From 037fea23d510e6e715fc5dd6b300b07bdf67e0cd Mon Sep 17 00:00:00 2001 From: PeterWeiWang <715533650@qq.com> Date: Tue, 8 Mar 2022 10:48:54 +0800 Subject: [PATCH 1/2] support for parallel queries - fix mtr test. --- include/sql_string.h | 3 +-- sql/item_func.cc | 5 ++--- sql/parse_tree_items.h | 2 ++ sql/pq_clone_item.cc | 25 ++++++++++++++++++------- sql/pq_condition.cc | 16 ++++++++-------- 5 files changed, 31 insertions(+), 20 deletions(-) diff --git a/include/sql_string.h b/include/sql_string.h index b4be536d1f44..a9cb41f2b614 100644 --- a/include/sql_string.h +++ b/include/sql_string.h @@ -70,11 +70,10 @@ extern PSI_memory_key key_memory_String_value; Don't add new members or virual methods into this class! */ class Simple_cstring { - private: + public: const char *m_str; size_t m_length; - public: /** Initialize from a C string whose length is already known. */ diff --git a/sql/item_func.cc b/sql/item_func.cc index 04215acfad21..936a55ea1125 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -6851,7 +6851,7 @@ bool Item_func_get_user_var::set_value(THD *thd, sp_rcontext * /*ctx*/, bool Item_func_get_user_var::pq_copy_from(THD *thd, Query_block *select, Item *item) { - if (Item_var_func::pq_copy_from(thd, select, this)) { + if (Item_var_func::pq_copy_from(thd, select, item)) { return true; } Item_func_get_user_var *orig_item = @@ -6863,9 +6863,8 @@ bool Item_func_get_user_var::pq_copy_from(THD *thd, Query_block *select, THD *entry_thd = thd->pq_leader; assert(entry_thd); mysql_mutex_lock(&entry_thd->LOCK_thd_data); - var_entry = get_variable(entry_thd, name, NULL); + var_entry = get_variable(entry_thd, name, nullptr); mysql_mutex_unlock(&entry_thd->LOCK_thd_data); - assert(var_entry && orig_item->var_entry); #endif if (orig_item != nullptr) { m_cached_result_type = orig_item->m_cached_result_type; diff --git a/sql/parse_tree_items.h b/sql/parse_tree_items.h index 03bdabf078fa..6632f22d0379 100644 --- a/sql/parse_tree_items.h +++ b/sql/parse_tree_items.h @@ -387,6 +387,8 @@ class PTI_user_variable final : public Item_func_get_user_var { PTI_user_variable(const POS &pos, const LEX_STRING &var) : super(pos, var) {} bool itemize(Parse_context *pc, Item **res) override; + + Item *pq_clone(THD *thd, Query_block *select) override; }; /** diff --git a/sql/pq_clone_item.cc b/sql/pq_clone_item.cc index 0aef4f5a043a..6782f00c09ee 100644 --- a/sql/pq_clone_item.cc +++ b/sql/pq_clone_item.cc @@ -690,13 +690,19 @@ COPY_FUNC_ITEM(Item_func_lt, ARG0, ARG1) COPY_FUNC_ITEM(Item_func_ne, ARG0, ARG1) PQ_CLONE_DEF(Item_func_like) { - Item *arg0 = args[0]->pq_clone(thd, select); - if (arg0 == nullptr) return nullptr; - - Item *arg1 = args[1]->pq_clone(thd, select); - if (arg1 == nullptr) return nullptr; - - new_item = new (thd->pq_mem_root) Item_func_like(arg0, arg1); + Item *arg[3]; + for (uint i = 0; i < arg_count; i++) { + arg[i] = args[i]->pq_clone(thd, select); + if (arg[i] == nullptr) return nullptr; + } + + if (arg_count == 2) { + new_item = new (thd->pq_mem_root) Item_func_like(arg[0], arg[1]); + } else if (arg_count == 3) { + new_item = new (thd->pq_mem_root) Item_func_like(arg[0], arg[1], arg[2]); + } else { + sql_print_warning("arg_count is wrong!"); + } } PQ_CLONE_RETURN @@ -1894,6 +1900,11 @@ PQ_CLONE_DEF(PTI_text_literal_underscore_charset) { } PQ_CLONE_RETURN +PQ_CLONE_DEF(PTI_user_variable) { + new_item = new (thd->pq_mem_root) PTI_user_variable(POS(), {const_cast(name.m_str), name.m_length}); +} +PQ_CLONE_RETURN + PQ_CLONE_DEF(Item_func_get_user_var) { new_item = new (thd->pq_mem_root) Item_func_get_user_var(POS(), name); } diff --git a/sql/pq_condition.cc b/sql/pq_condition.cc index a814d4426def..20578fc665e9 100644 --- a/sql/pq_condition.cc +++ b/sql/pq_condition.cc @@ -418,17 +418,13 @@ bool pq_create_result_fields(THD *thd, Temp_table_param *param, copy_func->reserve(copy_func_count); for (Item *item : fields) { - Field *new_field = nullptr; Item::Type type = item->type(); const bool is_sum_func = type == Item::SUM_FUNC_ITEM && !item->m_is_window_function; if (not_all_columns && item != nullptr) { if (item->has_aggregation() && type != Item::SUM_FUNC_ITEM) { - if (item->used_tables() & OUTER_REF_TABLE_BIT) { - item->update_used_tables(); - } - + if (item->is_outer_reference()) item->update_used_tables(); if (type == Item::SUBSELECT_ITEM || (item->used_tables() & ~OUTER_REF_TABLE_BIT)) { param->using_outer_summary_function = 1; @@ -449,14 +445,14 @@ bool pq_create_result_fields(THD *thd, Temp_table_param *param, goto update_hidden; } } - if (item->const_item() && (int)hidden_field_count <= 0) { - continue; // We don't have to store this - } + + if (item->const_item()) continue; } if (is_sum_func && !save_sum_fields) { /* Can't calc group yet */ } else { + Field *new_field = nullptr; if (param->schema_table) { new_field = item ? create_tmp_field_for_schema(item, &table, root) : nullptr; @@ -479,6 +475,8 @@ bool pq_create_result_fields(THD *thd, Temp_table_param *param, if (not_all_columns && type == Item::SUM_FUNC_ITEM) { ((Item_sum *)item)->result_field = new_field; } + + s.fields++; } update_hidden: @@ -487,6 +485,8 @@ bool pq_create_result_fields(THD *thd, Temp_table_param *param, } } // end of while ((item=li++)). + if (s.fields == 0) return true; + Field *result_field = nullptr; for (Item *item : fields) { From 2e2ad0c623099ad3815fd560c0c37ea0aca5622d Mon Sep 17 00:00:00 2001 From: PeterWeiWang <715533650@qq.com> Date: Tue, 8 Mar 2022 14:45:50 +0800 Subject: [PATCH 2/2] support for parallel queries - fix mtr test. --- mysql-test/r/compare.result-pq | 205 + mysql-test/r/ctype_gb18030.result-pq | 1751 ++++ mysql-test/r/ctype_uca.result-pq | 7610 +++++++++++++++++ mysql-test/r/ctype_unicode900.result-pq | 3889 +++++++++ mysql-test/r/ctype_unicode900_as_ci.result-pq | 1564 ++++ mysql-test/r/ctype_unicode900_as_cs.result-pq | 2078 +++++ mysql-test/r/ctype_utf16.result-pq | 1380 +++ mysql-test/r/ctype_utf16_uca.result-pq | 3597 ++++++++ mysql-test/r/ctype_utf16le.result-pq | 1631 ++++ mysql-test/r/ctype_utf32.result-pq | 1431 ++++ mysql-test/r/ctype_utf32_uca.result-pq | 3621 ++++++++ mysql-test/r/ctype_utf8mb4_innodb.result-pq | 2747 ++++++ mysql-test/r/func_default.result-pq | 3 +- mysql-test/r/func_group.result-pq | 2150 +++++ mysql-test/r/func_like.result-pq | 482 ++ mysql-test/r/func_prefix_key.result-pq | 943 ++ mysql-test/r/func_str.result-pq | 5312 ++++++++++++ mysql-test/r/group_by.result-pq | 3 +- mysql-test/r/hash_join.result-pq | 41 +- mysql-test/r/join.result-pq | 14 +- mysql-test/r/join_cache_nojb.result-pq | 16 +- mysql-test/r/join_outer.result-pq | 19 +- mysql-test/r/join_outer_bka.result-pq | 19 +- mysql-test/r/join_outer_bka_nobnl.result-pq | 19 +- mysql-test/r/metadata.result-pq | 454 + mysql-test/r/mysqld--help-notwin.result-pq | 1876 ++++ mysql-test/r/opt_hints.result-pq | 129 +- mysql-test/r/opt_hints_join_order.result-pq | 80 +- mysql-test/r/outfile.result-pq | Bin 0 -> 2457 bytes mysql-test/r/parser.result-pq | 3 +- mysql-test/r/select_all.result-pq | 5700 ++++++++++++ mysql-test/r/select_all_bka.result-pq | 5703 ++++++++++++ mysql-test/r/select_all_bka_nobnl.result-pq | 5703 ++++++++++++ mysql-test/r/select_icp_mrr.result-pq | 5700 ++++++++++++ mysql-test/r/select_icp_mrr_bka.result-pq | 5703 ++++++++++++ .../r/select_icp_mrr_bka_nobnl.result-pq | 5703 ++++++++++++ mysql-test/r/select_none.result-pq | 5699 ++++++++++++ mysql-test/r/select_none_bka.result-pq | 5701 ++++++++++++ mysql-test/r/select_none_bka_nobnl.result-pq | 5701 ++++++++++++ mysql-test/r/subquery_sj_firstmatch.result-pq | 5 +- .../r/subquery_sj_firstmatch_bka.result-pq | 5 +- ...subquery_sj_firstmatch_bka_nobnl.result-pq | 5 +- mysql-test/r/user_var.result-pq | 1087 +++ mysql-test/r/with_non_recursive.result-pq | 10 +- .../suite/opt_trace/r/charset.result-pq | 25 +- .../parts/r/partition_alter3_innodb.result-pq | 818 ++ 46 files changed, 96105 insertions(+), 230 deletions(-) create mode 100644 mysql-test/r/compare.result-pq create mode 100644 mysql-test/r/ctype_gb18030.result-pq create mode 100644 mysql-test/r/ctype_uca.result-pq create mode 100644 mysql-test/r/ctype_unicode900.result-pq create mode 100644 mysql-test/r/ctype_unicode900_as_ci.result-pq create mode 100644 mysql-test/r/ctype_unicode900_as_cs.result-pq create mode 100644 mysql-test/r/ctype_utf16.result-pq create mode 100644 mysql-test/r/ctype_utf16_uca.result-pq create mode 100644 mysql-test/r/ctype_utf16le.result-pq create mode 100644 mysql-test/r/ctype_utf32.result-pq create mode 100644 mysql-test/r/ctype_utf32_uca.result-pq create mode 100644 mysql-test/r/ctype_utf8mb4_innodb.result-pq create mode 100644 mysql-test/r/func_group.result-pq create mode 100644 mysql-test/r/func_like.result-pq create mode 100644 mysql-test/r/func_prefix_key.result-pq create mode 100644 mysql-test/r/func_str.result-pq create mode 100644 mysql-test/r/metadata.result-pq create mode 100644 mysql-test/r/mysqld--help-notwin.result-pq create mode 100644 mysql-test/r/outfile.result-pq create mode 100644 mysql-test/r/select_all.result-pq create mode 100644 mysql-test/r/select_all_bka.result-pq create mode 100644 mysql-test/r/select_all_bka_nobnl.result-pq create mode 100644 mysql-test/r/select_icp_mrr.result-pq create mode 100644 mysql-test/r/select_icp_mrr_bka.result-pq create mode 100644 mysql-test/r/select_icp_mrr_bka_nobnl.result-pq create mode 100644 mysql-test/r/select_none.result-pq create mode 100644 mysql-test/r/select_none_bka.result-pq create mode 100644 mysql-test/r/select_none_bka_nobnl.result-pq create mode 100644 mysql-test/r/user_var.result-pq create mode 100644 mysql-test/suite/parts/r/partition_alter3_innodb.result-pq diff --git a/mysql-test/r/compare.result-pq b/mysql-test/r/compare.result-pq new file mode 100644 index 000000000000..b3e01057243d --- /dev/null +++ b/mysql-test/r/compare.result-pq @@ -0,0 +1,205 @@ +drop table if exists t1; +CREATE TABLE t1 (id CHAR(12) not null, PRIMARY KEY (id)); +insert into t1 values ('000000000001'),('000000000002'); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +explain select * from t1 where id=000000000001; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index PRIMARY PRIMARY 48 NULL 2 50.00 Using where; Using index +Warnings: +Warning 1739 Cannot use ref access on index 'PRIMARY' due to type or collation conversion on field 'id' +Warning 1739 Cannot use range access on index 'PRIMARY' due to type or collation conversion on field 'id' +Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id` from `test`.`t1` where (`test`.`t1`.`id` = 1) +select * from t1 where id=000000000001; +id +000000000001 +delete from t1 where id=000000000002; +select * from t1; +id +000000000001 +drop table t1; +set names latin1; +SELECT 'a' = 'a '; +'a' = 'a ' +1 +SELECT 'a\0' < 'a'; +'a\0' < 'a' +1 +SELECT 'a\0' < 'a '; +'a\0' < 'a ' +1 +SELECT 'a\t' < 'a'; +'a\t' < 'a' +1 +SELECT 'a\t' < 'a '; +'a\t' < 'a ' +1 +CREATE TABLE t1 (a char(10) not null) charset latin1; +INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a '); +SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1; +hex(a) STRCMP(a,'a') STRCMP(a,'a ') +61 0 0 +6100 -1 -1 +6109 -1 -1 +61 0 0 +DROP TABLE t1; +set names default; +SELECT CHAR(31) = '', '' = CHAR(31); +CHAR(31) = '' '' = CHAR(31) +0 0 +SELECT CHAR(30) = '', '' = CHAR(30); +CHAR(30) = '' '' = CHAR(30) +0 0 +create table t1 (a tinyint(1),b binary(1)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (0x01,0x01); +select * from t1 where a=b; +a b +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: '\x01' +select * from t1 where a=b and b=0x01; +a b +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: '\x01' +drop table if exists t1; +CREATE TABLE t1 (b int(2) zerofill, c int(2) zerofill); +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 (b,c) VALUES (1,2), (1,1), (2,2); +SELECT CONCAT(b,c), CONCAT(b,c) = '0101' FROM t1; +CONCAT(b,c) CONCAT(b,c) = '0101' +0102 0 +0101 1 +0202 0 +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT b,c FROM t1 WHERE b = 1 AND CONCAT(b,c) = '0101'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL x 33.33 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL x 33.33 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where ((`test`.`t1`.`b` = 1) and (concat('01',`test`.`t1`.`c`) = '0101')) +SELECT b,c FROM t1 WHERE b = 1 AND CONCAT(b,c) = '0101'; +b c +01 01 +CREATE TABLE t2 (a int); +INSERT INTO t2 VALUES (1),(2); +SELECT a, +(SELECT COUNT(*) FROM t1 +WHERE b = t2.a AND CONCAT(b,c) = CONCAT('0',t2.a,'01')) x +FROM t2 ORDER BY a; +a x +1 1 +2 0 +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +EXPLAIN +SELECT a, +(SELECT COUNT(*) FROM t1 +WHERE b = t2.a AND CONCAT(b,c) = CONCAT('0',t2.a,'01')) x +FROM t2 ORDER BY a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 NULL ALL NULL NULL NULL NULL x 100.00 Using filesort +2 DEPENDENT SUBQUERY t1 NULL ALL NULL NULL NULL NULL x 33.33 Using where +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#1 */ select `test`.`t2`.`a` AS `a`,(/* select#2 */ 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; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1 (a TIMESTAMP); +INSERT INTO t1 VALUES (NOW()),(NOW()),(NOW()); +SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00'; +a +DROP TABLE t1; +SET sql_mode = default; +End of 5.0 tests +CREATE TABLE t1(a INT ZEROFILL); +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +SELECT 1 FROM t1 WHERE t1.a IN (1, t1.a) AND t1.a=2; +1 +DROP TABLE t1; + +Bug #27452148: ASSERTION FAILED: (SLEN % 4) == 0 IN +MY_STRNNCOLLSP_UTF32_BIN + +SET NAMES latin1; +CREATE TABLE t1(a CHAR(10) CHARACTER SET utf32 COLLATE utf32_bin); +INSERT INTO t1 VALUES('a'),('b'),('c'); +SELECT ROW('1', '1') > ROW(a, '1') FROM t1; +ROW('1', '1') > ROW(a, '1') +0 +0 +0 +SELECT ROW(a, '1') > ROW('1', '1') FROM t1; +ROW(a, '1') > ROW('1', '1') +1 +1 +1 +DROP TABLE t1; +SET NAMES default; +# +# Bug#30961924 AND OF TWO PREDICATES WITH DIFFERENT COLLATION ON SAME COLUMN GIVES WRONG RESULT +# +CREATE TABLE t1( +firstname CHAR(20), +lastname CHAR(20) +) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; +INSERT INTO t1 VALUES("john","doe"), ("John","Doe"); +SELECT * FROM t1 WHERE firstname = 'john'; +firstname lastname +john doe +John Doe +SELECT * FROM t1 WHERE firstname = 'john' COLLATE utf8mb4_0900_ai_ci; +firstname lastname +john doe +John Doe +SELECT * FROM t1 WHERE firstname = 'john' COLLATE utf8mb4_0900_as_cs; +firstname lastname +john doe +SELECT * FROM t1 +WHERE firstname = 'john' COLLATE utf8mb4_0900_ai_ci AND +firstname = 'john' COLLATE utf8mb4_0900_as_cs; +firstname lastname +john doe +SELECT * FROM t1 +WHERE firstname = 'john' COLLATE utf8mb4_0900_as_cs AND +firstname = 'john' COLLATE utf8mb4_0900_ai_ci; +firstname lastname +john doe +DROP TABLE t1; +Comparisons with parameters and extreme values +CREATE TABLE t(a DECIMAL(30,0)); +INSERT INTO t VALUES(0); +SELECT * FROM t; +a +0 +set @maxint=18446744073709551615; +SELECT @maxint; +@maxint +18446744073709551615 +SELECT * FROM t WHERE a < @maxint; +a +0 +SELECT * FROM t WHERE a < 18446744073709551615; +a +0 +SELECT * FROM t WHERE 0 < 18446744073709551615; +a +0 +SELECT * FROM t WHERE 0 < @maxint; +a +0 +DROP TABLE t; diff --git a/mysql-test/r/ctype_gb18030.result-pq b/mysql-test/r/ctype_gb18030.result-pq new file mode 100644 index 000000000000..94a82a76a618 --- /dev/null +++ b/mysql-test/r/ctype_gb18030.result-pq @@ -0,0 +1,1751 @@ +SET @test_character_set= 'gb18030'; +SET @test_collation= 'gb18030_chinese_ci'; +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET @safe_character_set_client= @@character_set_client; +SET @safe_character_set_results= @@character_set_results; +SET character_set_server= @test_character_set; +SET collation_server= @test_collation; +CREATE DATABASE d1; +USE d1; +CREATE TABLE t1 (c CHAR(10), KEY(c)); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c char(10) gb18030_chinese_ci YES MUL NULL +INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +want3results +aaa +aaaa +aaaaa +DROP TABLE t1; +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c1 varchar(15) gb18030_chinese_ci YES MUL NULL +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +want3results +location +loberge +lotre +SELECT c1 as want3results from t1 where c1 like 'lo%'; +want3results +location +loberge +lotre +SELECT c1 as want1result from t1 where c1 like 'loc%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'loca%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locat%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locati%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'location%'; +want1result +location +DROP TABLE t1; +create table t1 (a set('a') not null); +insert ignore into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +select 1 from t1 order by cast(a as char(1)); +1 +1 +1 +drop table t1; +set names utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +create table t1 ( +name varchar(10), +level smallint unsigned); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `name` varchar(10) DEFAULT NULL, + `level` smallint unsigned DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=gb18030 +insert into t1 values ('string',1); +select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; +concat(name,space(level)) concat(name, repeat(' ',level)) +string string +drop table t1; +DROP DATABASE d1; +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; +SET character_set_client= @safe_character_set_client; +SET character_set_results= @safe_character_set_results; +SET NAMES utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SET collation_connection='gb18030_chinese_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +gb18030_chinese_ci 6109 +gb18030_chinese_ci 61 +gb18030_chinese_ci 6120 +drop table t1; +create table t1 engine=innodb select repeat('a',50) as c1; +alter table t1 add index(c1(5)); +insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111'); +select collation(c1) from t1 limit 1; +collation(c1) +gb18030_chinese_ci +select c1 from t1 where c1 like 'abcdef%' order by c1; +c1 +abcdefg +select c1 from t1 where c1 like 'abcde1%' order by c1; +c1 +abcde100 +abcde110 +abcde111 +select c1 from t1 where c1 like 'abcde11%' order by c1; +c1 +abcde110 +abcde111 +select c1 from t1 where c1 like 'abcde111%' order by c1; +c1 +abcde111 +drop table t1; +select @@collation_connection; +@@collation_connection +gb18030_chinese_ci +create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ; +insert into t1 values('abcdef'); +insert into t1 values('_bcdef'); +insert into t1 values('a_cdef'); +insert into t1 values('ab_def'); +insert into t1 values('abc_ef'); +insert into t1 values('abcd_f'); +insert into t1 values('abcde_'); +select c1 as c1u from t1 where c1 like 'ab\_def'; +c1u +ab_def +select c1 as c2h from t1 where c1 like 'ab#_def' escape '#'; +c2h +ab_def +drop table t1; +CREATE TABLE t1 AS +SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d; +ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b); +INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5)); +INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10)); +INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11)); +INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12)); +SELECT hex(concat(repeat(0xF1F2, 10), '%')); +hex(concat(repeat(0xF1F2, 10), '%')) +F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225 +3 rows expected +SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%'); +a hex(b) c +2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL +3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL +4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL +DROP TABLE t1; +drop table if exists t1; +create table t1 select repeat('a',10) as c1; +delete from t1; +insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +SELECT GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM t1 GROUP BY c1; +GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) + 20 +! 21 +" 22 +# 23 +$ 24 +% 25 +& 26 +' 27 +( 28 +) 29 +* 2A ++ 2B +, 2C +- 2D +. 2E +/ 2F +0 30 +1 31 +2 32 +3 33 +4 34 +5 35 +6 36 +7 37 +8 38 +9 39 +: 3A +; 3B +< 3C += 3D +> 3E +? 3F +@ 40 +Aa 41,61 +Bb 42,62 +Cc 43,63 +Dd 44,64 +Ee 45,65 +Ff 46,66 +Gg 47,67 +Hh 48,68 +Ii 49,69 +Jj 4A,6A +Kk 4B,6B +Ll 4C,6C +Mm 4D,6D +Nn 4E,6E +Oo 4F,6F +Pp 50,70 +Qq 51,71 +Rr 52,72 +Ss 53,73 +Tt 54,74 +Uu 55,75 +Vv 56,76 +Ww 57,77 +Xx 58,78 +Yy 59,79 +Zz 5A,7A +[ 5B +\ 5C +] 5D +^ 5E +_ 5F +` 60 +{ 7B +| 7C +} 7D +~ 7E + 7F +drop table t1; +SET collation_connection='gb18030_bin'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +gb18030_bin 6109 +gb18030_bin 61 +gb18030_bin 6120 +drop table t1; +create table t1 engine=innodb select repeat('a',50) as c1; +alter table t1 add index(c1(5)); +insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111'); +select collation(c1) from t1 limit 1; +collation(c1) +gb18030_bin +select c1 from t1 where c1 like 'abcdef%' order by c1; +c1 +abcdefg +select c1 from t1 where c1 like 'abcde1%' order by c1; +c1 +abcde100 +abcde110 +abcde111 +select c1 from t1 where c1 like 'abcde11%' order by c1; +c1 +abcde110 +abcde111 +select c1 from t1 where c1 like 'abcde111%' order by c1; +c1 +abcde111 +drop table t1; +select @@collation_connection; +@@collation_connection +gb18030_bin +create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ; +insert into t1 values('abcdef'); +insert into t1 values('_bcdef'); +insert into t1 values('a_cdef'); +insert into t1 values('ab_def'); +insert into t1 values('abc_ef'); +insert into t1 values('abcd_f'); +insert into t1 values('abcde_'); +select c1 as c1u from t1 where c1 like 'ab\_def'; +c1u +ab_def +select c1 as c2h from t1 where c1 like 'ab#_def' escape '#'; +c2h +ab_def +drop table t1; +CREATE TABLE t1 AS +SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d; +ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b); +INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5)); +INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10)); +INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11)); +INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12)); +SELECT hex(concat(repeat(0xF1F2, 10), '%')); +hex(concat(repeat(0xF1F2, 10), '%')) +F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F225 +3 rows expected +SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%'); +a hex(b) c +2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL +3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL +4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL +DROP TABLE t1; +SELECT HEX(CONVERT(_gb18030 0xA14041 USING ucs2)); +HEX(CONVERT(_gb18030 0xA14041 USING ucs2)) +E4C60041 +SELECT HEX(CONVERT(_gb18030 0xA14041 USING utf8)); +HEX(CONVERT(_gb18030 0xA14041 USING utf8)) +EE938641 +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT HEX(CONVERT(_gb18030 0xFEFEFEFD814040 USING utf32)); +HEX(CONVERT(_gb18030 0xFEFEFEFD814040 USING utf32)) +0000E4C50000E4C400004E0200000040 +SELECT HEX(CONVERT(_gb18030 0x813081304041A140 USING utf32)); +HEX(CONVERT(_gb18030 0x813081304041A140 USING utf32)) +0000008000000040000000410000E4C6 +SELECT HEX(CONVERT(_gb18030 0xE3329A34 USING utf32)); +HEX(CONVERT(_gb18030 0xE3329A34 USING utf32)) +0010FFFE +SELECT HEX(CONVERT(_gb18030 0xE3329A35 USING utf32)); +HEX(CONVERT(_gb18030 0xE3329A35 USING utf32)) +0010FFFF +SELECT HEX(CONVERT(_gb18030 0xE3329A36 USING utf32)); +HEX(CONVERT(_gb18030 0xE3329A36 USING utf32)) +0000003F +SELECT HEX(CONVERT(_gb18030 0xFE39FE39 USING utf32)); +HEX(CONVERT(_gb18030 0xFE39FE39 USING utf32)) +0000003F +SELECT HEX(CONVERT(_ucs2 0xD800 USING gb18030)); +HEX(CONVERT(_ucs2 0xD800 USING gb18030)) +3F +SELECT HEX(CONVERT(_ucs2 0xDFFF USING gb18030)); +HEX(CONVERT(_ucs2 0xDFFF USING gb18030)) +3F +SELECT HEX(CONVERT(_ucs2 0xE000 USING gb18030)); +HEX(CONVERT(_ucs2 0xE000 USING gb18030)) +AAA1 +SELECT HEX(CONVERT(_ucs2 0xF8FF USING gb18030)); +HEX(CONVERT(_ucs2 0xF8FF USING gb18030)) +84308130 +SELECT HEX(CONVERT(_gb18030 0xA13941 USING ucs2)); +ERROR HY000: Invalid gb18030 character string: 'A13941' +SELECT HEX(CONVERT(_gb18030 0xFFFE USING ucs2)); +ERROR HY000: Invalid gb18030 character string: 'FFFE' +SELECT HEX(CONVERT(_gb18030 0x81308140 USING ucs2)); +ERROR HY000: Invalid gb18030 character string: '813081' +SELECT LOCATE(_gb18030 0x8140, _gb18030 0x814181408142); +LOCATE(_gb18030 0x8140, _gb18030 0x814181408142) +2 +SELECT HEX(REVERSE(_gb18030 0x8140814181428130813081308131FE39FE39)); +HEX(REVERSE(_gb18030 0x8140814181428130813081308131FE39FE39)) +FE39FE398130813181308130814281418140 +SELECT HEX(SUBSTRING(_gb18030 0x81308131813081328130813381308134, 1, 2)); +HEX(SUBSTRING(_gb18030 0x81308131813081328130813381308134, 1, 2)) +8130813181308132 +SELECT HEX(SUBSTRING(_gb18030 0x81308131813081328130813381308134, -3, 2)); +HEX(SUBSTRING(_gb18030 0x81308131813081328130813381308134, -3, 2)) +8130813281308133 +SELECT HEX(TRIM(_gb18030 0x20202081408141208144202020)); +HEX(TRIM(_gb18030 0x20202081408141208144202020)) +81408141208144 +CREATE TABLE t1 (c1 TEXT not null, c2 TEXT not null) CHARACTER SET gb18030; +ALTER TABLE t1 CHANGE c1 c1 MEDIUMTEXT CHARACTER SET gb18030 NOT NULL; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` mediumtext CHARACTER SET gb18030 COLLATE gb18030_chinese_ci NOT NULL, + `c2` text NOT NULL +) ENGINE=default_engine DEFAULT CHARSET=gb18030 +DROP TABLE t1; +CREATE TABLE t1(a MEDIUMTEXT CHARACTER SET gb18030, +b MEDIUMTEXT CHARACTER SET big5); +INSERT INTO t1 VALUES +(REPEAT(0x1125,200000), REPEAT(0x1125,200000)), ('', ''), ('', ''); +SELECT a FROM t1 GROUP BY 1 LIMIT 1 INTO @nullll; +SELECT b FROM t1 GROUP BY 1 LIMIT 1 INTO @nullll; +DROP TABLES t1; +SET NAMES utf8mb4; +SET collation_connection=gb18030_chinese_ci; +select @@collation_connection; +@@collation_connection +gb18030_chinese_ci +select hex(weight_string('a')); +hex(weight_string('a')) +41 +select hex(weight_string('A')); +hex(weight_string('A')) +41 +select hex(weight_string('abc')); +hex(weight_string('abc')) +414243 +select hex(weight_string('abc' as char(2))); +hex(weight_string('abc' as char(2))) +4142 +select hex(weight_string('abc' as char(3))); +hex(weight_string('abc' as char(3))) +414243 +select hex(weight_string('abc' as char(5))); +hex(weight_string('abc' as char(5))) +4142432020 +select hex(weight_string('abc', 1, 2, 0xC0)); +hex(weight_string('abc', 1, 2, 0xC0)) +41 +select hex(weight_string('abc', 2, 2, 0xC0)); +hex(weight_string('abc', 2, 2, 0xC0)) +4142 +select hex(weight_string('abc', 3, 2, 0xC0)); +hex(weight_string('abc', 3, 2, 0xC0)) +414220 +select hex(weight_string('abc', 4, 2, 0xC0)); +hex(weight_string('abc', 4, 2, 0xC0)) +41422020 +select hex(weight_string('abc', 5, 2, 0xC0)); +hex(weight_string('abc', 5, 2, 0xC0)) +4142202020 +select hex(weight_string('abc',25, 2, 0xC0)); +hex(weight_string('abc',25, 2, 0xC0)) +41422020202020202020202020202020202020202020202020 +select hex(weight_string('abc', 1, 3, 0xC0)); +hex(weight_string('abc', 1, 3, 0xC0)) +41 +select hex(weight_string('abc', 2, 3, 0xC0)); +hex(weight_string('abc', 2, 3, 0xC0)) +4142 +select hex(weight_string('abc', 3, 3, 0xC0)); +hex(weight_string('abc', 3, 3, 0xC0)) +414243 +select hex(weight_string('abc', 4, 3, 0xC0)); +hex(weight_string('abc', 4, 3, 0xC0)) +41424320 +select hex(weight_string('abc', 5, 3, 0xC0)); +hex(weight_string('abc', 5, 3, 0xC0)) +4142432020 +select hex(weight_string('abc',25, 3, 0xC0)); +hex(weight_string('abc',25, 3, 0xC0)) +41424320202020202020202020202020202020202020202020 +select hex(weight_string('abc', 1, 4, 0xC0)); +hex(weight_string('abc', 1, 4, 0xC0)) +41 +select hex(weight_string('abc', 2, 4, 0xC0)); +hex(weight_string('abc', 2, 4, 0xC0)) +4142 +select hex(weight_string('abc', 3, 4, 0xC0)); +hex(weight_string('abc', 3, 4, 0xC0)) +414243 +select hex(weight_string('abc', 4, 4, 0xC0)); +hex(weight_string('abc', 4, 4, 0xC0)) +41424320 +select hex(weight_string('abc', 5, 4, 0xC0)); +hex(weight_string('abc', 5, 4, 0xC0)) +4142432020 +select hex(weight_string('abc',25, 4, 0xC0)); +hex(weight_string('abc',25, 4, 0xC0)) +41424320202020202020202020202020202020202020202020 +select collation(cast(0xA1A1 as char)); +collation(cast(0xA1A1 as char)) +gb18030_chinese_ci +select hex(weight_string(cast(0x6141 as char))); +hex(weight_string(cast(0x6141 as char))) +4141 +select hex(weight_string(cast(0xA1A1 as char))); +hex(weight_string(cast(0xA1A1 as char))) +A1A1 +select hex(weight_string(cast(0xA1A1 as char) as char(1))); +hex(weight_string(cast(0xA1A1 as char) as char(1))) +A1A1 +select hex(weight_string(cast(0xA1A1A1A1 as char) as char(1))); +hex(weight_string(cast(0xA1A1A1A1 as char) as char(1))) +A1A1 +select hex(weight_string(cast(0xA1A1 as char) as char(3))); +hex(weight_string(cast(0xA1A1 as char) as char(3))) +A1A12020 +select hex(weight_string(cast(0xA1A1A1A1 as char) as char(3))); +hex(weight_string(cast(0xA1A1A1A1 as char) as char(3))) +A1A1A1A120 +select hex(weight_string(cast(0x40A1A1 as char) as char(3))); +hex(weight_string(cast(0x40A1A1 as char) as char(3))) +40A1A120 +select hex(weight_string(cast(0x40A1A1A1A1 as char) as char(3))); +hex(weight_string(cast(0x40A1A1A1A1 as char) as char(3))) +40A1A1A1A1 +select hex(weight_string(cast(0x40A1A1A1A1A1A1 as char) as char(3))); +hex(weight_string(cast(0x40A1A1A1A1A1A1 as char) as char(3))) +40A1A1A1A1 +select hex(weight_string(cast(0x4040A1A1A1A1A1A1 as char) as char(3))); +hex(weight_string(cast(0x4040A1A1A1A1A1A1 as char) as char(3))) +4040A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 2, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 2, 0xC0)) +A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 2, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 2, 0xC0)) +A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 2, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 2, 0xC0)) +A1A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 2, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 2, 0xC0)) +A1A1A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 2, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 2, 0xC0)) +A1A1A1A120 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 2, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 2, 0xC0)) +A1A1A1A1202020202020202020202020202020202020202020 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 3, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 3, 0xC0)) +A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 3, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 3, 0xC0)) +A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 3, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 3, 0xC0)) +A1A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 3, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 3, 0xC0)) +A1A1A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 3, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 3, 0xC0)) +A1A1A1A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 3, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 3, 0xC0)) +A1A1A1A1A1A120202020202020202020202020202020202020 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 4, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 4, 0xC0)) +A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 4, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 4, 0xC0)) +A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 4, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 4, 0xC0)) +A1A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 4, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 4, 0xC0)) +A1A1A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 4, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 4, 0xC0)) +A1A1A1A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 4, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 4, 0xC0)) +A1A1A1A1A1A120202020202020202020202020202020202020 +select collation(cast(0xA2A9 as char)); +collation(cast(0xA2A9 as char)) +gb18030_chinese_ci +select hex(weight_string(cast(0x6141 as char))); +hex(weight_string(cast(0x6141 as char))) +4141 +select hex(weight_string(cast(0xA2A9 as char))); +hex(weight_string(cast(0xA2A9 as char))) +A2F9 +select hex(weight_string(cast(0xA2A9 as char) as char(1))); +hex(weight_string(cast(0xA2A9 as char) as char(1))) +A2F9 +select hex(weight_string(cast(0xA2A9A2A9 as char) as char(1))); +hex(weight_string(cast(0xA2A9A2A9 as char) as char(1))) +A2F9 +select hex(weight_string(cast(0xA2A9 as char) as char(3))); +hex(weight_string(cast(0xA2A9 as char) as char(3))) +A2F92020 +select hex(weight_string(cast(0xA2A9A2A9 as char) as char(3))); +hex(weight_string(cast(0xA2A9A2A9 as char) as char(3))) +A2F9A2F920 +select hex(weight_string(cast(0x40A2A9 as char) as char(3))); +hex(weight_string(cast(0x40A2A9 as char) as char(3))) +40A2F920 +select hex(weight_string(cast(0x40A2A9A2A9 as char) as char(3))); +hex(weight_string(cast(0x40A2A9A2A9 as char) as char(3))) +40A2F9A2F9 +select hex(weight_string(cast(0x40A2A9A2A9A2A9 as char) as char(3))); +hex(weight_string(cast(0x40A2A9A2A9A2A9 as char) as char(3))) +40A2F9A2F9 +select hex(weight_string(cast(0x4040A2A9A2A9A2A9 as char) as char(3))); +hex(weight_string(cast(0x4040A2A9A2A9A2A9 as char) as char(3))) +4040A2F9 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 1, 2, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 1, 2, 0xC0)) +A2 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 2, 2, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 2, 2, 0xC0)) +A2F9 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 3, 2, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 3, 2, 0xC0)) +A2F9A2 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 4, 2, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 4, 2, 0xC0)) +A2F9A2F9 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 5, 2, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 5, 2, 0xC0)) +A2F9A2F920 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char),25, 2, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char),25, 2, 0xC0)) +A2F9A2F9202020202020202020202020202020202020202020 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 1, 3, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 1, 3, 0xC0)) +A2 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 2, 3, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 2, 3, 0xC0)) +A2F9 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 3, 3, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 3, 3, 0xC0)) +A2F9A2 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 4, 3, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 4, 3, 0xC0)) +A2F9A2F9 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 5, 3, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 5, 3, 0xC0)) +A2F9A2F9A2 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char),25, 3, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char),25, 3, 0xC0)) +A2F9A2F9A2F920202020202020202020202020202020202020 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 1, 4, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 1, 4, 0xC0)) +A2 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 2, 4, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 2, 4, 0xC0)) +A2F9 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 3, 4, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 3, 4, 0xC0)) +A2F9A2 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 4, 4, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 4, 4, 0xC0)) +A2F9A2F9 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 5, 4, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 5, 4, 0xC0)) +A2F9A2F9A2 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char),25, 4, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char),25, 4, 0xC0)) +A2F9A2F9A2F920202020202020202020202020202020202020 +SELECT collation(CAST(0x81309D30 AS CHAR)); +collation(CAST(0x81309D30 AS CHAR)) +gb18030_chinese_ci +SELECT HEX(WEIGHT_STRING(CAST(0x6141 AS CHAR))); +HEX(WEIGHT_STRING(CAST(0x6141 AS CHAR))) +4141 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D30 AS CHAR))); +HEX(WEIGHT_STRING(CAST(0x81309D30 AS CHAR))) +FF000117 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D30 AS CHAR) AS CHAR(1))); +HEX(WEIGHT_STRING(CAST(0x81309D30 AS CHAR) AS CHAR(1))) +FF000117 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D30 AS CHAR) AS CHAR(1))); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D30 AS CHAR) AS CHAR(1))) +FF000117 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D30 AS CHAR) AS CHAR(3))); +HEX(WEIGHT_STRING(CAST(0x81309D30 AS CHAR) AS CHAR(3))) +FF0001172020 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D30 AS CHAR) AS CHAR(3))); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D30 AS CHAR) AS CHAR(3))) +FF000117FF00011720 +SELECT HEX(WEIGHT_STRING(CAST(0x4081309D30 AS CHAR) AS CHAR(3))); +HEX(WEIGHT_STRING(CAST(0x4081309D30 AS CHAR) AS CHAR(3))) +40FF00011720 +SELECT HEX(WEIGHT_STRING(CAST(0x4081309D3081309D30 AS CHAR) AS CHAR(3))); +HEX(WEIGHT_STRING(CAST(0x4081309D3081309D30 AS CHAR) AS CHAR(3))) +40FF000117FF000117 +SELECT HEX(WEIGHT_STRING(CAST(0x4081309D3081309D3081309D30 AS CHAR) AS CHAR(3))); +HEX(WEIGHT_STRING(CAST(0x4081309D3081309D3081309D30 AS CHAR) AS CHAR(3))) +40FF000117FF000117 +SELECT HEX(WEIGHT_STRING(CAST(0x404081309D3081309D3081309D30 AS CHAR) AS CHAR(3))); +HEX(WEIGHT_STRING(CAST(0x404081309D3081309D3081309D30 AS CHAR) AS CHAR(3))) +4040FF000117 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 1, 2, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 1, 2, 0xC0)) +FF +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 2, 2, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 2, 2, 0xC0)) +FF00 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 3, 2, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 3, 2, 0xC0)) +FF0001 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 4, 2, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 4, 2, 0xC0)) +FF000117 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 5, 2, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 5, 2, 0xC0)) +FF000117FF +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 25, 2, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 25, 2, 0xC0)) +FF000117FF0001172020202020202020202020202020202020 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 1, 3, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 1, 3, 0xC0)) +FF +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 2, 3, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 2, 3, 0xC0)) +FF00 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 3, 3, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 3, 3, 0xC0)) +FF0001 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 4, 3, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 4, 3, 0xC0)) +FF000117 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 5, 3, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 5, 3, 0xC0)) +FF000117FF +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 25, 3, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 25, 3, 0xC0)) +FF000117FF000117FF00011720202020202020202020202020 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 1, 4, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 1, 4, 0xC0)) +FF +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 2, 4, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 2, 4, 0xC0)) +FF00 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 3, 4, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 3, 4, 0xC0)) +FF0001 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 4, 4, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 4, 4, 0xC0)) +FF000117 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 5, 4, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 5, 4, 0xC0)) +FF000117FF +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 25, 4, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 25, 4, 0xC0)) +FF000117FF000117FF00011720202020202020202020202020 +SET collation_connection=gb18030_bin; +select @@collation_connection; +@@collation_connection +gb18030_bin +select hex(weight_string('a')); +hex(weight_string('a')) +61 +select hex(weight_string('A')); +hex(weight_string('A')) +41 +select hex(weight_string('abc')); +hex(weight_string('abc')) +616263 +select hex(weight_string('abc' as char(2))); +hex(weight_string('abc' as char(2))) +6162 +select hex(weight_string('abc' as char(3))); +hex(weight_string('abc' as char(3))) +616263 +select hex(weight_string('abc' as char(5))); +hex(weight_string('abc' as char(5))) +6162632020 +select hex(weight_string('abc', 1, 2, 0xC0)); +hex(weight_string('abc', 1, 2, 0xC0)) +61 +select hex(weight_string('abc', 2, 2, 0xC0)); +hex(weight_string('abc', 2, 2, 0xC0)) +6162 +select hex(weight_string('abc', 3, 2, 0xC0)); +hex(weight_string('abc', 3, 2, 0xC0)) +616220 +select hex(weight_string('abc', 4, 2, 0xC0)); +hex(weight_string('abc', 4, 2, 0xC0)) +61622020 +select hex(weight_string('abc', 5, 2, 0xC0)); +hex(weight_string('abc', 5, 2, 0xC0)) +6162202020 +select hex(weight_string('abc',25, 2, 0xC0)); +hex(weight_string('abc',25, 2, 0xC0)) +61622020202020202020202020202020202020202020202020 +select hex(weight_string('abc', 1, 3, 0xC0)); +hex(weight_string('abc', 1, 3, 0xC0)) +61 +select hex(weight_string('abc', 2, 3, 0xC0)); +hex(weight_string('abc', 2, 3, 0xC0)) +6162 +select hex(weight_string('abc', 3, 3, 0xC0)); +hex(weight_string('abc', 3, 3, 0xC0)) +616263 +select hex(weight_string('abc', 4, 3, 0xC0)); +hex(weight_string('abc', 4, 3, 0xC0)) +61626320 +select hex(weight_string('abc', 5, 3, 0xC0)); +hex(weight_string('abc', 5, 3, 0xC0)) +6162632020 +select hex(weight_string('abc',25, 3, 0xC0)); +hex(weight_string('abc',25, 3, 0xC0)) +61626320202020202020202020202020202020202020202020 +select hex(weight_string('abc', 1, 4, 0xC0)); +hex(weight_string('abc', 1, 4, 0xC0)) +61 +select hex(weight_string('abc', 2, 4, 0xC0)); +hex(weight_string('abc', 2, 4, 0xC0)) +6162 +select hex(weight_string('abc', 3, 4, 0xC0)); +hex(weight_string('abc', 3, 4, 0xC0)) +616263 +select hex(weight_string('abc', 4, 4, 0xC0)); +hex(weight_string('abc', 4, 4, 0xC0)) +61626320 +select hex(weight_string('abc', 5, 4, 0xC0)); +hex(weight_string('abc', 5, 4, 0xC0)) +6162632020 +select hex(weight_string('abc',25, 4, 0xC0)); +hex(weight_string('abc',25, 4, 0xC0)) +61626320202020202020202020202020202020202020202020 +select collation(cast(0xA1A1 as char)); +collation(cast(0xA1A1 as char)) +gb18030_bin +select hex(weight_string(cast(0x6141 as char))); +hex(weight_string(cast(0x6141 as char))) +6141 +select hex(weight_string(cast(0xA1A1 as char))); +hex(weight_string(cast(0xA1A1 as char))) +A1A1 +select hex(weight_string(cast(0xA1A1 as char) as char(1))); +hex(weight_string(cast(0xA1A1 as char) as char(1))) +A1A1 +select hex(weight_string(cast(0xA1A1A1A1 as char) as char(1))); +hex(weight_string(cast(0xA1A1A1A1 as char) as char(1))) +A1A1 +select hex(weight_string(cast(0xA1A1 as char) as char(3))); +hex(weight_string(cast(0xA1A1 as char) as char(3))) +A1A12020 +select hex(weight_string(cast(0xA1A1A1A1 as char) as char(3))); +hex(weight_string(cast(0xA1A1A1A1 as char) as char(3))) +A1A1A1A120 +select hex(weight_string(cast(0x40A1A1 as char) as char(3))); +hex(weight_string(cast(0x40A1A1 as char) as char(3))) +40A1A120 +select hex(weight_string(cast(0x40A1A1A1A1 as char) as char(3))); +hex(weight_string(cast(0x40A1A1A1A1 as char) as char(3))) +40A1A1A1A1 +select hex(weight_string(cast(0x40A1A1A1A1A1A1 as char) as char(3))); +hex(weight_string(cast(0x40A1A1A1A1A1A1 as char) as char(3))) +40A1A1A1A1 +select hex(weight_string(cast(0x4040A1A1A1A1A1A1 as char) as char(3))); +hex(weight_string(cast(0x4040A1A1A1A1A1A1 as char) as char(3))) +4040A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 2, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 2, 0xC0)) +A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 2, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 2, 0xC0)) +A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 2, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 2, 0xC0)) +A1A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 2, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 2, 0xC0)) +A1A1A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 2, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 2, 0xC0)) +A1A1A1A120 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 2, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 2, 0xC0)) +A1A1A1A1202020202020202020202020202020202020202020 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 3, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 3, 0xC0)) +A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 3, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 3, 0xC0)) +A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 3, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 3, 0xC0)) +A1A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 3, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 3, 0xC0)) +A1A1A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 3, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 3, 0xC0)) +A1A1A1A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 3, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 3, 0xC0)) +A1A1A1A1A1A120202020202020202020202020202020202020 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 4, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 1, 4, 0xC0)) +A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 4, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 2, 4, 0xC0)) +A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 4, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 3, 4, 0xC0)) +A1A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 4, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 4, 4, 0xC0)) +A1A1A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 4, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char), 5, 4, 0xC0)) +A1A1A1A1A1 +select hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 4, 0xC0)); +hex(weight_string(cast(0xA1A1A1A1A1A1 as char),25, 4, 0xC0)) +A1A1A1A1A1A120202020202020202020202020202020202020 +select collation(cast(0xA2A9 as char)); +collation(cast(0xA2A9 as char)) +gb18030_bin +select hex(weight_string(cast(0x6141 as char))); +hex(weight_string(cast(0x6141 as char))) +6141 +select hex(weight_string(cast(0xA2A9 as char))); +hex(weight_string(cast(0xA2A9 as char))) +A2A9 +select hex(weight_string(cast(0xA2A9 as char) as char(1))); +hex(weight_string(cast(0xA2A9 as char) as char(1))) +A2A9 +select hex(weight_string(cast(0xA2A9A2A9 as char) as char(1))); +hex(weight_string(cast(0xA2A9A2A9 as char) as char(1))) +A2A9 +select hex(weight_string(cast(0xA2A9 as char) as char(3))); +hex(weight_string(cast(0xA2A9 as char) as char(3))) +A2A92020 +select hex(weight_string(cast(0xA2A9A2A9 as char) as char(3))); +hex(weight_string(cast(0xA2A9A2A9 as char) as char(3))) +A2A9A2A920 +select hex(weight_string(cast(0x40A2A9 as char) as char(3))); +hex(weight_string(cast(0x40A2A9 as char) as char(3))) +40A2A920 +select hex(weight_string(cast(0x40A2A9A2A9 as char) as char(3))); +hex(weight_string(cast(0x40A2A9A2A9 as char) as char(3))) +40A2A9A2A9 +select hex(weight_string(cast(0x40A2A9A2A9A2A9 as char) as char(3))); +hex(weight_string(cast(0x40A2A9A2A9A2A9 as char) as char(3))) +40A2A9A2A9 +select hex(weight_string(cast(0x4040A2A9A2A9A2A9 as char) as char(3))); +hex(weight_string(cast(0x4040A2A9A2A9A2A9 as char) as char(3))) +4040A2A9 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 1, 2, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 1, 2, 0xC0)) +A2 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 2, 2, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 2, 2, 0xC0)) +A2A9 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 3, 2, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 3, 2, 0xC0)) +A2A9A2 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 4, 2, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 4, 2, 0xC0)) +A2A9A2A9 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 5, 2, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 5, 2, 0xC0)) +A2A9A2A920 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char),25, 2, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char),25, 2, 0xC0)) +A2A9A2A9202020202020202020202020202020202020202020 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 1, 3, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 1, 3, 0xC0)) +A2 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 2, 3, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 2, 3, 0xC0)) +A2A9 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 3, 3, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 3, 3, 0xC0)) +A2A9A2 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 4, 3, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 4, 3, 0xC0)) +A2A9A2A9 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 5, 3, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 5, 3, 0xC0)) +A2A9A2A9A2 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char),25, 3, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char),25, 3, 0xC0)) +A2A9A2A9A2A920202020202020202020202020202020202020 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 1, 4, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 1, 4, 0xC0)) +A2 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 2, 4, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 2, 4, 0xC0)) +A2A9 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 3, 4, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 3, 4, 0xC0)) +A2A9A2 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 4, 4, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 4, 4, 0xC0)) +A2A9A2A9 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 5, 4, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 5, 4, 0xC0)) +A2A9A2A9A2 +select hex(weight_string(cast(0xA2A9A2A9A2A9 as char),25, 4, 0xC0)); +hex(weight_string(cast(0xA2A9A2A9A2A9 as char),25, 4, 0xC0)) +A2A9A2A9A2A920202020202020202020202020202020202020 +SELECT collation(CAST(0x81309D30 AS CHAR)); +collation(CAST(0x81309D30 AS CHAR)) +gb18030_bin +SELECT HEX(WEIGHT_STRING(CAST(0x6141 AS CHAR))); +HEX(WEIGHT_STRING(CAST(0x6141 AS CHAR))) +6141 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D30 AS CHAR))); +HEX(WEIGHT_STRING(CAST(0x81309D30 AS CHAR))) +81309D30 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D30 AS CHAR) AS CHAR(1))); +HEX(WEIGHT_STRING(CAST(0x81309D30 AS CHAR) AS CHAR(1))) +81309D30 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D30 AS CHAR) AS CHAR(1))); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D30 AS CHAR) AS CHAR(1))) +81309D30 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D30 AS CHAR) AS CHAR(3))); +HEX(WEIGHT_STRING(CAST(0x81309D30 AS CHAR) AS CHAR(3))) +81309D302020 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D30 AS CHAR) AS CHAR(3))); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D30 AS CHAR) AS CHAR(3))) +81309D3081309D3020 +SELECT HEX(WEIGHT_STRING(CAST(0x4081309D30 AS CHAR) AS CHAR(3))); +HEX(WEIGHT_STRING(CAST(0x4081309D30 AS CHAR) AS CHAR(3))) +4081309D3020 +SELECT HEX(WEIGHT_STRING(CAST(0x4081309D3081309D30 AS CHAR) AS CHAR(3))); +HEX(WEIGHT_STRING(CAST(0x4081309D3081309D30 AS CHAR) AS CHAR(3))) +4081309D3081309D30 +SELECT HEX(WEIGHT_STRING(CAST(0x4081309D3081309D3081309D30 AS CHAR) AS CHAR(3))); +HEX(WEIGHT_STRING(CAST(0x4081309D3081309D3081309D30 AS CHAR) AS CHAR(3))) +4081309D3081309D30 +SELECT HEX(WEIGHT_STRING(CAST(0x404081309D3081309D3081309D30 AS CHAR) AS CHAR(3))); +HEX(WEIGHT_STRING(CAST(0x404081309D3081309D3081309D30 AS CHAR) AS CHAR(3))) +404081309D30 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 1, 2, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 1, 2, 0xC0)) +81 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 2, 2, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 2, 2, 0xC0)) +8130 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 3, 2, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 3, 2, 0xC0)) +81309D +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 4, 2, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 4, 2, 0xC0)) +81309D30 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 5, 2, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 5, 2, 0xC0)) +81309D3081 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 25, 2, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 25, 2, 0xC0)) +81309D3081309D302020202020202020202020202020202020 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 1, 3, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 1, 3, 0xC0)) +81 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 2, 3, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 2, 3, 0xC0)) +8130 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 3, 3, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 3, 3, 0xC0)) +81309D +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 4, 3, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 4, 3, 0xC0)) +81309D30 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 5, 3, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 5, 3, 0xC0)) +81309D3081 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 25, 3, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 25, 3, 0xC0)) +81309D3081309D3081309D3020202020202020202020202020 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 1, 4, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 1, 4, 0xC0)) +81 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 2, 4, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 2, 4, 0xC0)) +8130 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 3, 4, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 3, 4, 0xC0)) +81309D +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 4, 4, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 4, 4, 0xC0)) +81309D30 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 5, 4, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 5, 4, 0xC0)) +81309D3081 +SELECT HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 25, 4, 0xC0)); +HEX(WEIGHT_STRING(CAST(0x81309D3081309D3081309D30 AS CHAR), 25, 4, 0xC0)) +81309D3081309D3081309D3020202020202020202020202020 +# +# Bugs#12635232: VALGRIND WARNINGS: IS_IPV6, IS_IPV4, INET6_ATON, +# INETTO_NTOA + MULTIBYTE CHARSET. +# +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +SELECT is_ipv4(inet_ntoa('1')); +is_ipv4(inet_ntoa('1')) +1 +SELECT is_ipv6(inet_ntoa('1')); +is_ipv6(inet_ntoa('1')) +0 +SELECT inet6_aton(inet_ntoa('1')); +inet6_aton(inet_ntoa('1')) + +SELECT inet6_ntoa(inet_ntoa('1')); +inet6_ntoa(inet_ntoa('1')) +NULL +# +# Bug#14040277 UNINITIALIZED VALUE REFERENCED IN STR_TO_IPV6 +# +SELECT inet6_aton(soundex('a')); +inet6_aton(soundex('a')) +NULL +# +# Bug#19047425 UNINITIALISED VALUE IN STR_TO_IPV6 +# +do is_ipv4_mapped(inet6_aton(convert(_ascii "a:" using utf8mb4))); +# +# Test for gb18030_unicode_520_ci collation. +# +SET NAMES utf8mb4; +SET collation_connection=gb18030_unicode_520_ci; +CREATE TABLE t1 AS SELECT repeat('a', 10) as c LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` varchar(10) CHARACTER SET gb18030 COLLATE gb18030_unicode_520_ci NOT NULL DEFAULT '' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +INSERT INTO t1 VALUES (_utf32 0x0180),(_utf32 0x023A); +INSERT INTO t1 VALUES (_utf32 0x023B),(_utf32 0x023C); +INSERT INTO t1 VALUES (_utf32 0x023D),(_utf32 0x023E); +INSERT INTO t1 VALUES (_utf32 0x0241),(_utf32 0x0242); +INSERT INTO t1 VALUES (_utf32 0x0243),(_utf32 0x0244); +INSERT INTO t1 VALUES (_utf32 0x0245),(_utf32 0x0246); +INSERT INTO t1 VALUES (_utf32 0x0247),(_utf32 0x0248); +INSERT INTO t1 VALUES (_utf32 0x0249),(_utf32 0x024A); +INSERT INTO t1 VALUES (_utf32 0x024B),(_utf32 0x024C); +INSERT INTO t1 VALUES (_utf32 0x024D),(_utf32 0x024E); +INSERT INTO t1 VALUES (_utf32 0x024F),(_utf32 0x026B); +INSERT INTO t1 VALUES (_utf32 0x027D),(_utf32 0x0289); +INSERT INTO t1 VALUES (_utf32 0x028C); +INSERT INTO t1 VALUES (_utf32 0x037B), (_utf32 0x037C); +INSERT INTO t1 VALUES (_utf32 0x037D), (_utf32 0x03FD); +INSERT INTO t1 VALUES (_utf32 0x03FE), (_utf32 0x03FF); +INSERT INTO t1 VALUES (_utf32 0x04C0), (_utf32 0x04CF); +INSERT INTO t1 VALUES (_utf32 0x04F6), (_utf32 0x04F7); +INSERT INTO t1 VALUES (_utf32 0x04FA), (_utf32 0x04FB); +INSERT INTO t1 VALUES (_utf32 0x04FC), (_utf32 0x04FD); +INSERT INTO t1 VALUES (_utf32 0x04FE), (_utf32 0x04FF); +INSERT INTO t1 VALUES (_utf32 0x0510), (_utf32 0x0511); +INSERT INTO t1 VALUES (_utf32 0x0512), (_utf32 0x0513); +INSERT INTO t1 VALUES (_utf32 0x10A0), (_utf32 0x10A1); +INSERT INTO t1 VALUES (_utf32 0x10A2), (_utf32 0x10A3); +INSERT INTO t1 VALUES (_utf32 0x10A4), (_utf32 0x10A5); +INSERT INTO t1 VALUES (_utf32 0x10A6), (_utf32 0x10A7); +INSERT INTO t1 VALUES (_utf32 0x2D00), (_utf32 0x2D01); +INSERT INTO t1 VALUES (_utf32 0x2D02), (_utf32 0x2D03); +INSERT INTO t1 VALUES (_utf32 0x2D04), (_utf32 0x2D05); +INSERT INTO t1 VALUES (_utf32 0x2D06), (_utf32 0x2D07); +INSERT INTO t1 VALUES (_utf32 0x1D7D); +INSERT INTO t1 VALUES (_utf32 0x2132),(_utf32 0x214E); +INSERT INTO t1 VALUES (_utf32 0x2183),(_utf32 0x2184); +INSERT INTO t1 VALUES (_utf32 0x2C80), (_utf32 0x2C81); +INSERT INTO t1 VALUES (_utf32 0x2C82), (_utf32 0x2C83); +INSERT INTO t1 VALUES (_utf32 0x2C84), (_utf32 0x2C85); +INSERT INTO t1 VALUES (_utf32 0x2C86), (_utf32 0x2C87); +INSERT INTO t1 VALUES (_utf32 0x2C88), (_utf32 0x2C89); +INSERT INTO t1 VALUES (_utf32 0x2C8A), (_utf32 0x2C8B); +INSERT INTO t1 VALUES (_utf32 0x2C8C), (_utf32 0x2C8D); +INSERT INTO t1 VALUES (_utf32 0x2C8E), (_utf32 0x2C8F); +INSERT INTO t1 VALUES (_utf32 0x2C60), (_utf32 0x2C61); +INSERT INTO t1 VALUES (_utf32 0x2C62), (_utf32 0x2C63); +INSERT INTO t1 VALUES (_utf32 0x2C64), (_utf32 0x2C65); +INSERT INTO t1 VALUES (_utf32 0x2C66), (_utf32 0x2C67); +INSERT INTO t1 VALUES (_utf32 0x2C68), (_utf32 0x2C69); +INSERT INTO t1 VALUES (_utf32 0x2C6A), (_utf32 0x2C6B); +INSERT INTO t1 VALUES (_utf32 0x2C6C), (_utf32 0x2C75); +INSERT INTO t1 VALUES (_utf32 0x2C76); +INSERT INTO t1 VALUES (_utf32 0x2C00), (_utf32 0x2C01); +INSERT INTO t1 VALUES (_utf32 0x2C02), (_utf32 0x2C03); +INSERT INTO t1 VALUES (_utf32 0x2C04), (_utf32 0x2C05); +INSERT INTO t1 VALUES (_utf32 0x2C06), (_utf32 0x2C07); +INSERT INTO t1 VALUES (_utf32 0x2C30), (_utf32 0x2C31); +INSERT INTO t1 VALUES (_utf32 0x2C32), (_utf32 0x2C33); +INSERT INTO t1 VALUES (_utf32 0x2C34), (_utf32 0x2C35); +INSERT INTO t1 VALUES (_utf32 0x2C36), (_utf32 0x2C37); +INSERT INTO t1 VALUES (_utf32 0x10400), (_utf32 0x10401); +INSERT INTO t1 VALUES (_utf32 0x10402), (_utf32 0x10403); +INSERT INTO t1 VALUES (_utf32 0x10404), (_utf32 0x10405); +INSERT INTO t1 VALUES (_utf32 0x10406), (_utf32 0x10407); +INSERT INTO t1 VALUES (_utf32 0x10428), (_utf32 0x10429); +INSERT INTO t1 VALUES (_utf32 0x1042A), (_utf32 0x1042B); +INSERT INTO t1 VALUES (_utf32 0x1042C), (_utf32 0x1042D); +INSERT INTO t1 VALUES (_utf32 0x1042E), (_utf32 0x1042F); +INSERT INTO t1 VALUES (_utf32 0x0370); +INSERT INTO t1 VALUES (_utf32 0x0371); +INSERT INTO t1 VALUES (_utf32 0x0372); +INSERT INTO t1 VALUES (_utf32 0x0373); +INSERT INTO t1 VALUES (_utf32 0x0514); +INSERT INTO t1 VALUES (_utf32 0x0515); +INSERT INTO t1 VALUES (_utf32 0x0516); +INSERT INTO t1 VALUES (_utf32 0x0517); +INSERT INTO t1 VALUES (_utf32 0xA640); +INSERT INTO t1 VALUES (_utf32 0xA641); +INSERT INTO t1 VALUES (_utf32 0xA642); +INSERT INTO t1 VALUES (_utf32 0xA643); +INSERT INTO t1 VALUES (_utf32 0xA722); +INSERT INTO t1 VALUES (_utf32 0xA723); +INSERT INTO t1 VALUES (_utf32 0xA724); +INSERT INTO t1 VALUES (_utf32 0xA725); +INSERT INTO t1 VALUES (_utf32 0xA726); +INSERT INTO t1 VALUES (_utf32 0xA727); +INSERT INTO t1 VALUES (_utf32 0xA728); +INSERT INTO t1 VALUES (_utf32 0xA729); +INSERT INTO t1 VALUES (_utf32 0xA72A); +INSERT INTO t1 VALUES (_utf32 0xA72B); +INSERT INTO t1 VALUES (_utf32 0x2CEB); +INSERT INTO t1 VALUES (_utf32 0x2CEC); +INSERT INTO t1 VALUES (_utf32 0x2CED); +INSERT INTO t1 VALUES (_utf32 0x2CEE); +SELECT hex(c), hex(lower(c)), hex(upper(c)), hex(weight_string(c)), c +FROM t1 ORDER BY c, BINARY c; +hex(c) hex(lower(c)) hex(upper(c)) hex(weight_string(c)) c +8130A935 8138C739 8130A935 1214 Ⱥ +8138C739 8138C739 8130A935 1214 ⱥ +81309738 81309738 8130AA34 122D ƀ +8130AA34 81309738 8130AA34 122D Ƀ +8130A936 8130A937 8130A936 1242 Ȼ +8130A937 8130A937 8130A936 1242 ȼ +8136C539 8136C630 8136C539 124E Ↄ +8136C630 8136C630 8136C539 124E ↄ +8130AA37 8130AA38 8130AA37 1270 Ɇ +8130AA38 8130AA38 8130AA37 1270 ɇ +8136C030 8136C238 8136C030 12AE Ⅎ +8136C238 8136C238 8136C030 12AE ⅎ +8138C831 8138C832 8138C831 12E3 Ⱨ +8138C832 8138C832 8138C831 12E3 ⱨ +8138C935 8138C936 8138C935 12E4 Ⱶ +8138C936 8138C936 8138C935 12E4 ⱶ +8236D133 8236D134 8236D133 12E5 Ꜧ +8236D134 8236D134 8236D133 12E5 ꜧ +8130AA39 8130AB30 8130AA39 130E Ɉ +8130AB30 8130AB30 8130AA39 130E ɉ +8138C833 8138C834 8138C833 1328 Ⱪ +8138C834 8138C834 8138C833 1328 ⱪ +8130A938 81309A34 8130A938 133B Ƚ +8138C734 8138C735 8138C734 133F Ⱡ +8138C735 8138C735 8138C734 133F ⱡ +8130AE32 8130AE32 8138C736 1340 ɫ +8138C736 8130AE32 8138C736 1340 Ɫ +8135E133 8135E133 8138C737 13B8 ᵽ +8138C737 8135E133 8138C737 13B8 Ᵽ +8130AB31 8130AB32 8130AB31 13D2 Ɋ +8130AB32 8130AB32 8130AB31 13D2 ɋ +8130AB33 8130AB34 8130AB33 13E4 Ɍ +8130AB34 8130AB34 8130AB33 13E4 ɍ +8130B030 8130B030 8138C738 13FC ɽ +8138C738 8130B030 8138C738 13FC Ɽ +8236D135 8236D136 8236D135 143314AD Ꜩ +8236D136 8236D136 8236D135 143314AD ꜩ +8130A939 8138C830 8130A939 143C Ⱦ +8138C830 8138C830 8130A939 143C ⱦ +8130AA35 8130B132 8130AA35 145B Ʉ +8130B132 8130B132 8130AA35 145B ʉ +8130AA36 8130B135 8130AA36 1489 Ʌ +8130B135 8130B135 8130AA36 1489 ʌ +8130AB35 8130AB36 8130AB35 14A4 Ɏ +8130AB36 8130AB36 8130AB35 14A4 ɏ +8138C835 8138C836 8138C835 14C8 Ⱬ +8138C836 8138C836 8138C835 14C8 ⱬ +8236D137 8236D138 8236D137 14F3 Ꜫ +8236D138 8236D138 8236D137 14F3 ꜫ +8130AA32 8130AA33 8130AA32 1506 Ɂ +8130AA33 8130AA33 8130AA32 1506 ɂ +8236D039 8236D130 8236D039 150E Ꜣ +8236D130 8236D130 8236D039 150E ꜣ +8236D131 8236D132 8236D131 1518 Ꜥ +8236D132 8236D132 8236D131 1518 ꜥ +8130C738 8130C739 8130C738 154F Ͱ +8130C739 8130C739 8130C738 154F ͱ +8130C930 8130C930 8130D132 1564 ͼ +8130D132 8130C930 8130D132 1564 Ͼ +8130C839 8130C839 8130D131 1565 ͻ +8130D131 8130C839 8130D131 1565 Ͻ +8130C931 8130C931 8130D133 1566 ͽ +8130D133 8130C931 8130D133 1566 Ͽ +8130C830 8130C831 8130C830 156F Ͳ +8130C831 8130C831 8130C830 156F ͳ +8138CA36 8138CA37 8138CA36 1571 Ⲁ +8138CA37 8138CA37 8138CA36 1571 ⲁ +8138CA38 8138CA39 8138CA38 1572 Ⲃ +8138CA39 8138CA39 8138CA38 1572 ⲃ +8138CB30 8138CB31 8138CB30 1573 Ⲅ +8138CB31 8138CB31 8138CB30 1573 ⲅ +8138CB32 8138CB33 8138CB32 1574 Ⲇ +8138CB33 8138CB33 8138CB32 1574 ⲇ +8138CB34 8138CB35 8138CB34 1575 Ⲉ +8138CB35 8138CB35 8138CB34 1575 ⲉ +8138CB36 8138CB37 8138CB36 1577 Ⲋ +8138CB37 8138CB37 8138CB36 1577 ⲋ +8138CB38 8138CB39 8138CB38 1578 Ⲍ +8138CB39 8138CB39 8138CB38 1578 ⲍ +8138CC30 8138CC31 8138CC30 1579 Ⲏ +8138CC31 8138CC31 8138CC30 1579 ⲏ +8138D533 8138D534 8138D533 1591 Ⳬ +8138D534 8138D534 8138D533 1591 ⳬ +8138D535 8138D536 8138D535 15A0 Ⳮ +8138D536 8138D536 8138D535 15A0 ⳮ +8130E338 8130E339 8130E338 15D4 Ӻ +8130E339 8130E339 8130E338 15D4 ӻ +8130E334 8130E335 8130E334 15DC Ӷ +8130E335 8130E335 8130E334 15DC ӷ +8236BA33 8236BA34 8236BA33 1611 Ꙁ +8236BA34 8236BA34 8236BA33 1611 ꙁ +8130E630 8130E631 8130E630 1613 Ԑ +8130E631 8130E631 8130E630 1613 ԑ +8236BA35 8236BA36 8236BA35 1618 Ꙃ +8236BA36 8236BA36 8236BA35 1618 ꙃ +8130E632 8130E633 8130E632 1666 Ԓ +8130E633 8130E633 8130E632 1666 ԓ +8130E634 8130E635 8130E634 166E Ԕ +8130E635 8130E635 8130E634 166E ԕ +8130E636 8130E637 8130E636 16B7 Ԗ +8130E637 8130E637 8130E636 16B7 ԗ +8130E430 8130E431 8130E430 16F9 Ӽ +8130E431 8130E431 8130E430 16F9 ӽ +8130E432 8130E433 8130E432 16FD Ӿ +8130E433 8130E433 8130E432 16FD ӿ +8130DE30 8130DF35 8130DE30 17B1 Ӏ +8130DF35 8130DF35 8130DE30 17B1 ӏ +8138BD38 8138C236 8138BD38 17B5 Ⰰ +8138C236 8138C236 8138BD38 17B5 ⰰ +8138BD39 8138C237 8138BD39 17B6 Ⰱ +8138C237 8138C237 8138BD39 17B6 ⰱ +8138BE30 8138C238 8138BE30 17B7 Ⰲ +8138C238 8138C238 8138BE30 17B7 ⰲ +8138BE31 8138C239 8138BE31 17B8 Ⰳ +8138C239 8138C239 8138BE31 17B8 ⰳ +8138BE32 8138C330 8138BE32 17B9 Ⰴ +8138C330 8138C330 8138BE32 17B9 ⰴ +8138BE33 8138C331 8138BE33 17BA Ⰵ +8138C331 8138C331 8138BE33 17BA ⰵ +8138BE34 8138C332 8138BE34 17BB Ⰶ +8138C332 8138C332 8138BE34 17BB ⰶ +8138BE35 8138C333 8138BE35 17BC Ⰷ +8138C333 8138C333 8138BE35 17BC ⰷ +81339430 8138D734 81339430 17E5 Ⴀ +8138D734 8138D734 81339430 17E5 ⴀ +81339431 8138D735 81339431 17E7 Ⴁ +8138D735 8138D735 81339431 17E7 ⴁ +81339432 8138D736 81339432 17E9 Ⴂ +8138D736 8138D736 81339432 17E9 ⴂ +81339433 8138D737 81339433 17EB Ⴃ +8138D737 8138D737 81339433 17EB ⴃ +81339434 8138D738 81339434 17ED Ⴄ +8138D738 8138D738 81339434 17ED ⴄ +81339435 8138D739 81339435 17EF Ⴅ +8138D739 8138D739 81339435 17EF ⴅ +81339436 8138D830 81339436 17F1 Ⴆ +8138D830 8138D830 81339436 17F1 ⴆ +81339437 8138D831 81339437 17F5 Ⴇ +8138D831 8138D831 81339437 17F5 ⴇ +9030E734 8130D239 8130D134 30D2 𐐀 +9030EB34 A7EA A7BA 30D2 𐐨 +9030E735 A7D7 A7A7 30D3 𐐁 +9030EB35 A7EB A7BB 30D3 𐐩 +9030E736 8130D330 8130D135 30D4 𐐂 +9030EB36 A7EC A7BC 30D4 𐐪 +9030E737 8130D331 8130D136 30D5 𐐃 +9030EB37 A7ED A7BD 30D5 𐐫 +9030E738 8130D332 8130D137 30D6 𐐄 +9030EB38 A7EE A7BE 30D6 𐐬 +9030E739 8130D333 8130D138 30D7 𐐅 +9030EB39 A7EF A7BF 30D7 𐐭 +9030E830 8130D334 8130D139 30D8 𐐆 +9030EC30 A7F0 A7C0 30D8 𐐮 +9030E831 8130D335 8130D230 30D9 𐐇 +9030EC31 A7F1 A7C1 30D9 𐐯 +INSERT INTO t1 VALUES ('a'); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0xFFFF)); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0x10FFFF)); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0x10400)); +SELECT hex(c), hex(weight_string(c)) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +hex(c) hex(weight_string(c)) +61 120F +619030E734 120F30D2 +618431A439 120FFBC1FFFF +61E3329A35 120FFBE1FFFF +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10400 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +9030E734 30D2 𐐀 +9030EB34 30D2 𐐨 +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10428 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +9030E734 30D2 𐐀 +9030EB34 30D2 𐐨 +ALTER TABLE t1 ADD KEY(c); +EXPLAIN SELECT hex(c) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range c c 42 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select hex(`test`.`t1`.`c`) AS `hex(c)` from `test`.`t1` where (`test`.`t1`.`c` like 'a%') order by `test`.`t1`.`c` +SELECT hex(c), hex(weight_string(c)) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +hex(c) hex(weight_string(c)) +61 120F +619030E734 120F30D2 +618431A439 120FFBC1FFFF +61E3329A35 120FFBE1FFFF +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10400 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +9030E734 30D2 𐐀 +9030EB34 30D2 𐐨 +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10428 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +9030E734 30D2 𐐀 +9030EB34 30D2 𐐨 +DROP TABLE t1; +SET NAMES gb18030 COLLATE gb18030_unicode_520_ci; +SELECT 1 gb18030_unicode_520_ci; +gb18030_unicode_520_ci +1 +CREATE DATABASE gb18030 CHARSET=GB18030; +SET NAMES utf8mb4; +SET collation_connection='gb18030_chinese_ci'; +CREATE TABLE t1(C VARCHAR(100) CHARACTER SET gb18030, KEY(c(20))); +INSERT INTO t1 VALUES(0xC4EEC5ABBDBFA1A4B3E0B1DABBB3B9C520A1A4CBD5B6ABC6C2); +INSERT INTO t1 VALUES(0xB4F3BDADB6ABC8A5A3ACC0CBCCD4BEA1A1A2C7A7B9C5B7E7C1F7C8CBCEEFA1A3); +INSERT INTO t1 VALUES(0xB9CAC0DDCEF7B1DFA3ACC8CBB5C0CAC7A1A2C8FDB9FAD6DCC0C9B3E0B1DAA1A3); +INSERT INTO t1 VALUES(0xC2D2CAAFB1C0D4C6A3ACBEAACCCEC1D1B0B6A3ACBEEDC6F0C7A7B6D1D1A9A1A3); +INSERT INTO t1 VALUES(0xBDADC9BDC8E7BBADA3ACD2BBCAB1B6E0C9D9BAC0BDDCA3A1); +INSERT INTO t1 VALUES(0xD2A3CFEBB9ABE8AAB5B1C4EAA3ACD0A1C7C7B3F5BCDEC1CBA3ACD0DBD7CBD3A2B7A2A1A3); +INSERT INTO t1 VALUES(0xD3F0C9C8C2DABDEDA3ACCCB8D0A6BCE4A1A2E9C9E9D6BBD2B7C9D1CCC3F0A1A3); +INSERT INTO t1 VALUES(0xB9CAB9FAC9F1D3CEA3ACB6E0C7E9D3A6D0A6CED2A1A2D4E7C9FABBAAB7A2A1A3); +INSERT INTO t1 VALUES(0xC8CBBCE4C8E7C3CEA3ACD2BBE9D7BBB9F5AABDADD4C2A1A3); +SELECT c, HEX(c), CONVERT(c USING utf8mb4) FROM t1; +c HEX(c) CONVERT(c USING utf8mb4) +念奴娇·赤壁怀古 ·苏东坡 C4EEC5ABBDBFA1A4B3E0B1DABBB3B9C520A1A4CBD5B6ABC6C2 念奴娇·赤壁怀古 ·苏东坡 +大江东去,浪淘尽、千古风流人物。 B4F3BDADB6ABC8A5A3ACC0CBCCD4BEA1A1A2C7A7B9C5B7E7C1F7C8CBCEEFA1A3 大江东去,浪淘尽、千古风流人物。 +故垒西边,人道是、三国周郎赤壁。 B9CAC0DDCEF7B1DFA3ACC8CBB5C0CAC7A1A2C8FDB9FAD6DCC0C9B3E0B1DAA1A3 故垒西边,人道是、三国周郎赤壁。 +乱石崩云,惊涛裂岸,卷起千堆雪。 C2D2CAAFB1C0D4C6A3ACBEAACCCEC1D1B0B6A3ACBEEDC6F0C7A7B6D1D1A9A1A3 乱石崩云,惊涛裂岸,卷起千堆雪。 +江山如画,一时多少豪杰! BDADC9BDC8E7BBADA3ACD2BBCAB1B6E0C9D9BAC0BDDCA3A1 江山如画,一时多少豪杰! +遥想公瑾当年,小乔初嫁了,雄姿英发。 D2A3CFEBB9ABE8AAB5B1C4EAA3ACD0A1C7C7B3F5BCDEC1CBA3ACD0DBD7CBD3A2B7A2A1A3 遥想公瑾当年,小乔初嫁了,雄姿英发。 +羽扇纶巾,谈笑间、樯橹灰飞烟灭。 D3F0C9C8C2DABDEDA3ACCCB8D0A6BCE4A1A2E9C9E9D6BBD2B7C9D1CCC3F0A1A3 羽扇纶巾,谈笑间、樯橹灰飞烟灭。 +故国神游,多情应笑我、早生华发。 B9CAB9FAC9F1D3CEA3ACB6E0C7E9D3A6D0A6CED2A1A2D4E7C9FABBAAB7A2A1A3 故国神游,多情应笑我、早生华发。 +人间如梦,一樽还酹江月。 C8CBBCE4C8E7C3CEA3ACD2BBE9D7BBB9F5AABDADD4C2A1A3 人间如梦,一樽还酹江月。 +SELECT HEX(c), CONVERT(c USING utf8mb4) FROM t1 ORDER BY c; +HEX(c) CONVERT(c USING utf8mb4) +B4F3BDADB6ABC8A5A3ACC0CBCCD4BEA1A1A2C7A7B9C5B7E7C1F7C8CBCEEFA1A3 大江东去,浪淘尽、千古风流人物。 +B9CAB9FAC9F1D3CEA3ACB6E0C7E9D3A6D0A6CED2A1A2D4E7C9FABBAAB7A2A1A3 故国神游,多情应笑我、早生华发。 +B9CAC0DDCEF7B1DFA3ACC8CBB5C0CAC7A1A2C8FDB9FAD6DCC0C9B3E0B1DAA1A3 故垒西边,人道是、三国周郎赤壁。 +BDADC9BDC8E7BBADA3ACD2BBCAB1B6E0C9D9BAC0BDDCA3A1 江山如画,一时多少豪杰! +C2D2CAAFB1C0D4C6A3ACBEAACCCEC1D1B0B6A3ACBEEDC6F0C7A7B6D1D1A9A1A3 乱石崩云,惊涛裂岸,卷起千堆雪。 +C4EEC5ABBDBFA1A4B3E0B1DABBB3B9C520A1A4CBD5B6ABC6C2 念奴娇·赤壁怀古 ·苏东坡 +C8CBBCE4C8E7C3CEA3ACD2BBE9D7BBB9F5AABDADD4C2A1A3 人间如梦,一樽还酹江月。 +D2A3CFEBB9ABE8AAB5B1C4EAA3ACD0A1C7C7B3F5BCDEC1CBA3ACD0DBD7CBD3A2B7A2A1A3 遥想公瑾当年,小乔初嫁了,雄姿英发。 +D3F0C9C8C2DABDEDA3ACCCB8D0A6BCE4A1A2E9C9E9D6BBD2B7C9D1CCC3F0A1A3 羽扇纶巾,谈笑间、樯橹灰飞烟灭。 +SELECT HEX(c), CONVERT(c USING utf8mb4) FROM t1 WHERE c LIKE CONCAT('%', _gb18030 0xD2BB, '%'); +HEX(c) CONVERT(c USING utf8mb4) +BDADC9BDC8E7BBADA3ACD2BBCAB1B6E0C9D9BAC0BDDCA3A1 江山如画,一时多少豪杰! +C8CBBCE4C8E7C3CEA3ACD2BBE9D7BBB9F5AABDADD4C2A1A3 人间如梦,一樽还酹江月。 +SELECT HEX(c), CONVERT(c USING utf8mb4) FROM t1 WHERE c LIKE CONCAT('%', _gb18030 0xC8CB, '%'); +HEX(c) CONVERT(c USING utf8mb4) +B4F3BDADB6ABC8A5A3ACC0CBCCD4BEA1A1A2C7A7B9C5B7E7C1F7C8CBCEEFA1A3 大江东去,浪淘尽、千古风流人物。 +B9CAC0DDCEF7B1DFA3ACC8CBB5C0CAC7A1A2C8FDB9FAD6DCC0C9B3E0B1DAA1A3 故垒西边,人道是、三国周郎赤壁。 +C8CBBCE4C8E7C3CEA3ACD2BBE9D7BBB9F5AABDADD4C2A1A3 人间如梦,一樽还酹江月。 +SELECT HEX(c), CONVERT(c USING utf8mb4) FROM t1 WHERE c > 0xD2A3; +HEX(c) CONVERT(c USING utf8mb4) +D2A3CFEBB9ABE8AAB5B1C4EAA3ACD0A1C7C7B3F5BCDEC1CBA3ACD0DBD7CBD3A2B7A2A1A3 遥想公瑾当年,小乔初嫁了,雄姿英发。 +D3F0C9C8C2DABDEDA3ACCCB8D0A6BCE4A1A2E9C9E9D6BBD2B7C9D1CCC3F0A1A3 羽扇纶巾,谈笑间、樯橹灰飞烟灭。 +TRUNCATE TABLE t1; +INSERT INTO t1 VALUES(0x5373547483329330); +INSERT INTO t1 VALUES(0x8239AB318239AB358239AF3583308132833087348335EB39); +INSERT INTO t1 VALUES(0x97339631973396339733A6359831C0359831C536); +INSERT INTO t1 VALUES(0x9835CF329835CE359835F336); +INSERT INTO t1 VALUES(0x833988318339883283398539); +INSERT INTO t1 VALUES(0x823398318233973582339A3882348A32); +INSERT INTO t1 VALUES(0x8134D5318134D6328134D832); +INSERT INTO t1 VALUES(0x4A7320204B82339A35646566); +INSERT INTO t1 VALUES(0x8130883281308833); +INSERT INTO t1 VALUES(0xE05FE06A777682339230); +INSERT INTO t1 VALUES(0x814081418139FE30); +INSERT INTO t1 VALUES(0x81308130FEFE); +INSERT INTO t1 VALUES(0xE3329A35E3329A34); +INSERT INTO t1 VALUES(0xFE39FE39FE38FE38); +INSERT INTO t1 VALUES(0xFE39FE38A976); +SELECT c, HEX(c), CONVERT(c USING utf8mb4) FROM t1; +c HEX(c) CONVERT(c USING utf8mb4) +SsTt숿 5373547483329330 SsTt숿 +둬둰뒘략럳푼 8239AB318239AB358239AF3583308132833087348335EB39 둬둰뒘략럳푼 +𦠟𦠡𦣃𩄧𩅚 97339631973396339733A6359831C0359831C536 𦠟𦠡𦣃𩄧𩅚 +𪕪𪕣𪛖 9835CF329835CE359835F336 𪕪𪕣𪛖 + 833988318339883283398539  +䑠䑚䑻䣈 823398318233973582339A3882348A32 䑠䑚䑻䣈 +᠗ᠢᠶ 8134D5318134D6328134D832 ᠗ᠢᠶ +Js K䑸def 4A7320204B82339A35646566 Js K䑸def +ÎÏ 8130883281308833 ÎÏ +郷鄇wv䐣 E05FE06A777682339230 郷鄇wv䐣 +丂丄㒙 814081418139FE30 丂丄㒙 +€ 81308130FEFE € +􏿿􏿾 E3329A35E3329A34 􏿿􏿾 +?? FE39FE39FE38FE38 ?? +?﹙ FE39FE38A976 ?﹙ +SELECT c, HEX(c), CONVERT(c USING utf8mb4) FROM t1 WHERE c LIKE CONCAT('%', _gb18030 0x9835CE35, '%'); +c HEX(c) CONVERT(c USING utf8mb4) +𪕪𪕣𪛖 9835CF329835CE359835F336 𪕪𪕣𪛖 +SELECT c, HEX(c), CONVERT(c USING utf8mb4) FROM t1 WHERE c = 0x8130883281308833; +c HEX(c) CONVERT(c USING utf8mb4) +ÎÏ 8130883281308833 ÎÏ +SELECT c, HEX(c), CONVERT(c USING utf8mb4) FROM t1 WHERE c > 0xE040 AND c < 0x8239AB31; +c HEX(c) CONVERT(c USING utf8mb4) +SELECT c, HEX(c), CONVERT(c USING utf8mb4) FROM t1 ORDER BY c; +c HEX(c) CONVERT(c USING utf8mb4) +Js K䑸def 4A7320204B82339A35646566 Js K䑸def +SsTt숿 5373547483329330 SsTt숿 +€ 81308130FEFE € +ÎÏ 8130883281308833 ÎÏ +᠗ᠢᠶ 8134D5318134D6328134D832 ᠗ᠢᠶ +둬둰뒘략럳푼 8239AB318239AB358239AF3583308132833087348335EB39 둬둰뒘략럳푼 + 833988318339883283398539  +𪕪𪕣𪛖 9835CF329835CE359835F336 𪕪𪕣𪛖 +􏿿􏿾 E3329A35E3329A34 􏿿􏿾 +?﹙ FE39FE38A976 ?﹙ +丂丄㒙 814081418139FE30 丂丄㒙 +䑠䑚䑻䣈 823398318233973582339A3882348A32 䑠䑚䑻䣈 +郷鄇wv䐣 E05FE06A777682339230 郷鄇wv䐣 +𦠟𦠡𦣃𩄧𩅚 97339631973396339733A6359831C0359831C536 𦠟𦠡𦣃𩄧𩅚 +?? FE39FE39FE38FE38 ?? +TRUNCATE TABLE t1; +INSERT INTO t1 VALUES(0x8139818F); +Warnings: +Warning 1366 Incorrect string value: '\x819\x81\x8F' for column 'C' at row 1 +INSERT INTO t1 VALUES(0x8431A530); +INSERT INTO t1 VALUES(0x9030813089398130); +INSERT INTO t1 VALUES(0xE3329A36); +INSERT INTO t1 VALUES(0xA6A78586E3329A38); +INSERT INTO t1 VALUES(0xA69C8041); +Warnings: +Warning 1366 Incorrect string value: '\x80A' for column 'C' at row 1 +INSERT INTO t1 VALUES(0xA9C6FEFF); +Warnings: +Warning 1366 Incorrect string value: '\xFE\xFF' for column 'C' at row 1 +INSERT INTO t1 VALUES(0xFFFF); +Warnings: +Warning 1366 Incorrect string value: '\xFF\xFF' for column 'C' at row 1 +INSERT INTO t1 VALUES(0x81408139); +Warnings: +Warning 1366 Incorrect string value: '\x819' for column 'C' at row 1 +INSERT INTO t1 VALUES(0x962B); +Warnings: +Warning 1366 Incorrect string value: '\x96+' for column 'C' at row 1 +INSERT INTO t1 VALUES(0x9F37823881308156); +Warnings: +Warning 1366 Incorrect string value: '\x810\x81V' for column 'C' at row 1 +INSERT INTO t1 VALUES(0xFE35FF30); +Warnings: +Warning 1366 Incorrect string value: '\xFE5\xFF0' for column 'C' at row 1 +INSERT INTO t1 VALUES(0x814281309CA4); +Warnings: +Warning 1366 Incorrect string value: '\x810\x9C\xA4' for column 'C' at row 1 +INSERT INTO t1 VALUES(0xE3329A36); +INSERT INTO t1 VALUES(0xFE39FE39FE39FE38); +SELECT * FROM t1; +C + +? +𐀀? +? +Η厗? + +┢ + +丂 + +񀓎 + +丅 +? +?? +UPDATE t1 SET c=0x81308130; +SELECT COUNT(*) FROM t1 WHERE c <> 0x81308130; +COUNT(*) +0 +TRUNCATE TABLE t1; +INSERT INTO t1 VALUES(_gb18030 0x9534A337), (_gb18030 0x8959), (_gb18030 0xB0F9), (_gb18030 0xB0F4), (_gb18030 0x95348B39), (_gb18030 0x9794), (_gb18030 0x8231AC35); +INSERT INTO t1 VALUES(_gb18030 0xB0F8), (_gb18030 0xAB67), (_gb18030 0x8232B632), (_gb18030 0x9630ED37), (_gb18030 0x9539F933), (_gb18030 0xB0F6), (_gb18030 0x8233B931); +INSERT INTO t1 VALUES(_gb18030 0xD143), (_gb18030 0xB2A4), (_gb18030 0xC08F), (_gb18030 0xBC9E), (_gb18030 0xB2A6), (_gb18030 0xB2A8), (_gb18030 0xB069); +INSERT INTO t1 VALUES(_gb18030 0x9833A533), (_gb18030 0xE2C4), (_gb18030 0xB2A7), (_gb18030 0x97368632), (_gb18030 0xB2A3), (_gb18030 0x8483), (_gb18030 0xB0FE); +INSERT INTO t1 VALUES(_gb18030 0x865C), (_gb18030 0xD093), (_gb18030 0xB36A), (_gb18030 0xB143); +SELECT c, HEX(c) FROM t1 ORDER BY c; +c HEX(c) +𠬣 9534A337 +𠨵 95348B39 +㭋 8231AC35 +玤 AB67 +䂜 8232B632 +蚌 B0F6 +𢜗 9539F933 +𢮏 9630ED37 +䖫 8233B931 +傍 B0F8 +棒 B0F4 +棓 9794 +谤 B0F9 +塝 8959 +拨 B2A6 +波 B2A8 +癷 B069 +𩧯 9833A533 +玻 B2A3 +剝 8483 +剥 B0FE +哱 865C +盋 B143 +砵 B36A +袚 D093 +𧙄 97368632 +钵 B2A7 +饽 E2C4 +紴 BC9E +缽 C08F +菠 B2A4 +袰 D143 +SELECT c, HEX(c) FROM t1 WHERE c >= 0x8483 and c < 0xE2C4 ORDER BY c; +c HEX(c) +剝 8483 +剥 B0FE +哱 865C +盋 B143 +砵 B36A +袚 D093 +𧙄 97368632 +钵 B2A7 +SELECT c, HEX(c) FROM t1 WHERE c LIKE 0xB0FE; +c HEX(c) +剥 B0FE +TRUNCATE TABLE t1; +INSERT INTO t1 VALUES(_gb18030 0x81308130), (_gb18030 0x81308132); +INSERT INTO t1 VALUES('A'), ('a'), ('1'), ('2'); +INSERT INTO t1 VALUES(_gb18030 0xCDF5), (_gb18030 0xC0EE), (_gb18030 0xD5C5), (_gb18030 0xC1F5), (_gb18030 0xB3C2), (_gb18030 0xD1EE), (_gb18030 0xBBC6); +INSERT INTO t1 VALUES(_gb18030 0xCEE2), (_gb18030 0xD5D4), (_gb18030 0xD6DC), (_gb18030 0xD0EC), (_gb18030 0xCBEF), (_gb18030 0xC2ED), (_gb18030 0xD6EC); +INSERT INTO t1 VALUES(_gb18030 0xBAFA), (_gb18030 0xC1D6), (_gb18030 0xB9F9), (_gb18030 0xBACE), (_gb18030 0xB8DF), (_gb18030 0xC2DE), (_gb18030 0xD6A3); +INSERT INTO t1 VALUES(_gb18030 0xE3329A35), (_gb18030 0xE3329A34); +SELECT c, HEX(c) FROM t1 ORDER BY c; +c HEX(c) +1 31 +2 32 +A 41 +a 61 +€ 81308130 +‚ 81308132 +􏿾 E3329A34 +􏿿 E3329A35 +陈 B3C2 +高 B8DF +郭 B9F9 +何 BACE +胡 BAFA +黄 BBC6 +李 C0EE +林 C1D6 +刘 C1F5 +罗 C2DE +马 C2ED +孙 CBEF +王 CDF5 +吴 CEE2 +徐 D0EC +杨 D1EE +张 D5C5 +赵 D5D4 +郑 D6A3 +周 D6DC +朱 D6EC +DROP TABLE t1; +CREATE TABLE t1 (c CHAR(1) CHARACTER SET gb18030, v VARCHAR(100) CHARACTER SET gb18030); +INSERT INTO t1 VALUES(0x8140, 0x81308132A6C9A6A985328338); +SELECT HEX(c), c, HEX(v), v FROM t1; +HEX(c) c HEX(v) v +8140 丂 81308132A6C9A6A985328338 ‚ιΙ? +ALTER TABLE t1 ADD COLUMN t TEXT CHARACTER SET gb18030; +INSERT INTO t1 VALUES(0xBC81, 0x82358132FE39FE3940414281308135, 0x84678578); +SELECT HEX(c), c, HEX(v), v, HEX(t), t FROM t1; +HEX(c) c HEX(v) v HEX(t) t +8140 丂 81308132A6C9A6A985328338 ‚ιΙ? NULL NULL +BC81 紒 82358132FE39FE3940414281308135 䵲?@AB… 84678578 刧厁 +DROP TABLE t1; +CREATE TABLE t1 (c VARCHAR(10) CHARACTER SET gb18030); +INSERT INTO t1 VALUES(0x81308A3181308A3181308A3181308A3181308732); +INSERT INTO t1 VALUES(0x81308A3181308A318130873281308A31); +INSERT INTO t1 VALUES(0x81308A318130873281309636); +INSERT INTO t1 VALUES(0x81308A318130873281309637); +INSERT INTO t1 VALUES(0x81308A31813087328130963781309636); +INSERT INTO t1 VALUES(0x8130963681308A31); +INSERT INTO t1 VALUES(0xA8A581308D35); +INSERT INTO t1 VALUES(0x81308D35A8A5); +INSERT INTO t1 VALUES(0x81308D35A8A5A8A5); +SELECT HEX(c) FROM t1; +HEX(c) +81308A3181308A3181308A3181308A3181308732 +81308A3181308A318130873281308A31 +81308A318130873281309636 +81308A318130873281309637 +81308A31813087328130963781309636 +8130963681308A31 +A8A581308D35 +81308D35A8A5 +81308D35A8A5A8A5 +SELECT HEX(c) FROM t1 WHERE c LIKE CONCAT('%', _gb18030 0x81308A31); +HEX(c) +81308A3181308A3181308A3181308A3181308732 +81308A3181308A318130873281308A31 +8130963681308A31 +SELECT HEX(c) FROM t1 WHERE c LIKE CONCAT('%', _gb18030 0x8130873281308A31, '%'); +HEX(c) +81308A3181308A3181308A3181308A3181308732 +81308A3181308A318130873281308A31 +81308A318130873281309636 +81308A318130873281309637 +81308A31813087328130963781309636 +SELECT HEX(c) FROM t1 WHERE c LIKE CONCAT('%', _gb18030 0x8130873281309636); +HEX(c) +81308A318130873281309636 +81308A318130873281309637 +SELECT HEX(c) FROM t1 WHERE c LIKE CONCAT('%', _gb18030 0x8130963781309636); +HEX(c) +81308A31813087328130963781309636 +SELECT HEX(c) FROM t1 WHERE c LIKE CONCAT(_gb18030 0x81309636, '%'); +HEX(c) +8130963681308A31 +SELECT HEX(c) FROM t1 WHERE c LIKE CONCAT('%', _gb18030 0x8130963781309636); +HEX(c) +81308A31813087328130963781309636 +SELECT HEX(c) FROM t1 WHERE c LIKE CONCAT('%', _gb18030 0x8130963781309636) ESCAPE _gb18030 0x81309637; +HEX(c) +81308A318130873281309636 +81308A318130873281309637 +81308A31813087328130963781309636 +SELECT HEX(c) FROM t1 WHERE c LIKE CONCAT(_gb18030 0xA8A5, '%'); +HEX(c) +A8A581308D35 +81308D35A8A5 +81308D35A8A5A8A5 +SELECT HEX(c) FROM t1 WHERE c LIKE CONCAT(_gb18030 0xA8A5, '_'); +HEX(c) +A8A581308D35 +81308D35A8A5 +SELECT HEX(c) FROM t1 WHERE c LIKE CONCAT(_gb18030 0xA8A5, '_', _gb18030 0x81308D35); +HEX(c) +81308D35A8A5A8A5 +SELECT HEX(c) FROM t1 WHERE c LIKE CONCAT('%_', _gb18030 0xA8A5); +HEX(c) +A8A581308D35 +81308D35A8A5 +81308D35A8A5A8A5 +DROP TABLE t1; +SET NAMES utf8mb4; +CREATE TABLE t1 (c VARCHAR(10) CHARACTER SET gb18030); +INSERT INTO t1 VALUES (_gb18030 0x8BF5819AEDC3), (_gb18030 0x99CC), (_gb18030 0x90459958), (_gb18030 0xAA95C0E59E509AED), (_gb18030 0xCCE7), (_gb18030 0x9068), (_gb18030 0x90459958); +SELECT ANY_VALUE(HEX(c)), COUNT(c) FROM t1 GROUP BY c COLLATE gb18030_chinese_ci; +ANY_VALUE(HEX(c)) COUNT(c) +8BF5819AEDC3 1 +90459958 2 +9068 1 +99CC 1 +AA95C0E59E509AED 1 +CCE7 1 +DROP TABLE t1; +CREATE TABLE t1 (a int) ENGINE=InnoDB; +LOAD DATA INFILE '../../std_data/bug21542698.dat' INTO TABLE t1 CHARACTER SET gb18030; +ERROR HY000: Invalid gb18030 character string: 'MZ' +DROP TABLE t1; +DROP DATABASE gb18030; +SET sql_mode = default; +# +# End of 5.7 tests +# diff --git a/mysql-test/r/ctype_uca.result-pq b/mysql-test/r/ctype_uca.result-pq new file mode 100644 index 000000000000..4f7ce5a01e22 --- /dev/null +++ b/mysql-test/r/ctype_uca.result-pq @@ -0,0 +1,7610 @@ +call mtr.add_suppression("Plugin \'InnoDB\'"); +DROP TABLE IF EXISTS t1; +set names utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +set collation_connection=utf8_unicode_ci; +Warnings: +Warning 3778 'utf8_unicode_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. +select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; +'a' = 'a' 'a' = 'a ' 'a ' = 'a' +1 1 1 +select 'a\t' = 'a' , 'a\t' < 'a' , 'a\t' > 'a'; +'a\t' = 'a' 'a\t' < 'a' 'a\t' > 'a' +0 1 0 +select 'a\t' = 'a ', 'a\t' < 'a ', 'a\t' > 'a '; +'a\t' = 'a ' 'a\t' < 'a ' 'a\t' > 'a ' +0 1 0 +select 'a' = 'a\t', 'a' < 'a\t', 'a' > 'a\t'; +'a' = 'a\t' 'a' < 'a\t' 'a' > 'a\t' +0 0 1 +select 'a ' = 'a\t', 'a ' < 'a\t', 'a ' > 'a\t'; +'a ' = 'a\t' 'a ' < 'a\t' 'a ' > 'a\t' +0 0 1 +select 'a a' > 'a', 'a \t' < 'a'; +'a a' > 'a' 'a \t' < 'a' +1 1 +select 'c' like '\_' as want0; +want0 +0 +create table t1 (c1 char(10) character set utf8 collate utf8_bin); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +Warning 3778 'utf8_bin' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. +insert into t1 values ('A'),('a'); +insert into t1 values ('B'),('b'); +insert into t1 values ('C'),('c'); +insert into t1 values ('D'),('d'); +insert into t1 values ('E'),('e'); +insert into t1 values ('F'),('f'); +insert into t1 values ('G'),('g'); +insert into t1 values ('H'),('h'); +insert into t1 values ('I'),('i'); +insert into t1 values ('J'),('j'); +insert into t1 values ('K'),('k'); +insert into t1 values ('L'),('l'); +insert into t1 values ('M'),('m'); +insert into t1 values ('N'),('n'); +insert into t1 values ('O'),('o'); +insert into t1 values ('P'),('p'); +insert into t1 values ('Q'),('q'); +insert into t1 values ('R'),('r'); +insert into t1 values ('S'),('s'); +insert into t1 values ('T'),('t'); +insert into t1 values ('U'),('u'); +insert into t1 values ('V'),('v'); +insert into t1 values ('W'),('w'); +insert into t1 values ('X'),('x'); +insert into t1 values ('Y'),('y'); +insert into t1 values ('Z'),('z'); +insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0); +insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1); +insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2); +insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3); +insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4); +insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5); +insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6); +insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7); +insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8); +insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9); +insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca); +insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb); +insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc); +insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd); +insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce); +insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf); +insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0); +insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1); +insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2); +insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3); +insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4); +insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5); +insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6); +insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7); +insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8); +insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9); +insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da); +insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db); +insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc); +insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd); +insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de); +insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df); +insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103); +insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107); +insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b); +insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f); +insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113); +insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117); +insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b); +insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f); +insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123); +insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127); +insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b); +insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f); +insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133); +insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137); +insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b); +insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f); +insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143); +insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147); +insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b); +insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f); +insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153); +insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157); +insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b); +insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f); +insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163); +insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167); +insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b); +insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f); +insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173); +insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177); +insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b); +insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f); +insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183); +insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187); +insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b); +insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f); +insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193); +insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197); +insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b); +insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f); +insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3); +insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7); +insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab); +insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af); +insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3); +insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7); +insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb); +insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf); +insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3); +insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7); +insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb); +insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf); +insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3); +insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7); +insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db); +insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df); +insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3); +insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7); +insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb); +insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef); +insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3); +insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7); +insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb); +insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff); +INSERT INTO t1 VALUES (_ucs2 0x1EA0),(_ucs2 0x1EA1),(_ucs2 0x1EA2),(_ucs2 0x1EA3); +INSERT INTO t1 VALUES (_ucs2 0x1EA4),(_ucs2 0x1EA5),(_ucs2 0x1EA6),(_ucs2 0x1EA7); +INSERT INTO t1 VALUES (_ucs2 0x1EA8),(_ucs2 0x1EA9),(_ucs2 0x1EAA),(_ucs2 0x1EAB); +INSERT INTO t1 VALUES (_ucs2 0x1EAC),(_ucs2 0x1EAD),(_ucs2 0x1EAE),(_ucs2 0x1EAF); +INSERT INTO t1 VALUES (_ucs2 0x1EB0),(_ucs2 0x1EB1),(_ucs2 0x1EB2),(_ucs2 0x1EB3); +INSERT INTO t1 VALUES (_ucs2 0x1EB4),(_ucs2 0x1EB5),(_ucs2 0x1EB6),(_ucs2 0x1EB7); +INSERT INTO t1 VALUES (_ucs2 0x1EB8),(_ucs2 0x1EB9),(_ucs2 0x1EBA),(_ucs2 0x1EBB); +INSERT INTO t1 VALUES (_ucs2 0x1EBC),(_ucs2 0x1EBD),(_ucs2 0x1EBE),(_ucs2 0x1EBF); +INSERT INTO t1 VALUES (_ucs2 0x1EC0),(_ucs2 0x1EC1),(_ucs2 0x1EC2),(_ucs2 0x1EC3); +INSERT INTO t1 VALUES (_ucs2 0x1EC4),(_ucs2 0x1EC5),(_ucs2 0x1EC6),(_ucs2 0x1EC7); +INSERT INTO t1 VALUES (_ucs2 0x1EC8),(_ucs2 0x1EC9),(_ucs2 0x1ECA),(_ucs2 0x1ECB); +INSERT INTO t1 VALUES (_ucs2 0x1ECC),(_ucs2 0x1ECD),(_ucs2 0x1ECE),(_ucs2 0x1ECF); +INSERT INTO t1 VALUES (_ucs2 0x1ED0),(_ucs2 0x1ED1),(_ucs2 0x1ED2),(_ucs2 0x1ED3); +INSERT INTO t1 VALUES (_ucs2 0x1ED4),(_ucs2 0x1ED5),(_ucs2 0x1ED6),(_ucs2 0x1ED7); +INSERT INTO t1 VALUES (_ucs2 0x1ED8),(_ucs2 0x1ED9),(_ucs2 0x1EDA),(_ucs2 0x1EDB); +INSERT INTO t1 VALUES (_ucs2 0x1EDC),(_ucs2 0x1EDD),(_ucs2 0x1EDE),(_ucs2 0x1EDF); +INSERT INTO t1 VALUES (_ucs2 0x1EE0),(_ucs2 0x1EE1),(_ucs2 0x1EE2),(_ucs2 0x1EE3); +INSERT INTO t1 VALUES (_ucs2 0x1EE4),(_ucs2 0x1EE5),(_ucs2 0x1EE6),(_ucs2 0x1EE7); +INSERT INTO t1 VALUES (_ucs2 0x1EE8),(_ucs2 0x1EE9),(_ucs2 0x1EEA),(_ucs2 0x1EEB); +INSERT INTO t1 VALUES (_ucs2 0x1EEC),(_ucs2 0x1EED),(_ucs2 0x1EEE),(_ucs2 0x1EEF); +INSERT INTO t1 VALUES (_ucs2 0x1EF0),(_ucs2 0x1EF1); +insert into t1 values ('AA'),('Aa'),('aa'),('aA'); +insert into t1 values ('AE'),('Ae'),('ae'),('aE'); +insert into t1 values ('CH'),('Ch'),('ch'),('cH'); +insert into t1 values ('DZ'),('Dz'),('dz'),('dZ'); +insert into t1 values ('DŽ'),('Dž'),('dž'),('dŽ'); +insert into t1 values ('IJ'),('Ij'),('ij'),('iJ'); +insert into t1 values ('LJ'),('Lj'),('lj'),('lJ'); +insert into t1 values ('LL'),('Ll'),('ll'),('lL'); +insert into t1 values ('NJ'),('Nj'),('nj'),('nJ'); +insert into t1 values ('OE'),('Oe'),('oe'),('oE'); +insert into t1 values ('SS'),('Ss'),('ss'),('sS'); +insert into t1 values ('RR'),('Rr'),('rr'),('rR'); +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_unicode_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_icelandic_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Â,Ã,à,â,ã,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Á,á +Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Ð,ð +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +E,e,È,Ê,Ë,è,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +É,é +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Î,Ï,ì,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +Í,í +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ô,Õ,ò,ô,õ,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ó,ó +Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Û,Ü,ù,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ú,ú +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,ÿ,Ŷ,ŷ,Ÿ +Ý,ý +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Þ,þ +Ä,Æ,ä,æ +Ö,Ø,ö,ø +Å,å +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_latvian_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ +CH,Ch,cH,ch +Č,č +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz +DŽ,Dž,dŽ,dž +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ǧ,ǧ,Ǵ,ǵ +Ģ,ģ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +Y,y +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ǩ,ǩ +Ķ,ķ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ļ,ļ +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ņ,ņ +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ř,ř +RR,Rr,rR,rr +Ŗ,ŗ +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,ſ +SS,Ss,sS,ss,ß +Š,š +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż +ƍ +Ž,ž +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_romanian_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Ã,Ä,Å,à,á,ã,ä,å,Ā,ā,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Ă,ă +Â,â +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Ï,ì,í,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +Î,î +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Š,š,ſ +SS,Ss,sS,ss,ß +Ş,ş +Ʃ +ƪ +T,t,Ť,ť +ƾ +Ţ,ţ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovenian_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ +CH,Ch,cH,ch +Č,č +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz +DŽ,Dž,dŽ,dž +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,ſ +SS,Ss,sS,ss,ß +Š,š +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż +ƍ +Ž,ž +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_polish_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Ą,ą +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ć,ć +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ę,ę +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ń,ń +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ô,Õ,Ö,ò,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ó,ó +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ś,ś +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ž,ž +ƍ +Ź,ź +Ż,ż +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_estonian_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,Å,à,á,â,ã,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,dZ,dz +DŽ,Dž,dŽ,dž +DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,ò,ó,ô,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,ſ +SS,Ss,sS,ss,ß +Š,š +Z,z +Ž,ž +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +Õ,õ +Ä,ä +Ö,ö +Ü,ü +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Ź,ź,Ż,ż +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ñ,ñ +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_swedish_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,à,á,â,ã,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,ò,ó,ô,õ,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ü,Ý,ü,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Å,å +Ä,Æ,ä,æ +Ö,Ø,ö,ø +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_turkish_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ç,ç +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ğ,ğ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +I,ı +IJ,Ij +ƕ,Ƕ +Ħ,ħ +i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +iJ,ij,IJ,ij +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,ò,ó,ô,õ,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ö,ö +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Š,š,ſ +SS,Ss,sS,ss,ß +Ş,ş +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ü,ü +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_czech_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ +cH +Č,č +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz +DŽ,Dž,dŽ,dž +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +CH,Ch,ch +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ +RR,Rr,rR,rr +Ř,ř +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,ſ +SS,Ss,sS,ss,ß +Š,š +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż +ƍ +Ž,ž +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_danish_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,à,á,â,ã,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +aA +AE,Ae,aE,ae +Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,ò,ó,ô,õ,Ō,ō,Ŏ,ŏ,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ü,Ý,ü,ý,ÿ,Ű,ű,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ä,Æ,ä,æ +Ö,Ø,ö,ø,Ő,ő +AA,Aa,aa,Å,å +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_lithuanian_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,CH,Ch,c,ch,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ +cH +Č,č +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz +DŽ,Dž,dŽ,dž +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,Y,i,y,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,ſ +SS,Ss,sS,ss,ß +Š,š +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż +ƍ +Ž,ž +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,Å,à,á,â,ã,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Ä,ä +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ +cH +Č,č +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz +DŽ,Dž,dŽ,dž +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +CH,Ch,ch +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Õ,Ö,ò,ó,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ô,ô +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,ſ +SS,Ss,sS,ss,ß +Š,š +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż +ƍ +Ž,ž +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +cH +CH,Ch,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +lL +LL,Ll,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ñ,ñ +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_roman_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,J,i,j,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij +IJ,ij +ı +Ɨ +Ɩ +Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj +LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj +NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +U,V,u,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_esperanto_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ĉ,ĉ +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ĝ,ĝ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h +Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,ǰ +Ĵ,ĵ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ŝ,ŝ +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ŭ,ŭ +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_hungarian_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,ò,ó,ô,õ,Ō,ō,Ŏ,ŏ,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ö,ö,Ő,ő +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ü,ü,Ű,ű +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_croatian_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ĉ,ĉ,Ċ,ċ +CH,Ch,cH,ch +Č,č +Ć,ć +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,dZ,dz,DZ,Dz,dz +DŽ,Dž,dŽ,dž,DŽ,Dž,dž +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LL,Ll,lL,ll +LJ,Lj,lJ,lj,LJ,Lj,lj +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,ſ +SS,Ss,sS,ss,ß +Š,š +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż +ƍ +Ž,ž +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_german2_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,Å,à,á,â,ã,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae,Ä,Æ,ä,æ +Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,ò,ó,ô,õ,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Ö,ö,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ü,ü +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_unicode_520_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae,Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ð,ð,Ď,ď,Đ,đ +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Ɖ +Ɗ +Ƌ,ƌ +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ,Ħ,ħ +ƕ,Ƕ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ,Ŀ,ŀ,Ł,ł +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,Ø,ò,ó,ô,õ,ö,ø,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ǿ,ǿ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_vietnamese_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Á,Ã,Ä,Å,à,á,ã,ä,å,Ā,ā,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả +AA,Aa,aA,aa +AE,Ae,aE,ae +Ă,ă,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +Â,â,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ë,è,é,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ +Ê,ê,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Õ,Ö,ò,ó,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ +OE,Oe,oE,oe,Œ,œ +Ô,ô,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ +Ơ,ơ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ +Ư,ư,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +ALTER TABLE t1 CONVERT TO CHARACTER SET ucs2 COLLATE ucs2_bin; +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_unicode_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_icelandic_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Â,Ã,à,â,ã,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Á,á +Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Ð,ð +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +E,e,È,Ê,Ë,è,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +É,é +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Î,Ï,ì,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +Í,í +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ô,Õ,ò,ô,õ,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ó,ó +Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Û,Ü,ù,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ú,ú +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,ÿ,Ŷ,ŷ,Ÿ +Ý,ý +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Þ,þ +Ä,Æ,ä,æ +Ö,Ø,ö,ø +Å,å +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_latvian_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ +CH,Ch,cH,ch +Č,č +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz +DŽ,Dž,dŽ,dž +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ǧ,ǧ,Ǵ,ǵ +Ģ,ģ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +Y,y +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ǩ,ǩ +Ķ,ķ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ļ,ļ +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ņ,ņ +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ř,ř +RR,Rr,rR,rr +Ŗ,ŗ +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,ſ +SS,Ss,sS,ss,ß +Š,š +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż +ƍ +Ž,ž +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_romanian_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Ã,Ä,Å,à,á,ã,ä,å,Ā,ā,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Ă,ă +Â,â +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Ï,ì,í,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +Î,î +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Š,š,ſ +SS,Ss,sS,ss,ß +Ş,ş +Ʃ +ƪ +T,t,Ť,ť +ƾ +Ţ,ţ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_slovenian_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ +CH,Ch,cH,ch +Č,č +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz +DŽ,Dž,dŽ,dž +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,ſ +SS,Ss,sS,ss,ß +Š,š +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż +ƍ +Ž,ž +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_polish_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Ą,ą +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ć,ć +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ę,ę +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ń,ń +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ô,Õ,Ö,ò,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ó,ó +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ś,ś +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ž,ž +ƍ +Ź,ź +Ż,ż +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_estonian_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Â,Ã,Å,à,á,â,ã,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,dZ,dz +DŽ,Dž,dŽ,dž +DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,ò,ó,ô,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,ſ +SS,Ss,sS,ss,ß +Š,š +Z,z +Ž,ž +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +Õ,õ +Ä,ä +Ö,ö +Ü,ü +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Ź,ź,Ż,ż +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_spanish_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ñ,ñ +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_swedish_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Â,Ã,à,á,â,ã,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,ò,ó,ô,õ,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ü,Ý,ü,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Å,å +Ä,Æ,ä,æ +Ö,Ø,ö,ø +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_turkish_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ç,ç +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ğ,ğ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +I,ı +IJ,Ij +ƕ,Ƕ +Ħ,ħ +i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +iJ,ij,IJ,ij +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,ò,ó,ô,õ,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ö,ö +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Š,š,ſ +SS,Ss,sS,ss,ß +Ş,ş +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ü,ü +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_czech_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ +cH +Č,č +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz +DŽ,Dž,dŽ,dž +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +CH,Ch,ch +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ +RR,Rr,rR,rr +Ř,ř +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,ſ +SS,Ss,sS,ss,ß +Š,š +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż +ƍ +Ž,ž +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_danish_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Â,Ã,à,á,â,ã,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +aA +AE,Ae,aE,ae +Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,ò,ó,ô,õ,Ō,ō,Ŏ,ŏ,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ü,Ý,ü,ý,ÿ,Ű,ű,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ä,Æ,ä,æ +Ö,Ø,ö,ø,Ő,ő +AA,Aa,aa,Å,å +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_lithuanian_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,CH,Ch,c,ch,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ +cH +Č,č +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz +DŽ,Dž,dŽ,dž +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,Y,i,y,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,ſ +SS,Ss,sS,ss,ß +Š,š +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż +ƍ +Ž,ž +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_slovak_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Â,Ã,Å,à,á,â,ã,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Ä,ä +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ +cH +Č,č +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz +DŽ,Dž,dŽ,dž +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +CH,Ch,ch +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Õ,Ö,ò,ó,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ô,ô +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,ſ +SS,Ss,sS,ss,ß +Š,š +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż +ƍ +Ž,ž +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_spanish2_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +cH +CH,Ch,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +lL +LL,Ll,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ñ,ñ +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_roman_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,J,i,j,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij +IJ,ij +ı +Ɨ +Ɩ +Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj +LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj +NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +U,V,u,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_esperanto_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ĉ,ĉ +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ĝ,ĝ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h +Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,ǰ +Ĵ,ĵ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ŝ,ŝ +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ŭ,ŭ +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_hungarian_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,ò,ó,ô,õ,Ō,ō,Ŏ,ŏ,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ö,ö,Ő,ő +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ü,ü,Ű,ű +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_croatian_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ĉ,ĉ,Ċ,ċ +CH,Ch,cH,ch +Č,č +Ć,ć +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,dZ,dz,DZ,Dz,dz +DŽ,Dž,dŽ,dž,DŽ,Dž,dž +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LL,Ll,lL,ll +LJ,Lj,lJ,lj,LJ,Lj,lj +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,ſ +SS,Ss,sS,ss,ß +Š,š +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż +ƍ +Ž,ž +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_german2_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Â,Ã,Å,à,á,â,ã,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae,Ä,Æ,ä,æ +Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,ò,ó,ô,õ,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Ö,ö,Œ,œ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,ù,ú,û,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ü,ü +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_unicode_520_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +AA,Aa,aA,aa +AE,Ae,aE,ae,Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ð,ð,Ď,ď,Đ,đ +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Ɖ +Ɗ +Ƌ,ƌ +E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ,Ħ,ħ +ƕ,Ƕ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ,Ŀ,ŀ,Ł,ł +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Ô,Õ,Ö,Ø,ò,ó,ô,õ,ö,ø,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ǿ,ǿ,Ọ,ọ,Ỏ,ỏ,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +OE,Oe,oE,oe,Œ,œ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +SELECT GROUP_CONCAT(c1 ORDER BY c1) FROM t1 GROUP BY c1 COLLATE ucs2_vietnamese_ci; +GROUP_CONCAT(c1 ORDER BY c1) +÷ +× +A,a,À,Á,Ã,Ä,Å,à,á,ã,ä,å,Ā,ā,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ,Ạ,ạ,Ả,ả +AA,Aa,aA,aa +AE,Ae,aE,ae +Ă,ă,Ắ,ắ,Ằ,ằ,Ẳ,ẳ,Ẵ,ẵ,Ặ,ặ +Â,â,Ấ,ấ,Ầ,ầ,Ẩ,ẩ,Ẫ,ẫ,Ậ,ậ +Æ,æ,Ǣ,ǣ,Ǽ,ǽ +B,b +ƀ +Ɓ +Ƃ,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č +CH,Ch,cH,ch +Ƈ,ƈ +D,d,Ď,ď +DZ,Dz,DŽ,Dž,dZ,dz,dŽ,dž,DŽ,Dž,dž,DZ,Dz,dz +Đ,đ +Ɖ +Ɗ +Ƌ,ƌ +Ð,ð +E,e,È,É,Ë,è,é,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě,Ẹ,ẹ,Ẻ,ẻ,Ẽ,ẽ +Ê,ê,Ế,ế,Ề,ề,Ể,ể,Ễ,ễ,Ệ,ệ +Ǝ,ǝ +Ə +Ɛ +F,f +Ƒ,ƒ +G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ +Ǥ,ǥ +Ɠ +Ɣ +Ƣ,ƣ +H,h,Ĥ,ĥ +ƕ,Ƕ +Ħ,ħ +I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ,Ỉ,ỉ,Ị,ị +IJ,Ij,iJ,ij,IJ,ij +ı +Ɨ +Ɩ +J,j,Ĵ,ĵ,ǰ +K,k,Ķ,ķ,Ǩ,ǩ +Ƙ,ƙ +L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ +Ŀ,ŀ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ł,ł +ƚ +ƛ +M,m +N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,NJ,Nj,nj +Ɲ +ƞ +Ŋ,ŋ +O,o,Ò,Ó,Õ,Ö,ò,ó,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ,Ọ,ọ,Ỏ,ỏ +OE,Oe,oE,oe,Œ,œ +Ô,ô,Ố,ố,Ồ,ồ,Ổ,ổ,Ỗ,ỗ,Ộ,ộ +Ơ,ơ,Ớ,ớ,Ờ,ờ,Ở,ở,Ỡ,ỡ,Ợ,ợ +Ø,ø,Ǿ,ǿ +Ɔ +Ɵ +P,p +Ƥ,ƥ +Q,q +ĸ +R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř +RR,Rr,rR,rr +Ʀ +S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ +SS,Ss,sS,ss,ß +Ʃ +ƪ +T,t,Ţ,ţ,Ť,ť +ƾ +Ŧ,ŧ +ƫ +Ƭ,ƭ +Ʈ +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ,Ụ,ụ,Ủ,ủ +Ư,ư,Ứ,ứ,Ừ,ừ,Ử,ử,Ữ,ữ,Ự,ự +Ɯ +Ʊ +V,v +Ʋ +W,w,Ŵ,ŵ +X,x +Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ +Ƴ,ƴ +Z,z,Ź,ź,Ż,ż,Ž,ž +ƍ +Ƶ,ƶ +Ʒ,Ǯ,ǯ +Ƹ,ƹ +ƺ +Þ,þ +ƿ,Ƿ +ƻ +Ƨ,ƨ +Ƽ,ƽ +Ƅ,ƅ +ʼn +ǀ +ǁ +ǂ +ǃ +drop table t1; +SET NAMES utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE utf8_general_ci, INDEX (c)); +Warnings: +Warning 3778 'utf8_general_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B403B11F770308 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) +COLLATE utf8_general_ci; +c +Μωδαί̈ +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) +COLLATE utf8_general_ci ORDER BY c; +c +Μωδ +Μωδαί̈ +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +DROP TABLE t1; +CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE ucs2_unicode_ci, INDEX (c)); +INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308); +SELECT * FROM t1 WHERE c LIKE _ucs2 0x039C0025 COLLATE ucs2_unicode_ci; +c +Μωδαί̈ +INSERT INTO t1 VALUES (_ucs2 0x039C03C903B4); +SELECT * FROM t1 WHERE c LIKE _ucs2 0x039C0025 +COLLATE ucs2_unicode_ci ORDER BY c; +c +Μωδ +Μωδαί̈ +DROP TABLE t1; +CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE utf8_unicode_ci, INDEX (c)); +Warnings: +Warning 3778 'utf8_unicode_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B403B11F770308 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) COLLATE utf8_unicode_ci; +c +Μωδαί̈ +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) +COLLATE utf8_unicode_ci ORDER BY c; +c +Μωδ +Μωδαί̈ +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +DROP TABLE t1; +CREATE TABLE t1 ( +col1 CHAR(32) CHARACTER SET utf8 NOT NULL +); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410627 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410628 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410648 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0633064A0651062F USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D06330646 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0642064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06320627062F0647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062806310627064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064706450647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F062706460634062C0648064A06270646064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A06270631064A062E USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062706460642064406270628 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A0631062706460650 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062F064806270631062F USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280631062706480646200C06310627 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E064806270646062F0647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A062D062A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0623062B064A0631 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0642063106270631 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF06310641062A0647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270646062F USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062E0635064A0651062A064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628062706310632 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270633062A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906A90633 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270648060C USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0631 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D062F0648062F USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628064A0633062A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648067E0646062C USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06330627064406AF064A060C USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063306270644 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606450627064A0646062F0647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A06280631064A0632 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062C06440633 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F060C USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628064A0646 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06350641062D0627062A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A0646 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9062A06270628 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x068606340645 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E06480631062F USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0686064706310647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06420648064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450635064506510645 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06310627 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646063406270646 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645064A200C062F0647062F060C USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647063106860646062F USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06390645064400BB USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9064806340634 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064706500646064A064606AF USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062D063306270646 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A062706310634062706370631 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646062A06340631 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062F0647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0633062A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064806270646 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064506270646 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064806510644 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0634062E064A0635 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0627062F USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280627 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064106270648062A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D06270644062A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064106A906510631 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063A064406280647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06270631062F USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270632 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063106470628063106270646 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606470636062A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506340631064806370647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646064A0632 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062D064206510642 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0637063106270632 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064106310647064606AF USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0645062F06510646 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627063106470627064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270648 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0639063106350647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064506480631 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0633064A06270633064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646060C USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D064806320647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906440645 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F062706460634 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450642062706440627062A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064A06AF0631 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648064A06980647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646062706450647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506480631062F USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628062D062B USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628063106310633064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606480634062A0647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064606470627 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0622064606860647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064806310647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064206270645062A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0631062F062706320645 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0698062706460648064A0647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06390648062A0650 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063306500631 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0646064A0633064F0646 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063106270633 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064A0626062A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0639064406480645200C063406310642064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280639062F0627064B USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062F063106330647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062206410631064A06420627064A064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06270646063406AF06270647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06440646062F0646 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E064A06480633062A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064606AF06270645064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0633 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0622063A06270632 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062C064606AF USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062C064706270646 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064806510645 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063406470631 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9064506280631064A062C USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646062A06420644 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90631062F0646062F USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06470645 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06310641062A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646062C0627 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506270646062F USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0627 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062706A9062A06280631 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606380631 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06480644062A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06480628062706310647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606330628062A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645063306270639062F USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062F USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06480632064A0631 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062E062A06270631 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06330641064A0631 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064606AF0644064A0633 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0642064A200C06320627062F0647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280627063206AF0634062A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064506330631 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220644064506270646064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270634 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220645062F0647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A906270631064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0631062F0627062E062A0647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906440645064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062F0628064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D062F0651 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606280648062F060C USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06480644064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906480636060C USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06340627064A062F USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506470645 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0631 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646060C USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06470645063306310634 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627064606480646 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E0627064606480627062F06AF064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF06310645064A USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062C0648062F USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062206480631062F USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0648 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627064506440627064B USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9062F064A06AF0631 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064406280633062A0647 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F0646062F USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450647064506270646 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT HEX(CONVERT(col1 USING ucs2)) FROM t1 ORDER BY col1 COLLATE utf8_persian_ci, col1 COLLATE utf8_bin; +HEX(CONVERT(col1 USING ucs2)) +0041004100410627 +0041004100410628 +0041004100410648 +0041004100410647 +0622063A06270632 +062206410631064A06420627064A064A +06220644064506270646064A +06220645062F0647 +06220646 +06220646060C +06220646062C0627 +0622064606860647 +062206480631062F +0627062D063306270646 +0627062F0628064A +0627062F064806270631062F +06270632 +06270633062A +06270634 +0627064206270645062A +062706A9062A06280631 +0627064506480631 +06270646062F +062706460642064406270628 +0627064606AF0644064A0633 +06270648 +06270648060C +0627064806510644 +0627064A +0627064A063106270646 +0627064A063106270646060C +0627064A0631062706460650 +0627064A063106270646064A +0627064A0646 +0628 +06280627 +0628062706310632 +06280627063206AF0634062A +0628062D062B +06280631062706480646200C06310627 +062806310627064A +0628063106310633064A +06280639062F0627064B +06280648062C0648062F +06280648062F +06280648062F060C +06280648062F0646062F +06280647 +0628064A0633062A +0628064A0646 +067E0631062F0627062E062A0647 +067E0631062F062706320645 +067E0633 +067E064A06480633062A +062A0627 +062A06270631064A062E +062A0623062B064A0631 +062A06280631064A0632 +062A062D062A +062A0631 +062A0634062E064A0635 +062A064106270648062A +062A064106A906510631 +062A0642064A +062A0642064A200C06320627062F0647 +062A0645062F06510646 +062A064606470627 +062A064806270646 +062C064606AF +062C064706270646 +068606340645 +0686064706310647 +062D06270644062A +062D062F0651 +062D062F0648062F +062D06330646 +062D064806320647 +062E0627064606480627062F06AF064A +062E064806270646062F0647 +062E06480631062F +062F0627062F +062F06270631062F +062F062706460634 +062F062706460634062C0648064A06270646064A +062F06270646063406AF06270647 +062F0631 +062F0633062A +062F06390648062A0650 +062F064406280633062A0647 +062F0646064A0633064F0646 +062F0648 +062F06480628062706310647 +062F064806310647 +062F06480644062A +062F064806510645 +062F064A06AF0631 +06310627 +063106270633 +06310641062A +063106470628063106270646 +06320627062F0647 +0698062706460648064A0647 +063306500631 +063306270644 +06330627064406AF064A060C +06330641064A0631 +0633064A06270633064A +0633064A0651062F +06340627064A062F +0634062E0635064A0651062A064A +0634062F +0634062F0647 +063406470631 +06350641062D0627062A +0637063106270632 +0639063106350647 +063906A90633 +063906440645 +063906440645064A +0639064406480645200C063406310642064A +06390645064400BB +063906480636060C +063A064406280647 +064106310647064606AF +0642063106270631 +06420648064A +06A90627063106470627064A +06A906270631064A +06A90627064506440627064B +06A90627064606480646 +06A9062A06270628 +06A90631062F0646062F +06A9064506280631064A062C +06A9064806340634 +06A90647 +06AF +06AF06310641062A0647 +06AF06310645064A +06440646062F0646 +064506270646062F +0645062C06440633 +0645062D064206510642 +0645062E062A06270631 +0645062F063106330647 +0645063306270639062F +064506340631064806370647 +06450635064506510645 +06450642062706440627062A +06450646 +06450646062A06340631 +06450646062A06420644 +064506480631062F +064506470645 +06450647064506270646 +0645064A +0645064A200C062F0647062F060C +0646062706450647 +064606280648062F060C +064606330628062A +0646063406270646 +064606380631 +064606450627064A0646062F0647 +064606480634062A0647 +064606470636062A +0646064A0632 +0648 +0648067E0646062C +06480632064A0631 +06480644064A +0648064A +0648064A06980647 +064706500646064A064606AF +0647063106860646062F +06470645 +0647064506270646 +0647064506330631 +06470645063306310634 +064706450647 +0647064606AF06270645064A +0647064A0626062A +064A062706310634062706370631 +064A06A9 +064A06A9062F064A06AF0631 +064A06A9064A +DROP TABLE t1; +CREATE TABLE t1 ( +a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_persian_ci, +offs INT NOT NULL +); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +Warning 3778 'utf8_persian_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. +INSERT INTO t1 VALUES +(_ucs2 0x066D, 1),(_ucs2 0x064E, 2),(_ucs2 0xFE76, 3),(_ucs2 0xFE77, 4), +(_ucs2 0x0650, 5),(_ucs2 0xFE7A, 6),(_ucs2 0xFE7B, 7),(_ucs2 0x064F, 8), +(_ucs2 0xFE78, 9),(_ucs2 0xFE79,10),(_ucs2 0x064B,11),(_ucs2 0xFE70,12), +(_ucs2 0xFE71,13),(_ucs2 0x064D,14),(_ucs2 0xFE74,15),(_ucs2 0x064C,16), +(_ucs2 0xFE72,17), +(_ucs2 0xFE7F, 1),(_ucs2 0x0653, 2),(_ucs2 0x0654, 3),(_ucs2 0x0655, 4), +(_ucs2 0x0670, 5), +(_ucs2 0x0669, 1),(_ucs2 0x0622, 2),(_ucs2 0x0627, 3),(_ucs2 0x0671, 4), +(_ucs2 0x0621, 5),(_ucs2 0x0623, 6),(_ucs2 0x0625, 7),(_ucs2 0x0624, 8), +(_ucs2 0x0626, 9), +(_ucs2 0x0642, 1),(_ucs2 0x06A9, 2),(_ucs2 0x0643, 3), +(_ucs2 0x0648, 1),(_ucs2 0x0647, 2),(_ucs2 0x0629, 3),(_ucs2 0x06C0, 4), +(_ucs2 0x06CC, 5),(_ucs2 0x0649, 6),(_ucs2 0x064A, 7), +(_ucs2 0xFE80, 1),(_ucs2 0xFE81, 2),(_ucs2 0xFE82, 3),(_ucs2 0xFE8D, 4), +(_ucs2 0xFE8E, 5),(_ucs2 0xFB50, 6),(_ucs2 0xFB51, 7),(_ucs2 0xFE80, 8), +(_ucs2 0xFE83, 9),(_ucs2 0xFE84,10),(_ucs2 0xFE87,11),(_ucs2 0xFE88,12), +(_ucs2 0xFE85,13),(_ucs2 0xFE86,14),(_ucs2 0x0689,16),(_ucs2 0x068A,17), +(_ucs2 0xFEAE, 1),(_ucs2 0xFDFC, 2), +(_ucs2 0xFED8, 1),(_ucs2 0xFB8E, 2),(_ucs2 0xFB8F, 3),(_ucs2 0xFB90, 4), +(_ucs2 0xFB91, 5),(_ucs2 0xFED9, 6),(_ucs2 0xFEDA, 7),(_ucs2 0xFEDB, 8), +(_ucs2 0xFEDC, 9), +(_ucs2 0xFEEE, 1),(_ucs2 0xFEE9, 2),(_ucs2 0xFEEA, 3),(_ucs2 0xFEEB, 4), +(_ucs2 0xFEEC, 5),(_ucs2 0xFE93, 6),(_ucs2 0xFE94, 7),(_ucs2 0xFBA4, 8), +(_ucs2 0xFBA5, 9),(_ucs2 0xFBFC,10),(_ucs2 0xFBFD,11),(_ucs2 0xFBFE,12), +(_ucs2 0xFBFF,13),(_ucs2 0xFEEF,14),(_ucs2 0xFEF0,15),(_ucs2 0xFEF1,16), +(_ucs2 0xFEF2,17),(_ucs2 0xFEF3,18),(_ucs2 0xFEF4,19),(_ucs2 0xFEF5,20), +(_ucs2 0xFEF6,21),(_ucs2 0xFEF7,22),(_ucs2 0xFEF8,23),(_ucs2 0xFEF9,24), +(_ucs2 0xFEFA,25),(_ucs2 0xFEFB,26),(_ucs2 0xFEFC,27); +SELECT HEX(CONVERT(a USING ucs2)), offs, hex(weight_string(a)), a +FROM t1 ORDER BY a, offs, BINARY a; +HEX(CONVERT(a USING ucs2)) offs hex(weight_string(a)) a +0653 2 0001 ٓ +0654 3 0002 ٔ +0655 4 0003 ٕ +0670 5 0004 ٰ +FE7F 1 ﹿ +066D 1 02CB ٭ +064E 2 02CC َ +FE76 3 02CD ﹶ +FE77 4 02CE ﹷ +0650 5 02CF ِ +FE7A 6 02D0 ﹺ +FE7B 7 02D1 ﹻ +064F 8 02D2 ُ +FE78 9 02D3 ﹸ +FE79 10 02D4 ﹹ +064B 11 02D5 ً +FE70 12 02D6 ﹰ +FE71 13 02D7 ﹱ +064D 14 02D8 ٍ +FE74 15 02D9 ﹴ +064C 16 02DA ٌ +FE72 17 02DB ﹲ +0669 1 0E32 ٩ +0622 2 0E33 آ +0627 3 0E34 ا +0671 4 0E35 ٱ +0621 5 0E36 ء +0623 6 0E37 أ +0625 7 0E38 إ +0624 8 0E39 ؤ +0626 9 0E3A ئ +FE81 2 1348 ﺁ +FE82 3 1349 ﺂ +FE8D 4 134A ﺍ +FE8E 5 134B ﺎ +FB50 6 134C ﭐ +FB51 7 134D ﭑ +FE80 1 134E ﺀ +FE80 8 134E ﺀ +FE83 9 134F ﺃ +FE84 10 1350 ﺄ +FE87 11 1351 ﺇ +FE88 12 1352 ﺈ +FE85 13 1353 ﺅ +FE86 14 1354 ﺆ +0689 16 1355 ډ +068A 17 1356 ڊ +FEAE 1 1375 ﺮ +FDFC 2 1376 ﷼ +0642 1 139B ق +FED8 1 139B ﻘ +06A9 2 139C ک +FB8E 2 139C ﮎ +0643 3 139D ك +FB8F 3 139D ﮏ +FB90 4 139E ﮐ +FB91 5 139F ﮑ +FED9 6 13A0 ﻙ +FEDA 7 13A1 ﻚ +FEDB 8 13A2 ﻛ +FEDC 9 13A3 ﻜ +0648 1 13BD و +FEEE 1 13BD ﻮ +0647 2 13BE ه +FEE9 2 13BE ﻩ +0629 3 13BF ة +FEEA 3 13BF ﻪ +06C0 4 13C0 ۀ +FEEB 4 13C0 ﻫ +06CC 5 13C1 ی +FEEC 5 13C1 ﻬ +0649 6 13C2 ى +FE93 6 13C2 ﺓ +064A 7 13C3 ي +FE94 7 13C3 ﺔ +FBA4 8 13C4 ﮤ +FBA5 9 13C5 ﮥ +FBFC 10 13C6 ﯼ +FBFD 11 13C7 ﯽ +FBFE 12 13C8 ﯾ +FBFF 13 13C9 ﯿ +FEEF 14 13CA ﻯ +FEF0 15 13CB ﻰ +FEF1 16 13CC ﻱ +FEF2 17 13CD ﻲ +FEF3 18 13CE ﻳ +FEF4 19 13CF ﻴ +FEF5 20 13D0 ﻵ +FEF6 21 13D1 ﻶ +FEF7 22 13D2 ﻷ +FEF8 23 13D3 ﻸ +FEF9 24 13D4 ﻹ +FEFA 25 13D5 ﻺ +FEFB 26 13D6 ﻻ +FEFC 27 13D7 ﻼ +DROP TABLE t1; +SET @test_character_set= 'utf8'; +SET @test_collation= 'utf8_swedish_ci'; +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET @safe_character_set_client= @@character_set_client; +SET @safe_character_set_results= @@character_set_results; +SET character_set_server= @test_character_set; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SET collation_server= @test_collation; +Warnings: +Warning 3778 'utf8_swedish_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. +CREATE DATABASE d1; +USE d1; +CREATE TABLE t1 (c CHAR(10), KEY(c)); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c char(10) utf8_swedish_ci YES MUL NULL +INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +want3results +aaa +aaaa +aaaaa +DROP TABLE t1; +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c1 varchar(15) utf8_swedish_ci YES MUL NULL +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +want3results +location +loberge +lotre +SELECT c1 as want3results from t1 where c1 like 'lo%'; +want3results +location +loberge +lotre +SELECT c1 as want1result from t1 where c1 like 'loc%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'loca%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locat%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locati%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'location%'; +want1result +location +DROP TABLE t1; +create table t1 (a set('a') not null); +insert ignore into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +select 1 from t1 order by cast(a as char(1)); +1 +1 +1 +drop table t1; +set names utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +create table t1 ( +name varchar(10), +level smallint unsigned); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `name` varchar(10) COLLATE utf8_swedish_ci DEFAULT NULL, + `level` smallint unsigned DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_swedish_ci +insert into t1 values ('string',1); +select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; +concat(name,space(level)) concat(name, repeat(' ',level)) +string string +drop table t1; +DROP DATABASE d1; +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; +SET character_set_client= @safe_character_set_client; +Warnings: +Warning 1287 'utf8mb3' is deprecated and will be removed in a future release. Please use utf8mb4 instead +SET character_set_results= @safe_character_set_results; +Warnings: +Warning 1287 'utf8mb3' is deprecated and will be removed in a future release. Please use utf8mb4 instead +create table t1 (a varchar(1)) character set utf8 collate utf8_estonian_ci; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +Warning 3778 'utf8_estonian_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. +insert into t1 values ('A'),('B'),('C'),('a'),('b'),('c'); +select a, a regexp '[a]' from t1 order by binary a; +a a regexp '[a]' +A 1 +B 0 +C 0 +a 1 +b 0 +c 0 +drop table t1; +SET collation_connection='utf8_unicode_ci'; +Warnings: +Warning 3778 'utf8_unicode_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +utf8_unicode_ci 6109 +utf8_unicode_ci 61 +utf8_unicode_ci 6120 +drop table t1; +select @@collation_connection; +@@collation_connection +utf8_unicode_ci +create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ; +insert into t1 values('abcdef'); +insert into t1 values('_bcdef'); +insert into t1 values('a_cdef'); +insert into t1 values('ab_def'); +insert into t1 values('abc_ef'); +insert into t1 values('abcd_f'); +insert into t1 values('abcde_'); +select c1 as c1u from t1 where c1 like 'ab\_def'; +c1u +ab_def +select c1 as c2h from t1 where c1 like 'ab#_def' escape '#'; +c2h +ab_def +drop table t1; +"BEGIN ctype_german.inc" +drop table if exists t1; +create table t1 as select repeat(' ', 64) as s1; +select collation(s1) from t1; +collation(s1) +utf8_unicode_ci +delete from t1; +INSERT INTO t1 VALUES ('ud'),('uf'); +INSERT INTO t1 VALUES ('od'),('of'); +INSERT INTO t1 VALUES ('e'); +INSERT INTO t1 VALUES ('ad'),('af'); +insert into t1 values ('a'),('ae'),(_latin1 0xE4); +insert into t1 values ('o'),('oe'),(_latin1 0xF6); +insert into t1 values ('s'),('ss'),(_latin1 0xDF); +insert into t1 values ('u'),('ue'),(_latin1 0xFC); +INSERT INTO t1 VALUES (_latin1 0xE6), (_latin1 0xC6); +INSERT INTO t1 VALUES (_latin1 0x9C), (_latin1 0x8C); +select s1, hex(s1) from t1 order by s1, binary s1; +s1 hex(s1) +a 61 +ä C3A4 +ad 6164 +ae 6165 +af 6166 +Æ C386 +æ C3A6 +e 65 +o 6F +ö C3B6 +od 6F64 +oe 6F65 +Œ C592 +œ C593 +of 6F66 +s 73 +ss 7373 +ß C39F +u 75 +ü C3BC +ud 7564 +ue 7565 +uf 7566 +select group_concat(s1 order by binary s1) from t1 group by s1; +group_concat(s1 order by binary s1) +a,ä +ad +ae +af +Æ,æ +e +o,ö +od +oe,Œ,œ +of +s +ss,ß +u,ü +ud +ue +uf +SELECT s1, hex(s1), hex(weight_string(s1)) FROM t1 ORDER BY s1, BINARY(s1); +s1 hex(s1) hex(weight_string(s1)) +a 61 0E33 +ä C3A4 0E33 +ad 6164 0E330E6D +ae 6165 0E330E8B +af 6166 0E330EB9 +Æ C386 0E38 +æ C3A6 0E38 +e 65 0E8B +o 6F 0F82 +ö C3B6 0F82 +od 6F64 0F820E6D +oe 6F65 0F820E8B +Œ C592 0F820E8B +œ C593 0F820E8B +of 6F66 0F820EB9 +s 73 0FEA +ss 7373 0FEA0FEA +ß C39F 0FEA0FEA +u 75 101F +ü C3BC 101F +ud 7564 101F0E6D +ue 7565 101F0E8B +uf 7566 101F0EB9 +SELECT s1, hex(s1) FROM t1 WHERE s1='ae' ORDER BY s1, BINARY(s1); +s1 hex(s1) +ae 6165 +drop table t1; +"END ctype_german.inc" +CREATE TABLE t1 (id int, a varchar(30) character set utf8); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (1, _ucs2 0x01310069), (2, _ucs2 0x01310131); +INSERT INTO t1 VALUES (3, _ucs2 0x00690069), (4, _ucs2 0x01300049); +INSERT INTO t1 VALUES (5, _ucs2 0x01300130), (6, _ucs2 0x00490049); +SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu +FROM t1 ORDER BY id; +a la l ll u lu +ıi 3 ıi 3 II 2 +ıı 4 ıı 4 II 2 +ii 2 ii 2 II 2 +İI 3 ii 2 İI 3 +İİ 4 ii 2 İİ 4 +II 2 ii 2 II 2 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +ALTER TABLE t1 MODIFY a VARCHAR(30) character set utf8 collate utf8_turkish_ci; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +Warning 3778 'utf8_turkish_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. +SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu +FROM t1 ORDER BY id; +a la l ll u lu +ıi 3 ıi 3 Iİ 3 +ıı 4 ıı 4 II 2 +ii 2 ii 2 İİ 4 +İI 3 iı 3 İI 3 +İİ 4 ii 2 İİ 4 +II 2 ıı 4 II 2 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +DROP TABLE t1; +set names utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +create table t1 ( +a varchar(255), +key a(a) +) character set utf8 collate utf8_danish_ci; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +Warning 3778 'utf8_danish_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. +insert into t1 values ('åaaaa'),('ååaaa'),('aaaaa'); +select a as like_a from t1 where a like 'a%'; +like_a +aaaaa +select a as like_aa from t1 where a like 'aa%'; +like_aa +aaaaa +select a as like_aaa from t1 where a like 'aaa%'; +like_aaa +aaaaa +select a as like_aaaa from t1 where a like 'aaaa%'; +like_aaaa +aaaaa +select a as like_aaaaa from t1 where a like 'aaaaa%'; +like_aaaaa +aaaaa +alter table t1 convert to character set ucs2 collate ucs2_danish_ci; +select a as like_a from t1 where a like 'a%'; +like_a +aaaaa +select a as like_aa from t1 where a like 'aa%'; +like_aa +aaaaa +select a as like_aaa from t1 where a like 'aaa%'; +like_aaa +aaaaa +select a as like_aaaa from t1 where a like 'aaaa%'; +like_aaaa +aaaaa +select a as like_aaaaa from t1 where a like 'aaaaa%'; +like_aaaaa +aaaaa +drop table t1; +create table t1 ( +a varchar(255), +key(a) +) character set utf8 collate utf8_spanish2_ci; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +Warning 3778 'utf8_spanish2_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. +insert into t1 values ('aaaaa'),('lllll'),('zzzzz'); +select a as like_l from t1 where a like 'l%'; +like_l +lllll +select a as like_ll from t1 where a like 'll%'; +like_ll +lllll +select a as like_lll from t1 where a like 'lll%'; +like_lll +lllll +select a as like_llll from t1 where a like 'llll%'; +like_llll +lllll +select a as like_lllll from t1 where a like 'lllll%'; +like_lllll +lllll +alter table t1 convert to character set ucs2 collate ucs2_spanish2_ci; +select a as like_l from t1 where a like 'l%'; +like_l +lllll +select a as like_ll from t1 where a like 'll%'; +like_ll +lllll +select a as like_lll from t1 where a like 'lll%'; +like_lll +lllll +select a as like_llll from t1 where a like 'llll%'; +like_llll +lllll +select a as like_lllll from t1 where a like 'lllll%'; +like_lllll +lllll +drop table t1; +create table t1 ( +a varchar(255), +key a(a) +) character set utf8 collate utf8_czech_ci; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +Warning 3778 'utf8_czech_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. +insert into t1 values +('b'),('c'),('d'),('e'),('f'),('g'),('h'),('ch'),('i'),('j'); +select * from t1 where a like 'c%'; +a +c +ch +alter table t1 convert to character set ucs2 collate ucs2_czech_ci; +select * from t1 where a like 'c%'; +a +c +ch +drop table t1; +set collation_connection=ucs2_unicode_ci; +drop table if exists t1; +create table t1 as +select repeat(' ', 64) as s1, repeat(' ',64) as s2 +union +select null, null; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `s1` varchar(64) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci DEFAULT NULL, + `s2` varchar(64) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci DEFAULT NULL +) ENGINE=default_engine DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +delete from t1; +insert into t1 values('aaa','aaa'); +insert into t1 values('aaa|qqq','qqq'); +insert into t1 values('gheis','^[^a-dXYZ]+$'); +insert into t1 values('aab','^aa?b'); +insert into t1 values('Baaan','^Ba*n'); +insert into t1 values('aaa','qqq|aaa'); +insert into t1 values('qqq','qqq|aaa'); +insert into t1 values('bbb','qqq|aaa'); +insert into t1 values('bbb','qqq'); +insert into t1 values('aaa','aba'); +insert into t1 values(null,'abc'); +insert into t1 values('def',null); +insert into t1 values(null,null); +select HIGH_PRIORITY s1 regexp s2 from t1; +s1 regexp s2 +1 +1 +1 +1 +1 +1 +1 +0 +0 +0 +NULL +NULL +NULL +SELECT 'ghi' REGEXP 'ghi['; +ERROR HY000: The regular expression contains an unclosed bracket expression. +drop table t1; +CREATE TABLE t1 AS +SELECT 10 AS a, REPEAT('a',20) AS b, REPEAT('a',8) AS c, REPEAT('a',8) AS d; +ALTER TABLE t1 ADD PRIMARY KEY(a), ADD KEY(b); +INSERT INTO t1 (a, b) VALUES (1, repeat(0xF1F2,5)); +INSERT INTO t1 (a, b) VALUES (2, repeat(0xF1F2,10)); +INSERT INTO t1 (a, b) VALUES (3, repeat(0xF1F2,11)); +INSERT INTO t1 (a, b) VALUES (4, repeat(0xF1F2,12)); +SELECT hex(concat(repeat(0xF1F2, 10), '%')); +hex(concat(repeat(0xF1F2, 10), '%')) +F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F20025 +3 rows expected +SELECT a, hex(b), c FROM t1 WHERE b LIKE concat(repeat(0xF1F2,10), '%'); +a hex(b) c +2 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL +3 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL +4 F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2F1F2 NULL +DROP TABLE t1; +set names utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +End for 5.0 tests +End of 5.1 tests +# +# Start of 5.5 tests +# +SET collation_connection=utf8_czech_ci; +Warnings: +Warning 3778 'utf8_czech_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. +SELECT @@collation_connection; +@@collation_connection +utf8_czech_ci +# +# Bug#57737 Character sets: search fails with like, contraction, index +# +CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0; +INSERT INTO t1 VALUES ('c'),('ce'),('cé'),('ch'); +SELECT * FROM t1 WHERE s1 LIKE 'c%'; +s1 +c +ce +cé +ch +ALTER TABLE t1 ADD KEY s1 (s1); +SELECT * FROM t1 WHERE s1 LIKE 'c%'; +s1 +c +ce +cé +ch +ALTER TABLE t1 DROP KEY s1, ADD KEY(s1(1)); +SELECT * FROM t1 WHERE s1 LIKE 'ch'; +s1 +ch +DROP TABLE t1; +SELECT @@collation_connection; +@@collation_connection +utf8_czech_ci +# +# Bug#57737 Character sets: search fails with like, contraction, index +# Part#2 - ignorable characters +# +CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0; +INSERT INTO t1 VALUES ('a\0\0\0\0\0\t'),('a'),('b'),('c'),('d'),('e'); +SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%'; +HEX(s1) +61000000000009 +61 +ALTER TABLE t1 ADD KEY s1 (s1); +SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%'; +HEX(s1) +61000000000009 +61 +DROP TABLE t1; +SET collation_connection=ucs2_czech_ci; +SELECT @@collation_connection; +@@collation_connection +ucs2_czech_ci +# +# Bug#57737 Character sets: search fails with like, contraction, index +# +CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0; +INSERT INTO t1 VALUES ('c'),('ce'),('cé'),('ch'); +SELECT * FROM t1 WHERE s1 LIKE 'c%'; +s1 +c +ce +cé +ch +ALTER TABLE t1 ADD KEY s1 (s1); +SELECT * FROM t1 WHERE s1 LIKE 'c%'; +s1 +c +ce +cé +ch +ALTER TABLE t1 DROP KEY s1, ADD KEY(s1(1)); +SELECT * FROM t1 WHERE s1 LIKE 'ch'; +s1 +ch +DROP TABLE t1; +SELECT @@collation_connection; +@@collation_connection +ucs2_czech_ci +# +# Bug#57737 Character sets: search fails with like, contraction, index +# Part#2 - ignorable characters +# +CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0; +INSERT INTO t1 VALUES ('a\0\0\0\0\0\t'),('a'),('b'),('c'),('d'),('e'); +SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%'; +HEX(s1) +0061000000000000000000000009 +0061 +ALTER TABLE t1 ADD KEY s1 (s1); +SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%'; +HEX(s1) +0061000000000000000000000009 +0061 +DROP TABLE t1; +# +# End of 5.5 tests +# +# +# Start of 5.6 tests +# +# +# WL#3664 WEIGHT_STRING +# +set collation_connection=ucs2_unicode_ci; +select @@collation_connection; +@@collation_connection +ucs2_unicode_ci +select hex(weight_string('a')); +hex(weight_string('a')) +0E33 +select hex(weight_string('A')); +hex(weight_string('A')) +0E33 +select hex(weight_string('abc')); +hex(weight_string('abc')) +0E330E4A0E60 +select hex(weight_string('abc' as char(2))); +hex(weight_string('abc' as char(2))) +0E330E4A +select hex(weight_string('abc' as char(3))); +hex(weight_string('abc' as char(3))) +0E330E4A0E60 +select hex(weight_string('abc' as char(5))); +hex(weight_string('abc' as char(5))) +0E330E4A0E6002090209 +select hex(weight_string('abc', 1, 2, 0xC0)); +hex(weight_string('abc', 1, 2, 0xC0)) +0E +select hex(weight_string('abc', 2, 2, 0xC0)); +hex(weight_string('abc', 2, 2, 0xC0)) +0E33 +select hex(weight_string('abc', 3, 2, 0xC0)); +hex(weight_string('abc', 3, 2, 0xC0)) +0E330E +select hex(weight_string('abc', 4, 2, 0xC0)); +hex(weight_string('abc', 4, 2, 0xC0)) +0E330E4A +select hex(weight_string('abc', 5, 2, 0xC0)); +hex(weight_string('abc', 5, 2, 0xC0)) +0E330E4A02 +select hex(weight_string('abc',25, 2, 0xC0)); +hex(weight_string('abc',25, 2, 0xC0)) +0E330E4A020902090209020902090209020902090209020902 +select hex(weight_string('abc', 1, 3, 0xC0)); +hex(weight_string('abc', 1, 3, 0xC0)) +0E +select hex(weight_string('abc', 2, 3, 0xC0)); +hex(weight_string('abc', 2, 3, 0xC0)) +0E33 +select hex(weight_string('abc', 3, 3, 0xC0)); +hex(weight_string('abc', 3, 3, 0xC0)) +0E330E +select hex(weight_string('abc', 4, 3, 0xC0)); +hex(weight_string('abc', 4, 3, 0xC0)) +0E330E4A +select hex(weight_string('abc', 5, 3, 0xC0)); +hex(weight_string('abc', 5, 3, 0xC0)) +0E330E4A0E +select hex(weight_string('abc',25, 3, 0xC0)); +hex(weight_string('abc',25, 3, 0xC0)) +0E330E4A0E6002090209020902090209020902090209020902 +select hex(weight_string('abc', 1, 4, 0xC0)); +hex(weight_string('abc', 1, 4, 0xC0)) +0E +select hex(weight_string('abc', 2, 4, 0xC0)); +hex(weight_string('abc', 2, 4, 0xC0)) +0E33 +select hex(weight_string('abc', 3, 4, 0xC0)); +hex(weight_string('abc', 3, 4, 0xC0)) +0E330E +select hex(weight_string('abc', 4, 4, 0xC0)); +hex(weight_string('abc', 4, 4, 0xC0)) +0E330E4A +select hex(weight_string('abc', 5, 4, 0xC0)); +hex(weight_string('abc', 5, 4, 0xC0)) +0E330E4A0E +select hex(weight_string('abc',25, 4, 0xC0)); +hex(weight_string('abc',25, 4, 0xC0)) +0E330E4A0E6002090209020902090209020902090209020902 +select @@collation_connection; +@@collation_connection +ucs2_unicode_ci +select hex(weight_string(cast(_latin1 0x80 as char))); +hex(weight_string(cast(_latin1 0x80 as char))) +0E23 +select hex(weight_string(cast(_latin1 0x808080 as char))); +hex(weight_string(cast(_latin1 0x808080 as char))) +0E230E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char) as char(2))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(2))) +0E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char) as char(3))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(3))) +0E230E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char) as char(5))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(5))) +0E230E230E2302090209 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)) +0E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)) +0E230E +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)) +0E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)) +0E230E2302 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)) +0E230E23020902090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)) +0E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)) +0E230E +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)) +0E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)) +0E230E230E +select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)) +0E230E230E2302090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)) +0E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)) +0E230E +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)) +0E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)) +0E230E230E +select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)) +0E230E230E2302090209020902090209020902090209020902 +set @@collation_connection=utf8_unicode_ci; +Warnings: +Warning 3778 'utf8_unicode_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. +select @@collation_connection; +@@collation_connection +utf8_unicode_ci +select hex(weight_string('a')); +hex(weight_string('a')) +0E33 +select hex(weight_string('A')); +hex(weight_string('A')) +0E33 +select hex(weight_string('abc')); +hex(weight_string('abc')) +0E330E4A0E60 +select hex(weight_string('abc' as char(2))); +hex(weight_string('abc' as char(2))) +0E330E4A +select hex(weight_string('abc' as char(3))); +hex(weight_string('abc' as char(3))) +0E330E4A0E60 +select hex(weight_string('abc' as char(5))); +hex(weight_string('abc' as char(5))) +0E330E4A0E6002090209 +select hex(weight_string('abc', 1, 2, 0xC0)); +hex(weight_string('abc', 1, 2, 0xC0)) +0E +select hex(weight_string('abc', 2, 2, 0xC0)); +hex(weight_string('abc', 2, 2, 0xC0)) +0E33 +select hex(weight_string('abc', 3, 2, 0xC0)); +hex(weight_string('abc', 3, 2, 0xC0)) +0E330E +select hex(weight_string('abc', 4, 2, 0xC0)); +hex(weight_string('abc', 4, 2, 0xC0)) +0E330E4A +select hex(weight_string('abc', 5, 2, 0xC0)); +hex(weight_string('abc', 5, 2, 0xC0)) +0E330E4A02 +select hex(weight_string('abc',25, 2, 0xC0)); +hex(weight_string('abc',25, 2, 0xC0)) +0E330E4A020902090209020902090209020902090209020902 +select hex(weight_string('abc', 1, 3, 0xC0)); +hex(weight_string('abc', 1, 3, 0xC0)) +0E +select hex(weight_string('abc', 2, 3, 0xC0)); +hex(weight_string('abc', 2, 3, 0xC0)) +0E33 +select hex(weight_string('abc', 3, 3, 0xC0)); +hex(weight_string('abc', 3, 3, 0xC0)) +0E330E +select hex(weight_string('abc', 4, 3, 0xC0)); +hex(weight_string('abc', 4, 3, 0xC0)) +0E330E4A +select hex(weight_string('abc', 5, 3, 0xC0)); +hex(weight_string('abc', 5, 3, 0xC0)) +0E330E4A0E +select hex(weight_string('abc',25, 3, 0xC0)); +hex(weight_string('abc',25, 3, 0xC0)) +0E330E4A0E6002090209020902090209020902090209020902 +select hex(weight_string('abc', 1, 4, 0xC0)); +hex(weight_string('abc', 1, 4, 0xC0)) +0E +select hex(weight_string('abc', 2, 4, 0xC0)); +hex(weight_string('abc', 2, 4, 0xC0)) +0E33 +select hex(weight_string('abc', 3, 4, 0xC0)); +hex(weight_string('abc', 3, 4, 0xC0)) +0E330E +select hex(weight_string('abc', 4, 4, 0xC0)); +hex(weight_string('abc', 4, 4, 0xC0)) +0E330E4A +select hex(weight_string('abc', 5, 4, 0xC0)); +hex(weight_string('abc', 5, 4, 0xC0)) +0E330E4A0E +select hex(weight_string('abc',25, 4, 0xC0)); +hex(weight_string('abc',25, 4, 0xC0)) +0E330E4A0E6002090209020902090209020902090209020902 +select @@collation_connection; +@@collation_connection +utf8_unicode_ci +select hex(weight_string(cast(_latin1 0x80 as char))); +hex(weight_string(cast(_latin1 0x80 as char))) +0E23 +select hex(weight_string(cast(_latin1 0x808080 as char))); +hex(weight_string(cast(_latin1 0x808080 as char))) +0E230E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char) as char(2))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(2))) +0E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char) as char(3))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(3))) +0E230E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char) as char(5))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(5))) +0E230E230E2302090209 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)) +0E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)) +0E230E +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)) +0E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)) +0E230E2302 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)) +0E230E23020902090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)) +0E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)) +0E230E +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)) +0E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)) +0E230E230E +select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)) +0E230E230E2302090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)) +0E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)) +0E230E +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)) +0E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)) +0E230E230E +select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)) +0E230E230E2302090209020902090209020902090209020902 +set @@collation_connection=utf8_czech_ci; +Warnings: +Warning 3778 'utf8_czech_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. +select @@collation_connection; +@@collation_connection +utf8_czech_ci +select collation(cast(_latin1 0xDF as char)); +collation(cast(_latin1 0xDF as char)) +utf8_czech_ci +select hex(weight_string('s')); +hex(weight_string('s')) +0FEA +select hex(weight_string(cast(_latin1 0xDF as char))); +hex(weight_string(cast(_latin1 0xDF as char))) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF as char) as char(1))); +hex(weight_string(cast(_latin1 0xDF as char) as char(1))) +0FEA0FEA +select hex(weight_string('c')); +hex(weight_string('c')) +0E60 +select hex(weight_string('h')); +hex(weight_string('h')) +0EE1 +select hex(weight_string('ch')); +hex(weight_string('ch')) +0EE2 +select hex(weight_string('i')); +hex(weight_string('i')) +0EFB +select hex(weight_string(cast(_latin1 0x6368DF as char))); +hex(weight_string(cast(_latin1 0x6368DF as char))) +0EE20FEA0FEA +select hex(weight_string(cast(_latin1 0x6368DF as char) as char(1))); +hex(weight_string(cast(_latin1 0x6368DF as char) as char(1))) +0E60 +select hex(weight_string(cast(_latin1 0x6368DF as char) as char(2))); +hex(weight_string(cast(_latin1 0x6368DF as char) as char(2))) +0EE2 +select hex(weight_string(cast(_latin1 0x6368DF as char) as char(3))); +hex(weight_string(cast(_latin1 0x6368DF as char) as char(3))) +0EE20FEA0FEA +select hex(weight_string(cast(_latin1 0x6368DF as char) as char(4))); +hex(weight_string(cast(_latin1 0x6368DF as char) as char(4))) +0EE20FEA0FEA0209 +select hex(weight_string(cast(_latin1 0xDF6368 as char))); +hex(weight_string(cast(_latin1 0xDF6368 as char))) +0FEA0FEA0EE2 +select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(1))); +hex(weight_string(cast(_latin1 0xDF6368 as char) as char(1))) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(2))); +hex(weight_string(cast(_latin1 0xDF6368 as char) as char(2))) +0FEA0FEA0E60 +select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(3))); +hex(weight_string(cast(_latin1 0xDF6368 as char) as char(3))) +0FEA0FEA0EE2 +select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(4))); +hex(weight_string(cast(_latin1 0xDF6368 as char) as char(4))) +0FEA0FEA0EE20209 +select hex(weight_string(cast(_latin1 0x6368DF as char), 1, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 1, 2, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 2, 2, 0xC0)) +0EE2 +select hex(weight_string(cast(_latin1 0x6368DF as char), 3, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 3, 2, 0xC0)) +0EE202 +select hex(weight_string(cast(_latin1 0x6368DF as char), 4, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 4, 2, 0xC0)) +0EE20209 +select hex(weight_string(cast(_latin1 0x6368DF as char),25, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char),25, 2, 0xC0)) +0EE20209020902090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0x6368DF as char), 1, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 1, 3, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 2, 3, 0xC0)) +0EE2 +select hex(weight_string(cast(_latin1 0x6368DF as char), 3, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 3, 3, 0xC0)) +0EE20F +select hex(weight_string(cast(_latin1 0x6368DF as char), 4, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 4, 3, 0xC0)) +0EE20FEA +select hex(weight_string(cast(_latin1 0x6368DF as char),25, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char),25, 3, 0xC0)) +0EE20FEA0FEA02090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0x6368DF as char), 1, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 1, 4, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0)) +0EE2 +select hex(weight_string(cast(_latin1 0x6368DF as char), 3, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 3, 4, 0xC0)) +0EE20F +select hex(weight_string(cast(_latin1 0x6368DF as char), 4, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 4, 4, 0xC0)) +0EE20FEA +select hex(weight_string(cast(_latin1 0x6368DF as char),25, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char),25, 4, 0xC0)) +0EE20FEA0FEA02090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 2,0xC0)) +0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 2,0xC0)) +0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 2,0xC0)) +0FEA0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 2,0xC0)) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char),25, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char),25, 2,0xC0)) +0FEA0FEA0E6002090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 3,0xC0)) +0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 3,0xC0)) +0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 3,0xC0)) +0FEA0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 3,0xC0)) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char),25, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char),25, 3,0xC0)) +0FEA0FEA0EE202090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 4,0xC0)) +0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 4,0xC0)) +0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 4,0xC0)) +0FEA0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 4,0xC0)) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char),25, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char),25, 4,0xC0)) +0FEA0FEA0EE202090209020902090209020902090209020902 +set @@collation_connection=ucs2_czech_ci; +select @@collation_connection; +@@collation_connection +ucs2_czech_ci +select collation(cast(_latin1 0xDF as char)); +collation(cast(_latin1 0xDF as char)) +ucs2_czech_ci +select hex(weight_string('s')); +hex(weight_string('s')) +0FEA +select hex(weight_string(cast(_latin1 0xDF as char))); +hex(weight_string(cast(_latin1 0xDF as char))) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF as char) as char(1))); +hex(weight_string(cast(_latin1 0xDF as char) as char(1))) +0FEA0FEA +select hex(weight_string('c')); +hex(weight_string('c')) +0E60 +select hex(weight_string('h')); +hex(weight_string('h')) +0EE1 +select hex(weight_string('ch')); +hex(weight_string('ch')) +0EE2 +select hex(weight_string('i')); +hex(weight_string('i')) +0EFB +select hex(weight_string(cast(_latin1 0x6368DF as char))); +hex(weight_string(cast(_latin1 0x6368DF as char))) +0EE20FEA0FEA +select hex(weight_string(cast(_latin1 0x6368DF as char) as char(1))); +hex(weight_string(cast(_latin1 0x6368DF as char) as char(1))) +0E60 +select hex(weight_string(cast(_latin1 0x6368DF as char) as char(2))); +hex(weight_string(cast(_latin1 0x6368DF as char) as char(2))) +0EE2 +select hex(weight_string(cast(_latin1 0x6368DF as char) as char(3))); +hex(weight_string(cast(_latin1 0x6368DF as char) as char(3))) +0EE20FEA0FEA +select hex(weight_string(cast(_latin1 0x6368DF as char) as char(4))); +hex(weight_string(cast(_latin1 0x6368DF as char) as char(4))) +0EE20FEA0FEA0209 +select hex(weight_string(cast(_latin1 0xDF6368 as char))); +hex(weight_string(cast(_latin1 0xDF6368 as char))) +0FEA0FEA0EE2 +select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(1))); +hex(weight_string(cast(_latin1 0xDF6368 as char) as char(1))) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(2))); +hex(weight_string(cast(_latin1 0xDF6368 as char) as char(2))) +0FEA0FEA0E60 +select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(3))); +hex(weight_string(cast(_latin1 0xDF6368 as char) as char(3))) +0FEA0FEA0EE2 +select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(4))); +hex(weight_string(cast(_latin1 0xDF6368 as char) as char(4))) +0FEA0FEA0EE20209 +select hex(weight_string(cast(_latin1 0x6368DF as char), 1, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 1, 2, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 2, 2, 0xC0)) +0EE2 +select hex(weight_string(cast(_latin1 0x6368DF as char), 3, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 3, 2, 0xC0)) +0EE202 +select hex(weight_string(cast(_latin1 0x6368DF as char), 4, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 4, 2, 0xC0)) +0EE20209 +select hex(weight_string(cast(_latin1 0x6368DF as char),25, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char),25, 2, 0xC0)) +0EE20209020902090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0x6368DF as char), 1, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 1, 3, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 2, 3, 0xC0)) +0EE2 +select hex(weight_string(cast(_latin1 0x6368DF as char), 3, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 3, 3, 0xC0)) +0EE20F +select hex(weight_string(cast(_latin1 0x6368DF as char), 4, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 4, 3, 0xC0)) +0EE20FEA +select hex(weight_string(cast(_latin1 0x6368DF as char),25, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char),25, 3, 0xC0)) +0EE20FEA0FEA02090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0x6368DF as char), 1, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 1, 4, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0)) +0EE2 +select hex(weight_string(cast(_latin1 0x6368DF as char), 3, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 3, 4, 0xC0)) +0EE20F +select hex(weight_string(cast(_latin1 0x6368DF as char), 4, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 4, 4, 0xC0)) +0EE20FEA +select hex(weight_string(cast(_latin1 0x6368DF as char),25, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char),25, 4, 0xC0)) +0EE20FEA0FEA02090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 2,0xC0)) +0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 2,0xC0)) +0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 2,0xC0)) +0FEA0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 2,0xC0)) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char),25, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char),25, 2,0xC0)) +0FEA0FEA0E6002090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 3,0xC0)) +0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 3,0xC0)) +0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 3,0xC0)) +0FEA0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 3,0xC0)) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char),25, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char),25, 3,0xC0)) +0FEA0FEA0EE202090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 4,0xC0)) +0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 4,0xC0)) +0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 4,0xC0)) +0FEA0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 4,0xC0)) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char),25, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char),25, 4,0xC0)) +0FEA0FEA0EE202090209020902090209020902090209020902 +# +# Bug#33077 weight of supplementary characters is not 0xfffd +# +select hex(weight_string(_utf8mb4 0xF0908080 /* U+10000 */ collate utf8mb4_unicode_ci)); +hex(weight_string(_utf8mb4 0xF0908080 /* U+10000 */ collate utf8mb4_unicode_ci)) +FFFD +# +# Bug#53064 garbled data when using utf8_german2_ci collation +# +CREATE TABLE t1 (s1 VARCHAR(10) COLLATE utf8_german2_ci); +Warnings: +Warning 3778 'utf8_german2_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. +INSERT INTO t1 VALUES ('a'),('ae'),('af'); +SELECT s1,hex(s1),hex(weight_string(s1)) FROM t1 ORDER BY s1; +s1 hex(s1) hex(weight_string(s1)) +a 61 0E33 +ae 6165 0E330E8B +af 6166 0E330EB9 +DROP TABLE t1; +# +# WL#4013 Unicode german2 collation +# +SET collation_connection=utf8_german2_ci; +Warnings: +Warning 3778 'utf8_german2_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. +"BEGIN ctype_german.inc" +drop table if exists t1; +create table t1 as select repeat(' ', 64) as s1; +select collation(s1) from t1; +collation(s1) +utf8_german2_ci +delete from t1; +INSERT INTO t1 VALUES ('ud'),('uf'); +INSERT INTO t1 VALUES ('od'),('of'); +INSERT INTO t1 VALUES ('e'); +INSERT INTO t1 VALUES ('ad'),('af'); +insert into t1 values ('a'),('ae'),(_latin1 0xE4); +insert into t1 values ('o'),('oe'),(_latin1 0xF6); +insert into t1 values ('s'),('ss'),(_latin1 0xDF); +insert into t1 values ('u'),('ue'),(_latin1 0xFC); +INSERT INTO t1 VALUES (_latin1 0xE6), (_latin1 0xC6); +INSERT INTO t1 VALUES (_latin1 0x9C), (_latin1 0x8C); +select s1, hex(s1) from t1 order by s1, binary s1; +s1 hex(s1) +a 61 +ad 6164 +ae 6165 +Æ C386 +ä C3A4 +æ C3A6 +af 6166 +e 65 +o 6F +od 6F64 +oe 6F65 +ö C3B6 +Œ C592 +œ C593 +of 6F66 +s 73 +ss 7373 +ß C39F +u 75 +ud 7564 +ue 7565 +ü C3BC +uf 7566 +select group_concat(s1 order by binary s1) from t1 group by s1; +group_concat(s1 order by binary s1) +a +ad +ae,Æ,ä,æ +af +e +o +od +oe,ö,Œ,œ +of +s +ss,ß +u +ud +ue,ü +uf +SELECT s1, hex(s1), hex(weight_string(s1)) FROM t1 ORDER BY s1, BINARY(s1); +s1 hex(s1) hex(weight_string(s1)) +a 61 0E33 +ad 6164 0E330E6D +ae 6165 0E330E8B +Æ C386 0E330E8B +ä C3A4 0E330E8B +æ C3A6 0E330E8B +af 6166 0E330EB9 +e 65 0E8B +o 6F 0F82 +od 6F64 0F820E6D +oe 6F65 0F820E8B +ö C3B6 0F820E8B +Œ C592 0F820E8B +œ C593 0F820E8B +of 6F66 0F820EB9 +s 73 0FEA +ss 7373 0FEA0FEA +ß C39F 0FEA0FEA +u 75 101F +ud 7564 101F0E6D +ue 7565 101F0E8B +ü C3BC 101F0E8B +uf 7566 101F0EB9 +SELECT s1, hex(s1) FROM t1 WHERE s1='ae' ORDER BY s1, BINARY(s1); +s1 hex(s1) +ae 6165 +Æ C386 +ä C3A4 +æ C3A6 +drop table t1; +"END ctype_german.inc" +# +# WL#2673 Unicode Collation Algorithm new version +# +SET NAMES utf8mb4 COLLATE utf8mb4_unicode_520_ci; +CREATE TABLE t1 AS SELECT repeat('a', 10) as c LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +INSERT INTO t1 VALUES (_utf32 0x0180),(_utf32 0x023A); +INSERT INTO t1 VALUES (_utf32 0x023B),(_utf32 0x023C); +INSERT INTO t1 VALUES (_utf32 0x023D),(_utf32 0x023E); +INSERT INTO t1 VALUES (_utf32 0x0241),(_utf32 0x0242); +INSERT INTO t1 VALUES (_utf32 0x0243),(_utf32 0x0244); +INSERT INTO t1 VALUES (_utf32 0x0245),(_utf32 0x0246); +INSERT INTO t1 VALUES (_utf32 0x0247),(_utf32 0x0248); +INSERT INTO t1 VALUES (_utf32 0x0249),(_utf32 0x024A); +INSERT INTO t1 VALUES (_utf32 0x024B),(_utf32 0x024C); +INSERT INTO t1 VALUES (_utf32 0x024D),(_utf32 0x024E); +INSERT INTO t1 VALUES (_utf32 0x024F),(_utf32 0x026B); +INSERT INTO t1 VALUES (_utf32 0x027D),(_utf32 0x0289); +INSERT INTO t1 VALUES (_utf32 0x028C); +INSERT INTO t1 VALUES (_utf32 0x037B), (_utf32 0x037C); +INSERT INTO t1 VALUES (_utf32 0x037D), (_utf32 0x03FD); +INSERT INTO t1 VALUES (_utf32 0x03FE), (_utf32 0x03FF); +INSERT INTO t1 VALUES (_utf32 0x04C0), (_utf32 0x04CF); +INSERT INTO t1 VALUES (_utf32 0x04F6), (_utf32 0x04F7); +INSERT INTO t1 VALUES (_utf32 0x04FA), (_utf32 0x04FB); +INSERT INTO t1 VALUES (_utf32 0x04FC), (_utf32 0x04FD); +INSERT INTO t1 VALUES (_utf32 0x04FE), (_utf32 0x04FF); +INSERT INTO t1 VALUES (_utf32 0x0510), (_utf32 0x0511); +INSERT INTO t1 VALUES (_utf32 0x0512), (_utf32 0x0513); +INSERT INTO t1 VALUES (_utf32 0x10A0), (_utf32 0x10A1); +INSERT INTO t1 VALUES (_utf32 0x10A2), (_utf32 0x10A3); +INSERT INTO t1 VALUES (_utf32 0x10A4), (_utf32 0x10A5); +INSERT INTO t1 VALUES (_utf32 0x10A6), (_utf32 0x10A7); +INSERT INTO t1 VALUES (_utf32 0x2D00), (_utf32 0x2D01); +INSERT INTO t1 VALUES (_utf32 0x2D02), (_utf32 0x2D03); +INSERT INTO t1 VALUES (_utf32 0x2D04), (_utf32 0x2D05); +INSERT INTO t1 VALUES (_utf32 0x2D06), (_utf32 0x2D07); +INSERT INTO t1 VALUES (_utf32 0x1D7D); +INSERT INTO t1 VALUES (_utf32 0x2132),(_utf32 0x214E); +INSERT INTO t1 VALUES (_utf32 0x2183),(_utf32 0x2184); +INSERT INTO t1 VALUES (_utf32 0x2C80), (_utf32 0x2C81); +INSERT INTO t1 VALUES (_utf32 0x2C82), (_utf32 0x2C83); +INSERT INTO t1 VALUES (_utf32 0x2C84), (_utf32 0x2C85); +INSERT INTO t1 VALUES (_utf32 0x2C86), (_utf32 0x2C87); +INSERT INTO t1 VALUES (_utf32 0x2C88), (_utf32 0x2C89); +INSERT INTO t1 VALUES (_utf32 0x2C8A), (_utf32 0x2C8B); +INSERT INTO t1 VALUES (_utf32 0x2C8C), (_utf32 0x2C8D); +INSERT INTO t1 VALUES (_utf32 0x2C8E), (_utf32 0x2C8F); +INSERT INTO t1 VALUES (_utf32 0x2C60), (_utf32 0x2C61); +INSERT INTO t1 VALUES (_utf32 0x2C62), (_utf32 0x2C63); +INSERT INTO t1 VALUES (_utf32 0x2C64), (_utf32 0x2C65); +INSERT INTO t1 VALUES (_utf32 0x2C66), (_utf32 0x2C67); +INSERT INTO t1 VALUES (_utf32 0x2C68), (_utf32 0x2C69); +INSERT INTO t1 VALUES (_utf32 0x2C6A), (_utf32 0x2C6B); +INSERT INTO t1 VALUES (_utf32 0x2C6C), (_utf32 0x2C75); +INSERT INTO t1 VALUES (_utf32 0x2C76); +INSERT INTO t1 VALUES (_utf32 0x2C00), (_utf32 0x2C01); +INSERT INTO t1 VALUES (_utf32 0x2C02), (_utf32 0x2C03); +INSERT INTO t1 VALUES (_utf32 0x2C04), (_utf32 0x2C05); +INSERT INTO t1 VALUES (_utf32 0x2C06), (_utf32 0x2C07); +INSERT INTO t1 VALUES (_utf32 0x2C30), (_utf32 0x2C31); +INSERT INTO t1 VALUES (_utf32 0x2C32), (_utf32 0x2C33); +INSERT INTO t1 VALUES (_utf32 0x2C34), (_utf32 0x2C35); +INSERT INTO t1 VALUES (_utf32 0x2C36), (_utf32 0x2C37); +INSERT INTO t1 VALUES (_utf32 0x10400), (_utf32 0x10401); +INSERT INTO t1 VALUES (_utf32 0x10402), (_utf32 0x10403); +INSERT INTO t1 VALUES (_utf32 0x10404), (_utf32 0x10405); +INSERT INTO t1 VALUES (_utf32 0x10406), (_utf32 0x10407); +INSERT INTO t1 VALUES (_utf32 0x10428), (_utf32 0x10429); +INSERT INTO t1 VALUES (_utf32 0x1042A), (_utf32 0x1042B); +INSERT INTO t1 VALUES (_utf32 0x1042C), (_utf32 0x1042D); +INSERT INTO t1 VALUES (_utf32 0x1042E), (_utf32 0x1042F); +INSERT INTO t1 VALUES (_utf32 0x0370); +INSERT INTO t1 VALUES (_utf32 0x0371); +INSERT INTO t1 VALUES (_utf32 0x0372); +INSERT INTO t1 VALUES (_utf32 0x0373); +INSERT INTO t1 VALUES (_utf32 0x0514); +INSERT INTO t1 VALUES (_utf32 0x0515); +INSERT INTO t1 VALUES (_utf32 0x0516); +INSERT INTO t1 VALUES (_utf32 0x0517); +INSERT INTO t1 VALUES (_utf32 0xA640); +INSERT INTO t1 VALUES (_utf32 0xA641); +INSERT INTO t1 VALUES (_utf32 0xA642); +INSERT INTO t1 VALUES (_utf32 0xA643); +INSERT INTO t1 VALUES (_utf32 0xA722); +INSERT INTO t1 VALUES (_utf32 0xA723); +INSERT INTO t1 VALUES (_utf32 0xA724); +INSERT INTO t1 VALUES (_utf32 0xA725); +INSERT INTO t1 VALUES (_utf32 0xA726); +INSERT INTO t1 VALUES (_utf32 0xA727); +INSERT INTO t1 VALUES (_utf32 0xA728); +INSERT INTO t1 VALUES (_utf32 0xA729); +INSERT INTO t1 VALUES (_utf32 0xA72A); +INSERT INTO t1 VALUES (_utf32 0xA72B); +INSERT INTO t1 VALUES (_utf32 0x2CEB); +INSERT INTO t1 VALUES (_utf32 0x2CEC); +INSERT INTO t1 VALUES (_utf32 0x2CED); +INSERT INTO t1 VALUES (_utf32 0x2CEE); +SELECT hex(c), hex(lower(c)), hex(upper(c)), hex(weight_string(c)), c +FROM t1 ORDER BY c, BINARY c; +hex(c) hex(lower(c)) hex(upper(c)) hex(weight_string(c)) c +C8BA C8BA 1214 Ⱥ +E2B1A5 E2B1A5 C8BA 1214 ⱥ +C680 C680 C983 122D ƀ +C983 C680 C983 122D Ƀ +C8BB C8BC C8BB 1242 Ȼ +C8BC C8BC C8BB 1242 ȼ +E28683 E28684 E28683 124E Ↄ +E28684 E28684 E28683 124E ↄ +C986 C987 C986 1270 Ɇ +C987 C987 C986 1270 ɇ +E284B2 E2858E E284B2 12AE Ⅎ +E2858E E2858E E284B2 12AE ⅎ +E2B1A7 E2B1A8 E2B1A7 12E3 Ⱨ +E2B1A8 E2B1A8 E2B1A7 12E3 ⱨ +E2B1B5 E2B1B6 E2B1B5 12E4 Ⱶ +E2B1B6 E2B1B6 E2B1B5 12E4 ⱶ +EA9CA6 EA9CA7 EA9CA6 12E5 Ꜧ +EA9CA7 EA9CA7 EA9CA6 12E5 ꜧ +C988 C989 C988 130E Ɉ +C989 C989 C988 130E ɉ +E2B1A9 E2B1AA E2B1A9 1328 Ⱪ +E2B1AA E2B1AA E2B1A9 1328 ⱪ +C8BD C69A C8BD 133B Ƚ +E2B1A0 E2B1A1 E2B1A0 133F Ⱡ +E2B1A1 E2B1A1 E2B1A0 133F ⱡ +C9AB C9AB 1340 ɫ +E2B1A2 C9AB E2B1A2 1340 Ɫ +E1B5BD E1B5BD E2B1A3 13B8 ᵽ +E2B1A3 E1B5BD E2B1A3 13B8 Ᵽ +C98A C98B C98A 13D2 Ɋ +C98B C98B C98A 13D2 ɋ +C98C C98D C98C 13E4 Ɍ +C98D C98D C98C 13E4 ɍ +C9BD C9BD 13FC ɽ +E2B1A4 C9BD E2B1A4 13FC Ɽ +EA9CA8 EA9CA9 EA9CA8 143314AD Ꜩ +EA9CA9 EA9CA9 EA9CA8 143314AD ꜩ +C8BE C8BE 143C Ⱦ +E2B1A6 E2B1A6 C8BE 143C ⱦ +C984 CA89 C984 145B Ʉ +CA89 CA89 C984 145B ʉ +C985 CA8C C985 1489 Ʌ +CA8C CA8C C985 1489 ʌ +C98E C98F C98E 14A4 Ɏ +C98F C98F C98E 14A4 ɏ +E2B1AB E2B1AC E2B1AB 14C8 Ⱬ +E2B1AC E2B1AC E2B1AB 14C8 ⱬ +EA9CAA EA9CAB EA9CAA 14F3 Ꜫ +EA9CAB EA9CAB EA9CAA 14F3 ꜫ +C981 C982 C981 1506 Ɂ +C982 C982 C981 1506 ɂ +EA9CA2 EA9CA3 EA9CA2 150E Ꜣ +EA9CA3 EA9CA3 EA9CA2 150E ꜣ +EA9CA4 EA9CA5 EA9CA4 1518 Ꜥ +EA9CA5 EA9CA5 EA9CA4 1518 ꜥ +CDB0 CDB1 CDB0 154F Ͱ +CDB1 CDB1 CDB0 154F ͱ +CDBC CDBC CFBE 1564 ͼ +CFBE CDBC CFBE 1564 Ͼ +CDBB CDBB CFBD 1565 ͻ +CFBD CDBB CFBD 1565 Ͻ +CDBD CDBD CFBF 1566 ͽ +CFBF CDBD CFBF 1566 Ͽ +CDB2 CDB3 CDB2 156F Ͳ +CDB3 CDB3 CDB2 156F ͳ +E2B280 E2B281 E2B280 1571 Ⲁ +E2B281 E2B281 E2B280 1571 ⲁ +E2B282 E2B283 E2B282 1572 Ⲃ +E2B283 E2B283 E2B282 1572 ⲃ +E2B284 E2B285 E2B284 1573 Ⲅ +E2B285 E2B285 E2B284 1573 ⲅ +E2B286 E2B287 E2B286 1574 Ⲇ +E2B287 E2B287 E2B286 1574 ⲇ +E2B288 E2B289 E2B288 1575 Ⲉ +E2B289 E2B289 E2B288 1575 ⲉ +E2B28A E2B28B E2B28A 1577 Ⲋ +E2B28B E2B28B E2B28A 1577 ⲋ +E2B28C E2B28D E2B28C 1578 Ⲍ +E2B28D E2B28D E2B28C 1578 ⲍ +E2B28E E2B28F E2B28E 1579 Ⲏ +E2B28F E2B28F E2B28E 1579 ⲏ +E2B3AB E2B3AC E2B3AB 1591 Ⳬ +E2B3AC E2B3AC E2B3AB 1591 ⳬ +E2B3AD E2B3AE E2B3AD 15A0 Ⳮ +E2B3AE E2B3AE E2B3AD 15A0 ⳮ +D3BA D3BB D3BA 15D4 Ӻ +D3BB D3BB D3BA 15D4 ӻ +D3B6 D3B7 D3B6 15DC Ӷ +D3B7 D3B7 D3B6 15DC ӷ +EA9980 EA9981 EA9980 1611 Ꙁ +EA9981 EA9981 EA9980 1611 ꙁ +D490 D491 D490 1613 Ԑ +D491 D491 D490 1613 ԑ +EA9982 EA9983 EA9982 1618 Ꙃ +EA9983 EA9983 EA9982 1618 ꙃ +D492 D493 D492 1666 Ԓ +D493 D493 D492 1666 ԓ +D494 D495 D494 166E Ԕ +D495 D495 D494 166E ԕ +D496 D497 D496 16B7 Ԗ +D497 D497 D496 16B7 ԗ +D3BC D3BD D3BC 16F9 Ӽ +D3BD D3BD D3BC 16F9 ӽ +D3BE D3BF D3BE 16FD Ӿ +D3BF D3BF D3BE 16FD ӿ +D380 D38F D380 17B1 Ӏ +D38F D38F D380 17B1 ӏ +E2B080 E2B0B0 E2B080 17B5 Ⰰ +E2B0B0 E2B0B0 E2B080 17B5 ⰰ +E2B081 E2B0B1 E2B081 17B6 Ⰱ +E2B0B1 E2B0B1 E2B081 17B6 ⰱ +E2B082 E2B0B2 E2B082 17B7 Ⰲ +E2B0B2 E2B0B2 E2B082 17B7 ⰲ +E2B083 E2B0B3 E2B083 17B8 Ⰳ +E2B0B3 E2B0B3 E2B083 17B8 ⰳ +E2B084 E2B0B4 E2B084 17B9 Ⰴ +E2B0B4 E2B0B4 E2B084 17B9 ⰴ +E2B085 E2B0B5 E2B085 17BA Ⰵ +E2B0B5 E2B0B5 E2B085 17BA ⰵ +E2B086 E2B0B6 E2B086 17BB Ⰶ +E2B0B6 E2B0B6 E2B086 17BB ⰶ +E2B087 E2B0B7 E2B087 17BC Ⰷ +E2B0B7 E2B0B7 E2B087 17BC ⰷ +E182A0 E2B480 E182A0 17E5 Ⴀ +E2B480 E2B480 E182A0 17E5 ⴀ +E182A1 E2B481 E182A1 17E7 Ⴁ +E2B481 E2B481 E182A1 17E7 ⴁ +E182A2 E2B482 E182A2 17E9 Ⴂ +E2B482 E2B482 E182A2 17E9 ⴂ +E182A3 E2B483 E182A3 17EB Ⴃ +E2B483 E2B483 E182A3 17EB ⴃ +E182A4 E2B484 E182A4 17ED Ⴄ +E2B484 E2B484 E182A4 17ED ⴄ +E182A5 E2B485 E182A5 17EF Ⴅ +E2B485 E2B485 E182A5 17EF ⴅ +E182A6 E2B486 E182A6 17F1 Ⴆ +E2B486 E2B486 E182A6 17F1 ⴆ +E182A7 E2B487 E182A7 17F5 Ⴇ +E2B487 E2B487 E182A7 17F5 ⴇ +F0909080 F09090A8 F0909080 30D2 𐐀 +F09090A8 F09090A8 F0909080 30D2 𐐨 +F0909081 F09090A9 F0909081 30D3 𐐁 +F09090A9 F09090A9 F0909081 30D3 𐐩 +F0909082 F09090AA F0909082 30D4 𐐂 +F09090AA F09090AA F0909082 30D4 𐐪 +F0909083 F09090AB F0909083 30D5 𐐃 +F09090AB F09090AB F0909083 30D5 𐐫 +F0909084 F09090AC F0909084 30D6 𐐄 +F09090AC F09090AC F0909084 30D6 𐐬 +F0909085 F09090AD F0909085 30D7 𐐅 +F09090AD F09090AD F0909085 30D7 𐐭 +F0909086 F09090AE F0909086 30D8 𐐆 +F09090AE F09090AE F0909086 30D8 𐐮 +F0909087 F09090AF F0909087 30D9 𐐇 +F09090AF F09090AF F0909087 30D9 𐐯 +INSERT INTO t1 VALUES ('a'); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0xFFFF)); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0x10FFFF)); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0x10400)); +SELECT hex(c), hex(weight_string(c)) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +hex(c) hex(weight_string(c)) +61 120F +61F0909080 120F30D2 +61EFBFBF 120FFBC1FFFF +61F48FBFBF 120FFBE1FFFF +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10400 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +F0909080 30D2 𐐀 +F09090A8 30D2 𐐨 +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10428 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +F0909080 30D2 𐐀 +F09090A8 30D2 𐐨 +ALTER TABLE t1 ADD KEY(c); +EXPLAIN SELECT hex(c) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range c c 43 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select hex(`test`.`t1`.`c`) AS `hex(c)` from `test`.`t1` where (`test`.`t1`.`c` like 'a%') order by `test`.`t1`.`c` +SELECT hex(c), hex(weight_string(c)) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +hex(c) hex(weight_string(c)) +61 120F +61F0909080 120F30D2 +61EFBFBF 120FFBC1FFFF +61F48FBFBF 120FFBE1FFFF +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10400 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +F0909080 30D2 𐐀 +F09090A8 30D2 𐐨 +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10428 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +F0909080 30D2 𐐀 +F09090A8 30D2 𐐨 +DROP TABLE t1; +# +# Bug #16204175 : COLLATION NAME MISSING FROM LOG MESSAGES +# ABOUT LDML DEFINITION PROBLEMS +# +# +# Restart the server with a collation with invalid grammar rules. +# restart:--character-sets-dir=MYSQL_TEST_DIR/std_data/bug16204175/ +# Check whether the new collation is loaded after restart +SHOW COLLATION LIKE 'utf8_test'; +Collation Charset Id Default Compiled Sortlen Pad_attribute +utf8_test utf8 999 8 PAD SPACE +# Create a table with the unknown collation. +CREATE TABLE t1(id INT PRIMARY KEY, c CHAR(1) COLLATE utf8_test); +ERROR HY000: Unknown collation: 'utf8_test' +# Below error is caused as a result of this test. The error message +# contains collation name which is added as a part of the fix. +call mtr.add_suppression("Shift expected at '' for COLLATION : utf8_test"); +# +# Restart server with original character sets dir: +# restart:--character-sets-dir=MYSQL_CHARSETSDIR +# +# End of 5.6 tests +# +SET NAMES utf8mb4; +CREATE TABLE t1 ( +f1 CHAR(4) NOT NULL +); +INSERT INTO t1 VALUES ('é'); +INSERT INTO t1 VALUES (_utf16 0x00650301); +SELECT DISTINCT f1 FROM t1; +f1 +é +SELECT SQL_BIG_RESULT DISTINCT f1 FROM t1; +f1 +é +DROP TABLE t1; +SET NAMES DEFAULT; +# +# Bug #27578340: INCONSISTENT RESULTS FOR SELECTS FROM TABLE WITH CHAR(N) COLUMN +# AND NO_PAD COLLATION +# +CREATE TABLE t1 ( +f1 CHAR(20) COLLATE utf8mb4_0900_ai_ci # A NO PAD collation. +); +INSERT INTO t1 VALUES ('ABC '); +INSERT INTO t1 VALUES ('XYZ'); +INSERT INTO t1 VALUES ('XYZ '); +INSERT INTO t1 VALUES ('ABC '); +# +# We should get the same results with and without an index. +# The former should match both XYZ values, the latter should match nothing. +# This is because CHAR conceptually never stores trailing spaces (in MySQL). +# +SELECT CONCAT(f1, '|') FROM t1 WHERE f1 = 'XYZ'; +CONCAT(f1, '|') +XYZ| +XYZ| +SELECT CONCAT(f1, '|') FROM t1 WHERE f1 = 'XYZ '; +CONCAT(f1, '|') +CREATE INDEX f1_index ON t1 ( f1 ); +SELECT CONCAT(f1, '|') FROM t1 WHERE f1 = 'XYZ'; +CONCAT(f1, '|') +XYZ| +XYZ| +SELECT CONCAT(f1, '|') FROM t1 WHERE f1 = 'XYZ '; +CONCAT(f1, '|') +DROP TABLE t1; +# +# Bug #28691605 ASSERTION `NUM_CODEPOINTS >= SCANNER.GET_CHAR_INDEX()' FAILED. +# +CREATE TABLE t1(c1 float); +INSERT INTO t1 VALUES +(-9999999999999), +(-99999999999999), +(-999999999999999), +(-9999999999999999); +SELECT GROUP_CONCAT(c1) FROM t1 GROUP BY c1 COLLATE utf8_icelandic_ci; +GROUP_CONCAT(c1) +-1e13 +-1e14 +-1e15 +-1e16 +DROP TABLE t1; +CREATE TABLE t1double(c1 double); +INSERT INTO t1double values(0.00000000000002123456789123456789); +SELECT c1 FROM t1double; +c1 +0.000000000000021234567891234568 +SELECT CONCAT(c1) FROM t1double; +CONCAT(c1) +2.1234567891234568e-14 +SELECT CAST(CONCAT(c1) AS DOUBLE) FROM t1double; +CAST(CONCAT(c1) AS DOUBLE) +0.000000000000021234567891234568 +SELECT GROUP_CONCAT(c1) FROM t1double GROUP BY c1 COLLATE utf8_icelandic_ci; +GROUP_CONCAT(c1) +2.1234567891234568e-14 +DROP TABLE t1double; +# +# Bug #32385934 ASSERTION `NUM_CODEPOINTS >= SCANNER.GET_CHAR_INDEX()' +# FAILED|CTYPE-UCA.CC +# +CREATE TABLE t1 ( +col_real_key double DEFAULT NULL, +col_bigint_key bigint DEFAULT NULL +); +INSERT INTO t1 VALUES (-20162.341,8262411111801246601); +SELECT alias1.col_real_key / alias1.col_bigint_key AS field1, +alias1.col_bigint_key AS field2 +FROM t1 AS alias1 +ORDER BY LEAST(field2, field1 COLLATE utf8mb4_croatian_ci); +field1 field2 +-0.000000000000002440249066183843 8262411111801246601 +DROP TABLE t1; diff --git a/mysql-test/r/ctype_unicode900.result-pq b/mysql-test/r/ctype_unicode900.result-pq new file mode 100644 index 000000000000..3e38d59b0a0d --- /dev/null +++ b/mysql-test/r/ctype_unicode900.result-pq @@ -0,0 +1,3889 @@ +DROP TABLE IF EXISTS t1; +# +# Start of 8.0 tests +# +# +# WL#9125: Add utf8mb4_0900_ai_ci +# +SET NAMES utf8mb4 COLLATE utf8mb4_0900_ai_ci; +SET @test_character_set= 'utf8mb4'; +SET @test_collation= 'utf8mb4_0900_ai_ci'; +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET @safe_character_set_client= @@character_set_client; +SET @safe_character_set_results= @@character_set_results; +SET character_set_server= @test_character_set; +SET collation_server= @test_collation; +CREATE DATABASE d1; +USE d1; +CREATE TABLE t1 (c CHAR(10), KEY(c)); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c char(10) utf8mb4_0900_ai_ci YES MUL NULL +INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +want3results +aaa +aaaa +aaaaa +DROP TABLE t1; +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c1 varchar(15) utf8mb4_0900_ai_ci YES MUL NULL +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +want3results +location +loberge +lotre +SELECT c1 as want3results from t1 where c1 like 'lo%'; +want3results +location +loberge +lotre +SELECT c1 as want1result from t1 where c1 like 'loc%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'loca%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locat%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locati%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'location%'; +want1result +location +DROP TABLE t1; +create table t1 (a set('a') not null); +insert ignore into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +select 1 from t1 order by cast(a as char(1)); +1 +1 +1 +drop table t1; +set names utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +create table t1 ( +name varchar(10), +level smallint unsigned); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `name` varchar(10) DEFAULT NULL, + `level` smallint unsigned DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +insert into t1 values ('string',1); +select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; +concat(name,space(level)) concat(name, repeat(' ',level)) +string string +drop table t1; +DROP DATABASE d1; +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; +SET character_set_client= @safe_character_set_client; +SET character_set_results= @safe_character_set_results; +SET NAMES utf8mb4 COLLATE utf8mb4_0900_ai_ci; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +utf8mb4_0900_ai_ci 61 +utf8mb4_0900_ai_ci 6109 +utf8mb4_0900_ai_ci 6120 +drop table t1; +create table t1 engine=innodb select repeat('a',50) as c1; +alter table t1 add index(c1(5)); +insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111'); +select collation(c1) from t1 limit 1; +collation(c1) +utf8mb4_0900_ai_ci +select c1 from t1 where c1 like 'abcdef%' order by c1; +c1 +abcdefg +select c1 from t1 where c1 like 'abcde1%' order by c1; +c1 +abcde100 +abcde110 +abcde111 +select c1 from t1 where c1 like 'abcde11%' order by c1; +c1 +abcde110 +abcde111 +select c1 from t1 where c1 like 'abcde111%' order by c1; +c1 +abcde111 +drop table t1; +select @@collation_connection; +@@collation_connection +utf8mb4_0900_ai_ci +create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ; +insert into t1 values('abcdef'); +insert into t1 values('_bcdef'); +insert into t1 values('a_cdef'); +insert into t1 values('ab_def'); +insert into t1 values('abc_ef'); +insert into t1 values('abcd_f'); +insert into t1 values('abcde_'); +select c1 as c1u from t1 where c1 like 'ab\_def'; +c1u +ab_def +select c1 as c2h from t1 where c1 like 'ab#_def' escape '#'; +c2h +ab_def +drop table t1; +drop table if exists t1; +create table t1 select repeat('a',10) as c1; +delete from t1; +insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +SELECT GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM t1 GROUP BY c1; +GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) + 7F + 20 +_ 5F +- 2D +, 2C +; 3B +: 3A +! 21 +? 3F +. 2E +' 27 +" 22 +( 28 +) 29 +[ 5B +] 5D +{ 7B +} 7D +@ 40 +* 2A +/ 2F +\ 5C +& 26 +# 23 +% 25 +` 60 +^ 5E ++ 2B +< 3C += 3D +> 3E +| 7C +~ 7E +$ 24 +0 30 +1 31 +2 32 +3 33 +4 34 +5 35 +6 36 +7 37 +8 38 +9 39 +Aa 41,61 +Bb 42,62 +Cc 43,63 +Dd 44,64 +Ee 45,65 +Ff 46,66 +Gg 47,67 +Hh 48,68 +Ii 49,69 +Jj 4A,6A +Kk 4B,6B +Ll 4C,6C +Mm 4D,6D +Nn 4E,6E +Oo 4F,6F +Pp 50,70 +Qq 51,71 +Rr 52,72 +Ss 53,73 +Tt 54,74 +Uu 55,75 +Vv 56,76 +Ww 57,77 +Xx 58,78 +Yy 59,79 +Zz 5A,7A +drop table t1; +SET NAMES utf8mb4 COLLATE utf8mb4_0900_ai_ci; +SELECT HEX(CONVERT(_utf8mb4 0xF091AB9B41 USING ucs2)); +HEX(CONVERT(_utf8mb4 0xF091AB9B41 USING ucs2)) +003F0041 +SELECT HEX(CONVERT(_utf8mb4 0xF091AB9B41 USING utf16)); +HEX(CONVERT(_utf8mb4 0xF091AB9B41 USING utf16)) +D806DEDB0041 +SELECT HEX(CONVERT(_utf8mb4 0xF091AB9B41 USING utf32)); +HEX(CONVERT(_utf8mb4 0xF091AB9B41 USING utf32)) +00011ADB00000041 +SELECT HEX(CONVERT(_ucs2 0xF8FF USING utf8mb4)); +HEX(CONVERT(_ucs2 0xF8FF USING utf8mb4)) +EFA3BF +SELECT HEX(CONVERT(_utf16 0xF8FF USING utf8mb4)); +HEX(CONVERT(_utf16 0xF8FF USING utf8mb4)) +EFA3BF +SELECT HEX(CONVERT(_utf32 0xF8FF USING utf8mb4)); +HEX(CONVERT(_utf32 0xF8FF USING utf8mb4)) +EFA3BF +SELECT HEX(CONVERT(_utf8mb4 0x8F USING ucs2)); +ERROR HY000: Invalid utf8mb4 character string: '8F' +SELECT HEX(CONVERT(_utf8mb4 0xC230 USING ucs2)); +ERROR HY000: Invalid utf8mb4 character string: 'C230' +SELECT HEX(CONVERT(_utf8mb4 0xE234F1 USING ucs2)); +ERROR HY000: Invalid utf8mb4 character string: 'E234F1' +SELECT HEX(CONVERT(_utf8mb4 0xF4E25634 USING ucs2)); +ERROR HY000: Invalid utf8mb4 character string: 'F4E256' +SELECT ASCII('ABC'); +ASCII('ABC') +65 +SELECT BIT_LENGTH('a'); +BIT_LENGTH('a') +8 +SELECT BIT_LENGTH('À'); +BIT_LENGTH('À') +16 +SELECT BIT_LENGTH('テ'); +BIT_LENGTH('テ') +24 +SELECT BIT_LENGTH('𝌆'); +BIT_LENGTH('?') +32 +SELECT CHAR_LENGTH('𝌆テÀa'); +CHAR_LENGTH('?テÀa') +4 +SELECT LENGTH('𝌆テÀa'); +LENGTH('?テÀa') +10 +SELECT FIELD('a', '𝌆テÀa'); +FIELD('a', '?テÀa') +0 +SELECT HEX('𝌆テÀa'); +HEX('?テÀa') +F09D8C86E38386C38061 +SELECT INSERT('𝌆テÀa', 2, 2, 'テb'); +INSERT('?テÀa', 2, 2, 'テb') +𝌆テba +SELECT LOWER('𝌆テÀBcd'); +LOWER('?テÀBcd') +𝌆テàbcd +SELECT ORD('𝌆'); +ORD('?') +4036856966 +SELECT UPPER('𝌆テàbCD'); +UPPER('?テàbCD') +𝌆テÀBCD +SELECT LOCATE(_utf8mb4 0xF091AB9B41, _utf8mb4 0xF091AB9B42F091AB9B41F091AB9B43); +LOCATE(_utf8mb4 0xF091AB9B41, _utf8mb4 0xF091AB9B42F091AB9B41F091AB9B43) +3 +SELECT HEX(REVERSE(_utf8mb4 0xF091AB9B41F091AB9B42F091AB9B43)); +HEX(REVERSE(_utf8mb4 0xF091AB9B41F091AB9B42F091AB9B43)) +43F091AB9B42F091AB9B41F091AB9B +SELECT HEX(SUBSTRING(_utf8mb4 0xF091AB9B41F091AB9B42F091AB9B43, 1, 2)); +HEX(SUBSTRING(_utf8mb4 0xF091AB9B41F091AB9B42F091AB9B43, 1, 2)) +F091AB9B41 +SELECT HEX(SUBSTRING(_utf8mb4 0xF091AB9B41F091AB9B42F091AB9B43, -3, 2)); +HEX(SUBSTRING(_utf8mb4 0xF091AB9B41F091AB9B42F091AB9B43, -3, 2)) +42F091AB9B +SELECT HEX(TRIM(_utf8mb4 0x2020F091AB9B4120F091AB9B4120202020)); +HEX(TRIM(_utf8mb4 0x2020F091AB9B4120F091AB9B4120202020)) +F091AB9B4120F091AB9B41 +SELECT HEX(WEIGHT_STRING('aA')); +HEX(WEIGHT_STRING('aA')) +1C471C47 +SELECT HEX(WEIGHT_STRING(CAST(_utf32 x'337F' AS CHAR))); +HEX(WEIGHT_STRING(CAST(_utf32 x'337F' AS CHAR))) +FB40E82AFB40DF0FFB40CF1AFB40F93E +SELECT HEX(WEIGHT_STRING(CAST(_utf32 x'FDFA' AS CHAR))); +HEX(WEIGHT_STRING(CAST(_utf32 x'FDFA' AS CHAR))) +2364239C23C50209230B239C239C23B1 +select @@collation_connection; +@@collation_connection +utf8mb4_0900_ai_ci +select hex(weight_string('a')); +hex(weight_string('a')) +1C47 +select hex(weight_string('A')); +hex(weight_string('A')) +1C47 +select hex(weight_string('abc')); +hex(weight_string('abc')) +1C471C601C7A +select hex(weight_string('abc' as char(2))); +hex(weight_string('abc' as char(2))) +1C471C60 +select hex(weight_string('abc' as char(3))); +hex(weight_string('abc' as char(3))) +1C471C601C7A +select hex(weight_string('abc' as char(5))); +hex(weight_string('abc' as char(5))) +1C471C601C7A +select hex(weight_string('abc', 1, 2, 0xC0)); +hex(weight_string('abc', 1, 2, 0xC0)) +1C +select hex(weight_string('abc', 2, 2, 0xC0)); +hex(weight_string('abc', 2, 2, 0xC0)) +1C47 +select hex(weight_string('abc', 3, 2, 0xC0)); +hex(weight_string('abc', 3, 2, 0xC0)) +1C471C +select hex(weight_string('abc', 4, 2, 0xC0)); +hex(weight_string('abc', 4, 2, 0xC0)) +1C471C60 +select hex(weight_string('abc', 5, 2, 0xC0)); +hex(weight_string('abc', 5, 2, 0xC0)) +1C471C6000 +select hex(weight_string('abc',25, 2, 0xC0)); +hex(weight_string('abc',25, 2, 0xC0)) +1C471C60000000000000000000000000000000000000000000 +select hex(weight_string('abc', 1, 3, 0xC0)); +hex(weight_string('abc', 1, 3, 0xC0)) +1C +select hex(weight_string('abc', 2, 3, 0xC0)); +hex(weight_string('abc', 2, 3, 0xC0)) +1C47 +select hex(weight_string('abc', 3, 3, 0xC0)); +hex(weight_string('abc', 3, 3, 0xC0)) +1C471C +select hex(weight_string('abc', 4, 3, 0xC0)); +hex(weight_string('abc', 4, 3, 0xC0)) +1C471C60 +select hex(weight_string('abc', 5, 3, 0xC0)); +hex(weight_string('abc', 5, 3, 0xC0)) +1C471C601C +select hex(weight_string('abc',25, 3, 0xC0)); +hex(weight_string('abc',25, 3, 0xC0)) +1C471C601C7A00000000000000000000000000000000000000 +select hex(weight_string('abc', 1, 4, 0xC0)); +hex(weight_string('abc', 1, 4, 0xC0)) +1C +select hex(weight_string('abc', 2, 4, 0xC0)); +hex(weight_string('abc', 2, 4, 0xC0)) +1C47 +select hex(weight_string('abc', 3, 4, 0xC0)); +hex(weight_string('abc', 3, 4, 0xC0)) +1C471C +select hex(weight_string('abc', 4, 4, 0xC0)); +hex(weight_string('abc', 4, 4, 0xC0)) +1C471C60 +select hex(weight_string('abc', 5, 4, 0xC0)); +hex(weight_string('abc', 5, 4, 0xC0)) +1C471C601C +select hex(weight_string('abc',25, 4, 0xC0)); +hex(weight_string('abc',25, 4, 0xC0)) +1C471C601C7A00000000000000000000000000000000000000 +select @@collation_connection; +@@collation_connection +utf8mb4_0900_ai_ci +select hex(weight_string(cast(_latin1 0x80 as char))); +hex(weight_string(cast(_latin1 0x80 as char))) +1C2A +select hex(weight_string(cast(_latin1 0x808080 as char))); +hex(weight_string(cast(_latin1 0x808080 as char))) +1C2A1C2A1C2A +select hex(weight_string(cast(_latin1 0x808080 as char) as char(2))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(2))) +1C2A1C2A +select hex(weight_string(cast(_latin1 0x808080 as char) as char(3))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(3))) +1C2A1C2A1C2A +select hex(weight_string(cast(_latin1 0x808080 as char) as char(5))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(5))) +1C2A1C2A1C2A +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)) +1C +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)) +1C2A +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)) +1C2A1C +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)) +1C2A1C2A +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)) +1C2A1C2A00 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)) +1C2A1C2A000000000000000000000000000000000000000000 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)) +1C +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)) +1C2A +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)) +1C2A1C +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)) +1C2A1C2A +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)) +1C2A1C2A1C +select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)) +1C2A1C2A1C2A00000000000000000000000000000000000000 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)) +1C +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)) +1C2A +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)) +1C2A1C +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)) +1C2A1C2A +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)) +1C2A1C2A1C +select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)) +1C2A1C2A1C2A00000000000000000000000000000000000000 +CREATE TABLE t1 AS SELECT repeat('a', 10) as c LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` varchar(10) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +INSERT INTO t1 VALUES (_utf32 0x0180),(_utf32 0x023A); +INSERT INTO t1 VALUES (_utf32 0x023B),(_utf32 0x023C); +INSERT INTO t1 VALUES (_utf32 0x023D),(_utf32 0x023E); +INSERT INTO t1 VALUES (_utf32 0x0241),(_utf32 0x0242); +INSERT INTO t1 VALUES (_utf32 0x0243),(_utf32 0x0244); +INSERT INTO t1 VALUES (_utf32 0x0245),(_utf32 0x0246); +INSERT INTO t1 VALUES (_utf32 0x0247),(_utf32 0x0248); +INSERT INTO t1 VALUES (_utf32 0x0249),(_utf32 0x024A); +INSERT INTO t1 VALUES (_utf32 0x024B),(_utf32 0x024C); +INSERT INTO t1 VALUES (_utf32 0x024D),(_utf32 0x024E); +INSERT INTO t1 VALUES (_utf32 0x024F),(_utf32 0x026B); +INSERT INTO t1 VALUES (_utf32 0x027D),(_utf32 0x0289); +INSERT INTO t1 VALUES (_utf32 0x028C); +INSERT INTO t1 VALUES (_utf32 0x037B), (_utf32 0x037C); +INSERT INTO t1 VALUES (_utf32 0x037D), (_utf32 0x03FD); +INSERT INTO t1 VALUES (_utf32 0x03FE), (_utf32 0x03FF); +INSERT INTO t1 VALUES (_utf32 0x04C0), (_utf32 0x04CF); +INSERT INTO t1 VALUES (_utf32 0x04F6), (_utf32 0x04F7); +INSERT INTO t1 VALUES (_utf32 0x04FA), (_utf32 0x04FB); +INSERT INTO t1 VALUES (_utf32 0x04FC), (_utf32 0x04FD); +INSERT INTO t1 VALUES (_utf32 0x04FE), (_utf32 0x04FF); +INSERT INTO t1 VALUES (_utf32 0x0510), (_utf32 0x0511); +INSERT INTO t1 VALUES (_utf32 0x0512), (_utf32 0x0513); +INSERT INTO t1 VALUES (_utf32 0x10A0), (_utf32 0x10A1); +INSERT INTO t1 VALUES (_utf32 0x10A2), (_utf32 0x10A3); +INSERT INTO t1 VALUES (_utf32 0x10A4), (_utf32 0x10A5); +INSERT INTO t1 VALUES (_utf32 0x10A6), (_utf32 0x10A7); +INSERT INTO t1 VALUES (_utf32 0x2D00), (_utf32 0x2D01); +INSERT INTO t1 VALUES (_utf32 0x2D02), (_utf32 0x2D03); +INSERT INTO t1 VALUES (_utf32 0x2D04), (_utf32 0x2D05); +INSERT INTO t1 VALUES (_utf32 0x2D06), (_utf32 0x2D07); +INSERT INTO t1 VALUES (_utf32 0x1D7D); +INSERT INTO t1 VALUES (_utf32 0x2132),(_utf32 0x214E); +INSERT INTO t1 VALUES (_utf32 0x2183),(_utf32 0x2184); +INSERT INTO t1 VALUES (_utf32 0x2C80), (_utf32 0x2C81); +INSERT INTO t1 VALUES (_utf32 0x2C82), (_utf32 0x2C83); +INSERT INTO t1 VALUES (_utf32 0x2C84), (_utf32 0x2C85); +INSERT INTO t1 VALUES (_utf32 0x2C86), (_utf32 0x2C87); +INSERT INTO t1 VALUES (_utf32 0x2C88), (_utf32 0x2C89); +INSERT INTO t1 VALUES (_utf32 0x2C8A), (_utf32 0x2C8B); +INSERT INTO t1 VALUES (_utf32 0x2C8C), (_utf32 0x2C8D); +INSERT INTO t1 VALUES (_utf32 0x2C8E), (_utf32 0x2C8F); +INSERT INTO t1 VALUES (_utf32 0x2C60), (_utf32 0x2C61); +INSERT INTO t1 VALUES (_utf32 0x2C62), (_utf32 0x2C63); +INSERT INTO t1 VALUES (_utf32 0x2C64), (_utf32 0x2C65); +INSERT INTO t1 VALUES (_utf32 0x2C66), (_utf32 0x2C67); +INSERT INTO t1 VALUES (_utf32 0x2C68), (_utf32 0x2C69); +INSERT INTO t1 VALUES (_utf32 0x2C6A), (_utf32 0x2C6B); +INSERT INTO t1 VALUES (_utf32 0x2C6C), (_utf32 0x2C75); +INSERT INTO t1 VALUES (_utf32 0x2C76); +INSERT INTO t1 VALUES (_utf32 0x2C00), (_utf32 0x2C01); +INSERT INTO t1 VALUES (_utf32 0x2C02), (_utf32 0x2C03); +INSERT INTO t1 VALUES (_utf32 0x2C04), (_utf32 0x2C05); +INSERT INTO t1 VALUES (_utf32 0x2C06), (_utf32 0x2C07); +INSERT INTO t1 VALUES (_utf32 0x2C30), (_utf32 0x2C31); +INSERT INTO t1 VALUES (_utf32 0x2C32), (_utf32 0x2C33); +INSERT INTO t1 VALUES (_utf32 0x2C34), (_utf32 0x2C35); +INSERT INTO t1 VALUES (_utf32 0x2C36), (_utf32 0x2C37); +INSERT INTO t1 VALUES (_utf32 0x10400), (_utf32 0x10401); +INSERT INTO t1 VALUES (_utf32 0x10402), (_utf32 0x10403); +INSERT INTO t1 VALUES (_utf32 0x10404), (_utf32 0x10405); +INSERT INTO t1 VALUES (_utf32 0x10406), (_utf32 0x10407); +INSERT INTO t1 VALUES (_utf32 0x10428), (_utf32 0x10429); +INSERT INTO t1 VALUES (_utf32 0x1042A), (_utf32 0x1042B); +INSERT INTO t1 VALUES (_utf32 0x1042C), (_utf32 0x1042D); +INSERT INTO t1 VALUES (_utf32 0x1042E), (_utf32 0x1042F); +INSERT INTO t1 VALUES (_utf32 0x0370); +INSERT INTO t1 VALUES (_utf32 0x0371); +INSERT INTO t1 VALUES (_utf32 0x0372); +INSERT INTO t1 VALUES (_utf32 0x0373); +INSERT INTO t1 VALUES (_utf32 0x0514); +INSERT INTO t1 VALUES (_utf32 0x0515); +INSERT INTO t1 VALUES (_utf32 0x0516); +INSERT INTO t1 VALUES (_utf32 0x0517); +INSERT INTO t1 VALUES (_utf32 0xA640); +INSERT INTO t1 VALUES (_utf32 0xA641); +INSERT INTO t1 VALUES (_utf32 0xA642); +INSERT INTO t1 VALUES (_utf32 0xA643); +INSERT INTO t1 VALUES (_utf32 0xA722); +INSERT INTO t1 VALUES (_utf32 0xA723); +INSERT INTO t1 VALUES (_utf32 0xA724); +INSERT INTO t1 VALUES (_utf32 0xA725); +INSERT INTO t1 VALUES (_utf32 0xA726); +INSERT INTO t1 VALUES (_utf32 0xA727); +INSERT INTO t1 VALUES (_utf32 0xA728); +INSERT INTO t1 VALUES (_utf32 0xA729); +INSERT INTO t1 VALUES (_utf32 0xA72A); +INSERT INTO t1 VALUES (_utf32 0xA72B); +INSERT INTO t1 VALUES (_utf32 0x2CEB); +INSERT INTO t1 VALUES (_utf32 0x2CEC); +INSERT INTO t1 VALUES (_utf32 0x2CED); +INSERT INTO t1 VALUES (_utf32 0x2CEE); +INSERT INTO t1 VALUES (_utf32 0x1FA01); +INSERT INTO t1 VALUES (_utf32 0x1FB01); +INSERT INTO t1 VALUES (_utf32 0x1FC01); +INSERT INTO t1 VALUES (_utf32 0x1FD01); +INSERT INTO t1 VALUES (_utf32 0x1F603); +INSERT INTO t1 VALUES (_utf32 0x1F604); +INSERT INTO t1 VALUES (_utf32 0x1F648); +INSERT INTO t1 VALUES (_utf32 0x1F64F); +INSERT INTO t1 VALUES (_utf32 0x2B759); +INSERT INTO t1 VALUES (_utf32 0x2B760); +INSERT INTO t1 VALUES (_utf32 0x2B761); +INSERT INTO t1 VALUES (_utf32 0x2B762); +INSERT INTO t1 VALUES (_utf32 0x16F00); +INSERT INTO t1 VALUES (_utf32 0x16F01); +INSERT INTO t1 VALUES (_utf32 0x08A2); +INSERT INTO t1 VALUES (_utf32 0x08A3); +INSERT INTO t1 VALUES (_utf32 0xA794); +INSERT INTO t1 VALUES (_utf32 0xA795); +INSERT INTO t1 VALUES (_utf32 0xA796); +INSERT INTO t1 VALUES (_utf32 0xA797); +INSERT INTO t1 VALUES (_utf32 0xAB37); +INSERT INTO t1 VALUES (_utf32 0xAB38); +INSERT INTO t1 VALUES (_utf32 0x10600); +INSERT INTO t1 VALUES (_utf32 0x10601); +INSERT INTO t1 VALUES (_utf32 0x10602); +INSERT INTO t1 VALUES (_utf32 0x10603); +INSERT INTO t1 VALUES (_utf32 0x1F800); +INSERT INTO t1 VALUES (_utf32 0x1F801); +INSERT INTO t1 VALUES (_utf32 0x1F802); +INSERT INTO t1 VALUES (_utf32 0x1F803); +INSERT INTO t1 VALUES (_utf32 0x10C92); +INSERT INTO t1 VALUES (_utf32 0x10C93); +INSERT INTO t1 VALUES (_utf32 0x10C94); +INSERT INTO t1 VALUES (_utf32 0x10C95); +INSERT INTO t1 VALUES (_utf32 0x2B836); +INSERT INTO t1 VALUES (_utf32 0x2B837); +INSERT INTO t1 VALUES (_utf32 0x2B838); +INSERT INTO t1 VALUES (_utf32 0x2B839); +SELECT hex(c), hex(lower(c)), hex(upper(c)), hex(weight_string(c)), c +FROM t1 ORDER BY c, BINARY c; +hex(c) hex(lower(c)) hex(upper(c)) hex(weight_string(c)) c +F09F9883 F09F9883 F09F9883 15FE 😃 +F09F9884 F09F9884 F09F9884 15FF 😄 +F09F9988 F09F9988 F09F9988 1643 🙈 +F09F998F F09F998F F09F998F 164A 🙏 +F09FA080 F09FA080 F09FA080 17AB 🠀 +F09FA081 F09FA081 F09FA081 17AC 🠁 +F09FA082 F09FA082 F09FA082 17AD 🠂 +F09FA083 F09FA083 F09FA083 17AE 🠃 +C8BA C8BA 1C4C Ⱥ +E2B1A5 E2B1A5 C8BA 1C4C ⱥ +C680 C680 C983 1C68 ƀ +C983 C680 C983 1C68 Ƀ +EA9E96 EA9E97 EA9E96 1C6F Ꞗ +EA9E97 EA9E97 EA9E96 1C6F ꞗ +C8BB C8BC C8BB 1C7F Ȼ +C8BC C8BC C8BB 1C7F ȼ +EA9E94 EA9E94 EA9E94 1C84 ꞔ +E28683 E28684 E28683 1C8D Ↄ +E28684 E28684 E28683 1C8D ↄ +C986 C987 C986 1CB1 Ɇ +C987 C987 C986 1CB1 ɇ +E284B2 E2858E E284B2 1CF2 Ⅎ +E2858E E2858E E284B2 1CF2 ⅎ +EA9E95 EA9E95 EA9E95 1D24 ꞕ +E2B1A7 E2B1A8 E2B1A7 1D29 Ⱨ +E2B1A8 E2B1A8 E2B1A7 1D29 ⱨ +E2B1B5 E2B1B6 E2B1B5 1D2A Ⱶ +E2B1B6 E2B1B6 E2B1B5 1D2A ⱶ +EA9CA6 EA9CA7 EA9CA6 1D2B Ꜧ +EA9CA7 EA9CA7 EA9CA6 1D2B ꜧ +C988 C989 C988 1D55 Ɉ +C989 C989 C988 1D55 ɉ +E2B1A9 E2B1AA E2B1A9 1D6F Ⱪ +E2B1AA E2B1AA E2B1A9 1D6F ⱪ +C8BD C69A C8BD 1D82 Ƚ +E2B1A0 E2B1A1 E2B1A0 1D86 Ⱡ +E2B1A1 E2B1A1 E2B1A0 1D86 ⱡ +C9AB C9AB 1D87 ɫ +E2B1A2 C9AB E2B1A2 1D87 Ɫ +EAACB8 EAACB8 EAACB8 1D8B ꬸ +EAACB7 EAACB7 EAACB7 1D91 ꬷ +E1B5BD E1B5BD E2B1A3 1E11 ᵽ +E2B1A3 E1B5BD E2B1A3 1E11 Ᵽ +C98A C98B C98A 1E2B Ɋ +C98B C98B C98A 1E2B ɋ +C98C C98D C98C 1E3F Ɍ +C98D C98D C98C 1E3F ɍ +C9BD C9BD 1E57 ɽ +E2B1A4 C9BD E2B1A4 1E57 Ɽ +EA9CA8 EA9CA9 EA9CA8 1E951F21 Ꜩ +EA9CA9 EA9CA9 EA9CA8 1E951F21 ꜩ +C8BE C8BE 1E9E Ⱦ +E2B1A6 E2B1A6 C8BE 1E9E ⱦ +C984 CA89 C984 1EC0 Ʉ +CA89 CA89 C984 1EC0 ʉ +C985 CA8C C985 1EF1 Ʌ +CA8C CA8C C985 1EF1 ʌ +C98E C98F C98E 1F13 Ɏ +C98F C98F C98E 1F13 ɏ +E2B1AB E2B1AC E2B1AB 1F3C Ⱬ +E2B1AC E2B1AC E2B1AB 1F3C ⱬ +EA9CAA EA9CAB EA9CAA 1F66 Ꜫ +EA9CAB EA9CAB EA9CAA 1F66 ꜫ +C981 C982 C981 1F79 Ɂ +C982 C982 C981 1F79 ɂ +EA9CA2 EA9CA3 EA9CA2 1F81 Ꜣ +EA9CA3 EA9CA3 EA9CA2 1F81 ꜣ +EA9CA4 EA9CA5 EA9CA4 1F8C Ꜥ +EA9CA5 EA9CA5 EA9CA4 1F8C ꜥ +CDB0 CDB1 CDB0 1FC3 Ͱ +CDB1 CDB1 CDB0 1FC3 ͱ +CDBC CDBC CFBE 1FD8 ͼ +CFBE CDBC CFBE 1FD8 Ͼ +CDBB CDBB CFBD 1FD9 ͻ +CFBD CDBB CFBD 1FD9 Ͻ +CDBD CDBD CFBF 1FDA ͽ +CFBF CDBD CFBF 1FDA Ͽ +CDB2 CDB3 CDB2 1FE4 Ͳ +CDB3 CDB3 CDB2 1FE4 ͳ +E2B280 E2B281 E2B280 1FE6 Ⲁ +E2B281 E2B281 E2B280 1FE6 ⲁ +E2B282 E2B283 E2B282 1FE7 Ⲃ +E2B283 E2B283 E2B282 1FE7 ⲃ +E2B284 E2B285 E2B284 1FE8 Ⲅ +E2B285 E2B285 E2B284 1FE8 ⲅ +E2B286 E2B287 E2B286 1FE9 Ⲇ +E2B287 E2B287 E2B286 1FE9 ⲇ +E2B288 E2B289 E2B288 1FEA Ⲉ +E2B289 E2B289 E2B288 1FEA ⲉ +E2B28A E2B28B E2B28A 1FEC Ⲋ +E2B28B E2B28B E2B28A 1FEC ⲋ +E2B28C E2B28D E2B28C 1FED Ⲍ +E2B28D E2B28D E2B28C 1FED ⲍ +E2B28E E2B28F E2B28E 1FEE Ⲏ +E2B28F E2B28F E2B28E 1FEE ⲏ +E2B3AB E2B3AC E2B3AB 2006 Ⳬ +E2B3AC E2B3AC E2B3AB 2006 ⳬ +E2B3AD E2B3AE E2B3AD 2016 Ⳮ +E2B3AE E2B3AE E2B3AD 2016 ⳮ +D3BA D3BB D3BA 203E Ӻ +D3BB D3BB D3BA 203E ӻ +D3B6 D3B7 D3B6 2046 Ӷ +D3B7 D3B7 D3B6 2046 ӷ +EA9980 EA9981 EA9980 2070 Ꙁ +EA9981 EA9981 EA9980 2070 ꙁ +D490 D491 D490 2072 Ԑ +D491 D491 D490 2072 ԑ +EA9982 EA9983 EA9982 2073 Ꙃ +EA9983 EA9983 EA9982 2073 ꙃ +D492 D493 D492 20BA Ԓ +D493 D493 D492 20BA ԓ +D494 D495 D494 20C2 Ԕ +D495 D495 D494 20C2 ԕ +D496 D497 D496 2104 Ԗ +D497 D497 D496 2104 ԗ +D3BC D3BD D3BC 2136 Ӽ +D3BD D3BD D3BC 2136 ӽ +D3BE D3BF D3BE 213A Ӿ +D3BF D3BF D3BE 213A ӿ +D380 D38F D380 21E1 Ӏ +D38F D38F D380 21E1 ӏ +E2B080 E2B0B0 E2B080 21E5 Ⰰ +E2B0B0 E2B0B0 E2B080 21E5 ⰰ +E2B081 E2B0B1 E2B081 21E6 Ⰱ +E2B0B1 E2B0B1 E2B081 21E6 ⰱ +E2B082 E2B0B2 E2B082 21E7 Ⰲ +E2B0B2 E2B0B2 E2B082 21E7 ⰲ +E2B083 E2B0B3 E2B083 21E8 Ⰳ +E2B0B3 E2B0B3 E2B083 21E8 ⰳ +E2B084 E2B0B4 E2B084 21E9 Ⰴ +E2B0B4 E2B0B4 E2B084 21E9 ⰴ +E2B085 E2B0B5 E2B085 21EA Ⰵ +E2B0B5 E2B0B5 E2B085 21EA ⰵ +E2B086 E2B0B6 E2B086 21EB Ⰶ +E2B0B6 E2B0B6 E2B086 21EB ⰶ +E2B087 E2B0B7 E2B087 21EC Ⰷ +E2B0B7 E2B0B7 E2B087 21EC ⰷ +E182A0 E2B480 E182A0 223B Ⴀ +E2B480 E2B480 E182A0 223B ⴀ +E182A1 E2B481 E182A1 223D Ⴁ +E2B481 E2B481 E182A1 223D ⴁ +E182A2 E2B482 E182A2 223F Ⴂ +E2B482 E2B482 E182A2 223F ⴂ +E182A3 E2B483 E182A3 2241 Ⴃ +E2B483 E2B483 E182A3 2241 ⴃ +E182A4 E2B484 E182A4 2243 Ⴄ +E2B484 E2B484 E182A4 2243 ⴄ +E182A5 E2B485 E182A5 2245 Ⴅ +E2B485 E2B485 E182A5 2245 ⴅ +E182A6 E2B486 E182A6 2247 Ⴆ +E2B486 E2B486 E182A6 2247 ⴆ +E182A7 E2B487 E182A7 224B Ⴇ +E2B487 E2B487 E182A7 224B ⴇ +E0A2A2 E0A2A2 E0A2A2 232B ࢢ +E0A2A3 E0A2A3 E0A2A3 236D ࢣ +F090B292 F090B392 F090B292 3712 𐲒 +F090B293 F090B393 F090B293 3713 𐲓 +F090B294 F090B394 F090B294 3714 𐲔 +F090B295 F090B395 F090B295 3715 𐲕 +F096BC80 F096BC80 F096BC80 427A 𖼀 +F096BC81 F096BC81 F096BC81 427B 𖼁 +F0909080 F09090A8 F0909080 4452 𐐀 +F09090A8 F09090A8 F0909080 4452 𐐨 +F0909081 F09090A9 F0909081 4453 𐐁 +F09090A9 F09090A9 F0909081 4453 𐐩 +F0909082 F09090AA F0909082 4454 𐐂 +F09090AA F09090AA F0909082 4454 𐐪 +F0909083 F09090AB F0909083 4455 𐐃 +F09090AB F09090AB F0909083 4455 𐐫 +F0909084 F09090AC F0909084 4456 𐐄 +F09090AC F09090AC F0909084 4456 𐐬 +F0909085 F09090AD F0909085 4457 𐐅 +F09090AD F09090AD F0909085 4457 𐐭 +F0909086 F09090AE F0909086 4458 𐐆 +F09090AE F09090AE F0909086 4458 𐐮 +F0909087 F09090AF F0909087 4459 𐐇 +F09090AF F09090AF F0909087 4459 𐐯 +F0909880 F0909880 F0909880 46BA 𐘀 +F0909881 F0909881 F0909881 46BB 𐘁 +F0909882 F0909882 F0909882 46BC 𐘂 +F0909883 F0909883 F0909883 46BD 𐘃 +F0AB9D99 F0AB9D99 F0AB9D99 FB85B759 𫝙 +F0AB9DA0 F0AB9DA0 F0AB9DA0 FB85B760 𫝠 +F0AB9DA1 F0AB9DA1 F0AB9DA1 FB85B761 𫝡 +F0AB9DA2 F0AB9DA2 F0AB9DA2 FB85B762 𫝢 +F0ABA0B6 F0ABA0B6 F0ABA0B6 FB85B836 𫠶 +F0ABA0B7 F0ABA0B7 F0ABA0B7 FB85B837 𫠷 +F0ABA0B8 F0ABA0B8 F0ABA0B8 FB85B838 𫠸 +F0ABA0B9 F0ABA0B9 F0ABA0B9 FB85B839 𫠹 +F09FA881 F09FA881 F09FA881 FBC3FA01 🨁 +F09FAC81 F09FAC81 F09FAC81 FBC3FB01 🬁 +F09FB081 F09FB081 F09FB081 FBC3FC01 🰁 +F09FB481 F09FB481 F09FB481 FBC3FD01 🴁 +INSERT INTO t1 VALUES ('a'); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0xFFFF)); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0x10FFFF)); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0x10400)); +SELECT hex(c), hex(weight_string(c)) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +hex(c) hex(weight_string(c)) +61 1C47 +61F0909080 1C474452 +61EFBFBF 1C47FBC1FFFF +61F48FBFBF 1C47FBE1FFFF +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10400 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +F0909080 4452 𐐀 +F09090A8 4452 𐐨 +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10428 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +F0909080 4452 𐐀 +F09090A8 4452 𐐨 +ALTER TABLE t1 ADD KEY(c); +EXPLAIN SELECT hex(c) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range c c 43 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select hex(`test`.`t1`.`c`) AS `hex(c)` from `test`.`t1` where (`test`.`t1`.`c` like 'a%') order by `test`.`t1`.`c` +SELECT hex(c), hex(weight_string(c)) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +hex(c) hex(weight_string(c)) +61 1C47 +61F0909080 1C474452 +61EFBFBF 1C47FBC1FFFF +61F48FBFBF 1C47FBE1FFFF +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10400 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +F0909080 4452 𐐀 +F09090A8 4452 𐐨 +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10428 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +F0909080 4452 𐐀 +F09090A8 4452 𐐨 +DROP TABLE t1; +SELECT 'a' = 'a '; +'a' = 'a ' +0 +SELECT 'a\0' < 'a'; +'a\0' < 'a' +0 +SELECT 'a\0' < 'a '; +'a\0' < 'a ' +1 +SELECT 'a\t' < 'a'; +'a\t' < 'a' +0 +SELECT 'a\t' < 'a '; +'a\t' < 'a ' +1 +SELECT 'a' LIKE 'a'; +'a' LIKE 'a' +1 +SELECT 'A' LIKE 'a'; +'A' LIKE 'a' +1 +SELECT _utf8mb4 0xD0B0D0B1D0B2 LIKE CONCAT(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4 '%'); +_utf8mb4 0xD0B0D0B1D0B2 LIKE CONCAT(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4 '%') +1 +SELECT is_ipv4(inet_ntoa('1')); +is_ipv4(inet_ntoa('1')) +1 +SELECT is_ipv6(inet_ntoa('1')); +is_ipv6(inet_ntoa('1')) +0 +SELECT inet6_aton(inet_ntoa('1')); +inet6_aton(inet_ntoa('1')) + +SELECT inet6_ntoa(inet_ntoa('1')); +inet6_ntoa(inet_ntoa('1')) +NULL +# +# Bug#14040277 UNINITIALIZED VALUE REFERENCED IN STR_TO_IPV6 +# +SELECT inet6_aton(soundex('a')); +inet6_aton(soundex('a')) +NULL +# +# Bug#19047425 UNINITIALISED VALUE IN STR_TO_IPV6 +# +do is_ipv4_mapped(inet6_aton(convert(_ascii "a:" using utf8mb4))); +CREATE TABLE t1 (c VARCHAR(10) CHARACTER SET utf8mb4); +INSERT INTO t1 VALUES (_utf8mb4 0xF09090A7), (_utf8mb4 0xEA8B93), (_utf8mb4 0xC4BC), (_utf8mb4 0xC6AD), (_utf8mb4 0xF090918F), (_utf8mb4 0xEAAD8B); +SELECT HEX(ANY_VALUE(c)), COUNT(c) FROM t1 GROUP BY c COLLATE utf8mb4_0900_ai_ci; +HEX(ANY_VALUE(c)) COUNT(c) +C4BC 1 +C6AD 1 +EA8B93 1 +EAAD8B 1 +F09090A7 2 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10)) COLLATE utf8mb4_0900_ai_ci; +INSERT INTO t1 VALUES(_utf16 0xAC00, _utf16 0x326E), (_utf16 0xAD, _utf16 0xA0), +(_utf16 0xC6, _utf16 0x41), (_utf16 0xC6, _utf16 0xAA), (_utf16 0xA73A, _utf16 0xA738); +SELECT a = b FROM t1; +a = b +1 +0 +0 +0 +1 +DROP TABLE t1; +SET NAMES utf8mb4; +CREATE TABLE t1 (c1 CHAR(10) CHARACTER SET utf8mb4); +insert into t1 values ('A'),('a'); +insert into t1 values ('B'),('b'); +insert into t1 values ('C'),('c'); +insert into t1 values ('D'),('d'); +insert into t1 values ('E'),('e'); +insert into t1 values ('F'),('f'); +insert into t1 values ('G'),('g'); +insert into t1 values ('H'),('h'); +insert into t1 values ('I'),('i'); +insert into t1 values ('J'),('j'); +insert into t1 values ('K'),('k'); +insert into t1 values ('L'),('l'); +insert into t1 values ('M'),('m'); +insert into t1 values ('N'),('n'); +insert into t1 values ('O'),('o'); +insert into t1 values ('P'),('p'); +insert into t1 values ('Q'),('q'); +insert into t1 values ('R'),('r'); +insert into t1 values ('S'),('s'); +insert into t1 values ('T'),('t'); +insert into t1 values ('U'),('u'); +insert into t1 values ('V'),('v'); +insert into t1 values ('W'),('w'); +insert into t1 values ('X'),('x'); +insert into t1 values ('Y'),('y'); +insert into t1 values ('Z'),('z'); +insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0); +insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1); +insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2); +insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3); +insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4); +insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5); +insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6); +insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7); +insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8); +insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9); +insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca); +insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb); +insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc); +insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd); +insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce); +insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf); +insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0); +insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1); +insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2); +insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3); +insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4); +insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5); +insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6); +insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7); +insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8); +insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9); +insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da); +insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db); +insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc); +insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd); +insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de); +insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df); +insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103); +insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107); +insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b); +insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f); +insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113); +insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117); +insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b); +insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f); +insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123); +insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127); +insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b); +insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f); +insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133); +insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137); +insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b); +insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f); +insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143); +insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147); +insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b); +insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f); +insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153); +insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157); +insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b); +insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f); +insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163); +insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167); +insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b); +insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f); +insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173); +insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177); +insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b); +insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f); +insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183); +insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187); +insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b); +insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f); +insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193); +insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197); +insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b); +insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f); +insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3); +insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7); +insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab); +insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af); +insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3); +insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7); +insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb); +insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf); +insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3); +insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7); +insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb); +insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf); +insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3); +insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7); +insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db); +insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df); +insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3); +insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7); +insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb); +insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef); +insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3); +insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7); +insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb); +insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff); +INSERT INTO t1 VALUES (_ucs2 0x1EA0),(_ucs2 0x1EA1),(_ucs2 0x1EA2),(_ucs2 0x1EA3); +INSERT INTO t1 VALUES (_ucs2 0x1EA4),(_ucs2 0x1EA5),(_ucs2 0x1EA6),(_ucs2 0x1EA7); +INSERT INTO t1 VALUES (_ucs2 0x1EA8),(_ucs2 0x1EA9),(_ucs2 0x1EAA),(_ucs2 0x1EAB); +INSERT INTO t1 VALUES (_ucs2 0x1EAC),(_ucs2 0x1EAD),(_ucs2 0x1EAE),(_ucs2 0x1EAF); +INSERT INTO t1 VALUES (_ucs2 0x1EB0),(_ucs2 0x1EB1),(_ucs2 0x1EB2),(_ucs2 0x1EB3); +INSERT INTO t1 VALUES (_ucs2 0x1EB4),(_ucs2 0x1EB5),(_ucs2 0x1EB6),(_ucs2 0x1EB7); +INSERT INTO t1 VALUES (_ucs2 0x1EB8),(_ucs2 0x1EB9),(_ucs2 0x1EBA),(_ucs2 0x1EBB); +INSERT INTO t1 VALUES (_ucs2 0x1EBC),(_ucs2 0x1EBD),(_ucs2 0x1EBE),(_ucs2 0x1EBF); +INSERT INTO t1 VALUES (_ucs2 0x1EC0),(_ucs2 0x1EC1),(_ucs2 0x1EC2),(_ucs2 0x1EC3); +INSERT INTO t1 VALUES (_ucs2 0x1EC4),(_ucs2 0x1EC5),(_ucs2 0x1EC6),(_ucs2 0x1EC7); +INSERT INTO t1 VALUES (_ucs2 0x1EC8),(_ucs2 0x1EC9),(_ucs2 0x1ECA),(_ucs2 0x1ECB); +INSERT INTO t1 VALUES (_ucs2 0x1ECC),(_ucs2 0x1ECD),(_ucs2 0x1ECE),(_ucs2 0x1ECF); +INSERT INTO t1 VALUES (_ucs2 0x1ED0),(_ucs2 0x1ED1),(_ucs2 0x1ED2),(_ucs2 0x1ED3); +INSERT INTO t1 VALUES (_ucs2 0x1ED4),(_ucs2 0x1ED5),(_ucs2 0x1ED6),(_ucs2 0x1ED7); +INSERT INTO t1 VALUES (_ucs2 0x1ED8),(_ucs2 0x1ED9),(_ucs2 0x1EDA),(_ucs2 0x1EDB); +INSERT INTO t1 VALUES (_ucs2 0x1EDC),(_ucs2 0x1EDD),(_ucs2 0x1EDE),(_ucs2 0x1EDF); +INSERT INTO t1 VALUES (_ucs2 0x1EE0),(_ucs2 0x1EE1),(_ucs2 0x1EE2),(_ucs2 0x1EE3); +INSERT INTO t1 VALUES (_ucs2 0x1EE4),(_ucs2 0x1EE5),(_ucs2 0x1EE6),(_ucs2 0x1EE7); +INSERT INTO t1 VALUES (_ucs2 0x1EE8),(_ucs2 0x1EE9),(_ucs2 0x1EEA),(_ucs2 0x1EEB); +INSERT INTO t1 VALUES (_ucs2 0x1EEC),(_ucs2 0x1EED),(_ucs2 0x1EEE),(_ucs2 0x1EEF); +INSERT INTO t1 VALUES (_ucs2 0x1EF0),(_ucs2 0x1EF1); +insert into t1 values ('AA'),('Aa'),('aa'),('aA'); +insert into t1 values ('AE'),('Ae'),('ae'),('aE'); +insert into t1 values ('CH'),('Ch'),('ch'),('cH'); +insert into t1 values ('DZ'),('Dz'),('dz'),('dZ'); +insert into t1 values ('DŽ'),('Dž'),('dž'),('dŽ'); +insert into t1 values ('IJ'),('Ij'),('ij'),('iJ'); +insert into t1 values ('LJ'),('Lj'),('lj'),('lJ'); +insert into t1 values ('LL'),('Ll'),('ll'),('lL'); +insert into t1 values ('NJ'),('Nj'),('nj'),('nJ'); +insert into t1 values ('OE'),('Oe'),('oe'),('oE'); +insert into t1 values ('SS'),('Ss'),('ss'),('sS'); +insert into t1 values ('RR'),('Rr'),('rr'),('rR'); +insert into t1 values (_ucs2 0x0218), (_ucs2 0x0219), (_ucs2 0x021a), (_ucs2 0x021b); +insert into t1 values (_ucs2 0x0d96), (_ucs2 0x0da4), (_ucs2 0x0da5); +insert into t1 values (_ucs2 0x0064017e), (_ucs2 0x0044017e), (_ucs2 0x0044017d); +insert into t1 values ('CS'),('Cs'),('cs'),('cS'); +insert into t1 values ('DZS'),('DZs'),('Dzs'),('DzS'); +insert into t1 values ('dZS'),('dZs'),('dzs'),('dzS'); +insert into t1 values ('GY'),('Gy'),('gy'),('gY'); +insert into t1 values ('LY'),('Ly'),('ly'),('lY'); +insert into t1 values ('NY'),('Ny'),('ny'),('nY'); +insert into t1 values ('SZ'),('Sz'),('sz'),('sZ'); +insert into t1 values ('TY'),('Ty'),('ty'),('tY'); +insert into t1 values ('ZS'),('Zs'),('zs'),('zS'); +insert into t1 values ('RR'),('Rr'),('rr'),('rR'); +insert into t1 values ('ccs'),('Ccs'),('CCS'),('cCS'); +insert into t1 values ('ddz'),('Ddz'),('DDZ'),('dDZ'); +insert into t1 values ('ddzs'),('Ddzs'),('DDZS'),('dDZS'); +insert into t1 values ('ggy'),('Ggy'),('GGY'),('gGY'); +insert into t1 values ('lly'),('Lly'),('LLY'),('lLY'); +insert into t1 values ('nny'),('Nny'),('NNY'),('nNY'); +insert into t1 values ('ssz'),('Ssz'),('SSZ'),('sSZ'); +insert into t1 values ('tty'),('Tty'),('TTY'),('tTY'); +insert into t1 values ('zzs'),('Zzs'),('ZZS'),('zZS'); +insert into t1 values ('UE'),('Ue'),('ue'),('uE'); +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C2 00C3 00C4 00C5 00E0 00E1 00E2 00E3 00E4 00E5 0100 0101 0102 0103 0104 0105 01CD 01CE 01DE 01DF 01E0 01E1 01FA 01FB 1EA0 1EA1 1EA2 1EA3 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00410041 00410061 00610041 00610061 +00410045 00410065 00610045 00610065 00C6 00E6 01E2 01E3 01FC 01FD +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0106 0107 0108 0109 010A 010B 010C 010D +004300430053 004300630073 006300430053 006300630073 +00430048 00430068 00630048 00630068 +00430053 00430073 00630053 00630073 +0187 0188 +0044 0064 00D0 00F0 010E 010F 0110 0111 +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0044017D 0044017D 0044017E 0044017E 0064005A 0064007A 0064017D 0064017E 0064017E 01C4 01C5 01C6 01F1 01F2 01F3 +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CA 00CB 00E8 00E9 00EA 00EB 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011C 011D 011E 011F 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0124 0125 0126 0127 +0195 01F6 +0049 0069 00CC 00CD 00CE 00CF 00EC 00ED 00EE 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB +0049004A 0049006A 0069004A 0069006A 0132 0133 +0131 +0197 +0196 +004A 006A 0134 0135 01F0 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 0141 0142 +004C004A 004C006A 006C004A 006C006A 01C7 01C8 01C9 +004C004C 004C006C 006C004C 006C006C +004C004C0059 004C006C0079 006C004C0059 006C006C0079 +004C0059 004C0079 006C0059 006C0079 +019A +019B +004D 006D +004E 006E 00D1 00F1 0143 0144 0145 0146 0147 0148 01F8 01F9 +004E004A 004E006A 006E004A 006E006A 01CA 01CB 01CC +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +004E0059 004E0079 006E0059 006E0079 +019D +019E +014A 014B +004F 006F 00D2 00D3 00D4 00D5 00D6 00D8 00F2 00F3 00F4 00F5 00F6 00F8 014C 014D 014E 014F 0150 0151 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 01FE 01FF 1ECC 1ECD 1ECE 1ECF 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 1EDA 1EDB 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +004F0045 004F0065 006F0045 006F0065 0152 0153 +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 0158 0159 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +01A6 +0053 0073 015A 015B 015C 015D 015E 015F 0160 0161 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +01A9 +01AA +0054 0074 0162 0163 0164 0165 021A 021B +01BE +005400540059 005400740079 007400540059 007400740079 +00540059 00540079 00740059 00740079 +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DA 00DB 00DC 00F9 00FA 00FB 00FC 0168 0169 016A 016B 016C 016D 016E 016F 0170 0171 0172 0173 01AF 01B0 01D3 01D4 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC 1EE4 1EE5 1EE6 1EE7 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +00550045 00550065 00750045 00750065 +019C +01B1 +0056 0076 +01B2 +0057 0077 0174 0175 +0058 0078 +0059 0079 00DD 00FD 00FF 0176 0177 0178 +01B3 01B4 +005A 007A 0179 017A 017B 017C 017D 017E +005A0053 005A0073 007A0053 007A0073 +018D +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +00DE 00FE +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_de_pb_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C2 00C3 00C5 00E0 00E1 00E2 00E3 00E5 0100 0101 0102 0103 0104 0105 01CD 01CE 01E0 01E1 01FA 01FB 1EA0 1EA1 1EA2 1EA3 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00410041 00410061 00610041 00610061 +00C4 00E4 01DE 01DF 00410045 00410065 00610045 00610065 00C6 00E6 01E2 01E3 01FC 01FD +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0106 0107 0108 0109 010A 010B 010C 010D +004300430053 004300630073 006300430053 006300630073 +00430048 00430068 00630048 00630068 +00430053 00430073 00630053 00630073 +0187 0188 +0044 0064 00D0 00F0 010E 010F 0110 0111 +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0044017D 0044017D 0044017E 0044017E 0064005A 0064007A 0064017D 0064017E 0064017E 01C4 01C5 01C6 01F1 01F2 01F3 +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CA 00CB 00E8 00E9 00EA 00EB 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011C 011D 011E 011F 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0124 0125 0126 0127 +0195 01F6 +0049 0069 00CC 00CD 00CE 00CF 00EC 00ED 00EE 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB +0049004A 0049006A 0069004A 0069006A 0132 0133 +0131 +0197 +0196 +004A 006A 0134 0135 01F0 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 0141 0142 +004C004A 004C006A 006C004A 006C006A 01C7 01C8 01C9 +004C004C 004C006C 006C004C 006C006C +004C004C0059 004C006C0079 006C004C0059 006C006C0079 +004C0059 004C0079 006C0059 006C0079 +019A +019B +004D 006D +004E 006E 00D1 00F1 0143 0144 0145 0146 0147 0148 01F8 01F9 +004E004A 004E006A 006E004A 006E006A 01CA 01CB 01CC +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +004E0059 004E0079 006E0059 006E0079 +019D +019E +014A 014B +004F 006F 00D2 00D3 00D4 00D5 00D8 00F2 00F3 00F4 00F5 00F8 014C 014D 014E 014F 0150 0151 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 01FE 01FF 1ECC 1ECD 1ECE 1ECF 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 1EDA 1EDB 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +00D6 00F6 004F0045 004F0065 006F0045 006F0065 0152 0153 +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 0158 0159 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +01A6 +0053 0073 015A 015B 015C 015D 015E 015F 0160 0161 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +01A9 +01AA +0054 0074 0162 0163 0164 0165 021A 021B +01BE +005400540059 005400740079 007400540059 007400740079 +00540059 00540079 00740059 00740079 +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DA 00DB 00F9 00FA 00FB 0168 0169 016A 016B 016C 016D 016E 016F 0170 0171 0172 0173 01AF 01B0 01D3 01D4 1EE4 1EE5 1EE6 1EE7 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +00DC 00FC 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC 00550045 00550065 00750045 00750065 +019C +01B1 +0056 0076 +01B2 +0057 0077 0174 0175 +0058 0078 +0059 0079 00DD 00FD 00FF 0176 0177 0178 +01B3 01B4 +005A 007A 0179 017A 017B 017C 017D 017E +005A0053 005A0073 007A0053 007A0073 +018D +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +00DE 00FE +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_is_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C2 00C3 00E0 00E2 00E3 0100 0101 0102 0103 0104 0105 01CD 01CE 01E0 01E1 1EA0 1EA1 1EA2 1EA3 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00410041 00410061 00610041 00610061 +00410045 00410065 00610045 00610065 +00C1 00E1 +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0106 0107 0108 0109 010A 010B 010C 010D +004300430053 004300630073 006300430053 006300630073 +00430048 00430068 00630048 00630068 +00430053 00430073 00630053 00630073 +0187 0188 +0044 0064 010E 010F 0110 0111 +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0044017D 0044017D 0044017E 0044017E 0064005A 0064007A 0064017D 0064017E 0064017E 01C4 01C5 01C6 01F1 01F2 01F3 +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +00D0 00F0 +0189 +018A +018B 018C +0045 0065 00C8 00CA 00CB 00E8 00EA 00EB 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +00C9 00E9 +0046 0066 +0191 0192 +0047 0067 011C 011D 011E 011F 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0124 0125 0126 0127 +0195 01F6 +0049 0069 00CC 00CE 00CF 00EC 00EE 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB +0049004A 0049006A 0069004A 0069006A 0132 0133 +0131 +0197 +0196 +00CD 00ED +004A 006A 0134 0135 01F0 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 0141 0142 +004C004A 004C006A 006C004A 006C006A 01C7 01C8 01C9 +004C004C 004C006C 006C004C 006C006C +004C004C0059 004C006C0079 006C004C0059 006C006C0079 +004C0059 004C0079 006C0059 006C0079 +019A +019B +004D 006D +004E 006E 00D1 00F1 0143 0144 0145 0146 0147 0148 01F8 01F9 +004E004A 004E006A 006E004A 006E006A 01CA 01CB 01CC +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +004E0059 004E0079 006E0059 006E0079 +019D +019E +014A 014B +004F 006F 00D2 00D4 00D5 00F2 00F4 00F5 014C 014D 014E 014F 0150 0151 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 1ECC 1ECD 1ECE 1ECF 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +004F0045 004F0065 006F0045 006F0065 0152 0153 +0186 +019F +00D3 00F3 1EDA 1EDB +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 0158 0159 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +01A6 +0053 0073 015A 015B 015C 015D 015E 015F 0160 0161 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +01A9 +01AA +0054 0074 0162 0163 0164 0165 021A 021B +01BE +005400540059 005400740079 007400540059 007400740079 +00540059 00540079 00740059 00740079 +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DB 00DC 00F9 00FB 00FC 0168 0169 016A 016B 016C 016D 016E 016F 0170 0171 0172 0173 01AF 01B0 01D3 01D4 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC 1EE4 1EE5 1EE6 1EE7 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +00550045 00550065 00750045 00750065 +019C +01B1 +00DA 00FA 1EE8 1EE9 +0056 0076 +01B2 +0057 0077 0174 0175 +0058 0078 +0059 0079 00FF 0176 0177 0178 +01B3 01B4 +00DD 00FD +005A 007A 0179 017A 017B 017C 017D 017E +005A0053 005A0073 007A0053 007A0073 +018D +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +00DE 00FE +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +00C4 00E4 01DE 01DF 00C6 00E6 01E2 01E3 01FC 01FD +00D6 00D8 00F6 00F8 01FE 01FF +00C5 00E5 01FA 01FB +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_lv_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C2 00C3 00C4 00C5 00E0 00E1 00E2 00E3 00E4 00E5 0100 0101 0102 0103 0104 0105 01CD 01CE 01DE 01DF 01E0 01E1 01FA 01FB 1EA0 1EA1 1EA2 1EA3 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00410041 00410061 00610041 00610061 +00410045 00410065 00610045 00610065 00C6 00E6 01E2 01E3 01FC 01FD +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0106 0107 0108 0109 010A 010B +004300430053 004300630073 006300430053 006300630073 +00430048 00430068 00630048 00630068 +00430053 00430073 00630053 00630073 +0187 0188 +010C 010D +0044 0064 00D0 00F0 010E 010F 0110 0111 +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0064005A 0064007A 01C4 01C5 01C6 01F1 01F2 01F3 +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +0044017D 0044017D 0044017E 0044017E 0064017D 0064017E 0064017E +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CA 00CB 00E8 00E9 00EA 00EB 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011C 011D 011E 011F 0120 0121 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +01E4 01E5 +0193 +0194 +01A2 01A3 +0122 0123 +0048 0068 0124 0125 0126 0127 +0195 01F6 +0049 0069 00CC 00CD 00CE 00CF 00EC 00ED 00EE 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB 0059 0079 00DD 00FD 00FF 0176 0177 0178 +0049004A 0049006A 0069004A 0069006A 0132 0133 +0131 +0197 +0196 +004A 006A 0134 0135 01F0 +004B 006B 01E8 01E9 +0198 0199 +0136 0137 +004C 006C 0139 013A 013D 013E 013F 0140 0141 0142 +004C0059 004C0079 006C0059 006C0079 +004C004A 004C006A 006C004A 006C006A 01C7 01C8 01C9 +004C004C 004C006C 006C004C 006C006C +004C004C0059 004C006C0079 006C004C0059 006C006C0079 +019A +019B +013B 013C +004D 006D +004E 006E 00D1 00F1 0143 0144 0147 0148 01F8 01F9 +004E0059 004E0079 006E0059 006E0079 +004E004A 004E006A 006E004A 006E006A 01CA 01CB 01CC +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +019D +019E +014A 014B +0145 0146 +004F 006F 00D2 00D3 00D4 00D5 00D6 00D8 00F2 00F3 00F4 00F5 00F6 00F8 014C 014D 014E 014F 0150 0151 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 01FE 01FF 1ECC 1ECD 1ECE 1ECF 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 1EDA 1EDB 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +004F0045 004F0065 006F0045 006F0065 0152 0153 +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0158 0159 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +01A6 +0156 0157 +0053 0073 015A 015B 015C 015D 015E 015F 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +01A9 +01AA +0160 0161 +0054 0074 0162 0163 0164 0165 021A 021B +00540059 00540079 00740059 00740079 +01BE +005400540059 005400740079 007400540059 007400740079 +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DA 00DB 00DC 00F9 00FA 00FB 00FC 0168 0169 016A 016B 016C 016D 016E 016F 0170 0171 0172 0173 01AF 01B0 01D3 01D4 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC 1EE4 1EE5 1EE6 1EE7 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +00550045 00550065 00750045 00750065 +019C +01B1 +0056 0076 +01B2 +0057 0077 0174 0175 +0058 0078 +01B3 01B4 +005A 007A 0179 017A 017B 017C +005A0053 005A0073 007A0053 007A0073 +018D +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +01B5 01B6 +017D 017E +01B7 01EE 01EF +01B8 01B9 +01BA +00DE 00FE +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_ro_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C3 00C4 00C5 00E0 00E1 00E3 00E4 00E5 0100 0101 0104 0105 01CD 01CE 01DE 01DF 01E0 01E1 01FA 01FB 1EA0 1EA1 1EA2 1EA3 +00410041 00410061 00610041 00610061 +00410045 00410065 00610045 00610065 00C6 00E6 01E2 01E3 01FC 01FD +0102 0103 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00C2 00E2 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0106 0107 0108 0109 010A 010B 010C 010D +004300430053 004300630073 006300430053 006300630073 +00430048 00430068 00630048 00630068 +00430053 00430073 00630053 00630073 +0187 0188 +0044 0064 00D0 00F0 010E 010F 0110 0111 +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0044017D 0044017D 0044017E 0044017E 0064005A 0064007A 0064017D 0064017E 0064017E 01C4 01C5 01C6 01F1 01F2 01F3 +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CA 00CB 00E8 00E9 00EA 00EB 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011C 011D 011E 011F 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0124 0125 0126 0127 +0195 01F6 +0049 0069 00CC 00CD 00CF 00EC 00ED 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB +0049004A 0049006A 0069004A 0069006A 0132 0133 +00CE 00EE +0131 +0197 +0196 +004A 006A 0134 0135 01F0 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 0141 0142 +004C004A 004C006A 006C004A 006C006A 01C7 01C8 01C9 +004C004C 004C006C 006C004C 006C006C +004C004C0059 004C006C0079 006C004C0059 006C006C0079 +004C0059 004C0079 006C0059 006C0079 +019A +019B +004D 006D +004E 006E 00D1 00F1 0143 0144 0145 0146 0147 0148 01F8 01F9 +004E004A 004E006A 006E004A 006E006A 01CA 01CB 01CC +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +004E0059 004E0079 006E0059 006E0079 +019D +019E +014A 014B +004F 006F 00D2 00D3 00D4 00D5 00D6 00D8 00F2 00F3 00F4 00F5 00F6 00F8 014C 014D 014E 014F 0150 0151 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 01FE 01FF 1ECC 1ECD 1ECE 1ECF 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 1EDA 1EDB 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +004F0045 004F0065 006F0045 006F0065 0152 0153 +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 0158 0159 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +01A6 +0053 0073 015A 015B 015C 015D 0160 0161 017F +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +015E 015F 0218 0219 +01A9 +01AA +0054 0074 0164 0165 +01BE +005400540059 005400740079 007400540059 007400740079 +00540059 00540079 00740059 00740079 +0162 0163 021A 021B +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DA 00DB 00DC 00F9 00FA 00FB 00FC 0168 0169 016A 016B 016C 016D 016E 016F 0170 0171 0172 0173 01AF 01B0 01D3 01D4 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC 1EE4 1EE5 1EE6 1EE7 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +00550045 00550065 00750045 00750065 +019C +01B1 +0056 0076 +01B2 +0057 0077 0174 0175 +0058 0078 +0059 0079 00DD 00FD 00FF 0176 0177 0178 +01B3 01B4 +005A 007A 0179 017A 017B 017C 017D 017E +005A0053 005A0073 007A0053 007A0073 +018D +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +00DE 00FE +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_sl_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C2 00C3 00C4 00C5 00E0 00E1 00E2 00E3 00E4 00E5 0100 0101 0102 0103 0104 0105 01CD 01CE 01DE 01DF 01E0 01E1 01FA 01FB 1EA0 1EA1 1EA2 1EA3 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00410041 00410061 00610041 00610061 +00410045 00410065 00610045 00610065 00C6 00E6 01E2 01E3 01FC 01FD +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0108 0109 010A 010B +004300430053 004300630073 006300430053 006300630073 +00430048 00430068 00630048 00630068 +00430053 00430073 00630053 00630073 +010C 010D +0106 0107 +0187 0188 +0044 0064 00D0 00F0 010E 010F +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0064005A 0064007A 01C4 01C5 01C6 01F1 01F2 01F3 +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +0044017D 0044017D 0044017E 0044017E 0064017D 0064017E 0064017E +0110 0111 +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CA 00CB 00E8 00E9 00EA 00EB 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011C 011D 011E 011F 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0124 0125 0126 0127 +0195 01F6 +0049 0069 00CC 00CD 00CE 00CF 00EC 00ED 00EE 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB +0049004A 0049006A 0069004A 0069006A 0132 0133 +0131 +0197 +0196 +004A 006A 0134 0135 01F0 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 0141 0142 +004C004A 004C006A 006C004A 006C006A 01C7 01C8 01C9 +004C004C 004C006C 006C004C 006C006C +004C004C0059 004C006C0079 006C004C0059 006C006C0079 +004C0059 004C0079 006C0059 006C0079 +019A +019B +004D 006D +004E 006E 00D1 00F1 0143 0144 0145 0146 0147 0148 01F8 01F9 +004E004A 004E006A 006E004A 006E006A 01CA 01CB 01CC +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +004E0059 004E0079 006E0059 006E0079 +019D +019E +014A 014B +004F 006F 00D2 00D3 00D4 00D5 00D6 00D8 00F2 00F3 00F4 00F5 00F6 00F8 014C 014D 014E 014F 0150 0151 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 01FE 01FF 1ECC 1ECD 1ECE 1ECF 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 1EDA 1EDB 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +004F0045 004F0065 006F0045 006F0065 0152 0153 +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 0158 0159 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +01A6 +0053 0073 015A 015B 015C 015D 015E 015F 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +0160 0161 +01A9 +01AA +0054 0074 0162 0163 0164 0165 021A 021B +01BE +005400540059 005400740079 007400540059 007400740079 +00540059 00540079 00740059 00740079 +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DA 00DB 00DC 00F9 00FA 00FB 00FC 0168 0169 016A 016B 016C 016D 016E 016F 0170 0171 0172 0173 01AF 01B0 01D3 01D4 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC 1EE4 1EE5 1EE6 1EE7 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +00550045 00550065 00750045 00750065 +019C +01B1 +0056 0076 +01B2 +0057 0077 0174 0175 +0058 0078 +0059 0079 00DD 00FD 00FF 0176 0177 0178 +01B3 01B4 +005A 007A 0179 017A 017B 017C +005A0053 005A0073 007A0053 007A0073 +018D +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +017D 017E +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +00DE 00FE +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_pl_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C2 00C3 00C4 00C5 00E0 00E1 00E2 00E3 00E4 00E5 0100 0101 0102 0103 01CD 01CE 01DE 01DF 01E0 01E1 01FA 01FB 1EA0 1EA1 1EA2 1EA3 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00410041 00410061 00610041 00610061 +00410045 00410065 00610045 00610065 00C6 00E6 01E2 01E3 01FC 01FD +0104 0105 +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0108 0109 010A 010B 010C 010D +004300430053 004300630073 006300430053 006300630073 +00430048 00430068 00630048 00630068 +00430053 00430073 00630053 00630073 +0106 0107 +0187 0188 +0044 0064 00D0 00F0 010E 010F 0110 0111 +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0044017D 0044017D 0044017E 0044017E 0064005A 0064007A 0064017D 0064017E 0064017E 01C4 01C5 01C6 01F1 01F2 01F3 +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CA 00CB 00E8 00E9 00EA 00EB 0112 0113 0114 0115 0116 0117 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +0118 0119 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011C 011D 011E 011F 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0124 0125 0126 0127 +0195 01F6 +0049 0069 00CC 00CD 00CE 00CF 00EC 00ED 00EE 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB +0049004A 0049006A 0069004A 0069006A 0132 0133 +0131 +0197 +0196 +004A 006A 0134 0135 01F0 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 +004C004A 004C006A 006C004A 006C006A 01C7 01C8 01C9 +004C004C 004C006C 006C004C 006C006C +004C004C0059 004C006C0079 006C004C0059 006C006C0079 +004C0059 004C0079 006C0059 006C0079 +0141 0142 +019A +019B +004D 006D +004E 006E 00D1 00F1 0145 0146 0147 0148 01F8 01F9 +004E004A 004E006A 006E004A 006E006A 01CA 01CB 01CC +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +004E0059 004E0079 006E0059 006E0079 +0143 0144 +019D +019E +014A 014B +004F 006F 00D2 00D4 00D5 00D6 00D8 00F2 00F4 00F5 00F6 00F8 014C 014D 014E 014F 0150 0151 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 01FE 01FF 1ECC 1ECD 1ECE 1ECF 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +004F0045 004F0065 006F0045 006F0065 0152 0153 +00D3 00F3 1EDA 1EDB +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 0158 0159 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +01A6 +0053 0073 015C 015D 015E 015F 0160 0161 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +015A 015B +01A9 +01AA +0054 0074 0162 0163 0164 0165 021A 021B +01BE +005400540059 005400740079 007400540059 007400740079 +00540059 00540079 00740059 00740079 +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DA 00DB 00DC 00F9 00FA 00FB 00FC 0168 0169 016A 016B 016C 016D 016E 016F 0170 0171 0172 0173 01AF 01B0 01D3 01D4 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC 1EE4 1EE5 1EE6 1EE7 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +00550045 00550065 00750045 00750065 +019C +01B1 +0056 0076 +01B2 +0057 0077 0174 0175 +0058 0078 +0059 0079 00DD 00FD 00FF 0176 0177 0178 +01B3 01B4 +005A 007A 017D 017E +005A0053 005A0073 007A0053 007A0073 +018D +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +0179 017A +017B 017C +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +00DE 00FE +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_et_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C2 00C3 00C5 00E0 00E1 00E2 00E3 00E5 0100 0101 0102 0103 0104 0105 01CD 01CE 01E0 01E1 01FA 01FB 1EA0 1EA1 1EA2 1EA3 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00410041 00410061 00610041 00610061 +00410045 00410065 00610045 00610065 00C6 00E6 01E2 01E3 01FC 01FD +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0106 0107 0108 0109 010A 010B 010C 010D +004300430053 004300630073 006300430053 006300630073 +00430048 00430068 00630048 00630068 +00430053 00430073 00630053 00630073 +0187 0188 +0044 0064 00D0 00F0 010E 010F 0110 0111 +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0064005A 0064007A +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +0044017D 0044017D 0044017E 0044017E 0064017D 0064017E 0064017E +01C4 01C5 01C6 01F1 01F2 01F3 +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CA 00CB 00E8 00E9 00EA 00EB 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011C 011D 011E 011F 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0124 0125 0126 0127 +0195 01F6 +0049 0069 00CC 00CD 00CE 00CF 00EC 00ED 00EE 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB +0049004A 0049006A 0069004A 0069006A 0132 0133 +0131 +0197 +0196 +004A 006A 0134 0135 01F0 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 0141 0142 +004C004A 004C006A 006C004A 006C006A 01C7 01C8 01C9 +004C004C 004C006C 006C004C 006C006C +004C004C0059 004C006C0079 006C004C0059 006C006C0079 +004C0059 004C0079 006C0059 006C0079 +019A +019B +004D 006D +004E 006E 00D1 00F1 0143 0144 0145 0146 0147 0148 01F8 01F9 +004E004A 004E006A 006E004A 006E006A 01CA 01CB 01CC +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +004E0059 004E0079 006E0059 006E0079 +019D +019E +014A 014B +004F 006F 00D2 00D3 00D4 00D8 00F2 00F3 00F4 00F8 014C 014D 014E 014F 0150 0151 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 01FE 01FF 1ECC 1ECD 1ECE 1ECF 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 1EDA 1EDB 1EDC 1EDD 1EDE 1EDF 1EE2 1EE3 +004F0045 004F0065 006F0045 006F0065 0152 0153 +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 0158 0159 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +01A6 +0053 0073 015A 015B 015C 015D 015E 015F 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +01A9 +01AA +0160 0161 +005A 007A 0179 017A 017B 017C +005A0053 005A0073 007A0053 007A0073 +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +017D 017E +0054 0074 0162 0163 0164 0165 021A 021B +01BE +005400540059 005400740079 007400540059 007400740079 +00540059 00540079 00740059 00740079 +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DA 00DB 00F9 00FA 00FB 0168 0169 016A 016B 016C 016D 016E 016F 0170 0171 0172 0173 01AF 01B0 01D3 01D4 1EE4 1EE5 1EE6 1EE7 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +00550045 00550065 00750045 00750065 +019C +01B1 +0056 0076 +01B2 +0057 0077 0174 0175 +00D5 00F5 1EE0 1EE1 +00C4 00E4 01DE 01DF +00D6 00F6 +00DC 00FC 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC +0058 0078 +0059 0079 00DD 00FD 00FF 0176 0177 0178 +01B3 01B4 +018D +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +00DE 00FE +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_es_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C2 00C3 00C4 00C5 00E0 00E1 00E2 00E3 00E4 00E5 0100 0101 0102 0103 0104 0105 01CD 01CE 01DE 01DF 01E0 01E1 01FA 01FB 1EA0 1EA1 1EA2 1EA3 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00410041 00410061 00610041 00610061 +00410045 00410065 00610045 00610065 00C6 00E6 01E2 01E3 01FC 01FD +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0106 0107 0108 0109 010A 010B 010C 010D +004300430053 004300630073 006300430053 006300630073 +00430048 00430068 00630048 00630068 +00430053 00430073 00630053 00630073 +0187 0188 +0044 0064 00D0 00F0 010E 010F 0110 0111 +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0044017D 0044017D 0044017E 0044017E 0064005A 0064007A 0064017D 0064017E 0064017E 01C4 01C5 01C6 01F1 01F2 01F3 +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CA 00CB 00E8 00E9 00EA 00EB 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011C 011D 011E 011F 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0124 0125 0126 0127 +0195 01F6 +0049 0069 00CC 00CD 00CE 00CF 00EC 00ED 00EE 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB +0049004A 0049006A 0069004A 0069006A 0132 0133 +0131 +0197 +0196 +004A 006A 0134 0135 01F0 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 0141 0142 +004C004A 004C006A 006C004A 006C006A 01C7 01C8 01C9 +004C004C 004C006C 006C004C 006C006C +004C004C0059 004C006C0079 006C004C0059 006C006C0079 +004C0059 004C0079 006C0059 006C0079 +019A +019B +004D 006D +004E 006E 0143 0144 0145 0146 0147 0148 01F8 01F9 +004E004A 004E006A 006E004A 006E006A 01CA 01CB 01CC +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +004E0059 004E0079 006E0059 006E0079 +00D1 00F1 +019D +019E +014A 014B +004F 006F 00D2 00D3 00D4 00D5 00D6 00D8 00F2 00F3 00F4 00F5 00F6 00F8 014C 014D 014E 014F 0150 0151 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 01FE 01FF 1ECC 1ECD 1ECE 1ECF 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 1EDA 1EDB 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +004F0045 004F0065 006F0045 006F0065 0152 0153 +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 0158 0159 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +01A6 +0053 0073 015A 015B 015C 015D 015E 015F 0160 0161 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +01A9 +01AA +0054 0074 0162 0163 0164 0165 021A 021B +01BE +005400540059 005400740079 007400540059 007400740079 +00540059 00540079 00740059 00740079 +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DA 00DB 00DC 00F9 00FA 00FB 00FC 0168 0169 016A 016B 016C 016D 016E 016F 0170 0171 0172 0173 01AF 01B0 01D3 01D4 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC 1EE4 1EE5 1EE6 1EE7 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +00550045 00550065 00750045 00750065 +019C +01B1 +0056 0076 +01B2 +0057 0077 0174 0175 +0058 0078 +0059 0079 00DD 00FD 00FF 0176 0177 0178 +01B3 01B4 +005A 007A 0179 017A 017B 017C 017D 017E +005A0053 005A0073 007A0053 007A0073 +018D +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +00DE 00FE +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_sv_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C2 00C3 00E0 00E1 00E2 00E3 0100 0101 0102 0103 0104 0105 01CD 01CE 01E0 01E1 1EA0 1EA1 1EA2 1EA3 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00410041 00410061 00610041 00610061 +00410045 00410065 00610045 00610065 +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0106 0107 0108 0109 010A 010B 010C 010D +004300430053 004300630073 006300430053 006300630073 +00430048 00430068 00630048 00630068 +00430053 00430073 00630053 00630073 +0187 0188 +0044 0064 00D0 00F0 010E 010F 0110 0111 +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0044017D 0044017D 0044017E 0044017E 0064005A 0064007A 0064017D 0064017E 0064017E 01C4 01C5 01C6 01F1 01F2 01F3 +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CA 00CB 00E8 00E9 00EA 00EB 0112 0113 0114 0115 0116 0117 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011C 011D 011E 011F 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0124 0125 0126 0127 +0195 01F6 +0049 0069 00CC 00CD 00CE 00CF 00EC 00ED 00EE 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB +0049004A 0049006A 0069004A 0069006A 0132 0133 +0131 +0197 +0196 +004A 006A 0134 0135 01F0 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 0141 0142 +004C004A 004C006A 006C004A 006C006A 01C7 01C8 01C9 +004C004C 004C006C 006C004C 006C006C +004C004C0059 004C006C0079 006C004C0059 006C006C0079 +004C0059 004C0079 006C0059 006C0079 +019A +019B +004D 006D +004E 006E 00D1 00F1 0143 0144 0145 0146 0147 0148 01F8 01F9 +004E004A 004E006A 006E004A 006E006A 01CA 01CB 01CC +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +004E0059 004E0079 006E0059 006E0079 +019D +019E +014A 014B +004F 006F 00D2 00D3 00D5 00F2 00F3 00F5 014C 014D 014E 014F 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 1ECC 1ECD 1ECE 1ECF 1EDA 1EDB 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +004F0045 004F0065 006F0045 006F0065 +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 0158 0159 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +01A6 +0053 0073 015A 015B 015C 015D 015E 015F 0160 0161 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +01A9 +01AA +0054 0074 0162 0163 0164 0165 021A 021B +00DE 00FE +01BE +005400540059 005400740079 007400540059 007400740079 +00540059 00540079 00740059 00740079 +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DA 00DB 00F9 00FA 00FB 0168 0169 016A 016B 016C 016D 016E 016F 0172 0173 01AF 01B0 01D3 01D4 1EE4 1EE5 1EE6 1EE7 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +00550045 00550065 00750045 00750065 +019C +01B1 +0056 0076 +01B2 +0057 0077 0174 0175 +0058 0078 +00DC 00FC 0170 0171 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC 0059 0079 00DD 00FD 00FF 0176 0177 0178 +01B3 01B4 +005A 007A 0179 017A 017B 017C 017D 017E +005A0053 005A0073 007A0053 007A0073 +018D +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +00C5 00E5 01FA 01FB +00C4 00E4 01DE 01DF 00C6 00E6 01E2 01E3 01FC 01FD 0118 0119 +00D4 00D6 00D8 00F4 00F6 00F8 0150 0151 01FE 01FF 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 0152 0153 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_tr_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C2 00C3 00C4 00C5 00E0 00E1 00E2 00E3 00E4 00E5 0100 0101 0102 0103 0104 0105 01CD 01CE 01DE 01DF 01E0 01E1 01FA 01FB 1EA0 1EA1 1EA2 1EA3 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00410041 00410061 00610041 00610061 +00410045 00410065 00610045 00610065 00C6 00E6 01E2 01E3 01FC 01FD +0042 0062 +0180 +0181 +0182 0183 +0043 0063 0106 0107 0108 0109 010A 010B 010C 010D +004300430053 004300630073 006300430053 006300630073 +00430048 00430068 00630048 00630068 +00430053 00430073 00630053 00630073 +00C7 00E7 +0187 0188 +0044 0064 00D0 00F0 010E 010F 0110 0111 +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0044017D 0044017D 0044017E 0044017E 0064005A 0064007A 0064017D 0064017E 0064017E 01C4 01C5 01C6 01F1 01F2 01F3 +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CA 00CB 00E8 00E9 00EA 00EB 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011C 011D 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +011E 011F +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0124 0125 0126 0127 +0195 01F6 +0049 00CC 00CD 00CE 00CF 0128 012A 012C 012E 01CF 1EC8 1ECA 0131 +0049004A 0049006A +0069 00EC 00ED 00EE 00EF 0129 012B 012D 012F 0130 01D0 1EC9 1ECB +0069004A 0069006A 0132 0133 +0197 +0196 +004A 006A 0134 0135 01F0 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 0141 0142 +004C004A 004C006A 006C004A 006C006A 01C7 01C8 01C9 +004C004C 004C006C 006C004C 006C006C +004C004C0059 004C006C0079 006C004C0059 006C006C0079 +004C0059 004C0079 006C0059 006C0079 +019A +019B +004D 006D +004E 006E 00D1 00F1 0143 0144 0145 0146 0147 0148 01F8 01F9 +004E004A 004E006A 006E004A 006E006A 01CA 01CB 01CC +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +004E0059 004E0079 006E0059 006E0079 +019D +019E +014A 014B +004F 006F 00D2 00D3 00D4 00D5 00D8 00F2 00F3 00F4 00F5 00F8 014C 014D 014E 014F 0150 0151 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 01FE 01FF 1ECC 1ECD 1ECE 1ECF 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 1EDA 1EDB 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +004F0045 004F0065 006F0045 006F0065 0152 0153 +00D6 00F6 +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 0158 0159 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +01A6 +0053 0073 015A 015B 015C 015D 0160 0161 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +015E 015F +01A9 +01AA +0054 0074 0162 0163 0164 0165 021A 021B +01BE +005400540059 005400740079 007400540059 007400740079 +00540059 00540079 00740059 00740079 +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DA 00DB 00F9 00FA 00FB 0168 0169 016A 016B 016C 016D 016E 016F 0170 0171 0172 0173 01AF 01B0 01D3 01D4 1EE4 1EE5 1EE6 1EE7 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +00550045 00550065 00750045 00750065 +00DC 00FC 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC +019C +01B1 +0056 0076 +01B2 +0057 0077 0174 0175 +0058 0078 +0059 0079 00DD 00FD 00FF 0176 0177 0178 +01B3 01B4 +005A 007A 0179 017A 017B 017C 017D 017E +005A0053 005A0073 007A0053 007A0073 +018D +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +00DE 00FE +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_cs_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C2 00C3 00C4 00C5 00E0 00E1 00E2 00E3 00E4 00E5 0100 0101 0102 0103 0104 0105 01CD 01CE 01DE 01DF 01E0 01E1 01FA 01FB 1EA0 1EA1 1EA2 1EA3 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00410041 00410061 00610041 00610061 +00410045 00410065 00610045 00610065 00C6 00E6 01E2 01E3 01FC 01FD +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0106 0107 0108 0109 010A 010B +004300430053 004300630073 006300430053 006300630073 +00430053 00430073 00630053 00630073 +010C 010D +0187 0188 +0044 0064 00D0 00F0 010E 010F 0110 0111 +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0064005A 0064007A 01C4 01C5 01C6 01F1 01F2 01F3 +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +0044017D 0044017D 0044017E 0044017E 0064017D 0064017E 0064017E +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CA 00CB 00E8 00E9 00EA 00EB 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011C 011D 011E 011F 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0124 0125 0126 0127 +00430048 00430068 00630048 00630068 +0195 01F6 +0049 0069 00CC 00CD 00CE 00CF 00EC 00ED 00EE 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB +0049004A 0049006A 0069004A 0069006A 0132 0133 +0131 +0197 +0196 +004A 006A 0134 0135 01F0 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 0141 0142 +004C004A 004C006A 006C004A 006C006A 01C7 01C8 01C9 +004C004C 004C006C 006C004C 006C006C +004C004C0059 004C006C0079 006C004C0059 006C006C0079 +004C0059 004C0079 006C0059 006C0079 +019A +019B +004D 006D +004E 006E 00D1 00F1 0143 0144 0145 0146 0147 0148 01F8 01F9 +004E004A 004E006A 006E004A 006E006A 01CA 01CB 01CC +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +004E0059 004E0079 006E0059 006E0079 +019D +019E +014A 014B +004F 006F 00D2 00D3 00D4 00D5 00D6 00D8 00F2 00F3 00F4 00F5 00F6 00F8 014C 014D 014E 014F 0150 0151 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 01FE 01FF 1ECC 1ECD 1ECE 1ECF 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 1EDA 1EDB 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +004F0045 004F0065 006F0045 006F0065 0152 0153 +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +0158 0159 +01A6 +0053 0073 015A 015B 015C 015D 015E 015F 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +0160 0161 +01A9 +01AA +0054 0074 0162 0163 0164 0165 021A 021B +01BE +005400540059 005400740079 007400540059 007400740079 +00540059 00540079 00740059 00740079 +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DA 00DB 00DC 00F9 00FA 00FB 00FC 0168 0169 016A 016B 016C 016D 016E 016F 0170 0171 0172 0173 01AF 01B0 01D3 01D4 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC 1EE4 1EE5 1EE6 1EE7 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +00550045 00550065 00750045 00750065 +019C +01B1 +0056 0076 +01B2 +0057 0077 0174 0175 +0058 0078 +0059 0079 00DD 00FD 00FF 0176 0177 0178 +01B3 01B4 +005A 007A 0179 017A 017B 017C +005A0053 005A0073 007A0053 007A0073 +018D +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +017D 017E +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +00DE 00FE +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_da_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C2 00C3 00E0 00E1 00E2 00E3 0100 0101 0102 0103 0104 0105 01CD 01CE 01E0 01E1 1EA0 1EA1 1EA2 1EA3 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00610041 +00410045 00410065 00610045 00610065 +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0106 0107 0108 0109 010A 010B 010C 010D +004300430053 004300630073 006300430053 006300630073 +00430048 00430068 00630048 00630068 +00430053 00430073 00630053 00630073 +0187 0188 +0044 0064 00D0 00F0 010E 010F 0110 0111 +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0044017D 0044017D 0044017E 0044017E 0064005A 0064007A 0064017D 0064017E 0064017E 01C4 01C5 01C6 01F1 01F2 01F3 +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CA 00CB 00E8 00E9 00EA 00EB 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011C 011D 011E 011F 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0124 0125 0126 0127 +0195 01F6 +0049 0069 00CC 00CD 00CE 00CF 00EC 00ED 00EE 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB +0049004A 0049006A 0069004A 0069006A 0132 0133 +0131 +0197 +0196 +004A 006A 0134 0135 01F0 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 0141 0142 +004C004A 004C006A 006C004A 006C006A 01C7 01C8 01C9 +004C004C 004C006C 006C004C 006C006C +004C004C0059 004C006C0079 006C004C0059 006C006C0079 +004C0059 004C0079 006C0059 006C0079 +019A +019B +004D 006D +004E 006E 00D1 00F1 0143 0144 0145 0146 0147 0148 01F8 01F9 +004E004A 004E006A 006E004A 006E006A 01CA 01CB 01CC +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +004E0059 004E0079 006E0059 006E0079 +019D +019E +014A 014B +004F 006F 00D2 00D3 00D4 00D5 00F2 00F3 00F4 00F5 014C 014D 014E 014F 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 1ECC 1ECD 1ECE 1ECF 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 1EDA 1EDB 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +004F0045 004F0065 006F0045 006F0065 +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 0158 0159 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +01A6 +0053 0073 015A 015B 015C 015D 015E 015F 0160 0161 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +01A9 +01AA +0054 0074 0162 0163 0164 0165 021A 021B +00DE 00FE +01BE +005400540059 005400740079 007400540059 007400740079 +00540059 00540079 00740059 00740079 +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DA 00DB 00F9 00FA 00FB 0168 0169 016A 016B 016C 016D 016E 016F 0172 0173 01AF 01B0 01D3 01D4 1EE4 1EE5 1EE6 1EE7 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +00550045 00550065 00750045 00750065 +019C +01B1 +0056 0076 +01B2 +0057 0077 0174 0175 +0058 0078 +00DC 00FC 0170 0171 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC 0059 0079 00DD 00FD 00FF 0176 0177 0178 +01B3 01B4 +005A 007A 0179 017A 017B 017C 017D 017E +005A0053 005A0073 007A0053 007A0073 +018D +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +00C4 00E4 01DE 01DF 00C6 00E6 01E2 01E3 01FC 01FD +00D6 00D8 00F6 00F8 0150 0151 01FE 01FF 0152 0153 +00C5 00E5 01FA 01FB 00410041 00410061 00610061 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_lt_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C2 00C3 00C4 00C5 00E0 00E1 00E2 00E3 00E4 00E5 0100 0101 0102 0103 0104 0105 01CD 01CE 01DE 01DF 01E0 01E1 01FA 01FB 1EA0 1EA1 1EA2 1EA3 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00410041 00410061 00610041 00610061 +00410045 00410065 00610045 00610065 00C6 00E6 01E2 01E3 01FC 01FD +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0106 0107 0108 0109 010A 010B +004300430053 004300630073 006300430053 006300630073 +00430048 00430068 00630048 00630068 +00430053 00430073 00630053 00630073 +010C 010D +0187 0188 +0044 0064 00D0 00F0 010E 010F 0110 0111 +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0064005A 0064007A 01C4 01C5 01C6 01F1 01F2 01F3 +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +0044017D 0044017D 0044017E 0044017E 0064017D 0064017E 0064017E +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CA 00CB 00E8 00E9 00EA 00EB 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011C 011D 011E 011F 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0124 0125 0126 0127 +0195 01F6 +0049 0069 00CC 00CD 00CE 00CF 00EC 00ED 00EE 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB 0059 0079 00DD 00FD 00FF 0176 0177 0178 +0049004A 0049006A 0069004A 0069006A 0132 0133 +0131 +0197 +0196 +004A 006A 0134 0135 01F0 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 0141 0142 +004C0059 004C0079 006C0059 006C0079 +004C004A 004C006A 006C004A 006C006A 01C7 01C8 01C9 +004C004C 004C006C 006C004C 006C006C +004C004C0059 004C006C0079 006C004C0059 006C006C0079 +019A +019B +004D 006D +004E 006E 00D1 00F1 0143 0144 0145 0146 0147 0148 01F8 01F9 +004E0059 004E0079 006E0059 006E0079 +004E004A 004E006A 006E004A 006E006A 01CA 01CB 01CC +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +019D +019E +014A 014B +004F 006F 00D2 00D3 00D4 00D5 00D6 00D8 00F2 00F3 00F4 00F5 00F6 00F8 014C 014D 014E 014F 0150 0151 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 01FE 01FF 1ECC 1ECD 1ECE 1ECF 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 1EDA 1EDB 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +004F0045 004F0065 006F0045 006F0065 0152 0153 +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 0158 0159 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +01A6 +0053 0073 015A 015B 015C 015D 015E 015F 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +0160 0161 +01A9 +01AA +0054 0074 0162 0163 0164 0165 021A 021B +00540059 00540079 00740059 00740079 +01BE +005400540059 005400740079 007400540059 007400740079 +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DA 00DB 00DC 00F9 00FA 00FB 00FC 0168 0169 016A 016B 016C 016D 016E 016F 0170 0171 0172 0173 01AF 01B0 01D3 01D4 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC 1EE4 1EE5 1EE6 1EE7 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +00550045 00550065 00750045 00750065 +019C +01B1 +0056 0076 +01B2 +0057 0077 0174 0175 +0058 0078 +01B3 01B4 +005A 007A 0179 017A 017B 017C +005A0053 005A0073 007A0053 007A0073 +018D +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +017D 017E +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +00DE 00FE +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_sk_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C2 00C3 00C5 00E0 00E1 00E2 00E3 00E5 0100 0101 0102 0103 0104 0105 01CD 01CE 01E0 01E1 01FA 01FB 1EA0 1EA1 1EA2 1EA3 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00410041 00410061 00610041 00610061 +00410045 00410065 00610045 00610065 00C6 00E6 01E2 01E3 01FC 01FD +00C4 00E4 01DE 01DF +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0106 0107 0108 0109 010A 010B +004300430053 004300630073 006300430053 006300630073 +00430053 00430073 00630053 00630073 +010C 010D +0187 0188 +0044 0064 00D0 00F0 010E 010F 0110 0111 +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0064005A 0064007A 01C4 01C5 01C6 01F1 01F2 01F3 +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +0044017D 0044017D 0044017E 0044017E 0064017D 0064017E 0064017E +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CA 00CB 00E8 00E9 00EA 00EB 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011C 011D 011E 011F 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0124 0125 0126 0127 +00430048 00430068 00630048 00630068 +0195 01F6 +0049 0069 00CC 00CD 00CE 00CF 00EC 00ED 00EE 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB +0049004A 0049006A 0069004A 0069006A 0132 0133 +0131 +0197 +0196 +004A 006A 0134 0135 01F0 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 0141 0142 +004C004A 004C006A 006C004A 006C006A 01C7 01C8 01C9 +004C004C 004C006C 006C004C 006C006C +004C004C0059 004C006C0079 006C004C0059 006C006C0079 +004C0059 004C0079 006C0059 006C0079 +019A +019B +004D 006D +004E 006E 00D1 00F1 0143 0144 0145 0146 0147 0148 01F8 01F9 +004E004A 004E006A 006E004A 006E006A 01CA 01CB 01CC +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +004E0059 004E0079 006E0059 006E0079 +019D +019E +014A 014B +004F 006F 00D2 00D3 00D5 00D6 00D8 00F2 00F3 00F5 00F6 00F8 014C 014D 014E 014F 0150 0151 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 01FE 01FF 1ECC 1ECD 1ECE 1ECF 1EDA 1EDB 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +004F0045 004F0065 006F0045 006F0065 0152 0153 +00D4 00F4 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +0158 0159 +01A6 +0053 0073 015A 015B 015C 015D 015E 015F 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +0160 0161 +01A9 +01AA +0054 0074 0162 0163 0164 0165 021A 021B +01BE +005400540059 005400740079 007400540059 007400740079 +00540059 00540079 00740059 00740079 +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DA 00DB 00DC 00F9 00FA 00FB 00FC 0168 0169 016A 016B 016C 016D 016E 016F 0170 0171 0172 0173 01AF 01B0 01D3 01D4 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC 1EE4 1EE5 1EE6 1EE7 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +00550045 00550065 00750045 00750065 +019C +01B1 +0056 0076 +01B2 +0057 0077 0174 0175 +0058 0078 +0059 0079 00DD 00FD 00FF 0176 0177 0178 +01B3 01B4 +005A 007A 0179 017A 017B 017C +005A0053 005A0073 007A0053 007A0073 +018D +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +017D 017E +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +00DE 00FE +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_es_trad_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C2 00C3 00C4 00C5 00E0 00E1 00E2 00E3 00E4 00E5 0100 0101 0102 0103 0104 0105 01CD 01CE 01DE 01DF 01E0 01E1 01FA 01FB 1EA0 1EA1 1EA2 1EA3 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00410041 00410061 00610041 00610061 +00410045 00410065 00610045 00610065 00C6 00E6 01E2 01E3 01FC 01FD +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0106 0107 0108 0109 010A 010B 010C 010D +004300430053 004300630073 006300430053 006300630073 +00630048 +00430053 00430073 00630053 00630073 +00430048 00430068 00630068 +0187 0188 +0044 0064 00D0 00F0 010E 010F 0110 0111 +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0044017D 0044017D 0044017E 0044017E 0064005A 0064007A 0064017D 0064017E 0064017E 01C4 01C5 01C6 01F1 01F2 01F3 +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CA 00CB 00E8 00E9 00EA 00EB 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011C 011D 011E 011F 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0124 0125 0126 0127 +0195 01F6 +0049 0069 00CC 00CD 00CE 00CF 00EC 00ED 00EE 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB +0049004A 0049006A 0069004A 0069006A 0132 0133 +0131 +0197 +0196 +004A 006A 0134 0135 01F0 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 0141 0142 +004C004A 004C006A 006C004A 006C006A 01C7 01C8 01C9 +006C004C +006C004C0059 +004C0059 004C0079 006C0059 006C0079 +004C004C 004C006C 006C006C +004C004C0059 004C006C0079 006C006C0079 +019A +019B +004D 006D +004E 006E 0143 0144 0145 0146 0147 0148 01F8 01F9 +004E004A 004E006A 006E004A 006E006A 01CA 01CB 01CC +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +004E0059 004E0079 006E0059 006E0079 +00D1 00F1 +019D +019E +014A 014B +004F 006F 00D2 00D3 00D4 00D5 00D6 00D8 00F2 00F3 00F4 00F5 00F6 00F8 014C 014D 014E 014F 0150 0151 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 01FE 01FF 1ECC 1ECD 1ECE 1ECF 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 1EDA 1EDB 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +004F0045 004F0065 006F0045 006F0065 0152 0153 +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 0158 0159 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +01A6 +0053 0073 015A 015B 015C 015D 015E 015F 0160 0161 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +01A9 +01AA +0054 0074 0162 0163 0164 0165 021A 021B +01BE +005400540059 005400740079 007400540059 007400740079 +00540059 00540079 00740059 00740079 +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DA 00DB 00DC 00F9 00FA 00FB 00FC 0168 0169 016A 016B 016C 016D 016E 016F 0170 0171 0172 0173 01AF 01B0 01D3 01D4 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC 1EE4 1EE5 1EE6 1EE7 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +00550045 00550065 00750045 00750065 +019C +01B1 +0056 0076 +01B2 +0057 0077 0174 0175 +0058 0078 +0059 0079 00DD 00FD 00FF 0176 0177 0178 +01B3 01B4 +005A 007A 0179 017A 017B 017C 017D 017E +005A0053 005A0073 007A0053 007A0073 +018D +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +00DE 00FE +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_la_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C2 00C3 00C4 00C5 00E0 00E1 00E2 00E3 00E4 00E5 0100 0101 0102 0103 0104 0105 01CD 01CE 01DE 01DF 01E0 01E1 01FA 01FB 1EA0 1EA1 1EA2 1EA3 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00410041 00410061 00610041 00610061 +00410045 00410065 00610045 00610065 00C6 00E6 01E2 01E3 01FC 01FD +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0106 0107 0108 0109 010A 010B 010C 010D +004300430053 004300630073 006300430053 006300630073 +00430048 00430068 00630048 00630068 +00430053 00430073 00630053 00630073 +0187 0188 +0044 0064 00D0 00F0 010E 010F 0110 0111 +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0044017D 0044017D 0044017E 0044017E 0064005A 0064007A 0064017D 0064017E 0064017E 01C4 01C5 01C6 01F1 01F2 01F3 +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CA 00CB 00E8 00E9 00EA 00EB 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011C 011D 011E 011F 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0124 0125 0126 0127 +0195 01F6 +0049 0069 00CC 00CD 00CE 00CF 00EC 00ED 00EE 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB 004A 006A 0134 0135 01F0 +0049004A 0049006A 0069004A 0069006A +0132 0133 +0131 +0197 +0196 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 0141 0142 +004C004A 004C006A 006C004A 006C006A +01C7 01C8 01C9 +004C004C 004C006C 006C004C 006C006C +004C004C0059 004C006C0079 006C004C0059 006C006C0079 +004C0059 004C0079 006C0059 006C0079 +019A +019B +004D 006D +004E 006E 00D1 00F1 0143 0144 0145 0146 0147 0148 01F8 01F9 +004E004A 004E006A 006E004A 006E006A +01CA 01CB 01CC +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +004E0059 004E0079 006E0059 006E0079 +019D +019E +014A 014B +004F 006F 00D2 00D3 00D4 00D5 00D6 00D8 00F2 00F3 00F4 00F5 00F6 00F8 014C 014D 014E 014F 0150 0151 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 01FE 01FF 1ECC 1ECD 1ECE 1ECF 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 1EDA 1EDB 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +004F0045 004F0065 006F0045 006F0065 0152 0153 +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 0158 0159 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +01A6 +0053 0073 015A 015B 015C 015D 015E 015F 0160 0161 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +01A9 +01AA +0054 0074 0162 0163 0164 0165 021A 021B +01BE +005400540059 005400740079 007400540059 007400740079 +00540059 00540079 00740059 00740079 +0166 0167 +01AB +01AC 01AD +01AE +019C +01B1 +0055 0075 00D9 00DA 00DB 00DC 00F9 00FA 00FB 00FC 0168 0169 016A 016B 016C 016D 016E 016F 0170 0171 0172 0173 01AF 01B0 01D3 01D4 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC 1EE4 1EE5 1EE6 1EE7 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 0056 0076 +00550045 00550065 00750045 00750065 +01B2 +0057 0077 0174 0175 +0058 0078 +0059 0079 00DD 00FD 00FF 0176 0177 0178 +01B3 01B4 +005A 007A 0179 017A 017B 017C 017D 017E +005A0053 005A0073 007A0053 007A0073 +018D +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +00DE 00FE +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_eo_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C2 00C3 00C4 00C5 00E0 00E1 00E2 00E3 00E4 00E5 0100 0101 0102 0103 0104 0105 01CD 01CE 01DE 01DF 01E0 01E1 01FA 01FB 1EA0 1EA1 1EA2 1EA3 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00410041 00410061 00610041 00610061 +00410045 00410065 00610045 00610065 00C6 00E6 01E2 01E3 01FC 01FD +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0106 0107 010A 010B 010C 010D +004300430053 004300630073 006300430053 006300630073 +00430048 00430068 00630048 00630068 +00430053 00430073 00630053 00630073 +0108 0109 +0187 0188 +0044 0064 00D0 00F0 010E 010F 0110 0111 +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0044017D 0044017D 0044017E 0044017E 0064005A 0064007A 0064017D 0064017E 0064017E 01C4 01C5 01C6 01F1 01F2 01F3 +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CA 00CB 00E8 00E9 00EA 00EB 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011E 011F 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +011C 011D +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0126 0127 +0124 0125 +0195 01F6 +0049 0069 00CC 00CD 00CE 00CF 00EC 00ED 00EE 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB +0049004A 0049006A 0069004A 0069006A 0132 0133 +0131 +0197 +0196 +004A 006A 01F0 +0134 0135 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 0141 0142 +004C004A 004C006A 006C004A 006C006A 01C7 01C8 01C9 +004C004C 004C006C 006C004C 006C006C +004C004C0059 004C006C0079 006C004C0059 006C006C0079 +004C0059 004C0079 006C0059 006C0079 +019A +019B +004D 006D +004E 006E 00D1 00F1 0143 0144 0145 0146 0147 0148 01F8 01F9 +004E004A 004E006A 006E004A 006E006A 01CA 01CB 01CC +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +004E0059 004E0079 006E0059 006E0079 +019D +019E +014A 014B +004F 006F 00D2 00D3 00D4 00D5 00D6 00D8 00F2 00F3 00F4 00F5 00F6 00F8 014C 014D 014E 014F 0150 0151 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 01FE 01FF 1ECC 1ECD 1ECE 1ECF 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 1EDA 1EDB 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +004F0045 004F0065 006F0045 006F0065 0152 0153 +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 0158 0159 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +01A6 +0053 0073 015A 015B 015E 015F 0160 0161 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +015C 015D +01A9 +01AA +0054 0074 0162 0163 0164 0165 021A 021B +01BE +005400540059 005400740079 007400540059 007400740079 +00540059 00540079 00740059 00740079 +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DA 00DB 00DC 00F9 00FA 00FB 00FC 0168 0169 016A 016B 016E 016F 0170 0171 0172 0173 01AF 01B0 01D3 01D4 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC 1EE4 1EE5 1EE6 1EE7 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +00550045 00550065 00750045 00750065 +016C 016D +019C +01B1 +0056 0076 +01B2 +0057 0077 0174 0175 +0058 0078 +0059 0079 00DD 00FD 00FF 0176 0177 0178 +01B3 01B4 +005A 007A 0179 017A 017B 017C 017D 017E +005A0053 005A0073 007A0053 007A0073 +018D +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +00DE 00FE +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_hu_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C2 00C3 00C4 00C5 00E0 00E1 00E2 00E3 00E4 00E5 0100 0101 0102 0103 0104 0105 01CD 01CE 01DE 01DF 01E0 01E1 01FA 01FB 1EA0 1EA1 1EA2 1EA3 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00410041 00410061 00610041 00610061 +00410045 00410065 00610045 00610065 00C6 00E6 01E2 01E3 01FC 01FD +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0106 0107 0108 0109 010A 010B 010C 010D +006300430053 +00430048 00430068 00630048 00630068 +00630053 +00430053 00430073 00630073 +004300430053 004300630073 006300630073 +0187 0188 +0044 0064 00D0 00F0 010E 010F 0110 0111 +00640044005A +00640044005A0053 +0044017D 0044017D 0044017E 0044017E 0064005A 0064017D 0064017E 0064017E 01C4 01C5 01C6 01F1 01F2 01F3 +0064005A0053 0064005A0073 +0044005A 0044007A 0064007A +00440044005A 00440064007A 00640064007A +0044005A0073 0044007A0053 0064007A0053 +0044005A0053 0044007A0073 0064007A0073 +00440044005A0053 00440064007A0073 00640064007A0073 +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CA 00CB 00E8 00E9 00EA 00EB 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011C 011D 011E 011F 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +006700470059 +00670059 +00470059 00470079 00670079 +004700470059 004700670079 006700670079 +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0124 0125 0126 0127 +0195 01F6 +0049 0069 00CC 00CD 00CE 00CF 00EC 00ED 00EE 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB +0049004A 0049006A 0069004A 0069006A 0132 0133 +0131 +0197 +0196 +004A 006A 0134 0135 01F0 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 0141 0142 +004C004A 004C006A 006C004A 006C006A 01C7 01C8 01C9 +004C004C 004C006C 006C004C 006C006C +006C004C0059 +006C0059 +004C0059 004C0079 006C0079 +004C004C0059 004C006C0079 006C006C0079 +019A +019B +004D 006D +004E 006E 00D1 00F1 0143 0144 0145 0146 0147 0148 01F8 01F9 +004E004A 004E006A 006E004A 006E006A 01CA 01CB 01CC +006E004E0059 +006E0059 +004E0059 004E0079 006E0079 +004E004E0059 004E006E0079 006E006E0079 +019D +019E +014A 014B +004F 006F 00D2 00D3 00D4 00D5 00D8 00F2 00F3 00F4 00F5 00F8 014C 014D 014E 014F 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 01FE 01FF 1ECC 1ECD 1ECE 1ECF 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 1EDA 1EDB 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +004F0045 004F0065 006F0045 006F0065 0152 0153 +00D6 00F6 0150 0151 +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 0158 0159 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +01A6 +0053 0073 015A 015B 015C 015D 015E 015F 0160 0161 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00730053005A +0073005A +0053005A 0053007A 0073007A +00530053005A 00530073007A 00730073007A +01A9 +01AA +0054 0074 0162 0163 0164 0165 021A 021B +01BE +007400540059 +00740059 +00540059 00540079 00740079 +005400540059 005400740079 007400740079 +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DA 00DB 00F9 00FA 00FB 0168 0169 016A 016B 016C 016D 016E 016F 0172 0173 01AF 01B0 01D3 01D4 1EE4 1EE5 1EE6 1EE7 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +00550045 00550065 00750045 00750065 +00DC 00FC 0170 0171 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC +019C +01B1 +0056 0076 +01B2 +0057 0077 0174 0175 +0058 0078 +0059 0079 00DD 00FD 00FF 0176 0177 0178 +01B3 01B4 +005A 007A 0179 017A 017B 017C 017D 017E +007A0053 +018D +007A005A0053 +005A0053 005A0073 007A0073 +005A005A0053 005A007A0073 007A007A0073 +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +00DE 00FE +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_hr_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C2 00C3 00C4 00C5 00E0 00E1 00E2 00E3 00E4 00E5 0100 0101 0102 0103 0104 0105 01CD 01CE 01DE 01DF 01E0 01E1 01FA 01FB 1EA0 1EA1 1EA2 1EA3 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00410041 00410061 00610041 00610061 +00410045 00410065 00610045 00610065 00C6 00E6 01E2 01E3 01FC 01FD +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0108 0109 010A 010B +004300430053 004300630073 006300430053 006300630073 +00430048 00430068 00630048 00630068 +00430053 00430073 00630053 00630073 +010C 010D +0106 0107 +0187 0188 +0044 0064 00D0 00F0 010E 010F +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0064005A 0064007A 01F1 01F2 01F3 +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +0064017D +0044017D 0044017D 0044017E 0044017E 0064017E 0064017E 01C4 01C5 01C6 +0110 0111 +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CA 00CB 00E8 00E9 00EA 00EB 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011C 011D 011E 011F 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0124 0125 0126 0127 +0195 01F6 +0049 0069 00CC 00CD 00CE 00CF 00EC 00ED 00EE 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB +0049004A 0049006A 0069004A 0069006A 0132 0133 +0131 +0197 +0196 +004A 006A 0134 0135 01F0 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 0141 0142 +006C004A +004C004C 004C006C 006C004C 006C006C +004C004C0059 004C006C0079 006C004C0059 006C006C0079 +004C0059 004C0079 006C0059 006C0079 +004C004A 004C006A 006C006A 01C7 01C8 01C9 +019A +019B +004D 006D +004E 006E 00D1 00F1 0143 0144 0145 0146 0147 0148 01F8 01F9 +006E004A +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +004E0059 004E0079 006E0059 006E0079 +004E004A 004E006A 006E006A 01CA 01CB 01CC +019D +019E +014A 014B +004F 006F 00D2 00D3 00D4 00D5 00D6 00D8 00F2 00F3 00F4 00F5 00F6 00F8 014C 014D 014E 014F 0150 0151 01A0 01A1 01D1 01D2 01EA 01EB 01EC 01ED 01FE 01FF 1ECC 1ECD 1ECE 1ECF 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 1EDA 1EDB 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +004F0045 004F0065 006F0045 006F0065 0152 0153 +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 0158 0159 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +01A6 +0053 0073 015A 015B 015C 015D 015E 015F 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +0160 0161 +01A9 +01AA +0054 0074 0162 0163 0164 0165 021A 021B +01BE +005400540059 005400740079 007400540059 007400740079 +00540059 00540079 00740059 00740079 +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DA 00DB 00DC 00F9 00FA 00FB 00FC 0168 0169 016A 016B 016C 016D 016E 016F 0170 0171 0172 0173 01AF 01B0 01D3 01D4 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC 1EE4 1EE5 1EE6 1EE7 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +00550045 00550065 00750045 00750065 +019C +01B1 +0056 0076 +01B2 +0057 0077 0174 0175 +0058 0078 +0059 0079 00DD 00FD 00FF 0176 0177 0178 +01B3 01B4 +005A 007A 0179 017A 017B 017C +005A0053 005A0073 007A0053 007A0073 +018D +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +017D 017E +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +00DE 00FE +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +SELECT GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') FROM t1 GROUP BY c1 COLLATE utf8mb4_vi_0900_ai_ci; +GROUP_CONCAT(HEX(CONVERT(c1 USING utf16)) ORDER BY c1, HEX(c1) SEPARATOR ' ') +00F7 +00D7 +0041 0061 00C0 00C1 00C3 00C4 00C5 00E0 00E1 00E3 00E4 00E5 0100 0101 0104 0105 01CD 01CE 01DE 01DF 01E0 01E1 01FA 01FB 1EA0 1EA1 1EA2 1EA3 +00410041 00410061 00610041 00610061 +00410045 00410065 00610045 00610065 00C6 00E6 01E2 01E3 01FC 01FD +0102 0103 1EAE 1EAF 1EB0 1EB1 1EB2 1EB3 1EB4 1EB5 1EB6 1EB7 +00C2 00E2 1EA4 1EA5 1EA6 1EA7 1EA8 1EA9 1EAA 1EAB 1EAC 1EAD +0042 0062 +0180 +0181 +0182 0183 +0043 0063 00C7 00E7 0106 0107 0108 0109 010A 010B 010C 010D +004300430053 004300630073 006300430053 006300630073 +00430048 00430068 00630048 00630068 +00430053 00430073 00630053 00630073 +0187 0188 +0044 0064 00D0 00F0 010E 010F +00440044005A 00440064007A 00640044005A 00640064007A +00440044005A0053 00440064007A0073 00640044005A0053 00640064007A0073 +0044005A 0044007A 0044017D 0044017D 0044017E 0044017E 0064005A 0064007A 0064017D 0064017E 0064017E 01C4 01C5 01C6 01F1 01F2 01F3 +0044005A0053 0044005A0073 0044007A0053 0044007A0073 0064005A0053 0064005A0073 0064007A0053 0064007A0073 +0110 0111 +0189 +018A +018B 018C +0045 0065 00C8 00C9 00CB 00E8 00E9 00EB 0112 0113 0114 0115 0116 0117 0118 0119 011A 011B 1EB8 1EB9 1EBA 1EBB 1EBC 1EBD +00CA 00EA 1EBE 1EBF 1EC0 1EC1 1EC2 1EC3 1EC4 1EC5 1EC6 1EC7 +018E 01DD +018F +0190 +0046 0066 +0191 0192 +0047 0067 011C 011D 011E 011F 0120 0121 0122 0123 01E6 01E7 01F4 01F5 +004700470059 004700670079 006700470059 006700670079 +00470059 00470079 00670059 00670079 +01E4 01E5 +0193 +0194 +01A2 01A3 +0048 0068 0124 0125 0126 0127 +0195 01F6 +0049 0069 00CC 00CD 00CE 00CF 00EC 00ED 00EE 00EF 0128 0129 012A 012B 012C 012D 012E 012F 0130 01CF 01D0 1EC8 1EC9 1ECA 1ECB +0049004A 0049006A 0069004A 0069006A 0132 0133 +0131 +0197 +0196 +004A 006A 0134 0135 01F0 +004B 006B 0136 0137 01E8 01E9 +0198 0199 +004C 006C 0139 013A 013B 013C 013D 013E 013F 0140 0141 0142 +004C004A 004C006A 006C004A 006C006A 01C7 01C8 01C9 +004C004C 004C006C 006C004C 006C006C +004C004C0059 004C006C0079 006C004C0059 006C006C0079 +004C0059 004C0079 006C0059 006C0079 +019A +019B +004D 006D +004E 006E 00D1 00F1 0143 0144 0145 0146 0147 0148 01F8 01F9 +004E004A 004E006A 006E004A 006E006A 01CA 01CB 01CC +004E004E0059 004E006E0079 006E004E0059 006E006E0079 +004E0059 004E0079 006E0059 006E0079 +019D +019E +014A 014B +004F 006F 00D2 00D3 00D5 00D6 00D8 00F2 00F3 00F5 00F6 00F8 014C 014D 014E 014F 0150 0151 01D1 01D2 01EA 01EB 01EC 01ED 01FE 01FF 1ECC 1ECD 1ECE 1ECF +004F0045 004F0065 006F0045 006F0065 0152 0153 +00D4 00F4 1ED0 1ED1 1ED2 1ED3 1ED4 1ED5 1ED6 1ED7 1ED8 1ED9 +01A0 01A1 1EDA 1EDB 1EDC 1EDD 1EDE 1EDF 1EE0 1EE1 1EE2 1EE3 +0186 +019F +0050 0070 +01A4 01A5 +0051 0071 +0138 +0052 0072 0154 0155 0156 0157 0158 0159 +00520052 00520052 00520072 00520072 00720052 00720052 00720072 00720072 +01A6 +0053 0073 015A 015B 015C 015D 015E 015F 0160 0161 017F 0218 0219 +00530053 00530073 00730053 00730073 00DF +00530053005A 00530073007A 00730053005A 00730073007A +0053005A 0053007A 0073005A 0073007A +01A9 +01AA +0054 0074 0162 0163 0164 0165 021A 021B +01BE +005400540059 005400740079 007400540059 007400740079 +00540059 00540079 00740059 00740079 +0166 0167 +01AB +01AC 01AD +01AE +0055 0075 00D9 00DA 00DB 00DC 00F9 00FA 00FB 00FC 0168 0169 016A 016B 016C 016D 016E 016F 0170 0171 0172 0173 01D3 01D4 01D5 01D6 01D7 01D8 01D9 01DA 01DB 01DC 1EE4 1EE5 1EE6 1EE7 +00550045 00550065 00750045 00750065 +01AF 01B0 1EE8 1EE9 1EEA 1EEB 1EEC 1EED 1EEE 1EEF 1EF0 1EF1 +019C +01B1 +0056 0076 +01B2 +0057 0077 0174 0175 +0058 0078 +0059 0079 00DD 00FD 00FF 0176 0177 0178 +01B3 01B4 +005A 007A 0179 017A 017B 017C 017D 017E +005A0053 005A0073 007A0053 007A0073 +018D +005A005A0053 005A007A0073 007A005A0053 007A007A0073 +01B5 01B6 +01B7 01EE 01EF +01B8 01B9 +01BA +00DE 00FE +01BF 01F7 +01BB +01A7 01A8 +01BC 01BD +0184 0185 +0149 +01C0 +01C1 +01C2 +01C3 +0D96 +0DA4 +0DA5 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(1)) COLLATE utf8mb4_da_0900_ai_ci; +INSERT INTO t1 VALUES('a'), ('b'), ('c'), ('d'), ('e'); +SELECT HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 ORDER BY a; +HEX(a) HEX(WEIGHT_STRING(a)) +61 1C47 +62 1C60 +63 1C7A +64 1C8F +65 1CAA +TRUNCATE TABLE t1; +INSERT INTO t1 VALUES(_utf16 0x00C4), (_utf16 0x00C5), (_utf16 0x00C6), (_utf16 0x00D8), (_utf16 0x00D6); +SELECT HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 ORDER BY a, BINARY a; +HEX(a) HEX(WEIGHT_STRING(a)) +C384 1F9854A5 +C386 1F9854A5 +C396 1F9854A6 +C398 1F9854A6 +C385 1F9854A7 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10)) COLLATE utf8mb4_da_0900_ai_ci; +INSERT INTO t1 VALUES(_utf16 0x015A, _utf16 0x00DF), (_utf16 0x0162, _utf16 0x00DE), (_utf16 0x01CF, _utf16 0x0132), (_utf16 0x01F8, _utf16 0x01CA), (_utf16 0x42, _utf16 0x1d2d); +SELECT HEX(CONVERT(a USING UTF16)) AS U16_a, HEX(CONVERT(b USING UTF16)) AS U16_b, a 3E +| 7C +~ 7E +$ 24 +0 30 +1 31 +2 32 +3 33 +4 34 +5 35 +6 36 +7 37 +8 38 +9 39 +Aa 41,61 +Bb 42,62 +Cc 43,63 +Dd 44,64 +Ee 45,65 +Ff 46,66 +Gg 47,67 +Hh 48,68 +Ii 49,69 +Jj 4A,6A +Kk 4B,6B +Ll 4C,6C +Mm 4D,6D +Nn 4E,6E +Oo 4F,6F +Pp 50,70 +Qq 51,71 +Rr 52,72 +Ss 53,73 +Tt 54,74 +Uu 55,75 +Vv 56,76 +Ww 57,77 +Xx 58,78 +Yy 59,79 +Zz 5A,7A +drop table t1; +SELECT HEX(WEIGHT_STRING('aA')); +HEX(WEIGHT_STRING('aA')) +1C471C47000000200020 +SELECT HEX(WEIGHT_STRING(CAST(_utf32 x'337F' AS CHAR))); +HEX(WEIGHT_STRING(CAST(_utf32 x'337F' AS CHAR))) +FB40E82AFB40DF0FFB40CF1AFB40F93E00000020002000200020 +SELECT HEX(WEIGHT_STRING(CAST(_utf32 x'FDFA' AS CHAR))); +HEX(WEIGHT_STRING(CAST(_utf32 x'FDFA' AS CHAR))) +2364239C23C50209230B239C239C23B1000000200020002000200020002000200020 +select @@collation_connection; +@@collation_connection +utf8mb4_0900_as_ci +select hex(weight_string('a')); +hex(weight_string('a')) +1C4700000020 +select hex(weight_string('A')); +hex(weight_string('A')) +1C4700000020 +select hex(weight_string('abc')); +hex(weight_string('abc')) +1C471C601C7A0000002000200020 +select hex(weight_string('abc' as char(2))); +hex(weight_string('abc' as char(2))) +1C471C60000000200020 +select hex(weight_string('abc' as char(3))); +hex(weight_string('abc' as char(3))) +1C471C601C7A0000002000200020 +select hex(weight_string('abc' as char(5))); +hex(weight_string('abc' as char(5))) +1C471C601C7A0000002000200020 +select hex(weight_string('abc', 1, 2, 0xC0)); +hex(weight_string('abc', 1, 2, 0xC0)) +1C +select hex(weight_string('abc', 2, 2, 0xC0)); +hex(weight_string('abc', 2, 2, 0xC0)) +1C47 +select hex(weight_string('abc', 3, 2, 0xC0)); +hex(weight_string('abc', 3, 2, 0xC0)) +1C471C +select hex(weight_string('abc', 4, 2, 0xC0)); +hex(weight_string('abc', 4, 2, 0xC0)) +1C471C60 +select hex(weight_string('abc', 5, 2, 0xC0)); +hex(weight_string('abc', 5, 2, 0xC0)) +1C471C6000 +select hex(weight_string('abc',25, 2, 0xC0)); +hex(weight_string('abc',25, 2, 0xC0)) +1C471C60000000200020000000000000000000000000000000 +select hex(weight_string('abc', 1, 3, 0xC0)); +hex(weight_string('abc', 1, 3, 0xC0)) +1C +select hex(weight_string('abc', 2, 3, 0xC0)); +hex(weight_string('abc', 2, 3, 0xC0)) +1C47 +select hex(weight_string('abc', 3, 3, 0xC0)); +hex(weight_string('abc', 3, 3, 0xC0)) +1C471C +select hex(weight_string('abc', 4, 3, 0xC0)); +hex(weight_string('abc', 4, 3, 0xC0)) +1C471C60 +select hex(weight_string('abc', 5, 3, 0xC0)); +hex(weight_string('abc', 5, 3, 0xC0)) +1C471C601C +select hex(weight_string('abc',25, 3, 0xC0)); +hex(weight_string('abc',25, 3, 0xC0)) +1C471C601C7A00000020002000200000000000000000000000 +select hex(weight_string('abc', 1, 4, 0xC0)); +hex(weight_string('abc', 1, 4, 0xC0)) +1C +select hex(weight_string('abc', 2, 4, 0xC0)); +hex(weight_string('abc', 2, 4, 0xC0)) +1C47 +select hex(weight_string('abc', 3, 4, 0xC0)); +hex(weight_string('abc', 3, 4, 0xC0)) +1C471C +select hex(weight_string('abc', 4, 4, 0xC0)); +hex(weight_string('abc', 4, 4, 0xC0)) +1C471C60 +select hex(weight_string('abc', 5, 4, 0xC0)); +hex(weight_string('abc', 5, 4, 0xC0)) +1C471C601C +select hex(weight_string('abc',25, 4, 0xC0)); +hex(weight_string('abc',25, 4, 0xC0)) +1C471C601C7A00000020002000200000000000000000000000 +select @@collation_connection; +@@collation_connection +utf8mb4_0900_as_ci +select hex(weight_string(cast(_latin1 0x80 as char))); +hex(weight_string(cast(_latin1 0x80 as char))) +1C2A00000020 +select hex(weight_string(cast(_latin1 0x808080 as char))); +hex(weight_string(cast(_latin1 0x808080 as char))) +1C2A1C2A1C2A0000002000200020 +select hex(weight_string(cast(_latin1 0x808080 as char) as char(2))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(2))) +1C2A1C2A000000200020 +select hex(weight_string(cast(_latin1 0x808080 as char) as char(3))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(3))) +1C2A1C2A1C2A0000002000200020 +select hex(weight_string(cast(_latin1 0x808080 as char) as char(5))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(5))) +1C2A1C2A1C2A0000002000200020 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)) +1C +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)) +1C2A +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)) +1C2A1C +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)) +1C2A1C2A +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)) +1C2A1C2A00 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)) +1C2A1C2A000000200020000000000000000000000000000000 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)) +1C +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)) +1C2A +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)) +1C2A1C +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)) +1C2A1C2A +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)) +1C2A1C2A1C +select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)) +1C2A1C2A1C2A00000020002000200000000000000000000000 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)) +1C +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)) +1C2A +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)) +1C2A1C +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)) +1C2A1C2A +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)) +1C2A1C2A1C +select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)) +1C2A1C2A1C2A00000020002000200000000000000000000000 +CREATE TABLE t1 AS SELECT repeat('a', 10) as c LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +INSERT INTO t1 VALUES (_utf32 0x0180),(_utf32 0x023A); +INSERT INTO t1 VALUES (_utf32 0x023B),(_utf32 0x023C); +INSERT INTO t1 VALUES (_utf32 0x023D),(_utf32 0x023E); +INSERT INTO t1 VALUES (_utf32 0x0241),(_utf32 0x0242); +INSERT INTO t1 VALUES (_utf32 0x0243),(_utf32 0x0244); +INSERT INTO t1 VALUES (_utf32 0x0245),(_utf32 0x0246); +INSERT INTO t1 VALUES (_utf32 0x0247),(_utf32 0x0248); +INSERT INTO t1 VALUES (_utf32 0x0249),(_utf32 0x024A); +INSERT INTO t1 VALUES (_utf32 0x024B),(_utf32 0x024C); +INSERT INTO t1 VALUES (_utf32 0x024D),(_utf32 0x024E); +INSERT INTO t1 VALUES (_utf32 0x024F),(_utf32 0x026B); +INSERT INTO t1 VALUES (_utf32 0x027D),(_utf32 0x0289); +INSERT INTO t1 VALUES (_utf32 0x028C); +INSERT INTO t1 VALUES (_utf32 0x037B), (_utf32 0x037C); +INSERT INTO t1 VALUES (_utf32 0x037D), (_utf32 0x03FD); +INSERT INTO t1 VALUES (_utf32 0x03FE), (_utf32 0x03FF); +INSERT INTO t1 VALUES (_utf32 0x04C0), (_utf32 0x04CF); +INSERT INTO t1 VALUES (_utf32 0x04F6), (_utf32 0x04F7); +INSERT INTO t1 VALUES (_utf32 0x04FA), (_utf32 0x04FB); +INSERT INTO t1 VALUES (_utf32 0x04FC), (_utf32 0x04FD); +INSERT INTO t1 VALUES (_utf32 0x04FE), (_utf32 0x04FF); +INSERT INTO t1 VALUES (_utf32 0x0510), (_utf32 0x0511); +INSERT INTO t1 VALUES (_utf32 0x0512), (_utf32 0x0513); +INSERT INTO t1 VALUES (_utf32 0x10A0), (_utf32 0x10A1); +INSERT INTO t1 VALUES (_utf32 0x10A2), (_utf32 0x10A3); +INSERT INTO t1 VALUES (_utf32 0x10A4), (_utf32 0x10A5); +INSERT INTO t1 VALUES (_utf32 0x10A6), (_utf32 0x10A7); +INSERT INTO t1 VALUES (_utf32 0x2D00), (_utf32 0x2D01); +INSERT INTO t1 VALUES (_utf32 0x2D02), (_utf32 0x2D03); +INSERT INTO t1 VALUES (_utf32 0x2D04), (_utf32 0x2D05); +INSERT INTO t1 VALUES (_utf32 0x2D06), (_utf32 0x2D07); +INSERT INTO t1 VALUES (_utf32 0x1D7D); +INSERT INTO t1 VALUES (_utf32 0x2132),(_utf32 0x214E); +INSERT INTO t1 VALUES (_utf32 0x2183),(_utf32 0x2184); +INSERT INTO t1 VALUES (_utf32 0x2C80), (_utf32 0x2C81); +INSERT INTO t1 VALUES (_utf32 0x2C82), (_utf32 0x2C83); +INSERT INTO t1 VALUES (_utf32 0x2C84), (_utf32 0x2C85); +INSERT INTO t1 VALUES (_utf32 0x2C86), (_utf32 0x2C87); +INSERT INTO t1 VALUES (_utf32 0x2C88), (_utf32 0x2C89); +INSERT INTO t1 VALUES (_utf32 0x2C8A), (_utf32 0x2C8B); +INSERT INTO t1 VALUES (_utf32 0x2C8C), (_utf32 0x2C8D); +INSERT INTO t1 VALUES (_utf32 0x2C8E), (_utf32 0x2C8F); +INSERT INTO t1 VALUES (_utf32 0x2C60), (_utf32 0x2C61); +INSERT INTO t1 VALUES (_utf32 0x2C62), (_utf32 0x2C63); +INSERT INTO t1 VALUES (_utf32 0x2C64), (_utf32 0x2C65); +INSERT INTO t1 VALUES (_utf32 0x2C66), (_utf32 0x2C67); +INSERT INTO t1 VALUES (_utf32 0x2C68), (_utf32 0x2C69); +INSERT INTO t1 VALUES (_utf32 0x2C6A), (_utf32 0x2C6B); +INSERT INTO t1 VALUES (_utf32 0x2C6C), (_utf32 0x2C75); +INSERT INTO t1 VALUES (_utf32 0x2C76); +INSERT INTO t1 VALUES (_utf32 0x2C00), (_utf32 0x2C01); +INSERT INTO t1 VALUES (_utf32 0x2C02), (_utf32 0x2C03); +INSERT INTO t1 VALUES (_utf32 0x2C04), (_utf32 0x2C05); +INSERT INTO t1 VALUES (_utf32 0x2C06), (_utf32 0x2C07); +INSERT INTO t1 VALUES (_utf32 0x2C30), (_utf32 0x2C31); +INSERT INTO t1 VALUES (_utf32 0x2C32), (_utf32 0x2C33); +INSERT INTO t1 VALUES (_utf32 0x2C34), (_utf32 0x2C35); +INSERT INTO t1 VALUES (_utf32 0x2C36), (_utf32 0x2C37); +INSERT INTO t1 VALUES (_utf32 0x10400), (_utf32 0x10401); +INSERT INTO t1 VALUES (_utf32 0x10402), (_utf32 0x10403); +INSERT INTO t1 VALUES (_utf32 0x10404), (_utf32 0x10405); +INSERT INTO t1 VALUES (_utf32 0x10406), (_utf32 0x10407); +INSERT INTO t1 VALUES (_utf32 0x10428), (_utf32 0x10429); +INSERT INTO t1 VALUES (_utf32 0x1042A), (_utf32 0x1042B); +INSERT INTO t1 VALUES (_utf32 0x1042C), (_utf32 0x1042D); +INSERT INTO t1 VALUES (_utf32 0x1042E), (_utf32 0x1042F); +INSERT INTO t1 VALUES (_utf32 0x0370); +INSERT INTO t1 VALUES (_utf32 0x0371); +INSERT INTO t1 VALUES (_utf32 0x0372); +INSERT INTO t1 VALUES (_utf32 0x0373); +INSERT INTO t1 VALUES (_utf32 0x0514); +INSERT INTO t1 VALUES (_utf32 0x0515); +INSERT INTO t1 VALUES (_utf32 0x0516); +INSERT INTO t1 VALUES (_utf32 0x0517); +INSERT INTO t1 VALUES (_utf32 0xA640); +INSERT INTO t1 VALUES (_utf32 0xA641); +INSERT INTO t1 VALUES (_utf32 0xA642); +INSERT INTO t1 VALUES (_utf32 0xA643); +INSERT INTO t1 VALUES (_utf32 0xA722); +INSERT INTO t1 VALUES (_utf32 0xA723); +INSERT INTO t1 VALUES (_utf32 0xA724); +INSERT INTO t1 VALUES (_utf32 0xA725); +INSERT INTO t1 VALUES (_utf32 0xA726); +INSERT INTO t1 VALUES (_utf32 0xA727); +INSERT INTO t1 VALUES (_utf32 0xA728); +INSERT INTO t1 VALUES (_utf32 0xA729); +INSERT INTO t1 VALUES (_utf32 0xA72A); +INSERT INTO t1 VALUES (_utf32 0xA72B); +INSERT INTO t1 VALUES (_utf32 0x2CEB); +INSERT INTO t1 VALUES (_utf32 0x2CEC); +INSERT INTO t1 VALUES (_utf32 0x2CED); +INSERT INTO t1 VALUES (_utf32 0x2CEE); +INSERT INTO t1 VALUES (_utf32 0x1FA01); +INSERT INTO t1 VALUES (_utf32 0x1FB01); +INSERT INTO t1 VALUES (_utf32 0x1FC01); +INSERT INTO t1 VALUES (_utf32 0x1FD01); +INSERT INTO t1 VALUES (_utf32 0x1F603); +INSERT INTO t1 VALUES (_utf32 0x1F604); +INSERT INTO t1 VALUES (_utf32 0x1F648); +INSERT INTO t1 VALUES (_utf32 0x1F64F); +INSERT INTO t1 VALUES (_utf32 0x2B759); +INSERT INTO t1 VALUES (_utf32 0x2B760); +INSERT INTO t1 VALUES (_utf32 0x2B761); +INSERT INTO t1 VALUES (_utf32 0x2B762); +INSERT INTO t1 VALUES (_utf32 0x16F00); +INSERT INTO t1 VALUES (_utf32 0x16F01); +INSERT INTO t1 VALUES (_utf32 0x08A2); +INSERT INTO t1 VALUES (_utf32 0x08A3); +INSERT INTO t1 VALUES (_utf32 0xA794); +INSERT INTO t1 VALUES (_utf32 0xA795); +INSERT INTO t1 VALUES (_utf32 0xA796); +INSERT INTO t1 VALUES (_utf32 0xA797); +INSERT INTO t1 VALUES (_utf32 0xAB37); +INSERT INTO t1 VALUES (_utf32 0xAB38); +INSERT INTO t1 VALUES (_utf32 0x10600); +INSERT INTO t1 VALUES (_utf32 0x10601); +INSERT INTO t1 VALUES (_utf32 0x10602); +INSERT INTO t1 VALUES (_utf32 0x10603); +INSERT INTO t1 VALUES (_utf32 0x1F800); +INSERT INTO t1 VALUES (_utf32 0x1F801); +INSERT INTO t1 VALUES (_utf32 0x1F802); +INSERT INTO t1 VALUES (_utf32 0x1F803); +INSERT INTO t1 VALUES (_utf32 0x10C92); +INSERT INTO t1 VALUES (_utf32 0x10C93); +INSERT INTO t1 VALUES (_utf32 0x10C94); +INSERT INTO t1 VALUES (_utf32 0x10C95); +INSERT INTO t1 VALUES (_utf32 0x2B836); +INSERT INTO t1 VALUES (_utf32 0x2B837); +INSERT INTO t1 VALUES (_utf32 0x2B838); +INSERT INTO t1 VALUES (_utf32 0x2B839); +SELECT hex(c), hex(lower(c)), hex(upper(c)), hex(weight_string(c)), c +FROM t1 ORDER BY c, BINARY c; +hex(c) hex(lower(c)) hex(upper(c)) hex(weight_string(c)) c +F09F9883 F09F9883 F09F9883 15FE00000020 😃 +F09F9884 F09F9884 F09F9884 15FF00000020 😄 +F09F9988 F09F9988 F09F9988 164300000020 🙈 +F09F998F F09F998F F09F998F 164A00000020 🙏 +F09FA080 F09FA080 F09FA080 17AB00000020 🠀 +F09FA081 F09FA081 F09FA081 17AC00000020 🠁 +F09FA082 F09FA082 F09FA082 17AD00000020 🠂 +F09FA083 F09FA083 F09FA083 17AE00000020 🠃 +C8BA C8BA 1C4C00000020 Ⱥ +E2B1A5 E2B1A5 C8BA 1C4C00000020 ⱥ +C680 C680 C983 1C6800000020 ƀ +C983 C680 C983 1C6800000020 Ƀ +EA9E96 EA9E97 EA9E96 1C6F00000020 Ꞗ +EA9E97 EA9E97 EA9E96 1C6F00000020 ꞗ +C8BB C8BC C8BB 1C7F00000020 Ȼ +C8BC C8BC C8BB 1C7F00000020 ȼ +EA9E94 EA9E94 EA9E94 1C8400000020 ꞔ +E28683 E28684 E28683 1C8D00000020 Ↄ +E28684 E28684 E28683 1C8D00000020 ↄ +C986 C987 C986 1CB100000020 Ɇ +C987 C987 C986 1CB100000020 ɇ +E284B2 E2858E E284B2 1CF200000020 Ⅎ +E2858E E2858E E284B2 1CF200000020 ⅎ +EA9E95 EA9E95 EA9E95 1D2400000020 ꞕ +E2B1A7 E2B1A8 E2B1A7 1D2900000020 Ⱨ +E2B1A8 E2B1A8 E2B1A7 1D2900000020 ⱨ +E2B1B5 E2B1B6 E2B1B5 1D2A00000020 Ⱶ +E2B1B6 E2B1B6 E2B1B5 1D2A00000020 ⱶ +EA9CA6 EA9CA7 EA9CA6 1D2B00000020 Ꜧ +EA9CA7 EA9CA7 EA9CA6 1D2B00000020 ꜧ +C988 C989 C988 1D5500000020 Ɉ +C989 C989 C988 1D5500000020 ɉ +E2B1A9 E2B1AA E2B1A9 1D6F00000020 Ⱪ +E2B1AA E2B1AA E2B1A9 1D6F00000020 ⱪ +C8BD C69A C8BD 1D8200000020 Ƚ +E2B1A0 E2B1A1 E2B1A0 1D8600000020 Ⱡ +E2B1A1 E2B1A1 E2B1A0 1D8600000020 ⱡ +C9AB C9AB 1D8700000020 ɫ +E2B1A2 C9AB E2B1A2 1D8700000020 Ɫ +EAACB8 EAACB8 EAACB8 1D8B00000020 ꬸ +EAACB7 EAACB7 EAACB7 1D9100000020 ꬷ +E1B5BD E1B5BD E2B1A3 1E1100000020 ᵽ +E2B1A3 E1B5BD E2B1A3 1E1100000020 Ᵽ +C98A C98B C98A 1E2B00000020 Ɋ +C98B C98B C98A 1E2B00000020 ɋ +C98C C98D C98C 1E3F00000020 Ɍ +C98D C98D C98C 1E3F00000020 ɍ +C9BD C9BD 1E5700000020 ɽ +E2B1A4 C9BD E2B1A4 1E5700000020 Ɽ +EA9CA8 EA9CA9 EA9CA8 1E951F21000000200020 Ꜩ +EA9CA9 EA9CA9 EA9CA8 1E951F21000000200020 ꜩ +C8BE C8BE 1E9E00000020 Ⱦ +E2B1A6 E2B1A6 C8BE 1E9E00000020 ⱦ +C984 CA89 C984 1EC000000020 Ʉ +CA89 CA89 C984 1EC000000020 ʉ +C985 CA8C C985 1EF100000020 Ʌ +CA8C CA8C C985 1EF100000020 ʌ +C98E C98F C98E 1F1300000020 Ɏ +C98F C98F C98E 1F1300000020 ɏ +E2B1AB E2B1AC E2B1AB 1F3C00000020 Ⱬ +E2B1AC E2B1AC E2B1AB 1F3C00000020 ⱬ +EA9CAA EA9CAB EA9CAA 1F6600000020 Ꜫ +EA9CAB EA9CAB EA9CAA 1F6600000020 ꜫ +C981 C982 C981 1F7900000020 Ɂ +C982 C982 C981 1F7900000020 ɂ +EA9CA2 EA9CA3 EA9CA2 1F8100000020 Ꜣ +EA9CA3 EA9CA3 EA9CA2 1F8100000020 ꜣ +EA9CA4 EA9CA5 EA9CA4 1F8C00000020 Ꜥ +EA9CA5 EA9CA5 EA9CA4 1F8C00000020 ꜥ +CDB0 CDB1 CDB0 1FC300000020 Ͱ +CDB1 CDB1 CDB0 1FC300000020 ͱ +CDBC CDBC CFBE 1FD800000020 ͼ +CFBE CDBC CFBE 1FD800000020 Ͼ +CDBB CDBB CFBD 1FD900000020 ͻ +CFBD CDBB CFBD 1FD900000020 Ͻ +CDBD CDBD CFBF 1FDA00000020 ͽ +CFBF CDBD CFBF 1FDA00000020 Ͽ +CDB2 CDB3 CDB2 1FE400000020 Ͳ +CDB3 CDB3 CDB2 1FE400000020 ͳ +E2B280 E2B281 E2B280 1FE600000020 Ⲁ +E2B281 E2B281 E2B280 1FE600000020 ⲁ +E2B282 E2B283 E2B282 1FE700000020 Ⲃ +E2B283 E2B283 E2B282 1FE700000020 ⲃ +E2B284 E2B285 E2B284 1FE800000020 Ⲅ +E2B285 E2B285 E2B284 1FE800000020 ⲅ +E2B286 E2B287 E2B286 1FE900000020 Ⲇ +E2B287 E2B287 E2B286 1FE900000020 ⲇ +E2B288 E2B289 E2B288 1FEA00000020 Ⲉ +E2B289 E2B289 E2B288 1FEA00000020 ⲉ +E2B28A E2B28B E2B28A 1FEC00000020 Ⲋ +E2B28B E2B28B E2B28A 1FEC00000020 ⲋ +E2B28C E2B28D E2B28C 1FED00000020 Ⲍ +E2B28D E2B28D E2B28C 1FED00000020 ⲍ +E2B28E E2B28F E2B28E 1FEE00000020 Ⲏ +E2B28F E2B28F E2B28E 1FEE00000020 ⲏ +E2B3AB E2B3AC E2B3AB 200600000020 Ⳬ +E2B3AC E2B3AC E2B3AB 200600000020 ⳬ +E2B3AD E2B3AE E2B3AD 201600000020 Ⳮ +E2B3AE E2B3AE E2B3AD 201600000020 ⳮ +D3BA D3BB D3BA 203E00000020 Ӻ +D3BB D3BB D3BA 203E00000020 ӻ +D3B6 D3B7 D3B6 204600000020 Ӷ +D3B7 D3B7 D3B6 204600000020 ӷ +EA9980 EA9981 EA9980 207000000020 Ꙁ +EA9981 EA9981 EA9980 207000000020 ꙁ +D490 D491 D490 207200000020 Ԑ +D491 D491 D490 207200000020 ԑ +EA9982 EA9983 EA9982 207300000020 Ꙃ +EA9983 EA9983 EA9982 207300000020 ꙃ +D492 D493 D492 20BA00000020 Ԓ +D493 D493 D492 20BA00000020 ԓ +D494 D495 D494 20C200000020 Ԕ +D495 D495 D494 20C200000020 ԕ +D496 D497 D496 210400000020 Ԗ +D497 D497 D496 210400000020 ԗ +D3BC D3BD D3BC 213600000020 Ӽ +D3BD D3BD D3BC 213600000020 ӽ +D3BE D3BF D3BE 213A00000020 Ӿ +D3BF D3BF D3BE 213A00000020 ӿ +D380 D38F D380 21E100000020 Ӏ +D38F D38F D380 21E100000020 ӏ +E2B080 E2B0B0 E2B080 21E500000020 Ⰰ +E2B0B0 E2B0B0 E2B080 21E500000020 ⰰ +E2B081 E2B0B1 E2B081 21E600000020 Ⰱ +E2B0B1 E2B0B1 E2B081 21E600000020 ⰱ +E2B082 E2B0B2 E2B082 21E700000020 Ⰲ +E2B0B2 E2B0B2 E2B082 21E700000020 ⰲ +E2B083 E2B0B3 E2B083 21E800000020 Ⰳ +E2B0B3 E2B0B3 E2B083 21E800000020 ⰳ +E2B084 E2B0B4 E2B084 21E900000020 Ⰴ +E2B0B4 E2B0B4 E2B084 21E900000020 ⰴ +E2B085 E2B0B5 E2B085 21EA00000020 Ⰵ +E2B0B5 E2B0B5 E2B085 21EA00000020 ⰵ +E2B086 E2B0B6 E2B086 21EB00000020 Ⰶ +E2B0B6 E2B0B6 E2B086 21EB00000020 ⰶ +E2B087 E2B0B7 E2B087 21EC00000020 Ⰷ +E2B0B7 E2B0B7 E2B087 21EC00000020 ⰷ +E182A0 E2B480 E182A0 223B00000020 Ⴀ +E2B480 E2B480 E182A0 223B00000020 ⴀ +E182A1 E2B481 E182A1 223D00000020 Ⴁ +E2B481 E2B481 E182A1 223D00000020 ⴁ +E182A2 E2B482 E182A2 223F00000020 Ⴂ +E2B482 E2B482 E182A2 223F00000020 ⴂ +E182A3 E2B483 E182A3 224100000020 Ⴃ +E2B483 E2B483 E182A3 224100000020 ⴃ +E182A4 E2B484 E182A4 224300000020 Ⴄ +E2B484 E2B484 E182A4 224300000020 ⴄ +E182A5 E2B485 E182A5 224500000020 Ⴅ +E2B485 E2B485 E182A5 224500000020 ⴅ +E182A6 E2B486 E182A6 224700000020 Ⴆ +E2B486 E2B486 E182A6 224700000020 ⴆ +E182A7 E2B487 E182A7 224B00000020 Ⴇ +E2B487 E2B487 E182A7 224B00000020 ⴇ +E0A2A2 E0A2A2 E0A2A2 232B00000020 ࢢ +E0A2A3 E0A2A3 E0A2A3 236D00000020 ࢣ +F090B292 F090B392 F090B292 371200000020 𐲒 +F090B293 F090B393 F090B293 371300000020 𐲓 +F090B294 F090B394 F090B294 371400000020 𐲔 +F090B295 F090B395 F090B295 371500000020 𐲕 +F096BC80 F096BC80 F096BC80 427A00000020 𖼀 +F096BC81 F096BC81 F096BC81 427B00000020 𖼁 +F0909080 F09090A8 F0909080 445200000020 𐐀 +F09090A8 F09090A8 F0909080 445200000020 𐐨 +F0909081 F09090A9 F0909081 445300000020 𐐁 +F09090A9 F09090A9 F0909081 445300000020 𐐩 +F0909082 F09090AA F0909082 445400000020 𐐂 +F09090AA F09090AA F0909082 445400000020 𐐪 +F0909083 F09090AB F0909083 445500000020 𐐃 +F09090AB F09090AB F0909083 445500000020 𐐫 +F0909084 F09090AC F0909084 445600000020 𐐄 +F09090AC F09090AC F0909084 445600000020 𐐬 +F0909085 F09090AD F0909085 445700000020 𐐅 +F09090AD F09090AD F0909085 445700000020 𐐭 +F0909086 F09090AE F0909086 445800000020 𐐆 +F09090AE F09090AE F0909086 445800000020 𐐮 +F0909087 F09090AF F0909087 445900000020 𐐇 +F09090AF F09090AF F0909087 445900000020 𐐯 +F0909880 F0909880 F0909880 46BA00000020 𐘀 +F0909881 F0909881 F0909881 46BB00000020 𐘁 +F0909882 F0909882 F0909882 46BC00000020 𐘂 +F0909883 F0909883 F0909883 46BD00000020 𐘃 +F0AB9D99 F0AB9D99 F0AB9D99 FB85B75900000020 𫝙 +F0AB9DA0 F0AB9DA0 F0AB9DA0 FB85B76000000020 𫝠 +F0AB9DA1 F0AB9DA1 F0AB9DA1 FB85B76100000020 𫝡 +F0AB9DA2 F0AB9DA2 F0AB9DA2 FB85B76200000020 𫝢 +F0ABA0B6 F0ABA0B6 F0ABA0B6 FB85B83600000020 𫠶 +F0ABA0B7 F0ABA0B7 F0ABA0B7 FB85B83700000020 𫠷 +F0ABA0B8 F0ABA0B8 F0ABA0B8 FB85B83800000020 𫠸 +F0ABA0B9 F0ABA0B9 F0ABA0B9 FB85B83900000020 𫠹 +F09FA881 F09FA881 F09FA881 FBC3FA0100000020 🨁 +F09FAC81 F09FAC81 F09FAC81 FBC3FB0100000020 🬁 +F09FB081 F09FB081 F09FB081 FBC3FC0100000020 🰁 +F09FB481 F09FB481 F09FB481 FBC3FD0100000020 🴁 +INSERT INTO t1 VALUES ('a'); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0xFFFF)); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0x10FFFF)); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0x10400)); +SELECT hex(c), hex(weight_string(c)) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +hex(c) hex(weight_string(c)) +61 1C4700000020 +61F0909080 1C474452000000200020 +61EFBFBF 1C47FBC1FFFF000000200020 +61F48FBFBF 1C47FBE1FFFF000000200020 +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10400 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +F0909080 445200000020 𐐀 +F09090A8 445200000020 𐐨 +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10428 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +F0909080 445200000020 𐐀 +F09090A8 445200000020 𐐨 +ALTER TABLE t1 ADD KEY(c); +EXPLAIN SELECT hex(c) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range c c 43 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select hex(`test`.`t1`.`c`) AS `hex(c)` from `test`.`t1` where (`test`.`t1`.`c` like 'a%') order by `test`.`t1`.`c` +SELECT hex(c), hex(weight_string(c)) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +hex(c) hex(weight_string(c)) +61 1C4700000020 +61F0909080 1C474452000000200020 +61EFBFBF 1C47FBC1FFFF000000200020 +61F48FBFBF 1C47FBE1FFFF000000200020 +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10400 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +F0909080 445200000020 𐐀 +F09090A8 445200000020 𐐨 +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10428 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +F0909080 445200000020 𐐀 +F09090A8 445200000020 𐐨 +DROP TABLE t1; +SELECT is_ipv4(inet_ntoa('1')); +is_ipv4(inet_ntoa('1')) +1 +SELECT is_ipv6(inet_ntoa('1')); +is_ipv6(inet_ntoa('1')) +0 +SELECT inet6_aton(inet_ntoa('1')); +inet6_aton(inet_ntoa('1')) + +SELECT inet6_ntoa(inet_ntoa('1')); +inet6_ntoa(inet_ntoa('1')) +NULL +# +# Bug#14040277 UNINITIALIZED VALUE REFERENCED IN STR_TO_IPV6 +# +SELECT inet6_aton(soundex('a')); +inet6_aton(soundex('a')) +NULL +# +# Bug#19047425 UNINITIALISED VALUE IN STR_TO_IPV6 +# +do is_ipv4_mapped(inet6_aton(convert(_ascii "a:" using utf8mb4))); +CREATE TABLE t1 (c VARCHAR(10) CHARACTER SET utf8mb4); +INSERT INTO t1 VALUES (_utf8mb4 0xF09090A7), (_utf8mb4 0xEA8B93), (_utf8mb4 0xC4BC), (_utf8mb4 0xC6AD), (_utf8mb4 0xF090918F), (_utf8mb4 0xEAAD8B); +SELECT HEX(ANY_VALUE(c)), COUNT(c) FROM t1 GROUP BY c COLLATE utf8mb4_0900_as_ci; +HEX(ANY_VALUE(c)) COUNT(c) +C4BC 1 +C6AD 1 +EA8B93 1 +EAAD8B 1 +F09090A7 2 +DROP TABLE t1; +SET NAMES utf8mb4; +CREATE TABLE t1 (c1 CHAR(10) COLLATE utf8mb4_0900_as_ci); +insert into t1 values ('A'),('a'); +insert into t1 values ('B'),('b'); +insert into t1 values ('C'),('c'); +insert into t1 values ('D'),('d'); +insert into t1 values ('E'),('e'); +insert into t1 values ('F'),('f'); +insert into t1 values ('G'),('g'); +insert into t1 values ('H'),('h'); +insert into t1 values ('I'),('i'); +insert into t1 values ('J'),('j'); +insert into t1 values ('K'),('k'); +insert into t1 values ('L'),('l'); +insert into t1 values ('M'),('m'); +insert into t1 values ('N'),('n'); +insert into t1 values ('O'),('o'); +insert into t1 values ('P'),('p'); +insert into t1 values ('Q'),('q'); +insert into t1 values ('R'),('r'); +insert into t1 values ('S'),('s'); +insert into t1 values ('T'),('t'); +insert into t1 values ('U'),('u'); +insert into t1 values ('V'),('v'); +insert into t1 values ('W'),('w'); +insert into t1 values ('X'),('x'); +insert into t1 values ('Y'),('y'); +insert into t1 values ('Z'),('z'); +insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0); +insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1); +insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2); +insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3); +insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4); +insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5); +insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6); +insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7); +insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8); +insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9); +insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca); +insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb); +insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc); +insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd); +insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce); +insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf); +insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0); +insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1); +insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2); +insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3); +insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4); +insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5); +insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6); +insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7); +insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8); +insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9); +insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da); +insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db); +insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc); +insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd); +insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de); +insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df); +insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103); +insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107); +insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b); +insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f); +insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113); +insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117); +insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b); +insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f); +insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123); +insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127); +insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b); +insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f); +insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133); +insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137); +insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b); +insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f); +insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143); +insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147); +insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b); +insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f); +insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153); +insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157); +insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b); +insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f); +insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163); +insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167); +insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b); +insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f); +insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173); +insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177); +insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b); +insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f); +insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183); +insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187); +insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b); +insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f); +insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193); +insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197); +insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b); +insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f); +insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3); +insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7); +insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab); +insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af); +insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3); +insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7); +insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb); +insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf); +insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3); +insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7); +insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb); +insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf); +insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3); +insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7); +insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db); +insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df); +insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3); +insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7); +insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb); +insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef); +insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3); +insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7); +insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb); +insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff); +INSERT INTO t1 VALUES (_ucs2 0x1EA0),(_ucs2 0x1EA1),(_ucs2 0x1EA2),(_ucs2 0x1EA3); +INSERT INTO t1 VALUES (_ucs2 0x1EA4),(_ucs2 0x1EA5),(_ucs2 0x1EA6),(_ucs2 0x1EA7); +INSERT INTO t1 VALUES (_ucs2 0x1EA8),(_ucs2 0x1EA9),(_ucs2 0x1EAA),(_ucs2 0x1EAB); +INSERT INTO t1 VALUES (_ucs2 0x1EAC),(_ucs2 0x1EAD),(_ucs2 0x1EAE),(_ucs2 0x1EAF); +INSERT INTO t1 VALUES (_ucs2 0x1EB0),(_ucs2 0x1EB1),(_ucs2 0x1EB2),(_ucs2 0x1EB3); +INSERT INTO t1 VALUES (_ucs2 0x1EB4),(_ucs2 0x1EB5),(_ucs2 0x1EB6),(_ucs2 0x1EB7); +INSERT INTO t1 VALUES (_ucs2 0x1EB8),(_ucs2 0x1EB9),(_ucs2 0x1EBA),(_ucs2 0x1EBB); +INSERT INTO t1 VALUES (_ucs2 0x1EBC),(_ucs2 0x1EBD),(_ucs2 0x1EBE),(_ucs2 0x1EBF); +INSERT INTO t1 VALUES (_ucs2 0x1EC0),(_ucs2 0x1EC1),(_ucs2 0x1EC2),(_ucs2 0x1EC3); +INSERT INTO t1 VALUES (_ucs2 0x1EC4),(_ucs2 0x1EC5),(_ucs2 0x1EC6),(_ucs2 0x1EC7); +INSERT INTO t1 VALUES (_ucs2 0x1EC8),(_ucs2 0x1EC9),(_ucs2 0x1ECA),(_ucs2 0x1ECB); +INSERT INTO t1 VALUES (_ucs2 0x1ECC),(_ucs2 0x1ECD),(_ucs2 0x1ECE),(_ucs2 0x1ECF); +INSERT INTO t1 VALUES (_ucs2 0x1ED0),(_ucs2 0x1ED1),(_ucs2 0x1ED2),(_ucs2 0x1ED3); +INSERT INTO t1 VALUES (_ucs2 0x1ED4),(_ucs2 0x1ED5),(_ucs2 0x1ED6),(_ucs2 0x1ED7); +INSERT INTO t1 VALUES (_ucs2 0x1ED8),(_ucs2 0x1ED9),(_ucs2 0x1EDA),(_ucs2 0x1EDB); +INSERT INTO t1 VALUES (_ucs2 0x1EDC),(_ucs2 0x1EDD),(_ucs2 0x1EDE),(_ucs2 0x1EDF); +INSERT INTO t1 VALUES (_ucs2 0x1EE0),(_ucs2 0x1EE1),(_ucs2 0x1EE2),(_ucs2 0x1EE3); +INSERT INTO t1 VALUES (_ucs2 0x1EE4),(_ucs2 0x1EE5),(_ucs2 0x1EE6),(_ucs2 0x1EE7); +INSERT INTO t1 VALUES (_ucs2 0x1EE8),(_ucs2 0x1EE9),(_ucs2 0x1EEA),(_ucs2 0x1EEB); +INSERT INTO t1 VALUES (_ucs2 0x1EEC),(_ucs2 0x1EED),(_ucs2 0x1EEE),(_ucs2 0x1EEF); +INSERT INTO t1 VALUES (_ucs2 0x1EF0),(_ucs2 0x1EF1); +insert into t1 values ('AA'),('Aa'),('aa'),('aA'); +insert into t1 values ('AE'),('Ae'),('ae'),('aE'); +insert into t1 values ('CH'),('Ch'),('ch'),('cH'); +insert into t1 values ('DZ'),('Dz'),('dz'),('dZ'); +insert into t1 values ('DŽ'),('Dž'),('dž'),('dŽ'); +insert into t1 values ('IJ'),('Ij'),('ij'),('iJ'); +insert into t1 values ('LJ'),('Lj'),('lj'),('lJ'); +insert into t1 values ('LL'),('Ll'),('ll'),('lL'); +insert into t1 values ('NJ'),('Nj'),('nj'),('nJ'); +insert into t1 values ('OE'),('Oe'),('oe'),('oE'); +insert into t1 values ('SS'),('Ss'),('ss'),('sS'); +insert into t1 values ('RR'),('Rr'),('rr'),('rR'); +insert into t1 values (_ucs2 0x0218), (_ucs2 0x0219), (_ucs2 0x021a), (_ucs2 0x021b); +insert into t1 values (_ucs2 0x0d96), (_ucs2 0x0da4), (_ucs2 0x0da5); +insert into t1 values (_ucs2 0x0064017e), (_ucs2 0x0044017e), (_ucs2 0x0044017d); +insert into t1 values ('CS'),('Cs'),('cs'),('cS'); +insert into t1 values ('DZS'),('DZs'),('Dzs'),('DzS'); +insert into t1 values ('dZS'),('dZs'),('dzs'),('dzS'); +insert into t1 values ('GY'),('Gy'),('gy'),('gY'); +insert into t1 values ('LY'),('Ly'),('ly'),('lY'); +insert into t1 values ('NY'),('Ny'),('ny'),('nY'); +insert into t1 values ('SZ'),('Sz'),('sz'),('sZ'); +insert into t1 values ('TY'),('Ty'),('ty'),('tY'); +insert into t1 values ('ZS'),('Zs'),('zs'),('zS'); +insert into t1 values ('RR'),('Rr'),('rr'),('rR'); +insert into t1 values ('ccs'),('Ccs'),('CCS'),('cCS'); +insert into t1 values ('ddz'),('Ddz'),('DDZ'),('dDZ'); +insert into t1 values ('ddzs'),('Ddzs'),('DDZS'),('dDZS'); +insert into t1 values ('ggy'),('Ggy'),('GGY'),('gGY'); +insert into t1 values ('lly'),('Lly'),('LLY'),('lLY'); +insert into t1 values ('nny'),('Nny'),('NNY'),('nNY'); +insert into t1 values ('ssz'),('Ssz'),('SSZ'),('sSZ'); +insert into t1 values ('tty'),('Tty'),('TTY'),('tTY'); +insert into t1 values ('zzs'),('Zzs'),('ZZS'),('zZS'); +insert into t1 values ('UE'),('Ue'),('ue'),('uE'); +SELECT c1, HEX(WEIGHT_STRING(c1)) FROM t1 ORDER BY c1, HEX(c1) COLLATE utf8mb4_0900_as_ci; +c1 HEX(WEIGHT_STRING(c1)) +÷ 061800000020 +× 061900000020 +A 1C4700000020 +a 1C4700000020 +Á 1C47000000200024 +á 1C47000000200024 +À 1C47000000200025 +à 1C47000000200025 +Ă 1C47000000200026 +ă 1C47000000200026 +Ắ 1C470000002000260024 +ắ 1C470000002000260024 +Ằ 1C470000002000260025 +ằ 1C470000002000260025 +Ẵ 1C47000000200026002D +ẵ 1C47000000200026002D +Ẳ 1C47000000200026003B +ẳ 1C47000000200026003B + 1C47000000200027 +â 1C47000000200027 +Ấ 1C470000002000270024 +ấ 1C470000002000270024 +Ầ 1C470000002000270025 +ầ 1C470000002000270025 +Ẫ 1C47000000200027002D +ẫ 1C47000000200027002D +Ẩ 1C47000000200027003B +ẩ 1C47000000200027003B +Ǎ 1C47000000200028 +ǎ 1C47000000200028 +Å 1C47000000200029 +å 1C47000000200029 +Ǻ 1C470000002000290024 +ǻ 1C470000002000290024 +Ä 1C4700000020002B +ä 1C4700000020002B +Ǟ 1C4700000020002B0032 +ǟ 1C4700000020002B0032 +à 1C4700000020002D +ã 1C4700000020002D +Ǡ 1C4700000020002E0032 +ǡ 1C4700000020002E0032 +Ą 1C47000000200031 +ą 1C47000000200031 +Ā 1C47000000200032 +ā 1C47000000200032 +Ả 1C4700000020003B +ả 1C4700000020003B +Ạ 1C47000000200042 +ạ 1C47000000200042 +Ặ 1C470000002000420026 +ặ 1C470000002000420026 +Ậ 1C470000002000420027 +ậ 1C470000002000420027 +AA 1C471C47000000200020 +Aa 1C471C47000000200020 +aA 1C471C47000000200020 +aa 1C471C47000000200020 +AE 1C471CAA000000200020 +Ae 1C471CAA000000200020 +aE 1C471CAA000000200020 +ae 1C471CAA000000200020 +Æ 1C471CAA0000002001100020 +æ 1C471CAA0000002001100020 +Ǽ 1C471CAA00000020011000200024 +ǽ 1C471CAA00000020011000200024 +Ǣ 1C471CAA00000020011000200032 +ǣ 1C471CAA00000020011000200032 +B 1C6000000020 +b 1C6000000020 +ƀ 1C6800000020 +Ɓ 1C7100000020 +Ƃ 1C7500000020 +ƃ 1C7500000020 +C 1C7A00000020 +c 1C7A00000020 +Ć 1C7A000000200024 +ć 1C7A000000200024 +Ĉ 1C7A000000200027 +ĉ 1C7A000000200027 +Č 1C7A000000200028 +č 1C7A000000200028 +Ċ 1C7A00000020002E +ċ 1C7A00000020002E +Ç 1C7A000000200030 +ç 1C7A000000200030 +CCS 1C7A1C7A1E710000002000200020 +Ccs 1C7A1C7A1E710000002000200020 +cCS 1C7A1C7A1E710000002000200020 +ccs 1C7A1C7A1E710000002000200020 +CH 1C7A1D18000000200020 +Ch 1C7A1D18000000200020 +cH 1C7A1D18000000200020 +ch 1C7A1D18000000200020 +CS 1C7A1E71000000200020 +Cs 1C7A1E71000000200020 +cS 1C7A1E71000000200020 +cs 1C7A1E71000000200020 +Ƈ 1C8500000020 +ƈ 1C8500000020 +D 1C8F00000020 +d 1C8F00000020 +Ď 1C8F000000200028 +ď 1C8F000000200028 +Đ 1C8F000000200039 +đ 1C8F000000200039 +Ð 1C8F000000200110 +ð 1C8F000000200110 +DDZ 1C8F1C8F1F210000002000200020 +Ddz 1C8F1C8F1F210000002000200020 +dDZ 1C8F1C8F1F210000002000200020 +ddz 1C8F1C8F1F210000002000200020 +DDZS 1C8F1C8F1F211E7100000020002000200020 +Ddzs 1C8F1C8F1F211E7100000020002000200020 +dDZS 1C8F1C8F1F211E7100000020002000200020 +ddzs 1C8F1C8F1F211E7100000020002000200020 +DZ 1C8F1F21000000200020 +Dz 1C8F1F21000000200020 +dZ 1C8F1F21000000200020 +dz 1C8F1F21000000200020 +DZ 1C8F1F21000000200020 +Dz 1C8F1F21000000200020 +dz 1C8F1F21000000200020 +DŽ 1C8F1F210000002000200028 +DŽ 1C8F1F210000002000200028 +Dž 1C8F1F210000002000200028 +Dž 1C8F1F210000002000200028 +dŽ 1C8F1F210000002000200028 +dž 1C8F1F210000002000200028 +dž 1C8F1F210000002000200028 +DŽ 1C8F1F210000002000200028 +Dž 1C8F1F210000002000200028 +dž 1C8F1F210000002000200028 +DZS 1C8F1F211E710000002000200020 +DZs 1C8F1F211E710000002000200020 +DzS 1C8F1F211E710000002000200020 +Dzs 1C8F1F211E710000002000200020 +dZS 1C8F1F211E710000002000200020 +dZs 1C8F1F211E710000002000200020 +dzS 1C8F1F211E710000002000200020 +dzs 1C8F1F211E710000002000200020 +Ɖ 1C9700000020 +Ɗ 1C9B00000020 +Ƌ 1CA000000020 +ƌ 1CA000000020 +E 1CAA00000020 +e 1CAA00000020 +É 1CAA000000200024 +é 1CAA000000200024 +È 1CAA000000200025 +è 1CAA000000200025 +Ĕ 1CAA000000200026 +ĕ 1CAA000000200026 +Ê 1CAA000000200027 +ê 1CAA000000200027 +Ế 1CAA0000002000270024 +ế 1CAA0000002000270024 +Ề 1CAA0000002000270025 +ề 1CAA0000002000270025 +Ễ 1CAA000000200027002D +ễ 1CAA000000200027002D +Ể 1CAA000000200027003B +ể 1CAA000000200027003B +Ě 1CAA000000200028 +ě 1CAA000000200028 +Ë 1CAA00000020002B +ë 1CAA00000020002B +Ẽ 1CAA00000020002D +ẽ 1CAA00000020002D +Ė 1CAA00000020002E +ė 1CAA00000020002E +Ę 1CAA000000200031 +ę 1CAA000000200031 +Ē 1CAA000000200032 +ē 1CAA000000200032 +Ẻ 1CAA00000020003B +ẻ 1CAA00000020003B +Ẹ 1CAA000000200042 +ẹ 1CAA000000200042 +Ệ 1CAA0000002000420027 +ệ 1CAA0000002000420027 +Ǝ 1CB800000020 +ǝ 1CB800000020 +Ə 1CBD00000020 +Ɛ 1CC200000020 +F 1CE500000020 +f 1CE500000020 +Ƒ 1CEE00000020 +ƒ 1CEE00000020 +G 1CF400000020 +g 1CF400000020 +Ǵ 1CF4000000200024 +ǵ 1CF4000000200024 +Ğ 1CF4000000200026 +ğ 1CF4000000200026 +Ĝ 1CF4000000200027 +ĝ 1CF4000000200027 +Ǧ 1CF4000000200028 +ǧ 1CF4000000200028 +Ġ 1CF400000020002E +ġ 1CF400000020002E +Ģ 1CF4000000200030 +ģ 1CF4000000200030 +GGY 1CF41CF41F0B0000002000200020 +Ggy 1CF41CF41F0B0000002000200020 +gGY 1CF41CF41F0B0000002000200020 +ggy 1CF41CF41F0B0000002000200020 +GY 1CF41F0B000000200020 +Gy 1CF41F0B000000200020 +gY 1CF41F0B000000200020 +gy 1CF41F0B000000200020 +Ǥ 1D0100000020 +ǥ 1D0100000020 +Ɠ 1D0600000020 +Ɣ 1D1000000020 +Ƣ 1D1400000020 +ƣ 1D1400000020 +H 1D1800000020 +h 1D1800000020 +Ĥ 1D18000000200027 +ĥ 1D18000000200027 +Ħ 1D18000000200039 +ħ 1D18000000200039 +ƕ 1D2000000020 +Ƕ 1D2000000020 +I 1D3200000020 +i 1D3200000020 +Í 1D32000000200024 +í 1D32000000200024 +Ì 1D32000000200025 +ì 1D32000000200025 +Ĭ 1D32000000200026 +ĭ 1D32000000200026 +Î 1D32000000200027 +î 1D32000000200027 +Ǐ 1D32000000200028 +ǐ 1D32000000200028 +Ï 1D3200000020002B +ï 1D3200000020002B +Ĩ 1D3200000020002D +ĩ 1D3200000020002D +İ 1D3200000020002E +Į 1D32000000200031 +į 1D32000000200031 +Ī 1D32000000200032 +ī 1D32000000200032 +Ỉ 1D3200000020003B +ỉ 1D3200000020003B +Ị 1D32000000200042 +ị 1D32000000200042 +IJ 1D321D4C000000200020 +Ij 1D321D4C000000200020 +iJ 1D321D4C000000200020 +ij 1D321D4C000000200020 +IJ 1D321D4C000000200020 +ij 1D321D4C000000200020 +ı 1D3600000020 +Ɨ 1D4100000020 +Ɩ 1D4700000020 +J 1D4C00000020 +j 1D4C00000020 +Ĵ 1D4C000000200027 +ĵ 1D4C000000200027 +ǰ 1D4C000000200028 +K 1D6500000020 +k 1D6500000020 +Ǩ 1D65000000200028 +ǩ 1D65000000200028 +Ķ 1D65000000200030 +ķ 1D65000000200030 +Ƙ 1D6B00000020 +ƙ 1D6B00000020 +L 1D7700000020 +l 1D7700000020 +Ĺ 1D77000000200024 +ĺ 1D77000000200024 +Ľ 1D77000000200028 +ľ 1D77000000200028 +Ļ 1D77000000200030 +ļ 1D77000000200030 +Ł 1D77000000200039 +ł 1D77000000200039 +Ŀ 1D77000000200110 +ŀ 1D77000000200110 +LJ 1D771D4C000000200020 +Lj 1D771D4C000000200020 +lJ 1D771D4C000000200020 +lj 1D771D4C000000200020 +LJ 1D771D4C000000200020 +Lj 1D771D4C000000200020 +lj 1D771D4C000000200020 +LL 1D771D77000000200020 +Ll 1D771D77000000200020 +lL 1D771D77000000200020 +ll 1D771D77000000200020 +LLY 1D771D771F0B0000002000200020 +Lly 1D771D771F0B0000002000200020 +lLY 1D771D771F0B0000002000200020 +lly 1D771D771F0B0000002000200020 +LY 1D771F0B000000200020 +Ly 1D771F0B000000200020 +lY 1D771F0B000000200020 +ly 1D771F0B000000200020 +ƚ 1D8200000020 +ƛ 1DA200000020 +M 1DAA00000020 +m 1DAA00000020 +N 1DB900000020 +n 1DB900000020 +Ń 1DB9000000200024 +ń 1DB9000000200024 +Ǹ 1DB9000000200025 +ǹ 1DB9000000200025 +Ň 1DB9000000200028 +ň 1DB9000000200028 +Ñ 1DB900000020002D +ñ 1DB900000020002D +Ņ 1DB9000000200030 +ņ 1DB9000000200030 +NJ 1DB91D4C000000200020 +Nj 1DB91D4C000000200020 +nJ 1DB91D4C000000200020 +nj 1DB91D4C000000200020 +NJ 1DB91D4C000000200020 +Nj 1DB91D4C000000200020 +nj 1DB91D4C000000200020 +NNY 1DB91DB91F0B0000002000200020 +Nny 1DB91DB91F0B0000002000200020 +nNY 1DB91DB91F0B0000002000200020 +nny 1DB91DB91F0B0000002000200020 +NY 1DB91F0B000000200020 +Ny 1DB91F0B000000200020 +nY 1DB91F0B000000200020 +ny 1DB91F0B000000200020 +Ɲ 1DC400000020 +ƞ 1DC800000020 +Ŋ 1DD800000020 +ŋ 1DD800000020 +O 1DDD00000020 +o 1DDD00000020 +Ó 1DDD000000200024 +ó 1DDD000000200024 +Ò 1DDD000000200025 +ò 1DDD000000200025 +Ŏ 1DDD000000200026 +ŏ 1DDD000000200026 +Ô 1DDD000000200027 +ô 1DDD000000200027 +Ố 1DDD0000002000270024 +ố 1DDD0000002000270024 +Ồ 1DDD0000002000270025 +ồ 1DDD0000002000270025 +Ỗ 1DDD000000200027002D +ỗ 1DDD000000200027002D +Ổ 1DDD000000200027003B +ổ 1DDD000000200027003B +Ǒ 1DDD000000200028 +ǒ 1DDD000000200028 +Ö 1DDD00000020002B +ö 1DDD00000020002B +Ő 1DDD00000020002C +ő 1DDD00000020002C +Õ 1DDD00000020002D +õ 1DDD00000020002D +Ø 1DDD00000020002F +ø 1DDD00000020002F +Ǿ 1DDD00000020002F0024 +ǿ 1DDD00000020002F0024 +Ǫ 1DDD000000200031 +ǫ 1DDD000000200031 +Ǭ 1DDD0000002000310032 +ǭ 1DDD0000002000310032 +Ō 1DDD000000200032 +ō 1DDD000000200032 +Ỏ 1DDD00000020003B +ỏ 1DDD00000020003B +Ơ 1DDD00000020003F +ơ 1DDD00000020003F +Ớ 1DDD00000020003F0024 +ớ 1DDD00000020003F0024 +Ờ 1DDD00000020003F0025 +ờ 1DDD00000020003F0025 +Ỡ 1DDD00000020003F002D +ỡ 1DDD00000020003F002D +Ở 1DDD00000020003F003B +ở 1DDD00000020003F003B +Ợ 1DDD00000020003F0042 +ợ 1DDD00000020003F0042 +Ọ 1DDD000000200042 +ọ 1DDD000000200042 +Ộ 1DDD0000002000420027 +ộ 1DDD0000002000420027 +OE 1DDD1CAA000000200020 +Oe 1DDD1CAA000000200020 +oE 1DDD1CAA000000200020 +oe 1DDD1CAA000000200020 +Œ 1DDD1CAA0000002001100020 +œ 1DDD1CAA0000002001100020 +Ɔ 1DF000000020 +Ɵ 1DFD00000020 +P 1E0C00000020 +p 1E0C00000020 +Ƥ 1E1500000020 +ƥ 1E1500000020 +Q 1E2100000020 +q 1E2100000020 +ĸ 1E2F00000020 +R 1E3300000020 +r 1E3300000020 +Ŕ 1E33000000200024 +ŕ 1E33000000200024 +Ř 1E33000000200028 +ř 1E33000000200028 +Ŗ 1E33000000200030 +ŗ 1E33000000200030 +RR 1E331E33000000200020 +RR 1E331E33000000200020 +Rr 1E331E33000000200020 +Rr 1E331E33000000200020 +rR 1E331E33000000200020 +rR 1E331E33000000200020 +rr 1E331E33000000200020 +rr 1E331E33000000200020 +Ʀ 1E3800000020 +S 1E7100000020 +s 1E7100000020 +Ś 1E71000000200024 +ś 1E71000000200024 +Ŝ 1E71000000200027 +ŝ 1E71000000200027 +Š 1E71000000200028 +š 1E71000000200028 +Ş 1E71000000200030 +ş 1E71000000200030 +Ș 1E71000000200045 +ș 1E71000000200045 +ſ 1E71000000200111 +SS 1E711E71000000200020 +Ss 1E711E71000000200020 +sS 1E711E71000000200020 +ss 1E711E71000000200020 +ß 1E711E710000002001100020 +SSZ 1E711E711F210000002000200020 +Ssz 1E711E711F210000002000200020 +sSZ 1E711E711F210000002000200020 +ssz 1E711E711F210000002000200020 +SZ 1E711F21000000200020 +Sz 1E711F21000000200020 +sZ 1E711F21000000200020 +sz 1E711F21000000200020 +Ʃ 1E8200000020 +ƪ 1E8800000020 +T 1E9500000020 +t 1E9500000020 +Ť 1E95000000200028 +ť 1E95000000200028 +Ţ 1E95000000200030 +ţ 1E95000000200030 +Ț 1E95000000200045 +ț 1E95000000200045 +ƾ 1E951E71000000200020 +TTY 1E951E951F0B0000002000200020 +Tty 1E951E951F0B0000002000200020 +tTY 1E951E951F0B0000002000200020 +tty 1E951E951F0B0000002000200020 +TY 1E951F0B000000200020 +Ty 1E951F0B000000200020 +tY 1E951F0B000000200020 +ty 1E951F0B000000200020 +Ŧ 1E9A00000020 +ŧ 1E9A00000020 +ƫ 1EA000000020 +Ƭ 1EA400000020 +ƭ 1EA400000020 +Ʈ 1EA800000020 +U 1EB500000020 +u 1EB500000020 +Ú 1EB5000000200024 +ú 1EB5000000200024 +Ù 1EB5000000200025 +ù 1EB5000000200025 +Ŭ 1EB5000000200026 +ŭ 1EB5000000200026 +Û 1EB5000000200027 +û 1EB5000000200027 +Ǔ 1EB5000000200028 +ǔ 1EB5000000200028 +Ů 1EB5000000200029 +ů 1EB5000000200029 +Ü 1EB500000020002B +ü 1EB500000020002B +Ǘ 1EB500000020002B0024 +ǘ 1EB500000020002B0024 +Ǜ 1EB500000020002B0025 +ǜ 1EB500000020002B0025 +Ǚ 1EB500000020002B0028 +ǚ 1EB500000020002B0028 +Ǖ 1EB500000020002B0032 +ǖ 1EB500000020002B0032 +Ű 1EB500000020002C +ű 1EB500000020002C +Ũ 1EB500000020002D +ũ 1EB500000020002D +Ų 1EB5000000200031 +ų 1EB5000000200031 +Ū 1EB5000000200032 +ū 1EB5000000200032 +Ủ 1EB500000020003B +ủ 1EB500000020003B +Ư 1EB500000020003F +ư 1EB500000020003F +Ứ 1EB500000020003F0024 +ứ 1EB500000020003F0024 +Ừ 1EB500000020003F0025 +ừ 1EB500000020003F0025 +Ữ 1EB500000020003F002D +ữ 1EB500000020003F002D +Ử 1EB500000020003F003B +ử 1EB500000020003F003B +Ự 1EB500000020003F0042 +ự 1EB500000020003F0042 +Ụ 1EB5000000200042 +ụ 1EB5000000200042 +UE 1EB51CAA000000200020 +Ue 1EB51CAA000000200020 +uE 1EB51CAA000000200020 +ue 1EB51CAA000000200020 +Ɯ 1ED400000020 +Ʊ 1EDE00000020 +V 1EE300000020 +v 1EE300000020 +Ʋ 1EEA00000020 +W 1EF500000020 +w 1EF500000020 +Ŵ 1EF5000000200027 +ŵ 1EF5000000200027 +X 1EFF00000020 +x 1EFF00000020 +Y 1F0B00000020 +y 1F0B00000020 +Ý 1F0B000000200024 +ý 1F0B000000200024 +Ŷ 1F0B000000200027 +ŷ 1F0B000000200027 +ÿ 1F0B00000020002B +Ÿ 1F0B00000020002B +Ƴ 1F1700000020 +ƴ 1F1700000020 +Z 1F2100000020 +z 1F2100000020 +Ź 1F21000000200024 +ź 1F21000000200024 +Ž 1F21000000200028 +ž 1F21000000200028 +Ż 1F2100000020002E +ż 1F2100000020002E +ZS 1F211E71000000200020 +Zs 1F211E71000000200020 +zS 1F211E71000000200020 +zs 1F211E71000000200020 +ƍ 1F211EF5000000200020 +ZZS 1F211F211E710000002000200020 +Zzs 1F211F211E710000002000200020 +zZS 1F211F211E710000002000200020 +zzs 1F211F211E710000002000200020 +Ƶ 1F2600000020 +ƶ 1F2600000020 +Ʒ 1F3E00000020 +Ǯ 1F3E000000200028 +ǯ 1F3E000000200028 +Ƹ 1F4300000020 +ƹ 1F4300000020 +ƺ 1F4800000020 +Þ 1F5000000020 +þ 1F5000000020 +ƿ 1F5600000020 +Ƿ 1F5600000020 +ƻ 1F6200000020 +Ƨ 1F6900000020 +ƨ 1F6900000020 +Ƽ 1F6D00000020 +ƽ 1F6D00000020 +Ƅ 1F7100000020 +ƅ 1F7100000020 +ʼn 1F7E1DB9000000200020 +ǀ 1F9900000020 +ǁ 1F9D00000020 +ǂ 1FA100000020 +ǃ 1FA500000020 +ඖ 28E100000020 +ඤ 28EC00000020 +ඥ 28ED00000020 +DROP TABLE t1; diff --git a/mysql-test/r/ctype_unicode900_as_cs.result-pq b/mysql-test/r/ctype_unicode900_as_cs.result-pq new file mode 100644 index 000000000000..c04278e207bd --- /dev/null +++ b/mysql-test/r/ctype_unicode900_as_cs.result-pq @@ -0,0 +1,2078 @@ +DROP TABLE IF EXISTS t1; +# +# Start of 5.8 tests +# +SET NAMES utf8mb4 COLLATE utf8mb4_0900_as_cs; +SET @test_character_set= 'utf8mb4'; +SET @test_collation= 'utf8mb4_0900_as_cs'; +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET @safe_character_set_client= @@character_set_client; +SET @safe_character_set_results= @@character_set_results; +SET character_set_server= @test_character_set; +SET collation_server= @test_collation; +CREATE DATABASE d1; +USE d1; +CREATE TABLE t1 (c CHAR(10), KEY(c)); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c char(10) utf8mb4_0900_as_cs YES MUL NULL +INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +want3results +aaa +aaaa +aaaaa +DROP TABLE t1; +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c1 varchar(15) utf8mb4_0900_as_cs YES MUL NULL +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +want3results +location +loberge +lotre +SELECT c1 as want3results from t1 where c1 like 'lo%'; +want3results +location +loberge +lotre +SELECT c1 as want1result from t1 where c1 like 'loc%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'loca%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locat%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locati%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'location%'; +want1result +location +DROP TABLE t1; +create table t1 (a set('a') not null); +insert ignore into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +select 1 from t1 order by cast(a as char(1)); +1 +1 +1 +drop table t1; +set names utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +create table t1 ( +name varchar(10), +level smallint unsigned); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `name` varchar(10) COLLATE utf8mb4_0900_as_cs DEFAULT NULL, + `level` smallint unsigned DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_as_cs +insert into t1 values ('string',1); +select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; +concat(name,space(level)) concat(name, repeat(' ',level)) +string string +drop table t1; +DROP DATABASE d1; +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; +SET character_set_client= @safe_character_set_client; +SET character_set_results= @safe_character_set_results; +SET NAMES utf8mb4 COLLATE utf8mb4_0900_as_cs; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +utf8mb4_0900_as_cs 61 +utf8mb4_0900_as_cs 6109 +utf8mb4_0900_as_cs 6120 +drop table t1; +create table t1 engine=innodb select repeat('a',50) as c1; +alter table t1 add index(c1(5)); +insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111'); +select collation(c1) from t1 limit 1; +collation(c1) +utf8mb4_0900_as_cs +select c1 from t1 where c1 like 'abcdef%' order by c1; +c1 +abcdefg +select c1 from t1 where c1 like 'abcde1%' order by c1; +c1 +abcde100 +abcde110 +abcde111 +select c1 from t1 where c1 like 'abcde11%' order by c1; +c1 +abcde110 +abcde111 +select c1 from t1 where c1 like 'abcde111%' order by c1; +c1 +abcde111 +drop table t1; +select @@collation_connection; +@@collation_connection +utf8mb4_0900_as_cs +create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ; +insert into t1 values('abcdef'); +insert into t1 values('_bcdef'); +insert into t1 values('a_cdef'); +insert into t1 values('ab_def'); +insert into t1 values('abc_ef'); +insert into t1 values('abcd_f'); +insert into t1 values('abcde_'); +select c1 as c1u from t1 where c1 like 'ab\_def'; +c1u +ab_def +select c1 as c2h from t1 where c1 like 'ab#_def' escape '#'; +c2h +ab_def +drop table t1; +drop table if exists t1; +create table t1 select repeat('a',10) as c1; +delete from t1; +insert into t1 values (0x20),(0x21),(0x22),(0x23),(0x24),(0x25),(0x26),(0x27),(0x28),(0x29),(0x2A),(0x2B),(0x2C),(0x2D),(0x2E),(0x2F); +insert into t1 values (0x30),(0x31),(0x32),(0x33),(0x34),(0x35),(0x36),(0x37),(0x38),(0x39),(0x3A),(0x3B),(0x3C),(0x3D),(0x3E),(0x3F); +insert into t1 values (0x40),(0x41),(0x42),(0x43),(0x44),(0x45),(0x46),(0x47),(0x48),(0x49),(0x4A),(0x4B),(0x4C),(0x4D),(0x4E),(0x4F); +insert into t1 values (0x50),(0x51),(0x52),(0x53),(0x54),(0x55),(0x56),(0x57),(0x58),(0x59),(0x5A),(0x5B),(0x5C),(0x5D),(0x5E),(0x5F); +insert into t1 values (0x60),(0x61),(0x62),(0x63),(0x64),(0x65),(0x66),(0x67),(0x68),(0x69),(0x6A),(0x6B),(0x6C),(0x6D),(0x6E),(0x6F); +insert into t1 values (0x70),(0x71),(0x72),(0x73),(0x74),(0x75),(0x76),(0x77),(0x78),(0x79),(0x7A),(0x7B),(0x7C),(0x7D),(0x7E),(0x7F); +SELECT GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR ''), GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) FROM t1 GROUP BY c1; +GROUP_CONCAT(c1 ORDER BY binary c1 SEPARATOR '') GROUP_CONCAT(hex(c1) ORDER BY BINARY c1) + 7F + 20 +_ 5F +- 2D +, 2C +; 3B +: 3A +! 21 +? 3F +. 2E +' 27 +" 22 +( 28 +) 29 +[ 5B +] 5D +{ 7B +} 7D +@ 40 +* 2A +/ 2F +\ 5C +& 26 +# 23 +% 25 +` 60 +^ 5E ++ 2B +< 3C += 3D +> 3E +| 7C +~ 7E +$ 24 +0 30 +1 31 +2 32 +3 33 +4 34 +5 35 +6 36 +7 37 +8 38 +9 39 +a 61 +A 41 +b 62 +B 42 +c 63 +C 43 +d 64 +D 44 +e 65 +E 45 +f 66 +F 46 +g 67 +G 47 +h 68 +H 48 +i 69 +I 49 +j 6A +J 4A +k 6B +K 4B +l 6C +L 4C +m 6D +M 4D +n 6E +N 4E +o 6F +O 4F +p 70 +P 50 +q 71 +Q 51 +r 72 +R 52 +s 73 +S 53 +t 74 +T 54 +u 75 +U 55 +v 76 +V 56 +w 77 +W 57 +x 78 +X 58 +y 79 +Y 59 +z 7A +Z 5A +drop table t1; +SET NAMES utf8mb4 COLLATE utf8mb4_0900_as_cs; +SELECT HEX(CONVERT(_utf8mb4 0xF091AB9B41 USING ucs2)); +HEX(CONVERT(_utf8mb4 0xF091AB9B41 USING ucs2)) +003F0041 +SELECT HEX(CONVERT(_utf8mb4 0xF091AB9B41 USING utf16)); +HEX(CONVERT(_utf8mb4 0xF091AB9B41 USING utf16)) +D806DEDB0041 +SELECT HEX(CONVERT(_utf8mb4 0xF091AB9B41 USING utf32)); +HEX(CONVERT(_utf8mb4 0xF091AB9B41 USING utf32)) +00011ADB00000041 +SELECT HEX(CONVERT(_ucs2 0xF8FF USING utf8mb4)); +HEX(CONVERT(_ucs2 0xF8FF USING utf8mb4)) +EFA3BF +SELECT HEX(CONVERT(_utf16 0xF8FF USING utf8mb4)); +HEX(CONVERT(_utf16 0xF8FF USING utf8mb4)) +EFA3BF +SELECT HEX(CONVERT(_utf32 0xF8FF USING utf8mb4)); +HEX(CONVERT(_utf32 0xF8FF USING utf8mb4)) +EFA3BF +SELECT HEX(CONVERT(_utf8mb4 0x8F USING ucs2)); +ERROR HY000: Invalid utf8mb4 character string: '8F' +SELECT HEX(CONVERT(_utf8mb4 0xC230 USING ucs2)); +ERROR HY000: Invalid utf8mb4 character string: 'C230' +SELECT HEX(CONVERT(_utf8mb4 0xE234F1 USING ucs2)); +ERROR HY000: Invalid utf8mb4 character string: 'E234F1' +SELECT HEX(CONVERT(_utf8mb4 0xF4E25634 USING ucs2)); +ERROR HY000: Invalid utf8mb4 character string: 'F4E256' +SELECT ASCII('ABC'); +ASCII('ABC') +65 +SELECT BIT_LENGTH('a'); +BIT_LENGTH('a') +8 +SELECT BIT_LENGTH('À'); +BIT_LENGTH('À') +16 +SELECT BIT_LENGTH('テ'); +BIT_LENGTH('テ') +24 +SELECT BIT_LENGTH('𝌆'); +BIT_LENGTH('?') +32 +SELECT CHAR_LENGTH('𝌆テÀa'); +CHAR_LENGTH('?テÀa') +4 +SELECT LENGTH('𝌆テÀa'); +LENGTH('?テÀa') +10 +SELECT FIELD('a', '𝌆テÀa'); +FIELD('a', '?テÀa') +0 +SELECT HEX('𝌆テÀa'); +HEX('?テÀa') +F09D8C86E38386C38061 +SELECT INSERT('𝌆テÀa', 2, 2, 'テb'); +INSERT('?テÀa', 2, 2, 'テb') +𝌆テba +SELECT LOWER('𝌆テÀBcd'); +LOWER('?テÀBcd') +𝌆テàbcd +SELECT ORD('𝌆'); +ORD('?') +4036856966 +SELECT UPPER('𝌆テàbCD'); +UPPER('?テàbCD') +𝌆テÀBCD +SELECT LOCATE(_utf8mb4 0xF091AB9B41, _utf8mb4 0xF091AB9B42F091AB9B41F091AB9B43); +LOCATE(_utf8mb4 0xF091AB9B41, _utf8mb4 0xF091AB9B42F091AB9B41F091AB9B43) +3 +SELECT HEX(REVERSE(_utf8mb4 0xF091AB9B41F091AB9B42F091AB9B43)); +HEX(REVERSE(_utf8mb4 0xF091AB9B41F091AB9B42F091AB9B43)) +43F091AB9B42F091AB9B41F091AB9B +SELECT HEX(SUBSTRING(_utf8mb4 0xF091AB9B41F091AB9B42F091AB9B43, 1, 2)); +HEX(SUBSTRING(_utf8mb4 0xF091AB9B41F091AB9B42F091AB9B43, 1, 2)) +F091AB9B41 +SELECT HEX(SUBSTRING(_utf8mb4 0xF091AB9B41F091AB9B42F091AB9B43, -3, 2)); +HEX(SUBSTRING(_utf8mb4 0xF091AB9B41F091AB9B42F091AB9B43, -3, 2)) +42F091AB9B +SELECT HEX(TRIM(_utf8mb4 0x2020F091AB9B4120F091AB9B4120202020)); +HEX(TRIM(_utf8mb4 0x2020F091AB9B4120F091AB9B4120202020)) +F091AB9B4120F091AB9B41 +SELECT HEX(WEIGHT_STRING('aA')); +HEX(WEIGHT_STRING('aA')) +1C471C47000000200020000000020008 +SELECT HEX(WEIGHT_STRING(CAST(_utf32 x'337F' AS CHAR))); +HEX(WEIGHT_STRING(CAST(_utf32 x'337F' AS CHAR))) +FB40E82AFB40DF0FFB40CF1AFB40F93E000000200020002000200000001C001C001C001C +SELECT HEX(WEIGHT_STRING(CAST(_utf32 x'FDFA' AS CHAR))); +HEX(WEIGHT_STRING(CAST(_utf32 x'FDFA' AS CHAR))) +2364239C23C50209230B239C239C23B10000002000200020002000200020002000200000001A001A001A001A001A001A001A001A +select @@collation_connection; +@@collation_connection +utf8mb4_0900_as_cs +select hex(weight_string('a')); +hex(weight_string('a')) +1C470000002000000002 +select hex(weight_string('A')); +hex(weight_string('A')) +1C470000002000000008 +select hex(weight_string('abc')); +hex(weight_string('abc')) +1C471C601C7A00000020002000200000000200020002 +select hex(weight_string('abc' as char(2))); +hex(weight_string('abc' as char(2))) +1C471C60000000200020000000020002 +select hex(weight_string('abc' as char(3))); +hex(weight_string('abc' as char(3))) +1C471C601C7A00000020002000200000000200020002 +select hex(weight_string('abc' as char(5))); +hex(weight_string('abc' as char(5))) +1C471C601C7A00000020002000200000000200020002 +select hex(weight_string('abc', 1, 2, 0xC0)); +hex(weight_string('abc', 1, 2, 0xC0)) +1C +select hex(weight_string('abc', 2, 2, 0xC0)); +hex(weight_string('abc', 2, 2, 0xC0)) +1C47 +select hex(weight_string('abc', 3, 2, 0xC0)); +hex(weight_string('abc', 3, 2, 0xC0)) +1C471C +select hex(weight_string('abc', 4, 2, 0xC0)); +hex(weight_string('abc', 4, 2, 0xC0)) +1C471C60 +select hex(weight_string('abc', 5, 2, 0xC0)); +hex(weight_string('abc', 5, 2, 0xC0)) +1C471C6000 +select hex(weight_string('abc',25, 2, 0xC0)); +hex(weight_string('abc',25, 2, 0xC0)) +1C471C60000000200020000000020002000000000000000000 +select hex(weight_string('abc', 1, 3, 0xC0)); +hex(weight_string('abc', 1, 3, 0xC0)) +1C +select hex(weight_string('abc', 2, 3, 0xC0)); +hex(weight_string('abc', 2, 3, 0xC0)) +1C47 +select hex(weight_string('abc', 3, 3, 0xC0)); +hex(weight_string('abc', 3, 3, 0xC0)) +1C471C +select hex(weight_string('abc', 4, 3, 0xC0)); +hex(weight_string('abc', 4, 3, 0xC0)) +1C471C60 +select hex(weight_string('abc', 5, 3, 0xC0)); +hex(weight_string('abc', 5, 3, 0xC0)) +1C471C601C +select hex(weight_string('abc',25, 3, 0xC0)); +hex(weight_string('abc',25, 3, 0xC0)) +1C471C601C7A00000020002000200000000200020002000000 +select hex(weight_string('abc', 1, 4, 0xC0)); +hex(weight_string('abc', 1, 4, 0xC0)) +1C +select hex(weight_string('abc', 2, 4, 0xC0)); +hex(weight_string('abc', 2, 4, 0xC0)) +1C47 +select hex(weight_string('abc', 3, 4, 0xC0)); +hex(weight_string('abc', 3, 4, 0xC0)) +1C471C +select hex(weight_string('abc', 4, 4, 0xC0)); +hex(weight_string('abc', 4, 4, 0xC0)) +1C471C60 +select hex(weight_string('abc', 5, 4, 0xC0)); +hex(weight_string('abc', 5, 4, 0xC0)) +1C471C601C +select hex(weight_string('abc',25, 4, 0xC0)); +hex(weight_string('abc',25, 4, 0xC0)) +1C471C601C7A00000020002000200000000200020002000000 +select @@collation_connection; +@@collation_connection +utf8mb4_0900_as_cs +select hex(weight_string(cast(_latin1 0x80 as char))); +hex(weight_string(cast(_latin1 0x80 as char))) +1C2A0000002000000002 +select hex(weight_string(cast(_latin1 0x808080 as char))); +hex(weight_string(cast(_latin1 0x808080 as char))) +1C2A1C2A1C2A00000020002000200000000200020002 +select hex(weight_string(cast(_latin1 0x808080 as char) as char(2))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(2))) +1C2A1C2A000000200020000000020002 +select hex(weight_string(cast(_latin1 0x808080 as char) as char(3))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(3))) +1C2A1C2A1C2A00000020002000200000000200020002 +select hex(weight_string(cast(_latin1 0x808080 as char) as char(5))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(5))) +1C2A1C2A1C2A00000020002000200000000200020002 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)) +1C +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)) +1C2A +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)) +1C2A1C +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)) +1C2A1C2A +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)) +1C2A1C2A00 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)) +1C2A1C2A000000200020000000020002000000000000000000 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)) +1C +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)) +1C2A +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)) +1C2A1C +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)) +1C2A1C2A +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)) +1C2A1C2A1C +select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)) +1C2A1C2A1C2A00000020002000200000000200020002000000 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)) +1C +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)) +1C2A +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)) +1C2A1C +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)) +1C2A1C2A +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)) +1C2A1C2A1C +select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)) +1C2A1C2A1C2A00000020002000200000000200020002000000 +CREATE TABLE t1 AS SELECT repeat('a', 10) as c LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_as_cs DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +INSERT INTO t1 VALUES (_utf32 0x0180),(_utf32 0x023A); +INSERT INTO t1 VALUES (_utf32 0x023B),(_utf32 0x023C); +INSERT INTO t1 VALUES (_utf32 0x023D),(_utf32 0x023E); +INSERT INTO t1 VALUES (_utf32 0x0241),(_utf32 0x0242); +INSERT INTO t1 VALUES (_utf32 0x0243),(_utf32 0x0244); +INSERT INTO t1 VALUES (_utf32 0x0245),(_utf32 0x0246); +INSERT INTO t1 VALUES (_utf32 0x0247),(_utf32 0x0248); +INSERT INTO t1 VALUES (_utf32 0x0249),(_utf32 0x024A); +INSERT INTO t1 VALUES (_utf32 0x024B),(_utf32 0x024C); +INSERT INTO t1 VALUES (_utf32 0x024D),(_utf32 0x024E); +INSERT INTO t1 VALUES (_utf32 0x024F),(_utf32 0x026B); +INSERT INTO t1 VALUES (_utf32 0x027D),(_utf32 0x0289); +INSERT INTO t1 VALUES (_utf32 0x028C); +INSERT INTO t1 VALUES (_utf32 0x037B), (_utf32 0x037C); +INSERT INTO t1 VALUES (_utf32 0x037D), (_utf32 0x03FD); +INSERT INTO t1 VALUES (_utf32 0x03FE), (_utf32 0x03FF); +INSERT INTO t1 VALUES (_utf32 0x04C0), (_utf32 0x04CF); +INSERT INTO t1 VALUES (_utf32 0x04F6), (_utf32 0x04F7); +INSERT INTO t1 VALUES (_utf32 0x04FA), (_utf32 0x04FB); +INSERT INTO t1 VALUES (_utf32 0x04FC), (_utf32 0x04FD); +INSERT INTO t1 VALUES (_utf32 0x04FE), (_utf32 0x04FF); +INSERT INTO t1 VALUES (_utf32 0x0510), (_utf32 0x0511); +INSERT INTO t1 VALUES (_utf32 0x0512), (_utf32 0x0513); +INSERT INTO t1 VALUES (_utf32 0x10A0), (_utf32 0x10A1); +INSERT INTO t1 VALUES (_utf32 0x10A2), (_utf32 0x10A3); +INSERT INTO t1 VALUES (_utf32 0x10A4), (_utf32 0x10A5); +INSERT INTO t1 VALUES (_utf32 0x10A6), (_utf32 0x10A7); +INSERT INTO t1 VALUES (_utf32 0x2D00), (_utf32 0x2D01); +INSERT INTO t1 VALUES (_utf32 0x2D02), (_utf32 0x2D03); +INSERT INTO t1 VALUES (_utf32 0x2D04), (_utf32 0x2D05); +INSERT INTO t1 VALUES (_utf32 0x2D06), (_utf32 0x2D07); +INSERT INTO t1 VALUES (_utf32 0x1D7D); +INSERT INTO t1 VALUES (_utf32 0x2132),(_utf32 0x214E); +INSERT INTO t1 VALUES (_utf32 0x2183),(_utf32 0x2184); +INSERT INTO t1 VALUES (_utf32 0x2C80), (_utf32 0x2C81); +INSERT INTO t1 VALUES (_utf32 0x2C82), (_utf32 0x2C83); +INSERT INTO t1 VALUES (_utf32 0x2C84), (_utf32 0x2C85); +INSERT INTO t1 VALUES (_utf32 0x2C86), (_utf32 0x2C87); +INSERT INTO t1 VALUES (_utf32 0x2C88), (_utf32 0x2C89); +INSERT INTO t1 VALUES (_utf32 0x2C8A), (_utf32 0x2C8B); +INSERT INTO t1 VALUES (_utf32 0x2C8C), (_utf32 0x2C8D); +INSERT INTO t1 VALUES (_utf32 0x2C8E), (_utf32 0x2C8F); +INSERT INTO t1 VALUES (_utf32 0x2C60), (_utf32 0x2C61); +INSERT INTO t1 VALUES (_utf32 0x2C62), (_utf32 0x2C63); +INSERT INTO t1 VALUES (_utf32 0x2C64), (_utf32 0x2C65); +INSERT INTO t1 VALUES (_utf32 0x2C66), (_utf32 0x2C67); +INSERT INTO t1 VALUES (_utf32 0x2C68), (_utf32 0x2C69); +INSERT INTO t1 VALUES (_utf32 0x2C6A), (_utf32 0x2C6B); +INSERT INTO t1 VALUES (_utf32 0x2C6C), (_utf32 0x2C75); +INSERT INTO t1 VALUES (_utf32 0x2C76); +INSERT INTO t1 VALUES (_utf32 0x2C00), (_utf32 0x2C01); +INSERT INTO t1 VALUES (_utf32 0x2C02), (_utf32 0x2C03); +INSERT INTO t1 VALUES (_utf32 0x2C04), (_utf32 0x2C05); +INSERT INTO t1 VALUES (_utf32 0x2C06), (_utf32 0x2C07); +INSERT INTO t1 VALUES (_utf32 0x2C30), (_utf32 0x2C31); +INSERT INTO t1 VALUES (_utf32 0x2C32), (_utf32 0x2C33); +INSERT INTO t1 VALUES (_utf32 0x2C34), (_utf32 0x2C35); +INSERT INTO t1 VALUES (_utf32 0x2C36), (_utf32 0x2C37); +INSERT INTO t1 VALUES (_utf32 0x10400), (_utf32 0x10401); +INSERT INTO t1 VALUES (_utf32 0x10402), (_utf32 0x10403); +INSERT INTO t1 VALUES (_utf32 0x10404), (_utf32 0x10405); +INSERT INTO t1 VALUES (_utf32 0x10406), (_utf32 0x10407); +INSERT INTO t1 VALUES (_utf32 0x10428), (_utf32 0x10429); +INSERT INTO t1 VALUES (_utf32 0x1042A), (_utf32 0x1042B); +INSERT INTO t1 VALUES (_utf32 0x1042C), (_utf32 0x1042D); +INSERT INTO t1 VALUES (_utf32 0x1042E), (_utf32 0x1042F); +INSERT INTO t1 VALUES (_utf32 0x0370); +INSERT INTO t1 VALUES (_utf32 0x0371); +INSERT INTO t1 VALUES (_utf32 0x0372); +INSERT INTO t1 VALUES (_utf32 0x0373); +INSERT INTO t1 VALUES (_utf32 0x0514); +INSERT INTO t1 VALUES (_utf32 0x0515); +INSERT INTO t1 VALUES (_utf32 0x0516); +INSERT INTO t1 VALUES (_utf32 0x0517); +INSERT INTO t1 VALUES (_utf32 0xA640); +INSERT INTO t1 VALUES (_utf32 0xA641); +INSERT INTO t1 VALUES (_utf32 0xA642); +INSERT INTO t1 VALUES (_utf32 0xA643); +INSERT INTO t1 VALUES (_utf32 0xA722); +INSERT INTO t1 VALUES (_utf32 0xA723); +INSERT INTO t1 VALUES (_utf32 0xA724); +INSERT INTO t1 VALUES (_utf32 0xA725); +INSERT INTO t1 VALUES (_utf32 0xA726); +INSERT INTO t1 VALUES (_utf32 0xA727); +INSERT INTO t1 VALUES (_utf32 0xA728); +INSERT INTO t1 VALUES (_utf32 0xA729); +INSERT INTO t1 VALUES (_utf32 0xA72A); +INSERT INTO t1 VALUES (_utf32 0xA72B); +INSERT INTO t1 VALUES (_utf32 0x2CEB); +INSERT INTO t1 VALUES (_utf32 0x2CEC); +INSERT INTO t1 VALUES (_utf32 0x2CED); +INSERT INTO t1 VALUES (_utf32 0x2CEE); +INSERT INTO t1 VALUES (_utf32 0x1FA01); +INSERT INTO t1 VALUES (_utf32 0x1FB01); +INSERT INTO t1 VALUES (_utf32 0x1FC01); +INSERT INTO t1 VALUES (_utf32 0x1FD01); +INSERT INTO t1 VALUES (_utf32 0x1F603); +INSERT INTO t1 VALUES (_utf32 0x1F604); +INSERT INTO t1 VALUES (_utf32 0x1F648); +INSERT INTO t1 VALUES (_utf32 0x1F64F); +INSERT INTO t1 VALUES (_utf32 0x2B759); +INSERT INTO t1 VALUES (_utf32 0x2B760); +INSERT INTO t1 VALUES (_utf32 0x2B761); +INSERT INTO t1 VALUES (_utf32 0x2B762); +INSERT INTO t1 VALUES (_utf32 0x16F00); +INSERT INTO t1 VALUES (_utf32 0x16F01); +INSERT INTO t1 VALUES (_utf32 0x08A2); +INSERT INTO t1 VALUES (_utf32 0x08A3); +INSERT INTO t1 VALUES (_utf32 0xA794); +INSERT INTO t1 VALUES (_utf32 0xA795); +INSERT INTO t1 VALUES (_utf32 0xA796); +INSERT INTO t1 VALUES (_utf32 0xA797); +INSERT INTO t1 VALUES (_utf32 0xAB37); +INSERT INTO t1 VALUES (_utf32 0xAB38); +INSERT INTO t1 VALUES (_utf32 0x10600); +INSERT INTO t1 VALUES (_utf32 0x10601); +INSERT INTO t1 VALUES (_utf32 0x10602); +INSERT INTO t1 VALUES (_utf32 0x10603); +INSERT INTO t1 VALUES (_utf32 0x1F800); +INSERT INTO t1 VALUES (_utf32 0x1F801); +INSERT INTO t1 VALUES (_utf32 0x1F802); +INSERT INTO t1 VALUES (_utf32 0x1F803); +INSERT INTO t1 VALUES (_utf32 0x10C92); +INSERT INTO t1 VALUES (_utf32 0x10C93); +INSERT INTO t1 VALUES (_utf32 0x10C94); +INSERT INTO t1 VALUES (_utf32 0x10C95); +INSERT INTO t1 VALUES (_utf32 0x2B836); +INSERT INTO t1 VALUES (_utf32 0x2B837); +INSERT INTO t1 VALUES (_utf32 0x2B838); +INSERT INTO t1 VALUES (_utf32 0x2B839); +SELECT hex(c), hex(lower(c)), hex(upper(c)), hex(weight_string(c)), c +FROM t1 ORDER BY c, BINARY c; +hex(c) hex(lower(c)) hex(upper(c)) hex(weight_string(c)) c +F09F9883 F09F9883 F09F9883 15FE0000002000000002 😃 +F09F9884 F09F9884 F09F9884 15FF0000002000000002 😄 +F09F9988 F09F9988 F09F9988 16430000002000000002 🙈 +F09F998F F09F998F F09F998F 164A0000002000000002 🙏 +F09FA080 F09FA080 F09FA080 17AB0000002000000002 🠀 +F09FA081 F09FA081 F09FA081 17AC0000002000000002 🠁 +F09FA082 F09FA082 F09FA082 17AD0000002000000002 🠂 +F09FA083 F09FA083 F09FA083 17AE0000002000000002 🠃 +E2B1A5 E2B1A5 C8BA 1C4C0000002000000002 ⱥ +C8BA C8BA 1C4C0000002000000008 Ⱥ +C680 C680 C983 1C680000002000000002 ƀ +C983 C680 C983 1C680000002000000008 Ƀ +EA9E97 EA9E97 EA9E96 1C6F0000002000000002 ꞗ +EA9E96 EA9E97 EA9E96 1C6F0000002000000008 Ꞗ +C8BC C8BC C8BB 1C7F0000002000000002 ȼ +C8BB C8BC C8BB 1C7F0000002000000008 Ȼ +EA9E94 EA9E94 EA9E94 1C840000002000000002 ꞔ +E28684 E28684 E28683 1C8D0000002000000002 ↄ +E28683 E28684 E28683 1C8D0000002000000008 Ↄ +C987 C987 C986 1CB10000002000000002 ɇ +C986 C987 C986 1CB10000002000000008 Ɇ +E2858E E2858E E284B2 1CF20000002000000002 ⅎ +E284B2 E2858E E284B2 1CF20000002000000008 Ⅎ +EA9E95 EA9E95 EA9E95 1D240000002000000002 ꞕ +E2B1A8 E2B1A8 E2B1A7 1D290000002000000002 ⱨ +E2B1A7 E2B1A8 E2B1A7 1D290000002000000008 Ⱨ +E2B1B6 E2B1B6 E2B1B5 1D2A0000002000000002 ⱶ +E2B1B5 E2B1B6 E2B1B5 1D2A0000002000000008 Ⱶ +EA9CA7 EA9CA7 EA9CA6 1D2B0000002000000002 ꜧ +EA9CA6 EA9CA7 EA9CA6 1D2B0000002000000008 Ꜧ +C989 C989 C988 1D550000002000000002 ɉ +C988 C989 C988 1D550000002000000008 Ɉ +E2B1AA E2B1AA E2B1A9 1D6F0000002000000002 ⱪ +E2B1A9 E2B1AA E2B1A9 1D6F0000002000000008 Ⱪ +C8BD C69A C8BD 1D820000002000000008 Ƚ +E2B1A1 E2B1A1 E2B1A0 1D860000002000000002 ⱡ +E2B1A0 E2B1A1 E2B1A0 1D860000002000000008 Ⱡ +C9AB C9AB 1D870000002000000002 ɫ +E2B1A2 C9AB E2B1A2 1D870000002000000008 Ɫ +EAACB8 EAACB8 EAACB8 1D8B0000002000000002 ꬸ +EAACB7 EAACB7 EAACB7 1D910000002000000002 ꬷ +E1B5BD E1B5BD E2B1A3 1E110000002000000002 ᵽ +E2B1A3 E1B5BD E2B1A3 1E110000002000000008 Ᵽ +C98B C98B C98A 1E2B0000002000000002 ɋ +C98A C98B C98A 1E2B0000002000000008 Ɋ +C98D C98D C98C 1E3F0000002000000002 ɍ +C98C C98D C98C 1E3F0000002000000008 Ɍ +C9BD C9BD 1E570000002000000002 ɽ +E2B1A4 C9BD E2B1A4 1E570000002000000008 Ɽ +EA9CA9 EA9CA9 EA9CA8 1E951F21000000200020000000040004 ꜩ +EA9CA8 EA9CA9 EA9CA8 1E951F210000002000200000000A0004 Ꜩ +E2B1A6 E2B1A6 C8BE 1E9E0000002000000002 ⱦ +C8BE C8BE 1E9E0000002000000008 Ⱦ +CA89 CA89 C984 1EC00000002000000002 ʉ +C984 CA89 C984 1EC00000002000000008 Ʉ +CA8C CA8C C985 1EF10000002000000002 ʌ +C985 CA8C C985 1EF10000002000000008 Ʌ +C98F C98F C98E 1F130000002000000002 ɏ +C98E C98F C98E 1F130000002000000008 Ɏ +E2B1AC E2B1AC E2B1AB 1F3C0000002000000002 ⱬ +E2B1AB E2B1AC E2B1AB 1F3C0000002000000008 Ⱬ +EA9CAB EA9CAB EA9CAA 1F660000002000000002 ꜫ +EA9CAA EA9CAB EA9CAA 1F660000002000000008 Ꜫ +C982 C982 C981 1F790000002000000002 ɂ +C981 C982 C981 1F790000002000000008 Ɂ +EA9CA3 EA9CA3 EA9CA2 1F810000002000000002 ꜣ +EA9CA2 EA9CA3 EA9CA2 1F810000002000000008 Ꜣ +EA9CA5 EA9CA5 EA9CA4 1F8C0000002000000002 ꜥ +EA9CA4 EA9CA5 EA9CA4 1F8C0000002000000008 Ꜥ +CDB1 CDB1 CDB0 1FC30000002000000002 ͱ +CDB0 CDB1 CDB0 1FC30000002000000008 Ͱ +CDBC CDBC CFBE 1FD80000002000000002 ͼ +CFBE CDBC CFBE 1FD80000002000000008 Ͼ +CDBB CDBB CFBD 1FD90000002000000002 ͻ +CFBD CDBB CFBD 1FD90000002000000008 Ͻ +CDBD CDBD CFBF 1FDA0000002000000002 ͽ +CFBF CDBD CFBF 1FDA0000002000000008 Ͽ +CDB3 CDB3 CDB2 1FE40000002000000002 ͳ +CDB2 CDB3 CDB2 1FE40000002000000008 Ͳ +E2B281 E2B281 E2B280 1FE60000002000000002 ⲁ +E2B280 E2B281 E2B280 1FE60000002000000008 Ⲁ +E2B283 E2B283 E2B282 1FE70000002000000002 ⲃ +E2B282 E2B283 E2B282 1FE70000002000000008 Ⲃ +E2B285 E2B285 E2B284 1FE80000002000000002 ⲅ +E2B284 E2B285 E2B284 1FE80000002000000008 Ⲅ +E2B287 E2B287 E2B286 1FE90000002000000002 ⲇ +E2B286 E2B287 E2B286 1FE90000002000000008 Ⲇ +E2B289 E2B289 E2B288 1FEA0000002000000002 ⲉ +E2B288 E2B289 E2B288 1FEA0000002000000008 Ⲉ +E2B28B E2B28B E2B28A 1FEC0000002000000002 ⲋ +E2B28A E2B28B E2B28A 1FEC0000002000000008 Ⲋ +E2B28D E2B28D E2B28C 1FED0000002000000002 ⲍ +E2B28C E2B28D E2B28C 1FED0000002000000008 Ⲍ +E2B28F E2B28F E2B28E 1FEE0000002000000002 ⲏ +E2B28E E2B28F E2B28E 1FEE0000002000000008 Ⲏ +E2B3AC E2B3AC E2B3AB 20060000002000000002 ⳬ +E2B3AB E2B3AC E2B3AB 20060000002000000008 Ⳬ +E2B3AE E2B3AE E2B3AD 20160000002000000002 ⳮ +E2B3AD E2B3AE E2B3AD 20160000002000000008 Ⳮ +D3BB D3BB D3BA 203E0000002000000002 ӻ +D3BA D3BB D3BA 203E0000002000000008 Ӻ +D3B7 D3B7 D3B6 20460000002000000002 ӷ +D3B6 D3B7 D3B6 20460000002000000008 Ӷ +EA9981 EA9981 EA9980 20700000002000000002 ꙁ +EA9980 EA9981 EA9980 20700000002000000008 Ꙁ +D491 D491 D490 20720000002000000002 ԑ +D490 D491 D490 20720000002000000008 Ԑ +EA9983 EA9983 EA9982 20730000002000000002 ꙃ +EA9982 EA9983 EA9982 20730000002000000008 Ꙃ +D493 D493 D492 20BA0000002000000002 ԓ +D492 D493 D492 20BA0000002000000008 Ԓ +D495 D495 D494 20C20000002000000002 ԕ +D494 D495 D494 20C20000002000000008 Ԕ +D497 D497 D496 21040000002000000002 ԗ +D496 D497 D496 21040000002000000008 Ԗ +D3BD D3BD D3BC 21360000002000000002 ӽ +D3BC D3BD D3BC 21360000002000000008 Ӽ +D3BF D3BF D3BE 213A0000002000000002 ӿ +D3BE D3BF D3BE 213A0000002000000008 Ӿ +D38F D38F D380 21E10000002000000002 ӏ +D380 D38F D380 21E10000002000000008 Ӏ +E2B0B0 E2B0B0 E2B080 21E50000002000000002 ⰰ +E2B080 E2B0B0 E2B080 21E50000002000000008 Ⰰ +E2B0B1 E2B0B1 E2B081 21E60000002000000002 ⰱ +E2B081 E2B0B1 E2B081 21E60000002000000008 Ⰱ +E2B0B2 E2B0B2 E2B082 21E70000002000000002 ⰲ +E2B082 E2B0B2 E2B082 21E70000002000000008 Ⰲ +E2B0B3 E2B0B3 E2B083 21E80000002000000002 ⰳ +E2B083 E2B0B3 E2B083 21E80000002000000008 Ⰳ +E2B0B4 E2B0B4 E2B084 21E90000002000000002 ⰴ +E2B084 E2B0B4 E2B084 21E90000002000000008 Ⰴ +E2B0B5 E2B0B5 E2B085 21EA0000002000000002 ⰵ +E2B085 E2B0B5 E2B085 21EA0000002000000008 Ⰵ +E2B0B6 E2B0B6 E2B086 21EB0000002000000002 ⰶ +E2B086 E2B0B6 E2B086 21EB0000002000000008 Ⰶ +E2B0B7 E2B0B7 E2B087 21EC0000002000000002 ⰷ +E2B087 E2B0B7 E2B087 21EC0000002000000008 Ⰷ +E2B480 E2B480 E182A0 223B0000002000000002 ⴀ +E182A0 E2B480 E182A0 223B0000002000000008 Ⴀ +E2B481 E2B481 E182A1 223D0000002000000002 ⴁ +E182A1 E2B481 E182A1 223D0000002000000008 Ⴁ +E2B482 E2B482 E182A2 223F0000002000000002 ⴂ +E182A2 E2B482 E182A2 223F0000002000000008 Ⴂ +E2B483 E2B483 E182A3 22410000002000000002 ⴃ +E182A3 E2B483 E182A3 22410000002000000008 Ⴃ +E2B484 E2B484 E182A4 22430000002000000002 ⴄ +E182A4 E2B484 E182A4 22430000002000000008 Ⴄ +E2B485 E2B485 E182A5 22450000002000000002 ⴅ +E182A5 E2B485 E182A5 22450000002000000008 Ⴅ +E2B486 E2B486 E182A6 22470000002000000002 ⴆ +E182A6 E2B486 E182A6 22470000002000000008 Ⴆ +E2B487 E2B487 E182A7 224B0000002000000002 ⴇ +E182A7 E2B487 E182A7 224B0000002000000008 Ⴇ +E0A2A2 E0A2A2 E0A2A2 232B0000002000000002 ࢢ +E0A2A3 E0A2A3 E0A2A3 236D0000002000000002 ࢣ +F090B292 F090B392 F090B292 37120000002000000008 𐲒 +F090B293 F090B393 F090B293 37130000002000000008 𐲓 +F090B294 F090B394 F090B294 37140000002000000008 𐲔 +F090B295 F090B395 F090B295 37150000002000000008 𐲕 +F096BC80 F096BC80 F096BC80 427A0000002000000002 𖼀 +F096BC81 F096BC81 F096BC81 427B0000002000000002 𖼁 +F09090A8 F09090A8 F0909080 44520000002000000002 𐐨 +F0909080 F09090A8 F0909080 44520000002000000008 𐐀 +F09090A9 F09090A9 F0909081 44530000002000000002 𐐩 +F0909081 F09090A9 F0909081 44530000002000000008 𐐁 +F09090AA F09090AA F0909082 44540000002000000002 𐐪 +F0909082 F09090AA F0909082 44540000002000000008 𐐂 +F09090AB F09090AB F0909083 44550000002000000002 𐐫 +F0909083 F09090AB F0909083 44550000002000000008 𐐃 +F09090AC F09090AC F0909084 44560000002000000002 𐐬 +F0909084 F09090AC F0909084 44560000002000000008 𐐄 +F09090AD F09090AD F0909085 44570000002000000002 𐐭 +F0909085 F09090AD F0909085 44570000002000000008 𐐅 +F09090AE F09090AE F0909086 44580000002000000002 𐐮 +F0909086 F09090AE F0909086 44580000002000000008 𐐆 +F09090AF F09090AF F0909087 44590000002000000002 𐐯 +F0909087 F09090AF F0909087 44590000002000000008 𐐇 +F0909880 F0909880 F0909880 46BA0000002000000002 𐘀 +F0909881 F0909881 F0909881 46BB0000002000000002 𐘁 +F0909882 F0909882 F0909882 46BC0000002000000002 𐘂 +F0909883 F0909883 F0909883 46BD0000002000000002 𐘃 +F0AB9D99 F0AB9D99 F0AB9D99 FB85B7590000002000000002 𫝙 +F0AB9DA0 F0AB9DA0 F0AB9DA0 FB85B7600000002000000002 𫝠 +F0AB9DA1 F0AB9DA1 F0AB9DA1 FB85B7610000002000000002 𫝡 +F0AB9DA2 F0AB9DA2 F0AB9DA2 FB85B7620000002000000002 𫝢 +F0ABA0B6 F0ABA0B6 F0ABA0B6 FB85B8360000002000000002 𫠶 +F0ABA0B7 F0ABA0B7 F0ABA0B7 FB85B8370000002000000002 𫠷 +F0ABA0B8 F0ABA0B8 F0ABA0B8 FB85B8380000002000000002 𫠸 +F0ABA0B9 F0ABA0B9 F0ABA0B9 FB85B8390000002000000002 𫠹 +F09FA881 F09FA881 F09FA881 FBC3FA010000002000000002 🨁 +F09FAC81 F09FAC81 F09FAC81 FBC3FB010000002000000002 🬁 +F09FB081 F09FB081 F09FB081 FBC3FC010000002000000002 🰁 +F09FB481 F09FB481 F09FB481 FBC3FD010000002000000002 🴁 +INSERT INTO t1 VALUES ('a'); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0xFFFF)); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0x10FFFF)); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0x10400)); +SELECT hex(c), hex(weight_string(c)) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +hex(c) hex(weight_string(c)) +61 1C470000002000000002 +61F0909080 1C474452000000200020000000020008 +61EFBFBF 1C47FBC1FFFF000000200020000000020002 +61F48FBFBF 1C47FBE1FFFF000000200020000000020002 +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10400 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +F0909080 44520000002000000008 𐐀 +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10428 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +F09090A8 44520000002000000002 𐐨 +ALTER TABLE t1 ADD KEY(c); +EXPLAIN SELECT hex(c) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range c c 43 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select hex(`test`.`t1`.`c`) AS `hex(c)` from `test`.`t1` where (`test`.`t1`.`c` like 'a%') order by `test`.`t1`.`c` +SELECT hex(c), hex(weight_string(c)) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +hex(c) hex(weight_string(c)) +61 1C470000002000000002 +61F0909080 1C474452000000200020000000020008 +61EFBFBF 1C47FBC1FFFF000000200020000000020002 +61F48FBFBF 1C47FBE1FFFF000000200020000000020002 +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10400 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +F0909080 44520000002000000008 𐐀 +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10428 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +F09090A8 44520000002000000002 𐐨 +DROP TABLE t1; +SELECT 'a' = 'a '; +'a' = 'a ' +0 +SELECT 'a\0' < 'a'; +'a\0' < 'a' +0 +SELECT 'a\0' < 'a '; +'a\0' < 'a ' +1 +SELECT 'a\t' < 'a'; +'a\t' < 'a' +0 +SELECT 'a\t' < 'a '; +'a\t' < 'a ' +1 +SELECT 'a' LIKE 'a'; +'a' LIKE 'a' +1 +SELECT 'A' LIKE 'a'; +'A' LIKE 'a' +0 +SELECT _utf8mb4 0xD0B0D0B1D0B2 LIKE CONCAT(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4 '%'); +_utf8mb4 0xD0B0D0B1D0B2 LIKE CONCAT(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4 '%') +1 +SELECT is_ipv4(inet_ntoa('1')); +is_ipv4(inet_ntoa('1')) +1 +SELECT is_ipv6(inet_ntoa('1')); +is_ipv6(inet_ntoa('1')) +0 +SELECT inet6_aton(inet_ntoa('1')); +inet6_aton(inet_ntoa('1')) + +SELECT inet6_ntoa(inet_ntoa('1')); +inet6_ntoa(inet_ntoa('1')) +NULL +# +# Bug#14040277 UNINITIALIZED VALUE REFERENCED IN STR_TO_IPV6 +# +SELECT inet6_aton(soundex('a')); +inet6_aton(soundex('a')) +NULL +# +# Bug#19047425 UNINITIALISED VALUE IN STR_TO_IPV6 +# +do is_ipv4_mapped(inet6_aton(convert(_ascii "a:" using utf8mb4))); +CREATE TABLE t1 (c VARCHAR(10) CHARACTER SET utf8mb4); +INSERT INTO t1 VALUES (_utf8mb4 0xF09090A7), (_utf8mb4 0xEA8B93), (_utf8mb4 0xC4BC), (_utf8mb4 0xC6AD), (_utf8mb4 0xF090918F), (_utf8mb4 0xEAAD8B); +SELECT HEX(ANY_VALUE(c)), COUNT(c) FROM t1 GROUP BY c COLLATE utf8mb4_0900_as_cs; +HEX(ANY_VALUE(c)) COUNT(c) +C4BC 1 +C6AD 1 +EA8B93 1 +EAAD8B 1 +F09090A7 1 +F090918F 1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10)) COLLATE utf8mb4_0900_as_cs; +INSERT INTO t1 VALUES(_utf16 0xAC00, _utf16 0x326E), (_utf16 0xAD, _utf16 0xA0), +(_utf16 0xC6, _utf16 0x41), (_utf16 0xC6, _utf16 0xAA), (_utf16 0xA73A, _utf16 0xA738); +SELECT a = b FROM t1; +a = b +0 +0 +0 +0 +0 +DROP TABLE t1; +SET NAMES utf8mb4; +CREATE TABLE t1 (c1 CHAR(10) COLLATE utf8mb4_0900_as_cs); +insert into t1 values ('A'),('a'); +insert into t1 values ('B'),('b'); +insert into t1 values ('C'),('c'); +insert into t1 values ('D'),('d'); +insert into t1 values ('E'),('e'); +insert into t1 values ('F'),('f'); +insert into t1 values ('G'),('g'); +insert into t1 values ('H'),('h'); +insert into t1 values ('I'),('i'); +insert into t1 values ('J'),('j'); +insert into t1 values ('K'),('k'); +insert into t1 values ('L'),('l'); +insert into t1 values ('M'),('m'); +insert into t1 values ('N'),('n'); +insert into t1 values ('O'),('o'); +insert into t1 values ('P'),('p'); +insert into t1 values ('Q'),('q'); +insert into t1 values ('R'),('r'); +insert into t1 values ('S'),('s'); +insert into t1 values ('T'),('t'); +insert into t1 values ('U'),('u'); +insert into t1 values ('V'),('v'); +insert into t1 values ('W'),('w'); +insert into t1 values ('X'),('x'); +insert into t1 values ('Y'),('y'); +insert into t1 values ('Z'),('z'); +insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0); +insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1); +insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2); +insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3); +insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4); +insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5); +insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6); +insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7); +insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8); +insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9); +insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca); +insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb); +insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc); +insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd); +insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce); +insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf); +insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0); +insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1); +insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2); +insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3); +insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4); +insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5); +insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6); +insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7); +insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8); +insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9); +insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da); +insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db); +insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc); +insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd); +insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de); +insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df); +insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103); +insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107); +insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b); +insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f); +insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113); +insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117); +insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b); +insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f); +insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123); +insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127); +insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b); +insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f); +insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133); +insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137); +insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b); +insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f); +insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143); +insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147); +insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b); +insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f); +insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153); +insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157); +insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b); +insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f); +insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163); +insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167); +insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b); +insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f); +insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173); +insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177); +insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b); +insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f); +insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183); +insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187); +insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b); +insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f); +insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193); +insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197); +insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b); +insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f); +insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3); +insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7); +insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab); +insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af); +insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3); +insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7); +insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb); +insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf); +insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3); +insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7); +insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb); +insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf); +insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3); +insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7); +insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db); +insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df); +insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3); +insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7); +insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb); +insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef); +insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3); +insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7); +insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb); +insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff); +INSERT INTO t1 VALUES (_ucs2 0x1EA0),(_ucs2 0x1EA1),(_ucs2 0x1EA2),(_ucs2 0x1EA3); +INSERT INTO t1 VALUES (_ucs2 0x1EA4),(_ucs2 0x1EA5),(_ucs2 0x1EA6),(_ucs2 0x1EA7); +INSERT INTO t1 VALUES (_ucs2 0x1EA8),(_ucs2 0x1EA9),(_ucs2 0x1EAA),(_ucs2 0x1EAB); +INSERT INTO t1 VALUES (_ucs2 0x1EAC),(_ucs2 0x1EAD),(_ucs2 0x1EAE),(_ucs2 0x1EAF); +INSERT INTO t1 VALUES (_ucs2 0x1EB0),(_ucs2 0x1EB1),(_ucs2 0x1EB2),(_ucs2 0x1EB3); +INSERT INTO t1 VALUES (_ucs2 0x1EB4),(_ucs2 0x1EB5),(_ucs2 0x1EB6),(_ucs2 0x1EB7); +INSERT INTO t1 VALUES (_ucs2 0x1EB8),(_ucs2 0x1EB9),(_ucs2 0x1EBA),(_ucs2 0x1EBB); +INSERT INTO t1 VALUES (_ucs2 0x1EBC),(_ucs2 0x1EBD),(_ucs2 0x1EBE),(_ucs2 0x1EBF); +INSERT INTO t1 VALUES (_ucs2 0x1EC0),(_ucs2 0x1EC1),(_ucs2 0x1EC2),(_ucs2 0x1EC3); +INSERT INTO t1 VALUES (_ucs2 0x1EC4),(_ucs2 0x1EC5),(_ucs2 0x1EC6),(_ucs2 0x1EC7); +INSERT INTO t1 VALUES (_ucs2 0x1EC8),(_ucs2 0x1EC9),(_ucs2 0x1ECA),(_ucs2 0x1ECB); +INSERT INTO t1 VALUES (_ucs2 0x1ECC),(_ucs2 0x1ECD),(_ucs2 0x1ECE),(_ucs2 0x1ECF); +INSERT INTO t1 VALUES (_ucs2 0x1ED0),(_ucs2 0x1ED1),(_ucs2 0x1ED2),(_ucs2 0x1ED3); +INSERT INTO t1 VALUES (_ucs2 0x1ED4),(_ucs2 0x1ED5),(_ucs2 0x1ED6),(_ucs2 0x1ED7); +INSERT INTO t1 VALUES (_ucs2 0x1ED8),(_ucs2 0x1ED9),(_ucs2 0x1EDA),(_ucs2 0x1EDB); +INSERT INTO t1 VALUES (_ucs2 0x1EDC),(_ucs2 0x1EDD),(_ucs2 0x1EDE),(_ucs2 0x1EDF); +INSERT INTO t1 VALUES (_ucs2 0x1EE0),(_ucs2 0x1EE1),(_ucs2 0x1EE2),(_ucs2 0x1EE3); +INSERT INTO t1 VALUES (_ucs2 0x1EE4),(_ucs2 0x1EE5),(_ucs2 0x1EE6),(_ucs2 0x1EE7); +INSERT INTO t1 VALUES (_ucs2 0x1EE8),(_ucs2 0x1EE9),(_ucs2 0x1EEA),(_ucs2 0x1EEB); +INSERT INTO t1 VALUES (_ucs2 0x1EEC),(_ucs2 0x1EED),(_ucs2 0x1EEE),(_ucs2 0x1EEF); +INSERT INTO t1 VALUES (_ucs2 0x1EF0),(_ucs2 0x1EF1); +insert into t1 values ('AA'),('Aa'),('aa'),('aA'); +insert into t1 values ('AE'),('Ae'),('ae'),('aE'); +insert into t1 values ('CH'),('Ch'),('ch'),('cH'); +insert into t1 values ('DZ'),('Dz'),('dz'),('dZ'); +insert into t1 values ('DŽ'),('Dž'),('dž'),('dŽ'); +insert into t1 values ('IJ'),('Ij'),('ij'),('iJ'); +insert into t1 values ('LJ'),('Lj'),('lj'),('lJ'); +insert into t1 values ('LL'),('Ll'),('ll'),('lL'); +insert into t1 values ('NJ'),('Nj'),('nj'),('nJ'); +insert into t1 values ('OE'),('Oe'),('oe'),('oE'); +insert into t1 values ('SS'),('Ss'),('ss'),('sS'); +insert into t1 values ('RR'),('Rr'),('rr'),('rR'); +insert into t1 values (_ucs2 0x0218), (_ucs2 0x0219), (_ucs2 0x021a), (_ucs2 0x021b); +insert into t1 values (_ucs2 0x0d96), (_ucs2 0x0da4), (_ucs2 0x0da5); +insert into t1 values (_ucs2 0x0064017e), (_ucs2 0x0044017e), (_ucs2 0x0044017d); +insert into t1 values ('CS'),('Cs'),('cs'),('cS'); +insert into t1 values ('DZS'),('DZs'),('Dzs'),('DzS'); +insert into t1 values ('dZS'),('dZs'),('dzs'),('dzS'); +insert into t1 values ('GY'),('Gy'),('gy'),('gY'); +insert into t1 values ('LY'),('Ly'),('ly'),('lY'); +insert into t1 values ('NY'),('Ny'),('ny'),('nY'); +insert into t1 values ('SZ'),('Sz'),('sz'),('sZ'); +insert into t1 values ('TY'),('Ty'),('ty'),('tY'); +insert into t1 values ('ZS'),('Zs'),('zs'),('zS'); +insert into t1 values ('RR'),('Rr'),('rr'),('rR'); +insert into t1 values ('ccs'),('Ccs'),('CCS'),('cCS'); +insert into t1 values ('ddz'),('Ddz'),('DDZ'),('dDZ'); +insert into t1 values ('ddzs'),('Ddzs'),('DDZS'),('dDZS'); +insert into t1 values ('ggy'),('Ggy'),('GGY'),('gGY'); +insert into t1 values ('lly'),('Lly'),('LLY'),('lLY'); +insert into t1 values ('nny'),('Nny'),('NNY'),('nNY'); +insert into t1 values ('ssz'),('Ssz'),('SSZ'),('sSZ'); +insert into t1 values ('tty'),('Tty'),('TTY'),('tTY'); +insert into t1 values ('zzs'),('Zzs'),('ZZS'),('zZS'); +insert into t1 values ('UE'),('Ue'),('ue'),('uE'); +SELECT c1, hex(weight_string(c1)) FROM t1 ORDER BY c1 COLLATE utf8mb4_0900_as_cs; +c1 hex(weight_string(c1)) +÷ 06180000002000000002 +× 06190000002000000002 +a 1C470000002000000002 +A 1C470000002000000008 +á 1C47000000200024000000020002 +Á 1C47000000200024000000080002 +à 1C47000000200025000000020002 +À 1C47000000200025000000080002 +ă 1C47000000200026000000020002 +Ă 1C47000000200026000000080002 +ắ 1C4700000020002600240000000200020002 +Ắ 1C4700000020002600240000000800020002 +ằ 1C4700000020002600250000000200020002 +Ằ 1C4700000020002600250000000800020002 +ẵ 1C47000000200026002D0000000200020002 +Ẵ 1C47000000200026002D0000000800020002 +ẳ 1C47000000200026003B0000000200020002 +Ẳ 1C47000000200026003B0000000800020002 +â 1C47000000200027000000020002 + 1C47000000200027000000080002 +ấ 1C4700000020002700240000000200020002 +Ấ 1C4700000020002700240000000800020002 +ầ 1C4700000020002700250000000200020002 +Ầ 1C4700000020002700250000000800020002 +ẫ 1C47000000200027002D0000000200020002 +Ẫ 1C47000000200027002D0000000800020002 +ẩ 1C47000000200027003B0000000200020002 +Ẩ 1C47000000200027003B0000000800020002 +ǎ 1C47000000200028000000020002 +Ǎ 1C47000000200028000000080002 +å 1C47000000200029000000020002 +Å 1C47000000200029000000080002 +ǻ 1C4700000020002900240000000200020002 +Ǻ 1C4700000020002900240000000800020002 +ä 1C4700000020002B000000020002 +Ä 1C4700000020002B000000080002 +ǟ 1C4700000020002B00320000000200020002 +Ǟ 1C4700000020002B00320000000800020002 +ã 1C4700000020002D000000020002 +à 1C4700000020002D000000080002 +ǡ 1C4700000020002E00320000000200020002 +Ǡ 1C4700000020002E00320000000800020002 +ą 1C47000000200031000000020002 +Ą 1C47000000200031000000080002 +ā 1C47000000200032000000020002 +Ā 1C47000000200032000000080002 +ả 1C4700000020003B000000020002 +Ả 1C4700000020003B000000080002 +ạ 1C47000000200042000000020002 +Ạ 1C47000000200042000000080002 +ặ 1C4700000020004200260000000200020002 +Ặ 1C4700000020004200260000000800020002 +ậ 1C4700000020004200270000000200020002 +Ậ 1C4700000020004200270000000800020002 +aa 1C471C47000000200020000000020002 +aA 1C471C47000000200020000000020008 +Aa 1C471C47000000200020000000080002 +AA 1C471C47000000200020000000080008 +ae 1C471CAA000000200020000000020002 +aE 1C471CAA000000200020000000020008 +Ae 1C471CAA000000200020000000080002 +AE 1C471CAA000000200020000000080008 +æ 1C471CAA00000020011000200000000400040004 +Æ 1C471CAA00000020011000200000000A0004000A +ǽ 1C471CAA0000002001100020002400000004000400040002 +Ǽ 1C471CAA000000200110002000240000000A0004000A0002 +ǣ 1C471CAA0000002001100020003200000004000400040002 +Ǣ 1C471CAA000000200110002000320000000A0004000A0002 +b 1C600000002000000002 +B 1C600000002000000008 +ƀ 1C680000002000000002 +Ɓ 1C710000002000000008 +ƃ 1C750000002000000002 +Ƃ 1C750000002000000008 +c 1C7A0000002000000002 +C 1C7A0000002000000008 +ć 1C7A000000200024000000020002 +Ć 1C7A000000200024000000080002 +ĉ 1C7A000000200027000000020002 +Ĉ 1C7A000000200027000000080002 +č 1C7A000000200028000000020002 +Č 1C7A000000200028000000080002 +ċ 1C7A00000020002E000000020002 +Ċ 1C7A00000020002E000000080002 +ç 1C7A000000200030000000020002 +Ç 1C7A000000200030000000080002 +ccs 1C7A1C7A1E7100000020002000200000000200020002 +cCS 1C7A1C7A1E7100000020002000200000000200080008 +Ccs 1C7A1C7A1E7100000020002000200000000800020002 +CCS 1C7A1C7A1E7100000020002000200000000800080008 +ch 1C7A1D18000000200020000000020002 +cH 1C7A1D18000000200020000000020008 +Ch 1C7A1D18000000200020000000080002 +CH 1C7A1D18000000200020000000080008 +cs 1C7A1E71000000200020000000020002 +cS 1C7A1E71000000200020000000020008 +Cs 1C7A1E71000000200020000000080002 +CS 1C7A1E71000000200020000000080008 +ƈ 1C850000002000000002 +Ƈ 1C850000002000000008 +d 1C8F0000002000000002 +D 1C8F0000002000000008 +ď 1C8F000000200028000000020002 +Ď 1C8F000000200028000000080002 +đ 1C8F000000200039000000020002 +Đ 1C8F000000200039000000080002 +ð 1C8F000000200110000000040004 +Ð 1C8F0000002001100000000A0004 +ddz 1C8F1C8F1F2100000020002000200000000200020002 +dDZ 1C8F1C8F1F2100000020002000200000000200080008 +Ddz 1C8F1C8F1F2100000020002000200000000800020002 +DDZ 1C8F1C8F1F2100000020002000200000000800080008 +ddzs 1C8F1C8F1F211E710000002000200020002000000002000200020002 +dDZS 1C8F1C8F1F211E710000002000200020002000000002000800080008 +Ddzs 1C8F1C8F1F211E710000002000200020002000000008000200020002 +DDZS 1C8F1C8F1F211E710000002000200020002000000008000800080008 +dz 1C8F1F21000000200020000000020002 +dZ 1C8F1F21000000200020000000020008 +dz 1C8F1F21000000200020000000040004 +Dz 1C8F1F21000000200020000000080002 +DZ 1C8F1F21000000200020000000080008 +Dz 1C8F1F210000002000200000000A0004 +DZ 1C8F1F210000002000200000000A000A +dž 1C8F1F2100000020002000280000000200020002 +dž 1C8F1F2100000020002000280000000200020002 +dŽ 1C8F1F2100000020002000280000000200080002 +dž 1C8F1F2100000020002000280000000400040004 +Dž 1C8F1F2100000020002000280000000800020002 +Dž 1C8F1F2100000020002000280000000800020002 +DŽ 1C8F1F2100000020002000280000000800080002 +DŽ 1C8F1F2100000020002000280000000800080002 +Dž 1C8F1F2100000020002000280000000A00040004 +DŽ 1C8F1F2100000020002000280000000A000A0004 +dzs 1C8F1F211E7100000020002000200000000200020002 +dzS 1C8F1F211E7100000020002000200000000200020008 +dZs 1C8F1F211E7100000020002000200000000200080002 +dZS 1C8F1F211E7100000020002000200000000200080008 +Dzs 1C8F1F211E7100000020002000200000000800020002 +DzS 1C8F1F211E7100000020002000200000000800020008 +DZs 1C8F1F211E7100000020002000200000000800080002 +DZS 1C8F1F211E7100000020002000200000000800080008 +Ɖ 1C970000002000000008 +Ɗ 1C9B0000002000000008 +ƌ 1CA00000002000000002 +Ƌ 1CA00000002000000008 +e 1CAA0000002000000002 +E 1CAA0000002000000008 +é 1CAA000000200024000000020002 +É 1CAA000000200024000000080002 +è 1CAA000000200025000000020002 +È 1CAA000000200025000000080002 +ĕ 1CAA000000200026000000020002 +Ĕ 1CAA000000200026000000080002 +ê 1CAA000000200027000000020002 +Ê 1CAA000000200027000000080002 +ế 1CAA00000020002700240000000200020002 +Ế 1CAA00000020002700240000000800020002 +ề 1CAA00000020002700250000000200020002 +Ề 1CAA00000020002700250000000800020002 +ễ 1CAA000000200027002D0000000200020002 +Ễ 1CAA000000200027002D0000000800020002 +ể 1CAA000000200027003B0000000200020002 +Ể 1CAA000000200027003B0000000800020002 +ě 1CAA000000200028000000020002 +Ě 1CAA000000200028000000080002 +ë 1CAA00000020002B000000020002 +Ë 1CAA00000020002B000000080002 +ẽ 1CAA00000020002D000000020002 +Ẽ 1CAA00000020002D000000080002 +ė 1CAA00000020002E000000020002 +Ė 1CAA00000020002E000000080002 +ę 1CAA000000200031000000020002 +Ę 1CAA000000200031000000080002 +ē 1CAA000000200032000000020002 +Ē 1CAA000000200032000000080002 +ẻ 1CAA00000020003B000000020002 +Ẻ 1CAA00000020003B000000080002 +ẹ 1CAA000000200042000000020002 +Ẹ 1CAA000000200042000000080002 +ệ 1CAA00000020004200270000000200020002 +Ệ 1CAA00000020004200270000000800020002 +ǝ 1CB80000002000000002 +Ǝ 1CB80000002000000008 +Ə 1CBD0000002000000008 +Ɛ 1CC20000002000000008 +f 1CE50000002000000002 +F 1CE50000002000000008 +ƒ 1CEE0000002000000002 +Ƒ 1CEE0000002000000008 +g 1CF40000002000000002 +G 1CF40000002000000008 +ǵ 1CF4000000200024000000020002 +Ǵ 1CF4000000200024000000080002 +ğ 1CF4000000200026000000020002 +Ğ 1CF4000000200026000000080002 +ĝ 1CF4000000200027000000020002 +Ĝ 1CF4000000200027000000080002 +ǧ 1CF4000000200028000000020002 +Ǧ 1CF4000000200028000000080002 +ġ 1CF400000020002E000000020002 +Ġ 1CF400000020002E000000080002 +ģ 1CF4000000200030000000020002 +Ģ 1CF4000000200030000000080002 +ggy 1CF41CF41F0B00000020002000200000000200020002 +gGY 1CF41CF41F0B00000020002000200000000200080008 +Ggy 1CF41CF41F0B00000020002000200000000800020002 +GGY 1CF41CF41F0B00000020002000200000000800080008 +gy 1CF41F0B000000200020000000020002 +gY 1CF41F0B000000200020000000020008 +Gy 1CF41F0B000000200020000000080002 +GY 1CF41F0B000000200020000000080008 +ǥ 1D010000002000000002 +Ǥ 1D010000002000000008 +Ɠ 1D060000002000000008 +Ɣ 1D100000002000000008 +ƣ 1D140000002000000002 +Ƣ 1D140000002000000008 +h 1D180000002000000002 +H 1D180000002000000008 +ĥ 1D18000000200027000000020002 +Ĥ 1D18000000200027000000080002 +ħ 1D18000000200039000000020002 +Ħ 1D18000000200039000000080002 +ƕ 1D200000002000000002 +Ƕ 1D200000002000000008 +i 1D320000002000000002 +I 1D320000002000000008 +í 1D32000000200024000000020002 +Í 1D32000000200024000000080002 +ì 1D32000000200025000000020002 +Ì 1D32000000200025000000080002 +ĭ 1D32000000200026000000020002 +Ĭ 1D32000000200026000000080002 +î 1D32000000200027000000020002 +Î 1D32000000200027000000080002 +ǐ 1D32000000200028000000020002 +Ǐ 1D32000000200028000000080002 +ï 1D3200000020002B000000020002 +Ï 1D3200000020002B000000080002 +ĩ 1D3200000020002D000000020002 +Ĩ 1D3200000020002D000000080002 +İ 1D3200000020002E000000080002 +į 1D32000000200031000000020002 +Į 1D32000000200031000000080002 +ī 1D32000000200032000000020002 +Ī 1D32000000200032000000080002 +ỉ 1D3200000020003B000000020002 +Ỉ 1D3200000020003B000000080002 +ị 1D32000000200042000000020002 +Ị 1D32000000200042000000080002 +ij 1D321D4C000000200020000000020002 +iJ 1D321D4C000000200020000000020008 +ij 1D321D4C000000200020000000040004 +Ij 1D321D4C000000200020000000080002 +IJ 1D321D4C000000200020000000080008 +IJ 1D321D4C0000002000200000000A000A +ı 1D360000002000000002 +Ɨ 1D410000002000000008 +Ɩ 1D470000002000000008 +j 1D4C0000002000000002 +J 1D4C0000002000000008 +ĵ 1D4C000000200027000000020002 +Ĵ 1D4C000000200027000000080002 +ǰ 1D4C000000200028000000020002 +k 1D650000002000000002 +K 1D650000002000000008 +ǩ 1D65000000200028000000020002 +Ǩ 1D65000000200028000000080002 +ķ 1D65000000200030000000020002 +Ķ 1D65000000200030000000080002 +ƙ 1D6B0000002000000002 +Ƙ 1D6B0000002000000008 +l 1D770000002000000002 +L 1D770000002000000008 +ĺ 1D77000000200024000000020002 +Ĺ 1D77000000200024000000080002 +ľ 1D77000000200028000000020002 +Ľ 1D77000000200028000000080002 +ļ 1D77000000200030000000020002 +Ļ 1D77000000200030000000080002 +ł 1D77000000200039000000020002 +Ł 1D77000000200039000000080002 +ŀ 1D77000000200110000000020002 +Ŀ 1D77000000200110000000080002 +lj 1D771D4C000000200020000000020002 +lJ 1D771D4C000000200020000000020008 +lj 1D771D4C000000200020000000040004 +Lj 1D771D4C000000200020000000080002 +LJ 1D771D4C000000200020000000080008 +Lj 1D771D4C0000002000200000000A0004 +LJ 1D771D4C0000002000200000000A000A +ll 1D771D77000000200020000000020002 +lL 1D771D77000000200020000000020008 +Ll 1D771D77000000200020000000080002 +LL 1D771D77000000200020000000080008 +lly 1D771D771F0B00000020002000200000000200020002 +lLY 1D771D771F0B00000020002000200000000200080008 +Lly 1D771D771F0B00000020002000200000000800020002 +LLY 1D771D771F0B00000020002000200000000800080008 +ly 1D771F0B000000200020000000020002 +lY 1D771F0B000000200020000000020008 +Ly 1D771F0B000000200020000000080002 +LY 1D771F0B000000200020000000080008 +ƚ 1D820000002000000002 +ƛ 1DA20000002000000002 +m 1DAA0000002000000002 +M 1DAA0000002000000008 +n 1DB90000002000000002 +N 1DB90000002000000008 +ń 1DB9000000200024000000020002 +Ń 1DB9000000200024000000080002 +ǹ 1DB9000000200025000000020002 +Ǹ 1DB9000000200025000000080002 +ň 1DB9000000200028000000020002 +Ň 1DB9000000200028000000080002 +ñ 1DB900000020002D000000020002 +Ñ 1DB900000020002D000000080002 +ņ 1DB9000000200030000000020002 +Ņ 1DB9000000200030000000080002 +nj 1DB91D4C000000200020000000020002 +nJ 1DB91D4C000000200020000000020008 +nj 1DB91D4C000000200020000000040004 +Nj 1DB91D4C000000200020000000080002 +NJ 1DB91D4C000000200020000000080008 +Nj 1DB91D4C0000002000200000000A0004 +NJ 1DB91D4C0000002000200000000A000A +nny 1DB91DB91F0B00000020002000200000000200020002 +nNY 1DB91DB91F0B00000020002000200000000200080008 +Nny 1DB91DB91F0B00000020002000200000000800020002 +NNY 1DB91DB91F0B00000020002000200000000800080008 +ny 1DB91F0B000000200020000000020002 +nY 1DB91F0B000000200020000000020008 +Ny 1DB91F0B000000200020000000080002 +NY 1DB91F0B000000200020000000080008 +Ɲ 1DC40000002000000008 +ƞ 1DC80000002000000002 +ŋ 1DD80000002000000002 +Ŋ 1DD80000002000000008 +o 1DDD0000002000000002 +O 1DDD0000002000000008 +ó 1DDD000000200024000000020002 +Ó 1DDD000000200024000000080002 +ò 1DDD000000200025000000020002 +Ò 1DDD000000200025000000080002 +ŏ 1DDD000000200026000000020002 +Ŏ 1DDD000000200026000000080002 +ô 1DDD000000200027000000020002 +Ô 1DDD000000200027000000080002 +ố 1DDD00000020002700240000000200020002 +Ố 1DDD00000020002700240000000800020002 +ồ 1DDD00000020002700250000000200020002 +Ồ 1DDD00000020002700250000000800020002 +ỗ 1DDD000000200027002D0000000200020002 +Ỗ 1DDD000000200027002D0000000800020002 +ổ 1DDD000000200027003B0000000200020002 +Ổ 1DDD000000200027003B0000000800020002 +ǒ 1DDD000000200028000000020002 +Ǒ 1DDD000000200028000000080002 +ö 1DDD00000020002B000000020002 +Ö 1DDD00000020002B000000080002 +ő 1DDD00000020002C000000020002 +Ő 1DDD00000020002C000000080002 +õ 1DDD00000020002D000000020002 +Õ 1DDD00000020002D000000080002 +ø 1DDD00000020002F000000020002 +Ø 1DDD00000020002F000000080002 +ǿ 1DDD00000020002F00240000000200020002 +Ǿ 1DDD00000020002F00240000000800020002 +ǫ 1DDD000000200031000000020002 +Ǫ 1DDD000000200031000000080002 +ǭ 1DDD00000020003100320000000200020002 +Ǭ 1DDD00000020003100320000000800020002 +ō 1DDD000000200032000000020002 +Ō 1DDD000000200032000000080002 +ỏ 1DDD00000020003B000000020002 +Ỏ 1DDD00000020003B000000080002 +ơ 1DDD00000020003F000000020002 +Ơ 1DDD00000020003F000000080002 +ớ 1DDD00000020003F00240000000200020002 +Ớ 1DDD00000020003F00240000000800020002 +ờ 1DDD00000020003F00250000000200020002 +Ờ 1DDD00000020003F00250000000800020002 +ỡ 1DDD00000020003F002D0000000200020002 +Ỡ 1DDD00000020003F002D0000000800020002 +ở 1DDD00000020003F003B0000000200020002 +Ở 1DDD00000020003F003B0000000800020002 +ợ 1DDD00000020003F00420000000200020002 +Ợ 1DDD00000020003F00420000000800020002 +ọ 1DDD000000200042000000020002 +Ọ 1DDD000000200042000000080002 +ộ 1DDD00000020004200270000000200020002 +Ộ 1DDD00000020004200270000000800020002 +oe 1DDD1CAA000000200020000000020002 +oE 1DDD1CAA000000200020000000020008 +Oe 1DDD1CAA000000200020000000080002 +OE 1DDD1CAA000000200020000000080008 +œ 1DDD1CAA00000020011000200000000400040004 +Œ 1DDD1CAA00000020011000200000000A0004000A +Ɔ 1DF00000002000000008 +Ɵ 1DFD0000002000000008 +p 1E0C0000002000000002 +P 1E0C0000002000000008 +ƥ 1E150000002000000002 +Ƥ 1E150000002000000008 +q 1E210000002000000002 +Q 1E210000002000000008 +ĸ 1E2F0000002000000002 +r 1E330000002000000002 +R 1E330000002000000008 +ŕ 1E33000000200024000000020002 +Ŕ 1E33000000200024000000080002 +ř 1E33000000200028000000020002 +Ř 1E33000000200028000000080002 +ŗ 1E33000000200030000000020002 +Ŗ 1E33000000200030000000080002 +rr 1E331E33000000200020000000020002 +rr 1E331E33000000200020000000020002 +rR 1E331E33000000200020000000020008 +rR 1E331E33000000200020000000020008 +Rr 1E331E33000000200020000000080002 +Rr 1E331E33000000200020000000080002 +RR 1E331E33000000200020000000080008 +RR 1E331E33000000200020000000080008 +Ʀ 1E380000002000000008 +s 1E710000002000000002 +S 1E710000002000000008 +ś 1E71000000200024000000020002 +Ś 1E71000000200024000000080002 +ŝ 1E71000000200027000000020002 +Ŝ 1E71000000200027000000080002 +š 1E71000000200028000000020002 +Š 1E71000000200028000000080002 +ş 1E71000000200030000000020002 +Ş 1E71000000200030000000080002 +ș 1E71000000200045000000020002 +Ș 1E71000000200045000000080002 +ſ 1E71000000200111000000040004 +ss 1E711E71000000200020000000020002 +sS 1E711E71000000200020000000020008 +Ss 1E711E71000000200020000000080002 +SS 1E711E71000000200020000000080008 +ß 1E711E7100000020011000200000000400040004 +ssz 1E711E711F2100000020002000200000000200020002 +sSZ 1E711E711F2100000020002000200000000200080008 +Ssz 1E711E711F2100000020002000200000000800020002 +SSZ 1E711E711F2100000020002000200000000800080008 +sz 1E711F21000000200020000000020002 +sZ 1E711F21000000200020000000020008 +Sz 1E711F21000000200020000000080002 +SZ 1E711F21000000200020000000080008 +Ʃ 1E820000002000000008 +ƪ 1E880000002000000002 +t 1E950000002000000002 +T 1E950000002000000008 +ť 1E95000000200028000000020002 +Ť 1E95000000200028000000080002 +ţ 1E95000000200030000000020002 +Ţ 1E95000000200030000000080002 +ț 1E95000000200045000000020002 +Ț 1E95000000200045000000080002 +ƾ 1E951E71000000200020000000040004 +tty 1E951E951F0B00000020002000200000000200020002 +tTY 1E951E951F0B00000020002000200000000200080008 +Tty 1E951E951F0B00000020002000200000000800020002 +TTY 1E951E951F0B00000020002000200000000800080008 +ty 1E951F0B000000200020000000020002 +tY 1E951F0B000000200020000000020008 +Ty 1E951F0B000000200020000000080002 +TY 1E951F0B000000200020000000080008 +ŧ 1E9A0000002000000002 +Ŧ 1E9A0000002000000008 +ƫ 1EA00000002000000002 +ƭ 1EA40000002000000002 +Ƭ 1EA40000002000000008 +Ʈ 1EA80000002000000008 +u 1EB50000002000000002 +U 1EB50000002000000008 +ú 1EB5000000200024000000020002 +Ú 1EB5000000200024000000080002 +ù 1EB5000000200025000000020002 +Ù 1EB5000000200025000000080002 +ŭ 1EB5000000200026000000020002 +Ŭ 1EB5000000200026000000080002 +û 1EB5000000200027000000020002 +Û 1EB5000000200027000000080002 +ǔ 1EB5000000200028000000020002 +Ǔ 1EB5000000200028000000080002 +ů 1EB5000000200029000000020002 +Ů 1EB5000000200029000000080002 +ü 1EB500000020002B000000020002 +Ü 1EB500000020002B000000080002 +ǘ 1EB500000020002B00240000000200020002 +Ǘ 1EB500000020002B00240000000800020002 +ǜ 1EB500000020002B00250000000200020002 +Ǜ 1EB500000020002B00250000000800020002 +ǚ 1EB500000020002B00280000000200020002 +Ǚ 1EB500000020002B00280000000800020002 +ǖ 1EB500000020002B00320000000200020002 +Ǖ 1EB500000020002B00320000000800020002 +ű 1EB500000020002C000000020002 +Ű 1EB500000020002C000000080002 +ũ 1EB500000020002D000000020002 +Ũ 1EB500000020002D000000080002 +ų 1EB5000000200031000000020002 +Ų 1EB5000000200031000000080002 +ū 1EB5000000200032000000020002 +Ū 1EB5000000200032000000080002 +ủ 1EB500000020003B000000020002 +Ủ 1EB500000020003B000000080002 +ư 1EB500000020003F000000020002 +Ư 1EB500000020003F000000080002 +ứ 1EB500000020003F00240000000200020002 +Ứ 1EB500000020003F00240000000800020002 +ừ 1EB500000020003F00250000000200020002 +Ừ 1EB500000020003F00250000000800020002 +ữ 1EB500000020003F002D0000000200020002 +Ữ 1EB500000020003F002D0000000800020002 +ử 1EB500000020003F003B0000000200020002 +Ử 1EB500000020003F003B0000000800020002 +ự 1EB500000020003F00420000000200020002 +Ự 1EB500000020003F00420000000800020002 +ụ 1EB5000000200042000000020002 +Ụ 1EB5000000200042000000080002 +ue 1EB51CAA000000200020000000020002 +uE 1EB51CAA000000200020000000020008 +Ue 1EB51CAA000000200020000000080002 +UE 1EB51CAA000000200020000000080008 +Ɯ 1ED40000002000000008 +Ʊ 1EDE0000002000000008 +v 1EE30000002000000002 +V 1EE30000002000000008 +Ʋ 1EEA0000002000000008 +w 1EF50000002000000002 +W 1EF50000002000000008 +ŵ 1EF5000000200027000000020002 +Ŵ 1EF5000000200027000000080002 +x 1EFF0000002000000002 +X 1EFF0000002000000008 +y 1F0B0000002000000002 +Y 1F0B0000002000000008 +ý 1F0B000000200024000000020002 +Ý 1F0B000000200024000000080002 +ŷ 1F0B000000200027000000020002 +Ŷ 1F0B000000200027000000080002 +ÿ 1F0B00000020002B000000020002 +Ÿ 1F0B00000020002B000000080002 +ƴ 1F170000002000000002 +Ƴ 1F170000002000000008 +z 1F210000002000000002 +Z 1F210000002000000008 +ź 1F21000000200024000000020002 +Ź 1F21000000200024000000080002 +ž 1F21000000200028000000020002 +Ž 1F21000000200028000000080002 +ż 1F2100000020002E000000020002 +Ż 1F2100000020002E000000080002 +zs 1F211E71000000200020000000020002 +zS 1F211E71000000200020000000020008 +Zs 1F211E71000000200020000000080002 +ZS 1F211E71000000200020000000080008 +ƍ 1F211EF5000000200020000000040004 +zzs 1F211F211E7100000020002000200000000200020002 +zZS 1F211F211E7100000020002000200000000200080008 +Zzs 1F211F211E7100000020002000200000000800020002 +ZZS 1F211F211E7100000020002000200000000800080008 +ƶ 1F260000002000000002 +Ƶ 1F260000002000000008 +Ʒ 1F3E0000002000000008 +ǯ 1F3E000000200028000000020002 +Ǯ 1F3E000000200028000000080002 +ƹ 1F430000002000000002 +Ƹ 1F430000002000000008 +ƺ 1F480000002000000002 +þ 1F500000002000000002 +Þ 1F500000002000000008 +ƿ 1F560000002000000002 +Ƿ 1F560000002000000008 +ƻ 1F620000002000000002 +ƨ 1F690000002000000002 +Ƨ 1F690000002000000008 +ƽ 1F6D0000002000000002 +Ƽ 1F6D0000002000000008 +ƅ 1F710000002000000002 +Ƅ 1F710000002000000008 +ʼn 1F7E1DB9000000200020000000040004 +ǀ 1F990000002000000002 +ǁ 1F9D0000002000000002 +ǂ 1FA10000002000000002 +ǃ 1FA50000002000000002 +ඖ 28E10000002000000002 +ඤ 28EC0000002000000002 +ඥ 28ED0000002000000002 +DROP TABLE t1; +CREATE TABLE t1 (a CHAR(10)) COLLATE utf8mb4_da_0900_as_cs; +INSERT INTO t1 VALUES('z'), (_utf16 0x00C50053), (_utf16 0x00C50073), (_utf16 0x00E50053), (_utf16 0x00E50073), (_utf16 0x00C10053), (_utf16 0x00C10073), (_utf16 0x00E10073), (_utf16 0x00E10053), ('aAS'), ('aAs'), ('AS'), ('As'), ('as'), ('aS'), ('aas'), ('AAS'), ('Aas'), ('AAs'), ('aaS'), ('AaS'); +SELECT HEX(CONVERT(a USING utf16)), HEX(WEIGHT_STRING(a)) FROM t1 ORDER BY a, BINARY a; +HEX(CONVERT(a USING utf16)) HEX(WEIGHT_STRING(a)) +006100410053 1C471C471E7100000020002000200000030201080108 +006100410073 1C471C471E7100000020002000200000030201080302 +00410053 1C471E71000000200020000001080108 +00410073 1C471E71000000200020000001080302 +00610053 1C471E71000000200020000003020108 +00610073 1C471E71000000200020000003020302 +00C10053 1C471E7100000020002400200000010803020108 +00C10073 1C471E7100000020002400200000010803020302 +00E10053 1C471E7100000020002400200000030203020108 +00E10073 1C471E7100000020002400200000030203020302 +007A 1F210000002000000302 +00C50053 1F9854A71E710000002000200000010201210108 +00C50073 1F9854A71E710000002000200000010201210302 +004100410053 1F9854A71E710000002000200000010201240108 +004100410073 1F9854A71E710000002000200000010201240302 +004100610053 1F9854A71E710000002000200000020202230108 +004100610073 1F9854A71E710000002000200000020202230302 +00E50053 1F9854A71E71000000200020000003020108 +00E50073 1F9854A71E71000000200020000003020302 +006100610053 1F9854A71E710000002000200000030203220108 +006100610073 1F9854A71E710000002000200000030203220302 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10)) COLLATE utf8mb4_da_0900_as_cs; +INSERT INTO t1 VALUES (_utf16 0x00DE, _utf16 0x0074), (_utf16 0x0162, _utf16 0x00DE), (_utf16 0x0162, _utf16 0x00FE), +(_utf16 0x0163, _utf16 0x00DE), (_utf16 0x0163, _utf16 0x00FE), (_utf16 0x0164, _utf16 0x00DE), +(_utf16 0x0164, _utf16 0x00FE), (_utf16 0x0165, _utf16 0x00DE), (_utf16 0x0165, _utf16 0x00FE), +(_utf16 0x01D5, _utf16 0x00DC), (_utf16 0x01D5, _utf16 0x00FC), (_utf16 0x01D7, _utf16 0x00DC), +(_utf16 0x01D7, _utf16 0x00FC), (_utf16 0x01D8, _utf16 0x01D5), (_utf16 0x01D9, _utf16 0x00DC), +(_utf16 0x01D9, _utf16 0x00FC), (_utf16 0x01D9, _utf16 0x01D7), (_utf16 0x01D9, _utf16 0x01D8), +(_utf16 0x01DA, _utf16 0x01D5), (_utf16 0x01DA, _utf16 0x01D8), (_utf16 0x01DB, _utf16 0x00DC), +(_utf16 0x01DB, _utf16 0x00FC), (_utf16 0x01DB, _utf16 0x01D7), (_utf16 0x01DB, _utf16 0x01D8), +(_utf16 0x01DC, _utf16 0x01D5), (_utf16 0x01DC, _utf16 0x01D8), (_utf16 0x01DC, _utf16 0x01D9), +(_utf16 0x01DE, _utf16 0x00C4), (_utf16 0x01DE, _utf16 0x00E4), (_utf16 0x01E2, _utf16 0x00C6), +(_utf16 0x01E2, _utf16 0x00E6), (_utf16 0x01FA, _utf16 0x00C5), (_utf16 0x01FA, _utf16 0x00E5), +(_utf16 0x01FC, _utf16 0x00C6), (_utf16 0x01FC, _utf16 0x00E6), (_utf16 0x01FD, _utf16 0x01E2), +(_utf16 0x01FE, _utf16 0x00D8), (_utf16 0x01FE, _utf16 0x00F8), (_utf16 0x021A, _utf16 0x00DE), +(_utf16 0x021A, _utf16 0x00FE), (_utf16 0x021B, _utf16 0x00DE), (_utf16 0x021B, _utf16 0x00FE), +(_utf16 0x022A, _utf16 0x00D6), (_utf16 0x022A, _utf16 0x00F6), (_utf16 0x02A8, _utf16 0x00DE), +(_utf16 0x02A8, _utf16 0x00FE); +SELECT a > b FROM t1; +a > b +1 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 +1 +0 +1 +1 +1 +1 +0 +1 +1 +1 +1 +1 +0 +1 +0 +1 +1 +1 +1 +1 +1 +1 +1 +0 +1 +1 +0 +0 +0 +0 +1 +1 +0 +0 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10), c integer) COLLATE utf8mb4_vi_0900_as_cs; +INSERT INTO t1 VALUES (_utf16 0x00C1, _utf16 0x00C0, 1), +(_utf16 0x00C3, _utf16 0x00C1, 0), (_utf16 0x00C4, _utf16 0x00C3, 1), +(_utf16 0x00C5, _utf16 0x00C3, 1), (_utf16 0x00C9, _utf16 0x00C8, 1), +(_utf16 0x00CD, _utf16 0x00CC, 1), (_utf16 0x00D3, _utf16 0x00D2, 1), +(_utf16 0x00D5, _utf16 0x00D3, 0), (_utf16 0x00D6, _utf16 0x00D5, 1), +(_utf16 0x00DA, _utf16 0x00D9, 1), (_utf16 0x00E0, _utf16 0x00C1, 0), +(_utf16 0x00E1, _utf16 0x00C0, 1), (_utf16 0x00E3, _utf16 0x00C1, 0), +(_utf16 0x00E4, _utf16 0x00C3, 1), (_utf16 0x00E5, _utf16 0x00C3, 1), +(_utf16 0x00E8, _utf16 0x00C9, 0), (_utf16 0x00E9, _utf16 0x00C8, 1), +(_utf16 0x00EC, _utf16 0x00CD, 0), (_utf16 0x00ED, _utf16 0x00CC, 1), +(_utf16 0x00F2, _utf16 0x00D3, 0), (_utf16 0x00F3, _utf16 0x00D2, 1), +(_utf16 0x00F5, _utf16 0x00D3, 0), (_utf16 0x00F6, _utf16 0x00D5, 1), +(_utf16 0x00F9, _utf16 0x00DA, 0), (_utf16 0x00FA, _utf16 0x00D9, 1), +(_utf16 0x0128, _utf16 0x00CD, 0), (_utf16 0x0129, _utf16 0x00CD, 0), +(_utf16 0x012C, _utf16 0x0128, 1), (_utf16 0x012D, _utf16 0x0128, 1), +(_utf16 0x0143, _utf16 0x00D1, 1), (_utf16 0x0144, _utf16 0x00D1, 1), +(_utf16 0x0147, _utf16 0x00D1, 1), (_utf16 0x0148, _utf16 0x00D1, 1), +(_utf16 0x014E, _utf16 0x00D5, 1), (_utf16 0x014F, _utf16 0x00D5, 1), +(_utf16 0x0150, _utf16 0x00D5, 1), (_utf16 0x0151, _utf16 0x00D5, 1), +(_utf16 0x0168, _utf16 0x00DA, 0), (_utf16 0x0169, _utf16 0x00DA, 0), +(_utf16 0x016C, _utf16 0x0168, 1), (_utf16 0x016D, _utf16 0x0168, 1), +(_utf16 0x016E, _utf16 0x0168, 1), (_utf16 0x016F, _utf16 0x0168, 1), +(_utf16 0x0170, _utf16 0x0168, 1), (_utf16 0x0171, _utf16 0x0168, 1), +(_utf16 0x01CD, _utf16 0x00C3, 1), (_utf16 0x01CE, _utf16 0x00C3, 1), +(_utf16 0x01CF, _utf16 0x0128, 1), (_utf16 0x01D0, _utf16 0x0128, 1), +(_utf16 0x01D1, _utf16 0x00D5, 1), (_utf16 0x01D2, _utf16 0x00D5, 1), +(_utf16 0x01D3, _utf16 0x0168, 1), (_utf16 0x01D4, _utf16 0x0168, 1), +(_utf16 0x01D5, _utf16 0x0168, 1), (_utf16 0x01D6, _utf16 0x0168, 1), +(_utf16 0x01D7, _utf16 0x0168, 1), (_utf16 0x01D8, _utf16 0x0168, 1), +(_utf16 0x01D9, _utf16 0x0168, 1), (_utf16 0x01DA, _utf16 0x0168, 1), +(_utf16 0x01DB, _utf16 0x0168, 1), (_utf16 0x01DC, _utf16 0x0168, 1), +(_utf16 0x01DE, _utf16 0x00C3, 1), (_utf16 0x01DF, _utf16 0x00C3, 1), +(_utf16 0x01F8, _utf16 0x0143, 0), (_utf16 0x01F9, _utf16 0x0143, 0), +(_utf16 0x01FA, _utf16 0x00C3, 1), (_utf16 0x01FB, _utf16 0x00C3, 1), +(_utf16 0x022A, _utf16 0x00D5, 1), (_utf16 0x022B, _utf16 0x00D5, 1), +(_utf16 0x022C, _utf16 0x00D3, 0), (_utf16 0x022D, _utf16 0x00D3, 0); +SELECT a, b, c FROM t1 where (a > b) <> c; +a b c +DROP TABLE t1; +# +# Bug 24480513: ANGSTROM SIGN NOT CORRECTLY HANDLED IN +# UTF8MB4_DA_0900_AS_CS +# +SET NAMES utf8mb4; +SELECT CONVERT(_utf16 0x212B USING utf8mb4) = CONVERT(_utf16 0x00C5 USING +utf8mb4) COLLATE utf8mb4_da_0900_as_cs AS result; +result +1 +SET NAMES default; +# +# Bug 24579093: WL#9109: SOME CHARACTERS DEVIATE FROM ICU FOR VIETNAMESE +# +CREATE TABLE t1(a CHAR, b CHAR, c INTEGER) COLLATE utf8mb4_vi_0900_as_cs; +INSERT INTO t1 VALUES (_utf16 0x1F8C , _utf16 0x1F02, 1), +(_utf16 0x1F8D , _utf16 0x1F03, 1), (_utf16 0x1F9C , _utf16 0x1F22, 1), +(_utf16 0x1F9D , _utf16 0x1F23, 1), (_utf16 0x1FAC , _utf16 0x1F62, 1), +(_utf16 0x1FAD , _utf16 0x1F63, 1), (_utf16 0x1FCE , _utf16 0x1FCD, 1), +(_utf16 0x1FDE , _utf16 0x1FDD, 1), (_utf16 0x1FED , _utf16 0x0385, 0), +(_utf16 0x1FEE , _utf16 0x1FED, 1); +SELECT a, b, c FROM t1 where (a > b) <> c; +a b c +DROP TABLE t1; +CREATE TABLE t1(a CHAR, description VARCHAR(30)) COLLATE utf8mb4_ja_0900_as_cs; +INSERT INTO t1 VALUES('a', 'Latin'), ('A', 'Latin'), (_utf16 0x02AC, 'Latin'), +(_utf16 0x02AD, 'Latin'), (_utf16 0x03B1, 'Greak'), (_utf16 0x2C81, 'Coptic'), +(_utf16 0x0430, 'Cyrillic'), (_utf16 0xD7FB, 'Hangul'), +(_utf16 0x3041, 'Hiragana'), (_utf16 0x3105, 'Bopomofo'), +(_utf16 0x2F00, 'Other Han'), (_utf16 0x4E00, 'Japanese Han'), +(_utf16 0x9FFF, 'Other'), (_utf16 0xA000, 'Other'), +(_utf16 0x9FD5, 'Other Han'), (_utf16 0xFA0E, 'Other Han'), +(_utf16 0x3400, 'Other Han'), (_utf16 0x4E9C, 'Japanese Han'), +(_utf16 0x7199, 'Japanese Han'), (_utf16 0x6190, 'Japanese Han'), +(_utf16 0x30F3, 'Katakana'), (_utf16 0x306F, 'Hiragana HA'), +(_utf16 0x3070, 'Hiragana BA'), (_utf16 0x3071, 'Hiragana PA'); +SELECT HEX(CONVERT(a USING utf16)), description FROM t1 ORDER BY a; +HEX(CONVERT(a USING utf16)) description +0061 Latin +0041 Latin +02AC Latin +02AD Latin +3041 Hiragana +306F Hiragana HA +3070 Hiragana BA +3071 Hiragana PA +30F3 Katakana +4E9C Japanese Han +4E00 Japanese Han +6190 Japanese Han +7199 Japanese Han +2F00 Other Han +9FD5 Other Han +FA0E Other Han +3400 Other Han +03B1 Greak +2C81 Coptic +0430 Cyrillic +D7FB Hangul +3105 Bopomofo +A000 Other +9FFF Other +DROP TABLE t1; +CREATE TABLE t1(a CHAR, description VARCHAR(30)) COLLATE utf8mb4_ja_0900_as_cs_ks; +INSERT INTO t1 VALUES('a', 'Latin'), ('A', 'Latin'), (_utf16 0x02AC, 'Latin'), +(_utf16 0x02AD, 'Latin'), (_utf16 0x03B1, 'Greak'), (_utf16 0x2C81, 'Coptic'), +(_utf16 0x0430, 'Cyrillic'), (_utf16 0xD7FB, 'Hangul'), +(_utf16 0x3041, 'Hiragana'), (_utf16 0x3105, 'Bopomofo'), +(_utf16 0x2F00, 'Other Han'), (_utf16 0x4E00, 'Japanese Han'), +(_utf16 0x9FFF, 'Other'), (_utf16 0xA000, 'Other'), +(_utf16 0x9FD5, 'Other Han'), (_utf16 0xFA0E, 'Other Han'), +(_utf16 0x3400, 'Other Han'), (_utf16 0x4E9C, 'Japanese Han'), +(_utf16 0x7199, 'Japanese Han'), (_utf16 0x6190, 'Japanese Han'), +(_utf16 0x30F3, 'Katakana'), (_utf16 0x306F, 'Hiragana HA'), +(_utf16 0x3070, 'Hiragana BA'), (_utf16 0x3071, 'Hiragana PA'); +SELECT HEX(CONVERT(a USING utf16)), description FROM t1 ORDER BY a; +HEX(CONVERT(a USING utf16)) description +0061 Latin +0041 Latin +02AC Latin +02AD Latin +3041 Hiragana +306F Hiragana HA +3070 Hiragana BA +3071 Hiragana PA +30F3 Katakana +4E9C Japanese Han +4E00 Japanese Han +6190 Japanese Han +7199 Japanese Han +2F00 Other Han +9FD5 Other Han +FA0E Other Han +3400 Other Han +03B1 Greak +2C81 Coptic +0430 Cyrillic +D7FB Hangul +3105 Bopomofo +A000 Other +9FFF Other +DROP TABLE t1; +SET @s1 = CONVERT(_utf16 0x304D30853046 USING utf8mb4); +SET @s2 = CONVERT(_utf16 0x30AD30E530A6 USING utf8mb4); +SET @s3 = CONVERT(_utf16 0x304D30863046 USING utf8mb4); +SET @s4 = CONVERT(_utf16 0x30AD30E630A6 USING utf8mb4); +SELECT STRCMP(@s1 COLLATE utf8mb4_ja_0900_as_cs, @s2 COLLATE utf8mb4_ja_0900_as_cs); +STRCMP(@s1 COLLATE utf8mb4_ja_0900_as_cs, @s2 COLLATE utf8mb4_ja_0900_as_cs) +0 +SELECT STRCMP(@s2 COLLATE utf8mb4_ja_0900_as_cs, @s3 COLLATE utf8mb4_ja_0900_as_cs); +STRCMP(@s2 COLLATE utf8mb4_ja_0900_as_cs, @s3 COLLATE utf8mb4_ja_0900_as_cs) +-1 +SELECT STRCMP(@s3 COLLATE utf8mb4_ja_0900_as_cs, @s4 COLLATE utf8mb4_ja_0900_as_cs); +STRCMP(@s3 COLLATE utf8mb4_ja_0900_as_cs, @s4 COLLATE utf8mb4_ja_0900_as_cs) +0 +SELECT STRCMP(@s1 COLLATE utf8mb4_ja_0900_as_cs_ks, @s2 COLLATE utf8mb4_ja_0900_as_cs_ks); +STRCMP(@s1 COLLATE utf8mb4_ja_0900_as_cs_ks, @s2 COLLATE utf8mb4_ja_0900_as_cs_ks) +-1 +SELECT STRCMP(@s2 COLLATE utf8mb4_ja_0900_as_cs_ks, @s3 COLLATE utf8mb4_ja_0900_as_cs_ks); +STRCMP(@s2 COLLATE utf8mb4_ja_0900_as_cs_ks, @s3 COLLATE utf8mb4_ja_0900_as_cs_ks) +-1 +SELECT STRCMP(@s3 COLLATE utf8mb4_ja_0900_as_cs_ks, @s4 COLLATE utf8mb4_ja_0900_as_cs_ks); +STRCMP(@s3 COLLATE utf8mb4_ja_0900_as_cs_ks, @s4 COLLATE utf8mb4_ja_0900_as_cs_ks) +-1 +SET @s1 = CONVERT(_utf16 0x309D USING utf8mb4); +SET @s2 = CONVERT(_utf16 0x30FD USING utf8mb4); +SELECT STRCMP(@s1 COLLATE utf8mb4_ja_0900_as_cs, @s2 COLLATE utf8mb4_ja_0900_as_cs); +STRCMP(@s1 COLLATE utf8mb4_ja_0900_as_cs, @s2 COLLATE utf8mb4_ja_0900_as_cs) +0 +SELECT STRCMP(@s1 COLLATE utf8mb4_ja_0900_as_cs_ks, @s2 COLLATE utf8mb4_ja_0900_as_cs_ks); +STRCMP(@s1 COLLATE utf8mb4_ja_0900_as_cs_ks, @s2 COLLATE utf8mb4_ja_0900_as_cs_ks) +-1 +CREATE TABLE t1(a VARCHAR(20)) COLLATE utf8mb4_ja_0900_as_cs_ks; +INSERT INTO t1 VALUES(_utf16 0x30FC), (_utf16 0x30A230FC), (_utf16 0x304230FC), +(_utf16 0x65E5672C8A9E), (_utf16 0x30443059309E), (_utf16 0x30443059305A), +(_utf16 0x30A430B930FE), (_utf16 0x30A430B930BA), +(_utf16 0x65E5672C8A9E30CB30DB30F330B4); +SELECT HEX(CONVERT(a USING utf16)), HEX(WEIGHT_STRING(a)) FROM t1 ORDER BY a; +HEX(CONVERT(a USING utf16)) HEX(WEIGHT_STRING(a)) +30FC 1C0E000000200000000200000008 +304230FC 1FB61FB60000002000200000000E000C0021000000020002 +30A230FC 1FB61FB60000002000200000000E000C0021000000080008 +30443059309E 1FB71FC31FC3000000200020002000370000000E000E000E000100210000000200020002 +30A430B930FE 1FB71FC31FC3000000200020002000370000000E000E000E000100210000000800080008 +30443059305A 1FB71FC31FC3000000200020002000370000000E000E000E00020000000200020002 +30A430B930BA 1FB71FC31FC3000000200020002000370000000E000E000E00020000000800080008 +65E5672C8A9E 5D135EC957DF00000020002000200000000200020002 +65E5672C8A9E30CB30DB30F330B4 5D135EC957DF1FCC1FD41FE71FC00000002000200020002000200020002000370000000200020002000E000E000E000E000200000008000800080008 +DROP TABLE t1; +CREATE TABLE t1(a VARCHAR(20), KEY a (a)) COLLATE utf8mb4_ja_0900_as_cs_ks +PARTITION BY KEY (a) PARTITIONS 3; +INSERT INTO t1 VALUES(_utf16 0x30FC), (_utf16 0x30A230FC), (_utf16 0x304230FC), +(_utf16 0x65E5672C8A9E), (_utf16 0x30443059309E), (_utf16 0x30443059305A), +(_utf16 0x30A430B930FE), (_utf16 0x30A430B930BA), +(_utf16 0x65E5672C8A9E30CB30DB30F330B4); +SELECT HEX(CONVERT(a USING utf16)) FROM t1 WHERE a = _utf16 0x30443059305A; +HEX(CONVERT(a USING utf16)) +30443059305A +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10)) COLLATE utf8mb4_ru_0900_as_cs; +INSERT INTO t1 VALUES(_utf16 0x0452), (_utf16 0x0453), (_utf16 0x0403), +(_utf16 0x0439), (_utf16 0x048B), (_utf16 0x048A), (_utf16 0x043B), +(_utf16 0x1D2B), (_utf16 0x045B), (_utf16 0x045C), (_utf16 0x040C); +SELECT HEX(CONVERT(a USING utf16)) AS codepoint FROM t1 ORDER BY a, HEX(a); +codepoint +0453 +0403 +0452 +048B +048A +0439 +045C +040C +043B +1D2B +045B +DROP TABLE t1; +# +# End of 5.8 tests +# +CREATE TABLE t1(a VARCHAR(10)) COLLATE utf8mb4_zh_0900_as_cs; +INSERT INTO t1 VALUES(_utf16 0x2E87), (_utf16 0x2E8D), (_utf16 0x2F17), +(_utf16 0x3038), (_utf16 0x24B6), (_utf32 0x1F150), (_utf16 0x4E2D), +(_utf16 0x3197), (_utf32 0x1F22D), ('A'), ('a'), ('Z'), ('z'), +(_utf16 0x3082), (_utf16 0x30E2), (_utf16 0x2E31), (_utf16 0x33E8), +(_utf32 0x1F229), (_utf32 0x1F241), (_utf16 0xFA56); +SELECT HEX(CONVERT(a USING utf32)), HEX(WEIGHT_STRING(a)) FROM t1 ORDER BY a, HEX(a); +HEX(CONVERT(a USING utf32)) HEX(WEIGHT_STRING(a)) +00002E31 028C0000002000000002 +0001F241 0379815D037A000000200020002000000002000200020021 +000033E8 1C467F7E0000002000200000000200020021 +00002E87 4CDF000000200110000000040004 +0000FA56 51CD0000002000000002 +00002F17 857A00000020000000020021 +00003038 857A00000020000000020022 +00002E8D 9C310000002000000002 +0001F229 A63E00000020000000020024 +00004E2D B8200000002000000002 +00003197 B82000000020000000020021 +0001F22D B82000000020000000020023 +00000061 BDC40000002000000002 +00000041 BDC40000002000000008 +000024B6 BDC4000000200000000C +0001F150 BDC4000000200000000C +0000007A C09E0000002000000002 +0000005A C09E0000002000000008 +00003082 DEFA000000200000000E +000030E2 DEFA0000002000000011 +DROP TABLE t1; +CREATE TABLE t1(a VARCHAR(10)) COLLATE utf8mb4_zh_0900_as_cs; +INSERT INTO t1 VALUES(_utf16 0x6C88), (_utf16 0x5F1E), (_utf16 0x9633), +(_utf16 0x6C889633), (_utf16 0x5F1E9633); +SELECT HEX(CONVERT(a USING utf32)), HEX(WEIGHT_STRING(a)) FROM t1 ORDER BY a, HEX(a); +HEX(CONVERT(a USING utf32)) HEX(WEIGHT_STRING(a)) +00006C88 289C0000002000000002 +00005F1E 848C0000002000000002 +00005F1E00009633 848CA41B000000200020000000020002 +00006C8800009633 848CA41BF645000000200020000000020002 +00009633 A41B0000002000000002 +DROP TABLE t1; +CREATE TABLE t1(a VARCHAR(10), b VARCHAR(10)) COLLATE utf8mb4_zh_0900_as_cs; +INSERT INTO t1 VALUES(_utf16 0xF902, _utf16 0x2F9E), (_utf16 0xF907, _utf16 0x2FD4), +(_utf16 0xF908, _utf16 0x2FD4), (_utf16 0xF9D1, _utf16 0x3285); +SELECT HEX(CONVERT(a USING utf16)) AS a_u16, HEX(CONVERT(b USING utf16)) AS b_u16, a = b FROM t1; +a_u16 b_u16 a = b +F902 2F9E 0 +F907 2FD4 0 +F908 2FD4 0 +F9D1 3285 0 +DROP TABLE t1; +CREATE TABLE t1(a VARCHAR(10)) COLLATE utf8mb4_zh_0900_as_cs; +INSERT INTO t1 VALUES(_utf16 0x1EC2), (_utf16 0x1EC3), (_utf16 0x1EC5), (_utf16 0x1EC0), (_utf16 0x1EC7), (_Utf16 0x1EBF); +SELECT HEX(CONVERT(a USING utf16)) FROM t1 ORDER BY a; +HEX(CONVERT(a USING utf16)) +1EC5 +1EC3 +1EC2 +1EC7 +1EBF +1EC0 +DROP TABLE t1; diff --git a/mysql-test/r/ctype_utf16.result-pq b/mysql-test/r/ctype_utf16.result-pq new file mode 100644 index 000000000000..ca1c9f1500d9 --- /dev/null +++ b/mysql-test/r/ctype_utf16.result-pq @@ -0,0 +1,1380 @@ +# +# Start of 5.5 tests +# +SET NAMES latin1; +SET character_set_connection=utf16; +select hex('a'), hex('a '); +hex('a') hex('a ') +0061 00610020 +select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; +'a' = 'a' 'a' = 'a ' 'a ' = 'a' +1 1 1 +select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a'; +'a\0' = 'a' 'a\0' < 'a' 'a\0' > 'a' +0 1 0 +select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0'; +'a' = 'a\0' 'a' < 'a\0' 'a' > 'a\0' +0 0 1 +select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a '; +'a\0' = 'a ' 'a\0' < 'a ' 'a\0' > 'a ' +0 1 0 +select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0'; +'a ' = 'a\0' 'a ' < 'a\0' 'a ' > 'a\0' +0 0 1 +select 'a a' > 'a', 'a \0' < 'a'; +'a a' > 'a' 'a \0' < 'a' +1 1 +select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a'; +binary 'a a' > 'a' binary 'a \0' > 'a' binary 'a\0' > 'a' +1 1 1 +select hex(_utf16 0x44); +hex(_utf16 0x44) +0044 +select hex(_utf16 0x3344); +hex(_utf16 0x3344) +3344 +select hex(_utf16 0x113344); +hex(_utf16 0x113344) +00113344 +CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf16; +INSERT INTO t1 VALUES (_koi8r 0xF2, _koi8r 0xF2), (X'2004',X'2004'); +SELECT hex(word) FROM t1 ORDER BY word; +hex(word) +0420 +2004 +SELECT hex(word2) FROM t1 ORDER BY word2; +hex(word2) +0420 +2004 +DELETE FROM t1; +INSERT INTO t1 VALUES (X'042000200020',X'042000200020'), (X'200400200020', X'200400200020'); +SELECT hex(word) FROM t1 ORDER BY word; +hex(word) +042000200020 +200400200020 +SELECT hex(word2) FROM t1 ORDER BY word2; +hex(word2) +0420 +2004 +DROP TABLE t1; +SELECT hex(LPAD(_utf16 X'0420',10,_utf16 X'0421')); +hex(LPAD(_utf16 X'0420',10,_utf16 X'0421')) +0421042104210421042104210421042104210420 +SELECT hex(LPAD(_utf16 X'0420',10,_utf16 X'04210422')); +hex(LPAD(_utf16 X'0420',10,_utf16 X'04210422')) +0421042204210422042104220421042204210420 +SELECT hex(LPAD(_utf16 X'0420',10,_utf16 X'042104220423')); +hex(LPAD(_utf16 X'0420',10,_utf16 X'042104220423')) +0421042204230421042204230421042204230420 +SELECT hex(LPAD(_utf16 X'0420042104220423042404250426042704280429042A042B',10,_utf16 X'042104220423')); +hex(LPAD(_utf16 X'0420042104220423042404250426042704280429042A042B',10,_utf16 X'042104220423')) +0420042104220423042404250426042704280429 +SELECT hex(LPAD(_utf16 X'D800DC00', 10, _utf16 X'0421')); +hex(LPAD(_utf16 X'D800DC00', 10, _utf16 X'0421')) +042104210421042104210421042104210421D800DC00 +SELECT hex(LPAD(_utf16 X'0421', 10, _utf16 X'D800DC00')); +hex(LPAD(_utf16 X'0421', 10, _utf16 X'D800DC00')) +D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC000421 +SELECT hex(RPAD(_utf16 X'0420',10,_utf16 X'0421')); +hex(RPAD(_utf16 X'0420',10,_utf16 X'0421')) +0420042104210421042104210421042104210421 +SELECT hex(RPAD(_utf16 X'0420',10,_utf16 X'04210422')); +hex(RPAD(_utf16 X'0420',10,_utf16 X'04210422')) +0420042104220421042204210422042104220421 +SELECT hex(RPAD(_utf16 X'0420',10,_utf16 X'042104220423')); +hex(RPAD(_utf16 X'0420',10,_utf16 X'042104220423')) +0420042104220423042104220423042104220423 +SELECT hex(RPAD(_utf16 X'0420042104220423042404250426042704280429042A042B',10,_utf16 X'042104220423')); +hex(RPAD(_utf16 X'0420042104220423042404250426042704280429042A042B',10,_utf16 X'042104220423')) +0420042104220423042404250426042704280429 +SELECT hex(RPAD(_utf16 X'D800DC00', 10, _utf16 X'0421')); +hex(RPAD(_utf16 X'D800DC00', 10, _utf16 X'0421')) +D800DC00042104210421042104210421042104210421 +SELECT hex(RPAD(_utf16 X'0421', 10, _utf16 X'D800DC00')); +hex(RPAD(_utf16 X'0421', 10, _utf16 X'D800DC00')) +0421D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00 +CREATE TABLE t1 SELECT +LPAD(_utf16 X'0420',10,_utf16 X'0421') l, +RPAD(_utf16 X'0420',10,_utf16 X'0421') r; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `l` varchar(10) CHARACTER SET utf16 DEFAULT NULL, + `r` varchar(10) CHARACTER SET utf16 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +select hex(l), hex(r) from t1; +hex(l) hex(r) +0421042104210421042104210421042104210420 0420042104210421042104210421042104210421 +DROP TABLE t1; +create table t1 (f1 char(30)); +insert into t1 values ("103000"), ("22720000"), ("3401200"), ("78000"); +select lpad(f1, 12, "-o-/") from t1; +lpad(f1, 12, "-o-/") +-o-/-o103000 +-o-/22720000 +-o-/-3401200 +-o-/-o-78000 +drop table t1; +SET NAMES latin1; +SET character_set_connection=utf16; +select @@collation_connection; +@@collation_connection +utf16_general_ci +create table t1 as select repeat(' ',10) as a union select null; +alter table t1 add key(a); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) CHARACTER SET utf16 DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); +explain select * from t1 where a like 'abc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range a a 43 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` like 'abc%') +explain select * from t1 where a like concat('abc','%'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range a a 43 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ 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 +abcd +select * from t1 where a like concat("abc","%"); +a +abc +abcd +select * from t1 where a like "ABC%"; +a +abc +abcd +select * from t1 where a like "test%"; +a +test +select * from t1 where a like "te_t"; +a +test +select * from t1 where a like "%a%"; +a +a +abc +abcd +select * from t1 where a like "%abcd%"; +a +abcd +select * from t1 where a like "%abc\d%"; +a +abcd +drop table t1; +select 'AA' like 'AA'; +'AA' like 'AA' +1 +select 'AA' like 'A%A'; +'AA' like 'A%A' +1 +select 'AA' like 'A%%A'; +'AA' like 'A%%A' +1 +select 'AA' like 'AA%'; +'AA' like 'AA%' +1 +select 'AA' like '%AA%'; +'AA' like '%AA%' +1 +select 'AA' like '%A'; +'AA' like '%A' +1 +select 'AA' like '%AA'; +'AA' like '%AA' +1 +select 'AA' like 'A%A%'; +'AA' like 'A%A%' +1 +select 'AA' like '_%_%'; +'AA' like '_%_%' +1 +select 'AA' like '%A%A'; +'AA' like '%A%A' +1 +select 'AAA'like 'A%A%A'; +'AAA'like 'A%A%A' +1 +select 'AZ' like 'AZ'; +'AZ' like 'AZ' +1 +select 'AZ' like 'A%Z'; +'AZ' like 'A%Z' +1 +select 'AZ' like 'A%%Z'; +'AZ' like 'A%%Z' +1 +select 'AZ' like 'AZ%'; +'AZ' like 'AZ%' +1 +select 'AZ' like '%AZ%'; +'AZ' like '%AZ%' +1 +select 'AZ' like '%Z'; +'AZ' like '%Z' +1 +select 'AZ' like '%AZ'; +'AZ' like '%AZ' +1 +select 'AZ' like 'A%Z%'; +'AZ' like 'A%Z%' +1 +select 'AZ' like '_%_%'; +'AZ' like '_%_%' +1 +select 'AZ' like '%A%Z'; +'AZ' like '%A%Z' +1 +select 'AZ' like 'A_'; +'AZ' like 'A_' +1 +select 'AZ' like '_Z'; +'AZ' like '_Z' +1 +select 'AMZ'like 'A%M%Z'; +'AMZ'like 'A%M%Z' +1 +SET NAMES utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SET character_set_connection=utf16; +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf16); +INSERT INTO t1 VALUES ('фыва'),('Фыва'),('фЫва'),('фыВа'),('фывА'),('ФЫВА'); +INSERT INTO t1 VALUES ('фывапролдж'),('Фывапролдж'),('фЫвапролдж'),('фыВапролдж'); +INSERT INTO t1 VALUES ('фывАпролдж'),('фываПролдж'),('фывапРолдж'),('фывапрОлдж'); +INSERT INTO t1 VALUES ('фывапроЛдж'),('фывапролДж'),('фывапролдЖ'),('ФЫВАПРОЛДЖ'); +SELECT * FROM t1 WHERE a LIKE '%фЫва%' ORDER BY BINARY a; +a +ФЫВА +ФЫВАПРОЛДЖ +Фыва +Фывапролдж +фЫва +фЫвапролдж +фыВа +фыВапролдж +фывА +фывАпролдж +фыва +фываПролдж +фывапРолдж +фывапрОлдж +фывапроЛдж +фывапролДж +фывапролдЖ +фывапролдж +SELECT * FROM t1 WHERE a LIKE '%фЫв%' ORDER BY BINARY a; +a +ФЫВА +ФЫВАПРОЛДЖ +Фыва +Фывапролдж +фЫва +фЫвапролдж +фыВа +фыВапролдж +фывА +фывАпролдж +фыва +фываПролдж +фывапРолдж +фывапрОлдж +фывапроЛдж +фывапролДж +фывапролдЖ +фывапролдж +SELECT * FROM t1 WHERE a LIKE 'фЫва%' ORDER BY BINARY a; +a +ФЫВА +ФЫВАПРОЛДЖ +Фыва +Фывапролдж +фЫва +фЫвапролдж +фыВа +фыВапролдж +фывА +фывАпролдж +фыва +фываПролдж +фывапРолдж +фывапрОлдж +фывапроЛдж +фывапролДж +фывапролдЖ +фывапролдж +SELECT * FROM t1 WHERE a LIKE 'фЫва%' COLLATE utf16_bin ORDER BY BINARY a; +a +фЫва +фЫвапролдж +DROP TABLE t1; +CREATE TABLE t1 (word varchar(64) NOT NULL, PRIMARY KEY (word)) +CHARACTER SET utf16; +INSERT INTO t1 (word) VALUES ("cat"); +SELECT * FROM t1 WHERE word LIKE "c%"; +word +cat +SELECT * FROM t1 WHERE word LIKE "ca_"; +word +cat +SELECT * FROM t1 WHERE word LIKE "cat"; +word +cat +SELECT * FROM t1 WHERE word LIKE _utf16 x'00630025'; +word +cat +SELECT * FROM t1 WHERE word LIKE _utf16 x'00630061005F'; +word +cat +DROP TABLE t1; +select insert(_utf16 0x006100620063,10,2,_utf16 0x006400650066); +insert(_utf16 0x006100620063,10,2,_utf16 0x006400650066) +abc +select insert(_utf16 0x006100620063,1,2,_utf16 0x006400650066); +insert(_utf16 0x006100620063,1,2,_utf16 0x006400650066) +defc +SELECT hex(cast(0xAA as char character set utf16)); +hex(cast(0xAA as char character set utf16)) +00AA +SELECT hex(convert(0xAA using utf16)); +hex(convert(0xAA using utf16)) +00AA +CREATE TABLE t1 (a char(10) character set utf16); +INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111); +SELECT HEX(a) FROM t1; +HEX(a) +0001 +0011 +0111 +1111 +00011111 +DROP TABLE t1; +CREATE TABLE t1 (a varchar(10) character set utf16); +INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111); +SELECT HEX(a) FROM t1; +HEX(a) +0001 +0011 +0111 +1111 +00011111 +DROP TABLE t1; +CREATE TABLE t1 (a text character set utf16); +INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111); +SELECT HEX(a) FROM t1; +HEX(a) +0001 +0011 +0111 +1111 +00011111 +DROP TABLE t1; +CREATE TABLE t1 (a mediumtext character set utf16); +INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111); +SELECT HEX(a) FROM t1; +HEX(a) +0001 +0011 +0111 +1111 +00011111 +DROP TABLE t1; +CREATE TABLE t1 (a longtext character set utf16); +INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111); +SELECT HEX(a) FROM t1; +HEX(a) +0001 +0011 +0111 +1111 +00011111 +DROP TABLE t1; +create table t1(a char(1)) default charset utf16; +insert into t1 values ('a'),('b'),('c'); +alter table t1 modify a char(5); +select a, hex(a) from t1; +a hex(a) +a 0061 +b 0062 +c 0063 +drop table t1; +set names latin1; +set @ivar= 1234; +set @str1 = 'select ?'; +set @str2 = convert(@str1 using utf16); +prepare stmt1 from @str2; +execute stmt1 using @ivar; +? +1234 +set names utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +create table t1 (a enum('x','y','z') character set utf16); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('x','y','z') CHARACTER SET utf16 COLLATE utf16_general_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +insert into t1 values ('x'); +insert into t1 values ('y'); +insert into t1 values ('z'); +select a, hex(a) from t1 order by a; +a hex(a) +x 0078 +y 0079 +z 007A +alter table t1 change a a enum('x','y','z','d','e','ä','ö','ü') character set utf16; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('x','y','z','d','e','ä','ö','ü') CHARACTER SET utf16 COLLATE utf16_general_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +insert into t1 values ('D'); +insert into t1 values ('E '); +insert into t1 values ('ä'); +insert into t1 values ('ö'); +insert into t1 values ('ü'); +select a, hex(a) from t1 order by a; +a hex(a) +x 0078 +y 0079 +z 007A +d 0064 +e 0065 +ä 00E4 +ö 00F6 +ü 00FC +drop table t1; +create table t1 (a set ('x','y','z','ä','ö','ü') character set utf16); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` set('x','y','z','ä','ö','ü') CHARACTER SET utf16 COLLATE utf16_general_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +insert into t1 values ('x'); +insert into t1 values ('y'); +insert into t1 values ('z'); +insert into t1 values ('x,y'); +insert into t1 values ('x,y,z,ä,ö,ü'); +select a, hex(a) from t1 order by a; +a hex(a) +x 0078 +y 0079 +x,y 0078002C0079 +z 007A +x,y,z,ä,ö,ü 0078002C0079002C007A002C00E4002C00F6002C00FC +drop table t1; +create table t1(a enum('a','b','c')) default character set utf16; +insert into t1 values('a'),('b'),('c'); +alter table t1 add b char(1); +show warnings; +Level Code Message +select * from t1 order by a; +a b +a NULL +b NULL +c NULL +drop table t1; +SET NAMES latin1; +SET collation_connection='utf16_general_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +utf16_general_ci 00610009 +utf16_general_ci 0061 +utf16_general_ci 00610020 +drop table t1; +select @@collation_connection; +@@collation_connection +utf16_general_ci +create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ; +insert into t1 values('abcdef'); +insert into t1 values('_bcdef'); +insert into t1 values('a_cdef'); +insert into t1 values('ab_def'); +insert into t1 values('abc_ef'); +insert into t1 values('abcd_f'); +insert into t1 values('abcde_'); +select c1 as c1u from t1 where c1 like 'ab\_def'; +c1u +ab_def +select c1 as c2h from t1 where c1 like 'ab#_def' escape '#'; +c2h +ab_def +drop table t1; +SET NAMES latin1; +SET collation_connection='utf16_bin'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +utf16_bin 00610009 +utf16_bin 0061 +utf16_bin 00610020 +drop table t1; +# +# Bug#55980 Character sets: supplementary character _bin ordering is wrong +# +CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1) CHARACTER SET utf16 COLLATE utf16_bin DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +INSERT INTO t1 VALUES (_utf8mb4 0xEFBE9D),(_utf8mb4 0xF0908E84); +INSERT INTO t1 VALUES (_utf8mb4 0xCE85),(_utf8mb4 0xF4808080); +SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a; +HEX(a) HEX(CONVERT(a USING utf8mb4)) +0385 CE85 +FF9D EFBE9D +D800DF84 F0908E84 +DBC0DC00 F4808080 +ALTER TABLE t1 ADD KEY(a); +SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a; +HEX(a) HEX(CONVERT(a USING utf8mb4)) +0385 CE85 +FF9D EFBE9D +D800DF84 F0908E84 +DBC0DC00 F4808080 +# Additional test for bug#37244 Character sets: short utf8_bin weight_string value +SELECT HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 ORDER BY a; +HEX(a) HEX(WEIGHT_STRING(a)) +0385 000385 +FF9D 00FF9D +D800DF84 010384 +DBC0DC00 100000 +DROP TABLE IF EXISTS t1; +# +# BUG#16691598 - ORDER BY LOWER(COLUMN) PRODUCES +# OUT-OF-ORDER RESULTS +# +CREATE TABLE t1 SELECT ('a a') as n; +INSERT INTO t1 VALUES('a b'); +SELECT * FROM t1 ORDER BY LOWER(n) ASC; +n +a a +a b +SELECT * FROM t1 ORDER BY LOWER(n) DESC; +n +a b +a a +DROP TABLE t1; +select @@collation_connection; +@@collation_connection +utf16_bin +create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ; +insert into t1 values('abcdef'); +insert into t1 values('_bcdef'); +insert into t1 values('a_cdef'); +insert into t1 values('ab_def'); +insert into t1 values('abc_ef'); +insert into t1 values('abcd_f'); +insert into t1 values('abcde_'); +select c1 as c1u from t1 where c1 like 'ab\_def'; +c1u +ab_def +select c1 as c2h from t1 where c1 like 'ab#_def' escape '#'; +c2h +ab_def +drop table t1; +select hex(substr(_utf16 0x00e400e50068,1)); +hex(substr(_utf16 0x00e400e50068,1)) +00E400E50068 +select hex(substr(_utf16 0x00e400e50068,2)); +hex(substr(_utf16 0x00e400e50068,2)) +00E50068 +select hex(substr(_utf16 0x00e400e50068,3)); +hex(substr(_utf16 0x00e400e50068,3)) +0068 +select hex(substr(_utf16 0x00e400e50068,-1)); +hex(substr(_utf16 0x00e400e50068,-1)) +0068 +select hex(substr(_utf16 0x00e400e50068,-2)); +hex(substr(_utf16 0x00e400e50068,-2)) +00E50068 +select hex(substr(_utf16 0x00e400e50068,-3)); +hex(substr(_utf16 0x00e400e50068,-3)) +00E400E50068 +select hex(substr(_utf16 0x00e400e5D800DC00,1)); +hex(substr(_utf16 0x00e400e5D800DC00,1)) +00E400E5D800DC00 +select hex(substr(_utf16 0x00e400e5D800DC00,2)); +hex(substr(_utf16 0x00e400e5D800DC00,2)) +00E5D800DC00 +select hex(substr(_utf16 0x00e400e5D800DC00,3)); +hex(substr(_utf16 0x00e400e5D800DC00,3)) +D800DC00 +select hex(substr(_utf16 0x00e400e5D800DC00,-1)); +hex(substr(_utf16 0x00e400e5D800DC00,-1)) +D800DC00 +select hex(substr(_utf16 0x00e400e5D800DC00,-2)); +hex(substr(_utf16 0x00e400e5D800DC00,-2)) +00E5D800DC00 +select hex(substr(_utf16 0x00e400e5D800DC00,-3)); +hex(substr(_utf16 0x00e400e5D800DC00,-3)) +00E400E5D800DC00 +SET NAMES latin1; +create table t1 (utext varchar(20) character set utf16); +insert into t1 values ("lily"); +insert into t1 values ("river"); +prepare stmt from 'select utext from t1 where utext like ?'; +set @param1='%%'; +execute stmt using @param1; +utext +lily +river +execute stmt using @param1; +utext +lily +river +select utext from t1 where utext like '%%'; +utext +lily +river +drop table t1; +deallocate prepare stmt; +CREATE TABLE t1 ( +status enum('active','passive') character set utf16 collate utf16_general_ci +NOT NULL default 'passive' +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `status` enum('active','passive') CHARACTER SET utf16 COLLATE utf16_general_ci NOT NULL DEFAULT 'passive' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +ALTER TABLE t1 ADD a int NOT NULL AFTER status; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `status` enum('active','passive') CHARACTER SET utf16 COLLATE utf16_general_ci NOT NULL DEFAULT 'passive', + `a` int NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +DROP TABLE t1; +End of 4.1 tests +CREATE TABLE t1 (a varchar(64) character set utf16, b decimal(10,3)); +INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0); +update t1 set b=a; +SELECT *, hex(a) FROM t1; +a b hex(a) +1.1 1.100 0031002E0031 +2.1 2.100 0032002E0031 +DROP TABLE t1; +create table t1 (utext varchar(20) character set utf16); +insert into t1 values ("lily"); +insert into t1 values ("river"); +prepare stmt from 'select utext from t1 where utext like ?'; +set @param1='%%'; +execute stmt using @param1; +utext +lily +river +execute stmt using @param1; +utext +lily +river +select utext from t1 where utext like '%%'; +utext +lily +river +drop table t1; +deallocate prepare stmt; +set names latin1; +set character_set_connection=utf16; +select soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb'); +soundex('') soundex('he') soundex('hello all folks') soundex('#3556 in bugdb') + H000 H4142 I51231 +select hex(soundex('')),hex(soundex('he')),hex(soundex('hello all folks')),hex(soundex('#3556 in bugdb')); +hex(soundex('')) hex(soundex('he')) hex(soundex('hello all folks')) hex(soundex('#3556 in bugdb')) + 0048003000300030 00480034003100340032 004900350031003200330031 +select 'mood' sounds like 'mud'; +'mood' sounds like 'mud' +1 +select hex(soundex(_utf16 0x041004110412)); +hex(soundex(_utf16 0x041004110412)) +0410003000300030 +select hex(soundex(_utf16 0x00BF00C0)); +hex(soundex(_utf16 0x00BF00C0)) +00C0003000300030 +set names latin1; +create table t1(a blob, b text charset utf16); +select data_type, character_octet_length, character_maximum_length +from information_schema.columns where table_name='t1'; +DATA_TYPE CHARACTER_OCTET_LENGTH CHARACTER_MAXIMUM_LENGTH +blob 65535 65535 +text 65535 32767 +drop table t1; +set names latin1; +set collation_connection=utf16_general_ci; +select position('bb' in 'abba'); +position('bb' in 'abba') +2 +create table t1 (a varchar(10) character set utf16) engine=heap; +insert into t1 values ('a'),('A'),('b'),('B'); +select * from t1 where a='a' order by binary a; +a +A +a +select hex(min(binary a)),count(*) from t1 group by a; +hex(min(binary a)) count(*) +0041 2 +0042 2 +drop table t1; +select char_length('abcd'), octet_length('abcd'); +char_length('abcd') octet_length('abcd') +4 8 +select char_length(_utf16 0xD800DC00), octet_length(_utf16 0xD800DC00); +char_length(_utf16 0xD800DC00) octet_length(_utf16 0xD800DC00) +1 4 +select char_length(_utf16 0xD87FDFFF), octet_length(_utf16 0xD87FDFFF); +char_length(_utf16 0xD87FDFFF) octet_length(_utf16 0xD87FDFFF) +1 4 +select left('abcd',2); +left('abcd',2) +ab +select hex(left(_utf16 0xD800DC00D87FDFFF, 1)); +hex(left(_utf16 0xD800DC00D87FDFFF, 1)) +D800DC00 +select hex(right(_utf16 0xD800DC00D87FDFFF, 1)); +hex(right(_utf16 0xD800DC00D87FDFFF, 1)) +D87FDFFF +create table t1 (a varchar(10) character set utf16); +insert into t1 values (_utf16 0xD800); +ERROR HY000: Invalid utf16 character string: 'D800' +insert into t1 values (_utf16 0xDC00); +ERROR HY000: Invalid utf16 character string: 'DC00' +insert into t1 values (_utf16 0xD800D800); +ERROR HY000: Invalid utf16 character string: 'D800D8' +insert into t1 values (_utf16 0xD800E800); +ERROR HY000: Invalid utf16 character string: 'D800E8' +insert into t1 values (_utf16 0xD8000800); +ERROR HY000: Invalid utf16 character string: 'D80008' +insert into t1 values (_utf16 0xD800DC00); +insert into t1 values (_utf16 0xD800DCFF); +insert into t1 values (_utf16 0xDBFFDC00); +insert into t1 values (_utf16 0xDBFFDCFF); +select hex(a) from t1; +hex(a) +D800DC00 +D800DCFF +DBFFDC00 +DBFFDCFF +drop table t1; +SET sql_mode = ''; +create table t1 (s1 varchar(50) character set ucs2); +insert into t1 values (0xdf84); +alter table t1 modify column s1 varchar(50) character set utf16; +Warnings: +Warning 1366 Incorrect string value: '\xDF\x84' for column 's1' at row 1 +select hex(s1) from t1; +hex(s1) +003F +drop table t1; +SET sql_mode = default; +create table t1 (s1 varchar(5) character set ucs2, s2 varchar(5) character set utf16); +insert into t1 (s1) values (0xdf84); +update ignore t1 set s2 = s1; +Warnings: +Warning 1366 Incorrect string value: '\xDF\x84' for column 's2' at row 1 +select hex(s2) from t1; +hex(s2) +003F +drop table t1; +create table t1 (a char(10)) character set utf16; +insert into t1 values ('a '); +select hex(a) from t1; +hex(a) +0061 +drop table t1; +select upper('abcd'), lower('ABCD'); +upper('abcd') lower('ABCD') +ABCD abcd +create table t1 (a varchar(10) character set utf16); +insert into t1 values (123456); +select a, hex(a) from t1; +a hex(a) +123456 003100320033003400350036 +drop table t1; +select hex(soundex('a')); +hex(soundex('a')) +0041003000300030 +create table t1 (a enum ('a','b','c')) character set utf16; +insert into t1 values ('1'); +select * from t1; +a +a +drop table t1; +set names latin1; +select hex(conv(convert('123' using utf16), -10, 16)); +hex(conv(convert('123' using utf16), -10, 16)) +3742 +select hex(conv(convert('123' using utf16), 10, 16)); +hex(conv(convert('123' using utf16), 10, 16)) +3742 +set names latin1; +set character_set_connection=utf16; +select 1.1 + '1.2'; +1.1 + '1.2' +2.3 +select 1.1 + '1.2xxx'; +1.1 + '1.2xxx' +2.3 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: '1.2xxx' +select left('aaa','1'); +left('aaa','1') +a +create table t1 (a int); +insert into t1 values ('-1234.1e2'); +insert ignore into t1 values ('-1234.1e2xxxx'); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +insert into t1 values ('-1234.1e2 '); +select * from t1; +a +-123410 +-123410 +-123410 +drop table t1; +create table t1 (a int); +insert into t1 values ('1 '); +insert ignore into t1 values ('1 x'); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +select * from t1; +a +1 +1 +drop table t1; +SET sql_mode = ''; +create table t1 (a varchar(17000) character set utf16); +Warnings: +Note 1246 Converting column 'a' from VARCHAR to TEXT +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumtext CHARACTER SET utf16 COLLATE utf16_general_ci +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +SET sql_mode = default; +create table t1 (a varchar(150) character set utf16 primary key); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(150) CHARACTER SET utf16 COLLATE utf16_general_ci NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +create table t1 (a varchar(334) character set utf16 primary key) ROW_FORMAT=COMPACT; +ERROR 42000: Specified key was too long; max key length is 767 bytes +create table t1 (a char(1) character set utf16); +insert into t1 values (0xD800DC00),(0xD800DCFF),(0xDB7FDC00),(0xDB7FDCFF); +insert into t1 values (0x00C0), (0x00FF),(0xE000), (0xFFFF); +select hex(a), hex(@a:=convert(a using utf8mb4)), hex(convert(@a using utf16)) from t1; +hex(a) hex(@a:=convert(a using utf8mb4)) hex(convert(@a using utf16)) +00C0 C380 00C0 +00FF C3BF 00FF +D800DC00 F0908080 D800DC00 +D800DCFF F09083BF D800DCFF +DB7FDC00 F3AFB080 DB7FDC00 +DB7FDCFF F3AFB3BF DB7FDCFF +E000 EE8080 E000 +FFFF EFBFBF FFFF +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warnings: +drop table t1; +set collation_connection=utf16_general_ci; +drop table if exists t1; +create table t1 as +select repeat(' ', 64) as s1, repeat(' ',64) as s2 +union +select null, null; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `s1` varchar(64) CHARACTER SET utf16 DEFAULT NULL, + `s2` varchar(64) CHARACTER SET utf16 DEFAULT NULL +) ENGINE=default_engine DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +delete from t1; +insert into t1 values('aaa','aaa'); +insert into t1 values('aaa|qqq','qqq'); +insert into t1 values('gheis','^[^a-dXYZ]+$'); +insert into t1 values('aab','^aa?b'); +insert into t1 values('Baaan','^Ba*n'); +insert into t1 values('aaa','qqq|aaa'); +insert into t1 values('qqq','qqq|aaa'); +insert into t1 values('bbb','qqq|aaa'); +insert into t1 values('bbb','qqq'); +insert into t1 values('aaa','aba'); +insert into t1 values(null,'abc'); +insert into t1 values('def',null); +insert into t1 values(null,null); +select HIGH_PRIORITY s1 regexp s2 from t1; +s1 regexp s2 +1 +1 +1 +1 +1 +1 +1 +0 +0 +0 +NULL +NULL +NULL +SELECT 'ghi' REGEXP 'ghi['; +ERROR HY000: The regular expression contains an unclosed bracket expression. +drop table t1; +set names latin1; +SET collation_connection=utf16_general_ci; +CREATE TABLE t1 AS SELECT repeat('a',20) AS s1 LIMIT 0; +SET timestamp=1216359724; +INSERT INTO t1 VALUES (current_date); +INSERT INTO t1 VALUES (current_time); +INSERT INTO t1 VALUES (current_timestamp); +SELECT s1, hex(s1) FROM t1; +s1 hex(s1) +2008-07-18 0032003000300038002D00300037002D00310038 +08:42:04 00300038003A00340032003A00300034 +2008-07-18 08:42:04 0032003000300038002D00300037002D00310038002000300038003A00340032003A00300034 +DROP TABLE t1; +SET timestamp=0; +SET NAMES latin1; +SET collation_connection=utf16_general_ci; +CREATE TABLE t1 AS SELECT repeat('a',2) as s1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `s1` varchar(2) CHARACTER SET utf16 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +INSERT INTO t1 VALUES ('ab'),('AE'),('ab'),('AE'); +SELECT * FROM t1 ORDER BY s1; +s1 +ab +ab +AE +AE +SET max_sort_length=4; +SELECT * FROM t1 ORDER BY s1; +s1 +ab +ab +AE +AE +DROP TABLE t1; +SET max_sort_length=DEFAULT; +SET NAMES latin1; +# +# Bug#52520 Difference in tinytext utf column metadata +# +CREATE TABLE t1 ( +s1 TINYTEXT CHARACTER SET utf16, +s2 TEXT CHARACTER SET utf16, +s3 MEDIUMTEXT CHARACTER SET utf16, +s4 LONGTEXT CHARACTER SET utf16 +); +SET NAMES utf8, @@character_set_results=NULL; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT *, HEX(s1) FROM t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 s1 s1 252 255 0 Y 16 0 54 +def test t1 t1 s2 s2 252 65535 0 Y 16 0 54 +def test t1 t1 s3 s3 252 16777215 0 Y 16 0 54 +def test t1 t1 s4 s4 252 4294967295 0 Y 16 0 54 +def HEX(s1) 253 6120 0 Y 0 31 33 +s1 s2 s3 s4 HEX(s1) +SET NAMES latin1; +SELECT *, HEX(s1) FROM t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 s1 s1 252 127 0 Y 16 0 8 +def test t1 t1 s2 s2 252 32767 0 Y 16 0 8 +def test t1 t1 s3 s3 252 8388607 0 Y 16 0 8 +def test t1 t1 s4 s4 252 2147483647 0 Y 16 0 8 +def HEX(s1) 253 2040 0 Y 0 31 8 +s1 s2 s3 s4 HEX(s1) +SET NAMES utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT *, HEX(s1) FROM t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 s1 s1 252 381 0 Y 16 0 33 +def test t1 t1 s2 s2 252 98301 0 Y 16 0 33 +def test t1 t1 s3 s3 252 25165821 0 Y 16 0 33 +def test t1 t1 s4 s4 252 4294967295 0 Y 16 0 33 +def HEX(s1) 253 6120 0 Y 0 31 33 +s1 s2 s3 s4 HEX(s1) +CREATE TABLE t2 AS SELECT CONCAT(s1) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `CONCAT(s1)` varchar(255) CHARACTER SET utf16 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +DROP TABLE t1, t2; +# +# Bug#11753363 (Bug#44793) Character sets: case clause, ucs2 or utf32, failure +# +SELECT CASE _latin1'a' WHEN _utf16'a' THEN 'A' END; +CASE _latin1'a' WHEN _utf16'a' THEN 'A' END +A +SELECT CASE _utf16'a' WHEN _latin1'a' THEN 'A' END; +CASE _utf16'a' WHEN _latin1'a' THEN 'A' END +A +CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET utf16); +INSERT INTO t1 VALUES ('a'); +SELECT CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END FROM t1; +CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END +b +DROP TABLE t1; +# +# Bug#12340997 +# DATE_ADD/DATE_SUB WITH INTERVAL CRASHES IN GET_INTERVAL_VALUE() +# +SELECT space(date_add(101, INTERVAL CHAR('1' USING utf16) hour_second)); +space(date_add(101, INTERVAL CHAR('1' USING utf16) hour_second)) +NULL +Warnings: +Warning 1301 Result of space() was larger than max_allowed_packet (67108864) - truncated +# +# Bug#11750518 41090: ORDER BY TRUNCATES GROUP_CONCAT RESULT +# +SET NAMES utf8, @@character_set_connection=utf16; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT id, CHAR_LENGTH(GROUP_CONCAT(body)) AS l +FROM (SELECT 'a' AS id, REPEAT('foo bar', 100) AS body +UNION ALL +SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1 +GROUP BY id +ORDER BY l DESC; +id l +a 512 +Warnings: +Warning 1260 Row 1 was cut by GROUP_CONCAT() +# +# End of 5.5 tests +# +# +# Start of 5.6 tests +# +# +# WL#3664 WEIGHT_STRING +# +set collation_connection=utf16_general_ci; +select @@collation_connection; +@@collation_connection +utf16_general_ci +select hex(weight_string('a')); +hex(weight_string('a')) +0041 +select hex(weight_string('A')); +hex(weight_string('A')) +0041 +select hex(weight_string('abc')); +hex(weight_string('abc')) +004100420043 +select hex(weight_string('abc' as char(2))); +hex(weight_string('abc' as char(2))) +00410042 +select hex(weight_string('abc' as char(3))); +hex(weight_string('abc' as char(3))) +004100420043 +select hex(weight_string('abc' as char(5))); +hex(weight_string('abc' as char(5))) +00410042004300200020 +select hex(weight_string('abc', 1, 2, 0xC0)); +hex(weight_string('abc', 1, 2, 0xC0)) +00 +select hex(weight_string('abc', 2, 2, 0xC0)); +hex(weight_string('abc', 2, 2, 0xC0)) +0041 +select hex(weight_string('abc', 3, 2, 0xC0)); +hex(weight_string('abc', 3, 2, 0xC0)) +004100 +select hex(weight_string('abc', 4, 2, 0xC0)); +hex(weight_string('abc', 4, 2, 0xC0)) +00410042 +select hex(weight_string('abc', 5, 2, 0xC0)); +hex(weight_string('abc', 5, 2, 0xC0)) +0041004200 +select hex(weight_string('abc',25, 2, 0xC0)); +hex(weight_string('abc',25, 2, 0xC0)) +00410042002000200020002000200020002000200020002000 +select hex(weight_string('abc', 1, 3, 0xC0)); +hex(weight_string('abc', 1, 3, 0xC0)) +00 +select hex(weight_string('abc', 2, 3, 0xC0)); +hex(weight_string('abc', 2, 3, 0xC0)) +0041 +select hex(weight_string('abc', 3, 3, 0xC0)); +hex(weight_string('abc', 3, 3, 0xC0)) +004100 +select hex(weight_string('abc', 4, 3, 0xC0)); +hex(weight_string('abc', 4, 3, 0xC0)) +00410042 +select hex(weight_string('abc', 5, 3, 0xC0)); +hex(weight_string('abc', 5, 3, 0xC0)) +0041004200 +select hex(weight_string('abc',25, 3, 0xC0)); +hex(weight_string('abc',25, 3, 0xC0)) +00410042004300200020002000200020002000200020002000 +select hex(weight_string('abc', 1, 4, 0xC0)); +hex(weight_string('abc', 1, 4, 0xC0)) +00 +select hex(weight_string('abc', 2, 4, 0xC0)); +hex(weight_string('abc', 2, 4, 0xC0)) +0041 +select hex(weight_string('abc', 3, 4, 0xC0)); +hex(weight_string('abc', 3, 4, 0xC0)) +004100 +select hex(weight_string('abc', 4, 4, 0xC0)); +hex(weight_string('abc', 4, 4, 0xC0)) +00410042 +select hex(weight_string('abc', 5, 4, 0xC0)); +hex(weight_string('abc', 5, 4, 0xC0)) +0041004200 +select hex(weight_string('abc',25, 4, 0xC0)); +hex(weight_string('abc',25, 4, 0xC0)) +00410042004300200020002000200020002000200020002000 +select @@collation_connection; +@@collation_connection +utf16_general_ci +select hex(weight_string(cast(_latin1 0x80 as char))); +hex(weight_string(cast(_latin1 0x80 as char))) +20AC +select hex(weight_string(cast(_latin1 0x808080 as char))); +hex(weight_string(cast(_latin1 0x808080 as char))) +20AC20AC20AC +select hex(weight_string(cast(_latin1 0x808080 as char) as char(2))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(2))) +20AC20AC +select hex(weight_string(cast(_latin1 0x808080 as char) as char(3))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(3))) +20AC20AC20AC +select hex(weight_string(cast(_latin1 0x808080 as char) as char(5))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(5))) +20AC20AC20AC00200020 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)) +20 +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)) +20AC +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)) +20AC20 +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)) +20AC20AC +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)) +20AC20AC00 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)) +20AC20AC002000200020002000200020002000200020002000 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)) +20 +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)) +20AC +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)) +20AC20 +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)) +20AC20AC +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)) +20AC20AC20 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)) +20AC20AC20AC00200020002000200020002000200020002000 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)) +20 +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)) +20AC +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)) +20AC20 +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)) +20AC20AC +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)) +20AC20AC20 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)) +20AC20AC20AC00200020002000200020002000200020002000 +select hex(weight_string(_utf16 0xD800DC00)); +hex(weight_string(_utf16 0xD800DC00)) +FFFD +select hex(weight_string(_utf16 0xD800DC01)); +hex(weight_string(_utf16 0xD800DC01)) +FFFD +set collation_connection=utf16_bin; +select @@collation_connection; +@@collation_connection +utf16_bin +select hex(weight_string('a')); +hex(weight_string('a')) +000061 +select hex(weight_string('A')); +hex(weight_string('A')) +000041 +select hex(weight_string('abc')); +hex(weight_string('abc')) +000061000062000063 +select hex(weight_string('abc' as char(2))); +hex(weight_string('abc' as char(2))) +000061000062 +select hex(weight_string('abc' as char(3))); +hex(weight_string('abc' as char(3))) +000061000062000063 +select hex(weight_string('abc' as char(5))); +hex(weight_string('abc' as char(5))) +000061000062000063000020000020 +select hex(weight_string('abc', 1, 2, 0xC0)); +hex(weight_string('abc', 1, 2, 0xC0)) +00 +select hex(weight_string('abc', 2, 2, 0xC0)); +hex(weight_string('abc', 2, 2, 0xC0)) +0000 +select hex(weight_string('abc', 3, 2, 0xC0)); +hex(weight_string('abc', 3, 2, 0xC0)) +000061 +select hex(weight_string('abc', 4, 2, 0xC0)); +hex(weight_string('abc', 4, 2, 0xC0)) +00006100 +select hex(weight_string('abc', 5, 2, 0xC0)); +hex(weight_string('abc', 5, 2, 0xC0)) +0000610000 +select hex(weight_string('abc',25, 2, 0xC0)); +hex(weight_string('abc',25, 2, 0xC0)) +00006100006200002000002000002000002000002000002000 +select hex(weight_string('abc', 1, 3, 0xC0)); +hex(weight_string('abc', 1, 3, 0xC0)) +00 +select hex(weight_string('abc', 2, 3, 0xC0)); +hex(weight_string('abc', 2, 3, 0xC0)) +0000 +select hex(weight_string('abc', 3, 3, 0xC0)); +hex(weight_string('abc', 3, 3, 0xC0)) +000061 +select hex(weight_string('abc', 4, 3, 0xC0)); +hex(weight_string('abc', 4, 3, 0xC0)) +00006100 +select hex(weight_string('abc', 5, 3, 0xC0)); +hex(weight_string('abc', 5, 3, 0xC0)) +0000610000 +select hex(weight_string('abc',25, 3, 0xC0)); +hex(weight_string('abc',25, 3, 0xC0)) +00006100006200006300002000002000002000002000002000 +select hex(weight_string('abc', 1, 4, 0xC0)); +hex(weight_string('abc', 1, 4, 0xC0)) +00 +select hex(weight_string('abc', 2, 4, 0xC0)); +hex(weight_string('abc', 2, 4, 0xC0)) +0000 +select hex(weight_string('abc', 3, 4, 0xC0)); +hex(weight_string('abc', 3, 4, 0xC0)) +000061 +select hex(weight_string('abc', 4, 4, 0xC0)); +hex(weight_string('abc', 4, 4, 0xC0)) +00006100 +select hex(weight_string('abc', 5, 4, 0xC0)); +hex(weight_string('abc', 5, 4, 0xC0)) +0000610000 +select hex(weight_string('abc',25, 4, 0xC0)); +hex(weight_string('abc',25, 4, 0xC0)) +00006100006200006300002000002000002000002000002000 +select @@collation_connection; +@@collation_connection +utf16_bin +select hex(weight_string(cast(_latin1 0x80 as char))); +hex(weight_string(cast(_latin1 0x80 as char))) +0020AC +select hex(weight_string(cast(_latin1 0x808080 as char))); +hex(weight_string(cast(_latin1 0x808080 as char))) +0020AC0020AC0020AC +select hex(weight_string(cast(_latin1 0x808080 as char) as char(2))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(2))) +0020AC0020AC +select hex(weight_string(cast(_latin1 0x808080 as char) as char(3))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(3))) +0020AC0020AC0020AC +select hex(weight_string(cast(_latin1 0x808080 as char) as char(5))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(5))) +0020AC0020AC0020AC000020000020 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)) +00 +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)) +0020 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)) +0020AC +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)) +0020AC00 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)) +0020AC0020 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)) +0020AC0020AC00002000002000002000002000002000002000 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)) +00 +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)) +0020 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)) +0020AC +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)) +0020AC00 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)) +0020AC0020 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)) +0020AC0020AC0020AC00002000002000002000002000002000 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)) +00 +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)) +0020 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)) +0020AC +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)) +0020AC00 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)) +0020AC0020 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)) +0020AC0020AC0020AC00002000002000002000002000002000 +# +# End of 5.6 tests +# diff --git a/mysql-test/r/ctype_utf16_uca.result-pq b/mysql-test/r/ctype_utf16_uca.result-pq new file mode 100644 index 000000000000..81db27e5922e --- /dev/null +++ b/mysql-test/r/ctype_utf16_uca.result-pq @@ -0,0 +1,3597 @@ +DROP TABLE IF EXISTS t1; +# +# Start of 5.5 tests +# +set names utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +set collation_connection=utf16_unicode_ci; +select hex('a'), hex('a '); +hex('a') hex('a ') +0061 00610020 +select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; +'a' = 'a' 'a' = 'a ' 'a ' = 'a' +1 1 1 +select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a'; +'a\0' = 'a' 'a\0' < 'a' 'a\0' > 'a' +1 0 0 +select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0'; +'a' = 'a\0' 'a' < 'a\0' 'a' > 'a\0' +1 0 0 +select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a '; +'a\0' = 'a ' 'a\0' < 'a ' 'a\0' > 'a ' +1 0 0 +select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0'; +'a ' = 'a\0' 'a ' < 'a\0' 'a ' > 'a\0' +1 0 0 +select 'a a' > 'a', 'a \0' < 'a'; +'a a' > 'a' 'a \0' < 'a' +1 0 +select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a'; +binary 'a a' > 'a' binary 'a \0' > 'a' binary 'a\0' > 'a' +1 1 1 +select 'c' like '\_' as want0; +want0 +0 +create table t1 (c1 char(10) character set utf16 collate utf16_bin); +insert into t1 values ('A'),('a'); +insert into t1 values ('B'),('b'); +insert into t1 values ('C'),('c'); +insert into t1 values ('D'),('d'); +insert into t1 values ('E'),('e'); +insert into t1 values ('F'),('f'); +insert into t1 values ('G'),('g'); +insert into t1 values ('H'),('h'); +insert into t1 values ('I'),('i'); +insert into t1 values ('J'),('j'); +insert into t1 values ('K'),('k'); +insert into t1 values ('L'),('l'); +insert into t1 values ('M'),('m'); +insert into t1 values ('N'),('n'); +insert into t1 values ('O'),('o'); +insert into t1 values ('P'),('p'); +insert into t1 values ('Q'),('q'); +insert into t1 values ('R'),('r'); +insert into t1 values ('S'),('s'); +insert into t1 values ('T'),('t'); +insert into t1 values ('U'),('u'); +insert into t1 values ('V'),('v'); +insert into t1 values ('W'),('w'); +insert into t1 values ('X'),('x'); +insert into t1 values ('Y'),('y'); +insert into t1 values ('Z'),('z'); +insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0); +insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1); +insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2); +insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3); +insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4); +insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5); +insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6); +insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7); +insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8); +insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9); +insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca); +insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb); +insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc); +insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd); +insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce); +insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf); +insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0); +insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1); +insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2); +insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3); +insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4); +insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5); +insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6); +insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7); +insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8); +insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9); +insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da); +insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db); +insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc); +insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd); +insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de); +insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df); +insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103); +insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107); +insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b); +insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f); +insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113); +insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117); +insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b); +insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f); +insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123); +insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127); +insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b); +insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f); +insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133); +insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137); +insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b); +insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f); +insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143); +insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147); +insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b); +insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f); +insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153); +insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157); +insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b); +insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f); +insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163); +insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167); +insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b); +insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f); +insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173); +insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177); +insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b); +insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f); +insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183); +insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187); +insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b); +insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f); +insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193); +insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197); +insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b); +insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f); +insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3); +insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7); +insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab); +insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af); +insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3); +insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7); +insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb); +insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf); +insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3); +insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7); +insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb); +insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf); +insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3); +insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7); +insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db); +insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df); +insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3); +insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7); +insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb); +insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef); +insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3); +insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7); +insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb); +insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff); +INSERT INTO t1 VALUES (_ucs2 0x1EA0),(_ucs2 0x1EA1),(_ucs2 0x1EA2),(_ucs2 0x1EA3); +INSERT INTO t1 VALUES (_ucs2 0x1EA4),(_ucs2 0x1EA5),(_ucs2 0x1EA6),(_ucs2 0x1EA7); +INSERT INTO t1 VALUES (_ucs2 0x1EA8),(_ucs2 0x1EA9),(_ucs2 0x1EAA),(_ucs2 0x1EAB); +INSERT INTO t1 VALUES (_ucs2 0x1EAC),(_ucs2 0x1EAD),(_ucs2 0x1EAE),(_ucs2 0x1EAF); +INSERT INTO t1 VALUES (_ucs2 0x1EB0),(_ucs2 0x1EB1),(_ucs2 0x1EB2),(_ucs2 0x1EB3); +INSERT INTO t1 VALUES (_ucs2 0x1EB4),(_ucs2 0x1EB5),(_ucs2 0x1EB6),(_ucs2 0x1EB7); +INSERT INTO t1 VALUES (_ucs2 0x1EB8),(_ucs2 0x1EB9),(_ucs2 0x1EBA),(_ucs2 0x1EBB); +INSERT INTO t1 VALUES (_ucs2 0x1EBC),(_ucs2 0x1EBD),(_ucs2 0x1EBE),(_ucs2 0x1EBF); +INSERT INTO t1 VALUES (_ucs2 0x1EC0),(_ucs2 0x1EC1),(_ucs2 0x1EC2),(_ucs2 0x1EC3); +INSERT INTO t1 VALUES (_ucs2 0x1EC4),(_ucs2 0x1EC5),(_ucs2 0x1EC6),(_ucs2 0x1EC7); +INSERT INTO t1 VALUES (_ucs2 0x1EC8),(_ucs2 0x1EC9),(_ucs2 0x1ECA),(_ucs2 0x1ECB); +INSERT INTO t1 VALUES (_ucs2 0x1ECC),(_ucs2 0x1ECD),(_ucs2 0x1ECE),(_ucs2 0x1ECF); +INSERT INTO t1 VALUES (_ucs2 0x1ED0),(_ucs2 0x1ED1),(_ucs2 0x1ED2),(_ucs2 0x1ED3); +INSERT INTO t1 VALUES (_ucs2 0x1ED4),(_ucs2 0x1ED5),(_ucs2 0x1ED6),(_ucs2 0x1ED7); +INSERT INTO t1 VALUES (_ucs2 0x1ED8),(_ucs2 0x1ED9),(_ucs2 0x1EDA),(_ucs2 0x1EDB); +INSERT INTO t1 VALUES (_ucs2 0x1EDC),(_ucs2 0x1EDD),(_ucs2 0x1EDE),(_ucs2 0x1EDF); +INSERT INTO t1 VALUES (_ucs2 0x1EE0),(_ucs2 0x1EE1),(_ucs2 0x1EE2),(_ucs2 0x1EE3); +INSERT INTO t1 VALUES (_ucs2 0x1EE4),(_ucs2 0x1EE5),(_ucs2 0x1EE6),(_ucs2 0x1EE7); +INSERT INTO t1 VALUES (_ucs2 0x1EE8),(_ucs2 0x1EE9),(_ucs2 0x1EEA),(_ucs2 0x1EEB); +INSERT INTO t1 VALUES (_ucs2 0x1EEC),(_ucs2 0x1EED),(_ucs2 0x1EEE),(_ucs2 0x1EEF); +INSERT INTO t1 VALUES (_ucs2 0x1EF0),(_ucs2 0x1EF1); +insert into t1 values ('AA'),('Aa'),('aa'),('aA'); +insert into t1 values ('AE'),('Ae'),('ae'),('aE'); +insert into t1 values ('CH'),('Ch'),('ch'),('cH'); +insert into t1 values ('DZ'),('Dz'),('dz'),('dZ'); +insert into t1 values ('DŽ'),('Dž'),('dž'),('dŽ'); +insert into t1 values ('IJ'),('Ij'),('ij'),('iJ'); +insert into t1 values ('LJ'),('Lj'),('lj'),('lJ'); +insert into t1 values ('LL'),('Ll'),('ll'),('lL'); +insert into t1 values ('NJ'),('Nj'),('nj'),('nJ'); +insert into t1 values ('OE'),('Oe'),('oe'),('oE'); +insert into t1 values ('SS'),('Ss'),('ss'),('sS'); +insert into t1 values ('RR'),('Rr'),('rr'),('rR'); +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_unicode_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_icelandic_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÂÃàâãĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +Áá +ǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Ðð +Đđ +Ɖ +Ɗ +Ƌƌ +EeÈÊËèêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Éé +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÎÏìîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +Íí +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÔÕòôõŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +Óó +Ǿǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÛÜùûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Úú +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÿŶŷŸ +Ýý +Ƴƴ +ZzŹźŻżŽž +ƍ +Þþ +ÄÆäæ +ÖØöø +Åå +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_latvian_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċ +CHChcHch +Čč +Ƈƈ +DdĎď +DZDzdZdzDŽDždžDZDzdz +DŽDždŽdž +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġǦǧǴǵ +Ģģ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +Yy +ı +Ɨ +Ɩ +JjĴĵǰ +KkǨǩ +Ķķ +Ƙƙ +LlĹ弾 +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Ļļ +Łł +ƚ +ƛ +Mm +NnÑñŃńŇňǸǹ +NJNjnJnjNJNjnj +Ņņ +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŘř +RRRrrRrr +Ŗŗ +Ʀ +SsŚśŜŝŞşſ +SSSssSssß +Šš +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +ÝýÿŶŷŸ +Ƴƴ +ZzŹźŻż +ƍ +Žž +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_romanian_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÃÄÅàáãäåĀāĄąǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +Ăă +Ââ +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÏìíïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +Îî +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŠšſ +SSSssSssß +Şş +Ʃ +ƪ +TtŤť +ƾ +Ţţ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_slovenian_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċ +CHChcHch +Čč +Ƈƈ +DdĎď +DZDzdZdzDŽDždžDZDzdz +DŽDždŽdž +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşſ +SSSssSssß +Šš +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻż +ƍ +Žž +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_polish_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂăǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +Ąą +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĈĉĊċČč +CHChcHch +Ćć +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ęę +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŅņŇňǸǹ +NJNjnJnjNJNjnj +Ńń +Ɲ +ƞ +Ŋŋ +OoÒÔÕÖòôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +Óó +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŜŝŞşŠšſ +SSSssSssß +Śś +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŽž +ƍ +Źź +Żż +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_estonian_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÅàáâãåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzdZdz +DŽDždŽdž +DŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔòóôŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşſ +SSSssSssß +Šš +Zz +Žž +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Õõ +Ää +Öö +Üü +Xx +YyÝýÿŶŷŸ +Ƴƴ +ŹźŻż +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_spanish_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ññ +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_swedish_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃàáâãĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕòóôõŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +Ǿǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÜÝüýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Åå +ÄÆäæ +ÖØöø +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_turkish_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcĆćĈĉĊċČč +CHChcHch +Çç +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĠġĢģǦǧǴǵ +Ğğ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +Iı +IJIj +ƕǶ +Ħħ +iÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +iJijIJij +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕòóôõŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +Öö +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŠšſ +SSSssSssß +Şş +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Üü +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_czech_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċ +cH +Čč +Ƈƈ +DdĎď +DZDzdZdzDŽDždžDZDzdz +DŽDždŽdž +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +CHChch +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗ +RRRrrRrr +Řř +Ʀ +SsŚśŜŝŞşſ +SSSssSssß +Šš +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻż +ƍ +Žž +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_danish_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃàáâãĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +aA +AEAeaEae +ǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕòóôõŌōŎŏƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +Ǿǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛùúûŨũŪūŬŭŮůŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÜÝüýÿŰűŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +ÄÆäæ +ÖØöøŐő +AAAaaaÅå +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_lithuanian_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CCHChcchÇçĆćĈĉĊċ +cH +Čč +Ƈƈ +DdĎď +DZDzdZdzDŽDždžDZDzdz +DŽDždŽdž +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IYiyÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşſ +SSSssSssß +Šš +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +ÝýÿŶŷŸ +Ƴƴ +ZzŹźŻż +ƍ +Žž +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_slovak_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÅàáâãåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +Ää +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċ +cH +Čč +Ƈƈ +DdĎď +DZDzdZdzDŽDždžDZDzdz +DŽDždŽdž +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +CHChch +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÕÖòóõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +Ôô +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşſ +SSSssSssß +Šš +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻż +ƍ +Žž +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_spanish2_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +cH +CHChch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +lL +LLLlll +Łł +ƚ +ƛ +Mm +NnŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ññ +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_roman_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IJijÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJij +IJij +ı +Ɨ +Ɩ +Ĵĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJlj +LJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnj +NJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +ÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +UVuv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_esperanto_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĊċČč +CHChcHch +Ĉĉ +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĞğĠġĢģǦǧǴǵ +Ĝĝ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +Hh +Ĥĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +Jjǰ +Ĵĵ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŞşŠšſ +SSSssSssß +Ŝŝ +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ŭŭ +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_hungarian_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕòóôõŌōŎŏƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ÖöŐő +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛùúûŨũŪūŬŭŮůŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +ÜüŰű +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_croatian_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĈĉĊċ +CHChcHch +Čč +Ćć +Ƈƈ +DdĎď +DZDzdZdzDZDzdz +DŽDždŽdžDŽDždž +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LLLllLll +LJLjlJljLJLjlj +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşſ +SSSssSssß +Šš +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻż +ƍ +Žž +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_german2_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÅàáâãåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEaeÄÆäæ +ǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕòóôõŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeÖöŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Üü +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_unicode_520_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEaeÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdÐðĎďĐđ +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Ɖ +Ɗ +Ƌƌ +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥĦħ +ƕǶ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľĿŀŁł +LJLjlJljLJLjlj +LLLllLll +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖØòóôõöøŌōŎŏŐőƠơǑǒǪǫǬǭǾǿỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf16_vietnamese_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÃÄÅàáãäåĀāĄąǍǎǞǟǠǡǺǻẠạẢả +AAAaaAaa +AEAeaEae +ĂăẮắẰằẲẳẴẵẶặ +ÂâẤấẦầẨẩẪẫẬậ +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉËèéëĒēĔĕĖėĘęĚěẸẹẺẻẼẽ +ÊêẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÕÖòóõöŌōŎŏŐőǑǒǪǫǬǭỌọỎỏ +OEOeoEoeŒœ +ÔôỐốỒồỔổỖỗỘộ +ƠơỚớỜờỞởỠỡỢợ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųǓǔǕǖǗǘǙǚǛǜỤụỦủ +ƯưỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +drop table t1; +SET NAMES utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +CREATE TABLE t1 (c varchar(150) CHARACTER SET utf16 COLLATE utf16_general_ci NOT NULL, INDEX (c)); +INSERT INTO t1 VALUES (0x039C03C903B403B11F770308); +SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 COLLATE utf16_general_ci; +c +Μωδαί̈ +INSERT INTO t1 VALUES (0x039C03C903B4); +SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 +COLLATE utf16_general_ci ORDER BY c; +c +Μωδ +Μωδαί̈ +DROP TABLE t1; +CREATE TABLE t1 (c varchar(150) CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL, INDEX (c)); +INSERT INTO t1 VALUES (0x039C03C903B403B11F770308); +SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 COLLATE utf16_unicode_ci; +c +Μωδαί̈ +INSERT INTO t1 VALUES (0x039C03C903B4); +SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 +COLLATE utf16_unicode_ci ORDER BY c; +c +Μωδ +Μωδαί̈ +DROP TABLE t1; +CREATE TABLE t1 (c varchar(150) CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL, INDEX (c)); +INSERT INTO t1 VALUES (0x039C03C903B403B11F770308); +SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 COLLATE utf16_unicode_ci; +c +Μωδαί̈ +INSERT INTO t1 VALUES (0x039C03C903B4); +SELECT * FROM t1 WHERE c LIKE _utf16 0x039C0025 +COLLATE utf16_unicode_ci ORDER BY c; +c +Μωδ +Μωδαί̈ +DROP TABLE t1; +SET NAMES utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SET @test_character_set='utf16'; +SET @test_collation='utf16_swedish_ci'; +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET @safe_character_set_client= @@character_set_client; +SET @safe_character_set_results= @@character_set_results; +SET character_set_server= @test_character_set; +SET collation_server= @test_collation; +CREATE DATABASE d1; +USE d1; +CREATE TABLE t1 (c CHAR(10), KEY(c)); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c char(10) utf16_swedish_ci YES MUL NULL +INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +want3results +aaa +aaaa +aaaaa +DROP TABLE t1; +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c1 varchar(15) utf16_swedish_ci YES MUL NULL +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +want3results +location +loberge +lotre +SELECT c1 as want3results from t1 where c1 like 'lo%'; +want3results +location +loberge +lotre +SELECT c1 as want1result from t1 where c1 like 'loc%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'loca%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locat%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locati%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'location%'; +want1result +location +DROP TABLE t1; +create table t1 (a set('a') not null); +insert ignore into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +select 1 from t1 order by cast(a as char(1)); +1 +1 +1 +drop table t1; +set names utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +create table t1 ( +name varchar(10), +level smallint unsigned); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `name` varchar(10) COLLATE utf16_swedish_ci DEFAULT NULL, + `level` smallint unsigned DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf16 COLLATE=utf16_swedish_ci +insert into t1 values ('string',1); +select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; +concat(name,space(level)) concat(name, repeat(' ',level)) +string string +drop table t1; +DROP DATABASE d1; +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; +SET character_set_client= @safe_character_set_client; +Warnings: +Warning 1287 'utf8mb3' is deprecated and will be removed in a future release. Please use utf8mb4 instead +SET character_set_results= @safe_character_set_results; +Warnings: +Warning 1287 'utf8mb3' is deprecated and will be removed in a future release. Please use utf8mb4 instead +SET collation_connection='utf16_unicode_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +utf16_unicode_ci 00610009 +utf16_unicode_ci 0061 +utf16_unicode_ci 00610020 +drop table t1; +select @@collation_connection; +@@collation_connection +utf16_unicode_ci +create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ; +insert into t1 values('abcdef'); +insert into t1 values('_bcdef'); +insert into t1 values('a_cdef'); +insert into t1 values('ab_def'); +insert into t1 values('abc_ef'); +insert into t1 values('abcd_f'); +insert into t1 values('abcde_'); +select c1 as c1u from t1 where c1 like 'ab\_def'; +c1u +ab_def +select c1 as c2h from t1 where c1 like 'ab#_def' escape '#'; +c2h +ab_def +drop table t1; +End of 4.1 tests +CREATE TABLE t1 (id int, a varchar(30) character set utf16); +INSERT INTO t1 VALUES (1, 0x01310069), (2, 0x01310131); +INSERT INTO t1 VALUES (3, 0x00690069), (4, 0x01300049); +INSERT INTO t1 VALUES (5, 0x01300130), (6, 0x00490049); +SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu +FROM t1 ORDER BY id; +a la l ll u lu +ıi 4 ıi 4 II 4 +ıı 4 ıı 4 II 4 +ii 4 ii 4 II 4 +İI 4 ii 4 İI 4 +İİ 4 ii 4 İİ 4 +II 4 ii 4 II 4 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +ALTER TABLE t1 MODIFY a VARCHAR(30) character set utf16 collate utf16_turkish_ci; +SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu +FROM t1 ORDER BY id; +a la l ll u lu +ıi 4 ıi 4 Iİ 4 +ıı 4 ıı 4 II 4 +ii 4 ii 4 İİ 4 +İI 4 iı 4 İI 4 +İİ 4 ii 4 İİ 4 +II 4 ıı 4 II 4 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +DROP TABLE t1; +set collation_connection=utf16_unicode_ci; +drop table if exists t1; +create table t1 as +select repeat(' ', 64) as s1, repeat(' ',64) as s2 +union +select null, null; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `s1` varchar(64) CHARACTER SET utf16 COLLATE utf16_unicode_ci DEFAULT NULL, + `s2` varchar(64) CHARACTER SET utf16 COLLATE utf16_unicode_ci DEFAULT NULL +) ENGINE=default_engine DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +delete from t1; +insert into t1 values('aaa','aaa'); +insert into t1 values('aaa|qqq','qqq'); +insert into t1 values('gheis','^[^a-dXYZ]+$'); +insert into t1 values('aab','^aa?b'); +insert into t1 values('Baaan','^Ba*n'); +insert into t1 values('aaa','qqq|aaa'); +insert into t1 values('qqq','qqq|aaa'); +insert into t1 values('bbb','qqq|aaa'); +insert into t1 values('bbb','qqq'); +insert into t1 values('aaa','aba'); +insert into t1 values(null,'abc'); +insert into t1 values('def',null); +insert into t1 values(null,null); +select HIGH_PRIORITY s1 regexp s2 from t1; +s1 regexp s2 +1 +1 +1 +1 +1 +1 +1 +0 +0 +0 +NULL +NULL +NULL +SELECT 'ghi' REGEXP 'ghi['; +ERROR HY000: The regular expression contains an unclosed bracket expression. +drop table t1; +SET collation_connection=utf16_czech_ci; +SELECT @@collation_connection; +@@collation_connection +utf16_czech_ci +# +# Bug#57737 Character sets: search fails with like, contraction, index +# +CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0; +INSERT INTO t1 VALUES ('c'),('ce'),('cé'),('ch'); +SELECT * FROM t1 WHERE s1 LIKE 'c%'; +s1 +c +ce +cé +ch +ALTER TABLE t1 ADD KEY s1 (s1); +SELECT * FROM t1 WHERE s1 LIKE 'c%'; +s1 +c +ce +cé +ch +ALTER TABLE t1 DROP KEY s1, ADD KEY(s1(1)); +SELECT * FROM t1 WHERE s1 LIKE 'ch'; +s1 +ch +DROP TABLE t1; +SELECT @@collation_connection; +@@collation_connection +utf16_czech_ci +# +# Bug#57737 Character sets: search fails with like, contraction, index +# Part#2 - ignorable characters +# +CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0; +INSERT INTO t1 VALUES ('a\0\0\0\0\0\t'),('a'),('b'),('c'),('d'),('e'); +SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%'; +HEX(s1) +0061000000000000000000000009 +0061 +ALTER TABLE t1 ADD KEY s1 (s1); +SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%'; +HEX(s1) +0061000000000000000000000009 +0061 +DROP TABLE t1; +# +# End of 5.5 tests +# +# +# Start of 5.6 tests +# +# +# WL#3664 WEIGHT_STRING +# +set collation_connection=utf16_unicode_ci; +select @@collation_connection; +@@collation_connection +utf16_unicode_ci +select hex(weight_string('a')); +hex(weight_string('a')) +0E33 +select hex(weight_string('A')); +hex(weight_string('A')) +0E33 +select hex(weight_string('abc')); +hex(weight_string('abc')) +0E330E4A0E60 +select hex(weight_string('abc' as char(2))); +hex(weight_string('abc' as char(2))) +0E330E4A +select hex(weight_string('abc' as char(3))); +hex(weight_string('abc' as char(3))) +0E330E4A0E60 +select hex(weight_string('abc' as char(5))); +hex(weight_string('abc' as char(5))) +0E330E4A0E6002090209 +select hex(weight_string('abc', 1, 2, 0xC0)); +hex(weight_string('abc', 1, 2, 0xC0)) +0E +select hex(weight_string('abc', 2, 2, 0xC0)); +hex(weight_string('abc', 2, 2, 0xC0)) +0E33 +select hex(weight_string('abc', 3, 2, 0xC0)); +hex(weight_string('abc', 3, 2, 0xC0)) +0E330E +select hex(weight_string('abc', 4, 2, 0xC0)); +hex(weight_string('abc', 4, 2, 0xC0)) +0E330E4A +select hex(weight_string('abc', 5, 2, 0xC0)); +hex(weight_string('abc', 5, 2, 0xC0)) +0E330E4A02 +select hex(weight_string('abc',25, 2, 0xC0)); +hex(weight_string('abc',25, 2, 0xC0)) +0E330E4A020902090209020902090209020902090209020902 +select hex(weight_string('abc', 1, 3, 0xC0)); +hex(weight_string('abc', 1, 3, 0xC0)) +0E +select hex(weight_string('abc', 2, 3, 0xC0)); +hex(weight_string('abc', 2, 3, 0xC0)) +0E33 +select hex(weight_string('abc', 3, 3, 0xC0)); +hex(weight_string('abc', 3, 3, 0xC0)) +0E330E +select hex(weight_string('abc', 4, 3, 0xC0)); +hex(weight_string('abc', 4, 3, 0xC0)) +0E330E4A +select hex(weight_string('abc', 5, 3, 0xC0)); +hex(weight_string('abc', 5, 3, 0xC0)) +0E330E4A0E +select hex(weight_string('abc',25, 3, 0xC0)); +hex(weight_string('abc',25, 3, 0xC0)) +0E330E4A0E6002090209020902090209020902090209020902 +select hex(weight_string('abc', 1, 4, 0xC0)); +hex(weight_string('abc', 1, 4, 0xC0)) +0E +select hex(weight_string('abc', 2, 4, 0xC0)); +hex(weight_string('abc', 2, 4, 0xC0)) +0E33 +select hex(weight_string('abc', 3, 4, 0xC0)); +hex(weight_string('abc', 3, 4, 0xC0)) +0E330E +select hex(weight_string('abc', 4, 4, 0xC0)); +hex(weight_string('abc', 4, 4, 0xC0)) +0E330E4A +select hex(weight_string('abc', 5, 4, 0xC0)); +hex(weight_string('abc', 5, 4, 0xC0)) +0E330E4A0E +select hex(weight_string('abc',25, 4, 0xC0)); +hex(weight_string('abc',25, 4, 0xC0)) +0E330E4A0E6002090209020902090209020902090209020902 +select @@collation_connection; +@@collation_connection +utf16_unicode_ci +select hex(weight_string(cast(_latin1 0x80 as char))); +hex(weight_string(cast(_latin1 0x80 as char))) +0E23 +select hex(weight_string(cast(_latin1 0x808080 as char))); +hex(weight_string(cast(_latin1 0x808080 as char))) +0E230E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char) as char(2))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(2))) +0E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char) as char(3))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(3))) +0E230E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char) as char(5))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(5))) +0E230E230E2302090209 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)) +0E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)) +0E230E +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)) +0E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)) +0E230E2302 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)) +0E230E23020902090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)) +0E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)) +0E230E +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)) +0E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)) +0E230E230E +select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)) +0E230E230E2302090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)) +0E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)) +0E230E +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)) +0E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)) +0E230E230E +select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)) +0E230E230E2302090209020902090209020902090209020902 +select hex(weight_string(_utf16 0xD800DC00 collate utf16_unicode_ci)); +hex(weight_string(_utf16 0xD800DC00 collate utf16_unicode_ci)) +FFFD +select hex(weight_string(_utf16 0xD800DC01 collate utf16_unicode_ci)); +hex(weight_string(_utf16 0xD800DC01 collate utf16_unicode_ci)) +FFFD +set @@collation_connection=utf16_czech_ci; +select @@collation_connection; +@@collation_connection +utf16_czech_ci +select collation(cast(_latin1 0xDF as char)); +collation(cast(_latin1 0xDF as char)) +utf16_czech_ci +select hex(weight_string('s')); +hex(weight_string('s')) +0FEA +select hex(weight_string(cast(_latin1 0xDF as char))); +hex(weight_string(cast(_latin1 0xDF as char))) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF as char) as char(1))); +hex(weight_string(cast(_latin1 0xDF as char) as char(1))) +0FEA0FEA +select hex(weight_string('c')); +hex(weight_string('c')) +0E60 +select hex(weight_string('h')); +hex(weight_string('h')) +0EE1 +select hex(weight_string('ch')); +hex(weight_string('ch')) +0EE2 +select hex(weight_string('i')); +hex(weight_string('i')) +0EFB +select hex(weight_string(cast(_latin1 0x6368DF as char))); +hex(weight_string(cast(_latin1 0x6368DF as char))) +0EE20FEA0FEA +select hex(weight_string(cast(_latin1 0x6368DF as char) as char(1))); +hex(weight_string(cast(_latin1 0x6368DF as char) as char(1))) +0E60 +select hex(weight_string(cast(_latin1 0x6368DF as char) as char(2))); +hex(weight_string(cast(_latin1 0x6368DF as char) as char(2))) +0EE2 +select hex(weight_string(cast(_latin1 0x6368DF as char) as char(3))); +hex(weight_string(cast(_latin1 0x6368DF as char) as char(3))) +0EE20FEA0FEA +select hex(weight_string(cast(_latin1 0x6368DF as char) as char(4))); +hex(weight_string(cast(_latin1 0x6368DF as char) as char(4))) +0EE20FEA0FEA0209 +select hex(weight_string(cast(_latin1 0xDF6368 as char))); +hex(weight_string(cast(_latin1 0xDF6368 as char))) +0FEA0FEA0EE2 +select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(1))); +hex(weight_string(cast(_latin1 0xDF6368 as char) as char(1))) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(2))); +hex(weight_string(cast(_latin1 0xDF6368 as char) as char(2))) +0FEA0FEA0E60 +select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(3))); +hex(weight_string(cast(_latin1 0xDF6368 as char) as char(3))) +0FEA0FEA0EE2 +select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(4))); +hex(weight_string(cast(_latin1 0xDF6368 as char) as char(4))) +0FEA0FEA0EE20209 +select hex(weight_string(cast(_latin1 0x6368DF as char), 1, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 1, 2, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 2, 2, 0xC0)) +0EE2 +select hex(weight_string(cast(_latin1 0x6368DF as char), 3, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 3, 2, 0xC0)) +0EE202 +select hex(weight_string(cast(_latin1 0x6368DF as char), 4, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 4, 2, 0xC0)) +0EE20209 +select hex(weight_string(cast(_latin1 0x6368DF as char),25, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char),25, 2, 0xC0)) +0EE20209020902090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0x6368DF as char), 1, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 1, 3, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 2, 3, 0xC0)) +0EE2 +select hex(weight_string(cast(_latin1 0x6368DF as char), 3, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 3, 3, 0xC0)) +0EE20F +select hex(weight_string(cast(_latin1 0x6368DF as char), 4, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 4, 3, 0xC0)) +0EE20FEA +select hex(weight_string(cast(_latin1 0x6368DF as char),25, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char),25, 3, 0xC0)) +0EE20FEA0FEA02090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0x6368DF as char), 1, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 1, 4, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0)) +0EE2 +select hex(weight_string(cast(_latin1 0x6368DF as char), 3, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 3, 4, 0xC0)) +0EE20F +select hex(weight_string(cast(_latin1 0x6368DF as char), 4, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 4, 4, 0xC0)) +0EE20FEA +select hex(weight_string(cast(_latin1 0x6368DF as char),25, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char),25, 4, 0xC0)) +0EE20FEA0FEA02090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 2,0xC0)) +0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 2,0xC0)) +0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 2,0xC0)) +0FEA0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 2,0xC0)) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char),25, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char),25, 2,0xC0)) +0FEA0FEA0E6002090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 3,0xC0)) +0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 3,0xC0)) +0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 3,0xC0)) +0FEA0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 3,0xC0)) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char),25, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char),25, 3,0xC0)) +0FEA0FEA0EE202090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 4,0xC0)) +0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 4,0xC0)) +0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 4,0xC0)) +0FEA0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 4,0xC0)) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char),25, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char),25, 4,0xC0)) +0FEA0FEA0EE202090209020902090209020902090209020902 +SET NAMES utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SET collation_connection=utf16_german2_ci; +"BEGIN ctype_german.inc" +drop table if exists t1; +create table t1 as select repeat(' ', 64) as s1; +select collation(s1) from t1; +collation(s1) +utf16_german2_ci +delete from t1; +INSERT INTO t1 VALUES ('ud'),('uf'); +INSERT INTO t1 VALUES ('od'),('of'); +INSERT INTO t1 VALUES ('e'); +INSERT INTO t1 VALUES ('ad'),('af'); +insert into t1 values ('a'),('ae'),(_latin1 0xE4); +insert into t1 values ('o'),('oe'),(_latin1 0xF6); +insert into t1 values ('s'),('ss'),(_latin1 0xDF); +insert into t1 values ('u'),('ue'),(_latin1 0xFC); +INSERT INTO t1 VALUES (_latin1 0xE6), (_latin1 0xC6); +INSERT INTO t1 VALUES (_latin1 0x9C), (_latin1 0x8C); +select s1, hex(s1) from t1 order by s1, binary s1; +s1 hex(s1) +a 0061 +ad 00610064 +ae 00610065 +Æ 00C6 +ä 00E4 +æ 00E6 +af 00610066 +e 0065 +o 006F +od 006F0064 +oe 006F0065 +ö 00F6 +Œ 0152 +œ 0153 +of 006F0066 +s 0073 +ss 00730073 +ß 00DF +u 0075 +ud 00750064 +ue 00750065 +ü 00FC +uf 00750066 +select group_concat(s1 order by binary s1) from t1 group by s1; +group_concat(s1 order by binary s1) +a +ad +ae,Æ,ä,æ +af +e +o +od +oe,ö,Œ,œ +of +s +ss,ß +u +ud +ue,ü +uf +SELECT s1, hex(s1), hex(weight_string(s1)) FROM t1 ORDER BY s1, BINARY(s1); +s1 hex(s1) hex(weight_string(s1)) +a 0061 0E33 +ad 00610064 0E330E6D +ae 00610065 0E330E8B +Æ 00C6 0E330E8B +ä 00E4 0E330E8B +æ 00E6 0E330E8B +af 00610066 0E330EB9 +e 0065 0E8B +o 006F 0F82 +od 006F0064 0F820E6D +oe 006F0065 0F820E8B +ö 00F6 0F820E8B +Œ 0152 0F820E8B +œ 0153 0F820E8B +of 006F0066 0F820EB9 +s 0073 0FEA +ss 00730073 0FEA0FEA +ß 00DF 0FEA0FEA +u 0075 101F +ud 00750064 101F0E6D +ue 00750065 101F0E8B +ü 00FC 101F0E8B +uf 00750066 101F0EB9 +SELECT s1, hex(s1) FROM t1 WHERE s1='ae' ORDER BY s1, BINARY(s1); +s1 hex(s1) +ae 00610065 +Æ 00C6 +ä 00E4 +æ 00E6 +drop table t1; +"END ctype_german.inc" +# +# WL#2673 Unicode Collation Algorithm new version +# +SET NAMES utf8mb4; +SET collation_connection=utf16_unicode_520_ci; +CREATE TABLE t1 AS SELECT repeat('a', 10) as c LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` varchar(10) CHARACTER SET utf16 COLLATE utf16_unicode_520_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +INSERT INTO t1 VALUES (_utf32 0x0180),(_utf32 0x023A); +INSERT INTO t1 VALUES (_utf32 0x023B),(_utf32 0x023C); +INSERT INTO t1 VALUES (_utf32 0x023D),(_utf32 0x023E); +INSERT INTO t1 VALUES (_utf32 0x0241),(_utf32 0x0242); +INSERT INTO t1 VALUES (_utf32 0x0243),(_utf32 0x0244); +INSERT INTO t1 VALUES (_utf32 0x0245),(_utf32 0x0246); +INSERT INTO t1 VALUES (_utf32 0x0247),(_utf32 0x0248); +INSERT INTO t1 VALUES (_utf32 0x0249),(_utf32 0x024A); +INSERT INTO t1 VALUES (_utf32 0x024B),(_utf32 0x024C); +INSERT INTO t1 VALUES (_utf32 0x024D),(_utf32 0x024E); +INSERT INTO t1 VALUES (_utf32 0x024F),(_utf32 0x026B); +INSERT INTO t1 VALUES (_utf32 0x027D),(_utf32 0x0289); +INSERT INTO t1 VALUES (_utf32 0x028C); +INSERT INTO t1 VALUES (_utf32 0x037B), (_utf32 0x037C); +INSERT INTO t1 VALUES (_utf32 0x037D), (_utf32 0x03FD); +INSERT INTO t1 VALUES (_utf32 0x03FE), (_utf32 0x03FF); +INSERT INTO t1 VALUES (_utf32 0x04C0), (_utf32 0x04CF); +INSERT INTO t1 VALUES (_utf32 0x04F6), (_utf32 0x04F7); +INSERT INTO t1 VALUES (_utf32 0x04FA), (_utf32 0x04FB); +INSERT INTO t1 VALUES (_utf32 0x04FC), (_utf32 0x04FD); +INSERT INTO t1 VALUES (_utf32 0x04FE), (_utf32 0x04FF); +INSERT INTO t1 VALUES (_utf32 0x0510), (_utf32 0x0511); +INSERT INTO t1 VALUES (_utf32 0x0512), (_utf32 0x0513); +INSERT INTO t1 VALUES (_utf32 0x10A0), (_utf32 0x10A1); +INSERT INTO t1 VALUES (_utf32 0x10A2), (_utf32 0x10A3); +INSERT INTO t1 VALUES (_utf32 0x10A4), (_utf32 0x10A5); +INSERT INTO t1 VALUES (_utf32 0x10A6), (_utf32 0x10A7); +INSERT INTO t1 VALUES (_utf32 0x2D00), (_utf32 0x2D01); +INSERT INTO t1 VALUES (_utf32 0x2D02), (_utf32 0x2D03); +INSERT INTO t1 VALUES (_utf32 0x2D04), (_utf32 0x2D05); +INSERT INTO t1 VALUES (_utf32 0x2D06), (_utf32 0x2D07); +INSERT INTO t1 VALUES (_utf32 0x1D7D); +INSERT INTO t1 VALUES (_utf32 0x2132),(_utf32 0x214E); +INSERT INTO t1 VALUES (_utf32 0x2183),(_utf32 0x2184); +INSERT INTO t1 VALUES (_utf32 0x2C80), (_utf32 0x2C81); +INSERT INTO t1 VALUES (_utf32 0x2C82), (_utf32 0x2C83); +INSERT INTO t1 VALUES (_utf32 0x2C84), (_utf32 0x2C85); +INSERT INTO t1 VALUES (_utf32 0x2C86), (_utf32 0x2C87); +INSERT INTO t1 VALUES (_utf32 0x2C88), (_utf32 0x2C89); +INSERT INTO t1 VALUES (_utf32 0x2C8A), (_utf32 0x2C8B); +INSERT INTO t1 VALUES (_utf32 0x2C8C), (_utf32 0x2C8D); +INSERT INTO t1 VALUES (_utf32 0x2C8E), (_utf32 0x2C8F); +INSERT INTO t1 VALUES (_utf32 0x2C60), (_utf32 0x2C61); +INSERT INTO t1 VALUES (_utf32 0x2C62), (_utf32 0x2C63); +INSERT INTO t1 VALUES (_utf32 0x2C64), (_utf32 0x2C65); +INSERT INTO t1 VALUES (_utf32 0x2C66), (_utf32 0x2C67); +INSERT INTO t1 VALUES (_utf32 0x2C68), (_utf32 0x2C69); +INSERT INTO t1 VALUES (_utf32 0x2C6A), (_utf32 0x2C6B); +INSERT INTO t1 VALUES (_utf32 0x2C6C), (_utf32 0x2C75); +INSERT INTO t1 VALUES (_utf32 0x2C76); +INSERT INTO t1 VALUES (_utf32 0x2C00), (_utf32 0x2C01); +INSERT INTO t1 VALUES (_utf32 0x2C02), (_utf32 0x2C03); +INSERT INTO t1 VALUES (_utf32 0x2C04), (_utf32 0x2C05); +INSERT INTO t1 VALUES (_utf32 0x2C06), (_utf32 0x2C07); +INSERT INTO t1 VALUES (_utf32 0x2C30), (_utf32 0x2C31); +INSERT INTO t1 VALUES (_utf32 0x2C32), (_utf32 0x2C33); +INSERT INTO t1 VALUES (_utf32 0x2C34), (_utf32 0x2C35); +INSERT INTO t1 VALUES (_utf32 0x2C36), (_utf32 0x2C37); +INSERT INTO t1 VALUES (_utf32 0x10400), (_utf32 0x10401); +INSERT INTO t1 VALUES (_utf32 0x10402), (_utf32 0x10403); +INSERT INTO t1 VALUES (_utf32 0x10404), (_utf32 0x10405); +INSERT INTO t1 VALUES (_utf32 0x10406), (_utf32 0x10407); +INSERT INTO t1 VALUES (_utf32 0x10428), (_utf32 0x10429); +INSERT INTO t1 VALUES (_utf32 0x1042A), (_utf32 0x1042B); +INSERT INTO t1 VALUES (_utf32 0x1042C), (_utf32 0x1042D); +INSERT INTO t1 VALUES (_utf32 0x1042E), (_utf32 0x1042F); +INSERT INTO t1 VALUES (_utf32 0x0370); +INSERT INTO t1 VALUES (_utf32 0x0371); +INSERT INTO t1 VALUES (_utf32 0x0372); +INSERT INTO t1 VALUES (_utf32 0x0373); +INSERT INTO t1 VALUES (_utf32 0x0514); +INSERT INTO t1 VALUES (_utf32 0x0515); +INSERT INTO t1 VALUES (_utf32 0x0516); +INSERT INTO t1 VALUES (_utf32 0x0517); +INSERT INTO t1 VALUES (_utf32 0xA640); +INSERT INTO t1 VALUES (_utf32 0xA641); +INSERT INTO t1 VALUES (_utf32 0xA642); +INSERT INTO t1 VALUES (_utf32 0xA643); +INSERT INTO t1 VALUES (_utf32 0xA722); +INSERT INTO t1 VALUES (_utf32 0xA723); +INSERT INTO t1 VALUES (_utf32 0xA724); +INSERT INTO t1 VALUES (_utf32 0xA725); +INSERT INTO t1 VALUES (_utf32 0xA726); +INSERT INTO t1 VALUES (_utf32 0xA727); +INSERT INTO t1 VALUES (_utf32 0xA728); +INSERT INTO t1 VALUES (_utf32 0xA729); +INSERT INTO t1 VALUES (_utf32 0xA72A); +INSERT INTO t1 VALUES (_utf32 0xA72B); +INSERT INTO t1 VALUES (_utf32 0x2CEB); +INSERT INTO t1 VALUES (_utf32 0x2CEC); +INSERT INTO t1 VALUES (_utf32 0x2CED); +INSERT INTO t1 VALUES (_utf32 0x2CEE); +SELECT hex(c), hex(lower(c)), hex(upper(c)), hex(weight_string(c)), c +FROM t1 ORDER BY c, BINARY c; +hex(c) hex(lower(c)) hex(upper(c)) hex(weight_string(c)) c +023A 2C65 023A 1214 Ⱥ +2C65 2C65 023A 1214 ⱥ +0180 0180 0243 122D ƀ +0243 0180 0243 122D Ƀ +023B 023C 023B 1242 Ȼ +023C 023C 023B 1242 ȼ +2183 2184 2183 124E Ↄ +2184 2184 2183 124E ↄ +0246 0247 0246 1270 Ɇ +0247 0247 0246 1270 ɇ +2132 214E 2132 12AE Ⅎ +214E 214E 2132 12AE ⅎ +2C67 2C68 2C67 12E3 Ⱨ +2C68 2C68 2C67 12E3 ⱨ +2C75 2C76 2C75 12E4 Ⱶ +2C76 2C76 2C75 12E4 ⱶ +A726 A727 A726 12E5 Ꜧ +A727 A727 A726 12E5 ꜧ +0248 0249 0248 130E Ɉ +0249 0249 0248 130E ɉ +2C69 2C6A 2C69 1328 Ⱪ +2C6A 2C6A 2C69 1328 ⱪ +023D 019A 023D 133B Ƚ +2C60 2C61 2C60 133F Ⱡ +2C61 2C61 2C60 133F ⱡ +026B 026B 2C62 1340 ɫ +2C62 026B 2C62 1340 Ɫ +1D7D 1D7D 2C63 13B8 ᵽ +2C63 1D7D 2C63 13B8 Ᵽ +024A 024B 024A 13D2 Ɋ +024B 024B 024A 13D2 ɋ +024C 024D 024C 13E4 Ɍ +024D 024D 024C 13E4 ɍ +027D 027D 2C64 13FC ɽ +2C64 027D 2C64 13FC Ɽ +A728 A729 A728 143314AD Ꜩ +A729 A729 A728 143314AD ꜩ +023E 2C66 023E 143C Ⱦ +2C66 2C66 023E 143C ⱦ +0244 0289 0244 145B Ʉ +0289 0289 0244 145B ʉ +0245 028C 0245 1489 Ʌ +028C 028C 0245 1489 ʌ +024E 024F 024E 14A4 Ɏ +024F 024F 024E 14A4 ɏ +2C6B 2C6C 2C6B 14C8 Ⱬ +2C6C 2C6C 2C6B 14C8 ⱬ +A72A A72B A72A 14F3 Ꜫ +A72B A72B A72A 14F3 ꜫ +0241 0242 0241 1506 Ɂ +0242 0242 0241 1506 ɂ +A722 A723 A722 150E Ꜣ +A723 A723 A722 150E ꜣ +A724 A725 A724 1518 Ꜥ +A725 A725 A724 1518 ꜥ +0370 0371 0370 154F Ͱ +0371 0371 0370 154F ͱ +037C 037C 03FE 1564 ͼ +03FE 037C 03FE 1564 Ͼ +037B 037B 03FD 1565 ͻ +03FD 037B 03FD 1565 Ͻ +037D 037D 03FF 1566 ͽ +03FF 037D 03FF 1566 Ͽ +0372 0373 0372 156F Ͳ +0373 0373 0372 156F ͳ +2C80 2C81 2C80 1571 Ⲁ +2C81 2C81 2C80 1571 ⲁ +2C82 2C83 2C82 1572 Ⲃ +2C83 2C83 2C82 1572 ⲃ +2C84 2C85 2C84 1573 Ⲅ +2C85 2C85 2C84 1573 ⲅ +2C86 2C87 2C86 1574 Ⲇ +2C87 2C87 2C86 1574 ⲇ +2C88 2C89 2C88 1575 Ⲉ +2C89 2C89 2C88 1575 ⲉ +2C8A 2C8B 2C8A 1577 Ⲋ +2C8B 2C8B 2C8A 1577 ⲋ +2C8C 2C8D 2C8C 1578 Ⲍ +2C8D 2C8D 2C8C 1578 ⲍ +2C8E 2C8F 2C8E 1579 Ⲏ +2C8F 2C8F 2C8E 1579 ⲏ +2CEB 2CEC 2CEB 1591 Ⳬ +2CEC 2CEC 2CEB 1591 ⳬ +2CED 2CEE 2CED 15A0 Ⳮ +2CEE 2CEE 2CED 15A0 ⳮ +04FA 04FB 04FA 15D4 Ӻ +04FB 04FB 04FA 15D4 ӻ +04F6 04F7 04F6 15DC Ӷ +04F7 04F7 04F6 15DC ӷ +A640 A641 A640 1611 Ꙁ +A641 A641 A640 1611 ꙁ +0510 0511 0510 1613 Ԑ +0511 0511 0510 1613 ԑ +A642 A643 A642 1618 Ꙃ +A643 A643 A642 1618 ꙃ +0512 0513 0512 1666 Ԓ +0513 0513 0512 1666 ԓ +0514 0515 0514 166E Ԕ +0515 0515 0514 166E ԕ +0516 0517 0516 16B7 Ԗ +0517 0517 0516 16B7 ԗ +04FC 04FD 04FC 16F9 Ӽ +04FD 04FD 04FC 16F9 ӽ +04FE 04FF 04FE 16FD Ӿ +04FF 04FF 04FE 16FD ӿ +04C0 04CF 04C0 17B1 Ӏ +04CF 04CF 04C0 17B1 ӏ +2C00 2C30 2C00 17B5 Ⰰ +2C30 2C30 2C00 17B5 ⰰ +2C01 2C31 2C01 17B6 Ⰱ +2C31 2C31 2C01 17B6 ⰱ +2C02 2C32 2C02 17B7 Ⰲ +2C32 2C32 2C02 17B7 ⰲ +2C03 2C33 2C03 17B8 Ⰳ +2C33 2C33 2C03 17B8 ⰳ +2C04 2C34 2C04 17B9 Ⰴ +2C34 2C34 2C04 17B9 ⰴ +2C05 2C35 2C05 17BA Ⰵ +2C35 2C35 2C05 17BA ⰵ +2C06 2C36 2C06 17BB Ⰶ +2C36 2C36 2C06 17BB ⰶ +2C07 2C37 2C07 17BC Ⰷ +2C37 2C37 2C07 17BC ⰷ +10A0 2D00 10A0 17E5 Ⴀ +2D00 2D00 10A0 17E5 ⴀ +10A1 2D01 10A1 17E7 Ⴁ +2D01 2D01 10A1 17E7 ⴁ +10A2 2D02 10A2 17E9 Ⴂ +2D02 2D02 10A2 17E9 ⴂ +10A3 2D03 10A3 17EB Ⴃ +2D03 2D03 10A3 17EB ⴃ +10A4 2D04 10A4 17ED Ⴄ +2D04 2D04 10A4 17ED ⴄ +10A5 2D05 10A5 17EF Ⴅ +2D05 2D05 10A5 17EF ⴅ +10A6 2D06 10A6 17F1 Ⴆ +2D06 2D06 10A6 17F1 ⴆ +10A7 2D07 10A7 17F5 Ⴇ +2D07 2D07 10A7 17F5 ⴇ +D801DC00 D801DC28 D801DC00 30D2 𐐀 +D801DC28 D801DC28 D801DC00 30D2 𐐨 +D801DC01 D801DC29 D801DC01 30D3 𐐁 +D801DC29 D801DC29 D801DC01 30D3 𐐩 +D801DC02 D801DC2A D801DC02 30D4 𐐂 +D801DC2A D801DC2A D801DC02 30D4 𐐪 +D801DC03 D801DC2B D801DC03 30D5 𐐃 +D801DC2B D801DC2B D801DC03 30D5 𐐫 +D801DC04 D801DC2C D801DC04 30D6 𐐄 +D801DC2C D801DC2C D801DC04 30D6 𐐬 +D801DC05 D801DC2D D801DC05 30D7 𐐅 +D801DC2D D801DC2D D801DC05 30D7 𐐭 +D801DC06 D801DC2E D801DC06 30D8 𐐆 +D801DC2E D801DC2E D801DC06 30D8 𐐮 +D801DC07 D801DC2F D801DC07 30D9 𐐇 +D801DC2F D801DC2F D801DC07 30D9 𐐯 +INSERT INTO t1 VALUES ('a'); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0xFFFF)); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0x10FFFF)); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0x10400)); +SELECT hex(c), hex(weight_string(c)) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +hex(c) hex(weight_string(c)) +0061 120F +0061D801DC00 120F30D2 +0061FFFF 120FFBC1FFFF +0061DBFFDFFF 120FFBE1FFFF +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10400 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +D801DC00 30D2 𐐀 +D801DC28 30D2 𐐨 +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10428 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +D801DC00 30D2 𐐀 +D801DC28 30D2 𐐨 +ALTER TABLE t1 ADD KEY(c); +EXPLAIN SELECT hex(c) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range c c 43 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select hex(`test`.`t1`.`c`) AS `hex(c)` from `test`.`t1` where (`test`.`t1`.`c` like 'a%') order by `test`.`t1`.`c` +SELECT hex(c), hex(weight_string(c)) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +hex(c) hex(weight_string(c)) +0061 120F +0061D801DC00 120F30D2 +0061FFFF 120FFBC1FFFF +0061DBFFDFFF 120FFBE1FFFF +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10400 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +D801DC00 30D2 𐐀 +D801DC28 30D2 𐐨 +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10428 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +D801DC00 30D2 𐐀 +D801DC28 30D2 𐐨 +DROP TABLE t1; +# +# End of 5.6 tests +# diff --git a/mysql-test/r/ctype_utf16le.result-pq b/mysql-test/r/ctype_utf16le.result-pq new file mode 100644 index 000000000000..d1938024ff62 --- /dev/null +++ b/mysql-test/r/ctype_utf16le.result-pq @@ -0,0 +1,1631 @@ +# +# Start of 5.6 tests +# +SET NAMES utf8, collation_connection=utf16le_general_ci; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT HEX('a'), HEX('a '); +HEX('a') HEX('a ') +6100 61002000 +select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; +'a' = 'a' 'a' = 'a ' 'a ' = 'a' +1 1 1 +select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a'; +'a\0' = 'a' 'a\0' < 'a' 'a\0' > 'a' +0 1 0 +select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0'; +'a' = 'a\0' 'a' < 'a\0' 'a' > 'a\0' +0 0 1 +select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a '; +'a\0' = 'a ' 'a\0' < 'a ' 'a\0' > 'a ' +0 1 0 +select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0'; +'a ' = 'a\0' 'a ' < 'a\0' 'a ' > 'a\0' +0 0 1 +select 'a a' > 'a', 'a \0' < 'a'; +'a a' > 'a' 'a \0' < 'a' +1 1 +select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a'; +binary 'a a' > 'a' binary 'a \0' > 'a' binary 'a\0' > 'a' +1 1 1 +# +# Check that incomplete utf16le characters in HEX notation +# are left-padded with zeros +# +SELECT HEX(_utf16le 0x44); +HEX(_utf16le 0x44) +0044 +SELECT HEX(_utf16le 0x3344); +HEX(_utf16le 0x3344) +3344 +SELECT HEX(_utf16le 0x113344); +HEX(_utf16le 0x113344) +00113344 +# +# Check that 0x20 is only trimmed when it is +# a part of real SPACE character, not just a part +# of a multibyte sequence. +# Note, CYRILLIC LETTER ER is used as an example, which +# is stored as 0x0420 in utf16le, thus contains 0x20 in the +# low byte. The second character is THREE-PER-M, U+2004, +# which contains 0x20 in the high byte. +# +CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf16le; +INSERT INTO t1 VALUES (_koi8r 0xF2, _koi8r 0xF2), (_ucs2 X'2004',_ucs2 X'2004'); +SELECT HEX(word) FROM t1 ORDER BY word; +HEX(word) +2004 +0420 +SELECT HEX(word2) FROM t1 ORDER BY word2; +HEX(word2) +2004 +0420 +DELETE FROM t1; +# +# Check that real spaces are correctly trimmed. +# +INSERT INTO t1 VALUES (_ucs2 X'042000200020', _ucs2 X'042000200020'); +INSERT INTO t1 VALUES (_ucs2 X'200400200020', _ucs2 X'200400200020'); +SELECT HEX(word) FROM t1 ORDER BY word; +HEX(word) +200420002000 +042020002000 +SELECT HEX(word2) FROM t1 ORDER BY word2; +HEX(word2) +2004 +0420 +DROP TABLE t1; +# +# Check LPAD/RPAD +# +CREATE TABLE t1 (a VARCHAR(10), pad INT, b VARCHAR(10)) CHARACTER SET utf16le; +INSERT INTO t1 VALUES (_ucs2 X'0420', 10, _ucs2 X'0421'); +INSERT INTO t1 VALUES (_ucs2 X'0420', 10, _ucs2 X'04210422'); +INSERT INTO t1 VALUES (_ucs2 X'0420', 10, _ucs2 X'042104220423'); +INSERT IGNORE INTO t1 VALUES (_ucs2 X'0420042104220423042404250426042704280429042A042B',10,_ucs2 X'042104220423'); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +INSERT INTO t1 VALUES (_utf32 X'010000', 10, _ucs2 X'0421'); +INSERT INTO t1 VALUES (_ucs2 X'0421', 10, _utf32 X'010000'); +SELECT a, pad, b, LPAD(a, pad, b), HEX(LPAD(a, pad, b)) FROM t1; +a pad b LPAD(a, pad, b) HEX(LPAD(a, pad, b)) +Р 10 С СССССССССР 2104210421042104210421042104210421042004 +Р 10 СТ СТСТСТСТСР 2104220421042204210422042104220421042004 +Р 10 СТУ СТУСТУСТУР 2104220423042104220423042104220423042004 +РСТУФХЦЧШЩ 10 СТУ РСТУФХЦЧШЩ 2004210422042304240425042604270428042904 +? 10 С ССССССССС? 21042104210421042104210421042104210400D800DC +С 10 ? ?????????С 00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC00D800DC2104 +DROP TABLE t1; +CREATE TABLE t1 SELECT +LPAD(_utf16le X'2004',10,_utf16le X'2104') l, +RPAD(_utf16le X'2004',10,_utf16le X'2104') r; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `l` varchar(10) CHARACTER SET utf16le DEFAULT NULL, + `r` varchar(10) CHARACTER SET utf16le DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT HEX(l), HEX(r) FROM t1; +HEX(l) HEX(r) +2104210421042104210421042104210421042004 2004210421042104210421042104210421042104 +DROP TABLE t1; +CREATE TABLE t1 (f1 CHAR(30)); +INSERT INTO t1 VALUES ("103000"), ("22720000"), ("3401200"), ("78000"); +SELECT LPAD(f1, 12, "-o-/") FROM t1; +LPAD(f1, 12, "-o-/") +-o-/-o103000 +-o-/22720000 +-o-/-3401200 +-o-/-o-78000 +DROP TABLE t1; +# +# Testing LIKE +# +SET NAMES utf8, collation_connection=utf16le_general_ci; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +select @@collation_connection; +@@collation_connection +utf16le_general_ci +create table t1 as select repeat(' ',10) as a union select null; +alter table t1 add key(a); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) CHARACTER SET utf16le DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); +explain select * from t1 where a like 'abc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range a a 43 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` like 'abc%') +explain select * from t1 where a like concat('abc','%'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range a a 43 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ 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 +abcd +select * from t1 where a like concat("abc","%"); +a +abc +abcd +select * from t1 where a like "ABC%"; +a +abc +abcd +select * from t1 where a like "test%"; +a +test +select * from t1 where a like "te_t"; +a +test +select * from t1 where a like "%a%"; +a +a +abc +abcd +select * from t1 where a like "%abcd%"; +a +abcd +select * from t1 where a like "%abc\d%"; +a +abcd +drop table t1; +select 'AA' like 'AA'; +'AA' like 'AA' +1 +select 'AA' like 'A%A'; +'AA' like 'A%A' +1 +select 'AA' like 'A%%A'; +'AA' like 'A%%A' +1 +select 'AA' like 'AA%'; +'AA' like 'AA%' +1 +select 'AA' like '%AA%'; +'AA' like '%AA%' +1 +select 'AA' like '%A'; +'AA' like '%A' +1 +select 'AA' like '%AA'; +'AA' like '%AA' +1 +select 'AA' like 'A%A%'; +'AA' like 'A%A%' +1 +select 'AA' like '_%_%'; +'AA' like '_%_%' +1 +select 'AA' like '%A%A'; +'AA' like '%A%A' +1 +select 'AAA'like 'A%A%A'; +'AAA'like 'A%A%A' +1 +select 'AZ' like 'AZ'; +'AZ' like 'AZ' +1 +select 'AZ' like 'A%Z'; +'AZ' like 'A%Z' +1 +select 'AZ' like 'A%%Z'; +'AZ' like 'A%%Z' +1 +select 'AZ' like 'AZ%'; +'AZ' like 'AZ%' +1 +select 'AZ' like '%AZ%'; +'AZ' like '%AZ%' +1 +select 'AZ' like '%Z'; +'AZ' like '%Z' +1 +select 'AZ' like '%AZ'; +'AZ' like '%AZ' +1 +select 'AZ' like 'A%Z%'; +'AZ' like 'A%Z%' +1 +select 'AZ' like '_%_%'; +'AZ' like '_%_%' +1 +select 'AZ' like '%A%Z'; +'AZ' like '%A%Z' +1 +select 'AZ' like 'A_'; +'AZ' like 'A_' +1 +select 'AZ' like '_Z'; +'AZ' like '_Z' +1 +select 'AMZ'like 'A%M%Z'; +'AMZ'like 'A%M%Z' +1 +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf16le); +INSERT INTO t1 VALUES ('фыва'),('Фыва'),('фЫва'),('фыВа'),('фывА'),('ФЫВА'); +INSERT INTO t1 VALUES ('фывапролдж'),('Фывапролдж'),('фЫвапролдж'),('фыВапролдж'); +INSERT INTO t1 VALUES ('фывАпролдж'),('фываПролдж'),('фывапРолдж'),('фывапрОлдж'); +INSERT INTO t1 VALUES ('фывапроЛдж'),('фывапролДж'),('фывапролдЖ'),('ФЫВАПРОЛДЖ'); +SELECT * FROM t1 WHERE a LIKE '%фЫва%' ORDER BY BINARY a; +a +ФЫВА +ФЫВАПРОЛДЖ +Фыва +Фывапролдж +фЫва +фЫвапролдж +фыВа +фыВапролдж +фывА +фывАпролдж +фыва +фываПролдж +фывапРолдж +фывапрОлдж +фывапроЛдж +фывапролДж +фывапролдЖ +фывапролдж +SELECT * FROM t1 WHERE a LIKE '%фЫв%' ORDER BY BINARY a; +a +ФЫВА +ФЫВАПРОЛДЖ +Фыва +Фывапролдж +фЫва +фЫвапролдж +фыВа +фыВапролдж +фывА +фывАпролдж +фыва +фываПролдж +фывапРолдж +фывапрОлдж +фывапроЛдж +фывапролДж +фывапролдЖ +фывапролдж +SELECT * FROM t1 WHERE a LIKE 'фЫва%' ORDER BY BINARY a; +a +ФЫВА +ФЫВАПРОЛДЖ +Фыва +Фывапролдж +фЫва +фЫвапролдж +фыВа +фыВапролдж +фывА +фывАпролдж +фыва +фываПролдж +фывапРолдж +фывапрОлдж +фывапроЛдж +фывапролДж +фывапролдЖ +фывапролдж +SELECT * FROM t1 WHERE a LIKE 'фЫва%' COLLATE utf16le_bin ORDER BY BINARY a; +a +фЫва +фЫвапролдж +DROP TABLE t1; +CREATE TABLE t1 (word VARCHAR(64) NOT NULL, PRIMARY KEY (word)) +CHARACTER SET utf16le; +INSERT INTO t1 (word) VALUES ("cat"); +SELECT * FROM t1 WHERE word LIKE "c%"; +word +cat +SELECT * FROM t1 WHERE word LIKE "ca_"; +word +cat +SELECT * FROM t1 WHERE word LIKE "cat"; +word +cat +SELECT * FROM t1 WHERE word LIKE _ucs2 x'00630025'; +word +cat +SELECT * FROM t1 WHERE word LIKE _ucs2 x'00630061005F'; +word +cat +DROP TABLE t1; +# +# Check that INSERT() works fine. +# This invokes charpos() function. +# +CREATE TABLE t1 ( +a VARCHAR(10) CHARACTER SET utf16le, +b VARCHAR(10) CHARACTER SET utf16le); +INSERT INTO t1 VALUES ('abc', 'def'); +SELECT INSERT(a, 10, 2, b) FROM t1; +INSERT(a, 10, 2, b) +abc +SELECT INSERT(a, 1, 2, b) FROM t1; +INSERT(a, 1, 2, b) +defc +DROP TABLE t1; +# +# Check alignment for from-binary-conversion with CAST and CONVERT +# +SELECT HEX(CAST(0xAA as char CHARACTER SET utf16le)); +HEX(CAST(0xAA as char CHARACTER SET utf16le)) +00AA +SELECT HEX(CONVERT(0xAA USING utf16le)); +HEX(CONVERT(0xAA USING utf16le)) +00AA +# +# Check alignment for string types +# +CREATE TABLE t1 (a CHAR(10) CHARACTER SET utf16le); +INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111); +SELECT HEX(a) FROM t1; +HEX(a) +0001 +0011 +0111 +1111 +00011111 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf16le); +INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111); +SELECT HEX(a) FROM t1; +HEX(a) +0001 +0011 +0111 +1111 +00011111 +DROP TABLE t1; +CREATE TABLE t1 (a TEXT CHARACTER SET utf16le); +INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111); +SELECT HEX(a) FROM t1; +HEX(a) +0001 +0011 +0111 +1111 +00011111 +DROP TABLE t1; +CREATE TABLE t1 (a MEDIUMTEXT CHARACTER SET utf16le); +INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111); +SELECT HEX(a) FROM t1; +HEX(a) +0001 +0011 +0111 +1111 +00011111 +DROP TABLE t1; +CREATE TABLE t1 (a LONGTEXT CHARACTER SET utf16le); +INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111); +SELECT HEX(a) FROM t1; +HEX(a) +0001 +0011 +0111 +1111 +00011111 +DROP TABLE t1; +# +# Bug#5081 : UCS2 fields are filled with '0x2020' +# after extending field length +# +CREATE TABLE t1(a CHAR(1)) DEFAULT CHARSET utf16le; +INSERT INTO t1 VALUES ('a'),('b'),('c'); +ALTER TABLE t1 MODIFY a CHAR(5); +SELECT a, HEX(a) FROM t1; +a HEX(a) +a 6100 +b 6200 +c 6300 +DROP TABLE t1; +# +# Check prepare statement from an UTF16 string +# +SET NAMES latin1; +SET @ivar= 1234; +SET @str1 = 'SELECT ?'; +SET @str2 = CONVERT(@str1 USING utf16le); +PREPARE stmt1 FROM @str2; +EXECUTE stmt1 USING @ivar; +? +1234 +# +# Check that utf16le works with ENUM and SET type +# +SET NAMES utf8, collation_connection=utf16le_general_ci; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +CREATE TABLE t1 (a ENUM('x','y','z') CHARACTER SET utf16le); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('x','y','z') CHARACTER SET utf16le COLLATE utf16le_general_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +INSERT INTO t1 VALUES ('x'); +INSERT INTO t1 VALUES ('y'); +INSERT INTO t1 VALUES ('z'); +SELECT a, HEX(a) FROM t1 ORDER BY a; +a HEX(a) +x 7800 +y 7900 +z 7A00 +ALTER TABLE t1 CHANGE a a ENUM('x','y','z','d','e','ä','ö','ü') CHARACTER SET utf16le; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('x','y','z','d','e','ä','ö','ü') CHARACTER SET utf16le COLLATE utf16le_general_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +INSERT INTO t1 VALUES ('D'); +INSERT INTO t1 VALUES ('E '); +INSERT INTO t1 VALUES ('ä'); +INSERT INTO t1 VALUES ('ö'); +INSERT INTO t1 VALUES ('ü'); +SELECT a, HEX(a) FROM t1 ORDER BY a; +a HEX(a) +x 7800 +y 7900 +z 7A00 +d 6400 +e 6500 +ä E400 +ö F600 +ü FC00 +DROP TABLE t1; +CREATE TABLE t1 (a set ('x','y','z','ä','ö','ü') CHARACTER SET utf16le); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` set('x','y','z','ä','ö','ü') CHARACTER SET utf16le COLLATE utf16le_general_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +INSERT INTO t1 VALUES ('x'); +INSERT INTO t1 VALUES ('y'); +INSERT INTO t1 VALUES ('z'); +INSERT INTO t1 VALUES ('x,y'); +INSERT INTO t1 VALUES ('x,y,z,ä,ö,ü'); +SELECT a, HEX(a) FROM t1 ORDER BY a; +a HEX(a) +x 7800 +y 7900 +x,y 78002C007900 +z 7A00 +x,y,z,ä,ö,ü 78002C0079002C007A002C00E4002C00F6002C00FC00 +DROP TABLE t1; +# +# Bug#7302 UCS2 data in ENUM fields get truncated when new column is added +# +CREATE TABLE t1(a ENUM('a','b','c')) DEFAULT CHARACTER SET utf16le; +INSERT INTO t1 VALUES('a'),('b'),('c'); +ALTER TABLE t1 ADD b CHAR(1); +SHOW WARNINGS; +Level Code Message +SELECT * FROM t1 ORDER BY a; +a b +a NULL +b NULL +c NULL +DROP TABLE t1; +SET NAMES utf8, collation_connection='utf16le_general_ci'; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +utf16le_general_ci 61000900 +utf16le_general_ci 6100 +utf16le_general_ci 61002000 +drop table t1; +select @@collation_connection; +@@collation_connection +utf16le_general_ci +create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ; +insert into t1 values('abcdef'); +insert into t1 values('_bcdef'); +insert into t1 values('a_cdef'); +insert into t1 values('ab_def'); +insert into t1 values('abc_ef'); +insert into t1 values('abcd_f'); +insert into t1 values('abcde_'); +select c1 as c1u from t1 where c1 like 'ab\_def'; +c1u +ab_def +select c1 as c2h from t1 where c1 like 'ab#_def' escape '#'; +c2h +ab_def +drop table t1; +SET NAMES utf8, collation_connection='utf16le_bin'; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +utf16le_bin 61000900 +utf16le_bin 6100 +utf16le_bin 61002000 +drop table t1; +# +# Bug#55980 Character sets: supplementary character _bin ordering is wrong +# +CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1) CHARACTER SET utf16le COLLATE utf16le_bin DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +INSERT INTO t1 VALUES (_utf8mb4 0xEFBE9D),(_utf8mb4 0xF0908E84); +INSERT INTO t1 VALUES (_utf8mb4 0xCE85),(_utf8mb4 0xF4808080); +SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a; +HEX(a) HEX(CONVERT(a USING utf8mb4)) +8503 CE85 +9DFF EFBE9D +00D884DF F0908E84 +C0DB00DC F4808080 +ALTER TABLE t1 ADD KEY(a); +SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a; +HEX(a) HEX(CONVERT(a USING utf8mb4)) +8503 CE85 +9DFF EFBE9D +00D884DF F0908E84 +C0DB00DC F4808080 +# Additional test for bug#37244 Character sets: short utf8_bin weight_string value +SELECT HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 ORDER BY a; +HEX(a) HEX(WEIGHT_STRING(a)) +8503 000385 +9DFF 00FF9D +00D884DF 010384 +C0DB00DC 100000 +DROP TABLE IF EXISTS t1; +# +# BUG#16691598 - ORDER BY LOWER(COLUMN) PRODUCES +# OUT-OF-ORDER RESULTS +# +CREATE TABLE t1 SELECT ('a a') as n; +INSERT INTO t1 VALUES('a b'); +SELECT * FROM t1 ORDER BY LOWER(n) ASC; +n +a a +a b +SELECT * FROM t1 ORDER BY LOWER(n) DESC; +n +a b +a a +DROP TABLE t1; +select @@collation_connection; +@@collation_connection +utf16le_bin +create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ; +insert into t1 values('abcdef'); +insert into t1 values('_bcdef'); +insert into t1 values('a_cdef'); +insert into t1 values('ab_def'); +insert into t1 values('abc_ef'); +insert into t1 values('abcd_f'); +insert into t1 values('abcde_'); +select c1 as c1u from t1 where c1 like 'ab\_def'; +c1u +ab_def +select c1 as c2h from t1 where c1 like 'ab#_def' escape '#'; +c2h +ab_def +drop table t1; +# +# Bug#10344 Some string functions fail for UCS2 +# +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf16le, pos INT); +INSERT INTO t1 VALUES (_ucs2 0x00e400e50068,1); +INSERT INTO t1 VALUES (_ucs2 0x00e400e50068,2); +INSERT INTO t1 VALUES (_ucs2 0x00e400e50068,3); +INSERT INTO t1 VALUES (_ucs2 0x00e400e50068,-1); +INSERT INTO t1 VALUES (_ucs2 0x00e400e50068,-2); +INSERT INTO t1 VALUES (_ucs2 0x00e400e50068,-3); +INSERT INTO t1 VALUES (_utf32 0x000000e4000000e500010000, 1); +INSERT INTO t1 VALUES (_utf32 0x000000e4000000e500010000, 2); +INSERT INTO t1 VALUES (_utf32 0x000000e4000000e500010000, 3); +INSERT INTO t1 VALUES (_utf32 0x000000e4000000e500010000, -1); +INSERT INTO t1 VALUES (_utf32 0x000000e4000000e500010000, -2); +INSERT INTO t1 VALUES (_utf32 0x000000e4000000e500010000, -3); +SELECT HEX(SUBSTR(a, pos)), SUBSTR(a, pos) FROM t1; +HEX(SUBSTR(a, pos)) SUBSTR(a, pos) +E400E5006800 äåh +E5006800 åh +6800 h +6800 h +E5006800 åh +E400E5006800 äåh +E400E50000D800DC äå? +E50000D800DC å? +00D800DC ? +00D800DC ? +E50000D800DC å? +E400E50000D800DC äå? +DROP TABLE t1; +SET NAMES utf8, collation_connection=utf16le_general_ci; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +# +# Bug#9442 Set parameter make query fail if column CHARACTER SET is UCS2 +# +CREATE TABLE t1 (utext VARCHAR(20) CHARACTER SET utf16le); +INSERT INTO t1 VALUES ("lily"); +INSERT INTO t1 VALUES ("river"); +PREPARE stmt FROM 'SELECT utext FROM t1 where utext like ?'; +SET @param1='%%'; +EXECUTE stmt USING @param1; +utext +lily +river +EXECUTE stmt USING @param1; +utext +lily +river +SELECT utext FROM t1 where utext like '%%'; +utext +lily +river +DROP TABLE t1; +DEALLOCATE PREPARE stmt; +# +# Bug #20108: corrupted default enum value for a ucs2 field +# +CREATE TABLE t1 ( +status ENUM('active','passive') CHARACTER SET utf16le COLLATE utf16le_general_ci +NOT NULL DEFAULT 'passive' +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `status` enum('active','passive') CHARACTER SET utf16le COLLATE utf16le_general_ci NOT NULL DEFAULT 'passive' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +ALTER TABLE t1 ADD a int NOT NULL AFTER status; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `status` enum('active','passive') CHARACTER SET utf16le COLLATE utf16le_general_ci NOT NULL DEFAULT 'passive', + `a` int NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +DROP TABLE t1; +# +# Conversion FROM an UTF16LE string to a decimal column +# +CREATE TABLE t1 (a VARCHAR(64) CHARACTER SET utf16le, b DECIMAL(10,3)); +INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0); +UPDATE t1 set b=a; +SELECT *, HEX(a) FROM t1; +a b HEX(a) +1.1 1.100 31002E003100 +2.1 2.100 32002E003100 +DROP TABLE t1; +# +# Bug#9442 Set parameter make query fail if column CHARACTER SET is UCS2 +# +CREATE TABLE t1 (utext VARCHAR(20) CHARACTER SET utf16le); +INSERT INTO t1 VALUES ("lily"); +INSERT INTO t1 VALUES ("river"); +PREPARE stmt FROM 'SELECT utext FROM t1 where utext like ?'; +SET @param1='%%'; +EXECUTE stmt USING @param1; +utext +lily +river +EXECUTE stmt USING @param1; +utext +lily +river +SELECT utext FROM t1 where utext like '%%'; +utext +lily +river +DROP TABLE t1; +DEALLOCATE PREPARE stmt; +# +# Bug#22638 SOUNDEX broken for international characters +# +SET NAMES utf8, collation_connection=utf16le_general_ci; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT SOUNDEX(''),SOUNDEX('he'),SOUNDEX('hello all folks'),SOUNDEX('#3556 in bugdb'); +SOUNDEX('') SOUNDEX('he') SOUNDEX('hello all folks') SOUNDEX('#3556 in bugdb') + H000 H4142 I51231 +SELECT HEX(SOUNDEX('')),HEX(SOUNDEX('he')),HEX(SOUNDEX('hello all folks')),HEX(SOUNDEX('#3556 in bugdb')); +HEX(SOUNDEX('')) HEX(SOUNDEX('he')) HEX(SOUNDEX('hello all folks')) HEX(SOUNDEX('#3556 in bugdb')) + 4800300030003000 48003400310034003200 490035003100320033003100 +SELECT 'mood' sounds like 'mud'; +'mood' sounds like 'mud' +1 +# Cyrillic A, BE, VE +SELECT HEX(SOUNDEX(_utf16le 0x041004110412)); +HEX(SOUNDEX(_utf16le 0x041004110412)) +0410300030003000 +# Make sure that "U+00BF INVERTED QUESTION MARK" is not considered as letter +SELECT HEX(SOUNDEX(_utf16le 0x00BF00C0)); +HEX(SOUNDEX(_utf16le 0x00BF00C0)) +00BF300030003000 +# +# Bug#14290: character_maximum_length for text fields +# +CREATE TABLE t1(a BLOB, b TEXT CHARSET utf16le); +SELECT data_type, character_octet_length, character_maximum_length +FROM information_schema.columns where table_name='t1'; +DATA_TYPE CHARACTER_OCTET_LENGTH CHARACTER_MAXIMUM_LENGTH +blob 65535 65535 +text 65535 32767 +DROP TABLE t1; +SET NAMES utf8, collation_connection=utf16le_general_ci; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +# +# Testing cs->coll->instr() +# +SELECT POSITION('bb' IN 'abba'); +POSITION('bb' IN 'abba') +2 +# +# Testing cs->coll->hash_sort() +# +SET NAMES utf8, collation_connection=utf16le_bin; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT @@collation_connection; +@@collation_connection +utf16le_bin +CREATE TABLE t1 ENGINE=HEAP AS SELECT REPEAT (' ', 10) AS a LIMIT 0; +ALTER TABLE t1 ADD KEY (a); +CREATE TABLE t2 (a VARCHAR(10)); +INSERT INTO t2 VALUES ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'); +INSERT INTO t2 VALUES ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F'); +INSERT INTO t1 SELECT CONCAT('a',t21.a,t22.a) FROM t2 t21, t2 t22 ORDER BY 1; +DROP TABLE t2; +INSERT INTO t1 VALUES ('a '); +SELECT a, HEX(a) FROM t1 WHERE a='a'; +a HEX(a) +a 61002000 +DROP TABLE t1; +SET NAMES utf8, collation_connection=utf16le_general_ci; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT @@collation_connection; +@@collation_connection +utf16le_general_ci +CREATE TABLE t1 ENGINE=HEAP AS SELECT REPEAT (' ', 10) AS a LIMIT 0; +ALTER TABLE t1 ADD KEY (a); +CREATE TABLE t2 (a VARCHAR(10)); +INSERT INTO t2 VALUES ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'); +INSERT INTO t2 VALUES ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F'); +INSERT INTO t1 SELECT CONCAT('a',t21.a,t22.a) FROM t2 t21, t2 t22 ORDER BY 1; +DROP TABLE t2; +INSERT INTO t1 VALUES ('a '); +SELECT a, HEX(a) FROM t1 WHERE a='a'; +a HEX(a) +a 61002000 +DROP TABLE t1; +# +# Testing cs->cset->numchars() +# +SELECT CHAR_LENGTH('abcd'), OCTET_LENGTH('abcd'); +CHAR_LENGTH('abcd') OCTET_LENGTH('abcd') +4 8 +SELECT CHAR_LENGTH(_utf16le 0x00D800DC), OCTET_LENGTH(_utf16le 0x00D800DC); +CHAR_LENGTH(_utf16le 0x00D800DC) OCTET_LENGTH(_utf16le 0x00D800DC) +1 4 +SELECT CHAR_LENGTH(_utf16le 0x7DD8FFDF), OCTET_LENGTH(_utf16le 0x7FD8DDDF); +CHAR_LENGTH(_utf16le 0x7DD8FFDF) OCTET_LENGTH(_utf16le 0x7FD8DDDF) +1 4 +# +# Testing cs->cset->charpos() +# +SELECT LEFT('abcd',2); +LEFT('abcd',2) +ab +SELECT HEX(LEFT(_utf16le 0x00D800DC7FD8FFDF, 1)); +HEX(LEFT(_utf16le 0x00D800DC7FD8FFDF, 1)) +00D800DC +SELECT HEX(RIGHT(_utf16le 0x00D800DC7FD8FFDF, 1)); +HEX(RIGHT(_utf16le 0x00D800DC7FD8FFDF, 1)) +7FD8FFDF +# +# Testing cs->cset->well_formed_length() +# +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf16le); +# Bad sequences +INSERT INTO t1 VALUES (_utf16le 0x00D8); +ERROR HY000: Invalid utf16le character string: '00D8' +INSERT INTO t1 VALUES (_utf16le 0x00DC); +ERROR HY000: Invalid utf16le character string: '00DC' +INSERT INTO t1 VALUES (_utf16le 0x00D800D8); +ERROR HY000: Invalid utf16le character string: '00D800' +INSERT INTO t1 VALUES (_utf16le 0x00D800E8); +ERROR HY000: Invalid utf16le character string: '00D800' +INSERT INTO t1 VALUES (_utf16le 0x00D80008); +ERROR HY000: Invalid utf16le character string: '00D800' +# Good sequences +INSERT INTO t1 VALUES (_utf16le 0x00D800DC); +INSERT INTO t1 VALUES (_utf16le 0x00D8FFDC); +INSERT INTO t1 VALUES (_utf16le 0xFFDB00DC); +INSERT INTO t1 VALUES (_utf16le 0xFFDBFFDC); +SELECT HEX(a) FROM t1; +HEX(a) +00D800DC +00D8FFDC +FFDB00DC +FFDBFFDC +DROP TABLE t1; +# +# Bug#32393 Character sets: illegal characters in utf16le columns +# +# Tests that cs->cset->wc_mb() doesn't accept surrogate parts +# +# via ALTER +# +SET sql_mode = ''; +CREATE TABLE t1 (s1 VARCHAR(50) CHARACTER SET ucs2); +INSERT INTO t1 VALUES (0xDF84); +ALTER TABLE t1 MODIFY column s1 VARCHAR(50) CHARACTER SET utf16le; +Warnings: +Warning 1366 Incorrect string value: '\xDF\x84' for column 's1' at row 1 +SELECT HEX(s1) FROM t1; +HEX(s1) +3F00 +DROP TABLE t1; +# +# via UPDATE +# +CREATE TABLE t1 (s1 VARCHAR(5) CHARACTER SET ucs2, s2 VARCHAR(5) CHARACTER SET utf16le); +INSERT INTO t1 (s1) VALUES (0xdf84); +UPDATE t1 set s2 = s1; +Warnings: +Warning 1366 Incorrect string value: '\xDF\x84' for column 's2' at row 1 +SELECT HEX(s2) FROM t1; +HEX(s2) +3F00 +DROP TABLE t1; +SET sql_mode = default; +# +# Testing cs->cset->lengthsp() +# +CREATE TABLE t1 (a CHAR(10)) CHARACTER SET utf16le; +INSERT INTO t1 VALUES ('a '); +SELECT HEX(a) FROM t1; +HEX(a) +6100 +DROP TABLE t1; +# +# Testing cs->cset->caseup() and cs->cset->casedn() +# +SELECT UPPER('abcd'), LOWER('ABCD'); +UPPER('abcd') LOWER('ABCD') +ABCD abcd +# +# Checking str_to_datetime() +# +select @@collation_connection; +@@collation_connection +utf16le_general_ci +CREATE TABLE t1 (a date); +INSERT INTO t1 VALUES ('2007-09-16'); +SELECT * FROM t1; +a +2007-09-16 +DROP TABLE t1; +# +# Testing cs->cset->ll10tostr +# +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf16le); +INSERT INTO t1 VALUES (123456); +SELECT a, HEX(a) FROM t1; +a HEX(a) +123456 310032003300340035003600 +DROP TABLE t1; +# +# Testing cs->cset->fill +# SOUNDEX fills strings with DIGIT ZERO up to four characters +# +SELECT SOUNDEX('a'), HEX(SOUNDEX('a')); +SOUNDEX('a') HEX(SOUNDEX('a')) +A000 4100300030003000 +# +# Testing cs->cset->strntoul +# +CREATE TABLE t1 (a enum ('a','b','c')) CHARACTER SET utf16le; +INSERT INTO t1 VALUES ('1'); +SELECT * FROM t1; +a +a +DROP TABLE t1; +# +# Testing cs->cset->strntoll and cs->cset->strntoull +# +SET NAMES latin1; +SELECT HEX(CONV(CONVERT('123' USING utf16le), -10, 16)); +HEX(CONV(CONVERT('123' USING utf16le), -10, 16)) +3742 +SELECT HEX(CONV(CONVERT('123' USING utf16le), 10, 16)); +HEX(CONV(CONVERT('123' USING utf16le), 10, 16)) +3742 +SET NAMES utf8, collation_connection=utf16le_general_ci; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +# +# Testing cs->cset->strntod +# +SET NAMES utf8, collation_connection=utf16le_general_ci; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT 1.1 + '1.2'; +1.1 + '1.2' +2.3 +SELECT 1.1 + '1.2xxx'; +1.1 + '1.2xxx' +2.3 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: '1.2xxx' +# +# Testing cs->cset->strtoll10 +# +SELECT LEFT('aaa','1'); +LEFT('aaa','1') +a +CREATE TABLE t1 AS SELECT REPEAT('abcd', 128) AS a; +SELECT LEFT(a, '2') FROM t1; +LEFT(a, '2') +ab +SELECT LEFT(a, ' \t \t 2') FROM t1; +LEFT(a, ' \t \t 2') +ab +SELECT LEFT(a, ' \t \t +2') FROM t1; +LEFT(a, ' \t \t +2') +ab +SELECT SUBSTR(a, '-2') FROM t1; +SUBSTR(a, '-2') +cd +SELECT SUBSTR(a, ' \t \t -2') FROM t1; +SUBSTR(a, ' \t \t -2') +cd +SELECT LEFT(a, '00002') FROM t1; +LEFT(a, '00002') +ab +SELECT LEFT(a, ' \t \t 00002') FROM t1; +LEFT(a, ' \t \t 00002') +ab +SELECT LEFT(a, ' \t \t +00002') FROM t1; +LEFT(a, ' \t \t +00002') +ab +SELECT SUBSTR(a, '-00002') FROM t1; +SUBSTR(a, '-00002') +cd +SELECT SUBSTR(a, ' \t \t -00002') FROM t1; +SUBSTR(a, ' \t \t -00002') +cd +DROP TABLE t1; +CREATE TABLE t1 AS SELECT REPEAT('abcd', 128) AS a LIMIT 0; +INSERT INTO t1 VALUES ('255'), ('65535'),('16777215'),('4294967295'), +('1099511627775'),('281474976710655'),('72057594037927935'), +('1844674407370955161'),('18446744073709551614'), ('18446744073709551615'); +SELECT a, CAST(a AS SIGNED), CAST(a AS UNSIGNED) FROM t1; +a CAST(a AS SIGNED) CAST(a AS UNSIGNED) +255 255 255 +65535 65535 65535 +16777215 16777215 16777215 +4294967295 4294967295 4294967295 +1099511627775 1099511627775 1099511627775 +281474976710655 281474976710655 281474976710655 +72057594037927935 72057594037927935 72057594037927935 +1844674407370955161 1844674407370955161 1844674407370955161 +18446744073709551614 -2 18446744073709551614 +18446744073709551615 -1 18446744073709551615 +Warnings: +Warning 1105 Cast to signed converted positive out-of-range integer to its negative complement +Warning 1105 Cast to signed converted positive out-of-range integer to its negative complement +UPDATE t1 SET a=CONCAT('-', a); +SELECT a, CAST(a AS SIGNED) FROM t1; +a CAST(a AS SIGNED) +-255 -255 +-65535 -65535 +-16777215 -16777215 +-4294967295 -4294967295 +-1099511627775 -1099511627775 +-281474976710655 -281474976710655 +-72057594037927935 -72057594037927935 +-1844674407370955161 -1844674407370955161 +-18446744073709551614 -9223372036854775808 +-18446744073709551615 -9223372036854775808 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '-18446744073709551614' +Warning 1292 Truncated incorrect INTEGER value: '-18446744073709551615' +DROP TABLE t1; +# +# Testing cs->cset->strntoull10rnd +# +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES ('-1234.1e2'); +INSERT IGNORE INTO t1 VALUES ('-1234.1e2xxxx'); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +INSERT INTO t1 VALUES ('-1234.1e2 '); +INSERT INTO t1 VALUES ('123'); +INSERT INTO t1 VALUES ('-124'); +INSERT INTO t1 VALUES ('+125'); +INSERT INTO t1 VALUES (' \t \t 123'); +INSERT INTO t1 VALUES (' \t \t -124'); +INSERT INTO t1 VALUES (' \t \t +125'); +INSERT INTO t1 VALUES (' \t \t 000123'); +INSERT INTO t1 VALUES (' \t \t -000124'); +INSERT INTO t1 VALUES (' \t \t +000125'); +SELECT * FROM t1; +a +-123410 +-123410 +-123410 +123 +-124 +125 +123 +-124 +125 +123 +-124 +125 +DROP TABLE t1; +CREATE TABLE t1 (a BIGINT UNSIGNED); +INSERT INTO t1 VALUES ('255'), ('65535'),('16777215'),('4294967295'), +('1099511627775'),('281474976710655'),('72057594037927935'), +('1844674407370955161'),('18446744073709551614'), ('18446744073709551615'); +SELECT * FROM t1; +a +255 +65535 +16777215 +4294967295 +1099511627775 +281474976710655 +72057594037927935 +1844674407370955161 +18446744073709551614 +18446744073709551615 +DROP TABLE t1; +# +# Testing cs->cset->scan +# +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES ('1 '); +INSERT IGNORE INTO t1 VALUES ('1 x'); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SELECT * FROM t1; +a +1 +1 +DROP TABLE t1; +# +# Testing auto-conversion to TEXT +# +SET sql_mode = ''; +CREATE TABLE t1 (a VARCHAR(17000) CHARACTER SET utf16le); +Warnings: +Note 1246 Converting column 'a' from VARCHAR to TEXT +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumtext CHARACTER SET utf16le COLLATE utf16le_general_ci +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +DROP TABLE t1; +SET sql_mode = default; +# +# Testing that maximim possible key length is 767 bytes for InnoDB +# +CREATE TABLE t1 (a VARCHAR(150) CHARACTER SET utf16le PRIMARY KEY); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(150) CHARACTER SET utf16le COLLATE utf16le_general_ci NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(334) CHARACTER SET utf16le PRIMARY KEY) ROW_FORMAT=COMPACT; +ERROR 42000: Specified key was too long; max key length is 767 bytes +# +# Conversion to utf8 +# +CREATE TABLE t1 (a CHAR(1) CHARACTER SET utf16le); +INSERT INTO t1 VALUES (0x00D800DC),(0x00D8FFDC),(0x7FDB00DC),(0x7FDBFFDC); +INSERT INTO t1 VALUES (0xC000), (0xFF00),(0x00E0), (0xFFFF); +SELECT HEX(a), HEX(@a:=CONVERT(a USING utf8mb4)), HEX(CONVERT(@a USING utf16le)) FROM t1; +HEX(a) HEX(@a:=CONVERT(a USING utf8mb4)) HEX(CONVERT(@a USING utf16le)) +00D800DC F0908080 00D800DC +00D8FFDC F09083BF 00D8FFDC +7FDB00DC F3AFB080 7FDB00DC +7FDBFFDC F3AFB3BF 7FDBFFDC +C000 C380 C000 +FF00 C3BF FF00 +00E0 EE8080 00E0 +FFFF EFBFBF FFFF +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +DROP TABLE t1; +# +# Test basic regex functionality +# +SET NAMES utf8, collation_connection=utf16le_general_ci; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +drop table if exists t1; +create table t1 as +select repeat(' ', 64) as s1, repeat(' ',64) as s2 +union +select null, null; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `s1` varchar(64) CHARACTER SET utf16le DEFAULT NULL, + `s2` varchar(64) CHARACTER SET utf16le DEFAULT NULL +) ENGINE=default_engine DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +delete from t1; +insert into t1 values('aaa','aaa'); +insert into t1 values('aaa|qqq','qqq'); +insert into t1 values('gheis','^[^a-dXYZ]+$'); +insert into t1 values('aab','^aa?b'); +insert into t1 values('Baaan','^Ba*n'); +insert into t1 values('aaa','qqq|aaa'); +insert into t1 values('qqq','qqq|aaa'); +insert into t1 values('bbb','qqq|aaa'); +insert into t1 values('bbb','qqq'); +insert into t1 values('aaa','aba'); +insert into t1 values(null,'abc'); +insert into t1 values('def',null); +insert into t1 values(null,null); +select HIGH_PRIORITY s1 regexp s2 from t1; +s1 regexp s2 +1 +1 +1 +1 +1 +1 +1 +0 +0 +0 +NULL +NULL +NULL +SELECT 'ghi' REGEXP 'ghi['; +ERROR HY000: The regular expression contains an unclosed bracket expression. +drop table t1; +# +# Test how CHARACTER SET works with date/time +# +CREATE TABLE t1 AS SELECT repeat('a',20) AS s1 LIMIT 0; +SET timestamp=1216359724; +INSERT INTO t1 VALUES (current_date); +INSERT INTO t1 VALUES (current_time); +INSERT INTO t1 VALUES (current_timestamp); +SELECT s1, hex(s1) FROM t1; +s1 hex(s1) +2008-07-18 32003000300038002D00300037002D0031003800 +08:42:04 300038003A00340032003A0030003400 +2008-07-18 08:42:04 32003000300038002D00300037002D00310038002000300038003A00340032003A0030003400 +DROP TABLE t1; +SET timestamp=0; +# +# Bug#33073 Character sets: ordering fails with utf32 +# +SET NAMES utf8, collation_connection=utf16le_general_ci; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +CREATE TABLE t1 AS SELECT REPEAT('a',2) as s1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `s1` varchar(2) CHARACTER SET utf16le DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +INSERT INTO t1 VALUES ('ab'),('AE'),('ab'),('AE'); +SELECT * FROM t1 ORDER BY s1; +s1 +ab +ab +AE +AE +SET max_sort_length=4; +SELECT * FROM t1 ORDER BY s1; +s1 +ab +ab +AE +AE +DROP TABLE t1; +SET max_sort_length=DEFAULT; +# +# Bug#52520 Difference in tinytext utf column metadata +# +CREATE TABLE t1 ( +s1 TINYTEXT CHARACTER SET utf16le, +s2 TEXT CHARACTER SET utf16le, +s3 MEDIUMTEXT CHARACTER SET utf16le, +s4 LONGTEXT CHARACTER SET utf16le +); +SET NAMES utf8, @@character_set_results=NULL; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT *, HEX(s1) FROM t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 s1 s1 252 255 0 Y 16 0 56 +def test t1 t1 s2 s2 252 65535 0 Y 16 0 56 +def test t1 t1 s3 s3 252 16777215 0 Y 16 0 56 +def test t1 t1 s4 s4 252 4294967295 0 Y 16 0 56 +def HEX(s1) 253 6120 0 Y 0 31 33 +s1 s2 s3 s4 HEX(s1) +SET NAMES latin1; +SELECT *, HEX(s1) FROM t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 s1 s1 252 127 0 Y 16 0 8 +def test t1 t1 s2 s2 252 32767 0 Y 16 0 8 +def test t1 t1 s3 s3 252 8388607 0 Y 16 0 8 +def test t1 t1 s4 s4 252 2147483647 0 Y 16 0 8 +def HEX(s1) 253 2040 0 Y 0 31 8 +s1 s2 s3 s4 HEX(s1) +SET NAMES utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT *, HEX(s1) FROM t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 s1 s1 252 381 0 Y 16 0 33 +def test t1 t1 s2 s2 252 98301 0 Y 16 0 33 +def test t1 t1 s3 s3 252 25165821 0 Y 16 0 33 +def test t1 t1 s4 s4 252 4294967295 0 Y 16 0 33 +def HEX(s1) 253 6120 0 Y 0 31 33 +s1 s2 s3 s4 HEX(s1) +CREATE TABLE t2 AS SELECT CONCAT(s1) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `CONCAT(s1)` varchar(255) CHARACTER SET utf16le DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +DROP TABLE t1, t2; +# +# Problem found by Roy during review +# MY_CS_BINSORT was not set for utf16le_bin, +# so filesort did not work well +# +SET NAMES utf8, @@collation_connection=utf16le_bin; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +CREATE TABLE t1 AS SELECT REPEAT(' ', 10) as c LIMIT 0; +ALTER TABLE t1 ADD PRIMARY KEY(c); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` varchar(10) CHARACTER SET utf16le COLLATE utf16le_bin NOT NULL, + PRIMARY KEY (`c`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +INSERT INTO t1 VALUES ('abc'),('zyx'),('acb'); +SELECT UPPER(c) FROM t1 ORDER BY 1 DESC; +UPPER(c) +ZYX +ACB +ABC +DROP TABLE t1; +# +# WL#3664 WEIGHT_STRING +# +SET NAMES utf8, collation_connection=utf16le_general_ci; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +select @@collation_connection; +@@collation_connection +utf16le_general_ci +select hex(weight_string('a')); +hex(weight_string('a')) +0041 +select hex(weight_string('A')); +hex(weight_string('A')) +0041 +select hex(weight_string('abc')); +hex(weight_string('abc')) +004100420043 +select hex(weight_string('abc' as char(2))); +hex(weight_string('abc' as char(2))) +00410042 +select hex(weight_string('abc' as char(3))); +hex(weight_string('abc' as char(3))) +004100420043 +select hex(weight_string('abc' as char(5))); +hex(weight_string('abc' as char(5))) +00410042004300200020 +select hex(weight_string('abc', 1, 2, 0xC0)); +hex(weight_string('abc', 1, 2, 0xC0)) +00 +select hex(weight_string('abc', 2, 2, 0xC0)); +hex(weight_string('abc', 2, 2, 0xC0)) +0041 +select hex(weight_string('abc', 3, 2, 0xC0)); +hex(weight_string('abc', 3, 2, 0xC0)) +004100 +select hex(weight_string('abc', 4, 2, 0xC0)); +hex(weight_string('abc', 4, 2, 0xC0)) +00410042 +select hex(weight_string('abc', 5, 2, 0xC0)); +hex(weight_string('abc', 5, 2, 0xC0)) +0041004200 +select hex(weight_string('abc',25, 2, 0xC0)); +hex(weight_string('abc',25, 2, 0xC0)) +00410042002000200020002000200020002000200020002000 +select hex(weight_string('abc', 1, 3, 0xC0)); +hex(weight_string('abc', 1, 3, 0xC0)) +00 +select hex(weight_string('abc', 2, 3, 0xC0)); +hex(weight_string('abc', 2, 3, 0xC0)) +0041 +select hex(weight_string('abc', 3, 3, 0xC0)); +hex(weight_string('abc', 3, 3, 0xC0)) +004100 +select hex(weight_string('abc', 4, 3, 0xC0)); +hex(weight_string('abc', 4, 3, 0xC0)) +00410042 +select hex(weight_string('abc', 5, 3, 0xC0)); +hex(weight_string('abc', 5, 3, 0xC0)) +0041004200 +select hex(weight_string('abc',25, 3, 0xC0)); +hex(weight_string('abc',25, 3, 0xC0)) +00410042004300200020002000200020002000200020002000 +select hex(weight_string('abc', 1, 4, 0xC0)); +hex(weight_string('abc', 1, 4, 0xC0)) +00 +select hex(weight_string('abc', 2, 4, 0xC0)); +hex(weight_string('abc', 2, 4, 0xC0)) +0041 +select hex(weight_string('abc', 3, 4, 0xC0)); +hex(weight_string('abc', 3, 4, 0xC0)) +004100 +select hex(weight_string('abc', 4, 4, 0xC0)); +hex(weight_string('abc', 4, 4, 0xC0)) +00410042 +select hex(weight_string('abc', 5, 4, 0xC0)); +hex(weight_string('abc', 5, 4, 0xC0)) +0041004200 +select hex(weight_string('abc',25, 4, 0xC0)); +hex(weight_string('abc',25, 4, 0xC0)) +00410042004300200020002000200020002000200020002000 +select @@collation_connection; +@@collation_connection +utf16le_general_ci +select hex(weight_string(cast(_latin1 0x80 as char))); +hex(weight_string(cast(_latin1 0x80 as char))) +20AC +select hex(weight_string(cast(_latin1 0x808080 as char))); +hex(weight_string(cast(_latin1 0x808080 as char))) +20AC20AC20AC +select hex(weight_string(cast(_latin1 0x808080 as char) as char(2))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(2))) +20AC20AC +select hex(weight_string(cast(_latin1 0x808080 as char) as char(3))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(3))) +20AC20AC20AC +select hex(weight_string(cast(_latin1 0x808080 as char) as char(5))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(5))) +20AC20AC20AC00200020 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)) +20 +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)) +20AC +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)) +20AC20 +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)) +20AC20AC +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)) +20AC20AC00 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)) +20AC20AC002000200020002000200020002000200020002000 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)) +20 +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)) +20AC +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)) +20AC20 +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)) +20AC20AC +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)) +20AC20AC20 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)) +20AC20AC20AC00200020002000200020002000200020002000 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)) +20 +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)) +20AC +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)) +20AC20 +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)) +20AC20AC +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)) +20AC20AC20 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)) +20AC20AC20AC00200020002000200020002000200020002000 +SELECT HEX(WEIGHT_STRING(_utf16le 0x00D800DC)); +HEX(WEIGHT_STRING(_utf16le 0x00D800DC)) +FFFD +SELECT HEX(WEIGHT_STRING(_utf16le 0x00D801DC)); +HEX(WEIGHT_STRING(_utf16le 0x00D801DC)) +FFFD +SET NAMES utf8, collation_connection=utf16le_bin; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +select @@collation_connection; +@@collation_connection +utf16le_bin +select hex(weight_string('a')); +hex(weight_string('a')) +000061 +select hex(weight_string('A')); +hex(weight_string('A')) +000041 +select hex(weight_string('abc')); +hex(weight_string('abc')) +000061000062000063 +select hex(weight_string('abc' as char(2))); +hex(weight_string('abc' as char(2))) +000061000062 +select hex(weight_string('abc' as char(3))); +hex(weight_string('abc' as char(3))) +000061000062000063 +select hex(weight_string('abc' as char(5))); +hex(weight_string('abc' as char(5))) +000061000062000063000020000020 +select hex(weight_string('abc', 1, 2, 0xC0)); +hex(weight_string('abc', 1, 2, 0xC0)) +00 +select hex(weight_string('abc', 2, 2, 0xC0)); +hex(weight_string('abc', 2, 2, 0xC0)) +0000 +select hex(weight_string('abc', 3, 2, 0xC0)); +hex(weight_string('abc', 3, 2, 0xC0)) +000061 +select hex(weight_string('abc', 4, 2, 0xC0)); +hex(weight_string('abc', 4, 2, 0xC0)) +00006100 +select hex(weight_string('abc', 5, 2, 0xC0)); +hex(weight_string('abc', 5, 2, 0xC0)) +0000610000 +select hex(weight_string('abc',25, 2, 0xC0)); +hex(weight_string('abc',25, 2, 0xC0)) +00006100006200002000002000002000002000002000002000 +select hex(weight_string('abc', 1, 3, 0xC0)); +hex(weight_string('abc', 1, 3, 0xC0)) +00 +select hex(weight_string('abc', 2, 3, 0xC0)); +hex(weight_string('abc', 2, 3, 0xC0)) +0000 +select hex(weight_string('abc', 3, 3, 0xC0)); +hex(weight_string('abc', 3, 3, 0xC0)) +000061 +select hex(weight_string('abc', 4, 3, 0xC0)); +hex(weight_string('abc', 4, 3, 0xC0)) +00006100 +select hex(weight_string('abc', 5, 3, 0xC0)); +hex(weight_string('abc', 5, 3, 0xC0)) +0000610000 +select hex(weight_string('abc',25, 3, 0xC0)); +hex(weight_string('abc',25, 3, 0xC0)) +00006100006200006300002000002000002000002000002000 +select hex(weight_string('abc', 1, 4, 0xC0)); +hex(weight_string('abc', 1, 4, 0xC0)) +00 +select hex(weight_string('abc', 2, 4, 0xC0)); +hex(weight_string('abc', 2, 4, 0xC0)) +0000 +select hex(weight_string('abc', 3, 4, 0xC0)); +hex(weight_string('abc', 3, 4, 0xC0)) +000061 +select hex(weight_string('abc', 4, 4, 0xC0)); +hex(weight_string('abc', 4, 4, 0xC0)) +00006100 +select hex(weight_string('abc', 5, 4, 0xC0)); +hex(weight_string('abc', 5, 4, 0xC0)) +0000610000 +select hex(weight_string('abc',25, 4, 0xC0)); +hex(weight_string('abc',25, 4, 0xC0)) +00006100006200006300002000002000002000002000002000 +select @@collation_connection; +@@collation_connection +utf16le_bin +select hex(weight_string(cast(_latin1 0x80 as char))); +hex(weight_string(cast(_latin1 0x80 as char))) +0020AC +select hex(weight_string(cast(_latin1 0x808080 as char))); +hex(weight_string(cast(_latin1 0x808080 as char))) +0020AC0020AC0020AC +select hex(weight_string(cast(_latin1 0x808080 as char) as char(2))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(2))) +0020AC0020AC +select hex(weight_string(cast(_latin1 0x808080 as char) as char(3))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(3))) +0020AC0020AC0020AC +select hex(weight_string(cast(_latin1 0x808080 as char) as char(5))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(5))) +0020AC0020AC0020AC000020000020 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)) +00 +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)) +0020 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)) +0020AC +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)) +0020AC00 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)) +0020AC0020 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)) +0020AC0020AC00002000002000002000002000002000002000 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)) +00 +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)) +0020 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)) +0020AC +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)) +0020AC00 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)) +0020AC0020 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)) +0020AC0020AC0020AC00002000002000002000002000002000 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)) +00 +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)) +0020 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)) +0020AC +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)) +0020AC00 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)) +0020AC0020 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)) +0020AC0020AC0020AC00002000002000002000002000002000 +# +# End of 5.6 tests +# diff --git a/mysql-test/r/ctype_utf32.result-pq b/mysql-test/r/ctype_utf32.result-pq new file mode 100644 index 000000000000..475d46cc94ea --- /dev/null +++ b/mysql-test/r/ctype_utf32.result-pq @@ -0,0 +1,1431 @@ +# +# Start of 5.5 tests +# +SET NAMES latin1; +SET character_set_connection=utf32; +select hex('a'), hex('a '); +hex('a') hex('a ') +00000061 0000006100000020 +select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; +'a' = 'a' 'a' = 'a ' 'a ' = 'a' +1 1 1 +select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a'; +'a\0' = 'a' 'a\0' < 'a' 'a\0' > 'a' +0 1 0 +select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0'; +'a' = 'a\0' 'a' < 'a\0' 'a' > 'a\0' +0 0 1 +select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a '; +'a\0' = 'a ' 'a\0' < 'a ' 'a\0' > 'a ' +0 1 0 +select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0'; +'a ' = 'a\0' 'a ' < 'a\0' 'a ' > 'a\0' +0 0 1 +select 'a a' > 'a', 'a \0' < 'a'; +'a a' > 'a' 'a \0' < 'a' +1 1 +select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a'; +binary 'a a' > 'a' binary 'a \0' > 'a' binary 'a\0' > 'a' +1 1 1 +select hex(_utf32 0x44); +hex(_utf32 0x44) +00000044 +select hex(_utf32 0x3344); +hex(_utf32 0x3344) +00003344 +select hex(_utf32 0x103344); +hex(_utf32 0x103344) +00103344 +select hex(_utf32 X'44'); +hex(_utf32 X'44') +00000044 +select hex(_utf32 X'3344'); +hex(_utf32 X'3344') +00003344 +select hex(_utf32 X'103344'); +hex(_utf32 X'103344') +00103344 +CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf32; +INSERT INTO t1 VALUES (_koi8r 0xF2, _koi8r 0xF2), (X'2004',X'2004'); +SELECT hex(word) FROM t1 ORDER BY word; +hex(word) +00000420 +00002004 +SELECT hex(word2) FROM t1 ORDER BY word2; +hex(word2) +00000420 +00002004 +DELETE FROM t1; +INSERT INTO t1 VALUES +(X'000004200000002000000020',X'000004200000002000000020'), +(X'000020040000002000000020',X'000020040000002000000020'); +SELECT hex(word) FROM t1 ORDER BY word; +hex(word) +000004200000002000000020 +000020040000002000000020 +SELECT hex(word2) FROM t1 ORDER BY word2; +hex(word2) +00000420 +00002004 +DROP TABLE t1; +SELECT hex(LPAD(_utf32 X'0420',10,_utf32 X'0421')); +hex(LPAD(_utf32 X'0420',10,_utf32 X'0421')) +00000421000004210000042100000421000004210000042100000421000004210000042100000420 +SELECT hex(LPAD(_utf32 X'0420',10,_utf32 X'0000042100000422')); +hex(LPAD(_utf32 X'0420',10,_utf32 X'0000042100000422')) +00000421000004220000042100000422000004210000042200000421000004220000042100000420 +SELECT hex(LPAD(_utf32 X'0420',10,_utf32 X'000004210000042200000423')); +hex(LPAD(_utf32 X'0420',10,_utf32 X'000004210000042200000423')) +00000421000004220000042300000421000004220000042300000421000004220000042300000420 +SELECT hex(LPAD(_utf32 X'000004200000042100000422000004230000042400000425000004260000042700000428000004290000042A0000042B',10,_utf32 X'000004210000042200000423')); +hex(LPAD(_utf32 X'000004200000042100000422000004230000042400000425000004260000042700000428000004290000042A0000042B',10,_utf32 X'000004210000042200000423')) +00000420000004210000042200000423000004240000042500000426000004270000042800000429 +SELECT hex(RPAD(_utf32 X'0420',10,_utf32 X'0421')); +hex(RPAD(_utf32 X'0420',10,_utf32 X'0421')) +00000420000004210000042100000421000004210000042100000421000004210000042100000421 +SELECT hex(RPAD(_utf32 X'0420',10,_utf32 X'0000042100000422')); +hex(RPAD(_utf32 X'0420',10,_utf32 X'0000042100000422')) +00000420000004210000042200000421000004220000042100000422000004210000042200000421 +SELECT hex(RPAD(_utf32 X'0420',10,_utf32 X'000004210000042200000423')); +hex(RPAD(_utf32 X'0420',10,_utf32 X'000004210000042200000423')) +00000420000004210000042200000423000004210000042200000423000004210000042200000423 +SELECT hex(RPAD(_utf32 X'000004200000042100000422000004230000042400000425000004260000042700000428000004290000042A0000042B',10,_utf32 X'000004210000042200000423')); +hex(RPAD(_utf32 X'000004200000042100000422000004230000042400000425000004260000042700000428000004290000042A0000042B',10,_utf32 X'000004210000042200000423')) +00000420000004210000042200000423000004240000042500000426000004270000042800000429 +CREATE TABLE t1 SELECT +LPAD(_utf32 X'0420',10,_utf32 X'0421') l, +RPAD(_utf32 X'0420',10,_utf32 X'0421') r; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `l` varchar(10) CHARACTER SET utf32 DEFAULT NULL, + `r` varchar(10) CHARACTER SET utf32 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +select hex(l), hex(r) from t1; +hex(l) hex(r) +00000421000004210000042100000421000004210000042100000421000004210000042100000420 00000420000004210000042100000421000004210000042100000421000004210000042100000421 +DROP TABLE t1; +create table t1 (f1 char(30)); +insert into t1 values ("103000"), ("22720000"), ("3401200"), ("78000"); +select lpad(f1, 12, "-o-/") from t1; +lpad(f1, 12, "-o-/") +-o-/-o103000 +-o-/22720000 +-o-/-3401200 +-o-/-o-78000 +drop table t1; +SET NAMES latin1; +SET character_set_connection=utf32; +select @@collation_connection; +@@collation_connection +utf32_general_ci +create table t1 as select repeat(' ',10) as a union select null; +alter table t1 add key(a); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) CHARACTER SET utf32 DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); +explain select * from t1 where a like 'abc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range a a 43 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` like 'abc%') +explain select * from t1 where a like concat('abc','%'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range a a 43 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ 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 +abcd +select * from t1 where a like concat("abc","%"); +a +abc +abcd +select * from t1 where a like "ABC%"; +a +abc +abcd +select * from t1 where a like "test%"; +a +test +select * from t1 where a like "te_t"; +a +test +select * from t1 where a like "%a%"; +a +a +abc +abcd +select * from t1 where a like "%abcd%"; +a +abcd +select * from t1 where a like "%abc\d%"; +a +abcd +drop table t1; +select 'AA' like 'AA'; +'AA' like 'AA' +1 +select 'AA' like 'A%A'; +'AA' like 'A%A' +1 +select 'AA' like 'A%%A'; +'AA' like 'A%%A' +1 +select 'AA' like 'AA%'; +'AA' like 'AA%' +1 +select 'AA' like '%AA%'; +'AA' like '%AA%' +1 +select 'AA' like '%A'; +'AA' like '%A' +1 +select 'AA' like '%AA'; +'AA' like '%AA' +1 +select 'AA' like 'A%A%'; +'AA' like 'A%A%' +1 +select 'AA' like '_%_%'; +'AA' like '_%_%' +1 +select 'AA' like '%A%A'; +'AA' like '%A%A' +1 +select 'AAA'like 'A%A%A'; +'AAA'like 'A%A%A' +1 +select 'AZ' like 'AZ'; +'AZ' like 'AZ' +1 +select 'AZ' like 'A%Z'; +'AZ' like 'A%Z' +1 +select 'AZ' like 'A%%Z'; +'AZ' like 'A%%Z' +1 +select 'AZ' like 'AZ%'; +'AZ' like 'AZ%' +1 +select 'AZ' like '%AZ%'; +'AZ' like '%AZ%' +1 +select 'AZ' like '%Z'; +'AZ' like '%Z' +1 +select 'AZ' like '%AZ'; +'AZ' like '%AZ' +1 +select 'AZ' like 'A%Z%'; +'AZ' like 'A%Z%' +1 +select 'AZ' like '_%_%'; +'AZ' like '_%_%' +1 +select 'AZ' like '%A%Z'; +'AZ' like '%A%Z' +1 +select 'AZ' like 'A_'; +'AZ' like 'A_' +1 +select 'AZ' like '_Z'; +'AZ' like '_Z' +1 +select 'AMZ'like 'A%M%Z'; +'AMZ'like 'A%M%Z' +1 +SET NAMES utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SET character_set_connection=utf32; +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32); +INSERT INTO t1 VALUES ('фыва'),('Фыва'),('фЫва'),('фыВа'),('фывА'),('ФЫВА'); +INSERT INTO t1 VALUES ('фывапролдж'),('Фывапролдж'),('фЫвапролдж'),('фыВапролдж'); +INSERT INTO t1 VALUES ('фывАпролдж'),('фываПролдж'),('фывапРолдж'),('фывапрОлдж'); +INSERT INTO t1 VALUES ('фывапроЛдж'),('фывапролДж'),('фывапролдЖ'),('ФЫВАПРОЛДЖ'); +SELECT * FROM t1 WHERE a LIKE '%фЫва%' ORDER BY BINARY a; +a +ФЫВА +ФЫВАПРОЛДЖ +Фыва +Фывапролдж +фЫва +фЫвапролдж +фыВа +фыВапролдж +фывА +фывАпролдж +фыва +фываПролдж +фывапРолдж +фывапрОлдж +фывапроЛдж +фывапролДж +фывапролдЖ +фывапролдж +SELECT * FROM t1 WHERE a LIKE '%фЫв%' ORDER BY BINARY a; +a +ФЫВА +ФЫВАПРОЛДЖ +Фыва +Фывапролдж +фЫва +фЫвапролдж +фыВа +фыВапролдж +фывА +фывАпролдж +фыва +фываПролдж +фывапРолдж +фывапрОлдж +фывапроЛдж +фывапролДж +фывапролдЖ +фывапролдж +SELECT * FROM t1 WHERE a LIKE 'фЫва%' ORDER BY BINARY a; +a +ФЫВА +ФЫВАПРОЛДЖ +Фыва +Фывапролдж +фЫва +фЫвапролдж +фыВа +фыВапролдж +фывА +фывАпролдж +фыва +фываПролдж +фывапРолдж +фывапрОлдж +фывапроЛдж +фывапролДж +фывапролдЖ +фывапролдж +SELECT * FROM t1 WHERE a LIKE 'фЫва%' COLLATE utf32_bin ORDER BY BINARY a; +a +фЫва +фЫвапролдж +DROP TABLE t1; +CREATE TABLE t1 (word varchar(64) NOT NULL, PRIMARY KEY (word)) +CHARACTER SET utf32; +INSERT INTO t1 (word) VALUES ("cat"); +SELECT * FROM t1 WHERE word LIKE "c%"; +word +cat +SELECT * FROM t1 WHERE word LIKE "ca_"; +word +cat +SELECT * FROM t1 WHERE word LIKE "cat"; +word +cat +SELECT * FROM t1 WHERE word LIKE _utf32 x'0000006300000025'; +word +cat +SELECT * FROM t1 WHERE word LIKE _utf32 x'00000063000000610000005F'; +word +cat +DROP TABLE t1; +select insert(_utf32 0x000000610000006200000063,10,2,_utf32 0x000000640000006500000066); +insert(_utf32 0x000000610000006200000063,10,2,_utf32 0x000000640000006500000066) +abc +select insert(_utf32 0x000000610000006200000063,1,2,_utf32 0x000000640000006500000066); +insert(_utf32 0x000000610000006200000063,1,2,_utf32 0x000000640000006500000066) +defc +SELECT hex(cast(0xAA as char character set utf32)); +hex(cast(0xAA as char character set utf32)) +000000AA +SELECT hex(convert(0xAA using utf32)); +hex(convert(0xAA using utf32)) +000000AA +CREATE TABLE t1 (a char(10) character set utf32); +INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111); +SELECT HEX(a) FROM t1; +HEX(a) +00000001 +00000011 +00000111 +00001111 +00011111 +DROP TABLE t1; +CREATE TABLE t1 (a varchar(10) character set utf32); +INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111); +SELECT HEX(a) FROM t1; +HEX(a) +00000001 +00000011 +00000111 +00001111 +00011111 +DROP TABLE t1; +CREATE TABLE t1 (a text character set utf32); +INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111); +SELECT HEX(a) FROM t1; +HEX(a) +00000001 +00000011 +00000111 +00001111 +00011111 +DROP TABLE t1; +CREATE TABLE t1 (a mediumtext character set utf32); +INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111); +SELECT HEX(a) FROM t1; +HEX(a) +00000001 +00000011 +00000111 +00001111 +00011111 +DROP TABLE t1; +CREATE TABLE t1 (a longtext character set utf32); +INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111); +SELECT HEX(a) FROM t1; +HEX(a) +00000001 +00000011 +00000111 +00001111 +00011111 +DROP TABLE t1; +create table t1(a char(1)) default charset utf32; +insert into t1 values ('a'),('b'),('c'); +alter table t1 modify a char(5); +select a, hex(a) from t1; +a hex(a) +a 00000061 +b 00000062 +c 00000063 +drop table t1; +set names latin1; +set @ivar= 1234; +set @str1 = 'select ?'; +set @str2 = convert(@str1 using utf32); +prepare stmt1 from @str2; +execute stmt1 using @ivar; +? +1234 +set names utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +create table t1 (a enum('x','y','z') character set utf32); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('x','y','z') CHARACTER SET utf32 COLLATE utf32_general_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +insert into t1 values ('x'); +insert into t1 values ('y'); +insert into t1 values ('z'); +select a, hex(a) from t1 order by a; +a hex(a) +x 00000078 +y 00000079 +z 0000007A +alter table t1 change a a enum('x','y','z','d','e','ä','ö','ü') character set utf32; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('x','y','z','d','e','ä','ö','ü') CHARACTER SET utf32 COLLATE utf32_general_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +insert into t1 values ('D'); +insert into t1 values ('E '); +insert into t1 values ('ä'); +insert into t1 values ('ö'); +insert into t1 values ('ü'); +select a, hex(a) from t1 order by a; +a hex(a) +x 00000078 +y 00000079 +z 0000007A +d 00000064 +e 00000065 +ä 000000E4 +ö 000000F6 +ü 000000FC +drop table t1; +create table t1 (a set ('x','y','z','ä','ö','ü') character set utf32); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` set('x','y','z','ä','ö','ü') CHARACTER SET utf32 COLLATE utf32_general_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +insert into t1 values ('x'); +insert into t1 values ('y'); +insert into t1 values ('z'); +insert into t1 values ('x,y'); +insert into t1 values ('x,y,z,ä,ö,ü'); +select a, hex(a) from t1 order by a; +a hex(a) +x 00000078 +y 00000079 +x,y 000000780000002C00000079 +z 0000007A +x,y,z,ä,ö,ü 000000780000002C000000790000002C0000007A0000002C000000E40000002C000000F60000002C000000FC +drop table t1; +create table t1(a enum('a','b','c')) default character set utf32; +insert into t1 values('a'),('b'),('c'); +alter table t1 add b char(1); +show warnings; +Level Code Message +select * from t1 order by a; +a b +a NULL +b NULL +c NULL +drop table t1; +SET NAMES latin1; +SET collation_connection='utf32_general_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +utf32_general_ci 0000006100000009 +utf32_general_ci 00000061 +utf32_general_ci 0000006100000020 +drop table t1; +select @@collation_connection; +@@collation_connection +utf32_general_ci +create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ; +insert into t1 values('abcdef'); +insert into t1 values('_bcdef'); +insert into t1 values('a_cdef'); +insert into t1 values('ab_def'); +insert into t1 values('abc_ef'); +insert into t1 values('abcd_f'); +insert into t1 values('abcde_'); +select c1 as c1u from t1 where c1 like 'ab\_def'; +c1u +ab_def +select c1 as c2h from t1 where c1 like 'ab#_def' escape '#'; +c2h +ab_def +drop table t1; +SET NAMES latin1; +SET collation_connection='utf32_bin'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +utf32_bin 0000006100000009 +utf32_bin 00000061 +utf32_bin 0000006100000020 +drop table t1; +# +# Bug#55980 Character sets: supplementary character _bin ordering is wrong +# +CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(1) CHARACTER SET utf32 COLLATE utf32_bin DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +INSERT INTO t1 VALUES (_utf8mb4 0xEFBE9D),(_utf8mb4 0xF0908E84); +INSERT INTO t1 VALUES (_utf8mb4 0xCE85),(_utf8mb4 0xF4808080); +SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a; +HEX(a) HEX(CONVERT(a USING utf8mb4)) +00000385 CE85 +0000FF9D EFBE9D +00010384 F0908E84 +00100000 F4808080 +ALTER TABLE t1 ADD KEY(a); +SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a; +HEX(a) HEX(CONVERT(a USING utf8mb4)) +00000385 CE85 +0000FF9D EFBE9D +00010384 F0908E84 +00100000 F4808080 +# Additional test for bug#37244 Character sets: short utf8_bin weight_string value +SELECT HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 ORDER BY a; +HEX(a) HEX(WEIGHT_STRING(a)) +00000385 000385 +0000FF9D 00FF9D +00010384 010384 +00100000 100000 +DROP TABLE IF EXISTS t1; +# +# BUG#16691598 - ORDER BY LOWER(COLUMN) PRODUCES +# OUT-OF-ORDER RESULTS +# +CREATE TABLE t1 SELECT ('a a') as n; +INSERT INTO t1 VALUES('a b'); +SELECT * FROM t1 ORDER BY LOWER(n) ASC; +n +a a +a b +SELECT * FROM t1 ORDER BY LOWER(n) DESC; +n +a b +a a +DROP TABLE t1; +select @@collation_connection; +@@collation_connection +utf32_bin +create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ; +insert into t1 values('abcdef'); +insert into t1 values('_bcdef'); +insert into t1 values('a_cdef'); +insert into t1 values('ab_def'); +insert into t1 values('abc_ef'); +insert into t1 values('abcd_f'); +insert into t1 values('abcde_'); +select c1 as c1u from t1 where c1 like 'ab\_def'; +c1u +ab_def +select c1 as c2h from t1 where c1 like 'ab#_def' escape '#'; +c2h +ab_def +drop table t1; +select hex(substr(_utf32 0x000000e4000000e500000068,1)); +hex(substr(_utf32 0x000000e4000000e500000068,1)) +000000E4000000E500000068 +select hex(substr(_utf32 0x000000e4000000e500000068,2)); +hex(substr(_utf32 0x000000e4000000e500000068,2)) +000000E500000068 +select hex(substr(_utf32 0x000000e4000000e500000068,3)); +hex(substr(_utf32 0x000000e4000000e500000068,3)) +00000068 +select hex(substr(_utf32 0x000000e4000000e500000068,-1)); +hex(substr(_utf32 0x000000e4000000e500000068,-1)) +00000068 +select hex(substr(_utf32 0x000000e4000000e500000068,-2)); +hex(substr(_utf32 0x000000e4000000e500000068,-2)) +000000E500000068 +select hex(substr(_utf32 0x000000e4000000e500000068,-3)); +hex(substr(_utf32 0x000000e4000000e500000068,-3)) +000000E4000000E500000068 +create table t1 (utext varchar(20) character set utf32); +insert into t1 values ("lily"); +insert into t1 values ("river"); +prepare stmt from 'select utext from t1 where utext like ?'; +set @param1='%%'; +execute stmt using @param1; +utext +lily +river +execute stmt using @param1; +utext +lily +river +select utext from t1 where utext like '%%'; +utext +lily +river +drop table t1; +deallocate prepare stmt; +CREATE TABLE t1 ( +status enum('active','passive') character set utf32 collate utf32_general_ci +NOT NULL default 'passive' +); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `status` enum('active','passive') CHARACTER SET utf32 COLLATE utf32_general_ci NOT NULL DEFAULT 'passive' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +ALTER TABLE t1 ADD a int NOT NULL AFTER status; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `status` enum('active','passive') CHARACTER SET utf32 COLLATE utf32_general_ci NOT NULL DEFAULT 'passive', + `a` int NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +DROP TABLE t1; +End of 4.1 tests +CREATE TABLE t1 (a varchar(64) character set utf32, b decimal(10,3)); +INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0); +update t1 set b=a; +SELECT *, hex(a) FROM t1; +a b hex(a) +1.1 1.100 000000310000002E00000031 +2.1 2.100 000000320000002E00000031 +DROP TABLE t1; +create table t1 (utext varchar(20) character set utf32); +insert into t1 values ("lily"); +insert into t1 values ("river"); +prepare stmt from 'select utext from t1 where utext like ?'; +set @param1='%%'; +execute stmt using @param1; +utext +lily +river +execute stmt using @param1; +utext +lily +river +select utext from t1 where utext like '%%'; +utext +lily +river +drop table t1; +deallocate prepare stmt; +set names latin1; +set character_set_connection=utf32; +select soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb'); +soundex('') soundex('he') soundex('hello all folks') soundex('#3556 in bugdb') + H000 H4142 I51231 +select hex(soundex('')),hex(soundex('he')),hex(soundex('hello all folks')),hex(soundex('#3556 in bugdb')); +hex(soundex('')) hex(soundex('he')) hex(soundex('hello all folks')) hex(soundex('#3556 in bugdb')) + 00000048000000300000003000000030 0000004800000034000000310000003400000032 000000490000003500000031000000320000003300000031 +select 'mood' sounds like 'mud'; +'mood' sounds like 'mud' +1 +select hex(soundex(_utf32 0x000004100000041100000412)); +hex(soundex(_utf32 0x000004100000041100000412)) +00000410000000300000003000000030 +select hex(soundex(_utf32 0x000000BF000000C0)); +hex(soundex(_utf32 0x000000BF000000C0)) +000000C0000000300000003000000030 +set names latin1; +create table t1(a blob, b text charset utf32); +select data_type, character_octet_length, character_maximum_length +from information_schema.columns where table_name='t1'; +DATA_TYPE CHARACTER_OCTET_LENGTH CHARACTER_MAXIMUM_LENGTH +blob 65535 65535 +text 65535 16383 +drop table t1; +set names latin1; +set collation_connection=utf32_general_ci; +select position('bb' in 'abba'); +position('bb' in 'abba') +2 +create table t1 (a varchar(10) character set utf32) engine=heap; +insert into t1 values ('a'),('A'),('b'),('B'); +select * from t1 where a='a' order by binary a; +a +A +a +select hex(min(binary a)),count(*) from t1 group by a; +hex(min(binary a)) count(*) +00000041 2 +00000042 2 +drop table t1; +select char_length('abcd'), octet_length('abcd'); +char_length('abcd') octet_length('abcd') +4 16 +select left('abcd',2); +left('abcd',2) +ab +create table t1 (a varchar(10) character set utf32); +insert into t1 values (_utf32 0x0010FFFF); +insert into t1 values (_utf32 0x00110000); +ERROR HY000: Invalid utf32 character string: '001100' +insert into t1 values (_utf32 0x00110101); +ERROR HY000: Invalid utf32 character string: '001101' +insert into t1 values (_utf32 0x01000101); +ERROR HY000: Invalid utf32 character string: '010001' +insert into t1 values (_utf32 0x11000101); +ERROR HY000: Invalid utf32 character string: '110001' +select hex(a) from t1; +hex(a) +0010FFFF +drop table t1; +SET sql_mode = ''; +create table t1 (utf32 varchar(2) character set utf32); +Wrong character with pad +insert into t1 values (0x110000); +Warnings: +Warning 1366 Incorrect string value: '\x11\x00\x00' for column 'utf32' at row 1 +Wrong chsaracter without pad +insert into t1 values (0x00110000); +Warnings: +Warning 1366 Incorrect string value: '\x00\x11\x00\x00' for column 'utf32' at row 1 +Wrong character with pad followed by another wrong character +insert into t1 values (0x11000000110000); +Warnings: +Warning 1366 Incorrect string value: '\x11\x00\x00\x00\x11\x00...' for column 'utf32' at row 1 +Good character with pad followed by bad character +insert into t1 values (0x10000000110000); +Warnings: +Warning 1366 Incorrect string value: '\x00\x11\x00\x00' for column 'utf32' at row 1 +Good character without pad followed by bad character +insert into t1 values (0x0010000000110000); +Warnings: +Warning 1366 Incorrect string value: '\x00\x11\x00\x00' for column 'utf32' at row 1 +Wrong character with the second byte higher than 0x10 +insert into t1 values (0x00800037); +Warnings: +Warning 1366 Incorrect string value: '\x00\x80\x007' for column 'utf32' at row 1 +Wrong character with pad with the second byte higher than 0x10 +insert into t1 values (0x00800037); +Warnings: +Warning 1366 Incorrect string value: '\x00\x80\x007' for column 'utf32' at row 1 +drop table t1; +SET sql_mode = default; +select _utf32'a' collate utf32_general_ci = 0xfffd; +_utf32'a' collate utf32_general_ci = 0xfffd +0 +select hex(concat(_utf32 0x0410 collate utf32_general_ci, 0x61)); +hex(concat(_utf32 0x0410 collate utf32_general_ci, 0x61)) +0000041000000061 +create table t1 (s1 varchar(5) character set utf32); +insert into t1 values (0xfffd); +select case when s1 = 0xfffd then 1 else 0 end from t1; +case when s1 = 0xfffd then 1 else 0 end +1 +select hex(s1) from t1 where s1 = 0xfffd; +hex(s1) +0000FFFD +drop table t1; +create table t1 (a char(10)) character set utf32; +insert into t1 values ('a '); +select hex(a) from t1; +hex(a) +00000061 +drop table t1; +select upper('abcd'), lower('ABCD'); +upper('abcd') lower('ABCD') +ABCD abcd +create table t1 (a varchar(10) character set utf32); +insert into t1 values (123456); +select a, hex(a) from t1; +a hex(a) +123456 000000310000003200000033000000340000003500000036 +drop table t1; +select hex(soundex('a')); +hex(soundex('a')) +00000041000000300000003000000030 +create table t1 (a enum ('a','b','c')) character set utf32; +insert into t1 values ('1'); +select * from t1; +a +a +drop table t1; +set names latin1; +select hex(conv(convert('123' using utf32), -10, 16)); +hex(conv(convert('123' using utf32), -10, 16)) +3742 +select hex(conv(convert('123' using utf32), 10, 16)); +hex(conv(convert('123' using utf32), 10, 16)) +3742 +set names latin1; +set character_set_connection=utf32; +select 1.1 + '1.2'; +1.1 + '1.2' +2.3 +select 1.1 + '1.2xxx'; +1.1 + '1.2xxx' +2.3 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: '1.2xxx' +select left('aaa','1'); +left('aaa','1') +a +create table t1 (a int); +insert into t1 values ('-1234.1e2'); +insert ignore into t1 values ('-1234.1e2xxxx'); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +insert into t1 values ('-1234.1e2 '); +select * from t1; +a +-123410 +-123410 +-123410 +drop table t1; +create table t1 (a int); +insert into t1 values ('1 '); +insert ignore into t1 values ('1 x'); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +select * from t1; +a +1 +1 +drop table t1; +SET sql_mode = ''; +create table t1 (a varchar(17000) character set utf32); +Warnings: +Note 1246 Converting column 'a' from VARCHAR to TEXT +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumtext CHARACTER SET utf32 COLLATE utf32_general_ci +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +SET sql_mode = default; +create table t1 (a varchar(150) character set utf32 primary key); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(150) CHARACTER SET utf32 COLLATE utf32_general_ci NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +create table t1 (a varchar(334) character set utf32 primary key) ROW_FORMAT=COMPACT; +ERROR 42000: Specified key was too long; max key length is 767 bytes +SET sql_mode = ''; +create table t1 (a varchar(333) character set utf32, key(a)) +row_format=dynamic; +insert into t1 values (repeat('a',333)), (repeat('b',333)); +flush tables; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; +SET sql_mode = default; +SET collation_connection=utf32_general_ci; +CREATE TABLE t1 AS SELECT repeat('a',20) AS s1 LIMIT 0; +SET timestamp=1216359724; +INSERT INTO t1 VALUES (current_date); +INSERT INTO t1 VALUES (current_time); +INSERT INTO t1 VALUES (current_timestamp); +SELECT s1, hex(s1) FROM t1; +s1 hex(s1) +2008-07-18 000000320000003000000030000000380000002D00000030000000370000002D0000003100000038 +08:42:04 00000030000000380000003A00000034000000320000003A0000003000000034 +2008-07-18 08:42:04 000000320000003000000030000000380000002D00000030000000370000002D00000031000000380000002000000030000000380000003A00000034000000320000003A0000003000000034 +DROP TABLE t1; +SET timestamp=0; +SET NAMES latin1; +set collation_connection=utf32_general_ci; +drop table if exists t1; +create table t1 as +select repeat(' ', 64) as s1, repeat(' ',64) as s2 +union +select null, null; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `s1` varchar(64) CHARACTER SET utf32 DEFAULT NULL, + `s2` varchar(64) CHARACTER SET utf32 DEFAULT NULL +) ENGINE=default_engine DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +delete from t1; +insert into t1 values('aaa','aaa'); +insert into t1 values('aaa|qqq','qqq'); +insert into t1 values('gheis','^[^a-dXYZ]+$'); +insert into t1 values('aab','^aa?b'); +insert into t1 values('Baaan','^Ba*n'); +insert into t1 values('aaa','qqq|aaa'); +insert into t1 values('qqq','qqq|aaa'); +insert into t1 values('bbb','qqq|aaa'); +insert into t1 values('bbb','qqq'); +insert into t1 values('aaa','aba'); +insert into t1 values(null,'abc'); +insert into t1 values('def',null); +insert into t1 values(null,null); +select HIGH_PRIORITY s1 regexp s2 from t1; +s1 regexp s2 +1 +1 +1 +1 +1 +1 +1 +0 +0 +0 +NULL +NULL +NULL +SELECT 'ghi' REGEXP 'ghi['; +ERROR HY000: The regular expression contains an unclosed bracket expression. +drop table t1; +set names latin1; +select hex(char(0x01 using utf32)); +hex(char(0x01 using utf32)) +00000001 +select hex(char(0x0102 using utf32)); +hex(char(0x0102 using utf32)) +00000102 +select hex(char(0x010203 using utf32)); +hex(char(0x010203 using utf32)) +00010203 +select hex(char(0x01020304 using utf32)); +hex(char(0x01020304 using utf32)) +NULL +Warnings: +Warning 1300 Invalid utf32 character string: '010203' +create table t1 (s1 varchar(1) character set utf32, s2 text character set utf32); +create index i on t1 (s1); +insert into t1 values (char(256 using utf32), char(256 using utf32)); +select hex(s1), hex(s2) from t1; +hex(s1) hex(s2) +00000100 00000100 +drop table t1; +SET collation_connection=utf32_general_ci; +CREATE TABLE t1 AS SELECT repeat('a',2) as s1 LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `s1` varchar(2) CHARACTER SET utf32 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +INSERT INTO t1 VALUES ('ab'),('AE'),('ab'),('AE'); +SELECT * FROM t1 ORDER BY s1; +s1 +ab +ab +AE +AE +SET max_sort_length=4; +SELECT * FROM t1 ORDER BY s1; +s1 +ab +ab +AE +AE +DROP TABLE t1; +SET max_sort_length=DEFAULT; +SET NAMES latin1; +# +# Bug#52520 Difference in tinytext utf column metadata +# +CREATE TABLE t1 ( +s1 TINYTEXT CHARACTER SET utf32, +s2 TEXT CHARACTER SET utf32, +s3 MEDIUMTEXT CHARACTER SET utf32, +s4 LONGTEXT CHARACTER SET utf32 +); +SET NAMES utf8mb4, @@character_set_results=NULL; +SELECT *, HEX(s1) FROM t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 s1 s1 252 255 0 Y 16 0 60 +def test t1 t1 s2 s2 252 65535 0 Y 16 0 60 +def test t1 t1 s3 s3 252 16777215 0 Y 16 0 60 +def test t1 t1 s4 s4 252 4294967295 0 Y 16 0 60 +def HEX(s1) 253 8160 0 Y 0 31 255 +s1 s2 s3 s4 HEX(s1) +SET NAMES latin1; +SELECT *, HEX(s1) FROM t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 s1 s1 252 63 0 Y 16 0 8 +def test t1 t1 s2 s2 252 16383 0 Y 16 0 8 +def test t1 t1 s3 s3 252 4194303 0 Y 16 0 8 +def test t1 t1 s4 s4 252 1073741823 0 Y 16 0 8 +def HEX(s1) 253 2040 0 Y 0 31 8 +s1 s2 s3 s4 HEX(s1) +SET NAMES utf8mb4; +SELECT *, HEX(s1) FROM t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 s1 s1 252 252 0 Y 16 0 255 +def test t1 t1 s2 s2 252 65532 0 Y 16 0 255 +def test t1 t1 s3 s3 252 16777212 0 Y 16 0 255 +def test t1 t1 s4 s4 252 4294967292 0 Y 16 0 255 +def HEX(s1) 253 8160 0 Y 0 31 255 +s1 s2 s3 s4 HEX(s1) +CREATE TABLE t2 AS SELECT CONCAT(s1) FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `CONCAT(s1)` varchar(255) CHARACTER SET utf32 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +DROP TABLE t1, t2; +# +# Bug#45263 utf32_general_ci, bad effects around CREATE TABLE AS SELECT +# +SET collation_connection=utf32_general_ci; +CREATE TABLE t1 AS SELECT HEX(0x00) AS my_col; +SELECT * FROM t1; +my_col +00 +DROP TABLE t1; +# +# Bug#32859 Character sets: no warning with non-fitting chariot wheel +# +CREATE TABLE t1 (utf32 CHAR(5) CHARACTER SET utf32, latin1 CHAR(5) CHARACTER SET latin1); +INSERT INTO t1 (utf32) VALUES (0xc581); +UPDATE IGNORE t1 SET latin1 = utf32; +Warnings: +Warning 1366 Incorrect string value: '\x00\x00\xC5\x81' for column 'latin1' at row 1 +DELETE FROM t1; +INSERT INTO t1 (utf32) VALUES (0x100cc); +UPDATE IGNORE t1 SET latin1 = utf32; +Warnings: +Warning 1366 Incorrect string value: '\x00\x01\x00\xCC' for column 'latin1' at row 1 +DROP TABLE t1; +# +# Bug#55912 FORMAT with locale set fails for numbers < 1000 +# +SET collation_connection=utf32_general_ci; +CREATE TABLE t1 AS SELECT format(123,2,'no_NO'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `format(123,2,'no_NO')` varchar(36) CHARACTER SET utf32 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT * FROM t1; +format(123,2,'no_NO') +123,00 +DROP TABLE t1; +# +# Bug#11753363 (Bug#44793) Character sets: case clause, ucs2 or utf32, failure +# +SELECT CASE _latin1'a' WHEN _utf32'a' THEN 'A' END; +CASE _latin1'a' WHEN _utf32'a' THEN 'A' END +A +SELECT CASE _utf32'a' WHEN _latin1'a' THEN 'A' END; +CASE _utf32'a' WHEN _latin1'a' THEN 'A' END +A +CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET utf32); +INSERT INTO t1 VALUES ('a'); +SELECT CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END FROM t1; +CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END +b +DROP TABLE t1; +# +# Bug#11750518 41090: ORDER BY TRUNCATES GROUP_CONCAT RESULT +# +SET NAMES utf8, @@character_set_connection=utf32; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT id, CHAR_LENGTH(GROUP_CONCAT(body)) AS l +FROM (SELECT 'a' AS id, REPEAT('foo bar', 100) AS body +UNION ALL +SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1 +GROUP BY id +ORDER BY l DESC; +id l +a 256 +Warnings: +Warning 1260 Row 1 was cut by GROUP_CONCAT() +# +# End of 5.5 tests +# +# +# Start of 5.6 tests +# +# +# WL#3664 WEIGHT_STRING +# +set collation_connection=utf32_general_ci; +select @@collation_connection; +@@collation_connection +utf32_general_ci +select hex(weight_string('a')); +hex(weight_string('a')) +0041 +select hex(weight_string('A')); +hex(weight_string('A')) +0041 +select hex(weight_string('abc')); +hex(weight_string('abc')) +004100420043 +select hex(weight_string('abc' as char(2))); +hex(weight_string('abc' as char(2))) +00410042 +select hex(weight_string('abc' as char(3))); +hex(weight_string('abc' as char(3))) +004100420043 +select hex(weight_string('abc' as char(5))); +hex(weight_string('abc' as char(5))) +00410042004300200020 +select hex(weight_string('abc', 1, 2, 0xC0)); +hex(weight_string('abc', 1, 2, 0xC0)) +00 +select hex(weight_string('abc', 2, 2, 0xC0)); +hex(weight_string('abc', 2, 2, 0xC0)) +0041 +select hex(weight_string('abc', 3, 2, 0xC0)); +hex(weight_string('abc', 3, 2, 0xC0)) +004100 +select hex(weight_string('abc', 4, 2, 0xC0)); +hex(weight_string('abc', 4, 2, 0xC0)) +00410042 +select hex(weight_string('abc', 5, 2, 0xC0)); +hex(weight_string('abc', 5, 2, 0xC0)) +0041004200 +select hex(weight_string('abc',25, 2, 0xC0)); +hex(weight_string('abc',25, 2, 0xC0)) +00410042002000200020002000200020002000200020002000 +select hex(weight_string('abc', 1, 3, 0xC0)); +hex(weight_string('abc', 1, 3, 0xC0)) +00 +select hex(weight_string('abc', 2, 3, 0xC0)); +hex(weight_string('abc', 2, 3, 0xC0)) +0041 +select hex(weight_string('abc', 3, 3, 0xC0)); +hex(weight_string('abc', 3, 3, 0xC0)) +004100 +select hex(weight_string('abc', 4, 3, 0xC0)); +hex(weight_string('abc', 4, 3, 0xC0)) +00410042 +select hex(weight_string('abc', 5, 3, 0xC0)); +hex(weight_string('abc', 5, 3, 0xC0)) +0041004200 +select hex(weight_string('abc',25, 3, 0xC0)); +hex(weight_string('abc',25, 3, 0xC0)) +00410042004300200020002000200020002000200020002000 +select hex(weight_string('abc', 1, 4, 0xC0)); +hex(weight_string('abc', 1, 4, 0xC0)) +00 +select hex(weight_string('abc', 2, 4, 0xC0)); +hex(weight_string('abc', 2, 4, 0xC0)) +0041 +select hex(weight_string('abc', 3, 4, 0xC0)); +hex(weight_string('abc', 3, 4, 0xC0)) +004100 +select hex(weight_string('abc', 4, 4, 0xC0)); +hex(weight_string('abc', 4, 4, 0xC0)) +00410042 +select hex(weight_string('abc', 5, 4, 0xC0)); +hex(weight_string('abc', 5, 4, 0xC0)) +0041004200 +select hex(weight_string('abc',25, 4, 0xC0)); +hex(weight_string('abc',25, 4, 0xC0)) +00410042004300200020002000200020002000200020002000 +select @@collation_connection; +@@collation_connection +utf32_general_ci +select hex(weight_string(cast(_latin1 0x80 as char))); +hex(weight_string(cast(_latin1 0x80 as char))) +20AC +select hex(weight_string(cast(_latin1 0x808080 as char))); +hex(weight_string(cast(_latin1 0x808080 as char))) +20AC20AC20AC +select hex(weight_string(cast(_latin1 0x808080 as char) as char(2))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(2))) +20AC20AC +select hex(weight_string(cast(_latin1 0x808080 as char) as char(3))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(3))) +20AC20AC20AC +select hex(weight_string(cast(_latin1 0x808080 as char) as char(5))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(5))) +20AC20AC20AC00200020 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)) +20 +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)) +20AC +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)) +20AC20 +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)) +20AC20AC +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)) +20AC20AC00 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)) +20AC20AC002000200020002000200020002000200020002000 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)) +20 +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)) +20AC +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)) +20AC20 +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)) +20AC20AC +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)) +20AC20AC20 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)) +20AC20AC20AC00200020002000200020002000200020002000 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)) +20 +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)) +20AC +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)) +20AC20 +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)) +20AC20AC +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)) +20AC20AC20 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)) +20AC20AC20AC00200020002000200020002000200020002000 +select hex(weight_string(_utf32 0x10000)); +hex(weight_string(_utf32 0x10000)) +FFFD +select hex(weight_string(_utf32 0x10001)); +hex(weight_string(_utf32 0x10001)) +FFFD +set collation_connection=utf32_bin; +select @@collation_connection; +@@collation_connection +utf32_bin +select hex(weight_string('a')); +hex(weight_string('a')) +000061 +select hex(weight_string('A')); +hex(weight_string('A')) +000041 +select hex(weight_string('abc')); +hex(weight_string('abc')) +000061000062000063 +select hex(weight_string('abc' as char(2))); +hex(weight_string('abc' as char(2))) +000061000062 +select hex(weight_string('abc' as char(3))); +hex(weight_string('abc' as char(3))) +000061000062000063 +select hex(weight_string('abc' as char(5))); +hex(weight_string('abc' as char(5))) +000061000062000063000020000020 +select hex(weight_string('abc', 1, 2, 0xC0)); +hex(weight_string('abc', 1, 2, 0xC0)) +00 +select hex(weight_string('abc', 2, 2, 0xC0)); +hex(weight_string('abc', 2, 2, 0xC0)) +0000 +select hex(weight_string('abc', 3, 2, 0xC0)); +hex(weight_string('abc', 3, 2, 0xC0)) +000061 +select hex(weight_string('abc', 4, 2, 0xC0)); +hex(weight_string('abc', 4, 2, 0xC0)) +00006100 +select hex(weight_string('abc', 5, 2, 0xC0)); +hex(weight_string('abc', 5, 2, 0xC0)) +0000610000 +select hex(weight_string('abc',25, 2, 0xC0)); +hex(weight_string('abc',25, 2, 0xC0)) +00006100006200002000002000002000002000002000002000 +select hex(weight_string('abc', 1, 3, 0xC0)); +hex(weight_string('abc', 1, 3, 0xC0)) +00 +select hex(weight_string('abc', 2, 3, 0xC0)); +hex(weight_string('abc', 2, 3, 0xC0)) +0000 +select hex(weight_string('abc', 3, 3, 0xC0)); +hex(weight_string('abc', 3, 3, 0xC0)) +000061 +select hex(weight_string('abc', 4, 3, 0xC0)); +hex(weight_string('abc', 4, 3, 0xC0)) +00006100 +select hex(weight_string('abc', 5, 3, 0xC0)); +hex(weight_string('abc', 5, 3, 0xC0)) +0000610000 +select hex(weight_string('abc',25, 3, 0xC0)); +hex(weight_string('abc',25, 3, 0xC0)) +00006100006200006300002000002000002000002000002000 +select hex(weight_string('abc', 1, 4, 0xC0)); +hex(weight_string('abc', 1, 4, 0xC0)) +00 +select hex(weight_string('abc', 2, 4, 0xC0)); +hex(weight_string('abc', 2, 4, 0xC0)) +0000 +select hex(weight_string('abc', 3, 4, 0xC0)); +hex(weight_string('abc', 3, 4, 0xC0)) +000061 +select hex(weight_string('abc', 4, 4, 0xC0)); +hex(weight_string('abc', 4, 4, 0xC0)) +00006100 +select hex(weight_string('abc', 5, 4, 0xC0)); +hex(weight_string('abc', 5, 4, 0xC0)) +0000610000 +select hex(weight_string('abc',25, 4, 0xC0)); +hex(weight_string('abc',25, 4, 0xC0)) +00006100006200006300002000002000002000002000002000 +select @@collation_connection; +@@collation_connection +utf32_bin +select hex(weight_string(cast(_latin1 0x80 as char))); +hex(weight_string(cast(_latin1 0x80 as char))) +0020AC +select hex(weight_string(cast(_latin1 0x808080 as char))); +hex(weight_string(cast(_latin1 0x808080 as char))) +0020AC0020AC0020AC +select hex(weight_string(cast(_latin1 0x808080 as char) as char(2))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(2))) +0020AC0020AC +select hex(weight_string(cast(_latin1 0x808080 as char) as char(3))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(3))) +0020AC0020AC0020AC +select hex(weight_string(cast(_latin1 0x808080 as char) as char(5))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(5))) +0020AC0020AC0020AC000020000020 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)) +00 +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)) +0020 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)) +0020AC +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)) +0020AC00 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)) +0020AC0020 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)) +0020AC0020AC00002000002000002000002000002000002000 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)) +00 +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)) +0020 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)) +0020AC +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)) +0020AC00 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)) +0020AC0020 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)) +0020AC0020AC0020AC00002000002000002000002000002000 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)) +00 +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)) +0020 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)) +0020AC +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)) +0020AC00 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)) +0020AC0020 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)) +0020AC0020AC0020AC00002000002000002000002000002000 +# +# End of 5.6 tests +# +# +# Start of 8.0 tests +# +# +# Bug#28275881: ASSERT `RC == TYPE_OK' IN CREATE TABLE WITH CHARSET UTF32 +# +CREATE TABLE table425 (b1 +SET('wgrpqu','Oklahoma','grpquarwkazzjeiwvdmdivjqsxmhjwagewclcfykywlcnemiuaabr +rifnhuufzasunkrcpvasdqkxbwptigbpnesqigwegcnfeuvrgnecpthmhffqbythjwpukqubzpomnt +rddrwhzjtqvbjiklcekxqyoxsolbxthdcprswpjxixmvfwmsyseblwcvumvyvbitxqjxdzdytunqvv +rmpyxrencqhuyrfluezqekmqpwutxnzddrbjycyoyqbzsoxvillooqxuvoxcgohdbytybwcqxdwtqr +ebgjzbycekyjgbpmqadutrqluyxhrdodxqqjwasfkvetfobocgpftrhvxugmmszwpoglvarsfiljrz +imqeplevleqdhepkhcfrahcpjj') NULL ) DEFAULT CHARACTER SET = utf32; +ERROR HY000: Too long enumeration/set value for column b1. +CREATE FUNCTION hello (s SET('wgrpqu','Oklahoma','grpquarwkazzjeiwvdmdivjqsxmh +jwagewclcfykywlcnemiuaabrrifnhuufzasunkrcpvasdqkxbwptigbpnesqigwegcnfeuvrgnecp +thmhffqbythjwpukqubzpomntrddrwhzjtqvbjiklcekxqyoxsolbxthdcprswpjxixmvfwmsysebl +wcvumvyvbitxqjxdzdytunqvvrmpyxrencqhuyrfluezqekmqpwutxnzddrbjycyoyqbzsoxvilloo +qxuvoxcgohdbytybwcqxdwtqrebgjzbycekyjgbpmqadutrqluyxhrdodxqqjwasfkvetfobocgpft +rhvxugmmszwpoglvarsfiljrzimqeplevleqdhepkhcfrahcpjj') CHARACTER SET utf32) +RETURNS CHAR(50) DETERMINISTIC RETURN CONCAT('Hello, ',s,'!'); +ERROR HY000: Too long enumeration/set value for column s. +# +# End of 8.0 tests +# diff --git a/mysql-test/r/ctype_utf32_uca.result-pq b/mysql-test/r/ctype_utf32_uca.result-pq new file mode 100644 index 000000000000..572dca7020b9 --- /dev/null +++ b/mysql-test/r/ctype_utf32_uca.result-pq @@ -0,0 +1,3621 @@ +DROP TABLE IF EXISTS t1; +# +# Start of 5.5 tests +# +set names utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +set collation_connection=utf32_unicode_ci; +select hex('a'), hex('a '); +hex('a') hex('a ') +00000061 0000006100000020 +select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; +'a' = 'a' 'a' = 'a ' 'a ' = 'a' +1 1 1 +select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a'; +'a\0' = 'a' 'a\0' < 'a' 'a\0' > 'a' +1 0 0 +select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0'; +'a' = 'a\0' 'a' < 'a\0' 'a' > 'a\0' +1 0 0 +select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a '; +'a\0' = 'a ' 'a\0' < 'a ' 'a\0' > 'a ' +1 0 0 +select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0'; +'a ' = 'a\0' 'a ' < 'a\0' 'a ' > 'a\0' +1 0 0 +select 'a a' > 'a', 'a \0' < 'a'; +'a a' > 'a' 'a \0' < 'a' +1 0 +select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a'; +binary 'a a' > 'a' binary 'a \0' > 'a' binary 'a\0' > 'a' +1 1 1 +select 'c' like '\_' as want0; +want0 +0 +create table t1 (c1 char(10) character set utf32 collate utf32_bin); +insert into t1 values ('A'),('a'); +insert into t1 values ('B'),('b'); +insert into t1 values ('C'),('c'); +insert into t1 values ('D'),('d'); +insert into t1 values ('E'),('e'); +insert into t1 values ('F'),('f'); +insert into t1 values ('G'),('g'); +insert into t1 values ('H'),('h'); +insert into t1 values ('I'),('i'); +insert into t1 values ('J'),('j'); +insert into t1 values ('K'),('k'); +insert into t1 values ('L'),('l'); +insert into t1 values ('M'),('m'); +insert into t1 values ('N'),('n'); +insert into t1 values ('O'),('o'); +insert into t1 values ('P'),('p'); +insert into t1 values ('Q'),('q'); +insert into t1 values ('R'),('r'); +insert into t1 values ('S'),('s'); +insert into t1 values ('T'),('t'); +insert into t1 values ('U'),('u'); +insert into t1 values ('V'),('v'); +insert into t1 values ('W'),('w'); +insert into t1 values ('X'),('x'); +insert into t1 values ('Y'),('y'); +insert into t1 values ('Z'),('z'); +insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0); +insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1); +insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2); +insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3); +insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4); +insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5); +insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6); +insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7); +insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8); +insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9); +insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca); +insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb); +insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc); +insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd); +insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce); +insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf); +insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0); +insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1); +insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2); +insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3); +insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4); +insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5); +insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6); +insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7); +insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8); +insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9); +insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da); +insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db); +insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc); +insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd); +insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de); +insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df); +insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103); +insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107); +insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b); +insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f); +insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113); +insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117); +insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b); +insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f); +insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123); +insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127); +insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b); +insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f); +insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133); +insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137); +insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b); +insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f); +insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143); +insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147); +insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b); +insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f); +insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153); +insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157); +insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b); +insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f); +insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163); +insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167); +insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b); +insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f); +insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173); +insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177); +insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b); +insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f); +insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183); +insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187); +insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b); +insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f); +insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193); +insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197); +insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b); +insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f); +insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3); +insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7); +insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab); +insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af); +insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3); +insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7); +insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb); +insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf); +insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3); +insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7); +insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb); +insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf); +insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3); +insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7); +insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db); +insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df); +insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3); +insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7); +insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb); +insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef); +insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3); +insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7); +insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb); +insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff); +INSERT INTO t1 VALUES (_ucs2 0x1EA0),(_ucs2 0x1EA1),(_ucs2 0x1EA2),(_ucs2 0x1EA3); +INSERT INTO t1 VALUES (_ucs2 0x1EA4),(_ucs2 0x1EA5),(_ucs2 0x1EA6),(_ucs2 0x1EA7); +INSERT INTO t1 VALUES (_ucs2 0x1EA8),(_ucs2 0x1EA9),(_ucs2 0x1EAA),(_ucs2 0x1EAB); +INSERT INTO t1 VALUES (_ucs2 0x1EAC),(_ucs2 0x1EAD),(_ucs2 0x1EAE),(_ucs2 0x1EAF); +INSERT INTO t1 VALUES (_ucs2 0x1EB0),(_ucs2 0x1EB1),(_ucs2 0x1EB2),(_ucs2 0x1EB3); +INSERT INTO t1 VALUES (_ucs2 0x1EB4),(_ucs2 0x1EB5),(_ucs2 0x1EB6),(_ucs2 0x1EB7); +INSERT INTO t1 VALUES (_ucs2 0x1EB8),(_ucs2 0x1EB9),(_ucs2 0x1EBA),(_ucs2 0x1EBB); +INSERT INTO t1 VALUES (_ucs2 0x1EBC),(_ucs2 0x1EBD),(_ucs2 0x1EBE),(_ucs2 0x1EBF); +INSERT INTO t1 VALUES (_ucs2 0x1EC0),(_ucs2 0x1EC1),(_ucs2 0x1EC2),(_ucs2 0x1EC3); +INSERT INTO t1 VALUES (_ucs2 0x1EC4),(_ucs2 0x1EC5),(_ucs2 0x1EC6),(_ucs2 0x1EC7); +INSERT INTO t1 VALUES (_ucs2 0x1EC8),(_ucs2 0x1EC9),(_ucs2 0x1ECA),(_ucs2 0x1ECB); +INSERT INTO t1 VALUES (_ucs2 0x1ECC),(_ucs2 0x1ECD),(_ucs2 0x1ECE),(_ucs2 0x1ECF); +INSERT INTO t1 VALUES (_ucs2 0x1ED0),(_ucs2 0x1ED1),(_ucs2 0x1ED2),(_ucs2 0x1ED3); +INSERT INTO t1 VALUES (_ucs2 0x1ED4),(_ucs2 0x1ED5),(_ucs2 0x1ED6),(_ucs2 0x1ED7); +INSERT INTO t1 VALUES (_ucs2 0x1ED8),(_ucs2 0x1ED9),(_ucs2 0x1EDA),(_ucs2 0x1EDB); +INSERT INTO t1 VALUES (_ucs2 0x1EDC),(_ucs2 0x1EDD),(_ucs2 0x1EDE),(_ucs2 0x1EDF); +INSERT INTO t1 VALUES (_ucs2 0x1EE0),(_ucs2 0x1EE1),(_ucs2 0x1EE2),(_ucs2 0x1EE3); +INSERT INTO t1 VALUES (_ucs2 0x1EE4),(_ucs2 0x1EE5),(_ucs2 0x1EE6),(_ucs2 0x1EE7); +INSERT INTO t1 VALUES (_ucs2 0x1EE8),(_ucs2 0x1EE9),(_ucs2 0x1EEA),(_ucs2 0x1EEB); +INSERT INTO t1 VALUES (_ucs2 0x1EEC),(_ucs2 0x1EED),(_ucs2 0x1EEE),(_ucs2 0x1EEF); +INSERT INTO t1 VALUES (_ucs2 0x1EF0),(_ucs2 0x1EF1); +insert into t1 values ('AA'),('Aa'),('aa'),('aA'); +insert into t1 values ('AE'),('Ae'),('ae'),('aE'); +insert into t1 values ('CH'),('Ch'),('ch'),('cH'); +insert into t1 values ('DZ'),('Dz'),('dz'),('dZ'); +insert into t1 values ('DŽ'),('Dž'),('dž'),('dŽ'); +insert into t1 values ('IJ'),('Ij'),('ij'),('iJ'); +insert into t1 values ('LJ'),('Lj'),('lj'),('lJ'); +insert into t1 values ('LL'),('Ll'),('ll'),('lL'); +insert into t1 values ('NJ'),('Nj'),('nj'),('nJ'); +insert into t1 values ('OE'),('Oe'),('oe'),('oE'); +insert into t1 values ('SS'),('Ss'),('ss'),('sS'); +insert into t1 values ('RR'),('Rr'),('rr'),('rR'); +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_unicode_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_icelandic_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÂÃàâãĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +Áá +ǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Ðð +Đđ +Ɖ +Ɗ +Ƌƌ +EeÈÊËèêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Éé +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÎÏìîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +Íí +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÔÕòôõŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +Óó +Ǿǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÛÜùûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Úú +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÿŶŷŸ +Ýý +Ƴƴ +ZzŹźŻżŽž +ƍ +Þþ +ÄÆäæ +ÖØöø +Åå +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_latvian_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċ +CHChcHch +Čč +Ƈƈ +DdĎď +DZDzdZdzDŽDždžDZDzdz +DŽDždŽdž +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġǦǧǴǵ +Ģģ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +Yy +ı +Ɨ +Ɩ +JjĴĵǰ +KkǨǩ +Ķķ +Ƙƙ +LlĹ弾 +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Ļļ +Łł +ƚ +ƛ +Mm +NnÑñŃńŇňǸǹ +NJNjnJnjNJNjnj +Ņņ +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŘř +RRRrrRrr +Ŗŗ +Ʀ +SsŚśŜŝŞşſ +SSSssSssß +Šš +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +ÝýÿŶŷŸ +Ƴƴ +ZzŹźŻż +ƍ +Žž +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_romanian_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÃÄÅàáãäåĀāĄąǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +Ăă +Ââ +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÏìíïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +Îî +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŠšſ +SSSssSssß +Şş +Ʃ +ƪ +TtŤť +ƾ +Ţţ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_slovenian_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċ +CHChcHch +Čč +Ƈƈ +DdĎď +DZDzdZdzDŽDždžDZDzdz +DŽDždŽdž +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşſ +SSSssSssß +Šš +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻż +ƍ +Žž +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_polish_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂăǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +Ąą +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĈĉĊċČč +CHChcHch +Ćć +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ęę +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŅņŇňǸǹ +NJNjnJnjNJNjnj +Ńń +Ɲ +ƞ +Ŋŋ +OoÒÔÕÖòôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +Óó +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŜŝŞşŠšſ +SSSssSssß +Śś +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŽž +ƍ +Źź +Żż +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_estonian_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÅàáâãåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzdZdz +DŽDždŽdž +DŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔòóôŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşſ +SSSssSssß +Šš +Zz +Žž +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Õõ +Ää +Öö +Üü +Xx +YyÝýÿŶŷŸ +Ƴƴ +ŹźŻż +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_spanish_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ññ +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_swedish_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃàáâãĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕòóôõŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +Ǿǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÜÝüýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Åå +ÄÆäæ +ÖØöø +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_turkish_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcĆćĈĉĊċČč +CHChcHch +Çç +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĠġĢģǦǧǴǵ +Ğğ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +Iı +IJIj +ƕǶ +Ħħ +iÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +iJijIJij +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕòóôõŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +Öö +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŠšſ +SSSssSssß +Şş +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Üü +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_czech_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċ +cH +Čč +Ƈƈ +DdĎď +DZDzdZdzDŽDždžDZDzdz +DŽDždŽdž +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +CHChch +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗ +RRRrrRrr +Řř +Ʀ +SsŚśŜŝŞşſ +SSSssSssß +Šš +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻż +ƍ +Žž +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_danish_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃàáâãĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +aA +AEAeaEae +ǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕòóôõŌōŎŏƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +Ǿǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛùúûŨũŪūŬŭŮůŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÜÝüýÿŰűŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +ÄÆäæ +ÖØöøŐő +AAAaaaÅå +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_lithuanian_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CCHChcchÇçĆćĈĉĊċ +cH +Čč +Ƈƈ +DdĎď +DZDzdZdzDŽDždžDZDzdz +DŽDždŽdž +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IYiyÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşſ +SSSssSssß +Šš +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +ÝýÿŶŷŸ +Ƴƴ +ZzŹźŻż +ƍ +Žž +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_slovak_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÅàáâãåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +Ää +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċ +cH +Čč +Ƈƈ +DdĎď +DZDzdZdzDŽDždžDZDzdz +DŽDždŽdž +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +CHChch +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÕÖòóõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +Ôô +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşſ +SSSssSssß +Šš +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻż +ƍ +Žž +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_spanish2_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +cH +CHChch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +lL +LLLlll +Łł +ƚ +ƛ +Mm +NnŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ññ +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_roman_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IJijÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJij +IJij +ı +Ɨ +Ɩ +Ĵĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJlj +LJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnj +NJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +ÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +UVuv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_esperanto_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĊċČč +CHChcHch +Ĉĉ +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĞğĠġĢģǦǧǴǵ +Ĝĝ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +Hh +Ĥĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +Jjǰ +Ĵĵ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŞşŠšſ +SSSssSssß +Ŝŝ +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ŭŭ +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_hungarian_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕòóôõŌōŎŏƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ÖöŐő +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛùúûŨũŪūŬŭŮůŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +ÜüŰű +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_croatian_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEae +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĈĉĊċ +CHChcHch +Čč +Ćć +Ƈƈ +DdĎď +DZDzdZdzDZDzdz +DŽDždŽdžDŽDždž +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LLLllLll +LJLjlJljLJLjlj +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖòóôõöŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşſ +SSSssSssß +Šš +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻż +ƍ +Žž +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_german2_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÅàáâãåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEaeÄÆäæ +ǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕòóôõŌōŎŏŐőƠơǑǒǪǫǬǭỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeÖöŒœ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛùúûŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Üü +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_unicode_520_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÂÃÄÅàáâãäåĀāĂ㥹ǍǎǞǟǠǡǺǻẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặ +AAAaaAaa +AEAeaEaeÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdÐðĎďĐđ +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Ɖ +Ɗ +Ƌƌ +EeÈÉÊËèéêëĒēĔĕĖėĘęĚěẸẹẺẻẼẽẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥĦħ +ƕǶ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľĿŀŁł +LJLjlJljLJLjlj +LLLllLll +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÔÕÖØòóôõöøŌōŎŏŐőƠơǑǒǪǫǬǭǾǿỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợ +OEOeoEoeŒœ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜỤụỦủỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +select group_concat(c1 order by binary c1 separator '') from t1 group by c1 collate utf32_vietnamese_ci; +group_concat(c1 order by binary c1 separator '') +÷ +× +AaÀÁÃÄÅàáãäåĀāĄąǍǎǞǟǠǡǺǻẠạẢả +AAAaaAaa +AEAeaEae +ĂăẮắẰằẲẳẴẵẶặ +ÂâẤấẦầẨẩẪẫẬậ +ÆæǢǣǼǽ +Bb +ƀ +Ɓ +Ƃƃ +CcÇçĆćĈĉĊċČč +CHChcHch +Ƈƈ +DdĎď +DZDzDŽDždZdzdŽdžDŽDždžDZDzdz +Đđ +Ɖ +Ɗ +Ƌƌ +Ðð +EeÈÉËèéëĒēĔĕĖėĘęĚěẸẹẺẻẼẽ +ÊêẾếỀềỂểỄễỆệ +Ǝǝ +Ə +Ɛ +Ff +Ƒƒ +GgĜĝĞğĠġĢģǦǧǴǵ +Ǥǥ +Ɠ +Ɣ +Ƣƣ +HhĤĥ +ƕǶ +Ħħ +IiÌÍÎÏìíîïĨĩĪīĬĭĮįİǏǐỈỉỊị +IJIjiJijIJij +ı +Ɨ +Ɩ +JjĴĵǰ +KkĶķǨǩ +Ƙƙ +LlĹĺĻļĽľ +Ŀŀ +LJLjlJljLJLjlj +LLLllLll +Łł +ƚ +ƛ +Mm +NnÑñŃńŅņŇňǸǹ +NJNjnJnjNJNjnj +Ɲ +ƞ +Ŋŋ +OoÒÓÕÖòóõöŌōŎŏŐőǑǒǪǫǬǭỌọỎỏ +OEOeoEoeŒœ +ÔôỐốỒồỔổỖỗỘộ +ƠơỚớỜờỞởỠỡỢợ +ØøǾǿ +Ɔ +Ɵ +Pp +Ƥƥ +Qq +ĸ +RrŔŕŖŗŘř +RRRrrRrr +Ʀ +SsŚśŜŝŞşŠšſ +SSSssSssß +Ʃ +ƪ +TtŢţŤť +ƾ +Ŧŧ +ƫ +Ƭƭ +Ʈ +UuÙÚÛÜùúûüŨũŪūŬŭŮůŰűŲųǓǔǕǖǗǘǙǚǛǜỤụỦủ +ƯưỨứỪừỬửỮữỰự +Ɯ +Ʊ +Vv +Ʋ +WwŴŵ +Xx +YyÝýÿŶŷŸ +Ƴƴ +ZzŹźŻżŽž +ƍ +Ƶƶ +ƷǮǯ +Ƹƹ +ƺ +Þþ +ƿǷ +ƻ +Ƨƨ +Ƽƽ +Ƅƅ +ʼn +ǀ +ǁ +ǂ +ǃ +drop table t1; +SET NAMES utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +CREATE TABLE t1 (c varchar(150) CHARACTER SET utf32 COLLATE utf32_general_ci NOT NULL, INDEX (c)); +INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308); +SELECT * FROM t1 WHERE c LIKE _utf32 0x0000039C00000025 COLLATE utf32_general_ci; +c +Μωδαί̈ +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT * FROM t1 WHERE c LIKE _utf32 0x0000039C00000025 +COLLATE utf32_general_ci ORDER BY c; +c +Μωδ +Μωδαί̈ +DROP TABLE t1; +CREATE TABLE t1 (c varchar(150) CHARACTER SET utf32 COLLATE utf32_unicode_ci NOT NULL, INDEX (c)); +INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308); +SELECT * FROM t1 WHERE c LIKE _utf32 0x0000039C00000025 COLLATE utf32_unicode_ci; +c +Μωδαί̈ +INSERT INTO t1 VALUES (_ucs2 0x039C03C903B4); +SELECT * FROM t1 WHERE c LIKE _utf32 0x0000039C00000025 +COLLATE utf32_unicode_ci ORDER BY c; +c +Μωδ +Μωδαί̈ +DROP TABLE t1; +CREATE TABLE t1 (c varchar(150) CHARACTER SET utf32 COLLATE utf32_unicode_ci NOT NULL, INDEX (c)); +INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308); +SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf32) COLLATE utf32_unicode_ci; +c +Μωδαί̈ +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8)); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf32) +COLLATE utf32_unicode_ci ORDER BY c; +c +Μωδ +Μωδαί̈ +DROP TABLE t1; +SET NAMES utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SET @test_character_set='utf32'; +SET @test_collation='utf32_swedish_ci'; +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET @safe_character_set_client= @@character_set_client; +SET @safe_character_set_results= @@character_set_results; +SET character_set_server= @test_character_set; +SET collation_server= @test_collation; +CREATE DATABASE d1; +USE d1; +CREATE TABLE t1 (c CHAR(10), KEY(c)); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c char(10) utf32_swedish_ci YES MUL NULL +INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +want3results +aaa +aaaa +aaaaa +DROP TABLE t1; +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c1 varchar(15) utf32_swedish_ci YES MUL NULL +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +want3results +location +loberge +lotre +SELECT c1 as want3results from t1 where c1 like 'lo%'; +want3results +location +loberge +lotre +SELECT c1 as want1result from t1 where c1 like 'loc%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'loca%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locat%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locati%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'location%'; +want1result +location +DROP TABLE t1; +create table t1 (a set('a') not null); +insert ignore into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +select 1 from t1 order by cast(a as char(1)); +1 +1 +1 +drop table t1; +set names utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +create table t1 ( +name varchar(10), +level smallint unsigned); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `name` varchar(10) COLLATE utf32_swedish_ci DEFAULT NULL, + `level` smallint unsigned DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf32 COLLATE=utf32_swedish_ci +insert into t1 values ('string',1); +select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; +concat(name,space(level)) concat(name, repeat(' ',level)) +string string +drop table t1; +DROP DATABASE d1; +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; +SET character_set_client= @safe_character_set_client; +Warnings: +Warning 1287 'utf8mb3' is deprecated and will be removed in a future release. Please use utf8mb4 instead +SET character_set_results= @safe_character_set_results; +Warnings: +Warning 1287 'utf8mb3' is deprecated and will be removed in a future release. Please use utf8mb4 instead +SET collation_connection='utf32_unicode_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +utf32_unicode_ci 0000006100000009 +utf32_unicode_ci 00000061 +utf32_unicode_ci 0000006100000020 +drop table t1; +select @@collation_connection; +@@collation_connection +utf32_unicode_ci +create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ; +insert into t1 values('abcdef'); +insert into t1 values('_bcdef'); +insert into t1 values('a_cdef'); +insert into t1 values('ab_def'); +insert into t1 values('abc_ef'); +insert into t1 values('abcd_f'); +insert into t1 values('abcde_'); +select c1 as c1u from t1 where c1 like 'ab\_def'; +c1u +ab_def +select c1 as c2h from t1 where c1 like 'ab#_def' escape '#'; +c2h +ab_def +drop table t1; +End of 4.1 tests +CREATE TABLE t1 (id int, a varchar(30) character set utf32); +INSERT INTO t1 VALUES (1, _ucs2 0x01310069), (2, _ucs2 0x01310131); +INSERT INTO t1 VALUES (3, _ucs2 0x00690069), (4, _ucs2 0x01300049); +INSERT INTO t1 VALUES (5, _ucs2 0x01300130), (6, _ucs2 0x00490049); +SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu +FROM t1 ORDER BY id; +a la l ll u lu +ıi 8 ıi 8 II 8 +ıı 8 ıı 8 II 8 +ii 8 ii 8 II 8 +İI 8 ii 8 İI 8 +İİ 8 ii 8 İİ 8 +II 8 ii 8 II 8 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +ALTER TABLE t1 MODIFY a VARCHAR(30) character set utf32 collate utf32_turkish_ci; +SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu +FROM t1 ORDER BY id; +a la l ll u lu +ıi 8 ıi 8 Iİ 8 +ıı 8 ıı 8 II 8 +ii 8 ii 8 İİ 8 +İI 8 iı 8 İI 8 +İİ 8 ii 8 İİ 8 +II 8 ıı 8 II 8 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +DROP TABLE t1; +set collation_connection=utf32_unicode_ci; +drop table if exists t1; +create table t1 as +select repeat(' ', 64) as s1, repeat(' ',64) as s2 +union +select null, null; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `s1` varchar(64) CHARACTER SET utf32 COLLATE utf32_unicode_ci DEFAULT NULL, + `s2` varchar(64) CHARACTER SET utf32 COLLATE utf32_unicode_ci DEFAULT NULL +) ENGINE=default_engine DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +delete from t1; +insert into t1 values('aaa','aaa'); +insert into t1 values('aaa|qqq','qqq'); +insert into t1 values('gheis','^[^a-dXYZ]+$'); +insert into t1 values('aab','^aa?b'); +insert into t1 values('Baaan','^Ba*n'); +insert into t1 values('aaa','qqq|aaa'); +insert into t1 values('qqq','qqq|aaa'); +insert into t1 values('bbb','qqq|aaa'); +insert into t1 values('bbb','qqq'); +insert into t1 values('aaa','aba'); +insert into t1 values(null,'abc'); +insert into t1 values('def',null); +insert into t1 values(null,null); +select HIGH_PRIORITY s1 regexp s2 from t1; +s1 regexp s2 +1 +1 +1 +1 +1 +1 +1 +0 +0 +0 +NULL +NULL +NULL +SELECT 'ghi' REGEXP 'ghi['; +ERROR HY000: The regular expression contains an unclosed bracket expression. +drop table t1; +SET collation_connection=utf32_czech_ci; +SELECT @@collation_connection; +@@collation_connection +utf32_czech_ci +# +# Bug#57737 Character sets: search fails with like, contraction, index +# +CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0; +INSERT INTO t1 VALUES ('c'),('ce'),('cé'),('ch'); +SELECT * FROM t1 WHERE s1 LIKE 'c%'; +s1 +c +ce +cé +ch +ALTER TABLE t1 ADD KEY s1 (s1); +SELECT * FROM t1 WHERE s1 LIKE 'c%'; +s1 +c +ce +cé +ch +ALTER TABLE t1 DROP KEY s1, ADD KEY(s1(1)); +SELECT * FROM t1 WHERE s1 LIKE 'ch'; +s1 +ch +DROP TABLE t1; +SELECT @@collation_connection; +@@collation_connection +utf32_czech_ci +# +# Bug#57737 Character sets: search fails with like, contraction, index +# Part#2 - ignorable characters +# +CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS s1 LIMIT 0; +INSERT INTO t1 VALUES ('a\0\0\0\0\0\t'),('a'),('b'),('c'),('d'),('e'); +SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%'; +HEX(s1) +00000061000000000000000000000000000000000000000000000009 +00000061 +ALTER TABLE t1 ADD KEY s1 (s1); +SELECT HEX(s1) FROM t1 WHERE s1 LIKE 'a%'; +HEX(s1) +00000061000000000000000000000000000000000000000000000009 +00000061 +DROP TABLE t1; +# +# Bug #12319710 : INVALID MEMORY READ AND/OR CRASH IN +# MY_UCA_CHARCMP WITH UTF32 +# +SET collation_connection=utf32_unicode_ci; +CREATE TABLE t1 (a TEXT CHARACTER SET utf32 COLLATE utf32_turkish_ci NOT NULL); +INSERT INTO t1 VALUES ('a'), ('b'); +CREATE TABLE t2 (b VARBINARY(5) NOT NULL); +#insert chars outside of BMP +INSERT INTO t2 VALUEs (0x082837),(0x082837); +#test for read-out-of-bounds with non-BMP chars as a LIKE pattern +SELECT * FROM t1,t2 WHERE a LIKE b; +a b +#test the original statement +SELECT 1 FROM t1 AS t1_0 NATURAL LEFT OUTER JOIN t2 AS t2_0 +RIGHT JOIN t1 AS t1_1 ON t1_0.a LIKE t2_0.b; +1 +1 +1 +DROP TABLE t1,t2; +# +# End of 5.5 tests +# +# +# Start of 5.6 tests +# +# +# WL#3664 WEIGHT_STRING +# +set collation_connection=utf32_unicode_ci; +select @@collation_connection; +@@collation_connection +utf32_unicode_ci +select hex(weight_string('a')); +hex(weight_string('a')) +0E33 +select hex(weight_string('A')); +hex(weight_string('A')) +0E33 +select hex(weight_string('abc')); +hex(weight_string('abc')) +0E330E4A0E60 +select hex(weight_string('abc' as char(2))); +hex(weight_string('abc' as char(2))) +0E330E4A +select hex(weight_string('abc' as char(3))); +hex(weight_string('abc' as char(3))) +0E330E4A0E60 +select hex(weight_string('abc' as char(5))); +hex(weight_string('abc' as char(5))) +0E330E4A0E6002090209 +select hex(weight_string('abc', 1, 2, 0xC0)); +hex(weight_string('abc', 1, 2, 0xC0)) +0E +select hex(weight_string('abc', 2, 2, 0xC0)); +hex(weight_string('abc', 2, 2, 0xC0)) +0E33 +select hex(weight_string('abc', 3, 2, 0xC0)); +hex(weight_string('abc', 3, 2, 0xC0)) +0E330E +select hex(weight_string('abc', 4, 2, 0xC0)); +hex(weight_string('abc', 4, 2, 0xC0)) +0E330E4A +select hex(weight_string('abc', 5, 2, 0xC0)); +hex(weight_string('abc', 5, 2, 0xC0)) +0E330E4A02 +select hex(weight_string('abc',25, 2, 0xC0)); +hex(weight_string('abc',25, 2, 0xC0)) +0E330E4A020902090209020902090209020902090209020902 +select hex(weight_string('abc', 1, 3, 0xC0)); +hex(weight_string('abc', 1, 3, 0xC0)) +0E +select hex(weight_string('abc', 2, 3, 0xC0)); +hex(weight_string('abc', 2, 3, 0xC0)) +0E33 +select hex(weight_string('abc', 3, 3, 0xC0)); +hex(weight_string('abc', 3, 3, 0xC0)) +0E330E +select hex(weight_string('abc', 4, 3, 0xC0)); +hex(weight_string('abc', 4, 3, 0xC0)) +0E330E4A +select hex(weight_string('abc', 5, 3, 0xC0)); +hex(weight_string('abc', 5, 3, 0xC0)) +0E330E4A0E +select hex(weight_string('abc',25, 3, 0xC0)); +hex(weight_string('abc',25, 3, 0xC0)) +0E330E4A0E6002090209020902090209020902090209020902 +select hex(weight_string('abc', 1, 4, 0xC0)); +hex(weight_string('abc', 1, 4, 0xC0)) +0E +select hex(weight_string('abc', 2, 4, 0xC0)); +hex(weight_string('abc', 2, 4, 0xC0)) +0E33 +select hex(weight_string('abc', 3, 4, 0xC0)); +hex(weight_string('abc', 3, 4, 0xC0)) +0E330E +select hex(weight_string('abc', 4, 4, 0xC0)); +hex(weight_string('abc', 4, 4, 0xC0)) +0E330E4A +select hex(weight_string('abc', 5, 4, 0xC0)); +hex(weight_string('abc', 5, 4, 0xC0)) +0E330E4A0E +select hex(weight_string('abc',25, 4, 0xC0)); +hex(weight_string('abc',25, 4, 0xC0)) +0E330E4A0E6002090209020902090209020902090209020902 +select @@collation_connection; +@@collation_connection +utf32_unicode_ci +select hex(weight_string(cast(_latin1 0x80 as char))); +hex(weight_string(cast(_latin1 0x80 as char))) +0E23 +select hex(weight_string(cast(_latin1 0x808080 as char))); +hex(weight_string(cast(_latin1 0x808080 as char))) +0E230E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char) as char(2))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(2))) +0E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char) as char(3))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(3))) +0E230E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char) as char(5))); +hex(weight_string(cast(_latin1 0x808080 as char) as char(5))) +0E230E230E2302090209 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)) +0E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)) +0E230E +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)) +0E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)) +0E230E2302 +select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)) +0E230E23020902090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)) +0E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)) +0E230E +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)) +0E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)) +0E230E230E +select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)) +0E230E230E2302090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)) +0E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)) +0E230E +select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)) +0E230E23 +select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)) +0E230E230E +select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)) +0E230E230E2302090209020902090209020902090209020902 +select hex(weight_string(_utf32 0x10000 collate utf32_unicode_ci)); +hex(weight_string(_utf32 0x10000 collate utf32_unicode_ci)) +FFFD +select hex(weight_string(_utf32 0x10001 collate utf32_unicode_ci)); +hex(weight_string(_utf32 0x10001 collate utf32_unicode_ci)) +FFFD +set @@collation_connection=utf32_czech_ci; +select @@collation_connection; +@@collation_connection +utf32_czech_ci +select collation(cast(_latin1 0xDF as char)); +collation(cast(_latin1 0xDF as char)) +utf32_czech_ci +select hex(weight_string('s')); +hex(weight_string('s')) +0FEA +select hex(weight_string(cast(_latin1 0xDF as char))); +hex(weight_string(cast(_latin1 0xDF as char))) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF as char) as char(1))); +hex(weight_string(cast(_latin1 0xDF as char) as char(1))) +0FEA0FEA +select hex(weight_string('c')); +hex(weight_string('c')) +0E60 +select hex(weight_string('h')); +hex(weight_string('h')) +0EE1 +select hex(weight_string('ch')); +hex(weight_string('ch')) +0EE2 +select hex(weight_string('i')); +hex(weight_string('i')) +0EFB +select hex(weight_string(cast(_latin1 0x6368DF as char))); +hex(weight_string(cast(_latin1 0x6368DF as char))) +0EE20FEA0FEA +select hex(weight_string(cast(_latin1 0x6368DF as char) as char(1))); +hex(weight_string(cast(_latin1 0x6368DF as char) as char(1))) +0E60 +select hex(weight_string(cast(_latin1 0x6368DF as char) as char(2))); +hex(weight_string(cast(_latin1 0x6368DF as char) as char(2))) +0EE2 +select hex(weight_string(cast(_latin1 0x6368DF as char) as char(3))); +hex(weight_string(cast(_latin1 0x6368DF as char) as char(3))) +0EE20FEA0FEA +select hex(weight_string(cast(_latin1 0x6368DF as char) as char(4))); +hex(weight_string(cast(_latin1 0x6368DF as char) as char(4))) +0EE20FEA0FEA0209 +select hex(weight_string(cast(_latin1 0xDF6368 as char))); +hex(weight_string(cast(_latin1 0xDF6368 as char))) +0FEA0FEA0EE2 +select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(1))); +hex(weight_string(cast(_latin1 0xDF6368 as char) as char(1))) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(2))); +hex(weight_string(cast(_latin1 0xDF6368 as char) as char(2))) +0FEA0FEA0E60 +select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(3))); +hex(weight_string(cast(_latin1 0xDF6368 as char) as char(3))) +0FEA0FEA0EE2 +select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(4))); +hex(weight_string(cast(_latin1 0xDF6368 as char) as char(4))) +0FEA0FEA0EE20209 +select hex(weight_string(cast(_latin1 0x6368DF as char), 1, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 1, 2, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 2, 2, 0xC0)) +0EE2 +select hex(weight_string(cast(_latin1 0x6368DF as char), 3, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 3, 2, 0xC0)) +0EE202 +select hex(weight_string(cast(_latin1 0x6368DF as char), 4, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 4, 2, 0xC0)) +0EE20209 +select hex(weight_string(cast(_latin1 0x6368DF as char),25, 2, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char),25, 2, 0xC0)) +0EE20209020902090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0x6368DF as char), 1, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 1, 3, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 2, 3, 0xC0)) +0EE2 +select hex(weight_string(cast(_latin1 0x6368DF as char), 3, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 3, 3, 0xC0)) +0EE20F +select hex(weight_string(cast(_latin1 0x6368DF as char), 4, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 4, 3, 0xC0)) +0EE20FEA +select hex(weight_string(cast(_latin1 0x6368DF as char),25, 3, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char),25, 3, 0xC0)) +0EE20FEA0FEA02090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0x6368DF as char), 1, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 1, 4, 0xC0)) +0E +select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0)) +0EE2 +select hex(weight_string(cast(_latin1 0x6368DF as char), 3, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 3, 4, 0xC0)) +0EE20F +select hex(weight_string(cast(_latin1 0x6368DF as char), 4, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char), 4, 4, 0xC0)) +0EE20FEA +select hex(weight_string(cast(_latin1 0x6368DF as char),25, 4, 0xC0)); +hex(weight_string(cast(_latin1 0x6368DF as char),25, 4, 0xC0)) +0EE20FEA0FEA02090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 2,0xC0)) +0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 2,0xC0)) +0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 2,0xC0)) +0FEA0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 2,0xC0)) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char),25, 2,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char),25, 2,0xC0)) +0FEA0FEA0E6002090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 3,0xC0)) +0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 3,0xC0)) +0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 3,0xC0)) +0FEA0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 3,0xC0)) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char),25, 3,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char),25, 3,0xC0)) +0FEA0FEA0EE202090209020902090209020902090209020902 +select hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 4,0xC0)) +0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 4,0xC0)) +0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 4,0xC0)) +0FEA0F +select hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 4,0xC0)) +0FEA0FEA +select hex(weight_string(cast(_latin1 0xDF6368 as char),25, 4,0xC0)); +hex(weight_string(cast(_latin1 0xDF6368 as char),25, 4,0xC0)) +0FEA0FEA0EE202090209020902090209020902090209020902 +SET NAMES utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SET collation_connection=utf32_german2_ci; +"BEGIN ctype_german.inc" +drop table if exists t1; +create table t1 as select repeat(' ', 64) as s1; +select collation(s1) from t1; +collation(s1) +utf32_german2_ci +delete from t1; +INSERT INTO t1 VALUES ('ud'),('uf'); +INSERT INTO t1 VALUES ('od'),('of'); +INSERT INTO t1 VALUES ('e'); +INSERT INTO t1 VALUES ('ad'),('af'); +insert into t1 values ('a'),('ae'),(_latin1 0xE4); +insert into t1 values ('o'),('oe'),(_latin1 0xF6); +insert into t1 values ('s'),('ss'),(_latin1 0xDF); +insert into t1 values ('u'),('ue'),(_latin1 0xFC); +INSERT INTO t1 VALUES (_latin1 0xE6), (_latin1 0xC6); +INSERT INTO t1 VALUES (_latin1 0x9C), (_latin1 0x8C); +select s1, hex(s1) from t1 order by s1, binary s1; +s1 hex(s1) +a 00000061 +ad 0000006100000064 +ae 0000006100000065 +Æ 000000C6 +ä 000000E4 +æ 000000E6 +af 0000006100000066 +e 00000065 +o 0000006F +od 0000006F00000064 +oe 0000006F00000065 +ö 000000F6 +Œ 00000152 +œ 00000153 +of 0000006F00000066 +s 00000073 +ss 0000007300000073 +ß 000000DF +u 00000075 +ud 0000007500000064 +ue 0000007500000065 +ü 000000FC +uf 0000007500000066 +select group_concat(s1 order by binary s1) from t1 group by s1; +group_concat(s1 order by binary s1) +a +ad +ae,Æ,ä,æ +af +e +o +od +oe,ö,Œ,œ +of +s +ss,ß +u +ud +ue,ü +uf +SELECT s1, hex(s1), hex(weight_string(s1)) FROM t1 ORDER BY s1, BINARY(s1); +s1 hex(s1) hex(weight_string(s1)) +a 00000061 0E33 +ad 0000006100000064 0E330E6D +ae 0000006100000065 0E330E8B +Æ 000000C6 0E330E8B +ä 000000E4 0E330E8B +æ 000000E6 0E330E8B +af 0000006100000066 0E330EB9 +e 00000065 0E8B +o 0000006F 0F82 +od 0000006F00000064 0F820E6D +oe 0000006F00000065 0F820E8B +ö 000000F6 0F820E8B +Œ 00000152 0F820E8B +œ 00000153 0F820E8B +of 0000006F00000066 0F820EB9 +s 00000073 0FEA +ss 0000007300000073 0FEA0FEA +ß 000000DF 0FEA0FEA +u 00000075 101F +ud 0000007500000064 101F0E6D +ue 0000007500000065 101F0E8B +ü 000000FC 101F0E8B +uf 0000007500000066 101F0EB9 +SELECT s1, hex(s1) FROM t1 WHERE s1='ae' ORDER BY s1, BINARY(s1); +s1 hex(s1) +ae 0000006100000065 +Æ 000000C6 +ä 000000E4 +æ 000000E6 +drop table t1; +"END ctype_german.inc" +# +# WL#2673 Unicode Collation Algorithm new version +# +SET NAMES utf8mb4; +SET collation_connection=utf32_unicode_520_ci; +CREATE TABLE t1 AS SELECT repeat('a', 10) as c LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` varchar(10) CHARACTER SET utf32 COLLATE utf32_unicode_520_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +INSERT INTO t1 VALUES (_utf32 0x0180),(_utf32 0x023A); +INSERT INTO t1 VALUES (_utf32 0x023B),(_utf32 0x023C); +INSERT INTO t1 VALUES (_utf32 0x023D),(_utf32 0x023E); +INSERT INTO t1 VALUES (_utf32 0x0241),(_utf32 0x0242); +INSERT INTO t1 VALUES (_utf32 0x0243),(_utf32 0x0244); +INSERT INTO t1 VALUES (_utf32 0x0245),(_utf32 0x0246); +INSERT INTO t1 VALUES (_utf32 0x0247),(_utf32 0x0248); +INSERT INTO t1 VALUES (_utf32 0x0249),(_utf32 0x024A); +INSERT INTO t1 VALUES (_utf32 0x024B),(_utf32 0x024C); +INSERT INTO t1 VALUES (_utf32 0x024D),(_utf32 0x024E); +INSERT INTO t1 VALUES (_utf32 0x024F),(_utf32 0x026B); +INSERT INTO t1 VALUES (_utf32 0x027D),(_utf32 0x0289); +INSERT INTO t1 VALUES (_utf32 0x028C); +INSERT INTO t1 VALUES (_utf32 0x037B), (_utf32 0x037C); +INSERT INTO t1 VALUES (_utf32 0x037D), (_utf32 0x03FD); +INSERT INTO t1 VALUES (_utf32 0x03FE), (_utf32 0x03FF); +INSERT INTO t1 VALUES (_utf32 0x04C0), (_utf32 0x04CF); +INSERT INTO t1 VALUES (_utf32 0x04F6), (_utf32 0x04F7); +INSERT INTO t1 VALUES (_utf32 0x04FA), (_utf32 0x04FB); +INSERT INTO t1 VALUES (_utf32 0x04FC), (_utf32 0x04FD); +INSERT INTO t1 VALUES (_utf32 0x04FE), (_utf32 0x04FF); +INSERT INTO t1 VALUES (_utf32 0x0510), (_utf32 0x0511); +INSERT INTO t1 VALUES (_utf32 0x0512), (_utf32 0x0513); +INSERT INTO t1 VALUES (_utf32 0x10A0), (_utf32 0x10A1); +INSERT INTO t1 VALUES (_utf32 0x10A2), (_utf32 0x10A3); +INSERT INTO t1 VALUES (_utf32 0x10A4), (_utf32 0x10A5); +INSERT INTO t1 VALUES (_utf32 0x10A6), (_utf32 0x10A7); +INSERT INTO t1 VALUES (_utf32 0x2D00), (_utf32 0x2D01); +INSERT INTO t1 VALUES (_utf32 0x2D02), (_utf32 0x2D03); +INSERT INTO t1 VALUES (_utf32 0x2D04), (_utf32 0x2D05); +INSERT INTO t1 VALUES (_utf32 0x2D06), (_utf32 0x2D07); +INSERT INTO t1 VALUES (_utf32 0x1D7D); +INSERT INTO t1 VALUES (_utf32 0x2132),(_utf32 0x214E); +INSERT INTO t1 VALUES (_utf32 0x2183),(_utf32 0x2184); +INSERT INTO t1 VALUES (_utf32 0x2C80), (_utf32 0x2C81); +INSERT INTO t1 VALUES (_utf32 0x2C82), (_utf32 0x2C83); +INSERT INTO t1 VALUES (_utf32 0x2C84), (_utf32 0x2C85); +INSERT INTO t1 VALUES (_utf32 0x2C86), (_utf32 0x2C87); +INSERT INTO t1 VALUES (_utf32 0x2C88), (_utf32 0x2C89); +INSERT INTO t1 VALUES (_utf32 0x2C8A), (_utf32 0x2C8B); +INSERT INTO t1 VALUES (_utf32 0x2C8C), (_utf32 0x2C8D); +INSERT INTO t1 VALUES (_utf32 0x2C8E), (_utf32 0x2C8F); +INSERT INTO t1 VALUES (_utf32 0x2C60), (_utf32 0x2C61); +INSERT INTO t1 VALUES (_utf32 0x2C62), (_utf32 0x2C63); +INSERT INTO t1 VALUES (_utf32 0x2C64), (_utf32 0x2C65); +INSERT INTO t1 VALUES (_utf32 0x2C66), (_utf32 0x2C67); +INSERT INTO t1 VALUES (_utf32 0x2C68), (_utf32 0x2C69); +INSERT INTO t1 VALUES (_utf32 0x2C6A), (_utf32 0x2C6B); +INSERT INTO t1 VALUES (_utf32 0x2C6C), (_utf32 0x2C75); +INSERT INTO t1 VALUES (_utf32 0x2C76); +INSERT INTO t1 VALUES (_utf32 0x2C00), (_utf32 0x2C01); +INSERT INTO t1 VALUES (_utf32 0x2C02), (_utf32 0x2C03); +INSERT INTO t1 VALUES (_utf32 0x2C04), (_utf32 0x2C05); +INSERT INTO t1 VALUES (_utf32 0x2C06), (_utf32 0x2C07); +INSERT INTO t1 VALUES (_utf32 0x2C30), (_utf32 0x2C31); +INSERT INTO t1 VALUES (_utf32 0x2C32), (_utf32 0x2C33); +INSERT INTO t1 VALUES (_utf32 0x2C34), (_utf32 0x2C35); +INSERT INTO t1 VALUES (_utf32 0x2C36), (_utf32 0x2C37); +INSERT INTO t1 VALUES (_utf32 0x10400), (_utf32 0x10401); +INSERT INTO t1 VALUES (_utf32 0x10402), (_utf32 0x10403); +INSERT INTO t1 VALUES (_utf32 0x10404), (_utf32 0x10405); +INSERT INTO t1 VALUES (_utf32 0x10406), (_utf32 0x10407); +INSERT INTO t1 VALUES (_utf32 0x10428), (_utf32 0x10429); +INSERT INTO t1 VALUES (_utf32 0x1042A), (_utf32 0x1042B); +INSERT INTO t1 VALUES (_utf32 0x1042C), (_utf32 0x1042D); +INSERT INTO t1 VALUES (_utf32 0x1042E), (_utf32 0x1042F); +INSERT INTO t1 VALUES (_utf32 0x0370); +INSERT INTO t1 VALUES (_utf32 0x0371); +INSERT INTO t1 VALUES (_utf32 0x0372); +INSERT INTO t1 VALUES (_utf32 0x0373); +INSERT INTO t1 VALUES (_utf32 0x0514); +INSERT INTO t1 VALUES (_utf32 0x0515); +INSERT INTO t1 VALUES (_utf32 0x0516); +INSERT INTO t1 VALUES (_utf32 0x0517); +INSERT INTO t1 VALUES (_utf32 0xA640); +INSERT INTO t1 VALUES (_utf32 0xA641); +INSERT INTO t1 VALUES (_utf32 0xA642); +INSERT INTO t1 VALUES (_utf32 0xA643); +INSERT INTO t1 VALUES (_utf32 0xA722); +INSERT INTO t1 VALUES (_utf32 0xA723); +INSERT INTO t1 VALUES (_utf32 0xA724); +INSERT INTO t1 VALUES (_utf32 0xA725); +INSERT INTO t1 VALUES (_utf32 0xA726); +INSERT INTO t1 VALUES (_utf32 0xA727); +INSERT INTO t1 VALUES (_utf32 0xA728); +INSERT INTO t1 VALUES (_utf32 0xA729); +INSERT INTO t1 VALUES (_utf32 0xA72A); +INSERT INTO t1 VALUES (_utf32 0xA72B); +INSERT INTO t1 VALUES (_utf32 0x2CEB); +INSERT INTO t1 VALUES (_utf32 0x2CEC); +INSERT INTO t1 VALUES (_utf32 0x2CED); +INSERT INTO t1 VALUES (_utf32 0x2CEE); +SELECT hex(c), hex(lower(c)), hex(upper(c)), hex(weight_string(c)), c +FROM t1 ORDER BY c, BINARY c; +hex(c) hex(lower(c)) hex(upper(c)) hex(weight_string(c)) c +0000023A 00002C65 0000023A 1214 Ⱥ +00002C65 00002C65 0000023A 1214 ⱥ +00000180 00000180 00000243 122D ƀ +00000243 00000180 00000243 122D Ƀ +0000023B 0000023C 0000023B 1242 Ȼ +0000023C 0000023C 0000023B 1242 ȼ +00002183 00002184 00002183 124E Ↄ +00002184 00002184 00002183 124E ↄ +00000246 00000247 00000246 1270 Ɇ +00000247 00000247 00000246 1270 ɇ +00002132 0000214E 00002132 12AE Ⅎ +0000214E 0000214E 00002132 12AE ⅎ +00002C67 00002C68 00002C67 12E3 Ⱨ +00002C68 00002C68 00002C67 12E3 ⱨ +00002C75 00002C76 00002C75 12E4 Ⱶ +00002C76 00002C76 00002C75 12E4 ⱶ +0000A726 0000A727 0000A726 12E5 Ꜧ +0000A727 0000A727 0000A726 12E5 ꜧ +00000248 00000249 00000248 130E Ɉ +00000249 00000249 00000248 130E ɉ +00002C69 00002C6A 00002C69 1328 Ⱪ +00002C6A 00002C6A 00002C69 1328 ⱪ +0000023D 0000019A 0000023D 133B Ƚ +00002C60 00002C61 00002C60 133F Ⱡ +00002C61 00002C61 00002C60 133F ⱡ +0000026B 0000026B 00002C62 1340 ɫ +00002C62 0000026B 00002C62 1340 Ɫ +00001D7D 00001D7D 00002C63 13B8 ᵽ +00002C63 00001D7D 00002C63 13B8 Ᵽ +0000024A 0000024B 0000024A 13D2 Ɋ +0000024B 0000024B 0000024A 13D2 ɋ +0000024C 0000024D 0000024C 13E4 Ɍ +0000024D 0000024D 0000024C 13E4 ɍ +0000027D 0000027D 00002C64 13FC ɽ +00002C64 0000027D 00002C64 13FC Ɽ +0000A728 0000A729 0000A728 143314AD Ꜩ +0000A729 0000A729 0000A728 143314AD ꜩ +0000023E 00002C66 0000023E 143C Ⱦ +00002C66 00002C66 0000023E 143C ⱦ +00000244 00000289 00000244 145B Ʉ +00000289 00000289 00000244 145B ʉ +00000245 0000028C 00000245 1489 Ʌ +0000028C 0000028C 00000245 1489 ʌ +0000024E 0000024F 0000024E 14A4 Ɏ +0000024F 0000024F 0000024E 14A4 ɏ +00002C6B 00002C6C 00002C6B 14C8 Ⱬ +00002C6C 00002C6C 00002C6B 14C8 ⱬ +0000A72A 0000A72B 0000A72A 14F3 Ꜫ +0000A72B 0000A72B 0000A72A 14F3 ꜫ +00000241 00000242 00000241 1506 Ɂ +00000242 00000242 00000241 1506 ɂ +0000A722 0000A723 0000A722 150E Ꜣ +0000A723 0000A723 0000A722 150E ꜣ +0000A724 0000A725 0000A724 1518 Ꜥ +0000A725 0000A725 0000A724 1518 ꜥ +00000370 00000371 00000370 154F Ͱ +00000371 00000371 00000370 154F ͱ +0000037C 0000037C 000003FE 1564 ͼ +000003FE 0000037C 000003FE 1564 Ͼ +0000037B 0000037B 000003FD 1565 ͻ +000003FD 0000037B 000003FD 1565 Ͻ +0000037D 0000037D 000003FF 1566 ͽ +000003FF 0000037D 000003FF 1566 Ͽ +00000372 00000373 00000372 156F Ͳ +00000373 00000373 00000372 156F ͳ +00002C80 00002C81 00002C80 1571 Ⲁ +00002C81 00002C81 00002C80 1571 ⲁ +00002C82 00002C83 00002C82 1572 Ⲃ +00002C83 00002C83 00002C82 1572 ⲃ +00002C84 00002C85 00002C84 1573 Ⲅ +00002C85 00002C85 00002C84 1573 ⲅ +00002C86 00002C87 00002C86 1574 Ⲇ +00002C87 00002C87 00002C86 1574 ⲇ +00002C88 00002C89 00002C88 1575 Ⲉ +00002C89 00002C89 00002C88 1575 ⲉ +00002C8A 00002C8B 00002C8A 1577 Ⲋ +00002C8B 00002C8B 00002C8A 1577 ⲋ +00002C8C 00002C8D 00002C8C 1578 Ⲍ +00002C8D 00002C8D 00002C8C 1578 ⲍ +00002C8E 00002C8F 00002C8E 1579 Ⲏ +00002C8F 00002C8F 00002C8E 1579 ⲏ +00002CEB 00002CEC 00002CEB 1591 Ⳬ +00002CEC 00002CEC 00002CEB 1591 ⳬ +00002CED 00002CEE 00002CED 15A0 Ⳮ +00002CEE 00002CEE 00002CED 15A0 ⳮ +000004FA 000004FB 000004FA 15D4 Ӻ +000004FB 000004FB 000004FA 15D4 ӻ +000004F6 000004F7 000004F6 15DC Ӷ +000004F7 000004F7 000004F6 15DC ӷ +0000A640 0000A641 0000A640 1611 Ꙁ +0000A641 0000A641 0000A640 1611 ꙁ +00000510 00000511 00000510 1613 Ԑ +00000511 00000511 00000510 1613 ԑ +0000A642 0000A643 0000A642 1618 Ꙃ +0000A643 0000A643 0000A642 1618 ꙃ +00000512 00000513 00000512 1666 Ԓ +00000513 00000513 00000512 1666 ԓ +00000514 00000515 00000514 166E Ԕ +00000515 00000515 00000514 166E ԕ +00000516 00000517 00000516 16B7 Ԗ +00000517 00000517 00000516 16B7 ԗ +000004FC 000004FD 000004FC 16F9 Ӽ +000004FD 000004FD 000004FC 16F9 ӽ +000004FE 000004FF 000004FE 16FD Ӿ +000004FF 000004FF 000004FE 16FD ӿ +000004C0 000004CF 000004C0 17B1 Ӏ +000004CF 000004CF 000004C0 17B1 ӏ +00002C00 00002C30 00002C00 17B5 Ⰰ +00002C30 00002C30 00002C00 17B5 ⰰ +00002C01 00002C31 00002C01 17B6 Ⰱ +00002C31 00002C31 00002C01 17B6 ⰱ +00002C02 00002C32 00002C02 17B7 Ⰲ +00002C32 00002C32 00002C02 17B7 ⰲ +00002C03 00002C33 00002C03 17B8 Ⰳ +00002C33 00002C33 00002C03 17B8 ⰳ +00002C04 00002C34 00002C04 17B9 Ⰴ +00002C34 00002C34 00002C04 17B9 ⰴ +00002C05 00002C35 00002C05 17BA Ⰵ +00002C35 00002C35 00002C05 17BA ⰵ +00002C06 00002C36 00002C06 17BB Ⰶ +00002C36 00002C36 00002C06 17BB ⰶ +00002C07 00002C37 00002C07 17BC Ⰷ +00002C37 00002C37 00002C07 17BC ⰷ +000010A0 00002D00 000010A0 17E5 Ⴀ +00002D00 00002D00 000010A0 17E5 ⴀ +000010A1 00002D01 000010A1 17E7 Ⴁ +00002D01 00002D01 000010A1 17E7 ⴁ +000010A2 00002D02 000010A2 17E9 Ⴂ +00002D02 00002D02 000010A2 17E9 ⴂ +000010A3 00002D03 000010A3 17EB Ⴃ +00002D03 00002D03 000010A3 17EB ⴃ +000010A4 00002D04 000010A4 17ED Ⴄ +00002D04 00002D04 000010A4 17ED ⴄ +000010A5 00002D05 000010A5 17EF Ⴅ +00002D05 00002D05 000010A5 17EF ⴅ +000010A6 00002D06 000010A6 17F1 Ⴆ +00002D06 00002D06 000010A6 17F1 ⴆ +000010A7 00002D07 000010A7 17F5 Ⴇ +00002D07 00002D07 000010A7 17F5 ⴇ +00010400 00010428 00010400 30D2 𐐀 +00010428 00010428 00010400 30D2 𐐨 +00010401 00010429 00010401 30D3 𐐁 +00010429 00010429 00010401 30D3 𐐩 +00010402 0001042A 00010402 30D4 𐐂 +0001042A 0001042A 00010402 30D4 𐐪 +00010403 0001042B 00010403 30D5 𐐃 +0001042B 0001042B 00010403 30D5 𐐫 +00010404 0001042C 00010404 30D6 𐐄 +0001042C 0001042C 00010404 30D6 𐐬 +00010405 0001042D 00010405 30D7 𐐅 +0001042D 0001042D 00010405 30D7 𐐭 +00010406 0001042E 00010406 30D8 𐐆 +0001042E 0001042E 00010406 30D8 𐐮 +00010407 0001042F 00010407 30D9 𐐇 +0001042F 0001042F 00010407 30D9 𐐯 +INSERT INTO t1 VALUES ('a'); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0xFFFF)); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0x10FFFF)); +INSERT INTO t1 VALUES (concat(_utf32 0x61, _utf32 0x10400)); +SELECT hex(c), hex(weight_string(c)) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +hex(c) hex(weight_string(c)) +00000061 120F +0000006100010400 120F30D2 +000000610000FFFF 120FFBC1FFFF +000000610010FFFF 120FFBE1FFFF +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10400 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +00010400 30D2 𐐀 +00010428 30D2 𐐨 +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10428 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +00010400 30D2 𐐀 +00010428 30D2 𐐨 +ALTER TABLE t1 ADD KEY(c); +EXPLAIN SELECT hex(c) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range c c 43 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select hex(`test`.`t1`.`c`) AS `hex(c)` from `test`.`t1` where (`test`.`t1`.`c` like 'a%') order by `test`.`t1`.`c` +SELECT hex(c), hex(weight_string(c)) FROM t1 WHERE c LIKE 'a%' ORDER BY c; +hex(c) hex(weight_string(c)) +00000061 120F +0000006100010400 120F30D2 +000000610000FFFF 120FFBC1FFFF +000000610010FFFF 120FFBE1FFFF +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10400 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +00010400 30D2 𐐀 +00010428 30D2 𐐨 +SELECT hex(c), hex(weight_string(c)), c FROM t1 WHERE c LIKE _utf32 0x10428 ORDER BY c, BINARY c; +hex(c) hex(weight_string(c)) c +00010400 30D2 𐐀 +00010428 30D2 𐐨 +DROP TABLE t1; +# +# End of 5.6 tests +# diff --git a/mysql-test/r/ctype_utf8mb4_innodb.result-pq b/mysql-test/r/ctype_utf8mb4_innodb.result-pq new file mode 100644 index 000000000000..1eb644e871f5 --- /dev/null +++ b/mysql-test/r/ctype_utf8mb4_innodb.result-pq @@ -0,0 +1,2747 @@ +drop table if exists t1,t2; +# +# Start of 5.5 tests +# +set names utf8mb4; +select left(_utf8mb4 0xD0B0D0B1D0B2,1); +left(_utf8mb4 0xD0B0D0B1D0B2,1) +а +select right(_utf8mb4 0xD0B0D0B2D0B2,1); +right(_utf8mb4 0xD0B0D0B2D0B2,1) +в +select locate('he','hello'); +locate('he','hello') +1 +select locate('he','hello',2); +locate('he','hello',2) +0 +select locate('lo','hello',2); +locate('lo','hello',2) +4 +select locate('HE','hello'); +locate('HE','hello') +1 +select locate('HE','hello',2); +locate('HE','hello',2) +0 +select locate('LO','hello',2); +locate('LO','hello',2) +4 +select locate('HE','hello' collate utf8mb4_bin); +locate('HE','hello' collate utf8mb4_bin) +0 +select locate('HE','hello' collate utf8mb4_bin,2); +locate('HE','hello' collate utf8mb4_bin,2) +0 +select locate('LO','hello' collate utf8mb4_bin,2); +locate('LO','hello' collate utf8mb4_bin,2) +0 +select locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D0B1D0B2); +locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D0B1D0B2) +2 +select locate(_utf8mb4 0xD091, _utf8mb4 0xD0B0D0B1D0B2); +locate(_utf8mb4 0xD091, _utf8mb4 0xD0B0D0B1D0B2) +2 +select locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D091D0B2); +locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D091D0B2) +2 +select locate(_utf8mb4 0xD091, _utf8mb4 0xD0B0D0B1D0B2 collate utf8mb4_bin); +locate(_utf8mb4 0xD091, _utf8mb4 0xD0B0D0B1D0B2 collate utf8mb4_bin) +0 +select locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D091D0B2 collate utf8mb4_bin); +locate(_utf8mb4 0xD0B1, _utf8mb4 0xD0B0D091D0B2 collate utf8mb4_bin) +0 +select length(_utf8mb4 0xD0B1), bit_length(_utf8mb4 0xD0B1), char_length(_utf8mb4 0xD0B1); +length(_utf8mb4 0xD0B1) bit_length(_utf8mb4 0xD0B1) char_length(_utf8mb4 0xD0B1) +2 16 1 +select 'a' like 'a'; +'a' like 'a' +1 +select 'A' like 'a'; +'A' like 'a' +1 +select 'A' like 'a' collate utf8mb4_bin; +'A' like 'a' collate utf8mb4_bin +0 +select _utf8mb4 0xD0B0D0B1D0B2 like concat(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4 '%'); +_utf8mb4 0xD0B0D0B1D0B2 like concat(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4 '%') +1 +select convert(_latin1'Gnter Andr' using utf8mb4) like CONVERT(_latin1'GNTER%' USING utf8mb4); +convert(_latin1'G?nter Andr?' using utf8mb4) like CONVERT(_latin1'G?NTER%' USING utf8mb4) +1 +select CONVERT(_koi8r'' USING utf8mb4) LIKE CONVERT(_koi8r'' USING utf8mb4); +CONVERT(_koi8r'????' USING utf8mb4) LIKE CONVERT(_koi8r'????' USING utf8mb4) +1 +select CONVERT(_koi8r'' USING utf8mb4) LIKE CONVERT(_koi8r'' USING utf8mb4); +CONVERT(_koi8r'????' USING utf8mb4) LIKE CONVERT(_koi8r'????' USING utf8mb4) +1 +SELECT 'a' = 'a '; +'a' = 'a ' +0 +SELECT 'a\0' < 'a'; +'a\0' < 'a' +0 +SELECT 'a\0' < 'a '; +'a\0' < 'a ' +1 +SELECT 'a\t' < 'a'; +'a\t' < 'a' +0 +SELECT 'a\t' < 'a '; +'a\t' < 'a ' +1 +SELECT 'a' = 'a ' collate utf8mb4_bin; +'a' = 'a ' collate utf8mb4_bin +1 +SELECT 'a\0' < 'a' collate utf8mb4_bin; +'a\0' < 'a' collate utf8mb4_bin +1 +SELECT 'a\0' < 'a ' collate utf8mb4_bin; +'a\0' < 'a ' collate utf8mb4_bin +1 +SELECT 'a\t' < 'a' collate utf8mb4_bin; +'a\t' < 'a' collate utf8mb4_bin +1 +SELECT 'a\t' < 'a ' collate utf8mb4_bin; +'a\t' < 'a ' collate utf8mb4_bin +1 +CREATE TABLE t1 (a char(10) character set utf8mb4 not null) ENGINE InnoDB; +INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a '); +SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1; +hex(a) STRCMP(a,'a') STRCMP(a,'a ') +61 0 -1 +61 0 -1 +6100 0 -1 +6109 1 -1 +DROP TABLE t1; +select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es'); +insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es') +this is test +select insert("aa",100,1,"b"),insert("aa",1,3,"b"); +insert("aa",100,1,"b") insert("aa",1,3,"b") +aa b +select char_length(left(@a:='тест',5)), length(@a), @a; +char_length(left(@a:='тест',5)) length(@a) @a +4 8 тест +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +create table t1 ENGINE InnoDB select date_format("2004-01-19 10:10:10", "%Y-%m-%d"); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `date_format("2004-01-19 10:10:10", "%Y-%m-%d")` varchar(10) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +select * from t1; +date_format("2004-01-19 10:10:10", "%Y-%m-%d") +2004-01-19 +drop table t1; +set names utf8mb4; +set LC_TIME_NAMES='fr_FR'; +create table t1 (s1 char(20) character set latin1) engine InnoDB; +insert into t1 values (date_format('2004-02-02','%M')); +select hex(s1) from t1; +hex(s1) +66E97672696572 +drop table t1; +create table t1 (s1 char(20) character set koi8r) engine InnoDB; +set LC_TIME_NAMES='ru_RU'; +insert into t1 values (date_format('2004-02-02','%M')); +insert into t1 values (date_format('2004-02-02','%b')); +insert into t1 values (date_format('2004-02-02','%W')); +insert into t1 values (date_format('2004-02-02','%a')); +select hex(s1), s1 from t1; +hex(s1) s1 +E6C5D7 Фев +E6C5D7D2C1CCD1 Февраля +F0CEC4 Пнд +F0CFCEC5C4C5CCD8CEC9CB Понедельник +drop table t1; +set LC_TIME_NAMES='en_US'; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +set names koi8r; +create table t1 (s1 char(1) character set utf8mb4) engine InnoDB; +insert into t1 values (_koi8r''); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +select s1,hex(s1),char_length(s1),octet_length(s1) from t1; +s1 hex(s1) char_length(s1) octet_length(s1) + D0B0 1 2 +drop table t1; +create table t1 (s1 tinytext character set utf8mb4) engine InnoDB; +insert into t1 select repeat('a',300); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +insert into t1 select repeat('',300); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +insert into t1 select repeat('a',300); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +insert into t1 select repeat('a',300); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +insert into t1 select repeat('',300); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +select hex(s1) from t1; +hex(s1) +616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 +61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F +D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61D18F61 +D18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18F +D18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18FD18F +select length(s1),char_length(s1) from t1; +length(s1) char_length(s1) +254 127 +254 127 +255 170 +255 170 +255 255 +drop table t1; +create table t1 (s1 text character set utf8mb4) engine InnoDB; +insert into t1 select repeat('a',66000); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +insert into t1 select repeat('',66000); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +insert into t1 select repeat('a',66000); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +insert into t1 select repeat('a',66000); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +insert into t1 select repeat('',66000); +Warnings: +Warning 1265 Data truncated for column 's1' at row 1 +select length(s1),char_length(s1) from t1; +length(s1) char_length(s1) +65534 32767 +65534 32767 +65535 43690 +65535 43690 +65535 65535 +drop table t1; +SET sql_mode = default; +create table t1 (s1 char(10) character set utf8mb4) engine InnoDB; +insert ignore into t1 values (0x41FF); +Warnings: +Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1 +select hex(s1) from t1; +hex(s1) +41 +drop table t1; +create table t1 (s1 varchar(10) character set utf8mb4) engine InnoDB; +insert ignore into t1 values (0x41FF); +Warnings: +Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1 +select hex(s1) from t1; +hex(s1) +41 +drop table t1; +create table t1 (s1 text character set utf8mb4) engine InnoDB; +insert ignore into t1 values (0x41FF); +Warnings: +Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1 +select hex(s1) from t1; +hex(s1) +41 +drop table t1; +create table t1 (a text character set utf8mb4, primary key(a(371))) engine InnoDB ROW_FORMAT=COMPACT; +Got one of the listed errors +CREATE TABLE t1 ( a varchar(10) ) CHARACTER SET utf8mb4 ENGINE InnoDB; +INSERT INTO t1 VALUES ( 'test' ); +SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = b.a; +a a +test test +SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = 'test' and b.a = 'test'; +a a +test test +SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = b.a and a.a = 'test'; +a a +test test +DROP TABLE t1; +create table t1 (a char(255) character set utf8mb4) engine InnoDB; +insert into t1 values('b'),('b'); +select * from t1 where a = 'b'; +a +b +b +select * from t1 where a = 'b' and a = 'b'; +a +b +b +select * from t1 where a = 'b' and a != 'b'; +a +drop table t1; +set collation_connection=utf8mb4_general_ci; +drop table if exists t1; +create table t1 as +select repeat(' ', 64) as s1, repeat(' ',64) as s2 +union +select null, null; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `s1` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `s2` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL +) ENGINE=default_engine DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +delete from t1; +insert into t1 values('aaa','aaa'); +insert into t1 values('aaa|qqq','qqq'); +insert into t1 values('gheis','^[^a-dXYZ]+$'); +insert into t1 values('aab','^aa?b'); +insert into t1 values('Baaan','^Ba*n'); +insert into t1 values('aaa','qqq|aaa'); +insert into t1 values('qqq','qqq|aaa'); +insert into t1 values('bbb','qqq|aaa'); +insert into t1 values('bbb','qqq'); +insert into t1 values('aaa','aba'); +insert into t1 values(null,'abc'); +insert into t1 values('def',null); +insert into t1 values(null,null); +select HIGH_PRIORITY s1 regexp s2 from t1; +s1 regexp s2 +1 +1 +1 +1 +1 +1 +1 +0 +0 +0 +NULL +NULL +NULL +SELECT 'ghi' REGEXP 'ghi['; +ERROR HY000: The regular expression contains an unclosed bracket expression. +drop table t1; +set names utf8mb4; +set names utf8mb4; +# Not supported by ICU +select 'вася' rlike '[[:<:]]вася[[:>:]]'; +ERROR HY000: Illegal argument to a regular expression. +# Not supported by ICU +select 'вася ' rlike '[[:<:]]вася[[:>:]]'; +ERROR HY000: Illegal argument to a regular expression. +# Not supported by ICU +select ' вася' rlike '[[:<:]]вася[[:>:]]'; +ERROR HY000: Illegal argument to a regular expression. +# Not supported by ICU +select ' вася ' rlike '[[:<:]]вася[[:>:]]'; +ERROR HY000: Illegal argument to a regular expression. +# Not supported by ICU +select 'васяz' rlike '[[:<:]]вася[[:>:]]'; +ERROR HY000: Illegal argument to a regular expression. +# Not supported by ICU +select 'zвася' rlike '[[:<:]]вася[[:>:]]'; +ERROR HY000: Illegal argument to a regular expression. +# Not supported by ICU +select 'zвасяz' rlike '[[:<:]]вася[[:>:]]'; +ERROR HY000: Illegal argument to a regular expression. +CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8mb4_unicode_ci) ENGINE InnoDB; +ALTER TABLE t1 ADD COLUMN b CHAR(20); +DROP TABLE t1; +set names utf8mb4; +create table t1 (a enum('aaaa','проба') character set utf8mb4) engine InnoDB; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('aaaa','проба') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +insert into t1 values ('проба'); +select * from t1; +a +проба +create table t2 engine InnoDB select ifnull(a,a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `ifnull(a,a)` varchar(5) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +select * from t2; +ifnull(a,a) +проба +drop table t1; +drop table t2; +create table t1 (c varchar(30) character set utf8mb4, unique(c(10))) engine InnoDB; +insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z'); +insert into t1 values ('aaaaaaaaaa'); +insert into t1 values ('aaaaaaaaaaa'); +ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 't1.c' +insert into t1 values ('aaaaaaaaaaaa'); +ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 't1.c' +insert into t1 values (repeat('b',20)); +select c c1 from t1 where c='1'; +c1 +1 +select c c2 from t1 where c='2'; +c2 +2 +select c c3 from t1 where c='3'; +c3 +3 +select c cx from t1 where c='x'; +cx +x +select c cy from t1 where c='y'; +cy +y +select c cz from t1 where c='z'; +cz +z +select c ca10 from t1 where c='aaaaaaaaaa'; +ca10 +aaaaaaaaaa +select c cb20 from t1 where c=repeat('b',20); +cb20 +bbbbbbbbbbbbbbbbbbbb +drop table t1; +create table t1 (c varchar(30) character set utf8mb4, unique(c(10))) engine=InnoDB; +insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z'); +insert into t1 values ('aaaaaaaaaa'); +insert into t1 values ('aaaaaaaaaaa'); +ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 't1.c' +insert into t1 values ('aaaaaaaaaaaa'); +ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 't1.c' +insert into t1 values (repeat('b',20)); +select c c1 from t1 where c='1'; +c1 +1 +select c c2 from t1 where c='2'; +c2 +2 +select c c3 from t1 where c='3'; +c3 +3 +select c cx from t1 where c='x'; +cx +x +select c cy from t1 where c='y'; +cy +y +select c cz from t1 where c='z'; +cz +z +select c ca10 from t1 where c='aaaaaaaaaa'; +ca10 +aaaaaaaaaa +select c cb20 from t1 where c=repeat('b',20); +cb20 +bbbbbbbbbbbbbbbbbbbb +drop table t1; +create table t1 (c char(3) character set utf8mb4, unique (c(2))) engine InnoDB; +insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z'); +insert into t1 values ('a'); +insert into t1 values ('aa'); +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'aa' for key 't1.c' +insert into t1 values ('b'); +insert into t1 values ('bb'); +insert into t1 values ('bbb'); +ERROR 23000: Duplicate entry 'bb' for key 't1.c' +insert into t1 values ('а'); +insert into t1 values ('аа'); +insert into t1 values ('ааа'); +ERROR 23000: Duplicate entry 'аа' for key 't1.c' +insert into t1 values ('б'); +insert into t1 values ('бб'); +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'бб' for key 't1.c' +insert into t1 values ('ꪪ'); +insert into t1 values ('ꪪꪪ'); +insert into t1 values ('ꪪꪪꪪ'); +ERROR 23000: Duplicate entry 'ꪪꪪ' for key 't1.c' +drop table t1; +create table t1 (c char(3) character set utf8mb4, unique (c(2))) engine=InnoDB; +insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z'); +insert into t1 values ('a'); +insert into t1 values ('aa'); +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'aa' for key 't1.c' +insert into t1 values ('b'); +insert into t1 values ('bb'); +insert into t1 values ('bbb'); +ERROR 23000: Duplicate entry 'bb' for key 't1.c' +insert into t1 values ('а'); +insert into t1 values ('аа'); +insert into t1 values ('ааа'); +ERROR 23000: Duplicate entry 'аа' for key 't1.c' +insert into t1 values ('б'); +insert into t1 values ('бб'); +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'бб' for key 't1.c' +insert into t1 values ('ꪪ'); +insert into t1 values ('ꪪꪪ'); +insert into t1 values ('ꪪꪪꪪ'); +ERROR 23000: Duplicate entry 'ꪪꪪ' for key 't1.c' +drop table t1; +create table t1 ( +c char(10) character set utf8mb4, +unique key a using hash (c(1)) +) engine=InnoDB; +Warnings: +Note 3502 This storage engine does not support the HASH index algorithm, storage engine default was used instead. +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + UNIQUE KEY `a` (`c`(1)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); +insert into t1 values ('aa'); +ERROR 23000: Duplicate entry 'a' for key 't1.a' +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'a' for key 't1.a' +insert into t1 values ('б'); +insert into t1 values ('бб'); +ERROR 23000: Duplicate entry 'б' for key 't1.a' +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'б' for key 't1.a' +select c as c_all from t1 order by c; +c_all +a +b +c +d +e +f +б +select c as c_a from t1 where c='a'; +c_a +a +select c as c_a from t1 where c='б'; +c_a +б +drop table t1; +create table t1 ( +c char(10) character set utf8mb4, +unique key a using btree (c(1)) +) engine=InnoDB; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL, + UNIQUE KEY `a` (`c`(1)) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); +insert into t1 values ('aa'); +ERROR 23000: Duplicate entry 'a' for key 't1.a' +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'a' for key 't1.a' +insert into t1 values ('б'); +insert into t1 values ('бб'); +ERROR 23000: Duplicate entry 'б' for key 't1.a' +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'б' for key 't1.a' +select c as c_all from t1 order by c; +c_all +a +b +c +d +e +f +б +select c as c_a from t1 where c='a'; +c_a +a +select c as c_a from t1 where c='б'; +c_a +б +drop table t1; +create table t1 ( +c char(10) character set utf8mb4, +unique key a (c(1)) +) engine=InnoDB; +insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); +insert into t1 values ('aa'); +ERROR 23000: Duplicate entry 'a' for key 't1.a' +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'a' for key 't1.a' +insert into t1 values ('б'); +insert into t1 values ('бб'); +ERROR 23000: Duplicate entry 'б' for key 't1.a' +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'б' for key 't1.a' +select c as c_all from t1 order by c; +c_all +a +b +c +d +e +f +б +select c as c_a from t1 where c='a'; +c_a +a +select c as c_a from t1 where c='б'; +c_a +б +drop table t1; +create table t1 (c varchar(30) character set utf8mb4 collate utf8mb4_bin, unique(c(10))) engine InnoDB; +insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z'); +insert into t1 values ('aaaaaaaaaa'); +insert into t1 values ('aaaaaaaaaaa'); +ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 't1.c' +insert into t1 values ('aaaaaaaaaaaa'); +ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 't1.c' +insert into t1 values (repeat('b',20)); +select c c1 from t1 where c='1'; +c1 +1 +select c c2 from t1 where c='2'; +c2 +2 +select c c3 from t1 where c='3'; +c3 +3 +select c cx from t1 where c='x'; +cx +x +select c cy from t1 where c='y'; +cy +y +select c cz from t1 where c='z'; +cz +z +select c ca10 from t1 where c='aaaaaaaaaa'; +ca10 +aaaaaaaaaa +select c cb20 from t1 where c=repeat('b',20); +cb20 +bbbbbbbbbbbbbbbbbbbb +drop table t1; +create table t1 (c char(3) character set utf8mb4 collate utf8mb4_bin, unique (c(2))) engine InnoDB; +insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z'); +insert into t1 values ('a'); +insert into t1 values ('aa'); +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'aa' for key 't1.c' +insert into t1 values ('b'); +insert into t1 values ('bb'); +insert into t1 values ('bbb'); +ERROR 23000: Duplicate entry 'bb' for key 't1.c' +insert into t1 values ('а'); +insert into t1 values ('аа'); +insert into t1 values ('ааа'); +ERROR 23000: Duplicate entry 'аа' for key 't1.c' +insert into t1 values ('б'); +insert into t1 values ('бб'); +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'бб' for key 't1.c' +insert into t1 values ('ꪪ'); +insert into t1 values ('ꪪꪪ'); +insert into t1 values ('ꪪꪪꪪ'); +ERROR 23000: Duplicate entry 'ꪪꪪ' for key 't1.c' +drop table t1; +create table t1 ( +c char(10) character set utf8mb4 collate utf8mb4_bin, +unique key a using hash (c(1)) +) engine=InnoDB; +Warnings: +Note 3502 This storage engine does not support the HASH index algorithm, storage engine default was used instead. +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL, + UNIQUE KEY `a` (`c`(1)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); +insert into t1 values ('aa'); +ERROR 23000: Duplicate entry 'a' for key 't1.a' +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'a' for key 't1.a' +insert into t1 values ('б'); +insert into t1 values ('бб'); +ERROR 23000: Duplicate entry 'б' for key 't1.a' +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'б' for key 't1.a' +select c as c_all from t1 order by c; +c_all +a +b +c +d +e +f +б +select c as c_a from t1 where c='a'; +c_a +a +select c as c_a from t1 where c='б'; +c_a +б +drop table t1; +create table t1 ( +c char(10) character set utf8mb4 collate utf8mb4_bin, +unique key a using btree (c(1)) +) engine=InnoDB; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL, + UNIQUE KEY `a` (`c`(1)) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); +insert into t1 values ('aa'); +ERROR 23000: Duplicate entry 'a' for key 't1.a' +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'a' for key 't1.a' +insert into t1 values ('б'); +insert into t1 values ('бб'); +ERROR 23000: Duplicate entry 'б' for key 't1.a' +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'б' for key 't1.a' +select c as c_all from t1 order by c; +c_all +a +b +c +d +e +f +б +select c as c_a from t1 where c='a'; +c_a +a +select c as c_a from t1 where c='б'; +c_a +б +drop table t1; +create table t1 ( +c char(10) character set utf8mb4 collate utf8mb4_bin, +unique key a (c(1)) +) engine=InnoDB; +insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); +insert into t1 values ('aa'); +ERROR 23000: Duplicate entry 'a' for key 't1.a' +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'a' for key 't1.a' +insert into t1 values ('б'); +insert into t1 values ('бб'); +ERROR 23000: Duplicate entry 'б' for key 't1.a' +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'б' for key 't1.a' +select c as c_all from t1 order by c; +c_all +a +b +c +d +e +f +б +select c as c_a from t1 where c='a'; +c_a +a +select c as c_a from t1 where c='б'; +c_a +б +drop table t1; +create table t1 ( +str varchar(255) character set utf8mb4 not null, +key str (str(2)) +) engine=InnoDB; +INSERT INTO t1 VALUES ('str'); +INSERT INTO t1 VALUES ('str2'); +select * from t1 where str='str'; +str +str +drop table t1; +create table t1 ( +str varchar(255) character set utf8mb4 not null, +key str (str(2)) +) engine=InnoDB; +INSERT INTO t1 VALUES ('str'); +INSERT INTO t1 VALUES ('str2'); +select * from t1 where str='str'; +str +str +drop table t1; +create table t1 ( +str varchar(255) character set utf8mb4 not null, +key str using btree (str(2)) +) engine=InnoDB; +INSERT INTO t1 VALUES ('str'); +INSERT INTO t1 VALUES ('str2'); +select * from t1 where str='str'; +str +str +drop table t1; +create table t1 ( +str varchar(255) character set utf8mb4 not null, +key str using hash (str(2)) +) engine=InnoDB; +Warnings: +Note 3502 This storage engine does not support the HASH index algorithm, storage engine default was used instead. +INSERT INTO t1 VALUES ('str'); +INSERT INTO t1 VALUES ('str2'); +select * from t1 where str='str'; +str +str +drop table t1; +create table t1 ( +str varchar(255) character set utf8mb4 not null, +key str (str(2)) +) engine= InnoDB; +INSERT INTO t1 VALUES ('str'); +INSERT INTO t1 VALUES ('str2'); +select * from t1 where str='str'; +str +str +drop table t1; +CREATE TABLE t1 (a varchar(32) BINARY) CHARACTER SET utf8mb4 ENGINE InnoDB; +Warnings: +Warning 1287 'BINARY as attribute of a type' is deprecated and will be removed in a future release. Please use a CHARACTER SET clause with _bin collation instead +INSERT INTO t1 VALUES ('test'); +SELECT a FROM t1 WHERE a LIKE '%te'; +a +DROP TABLE t1; +SET NAMES utf8mb4; +CREATE TABLE t1 ( +subject varchar(255) character set utf8mb4 collate utf8mb4_unicode_ci, +p varchar(15) character set utf8mb4 +) ENGINE= InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES ('谷川俊二と申しますが、インターネット予約の会員登録をしましたところ、メールアドレスを間違えてしまい会員IDが受け取ることが出来ませんでした。間違えアドレスはtani-shun@n.vodafone.ne.jpを書き込みました。どうすればよいですか? その他、住所等は間違えありません。連絡ください。よろしくお願いします。m(__)m','040312-000057'); +INSERT INTO t1 VALUES ('aaa','bbb'); +SELECT length(subject) FROM t1; +length(subject) +3 +432 +SELECT length(subject) FROM t1 ORDER BY 1; +length(subject) +3 +432 +DROP TABLE t1; +CREATE TABLE t1 ( +id int unsigned NOT NULL auto_increment, +list_id smallint unsigned NOT NULL, +term TEXT NOT NULL, +PRIMARY KEY(id), +INDEX(list_id, term(4)) +) ENGINE=InnoDB CHARSET=utf8mb4; +INSERT INTO t1 SET list_id = 1, term = "letterc"; +INSERT INTO t1 SET list_id = 1, term = "letterb"; +INSERT INTO t1 SET list_id = 1, term = "lettera"; +INSERT INTO t1 SET list_id = 1, term = "letterd"; +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterc"); +id +1 +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterb"); +id +2 +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "lettera"); +id +3 +SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterd"); +id +4 +DROP TABLE t1; +SET NAMES latin1; +CREATE TABLE t1 ( +id int unsigned NOT NULL auto_increment, +list_id smallint unsigned NOT NULL, +term text NOT NULL, +PRIMARY KEY(id), +INDEX(list_id, term(19)) +) ENGINE=InnoDB CHARSET=utf8mb4; +INSERT INTO t1 set list_id = 1, term = "testtest"; +INSERT INTO t1 set list_id = 1, term = "testetest"; +INSERT INTO t1 set list_id = 1, term = "testtest"; +SELECT id, term FROM t1 where (list_id = 1) AND (term = "testtest"); +id term +1 testtest +2 testetest +3 testtest +SELECT id, term FROM t1 where (list_id = 1) AND (term = "testetest"); +id term +1 testtest +2 testetest +3 testtest +SELECT id, term FROM t1 where (list_id = 1) AND (term = "testtest"); +id term +1 testtest +2 testetest +3 testtest +DROP TABLE t1; +set names utf8mb4; +create table t1 ( +a int primary key, +b varchar(6), +index b3(b(3)) +) engine=InnoDB character set=utf8mb4; +insert into t1 values(1,'foo'),(2,'foobar'); +select * from t1 where b like 'foob%'; +a b +2 foobar +alter table t1 engine=innodb; +select * from t1 where b like 'foob%'; +a b +2 foobar +drop table t1; +create table t1 ( +a enum('петя','вася','анюта') character set utf8mb4 not null default 'анюта', +b set('петя','вася','анюта') character set utf8mb4 not null default 'анюта' +) engine InnoDB; +create table t2 engine InnoDB select concat(a,_utf8mb4'') as a, concat(b,_utf8mb4'')as b from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` varchar(5) DEFAULT NULL, + `b` varchar(15) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t2; +drop table t1; +select 'c' like '\_' as want0; +want0 +0 +SELECT SUBSTR('вася',-2); +SUBSTR('вася',-2) +ся +create table t1 (id integer, a varchar(100) character set utf8mb4 collate utf8mb4_unicode_ci) engine InnoDB; +insert into t1 values (1, 'Test'); +select * from t1 where soundex(a) = soundex('Test'); +id a +1 Test +select * from t1 where soundex(a) = soundex('TEST'); +id a +1 Test +select * from t1 where soundex(a) = soundex('test'); +id a +1 Test +drop table t1; +select soundex(_utf8mb4 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB); +soundex(_utf8mb4 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB) +阅000 +select hex(soundex(_utf8mb4 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB)); +hex(soundex(_utf8mb4 0xE99885E8A788E99A8FE697B6E69BB4E696B0E79A84E696B0E997BB)) +E99885303030 +select soundex(_utf8mb4 0xD091D092D093); +soundex(_utf8mb4 0xD091D092D093) +Б000 +select hex(soundex(_utf8mb4 0xD091D092D093)); +hex(soundex(_utf8mb4 0xD091D092D093)) +D091303030 +SET collation_connection='utf8mb4_general_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +utf8mb4_general_ci 6109 +utf8mb4_general_ci 61 +utf8mb4_general_ci 6120 +drop table t1; +select @@collation_connection; +@@collation_connection +utf8mb4_general_ci +create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ; +insert into t1 values('abcdef'); +insert into t1 values('_bcdef'); +insert into t1 values('a_cdef'); +insert into t1 values('ab_def'); +insert into t1 values('abc_ef'); +insert into t1 values('abcd_f'); +insert into t1 values('abcde_'); +select c1 as c1u from t1 where c1 like 'ab\_def'; +c1u +ab_def +select c1 as c2h from t1 where c1 like 'ab#_def' escape '#'; +c2h +ab_def +drop table t1; +"BEGIN ctype_german.inc" +drop table if exists t1; +create table t1 as select repeat(' ', 64) as s1; +select collation(s1) from t1; +collation(s1) +utf8mb4_general_ci +delete from t1; +INSERT INTO t1 VALUES ('ud'),('uf'); +INSERT INTO t1 VALUES ('od'),('of'); +INSERT INTO t1 VALUES ('e'); +INSERT INTO t1 VALUES ('ad'),('af'); +insert into t1 values ('a'),('ae'),(_latin1 0xE4); +insert into t1 values ('o'),('oe'),(_latin1 0xF6); +insert into t1 values ('s'),('ss'),(_latin1 0xDF); +insert into t1 values ('u'),('ue'),(_latin1 0xFC); +INSERT INTO t1 VALUES (_latin1 0xE6), (_latin1 0xC6); +INSERT INTO t1 VALUES (_latin1 0x9C), (_latin1 0x8C); +select s1, hex(s1) from t1 order by s1, binary s1; +s1 hex(s1) +a 61 +ä C3A4 +ad 6164 +ae 6165 +af 6166 +e 65 +o 6F +ö C3B6 +od 6F64 +oe 6F65 +of 6F66 +s 73 +ß C39F +ss 7373 +u 75 +ü C3BC +ud 7564 +ue 7565 +uf 7566 +Æ C386 +æ C3A6 +Œ C592 +œ C593 +select group_concat(s1 order by binary s1) from t1 group by s1; +group_concat(s1 order by binary s1) +a,ä +ad +ae +af +e +o,ö +od +oe +of +s,ß +ss +u,ü +ud +ue +uf +Æ,æ +Œ,œ +SELECT s1, hex(s1), hex(weight_string(s1)) FROM t1 ORDER BY s1, BINARY(s1); +s1 hex(s1) hex(weight_string(s1)) +a 61 0041 +ä C3A4 0041 +ad 6164 00410044 +ae 6165 00410045 +af 6166 00410046 +e 65 0045 +o 6F 004F +ö C3B6 004F +od 6F64 004F0044 +oe 6F65 004F0045 +of 6F66 004F0046 +s 73 0053 +ß C39F 0053 +ss 7373 00530053 +u 75 0055 +ü C3BC 0055 +ud 7564 00550044 +ue 7565 00550045 +uf 7566 00550046 +Æ C386 00C6 +æ C3A6 00C6 +Œ C592 0152 +œ C593 0152 +SELECT s1, hex(s1) FROM t1 WHERE s1='ae' ORDER BY s1, BINARY(s1); +s1 hex(s1) +ae 6165 +drop table t1; +"END ctype_german.inc" +SET collation_connection='utf8mb4_bin'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +utf8mb4_bin 6109 +utf8mb4_bin 61 +utf8mb4_bin 6120 +drop table t1; +select @@collation_connection; +@@collation_connection +utf8mb4_bin +create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ; +insert into t1 values('abcdef'); +insert into t1 values('_bcdef'); +insert into t1 values('a_cdef'); +insert into t1 values('ab_def'); +insert into t1 values('abc_ef'); +insert into t1 values('abcd_f'); +insert into t1 values('abcde_'); +select c1 as c1u from t1 where c1 like 'ab\_def'; +c1u +ab_def +select c1 as c2h from t1 where c1 like 'ab#_def' escape '#'; +c2h +ab_def +drop table t1; +CREATE TABLE t1 ( +user varchar(255) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES ('one'),('two'); +SELECT CHARSET('a'); +CHARSET('a') +utf8mb4 +SELECT user, CONCAT('<', user, '>') AS c FROM t1; +user c +one +two +DROP TABLE t1; +create table t1 (f1 varchar(1) not null) default charset utf8mb4 engine InnoDB; +insert into t1 values (''), (''); +select concat(concat(_latin1'->',f1),_latin1'<-') from t1; +concat(concat(_latin1'->',f1),_latin1'<-') +-><- +-><- +drop table t1; +select convert(_koi8r'' using utf8mb4) < convert(_koi8r'' using utf8mb4); +convert(_koi8r'?' using utf8mb4) < convert(_koi8r'?' using utf8mb4) +1 +set names latin1; +create table t1 (a varchar(10)) character set utf8mb4 engine InnoDB; +insert into t1 values ('test'); +select ifnull(a,'') from t1; +ifnull(a,'') +test +drop table t1; +select repeat(_utf8mb4'+',3) as h union select NULL; +h ++++ +NULL +select ifnull(NULL, _utf8mb4'string'); +ifnull(NULL, _utf8mb4'string') +string +set names utf8mb4; +create table t1 (s1 char(5) character set utf8mb4 collate utf8mb4_lithuanian_ci) engine InnoDB; +insert into t1 values ('I'),('K'),('Y'); +select * from t1 where s1 < 'K' and s1 = 'Y'; +s1 +I +Y +select * from t1 where 'K' > s1 and s1 = 'Y'; +s1 +I +Y +drop table t1; +create table t1 (s1 char(5) character set utf8mb4 collate utf8mb4_czech_ci) engine InnoDB; +insert into t1 values ('c'),('d'),('h'),('ch'),('CH'),('cH'),('Ch'),('i'); +select * from t1 where s1 > 'd' and s1 = 'CH'; +s1 +CH +Ch +ch +select * from t1 where 'd' < s1 and s1 = 'CH'; +s1 +CH +Ch +ch +select * from t1 where s1 = 'cH' and s1 <> 'ch'; +s1 +cH +select * from t1 where 'cH' = s1 and s1 <> 'ch'; +s1 +cH +drop table t1; +create table t1 (a varchar(255)) default character set utf8mb4 engine InnoDB; +insert into t1 values (1.0); +drop table t1; +create table t1 ( +id int not null, +city varchar(20) not null, +key (city(7),id) +) character set=utf8mb4 engine InnoDB; +insert into t1 values (1,'Durban North'); +insert into t1 values (2,'Durban'); +select * from t1 where city = 'Durban'; +id city +2 Durban +select * from t1 where city = 'Durban '; +id city +drop table t1; +create table t1 (x set('A', 'B') default 0) character set utf8mb4 engine InnoDB; +ERROR 42000: Invalid default value for 'x' +create table t1 (x enum('A', 'B') default 0) character set utf8mb4 engine InnoDB; +ERROR 42000: Invalid default value for 'x' +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +SET NAMES UTF8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +CREATE TABLE t1 ( +`id` int(20) NOT NULL auto_increment, +`country` varchar(100) NOT NULL default '', +`shortcode` varchar(100) NOT NULL default '', +`operator` varchar(100) NOT NULL default '', +`momid` varchar(30) NOT NULL default '', +`keyword` varchar(160) NOT NULL default '', +`content` varchar(160) NOT NULL default '', +`second_token` varchar(160) default NULL, +`gateway_id` int(11) NOT NULL default '0', +`created` datetime NOT NULL default '0000-00-00 00:00:00', +`msisdn` varchar(15) NOT NULL default '', +PRIMARY KEY (`id`), +UNIQUE KEY `MSCCSPK_20030521130957121` (`momid`), +KEY `IX_mobile_originated_message_keyword` (`keyword`), +KEY `IX_mobile_originated_message_created` (`created`), +KEY `IX_mobile_originated_message_support` (`msisdn`,`momid`,`keyword`,`gateway_id`,`created`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +(1,'blah','464','aaa','fkc1c9ilc20x0hgae7lx6j09','ERR','ERR Имри.Афимим.Аеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ад.Д имдимримрад.Адимримримрмдиримримримр м.Дадимфшьмримд им.Адимимрн имадми','ИМРИ.АФИМИМ.АЕИМИМРИМДМРИМРМРИРОР',3,'2005-06-01 17:30:43','1234567890'), +(2,'blah','464','aaa','haxpl2ilc20x00bj4tt2m5ti','11','11 g','G',3,'2005-06-02 22:43:10','1234567890'); +CREATE TABLE t2 ( +`msisdn` varchar(15) NOT NULL default '', +`operator_id` int(11) NOT NULL default '0', +`created` datetime NOT NULL default '0000-00-00 00:00:00', +UNIQUE KEY `PK_user` (`msisdn`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +INSERT INTO t2 VALUES ('1234567890',2,'2005-05-24 13:53:25'); +SELECT content, t2.msisdn FROM t1, t2 WHERE t1.msisdn = '1234567890'; +content msisdn +ERR Имри.Афимим.Аеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ад.Д имдимримрад.Адимримримрмдиримримримр м.Дадимфшьмримд им.Адимимрн имадми 1234567890 +11 g 1234567890 +DROP TABLE t1,t2; +SET sql_mode = default; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +create table t1 (a char(20) character set utf8mb4) engine InnoDB; +insert into t1 values ('123456'),('андрей'); +alter table t1 modify a char(2) character set utf8mb4; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'a' at row 2 +select char_length(a), length(a), a from t1 order by a; +char_length(a) length(a) a +2 2 12 +2 4 ан +drop table t1; +SET sql_mode = default; +set names utf8mb4; +select 'andre%' like 'andreñ%' escape 'ñ'; +'andre%' like 'andreñ%' escape 'ñ' +1 +set names utf8mb4; +select 'a\\' like 'a\\'; +'a\\' like 'a\\' +1 +select 'aa\\' like 'a%\\'; +'aa\\' like 'a%\\' +1 +create table t1 (a char(10), key(a)) character set utf8mb4 engine InnoDB; +insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); +select * from t1 where a like "abc%"; +a +abc +abcd +select * from t1 where a like concat("abc","%"); +a +abc +abcd +select * from t1 where a like "ABC%"; +a +abc +abcd +select * from t1 where a like "test%"; +a +test +select * from t1 where a like "te_t"; +a +test +select * from t1 where a like "%a%"; +a +a +abc +abcd +select * from t1 where a like "%abcd%"; +a +abcd +select * from t1 where a like "%abc\d%"; +a +abcd +drop table t1; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1 ( +a varchar(255) NOT NULL default '', +KEY a (a) +) ENGINE=InnoDB ROW_FORMAT=DYNAMIC +DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci; +insert into t1 values (_utf8mb4 0xe880bd); +insert into t1 values (_utf8mb4 0x5b); +select hex(a) from t1; +hex(a) +5B +E880BD +drop table t1; +SET sql_mode = default; +set names 'latin1'; +create table t1 (a varchar(255)) default charset=utf8mb4 engine InnoDB; +select * from t1 where find_in_set('-1', a); +a +drop table t1; +create table t1 (a int) engine InnoDB; +insert into t1 values (48),(49),(50); +set names utf8mb4; +select distinct char(a) from t1; +char(a) +0 +1 +2 +drop table t1; +CREATE TABLE t1 (t TINYTEXT CHARACTER SET utf8mb4) ENGINE InnoDB; +INSERT INTO t1 VALUES(REPEAT('a', 100)); +CREATE TEMPORARY TABLE t2 ENGINE InnoDB SELECT COALESCE(t) AS bug FROM t1; +SELECT LENGTH(bug) FROM t2; +LENGTH(bug) +100 +DROP TABLE t2; +DROP TABLE t1; +CREATE TABLE t1 (item varchar(255)) default character set utf8mb4 ENGINE InnoDB; +INSERT INTO t1 VALUES (N'\\'); +Warnings: +Warning 3720 NATIONAL/NCHAR/NVARCHAR implies the character set UTF8MB3, which will be replaced by UTF8MB4 in a future release. Please consider using CHAR(x) CHARACTER SET UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (_utf8mb4'\\'); +INSERT INTO t1 VALUES (N'Cote d\'Ivoire'); +Warnings: +Warning 3720 NATIONAL/NCHAR/NVARCHAR implies the character set UTF8MB3, which will be replaced by UTF8MB4 in a future release. Please consider using CHAR(x) CHARACTER SET UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES (_utf8mb4'Cote d\'Ivoire'); +SELECT item FROM t1 ORDER BY item; +item +\ +\ +Cote d'Ivoire +Cote d'Ivoire +DROP TABLE t1; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +SET NAMES utf8mb4; +CREATE TABLE t1(a VARCHAR(255), KEY(a)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC DEFAULT CHARSET=utf8mb4; +INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'); +INSERT INTO t1 VALUES('uu'); +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 VALUES('uU'); +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 VALUES('uu'); +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 VALUES('uuABC'); +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 VALUES('UuABC'); +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 VALUES('uuABC'); +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +alter table t1 add b int; +INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',1); +INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',2); +delete from t1 where b=1; +INSERT INTO t1 VALUES('UUABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',1); +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',3); +INSERT INTO t1 VALUES('uuABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',4); +delete from t1 where b=3; +INSERT INTO t1 VALUES('uUABCDEFGHIGKLMNOPRSTUVWXYZ̈bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',3); +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; +SET sql_mode = default; +set names utf8mb4; +create table t1 (s1 char(5) character set utf8mb4) engine InnoDB; +insert into t1 values +('a'),('b'),(null),('ペテルグル'),('ü'),('Y'); +create index it1 on t1 (s1); +select s1 as before_delete_general_ci from t1 where s1 like 'ペテ%'; +before_delete_general_ci +ペテルグル +delete from t1 where s1 = 'Y'; +select s1 as after_delete_general_ci from t1 where s1 like 'ペテ%'; +after_delete_general_ci +ペテルグル +drop table t1; +set names utf8mb4; +create table t1 (s1 char(5) character set utf8mb4 collate utf8mb4_unicode_ci) engine InnoDB; +insert into t1 values +('a'),('b'),(null),('ペテルグル'),('ü'),('Y'); +create index it1 on t1 (s1); +select s1 as before_delete_unicode_ci from t1 where s1 like 'ペテ%'; +before_delete_unicode_ci +ペテルグル +delete from t1 where s1 = 'Y'; +select s1 as after_delete_unicode_ci from t1 where s1 like 'ペテ%'; +after_delete_unicode_ci +ペテルグル +drop table t1; +set names utf8mb4; +create table t1 (s1 char(5) character set utf8mb4 collate utf8mb4_bin) engine InnoDB; +insert into t1 values +('a'),('b'),(null),('ペテルグル'),('ü'),('Y'); +create index it1 on t1 (s1); +select s1 as before_delete_bin from t1 where s1 like 'ペテ%'; +before_delete_bin +ペテルグル +delete from t1 where s1 = 'Y'; +select s1 as after_delete_bin from t1 where s1 like 'ペテ%'; +after_delete_bin +ペテルグル +drop table t1; +set names utf8mb4; +create table t1 (a varchar(30) not null primary key) +engine=InnoDB default character set utf8mb4 collate utf8mb4_general_ci; +insert into t1 values ('あいうえおかきくけこさしすせそ'); +insert into t1 values ('さしすせそかきくけこあいうえお'); +select a as gci1 from t1 where a like 'さしすせそかきくけこあいうえお%'; +gci1 +さしすせそかきくけこあいうえお +select a as gci2 from t1 where a like 'あいうえおかきくけこさしすせそ'; +gci2 +あいうえおかきくけこさしすせそ +drop table t1; +set names utf8mb4; +create table t1 (a varchar(30) not null primary key) +engine=InnoDB default character set utf8mb4 collate utf8mb4_unicode_ci; +insert into t1 values ('あいうえおかきくけこさしすせそ'); +insert into t1 values ('さしすせそかきくけこあいうえお'); +select a as uci1 from t1 where a like 'さしすせそかきくけこあいうえお%'; +uci1 +さしすせそかきくけこあいうえお +select a as uci2 from t1 where a like 'あいうえおかきくけこさしすせそ'; +uci2 +あいうえおかきくけこさしすせそ +drop table t1; +set names utf8mb4; +create table t1 (a varchar(30) not null primary key) +engine=InnoDB default character set utf8mb4 collate utf8mb4_bin; +insert into t1 values ('あいうえおかきくけこさしすせそ'); +insert into t1 values ('さしすせそかきくけこあいうえお'); +select a as bin1 from t1 where a like 'さしすせそかきくけこあいうえお%'; +bin1 +さしすせそかきくけこあいうえお +select a as bin2 from t1 where a like 'あいうえおかきくけこさしすせそ'; +bin2 +あいうえおかきくけこさしすせそ +drop table t1; +SET NAMES utf8mb4; +CREATE TABLE t1 (id int PRIMARY KEY, +a varchar(16) collate utf8mb4_unicode_ci NOT NULL default '', +b int, +f varchar(128) default 'XXX', +INDEX (a(4)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +INSERT INTO t1(id, a, b) VALUES +(1, 'cccc', 50), (2, 'cccc', 70), (3, 'cccc', 30), +(4, 'cccc', 30), (5, 'cccc', 20), (6, 'bbbbbb', 40), +(7, 'dddd', 30), (8, 'aaaa', 10), (9, 'aaaa', 50), +(10, 'eeeee', 40), (11, 'bbbbbb', 60); +SELECT id, a, b FROM t1; +id a b +1 cccc 50 +10 eeeee 40 +11 bbbbbb 60 +2 cccc 70 +3 cccc 30 +4 cccc 30 +5 cccc 20 +6 bbbbbb 40 +7 dddd 30 +8 aaaa 10 +9 aaaa 50 +SELECT id, a, b FROM t1 WHERE a BETWEEN 'aaaa' AND 'bbbbbb'; +id a b +11 bbbbbb 60 +6 bbbbbb 40 +8 aaaa 10 +9 aaaa 50 +SELECT id, a FROM t1 WHERE a='bbbbbb'; +id a +11 bbbbbb +6 bbbbbb +SELECT id, a FROM t1 WHERE a='bbbbbb' ORDER BY b; +id a +6 bbbbbb +11 bbbbbb +DROP TABLE t1; +SET NAMES utf8mb4; +CREATE TABLE t1 ( +a CHAR(13) DEFAULT '', +INDEX(a) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; +INSERT INTO t1 VALUES +('Käli Käli 2-4'), ('Käli Käli 2-4'), +('Käli Käli 2+4'), ('Käli Käli 2+4'), +('Käli Käli 2-6'), ('Käli Käli 2-6'); +INSERT INTO t1 SELECT * FROM t1; +CREATE TABLE t2 ( +a CHAR(13) DEFAULT '', +INDEX(a) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; +INSERT INTO t2 VALUES +('Kali Kali 2-4'), ('Kali Kali 2-4'), +('Kali Kali 2+4'), ('Kali Kali 2+4'), +('Kali Kali 2-6'), ('Kali Kali 2-6'); +INSERT INTO t2 SELECT * FROM t2; +SELECT a FROM t1 WHERE a LIKE 'Käli Käli 2+4'; +a +Käli Käli 2+4 +Käli Käli 2+4 +Käli Käli 2+4 +Käli Käli 2+4 +SELECT a FROM t2 WHERE a LIKE 'Kali Kali 2+4'; +a +Kali Kali 2+4 +Kali Kali 2+4 +Kali Kali 2+4 +Kali Kali 2+4 +EXPLAIN SELECT a FROM t1 WHERE a LIKE 'Käli Käli 2+4'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range a a 53 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` like 'Käli Käli 2+4') +EXPLAIN SELECT a FROM t1 WHERE a = 'Käli Käli 2+4'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref a a 53 const 4 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'Käli Käli 2+4') +EXPLAIN SELECT a FROM t2 WHERE a LIKE 'Kali Kali 2+4'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range a a 14 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a` like 'Kali Kali 2+4') +EXPLAIN SELECT a FROM t2 WHERE a = 'Kali Kali 2+4'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref a a 14 const 4 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a` = 'Kali Kali 2+4') +DROP TABLE t1,t2; +CREATE TABLE t1 ( +a char(255) DEFAULT '', +KEY(a(10)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; +INSERT INTO t1 VALUES ('Käli Käli 2-4'); +SELECT * FROM t1 WHERE a LIKE 'Käli Käli 2%'; +a +Käli Käli 2-4 +INSERT INTO t1 VALUES ('Käli Käli 2-4'); +SELECT * FROM t1 WHERE a LIKE 'Käli Käli 2%'; +a +Käli Käli 2-4 +Käli Käli 2-4 +DROP TABLE t1; +CREATE TABLE t1 ( +a char(255) DEFAULT '' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; +INSERT INTO t1 VALUES ('Käli Käli 2-4'); +INSERT INTO t1 VALUES ('Käli Käli 2-4'); +SELECT * FROM t1 WHERE a LIKE 'Käli Käli 2%'; +a +Käli Käli 2-4 +Käli Käli 2-4 +ALTER TABLE t1 ADD KEY (a(10)); +SELECT * FROM t1 WHERE a LIKE 'Käli Käli 2%'; +a +Käli Käli 2-4 +Käli Käli 2-4 +DROP TABLE t1; +SET NAMES latin2; +CREATE TABLE t1 ( +id int(11) NOT NULL default '0', +tid int(11) NOT NULL default '0', +val text NOT NULL, +INDEX idx(tid, val(10)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +(40988,72,'VOLN ADSL'),(41009,72,'VOLN ADSL'), +(41032,72,'VOLN ADSL'),(41038,72,'VOLN ADSL'), +(41063,72,'VOLN ADSL'),(41537,72,'VOLN ADSL Office'), +(42141,72,'VOLN ADSL'),(42565,72,'VOLN ADSL Combi'), +(42749,72,'VOLN ADSL'),(44205,72,'VOLN ADSL'); +SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLNY ADSL'; +id tid val +40988 72 VOLN ADSL +41009 72 VOLN ADSL +41032 72 VOLN ADSL +41038 72 VOLN ADSL +41063 72 VOLN ADSL +42141 72 VOLN ADSL +42749 72 VOLN ADSL +44205 72 VOLN ADSL +SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLN ADSL'; +id tid val +40988 72 VOLN ADSL +41009 72 VOLN ADSL +41032 72 VOLN ADSL +41038 72 VOLN ADSL +41063 72 VOLN ADSL +42141 72 VOLN ADSL +42749 72 VOLN ADSL +44205 72 VOLN ADSL +SELECT * FROM t1 WHERE tid=72 and val LIKE '%VOLN ADSL'; +id tid val +40988 72 VOLN ADSL +41009 72 VOLN ADSL +41032 72 VOLN ADSL +41038 72 VOLN ADSL +41063 72 VOLN ADSL +42141 72 VOLN ADSL +42749 72 VOLN ADSL +44205 72 VOLN ADSL +ALTER TABLE t1 DROP KEY idx; +ALTER TABLE t1 ADD KEY idx (tid,val(11)); +SELECT * FROM t1 WHERE tid=72 and val LIKE 'VOLN ADSL'; +id tid val +40988 72 VOLN ADSL +41009 72 VOLN ADSL +41032 72 VOLN ADSL +41038 72 VOLN ADSL +41063 72 VOLN ADSL +42141 72 VOLN ADSL +42749 72 VOLN ADSL +44205 72 VOLN ADSL +DROP TABLE t1; +create table t1(a char(200) collate utf8mb4_unicode_ci NOT NULL default '') +default charset=utf8mb4 collate=utf8mb4_unicode_ci engine InnoDB; +insert into t1 values (unhex('65')), (unhex('C3A9')), (unhex('65')); +explain select distinct a from t1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using temporary +Warnings: +Note 1003 /* select#1 */ select distinct `test`.`t1`.`a` AS `a` from `test`.`t1` +SELECT COUNT(*) FROM (SELECT DISTINCT a FROM t1) AS t2; +COUNT(*) +1 +explain select a from t1 group by a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using temporary +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` group by `test`.`t1`.`a` +SELECT COUNT(*) FROM (SELECT a FROM t1 GROUP BY a) AS t2; +COUNT(*) +1 +drop table t1; +create table t1(a char(10)) default charset utf8mb4 engine InnoDB; +insert into t1 values ('123'), ('456'); +explain +select substr(z.a,-1), z.a from t1 as y join t1 as z on y.a=z.a order by 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE y NULL ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort +2 SIMPLE z NULL ALL NULL NULL NULL NULL 2 50.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select substr(`test`.`z`.`a`,-(1)) AS `substr(z.a,-1)`,`test`.`z`.`a` AS `a` from `test`.`t1` `y` join `test`.`t1` `z` where (`test`.`z`.`a` = `test`.`y`.`a`) order by `substr(z.a,-1)` +select substr(z.a,-1), z.a from t1 as y join t1 as z on y.a=z.a order by 1; +substr(z.a,-1) a +3 123 +6 456 +drop table t1; +SET CHARACTER SET utf8mb4; +CREATE DATABASE crashtest DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; +USE crashtest; +CREATE TABLE crashtest (crash char(10)) DEFAULT CHARSET=utf8mb4 ENGINE InnoDB; +INSERT INTO crashtest VALUES ('35'), ('36'), ('37'); +SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4); +crash +35 +37 +36 +INSERT INTO crashtest VALUES ('-1000'); +EXPLAIN SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE crashtest NULL ALL NULL NULL NULL NULL 4 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `crashtest`.`crashtest`.`crash` AS `crash` from `crashtest`.`crashtest` order by `char(crashtest.crash)` +SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4); +crash +-1000 +35 +37 +36 +Warnings: +Warning 1300 Invalid utf8mb4 character string: 'FFFFFC' +Warning 1300 Invalid utf8mb4 character string: 'FFFFFC' +DROP TABLE crashtest; +DROP DATABASE crashtest; +USE test; +SET CHARACTER SET default; +CREATE TABLE t1(id varchar(20) NOT NULL) DEFAULT CHARSET=utf8mb4 ENGINE InnoDB; +INSERT INTO t1 VALUES ('xxx'), ('aa'), ('yyy'), ('aa'); +SELECT id FROM t1; +id +aa +aa +xxx +yyy +SELECT DISTINCT id FROM t1; +id +aa +xxx +yyy +SELECT DISTINCT id FROM t1 ORDER BY id; +id +aa +xxx +yyy +DROP TABLE t1; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +create table t1 ( +a varchar(26) not null +) default character set utf8mb4 ENGINE InnoDB; +insert into t1 (a) values ('abcdefghijklmnopqrstuvwxyz'); +select * from t1; +a +abcdefghijklmnopqrstuvwxyz +alter table t1 change a a varchar(20) character set utf8mb4 not null; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +select * from t1; +a +abcdefghijklmnopqrst +alter table t1 change a a char(15) character set utf8mb4 not null; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +select * from t1; +a +abcdefghijklmno +alter table t1 change a a char(10) character set utf8mb4 not null; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +select * from t1; +a +abcdefghij +alter table t1 change a a varchar(5) character set utf8mb4 not null; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +select * from t1; +a +abcde +drop table t1; +create table t1 ( +a varchar(4000) not null +) default character set utf8mb4 engine InnoDB; +insert into t1 values (repeat('a',4000)); +alter table t1 change a a varchar(3000) character set utf8mb4 not null; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +select length(a) from t1; +length(a) +3000 +drop table t1; +SET sql_mode = default; +set names utf8mb4; +select hex(char(1 using utf8mb4)); +hex(char(1 using utf8mb4)) +01 +select char(0xd1,0x8f using utf8mb4); +char(0xd1,0x8f using utf8mb4) +я +select char(0xd18f using utf8mb4); +char(0xd18f using utf8mb4) +я +select char(53647 using utf8mb4); +char(53647 using utf8mb4) +я +select char(0xff,0x8f using utf8mb4); +char(0xff,0x8f using utf8mb4) +NULL +Warnings: +Warning 1300 Invalid utf8mb4 character string: 'FF8F' +select convert(char(0xff,0x8f) using utf8mb4); +convert(char(0xff,0x8f) using utf8mb4) +NULL +Warnings: +Warning 1300 Invalid utf8mb4 character string: 'FF8F' +set sql_mode=traditional; +select char(0xff,0x8f using utf8mb4); +char(0xff,0x8f using utf8mb4) +NULL +Warnings: +Warning 1300 Invalid utf8mb4 character string: 'FF8F' +select char(195 using utf8mb4); +char(195 using utf8mb4) +NULL +Warnings: +Warning 1300 Invalid utf8mb4 character string: 'C3' +select char(196 using utf8mb4); +char(196 using utf8mb4) +NULL +Warnings: +Warning 1300 Invalid utf8mb4 character string: 'C4' +select char(2557 using utf8mb4); +char(2557 using utf8mb4) +NULL +Warnings: +Warning 1300 Invalid utf8mb4 character string: 'FD' +select convert(char(0xff,0x8f) using utf8mb4); +convert(char(0xff,0x8f) using utf8mb4) +NULL +Warnings: +Warning 1300 Invalid utf8mb4 character string: 'FF8F' +select hex(convert(char(2557 using latin1) using utf8mb4)); +hex(convert(char(2557 using latin1) using utf8mb4)) +09C3BD +select hex(char(195)); +hex(char(195)) +C3 +select hex(char(196)); +hex(char(196)) +C4 +select hex(char(2557)); +hex(char(2557)) +09FD +set names utf8mb4; +create table t1 (a char(1)) default character set utf8mb4 engine InnoDB; +create table t2 (a char(1)) default character set utf8mb4 engine InnoDB; +insert into t1 values('a'),('a'),(0xE38182),(0xE38182); +insert into t1 values('i'),('i'),(0xE38184),(0xE38184); +select * from t1 union distinct select * from t2; +a +a +i +あ +い +drop table t1,t2; +set names utf8mb4; +create table t1 (a char(10), b varchar(10)) engine InnoDB; +insert into t1 values ('bar','kostja'); +insert into t1 values ('kostja','bar'); +prepare my_stmt from "select * from t1 where a=?"; +set @a:='bar'; +execute my_stmt using @a; +a b +bar kostja +set @a:='kostja'; +execute my_stmt using @a; +a b +kostja bar +set @a:=null; +execute my_stmt using @a; +a b +drop table if exists t1; +drop table if exists t1; +drop view if exists v1, v2; +set names utf8mb4; +create table t1(col1 varchar(12) character set utf8mb4 collate utf8mb4_unicode_ci) engine InnoDB; +insert into t1 values('t1_val'); +create view v1 as select 'v1_val' as col1; +select coercibility(col1), collation(col1) from v1; +coercibility(col1) collation(col1) +4 utf8mb4_0900_ai_ci +create view v2 as select col1 from v1 union select col1 from t1; +select coercibility(col1), collation(col1)from v2; +coercibility(col1) collation(col1) +2 utf8mb4_unicode_ci +2 utf8mb4_unicode_ci +drop view v1, v2; +create view v1 as select 'v1_val' collate utf8mb4_swedish_ci as col1; +select coercibility(col1), collation(col1) from v1; +coercibility(col1) collation(col1) +0 utf8mb4_swedish_ci +create view v2 as select col1 from v1 union select col1 from t1; +select coercibility(col1), collation(col1) from v2; +coercibility(col1) collation(col1) +0 utf8mb4_swedish_ci +0 utf8mb4_swedish_ci +drop view v1, v2; +drop table t1; +set names utf8mb4; +create table t1 (a varchar(10) character set latin1, b int) engine InnoDB; +insert into t1 values ('a',1); +select concat(a, if(b>10, N'x', N'y')) from t1; +concat(a, if(b>10, N'x', N'y')) +ay +Warnings: +Warning 3720 NATIONAL/NCHAR/NVARCHAR implies the character set UTF8MB3, which will be replaced by UTF8MB4 in a future release. Please consider using CHAR(x) CHARACTER SET UTF8MB4 in order to be unambiguous. +Warning 3720 NATIONAL/NCHAR/NVARCHAR implies the character set UTF8MB3, which will be replaced by UTF8MB4 in a future release. Please consider using CHAR(x) CHARACTER SET UTF8MB4 in order to be unambiguous. +select concat(a, if(b>10, N'æ', N'ß')) from t1; +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'concat' +drop table t1; +set names utf8mb4; +create table t1 (a varchar(10) character set latin1, b int) engine InnoDB; +insert into t1 values ('a',1); +select concat(a, if(b>10, _utf8mb4'x', _utf8mb4'y')) from t1; +concat(a, if(b>10, _utf8mb4'x', _utf8mb4'y')) +ay +select concat(a, if(b>10, _utf8mb4'æ', _utf8mb4'ß')) from t1; +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,COERCIBLE) for operation 'concat' +drop table t1; +set names utf8mb4; +create table t1 (a varchar(10) character set latin1, b int) engine InnoDB; +insert into t1 values ('a',1); +select concat(a, if(b>10, _utf8mb4 0x78, _utf8mb4 0x79)) from t1; +concat(a, if(b>10, _utf8mb4 0x78, _utf8mb4 0x79)) +ay +select concat(a, if(b>10, _utf8mb4 0xC3A6, _utf8mb4 0xC3AF)) from t1; +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,COERCIBLE) for operation 'concat' +drop table t1; +set names utf8mb4; +create table t1 (a varchar(10) character set latin1, b int) engine InnoDB; +insert into t1 values ('a',1); +select concat(a, if(b>10, 'x' 'x', 'y' 'y')) from t1; +concat(a, if(b>10, 'x' 'x', 'y' 'y')) +ayy +select concat(a, if(b>10, 'x' 'æ', 'y' 'ß')) from t1; +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,COERCIBLE) for operation 'concat' +drop table t1; +CREATE TABLE t1 ( +colA int(11) NOT NULL, +colB varchar(255) character set utf8mb4 NOT NULL, +PRIMARY KEY (colA) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 (colA, colB) VALUES (1, 'foo'), (2, 'foo bar'); +CREATE TABLE t2 ( +colA int(11) NOT NULL, +colB varchar(255) character set utf8mb4 NOT NULL, +KEY bad (colA,colB(3)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t2 (colA, colB) VALUES (1, 'foo'),(2, 'foo bar'); +SELECT * FROM t1 JOIN t2 ON t1.colA=t2.colA AND t1.colB=t2.colB +WHERE t1.colA < 3; +colA colB colA colB +1 foo 1 foo +2 foo bar 2 foo bar +DROP TABLE t1, t2; +SELECT 'н1234567890' UNION SELECT _binary '1'; +н1234567890 +н1234567890 +1 +SELECT 'н1234567890' UNION SELECT 1; +н1234567890 +н1234567890 +1 +SELECT '1' UNION SELECT 'н1234567890'; +1 +1 +н1234567890 +SELECT 1 UNION SELECT 'н1234567890'; +1 +1 +н1234567890 +CREATE TABLE t1 (c VARCHAR(11)) CHARACTER SET utf8mb4 ENGINE InnoDB; +CREATE TABLE t2 (b CHAR(1) CHARACTER SET binary, i INT) ENGINE InnoDB; +INSERT INTO t1 (c) VALUES ('н1234567890'); +INSERT INTO t2 (b, i) VALUES ('1', 1); +SELECT c FROM t1 UNION SELECT b FROM t2; +c +н1234567890 +1 +SELECT c FROM t1 UNION SELECT i FROM t2; +c +н1234567890 +1 +SELECT b FROM t2 UNION SELECT c FROM t1; +b +1 +н1234567890 +SELECT i FROM t2 UNION SELECT c FROM t1; +i +1 +н1234567890 +DROP TABLE t1, t2; +set sql_mode=traditional; +select hex(char(0xFF using utf8mb4)); +hex(char(0xFF using utf8mb4)) +NULL +Warnings: +Warning 1300 Invalid utf8mb4 character string: 'FF' +select hex(convert(0xFF using utf8mb4)); +hex(convert(0xFF using utf8mb4)) +NULL +Warnings: +Warning 1300 Invalid utf8mb4 character string: 'FF' +select hex(_utf8mb4 0x616263FF); +ERROR HY000: Invalid utf8mb4 character string: 'FF' +select hex(_utf8mb4 X'616263FF'); +ERROR HY000: Invalid utf8mb4 character string: 'FF' +select hex(_utf8mb4 B'001111111111'); +ERROR HY000: Invalid utf8mb4 character string: 'FF' +select (_utf8mb4 X'616263FF'); +ERROR HY000: Invalid utf8mb4 character string: 'FF' +set sql_mode=default; +select hex(char(0xFF using utf8mb4)); +hex(char(0xFF using utf8mb4)) +NULL +Warnings: +Warning 1300 Invalid utf8mb4 character string: 'FF' +select hex(convert(0xFF using utf8mb4)); +hex(convert(0xFF using utf8mb4)) +NULL +Warnings: +Warning 1300 Invalid utf8mb4 character string: 'FF' +select hex(_utf8mb4 0x616263FF); +ERROR HY000: Invalid utf8mb4 character string: 'FF' +select hex(_utf8mb4 X'616263FF'); +ERROR HY000: Invalid utf8mb4 character string: 'FF' +select hex(_utf8mb4 B'001111111111'); +ERROR HY000: Invalid utf8mb4 character string: 'FF' +select (_utf8mb4 X'616263FF'); +ERROR HY000: Invalid utf8mb4 character string: 'FF' +CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL) ENGINE InnoDB; +INSERT INTO t1 VALUES (70000, 1092), (70001, 1085), (70002, 1065); +SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b; +CONVERT(a, CHAR) CONVERT(b, CHAR) +70000 1092 +70001 1085 +70002 1065 +SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1; +CONVERT(a, CHAR) CONVERT(b, CHAR) +70000 1092 +70001 1085 +70002 1065 +ALTER TABLE t1 ADD UNIQUE (b); +SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b; +CONVERT(a, CHAR) CONVERT(b, CHAR) +70000 1092 +70001 1085 +70002 1065 +DROP INDEX b ON t1; +SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b; +CONVERT(a, CHAR) CONVERT(b, CHAR) +70000 1092 +70001 1085 +70002 1065 +ALTER TABLE t1 ADD INDEX (b); +SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) from t1 GROUP BY b; +CONVERT(a, CHAR) CONVERT(b, CHAR) +70000 1092 +70001 1085 +70002 1065 +DROP TABLE t1; +# +# Bug#26474: Add Sinhala script (Sri Lanka) collation to MySQL +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +predicted_order int NOT NULL, +utf8mb4_encoding VARCHAR(10) NOT NULL +) CHARACTER SET utf8mb4 ENGINE InnoDB; +INSERT INTO t1 VALUES (19, x'E0B696'), (30, x'E0B69AE0B798'), (61, x'E0B6AF'), (93, x'E0B799'), (52, x'E0B6A6'), (73, x'E0B6BBE0B78AE2808D'), (3, x'E0B686'), (56, x'E0B6AA'), (55, x'E0B6A9'), (70, x'E0B6B9'), (94, x'E0B79A'), (80, x'E0B785'), (25, x'E0B69AE0B791'), (48, x'E0B6A2'), (13, x'E0B690'), (86, x'E0B793'), (91, x'E0B79F'), (81, x'E0B786'), (79, x'E0B784'), (14, x'E0B691'), (99, x'E0B78A'), (8, x'E0B68B'), (68, x'E0B6B7'), (22, x'E0B69A'), (16, x'E0B693'), (33, x'E0B69AE0B7B3'), (38, x'E0B69AE0B79D'), (21, x'E0B683'), (11, x'E0B68E'), (77, x'E0B782'), (40, x'E0B69AE0B78A'), (101, x'E0B78AE2808DE0B6BB'), (35, x'E0B69AE0B79A'), (1, x'E0B7B4'), (9, x'E0B68C'), (96, x'E0B79C'), (6, x'E0B689'), (95, x'E0B79B'), (88, x'E0B796'), (64, x'E0B6B3'), (26, x'E0B69AE0B792'), (82, x'E0B78F'), (28, x'E0B69AE0B794'), (39, x'E0B69AE0B79E'), (97, x'E0B79D'), (2, x'E0B685'), (75, x'E0B780'), (34, x'E0B69AE0B799'), (69, x'E0B6B8'), (83, x'E0B790'), (18, x'E0B695'), (90, x'E0B7B2'), (17, x'E0B694'), (72, x'E0B6BB'), (66, x'E0B6B5'), (59, x'E0B6AD'), (44, x'E0B69E'), (15, x'E0B692'), (23, x'E0B69AE0B78F'), (65, x'E0B6B4'), (42, x'E0B69C'), (63, x'E0B6B1'), (85, x'E0B792'), (47, x'E0B6A1'), (49, x'E0B6A3'), (92, x'E0B7B3'), (78, x'E0B783'), (36, x'E0B69AE0B79B'), (4, x'E0B687'), (24, x'E0B69AE0B790'), (87, x'E0B794'), (37, x'E0B69AE0B79C'), (32, x'E0B69AE0B79F'), (29, x'E0B69AE0B796'), (43, x'E0B69D'), (62, x'E0B6B0'), (100, x'E0B78AE2808DE0B6BA'), (60, x'E0B6AE'), (45, x'E0B69F'), (12, x'E0B68F'), (46, x'E0B6A0'), (50, x'E0B6A5'), (51, x'E0B6A4'), (5, x'E0B688'), (76, x'E0B781'), (89, x'E0B798'), (74, x'E0B6BD'), (10, x'E0B68D'), (57, x'E0B6AB'), (71, x'E0B6BA'), (58, x'E0B6AC'), (27, x'E0B69AE0B793'), (54, x'E0B6A8'), (84, x'E0B791'), (31, x'E0B69AE0B7B2'), (98, x'E0B79E'), (53, x'E0B6A7'), (41, x'E0B69B'), (67, x'E0B6B6'), (7, x'E0B68A'), (20, x'E0B682'); +SELECT predicted_order, hex(utf8mb4_encoding) FROM t1 ORDER BY utf8mb4_encoding COLLATE utf8mb4_sinhala_ci; +predicted_order hex(utf8mb4_encoding) +1 E0B7B4 +2 E0B685 +3 E0B686 +4 E0B687 +5 E0B688 +6 E0B689 +7 E0B68A +8 E0B68B +9 E0B68C +10 E0B68D +11 E0B68E +12 E0B68F +13 E0B690 +14 E0B691 +15 E0B692 +16 E0B693 +17 E0B694 +18 E0B695 +19 E0B696 +20 E0B682 +21 E0B683 +22 E0B69A +23 E0B69AE0B78F +24 E0B69AE0B790 +25 E0B69AE0B791 +26 E0B69AE0B792 +27 E0B69AE0B793 +28 E0B69AE0B794 +29 E0B69AE0B796 +30 E0B69AE0B798 +31 E0B69AE0B7B2 +32 E0B69AE0B79F +33 E0B69AE0B7B3 +34 E0B69AE0B799 +35 E0B69AE0B79A +36 E0B69AE0B79B +37 E0B69AE0B79C +38 E0B69AE0B79D +39 E0B69AE0B79E +40 E0B69AE0B78A +41 E0B69B +42 E0B69C +43 E0B69D +44 E0B69E +45 E0B69F +46 E0B6A0 +47 E0B6A1 +48 E0B6A2 +49 E0B6A3 +50 E0B6A5 +51 E0B6A4 +52 E0B6A6 +53 E0B6A7 +54 E0B6A8 +55 E0B6A9 +56 E0B6AA +57 E0B6AB +58 E0B6AC +59 E0B6AD +60 E0B6AE +61 E0B6AF +62 E0B6B0 +63 E0B6B1 +64 E0B6B3 +65 E0B6B4 +66 E0B6B5 +67 E0B6B6 +68 E0B6B7 +69 E0B6B8 +70 E0B6B9 +71 E0B6BA +72 E0B6BB +73 E0B6BBE0B78AE2808D +74 E0B6BD +75 E0B780 +76 E0B781 +77 E0B782 +78 E0B783 +79 E0B784 +80 E0B785 +81 E0B786 +82 E0B78F +83 E0B790 +84 E0B791 +85 E0B792 +86 E0B793 +87 E0B794 +88 E0B796 +89 E0B798 +90 E0B7B2 +91 E0B79F +92 E0B7B3 +93 E0B799 +94 E0B79A +95 E0B79B +96 E0B79C +97 E0B79D +98 E0B79E +99 E0B78A +100 E0B78AE2808DE0B6BA +101 E0B78AE2808DE0B6BB +DROP TABLE t1; +# +# Bug#32914 Character sets: illegal characters in utf8mb4 and utf32 columns +# +create table t1 (utf8mb4 char(1) character set utf8mb4) engine InnoDB; +Testing [F0][90..BF][80..BF][80..BF] +insert into t1 values (0xF0908080); +insert into t1 values (0xF0BFBFBF); +insert ignore into t1 values (0xF08F8080); +Warnings: +Warning 1366 Incorrect string value: '\xF0\x8F\x80\x80' for column 'utf8mb4' at row 1 +select hex(utf8mb4) from t1; +hex(utf8mb4) + +F0908080 +F0BFBFBF +delete from t1; +Testing [F2..F3][80..BF][80..BF][80..BF] +insert into t1 values (0xF2808080); +insert into t1 values (0xF2BFBFBF); +select hex(utf8mb4) from t1; +hex(utf8mb4) +F2808080 +F2BFBFBF +delete from t1; +Testing [F4][80..8F][80..BF][80..BF] +insert into t1 values (0xF4808080); +insert into t1 values (0xF48F8080); +insert ignore into t1 values (0xF4908080); +Warnings: +Warning 1366 Incorrect string value: '\xF4\x90\x80\x80' for column 'utf8mb4' at row 1 +select hex(utf8mb4) from t1; +hex(utf8mb4) + +F4808080 +F48F8080 +drop table t1; +# +# Check strnxfrm() with odd length +# +set max_sort_length=5; +select @@max_sort_length; +@@max_sort_length +5 +create table t1 (a varchar(128) character set utf8mb4 collate utf8mb4_general_ci) engine InnoDB; +insert into t1 values ('a'),('b'),('c'); +select * from t1 order by a; +a +a +b +c +alter table t1 modify a varchar(128) character set utf8mb4 collate utf8mb4_bin; +select * from t1 order by a; +a +a +b +c +drop table t1; +set max_sort_length=default; +# +# Bug#26180: Can't add columns to tables created with utf8mb4 text indexes +# +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1 ( +clipid INT NOT NULL, +Tape TINYTEXT, +PRIMARY KEY (clipid), +KEY tape(Tape(255)) +) CHARACTER SET=utf8mb4 ROW_FORMAT=DYNAMIC ENGINE=InnoDB; +Warnings: +Warning 1071 Specified key was too long; max key length is 255 bytes +ALTER TABLE t1 ADD mos TINYINT DEFAULT 0 AFTER clipid; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `clipid` int NOT NULL, + `mos` tinyint DEFAULT '0', + `Tape` tinytext, + PRIMARY KEY (`clipid`), + KEY `tape` (`Tape`(63)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC +DROP TABLE t1; +SET sql_mode = default; +# +# Testing 4-byte values. +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +u_decimal int NOT NULL, +utf8mb4_encoding VARCHAR(10) NOT NULL +) CHARACTER SET utf8mb4 ENGINE InnoDB; +INSERT INTO t1 VALUES (119040, x'f09d8480'), +# G CLEF +(119070, x'f09d849e'), +# HALF NOTE +(119134, x'f09d859e'), +# MUSICAL SYMBOL CROIX +(119247, x'f09d878f'), +# MATHEMATICAL BOLD ITALIC CAPITAL DELTA +(120607, x'f09d9c9f'), +# SANS-SERIF BOLD ITALIC CAPITAL PI +(120735, x'f09d9e9f'), +# (last 4 byte character) +(1114111, x'f48fbfbf'), +# VARIATION SELECTOR-256 +(917999, x'f3a087af'); +INSERT INTO t1 VALUES (119070, x'f09d849ef09d859ef09d859ef09d8480f09d859ff09d859ff09d859ff09d85a0f09d85a0f09d8480'); +INSERT INTO t1 VALUES (65131, x'efb9abf09d849ef09d859ef09d859ef09d8480f09d859fefb9abefb9abf09d85a0efb9ab'); +INSERT IGNORE INTO t1 VALUES (119070, x'f09d849ef09d859ef09d859ef09d8480f09d859ff09d859ff09d859ff09d85a0f09d85a0f09d8480f09d85a0'); +Warnings: +Warning 1265 Data truncated for column 'utf8mb4_encoding' at row 1 +SELECT u_decimal, hex(utf8mb4_encoding) FROM t1 ORDER BY utf8mb4_encoding COLLATE utf8mb4_general_ci, BINARY utf8mb4_encoding; +u_decimal hex(utf8mb4_encoding) +1114111 F48FBFBF +119040 F09D8480 +119070 F09D849E +119070 F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480 +119070 F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480 +119134 F09D859E +119247 F09D878F +120607 F09D9C9F +120735 F09D9E9F +65131 EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9AB +917999 F3A087AF +INSERT IGNORE INTO t1 VALUES (1114111, x'f5808080'); +Warnings: +Warning 1366 Incorrect string value: '\xF5\x80\x80\x80' for column 'utf8mb4_encoding' at row 1 +SELECT character_maximum_length, character_octet_length FROM information_schema.columns WHERE +table_name= 't1' AND column_name= 'utf8mb4_encoding'; +CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH +10 40 +DROP TABLE IF EXISTS t2; +CREATE TABLE t2 ( +u_decimal int NOT NULL, +utf8mb3_encoding VARCHAR(10) NOT NULL +) CHARACTER SET utf8mb3 ENGINE InnoDB; +Warnings: +Warning 1287 'utf8mb3' is deprecated and will be removed in a future release. Please use utf8mb4 instead +INSERT INTO t2 VALUES (42856, x'ea9da8'); +INSERT INTO t2 VALUES (65131, x'efb9ab'); +INSERT IGNORE INTO t2 VALUES (1114111, x'f48fbfbf'); +Warnings: +Warning 1366 Incorrect string value: '\xF4\x8F\xBF\xBF' for column 'utf8mb3_encoding' at row 1 +SELECT character_maximum_length, character_octet_length FROM information_schema.columns WHERE +table_name= 't2' AND column_name= 'utf8mb3_encoding'; +CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH +10 30 +UPDATE IGNORE t2 SET utf8mb3_encoding= x'f48fbfbd' where u_decimal= 42856; +Warnings: +Warning 1366 Incorrect string value: '\xF4\x8F\xBF\xBD' for column 'utf8mb3_encoding' at row 1 +UPDATE t2 SET utf8mb3_encoding= _utf8mb4 x'ea9da8' where u_decimal= 42856; +SELECT HEX(CONCAT(utf8mb4_encoding, _utf8 x'ea9da8')) FROM t1; +HEX(CONCAT(utf8mb4_encoding, _utf8 x'ea9da8')) +EA9DA8 +EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9ABEA9DA8 +F09D8480EA9DA8 +F09D849EEA9DA8 +F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EA9DA8 +F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EA9DA8 +F09D859EEA9DA8 +F09D878FEA9DA8 +F09D9C9FEA9DA8 +F09D9E9FEA9DA8 +F3A087AFEA9DA8 +F48FBFBFEA9DA8 +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +Warnings: +SELECT HEX(CONCAT(utf8mb4_encoding, utf8mb3_encoding)) FROM t1,t2; +HEX(CONCAT(utf8mb4_encoding, utf8mb3_encoding)) + +EA9DA8 +EFB9AB +EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9AB +EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9ABEA9DA8 +EFB9ABF09D849EF09D859EF09D859EF09D8480F09D859FEFB9ABEFB9ABF09D85A0EFB9ABEFB9AB +F09D8480 +F09D8480EA9DA8 +F09D8480EFB9AB +F09D849E +F09D849EEA9DA8 +F09D849EEFB9AB +F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480 +F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480 +F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EA9DA8 +F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EA9DA8 +F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EFB9AB +F09D849EF09D859EF09D859EF09D8480F09D859FF09D859FF09D859FF09D85A0F09D85A0F09D8480EFB9AB +F09D859E +F09D859EEA9DA8 +F09D859EEFB9AB +F09D878F +F09D878FEA9DA8 +F09D878FEFB9AB +F09D9C9F +F09D9C9FEA9DA8 +F09D9C9FEFB9AB +F09D9E9F +F09D9E9FEA9DA8 +F09D9E9FEFB9AB +F3A087AF +F3A087AFEA9DA8 +F3A087AFEFB9AB +F48FBFBF +F48FBFBFEA9DA8 +F48FBFBFEFB9AB +SELECT count(*) FROM t1, t2 +WHERE t1.utf8mb4_encoding > t2.utf8mb3_encoding; +count(*) +23 +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +ALTER TABLE t1 CONVERT TO CHARACTER SET utf8; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `u_decimal` int NOT NULL, + `utf8mb4_encoding` varchar(10) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 +SELECT u_decimal,hex(utf8mb4_encoding),utf8mb4_encoding FROM t1; +u_decimal hex(utf8mb4_encoding) utf8mb4_encoding +1114111 +1114111 3F ? +119040 3F ? +119070 3F ? +119070 3F3F3F3F3F3F3F3F3F3F ?????????? +119070 3F3F3F3F3F3F3F3F3F3F ?????????? +119134 3F ? +119247 3F ? +120607 3F ? +120735 3F ? +65131 EFB9AB3F3F3F3F3FEFB9ABEFB9AB3FEFB9AB ﹫?????﹫﹫?﹫ +917999 3F ? +SET sql_mode = default; +ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb4; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `u_decimal` int NOT NULL, + `utf8mb3_encoding` varchar(10) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT u_decimal,hex(utf8mb3_encoding) FROM t2; +u_decimal hex(utf8mb3_encoding) +1114111 +42856 EA9DA8 +65131 EFB9AB +ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb3; +Warnings: +Warning 1287 'utf8mb3' is deprecated and will be removed in a future release. Please use utf8mb4 instead +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `u_decimal` int NOT NULL, + `utf8mb3_encoding` varchar(10) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 +SELECT u_decimal,hex(utf8mb3_encoding) FROM t2; +u_decimal hex(utf8mb3_encoding) +1114111 +42856 EA9DA8 +65131 EFB9AB +ALTER TABLE t1 MODIFY utf8mb4_encoding VARCHAR(10) CHARACTER SET utf8mb3; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `u_decimal` int NOT NULL, + `utf8mb4_encoding` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 +SELECT u_decimal,hex(utf8mb4_encoding) FROM t1; +u_decimal hex(utf8mb4_encoding) +1114111 +1114111 3F +119040 3F +119070 3F +119070 3F3F3F3F3F3F3F3F3F3F +119070 3F3F3F3F3F3F3F3F3F3F +119134 3F +119247 3F +120607 3F +120735 3F +65131 EFB9AB3F3F3F3F3FEFB9ABEFB9AB3FEFB9AB +917999 3F +ALTER TABLE t1 MODIFY utf8mb4_encoding VARCHAR(10) CHARACTER SET utf8mb4; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `u_decimal` int NOT NULL, + `utf8mb4_encoding` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 +SELECT u_decimal,hex(utf8mb4_encoding) FROM t1; +u_decimal hex(utf8mb4_encoding) +1114111 +1114111 3F +119040 3F +119070 3F +119070 3F3F3F3F3F3F3F3F3F3F +119070 3F3F3F3F3F3F3F3F3F3F +119134 3F +119247 3F +120607 3F +120735 3F +65131 EFB9AB3F3F3F3F3FEFB9ABEFB9AB3FEFB9AB +917999 3F +ALTER TABLE t2 MODIFY utf8mb3_encoding VARCHAR(10) CHARACTER SET utf8mb4; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `u_decimal` int NOT NULL, + `utf8mb3_encoding` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 +SELECT u_decimal,hex(utf8mb3_encoding) FROM t2; +u_decimal hex(utf8mb3_encoding) +1114111 +42856 EA9DA8 +65131 EFB9AB +DROP TABLE IF EXISTS t3; +CREATE TABLE t3 ( +u_decimal int NOT NULL, +utf8mb3_encoding VARCHAR(10) NOT NULL +) CHARACTER SET utf8 ENGINE InnoDB; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t3 SELECT * FROM t1; +DROP TABLE IF EXISTS t4; +CREATE TABLE t4 ( +u_decimal int NOT NULL, +utf8mb4_encoding VARCHAR(10) NOT NULL +) CHARACTER SET utf8mb4 ENGINE InnoDB; +INSERT INTO t3 SELECT * FROM t2; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; +# +# Testing that mixing utf8 and utf8mb4 collations returns utf8mb4 +# +SELECT CHARSET(CONCAT(_utf8mb4'a',_utf8'b')); +CHARSET(CONCAT(_utf8mb4'a',_utf8'b')) +utf8mb4 +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4 NOT NULL) ENGINE InnoDB; +INSERT INTO t1 VALUES (x'ea9da8'),(x'f48fbfbf'); +SELECT CONCAT(utf8mb4, _utf8 x'ea9da8') FROM t1 LIMIT 0; +CONCAT(utf8mb4, _utf8 x'ea9da8') +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +CREATE TABLE t2 (utf8mb3 VARCHAR(10) CHARACTER SET utf8mb3 NOT NULL) ENGINE InnoDB; +Warnings: +Warning 1287 'utf8mb3' is deprecated and will be removed in a future release. Please use utf8mb4 instead +INSERT INTO t2 VALUES (x'ea9da8'); +SELECT HEX(CONCAT(utf8mb4, utf8mb3)) FROM t1,t2 ORDER BY 1; +HEX(CONCAT(utf8mb4, utf8mb3)) +EA9DA8EA9DA8 +F48FBFBFEA9DA8 +SELECT CHARSET(CONCAT(utf8mb4, utf8mb3)) FROM t1, t2 LIMIT 1; +CHARSET(CONCAT(utf8mb4, utf8mb3)) +utf8mb4 +CREATE TEMPORARY TABLE t3 ENGINE InnoDB AS SELECT *, concat(utf8mb4,utf8mb3) FROM t1, t2; +SHOW CREATE TABLE t3; +Table Create Table +t3 CREATE TEMPORARY TABLE `t3` ( + `utf8mb4` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, + `utf8mb3` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `concat(utf8mb4,utf8mb3)` varchar(20) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +DROP TEMPORARY TABLE t3; +SELECT * FROM t1, t2 WHERE t1.utf8mb4 > t2.utf8mb3; +utf8mb4 utf8mb3 +􏿿 Ꝩ +SELECT * FROM t1, t2 WHERE t1.utf8mb4 = t2.utf8mb3; +utf8mb4 utf8mb3 +Ꝩ Ꝩ +SELECT * FROM t1, t2 WHERE t1.utf8mb4 < t2.utf8mb3; +utf8mb4 utf8mb3 +DROP TABLE t1; +DROP TABLE t2; +# +# Check that mixing utf8mb4 with an invalid utf8 constant returns error +# +CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4) ENGINE InnoDB; +INSERT INTO t1 VALUES (x'f48fbfbf'); +SELECT CONCAT(utf8mb4, _utf8 '') FROM t1; +ERROR HY000: Illegal mix of collations (utf8mb4_0900_ai_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation 'concat' +SELECT CONCAT('a', _utf8 '') FROM t1; +ERROR HY000: Illegal mix of collations (utf8mb4_0900_ai_ci,COERCIBLE) and (utf8_general_ci,COERCIBLE) for operation 'concat' +DROP TABLE t1; +# +# End of 5.5 tests +# +# +# End of tests +# +create table t1 (c varchar(30) character set utf8mb4, unique(c(10))) engine=innodb; +insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z'); +insert into t1 values ('aaaaaaaaaa'); +insert into t1 values ('aaaaaaaaaaa'); +ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 't1.c' +insert into t1 values ('aaaaaaaaaaaa'); +ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 't1.c' +insert into t1 values (repeat('b',20)); +select c c1 from t1 where c='1'; +c1 +1 +select c c2 from t1 where c='2'; +c2 +2 +select c c3 from t1 where c='3'; +c3 +3 +select c cx from t1 where c='x'; +cx +x +select c cy from t1 where c='y'; +cy +y +select c cz from t1 where c='z'; +cz +z +select c ca10 from t1 where c='aaaaaaaaaa'; +ca10 +aaaaaaaaaa +select c cb20 from t1 where c=repeat('b',20); +cb20 +bbbbbbbbbbbbbbbbbbbb +drop table t1; +create table t1 (c char(3) character set utf8mb4, unique (c(2))) engine=innodb; +insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z'); +insert into t1 values ('a'); +insert into t1 values ('aa'); +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'aa' for key 't1.c' +insert into t1 values ('b'); +insert into t1 values ('bb'); +insert into t1 values ('bbb'); +ERROR 23000: Duplicate entry 'bb' for key 't1.c' +insert into t1 values ('а'); +insert into t1 values ('аа'); +insert into t1 values ('ааа'); +ERROR 23000: Duplicate entry 'аа' for key 't1.c' +insert into t1 values ('б'); +insert into t1 values ('бб'); +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'бб' for key 't1.c' +insert into t1 values ('ꪪ'); +insert into t1 values ('ꪪꪪ'); +insert into t1 values ('ꪪꪪꪪ'); +ERROR 23000: Duplicate entry 'ꪪꪪ' for key 't1.c' +drop table t1; +create table t1 ( +c char(10) character set utf8mb4, +unique key a (c(1)) +) engine=innodb; +insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); +insert into t1 values ('aa'); +ERROR 23000: Duplicate entry 'a' for key 't1.a' +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'a' for key 't1.a' +insert into t1 values ('б'); +insert into t1 values ('бб'); +ERROR 23000: Duplicate entry 'б' for key 't1.a' +insert into t1 values ('ббб'); +ERROR 23000: Duplicate entry 'б' for key 't1.a' +select c as c_all from t1 order by c; +c_all +a +b +c +d +e +f +б +select c as c_a from t1 where c='a'; +c_a +a +select c as c_a from t1 where c='б'; +c_a +б +drop table t1; +create table t1 ( +c char(10) character set utf8mb4 collate utf8mb4_bin, +unique key a (c(1)) +) engine=innodb; +insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); +insert into t1 values ('aa'); +ERROR 23000: Duplicate entry 'a' for key 't1.a' +insert into t1 values ('aaa'); +ERROR 23000: Duplicate entry 'a' for key 't1.a' +insert into t1 values ('ñ'); +insert into t1 values ('ññ'); +ERROR 23000: Duplicate entry 'Ã' for key 't1.a' +insert into t1 values ('ñññ'); +ERROR 23000: Duplicate entry 'Ã' for key 't1.a' +select c as c_all from t1 order by c; +c_all +a +b +c +d +e +f +ñ +select c as c_a from t1 where c='a'; +c_a +a +select c as c_a from t1 where c='ñ'; +c_a +ñ +drop table t1; +create table t1 ( +str varchar(255) character set utf8mb4 not null, +key str (str(2)) +) engine=innodb; +INSERT INTO t1 VALUES ('str'); +INSERT INTO t1 VALUES ('str2'); +select * from t1 where str='str'; +str +str +drop table t1; +create table t1 ( +str varchar(255) character set utf8mb4 not null, +key str (str(2)) +) engine=innodb; +INSERT INTO t1 VALUES ('str'); +INSERT INTO t1 VALUES ('str2'); +select * from t1 where str='str'; +str +str +drop table t1; +SET NAMES utf8mb4; +CREATE TABLE t1 ( +subject varchar(255) character set utf8mb4 collate utf8mb4_unicode_ci, +p varchar(15) character set utf8mb4 +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES ('谷川俊二と申しますが、インターネット予約の会員登録をしましたところ、メールアドレスを間違えてしまい会員IDが受け取ることが出来ませんでした。間違えアドレスはtani-shun@n.vodafone.ne.jpを書き込みました。どうすればよいですか? その他、住所等は間違えありません。連絡ください。よろしくお願いします。m(__)m','040312-000057'); +INSERT INTO t1 VALUES ('aaa','bbb'); +SELECT length(subject) FROM t1; +length(subject) +432 +3 +SELECT length(subject) FROM t1 ORDER BY 1; +length(subject) +3 +432 +DROP TABLE t1; +set names utf8mb4; +create table t1 (a varchar(30) not null primary key) +engine=innodb default character set utf8mb4 collate utf8mb4_general_ci; +insert into t1 values ('あいうえおかきくけこさしすせそ'); +insert into t1 values ('さしすせそかきくけこあいうえお'); +select a as gci1 from t1 where a like 'さしすせそかきくけこあいうえお%'; +gci1 +さしすせそかきくけこあいうえお +select a as gci2 from t1 where a like 'あいうえおかきくけこさしすせそ'; +gci2 +あいうえおかきくけこさしすせそ +drop table t1; +set names utf8mb4; +create table t1 (a varchar(30) not null primary key) +engine=innodb default character set utf8mb4 collate utf8mb4_unicode_ci; +insert into t1 values ('あいうえおかきくけこさしすせそ'); +insert into t1 values ('さしすせそかきくけこあいうえお'); +select a as uci1 from t1 where a like 'さしすせそかきくけこあいうえお%'; +uci1 +さしすせそかきくけこあいうえお +select a as uci2 from t1 where a like 'あいうえおかきくけこさしすせそ'; +uci2 +あいうえおかきくけこさしすせそ +drop table t1; +set names utf8mb4; +create table t1 (a varchar(30) not null primary key) +engine=innodb default character set utf8mb4 collate utf8mb4_bin; +insert into t1 values ('あいうえおかきくけこさしすせそ'); +insert into t1 values ('さしすせそかきくけこあいうえお'); +select a as bin1 from t1 where a like 'さしすせそかきくけこあいうえお%'; +bin1 +さしすせそかきくけこあいうえお +select a as bin2 from t1 where a like 'あいうえおかきくけこさしすせそ'; +bin2 +あいうえおかきくけこさしすせそ +drop table t1; +set names utf8mb4; +create table t1 ( +a int primary key, +b varchar(6), +index b3(b(3)) +) engine=innodb character set=utf8mb4; +insert into t1 values(1,'foo'),(2,'foobar'); +select * from t1 where b like 'foob%'; +a b +2 foobar +alter table t1 engine=innodb; +select * from t1 where b like 'foob%'; +a b +2 foobar +drop table t1; +CREATE TABLE t1 ( +colA int(11) NOT NULL, +colB varchar(255) character set utf8mb4 NOT NULL, +PRIMARY KEY (colA) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t1 (colA, colB) VALUES (1, 'foo'), (2, 'foo bar'); +CREATE TABLE t2 ( +colA int(11) NOT NULL, +colB varchar(255) character set utf8mb4 NOT NULL, +KEY bad (colA,colB(3)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t2 (colA, colB) VALUES (1, 'foo'),(2, 'foo bar'); +SELECT * FROM t1 JOIN t2 ON t1.colA=t2.colA AND t1.colB=t2.colB +WHERE t1.colA < 3; +colA colB colA colB +1 foo 1 foo +2 foo bar 2 foo bar +DROP TABLE t1, t2; diff --git a/mysql-test/r/func_default.result-pq b/mysql-test/r/func_default.result-pq index e3aa47af2fab..62065bdd7217 100644 --- a/mysql-test/r/func_default.result-pq +++ b/mysql-test/r/func_default.result-pq @@ -9,8 +9,7 @@ default(str) default(strnull) default(intg) default(rel) def NULL 10 3.14 explain select default(str), default(strnull), default(intg), default(rel) from t1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL Warnings: Note 1003 /* select#1 */ select default(`test`.`t1`.`str`) AS `default(str)`,default(`test`.`t1`.`strnull`) AS `default(strnull)`,default(`test`.`t1`.`intg`) AS `default(intg)`,default(`test`.`t1`.`rel`) AS `default(rel)` from `test`.`t1` select * from t1 where str <> default(str); diff --git a/mysql-test/r/func_group.result-pq b/mysql-test/r/func_group.result-pq new file mode 100644 index 000000000000..b6d203e0d0e3 --- /dev/null +++ b/mysql-test/r/func_group.result-pq @@ -0,0 +1,2150 @@ +drop table if exists t1,t2; +set @sav_dpi= @@div_precision_increment; +set div_precision_increment= 5; +show variables like 'div_precision_increment'; +Variable_name Value +div_precision_increment 5 +create table t1 (grp int, a bigint unsigned, c char(10) not null); +insert into t1 values (1,1,"a"); +insert into t1 values (2,2,"b"); +insert into t1 values (2,3,"c"); +insert into t1 values (3,4,"E"); +insert into t1 values (3,5,"C"); +insert into t1 values (3,6,"D"); +select a,c,sum(a) from t1 group by a; +a c sum(a) +1 a 1 +2 b 2 +3 c 3 +4 E 4 +5 C 5 +6 D 6 +select a,c,sum(a) from t1 where a > 10 group by a; +a c sum(a) +select sum(a) from t1 where a > 10; +sum(a) +NULL +select a from t1 order by rand(10); +a +2 +6 +1 +3 +5 +4 +select distinct a from t1 order by rand(10); +a +2 +6 +1 +3 +5 +4 +select count(distinct a),count(distinct grp) from t1; +count(distinct a) count(distinct grp) +6 3 +insert into t1 values (null,null,''); +select count(distinct a),count(distinct grp) from t1; +count(distinct a) count(distinct grp) +6 3 +select sum(all a),count(all a),avg(all a),std(all a),variance(all a),bit_or(all a),bit_and(all a),min(all a),max(all a),min(all c),max(all c) from t1; +sum(all a) count(all a) avg(all a) std(all a) variance(all a) bit_or(all a) bit_and(all a) min(all a) max(all a) min(all c) max(all c) +21 6 3.50000 1.707825127659933 2.9166666666666665 7 0 1 6 E +select grp, sum(a),count(a),avg(a),std(a),variance(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1 group by grp; +grp sum(a) count(a) avg(a) std(a) variance(a) bit_or(a) bit_and(a) min(a) max(a) min(c) max(c) +1 1 1 1.00000 0 0 1 1 1 1 a a +2 5 2 2.50000 0.5 0.25 3 2 2 3 b c +3 15 3 5.00000 0.816496580927726 0.6666666666666666 7 4 4 6 C E +NULL NULL 0 NULL NULL NULL 0 18446744073709551615 NULL NULL +select grp, sum(a)+count(a)+avg(a)+std(a)+variance(a)+bit_or(a)+bit_and(a)+min(a)+max(a)+min(c)+max(c) as sum from t1 group by grp; +grp sum +1 7 +2 20.25 +3 45.48316324759439 +NULL NULL +create table t2 (grp int, a bigint unsigned, c char(10)); +insert into t2 select grp,max(a)+max(grp),max(c) from t1 group by grp; +replace into t2 select grp, a, c from t1 limit 2,1; +select * from t2; +grp a c +1 2 a +2 5 c +3 9 E +NULL NULL +2 3 c +drop table t1,t2; +CREATE TABLE t1 (id int(11),value1 float(10,2)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (1,0.00),(1,1.00), (1,2.00), (2,10.00), (2,11.00), (2,12.00); +CREATE TABLE t2 (id int(11),name char(20)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (1,'Set One'),(2,'Set Two'); +select id, avg(value1), std(value1), variance(value1) from t1 group by id; +id avg(value1) std(value1) variance(value1) +1 1.0000000 0.816496580927726 0.6666666666666666 +2 11.0000000 0.816496580927726 0.6666666666666666 +select name, avg(value1), std(value1), variance(value1) from t1, t2 where t1.id = t2.id group by t1.id; +name avg(value1) std(value1) variance(value1) +Set One 1.0000000 0.816496580927726 0.6666666666666666 +Set Two 11.0000000 0.816496580927726 0.6666666666666666 +drop table t1,t2; +create table t1 (id int not null); +create table t2 (id int not null,rating int null); +insert into t1 values(1),(2),(3); +insert into t2 values(1, 3),(2, NULL),(2, NULL),(3, 2),(3, NULL); +select t1.id, avg(rating) from t1 left join t2 on ( t1.id = t2.id ) group by t1.id; +id avg(rating) +1 3.00000 +2 NULL +3 2.00000 +select sql_small_result t2.id, avg(rating) from t2 group by t2.id; +id avg(rating) +1 3.00000 +2 NULL +3 2.00000 +select sql_big_result t2.id, avg(rating) from t2 group by t2.id; +id avg(rating) +1 3.00000 +2 NULL +3 2.00000 +select sql_small_result t2.id, avg(rating+0.0e0) from t2 group by t2.id; +id avg(rating+0.0e0) +1 3 +2 NULL +3 2 +select sql_big_result t2.id, avg(rating+0.0e0) from t2 group by t2.id; +id avg(rating+0.0e0) +1 3 +2 NULL +3 2 +drop table t1,t2; +create table t1 (a smallint(6) primary key, c char(10), b text); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (1,'1','1'); +INSERT INTO t1 VALUES (2,'2','2'); +INSERT INTO t1 VALUES (4,'4','4'); +select count(*) from t1; +count(*) +3 +select count(*) from t1 where a = 1; +count(*) +1 +select count(*) from t1 where a = 100; +count(*) +0 +select count(*) from t1 where a >= 10; +count(*) +0 +select count(a) from t1 where a = 1; +count(a) +1 +select count(a) from t1 where a = 100; +count(a) +0 +select count(a) from t1 where a >= 10; +count(a) +0 +select count(b) from t1 where b >= 2; +count(b) +2 +select count(b) from t1 where b >= 10; +count(b) +0 +select count(c) from t1 where c = 10; +count(c) +0 +drop table t1; +CREATE TABLE t1 (d DATETIME, i INT); +INSERT INTO t1 VALUES (NOW(), 1); +SELECT COUNT(i), i, COUNT(i)*i FROM t1 GROUP BY i; +COUNT(i) i COUNT(i)*i +1 1 1 +SELECT COUNT(i), (i+0), COUNT(i)*(i+0) FROM t1 GROUP BY i; +COUNT(i) (i+0) COUNT(i)*(i+0) +1 1 1 +DROP TABLE t1; +create table t1 ( +num float(5,2), +user char(20) +); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +insert into t1 values (10.3,'nem'),(20.53,'monty'),(30.23,'sinisa'); +insert into t1 values (30.13,'nem'),(20.98,'monty'),(10.45,'sinisa'); +insert into t1 values (5.2,'nem'),(8.64,'monty'),(11.12,'sinisa'); +select sum(num) from t1; +sum(num) +147.58 +select sum(num) from t1 group by user; +sum(num) +45.63 +50.15 +51.80 +drop table t1; +create table t1 (a1 int, a2 char(3), key k1(a1), key k2(a2)); +insert into t1 values(10,'aaa'), (10,null), (10,'bbb'), (20,'zzz'); +create table t2(a1 char(3), a2 int, a3 real, key k1(a1), key k2(a2, a1)); +analyze table t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +select * from t1; +a1 a2 +10 aaa +10 NULL +10 bbb +20 zzz +select min(a2) from t1; +min(a2) +aaa +select max(t1.a1), max(t2.a2) from t1, t2; +max(t1.a1) max(t2.a2) +NULL NULL +select max(t1.a1) from t1, t2; +max(t1.a1) +NULL +select max(t2.a2), max(t1.a1) from t1, t2; +max(t2.a2) max(t1.a1) +NULL NULL +explain select min(a2) from t1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a2`) AS `min(a2)` from `test`.`t1` +explain select max(t1.a1), max(t2.a2) from t1, t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No matching min/max row +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`a1`) AS `max(t1.a1)`,max(`test`.`t2`.`a2`) AS `max(t2.a2)` from `test`.`t1` join `test`.`t2` +insert into t2 values('AAA', 10, 0.5); +insert into t2 values('BBB', 20, 1.0); +select t1.a1, t1.a2, t2.a1, t2.a2 from t1,t2; +a1 a2 a1 a2 +10 NULL AAA 10 +10 NULL BBB 20 +10 aaa AAA 10 +10 aaa BBB 20 +10 bbb AAA 10 +10 bbb BBB 20 +20 zzz AAA 10 +20 zzz BBB 20 +select max(t1.a1), max(t2.a1) from t1, t2 where t2.a2=9; +max(t1.a1) max(t2.a1) +NULL NULL +select max(t2.a1), max(t1.a1) from t1, t2 where t2.a2=9; +max(t2.a1) max(t1.a1) +NULL NULL +select t1.a1, t1.a2, t2.a1, t2.a2 from t1 left outer join t2 on t1.a1=10; +a1 a2 a1 a2 +10 NULL AAA 10 +10 NULL BBB 20 +10 aaa AAA 10 +10 aaa BBB 20 +10 bbb AAA 10 +10 bbb BBB 20 +20 zzz NULL NULL +select max(t1.a2) from t1 left outer join t2 on t1.a1=10; +max(t1.a2) +zzz +select max(t2.a1) from t2 left outer join t1 on t2.a2=10 where t2.a2=20; +max(t2.a1) +BBB +select max(t2.a1) from t2 left outer join t1 on t2.a2=10 where t2.a2=10; +max(t2.a1) +AAA +select max(t2.a1) from t1 left outer join t2 on t1.a2=t2.a1 and 1=0 where t2.a1='AAA'; +max(t2.a1) +NULL +select max(t1.a2),max(t2.a1) from t1 left outer join t2 on t1.a1=10; +max(t1.a2) max(t2.a1) +zzz BBB +drop table t1,t2; +CREATE TABLE t1 (a int, b int); +select count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1; +count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) +0 NULL NULL NULL NULL NULL 18446744073709551615 0 +select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) +insert into t1 values (1,null); +select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) +1 0 NULL NULL NULL NULL NULL 18446744073709551615 0 +insert into t1 values (1,null); +insert into t1 values (2,null); +select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) +1 0 NULL NULL NULL NULL NULL 18446744073709551615 0 +2 0 NULL NULL NULL NULL NULL 18446744073709551615 0 +select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) +1 0 NULL NULL NULL NULL NULL 18446744073709551615 0 +2 0 NULL NULL NULL NULL NULL 18446744073709551615 0 +insert into t1 values (2,1); +select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) +1 0 NULL NULL NULL NULL NULL 18446744073709551615 0 +2 1 1 1.00000 0 1 1 1 1 +select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) +1 0 NULL NULL NULL NULL NULL 18446744073709551615 0 +2 1 1 1.00000 0 1 1 1 1 +insert into t1 values (3,1); +select a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b) from t1 group by a; +a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) +1 0 NULL NULL NULL NULL NULL 18446744073709551615 0 +2 1 1 1.00000 0 1 1 1 1 +3 1 1 1.00000 0 1 1 1 1 +select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b), bit_xor(b) from t1 group by a; +a count(b) sum(b) avg(b) std(b) min(b) max(b) bit_and(b) bit_or(b) bit_xor(b) +1 0 NULL NULL NULL NULL NULL 18446744073709551615 0 0 +2 1 1 1.00000 0 1 1 1 1 1 +3 1 1 1.00000 0 1 1 1 1 1 +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +explain select SQL_BIG_RESULT a,count(b), sum(b), avg(b), std(b), min(b), max(b), bit_and(b), bit_or(b), bit_xor(b) from t1 group by a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select sql_big_result `test`.`t1`.`a` AS `a`,count(`test`.`t1`.`b`) AS `count(b)`,sum(`test`.`t1`.`b`) AS `sum(b)`,avg(`test`.`t1`.`b`) AS `avg(b)`,std(`test`.`t1`.`b`) AS `std(b)`,min(`test`.`t1`.`b`) AS `min(b)`,max(`test`.`t1`.`b`) AS `max(b)`,bit_and(`test`.`t1`.`b`) AS `bit_and(b)`,bit_or(`test`.`t1`.`b`) AS `bit_or(b)`,bit_xor(`test`.`t1`.`b`) AS `bit_xor(b)` from `test`.`t1` group by `test`.`t1`.`a` +drop table t1; +create table t1 (col int); +insert into t1 values (-1), (-2), (-3); +select bit_and(col), bit_or(col) from t1; +bit_and(col) bit_or(col) +18446744073709551612 18446744073709551615 +select SQL_BIG_RESULT bit_and(col), bit_or(col) from t1 group by col; +bit_and(col) bit_or(col) +18446744073709551613 18446744073709551613 +18446744073709551614 18446744073709551614 +18446744073709551615 18446744073709551615 +drop table t1; +create table t1 (a int); +select avg(2) from t1; +avg(2) +NULL +drop table t1; +create table t1( +a1 char(3) primary key, +a2 smallint, +a3 char(3), +a4 real, +a5 date, +key k1(a2,a3), +key k2(a4,a1), +key k3(a5,a1) +); +create table t2( +a1 char(3) primary key, +a2 char(17), +a3 char(2), +a4 char(3), +key k1(a3, a2), +key k2(a4) +); +insert into t1 values('AME',0,'SEA',0.100,date'1942-02-19'); +insert into t1 values('HBR',1,'SEA',0.085,date'1948-03-05'); +insert into t1 values('BOT',2,'SEA',0.085,date'1951-11-29'); +insert into t1 values('BMC',3,'SEA',0.085,date'1958-09-08'); +insert into t1 values('TWU',0,'LAX',0.080,date'1969-10-05'); +insert into t1 values('BDL',0,'DEN',0.080,date'1960-11-27'); +insert into t1 values('DTX',1,'NYC',0.080,date'1961-05-04'); +insert into t1 values('PLS',1,'WDC',0.075,date'1949-01-02'); +insert into t1 values('ZAJ',2,'CHI',0.075,date'1960-06-15'); +insert into t1 values('VVV',2,'MIN',0.075,date'1959-06-28'); +insert into t1 values('GTM',3,'DAL',0.070,date'1977-09-23'); +insert into t1 values('SSJ',null,'CHI',null,date'1974-03-19'); +insert into t1 values('KKK',3,'ATL',null,null); +insert into t1 values('XXX',null,'MIN',null,null); +insert into t1 values('WWW',1,'LED',null,null); +insert into t2 values('TKF','Seattle','WA','AME'); +insert into t2 values('LCC','Los Angeles','CA','TWU'); +insert into t2 values('DEN','Denver','CO','BDL'); +insert into t2 values('SDC','San Diego','CA','TWU'); +insert into t2 values('NOL','New Orleans','LA','GTM'); +insert into t2 values('LAK','Los Angeles','CA','TWU'); +insert into t2 values('AAA','AAA','AA','AME'); +analyze table t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +select * from t1; +a1 a2 a3 a4 a5 +AME 0 SEA 0.1 1942-02-19 +BDL 0 DEN 0.08 1960-11-27 +BMC 3 SEA 0.085 1958-09-08 +BOT 2 SEA 0.085 1951-11-29 +DTX 1 NYC 0.08 1961-05-04 +GTM 3 DAL 0.07 1977-09-23 +HBR 1 SEA 0.085 1948-03-05 +KKK 3 ATL NULL NULL +PLS 1 WDC 0.075 1949-01-02 +SSJ NULL CHI NULL 1974-03-19 +TWU 0 LAX 0.08 1969-10-05 +VVV 2 MIN 0.075 1959-06-28 +WWW 1 LED NULL NULL +XXX NULL MIN NULL NULL +ZAJ 2 CHI 0.075 1960-06-15 +select * from t2; +a1 a2 a3 a4 +AAA AAA AA AME +DEN Denver CO BDL +LAK Los Angeles CA TWU +LCC Los Angeles CA TWU +NOL New Orleans LA GTM +SDC San Diego CA TWU +TKF Seattle WA AME +explain +select min(a1) from t1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a1`) AS `min(a1)` from `test`.`t1` +select min(a1) from t1; +min(a1) +AME +explain +select max(a4) from t1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`a4`) AS `max(a4)` from `test`.`t1` +select max(a4) from t1; +max(a4) +0.1 +explain +select min(a5), max(a5) from t1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a5`) AS `min(a5)`,max(`test`.`t1`.`a5`) AS `max(a5)` from `test`.`t1` +select min(a5), max(a5) from t1; +min(a5) max(a5) +1942-02-19 1977-09-23 +explain +select min(a3) from t1 where a2 = 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a3`) AS `min(a3)` from `test`.`t1` where multiple equal(2, `test`.`t1`.`a2`) +select min(a3) from t1 where a2 = 2; +min(a3) +CHI +explain +select min(a1), max(a1) from t1 where a4 = 0.080; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a1`) AS `min(a1)`,max(`test`.`t1`.`a1`) AS `max(a1)` from `test`.`t1` where (`test`.`t1`.`a4` = 0.08) +select min(a1), max(a1) from t1 where a4 = 0.080; +min(a1) max(a1) +BDL TWU +explain +select min(t1.a5), max(t2.a3) from t1, t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a5`) AS `min(t1.a5)`,max(`test`.`t2`.`a3`) AS `max(t2.a3)` from `test`.`t1` join `test`.`t2` +select min(t1.a5), max(t2.a3) from t1, t2; +min(t1.a5) max(t2.a3) +1942-02-19 WA +explain +select min(t1.a3), max(t2.a2) from t1, t2 where t1.a2 = 0 and t2.a3 = 'CA'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a3`) AS `min(t1.a3)`,max(`test`.`t2`.`a2`) AS `max(t2.a2)` from `test`.`t1` join `test`.`t2` where (multiple equal(0, `test`.`t1`.`a2`) and multiple equal('CA', `test`.`t2`.`a3`)) +select min(t1.a3), max(t2.a2) from t1, t2 where t1.a2 = 0 and t2.a3 = 'CA'; +min(t1.a3) max(t2.a2) +DEN San Diego +explain +select min(a1) from t1 where a1 > 'KKK'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a1`) AS `min(a1)` from `test`.`t1` where (`test`.`t1`.`a1` > 'KKK') +select min(a1) from t1 where a1 > 'KKK'; +min(a1) +PLS +explain +select min(a1) from t1 where a1 >= 'KKK'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a1`) AS `min(a1)` from `test`.`t1` where (`test`.`t1`.`a1` >= 'KKK') +select min(a1) from t1 where a1 >= 'KKK'; +min(a1) +KKK +explain +select max(a3) from t1 where a2 = 2 and a3 < 'SEA'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`a3`) AS `max(a3)` from `test`.`t1` where ((`test`.`t1`.`a3` < 'SEA') and multiple equal(2, `test`.`t1`.`a2`)) +select max(a3) from t1 where a2 = 2 and a3 < 'SEA'; +max(a3) +MIN +explain +select max(a5) from t1 where a5 < date'1970-01-01'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`a5`) AS `max(a5)` from `test`.`t1` where (`test`.`t1`.`a5` < DATE'1970-01-01') +select max(a5) from t1 where a5 < date'1970-01-01'; +max(a5) +1969-10-05 +explain +select max(a3) from t1 where a2 is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`a3`) AS `max(a3)` from `test`.`t1` where (`test`.`t1`.`a2` is null) +select max(a3) from t1 where a2 is null; +max(a3) +MIN +explain +select max(a3) from t1 where a2 = 0 and a3 between 'K' and 'Q'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`a3`) AS `max(a3)` from `test`.`t1` where ((`test`.`t1`.`a3` between 'K' and 'Q') and multiple equal(0, `test`.`t1`.`a2`)) +select max(a3) from t1 where a2 = 0 and a3 between 'K' and 'Q'; +max(a3) +LAX +explain +select min(a1), max(a1) from t1 where a1 between 'A' and 'P'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a1`) AS `min(a1)`,max(`test`.`t1`.`a1`) AS `max(a1)` from `test`.`t1` where (`test`.`t1`.`a1` between 'A' and 'P') +select min(a1), max(a1) from t1 where a1 between 'A' and 'P'; +min(a1) max(a1) +AME KKK +explain +select max(a3) from t1 where a3 < 'SEA' and a2 = 2 and a3 <= 'MIN'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`a3`) AS `max(a3)` from `test`.`t1` where ((`test`.`t1`.`a3` < 'SEA') and (`test`.`t1`.`a3` <= 'MIN') and multiple equal(2, `test`.`t1`.`a2`)) +select max(a3) from t1 where a3 < 'SEA' and a2 = 2 and a3 <= 'MIN'; +max(a3) +MIN +explain +select max(a3) from t1 where a3 = 'MIN' and a2 = 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`a3`) AS `max(a3)` from `test`.`t1` where (multiple equal('MIN', `test`.`t1`.`a3`) and multiple equal(2, `test`.`t1`.`a2`)) +select max(a3) from t1 where a3 = 'MIN' and a2 = 2; +max(a3) +MIN +explain +select max(a3) from t1 where a3 = 'DEN' and a2 = 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No matching min/max row +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`a3`) AS `max(a3)` from `test`.`t1` where (multiple equal('DEN', `test`.`t1`.`a3`) and multiple equal(2, `test`.`t1`.`a2`)) +select max(a3) from t1 where a3 = 'DEN' and a2 = 2; +max(a3) +NULL +explain +select max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 = 'CA'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`a3`) AS `max(t1.a3)`,min(`test`.`t2`.`a2`) AS `min(t2.a2)` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a3` < 'MIN') and multiple equal(2, `test`.`t1`.`a2`) and multiple equal('CA', `test`.`t2`.`a3`)) +select max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 = 'CA'; +max(t1.a3) min(t2.a2) +CHI Los Angeles +explain +select max(a3) from t1 where a2 is null and a2 = 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`a3`) AS `max(a3)` from `test`.`t1` where false +select max(a3) from t1 where a2 is null and a2 = 2; +max(a3) +NULL +explain +select max(a2) from t1 where a2 >= 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`a2`) AS `max(a2)` from `test`.`t1` where (`test`.`t1`.`a2` >= 1) +select max(a2) from t1 where a2 >= 1; +max(a2) +3 +explain +select min(a3) from t1 where a2 = 2 and a3 < 'SEA'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a3`) AS `min(a3)` from `test`.`t1` where ((`test`.`t1`.`a3` < 'SEA') and multiple equal(2, `test`.`t1`.`a2`)) +select min(a3) from t1 where a2 = 2 and a3 < 'SEA'; +min(a3) +CHI +explain +select min(a3) from t1 where a2 = 4; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No matching min/max row +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a3`) AS `min(a3)` from `test`.`t1` where multiple equal(4, `test`.`t1`.`a2`) +select min(a3) from t1 where a2 = 4; +min(a3) +NULL +explain +select min(a3) from t1 where a2 = 2 and a3 > 'SEA'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No matching min/max row +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a3`) AS `min(a3)` from `test`.`t1` where ((`test`.`t1`.`a3` > 'SEA') and multiple equal(2, `test`.`t1`.`a2`)) +select min(a3) from t1 where a2 = 2 and a3 > 'SEA'; +min(a3) +NULL +explain +select (min(a4)+max(a4))/2 from t1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select ((min(`test`.`t1`.`a4`) + max(`test`.`t1`.`a4`)) / 2) AS `(min(a4)+max(a4))/2` from `test`.`t1` +select (min(a4)+max(a4))/2 from t1; +(min(a4)+max(a4))/2 +0.085 +explain +select min(a3) from t1 where 2 = a2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a3`) AS `min(a3)` from `test`.`t1` where multiple equal(2, `test`.`t1`.`a2`) +select min(a3) from t1 where 2 = a2; +min(a3) +CHI +explain +select max(a3) from t1 where a2 = 2 and 'SEA' > a3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`a3`) AS `max(a3)` from `test`.`t1` where (('SEA' > `test`.`t1`.`a3`) and multiple equal(2, `test`.`t1`.`a2`)) +select max(a3) from t1 where a2 = 2 and 'SEA' > a3; +max(a3) +MIN +explain +select max(a3) from t1 where a2 = 2 and 'SEA' < a3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No matching min/max row +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`a3`) AS `max(a3)` from `test`.`t1` where (('SEA' < `test`.`t1`.`a3`) and multiple equal(2, `test`.`t1`.`a2`)) +select max(a3) from t1 where a2 = 2 and 'SEA' < a3; +max(a3) +NULL +explain +select min(a3) from t1 where a2 = 2 and a3 >= 'CHI'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a3`) AS `min(a3)` from `test`.`t1` where ((`test`.`t1`.`a3` >= 'CHI') and multiple equal(2, `test`.`t1`.`a2`)) +select min(a3) from t1 where a2 = 2 and a3 >= 'CHI'; +min(a3) +CHI +explain +select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 < 'SEA'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a3`) AS `min(a3)` from `test`.`t1` where ((`test`.`t1`.`a3` >= 'CHI') and (`test`.`t1`.`a3` < 'SEA') and multiple equal(2, `test`.`t1`.`a2`)) +select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 < 'SEA'; +min(a3) +CHI +explain +select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 = 'MIN'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a3`) AS `min(a3)` from `test`.`t1` where (multiple equal(2, `test`.`t1`.`a2`) and multiple equal('MIN', `test`.`t1`.`a3`)) +select min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 = 'MIN'; +min(a3) +MIN +explain +select min(a3) from t1 where a2 = 2 and a3 >= 'SEA' and a3 = 'MIN'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a3`) AS `min(a3)` from `test`.`t1` where false +select min(a3) from t1 where a2 = 2 and a3 >= 'SEA' and a3 = 'MIN'; +min(a3) +NULL +explain +select min(t1.a1), min(t2.a4) from t1,t2 where t1.a1 < 'KKK' and t2.a4 < 'KKK'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a1`) AS `min(t1.a1)`,min(`test`.`t2`.`a4`) AS `min(t2.a4)` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a1` < 'KKK') and (`test`.`t2`.`a4` < 'KKK')) +select min(t1.a1), min(t2.a4) from t1,t2 where t1.a1 < 'KKK' and t2.a4 < 'KKK'; +min(t1.a1) min(t2.a4) +AME AME +explain +select min(a1) from t1 where a1 > 'KKK' or a1 < 'XXX'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 15 55.55 Parallel execute (1 workers) +2 SIMPLE t1 NULL index PRIMARY k1 16 NULL 15 55.55 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a1`) AS `min(a1)` from `test`.`t1` where ((`test`.`t1`.`a1` > 'KKK') or (`test`.`t1`.`a1` < 'XXX')) +explain +select min(a1) from t1 where a1 != 'KKK'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 15 93.33 Parallel execute (1 workers) +2 SIMPLE t1 NULL index PRIMARY k1 16 NULL 15 93.33 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a1`) AS `min(a1)` from `test`.`t1` where (`test`.`t1`.`a1` <> 'KKK') +explain +select max(a3) from t1 where a2 < 2 and a3 < 'SEA'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 7 33.33 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k1 k1 3 NULL 7 33.33 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`a3`) AS `max(a3)` from `test`.`t1` where ((`test`.`t1`.`a2` < 2) and (`test`.`t1`.`a3` < 'SEA')) +explain +select max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 > 'CA'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k1 k1 16 NULL 1 100.00 Using where; Using index +2 SIMPLE t2 NULL range k1 k1 9 NULL 3 100.00 Using where; Using index; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`a3`) AS `max(t1.a3)`,min(`test`.`t2`.`a2`) AS `min(t2.a2)` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a2` = 2) and (`test`.`t1`.`a3` < 'MIN') and (`test`.`t2`.`a3` > 'CA')) +explain +select min(a4 - 0.01) from t1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 15 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index NULL k2 21 NULL 15 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select min((`test`.`t1`.`a4` - 0.01)) AS `min(a4 - 0.01)` from `test`.`t1` +explain +select max(a4 + 0.01) from t1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 15 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index NULL k2 21 NULL 15 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select max((`test`.`t1`.`a4` + 0.01)) AS `max(a4 + 0.01)` from `test`.`t1` +explain +select min(a3) from t1 where (a2 +1 ) is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 15 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index NULL k1 16 NULL 15 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a3`) AS `min(a3)` from `test`.`t1` where ((`test`.`t1`.`a2` + 1) is null) +explain +select min(a3) from t1 where (a2 + 1) = 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 15 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index NULL k1 16 NULL 15 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a3`) AS `min(a3)` from `test`.`t1` where ((`test`.`t1`.`a2` + 1) = 2) +explain +select min(a3) from t1 where 2 = (a2 + 1); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 15 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index NULL k1 16 NULL 15 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a3`) AS `min(a3)` from `test`.`t1` where (2 = (`test`.`t1`.`a2` + 1)) +explain +select min(a2) from t1 where a2 < 2 * a2 - 8; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 15 33.33 Parallel execute (1 workers) +2 SIMPLE t1 NULL index NULL k1 16 NULL 15 33.33 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a2`) AS `min(a2)` from `test`.`t1` where (`test`.`t1`.`a2` < ((2 * `test`.`t1`.`a2`) - 8)) +explain +select min(a1) from t1 where a1 between a3 and 'KKK'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 15 11.11 Parallel execute (1 workers) +2 SIMPLE t1 NULL index PRIMARY k1 16 NULL 15 11.11 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a1`) AS `min(a1)` from `test`.`t1` where (`test`.`t1`.`a1` between `test`.`t1`.`a3` and 'KKK') +explain +select min(a4) from t1 where (a4 + 0.01) between 0.07 and 0.08; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 15 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index NULL k2 21 NULL 15 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a4`) AS `min(a4)` from `test`.`t1` where ((`test`.`t1`.`a4` + 0.01) between 0.07 and 0.08) +explain +select concat(min(t1.a1),min(t2.a4)) from t1, t2 where t2.a4 <> 'AME'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 6 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL range k2 k2 13 NULL 6 100.00 Using where; Using index +2 SIMPLE t1 NULL index NULL k1 16 NULL 15 100.00 Using index; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select concat(min(`test`.`t1`.`a1`),min(`min(t2.a4)`)) AS `concat(min(t1.a1),min(t2.a4))` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`a4` <> 'AME') +drop table t1, t2; +create table t1 (a char(10)); +insert into t1 values ('a'),('b'),('c'); +select coercibility(max(a)) from t1; +coercibility(max(a)) +2 +drop table t1; +create table t1 (a char character set latin2); +insert into t1 values ('a'),('b'); +select charset(max(a)), coercibility(max(a)), +charset(min(a)), coercibility(min(a)) from t1; +charset(max(a)) coercibility(max(a)) charset(min(a)) coercibility(min(a)) +latin2 2 latin2 2 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(1) CHARACTER SET latin2 COLLATE latin2_general_ci DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +create table t2 select max(a),min(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `max(a)` char(1) CHARACTER SET latin2 DEFAULT NULL, + `min(a)` char(1) CHARACTER SET latin2 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t2; +create table t2 select concat(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `concat(a)` varchar(1) CHARACTER SET latin2 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t2,t1; +create table t1 (a int); +insert into t1 values (1); +select max(a) as b from t1 having b=1; +b +1 +select a from t1 having a=1; +a +1 +drop table t1; +create table t1 (a int); +select variance(2) from t1; +variance(2) +NULL +select stddev(2) from t1; +stddev(2) +NULL +drop table t1; +create table t1 (a int); +insert into t1 values (1),(2); +prepare stmt1 from 'SELECT COUNT(*) FROM t1'; +execute stmt1; +COUNT(*) +2 +execute stmt1; +COUNT(*) +2 +execute stmt1; +COUNT(*) +2 +deallocate prepare stmt1; +drop table t1; +create table t1 (a int, primary key(a)); +insert into t1 values (1),(2); +prepare stmt1 from 'SELECT max(a) FROM t1'; +execute stmt1; +max(a) +2 +execute stmt1; +max(a) +2 +execute stmt1; +max(a) +2 +deallocate prepare stmt1; +drop table t1; +CREATE TABLE t1 (a int primary key); +INSERT INTO t1 VALUES (1),(2),(3),(4); +SELECT MAX(a) FROM t1 WHERE a > 5; +MAX(a) +NULL +SELECT MIN(a) FROM t1 WHERE a < 0; +MIN(a) +NULL +DROP TABLE t1; +CREATE TABLE t1 ( +id int(10) unsigned NOT NULL auto_increment, +val enum('one','two','three') NOT NULL default 'one', +PRIMARY KEY (id) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES +(1,'one'),(2,'two'),(3,'three'),(4,'one'),(5,'two'); +select val, count(*) from t1 group by val; +val count(*) +one 2 +two 2 +three 1 +drop table t1; +CREATE TABLE t1 ( +id int(10) unsigned NOT NULL auto_increment, +val set('one','two','three') NOT NULL default 'one', +PRIMARY KEY (id) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +INSERT INTO t1 VALUES +(1,'one'),(2,'two'),(3,'three'),(4,'one'),(5,'two'); +select val, count(*) from t1 group by val; +val count(*) +one 2 +two 2 +three 1 +drop table t1; +create table t1(a int, b datetime); +insert into t1 values (1, NOW()), (2, NOW()); +create table t2 select MAX(b) from t1 group by a; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `MAX(b)` datetime DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1, t2; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +create table t1(f1 datetime); +insert into t1 values (now()); +create table t2 select f2 from (select max(now()) f2 from t1) a; +show columns from t2; +Field Type Null Key Default Extra +f2 datetime YES NULL +drop table t2; +create table t2 select f2 from (select now() f2 from t1) a; +show columns from t2; +Field Type Null Key Default Extra +f2 datetime NO 0000-00-00 00:00:00 +drop table t2, t1; +SET sql_mode = default; +CREATE TABLE t1( +id int PRIMARY KEY, +a int, +b int, +INDEX i_b_id(a,b,id), +INDEX i_id(a,id) +); +INSERT INTO t1 VALUES +(1,1,4), (2,2,1), (3,1,3), (4,2,1), (5,1,1); +SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6; +MAX(id) +NULL +DROP TABLE t1; +CREATE TABLE t1( +id int PRIMARY KEY, +a int, +b int, +INDEX i_id(a,id), +INDEX i_b_id(a,b,id) +); +INSERT INTO t1 VALUES +(1,1,4), (2,2,1), (3,1,3), (4,2,1), (5,1,1); +SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6; +MAX(id) +NULL +DROP TABLE t1; +CREATE TABLE t1 (id int PRIMARY KEY, b char(3), INDEX(b)); +INSERT INTO t1 VALUES (1,'xx'), (2,'aa'); +SELECT * FROM t1; +id b +1 xx +2 aa +SELECT MAX(b) FROM t1 WHERE b < 'ppppp'; +MAX(b) +aa +SHOW WARNINGS; +Level Code Message +SELECT MAX(b) FROM t1 WHERE b < 'pp'; +MAX(b) +aa +DROP TABLE t1; +CREATE TABLE t1 (id int PRIMARY KEY, b char(16), INDEX(b(4))); +INSERT INTO t1 VALUES (1, 'xxxxbbbb'), (2, 'xxxxaaaa'); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SELECT MAX(b) FROM t1; +MAX(b) +xxxxbbbb +EXPLAIN SELECT MAX(b) FROM t1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`b`) AS `MAX(b)` from `test`.`t1` +DROP TABLE t1; +CREATE TABLE t1 (id int , b varchar(512), INDEX(b(250))) COLLATE latin1_bin; +INSERT INTO t1 VALUES +(1,CONCAT(REPEAT('_', 250), "qq")), (1,CONCAT(REPEAT('_', 250), "zz")), +(1,CONCAT(REPEAT('_', 250), "aa")), (1,CONCAT(REPEAT('_', 250), "ff")); +SELECT MAX(b) FROM t1; +MAX(b) +__________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________zz +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT MAX(b) FROM t1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 4 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`b`) AS `MAX(b)` from `test`.`t1` +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +INSERT INTO t1 VALUES (1,1),(1,2),(2,3); +SELECT (SELECT COUNT(DISTINCT t1.b)) FROM t1 GROUP BY t1.a; +(SELECT COUNT(DISTINCT t1.b)) +2 +1 +SELECT (SELECT COUNT(DISTINCT 12)) FROM t1 GROUP BY t1.a; +(SELECT COUNT(DISTINCT 12)) +1 +1 +SELECT AVG(2), BIT_AND(2), BIT_OR(2), BIT_XOR(2), COUNT(*), COUNT(12), +COUNT(DISTINCT 12), MIN(2),MAX(2),STD(2), VARIANCE(2),SUM(2), +GROUP_CONCAT(2),GROUP_CONCAT(DISTINCT 2); +AVG(2) BIT_AND(2) BIT_OR(2) BIT_XOR(2) COUNT(*) COUNT(12) COUNT(DISTINCT 12) MIN(2) MAX(2) STD(2) VARIANCE(2) SUM(2) GROUP_CONCAT(2) GROUP_CONCAT(DISTINCT 2) +2.00000 2 2 2 1 1 1 2 2 0 0 2 2 2 +DROP TABLE t1; +create table t2 (ff double); +insert into t2 values (2.2); +select cast(sum(distinct ff) as decimal(5,2)) from t2; +cast(sum(distinct ff) as decimal(5,2)) +2.20 +select cast(sum(distinct ff) as signed) from t2; +cast(sum(distinct ff) as signed) +2 +select cast(variance(ff) as decimal(10,3)) from t2; +cast(variance(ff) as decimal(10,3)) +0.000 +select cast(min(ff) as decimal(5,2)) from t2; +cast(min(ff) as decimal(5,2)) +2.20 +create table t1 (df decimal(5,1)); +insert into t1 values(1.1); +insert into t1 values(2.2); +select cast(sum(distinct df) as signed) from t1; +cast(sum(distinct df) as signed) +3 +select cast(min(df) as signed) from t1; +cast(min(df) as signed) +1 +select 1e8 * sum(distinct df) from t1; +1e8 * sum(distinct df) +330000000 +select 1e8 * min(df) from t1; +1e8 * min(df) +110000000.00000001 +create table t3 (ifl int); +insert into t3 values(1), (2); +select cast(min(ifl) as decimal(5,2)) from t3; +cast(min(ifl) as decimal(5,2)) +1.00 +drop table t1, t2, t3; +CREATE TABLE t1 (id int(11),value1 float(10,2)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (1,0.00),(1,1.00), (1,2.00), (2,10.00), (2,11.00), (2,12.00), (2,13.00); +select id, stddev_pop(value1), var_pop(value1), stddev_samp(value1), var_samp(value1) from t1 group by id; +id stddev_pop(value1) var_pop(value1) stddev_samp(value1) var_samp(value1) +1 0.816496580927726 0.6666666666666666 1 1 +2 1.118033988749895 1.25 1.2909944487358056 1.6666666666666667 +DROP TABLE t1; +CREATE TABLE t1 (col1 decimal(16,12)); +INSERT INTO t1 VALUES (-5.00000000001),(-5.00000000002),(-5.00000000003),(-5.00000000000),(-5.00000000001),(-5.00000000002); +insert into t1 select * from t1; +select col1,count(col1),sum(col1),avg(col1) from t1 group by col1; +col1 count(col1) sum(col1) avg(col1) +-5.000000000000 2 -10.000000000000 -5.00000000000000000 +-5.000000000010 4 -20.000000000040 -5.00000000001000000 +-5.000000000020 4 -20.000000000080 -5.00000000002000000 +-5.000000000030 2 -10.000000000060 -5.00000000003000000 +DROP TABLE t1; +create table t1 (col1 decimal(16,12)); +insert into t1 values (-5.00000000001); +insert into t1 values (-5.00000000001); +select col1,sum(col1),max(col1),min(col1) from t1 group by col1; +col1 sum(col1) max(col1) min(col1) +-5.000000000010 -10.000000000020 -5.000000000010 -5.000000000010 +delete from t1; +insert into t1 values (5.00000000001); +insert into t1 values (5.00000000001); +select col1,sum(col1),max(col1),min(col1) from t1 group by col1; +col1 sum(col1) max(col1) min(col1) +5.000000000010 10.000000000020 5.000000000010 5.000000000010 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(400)) charset latin1; +INSERT INTO t1 (a) VALUES ("A"), ("a"), ("a "), ("a "), +("B"), ("b"), ("b "), ("b "); +SELECT COUNT(DISTINCT a) FROM t1; +COUNT(DISTINCT a) +2 +DROP TABLE t1; +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 (a, b, c) VALUES +(1,1,1), (1,1,2), (1,1,3), +(1,2,1), (1,2,2), (1,2,3), +(1,3,1), (1,3,2), (1,3,3), +(2,1,1), (2,1,2), (2,1,3), +(2,2,1), (2,2,2), (2,2,3), +(2,3,1), (2,3,2), (2,3,3), +(3,1,1), (3,1,2), (3,1,3), +(3,2,1), (3,2,2), (3,2,3), +(3,3,1), (3,3,2), (3,3,3); +SELECT b/c as v, a FROM t1 ORDER BY v, a; +v a +0.33333 1 +0.33333 2 +0.33333 3 +0.50000 1 +0.50000 2 +0.50000 3 +0.66667 1 +0.66667 2 +0.66667 3 +1.00000 1 +1.00000 1 +1.00000 1 +1.00000 2 +1.00000 2 +1.00000 2 +1.00000 3 +1.00000 3 +1.00000 3 +1.50000 1 +1.50000 2 +1.50000 3 +2.00000 1 +2.00000 2 +2.00000 3 +3.00000 1 +3.00000 2 +3.00000 3 +SELECT b/c as v, SUM(a) FROM t1 GROUP BY v; +v SUM(a) +0.33333 6 +0.50000 6 +0.66667 6 +1.00000 18 +1.50000 6 +2.00000 6 +3.00000 6 +SELECT SUM(a) FROM t1 GROUP BY b/c; +SUM(a) +18 +6 +6 +6 +6 +6 +6 +DROP TABLE t1; +set div_precision_increment= @sav_dpi; +CREATE TABLE t1 (a INT PRIMARY KEY, b INT); +INSERT INTO t1 VALUES (1,1), (2,2); +CREATE TABLE t2 (a INT PRIMARY KEY, b INT); +INSERT INTO t2 VALUES (1,1), (3,3); +SELECT +(SELECT SUM(c.a) FROM t1 ttt, t2 ccc +WHERE ttt.a = ccc.b AND ttt.a = t.a GROUP BY ttt.a) AS minid +FROM t1 t, t2 c WHERE t.a = c.b; +minid +1 +DROP TABLE t1,t2; +create table t1 select variance(0); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `variance(0)` double DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +create table t1 select stddev(0); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `stddev(0)` double DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +create table bug22555 (i smallint primary key auto_increment, s1 smallint, s2 smallint, e decimal(30,10), o double); +insert into bug22555 (s1, s2, e, o) values (53, 78, 11.4276528, 6.828112), (17, 78, 5.916793, 1.8502951), (18, 76, 2.679231, 9.17975591), (31, 62, 6.07831, 0.1), (19, 41, 5.37463, 15.1), (83, 73, 14.567426, 7.959222), (92, 53, 6.10151, 13.1856852), (7, 12, 13.92272, 3.442007), (92, 35, 11.95358909, 6.01376678), (38, 84, 2.572, 7.904571); +select std(s1/s2) from bug22555 group by i; +std(s1/s2) +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +select std(e) from bug22555 group by i; +std(e) +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +select std(o) from bug22555 group by i; +std(o) +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +drop table bug22555; +create table bug22555 (i smallint, s1 smallint, s2 smallint, o1 double, o2 double, e1 decimal, e2 decimal); +insert into bug22555 values (1,53,78,53,78,53,78),(2,17,78,17,78,17,78),(3,18,76,18,76,18,76); +select i, count(*) from bug22555 group by i; +i count(*) +1 1 +2 1 +3 1 +select std(s1/s2) from bug22555 where i=1; +std(s1/s2) +0 +select std(s1/s2) from bug22555 where i=2; +std(s1/s2) +0 +select std(s1/s2) from bug22555 where i=3; +std(s1/s2) +0 +select std(s1/s2) from bug22555 where i=1 group by i; +std(s1/s2) +0 +select std(s1/s2) from bug22555 where i=2 group by i; +std(s1/s2) +0 +select std(s1/s2) from bug22555 where i=3 group by i; +std(s1/s2) +0 +select std(s1/s2) from bug22555 group by i order by i; +std(s1/s2) +0 +0 +0 +select i, count(*), std(o1/o2) from bug22555 group by i order by i; +i count(*) std(o1/o2) +1 1 0 +2 1 0 +3 1 0 +select i, count(*), std(e1/e2) from bug22555 group by i order by i; +i count(*) std(e1/e2) +1 1 0 +2 1 0 +3 1 0 +set @saved_div_precision_increment=@@div_precision_increment; +set div_precision_increment=19; +select i, count(*), variance(s1/s2) from bug22555 group by i order by i; +i count(*) variance(s1/s2) +1 1 0 +2 1 0 +3 1 0 +select i, count(*), variance(o1/o2) from bug22555 group by i order by i; +i count(*) variance(o1/o2) +1 1 0 +2 1 0 +3 1 0 +select i, count(*), variance(e1/e2) from bug22555 group by i order by i; +i count(*) variance(e1/e2) +1 1 0 +2 1 0 +3 1 0 +select i, count(*), std(s1/s2) from bug22555 group by i order by i; +i count(*) std(s1/s2) +1 1 0 +2 1 0 +3 1 0 +select i, count(*), std(o1/o2) from bug22555 group by i order by i; +i count(*) std(o1/o2) +1 1 0 +2 1 0 +3 1 0 +select i, count(*), std(e1/e2) from bug22555 group by i order by i; +i count(*) std(e1/e2) +1 1 0 +2 1 0 +3 1 0 +set div_precision_increment=20; +select i, count(*), variance(s1/s2) from bug22555 group by i order by i; +i count(*) variance(s1/s2) +1 1 0 +2 1 0 +3 1 0 +select i, count(*), variance(o1/o2) from bug22555 group by i order by i; +i count(*) variance(o1/o2) +1 1 0 +2 1 0 +3 1 0 +select i, count(*), variance(e1/e2) from bug22555 group by i order by i; +i count(*) variance(e1/e2) +1 1 0 +2 1 0 +3 1 0 +select i, count(*), std(s1/s2) from bug22555 group by i order by i; +i count(*) std(s1/s2) +1 1 0 +2 1 0 +3 1 0 +select i, count(*), std(o1/o2) from bug22555 group by i order by i; +i count(*) std(o1/o2) +1 1 0 +2 1 0 +3 1 0 +select i, count(*), std(e1/e2) from bug22555 group by i order by i; +i count(*) std(e1/e2) +1 1 0 +2 1 0 +3 1 0 +set @@div_precision_increment=@saved_div_precision_increment; +insert into bug22555 values (1,53,78,53,78,53,78),(2,17,78,17,78,17,78),(3,18,76,18,76,18,76); +insert into bug22555 values (1,53,78,53,78,53,78),(2,17,78,17,78,17,78),(3,18,76,18,76,18,76); +insert into bug22555 values (1,53,78,53,78,53,78),(2,17,78,17,78,17,78),(3,18,76,18,76,18,76); +select i, count(*), std(s1/s2) from bug22555 group by i order by i; +i count(*) std(s1/s2) +1 4 0 +2 4 0 +3 4 0 +select i, count(*), round(std(o1/o2), 16) from bug22555 group by i order by i; +i count(*) round(std(o1/o2), 16) +1 4 0 +2 4 0 +3 4 0 +select i, count(*), std(e1/e2) from bug22555 group by i order by i; +i count(*) std(e1/e2) +1 4 0 +2 4 0 +3 4 0 +select std(s1/s2) from bug22555; +std(s1/s2) +0.21325763593256278 +select std(o1/o2) from bug22555; +std(o1/o2) +0.2132576358664934 +select std(e1/e2) from bug22555; +std(e1/e2) +0.21325763593256278 +set @saved_div_precision_increment=@@div_precision_increment; +set div_precision_increment=19; +select i, count(*), std(s1/s2) from bug22555 group by i order by i; +i count(*) std(s1/s2) +1 4 0 +2 4 0 +3 4 0 +select i, count(*), round(std(o1/o2), 16) from bug22555 group by i order by i; +i count(*) round(std(o1/o2), 16) +1 4 0 +2 4 0 +3 4 0 +select i, count(*), std(e1/e2) from bug22555 group by i order by i; +i count(*) std(e1/e2) +1 4 0 +2 4 0 +3 4 0 +select round(std(s1/s2), 17) from bug22555; +round(std(s1/s2), 17) +0.2132576358664934 +select std(o1/o2) from bug22555; +std(o1/o2) +0.2132576358664934 +select round(std(e1/e2), 17) from bug22555; +round(std(e1/e2), 17) +0.2132576358664934 +set div_precision_increment=20; +select i, count(*), std(s1/s2) from bug22555 group by i order by i; +i count(*) std(s1/s2) +1 4 0 +2 4 0 +3 4 0 +select i, count(*), round(std(o1/o2), 16) from bug22555 group by i order by i; +i count(*) round(std(o1/o2), 16) +1 4 0 +2 4 0 +3 4 0 +select i, count(*), std(e1/e2) from bug22555 group by i order by i; +i count(*) std(e1/e2) +1 4 0 +2 4 0 +3 4 0 +select round(std(s1/s2), 17) from bug22555; +round(std(s1/s2), 17) +0.2132576358664934 +select std(o1/o2) from bug22555; +std(o1/o2) +0.2132576358664934 +select round(std(e1/e2), 17) from bug22555; +round(std(e1/e2), 17) +0.2132576358664934 +set @@div_precision_increment=@saved_div_precision_increment; +drop table bug22555; +create table bug22555 (s smallint, o double, e decimal); +insert into bug22555 values (1,1,1),(2,2,2),(3,3,3),(6,6,6),(7,7,7); +select var_samp(s), var_pop(s) from bug22555; +var_samp(s) var_pop(s) +6.7 5.36 +select var_samp(o), var_pop(o) from bug22555; +var_samp(o) var_pop(o) +6.7 5.36 +select var_samp(e), var_pop(e) from bug22555; +var_samp(e) var_pop(e) +6.7 5.36 +drop table bug22555; +create table bug22555 (s smallint, o double, e decimal); +insert into bug22555 values (null,null,null),(null,null,null); +select var_samp(s) as 'null', var_pop(s) as 'null' from bug22555; +null null +NULL NULL +select var_samp(o) as 'null', var_pop(o) as 'null' from bug22555; +null null +NULL NULL +select var_samp(e) as 'null', var_pop(e) as 'null' from bug22555; +null null +NULL NULL +insert into bug22555 values (1,1,1); +select var_samp(s) as 'null', var_pop(s) as '0' from bug22555; +null 0 +NULL 0 +select var_samp(o) as 'null', var_pop(o) as '0' from bug22555; +null 0 +NULL 0 +select var_samp(e) as 'null', var_pop(e) as '0' from bug22555; +null 0 +NULL 0 +insert into bug22555 values (2,2,2); +select var_samp(s) as '0.5', var_pop(s) as '0.25' from bug22555; +0.5 0.25 +0.5 0.25 +select var_samp(o) as '0.5', var_pop(o) as '0.25' from bug22555; +0.5 0.25 +0.5 0.25 +select var_samp(e) as '0.5', var_pop(e) as '0.25' from bug22555; +0.5 0.25 +0.5 0.25 +drop table bug22555; +create table t1 (a decimal(20)); +insert into t1 values (12345678901234567890); +select count(a) from t1; +count(a) +1 +select count(distinct a) from t1; +count(distinct a) +1 +drop table t1; +CREATE TABLE t1 (a INT, b INT); +INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8); +INSERT INTO t1 SELECT a, b+8 FROM t1; +INSERT INTO t1 SELECT a, b+16 FROM t1; +INSERT INTO t1 SELECT a, b+32 FROM t1; +INSERT INTO t1 SELECT a, b+64 FROM t1; +INSERT INTO t1 SELECT a, b+128 FROM t1; +INSERT INTO t1 SELECT a, b+256 FROM t1; +INSERT INTO t1 SELECT a, b+512 FROM t1; +INSERT INTO t1 SELECT a, b+1024 FROM t1; +INSERT INTO t1 SELECT a, b+2048 FROM t1; +INSERT INTO t1 SELECT a, b+4096 FROM t1; +INSERT INTO t1 SELECT a, b+8192 FROM t1; +INSERT INTO t1 SELECT a, b+16384 FROM t1; +INSERT INTO t1 SELECT a, b+32768 FROM t1; +SELECT a,COUNT(DISTINCT b) AS cnt FROM t1 GROUP BY a HAVING cnt > 50; +a cnt +1 65536 +SELECT a,SUM(DISTINCT b) AS sumation FROM t1 GROUP BY a HAVING sumation > 50; +a sumation +1 2147516416 +SELECT a,AVG(DISTINCT b) AS average FROM t1 GROUP BY a HAVING average > 50; +a average +1 32768.5000 +DROP TABLE t1; +CREATE TABLE t1 ( a INT, b INT, KEY(a) ); +INSERT INTO t1 VALUES (NULL, 1), (NULL, 2); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT MIN(a), MIN(b) FROM t1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`a`) AS `MIN(a)`,min(`test`.`t1`.`b`) AS `MIN(b)` from `test`.`t1` +SELECT MIN(a), MIN(b) FROM t1; +MIN(a) MIN(b) +NULL 1 +CREATE TABLE t2( a INT, b INT, c INT, KEY(a, b) ); +INSERT INTO t2 ( a, b, c ) VALUES ( 1, NULL, 2 ), ( 1, 3, 4 ), ( 1, 4, 4 ); +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +EXPLAIN SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref a a 5 const 3 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t2`.`b`) AS `MIN(b)`,min(`test`.`t2`.`c`) AS `MIN(c)` from `test`.`t2` where (`test`.`t2`.`a` = 1) +SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1; +MIN(b) MIN(c) +3 2 +CREATE TABLE t3 (a INT, b INT, c int, KEY(a, b)); +INSERT INTO t3 VALUES (1, NULL, 1), (2, NULL, 2), (2, NULL, 2), (3, NULL, 3); +ANALYZE TABLE t3; +Table Op Msg_type Msg_text +test.t3 analyze status OK +EXPLAIN SELECT MIN(a), MIN(b) FROM t3 where a = 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t3`.`a`) AS `MIN(a)`,min(`test`.`t3`.`b`) AS `MIN(b)` from `test`.`t3` where multiple equal(2, `test`.`t3`.`a`) +SELECT MIN(a), MIN(b) FROM t3 where a = 2; +MIN(a) MIN(b) +2 NULL +CREATE TABLE t4 (a INT, b INT, c int, KEY(a, b)); +INSERT INTO t4 VALUES (1, 1, 1), (2, NULL, 2), (2, NULL, 2), (3, 1, 3); +ANALYZE TABLE t4; +Table Op Msg_type Msg_text +test.t4 analyze status OK +EXPLAIN SELECT MIN(a), MIN(b) FROM t4 where a = 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t4`.`a`) AS `MIN(a)`,min(`test`.`t4`.`b`) AS `MIN(b)` from `test`.`t4` where multiple equal(2, `test`.`t4`.`a`) +SELECT MIN(a), MIN(b) FROM t4 where a = 2; +MIN(a) MIN(b) +2 NULL +SELECT MIN(b), min(c) FROM t4 where a = 2; +MIN(b) min(c) +NULL 2 +CREATE TABLE t5( a INT, b INT, KEY( a, b) ); +INSERT INTO t5 VALUES( 1, 1 ), ( 1, 2 ); +ANALYZE TABLE t5; +Table Op Msg_type Msg_text +test.t5 analyze status OK +EXPLAIN SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t5`.`a`) AS `MIN(a)`,min(`test`.`t5`.`b`) AS `MIN(b)` from `test`.`t5` where multiple equal(1, `test`.`t5`.`a`) +SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1; +MIN(a) MIN(b) +1 1 +SELECT MIN(a), MIN(b) FROM t5 WHERE a = 1 and b > 1; +MIN(a) MIN(b) +1 2 +DROP TABLE t1, t2, t3, t4, t5; +CREATE TABLE t1 (a INT); +INSERT INTO t1 values (),(),(); +SELECT (SELECT SLEEP(0) FROM t1 ORDER BY AVG(DISTINCT a) ) as x FROM t1 +GROUP BY x; +ERROR HY000: Expression #1 of ORDER BY contains aggregate function and applies to the result of a non-aggregated query +SELECT 1 FROM t1 GROUP BY (SELECT SLEEP(0) FROM t1 ORDER BY AVG(DISTINCT a) ); +ERROR HY000: Expression #1 of ORDER BY contains aggregate function and applies to the result of a non-aggregated query +DROP TABLE t1; +CREATE TABLE t1 (a int, b date NOT NULL, KEY k1 (a,b)); +SELECT MIN(b) FROM t1 WHERE a=1 AND b>'2007-08-01'; +MIN(b) +NULL +DROP TABLE t1; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2),(3),(4); +SELECT a FROM t1 HAVING COUNT(*)>2; +ERROR 42000: In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'test.t1.a'; this is incompatible with sql_mode=only_full_group_by +SELECT COUNT(*), a FROM t1; +ERROR 42000: In aggregated query without GROUP BY, expression #2 of SELECT list contains nonaggregated column 'test.t1.a'; this is incompatible with sql_mode=only_full_group_by +SELECT a FROM t1 HAVING COUNT(*)>2; +a +1 +SELECT COUNT(*), a FROM t1; +COUNT(*) a +4 1 +DROP TABLE t1; +set SQL_MODE=ONLY_FULL_GROUP_BY; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2),(3),(4); +CREATE VIEW v1 AS SELECT a,(a + 1) AS y FROM t1; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT y FROM v1 GROUP BY v1.y; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 4 100.00 Using temporary +Warnings: +Note 1003 /* select#1 */ 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; +CREATE TABLE t1(a DOUBLE); +INSERT INTO t1 VALUES (10), (20); +SELECT AVG(a), CAST(AVG(a) AS DECIMAL) FROM t1; +AVG(a) CAST(AVG(a) AS DECIMAL) +15 15 +DROP TABLE t1; +CREATE TABLE derived1 (a bigint(21)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO derived1 VALUES (2); +CREATE TABLE D ( +pk int(11) NOT NULL AUTO_INCREMENT, +int_nokey int(11) DEFAULT NULL, +int_key int(11) DEFAULT NULL, +filler blob, +PRIMARY KEY (pk), +KEY int_key (int_key) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO D VALUES +(39,40,4,repeat(' X', 42)), +(43,56,4,repeat(' X', 42)), +(47,12,4,repeat(' X', 42)), +(71,28,4,repeat(' X', 42)), +(76,54,4,repeat(' X', 42)), +(83,45,4,repeat(' X', 42)), +(105,53,12,NULL); +SELECT +(SELECT COUNT( int_nokey ) +FROM derived1 AS X +WHERE +X.int_nokey < 61 +GROUP BY pk +LIMIT 1) +FROM D AS X +WHERE X.int_key < 13 +GROUP BY int_nokey LIMIT 1; +ERROR 42000: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'test.X.pk' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by +DROP TABLE derived1; +DROP TABLE D; +CREATE TABLE t1 (a INT, b INT); +INSERT INTO t1 VALUES (1,1), (1,2), (1,3); +SET SQL_MODE='ONLY_FULL_GROUP_BY'; +SELECT COUNT(*) FROM t1; +COUNT(*) +3 +SELECT COUNT(*) FROM t1 where a=1; +COUNT(*) +3 +SELECT COUNT(*),a FROM t1; +ERROR 42000: In aggregated query without GROUP BY, expression #2 of SELECT list contains nonaggregated column 'test.t1.a'; this is incompatible with sql_mode=only_full_group_by +SELECT COUNT(*) FROM t1 a JOIN t1 b ON a.a= b.a; +COUNT(*) +9 +SELECT COUNT(*), (SELECT count(*) FROM t1 inr WHERE inr.a = outr.a) +FROM t1 outr; +ERROR 42000: In aggregated query without GROUP BY, expression #2 of SELECT list contains nonaggregated column 'test.outr.a'; this is incompatible with sql_mode=only_full_group_by +SELECT COUNT(*) FROM t1 a JOIN t1 outr +ON a.a= (SELECT count(*) FROM t1 inr WHERE inr.a = outr.a); +COUNT(*) +0 +SET SQL_MODE=default; +DROP TABLE t1; +End of 5.0 tests +# +# BUG#47280 - strange results from count(*) with order by multiple +# columns without where/group +# +# +# Initialize test +# +CREATE TABLE t1 ( +pk INT NOT NULL, +i INT, +PRIMARY KEY (pk) +); +INSERT INTO t1 VALUES (1,11),(2,12),(3,13); +# +# Start test +# All the following queries shall return 1 record +# + +# Masking all correct values {11...13} for column i in this result. +SELECT MAX(pk) as max, i +FROM t1 +ORDER BY max; +max i +3 # + +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN +SELECT MAX(pk) as max, i +FROM t1 +ORDER BY max; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`pk`) AS `max`,`test`.`t1`.`i` AS `i` from `test`.`t1` + +# Only 11 is correct for collumn i in this result +SELECT MAX(pk) as max, i +FROM t1 +WHERE pk<2 +ORDER BY max; +max i +1 11 +# +# Cleanup +# +DROP TABLE t1; +# +# Bug#43668: Wrong comparison and MIN/MAX for YEAR(2) +# WL#6263: Remove year(2) +# +create table t1 (f1 year, f2 year, f3 date, f4 datetime); +insert into t1 values +(98,1998,19980101,"1998-01-01 00:00:00"), +('00',2000,20000101,"2000-01-01 00:00:01"), +(02,2002,20020101,"2002-01-01 23:59:59"), +(60,2060,20600101,"2060-01-01 11:11:11"), +(70,1970,19700101,"1970-11-11 22:22:22"), +(NULL,NULL,NULL,NULL); +select min(f1),max(f1) from t1; +min(f1) max(f1) +1970 2060 +select min(f2),max(f2) from t1; +min(f2) max(f2) +1970 2060 +select min(f3),max(f3) from t1; +min(f3) max(f3) +1970-01-01 2060-01-01 +select min(f4),max(f4) from t1; +min(f4) max(f4) +1970-11-11 22:22:22 2060-01-01 11:11:11 +select a.f1 as a, b.f1 as b, a.f1 > b.f1 as gt, +a.f1 < b.f1 as lt, a.f1<=>b.f1 as eq +from t1 a, t1 b; +a b gt lt eq +1970 1970 0 0 1 +1970 1998 0 1 0 +1970 2000 0 1 0 +1970 2002 0 1 0 +1970 2060 0 1 0 +1970 NULL NULL NULL 0 +1998 1970 1 0 0 +1998 1998 0 0 1 +1998 2000 0 1 0 +1998 2002 0 1 0 +1998 2060 0 1 0 +1998 NULL NULL NULL 0 +2000 1970 1 0 0 +2000 1998 1 0 0 +2000 2000 0 0 1 +2000 2002 0 1 0 +2000 2060 0 1 0 +2000 NULL NULL NULL 0 +2002 1970 1 0 0 +2002 1998 1 0 0 +2002 2000 1 0 0 +2002 2002 0 0 1 +2002 2060 0 1 0 +2002 NULL NULL NULL 0 +2060 1970 1 0 0 +2060 1998 1 0 0 +2060 2000 1 0 0 +2060 2002 1 0 0 +2060 2060 0 0 1 +2060 NULL NULL NULL 0 +NULL 1970 NULL NULL 0 +NULL 1998 NULL NULL 0 +NULL 2000 NULL NULL 0 +NULL 2002 NULL NULL 0 +NULL 2060 NULL NULL 0 +NULL NULL NULL NULL 1 +select a.f1 as a, b.f2 as b, a.f1 > b.f2 as gt, +a.f1 < b.f2 as lt, a.f1<=>b.f2 as eq +from t1 a, t1 b; +a b gt lt eq +1970 1970 0 0 1 +1970 1998 0 1 0 +1970 2000 0 1 0 +1970 2002 0 1 0 +1970 2060 0 1 0 +1970 NULL NULL NULL 0 +1998 1970 1 0 0 +1998 1998 0 0 1 +1998 2000 0 1 0 +1998 2002 0 1 0 +1998 2060 0 1 0 +1998 NULL NULL NULL 0 +2000 1970 1 0 0 +2000 1998 1 0 0 +2000 2000 0 0 1 +2000 2002 0 1 0 +2000 2060 0 1 0 +2000 NULL NULL NULL 0 +2002 1970 1 0 0 +2002 1998 1 0 0 +2002 2000 1 0 0 +2002 2002 0 0 1 +2002 2060 0 1 0 +2002 NULL NULL NULL 0 +2060 1970 1 0 0 +2060 1998 1 0 0 +2060 2000 1 0 0 +2060 2002 1 0 0 +2060 2060 0 0 1 +2060 NULL NULL NULL 0 +NULL 1970 NULL NULL 0 +NULL 1998 NULL NULL 0 +NULL 2000 NULL NULL 0 +NULL 2002 NULL NULL 0 +NULL 2060 NULL NULL 0 +NULL NULL NULL NULL 1 +select a.f1 as a, b.f3 as b, a.f1 > b.f3 as gt, +a.f1 < b.f3 as lt, a.f1<=>b.f3 as eq +from t1 a, t1 b; +a b gt lt eq +1970 1970-01-01 0 1 0 +1970 1998-01-01 0 1 0 +1970 2000-01-01 0 1 0 +1970 2002-01-01 0 1 0 +1970 2060-01-01 0 1 0 +1970 NULL NULL NULL 0 +1998 1970-01-01 1 0 0 +1998 1998-01-01 0 1 0 +1998 2000-01-01 0 1 0 +1998 2002-01-01 0 1 0 +1998 2060-01-01 0 1 0 +1998 NULL NULL NULL 0 +2000 1970-01-01 1 0 0 +2000 1998-01-01 1 0 0 +2000 2000-01-01 0 1 0 +2000 2002-01-01 0 1 0 +2000 2060-01-01 0 1 0 +2000 NULL NULL NULL 0 +2002 1970-01-01 1 0 0 +2002 1998-01-01 1 0 0 +2002 2000-01-01 1 0 0 +2002 2002-01-01 0 1 0 +2002 2060-01-01 0 1 0 +2002 NULL NULL NULL 0 +2060 1970-01-01 1 0 0 +2060 1998-01-01 1 0 0 +2060 2000-01-01 1 0 0 +2060 2002-01-01 1 0 0 +2060 2060-01-01 0 1 0 +2060 NULL NULL NULL 0 +NULL 1970-01-01 NULL NULL 0 +NULL 1998-01-01 NULL NULL 0 +NULL 2000-01-01 NULL NULL 0 +NULL 2002-01-01 NULL NULL 0 +NULL 2060-01-01 NULL NULL 0 +NULL NULL NULL NULL 1 +select a.f1 as a, b.f4 as b, a.f1 > b.f4 as gt, +a.f1 < b.f4 as lt, a.f1<=>b.f4 as eq +from t1 a, t1 b; +a b gt lt eq +1970 1970-11-11 22:22:22 0 1 0 +1970 1998-01-01 00:00:00 0 1 0 +1970 2000-01-01 00:00:01 0 1 0 +1970 2002-01-01 23:59:59 0 1 0 +1970 2060-01-01 11:11:11 0 1 0 +1970 NULL NULL NULL 0 +1998 1970-11-11 22:22:22 1 0 0 +1998 1998-01-01 00:00:00 0 1 0 +1998 2000-01-01 00:00:01 0 1 0 +1998 2002-01-01 23:59:59 0 1 0 +1998 2060-01-01 11:11:11 0 1 0 +1998 NULL NULL NULL 0 +2000 1970-11-11 22:22:22 1 0 0 +2000 1998-01-01 00:00:00 1 0 0 +2000 2000-01-01 00:00:01 0 1 0 +2000 2002-01-01 23:59:59 0 1 0 +2000 2060-01-01 11:11:11 0 1 0 +2000 NULL NULL NULL 0 +2002 1970-11-11 22:22:22 1 0 0 +2002 1998-01-01 00:00:00 1 0 0 +2002 2000-01-01 00:00:01 1 0 0 +2002 2002-01-01 23:59:59 0 1 0 +2002 2060-01-01 11:11:11 0 1 0 +2002 NULL NULL NULL 0 +2060 1970-11-11 22:22:22 1 0 0 +2060 1998-01-01 00:00:00 1 0 0 +2060 2000-01-01 00:00:01 1 0 0 +2060 2002-01-01 23:59:59 1 0 0 +2060 2060-01-01 11:11:11 0 1 0 +2060 NULL NULL NULL 0 +NULL 1970-11-11 22:22:22 NULL NULL 0 +NULL 1998-01-01 00:00:00 NULL NULL 0 +NULL 2000-01-01 00:00:01 NULL NULL 0 +NULL 2002-01-01 23:59:59 NULL NULL 0 +NULL 2060-01-01 11:11:11 NULL NULL 0 +NULL NULL NULL NULL 1 +select *, f1 = f2 from t1; +f1 f2 f3 f4 f1 = f2 +1998 1998 1998-01-01 1998-01-01 00:00:00 1 +2000 2000 2000-01-01 2000-01-01 00:00:01 1 +2002 2002 2002-01-01 2002-01-01 23:59:59 1 +2060 2060 2060-01-01 2060-01-01 11:11:11 1 +1970 1970 1970-01-01 1970-11-11 22:22:22 1 +NULL NULL NULL NULL NULL +drop table t1; +# +# Bug #54465: assert: field_types == 0 || field_types[field_pos] == +# MYSQL_TYPE_LONGLONG +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1), (2); +SELECT MAX((SELECT 1 FROM t1 ORDER BY @var LIMIT 1)) m FROM t1 t2, t1 +ORDER BY t1.a; +m +1 +DROP TABLE t1; +# +# Bug#58030 crash in Item_func_geometry_from_text::val_str +# +SELECT MAX(TIMESTAMP(RAND(0))); +SELECT MIN(TIMESTAMP(RAND(0))); +# +# Bug#58177 crash and valgrind warnings in decimal and protocol sending functions... +# +SELECT MIN(GET_LOCK('aaaaaaaaaaaaaaaaa',0) / '0b1111111111111111111111111111111111111111111111111111111111111111111111111' ^ (RAND())); +SELECT MIN(GET_LOCK('aaaaaaaaaaaaaaaaa',0) / '0b1111111111111111111111111111111111111111111111111111111111111111111111111' ^ (RAND())); +SELECT MIN(GET_LOCK('aaaaaaaaaaaaaaaaa',0) / '0b1111111111111111111111111111111111111111111111111111111111111111111111111' ^ (RAND())); +SELECT MIN(GET_LOCK('aaaaaaaaaaaaaaaaa',0) / '0b1111111111111111111111111111111111111111111111111111111111111111111111111' ^ (RAND())); +SELECT RELEASE_LOCK('aaaaaaaaaaaaaaaaa'); +# +# Bug #11766094 - 59132: MIN() AND MAX() REMOVE UNSIGNEDNESS +# +CREATE TABLE t1 (a BIGINT UNSIGNED); +INSERT INTO t1 VALUES (18446668621106209655); +SELECT MAX(LENGTH(a)), LENGTH(MAX(a)), MIN(a), MAX(a), CONCAT(MIN(a)), CONCAT(MAX(a)) FROM t1; +MAX(LENGTH(a)) LENGTH(MAX(a)) MIN(a) MAX(a) CONCAT(MIN(a)) CONCAT(MAX(a)) +20 20 18446668621106209655 18446668621106209655 18446668621106209655 18446668621106209655 +DROP TABLE t1; +# +# Bug #11766270 59343: YEAR(4): INCORRECT RESULT AND VALGRIND WARNINGS WITH MIN/MAX, UNION +# +CREATE TABLE t1(f1 YEAR); +INSERT INTO t1 VALUES (0000),(2001); +(SELECT MAX(f1) FROM t1) UNION (SELECT MAX(f1) FROM t1); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def MAX(f1) MAX(f1) 13 4 4 Y 32864 0 63 +MAX(f1) +2001 +DROP TABLE t1; +# +End of 5.1 tests +# +# Bug#52123 Assertion failed: aggregator == aggr->Aggrtype(), +# file .\item_sum.cc, line 587 +# +CREATE TABLE t1(a int, KEY(a)); +INSERT INTO t1 VALUES (1), (2); +SELECT 1 FROM t1 ORDER BY AVG(DISTINCT a); +ERROR HY000: Expression #1 of ORDER BY contains aggregate function and applies to the result of a non-aggregated query +DROP TABLE t1; +# +# Bug#55648: Server crash on MIN/MAX on maximum time value +# +CREATE TABLE t1(c1 TIME NOT NULL); +INSERT INTO t1 VALUES('837:59:59'); +INSERT INTO t1 VALUES('838:59:59'); +SELECT MAX(c1) FROM t1; +MAX(c1) +838:59:59 +DROP TABLE t1; +# End of the bug#55648 +# +# Bug#56120: Failed assertion on MIN/MAX on negative time value +# +CREATE TABLE t1(c1 TIME NOT NULL); +INSERT INTO t1 VALUES('-00:00:01'); +SELECT MAX(c1),MIN(c1) FROM t1; +MAX(c1) MIN(c1) +-00:00:01 -00:00:01 +DROP TABLE t1; +# End of the bug#56120 +# +# Bug#57932 "query with AVG(DISTINCT) returns NULL if last +# aggregated value was NULL" +# +CREATE TABLE t1 (col_int_nokey int(11)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (7),(8),(NULL); +SELECT AVG(DISTINCT col_int_nokey) FROM t1; +AVG(DISTINCT col_int_nokey) +7.5000 +SELECT AVG(DISTINCT outr.col_int_nokey) FROM t1 AS outr LEFT JOIN t1 AS outr2 ON +outr.col_int_nokey = outr2.col_int_nokey; +AVG(DISTINCT outr.col_int_nokey) +7.5000 +DROP TABLE t1; +# End of the bug#57932 +# +# BUG#12773464 - 61925: WRONG RESULT WITH AGGREGATE + NOT BETWEEN + KEY +# +CREATE TABLE t1 (a int, KEY (a)); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +SELECT MAX(a) FROM t1 WHERE a NOT BETWEEN 3 AND 9; +MAX(a) +10 +DROP TABLE t1; +# +# Bug#13724099 1032 BYTE MEMORY LEAK NEW_CACHED_ITEM IN +# SUBQUERY WITH GROUPING OF OUTER COLUMN +# +CREATE TABLE t1 ( +a BLOB, +b INT) +engine=innodb; +INSERT INTO t1 VALUES ('a', 0); +SELECT 0 FROM t1 +WHERE 0 = (SELECT group_concat(b) +FROM t1 t GROUP BY t1.a) +; +0 +0 +DROP TABLE t1; +# +# Bug#25738624: ASSERTION `FALSE' FAILED IN SQL/SQL_EXECUTOR.CC +# +CREATE TABLE e1(pk INT, col_date DATE); +CREATE TABLE b1(i INT); +CREATE TABLE bb4(col_int_key INT, KEY(col_int_key)) ENGINE=MYISAM; +INSERT INTO bb4 VALUES(4); +UPDATE IGNORE e1 AS outr1, b1 AS outr2 SET outr1.col_date = +JSON_SET(outr1.col_date, CONCAT('$','[',1,']','.','cdate'), '2007-07-12') +WHERE outr1.pk <= ANY ( SELECT DISTINCT innr1.col_int_key AS y FROM bb4 +AS innr2 LEFT JOIN bb4 AS innr1 ON (innr2.col_int_key <> innr1.col_int_key) +WHERE innr1.col_int_key= 4); +DROP TABLE e1, b1, bb4; +CREATE TABLE t1(pk INT, KEY(pk)) ENGINE=MYISAM; +INSERT INTO t1 VALUES(1); +SELECT MIN(i2.pk) FROM t1 i1 LEFT JOIN t1 i2 ON (i1.pk != i2.pk) +WHERE i2.pk = 1; +MIN(i2.pk) +NULL +DROP TABLE t1; +# End of test for bug#25738624 +# +# Bug#25541454: ASSERT `FALSE' FAILED IN READ_SYSTEM / JOIN_READ_CONST_TABLE AT SQL_EXECUTOR.CC +# +CREATE TABLE t1 ( +col_int_key int(11) DEFAULT NULL, +pk int(11) NOT NULL AUTO_INCREMENT, +col_int int(11) DEFAULT NULL, +PRIMARY KEY (pk), +KEY col_int_key (col_int_key) +) ENGINE=MyISAM; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t2 ( +col_int_key int(11) DEFAULT NULL, +pk int(11) NOT NULL AUTO_INCREMENT, +col_int int(11) DEFAULT NULL, +PRIMARY KEY (pk), +KEY col_int_key (col_int_key) +) ENGINE=MyISAM; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (4,1,2); +CREATE TABLE t3 ( +col_int int(11) DEFAULT NULL, +col_int_key int(11) DEFAULT NULL, +pk int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (pk), +KEY col_int_key (col_int_key) +) ENGINE=MyISAM; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t3 VALUES (3,9,1); +CREATE TABLE t4 ( +col_int_key int(11) DEFAULT NULL, +col_int int(11) DEFAULT NULL, +pk int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (pk), +KEY col_int_key (col_int_key) +) ENGINE=MyISAM; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +SELECT ( +SELECT MIN(subquery1_t1.col_int_key) +FROM t3 AS subquery1_t1 +RIGHT JOIN t1 AS subquery1_t2 +STRAIGHT_JOIN t4 AS subquery1_t3 +ON (subquery1_t3.pk = subquery1_t2.col_int_key) +ON (subquery1_t3.col_int_key = subquery1_t2.col_int) +WHERE subquery1_t1.col_int_key >= table1.col_int +AND subquery1_t3.pk > table1.pk +) +FROM t2 AS table1; +( +SELECT MIN(subquery1_t1.col_int_key) +FROM t3 AS subquery1_t1 +RIGHT JOIN t1 AS subquery1_t2 +STRAIGHT_JOIN t4 AS subquery1_t3 +ON (subquery1_t3.pk = subquery1_t2.col_int_key) +ON (subquery1_t3.col_int_key = subquery1_t2.col_int) +WHERE subquery1_t1.col_int_k +NULL +DROP TABLE t1, t2, t3, t4; +# End of test for bug#25541454 +# +# Bug#29596977 MYSQL OPTIMIZER SCAN FULL INDEX FOR MAX() ON INDEXED COLUMN. +# +CREATE TABLE t1 ( +id BIGINT NOT NULL AUTO_INCREMENT, +f1 BIGINT, +PRIMARY KEY(id), +INDEX ix_fd2 (f1) +); +INSERT INTO t1 VALUES (NULL, 1), (NULL, 2), (NULL, 3); +CREATE FUNCTION f1 (par INT) RETURNS INT +DETERMINISTIC +SQL SECURITY INVOKER +BEGIN +RETURN par + 1; +END| +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT f1(MAX(f1)) FROM t1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select `f1`(max(`test`.`t1`.`f1`)) AS `f1(MAX(f1))` from `test`.`t1` +SELECT f1(MAX(f1)) FROM t1; +f1(MAX(f1)) +4 +DROP TABLE t1; +DROP FUNCTION f1; +# +# Bug#31848191: ITEM_SUM_STD AND _VARIANCE HAS INCORRECT IS_NULL() +# +CREATE TABLE t1 (f1 INTEGER,f2 INTEGER); +INSERT INTO t1 VALUES (1,10),(1,20),(2,NULL),(2,NULL),(3,50); +SELECT f1, STD(f2) FROM t1 GROUP BY f1 WITH ROLLUP HAVING STD(f2) IS NULL; +f1 STD(f2) +2 NULL +SELECT f1, STD(f2) FROM t1 GROUP BY f1 WITH ROLLUP HAVING STD(f2) IS NOT NULL; +f1 STD(f2) +1 5 +3 0 +NULL 16.99673171197595 +DROP TABLE t1; diff --git a/mysql-test/r/func_like.result-pq b/mysql-test/r/func_like.result-pq new file mode 100644 index 000000000000..47dbe43c1448 --- /dev/null +++ b/mysql-test/r/func_like.result-pq @@ -0,0 +1,482 @@ +drop table if exists t1; +create table t1 (a varchar(10), key(a)) charset utf8mb4; +insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +explain select * from t1 where a like 'abc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range a a 43 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` like 'abc%') +explain select * from t1 where a like concat('abc','%'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range a a 43 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ 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 +abcd +select * from t1 where a like concat("abc","%"); +a +abc +abcd +select * from t1 where a like "ABC%"; +a +abc +abcd +select * from t1 where a like "test%"; +a +test +select * from t1 where a like "te_t"; +a +test +select * from t1 where a like "%a%"; +a +a +abc +abcd +select * from t1 where a like "%abcd%"; +a +abcd +select * from t1 where a like "%abc\d%"; +a +abcd +drop table t1; +create table t1 (a varchar(10), key(a)); +insert into t1 values ('a'), ('a\\b'); +select * from t1 where a like 'a\\%' escape '#'; +a +a\b +select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b'; +a +a\b +prepare stmt1 from 'select * from t1 where a like \'a\\%\' escape ?'; +set @esc='#'; +execute stmt1 using @esc; +a +a\b +deallocate prepare stmt1; +drop table t1; +create table t1 (a datetime); +insert into t1 values ('2004-03-11 12:00:21'); +select * from t1 where a like '2004-03-11 12:00:21'; +a +2004-03-11 12:00:21 +drop table t1; +SET NAMES koi8r; +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET koi8r); +INSERT INTO t1 VALUES (''),(''),(''),(''),(''),(''); +INSERT INTO t1 VALUES (''),(''),(''),(''); +INSERT INTO t1 VALUES (''),(''),(''),(''); +INSERT INTO t1 VALUES (''),(''),(''),(''); +SELECT * FROM t1 WHERE a LIKE '%%'; +a + + + + + + + + + + + + + + + + + + +SELECT * FROM t1 WHERE a LIKE '%%'; +a + + + + + + + + + + + + + + + + + + +SELECT * FROM t1 WHERE a LIKE '%'; +a + + + + + + + + + + + + + + + + + + +DROP TABLE t1; +SET NAMES cp1250; +CREATE TABLE t1 (a varchar(250) NOT NULL) DEFAULT CHARACTER SET=cp1250; +INSERT INTO t1 VALUES +('Techni Tapes Sp. z o.o.'), +('Pojazdy Szynowe PESA Bydgoszcz SA Holding'), +('AKAPESTER 1 P.P.H.U.'), +('Pojazdy Szynowe PESA Bydgoszcz S A Holding'), +('PPUH PESKA-I Maria Struniarska'); +select * from t1 where a like '%PESA%'; +a +Pojazdy Szynowe PESA Bydgoszcz SA Holding +Pojazdy Szynowe PESA Bydgoszcz S A Holding +select * from t1 where a like '%PESA %'; +a +Pojazdy Szynowe PESA Bydgoszcz SA Holding +Pojazdy Szynowe PESA Bydgoszcz S A Holding +select * from t1 where a like '%PES%'; +a +Techni Tapes Sp. z o.o. +Pojazdy Szynowe PESA Bydgoszcz SA Holding +AKAPESTER 1 P.P.H.U. +Pojazdy Szynowe PESA Bydgoszcz S A Holding +PPUH PESKA-I Maria Struniarska +select * from t1 where a like '%PESKA%'; +a +PPUH PESKA-I Maria Struniarska +select * from t1 where a like '%ESKA%'; +a +PPUH PESKA-I Maria Struniarska +DROP TABLE t1; +select _cp866'aaaaaaaaa' like _cp866'%aaaa%' collate cp866_bin; +_cp866'aaaaaaaaa' like _cp866'%aaaa%' collate cp866_bin +1 +set names koi8r; +select 'andre%' like 'andre%' escape ''; +'andre%' like 'andre%' escape '' +1 +select _cp1251'andre%' like convert('andre%' using cp1251) escape ''; +_cp1251'andre%' like convert('andre%' using cp1251) escape '' +1 +End of 4.1 tests +# +# Bug #54575: crash when joining tables with unique set column +# +CREATE TABLE t1(a SET('a') NOT NULL, UNIQUE KEY(a)); +CREATE TABLE t2(b INT PRIMARY KEY); +INSERT IGNORE INTO t1 VALUES (); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +INSERT INTO t2 VALUES (1), (2), (3); +SELECT 1 FROM t2 JOIN t1 ON 1 LIKE a GROUP BY a; +1 +DROP TABLE t1, t2; +# +# Bug#59149 valgrind warnings with "like .. escape .." function +# +SELECT '' LIKE '1' ESCAPE COUNT(1); +'' LIKE '1' ESCAPE COUNT(1) +0 +End of 5.1 tests +# +# Bug #18114294 CRASH IN ITEM_FUNC_LIKE::BM_MATCHES +# +select 0x0000000001020003F03F40408484040ADDE40 like 0x256F3B38312A7725; +0x0000000001020003F03F40408484040ADDE40 like 0x256F3B38312A7725 +0 +select 0x003c8793403032 like '%-112%'; +0x003c8793403032 like '%-112%' +0 +select 0x903f645a8c507dd79178 like '%-128%'; +0x903f645a8c507dd79178 like '%-128%' +0 +select 0xac14aa84f000d276d66ed9 like '%-107%'; +0xac14aa84f000d276d66ed9 like '%-107%' +0 +select 0xf0be117400d02a20b8e049da3e74 like '%-123%'; +0xf0be117400d02a20b8e049da3e74 like '%-123%' +0 +select 0x961838f6fc3c7f9ec17b5d900410d8aa like '%-113%'; +0x961838f6fc3c7f9ec17b5d900410d8aa like '%-113%' +0 +select 0x6a8473fc1c64ce4f2684c05a400c5e7ca4a01a like '%emailin%'; +0x6a8473fc1c64ce4f2684c05a400c5e7ca4a01a like '%emailin%' +0 +select 0x00b25278956e0044683dfc180cd886aeff2f5bc3fc18 like '%-122%'; +0x00b25278956e0044683dfc180cd886aeff2f5bc3fc18 like '%-122%' +0 +select 0xbc24421ce6194ab5c260e80af647ae58fdbfca18a19dc8411424 like '%-106%'; +0xbc24421ce6194ab5c260e80af647ae58fdbfca18a19dc8411424 like '%-106%' +0 +# +# Bug#19931126 VALGRIND REPORTS USE OF UNINITIALIZED VALUE IN +# MY_WILDCMP_BIN_IMPL +# +CREATE TABLE t1(x CHAR(1)) ENGINE=InnoDB; +SELECT ('a%b' LIKE 'a\%b' ESCAPE (SELECT x FROM t1)); +('a%b' LIKE 'a\%b' ESCAPE (SELECT x FROM t1)) +1 +SELECT ('a%b' LIKE 'ax%b' ESCAPE (SELECT x FROM t1)); +('a%b' LIKE 'ax%b' ESCAPE (SELECT x FROM t1)) +0 +INSERT INTO t1 VALUES ('x'); +SELECT ('a%b' LIKE 'a\%b' ESCAPE (SELECT x FROM t1)); +('a%b' LIKE 'a\%b' ESCAPE (SELECT x FROM t1)) +0 +SELECT ('a%b' LIKE 'ax%b' ESCAPE (SELECT x FROM t1)); +('a%b' LIKE 'ax%b' ESCAPE (SELECT x FROM t1)) +1 +SELECT ('a%b' LIKE 'ax%b' ESCAPE (SELECT 'xy' FROM t1)); +ERROR HY000: Incorrect arguments to ESCAPE +INSERT INTO t1 VALUES ('y'); +SELECT ('a%b' LIKE 'ax%b' ESCAPE (SELECT x FROM t1)); +ERROR 21000: Subquery returns more than 1 row +DELETE FROM t1 WHERE x = 'y'; +SELECT ('a%b' LIKE 'ax%b' ESCAPE (SELECT x, x FROM t1)); +ERROR 21000: Operand should contain 1 column(s) +SELECT ('a%b' LIKE 'ax%b' ESCAPE ('x', 'y')); +ERROR 21000: Operand should contain 1 column(s) +SELECT ('a%b' LIKE 'ax%b' ESCAPE x) FROM t1; +ERROR HY000: Incorrect arguments to ESCAPE +CREATE TABLE t2(x int, y varchar(100)) ENGINE=InnoDB; +CREATE INDEX idx ON t2(y); +INSERT INTO t2 VALUES (1, 'abcd'), (2, 'ab%cde'); +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +EXPLAIN SELECT * FROM t2 WHERE y LIKE 'abc%%' ESCAPE (SELECT 'c' FROM t1) ORDER BY y; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 NULL ALL idx NULL NULL NULL 2 50.00 Using where; Using filesort +2 SUBQUERY t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`x` AS `x`,`test`.`t2`.`y` AS `y` from `test`.`t2` where (`test`.`t2`.`y` like 'abc%%' escape (/* select#2 */ select 'c' from `test`.`t1`)) order by `test`.`t2`.`y` +SELECT * FROM t2 WHERE y LIKE 'abc%%' ESCAPE (SELECT 'c' FROM t1) ORDER BY y; +x y +2 ab%cde +DROP TABLE t1, t2; +# Bug#20035071: Out of range error in subselect lead to assertion failed +CREATE TABLE t1(a INTEGER) engine=innodb; +INSERT INTO t1 VALUES(1); +SELECT 1 FROM t1 HAVING (SELECT 1 FROM t1) LIKE EXP(NOW()); +ERROR 22003: DOUBLE value is out of range in 'exp(now())' +DROP TABLE t1; +# +# Bug #25140629: WRONG RESULT WHEN USING LIKE FUNCTION WITH UCA +# COLLATIONS +# +CREATE TABLE t1(wildstr VARCHAR(10), str VARCHAR(10), like_result INTEGER) +COLLATE utf8mb4_0900_ai_ci; +INSERT INTO t1 VALUES('abc', 'abc', 1), ('AbC', 'aBc', 1), ('_bc', 'abc', 1), +('a_c', 'abc', 1), ('ab_', 'abc', 1), ('%c', 'abc', 1), ('a%c', 'abc', 1), +('a%', 'abc', 1), ('a%d_f', 'abcdef', 1), ('a%d%g', 'abcdefg', 1), +('a_c_e', 'abcde', 1), ('a%%de', 'abcde', 1), ('a__de', 'abcde', 1), +(_utf16 0x65700025636E005F5E93, _utf16 0x65706C49636E5B575E93, 1), +('a\\', 'a\\', 1); +SELECT wildstr, str, like_result FROM t1 WHERE (str LIKE wildstr) <> +like_result; +wildstr str like_result +DROP TABLE t1; +# +# Bug #12635103: VALGRIND WARNINGS IN MY_WILDCMP_MB AND +# MY_WILDCMP_8BIT WITH LIKE AND CONVERT +# +SELECT 'aa' LIKE CONVERT('%a' USING big5); +'aa' LIKE CONVERT('%a' USING big5) +1 +SELECT 'aa' LIKE CONVERT('%a' USING utf8mb4); +'aa' LIKE CONVERT('%a' USING utf8mb4) +1 +SELECT 'aa' LIKE CONVERT('%a' USING gb18030); +'aa' LIKE CONVERT('%a' USING gb18030) +1 +SELECT 'aa' LIKE CONVERT('%a' USING binary); +'aa' LIKE CONVERT('%a' USING binary) +1 +SELECT 'aa' LIKE CONVERT('%a' USING latin1); +'aa' LIKE CONVERT('%a' USING latin1) +1 +SET NAMES gb2312; +SELECT 'aa' LIKE '%a' COLLATE gb2312_bin; +'aa' LIKE '%a' COLLATE gb2312_bin +1 +SET NAMES DEFAULT; +SELECT 'aa' LIKE CONVERT('%a' USING utf8); +'aa' LIKE CONVERT('%a' USING utf8) +1 +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +# +# Bug#29175461: LIKE RESULT ERROR IF ESCAPE IS % OF WILDCARD CHARACTERS +# +SET NAMES big5; +select 1 where 'b%a' like '%%a' escape '%'; +1 +select 1 where 'b_a' like '__a' escape '_'; +1 +select 1 where 'b%a' like '#%a' escape '#'; +1 +select 1 where 'b_a' like '#_a' escape '#'; +1 +SET NAMES utf8mb4; +select 1 where 'b%a' like '%%a' escape '%'; +1 +select 1 where 'b_a' like '__a' escape '_'; +1 +select 1 where 'b%a' like '#%a' escape '#'; +1 +select 1 where 'b_a' like '#_a' escape '#'; +1 +SET NAMES gb18030; +select 1 where 'b%a' like '%%a' escape '%'; +1 +select 1 where 'b_a' like '__a' escape '_'; +1 +select 1 where 'b%a' like '#%a' escape '#'; +1 +select 1 where 'b_a' like '#_a' escape '#'; +1 +SET NAMES binary; +select 1 where 'b%a' like '%%a' escape '%'; +1 +select 1 where 'b_a' like '__a' escape '_'; +1 +select 1 where 'b%a' like '#%a' escape '#'; +1 +select 1 where 'b_a' like '#_a' escape '#'; +1 +SET NAMES latin1; +select 1 where 'b%a' like '%%a' escape '%'; +1 +select 1 where 'b_a' like '__a' escape '_'; +1 +select 1 where 'b%a' like '#%a' escape '#'; +1 +select 1 where 'b_a' like '#_a' escape '#'; +1 +SET NAMES gb2312; +select 1 where 'b%a' like '%%a' escape '%'; +1 +select 1 where 'b_a' like '__a' escape '_'; +1 +select 1 where 'b%a' like '#%a' escape '#'; +1 +select 1 where 'b_a' like '#_a' escape '#'; +1 +SET NAMES utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +select 1 where 'b%a' like '%%a' escape '%'; +1 +select 1 where 'b_a' like '__a' escape '_'; +1 +select 1 where 'b%a' like '#%a' escape '#'; +1 +select 1 where 'b_a' like '#_a' escape '#'; +1 +SET NAMES default; +# +# Bug#29368521: ASSERTION `!THD->IS_ERROR()' FAILED +# +SELECT 'a' LIKE '%' ESCAPE CAST('' AS JSON); +ERROR 22032: Invalid JSON text in argument 1 to function cast_as_json: "The document is empty." at position 0. +# +# Bug#29590129 UBSAN: MEMBER CALL ON NULL POINTER OF TYPE +# 'STRUCT STRING' IN ITEM_FUNC_LIKE::VA +# +CREATE TABLE t1 (c1 INT); +INSERT INTO t1 VALUES (42); +DELETE FROM t1 WHERE +( EXISTS +(SELECT * WHERE '520:33:32.77' < (c1 - INTERVAL(1) MONTH)) +) LIKE (c1); +ERROR 22007: Incorrect datetime value: '42' +DROP TABLE t1; +# +# Bug#29904751: LIKE CONDITION FOR DATE COLUMN RETURNS ERROR +# +CREATE TABLE t(col1 DATE); +INSERT INTO t(col1) VALUES('2019-06-13'), ('2019-07-13'); +SELECT * FROM t WHERE col1 LIKE '2019%'; +col1 +2019-06-13 +2019-07-13 +SELECT * FROM t WHERE col1 LIKE '2019-06-1%'; +col1 +2019-06-13 +DROP TABLE t; +# +# Bug#31249687 WL9384: RESULTSET MISMATCH WITH LIKE KEYWORD USING PREPARE STATEMENT +# +create table t1(a int); +insert into t1 values(0); +set @pattern="%1%"; +select 1 from t1 where a like @pattern; +1 +prepare s from 'select 1 from t1 where a like ?'; +execute s using @pattern; +1 +drop table t1; +# +# Bug#26086751: LIKE LOSES ESCAPE CLAUSE WHEN USED IN VIEW +# Bug#29224931: LIKE ... ESCAPE IS NOT WRITTEN TO DICTIONARY +# Bug#30211596: `EXPLAIN ... LIKE ... ESCAPE` DOESN'T OUTPUT `ESCAPE` +# CLAUSE IN THE WARNING +# +EXPLAIN SELECT 'abba' LIKE 'abba' ESCAPE 'b'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select ('abba' like 'abba' escape 'b') AS `'abba' LIKE 'abba' ESCAPE 'b'` +CREATE TABLE t(x VARCHAR(10), +gc INTEGER GENERATED ALWAYS AS (x LIKE 'abba' ESCAPE 'b')); +INSERT INTO t(x) VALUES ('abba'), ('aba'), ('abbbba'); +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `x` varchar(10) DEFAULT NULL, + `gc` int GENERATED ALWAYS AS ((`x` like _utf8mb4'abba' escape _utf8mb4'b')) VIRTUAL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT x FROM t WHERE gc <> 0; +x +aba +CREATE VIEW v AS SELECT x, 'abba' LIKE x ESCAPE 'b' AS y FROM t; +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 `t`.`x` AS `x`,('abba' like `t`.`x` escape 'b') AS `y` from `t` utf8mb4 utf8mb4_0900_ai_ci +SELECT x FROM v WHERE y <> 0; +x +abbbba +DROP VIEW v; +DROP TABLE t; +# +# Bug#32446508: INCONSISTENT HANDLING OF LIKE WITH AN EMPTY ESCAPE SEQUENCE +# +# Used to return (0, 1, 1), should return (0, 0, 0). +SELECT _latin1'abc' LIKE _latin1'a\\bc' ESCAPE _latin1'' AS col1, +_utf8mb4'abc' LIKE _utf8mb4'a\\bc' ESCAPE _utf8mb4'' AS col2, +_latin1'abc' LIKE _latin1'a\\bc' ESCAPE _ascii'' AS col3; +col1 col2 col3 +0 0 0 +SET sql_mode = CONCAT(@@sql_mode, ',NO_BACKSLASH_ESCAPES'); +# Used to return (1, 0), should return (1, 1). +SELECT _latin1'a\bc' LIKE _latin1'a\%' AS col1, +_utf8mb4'a\bc' LIKE _utf8mb4'a\%' AS col2; +col1 col2 +1 1 +SET sql_mode = DEFAULT; diff --git a/mysql-test/r/func_prefix_key.result-pq b/mysql-test/r/func_prefix_key.result-pq new file mode 100644 index 000000000000..53ae142f87ff --- /dev/null +++ b/mysql-test/r/func_prefix_key.result-pq @@ -0,0 +1,943 @@ +CREATE TABLE t1(a int, b VARCHAR(5), PRIMARY KEY(a))ENGINE=INNODB; +INSERT INTO t1 VALUES (1, 'a'), (2, 'ab'), (3, 'abc'), (4, 'abcd'), (5, 'abcde'); +ALTER TABLE t1 ADD KEY k2 (b(4)); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +# 'Using index' method is used since wild string is suitable for the use with prefix key. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index k2 k2 19 NULL 5 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'a%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abcd%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abcd%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like ''; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abc\%%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abc\\%%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '\%abc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '\\%abc%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abc%%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abc%%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 20.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index NULL k2 19 NULL 5 20.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '%%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 20.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index NULL k2 19 NULL 5 20.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '%%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '____%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 20.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index NULL k2 19 NULL 5 20.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '____%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '\_\_\_\_%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '\\_\\_\\_\\_%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '\%\%\%\%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '\\%\\%\\%\\%') +EXPLAIN SELECT b LIKE 'abcd' FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`b` like 'abcd') AS `b LIKE 'abcd'` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT b LIKE 'abc%' FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`b` like 'abc%') AS `b LIKE 'abc%'` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'aaa\\'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'aaa\\') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'aaa\\\\'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'aaa\\\\') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'aaa\\\\%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'aaa\\\\%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a_'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index k2 k2 19 NULL 5 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'a_') +# 'Using index' method is not used since wild string is not suitable for the use with prefix key. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '%a'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 20.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 20.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '%a') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a%c%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 5 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'a%c%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a%c'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 5 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'a%c') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abcde%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abcde%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abcde%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abcde%') +EXPLAIN SELECT b FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT b LIKE 'abcde' FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`b` like 'abcde') AS `b LIKE 'abcde'` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT b LIKE '%bc' FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`b` like '%bc') AS `b LIKE '%bc'` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'aaaa\\'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'aaaa\\') +# 'Using index' method is not used since wild string is not suitable for the use with prefix key. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a%' OR b like '%a'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 36.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL k2 NULL NULL NULL 5 36.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where ((`test`.`t1`.`b` like 'a%') or (`test`.`t1`.`b` like '%a')) +# 'Using index' method is used since wild string is suitable for the use with prefix key. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +# 'Using index' method is not used since 'b' field is used in select output. +EXPLAIN SELECT b FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +# Index k2 shouldn't be used. +EXPLAIN SELECT COUNT(*) FROM t1 IGNORE INDEX(k2) WHERE b like 'a%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 20.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 20.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` IGNORE INDEX (`k2`) where (`test`.`t1`.`b` like 'a%') +DROP TABLE t1; +CREATE TABLE t1(a int, b VARCHAR(5), PRIMARY KEY(a))ENGINE=INNODB DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (1, 'a'), (2, 'ab'), (3, 'abc'), (4, 'abcd'), (5, 'abcde'); +ALTER TABLE t1 ADD KEY k2 (b(4)); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +# 'Using index' method is used since wild string is suitable for the use with prefix key. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index k2 k2 7 NULL 5 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'a%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abcd%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abcd%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like ''; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abc\%%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abc\\%%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '\%abc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '\\%abc%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abc%%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abc%%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 20.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index NULL k2 7 NULL 5 20.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '%%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 20.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index NULL k2 7 NULL 5 20.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '%%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '____%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 20.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index NULL k2 7 NULL 5 20.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '____%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '\_\_\_\_%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '\\_\\_\\_\\_%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '\%\%\%\%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '\\%\\%\\%\\%') +EXPLAIN SELECT b LIKE 'abcd' FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`b` like 'abcd') AS `b LIKE 'abcd'` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT b LIKE 'abc%' FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`b` like 'abc%') AS `b LIKE 'abc%'` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'aaa\\'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'aaa\\') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'aaa\\\\'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'aaa\\\\') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'aaa\\\\%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'aaa\\\\%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a_'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index k2 k2 7 NULL 5 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'a_') +# 'Using index' method is not used since wild string is not suitable for the use with prefix key. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '%a'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 20.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 20.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '%a') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a%c%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 5 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'a%c%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a%c'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 5 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'a%c') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abcde%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abcde%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abcde%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abcde%') +EXPLAIN SELECT b FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT b LIKE 'abcde' FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`b` like 'abcde') AS `b LIKE 'abcde'` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT b LIKE '%bc' FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`b` like '%bc') AS `b LIKE '%bc'` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'aaaa\\'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'aaaa\\') +# 'Using index' method is not used since wild string is not suitable for the use with prefix key. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a%' OR b like '%a'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 36.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL k2 NULL NULL NULL 5 36.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where ((`test`.`t1`.`b` like 'a%') or (`test`.`t1`.`b` like '%a')) +# 'Using index' method is used since wild string is suitable for the use with prefix key. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +# 'Using index' method is not used since 'b' field is used in select output. +EXPLAIN SELECT b FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 7 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +# Index k2 shouldn't be used. +EXPLAIN SELECT COUNT(*) FROM t1 IGNORE INDEX(k2) WHERE b like 'a%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 20.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 20.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` IGNORE INDEX (`k2`) where (`test`.`t1`.`b` like 'a%') +DROP TABLE t1; +CREATE TABLE t1(a int, b VARCHAR(5), PRIMARY KEY(a))ENGINE=INNODB DEFAULT CHARSET=utf32; +INSERT INTO t1 VALUES (1, 'a'), (2, 'ab'), (3, 'abc'), (4, 'abcd'), (5, 'abcde'); +ALTER TABLE t1 ADD KEY k2 (b(4)); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +# 'Using index' method is used since wild string is suitable for the use with prefix key. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index k2 k2 19 NULL 5 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'a%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abcd%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abcd%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like ''; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abc\%%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abc\\%%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '\%abc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '\\%abc%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abc%%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abc%%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index k2 k2 19 NULL 5 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '%%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index k2 k2 19 NULL 5 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '%%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '____%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index k2 k2 19 NULL 5 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '____%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '\_\_\_\_%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '\\_\\_\\_\\_%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '\%\%\%\%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '\\%\\%\\%\\%') +EXPLAIN SELECT b LIKE 'abcd' FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`b` like 'abcd') AS `b LIKE 'abcd'` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT b LIKE 'abc%' FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`b` like 'abc%') AS `b LIKE 'abc%'` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'aaa\\'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'aaa\\') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'aaa\\\\'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'aaa\\\\') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'aaa\\\\%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'aaa\\\\%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a_'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index k2 k2 19 NULL 5 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'a_') +# 'Using index' method is not used since wild string is not suitable for the use with prefix key. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '%a'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 5 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '%a') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a%c%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 5 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'a%c%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a%c'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 5 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'a%c') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abcde%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abcde%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abcde%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abcde%') +EXPLAIN SELECT b FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT b LIKE 'abcde' FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`b` like 'abcde') AS `b LIKE 'abcde'` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT b LIKE '%bc' FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`b` like '%bc') AS `b LIKE '%bc'` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'aaaa\\'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'aaaa\\') +# 'Using index' method is not used since wild string is not suitable for the use with prefix key. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a%' OR b like '%a'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 5 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where ((`test`.`t1`.`b` like 'a%') or (`test`.`t1`.`b` like '%a')) +# 'Using index' method is used since wild string is suitable for the use with prefix key. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +# 'Using index' method is not used since 'b' field is used in select output. +EXPLAIN SELECT b FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +# Index k2 shouldn't be used. +EXPLAIN SELECT COUNT(*) FROM t1 IGNORE INDEX(k2) WHERE b like 'a%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 20.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 20.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` IGNORE INDEX (`k2`) where (`test`.`t1`.`b` like 'a%') +DROP TABLE t1; +CREATE TABLE t1(a int, b TEXT, PRIMARY KEY(a))ENGINE=INNODB; +INSERT INTO t1 VALUES (1, 'a'), (2, 'ab'), (3, 'abc'), (4, 'abcd'), (5, 'abcde'); +ALTER TABLE t1 ADD KEY k2 (b(4)); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +# 'Using index' method is used since wild string is suitable for the use with prefix key. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL index k2 k2 19 NULL 5 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'a%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abcd%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abcd%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like ''; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abc\%%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abc\\%%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '\%abc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '\\%abc%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abc%%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abc%%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL index NULL k2 19 NULL 5 20.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '%%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL index NULL k2 19 NULL 5 20.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '%%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '____%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL index NULL k2 19 NULL 5 20.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '____%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '\_\_\_\_%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '\\_\\_\\_\\_%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '\%\%\%\%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '\\%\\%\\%\\%') +EXPLAIN SELECT b LIKE 'abcd' FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`b` like 'abcd') AS `b LIKE 'abcd'` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT b LIKE 'abc%' FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`b` like 'abc%') AS `b LIKE 'abc%'` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'aaa\\'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'aaa\\') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'aaa\\\\'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'aaa\\\\') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'aaa\\\\%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'aaa\\\\%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a_'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL index k2 k2 19 NULL 5 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'a_') +# 'Using index' method is not used since wild string is not suitable for the use with prefix key. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like '%a'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 20.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like '%a') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a%c%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 5 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'a%c%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a%c'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 5 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'a%c') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abcde%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abcde%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abcde%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abcde%') +EXPLAIN SELECT b FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT b LIKE 'abcde' FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`b` like 'abcde') AS `b LIKE 'abcde'` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT b LIKE '%bc' FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`b` like '%bc') AS `b LIKE '%bc'` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'aaaa\\'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'aaaa\\') +# 'Using index' method is not used since wild string is not suitable for the use with prefix key. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'a%' OR b like '%a'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL k2 NULL NULL NULL 5 36.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where ((`test`.`t1`.`b` like 'a%') or (`test`.`t1`.`b` like '%a')) +# 'Using index' method is used since wild string is suitable for the use with prefix key. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +# 'Using index' method is not used since 'b' field is used in select output. +EXPLAIN SELECT b FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +# Index k2 shouldn't be used. +EXPLAIN SELECT COUNT(*) FROM t1 IGNORE INDEX(k2) WHERE b like 'a%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 20.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` IGNORE INDEX (`k2`) where (`test`.`t1`.`b` like 'a%') +DROP TABLE t1; +CREATE TABLE t1(a int, b VARCHAR(5), PRIMARY KEY(a))ENGINE=INNODB DEFAULT CHARSET=utf32; +INSERT INTO t1 VALUES (1, 'a'), (2, 'ab'), (3, 'abc'), (4, 'abcd'), (5, 'abcde'), (6, 'abcdf'); +ALTER TABLE t1 ADD KEY k2 (b(4)); +ALTER TABLE t1 ADD KEY k3 (b(2)); +ALTER TABLE t1 ADD KEY k4 (a, b(3)); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +# k2 index used since it's covering. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'abc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2,k3 k2 19 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'abc%') +SELECT COUNT(*) FROM t1 WHERE b like 'abc%'; +COUNT(*) +4 +# k4 index used since it's covering. +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT /*+ INDEX(t1 k4) */ COUNT(*) FROM t1 WHERE a > 4 AND b like 'abc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 16.67 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k4 k4 4 NULL 2 16.67 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select /*+ INDEX(`t1`@`select#1` `k4`) */ count(0) AS `COUNT(*)` from `test`.`t1` where ((`test`.`t1`.`a` > 4) and (`test`.`t1`.`b` like 'abc%')) +SELECT /*+ INDEX(t1 k4) */ COUNT(*) FROM t1 WHERE a > 4 AND b like 'abc%'; +COUNT(*) +2 +# k3 index is used since it's shorters key. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'ab%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range k2,k3 k3 11 NULL 5 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'ab%') +SELECT COUNT(*) FROM t1 WHERE b like 'ab%'; +COUNT(*) +5 +# Index access is not used, no covering keys. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE a > 4 AND b like 'abcde%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 16.67 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,k2,k3,k4 PRIMARY 4 NULL 2 16.67 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where ((`test`.`t1`.`a` > 4) and (`test`.`t1`.`b` like 'abcde%')) +SELECT COUNT(*) FROM t1 WHERE a > 4 AND b like 'abcde%'; +COUNT(*) +1 +# k2 index used since it's covering. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE a > 4 AND b like 'abcd%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,k2,k3,k4 k2 23 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where ((`test`.`t1`.`a` > 4) and (`test`.`t1`.`b` like 'abcd%')) +SELECT COUNT(*) FROM t1 WHERE a > 4 AND b like 'abcd%'; +COUNT(*) +2 +# Index access is not used, no covering keys. +EXPLAIN SELECT b like 'abcdf%' FROM t1 WHERE a > 4 AND b like 'abcd%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 16.67 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,k2,k3,k4 PRIMARY 4 NULL 2 16.67 Using where +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`b` like 'abcdf%') AS `b like 'abcdf%'` from `test`.`t1` where ((`test`.`t1`.`a` > 4) and (`test`.`t1`.`b` like 'abcd%')) +SELECT b like 'abcdf%' FROM t1 WHERE a > 4 AND b like 'abcd%'; +b like 'abcdf%' +0 +1 +# Index access is used since k4 is covering. +EXPLAIN SELECT b like 'ab%' FROM t1 WHERE a > 4 AND b like 'a%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,k2,k3,k4 k4 4 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`b` like 'ab%') AS `b like 'ab%'` from `test`.`t1` where ((`test`.`t1`.`a` > 4) and (`test`.`t1`.`b` like 'a%')) +SELECT b like 'ab%' FROM t1 WHERE a > 4 AND b like 'a%'; +b like 'ab%' +1 +1 +# Index access is used since k3 is forced and covering. +EXPLAIN SELECT b like 'ab%' FROM t1 FORCE INDEX(k3) WHERE a > 4 AND b like 'a%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 6 33.33 Parallel execute (1 workers) +2 SIMPLE t1 NULL index k3 k3 11 NULL 6 33.33 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`b` like 'ab%') AS `b like 'ab%'` from `test`.`t1` FORCE INDEX (`k3`) where ((`test`.`t1`.`a` > 4) and (`test`.`t1`.`b` like 'a%')) +SELECT b like 'ab%' FROM t1 FORCE INDEX(k3) WHERE a > 4 AND b like 'a%'; +b like 'ab%' +1 +1 +# No index access is used since second argument is not const. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 6 16.67 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 6 16.67 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like `test`.`t1`.`a`) +SELECT COUNT(*) FROM t1 WHERE b like a; +COUNT(*) +0 +DROP TABLE t1; +CREATE TABLE t1(a int, b TEXT, c TEXT, PRIMARY KEY(a))ENGINE=INNODB; +INSERT INTO t1 VALUES (1, 'a', 'a'), (2, 'ab', 'ab'), (3, 'abc', 'abc'), (4, 'abcd', 'abcd'), (5, 'abcde', 'abcde'); +ALTER TABLE t1 ADD KEY k2 (b(4), c(3)); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +# Index access is used since key is covering. +EXPLAIN SELECT COUNT(*) FROM t1 WHERE b like 'aaaa'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range k2 k2 19 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`b` like 'aaaa') +DROP TABLE t1; +# +# Bug#27660560 RECENT REGRESSION: CRASH IN CHECK_COVERING_PREFIX_KEYS. +# +CREATE TABLE t1(f1 BLOB, KEY(f1(1))) ENGINE=INNODB; +INSERT INTO t1 VALUES ('ccc'), ('aa'); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SELECT (f1 LIKE null) from t1; +(f1 LIKE null) +NULL +NULL +SELECT 1 FROM t1 WHERE f1 NOT LIKE json_merge('' ,'+' ); +ERROR 22032: Invalid JSON text in argument 1 to function json_merge_preserve: "The document is empty." at position 0. +SELECT 1 FROM t1 WHERE f1 LIKE json_contains('key2' ,'key4' ); +ERROR 22032: Invalid JSON text in argument 1 to function json_contains: "Invalid value." at position 0. +SELECT 1 FROM t1 WHERE f1 LIKE json_depth(null); +1 +EXPLAIN SELECT (f1 LIKE null) from t1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL index NULL f1 4 NULL 2 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`f1` like NULL) AS `(f1 LIKE null)` from `test`.`t1` +EXPLAIN SELECT (f1 LIKE null) from t1 WHERE f1 LIKE 'a%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL range f1 f1 4 NULL 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select (`test`.`t1`.`f1` like NULL) AS `(f1 LIKE null)` from `test`.`t1` where (`test`.`t1`.`f1` like 'a%') +DROP TABLE t1; +# +# Bug#28934315 CASE STATEMENT USE IN CONDITIONAL WITH SUB_PART INDEX REGRESSION IN 8.0. +# +CREATE TABLE t1 ( +id INT(11) NOT NULL AUTO_INCREMENT, +example VARCHAR(100) NOT NULL DEFAULT '', +PRIMARY KEY (id), +KEY example_key (example(9)) +) ENGINE=InnoDB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t2 ( +id INT(11) NOT NULL AUTO_INCREMENT, +example VARCHAR(100) NOT NULL DEFAULT '', +PRIMARY KEY (id) +) ENGINE=InnoDB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 (example) VALUES ('1234567890'); +INSERT INTO t2 (example) VALUES ('1234567890'); +EXPLAIN SELECT t2.example, t2.id FROM t2, t1 WHERE t1.example = LOWER(t2.example); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL ref example_key example_key 38 func 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`example` AS `example`,`test`.`t2`.`id` AS `id` from `test`.`t2` join `test`.`t1` where (`test`.`t1`.`example` = lower(`test`.`t2`.`example`)) +SELECT t2.example, t2.id FROM t2, t1 WHERE t1.example = LOWER(t2.example); +example id +1234567890 1 +DROP TABLE t1, t2; diff --git a/mysql-test/r/func_str.result-pq b/mysql-test/r/func_str.result-pq new file mode 100644 index 000000000000..cf96fc71d248 --- /dev/null +++ b/mysql-test/r/func_str.result-pq @@ -0,0 +1,5312 @@ +drop table if exists t1,t2; +set names latin1; +select 'hello',"'hello'",'""hello""','''h''e''l''l''o''',"hel""lo",'hel\'lo'; +hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lo +hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lo +select 'hello' 'monty'; +hello +hellomonty +select length('\n\t\r\b\0\_\%\\'); +length('\n\t\r\b\0\_\%\\') +10 +select bit_length('\n\t\r\b\0\_\%\\'); +bit_length('\n\t\r\b\0\_\%\\') +80 +select char_length('\n\t\r\b\0\_\%\\'); +char_length('\n\t\r\b\0\_\%\\') +10 +select length(_latin1'\n\t\n\b\0\\_\\%\\'); +length(_latin1'\n\t\n\b\0\\_\\%\\') +10 +select concat('monty',' was here ','again'),length('hello'),char(ascii('h')),ord('h'); +concat('monty',' was here ','again') length('hello') char(ascii('h')) ord('h') +monty was here again 5 h 104 +select hex(char(256)); +hex(char(256)) +0100 +select locate('he','hello'),locate('he','hello',2),locate('lo','hello',2) ; +locate('he','hello') locate('he','hello',2) locate('lo','hello',2) +1 0 4 +select instr('hello','HE'), instr('hello',binary 'HE'), instr(binary 'hello','HE'); +instr('hello','HE') instr('hello',binary 'HE') instr(binary 'hello','HE') +1 0 0 +select position(binary 'll' in 'hello'),position('a' in binary 'hello'); +position(binary 'll' in 'hello') position('a' in binary 'hello') +3 0 +select left('hello',null), right('hello',null); +left('hello',null) right('hello',null) +NULL NULL +select left('hello',2),right('hello',2),substring('hello',2,2),mid('hello',1,5) ; +left('hello',2) right('hello',2) substring('hello',2,2) mid('hello',1,5) +he lo el hello +select concat('',left(right(concat('what ',concat('is ','happening')),9),4),'',substring('monty',5,1)) ; +concat('',left(right(concat('what ',concat('is ','happening')),9),4),'',substring('monty',5,1)) +happy +select substring_index('www.tcx.se','.',-2),substring_index('www.tcx.se','.',1); +substring_index('www.tcx.se','.',-2) substring_index('www.tcx.se','.',1) +tcx.se www +select substring_index('www.tcx.se','tcx',1),substring_index('www.tcx.se','tcx',-1); +substring_index('www.tcx.se','tcx',1) substring_index('www.tcx.se','tcx',-1) +www. .se +select substring_index('.tcx.se','.',-2),substring_index('.tcx.se','.tcx',-1); +substring_index('.tcx.se','.',-2) substring_index('.tcx.se','.tcx',-1) +tcx.se .se +select substring_index('aaaaaaaaa1','a',1); +substring_index('aaaaaaaaa1','a',1) + +select substring_index('aaaaaaaaa1','aa',1); +substring_index('aaaaaaaaa1','aa',1) + +select substring_index('aaaaaaaaa1','aa',2); +substring_index('aaaaaaaaa1','aa',2) +aa +select substring_index('aaaaaaaaa1','aa',3); +substring_index('aaaaaaaaa1','aa',3) +aaaa +select substring_index('aaaaaaaaa1','aa',4); +substring_index('aaaaaaaaa1','aa',4) +aaaaaa +select substring_index('aaaaaaaaa1','aa',5); +substring_index('aaaaaaaaa1','aa',5) +aaaaaaaaa1 +select substring_index('aaaaaaaaa1','aaa',1); +substring_index('aaaaaaaaa1','aaa',1) + +select substring_index('aaaaaaaaa1','aaa',2); +substring_index('aaaaaaaaa1','aaa',2) +aaa +select substring_index('aaaaaaaaa1','aaa',3); +substring_index('aaaaaaaaa1','aaa',3) +aaaaaa +select substring_index('aaaaaaaaa1','aaa',4); +substring_index('aaaaaaaaa1','aaa',4) +aaaaaaaaa1 +select substring_index('aaaaaaaaa1','aaaa',1); +substring_index('aaaaaaaaa1','aaaa',1) + +select substring_index('aaaaaaaaa1','aaaa',2); +substring_index('aaaaaaaaa1','aaaa',2) +aaaa +select substring_index('aaaaaaaaa1','1',1); +substring_index('aaaaaaaaa1','1',1) +aaaaaaaaa +select substring_index('aaaaaaaaa1','a',-1); +substring_index('aaaaaaaaa1','a',-1) +1 +select substring_index('aaaaaaaaa1','aa',-1); +substring_index('aaaaaaaaa1','aa',-1) +1 +select substring_index('aaaaaaaaa1','aa',-2); +substring_index('aaaaaaaaa1','aa',-2) +aa1 +select substring_index('aaaaaaaaa1','aa',-3); +substring_index('aaaaaaaaa1','aa',-3) +aaaa1 +select substring_index('aaaaaaaaa1','aa',-4); +substring_index('aaaaaaaaa1','aa',-4) +aaaaaa1 +select substring_index('aaaaaaaaa1','aa',-5); +substring_index('aaaaaaaaa1','aa',-5) +aaaaaaaaa1 +select substring_index('aaaaaaaaa1','aaa',-1); +substring_index('aaaaaaaaa1','aaa',-1) +1 +select substring_index('aaaaaaaaa1','aaa',-2); +substring_index('aaaaaaaaa1','aaa',-2) +aaa1 +select substring_index('aaaaaaaaa1','aaa',-3); +substring_index('aaaaaaaaa1','aaa',-3) +aaaaaa1 +select substring_index('aaaaaaaaa1','aaa',-4); +substring_index('aaaaaaaaa1','aaa',-4) +aaaaaaaaa1 +select substring_index('the king of thethe hill','the',-2); +substring_index('the king of thethe hill','the',-2) +the hill +select substring_index('the king of the the hill','the',-2); +substring_index('the king of the the hill','the',-2) + the hill +select substring_index('the king of the the hill','the',-2); +substring_index('the king of the the hill','the',-2) + the hill +select substring_index('the king of the the hill',' the ',-1); +substring_index('the king of the the hill',' the ',-1) +hill +select substring_index('the king of the the hill',' the ',-2); +substring_index('the king of the the hill',' the ',-2) + the hill +select substring_index('the king of the the hill',' ',-1); +substring_index('the king of the the hill',' ',-1) +hill +select substring_index('the king of the the hill',' ',-2); +substring_index('the king of the the hill',' ',-2) +the hill +select substring_index('the king of the the hill',' ',-3); +substring_index('the king of the the hill',' ',-3) + the hill +select substring_index('the king of the the hill',' ',-4); +substring_index('the king of the the hill',' ',-4) +the the hill +select substring_index('the king of the the hill',' ',-5); +substring_index('the king of the the hill',' ',-5) +of the the hill +select substring_index('the king of the.the hill','the',-2); +substring_index('the king of the.the hill','the',-2) +.the hill +select substring_index('the king of thethethe.the hill','the',-3); +substring_index('the king of thethethe.the hill','the',-3) +the.the hill +select substring_index('the king of thethethe.the hill','the',-1); +substring_index('the king of thethethe.the hill','the',-1) + hill +select substring_index('the king of the the hill','the',1); +substring_index('the king of the the hill','the',1) + +select substring_index('the king of the the hill','the',2); +substring_index('the king of the the hill','the',2) +the king of +select substring_index('the king of the the hill','the',3); +substring_index('the king of the the hill','the',3) +the king of the +select concat(':',ltrim(' left '),':',rtrim(' right '),':'); +concat(':',ltrim(' left '),':',rtrim(' right '),':') +:left : right: +select concat(':',trim(leading from ' left '),':',trim(trailing from ' right '),':'); +concat(':',trim(leading from ' left '),':',trim(trailing from ' right '),':') +:left : right: +select concat(':',trim(LEADING FROM ' left'),':',trim(TRAILING FROM ' right '),':'); +concat(':',trim(LEADING FROM ' left'),':',trim(TRAILING FROM ' right '),':') +:left: right: +select concat(':',trim(' m '),':',trim(BOTH FROM ' y '),':',trim('*' FROM '*s*'),':'); +concat(':',trim(' m '),':',trim(BOTH FROM ' y '),':',trim('*' FROM '*s*'),':') +:m:y:s: +select concat(':',trim(BOTH 'ab' FROM 'ababmyabab'),':',trim(BOTH '*' FROM '***sql'),':'); +concat(':',trim(BOTH 'ab' FROM 'ababmyabab'),':',trim(BOTH '*' FROM '***sql'),':') +:my:sql: +select concat(':',trim(LEADING '.*' FROM '.*my'),':',trim(TRAILING '.*' FROM 'sql.*.*'),':'); +concat(':',trim(LEADING '.*' FROM '.*my'),':',trim(TRAILING '.*' FROM 'sql.*.*'),':') +:my:sql: +select TRIM("foo" FROM "foo"), TRIM("foo" FROM "foook"), TRIM("foo" FROM "okfoo"); +TRIM("foo" FROM "foo") TRIM("foo" FROM "foook") TRIM("foo" FROM "okfoo") + ok ok +select concat_ws(', ','monty','was here','again'); +concat_ws(', ','monty','was here','again') +monty, was here, again +select concat_ws(NULL,'a'),concat_ws(',',NULL,''); +concat_ws(NULL,'a') concat_ws(',',NULL,'') +NULL +select concat_ws(',','',NULL,'a'); +concat_ws(',','',NULL,'a') +,a +SELECT CONCAT('"',CONCAT_WS('";"',repeat('a',60),repeat('b',60),repeat('c',60),repeat('d',100)), '"'); +CONCAT('"',CONCAT_WS('";"',repeat('a',60),repeat('b',60),repeat('c',60),repeat('d',100)), '"') +"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";"cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc";"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" +select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es'); +insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es') +this is test +select replace('aaaa','a','b'),replace('aaaa','aa','b'),replace('aaaa','a','bb'),replace('aaaa','','b'),replace('bbbb','a','c'); +replace('aaaa','a','b') replace('aaaa','aa','b') replace('aaaa','a','bb') replace('aaaa','','b') replace('bbbb','a','c') +bbbb bb bbbbbbbb aaaa bbbb +select replace(concat(lcase(concat('THIS',' ','IS',' ','A',' ')),ucase('false'),' ','test'),'FALSE','REAL') ; +replace(concat(lcase(concat('THIS',' ','IS',' ','A',' ')),ucase('false'),' ','test'),'FALSE','REAL') +this is a REAL test +select soundex(''),soundex('he'),soundex('hello all folks'),soundex('#3556 in bugdb'); +soundex('') soundex('he') soundex('hello all folks') soundex('#3556 in bugdb') + H000 H4142 I51231 +select 'mood' sounds like 'mud'; +'mood' sounds like 'mud' +1 +select 'Glazgo' sounds like 'Liverpool'; +'Glazgo' sounds like 'Liverpool' +0 +select null sounds like 'null'; +null sounds like 'null' +NULL +select 'null' sounds like null; +'null' sounds like null +NULL +select null sounds like null; +null sounds like null +NULL +select md5('hello'); +md5('hello') +5d41402abc4b2a76b9719d911017c592 +select crc32("123"); +crc32("123") +2286445522 +select sha('abc'); +sha('abc') +a9993e364706816aba3e25717850c26c9cd0d89d +select sha1('abc'); +sha1('abc') +a9993e364706816aba3e25717850c26c9cd0d89d +select aes_decrypt(aes_encrypt('abc','1'),'1'); +aes_decrypt(aes_encrypt('abc','1'),'1') +abc +select aes_decrypt(aes_encrypt('abc','1'),1); +aes_decrypt(aes_encrypt('abc','1'),1) +abc +select aes_encrypt(NULL,"a"); +aes_encrypt(NULL,"a") +NULL +select aes_encrypt("a",NULL); +aes_encrypt("a",NULL) +NULL +select aes_decrypt(NULL,"a"); +aes_decrypt(NULL,"a") +NULL +select aes_decrypt("a",NULL); +aes_decrypt("a",NULL) +NULL +select aes_decrypt("a","a"); +aes_decrypt("a","a") +NULL +select aes_decrypt(aes_encrypt("","a"),"a"); +aes_decrypt(aes_encrypt("","a"),"a") + +select repeat('monty',5),concat('*',space(5),'*'); +repeat('monty',5) concat('*',space(5),'*') +montymontymontymontymonty * * +select reverse('abc'),reverse('abcd'); +reverse('abc') reverse('abcd') +cba dcba +select rpad('a',4,'1'),rpad('a',4,'12'),rpad('abcd',3,'12'), rpad(11, 10 , 22), rpad("ab", 10, 22); +rpad('a',4,'1') rpad('a',4,'12') rpad('abcd',3,'12') rpad(11, 10 , 22) rpad("ab", 10, 22) +a111 a121 abc 1122222222 ab22222222 +select lpad('a',4,'1'),lpad('a',4,'12'),lpad('abcd',3,'12'), lpad(11, 10 , 22); +lpad('a',4,'1') lpad('a',4,'12') lpad('abcd',3,'12') lpad(11, 10 , 22) +111a 121a abc 2222222211 +select rpad(741653838,17,'0'),lpad(741653838,17,'0'); +rpad(741653838,17,'0') lpad(741653838,17,'0') +74165383800000000 00000000741653838 +select rpad('abcd',7,'ab'),lpad('abcd',7,'ab'); +rpad('abcd',7,'ab') lpad('abcd',7,'ab') +abcdaba abaabcd +select rpad('abcd',1,'ab'),lpad('abcd',1,'ab'); +rpad('abcd',1,'ab') lpad('abcd',1,'ab') +a a +select rpad('STRING', 20, CONCAT('p','a','d') ); +rpad('STRING', 20, CONCAT('p','a','d') ) +STRINGpadpadpadpadpa +select lpad('STRING', 20, CONCAT('p','a','d') ); +lpad('STRING', 20, CONCAT('p','a','d') ) +padpadpadpadpaSTRING +select LEAST(NULL,'HARRY','HARRIOT',NULL,'HAROLD'),GREATEST(NULL,'HARRY','HARRIOT',NULL,'HAROLD'); +LEAST(NULL,'HARRY','HARRIOT',NULL,'HAROLD') GREATEST(NULL,'HARRY','HARRIOT',NULL,'HAROLD') +NULL NULL +select least(1,2,3) | greatest(16,32,8), least(5,4)*1,greatest(-1.0,1.0)*1,least(3,2,1)*1.0,greatest(1,1.1,1.0),least("10",9),greatest("A","B","0"); +least(1,2,3) | greatest(16,32,8) least(5,4)*1 greatest(-1.0,1.0)*1 least(3,2,1)*1.0 greatest(1,1.1,1.0) least("10",9) greatest("A","B","0") +33 4 1.0 1.0 1.1 10 B +select quote('\'\"\\test'); +quote('\'\"\\test') +'\'"\\test' +select quote(concat('abc\'', '\\cba')); +quote(concat('abc\'', '\\cba')) +'abc\'\\cba' +select quote(1/0), quote('\0\Z'); +quote(1/0) quote('\0\Z') +NULL '\0\Z' +Warnings: +Warning 1365 Division by 0 +select length(quote(concat(char(0),"test"))); +length(quote(concat(char(0),"test"))) +8 +select hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235)))); +hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235)))) +27E0E3E6E7E8EAEB27 +select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678"), unhex(NULL); +unhex(hex("foobar")) hex(unhex("1234567890ABCDEF")) unhex("345678") unhex(NULL) +foobar 1234567890ABCDEF 4Vx NULL +select hex(unhex("1")), hex(unhex("12")), hex(unhex("123")), hex(unhex("1234")), hex(unhex("12345")), hex(unhex("123456")); +hex(unhex("1")) hex(unhex("12")) hex(unhex("123")) hex(unhex("1234")) hex(unhex("12345")) hex(unhex("123456")) +01 12 0123 1234 012345 123456 +select length(unhex(md5("abrakadabra"))); +length(unhex(md5("abrakadabra"))) +16 +select concat('a', quote(NULL)); +concat('a', quote(NULL)) +aNULL +select reverse(""); +reverse("") + +select insert("aa",100,1,"b"),insert("aa",1,3,"b"),left("aa",-1),substring("a",1,2); +insert("aa",100,1,"b") insert("aa",1,3,"b") left("aa",-1) substring("a",1,2) +aa b a +select elt(2,1),field(NULL,"a","b","c"),reverse(""); +elt(2,1) field(NULL,"a","b","c") reverse("") +NULL 0 +select locate("a","b",2),locate("","a",1); +locate("a","b",2) locate("","a",1) +0 1 +select ltrim("a"),rtrim("a"),trim(BOTH "" from "a"),trim(BOTH " " from "a"); +ltrim("a") rtrim("a") trim(BOTH "" from "a") trim(BOTH " " from "a") +a a a a +select concat("1","2")|0,concat("1",".5")+0.0; +concat("1","2")|0 concat("1",".5")+0.0 +12 1.5 +select substring_index("www.tcx.se","",3); +substring_index("www.tcx.se","",3) + +select length(repeat("a",100000000)),length(repeat("a",1000*64)); +length(repeat("a",100000000)) length(repeat("a",1000*64)) +NULL 64000 +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (67108864) - truncated +select position("0" in "baaa" in (1)),position("0" in "1" in (1,2,3)),position("sql" in ("mysql")); +position("0" in "baaa" in (1)) position("0" in "1" in (1,2,3)) position("sql" in ("mysql")) +1 0 3 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'baaa' +select position(("1" in (1,2,3)) in "01"); +position(("1" in (1,2,3)) in "01") +2 +select length(repeat("a",65500)),length(concat(repeat("a",32000),repeat("a",32000))),length(replace("aaaaa","a",concat(repeat("a",10000)))),length(insert(repeat("a",40000),1,30000,repeat("b",50000))); +length(repeat("a",65500)) length(concat(repeat("a",32000),repeat("a",32000))) length(replace("aaaaa","a",concat(repeat("a",10000)))) length(insert(repeat("a",40000),1,30000,repeat("b",50000))) +65500 64000 50000 60000 +select length(repeat("a",1000000)),length(concat(repeat("a",32000),repeat("a",32000),repeat("a",32000))),length(replace("aaaaa","a",concat(repeat("a",32000)))),length(insert(repeat("a",48000),1,1000,repeat("a",48000))); +length(repeat("a",1000000)) length(concat(repeat("a",32000),repeat("a",32000),repeat("a",32000))) length(replace("aaaaa","a",concat(repeat("a",32000)))) length(insert(repeat("a",48000),1,1000,repeat("a",48000))) +1000000 96000 160000 95000 +create table t1 ( domain char(50) ); +insert into t1 VALUES ("hello.de" ), ("test.de" ); +select domain from t1 where concat('@', trim(leading '.' from concat('.', domain))) = '@hello.de'; +domain +hello.de +select domain from t1 where concat('@', trim(leading '.' from concat('.', domain))) = '@test.de'; +domain +test.de +drop table t1; +CREATE TABLE t1 (i int, j int); +INSERT INTO t1 VALUES (1,1),(2,2); +SELECT DISTINCT i, ELT(j, '345', '34') FROM t1; +i ELT(j, '345', '34') +1 345 +2 34 +DROP TABLE t1; +create table t1(a char(4)); +insert into t1 values ('one'),(NULL),('two'),('four'); +select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1; +a quote(a) isnull(quote(a)) quote(a) is null ifnull(quote(a), 'n') +one 'one' 0 0 'one' +NULL NULL 0 0 NULL +two 'two' 0 0 'two' +four 'four' 0 0 'four' +drop table t1; +select trim(trailing 'foo' from 'foo'); +trim(trailing 'foo' from 'foo') + +select trim(leading 'foo' from 'foo'); +trim(leading 'foo' from 'foo') + +select quote(ltrim(concat(' ', 'a'))); +quote(ltrim(concat(' ', 'a'))) +'a' +select quote(trim(concat(' ', 'a'))); +quote(trim(concat(' ', 'a'))) +'a' +CREATE TABLE t1 SELECT 1 UNION SELECT 2 UNION SELECT 3; +SELECT QUOTE('A') FROM t1; +QUOTE('A') +'A' +'A' +'A' +DROP TABLE t1; +select 1=_latin1'1'; +1=_latin1'1' +1 +select _latin1'1'=1; +_latin1'1'=1 +1 +select _latin2'1'=1; +_latin2'1'=1 +1 +select 1=_latin2'1'; +1=_latin2'1' +1 +select _latin1'1'=_latin2'1'; +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation '=' +select row('a','b','c') = row('a','b','c'); +row('a','b','c') = row('a','b','c') +1 +select row('A','b','c') = row('a','b','c'); +row('A','b','c') = row('a','b','c') +1 +select row('A' COLLATE latin1_bin,'b','c') = row('a','b','c'); +row('A' COLLATE latin1_bin,'b','c') = row('a','b','c') +0 +select row('A','b','c') = row('a' COLLATE latin1_bin,'b','c'); +row('A','b','c') = row('a' COLLATE latin1_bin,'b','c') +0 +select row('A' COLLATE latin1_general_ci,'b','c') = row('a' COLLATE latin1_bin,'b','c'); +ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT) and (latin1_bin,EXPLICIT) for operation '=' +select concat(_latin1'a',_latin2'a'); +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'concat' +select concat(_latin1'a',_latin2'a',_latin5'a'); +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE), (latin2_general_ci,COERCIBLE), (latin5_turkish_ci,COERCIBLE) for operation 'concat' +select concat(_latin1'a',_latin2'a',_latin5'a',_latin7'a'); +ERROR HY000: Illegal mix of collations for operation 'concat' +select concat_ws(_latin1'a',_latin2'a'); +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'concat_ws' +select FIELD('b','A','B'); +FIELD('b','A','B') +2 +select FIELD('B','A','B'); +FIELD('B','A','B') +2 +select FIELD('b' COLLATE latin1_bin,'A','B'); +FIELD('b' COLLATE latin1_bin,'A','B') +0 +select FIELD('b','A' COLLATE latin1_bin,'B'); +FIELD('b','A' COLLATE latin1_bin,'B') +0 +select FIELD(_latin2'b','A','B'); +ERROR HY000: Illegal mix of collations (latin2_general_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE) for operation 'field' +select FIELD('b',_latin2'A','B'); +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE), (latin2_general_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE) for operation 'field' +select FIELD('1',_latin2'3','2',1); +FIELD('1',_latin2'3','2',1) +3 +select POSITION(_latin1'B' IN _latin1'abcd'); +POSITION(_latin1'B' IN _latin1'abcd') +2 +select POSITION(_latin1'B' IN _latin1'abcd' COLLATE latin1_bin); +POSITION(_latin1'B' IN _latin1'abcd' COLLATE latin1_bin) +0 +select POSITION(_latin1'B' COLLATE latin1_bin IN _latin1'abcd'); +POSITION(_latin1'B' COLLATE latin1_bin IN _latin1'abcd') +0 +select POSITION(_latin1'B' COLLATE latin1_general_ci IN _latin1'abcd' COLLATE latin1_bin); +ERROR HY000: Illegal mix of collations (latin1_bin,EXPLICIT) and (latin1_general_ci,EXPLICIT) for operation 'locate' +select POSITION(_latin1'B' IN _latin2'abcd'); +ERROR HY000: Illegal mix of collations (latin2_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'locate' +select FIND_IN_SET(_latin1'B',_latin1'a,b,c,d'); +FIND_IN_SET(_latin1'B',_latin1'a,b,c,d') +2 +select FIND_IN_SET(_latin1'B' COLLATE latin1_general_ci,_latin1'a,b,c,d' COLLATE latin1_bin); +ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT) and (latin1_bin,EXPLICIT) for operation 'find_in_set' +select FIND_IN_SET(_latin1'B',_latin2'a,b,c,d'); +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'find_in_set' +select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd',2); +SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd',2) +abcdabc +select SUBSTRING_INDEX(_latin1'abcdabcdabcd' COLLATE latin1_bin,_latin1'd',2); +SUBSTRING_INDEX(_latin1'abcdabcdabcd' COLLATE latin1_bin,_latin1'd',2) +abcdabc +select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd' COLLATE latin1_bin,2); +SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd' COLLATE latin1_bin,2) +abcdabc +select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin2'd',2); +SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin2'd',2) +abcdabc +select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin2 0xa3, 2); +ERROR HY000: Cannot convert string '\xA3' from latin2 to latin1 +select SUBSTRING_INDEX(_latin1'abcdabcdabcd' COLLATE latin1_general_ci,_latin1'd' COLLATE latin1_bin,2); +SUBSTRING_INDEX(_latin1'abcdabcdabcd' COLLATE latin1_general_ci,_latin1'd' COLLATE latin1_bin,2) +abcdabc +select _latin1'B' between _latin1'a' and _latin1'c'; +_latin1'B' between _latin1'a' and _latin1'c' +1 +select _latin1'B' collate latin1_bin between _latin1'a' and _latin1'c'; +_latin1'B' collate latin1_bin between _latin1'a' and _latin1'c' +0 +select _latin1'B' between _latin1'a' collate latin1_bin and _latin1'c'; +_latin1'B' between _latin1'a' collate latin1_bin and _latin1'c' +0 +select _latin1'B' between _latin1'a' and _latin1'c' collate latin1_bin; +_latin1'B' between _latin1'a' and _latin1'c' collate latin1_bin +0 +select _latin2'B' between _latin1'a' and _latin1'b'; +ERROR HY000: Illegal mix of collations (latin2_general_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE) for operation 'between' +select _latin1'B' between _latin2'a' and _latin1'b'; +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE), (latin2_general_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE) for operation 'between' +select _latin1'B' between _latin1'a' and _latin2'b'; +ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE), (latin1_swedish_ci,COERCIBLE), (latin2_general_ci,COERCIBLE) for operation 'between' +select _latin1'B' collate latin1_general_ci between _latin1'a' collate latin1_bin and _latin1'b'; +ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT), (latin1_bin,EXPLICIT), (latin1_swedish_ci,COERCIBLE) for operation 'between' +select _latin1'B' in (_latin1'a',_latin1'b'); +_latin1'B' in (_latin1'a',_latin1'b') +1 +select _latin1'B' collate latin1_bin in (_latin1'a',_latin1'b'); +_latin1'B' collate latin1_bin in (_latin1'a',_latin1'b') +0 +select _latin1'B' in (_latin1'a' collate latin1_bin,_latin1'b'); +_latin1'B' in (_latin1'a' collate latin1_bin,_latin1'b') +0 +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 ' +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 ' +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 ' +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 ' +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 ' +select collation(bin(130)), coercibility(bin(130)); +collation(bin(130)) coercibility(bin(130)) +latin1_swedish_ci 4 +select collation(oct(130)), coercibility(oct(130)); +collation(oct(130)) coercibility(oct(130)) +latin1_swedish_ci 4 +select collation(conv(130,16,10)), coercibility(conv(130,16,10)); +collation(conv(130,16,10)) coercibility(conv(130,16,10)) +latin1_swedish_ci 4 +select collation(hex(130)), coercibility(hex(130)); +collation(hex(130)) coercibility(hex(130)) +latin1_swedish_ci 4 +select collation(char(130)), coercibility(hex(130)); +collation(char(130)) coercibility(hex(130)) +binary 4 +select collation(format(130,10)), coercibility(format(130,10)); +collation(format(130,10)) coercibility(format(130,10)) +latin1_swedish_ci 4 +select collation(lcase(_latin2'a')), coercibility(lcase(_latin2'a')); +collation(lcase(_latin2'a')) coercibility(lcase(_latin2'a')) +latin2_general_ci 4 +select collation(ucase(_latin2'a')), coercibility(ucase(_latin2'a')); +collation(ucase(_latin2'a')) coercibility(ucase(_latin2'a')) +latin2_general_ci 4 +select collation(left(_latin2'a',1)), coercibility(left(_latin2'a',1)); +collation(left(_latin2'a',1)) coercibility(left(_latin2'a',1)) +latin2_general_ci 4 +select collation(right(_latin2'a',1)), coercibility(right(_latin2'a',1)); +collation(right(_latin2'a',1)) coercibility(right(_latin2'a',1)) +latin2_general_ci 4 +select collation(substring(_latin2'a',1,1)), coercibility(substring(_latin2'a',1,1)); +collation(substring(_latin2'a',1,1)) coercibility(substring(_latin2'a',1,1)) +latin2_general_ci 4 +select collation(concat(_latin2'a',_latin2'b')), coercibility(concat(_latin2'a',_latin2'b')); +collation(concat(_latin2'a',_latin2'b')) coercibility(concat(_latin2'a',_latin2'b')) +latin2_general_ci 4 +select collation(lpad(_latin2'a',4,_latin2'b')), coercibility(lpad(_latin2'a',4,_latin2'b')); +collation(lpad(_latin2'a',4,_latin2'b')) coercibility(lpad(_latin2'a',4,_latin2'b')) +latin2_general_ci 4 +select collation(rpad(_latin2'a',4,_latin2'b')), coercibility(rpad(_latin2'a',4,_latin2'b')); +collation(rpad(_latin2'a',4,_latin2'b')) coercibility(rpad(_latin2'a',4,_latin2'b')) +latin2_general_ci 4 +select collation(concat_ws(_latin2'a',_latin2'b')), coercibility(concat_ws(_latin2'a',_latin2'b')); +collation(concat_ws(_latin2'a',_latin2'b')) coercibility(concat_ws(_latin2'a',_latin2'b')) +latin2_general_ci 4 +select collation(make_set(255,_latin2'a',_latin2'b',_latin2'c')), coercibility(make_set(255,_latin2'a',_latin2'b',_latin2'c')); +collation(make_set(255,_latin2'a',_latin2'b',_latin2'c')) coercibility(make_set(255,_latin2'a',_latin2'b',_latin2'c')) +latin2_general_ci 4 +select collation(export_set(255,_latin2'y',_latin2'n',_latin2' ')), coercibility(export_set(255,_latin2'y',_latin2'n',_latin2' ')); +collation(export_set(255,_latin2'y',_latin2'n',_latin2' ')) coercibility(export_set(255,_latin2'y',_latin2'n',_latin2' ')) +latin2_general_ci 4 +select collation(trim(_latin2' a ')), coercibility(trim(_latin2' a ')); +collation(trim(_latin2' a ')) coercibility(trim(_latin2' a ')) +latin2_general_ci 4 +select collation(ltrim(_latin2' a ')), coercibility(ltrim(_latin2' a ')); +collation(ltrim(_latin2' a ')) coercibility(ltrim(_latin2' a ')) +latin2_general_ci 4 +select collation(rtrim(_latin2' a ')), coercibility(rtrim(_latin2' a ')); +collation(rtrim(_latin2' a ')) coercibility(rtrim(_latin2' a ')) +latin2_general_ci 4 +select collation(trim(LEADING _latin2' ' FROM _latin2'a')), coercibility(trim(LEADING _latin2'a' FROM _latin2'a')); +collation(trim(LEADING _latin2' ' FROM _latin2'a')) coercibility(trim(LEADING _latin2'a' FROM _latin2'a')) +latin2_general_ci 4 +select collation(trim(TRAILING _latin2' ' FROM _latin2'a')), coercibility(trim(TRAILING _latin2'a' FROM _latin2'a')); +collation(trim(TRAILING _latin2' ' FROM _latin2'a')) coercibility(trim(TRAILING _latin2'a' FROM _latin2'a')) +latin2_general_ci 4 +select collation(trim(BOTH _latin2' ' FROM _latin2'a')), coercibility(trim(BOTH _latin2'a' FROM _latin2'a')); +collation(trim(BOTH _latin2' ' FROM _latin2'a')) coercibility(trim(BOTH _latin2'a' FROM _latin2'a')) +latin2_general_ci 4 +select collation(repeat(_latin2'a',10)), coercibility(repeat(_latin2'a',10)); +collation(repeat(_latin2'a',10)) coercibility(repeat(_latin2'a',10)) +latin2_general_ci 4 +select collation(reverse(_latin2'ab')), coercibility(reverse(_latin2'ab')); +collation(reverse(_latin2'ab')) coercibility(reverse(_latin2'ab')) +latin2_general_ci 4 +select collation(quote(_latin2'ab')), coercibility(quote(_latin2'ab')); +collation(quote(_latin2'ab')) coercibility(quote(_latin2'ab')) +latin2_general_ci 4 +select collation(soundex(_latin2'ab')), coercibility(soundex(_latin2'ab')); +collation(soundex(_latin2'ab')) coercibility(soundex(_latin2'ab')) +latin2_general_ci 4 +select collation(substring(_latin2'ab',1)), coercibility(substring(_latin2'ab',1)); +collation(substring(_latin2'ab',1)) coercibility(substring(_latin2'ab',1)) +latin2_general_ci 4 +select collation(insert(_latin2'abcd',2,3,_latin2'ef')), coercibility(insert(_latin2'abcd',2,3,_latin2'ef')); +collation(insert(_latin2'abcd',2,3,_latin2'ef')) coercibility(insert(_latin2'abcd',2,3,_latin2'ef')) +latin2_general_ci 4 +select collation(replace(_latin2'abcd',_latin2'b',_latin2'B')), coercibility(replace(_latin2'abcd',_latin2'b',_latin2'B')); +collation(replace(_latin2'abcd',_latin2'b',_latin2'B')) coercibility(replace(_latin2'abcd',_latin2'b',_latin2'B')) +latin2_general_ci 4 +create table t1 charset latin1 +select +bin(130), +oct(130), +conv(130,16,10), +hex(130), +char(130), +format(130,10), +left(_latin2'a',1), +right(_latin2'a',1), +lcase(_latin2'a'), +ucase(_latin2'a'), +substring(_latin2'a',1,1), +concat(_latin2'a',_latin2'b'), +lpad(_latin2'a',4,_latin2'b'), +rpad(_latin2'a',4,_latin2'b'), +concat_ws(_latin2'a',_latin2'b'), +make_set(255,_latin2'a',_latin2'b',_latin2'c'), +export_set(255,_latin2'y',_latin2'n',_latin2' '), +trim(_latin2' a '), +ltrim(_latin2' a '), +rtrim(_latin2' a '), +trim(LEADING _latin2' ' FROM _latin2' a '), +trim(TRAILING _latin2' ' FROM _latin2' a '), +trim(BOTH _latin2' ' FROM _latin2' a '), +repeat(_latin2'a',10), +reverse(_latin2'ab'), +quote(_latin2'ab'), +soundex(_latin2'ab'), +substring(_latin2'ab',1), +insert(_latin2'abcd',2,3,_latin2'ef'), +replace(_latin2'abcd',_latin2'b',_latin2'B') +; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `bin(130)` varchar(65) DEFAULT NULL, + `oct(130)` varchar(65) DEFAULT NULL, + `conv(130,16,10)` varchar(65) DEFAULT NULL, + `hex(130)` varchar(6) DEFAULT NULL, + `char(130)` varbinary(4) DEFAULT NULL, + `format(130,10)` varchar(36) DEFAULT NULL, + `left(_latin2'a',1)` varchar(1) CHARACTER SET latin2 DEFAULT NULL, + `right(_latin2'a',1)` varchar(1) CHARACTER SET latin2 DEFAULT NULL, + `lcase(_latin2'a')` varchar(1) CHARACTER SET latin2 DEFAULT NULL, + `ucase(_latin2'a')` varchar(1) CHARACTER SET latin2 DEFAULT NULL, + `substring(_latin2'a',1,1)` varchar(1) CHARACTER SET latin2 DEFAULT NULL, + `concat(_latin2'a',_latin2'b')` varchar(2) CHARACTER SET latin2 DEFAULT NULL, + `lpad(_latin2'a',4,_latin2'b')` varchar(4) CHARACTER SET latin2 DEFAULT NULL, + `rpad(_latin2'a',4,_latin2'b')` varchar(4) CHARACTER SET latin2 DEFAULT NULL, + `concat_ws(_latin2'a',_latin2'b')` varchar(1) CHARACTER SET latin2 DEFAULT NULL, + `make_set(255,_latin2'a',_latin2'b',_latin2'c')` varchar(5) CHARACTER SET latin2 NOT NULL DEFAULT '', + `export_set(255,_latin2'y',_latin2'n',_latin2' ')` varchar(127) CHARACTER SET latin2 DEFAULT NULL, + `trim(_latin2' a ')` varchar(3) CHARACTER SET latin2 DEFAULT NULL, + `ltrim(_latin2' a ')` varchar(3) CHARACTER SET latin2 DEFAULT NULL, + `rtrim(_latin2' a ')` varchar(3) CHARACTER SET latin2 DEFAULT NULL, + `trim(LEADING _latin2' ' FROM _latin2' a ')` varchar(3) CHARACTER SET latin2 DEFAULT NULL, + `trim(TRAILING _latin2' ' FROM _latin2' a ')` varchar(3) CHARACTER SET latin2 DEFAULT NULL, + `trim(BOTH _latin2' ' FROM _latin2' a ')` varchar(3) CHARACTER SET latin2 DEFAULT NULL, + `repeat(_latin2'a',10)` varchar(10) CHARACTER SET latin2 DEFAULT NULL, + `reverse(_latin2'ab')` varchar(2) CHARACTER SET latin2 DEFAULT NULL, + `quote(_latin2'ab')` varchar(6) CHARACTER SET latin2 DEFAULT NULL, + `soundex(_latin2'ab')` varchar(4) CHARACTER SET latin2 DEFAULT NULL, + `substring(_latin2'ab',1)` varchar(2) CHARACTER SET latin2 DEFAULT NULL, + `insert(_latin2'abcd',2,3,_latin2'ef')` varchar(6) CHARACTER SET latin2 DEFAULT NULL, + `replace(_latin2'abcd',_latin2'b',_latin2'B')` varchar(4) CHARACTER SET latin2 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (a char character set latin2); +insert into t1 values (null); +select charset(a), collation(a), coercibility(a) from t1; +charset(a) collation(a) coercibility(a) +latin2 latin2_general_ci 2 +drop table t1; +select charset(null), collation(null), coercibility(null); +charset(null) collation(null) coercibility(null) +binary binary 6 +CREATE TABLE t1 (a int, b int); +CREATE TABLE t2 (a int, b int); +INSERT INTO t1 VALUES (1,1),(2,2); +INSERT INTO t2 VALUES (2,2),(3,3); +select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b) +where collation(t2.a) = _utf8'binary' order by t1.a,t2.a; +a b a b +1 1 NULL NULL +2 2 2 2 +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b) +where charset(t2.a) = _utf8'binary' order by t1.a,t2.a; +a b a b +1 1 NULL NULL +2 2 2 2 +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +select t1.*,t2.* from t1 left join t2 on (t1.b=t2.b) +where coercibility(t2.a) = 5 order by t1.a,t2.a; +a b a b +1 1 NULL NULL +2 2 2 2 +DROP TABLE t1, t2; +select SUBSTR('abcdefg',3,2); +SUBSTR('abcdefg',3,2) +cd +select SUBSTRING('abcdefg',3,2); +SUBSTRING('abcdefg',3,2) +cd +select SUBSTR('abcdefg',-3,2) FROM DUAL; +SUBSTR('abcdefg',-3,2) +ef +select SUBSTR('abcdefg',-1,5) FROM DUAL; +SUBSTR('abcdefg',-1,5) +g +select SUBSTR('abcdefg',0,0) FROM DUAL; +SUBSTR('abcdefg',0,0) + +select SUBSTR('abcdefg',-1,-1) FROM DUAL; +SUBSTR('abcdefg',-1,-1) + +select SUBSTR('abcdefg',1,-1) FROM DUAL; +SUBSTR('abcdefg',1,-1) + +create table t7 (s1 char) charset latin1; +select * from t7 +where concat(s1 collate latin1_general_ci,s1 collate latin1_swedish_ci) = 'AA'; +ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT) and (latin1_swedish_ci,EXPLICIT) for operation 'concat' +drop table t7; +select substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2),substring_index("1abcd;2abcd;3abcd;4abcd", ';', -2); +substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2) substring_index("1abcd;2abcd;3abcd;4abcd", ';', -2) +1abcd;2abcd 3abcd;4abcd +explain select md5('hello'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select md5('hello') AS `md5('hello')` +explain select sha('abc'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select sha('abc') AS `sha('abc')` +explain select sha1('abc'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select sha('abc') AS `sha1('abc')` +explain select soundex(''); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select soundex('') AS `soundex('')` +explain select 'mood' sounds like 'mud'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select (soundex('mood') = soundex('mud')) AS `'mood' sounds like 'mud'` +explain select aes_decrypt(aes_encrypt('abc','1'),'1'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select aes_decrypt(aes_encrypt('abc','1'),'1') AS `aes_decrypt(aes_encrypt('abc','1'),'1')` +explain select concat('*',space(5),'*'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select concat('*',space(5),'*') AS `concat('*',space(5),'*')` +explain select reverse('abc'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select reverse('abc') AS `reverse('abc')` +explain select rpad('a',4,'1'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select rpad('a',4,'1') AS `rpad('a',4,'1')` +explain select lpad('a',4,'1'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select lpad('a',4,'1') AS `lpad('a',4,'1')` +explain select concat_ws(',','',NULL,'a'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select concat_ws(',','',NULL,'a') AS `concat_ws(',','',NULL,'a')` +explain select make_set(255,_latin2'a', _latin2'b', _latin2'c'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select make_set(255,_latin2'a',_latin2'b',_latin2'c') AS `make_set(255,_latin2'a', _latin2'b', _latin2'c')` +explain select elt(2,1); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select elt(2,1) AS `elt(2,1)` +explain select locate("a","b",2); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select locate('a','b',2) AS `locate("a","b",2)` +explain select format(130,10); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select format(130,10) AS `format(130,10)` +explain select char(0); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select char(0) AS `char(0)` +explain select conv(130,16,10); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select conv(130,16,10) AS `conv(130,16,10)` +explain select hex(130); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select hex(130) AS `hex(130)` +explain select binary 'HE'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select cast('HE' as char charset binary) AS `binary 'HE'` +explain select export_set(255,_latin2'y', _latin2'n', _latin2' '); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select export_set(255,_latin2'y',_latin2'n',_latin2' ') AS `export_set(255,_latin2'y', _latin2'n', _latin2' ')` +explain select FIELD('b' COLLATE latin1_bin,'A','B'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select field(('b' collate latin1_bin),'A','B') AS `FIELD('b' COLLATE latin1_bin,'A','B')` +explain select FIND_IN_SET(_latin1'B', _latin1'a,b,c,d'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select find_in_set(_latin1'B',_latin1'a,b,c,d') AS `FIND_IN_SET(_latin1'B', _latin1'a,b,c,d')` +explain select collation(conv(130,16,10)); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select collation(conv(130,16,10)) AS `collation(conv(130,16,10))` +explain select coercibility(conv(130,16,10)); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select coercibility(conv(130,16,10)) AS `coercibility(conv(130,16,10))` +explain select length('\n\t\r\b\0\_\%\\'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select length('\n \r\0\\_\\%\\') AS `length('\n\t\r\b\0\_\%\\')` +explain select bit_length('\n\t\r\b\0\_\%\\'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select bit_length('\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')` +explain select bit_length('\n\t\r\b\0\_\%\\'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select bit_length('\n \r\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')` +explain select concat('monty',' was here ','again'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select concat('monty',' was here ','again') AS `concat('monty',' was here ','again')` +explain select length('hello'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select length('hello') AS `length('hello')` +explain select char(ascii('h')); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select char(ascii('h')) AS `char(ascii('h'))` +explain select ord('h'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select ord('h') AS `ord('h')` +explain select quote(1/0); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select quote((1 / 0)) AS `quote(1/0)` +explain select crc32("123"); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select crc32('123') AS `crc32("123")` +explain select replace('aaaa','a','b'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select replace('aaaa','a','b') AS `replace('aaaa','a','b')` +explain select insert('txs',2,1,'hi'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select insert('txs',2,1,'hi') AS `insert('txs',2,1,'hi')` +explain select left(_latin2'a',1); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select left(_latin2'a',1) AS `left(_latin2'a',1)` +explain select right(_latin2'a',1); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select right(_latin2'a',1) AS `right(_latin2'a',1)` +explain select lcase(_latin2'a'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select lower(_latin2'a') AS `lcase(_latin2'a')` +explain select ucase(_latin2'a'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select upper(_latin2'a') AS `ucase(_latin2'a')` +explain select SUBSTR('abcdefg',3,2); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select substr('abcdefg',3,2) AS `SUBSTR('abcdefg',3,2)` +explain select substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select substring_index('1abcd;2abcd;3abcd;4abcd',';',2) AS `substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2)` +explain select trim(_latin2' a '); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select trim(_latin2' a ') AS `trim(_latin2' a ')` +explain select ltrim(_latin2' a '); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select ltrim(_latin2' a ') AS `ltrim(_latin2' a ')` +explain select rtrim(_latin2' a '); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ select rtrim(_latin2' a ') AS `rtrim(_latin2' a ')` +SELECT lpad(12345, 5, "#"); +lpad(12345, 5, "#") +12345 +SELECT conv(71, 10, 36), conv('1Z', 36, 10); +conv(71, 10, 36) conv('1Z', 36, 10) +1Z 71 +SELECT conv(71, 10, 37), conv('1Z', 37, 10), conv(0,1,10),conv(0,0,10), conv(0,-1,10); +conv(71, 10, 37) conv('1Z', 37, 10) conv(0,1,10) conv(0,0,10) conv(0,-1,10) +NULL NULL NULL NULL NULL +create table t1 (id int(1), str varchar(10)) DEFAULT CHARSET=utf8; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t1 values (1,'aaaaaaaaaa'), (2,'bbbbbbbbbb'); +create table t2 (id int(1), str varchar(10)) DEFAULT CHARSET=utf8; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t2 values (1,'cccccccccc'), (2,'dddddddddd'); +select substring(concat(t1.str, t2.str), 1, 15) "name" from t1, t2 +where t2.id=t1.id order by name; +name +aaaaaaaaaaccccc +bbbbbbbbbbddddd +drop table t1, t2; +create table t1 (c1 INT, c2 INT UNSIGNED); +insert ignore into t1 values ('21474836461','21474836461'); +Warnings: +Warning 1264 Out of range value for column 'c1' at row 1 +Warning 1264 Out of range value for column 'c2' at row 1 +insert ignore into t1 values ('-21474836461','-21474836461'); +Warnings: +Warning 1264 Out of range value for column 'c1' at row 1 +Warning 1264 Out of range value for column 'c2' at row 1 +show warnings; +Level Code Message +Warning 1264 Out of range value for column 'c1' at row 1 +Warning 1264 Out of range value for column 'c2' at row 1 +select * from t1; +c1 c2 +2147483647 4294967295 +-2147483648 0 +drop table t1; +select left(1234, 3) + 0; +left(1234, 3) + 0 +123 +create table t1 (a int not null primary key, b varchar(40), c datetime); +insert into t1 (a,b,c) values (1,'Tom','2004-12-10 12:13:14'),(2,'ball games','2004-12-10 12:13:14'), (3,'Basil','2004-12-10 12:13:14'), (4,'Dean','2004-12-10 12:13:14'),(5,'Ellis','2004-12-10 12:13:14'), (6,'Serg','2004-12-10 12:13:14'), (7,'Sergei','2004-12-10 12:13:14'),(8,'Georg','2004-12-10 12:13:14'),(9,'Salle','2004-12-10 12:13:14'),(10,'Sinisa','2004-12-10 12:13:14'); +select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12; +total reg +10 2004-12-10 +drop table t1; +select trim(null from 'kate') as "must_be_null"; +must_be_null +NULL +select trim('xyz' from null) as "must_be_null"; +must_be_null +NULL +select trim(leading NULL from 'kate') as "must_be_null"; +must_be_null +NULL +select trim(trailing NULL from 'xyz') as "must_be_null"; +must_be_null +NULL +SELECT CHAR(NULL,121,83,81,'76') as my_column; +my_column +ySQL +SELECT CHAR_LENGTH(CHAR(NULL,121,83,81,'76')) as my_column; +my_column +4 +CREATE TABLE t1 (id int PRIMARY KEY, str char(255) NOT NULL) charset latin1; +CREATE TABLE t2 (id int NOT NULL UNIQUE); +INSERT INTO t2 VALUES (1),(2); +INSERT INTO t1 VALUES (1, aes_encrypt('foo', 'bar')); +INSERT INTO t1 VALUES (2, 'not valid'); +SELECT t1.id, aes_decrypt(str, 'bar') FROM t1, t2 WHERE t1.id = t2.id; +id aes_decrypt(str, 'bar') +1 foo +2 NULL +SELECT t1.id, aes_decrypt(str, 'bar') FROM t1, t2 WHERE t1.id = t2.id +ORDER BY t1.id; +id aes_decrypt(str, 'bar') +1 foo +2 NULL +DROP TABLE t1, t2; +select field(0,NULL,1,0), field("",NULL,"bar",""), field(0.0,NULL,1.0,0.0); +field(0,NULL,1,0) field("",NULL,"bar","") field(0.0,NULL,1.0,0.0) +3 3 3 +select field(NULL,1,2,NULL), field(NULL,1,2,0); +field(NULL,1,2,NULL) field(NULL,1,2,0) +0 0 +CREATE TABLE t1 (str varchar(20) PRIMARY KEY); +CREATE TABLE t2 (num int primary key); +INSERT INTO t1 VALUES ('notnumber'); +INSERT INTO t2 VALUES (0), (1); +SELECT * FROM t1, t2 WHERE num=str; +str num +notnumber 0 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'notnumber' +SELECT * FROM t1, t2 WHERE num=substring(str from 1 for 6); +str num +notnumber 0 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'notnum' +DROP TABLE t1,t2; +CREATE TABLE t1( +id int(11) NOT NULL auto_increment, +pc int(11) NOT NULL default '0', +title varchar(20) default NULL, +PRIMARY KEY (id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +(1, 0, 'Main'), +(2, 1, 'Toys'), +(3, 1, 'Games'); +SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1 +FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id +LEFT JOIN t1 AS t3 ON t2.pc=t3.id; +id col1 +1 Main +2 Main->Toys +3 Main->Games +SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1 +FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id +LEFT JOIN t1 AS t3 ON t2.pc=t3.id +WHERE CONCAT_WS('->', t3.title, t2.title, t1.title) LIKE '%Toys%'; +id col1 +2 Main->Toys +DROP TABLE t1; +CREATE TABLE t1( +trackid int(10) unsigned NOT NULL auto_increment, +trackname varchar(100) NOT NULL default '', +PRIMARY KEY (trackid) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t2( +artistid int(10) unsigned NOT NULL auto_increment, +artistname varchar(100) NOT NULL default '', +PRIMARY KEY (artistid) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t3( +trackid int(10) unsigned NOT NULL, +artistid int(10) unsigned NOT NULL, +PRIMARY KEY (trackid,artistid) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (1, 'April In Paris'), (2, 'Autumn In New York'); +INSERT INTO t2 VALUES (1, 'Vernon Duke'); +INSERT INTO t3 VALUES (1,1); +SELECT CONCAT_WS(' ', trackname, artistname) trackname, artistname +FROM t1 LEFT JOIN t3 ON t1.trackid=t3.trackid +LEFT JOIN t2 ON t2.artistid=t3.artistid +WHERE CONCAT_WS(' ', trackname, artistname) LIKE '%In%'; +trackname artistname +April In Paris Vernon Duke Vernon Duke +Autumn In New York NULL +DROP TABLE t1,t2,t3; +create table t1 (b varchar(5)); +insert t1 values ('ab'), ('abc'), ('abcd'), ('abcde'); +select *,substring(b,1),substring(b,-1),substring(b,-2),substring(b,-3),substring(b,-4),substring(b,-5) from t1; +b substring(b,1) substring(b,-1) substring(b,-2) substring(b,-3) substring(b,-4) substring(b,-5) +ab ab b ab +abc abc c bc abc +abcd abcd d cd bcd abcd +abcde abcde e de cde bcde abcde +select * from (select *,substring(b,1),substring(b,-1),substring(b,-2),substring(b,-3),substring(b,-4),substring(b,-5) from t1) t; +b substring(b,1) substring(b,-1) substring(b,-2) substring(b,-3) substring(b,-4) substring(b,-5) +ab ab b ab +abc abc c bc abc +abcd abcd d cd bcd abcd +abcde abcde e de cde bcde abcde +drop table t1; +select hex(29223372036854775809) as hex_signed, +hex(cast(29223372036854775809 as unsigned)) as hex_unsigned; +hex_signed hex_unsigned +7FFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '29223372036854775809' +Warning 1292 Truncated incorrect DECIMAL value: '29223372036854775809' +select conv(29223372036854775809, -10, 16) as conv_signed, +conv(29223372036854775809, 10, 16) as conv_unsigned; +conv_signed conv_unsigned +7FFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '29223372036854775809' +Warning 1292 Truncated incorrect DECIMAL value: '29223372036854775809' +select hex(-29223372036854775809) as hex_signed, +hex(cast(-29223372036854775809 as unsigned)) as hex_unsigned; +hex_signed hex_unsigned +8000000000000000 8000000000000000 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-29223372036854775809' +Warning 1292 Truncated incorrect DECIMAL value: '-29223372036854775809' +select conv(-29223372036854775809, -10, 16) as conv_signed, +conv(-29223372036854775809, 10, 16) as conv_unsigned; +conv_signed conv_unsigned +8000000000000000 0 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-29223372036854775809' +Warning 1292 Truncated incorrect DECIMAL value: '-29223372036854775809' +create table t1 (i int); +insert into t1 values (1000000000),(1); +select lpad(i, 7, ' ') as t from t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t t 253 7 7 Y 0 0 8 +t +1000000 + 1 +select rpad(i, 7, ' ') as t from t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t t 253 7 7 Y 0 0 8 +t +1000000 +1 +drop table t1; +select load_file("lkjlkj"); +load_file("lkjlkj") +NULL +select ifnull(load_file("lkjlkj"),"it is null"); +ifnull(load_file("lkjlkj"),"it is null") +it is null +create table t1 (f1 varchar(4), f2 varchar(64), unique key k1 (f1,f2)); +insert into t1 values ( 'test',md5('test')), ('test', sha('test')); +select * from t1 where f1='test' and (f2= md5("test") or f2= md5("TEST")); +f1 f2 +test 098f6bcd4621d373cade4e832627b4f6 +select * from t1 where f1='test' and (f2= md5("TEST") or f2= md5("test")); +f1 f2 +test 098f6bcd4621d373cade4e832627b4f6 +select * from t1 where f1='test' and (f2= sha("test") or f2= sha("TEST")); +f1 f2 +test a94a8fe5ccb19ba61c4c0873d391e987982fbbd3 +select * from t1 where f1='test' and (f2= sha("TEST") or f2= sha("test")); +f1 f2 +test a94a8fe5ccb19ba61c4c0873d391e987982fbbd3 +drop table t1; +CREATE TABLE t1 (a varchar(10)); +INSERT INTO t1 VALUES ('abc'), ('xyz'); +SELECT a, CONCAT(a,' ',a) AS c FROM t1 +HAVING LEFT(c,LENGTH(c)-INSTR(REVERSE(c)," ")) = a; +a c +abc abc abc +xyz xyz xyz +SELECT a, CONCAT(a,' ',a) AS c FROM t1 +HAVING LEFT(CONCAT(a,' ',a), +LENGTH(CONCAT(a,' ',a))- +INSTR(REVERSE(CONCAT(a,' ',a))," ")) = a; +a c +abc abc abc +xyz xyz xyz +DROP TABLE t1; +CREATE TABLE t1 (s varchar(10)); +INSERT INTO t1 VALUES ('yadda'), ('yaddy'); +EXPLAIN SELECT s FROM t1 WHERE TRIM(s) > 'ab'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(`test`.`t1`.`s`) > 'ab') +EXPLAIN SELECT s FROM t1 WHERE TRIM('y' FROM s) > 'ab'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim('y' from `test`.`t1`.`s`) > 'ab') +EXPLAIN SELECT s FROM t1 WHERE TRIM(LEADING 'y' FROM s) > 'ab'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(leading 'y' from `test`.`t1`.`s`) > 'ab') +EXPLAIN SELECT s FROM t1 WHERE TRIM(TRAILING 'y' FROM s) > 'ab'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(trailing 'y' from `test`.`t1`.`s`) > 'ab') +EXPLAIN SELECT s FROM t1 WHERE TRIM(BOTH 'y' FROM s) > 'ab'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(both 'y' from `test`.`t1`.`s`) > 'ab') +DROP TABLE t1; +create table t1 (d decimal default null); +insert into t1 values (null); +select format(d, 2) from t1; +format(d, 2) +NULL +drop table t1; +create table t1 (c varchar(40)); +insert into t1 values ('y,abc'),('y,abc'); +select c, substring_index(lcase(c), @q:=',', -1) as res from t1; +c res +y,abc abc +y,abc abc +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +drop table t1; +select cast(rtrim(' 20.06 ') as decimal(19,2)); +cast(rtrim(' 20.06 ') as decimal(19,2)) +20.06 +select cast(ltrim(' 20.06 ') as decimal(19,2)); +cast(ltrim(' 20.06 ') as decimal(19,2)) +20.06 +select cast(rtrim(ltrim(' 20.06 ')) as decimal(19,2)); +cast(rtrim(ltrim(' 20.06 ')) as decimal(19,2)) +20.06 +select conv("18383815659218730760",10,10) + 0; +conv("18383815659218730760",10,10) + 0 +1.838381565921873e19 +select "18383815659218730760" + 0; +"18383815659218730760" + 0 +1.838381565921873e19 +CREATE TABLE t1 (code varchar(10)) charset utf8mb4; +INSERT INTO t1 VALUES ('a12'), ('A12'), ('a13'); +SELECT ASCII(code), code FROM t1 WHERE code='A12'; +ASCII(code) code +97 a12 +65 A12 +SELECT ASCII(code), code FROM t1 WHERE code='A12' AND ASCII(code)=65; +ASCII(code) code +65 A12 +INSERT INTO t1 VALUES (_utf16 0x0061003100320007), (_utf16 0x00410031003200070007); +SELECT LENGTH(code), code FROM t1 WHERE code='A12'; +LENGTH(code) code +3 a12 +3 A12 +4 a12 +5 A12 +SELECT LENGTH(code), code FROM t1 WHERE code='A12' AND LENGTH(code)=5; +LENGTH(code) code +5 A12 +ALTER TABLE t1 ADD INDEX (code); +CREATE TABLE t2 (id varchar(10) PRIMARY KEY) charset utf8mb4; +INSERT INTO t2 VALUES ('a11'), ('a12'), ('a13'), ('a14'); +SELECT * FROM t1 INNER JOIN t2 ON t1.code=t2.id +WHERE t2.id='a12' AND (LENGTH(code)=5 OR code < 'a00'); +code id +A12 a12 +EXPLAIN +SELECT * FROM t1 INNER JOIN t2 ON code=id +WHERE id='a12' AND (LENGTH(code)=5 OR code < 'a00'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 42 const 1 100.00 Using index +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL const PRIMARY PRIMARY 42 const 1 100.00 Using index +2 SIMPLE t1 NULL ref code code 43 const 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ 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 format(NULL, NULL); +format(NULL, NULL) +NULL +select format(pi(), NULL); +format(pi(), NULL) +NULL +select format(NULL, 2); +format(NULL, 2) +NULL +select benchmark(NULL, NULL); +benchmark(NULL, NULL) +NULL +select benchmark(0, NULL); +benchmark(0, NULL) +0 +select benchmark(100, NULL); +benchmark(100, NULL) +0 +select benchmark(NULL, 1+1); +benchmark(NULL, 1+1) +NULL +select benchmark(-1, 1); +benchmark(-1, 1) +NULL +Warnings: +Warning 1411 Incorrect count value: '-1' for function benchmark +set @dec=5; +select format(pi(), (1+1)); +format(pi(), (1+1)) +3.14 +select format(pi(), (select 3 from dual)); +format(pi(), (select 3 from dual)) +3.142 +select format(pi(), @dec); +format(pi(), @dec) +3.14159 +set @bench_count=10; +select benchmark(10, pi()); +benchmark(10, pi()) +0 +select benchmark(5+5, pi()); +benchmark(5+5, pi()) +0 +select benchmark((select 10 from dual), pi()); +benchmark((select 10 from dual), pi()) +0 +select benchmark(@bench_count, pi()); +benchmark(@bench_count, pi()) +0 +select locate('he','hello',-2); +locate('he','hello',-2) +0 +select locate('lo','hello',-4294967295); +locate('lo','hello',-4294967295) +0 +select locate('lo','hello',4294967295); +locate('lo','hello',4294967295) +0 +select locate('lo','hello',-4294967296); +locate('lo','hello',-4294967296) +0 +select locate('lo','hello',4294967296); +locate('lo','hello',4294967296) +0 +select locate('lo','hello',-4294967297); +locate('lo','hello',-4294967297) +0 +select locate('lo','hello',4294967297); +locate('lo','hello',4294967297) +0 +select locate('lo','hello',-18446744073709551615); +locate('lo','hello',-18446744073709551615) +0 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +select locate('lo','hello',18446744073709551615); +locate('lo','hello',18446744073709551615) +0 +select locate('lo','hello',-18446744073709551616); +locate('lo','hello',-18446744073709551616) +0 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +select locate('lo','hello',18446744073709551616); +locate('lo','hello',18446744073709551616) +0 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +select locate('lo','hello',-18446744073709551617); +locate('lo','hello',-18446744073709551617) +0 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +select locate('lo','hello',18446744073709551617); +locate('lo','hello',18446744073709551617) +0 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +select left('hello', 10); +left('hello', 10) +hello +select left('hello', 0); +left('hello', 0) + +select left('hello', -1); +left('hello', -1) + +select left('hello', -4294967295); +left('hello', -4294967295) + +select left('hello', 4294967295); +left('hello', 4294967295) +hello +select left('hello', -4294967296); +left('hello', -4294967296) + +select left('hello', 4294967296); +left('hello', 4294967296) +hello +select left('hello', -4294967297); +left('hello', -4294967297) + +select left('hello', 4294967297); +left('hello', 4294967297) +hello +select left('hello', -18446744073709551615); +left('hello', -18446744073709551615) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +select left('hello', 18446744073709551615); +left('hello', 18446744073709551615) +hello +select left('hello', -18446744073709551616); +left('hello', -18446744073709551616) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +select left('hello', 18446744073709551616); +left('hello', 18446744073709551616) +hello +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +select left('hello', -18446744073709551617); +left('hello', -18446744073709551617) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +select left('hello', 18446744073709551617); +left('hello', 18446744073709551617) +hello +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +select right('hello', 10); +right('hello', 10) +hello +select right('hello', 0); +right('hello', 0) + +select right('hello', -1); +right('hello', -1) + +select right('hello', -4294967295); +right('hello', -4294967295) + +select right('hello', 4294967295); +right('hello', 4294967295) +hello +select right('hello', -4294967296); +right('hello', -4294967296) + +select right('hello', 4294967296); +right('hello', 4294967296) +hello +select right('hello', -4294967297); +right('hello', -4294967297) + +select right('hello', 4294967297); +right('hello', 4294967297) +hello +select right('hello', -18446744073709551615); +right('hello', -18446744073709551615) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +select right('hello', 18446744073709551615); +right('hello', 18446744073709551615) +hello +select right('hello', -18446744073709551616); +right('hello', -18446744073709551616) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +select right('hello', 18446744073709551616); +right('hello', 18446744073709551616) +hello +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +select right('hello', -18446744073709551617); +right('hello', -18446744073709551617) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +select right('hello', 18446744073709551617); +right('hello', 18446744073709551617) +hello +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +select substring('hello', 2, -1); +substring('hello', 2, -1) + +select substring('hello', -1, 1); +substring('hello', -1, 1) +o +select substring('hello', -2, 1); +substring('hello', -2, 1) +l +select substring('hello', -4294967295, 1); +substring('hello', -4294967295, 1) + +select substring('hello', 4294967295, 1); +substring('hello', 4294967295, 1) + +select substring('hello', -4294967296, 1); +substring('hello', -4294967296, 1) + +select substring('hello', 4294967296, 1); +substring('hello', 4294967296, 1) + +select substring('hello', -4294967297, 1); +substring('hello', -4294967297, 1) + +select substring('hello', 4294967297, 1); +substring('hello', 4294967297, 1) + +select substring('hello', -18446744073709551615, 1); +substring('hello', -18446744073709551615, 1) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +select substring('hello', 18446744073709551615, 1); +substring('hello', 18446744073709551615, 1) + +select substring('hello', -18446744073709551616, 1); +substring('hello', -18446744073709551616, 1) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +select substring('hello', 18446744073709551616, 1); +substring('hello', 18446744073709551616, 1) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +select substring('hello', -18446744073709551617, 1); +substring('hello', -18446744073709551617, 1) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +select substring('hello', 18446744073709551617, 1); +substring('hello', 18446744073709551617, 1) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +select substring('hello', 1, -1); +substring('hello', 1, -1) + +select substring('hello', 1, -4294967295); +substring('hello', 1, -4294967295) + +select substring('hello', 1, 4294967295); +substring('hello', 1, 4294967295) +hello +select substring('hello', 1, -4294967296); +substring('hello', 1, -4294967296) + +select substring('hello', 1, 4294967296); +substring('hello', 1, 4294967296) +hello +select substring('hello', 1, -4294967297); +substring('hello', 1, -4294967297) + +select substring('hello', 1, 4294967297); +substring('hello', 1, 4294967297) +hello +select substring('hello', 1, -18446744073709551615); +substring('hello', 1, -18446744073709551615) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +select substring('hello', 1, 18446744073709551615); +substring('hello', 1, 18446744073709551615) +hello +select substring('hello', 1, -18446744073709551616); +substring('hello', 1, -18446744073709551616) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +select substring('hello', 1, 18446744073709551616); +substring('hello', 1, 18446744073709551616) +hello +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +select substring('hello', 1, -18446744073709551617); +substring('hello', 1, -18446744073709551617) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +select substring('hello', 1, 18446744073709551617); +substring('hello', 1, 18446744073709551617) +hello +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +select substring('hello', -1, -1); +substring('hello', -1, -1) + +select substring('hello', -4294967295, -4294967295); +substring('hello', -4294967295, -4294967295) + +select substring('hello', 4294967295, 4294967295); +substring('hello', 4294967295, 4294967295) + +select substring('hello', -4294967296, -4294967296); +substring('hello', -4294967296, -4294967296) + +select substring('hello', 4294967296, 4294967296); +substring('hello', 4294967296, 4294967296) + +select substring('hello', -4294967297, -4294967297); +substring('hello', -4294967297, -4294967297) + +select substring('hello', 4294967297, 4294967297); +substring('hello', 4294967297, 4294967297) + +select substring('hello', -18446744073709551615, -18446744073709551615); +substring('hello', -18446744073709551615, -18446744073709551615) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +select substring('hello', 18446744073709551615, 18446744073709551615); +substring('hello', 18446744073709551615, 18446744073709551615) + +select substring('hello', -18446744073709551616, -18446744073709551616); +substring('hello', -18446744073709551616, -18446744073709551616) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +select substring('hello', 18446744073709551616, 18446744073709551616); +substring('hello', 18446744073709551616, 18446744073709551616) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +select substring('hello', -18446744073709551617, -18446744073709551617); +substring('hello', -18446744073709551617, -18446744073709551617) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +select substring('hello', 18446744073709551617, 18446744073709551617); +substring('hello', 18446744073709551617, 18446744073709551617) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +select insert('hello', -1, 1, 'hi'); +insert('hello', -1, 1, 'hi') +hello +select insert('hello', -4294967295, 1, 'hi'); +insert('hello', -4294967295, 1, 'hi') +hello +select insert('hello', 4294967295, 1, 'hi'); +insert('hello', 4294967295, 1, 'hi') +hello +select insert('hello', -4294967296, 1, 'hi'); +insert('hello', -4294967296, 1, 'hi') +hello +select insert('hello', 4294967296, 1, 'hi'); +insert('hello', 4294967296, 1, 'hi') +hello +select insert('hello', -4294967297, 1, 'hi'); +insert('hello', -4294967297, 1, 'hi') +hello +select insert('hello', 4294967297, 1, 'hi'); +insert('hello', 4294967297, 1, 'hi') +hello +select insert('hello', -18446744073709551615, 1, 'hi'); +insert('hello', -18446744073709551615, 1, 'hi') +hello +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +select insert('hello', 18446744073709551615, 1, 'hi'); +insert('hello', 18446744073709551615, 1, 'hi') +hello +select insert('hello', -18446744073709551616, 1, 'hi'); +insert('hello', -18446744073709551616, 1, 'hi') +hello +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +select insert('hello', 18446744073709551616, 1, 'hi'); +insert('hello', 18446744073709551616, 1, 'hi') +hello +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +select insert('hello', -18446744073709551617, 1, 'hi'); +insert('hello', -18446744073709551617, 1, 'hi') +hello +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +select insert('hello', 18446744073709551617, 1, 'hi'); +insert('hello', 18446744073709551617, 1, 'hi') +hello +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +select insert('hello', 1, -1, 'hi'); +insert('hello', 1, -1, 'hi') +hi +select insert('hello', 1, -4294967295, 'hi'); +insert('hello', 1, -4294967295, 'hi') +hi +select insert('hello', 1, 4294967295, 'hi'); +insert('hello', 1, 4294967295, 'hi') +hi +select insert('hello', 1, -4294967296, 'hi'); +insert('hello', 1, -4294967296, 'hi') +hi +select insert('hello', 1, 4294967296, 'hi'); +insert('hello', 1, 4294967296, 'hi') +hi +select insert('hello', 1, -4294967297, 'hi'); +insert('hello', 1, -4294967297, 'hi') +hi +select insert('hello', 1, 4294967297, 'hi'); +insert('hello', 1, 4294967297, 'hi') +hi +select insert('hello', 1, -18446744073709551615, 'hi'); +insert('hello', 1, -18446744073709551615, 'hi') +hi +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +select insert('hello', 1, 18446744073709551615, 'hi'); +insert('hello', 1, 18446744073709551615, 'hi') +hi +select insert('hello', 1, -18446744073709551616, 'hi'); +insert('hello', 1, -18446744073709551616, 'hi') +hi +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +select insert('hello', 1, 18446744073709551616, 'hi'); +insert('hello', 1, 18446744073709551616, 'hi') +hi +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +select insert('hello', 1, -18446744073709551617, 'hi'); +insert('hello', 1, -18446744073709551617, 'hi') +hi +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +select insert('hello', 1, 18446744073709551617, 'hi'); +insert('hello', 1, 18446744073709551617, 'hi') +hi +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +select insert('hello', -1, -1, 'hi'); +insert('hello', -1, -1, 'hi') +hello +select insert('hello', -4294967295, -4294967295, 'hi'); +insert('hello', -4294967295, -4294967295, 'hi') +hello +select insert('hello', 4294967295, 4294967295, 'hi'); +insert('hello', 4294967295, 4294967295, 'hi') +hello +select insert('hello', -4294967296, -4294967296, 'hi'); +insert('hello', -4294967296, -4294967296, 'hi') +hello +select insert('hello', 4294967296, 4294967296, 'hi'); +insert('hello', 4294967296, 4294967296, 'hi') +hello +select insert('hello', -4294967297, -4294967297, 'hi'); +insert('hello', -4294967297, -4294967297, 'hi') +hello +select insert('hello', 4294967297, 4294967297, 'hi'); +insert('hello', 4294967297, 4294967297, 'hi') +hello +select insert('hello', -18446744073709551615, -18446744073709551615, 'hi'); +insert('hello', -18446744073709551615, -18446744073709551615, 'hi') +hello +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +select insert('hello', 18446744073709551615, 18446744073709551615, 'hi'); +insert('hello', 18446744073709551615, 18446744073709551615, 'hi') +hello +select insert('hello', -18446744073709551616, -18446744073709551616, 'hi'); +insert('hello', -18446744073709551616, -18446744073709551616, 'hi') +hello +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +select insert('hello', 18446744073709551616, 18446744073709551616, 'hi'); +insert('hello', 18446744073709551616, 18446744073709551616, 'hi') +hello +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +select insert('hello', -18446744073709551617, -18446744073709551617, 'hi'); +insert('hello', -18446744073709551617, -18446744073709551617, 'hi') +hello +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +select insert('hello', 18446744073709551617, 18446744073709551617, 'hi'); +insert('hello', 18446744073709551617, 18446744073709551617, 'hi') +hello +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +select repeat('hello', -1); +repeat('hello', -1) + +select repeat('hello', -4294967295); +repeat('hello', -4294967295) + +select repeat('hello', 4294967295); +repeat('hello', 4294967295) +NULL +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (67108864) - truncated +select repeat('hello', -4294967296); +repeat('hello', -4294967296) + +select repeat('hello', 4294967296); +repeat('hello', 4294967296) +NULL +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (67108864) - truncated +select repeat('hello', -4294967297); +repeat('hello', -4294967297) + +select repeat('hello', 4294967297); +repeat('hello', 4294967297) +NULL +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (67108864) - truncated +select repeat('hello', -18446744073709551615); +repeat('hello', -18446744073709551615) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +select repeat('hello', 18446744073709551615); +repeat('hello', 18446744073709551615) +NULL +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (67108864) - truncated +select repeat('hello', -18446744073709551616); +repeat('hello', -18446744073709551616) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +select repeat('hello', 18446744073709551616); +repeat('hello', 18446744073709551616) +NULL +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +Warning 1301 Result of repeat() was larger than max_allowed_packet (67108864) - truncated +select repeat('hello', -18446744073709551617); +repeat('hello', -18446744073709551617) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +select repeat('hello', 18446744073709551617); +repeat('hello', 18446744073709551617) +NULL +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +Warning 1301 Result of repeat() was larger than max_allowed_packet (67108864) - truncated +select space(-1); +space(-1) + +select space(-4294967295); +space(-4294967295) + +select space(4294967295); +space(4294967295) +NULL +Warnings: +Warning 1301 Result of space() was larger than max_allowed_packet (67108864) - truncated +select space(-4294967296); +space(-4294967296) + +select space(4294967296); +space(4294967296) +NULL +Warnings: +Warning 1301 Result of space() was larger than max_allowed_packet (67108864) - truncated +select space(-4294967297); +space(-4294967297) + +select space(4294967297); +space(4294967297) +NULL +Warnings: +Warning 1301 Result of space() was larger than max_allowed_packet (67108864) - truncated +select space(-18446744073709551615); +space(-18446744073709551615) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +select space(18446744073709551615); +space(18446744073709551615) +NULL +Warnings: +Warning 1301 Result of space() was larger than max_allowed_packet (67108864) - truncated +select space(-18446744073709551616); +space(-18446744073709551616) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +select space(18446744073709551616); +space(18446744073709551616) +NULL +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +Warning 1301 Result of space() was larger than max_allowed_packet (67108864) - truncated +select space(-18446744073709551617); +space(-18446744073709551617) + +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +select space(18446744073709551617); +space(18446744073709551617) +NULL +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +Warning 1301 Result of space() was larger than max_allowed_packet (67108864) - truncated +select rpad('hello', -1, '1'); +rpad('hello', -1, '1') +NULL +select rpad('hello', -4294967295, '1'); +rpad('hello', -4294967295, '1') +NULL +select rpad('hello', 4294967295, '1'); +rpad('hello', 4294967295, '1') +NULL +Warnings: +Warning 1301 Result of rpad() was larger than max_allowed_packet (67108864) - truncated +select rpad('hello', -4294967296, '1'); +rpad('hello', -4294967296, '1') +NULL +select rpad('hello', 4294967296, '1'); +rpad('hello', 4294967296, '1') +NULL +Warnings: +Warning 1301 Result of rpad() was larger than max_allowed_packet (67108864) - truncated +select rpad('hello', -4294967297, '1'); +rpad('hello', -4294967297, '1') +NULL +select rpad('hello', 4294967297, '1'); +rpad('hello', 4294967297, '1') +NULL +Warnings: +Warning 1301 Result of rpad() was larger than max_allowed_packet (67108864) - truncated +select rpad('hello', -18446744073709551615, '1'); +rpad('hello', -18446744073709551615, '1') +NULL +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +select rpad('hello', 18446744073709551615, '1'); +rpad('hello', 18446744073709551615, '1') +NULL +Warnings: +Warning 1301 Result of rpad() was larger than max_allowed_packet (67108864) - truncated +select rpad('hello', -18446744073709551616, '1'); +rpad('hello', -18446744073709551616, '1') +NULL +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +select rpad('hello', 18446744073709551616, '1'); +rpad('hello', 18446744073709551616, '1') +NULL +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +Warning 1301 Result of rpad() was larger than max_allowed_packet (67108864) - truncated +select rpad('hello', -18446744073709551617, '1'); +rpad('hello', -18446744073709551617, '1') +NULL +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +select rpad('hello', 18446744073709551617, '1'); +rpad('hello', 18446744073709551617, '1') +NULL +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +Warning 1301 Result of rpad() was larger than max_allowed_packet (67108864) - truncated +select lpad('hello', -1, '1'); +lpad('hello', -1, '1') +NULL +select lpad('hello', -4294967295, '1'); +lpad('hello', -4294967295, '1') +NULL +select lpad('hello', 4294967295, '1'); +lpad('hello', 4294967295, '1') +NULL +Warnings: +Warning 1301 Result of lpad() was larger than max_allowed_packet (67108864) - truncated +select lpad('hello', -4294967296, '1'); +lpad('hello', -4294967296, '1') +NULL +select lpad('hello', 4294967296, '1'); +lpad('hello', 4294967296, '1') +NULL +Warnings: +Warning 1301 Result of lpad() was larger than max_allowed_packet (67108864) - truncated +select lpad('hello', -4294967297, '1'); +lpad('hello', -4294967297, '1') +NULL +select lpad('hello', 4294967297, '1'); +lpad('hello', 4294967297, '1') +NULL +Warnings: +Warning 1301 Result of lpad() was larger than max_allowed_packet (67108864) - truncated +select lpad('hello', -18446744073709551615, '1'); +lpad('hello', -18446744073709551615, '1') +NULL +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551615' +select lpad('hello', 18446744073709551615, '1'); +lpad('hello', 18446744073709551615, '1') +NULL +Warnings: +Warning 1301 Result of lpad() was larger than max_allowed_packet (67108864) - truncated +select lpad('hello', -18446744073709551616, '1'); +lpad('hello', -18446744073709551616, '1') +NULL +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551616' +select lpad('hello', 18446744073709551616, '1'); +lpad('hello', 18446744073709551616, '1') +NULL +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551616' +Warning 1301 Result of lpad() was larger than max_allowed_packet (67108864) - truncated +select lpad('hello', -18446744073709551617, '1'); +lpad('hello', -18446744073709551617, '1') +NULL +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '-18446744073709551617' +select lpad('hello', 18446744073709551617, '1'); +lpad('hello', 18446744073709551617, '1') +NULL +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +Warning 1292 Truncated incorrect DECIMAL value: '18446744073709551617' +Warning 1301 Result of lpad() was larger than max_allowed_packet (67108864) - truncated +SET @orig_sql_mode = @@SQL_MODE; +SET SQL_MODE=traditional; +SELECT CHAR(0xff,0x8f USING utf8); +CHAR(0xff,0x8f USING utf8) +NULL +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +Warning 1300 Invalid utf8 character string: 'FF8F' +SELECT CHAR(0xff,0x8f USING utf8) IS NULL; +CHAR(0xff,0x8f USING utf8) IS NULL +1 +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +Warning 1300 Invalid utf8 character string: 'FF8F' +SET SQL_MODE=@orig_sql_mode; +select substring('abc', cast(2 as unsigned int)); +substring('abc', cast(2 as unsigned int)) +bc +select repeat('a', cast(2 as unsigned int)); +repeat('a', cast(2 as unsigned int)) +aa +select rpad('abc', cast(5 as unsigned integer), 'x'); +rpad('abc', cast(5 as unsigned integer), 'x') +abcxx +select lpad('abc', cast(5 as unsigned integer), 'x'); +lpad('abc', cast(5 as unsigned integer), 'x') +xxabc +create table t1(f1 longtext); +insert into t1 values ("123"),("456"); +select substring(f1,1,1) from t1 group by 1; +substring(f1,1,1) +1 +4 +create table t2(f1 varchar(3)); +insert into t1 values ("123"),("456"); +select substring(f1,4,1), substring(f1,-4,1) from t2; +substring(f1,4,1) substring(f1,-4,1) +drop table t1,t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE `t1` ( +`id` varchar(20) NOT NULL, +`tire` tinyint(3) unsigned NOT NULL, +PRIMARY KEY (`id`) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `t1` (`id`, `tire`) VALUES ('A', 0), ('B', 1),('C', 2); +SELECT REPEAT( '#', tire ) AS A, +REPEAT( '#', tire % 999 ) AS B, tire FROM `t1`; +A B tire + 0 +# # 1 +## ## 2 +SELECT REPEAT('0', CAST(0 AS UNSIGNED)); +REPEAT('0', CAST(0 AS UNSIGNED)) + +SELECT REPEAT('0', -2); +REPEAT('0', -2) + +SELECT REPEAT('0', 2); +REPEAT('0', 2) +00 +DROP TABLE t1; +SELECT UNHEX('G'); +UNHEX('G') +NULL +Warnings: +Warning 1411 Incorrect string value: ''G'' for function unhex +SELECT UNHEX('G') IS NULL; +UNHEX('G') IS NULL +1 +Warnings: +Warning 1411 Incorrect string value: ''G'' for function unhex +DO UNHEX(-1); +Warnings: +Warning 1411 Incorrect string value: '-(1)' for function unhex +SHOW warnings; +Level Code Message +Warning 1411 Incorrect string value: '-(1)' for function unhex +DO UNHEX(-182680438); +Warnings: +Warning 1411 Incorrect string value: '-(182680438)' for function unhex +SHOW warnings; +Level Code Message +Warning 1411 Incorrect string value: '-(182680438)' for function unhex +DO UNHEX(-2251799813685249); +Warnings: +Warning 1411 Incorrect string value: '-(2251799813685249)' for function unhex +SHOW warnings; +Level Code Message +Warning 1411 Incorrect string value: '-(2251799813685249)' for function unhex +select unhex('5078-04-25'); +unhex('5078-04-25') +NULL +Warnings: +Warning 1411 Incorrect string value: ''5078-04-25'' for function unhex +SELECT INSERT('abc', 3, 3, '1234'); +INSERT('abc', 3, 3, '1234') +ab1234 +SELECT INSERT('abc', 4, 3, '1234'); +INSERT('abc', 4, 3, '1234') +abc +SELECT INSERT('abc', 5, 3, '1234'); +INSERT('abc', 5, 3, '1234') +abc +SELECT INSERT('abc', 6, 3, '1234'); +INSERT('abc', 6, 3, '1234') +abc +CREATE TABLE t1 (a INT); +CREATE VIEW v1 AS SELECT CRC32(a) AS C FROM t1; +INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +SELECT CRC32(a), COUNT(*) FROM t1 GROUP BY 1; +CRC32(a) COUNT(*) +1790921346 1 +1842515611 1 +2212294583 1 +2226203566 1 +2366072709 1 +2707236321 1 +4088798008 1 +4194326291 1 +450215437 1 +498629140 1 +SELECT CRC32(a), COUNT(*) FROM t1 GROUP BY 1 ORDER BY 1; +CRC32(a) COUNT(*) +450215437 1 +498629140 1 +1790921346 1 +1842515611 1 +2212294583 1 +2226203566 1 +2366072709 1 +2707236321 1 +4088798008 1 +4194326291 1 +SELECT * FROM (SELECT CRC32(a) FROM t1) t2; +CRC32(a) +1790921346 +1842515611 +2212294583 +2226203566 +2366072709 +2707236321 +4088798008 +4194326291 +450215437 +498629140 +CREATE TABLE t2 SELECT CRC32(a) FROM t1; +desc t2; +Field Type Null Key Default Extra +CRC32(a) int unsigned YES NULL +SELECT * FROM v1; +C +1790921346 +1842515611 +2212294583 +2226203566 +2366072709 +2707236321 +4088798008 +4194326291 +450215437 +498629140 +SELECT * FROM (SELECT * FROM v1) x; +C +1790921346 +1842515611 +2212294583 +2226203566 +2366072709 +2707236321 +4088798008 +4194326291 +450215437 +498629140 +DROP TABLE t1, t2; +DROP VIEW v1; +SELECT LOCATE('foo', NULL) FROM DUAL; +LOCATE('foo', NULL) +NULL +SELECT LOCATE(NULL, 'o') FROM DUAL; +LOCATE(NULL, 'o') +NULL +SELECT LOCATE(NULL, NULL) FROM DUAL; +LOCATE(NULL, NULL) +NULL +SELECT LOCATE('foo', NULL) IS NULL FROM DUAL; +LOCATE('foo', NULL) IS NULL +1 +SELECT LOCATE(NULL, 'o') IS NULL FROM DUAL; +LOCATE(NULL, 'o') IS NULL +1 +SELECT LOCATE(NULL, NULL) IS NULL FROM DUAL; +LOCATE(NULL, NULL) IS NULL +1 +SELECT ISNULL(LOCATE('foo', NULL)) FROM DUAL; +ISNULL(LOCATE('foo', NULL)) +1 +SELECT ISNULL(LOCATE(NULL, 'o')) FROM DUAL; +ISNULL(LOCATE(NULL, 'o')) +1 +SELECT ISNULL(LOCATE(NULL, NULL)) FROM DUAL; +ISNULL(LOCATE(NULL, NULL)) +1 +SELECT LOCATE('foo', NULL) <=> NULL FROM DUAL; +LOCATE('foo', NULL) <=> NULL +1 +SELECT LOCATE(NULL, 'o') <=> NULL FROM DUAL; +LOCATE(NULL, 'o') <=> NULL +1 +SELECT LOCATE(NULL, NULL) <=> NULL FROM DUAL; +LOCATE(NULL, NULL) <=> NULL +1 +CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a varchar(10), p varchar(10)); +INSERT INTO t1 VALUES (1, 'foo', 'o'); +INSERT INTO t1 VALUES (2, 'foo', NULL); +INSERT INTO t1 VALUES (3, NULL, 'o'); +INSERT INTO t1 VALUES (4, NULL, NULL); +SELECT id, LOCATE(a,p) FROM t1; +id LOCATE(a,p) +1 0 +2 NULL +3 NULL +4 NULL +SELECT id, LOCATE(a,p) IS NULL FROM t1; +id LOCATE(a,p) IS NULL +1 0 +2 1 +3 1 +4 1 +SELECT id, ISNULL(LOCATE(a,p)) FROM t1; +id ISNULL(LOCATE(a,p)) +1 0 +2 1 +3 1 +4 1 +SELECT id, LOCATE(a,p) <=> NULL FROM t1; +id LOCATE(a,p) <=> NULL +1 0 +2 1 +3 1 +4 1 +SELECT id FROM t1 WHERE LOCATE(a,p) IS NULL; +id +2 +3 +4 +SELECT id FROM t1 WHERE LOCATE(a,p) <=> NULL; +id +2 +3 +4 +DROP TABLE t1; +SELECT SUBSTR('foo',1,0) FROM DUAL; +SUBSTR('foo',1,0) + +SELECT SUBSTR('foo',1,CAST(0 AS SIGNED)) FROM DUAL; +SUBSTR('foo',1,CAST(0 AS SIGNED)) + +SELECT SUBSTR('foo',1,CAST(0 AS UNSIGNED)) FROM DUAL; +SUBSTR('foo',1,CAST(0 AS UNSIGNED)) + +CREATE TABLE t1 (a varchar(10), len int unsigned); +INSERT INTO t1 VALUES ('bar', 2), ('foo', 0); +SELECT SUBSTR(a,1,len) FROM t1; +SUBSTR(a,1,len) +ba + +DROP TABLE t1; +CREATE TABLE t1 AS SELECT CHAR(0x414243) as c1; +SELECT HEX(c1) from t1; +HEX(c1) +414243 +DROP TABLE t1; +CREATE VIEW v1 AS SELECT CHAR(0x414243) as c1; +SELECT HEX(c1) from v1; +HEX(c1) +414243 +DROP VIEW v1; +create table t1(a float); +insert into t1 values (1.33); +select format(a, 2) from t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def format(a, 2) format(a, 2) 253 48 4 Y 0 0 8 +format(a, 2) +1.33 +drop table t1; +CREATE TABLE t1 (c DATE, aa VARCHAR(30)); +INSERT INTO t1 VALUES ('2008-12-31','aaaaaa'); +SELECT DATE_FORMAT(c, GET_FORMAT(DATE, 'eur')) h, CONCAT(UPPER(aa),', ', aa) i FROM t1; +h i +31.12.2008 AAAAAA, aaaaaa +DROP TABLE t1; +# +# BUG#44774: load_file function produces valgrind warnings +# +CREATE TABLE t1 (a TINYBLOB); +INSERT INTO t1 VALUES ('aaaaaaaa'); +SELECT LOAD_FILE(a) FROM t1; +LOAD_FILE(a) +NULL +DROP TABLE t1; +CREATE TABLE t1 (f2 VARCHAR(20)); +CREATE TABLE t2 (f2 VARCHAR(20)); +INSERT INTO t1 VALUES ('MIN'),('MAX'); +INSERT INTO t2 VALUES ('LOAD'); +SELECT CONCAT_WS('_', (SELECT t2.f2 FROM t2), t1.f2) AS concat_name FROM t1; +concat_name +LOAD_MIN +LOAD_MAX +DROP TABLE t1, t2; +End of 5.0 tests +# +# Bug#52164 Assertion failed: param.sort_length, file .\filesort.cc, line 149 +# +CREATE TABLE t1 (a LONGBLOB NOT NULL); +INSERT INTO t1 VALUES (''),(''); +SELECT 1 FROM t1, t1 t2 +ORDER BY QUOTE(t1.a); +1 +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug#57913 large negative number to string conversion functions crash +# Bug#57810 case/when/then : Assertion failed: length || !scale +# +SELECT '1' IN ('1', SUBSTRING(-9223372036854775809, 1)); +'1' IN ('1', SUBSTRING(-9223372036854775809, 1)) +1 +SELECT CONVERT(('' IN (REVERSE(CAST(('') AS DECIMAL)), '')), CHAR(3)); +CONVERT(('' IN (REVERSE(CAST(('') AS DECIMAL)), '')), CHAR(3)) +1 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '' +# +# Bug#58165: "my_empty_string" gets modified and causes LOAD DATA to fail +# and other crashes +# +CREATE TABLE t1 ( a TEXT ); +SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug58165.txt';; +SELECT insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' ); +insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' ) + +Warnings: +Warning 1292 Truncated incorrect INTEGER value: 'b' +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug58165.txt' INTO TABLE t1;; +SELECT * FROM t1; +a +aaaaaaaaaaaaaa +DROP TABLE t1; +# +# Bug#12634989 VALGRIND WARNING ABOUT UNINITIALIZED VALUES CREATED IN ITEM_FUNC_DAYOFMONTH +# +SELECT SUBSTRING('1', DAY(FROM_UNIXTIME(-1))); +SUBSTRING('1', DAY(FROM_UNIXTIME(-1))) +NULL +SELECT LEFT('1', DAY(FROM_UNIXTIME(-1))); +LEFT('1', DAY(FROM_UNIXTIME(-1))) +NULL +SELECT RIGHT('1', DAY(FROM_UNIXTIME(-1))); +RIGHT('1', DAY(FROM_UNIXTIME(-1))) +NULL +SELECT REPEAT('1', DAY(FROM_UNIXTIME(-1))); +REPEAT('1', DAY(FROM_UNIXTIME(-1))) +NULL +SELECT RPAD('hi', DAY(FROM_UNIXTIME(-1)),'?'); +RPAD('hi', DAY(FROM_UNIXTIME(-1)),'?') +NULL +SELECT LPAD('hi', DAY(FROM_UNIXTIME(-1)),'?'); +LPAD('hi', DAY(FROM_UNIXTIME(-1)),'?') +NULL +CREATE TABLE t1 charset utf8mb4 +SELECT SUBSTRING('1', DAY(FROM_UNIXTIME(-1))) AS f1, +LEFT('1', DAY(FROM_UNIXTIME(-1))) AS f2, +RIGHT('1', DAY(FROM_UNIXTIME(-1))) AS f3, +REPEAT('1', DAY(FROM_UNIXTIME(-1))) AS f4, +RPAD('hi', DAY(FROM_UNIXTIME(-1)),'?') AS f5, +LPAD('hi', DAY(FROM_UNIXTIME(-1)),'?') AS f6; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` varchar(1) CHARACTER SET latin1 DEFAULT NULL, + `f2` varchar(1) CHARACTER SET latin1 DEFAULT NULL, + `f3` varchar(1) CHARACTER SET latin1 DEFAULT NULL, + `f4` longtext CHARACTER SET latin1, + `f5` longtext CHARACTER SET latin1, + `f6` longtext CHARACTER SET latin1 +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +DROP TABLE t1; +# +# Bug#11766684 59851: UNINITIALISED VALUE IN ITEM_FUNC_LIKE::SELECT_OPTIMIZE WITH SUBQUERY AND +# +CREATE TABLE t2(a INT, KEY(a)); +INSERT INTO t2 VALUES (1),(2); +CREATE TABLE t1(b INT, PRIMARY KEY(b)); +INSERT INTO t1 VALUES (0),(254); +SELECT 1 FROM t2 WHERE a LIKE +(SELECT EXPORT_SET(1, b, b, b, b) FROM t1 LIMIT 1); +1 +DROP TABLE t1, t2; +End of 5.1 tests +Start of 5.4 tests +SELECT format(12345678901234567890.123, 3); +format(12345678901234567890.123, 3) +12,345,678,901,234,567,890.123 +SELECT format(12345678901234567890.123, 3, NULL); +format(12345678901234567890.123, 3, NULL) +12,345,678,901,234,567,890.123 +Warnings: +Warning 1649 Unknown locale: 'NULL' +SELECT format(12345678901234567890.123, 3, 'ar_AE'); +format(12345678901234567890.123, 3, 'ar_AE') +12,345,678,901,234,567,890.123 +SELECT format(12345678901234567890.123, 3, 'ar_SA'); +format(12345678901234567890.123, 3, 'ar_SA') +12345678901234567890.123 +SELECT format(12345678901234567890.123, 3, 'be_BY'); +format(12345678901234567890.123, 3, 'be_BY') +12.345.678.901.234.567.890,123 +SELECT format(12345678901234567890.123, 3, 'de_DE'); +format(12345678901234567890.123, 3, 'de_DE') +12.345.678.901.234.567.890,123 +SELECT format(12345678901234567890.123, 3, 'en_IN'); +format(12345678901234567890.123, 3, 'en_IN') +1,23,45,67,89,01,23,45,67,890.123 +SELECT format(12345678901234567890.123, 3, 'en_US'); +format(12345678901234567890.123, 3, 'en_US') +12,345,678,901,234,567,890.123 +SELECT format(12345678901234567890.123, 3, 'it_CH'); +format(12345678901234567890.123, 3, 'it_CH') +12'345'678'901'234'567'890,123 +SELECT format(12345678901234567890.123, 3, 'ru_RU'); +format(12345678901234567890.123, 3, 'ru_RU') +12 345 678 901 234 567 890,123 +SELECT format(12345678901234567890.123, 3, 'ta_IN'); +format(12345678901234567890.123, 3, 'ta_IN') +1,23,45,67,89,01,23,45,67,890.123 +CREATE TABLE t1 (fmt CHAR(5) NOT NULL); +INSERT INTO t1 VALUES ('ar_AE'); +INSERT INTO t1 VALUES ('ar_SA'); +INSERT INTO t1 VALUES ('be_BY'); +INSERT INTO t1 VALUES ('de_DE'); +INSERT INTO t1 VALUES ('en_IN'); +INSERT INTO t1 VALUES ('en_US'); +INSERT INTO t1 VALUES ('it_CH'); +INSERT INTO t1 VALUES ('ru_RU'); +INSERT INTO t1 VALUES ('ta_IN'); +SELECT fmt, format(12345678901234567890.123, 3, fmt) FROM t1 ORDER BY fmt; +fmt format(12345678901234567890.123, 3, fmt) +ar_AE 12,345,678,901,234,567,890.123 +ar_SA 12345678901234567890.123 +be_BY 12.345.678.901.234.567.890,123 +de_DE 12.345.678.901.234.567.890,123 +en_IN 1,23,45,67,89,01,23,45,67,890.123 +en_US 12,345,678,901,234,567,890.123 +it_CH 12'345'678'901'234'567'890,123 +ru_RU 12 345 678 901 234 567 890,123 +ta_IN 1,23,45,67,89,01,23,45,67,890.123 +SELECT fmt, format(12345678901234567890.123, 0, fmt) FROM t1 ORDER BY fmt; +fmt format(12345678901234567890.123, 0, fmt) +ar_AE 12,345,678,901,234,567,890 +ar_SA 12345678901234567890 +be_BY 12.345.678.901.234.567.890 +de_DE 12.345.678.901.234.567.890 +en_IN 1,23,45,67,89,01,23,45,67,890 +en_US 12,345,678,901,234,567,890 +it_CH 12'345'678'901'234'567'890 +ru_RU 12 345 678 901 234 567 890 +ta_IN 1,23,45,67,89,01,23,45,67,890 +SELECT fmt, format(12345678901234567890, 3, fmt) FROM t1 ORDER BY fmt; +fmt format(12345678901234567890, 3, fmt) +ar_AE 12,345,678,901,234,567,890.000 +ar_SA 12345678901234567890.000 +be_BY 12.345.678.901.234.567.890,000 +de_DE 12.345.678.901.234.567.890,000 +en_IN 1,23,45,67,89,01,23,45,67,890.000 +en_US 12,345,678,901,234,567,890.000 +it_CH 12'345'678'901'234'567'890,000 +ru_RU 12 345 678 901 234 567 890,000 +ta_IN 1,23,45,67,89,01,23,45,67,890.000 +SELECT fmt, format(-12345678901234567890, 3, fmt) FROM t1 ORDER BY fmt; +fmt format(-12345678901234567890, 3, fmt) +ar_AE -12,345,678,901,234,567,890.000 +ar_SA -12345678901234567890.000 +be_BY -12.345.678.901.234.567.890,000 +de_DE -12.345.678.901.234.567.890,000 +en_IN -1,23,45,67,89,01,23,45,67,890.000 +en_US -12,345,678,901,234,567,890.000 +it_CH -12'345'678'901'234'567'890,000 +ru_RU -12 345 678 901 234 567 890,000 +ta_IN -1,23,45,67,89,01,23,45,67,890.000 +SELECT fmt, format(-02345678901234567890, 3, fmt) FROM t1 ORDER BY fmt; +fmt format(-02345678901234567890, 3, fmt) +ar_AE -2,345,678,901,234,567,890.000 +ar_SA -2345678901234567890.000 +be_BY -2.345.678.901.234.567.890,000 +de_DE -2.345.678.901.234.567.890,000 +en_IN -23,45,67,89,01,23,45,67,890.000 +en_US -2,345,678,901,234,567,890.000 +it_CH -2'345'678'901'234'567'890,000 +ru_RU -2 345 678 901 234 567 890,000 +ta_IN -23,45,67,89,01,23,45,67,890.000 +SELECT fmt, format(-00345678901234567890, 3, fmt) FROM t1 ORDER BY fmt; +fmt format(-00345678901234567890, 3, fmt) +ar_AE -345,678,901,234,567,890.000 +ar_SA -345678901234567890.000 +be_BY -345.678.901.234.567.890,000 +de_DE -345.678.901.234.567.890,000 +en_IN -3,45,67,89,01,23,45,67,890.000 +en_US -345,678,901,234,567,890.000 +it_CH -345'678'901'234'567'890,000 +ru_RU -345 678 901 234 567 890,000 +ta_IN -3,45,67,89,01,23,45,67,890.000 +SELECT fmt, format(-00045678901234567890, 3, fmt) FROM t1 ORDER BY fmt; +fmt format(-00045678901234567890, 3, fmt) +ar_AE -45,678,901,234,567,890.000 +ar_SA -45678901234567890.000 +be_BY -45.678.901.234.567.890,000 +de_DE -45.678.901.234.567.890,000 +en_IN -45,67,89,01,23,45,67,890.000 +en_US -45,678,901,234,567,890.000 +it_CH -45'678'901'234'567'890,000 +ru_RU -45 678 901 234 567 890,000 +ta_IN -45,67,89,01,23,45,67,890.000 +DROP TABLE t1; +SELECT format(123, 1, 'Non-existent-locale'); +format(123, 1, 'Non-existent-locale') +123.0 +Warnings: +Warning 1649 Unknown locale: 'Non-existent-locale' +End of 5.4 tests +# +# Start of 5.5 tests +# +# +# Bug#55912 FORMAT with locale set fails for numbers < 1000 +# +SELECT FORMAT(123.33, 2, 'no_NO'), FORMAT(1123.33, 2, 'no_NO'); +FORMAT(123.33, 2, 'no_NO') FORMAT(1123.33, 2, 'no_NO') +123,33 1.123,33 +SELECT FORMAT(12333e-2, 2, 'no_NO'), FORMAT(112333e-2, 2, 'no_NO'); +FORMAT(12333e-2, 2, 'no_NO') FORMAT(112333e-2, 2, 'no_NO') +123,33 1.123,33 +CREATE TABLE t1 charset utf8mb4 AS SELECT format(123,2,'no_NO'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `format(123,2,'no_NO')` varchar(36) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT * FROM t1; +format(123,2,'no_NO') +123,00 +DROP TABLE t1; +# +# Bug#11764310 conv function crashes, negative argument to memcpy +# +SELECT CONV(1,-2147483648,-2147483648); +CONV(1,-2147483648,-2147483648) +NULL +# +# Bug#12985030 SIMPLE QUERY WITH DECIMAL NUMBERS LEAKS MEMORY +# +SELECT (rpad(1.0,2048,1)) IS NOT FALSE; +(rpad(1.0,2048,1)) IS NOT FALSE +1 +SELECT ((+0) IN +((0b111111111111111111111111111111111111111111111111111),(rpad(1.0,2048,1)), +(32767.1))); +((+0) IN +((0b111111111111111111111111111111111111111111111111111),(rpad(1.0,2048,1)), +(32767.1))) +0 +SELECT ((rpad(1.0,2048,1)) = ('4(') ^ (0.1)); +((rpad(1.0,2048,1)) = ('4(') ^ (0.1)) +0 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '4(' +SELECT +pow((rpad(10.0,2048,1)),(b'1111111111111111111111111111111111111111111')); +ERROR 22003: DOUBLE value is out of range in 'pow(rpad(10.0,2048,1),0x07ffffffffff)' +SELECT ((rpad(1.0,2048,1)) + (0) ^ ('../')); +((rpad(1.0,2048,1)) + (0) ^ ('../')) +1.011111111111111 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '../' +SELECT stddev_samp(rpad(1.0,2048,1)); +stddev_samp(rpad(1.0,2048,1)) +NULL +SELECT ((127.1) not in ((rpad(1.0,2048,1)),(''),(-1.1))); +((127.1) not in ((rpad(1.0,2048,1)),(''),(-1.1))) +1 +SELECT ((0xf3) * (rpad(1.0,2048,1)) << (0xcc)); +((0xf3) * (rpad(1.0,2048,1)) << (0xcc)) +0 +# +# Bug#13359121 LARGE NUMBERS, /STRINGS/DTOA.C:662: +# BALLOC: ASSERTION `K <= 15' FAILED. +# Bug#12985021 SIMPLE QUERY WITH DECIMAL NUMBERS TAKE AN +# EXTRAORDINARY LONG TIME TO EXECUTE +SELECT @tmp_max:= @@global.max_allowed_packet; +@tmp_max:= @@global.max_allowed_packet +67108864 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +SET @@global.max_allowed_packet=1024*1024*1024; +SELECT @@global.max_allowed_packet; +@@global.max_allowed_packet +1073741824 +do +format(rpad('111111111.1', +1111111, +'999999999999999999999999999999999999999999'),0,'be_BY') +; +DO +round( +concat( ( +coalesce( ( +ST_linefromwkb('2147483648', +-b'1111111111111111111111111111111111111111111')), +( convert('[.DC2.]',decimal(30,30)) ), +bit_count('') +) ), +( lpad( ( elt('01','}:K5')), +sha1('P'), +( ( select '-9223372036854775808.1' > all (select ''))) +) +) +) +); +ERROR 22003: SRID value is out of range in 'st_linefromwkb' +SET @@global.max_allowed_packet:= @tmp_max; +# +# End of 5.5 tests +# +# +# Start of 5.6 tests +# +# +# WL#5510 Functions to_base64 and from_base64 +# +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',63)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(85) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh +YWFhYWFh 85 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(63) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 63 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',62)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(85) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh +YWFhYWE= 85 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(63) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 62 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',61)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(85) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh +YWFhYQ== 85 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(63) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 61 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',60)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(81) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh +YWFh 81 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(60) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 60 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',59)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(81) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh +YWE= 81 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(60) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 59 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',58)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(81) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh +YQ== 81 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(60) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 58 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',57)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(76) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh 76 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(57) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 57 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',56)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(76) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWE= 76 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(57) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 56 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',55)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(76) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ== 76 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(57) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 55 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',54)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(72) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh 72 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(54) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 54 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',53)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(72) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWE= 72 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(54) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 53 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',52)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(72) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ== 72 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(54) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 52 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',51)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(68) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh 68 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(51) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 51 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',50)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(68) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWE= 68 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(51) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 50 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',49)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(68) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ== 68 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(51) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 49 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',48)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(64) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh 64 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(48) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 48 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',47)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(64) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWE= 64 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(48) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 47 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',46)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(64) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ== 64 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(48) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 46 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',45)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(60) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh 60 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(45) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 45 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',44)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(60) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWE= 60 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(45) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 44 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',43)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(60) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ== 60 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(45) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 43 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',42)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(56) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh 56 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(42) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 42 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',41)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(56) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWE= 56 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(42) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 41 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',40)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(56) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ== 56 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(42) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 40 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',39)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(52) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh 52 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(39) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 39 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',38)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(52) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWE= 52 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(39) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 38 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',37)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(52) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ== 52 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(39) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 37 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',36)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(48) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh 48 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(36) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 36 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',35)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(48) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWE= 48 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(36) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 35 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',34)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(48) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ== 48 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(36) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 34 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',33)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(44) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh 44 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(33) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 33 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',32)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(44) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWE= 44 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(33) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 32 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',31)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(44) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ== 44 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(33) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 31 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',30)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(40) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh 40 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 30 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',29)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(40) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWE= 40 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaaa 29 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',28)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(40) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ== 40 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaaa 28 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',27)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(36) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh 36 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(27) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaaa 27 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',26)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(36) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWE= 36 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(27) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaaa 26 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',25)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(36) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ== 36 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(27) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaaa 25 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',24)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(32) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh 32 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(24) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaaa 24 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',23)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(32) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWE= 32 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(24) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaaa 23 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',22)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(32) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFhYQ== 32 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(24) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaaa 22 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',21)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(28) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWFh 28 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(21) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaaa 21 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',20)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(28) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYWE= 28 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(21) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaaa 20 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',19)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(28) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFhYQ== 28 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(21) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaaa 19 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',18)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(24) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWFh 24 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(18) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaaa 18 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',17)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(24) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYWE= 24 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(18) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaaa 17 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',16)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(24) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFhYQ== 24 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(18) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaaa 16 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',15)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(20) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWFh 20 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(15) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaaa 15 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',14)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(20) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYWE= 20 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(15) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaaa 14 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',13)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(20) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFhYQ== 20 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(15) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaaa 13 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',12)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(16) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWFh 16 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(12) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaaa 12 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',11)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(16) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYWE= 16 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(12) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaaa 11 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',10)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(16) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFhYQ== 16 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(12) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaaa 10 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',9)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(12) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWFh 12 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(9) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaaa 9 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',8)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(12) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYWE= 12 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(9) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaaa 8 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',7)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(12) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFhYQ== 12 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(9) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaaa 7 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',6)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(8) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWFh 8 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(6) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaaa 6 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',5)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(8) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYWE= 8 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(6) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaaa 5 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',4)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(8) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFhYQ== 8 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(6) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaaa 4 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',3)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(4) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWFh 4 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(3) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aaa 3 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',2)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(4) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YWE= 4 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(3) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +aa 2 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',1)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` varchar(4) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) +YQ== 4 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` varbinary(3) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) +a 1 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 charset utf8mb4 AS SELECT TO_BASE64(REPEAT('a',0)) AS to_base64; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `to_base64` char(0) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT to_base64, LENGTH(to_base64) FROM t1; +to_base64 LENGTH(to_base64) + 0 +CREATE TABLE t2 charset utf8mb4 AS SELECT from_base64(to_base64) AS from_base64 FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `from_base64` binary(0) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SELECT from_base64, LENGTH(from_base64) FROM t2; +from_base64 LENGTH(from_base64) + 0 +DROP TABLE t2; +DROP TABLE t1; + +CREATE TABLE t1 (a VARBINARY(64)); +INSERT INTO t1 VALUES (0x00), (0x0000), (0x000000), (0x00000000); +INSERT INTO t1 VALUES (0x00010203040506070809); +SELECT TO_BASE64(a), hex(a) FROM t1 ORDER BY a; +TO_BASE64(a) hex(a) +AA== 00 +AAA= 0000 +AAAA 000000 +AAAAAA== 00000000 +AAECAwQFBgcICQ== 00010203040506070809 +DROP TABLE t1; +# +# Test NULL output for NULL input +# +SELECT TO_BASE64(NULL); +TO_BASE64(NULL) +NULL +SELECT FROM_BASE64(NULL); +FROM_BASE64(NULL) +NULL +# +# RFC4648 test vectors +# +SELECT @b:= TO_BASE64(''), FROM_BASE64(@b); +@b:= TO_BASE64('') FROM_BASE64(@b) + +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +SELECT @b:= TO_BASE64('f'), FROM_BASE64(@b); +@b:= TO_BASE64('f') FROM_BASE64(@b) +Zg== f +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +SELECT @b:= TO_BASE64('fo'), FROM_BASE64(@b); +@b:= TO_BASE64('fo') FROM_BASE64(@b) +Zm8= fo +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +SELECT @b:= TO_BASE64('foo'), FROM_BASE64(@b); +@b:= TO_BASE64('foo') FROM_BASE64(@b) +Zm9v foo +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +SELECT @b:= TO_BASE64('foob'), FROM_BASE64(@b); +@b:= TO_BASE64('foob') FROM_BASE64(@b) +Zm9vYg== foob +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +SELECT @b:= TO_BASE64('fooba'), FROM_BASE64(@b); +@b:= TO_BASE64('fooba') FROM_BASE64(@b) +Zm9vYmE= fooba +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +SELECT @b:= TO_BASE64('foobar'), FROM_BASE64(@b); +@b:= TO_BASE64('foobar') FROM_BASE64(@b) +Zm9vYmFy foobar +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +# +# Invalid characters - return NULL +# +SELECT hex(FROM_BASE64('#')); +hex(FROM_BASE64('#')) +NULL +SELECT hex(FROM_BASE64('A#')); +hex(FROM_BASE64('A#')) +NULL +SELECT hex(FROM_BASE64('AB#')); +hex(FROM_BASE64('AB#')) +NULL +SELECT hex(FROM_BASE64('ABC#')); +hex(FROM_BASE64('ABC#')) +NULL +SELECT hex(FROM_BASE64('ABCD#')); +hex(FROM_BASE64('ABCD#')) +NULL +# +# "=" is not valid on the first and second positions of a quadruple +# +SELECT hex(FROM_BASE64('=')); +hex(FROM_BASE64('=')) +NULL +SELECT hex(FROM_BASE64('A=')); +hex(FROM_BASE64('A=')) +NULL +SELECT hex(FROM_BASE64('ABCD=')); +hex(FROM_BASE64('ABCD=')) +NULL +SELECT hex(FROM_BASE64('ABCDE=')); +hex(FROM_BASE64('ABCDE=')) +NULL +# +# Incomplete sequences - return NULL +# +SELECT hex(FROM_BASE64('A')); +hex(FROM_BASE64('A')) +NULL +SELECT hex(FROM_BASE64('AB')); +hex(FROM_BASE64('AB')) +NULL +SELECT hex(FROM_BASE64('ABC')); +hex(FROM_BASE64('ABC')) +NULL +# +# Unexpected input after pad characters - return NULL +# +SELECT hex(FROM_BASE64('AAA=x')); +hex(FROM_BASE64('AAA=x')) +NULL +SELECT hex(FROM_BASE64('AA==x')); +hex(FROM_BASE64('AA==x')) +NULL +# +# Delimiters are allowed at any position +# +SELECT hex(FROM_BASE64(' A B C D ')); +hex(FROM_BASE64(' A B C D ')) +001083 +SELECT hex(FROM_BASE64(' A A = = ')); +hex(FROM_BASE64(' A A = = ')) +00 +SELECT hex(FROM_BASE64(' A A A = ')); +hex(FROM_BASE64(' A A A = ')) +0000 +SELECT hex(FROM_BASE64(' A \n B \r C \t D ')); +hex(FROM_BASE64(' A \n B \r C \t D ')) +001083 +# +# Testing that to_base64 respects max_allowed_packet +# +SELECT LENGTH(TO_BASE64(REPEAT('a', @@max_allowed_packet-10))); +LENGTH(TO_BASE64(REPEAT('a', @@max_allowed_packet-10))) +NULL +Warnings: +Warning 1301 Result of to_base64() was larger than max_allowed_packet (67108864) - truncated +# +# Testing base64 with various data types +# +CREATE TABLE t1 ( +i1 INT, +f1 FLOAT, +dc1 DECIMAL(10,5), +e1 ENUM('enum11','enum12','enum13'), +s1 SET('set1','set2','set3'), +t1 TIME, +d1 DATE, +dt1 DATETIME +); +INSERT INTO t1 VALUES +(-12345, -456.789, 123.45, 'enum13', 'set1,set3', +'01:02:03', '2010-01-01', '2011-01-01 02:03:04'); +SELECT FROM_BASE64(TO_BASE64(i1)) FROM t1; +FROM_BASE64(TO_BASE64(i1)) +-12345 +SELECT FROM_BASE64(TO_BASE64(f1)) FROM t1; +FROM_BASE64(TO_BASE64(f1)) +-456.789 +SELECT FROM_BASE64(TO_BASE64(dc1)) FROM t1; +FROM_BASE64(TO_BASE64(dc1)) +123.45000 +SELECT FROM_BASE64(TO_BASE64(e1)) FROM t1; +FROM_BASE64(TO_BASE64(e1)) +enum13 +SELECT FROM_BASE64(TO_BASE64(s1)) FROM t1; +FROM_BASE64(TO_BASE64(s1)) +set1,set3 +SELECT FROM_BASE64(TO_BASE64(t1)) FROM t1; +FROM_BASE64(TO_BASE64(t1)) +01:02:03 +SELECT FROM_BASE64(TO_BASE64(d1)) FROM t1; +FROM_BASE64(TO_BASE64(d1)) +2010-01-01 +SELECT FROM_BASE64(TO_BASE64(dt1)) FROM t1; +FROM_BASE64(TO_BASE64(dt1)) +2011-01-01 02:03:04 +DROP TABLE t1; +# +# Bug#11765562 58545: +# EXPORT_SET() CAN BE USED TO MAKE ENTIRE SERVER COMPLETELY UNRESPONSIVE +# +SELECT @tmp_max:= @@global.max_allowed_packet; +@tmp_max:= @@global.max_allowed_packet +67108864 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +SET @@global.max_allowed_packet=1024*1024*1024; +SELECT @@global.max_allowed_packet; +@@global.max_allowed_packet +1073741824 +SELECT CHAR_LENGTH(EXPORT_SET(1,1,1,REPEAT(1,100000000))); +CHAR_LENGTH(EXPORT_SET(1,1,1,REPEAT(1,100000000))) +NULL +Warnings: +Warning 1301 Result of export_set() was larger than max_allowed_packet (1073741824) - truncated +SET @@global.max_allowed_packet:= @tmp_max; +SELECT SPACE(@@global.max_allowed_packet*2); +SPACE(@@global.max_allowed_packet*2) +NULL +Warnings: +Warning 1301 Result of space() was larger than max_allowed_packet (67108864) - truncated +SET NAMES latin1; +PREPARE stmt FROM "SELECT COLLATION(space(2))"; +EXECUTE stmt; +COLLATION(space(2)) +latin1_swedish_ci +SET NAMES latin2; +EXECUTE stmt; +COLLATION(space(2)) +latin1_swedish_ci +# +# Bug#11829861: SUBSTRING_INDEX() RESULTS IN MISSING CHARACTERS WHEN USED +# INSIDE LOWER() +# +SET @user_at_host = 'root@mytinyhost-PC.local'; +SELECT LOWER(SUBSTRING_INDEX(@user_at_host, '@', -1)); +LOWER(SUBSTRING_INDEX(@user_at_host, '@', -1)) +mytinyhost-pc.local +# End of test BUG#11829861 +# +# Bug#42404: SUBSTRING_INDEX() RESULTS ARE INCONSISTENT +# +CREATE TABLE t (i INT NOT NULL, c CHAR(255) NOT NULL); +INSERT INTO t VALUES (0,'.www.mysql.com'),(1,'.wwwmysqlcom'); +SELECT i, SUBSTRING_INDEX(c, '.', -2) FROM t WHERE i = 1; +i SUBSTRING_INDEX(c, '.', -2) +1 .wwwmysqlcom +SELECT i, SUBSTRING_INDEX(c, '.', -2) FROM t; +i SUBSTRING_INDEX(c, '.', -2) +0 mysql.com +1 .wwwmysqlcom +DROP TABLE t; +# End of test BUG#42404 +# +# Bug#13812875 ILLEGAL MIX OF COLLATIONS WITH FUNCTIONS THAT USED TO WORK +# +SET NAMES utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +CREATE TABLE t1 (a varchar(1)); +SELECT * FROM t1 WHERE a=md5('a'); +a +SELECT * FROM t1 WHERE a=hex('a'); +a +SELECT * FROM t1 WHERE a=to_base64('a'); +a +DROP TABLE t1; +SET NAMES latin1; +# +# Bug #11765149 DUPLICATE ENTRY ERROR WHEN DOING GROUP BY +# +create table t1(a varchar(20)); +insert into t1 values(''), (' '), ('xxxxxxxxxxxxxxx'); +create table t2(a int); +insert into t2 values(0),(0),(1),(0),(10),(-2),(30),(NULL); +select t1.a as str, length(t1.a) as str_length, t2.a as pos, t2.a + 10 as length, insert(t1.a, t2.a, t2.a + 10, '1234567') as 'insert' from t1, t2; +str str_length pos length insert + 0 -2 8 + 0 0 10 + 0 0 10 + 0 0 10 + 0 1 11 + 0 10 20 + 0 30 40 + 0 NULL NULL NULL + 1 -2 8 + 1 0 10 + 1 0 10 + 1 0 10 + 1 1 11 1234567 + 1 10 20 + 1 30 40 + 1 NULL NULL NULL +xxxxxxxxxxxxxxx 15 -2 8 xxxxxxxxxxxxxxx +xxxxxxxxxxxxxxx 15 0 10 xxxxxxxxxxxxxxx +xxxxxxxxxxxxxxx 15 0 10 xxxxxxxxxxxxxxx +xxxxxxxxxxxxxxx 15 0 10 xxxxxxxxxxxxxxx +xxxxxxxxxxxxxxx 15 1 11 1234567xxxx +xxxxxxxxxxxxxxx 15 10 20 xxxxxxxxx1234567 +xxxxxxxxxxxxxxx 15 30 40 xxxxxxxxxxxxxxx +xxxxxxxxxxxxxxx 15 NULL NULL NULL +drop table t1,t2; +# +# Bug #19174480: INSERT STRING FUNCTIONS RECENTLY CRASHING +# +CREATE TABLE t1(a TIMESTAMP(5)) ENGINE=INNODB; +INSERT INTO t1 VALUES('1978-01-03 00:00:00'),('2000-001-02 00:00:00'); +SELECT 1 FROM t1 GROUP BY insert(a,'1','11','1'); +1 +1 +SELECT insert(a,1,1,1) FROM t1; +insert(a,1,1,1) +1978-01-03 00:00:00.00000 +1000-01-02 00:00:00.00000 +DROP TABLE t1; +# +# Bug#22888420 CONCAT_WS: ASSERTION FAILED: !S.USES_BUFFER_OWNED_BY(THIS) +# +do concat('a',concat_ws('a', 0x2859, 'a' , +trim(period_add('a',1) from (1&'')) +) +); +ERROR HY000: Incorrect arguments to period_add +# +# End of 5.6 tests +# +# +# Bug#19646643 REPEAT() WASTES CPU TIME ON LARGE INPUT VALUES +# THAT GAURANTEE EMPTY RESULT +# +SET @@global.max_allowed_packet=1024*1024; +connect newconn, localhost, root,,; +select length(repeat("",1)) as a; +a +0 +select length(repeat("",1024*1024*1024)) as a; +a +0 +select length(repeat("1",1024*1024)) as a; +a +1048576 +select length(repeat("1",1024*1024*1024)) as a; +a +NULL +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated +disconnect newconn; +connection default; +SET @@global.max_allowed_packet:= DEFAULT; +# +# Bug#20316028 RPAD + UTF16 ON X86 BUILD RUNNING ON WIN64 STACK +# EXPLOITABLE +do rpad(_utf16"33",1073741826,_latin1"44"); +Warnings: +Warning 1301 Result of rpad() was larger than max_allowed_packet (67108864) - truncated +# +# Bug#13740934 ASSERTION FAILED: ARGS[0]->FIXED ITEM_FUNC_CONV_CHARSET::ITEM_FUNC_CONV_CHARSET +# +CREATE TABLE t1(a TIME); +INSERT INTO t1 VALUES (); +SELECT (SELECT (SELECT 1 FROM t1 a WHERE t1.a <_ucs2'a')) AS d5 FROM t1 GROUP BY 1; +d5 +NULL +Warnings: +Warning 1292 Incorrect time value: 'a' for column 'a' at row 1 +DROP TABLE t1; +# +# Bug#21317406 TRUNCATED DATA WITH SUBQUERY & UTF8 +# +SELECT length(rpad(_utf8 0xD0B1, 65536, _utf8 0xD0B2)) AS data; +data +131072 +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT length(data) AS len FROM ( +SELECT rpad(_utf8 0xD0B1, 65536, _utf8 0xD0B2) AS data +) AS sub; +len +131072 +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT length(rpad(_utf8 0xD0B1, 65535, _utf8 0xD0B2)) AS data; +data +131070 +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT length(data) AS len FROM ( +SELECT rpad(_utf8 0xD0B1, 65535, _utf8 0xD0B2) AS data +) AS sub; +len +131070 +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT length(repeat(_utf8mb4 0xE29883, 21844)) AS data; +data +65532 +SELECT length(data) AS len +FROM ( SELECT repeat(_utf8mb4 0xE29883, 21844) AS data ) AS sub; +len +65532 +SELECT length(repeat(_utf8mb4 0xE29883, 21846)) AS data; +data +65538 +SELECT length(data) AS len +FROM ( SELECT repeat(_utf8mb4 0xE29883, 21846) AS data ) AS sub; +len +65538 +# +# Bug #22884187 RTRIM GETS EXPONENTIALLY SLOWER ON LARGE STRINGS +# +set names utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT TRIM(BOTH 'å' FROM 'aæaå'); +TRIM(BOTH 'å' FROM 'aæaå') +aæa +set names default; +SELECT HEX(TRIM(CONVERT(_gb18030 0x20202081408141208144202020 USING utf32))); +HEX(TRIM(CONVERT(_gb18030 0x20202081408141208144202020 USING utf32))) +00004E0200004E040000002000004E0F +# +# Bug#21447969 FILTER USING TRIM RESULTS IN CORRECT +# +CREATE TABLE t1 (COUNTRY char(100)); +INSERT INTO t1 VALUES ("Norway"), ("Australia"); +SELECT COUNTRY FROM t1 +WHERE trim(leading 'A' FROM COUNTRY) = 'ustralia'; +COUNTRY +Australia +SELECT COUNTRY FROM t1 +WHERE trim(trailing 'a' FROM COUNTRY)= 'Australi'; +COUNTRY +Australia +SELECT COUNTRY FROM t1 +WHERE trim(leading 'A' FROM COUNTRY) = 'ustralia' +AND trim(trailing 'a' FROM COUNTRY) = 'Australi'; +COUNTRY +Australia +DROP TABLE t1; +# +# Bug#22391186 TRUE WHERE CLAUSE DOESN'T RETURN EXPECTED ROW, +# BUT EMPTY SET +# +CREATE DATABASE testt CHARACTER SET utf8mb4; +USE testt; +SET NAMES 'utf8mb4'; +CREATE TABLE t1(c1 CHAR(20)); +INSERT INTO t1 VALUES('11'); +SELECT c1 <= REPEAT( SUBSTR( UPPER('Rdlpikti') , 1 , 2 ), 8 ) FROM t1; +c1 <= REPEAT( SUBSTR( UPPER('Rdlpikti') , 1 , 2 ), 8 ) +1 +SELECT * FROM t1 WHERE c1 <= REPEAT( SUBSTR( UPPER('Rdlpikti') , 1 , 2 ), 8); +c1 +11 +SELECT * FROM t1 WHERE c1 <= REPEAT( SUBSTR( UPPER('Rdlpikti') , 1 , 2 ), 8); +c1 +11 +DROP TABLE t1; +DROP DATABASE testt; +SET NAMES DEFAULT; +USE test; +# +# Bug#22297983 HEX() FUNCTION CONVERTS DECIMAL TO DOUBLE AND +# THUS RETURNS WRONG RESULT +# +select hex(cast(9007199254740992 as decimal(30,0))); +hex(cast(9007199254740992 as decimal(30,0))) +20000000000000 +select hex(cast(9007199254740993 as decimal(30,0))); +hex(cast(9007199254740993 as decimal(30,0))) +20000000000001 +select hex(cast(9007199254740994 as decimal(30,0))); +hex(cast(9007199254740994 as decimal(30,0))) +20000000000002 +select hex(cast(0x20000000000000 as unsigned) + 1); +hex(cast(0x20000000000000 as unsigned) + 1) +20000000000001 +select hex(cast(0x20000000000000 as decimal(30,0)) + 1); +hex(cast(0x20000000000000 as decimal(30,0)) + 1) +20000000000001 +select hex(cast(0x20000000000000 as decimal(30,0)) + 2); +hex(cast(0x20000000000000 as decimal(30,0)) + 2) +20000000000002 +# +# Bug#22523836 FUNCTION REPLACE WITH BINARY OP DOESNT RETURN EXPECTED +# NULL, WITH PARAM AS NULL +# +SELECT REPLACE( 'a', binary 'b', NULL ) as xxx; +xxx +NULL +SELECT REPLACE( 'a', binary '', NULL ) as xxx; +xxx +NULL +SELECT REPLACE( 'a', 'b', NULL ) as xxx; +xxx +NULL +SELECT REPLACE( 'a', '', NULL ) as xxx; +xxx +NULL +SELECT REPLACE( NULL, 'b', 'bravo' ) as xxx; +xxx +NULL +SELECT REPLACE( NULL, '', 'bravo' ) as xxx; +xxx +NULL +SELECT REPLACE( 'a', NULL, 'bravo' ) as xxx; +xxx +NULL +SELECT REPLACE( 'a', binary NULL, 'bravo' ) as xxx; +xxx +NULL +# +# Bug#22565155 DATA ROWS LOST AFTER ADDING DISTINCT WITH +# SUBSTR() IN SELECT LIST +# +CREATE TABLE t1(c1 CHAR(30)); +INSERT INTO t1 VALUES('111'),('222'); +SELECT DISTINCT substr(c1, 1, 2147483647) FROM t1; +substr(c1, 1, 2147483647) +111 +222 +SELECT DISTINCT substr(c1, 1, 2147483648) FROM t1; +substr(c1, 1, 2147483648) +111 +222 +SELECT DISTINCT substr(c1, -1, 2147483648) FROM t1; +substr(c1, -1, 2147483648) +1 +2 +SELECT DISTINCT substr(c1, -2147483647, 2147483648) FROM t1; +substr(c1, -2147483647, 2147483648) + +SELECT DISTINCT substr(c1, 9223372036854775807, 23) FROM t1; +substr(c1, 9223372036854775807, 23) + +SELECT DISTINCT left(c1, 3) FROM t1; +left(c1, 3) +111 +222 +SELECT DISTINCT left(c1, 2147483647) FROM t1; +left(c1, 2147483647) +111 +222 +SELECT DISTINCT left(c1, 2147483648) FROM t1; +left(c1, 2147483648) +111 +222 +SELECT DISTINCT right(c1, 3) FROM t1; +right(c1, 3) +111 +222 +SELECT DISTINCT right(c1, 2147483647) FROM t1; +right(c1, 2147483647) +111 +222 +SELECT DISTINCT right(c1, 2147483648) FROM t1; +right(c1, 2147483648) +111 +222 +DROP TABLE t1; +# +# Bug#22545429 FUNC SUBSTRING_INDEX WORKS INCORRECTLY +# WHEN THE COUNT PARAM IS A BIGINT UNSIGNED +# +SELECT SUBSTRING_INDEX( 'xyz', 'abc', 9223372036854775807 ); +SUBSTRING_INDEX( 'xyz', 'abc', 9223372036854775807 ) +xyz +SELECT SUBSTRING_INDEX( 'xyz', 'abc', 9223372036854775808 ); +SUBSTRING_INDEX( 'xyz', 'abc', 9223372036854775808 ) +xyz +SELECT SUBSTRING_INDEX( 'xyz', 'abc', 18446744073709551615 ); +SUBSTRING_INDEX( 'xyz', 'abc', 18446744073709551615 ) +xyz +set names utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +SELECT SUBSTRING_INDEX( 'xyz', 'abc', 9223372036854775807 ); +SUBSTRING_INDEX( 'xyz', 'abc', 9223372036854775807 ) +xyz +SELECT SUBSTRING_INDEX( 'xyz', 'abc', 9223372036854775808 ); +SUBSTRING_INDEX( 'xyz', 'abc', 9223372036854775808 ) +xyz +SELECT SUBSTRING_INDEX( 'xyz', 'abc', 18446744073709551615 ); +SUBSTRING_INDEX( 'xyz', 'abc', 18446744073709551615 ) +xyz +SELECT SUBSTRING_INDEX('www.mysql.com', '.', 1); +SUBSTRING_INDEX('www.mysql.com', '.', 1) +www +SELECT SUBSTRING_INDEX('www.mysql.com', '.', -1); +SUBSTRING_INDEX('www.mysql.com', '.', -1) +com +SELECT SUBSTRING_INDEX('www.mysql.com', '.', 100); +SUBSTRING_INDEX('www.mysql.com', '.', 100) +www.mysql.com +SELECT SUBSTRING_INDEX('www.mysql.com', '.', -100); +SUBSTRING_INDEX('www.mysql.com', '.', -100) +www.mysql.com +SELECT SUBSTRING_INDEX('www.mysql.com', '.', 2147483647); +SUBSTRING_INDEX('www.mysql.com', '.', 2147483647) +www.mysql.com +SELECT SUBSTRING_INDEX('www.mysql.com', '.', -2147483647); +SUBSTRING_INDEX('www.mysql.com', '.', -2147483647) +www.mysql.com +SELECT SUBSTRING_INDEX('www.mysql.com', '.', 2147483648); +SUBSTRING_INDEX('www.mysql.com', '.', 2147483648) +www.mysql.com +SELECT SUBSTRING_INDEX('www.mysql.com', '.', -2147483648); +SUBSTRING_INDEX('www.mysql.com', '.', -2147483648) +www.mysql.com +SELECT SUBSTRING_INDEX('www.mysql.com', '.', 2147483649); +SUBSTRING_INDEX('www.mysql.com', '.', 2147483649) +www.mysql.com +SELECT SUBSTRING_INDEX('www.mysql.com', '.', -2147483649); +SUBSTRING_INDEX('www.mysql.com', '.', -2147483649) +www.mysql.com +set names default; +# +# Bug#22882717 "BIN", "OCT" FUNCTION LEADS TO MANY VALGRIND ERRORS +# +SELECT BIN(MID(REPEAT('b',64),21,229)); +BIN(MID(REPEAT('b',64),21,229)) +0 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +SELECT BIN(MID(1.051098E+308,9,99)); +BIN(MID(1.051098E+308,9,99)) +0 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'e308' +SELECT BIN(RIGHT(REPEAT('b',64),30)); +BIN(RIGHT(REPEAT('b',64),30)) +0 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +SELECT BIN(SUBSTRING(REPEAT('b',64),9)); +BIN(SUBSTRING(REPEAT('b',64),9)) +0 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +SELECT OCT(LEFT(REPEAT('b',64),15)); +OCT(LEFT(REPEAT('b',64),15)) +0 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'bbbbbbbbbbbbbbb' +# +# Bug#22900560 CAST .. AS BINARY.. HEAP-USE-AFTER-FREE FROM ASAN +# +do +from_base64(aes_encrypt(right(cast((0x5d44f4d736397d92c8267c12)as decimal),1), +rand(to_days('2028-12-04 15:50:01.284969')))); +Warnings: +Warning 1292 Truncated incorrect BINARY value: 'x'5d44f4d736397d92c8267c12'' +Warning 1264 Out of range value for column '(null)' at row 1 +do from_base64(cast(right(11,1)as binary(24))); +do convert(inet_aton(cast(left(-1,1)as binary(30))) using utf8); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +Warning 1411 Incorrect string value: 'cast(left(-(1),1) as char(30) charset binary)' for function inet_aton +do from_base64(cast((left(collation(4097),((repeat('1',32))or((-18772))))) +as binary(40))); +do from_base64(cast((mid(17653,row('-688:20:12.162697',(null)) >= +row(('*.)$'),(0xc254b6)),1))as binary(34))); +do from_base64(cast((mid(uuid(),20,64)) as binary(55))); +set @e:=_latin1'77'; +do inet_aton(aes_encrypt(left(@e,1),5)); +Warnings: +Warning 1411 Incorrect string value: 'aes_encrypt(left((@`e`),1),5)' for function inet_aton +# +# Bug#23194118 WEIGHT_STRING: ASSERTION FAILED: +# SRC, FILE .\STRINGS\CTYPE-UTF8.CC, LINE 8686 +# +SET NAMES utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +CREATE TABLE t(a INT) engine=innodb; +INSERT INTO t VALUES(1); +SELECT 1 FROM t WHERE WEIGHT_STRING(CONCAT_WS('1','')); +1 +SELECT 1 FROM t WHERE WEIGHT_STRING(CONCAT('','')); +1 +SET NAMES DEFAULT; +DROP TABLE t; +# +# Bug#24376444 USING COLLATE IN WHERE CLAUSE PREVENTS OPTIMIZER FROM +# CONSIDERING INDEXES +CREATE TABLE dd_table (name VARCHAR(64) COLLATE utf8_tolower_ci, UNIQUE KEY(name)); +Warnings: +Warning 3778 'utf8_tolower_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead. +INSERT INTO dd_table VALUES('t1'), ('t2'); +CREATE VIEW view1 AS SELECT name AS table_name FROM dd_table; +CREATE VIEW view2 AS SELECT name COLLATE utf8_tolower_ci AS table_name FROM dd_table; +CREATE PROCEDURE sub1(id CHAR(10) CHARACTER SET utf8) +BEGIN +SELECT * FROM view1 WHERE table_name=id COLLATE utf8_tolower_ci; +EXPLAIN SELECT * FROM view1 WHERE table_name=id COLLATE utf8_tolower_ci; +SELECT * FROM view2 WHERE table_name=id; +EXPLAIN SELECT * FROM view2 WHERE table_name=id; +SELECT * FROM dd_table WHERE name COLLATE utf8_tolower_ci = id; +EXPLAIN SELECT * FROM dd_table WHERE name COLLATE utf8_tolower_ci = id; +SELECT * FROM view1 WHERE id COLLATE utf8_tolower_ci=table_name; +EXPLAIN SELECT * FROM view1 WHERE id COLLATE utf8_tolower_ci=table_name; +SELECT * FROM view2 WHERE id=table_name; +EXPLAIN SELECT * FROM view2 WHERE id=table_name; +SELECT * FROM dd_table WHERE id = name COLLATE utf8_tolower_ci; +EXPLAIN SELECT * FROM dd_table WHERE id = name COLLATE utf8_tolower_ci; +SELECT * FROM view1 WHERE table_name COLLATE utf8_tolower_ci = id; +EXPLAIN SELECT * FROM view1 WHERE table_name COLLATE utf8_tolower_ci = id; +END | +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +CALL sub1('t1'); +table_name +t1 +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE dd_table NULL const name name 195 const 1 100.00 Using index +table_name +t1 +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE dd_table NULL const name name 195 const 1 100.00 Using index +name +t1 +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE dd_table NULL const name name 195 const 1 100.00 Using index +table_name +t1 +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE dd_table NULL const name name 195 const 1 100.00 Using index +table_name +t1 +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE dd_table NULL const name name 195 const 1 100.00 Using index +name +t1 +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE dd_table NULL const name name 195 const 1 100.00 Using index +table_name +t1 +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE dd_table NULL index NULL name 195 NULL 2 100.00 Using where; Using index +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +Note 1003 /* select#1 */ select `test`.`dd_table`.`name` AS `table_name` from `test`.`dd_table` where ((`test`.`dd_table`.`name` collate utf8_tolower_ci) = (id@0)) +DROP PROCEDURE sub1; +DROP VIEW view1; +DROP VIEW view2; +DROP TABLE dd_table; +# +# Bug#24911350 LOCATE('HE','HELLO',NULL) SHOULD RETURN NULL INSTEAD OF 0 +# +select locate('he','hello',null),locate('he',null,2),locate(null,'hello',2); +locate('he','hello',null) locate('he',null,2) locate(null,'hello',2) +NULL NULL NULL +select locate(null,'hello',null),locate('he',null,null); +locate(null,'hello',null) locate('he',null,null) +NULL NULL +select left('hello',null),left(null,1),left(null,null); +left('hello',null) left(null,1) left(null,null) +NULL NULL NULL +select right('hello',null),right(null,1),right(null,null); +right('hello',null) right(null,1) right(null,null) +NULL NULL NULL +select mid('hello',1,null),mid('hello',null,1),mid(null,1,1); +mid('hello',1,null) mid('hello',null,1) mid(null,1,1) +NULL NULL NULL +select substr('hello',null,2),substr('hello',2,null),substr(null,1,2); +substr('hello',null,2) substr('hello',2,null) substr(null,1,2) +NULL NULL NULL +select substr(null,null,null),mid(null,null,null); +substr(null,null,null) mid(null,null,null) +NULL NULL +select substring_index('the king of the the null','the',null); +substring_index('the king of the the null','the',null) +NULL +select substring_index('the king of the the null',null,3); +substring_index('the king of the the null',null,3) +NULL +select substring_index(null,'the',3); +substring_index(null,'the',3) +NULL +select substring_index(null,null,3); +substring_index(null,null,3) +NULL +select substring_index(null,null,null); +substring_index(null,null,null) +NULL +select insert(null,2,1,'hi'),insert('txs',null,1,'hi'); +insert(null,2,1,'hi') insert('txs',null,1,'hi') +NULL NULL +select insert('txs',2,null,'hi'),insert('txs',2,1,null); +insert('txs',2,null,'hi') insert('txs',2,1,null) +NULL NULL +select insert('txs',null,null,'hi'),insert(null,null,null,null); +insert('txs',null,null,'hi') insert(null,null,null,null) +NULL NULL +# +# Bug #24930038 BITWISE SHIFT: ASSERTION FAILED: NULL_VALUE OR LOST CONNECTION TO SERVER ERROR +# +SET @orig_sql_mode = @@SQL_MODE; +SET SQL_MODE=''; +SELECT REPEAT(0x1111, 40000000) >> 1; +REPEAT(0x1111, 40000000) >> 1 +NULL +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (67108864) - truncated +SELECT (~(REPEAT(0xb822, 0x5C9C380))); +(~(REPEAT(0xb822, 0x5C9C380))) +NULL +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (67108864) - truncated +SET SQL_MODE=@orig_sql_mode; +# +# Bug#25688192 ASSERTION FAILED: MAYBE_NULL IN ITEM_FUNC_CONCAT::VAL_STR +# +set @max_allowed_packet=@@global.max_allowed_packet; +set global max_allowed_packet=2048; +Warnings: +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' +connect con1,localhost,root,,; +set sql_mode=""; +do concat(export_set(1,1,repeat('a',31),' $',213)); +Warnings: +Warning 1301 Result of export_set() was larger than max_allowed_packet (2048) - truncated +disconnect con1; +connection default; +set global max_allowed_packet=@max_allowed_packet; +# +# Bug#26524721 ASSERTION MAYBE_NULL FAILED IN ITEM_FUNC_CONCAT::VAL_STR +# +CREATE TABLE t(x VARCHAR(10) NOT NULL); +Warnings: +Warning 3135 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release. +SELECT COUNT(*), CONCAT(x, 'x') FROM (SELECT * FROM t) AS tt; +COUNT(*) CONCAT(x, 'x') +0 NULL +DROP TABLE t; +# Bug#26049942 create table .. as select .. quote() give wrong length +SET NAMES latin1; +CREATE TABLE t1 AS SELECT quote('a'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `quote('a')` varchar(4) CHARACTER SET latin1 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SET NAMES utf8; +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +CREATE TABLE t2 AS SELECT quote('a'); +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `quote('a')` varchar(4) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SET NAMES utf8mb4; +CREATE TABLE t3 AS SELECT quote('a'); +SHOW CREATE TABLE t3; +Table Create Table +t3 CREATE TABLE `t3` ( + `quote('a')` varchar(4) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SET NAMES DEFAULT; +DROP TABLE t1, t2, t3; +# +# Bug #27410088: LOWER(CHAR(51386)) NOT EVALUATED CONSISTENTLY IN +# STORED PROCEDURE +# +CREATE PROCEDURE proc (ofs INT, count INT) +BEGIN +DECLARE i INT DEFAULT ofs; +WHILE i < count DO +SELECT i AS i; +IF LOWER(CHAR(i USING utf8) COLLATE utf8_tolower_ci) != +LOWER(CHAR(i USING utf8mb4) COLLATE utf8mb4_0900_as_ci) THEN +SELECT i AS 'found funny character'; +END IF; +SET i = i + 1; +END WHILE; +END| +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +CALL proc(51390, 51394); +i +51390 +found funny character +51390 +i +51391 +i +51392 +i +51393 +CALL proc(51390, 51394); +i +51390 +found funny character +51390 +i +51391 +i +51392 +i +51393 +DROP PROCEDURE proc; +# +# Bug#29133127 ASSERTION `MAYBE_NULL' FAILED +# |ITEM_FUNC_CONCAT::VAL_STR(STRING*) +# +SET GLOBAL max_allowed_packet=1024; +Warnings: +Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length' +Warnings: +Warning 3135 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release. +SET collation_connection=utf32_unicode_ci; +SELECT +CONCAT('"',CONCAT('";"',repeat('a',60), +repeat('b',60), +repeat('c',60), +repeat ('d',100)),'"'); +CONCAT('"',CONCAT('";"',repeat('a',60), +repeat('b',60), +repeat('c',60), +repeat ('d',100)),'"') +NULL +Warnings: +Warning 1301 Result of concat() was larger than max_allowed_packet (1024) - truncated +SELECT +CONCAT('"',CONCAT_WS('";"',repeat('a',60), +repeat('b',60), +repeat('c',60), +repeat ('d',100)),'"'); +CONCAT('"',CONCAT_WS('";"',repeat('a',60), +repeat('b',60), +repeat('c',60), +repeat ('d',100)),'"') +NULL +Warnings: +Warning 1301 Result of concat_ws() was larger than max_allowed_packet (1024) - truncated +SELECT +CONCAT_WS('"',CONCAT_WS('";"',repeat('a',60), +repeat('b',60), +repeat('c',60), +repeat ('d',100)),'"'); +CONCAT_WS('"',CONCAT_WS('";"',repeat('a',60), +repeat('b',60), +repeat('c',60), +repeat ('d',100)),'"') +" +Warnings: +Warning 1301 Result of concat_ws() was larger than max_allowed_packet (1024) - truncated +SELECT +CONCAT('"',CONCAT('";"',repeat('a',60), +repeat('b',60), +repeat('c',60), +repeat ('d',100)),'"'); +CONCAT('"',CONCAT('";"',repeat('a',60), +repeat('b',60), +repeat('c',60), +repeat ('d',100)),'"') +NULL +Warnings: +Warning 1301 Result of concat() was larger than max_allowed_packet (1024) - truncated +SELECT +CONCAT('"',CONCAT_WS('";"',repeat('a',60), +repeat('b',60), +repeat('c',60), +repeat ('d',100)),'"'); +CONCAT('"',CONCAT_WS('";"',repeat('a',60), +repeat('b',60), +repeat('c',60), +repeat ('d',100)),'"') +NULL +Warnings: +Warning 1301 Result of concat_ws() was larger than max_allowed_packet (1024) - truncated +SELECT +CONCAT_WS('"',CONCAT_WS('";"',repeat('a',60), +repeat('b',60), +repeat('c',60), +repeat ('d',100)),'"'); +CONCAT_WS('"',CONCAT_WS('";"',repeat('a',60), +repeat('b',60), +repeat('c',60), +repeat ('d',100)),'"') +" +Warnings: +Warning 1301 Result of concat_ws() was larger than max_allowed_packet (1024) - truncated +SET GLOBAL max_allowed_packet=default; +# +# Bug#29739778 ASSERTION FAILED: MAYBE_NULL, +# IN ITEM_STR_FUNC::PUSH_PACKET_OVERFLOW_WARNING +# +set sql_mode=''; +do repeat(row_count() ,((-9223372036854775808 )<<('{ }' )) ); +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '{ }' +Warning 1292 Truncated incorrect INTEGER value: '{ }' +Warning 1301 Result of repeat() was larger than max_allowed_packet (67108864) - truncated +do ((repeat(1,9223372036854775808))or(convert((0x6d5b5d8d)using dec8))); +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (67108864) - truncated +Warning 1292 Truncated incorrect DOUBLE value: 'm[]' +set sql_mode=default; +# +# Bug #30114420 ASSERTION `CURRENT_THD->IS_ERROR()' +# FAILED|SQL/ITEM_STRFUNC.CC +# +CREATE TABLE t1(c1 VARCHAR(10)); +INSERT INTO t1 VALUES ('Alaska'); +SELECT HEX(LPAD('', 42, REPLACE(COMPRESS(42),c1,''))) FROM t1; +HEX(LPAD('', 42, REPLACE(COMPRESS(42),c1,''))) +02000000789C33310200009C006702000000789C33310200009C006702000000789C33310200009C0067 +SELECT HEX(LPAD('', 42, SUBSTRING_INDEX(COMPRESS(42),c1,1))) FROM t1; +HEX(LPAD('', 42, SUBSTRING_INDEX(COMPRESS(42),c1,1))) +02000000789C33310200009C006702000000789C33310200009C006702000000789C33310200009C0067 +SELECT LPAD('', 42, REPLACE(RANDOM_BYTES(42),c1,'')) FROM t1; +SELECT LPAD('', 42, REPLACE(AES_ENCRYPT(c1, 'key'),c1,'')) FROM t1; +SELECT LPAD('', 42, REPLACE(MD5(c1),c1,'')) FROM t1; +LPAD('', 42, REPLACE(MD5(c1),c1,'')) +e15997c74a71c5d9263df6f7a21bc191e15997c74a +SELECT HEX(LPAD('', 42, TRIM(BOTH c1 FROM x'ff'))) FROM t1; +HEX(LPAD('', 42, TRIM(BOTH c1 FROM x'ff'))) +FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +SELECT HEX(LPAD('', 42, REPLACE(x'ffff',c1,''))) FROM t1; +HEX(LPAD('', 42, REPLACE(x'ffff',c1,''))) +FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +SELECT HEX(LPAD('', 42, TRIM(x'ffff' FROM c1))) FROM t1; +ERROR HY000: Cannot convert string '\xFF\xFF' from binary to utf8mb4 +SELECT LPAD('', 42, REPLACE(c1, 'las', x'ff')) FROM t1; +ERROR HY000: Cannot convert string '\xFF' from binary to utf8mb4 +SELECT LPAD('', 42, REPLACE(c1, x'ff', 'las')) FROM t1; +ERROR HY000: Cannot convert string '\xFF' from binary to utf8mb4 +SELECT HEX(SUBSTRING_INDEX(_utf8mb4 x'41F09F8DA3F09F8DA3' , x'f0', 2)) FROM t1; +ERROR HY000: Cannot convert string '\xF0' from binary to utf8mb4 +DROP TABLE t1; +SELECT TRIM(BOTH x'f0' FROM _utf8mb4 x'F09F8DA3F09F8DA3'); +ERROR HY000: Cannot convert string '\xF0' from binary to utf8mb4 +SELECT TRIM(BOTH x'F09F8DA3' FROM _utf8mb4 x'F09F8DA3F09F8DA3'); +TRIM(BOTH x'F09F8DA3' FROM _utf8mb4 x'F09F8DA3F09F8DA3') + +SELECT TRIM(_latin2 x'a3' from _latin1 "hello"); +ERROR HY000: Cannot convert string '\xA3' from latin2 to latin1 +SELECT REPLACE(_latin1 "hello", _latin2 x'a3', "hei"); +ERROR HY000: Cannot convert string '\xA3' from latin2 to latin1 +SELECT REPLACE(_latin1 "hello", "hei", _latin2 x'a3'); +ERROR HY000: Cannot convert string '\xA3' from latin2 to latin1 +SELECT SUBSTRING_INDEX(_latin1 "hello", _latin2 x'a3', 42); +ERROR HY000: Cannot convert string '\xA3' from latin2 to latin1 +SELECT TRIM(leading _utf8mb4 x'F09F8DA3' from _gb18030 x'9439B9376181308B33'); +TRIM(leading _utf8mb4 x'F09F8DA3' from _gb18030 x'9439B9376181308B33') +aø +SELECT SUBSTRING_INDEX(_utf8mb4 x'C3A6C3B8F09F8DA361C3A6C3B8F09F8DA362', +_gb18030 x'81308B339439B937', 2); +SUBSTRING_INDEX(_utf8mb4 x'C3A6C3B8F09F8DA361C3A6C3B8F09F8DA362', +_gb18030 x'81308B339439B937', 2) +æø🍣aæ +SELECT REPLACE('æøåæøå',_utf16 x'00e5', _gb18030 x'9439B937'); +REPLACE('æøåæøå',_utf16 x'00e5', _gb18030 x'9439B937') +æø🍣æø🍣 +SELECT REPLACE(_latin1 x'E6F8E5E6F8E5',_utf16 x'00e5', _utf32 x'00000061'); +REPLACE(_latin1 x'E6F8E5E6F8E5',_utf16 x'00e5', _utf32 x'00000061') +æøaæøa +# Bug#31358389: Crash in Item::add_accum_properties() +DO INSERT(1, 1, 1, CAST(1 AS DECIMAL(1,3))); +ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column ''). +# +# Bug #31798093 RECENT REGRESSION: +# ARG_COMPARATOR::COMPARE JUMPING TO INVALID CODE IN MEMORY +DO CONVERT( NULLIF( @a , 'c' ) USING BINARY); +# +# Bug #31887870 +# QUERY WITH RPAD FUNCTION USING CHINESE STRING LEADS TO MESSY CODE +# +CREATE TABLE t1 ( +id INT NOT NULL, +c1 VARCHAR(10) +); +INSERT INTO t1 VALUES (111,'111'); +SELECT +RPAD(id, 11, _utf8mb4 x'E4B8ADE69687') as rpad_id, +LPAD(id, 11, _utf8mb4 x'E4B8ADE69687') as lpad_id, +RPAD(c1, 11, _utf8mb4 x'E4B8ADE69687') as rpad_c1, +LPAD(c1, 11, _utf8mb4 x'E4B8ADE69687') as lpad_c1 +FROM t1; +rpad_id lpad_id rpad_c1 lpad_c1 +111中文中文中文中文 中文中文中文中文111 111中文中文中文中文 中文中文中文中文111 +DROP TABLE t1; +# +# Bug #22523946 GET MESS CODE FOR FUNC INSERT() +# WITH STR AS INT CONST AND NEWSTR AS MULTI-BYTE +# +SELECT INSERT(1, 1, 2, _utf8mb4 x'E4B8ADE69687'); +INSERT(1, 1, 2, _utf8mb4 x'E4B8ADE69687') +中文 +# +# Bug #21943299 FAILED CAST OF STRING-RETURNING FUNCTION TO DOUBLE +# EMITS NO WARNING +SELECT 'a' + 0; +'a' + 0 +0 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'a' +SELECT CAST('a' as DOUBLE); +CAST('a' as DOUBLE) +0 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'a' +SELECT CAST(CONCAT('a') as DOUBLE); +CAST(CONCAT('a') as DOUBLE) +0 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'a' +# Bug #22538859 "CONCAT( '2005' , '-01-01') - 100" +# DOESN'T THROW ANY WARNING +# +SELECT '2005-01-01' - 100; +'2005-01-01' - 100 +1905 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: '2005-01-01' +SELECT CONCAT('2005' , '-01-01') - 100; +CONCAT('2005' , '-01-01') - 100 +1905 +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: '2005-01-01' +# Bug#32096341: ISNULL continuously returns the same value for LOAD_FILE +CREATE TABLE t1(id INTEGER NOT NULL PRIMARY KEY); +INSERT INTO t1 VALUES(0); +CALL p1(); +is null +1 +CALL p1(); +is null +0 +DROP PROCEDURE p1; +DROP TABLE t1; +# +# Bug #32163391 ASSERTION `CRC32_Z(CRC, POS, LENGTH) +# < STD::NUMERIC_LIMITS::MAX()' FAILED. +do crc32(char(1.134475e+308)); +# +# Bug#32192454: WL14340: RPDSERVER SIG11 AT +# RPDMPR_BVFLT_RPDMPR_DTYPE_SB8_RPDOQC_OPT_TYPE_GT_TRUE +# +CREATE TABLE t(x LONGTEXT); +SELECT UNHEX(x) FROM t; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def UNHEX(x) 251 2147483648 0 Y 128 31 63 +UNHEX(x) +DROP TABLE t; +Bug#32501472: Concatenation may create invalid UTF8 strings +CREATE TABLE t1(a CHAR(1) CHARACTER SET utf8mb4); +INSERT INTO t1 VALUES('a'); +SELECT CONCAT(a, x'ff') FROM t1; +ERROR HY000: Cannot convert string '\xFF' from binary to utf8mb4 +SELECT CONCAT_WS(',', a, x'ff') FROM t1; +ERROR HY000: Cannot convert string '\xFF' from binary to utf8mb4 +SELECT CONCAT_WS(x'ff', a, a) FROM t1; +ERROR HY000: Cannot convert string '\xFF' from binary to utf8mb4 +SELECT INSERT(a, 1, 1, x'ff') FROM t1; +ERROR HY000: Cannot convert string '\xFF' from binary to utf8mb4 +DROP TABLE t1; +CREATE TABLE t1(a VARCHAR(3), b VARCHAR(3)); +INSERT INTO t1 VALUES('on','off'); +SELECT EXPORT_SET(7, a, b, x'ff', 4) FROM t1; +ERROR HY000: Cannot convert string '\xFF' from binary to utf8mb4 +SELECT EXPORT_SET(7, a, x'ff', b, 4) FROM t1; +ERROR HY000: Cannot convert string '\xFF' from binary to utf8mb4 +SELECT MAKE_SET(7, a, b, x'ff') FROM t1; +ERROR HY000: Cannot convert string '\xFF' from binary to utf8mb4 +DROP TABLE t1; +Bug#30746908: Assertion `(tlen % 4) == 0' in my_strnncollsp_utf32 +CREATE TABLE t(a INTEGER); +INSERT INTO t VALUES (1),(2); +SELECT (SELECT 1 +FROM t +WHERE CONVERT(1 USING utf32) <> GROUP_CONCAT(1) +); +(SELECT 1 +FROM t +WHERE CONVERT(1 USING utf32) <> GROUP_CONCAT(1) +) +NULL +SELECT (SELECT 1 +FROM t +WHERE CONVERT(1 USING gb18030) <> GROUP_CONCAT(x'a3') +); +ERROR HY000: Cannot convert string '\xA3' from binary to gb18030 +DROP TABLE t; diff --git a/mysql-test/r/group_by.result-pq b/mysql-test/r/group_by.result-pq index 862a93bf766f..2c76dfba6496 100644 --- a/mysql-test/r/group_by.result-pq +++ b/mysql-test/r/group_by.result-pq @@ -2970,8 +2970,7 @@ EXPLAIN SELECT (SELECT 150) AS field5 FROM (SELECT * FROM t1) AS alias1 GROUP BY field5; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL Warnings: Note 1249 Select 2 was reduced during optimization Note 1003 /* select#1 */ select 150 AS `field5` from `test`.`t1` group by `field5` diff --git a/mysql-test/r/hash_join.result-pq b/mysql-test/r/hash_join.result-pq index eb629ba1ceac..cf8b6b8553b3 100644 --- a/mysql-test/r/hash_join.result-pq +++ b/mysql-test/r/hash_join.result-pq @@ -882,18 +882,17 @@ WHERE (NOT EXISTS ON alias4.col_varchar = alias3.col_varchar_key) WHERE alias3.pk >= table1.pk)); EXPLAIN --> Parallel scan on - -> Nested loop antijoin (cost=2.30 rows=8) - -> Filter: ((table1.pk = table2.pk) or (table1.col_varchar < 'D')) (cost=1.00 rows=2) - -> Inner hash join (no condition) (cost=1.00 rows=2) - -> Table scan on table1 (cost=0.45 rows=4) - -> Hash - -> PQblock scan on table2 using varchar_key (cost=0.35 rows=1) - -> Nested loop inner join (cost=2.85 rows=4) - -> Filter: (alias3.pk >= table1.pk) (cost=0.45 rows=4) - -> Index range scan on alias3 (re-planned for each iteration) (cost=0.45 rows=4) - -> Filter: (alias4.col_varchar = alias3.col_varchar_key) (cost=1.05 rows=1) - -> Table scan on alias4 (cost=1.05 rows=1) +-> Nested loop antijoin (cost=2.30 rows=8) + -> Filter: ((table1.pk = table2.pk) or (table1.col_varchar < 'D')) (cost=1.00 rows=2) + -> Inner hash join (no condition) (cost=1.00 rows=2) + -> Table scan on table1 (cost=0.45 rows=4) + -> Hash + -> Index scan on table2 using varchar_key (cost=0.35 rows=1) + -> Nested loop inner join (cost=2.85 rows=4) + -> Filter: (alias3.pk >= table1.pk) (cost=0.45 rows=4) + -> Index range scan on alias3 (re-planned for each iteration) (cost=0.45 rows=4) + -> Filter: (alias4.col_varchar = alias3.col_varchar_key) (cost=1.05 rows=1) + -> Table scan on alias4 (cost=1.05 rows=1) Warnings: Note 1276 Field or reference 'test.table1.pk' of SELECT #2 was resolved in SELECT #1 @@ -3267,11 +3266,10 @@ LEFT JOIN t1 ON tt.t = 'crash2' AND tt.f2 = t1.f2 WHERE tt.t = 'crash1'; EXPLAIN --> Parallel scan on - -> Left hash join (no condition) (cost=0.25 rows=0) - -> PQblock scan on t1 (cost=0.45 rows=2) - -> Hash - -> Zero rows (Impossible filter) (cost=0.00..0.00 rows=0) +-> Left hash join (no condition) (cost=0.25 rows=0) + -> Table scan on t1 (cost=0.45 rows=2) + -> Hash + -> Zero rows (Impossible filter) (cost=0.00..0.00 rows=0) SELECT tt.t @@ -3700,11 +3698,10 @@ SELECT 1 FROM t1 JOIN t1 AS t2 ON t1.a=t2.a; 1 EXPLAIN FORMAT=tree SELECT 1 FROM t1 LEFT JOIN t1 AS t2 ON t1.a=t2.a; EXPLAIN --> Parallel scan on - -> Left hash join ((t2.a)=(t1.a)), extra conditions: (t2.a = t1.a) (cost=0.73 rows=1) - -> PQblock scan on t1 (cost=0.35 rows=1) - -> Hash - -> Table scan on t2 (cost=0.37 rows=1) +-> Left hash join ((t2.a)=(t1.a)), extra conditions: (t2.a = t1.a) (cost=0.73 rows=1) + -> Table scan on t1 (cost=0.35 rows=1) + -> Hash + -> Table scan on t2 (cost=0.37 rows=1) SELECT 1 FROM t1 LEFT JOIN t1 AS t2 ON t1.a=t2.a; 1 diff --git a/mysql-test/r/join.result-pq b/mysql-test/r/join.result-pq index 3e98c027892a..2944871c5a80 100644 --- a/mysql-test/r/join.result-pq +++ b/mysql-test/r/join.result-pq @@ -1473,10 +1473,9 @@ FROM (SELECT 1 FROM t1 WHERE a) AS q NATURAL LEFT JOIN t1 NATURAL LEFT JOIN t1 AS t2; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) Warnings: Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join `test`.`t1` on(true) left join `test`.`t1` `t2` on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where (0 <> `test`.`t1`.`a`) SELECT 1 @@ -1489,10 +1488,9 @@ FROM t1 NATURAL RIGHT JOIN t1 AS t2 NATURAL RIGHT JOIN (SELECT 1 FROM t1 WHERE a) AS q; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) Warnings: Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join (`test`.`t1` `t2` left join `test`.`t1` on((`test`.`t1`.`a` = `test`.`t2`.`a`))) on(true) where (0 <> `test`.`t1`.`a`) SELECT 1 diff --git a/mysql-test/r/join_cache_nojb.result-pq b/mysql-test/r/join_cache_nojb.result-pq index 037a4746465d..c8351a8c84ff 100644 --- a/mysql-test/r/join_cache_nojb.result-pq +++ b/mysql-test/r/join_cache_nojb.result-pq @@ -2191,7 +2191,7 @@ SELECT MAX(t1.i) FROM t1 JOIN t2 ON t2.v ORDER BY t2.v; MAX(t1.i) -13 +NULL Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'x' Warning 1292 Truncated incorrect DOUBLE value: 'y' @@ -2201,9 +2201,8 @@ SELECT MAX(t1.i) FROM t1 JOIN t2 ON t2.v ORDER BY t2.v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 2 50.00 Using where -2 SIMPLE t1 NULL index NULL PRIMARY 4 NULL 4 100.00 Using index +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +1 SIMPLE t1 NULL index NULL PRIMARY 4 NULL 4 100.00 Using index Warnings: Note 1003 /* select#1 */ select max(`test`.`t1`.`i`) AS `MAX(t1.i)` from `test`.`t1` join `test`.`t2` where (0 <> `test`.`t2`.`v`) @@ -2283,11 +2282,10 @@ FROM t2 LEFT JOIN LEFT JOIN t4 ON 1 ) ON 1 ; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 2 100.00 NULL -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t3 NULL eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t3 NULL eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using where Warnings: Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t2` left join (`test`.`t1` join `test`.`t3` left join `test`.`t4` on(true)) on(((`test`.`t3`.`pk` = `test`.`t1`.`a`))) where true SELECT 1 diff --git a/mysql-test/r/join_outer.result-pq b/mysql-test/r/join_outer.result-pq index 217f7b6e7238..8e26ca3e2b70 100644 --- a/mysql-test/r/join_outer.result-pq +++ b/mysql-test/r/join_outer.result-pq @@ -1535,16 +1535,15 @@ RIGHT OUTER JOIN t1 tt2 ON 1 RIGHT OUTER JOIN t1 tt1 ON 1 STRAIGHT_JOIN t1 tt9 ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) -2 SIMPLE tt1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL -2 SIMPLE tt2 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) -2 SIMPLE tt3 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) -2 SIMPLE tt4 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) -2 SIMPLE tt5 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) -2 SIMPLE tt6 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) -2 SIMPLE tt7 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) -2 SIMPLE tt8 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) -2 SIMPLE tt9 NULL ALL NULL NULL NULL NULL 2 100.00 Using join buffer (hash join) +1 SIMPLE tt1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE tt2 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) +1 SIMPLE tt3 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) +1 SIMPLE tt4 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) +1 SIMPLE tt5 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) +1 SIMPLE tt6 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) +1 SIMPLE tt7 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) +1 SIMPLE tt8 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) +1 SIMPLE tt9 NULL ALL NULL NULL NULL NULL 2 100.00 Using join buffer (hash join) Warnings: Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` `tt1` left join (`test`.`t1` `tt2` left join (`test`.`t1` `tt3` left join `test`.`t1` `tt4` on(true) left join `test`.`t1` `tt5` on(true) left join `test`.`t1` `tt6` on(true) left join `test`.`t1` `tt7` on(true) left join `test`.`t1` `tt8` on(true)) on(true)) on(true) straight_join `test`.`t1` `tt9` where true SET optimizer_search_depth = DEFAULT; diff --git a/mysql-test/r/join_outer_bka.result-pq b/mysql-test/r/join_outer_bka.result-pq index ef95cac6ec96..9cbbc771661b 100644 --- a/mysql-test/r/join_outer_bka.result-pq +++ b/mysql-test/r/join_outer_bka.result-pq @@ -1536,16 +1536,15 @@ RIGHT OUTER JOIN t1 tt2 ON 1 RIGHT OUTER JOIN t1 tt1 ON 1 STRAIGHT_JOIN t1 tt9 ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) -2 SIMPLE tt1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL -2 SIMPLE tt2 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) -2 SIMPLE tt3 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) -2 SIMPLE tt4 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) -2 SIMPLE tt5 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) -2 SIMPLE tt6 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) -2 SIMPLE tt7 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) -2 SIMPLE tt8 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) -2 SIMPLE tt9 NULL ALL NULL NULL NULL NULL 2 100.00 Using join buffer (hash join) +1 SIMPLE tt1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE tt2 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) +1 SIMPLE tt3 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) +1 SIMPLE tt4 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) +1 SIMPLE tt5 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) +1 SIMPLE tt6 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) +1 SIMPLE tt7 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) +1 SIMPLE tt8 NULL ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (hash join) +1 SIMPLE tt9 NULL ALL NULL NULL NULL NULL 2 100.00 Using join buffer (hash join) Warnings: Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` `tt1` left join (`test`.`t1` `tt2` left join (`test`.`t1` `tt3` left join `test`.`t1` `tt4` on(true) left join `test`.`t1` `tt5` on(true) left join `test`.`t1` `tt6` on(true) left join `test`.`t1` `tt7` on(true) left join `test`.`t1` `tt8` on(true)) on(true)) on(true) straight_join `test`.`t1` `tt9` where true SET optimizer_search_depth = DEFAULT; diff --git a/mysql-test/r/join_outer_bka_nobnl.result-pq b/mysql-test/r/join_outer_bka_nobnl.result-pq index 16a915a9a878..71ea7d3b7b9e 100644 --- a/mysql-test/r/join_outer_bka_nobnl.result-pq +++ b/mysql-test/r/join_outer_bka_nobnl.result-pq @@ -1536,16 +1536,15 @@ RIGHT OUTER JOIN t1 tt2 ON 1 RIGHT OUTER JOIN t1 tt1 ON 1 STRAIGHT_JOIN t1 tt9 ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) -2 SIMPLE tt1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL -2 SIMPLE tt2 NULL ALL NULL NULL NULL NULL 2 100.00 Using where -2 SIMPLE tt3 NULL ALL NULL NULL NULL NULL 2 100.00 Using where -2 SIMPLE tt4 NULL ALL NULL NULL NULL NULL 2 100.00 Using where -2 SIMPLE tt5 NULL ALL NULL NULL NULL NULL 2 100.00 Using where -2 SIMPLE tt6 NULL ALL NULL NULL NULL NULL 2 100.00 Using where -2 SIMPLE tt7 NULL ALL NULL NULL NULL NULL 2 100.00 Using where -2 SIMPLE tt8 NULL ALL NULL NULL NULL NULL 2 100.00 Using where -2 SIMPLE tt9 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE tt1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE tt2 NULL ALL NULL NULL NULL NULL 2 100.00 Using where +1 SIMPLE tt3 NULL ALL NULL NULL NULL NULL 2 100.00 Using where +1 SIMPLE tt4 NULL ALL NULL NULL NULL NULL 2 100.00 Using where +1 SIMPLE tt5 NULL ALL NULL NULL NULL NULL 2 100.00 Using where +1 SIMPLE tt6 NULL ALL NULL NULL NULL NULL 2 100.00 Using where +1 SIMPLE tt7 NULL ALL NULL NULL NULL NULL 2 100.00 Using where +1 SIMPLE tt8 NULL ALL NULL NULL NULL NULL 2 100.00 Using where +1 SIMPLE tt9 NULL ALL NULL NULL NULL NULL 2 100.00 NULL Warnings: Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` `tt1` left join (`test`.`t1` `tt2` left join (`test`.`t1` `tt3` left join `test`.`t1` `tt4` on(true) left join `test`.`t1` `tt5` on(true) left join `test`.`t1` `tt6` on(true) left join `test`.`t1` `tt7` on(true) left join `test`.`t1` `tt8` on(true)) on(true)) on(true) straight_join `test`.`t1` `tt9` where true SET optimizer_search_depth = DEFAULT; diff --git a/mysql-test/r/metadata.result-pq b/mysql-test/r/metadata.result-pq new file mode 100644 index 000000000000..b9465e148328 --- /dev/null +++ b/mysql-test/r/metadata.result-pq @@ -0,0 +1,454 @@ +select 1, 1.0, -1, "hello", NULL; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def 1 8 1 1 N 32897 0 63 +def 1.0 246 4 3 N 32897 1 63 +def -1 8 2 2 N 32897 0 63 +def hello 253 20 5 N 1 31 255 +def NULL 6 0 0 Y 32896 0 63 +1 1.0 -1 hello NULL +1 1.0 -1 hello NULL +create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, l datetime, m enum('a','b'), n set('a','b'), o char(10)); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +select * from t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 a a 1 4 0 Y 32768 0 63 +def test t1 t1 b b 2 6 0 Y 32768 0 63 +def test t1 t1 c c 9 9 0 Y 32768 0 63 +def test t1 t1 d d 3 11 0 Y 32768 0 63 +def test t1 t1 e e 8 20 0 Y 32768 0 63 +def test t1 t1 f f 4 3 0 Y 32768 2 63 +def test t1 t1 g g 5 4 0 Y 32768 3 63 +def test t1 t1 h h 246 7 0 Y 32768 4 63 +def test t1 t1 i i 13 4 0 Y 32864 0 63 +def test t1 t1 j j 10 10 0 Y 128 0 63 +def test t1 t1 k k 7 19 0 N 129 0 63 +def test t1 t1 l l 12 19 0 Y 128 0 63 +def test t1 t1 m m 254 4 0 Y 256 0 255 +def test t1 t1 n n 254 12 0 Y 2048 0 255 +def test t1 t1 o o 254 40 0 Y 0 0 255 +a b c d e f g h i j k l m n o +select a b, b c from t1 as t2; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t2 a b 1 4 0 Y 32768 0 63 +def test t1 t2 b c 2 6 0 Y 32768 0 63 +b c +drop table t1; +CREATE TABLE t1 (id tinyint(3) default NULL, data varchar(255) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (1,'male'),(2,'female'); +CREATE TABLE t2 (id tinyint(3) unsigned default NULL, data char(3) default '0'); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (1,'yes'),(2,'no'); +select t1.id, t1.data, t2.data from t1, t2 where t1.id = t2.id; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 id id 1 3 1 Y 32768 0 63 +def test t1 t1 data data 253 1020 6 Y 0 0 255 +def test t2 t2 data data 254 12 3 Y 0 0 255 +id data data +1 male yes +2 female no +select t1.id, t1.data, t2.data from t1, t2 where t1.id = t2.id order by t1.id; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 id id 1 3 1 Y 32768 0 63 +def test t1 t1 data data 253 1020 6 Y 0 0 255 +def test t2 t2 data data 254 12 3 Y 0 0 255 +id data data +1 male yes +2 female no +select t1.id from t1 union select t2.id from t2; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def id id 2 4 1 Y 32768 0 63 +id +1 +2 +drop table t1,t2; +create table t1 ( a int, b varchar(30), primary key(a)); +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +set @arg00=1 ; +select @arg00 FROM t1 where a=1 union distinct select 1 FROM t1 where a=1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def @arg00 @arg00 8 21 1 Y 32768 0 63 +@arg00 +1 +select * from (select @arg00) aaa; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def aaa @arg00 @arg00 8 21 1 Y 32768 0 63 +@arg00 +1 +select 1 union select 1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def 1 1 8 1 1 N 32769 0 63 +1 +1 +select * from (select 1 union select 1) aaa; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def aaa 1 1 8 1 1 N 32769 0 63 +1 +1 +drop table t1; +create table t1 (i int); +insert into t1 values (1),(2),(3); +select * from t1 where i = 2; +drop table t1;// +affected rows: 0 +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 +i +2 +affected rows: 1 +affected rows: 0 +select a.* from (select 2147483648 as v_large) a; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def a v_large v_large 8 10 10 N 32769 0 63 +v_large +2147483648 +select a.* from (select 214748364 as v_small) a; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def a v_small v_small 3 9 9 N 32769 0 63 +v_small +214748364 +CREATE TABLE t1 (c1 CHAR(1)); +CREATE TABLE t2 (c2 CHAR(1)); +CREATE VIEW v1 AS SELECT t1.c1 FROM t1; +CREATE VIEW v2 AS SELECT t2.c2 FROM t2; +INSERT INTO t1 VALUES ('1'), ('2'), ('3'); +INSERT INTO t2 VALUES ('1'), ('2'), ('3'), ('2'); +SELECT v1.c1 FROM v1 JOIN t2 ON c1=c2 ORDER BY 1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 v1 c1 c1 254 4 1 Y 0 0 255 +c1 +1 +2 +2 +3 +SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +1 1 +2 2 +2 2 +3 3 +c1 c2 +def test v1 v1 c1 c1 254 4 1 Y 0 0 255 +def test v2 v2 c2 c2 254 4 1 Y 0 0 255 +SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2 GROUP BY v1.c1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 v1 c1 c1 254 4 1 Y 32768 0 255 +def test t2 v2 c2 c2 254 4 1 Y 0 0 255 +c1 c2 +1 1 +2 2 +3 3 +SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2 GROUP BY v1.c1 ORDER BY v2.c2; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 v1 c1 c1 254 4 1 Y 32768 0 255 +def test t2 v2 c2 c2 254 4 1 Y 0 0 255 +c1 c2 +1 1 +2 2 +3 3 +DROP VIEW v1,v2; +DROP TABLE t1,t2; +CREATE TABLE t1 (i INT, d DATE); +INSERT INTO t1 VALUES (1, '2008-01-01'), (2, '2008-01-02'), (3, '2008-01-03'); +SELECT COALESCE(d, d), IFNULL(d, d), IF(i, d, d), +CASE i WHEN i THEN d ELSE d END, GREATEST(d, d), LEAST(d, d) +FROM t1 ORDER BY RAND(); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +2008-01-01 2008-01-01 2008-01-01 2008-01-01 2008-01-01 2008-01-01 +2008-01-02 2008-01-02 2008-01-02 2008-01-02 2008-01-02 2008-01-02 +2008-01-03 2008-01-03 2008-01-03 2008-01-03 2008-01-03 2008-01-03 +COALESCE(d, d) IFNULL(d, d) IF(i, d, d) CASE i WHEN i THEN d ELSE d END GREATEST(d, d) LEAST(d, d) +def CASE i WHEN i THEN d ELSE d END CASE i WHEN i THEN d ELSE d END 10 10 10 Y 128 0 63 +def COALESCE(d, d) COALESCE(d, d) 10 10 10 Y 128 0 63 +def GREATEST(d, d) GREATEST(d, d) 10 10 10 Y 128 0 63 +def IF(i, d, d) IF(i, d, d) 10 10 10 Y 128 0 63 +def IFNULL(d, d) IFNULL(d, d) 10 10 10 Y 128 0 63 +def LEAST(d, d) LEAST(d, d) 10 10 10 Y 128 0 63 +DROP TABLE t1; +# +# Bug#41788 mysql_fetch_field returns org_table == table by a view +# +CREATE TABLE t1 (f1 INT); +CREATE VIEW v1 AS SELECT f1 FROM t1; +SELECT f1 FROM v1 va; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test v1 va f1 f1 3 11 0 Y 32768 0 63 +f1 +DROP VIEW v1; +DROP TABLE t1; +End of 5.0 tests +create table t1( +# numeric types +bool_col bool, +boolean_col boolean, +bit_col bit(5), +tiny tinyint, +tiny_uns tinyint unsigned, +small smallint, +small_uns smallint unsigned, +medium mediumint, +medium_uns mediumint unsigned, +int_col int, +int_col_uns int unsigned, +big bigint, +big_uns bigint unsigned, +decimal_col decimal(10,5), +# synonyms of DECIMAL +numeric_col numeric(10), +fixed_col fixed(10), +dec_col dec(10), +decimal_col_uns decimal(10,5) unsigned, +fcol float, +fcol_uns float unsigned, +dcol double, +double_precision_col double precision, +dcol_uns double unsigned, +# date/time types +date_col date, +time_col time, +timestamp_col timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, +year_col year, +datetime_col datetime, +# string types +char_col char(5), +varchar_col varchar(10), +binary_col binary(10), +varbinary_col varbinary(10), +tinyblob_col tinyblob, +blob_col blob, +mediumblob_col mediumblob, +longblob_col longblob, +text_col text, +mediumtext_col mediumtext, +longtext_col longtext, +enum_col enum("A","B","C"), +set_col set("F","E","D") +); +Warnings: +Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. +Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. +Warning 1681 UNSIGNED for decimal and floating point data types is deprecated and support for it will be removed in a future release. +select * from t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 bool_col bool_col 1 1 0 Y 32768 0 63 +def test t1 t1 boolean_col boolean_col 1 1 0 Y 32768 0 63 +def test t1 t1 bit_col bit_col 16 5 0 Y 32 0 63 +def test t1 t1 tiny tiny 1 4 0 Y 32768 0 63 +def test t1 t1 tiny_uns tiny_uns 1 3 0 Y 32800 0 63 +def test t1 t1 small small 2 6 0 Y 32768 0 63 +def test t1 t1 small_uns small_uns 2 5 0 Y 32800 0 63 +def test t1 t1 medium medium 9 9 0 Y 32768 0 63 +def test t1 t1 medium_uns medium_uns 9 8 0 Y 32800 0 63 +def test t1 t1 int_col int_col 3 11 0 Y 32768 0 63 +def test t1 t1 int_col_uns int_col_uns 3 10 0 Y 32800 0 63 +def test t1 t1 big big 8 20 0 Y 32768 0 63 +def test t1 t1 big_uns big_uns 8 20 0 Y 32800 0 63 +def test t1 t1 decimal_col decimal_col 246 12 0 Y 32768 5 63 +def test t1 t1 numeric_col numeric_col 246 11 0 Y 32768 0 63 +def test t1 t1 fixed_col fixed_col 246 11 0 Y 32768 0 63 +def test t1 t1 dec_col dec_col 246 11 0 Y 32768 0 63 +def test t1 t1 decimal_col_uns decimal_col_uns 246 11 0 Y 32800 5 63 +def test t1 t1 fcol fcol 4 12 0 Y 32768 31 63 +def test t1 t1 fcol_uns fcol_uns 4 12 0 Y 32800 31 63 +def test t1 t1 dcol dcol 5 22 0 Y 32768 31 63 +def test t1 t1 double_precision_col double_precision_col 5 22 0 Y 32768 31 63 +def test t1 t1 dcol_uns dcol_uns 5 22 0 Y 32800 31 63 +def test t1 t1 date_col date_col 10 10 0 Y 128 0 63 +def test t1 t1 time_col time_col 11 10 0 Y 128 0 63 +def test t1 t1 timestamp_col timestamp_col 7 19 0 N 9345 0 63 +def test t1 t1 year_col year_col 13 4 0 Y 32864 0 63 +def test t1 t1 datetime_col datetime_col 12 19 0 Y 128 0 63 +def test t1 t1 char_col char_col 254 20 0 Y 0 0 255 +def test t1 t1 varchar_col varchar_col 253 40 0 Y 0 0 255 +def test t1 t1 binary_col binary_col 254 10 0 Y 128 0 63 +def test t1 t1 varbinary_col varbinary_col 253 10 0 Y 128 0 63 +def test t1 t1 tinyblob_col tinyblob_col 252 255 0 Y 144 0 63 +def test t1 t1 blob_col blob_col 252 65535 0 Y 144 0 63 +def test t1 t1 mediumblob_col mediumblob_col 252 16777215 0 Y 144 0 63 +def test t1 t1 longblob_col longblob_col 252 4294967295 0 Y 144 0 63 +def test t1 t1 text_col text_col 252 262140 0 Y 16 0 255 +def test t1 t1 mediumtext_col mediumtext_col 252 67108860 0 Y 16 0 255 +def test t1 t1 longtext_col longtext_col 252 4294967295 0 Y 16 0 255 +def test t1 t1 enum_col enum_col 254 4 0 Y 256 0 255 +def test t1 t1 set_col set_col 254 20 0 Y 2048 0 255 +bool_col boolean_col bit_col tiny tiny_uns small small_uns medium medium_uns int_col int_col_uns big big_uns decimal_col numeric_col fixed_col dec_col decimal_col_uns fcol fcol_uns dcol double_precision_col dcol_uns date_col time_col timestamp_col year_col datetime_col char_col varchar_col binary_col varbinary_col tinyblob_col blob_col mediumblob_col longblob_col text_col mediumtext_col longtext_col enum_col set_col +drop table t1; +# +# WL#946 TIME/DATETIME/TIMESTAMP with fractional precision +# +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1 ( +t6 TIME(6), t5 TIME(5), t4 TIME(4), +t3 TIME(3), t2 TIME(2), t1 TIME(1), +t0 TIME, +dt6 DATETIME(6), dt5 DATETIME(5), dt4 DATETIME(4), +dt3 DATETIME(3), dt2 DATETIME(2), dt1 DATETIME(1), +dt0 DATETIME, +ts6 TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), +ts5 TIMESTAMP(5) NOT NULL DEFAULT '0000-00-00 00:00:00', +ts4 TIMESTAMP(4) NOT NULL DEFAULT '0000-00-00 00:00:00', +ts3 TIMESTAMP(3) NOT NULL DEFAULT '0000-00-00 00:00:00', +ts2 TIMESTAMP(2) NOT NULL DEFAULT '0000-00-00 00:00:00', +ts1 TIMESTAMP(1) NOT NULL DEFAULT '0000-00-00 00:00:00', +ts0 TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00' +); +SELECT * FROM t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 t6 t6 11 17 0 Y 128 6 63 +def test t1 t1 t5 t5 11 16 0 Y 128 5 63 +def test t1 t1 t4 t4 11 15 0 Y 128 4 63 +def test t1 t1 t3 t3 11 14 0 Y 128 3 63 +def test t1 t1 t2 t2 11 13 0 Y 128 2 63 +def test t1 t1 t1 t1 11 12 0 Y 128 1 63 +def test t1 t1 t0 t0 11 10 0 Y 128 0 63 +def test t1 t1 dt6 dt6 12 26 0 Y 128 6 63 +def test t1 t1 dt5 dt5 12 25 0 Y 128 5 63 +def test t1 t1 dt4 dt4 12 24 0 Y 128 4 63 +def test t1 t1 dt3 dt3 12 23 0 Y 128 3 63 +def test t1 t1 dt2 dt2 12 22 0 Y 128 2 63 +def test t1 t1 dt1 dt1 12 21 0 Y 128 1 63 +def test t1 t1 dt0 dt0 12 19 0 Y 128 0 63 +def test t1 t1 ts6 ts6 7 26 0 N 129 6 63 +def test t1 t1 ts5 ts5 7 25 0 N 129 5 63 +def test t1 t1 ts4 ts4 7 24 0 N 129 4 63 +def test t1 t1 ts3 ts3 7 23 0 N 129 3 63 +def test t1 t1 ts2 ts2 7 22 0 N 129 2 63 +def test t1 t1 ts1 ts1 7 21 0 N 129 1 63 +def test t1 t1 ts0 ts0 7 19 0 N 129 0 63 +t6 t5 t4 t3 t2 t1 t0 dt6 dt5 dt4 dt3 dt2 dt1 dt0 ts6 ts5 ts4 ts3 ts2 ts1 ts0 +DROP TABLE t1; +SET sql_mode = default; +# +# Bug#22364401: COM_QUERY RESPONSE METADATA WITH '*' IN FIELD ORG_TABLE +# +CREATE TABLE t1 (f1 INTEGER, f2 CHAR(1)); +INSERT INTO t1 VALUES (10, 'A'); +CREATE VIEW v1 AS SELECT f1, f2 FROM t1; +CREATE VIEW v2 AS SELECT DISTINCT f1 FROM t1; +SELECT * FROM (SELECT f1 FROM t1) AS dt; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1 dt f1 f1 3 11 2 Y 32768 0 63 +f1 +10 +SELECT * FROM (SELECT f1 FROM (SELECT f1 FROM t1) AS dt1) AS dt2; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1 dt2 f1 f1 3 11 2 Y 32768 0 63 +f1 +10 +SELECT * +FROM (SELECT t1.f1 AS a, t2.f1 AS b, t1.f1+t2.f1 AS d FROM t1 JOIN t1 AS t2) AS dt; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t1 dt a a 3 11 2 Y 32768 0 63 +def t1 dt b b 3 11 2 Y 32768 0 63 +def dt d d 8 12 2 Y 32896 0 63 +a b d +10 10 20 +SELECT * FROM (SELECT DISTINCT f1 FROM t1) AS dt; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 dt f1 f1 3 11 2 Y 32768 0 63 +f1 +10 +SELECT * FROM (SELECT DISTINCT t1.f1+t2.f1 AS d FROM t1 JOIN t1 AS t2) AS dt; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def dt d d 8 12 2 Y 32768 0 63 +d +20 +SELECT * FROM v1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test v1 v1 f1 f1 3 11 2 Y 32768 0 63 +def test v1 v1 f2 f2 254 4 1 Y 0 0 255 +f1 f2 +10 A +SELECT * FROM v2; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 v2 f1 f1 3 11 2 Y 32768 0 63 +f1 +10 +SELECT * FROM (SELECT * FROM v1) AS dt; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 dt f1 f1 3 11 2 Y 32768 0 63 +def test t1 dt f2 f2 254 4 1 Y 0 0 255 +f1 f2 +10 A +SELECT * FROM (SELECT * FROM v2) AS dt; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test v2 dt f1 f1 3 11 2 Y 32768 0 63 +f1 +10 +DROP VIEW v1,v2; +DROP TABLE t1; +# End of test for Bug#22364401 +# Testing Org_table/Table/DB returned to client for derived tables +create table t(a int); +create view v as select a as d, 2*a as two from t; +select a as d from t limit 1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t t a d 3 11 0 Y 32768 0 63 +d +select * from (select a as d, 2*a as two from t) dt; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t dt d d 3 11 0 Y 32768 0 63 +def dt two two 8 12 0 Y 32896 0 63 +d two +select d, two from (select a as d, 2*a as two from t) dt; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t dt d d 3 11 0 Y 32768 0 63 +def dt two two 8 12 0 Y 32896 0 63 +d two +select d as e, two as f from (select a as d, 2*a as two from t) dt; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def t dt e e 3 11 0 Y 32768 0 63 +def dt f f 8 12 0 Y 32896 0 63 +e f +select * from v; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test v v d d 3 11 0 Y 32768 0 63 +def v v two two 8 12 0 Y 32896 0 63 +d two +select d, two from v; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test v v d d 3 11 0 Y 32768 0 63 +def v v two two 8 12 0 Y 32896 0 63 +d two +select d as e, two as f from v; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test v v d e 3 11 0 Y 32768 0 63 +def v v two f 8 12 0 Y 32896 0 63 +e f +set optimizer_switch="derived_merge=off"; +select * from (select a as d, 2*a as two from t) dt; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t dt d d 3 11 0 Y 32768 0 63 +def dt two two 8 12 0 Y 32768 0 63 +d two +select d from (select a as d, 2*a as two from t) dt; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t dt d d 3 11 0 Y 32768 0 63 +d +select d as e from (select a as d, 2*a as two from t) dt; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t dt d e 3 11 0 Y 32768 0 63 +e +select * from v; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t v d d 3 11 0 Y 32768 0 63 +def test v v two two 8 12 0 Y 32768 0 63 +d two +select d, two from v; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test v v d d 3 11 0 Y 32768 0 63 +def test v v two two 8 12 0 Y 32768 0 63 +d two +select d as e, two as f from v; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test v v d e 3 11 0 Y 32768 0 63 +def test v v two f 8 12 0 Y 32768 0 63 +e f +set optimizer_switch=default; +drop view v; +drop table t; diff --git a/mysql-test/r/mysqld--help-notwin.result-pq b/mysql-test/r/mysqld--help-notwin.result-pq new file mode 100644 index 000000000000..0bed47307631 --- /dev/null +++ b/mysql-test/r/mysqld--help-notwin.result-pq @@ -0,0 +1,1876 @@ +The following options may be given as the first argument: +--print-defaults Print the program argument list and exit. +--no-defaults Don't read default options from any option file, + except for login file. +--defaults-file=# Only read default options from the given file #. +--defaults-extra-file=# Read this file after the global files are read. +--defaults-group-suffix=# + Also read groups with concat(group, suffix) +--login-path=# Read this path from the login file. + + --abort-slave-event-count=# + Option used by mysql-test for debugging and testing of + replication. + --activate-all-roles-on-login + Automatically set all granted roles as active after the + user has authenticated successfully. + --admin-address=name + IP address to bind to for service connection. Address can + be an IPv4 address, IPv6 address, or host name. Wildcard + values *, ::, 0.0.0.0 are not allowed. Address value can + have following optional network namespace separated by + the delimiter / from the address value. E.g., the + following value 192.168.1.1/red specifies IP addresses to + listen for incoming TCP connections that have to be + placed into the namespace 'red'. Using of network + namespace requires its support from underlying Operating + System. Attempt to specify a network namespace for a + platform that doesn't support it results in error during + socket creation. + --admin-port=# Port number to use for service connection, built-in + default (33062) + --admin-ssl Enable SSL for admin interface (automatically enabled + with other flags). + (Defaults to on; use --skip-admin-ssl to disable.) + --admin-ssl-capath=name + --admin-ssl-cert=name + --admin-ssl-cipher=name + --admin-ssl-crl=name + CRL file in PEM format (check OpenSSL docs, implies + --admin-ssl-crlpath=name + --admin-ssl-key=name + --admin-tls-ciphersuites=name + --admin-tls-version=name + TLS version for --admin-port, permitted values are TLSv1, + TLSv1.1, TLSv1.2, TLSv1.3 + --allow-suspicious-udfs + Allows use of UDFs consisting of only one symbol xxx() + without corresponding xxx_init() or xxx_deinit(). That + also means that one can load any function from any + library, for example exit() from libc.so + -a, --ansi Use ANSI SQL syntax instead of MySQL syntax. This mode + will also set transaction isolation level 'serializable'. + --auto-increment-increment[=#] + Auto-increment columns are incremented by this + --auto-increment-offset[=#] + Offset added to Auto-increment columns. Used when + auto-increment-increment != 1 + --autocommit Set default value for autocommit (0 or 1) + (Defaults to on; use --skip-autocommit to disable.) + --automatic-sp-privileges + Creating and dropping stored procedures alters ACLs + (Defaults to on; use --skip-automatic-sp-privileges to disable.) + --avoid-temporal-upgrade + When this option is enabled, the pre-5.6.4 temporal types + are not upgraded to the new format for ALTER TABLE + requests ADD/CHANGE/MODIFY COLUMN, ADD INDEX or FORCE + operation. This variable is deprecated and will be + removed in a future release. + --back-log=# The number of outstanding connection requests MySQL can + have. This comes into play when the main MySQL thread + gets very many connection requests in a very short time + -b, --basedir=name Path to installation directory. All paths are usually + resolved relative to this + --big-tables Allow big result sets by saving all temporary sets on + file (Solves most 'table full' errors) + --bind-address=name IP address(es) to bind to. Syntax: address[,address]..., + where address can be an IPv4 address, IPv6 address, host + name or one of the wildcard values *, ::, 0.0.0.0. In + case more than one address is specified in a + comma-separated list, wildcard values are not allowed. + Every address can have optional network namespace + separated by the delimiter / from the address value. + E.g., the following value + 192.168.1.1/red,172.16.1.1/green,193.168.1.1 specifies + three IP addresses to listen for incoming TCP connections + two of that have to be placed in corresponding + namespaces: the address 192.168.1.1 must be placed into + the namespace red and the address 172.16.1.1 must be + placed into the namespace green. Using of network + namespace requires its support from underlying Operating + System. Attempt to specify a network namespace for a + platform that doesn't support it results in error during + socket creation. + --binlog-cache-size=# + The size of the transactional cache for updates to + transactional engines for the binary log. If you often + use transactions containing many statements, you can + increase this to get more performance + --binlog-checksum=name + Type of BINLOG_CHECKSUM_ALG. Include checksum for log + events in the binary log. Possible values are NONE and + CRC32; default is CRC32. + --binlog-direct-non-transactional-updates + Causes updates to non-transactional engines using + statement format to be written directly to binary log. + Before using this option make sure that there are no + dependencies between transactional and non-transactional + tables such as in the statement INSERT INTO t_myisam + SELECT * FROM t_innodb; otherwise, slaves may diverge + from the master. + --binlog-do-db=name Tells the master it should log updates for the specified + database, and exclude all others not explicitly + mentioned. + --binlog-encryption Enable/disable binary and relay logs encryption. + --binlog-error-action=name + When statements cannot be written to the binary log due + to a fatal error, the server can either ignore the error + and let the master continue, or abort. + --binlog-expire-logs-seconds=# + If non-zero, binary logs will be purged after + binlog_expire_logs_seconds seconds; If both this option + and expire_logs_days are set to non-zero values, this + option takes priority. Purges happen at startup and at + binary log rotation. + --binlog-format=name + What form of binary logging the master will use: either + ROW for row-based binary logging, STATEMENT for + statement-based binary logging, or MIXED. MIXED is + statement-based binary logging except for those + statements where only row-based is correct: those which + involve user-defined functions (i.e. UDFs) or the UUID() + function; for those, row-based binary logging is + automatically used. If NDBCLUSTER is enabled and + binlog-format is MIXED, the format switches to row-based + and back implicitly per each query accessing an + NDBCLUSTER table + --binlog-group-commit-sync-delay=# + The number of microseconds the server waits for the + binary log group commit sync queue to fill before + continuing. Default: 0. Min: 0. Max: 1000000. + --binlog-group-commit-sync-no-delay-count=# + If there are this many transactions in the commit sync + queue and the server is waiting for more transactions to + be enqueued (as set using + --binlog-group-commit-sync-delay), the commit procedure + resumes. + --binlog-gtid-simple-recovery + If this option is enabled, the server does not open more + than two binary logs when initializing GTID_PURGED and + GTID_EXECUTED, either during server restart or when + binary logs are being purged. Enabling this option is + useful when the server has already generated many binary + logs without GTID events (e.g., having GTID_MODE = OFF). + Note: If this option is enabled, GLOBAL.GTID_EXECUTED and + GLOBAL.GTID_PURGED may be initialized wrongly in two + cases: (1) All binary logs were generated by MySQL 5.7.5 + or older, and GTID_MODE was ON for some binary logs but + OFF for the newest binary log. (2) The oldest existing + binary log was generated by MySQL 5.7.5 or older, and SET + GTID_PURGED was issued after the oldest binary log was + generated. If a wrong set is computed in one of case (1) + or case (2), it will remain wrong even if the server is + later restarted with this option disabled. + (Defaults to on; use --skip-binlog-gtid-simple-recovery to disable.) + --binlog-ignore-db=name + Tells the master that updates to the given database + should not be logged to the binary log. + --binlog-max-flush-queue-time=# + The maximum time that the binary log group commit will + keep reading transactions before it flush the + transactions to the binary log (and optionally sync, + depending on the value of sync_binlog). + --binlog-order-commits + Issue internal commit calls in the same order as + transactions are written to the binary log. Default is to + order commits. + (Defaults to on; use --skip-binlog-order-commits to disable.) + --binlog-rotate-encryption-master-key-at-startup + Force binlog encryption master key rotation at startup + --binlog-row-event-max-size=# + The maximum size of a row-based binary log event in + bytes. Rows will be grouped into events smaller than this + size if possible. The value has to be a multiple of 256. + --binlog-row-image=name + Controls whether rows should be logged in 'FULL', + 'NOBLOB' or 'MINIMAL' formats. 'FULL', means that all + columns in the before and after image are logged. + 'NOBLOB', means that mysqld avoids logging blob columns + whenever possible (e.g. blob column was not changed or is + not part of primary key). 'MINIMAL', means that a PK + equivalent (PK columns or full row if there is no PK in + the table) is logged in the before image, and only + changed columns are logged in the after image. (Default: + FULL). + --binlog-row-metadata=name + Controls whether metadata is logged using FULL or MINIMAL + format. FULL causes all metadata to be logged; MINIMAL + means that only metadata actually required by slave is + logged. Default: MINIMAL. + --binlog-row-value-options=name + When set to PARTIAL_JSON, this option enables a + space-efficient row-based binary log format for UPDATE + statements that modify a JSON value using only the + functions JSON_SET, JSON_REPLACE, and JSON_REMOVE. For + such updates, only the modified parts of the JSON + document are included in the binary log, so small changes + of big documents may need significantly less space. + --binlog-rows-query-log-events + Allow writing of Rows_query_log events into binary log. + --binlog-stmt-cache-size=# + The size of the statement cache for updates to + non-transactional engines for the binary log. If you + often use statements updating a great number of rows, you + can increase this to get more performance + --binlog-transaction-compression + Whether to compress transactions or not. Transactions are + compressed using the ZSTD compression algorythm. + --binlog-transaction-compression-level-zstd=# + Specifies the transaction compression level for ZSTD + transaction compression in the binary log. + --binlog-transaction-dependency-history-size=# + Maximum number of rows to keep in the writeset history. + --binlog-transaction-dependency-tracking=name + Selects the source of dependency information from which + to assess which transactions can be executed in parallel + by the slave's multi-threaded applier. Possible values + are COMMIT_ORDER, WRITESET and WRITESET_SESSION. + --block-encryption-mode=name + mode for AES_ENCRYPT/AES_DECRYPT + --bulk-insert-buffer-size=# + Size of tree cache used in bulk insert optimisation. Note + that this is a limit per thread! + --caching-sha2-password-digest-rounds=# + Number of SHA2 rounds to be done when storing a password + hash onto disk. + --caching-sha2-password-private-key-path=name + A fully qualified path to the private RSA key used for + authentication. + --caching-sha2-password-public-key-path=name + A fully qualified path to the public RSA key used for + authentication. + --character-set-client-handshake + Don't ignore client side character set value sent during + handshake. + (Defaults to on; use --skip-character-set-client-handshake to disable.) + --character-set-filesystem=name + Set the filesystem character set. + -C, --character-set-server=name + Set the default character set. + --character-sets-dir=name + Directory where character sets are + --check-proxy-users If set to FALSE (the default), then proxy user identity + will not be mapped for authentication plugins which + support mapping from grant tables. When set to TRUE, + users associated with authentication plugins which signal + proxy user mapping should be done according to GRANT + PROXY privilege definition. + -r, --chroot=name Chroot mysqld daemon during startup. + --collation-server=name + Set the default collation. + --completion-type=name + The transaction completion type, one of NO_CHAIN, CHAIN, + RELEASE + --concurrent-insert[=name] + Use concurrent insert with MyISAM. Possible values are + NEVER, AUTO, ALWAYS + --connect-timeout=# The number of seconds the mysqld server is waiting for a + connect packet before responding with 'Bad handshake' + --console Write error output on screen; don't remove the console + window on windows. + --core-file Write core on errors. + --create-admin-listener-thread + Use a dedicated thread for listening incoming connections + on admin interface + --cte-max-recursion-depth=# + Abort a recursive common table expression if it does more + than this number of iterations. + -D, --daemonize Run mysqld as sysv daemon + -h, --datadir=name Path to the database root directory + --default-authentication-plugin=name + The default authentication plugin used by the server to + hash the password. + --default-password-lifetime=# + The number of days after which the password will expire. + --default-storage-engine=name + The default storage engine for new tables + --default-table-encryption + Database and tablespace are created with this default + encryption property unless the user specifies an explicit + encryption property. + --default-time-zone=name + Set the default time zone. + --default-tmp-storage-engine=name + The default storage engine for new explicit temporary + tables + --default-week-format=# + The default week format used by WEEK() functions + --delay-key-write[=name] + Type of DELAY_KEY_WRITE + --delayed-insert-limit=# + After inserting delayed_insert_limit rows, the INSERT + DELAYED handler will check if there are any SELECT + statements pending. If so, it allows these to execute + before continuing. This variable is deprecated along with + INSERT DELAYED. + --delayed-insert-timeout=# + How long a INSERT DELAYED thread should wait for INSERT + statements before terminating. This variable is + deprecated along with INSERT DELAYED. + --delayed-queue-size=# + What size queue (in rows) should be allocated for + handling INSERT DELAYED. If the queue becomes full, any + client that does INSERT DELAYED will wait until there is + room in the queue again. This variable is deprecated + along with INSERT DELAYED. + --disabled-storage-engines=name + Limit CREATE TABLE for the storage engines listed + --disconnect-on-expired-password + Give clients that don't signal password expiration + support execution time error(s) instead of connection + error + (Defaults to on; use --skip-disconnect-on-expired-password to disable.) + --disconnect-slave-event-count=# + Option used by mysql-test for debugging and testing of + replication. + --div-precision-increment=# + Precision of the result of '/' operator will be increased + on that value + --early-plugin-load=name + Optional semicolon-separated list of plugins to load + before storage engine initialization, where each plugin + is identified as name=library, where name is the plugin + name and library is the plugin library in plugin_dir. + --end-markers-in-json + In JSON output ("EXPLAIN FORMAT=JSON" and optimizer + trace), if variable is set to 1, repeats the structure's + key (if it has one) near the closing bracket + --enforce-gtid-consistency[=name] + Prevents execution of statements that would be impossible + to log in a transactionally safe manner. Currently, the + disallowed statements include CREATE TEMPORARY TABLE + inside transactions, all updates to non-transactional + tables, and CREATE TABLE ... SELECT. + --eq-range-index-dive-limit=# + The optimizer will use existing index statistics instead + of doing index dives for equality ranges if the number of + equality ranges for the index is larger than or equal to + this number. If set to 0, index dives are always used. + --event-scheduler[=name] + Enable the event scheduler. Possible values are ON, OFF, + and DISABLED (keep the event scheduler completely + deactivated, it cannot be activated run-time) + -T, --exit-info[=#] Used for debugging. Use at your own risk. + --expire-logs-days=# + If non-zero, binary logs will be purged after + expire_logs_days days; If this option alone is set on the + command line or in a configuration file, it overrides the + default value for binlog-expire-logs-seconds. If both + options are set to nonzero values, + binlog-expire-logs-seconds takes priority. Possible + purges happen at startup and at binary log rotation. + --explicit-defaults-for-timestamp + This option causes CREATE TABLE to create all TIMESTAMP + columns as NULL with DEFAULT NULL attribute, Without this + option, TIMESTAMP columns are NOT NULL and have implicit + DEFAULT clauses. The old behavior is deprecated. The + variable can only be set by users having the SUPER + privilege. + (Defaults to on; use --skip-explicit-defaults-for-timestamp to disable.) + --external-locking Use system (external) locking (disabled by default). + With this option enabled you can run myisamchk to test + (not repair) tables while the MySQL server is running. + Disable with --skip-external-locking. + --flush Flush MyISAM tables to disk between SQL commands + --flush-time=# A dedicated thread is created to flush all tables at the + given interval + --force-parallel-execute + force parallel execute in session + --ft-boolean-syntax=name + List of operators for MATCH ... AGAINST ( ... IN BOOLEAN + MODE) + --ft-max-word-len=# The maximum length of the word to be included in a + FULLTEXT index. Note: FULLTEXT indexes must be rebuilt + after changing this variable + --ft-min-word-len=# The minimum length of the word to be included in a + FULLTEXT index. Note: FULLTEXT indexes must be rebuilt + after changing this variable + --ft-query-expansion-limit=# + Number of best matches to use for query expansion + --ft-stopword-file=name + Use stopwords from this file instead of built-in list + --gdb Set up signals usable for debugging. + --general-log Log connections and queries to a table or log file. + Defaults to logging to a file hostname.log, or if + --log-output=TABLE is used, to a table mysql.general_log. + --general-log-file=name + Log connections and queries to given file + --generated-random-password-length=# + Determines the length randomly generated passwords in + CREATE USER-,SET PASSWORD- or ALTER USER statements + --group-concat-max-len=# + The maximum length of the result of function + GROUP_CONCAT() + --group-replication-consistency[=name] + Transaction consistency guarantee, possible values: + EVENTUAL, BEFORE_ON_PRIMARY_FAILOVER, BEFORE, AFTER, + BEFORE_AND_AFTER + --gtid-executed-compression-period[=#] + Compress the mysql.gtid_executed table whenever this + number of transactions have been added, by waking up a + foreground thread (compress_gtid_table). This compression + method only operates when binary logging is disabled on + the replica; if binary logging is enabled, the table is + compressed every time the binary log is rotated, and this + value is ignored. Before MySQL 8.0.23, the default is + 1000, and from MySQL 8.0.23, the default is zero, which + disables this compression method. This is because in + releases from MySQL 8.0.17, InnoDB transactions are + written to the mysql.gtid_executed table by a separate + process to non-InnoDB transactions. If the server has a + mix of InnoDB and non-InnoDB transactions, attempting to + compress the table with the compress_gtid_table thread + can slow this process, so from MySQL 8.0.17 it is + recommended that you set gtid_executed_compression_period + to 0. + --gtid-mode=name Controls whether Global Transaction Identifiers (GTIDs) + are enabled. Can be OFF, OFF_PERMISSIVE, ON_PERMISSIVE, + or ON. OFF means that no transaction has a GTID. + OFF_PERMISSIVE means that new transactions (committed in + a client session using GTID_NEXT='AUTOMATIC') are not + assigned any GTID, and replicated transactions are + allowed to have or not have a GTID. ON_PERMISSIVE means + that new transactions are assigned a GTID, and replicated + transactions are allowed to have or not have a GTID. ON + means that all transactions have a GTID. ON is required + on a master before any slave can use + MASTER_AUTO_POSITION=1. To safely switch from OFF to ON, + first set all servers to OFF_PERMISSIVE, then set all + servers to ON_PERMISSIVE, then wait for all transactions + without a GTID to be replicated and executed on all + servers, and finally set all servers to GTID_MODE = ON. + -?, --help Display this help and exit. + --histogram-generation-max-mem-size=# + Maximum amount of memory available for generating + histograms + --host-cache-size=# How many host names should be cached to avoid resolving. + --information-schema-stats-expiry=# + The number of seconds after which mysqld server will + fetch data from storage engine and replace the data in + cache. + --init-connect=name Command(s) that are executed for each new connection + --init-file=name Read SQL commands from this file at startup + --init-slave=name Command(s) that are executed by a slave server each time + the SQL thread starts + -I, --initialize Create the default database and exit. Create a super user + with a random expired password and store it into the log. + --initialize-insecure + Create the default database and exit. Create a super user + with empty password. + --interactive-timeout=# + The number of seconds the server waits for activity on an + interactive connection before closing it + --internal-tmp-mem-storage-engine=name + The default storage engine for in-memory internal + temporary tables. + --join-buffer-size=# + The size of the buffer that is used for full joins + --keep-files-on-create + Don't overwrite stale .MYD and .MYI even if no directory + is specified + --key-buffer-size=# The size of the buffer used for index blocks for MyISAM + tables. Increase this to get better index handling (for + all reads and multiple writes) to as much as you can + afford + --key-cache-age-threshold=# + This characterizes the number of hits a hot block has to + be untouched until it is considered aged enough to be + downgraded to a warm block. This specifies the percentage + ratio of that number of hits to the total number of + blocks in key cache + --key-cache-block-size=# + The default size of key cache blocks + --key-cache-division-limit=# + The minimum percentage of warm blocks in key cache + --keyring-migration-destination=name + Keyring plugin or component to which the keys are + migrated to. + --keyring-migration-host=name + Connect to host. + -p, --keyring-migration-password[=name] + Password to use when connecting to server during keyring + migration. If password value is not specified then it + will be asked from the tty. + --keyring-migration-port=# + Port number to use for connection. + --keyring-migration-source=name + Keyring plugin from where the keys needs to be migrated + to. This option must be specified along with + --keyring-migration-destination. + --keyring-migration-to-component + Migrate from keyring plugin to keyring component. + --keyring-migration-user=name + User to login to server. + -L, --language=name Client error messages in given language. May be given as + a full path. Deprecated. Use --lc-messages-dir instead. + --large-pages Enable support for large pages + --lc-messages=name Set the language used for the error messages. + --lc-messages-dir=name + Directory where error messages are + --lc-time-names=name + Set the language used for the month names and the days of + the week. + --local-infile Enable LOAD DATA LOCAL INFILE + --lock-wait-timeout=# + Timeout in seconds to wait for a lock before returning an + error. + --log-bin[=name] Configures the name prefix to use for binary log files. + If the --log-bin option is not supplied, the name prefix + defaults to "binlog". If the --log-bin option is supplied + without argument, the name prefix defaults to + "HOSTNAME-bin", where HOSTNAME is the machine's hostname. + To set a different name prefix for binary log files, use + --log-bin=name. To disable binary logging, use the + --skip-log-bin or --disable-log-bin option. + --log-bin-index=name + File that holds the names for binary log files. + --log-bin-trust-function-creators + If set to FALSE (the default), then when --log-bin is + used, creation of a stored function (or trigger) is + allowed only to users having the SUPER privilege and only + if this stored function (trigger) may not break binary + logging. Note that if ALL connections to this server + ALWAYS use row-based binary logging, the security issues + do not exist and the binary logging cannot break, so you + can safely set this to TRUE + --log-bin-use-v1-row-events + If equal to 1 then version 1 row events are written to a + row based binary log. If equal to 0, then the latest + version of events are written. This option is useful + during some upgrades. + --log-error[=name] Error log file + --log-error-services=name + Services that should be called when an error event is + received + --log-error-suppression-list=name + Comma-separated list of error-codes. Error messages + corresponding to these codes will not be included in the + error log. Only events with a severity of Warning or + Information can be suppressed; events with System or + Error severity will always be included. Requires the + filter 'log_filter_internal' to be set in + @@global.log_error_services, which is the default. + --log-error-verbosity=# + How detailed the error log should be. 1, log errors only. + 2, log errors and warnings. 3, log errors, warnings, and + notes. Messages sent to the client are unaffected by this + setting. + --log-isam[=name] Log all MyISAM changes to file. + --log-output=name Syntax: log-output=value[,value...], where "value" could + be TABLE, FILE or NONE + --log-queries-not-using-indexes + Log queries that are executed without benefit of any + index to the slow log if it is open + --log-raw Log to general log before any rewriting of the query. For + use in debugging, not production as sensitive information + may be logged. + --log-short-format Don't log extra information to update and slow-query + logs. + --log-slave-updates Tells the slave to log the updates from the slave thread + to the binary log. + (Defaults to on; use --skip-log-slave-updates to disable.) + --log-slow-admin-statements + Log slow OPTIMIZE, ANALYZE, ALTER and other + administrative statements to the slow log if it is open. + --log-slow-extra Print more attributes to the slow query log file. Has no + effect on logging to table. + --log-slow-slave-statements + Log slow statements executed by slave thread to the slow + log if it is open. + --log-statements-unsafe-for-binlog + Log statements considered unsafe when using statement + based binary logging. + (Defaults to on; use --skip-log-statements-unsafe-for-binlog to disable.) + --log-tc=name Path to transaction coordinator log (used for + transactions that affect more than one storage engine, + when binary log is disabled). + --log-tc-size=# Size of transaction coordinator log. + --log-throttle-queries-not-using-indexes=# + Log at most this many 'not using index' warnings per + minute to the slow log. Any further warnings will be + condensed into a single summary line. A value of 0 + disables throttling. Option has no effect unless + --log_queries_not_using_indexes is set. + --log-timestamps=name + UTC to timestamp log files in zulu time, for more concise + timestamps and easier correlation of logs from servers + from multiple time zones, or SYSTEM to use the system's + local time. This affects only log files, not log tables, + as the timestamp columns of the latter can be converted + at will. + --long-query-time=# Log all queries that have taken more than long_query_time + seconds to execute to file. The argument will be treated + as a decimal value with microsecond precision + --low-priority-updates + INSERT/DELETE/UPDATE has lower priority than selects + --lower-case-table-names[=#] + If set to 1 table names are stored in lowercase on disk + and table names will be case-insensitive. Should be set + to 2 if you are using a case insensitive file system + --mandatory-roles=name + All the specified roles are always considered granted to + every user and they can't be revoked. Mandatory roles + still require activation unless they are made into + default roles. The granted roles will not be visible in + the mysql.role_edges table. + --master-info-file=name + The location and name of the file that remembers the + master and where the I/O replication thread is in the + master's binlogs. Deprecated option that shall be removed + eventually without a replacement. + --master-info-repository=name + Defines the type of the repository for the master + information. + --master-retry-count=# + The number of tries the slave will make to connect to the + master before giving up. Deprecated option, use 'CHANGE + MASTER TO master_retry_count = ' instead. + --master-verify-checksum + Force checksum verification of logged events in binary + log before sending them to slaves or printing them in + output of SHOW BINLOG EVENTS. Disabled by default. + --max-allowed-packet=# + Max packet length to send to or receive from the server + --max-binlog-cache-size=# + Sets the total size of the transactional cache + --max-binlog-dump-events=# + Option used by mysql-test for debugging and testing of + replication. + --max-binlog-size=# Binary log will be rotated automatically when the size + exceeds this value. Will also apply to relay logs if + max_relay_log_size is 0 + --max-binlog-stmt-cache-size=# + Sets the total size of the statement cache + --max-connect-errors=# + If there is more than this number of interrupted + connections from a host this host will be blocked from + further connections + --max-connections=# The number of simultaneous clients allowed + --max-delayed-threads=# + Don't start more than this number of threads to handle + INSERT DELAYED statements. If set to zero INSERT DELAYED + will be not used. This variable is deprecated along with + INSERT DELAYED. + --max-digest-length=# + Maximum length considered for digest text. + --max-error-count=# Max number of errors/warnings to store for a statement + --max-execution-time=# + Kill SELECT statement that takes over the specified + number of milliseconds + --max-heap-table-size=# + Don't allow creation of heap tables bigger than this + --max-join-size=# Joins that are probably going to read more than + max_join_size records return an error + --max-length-for-sort-data=# + This variable is deprecated and will be removed in a + future release. + --max-points-in-geometry[=#] + Maximum number of points in a geometry + --max-prepared-stmt-count=# + Maximum number of prepared statements in the server + --max-relay-log-size=# + If non-zero: relay log will be rotated automatically when + the size exceeds this value; if zero: when the size + exceeds max_binlog_size + --max-seeks-for-key=# + Limit assumed max number of seeks when looking up rows + based on a key + --max-sort-length=# The number of bytes to use when sorting long values with + PAD SPACE collations (only the first max_sort_length + bytes of each value are used; the rest are ignored) + --max-sp-recursion-depth[=#] + Maximum stored procedure recursion depth + --max-user-connections=# + The maximum number of active connections for a single + user (0 = no limit) + --max-write-lock-count=# + After this many write locks, allow some read locks to run + in between + --memlock Lock mysqld in memory. + --min-examined-row-limit=# + Don't write queries to slow log that examine fewer rows + than that + --myisam-block-size=# + Block size to be used for MyISAM index pages + --myisam-data-pointer-size=# + Default pointer size to be used for MyISAM tables + --myisam-max-sort-file-size=# + Don't use the fast sort index method to created index if + the temporary file would get bigger than this + --myisam-mmap-size=# + Restricts the total memory used for memory mapping of + MySQL tables + --myisam-recover-options[=name] + Syntax: myisam-recover-options[=option[,option...]], + where option can be DEFAULT, BACKUP, FORCE, QUICK, or OFF + --myisam-repair-threads=# + If larger than 1, when repairing a MyISAM table all + indexes will be created in parallel, with one thread per + index. The value of 1 disables parallel repair + --myisam-sort-buffer-size=# + The buffer that is allocated when sorting the index when + doing a REPAIR or when creating indexes with CREATE INDEX + or ALTER TABLE + --myisam-stats-method=name + Specifies how MyISAM index statistics collection code + should treat NULLs. Possible values of name are + NULLS_UNEQUAL (default behavior for 4.1 and later), + NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED + --myisam-use-mmap Use memory mapping for reading and writing MyISAM tables + --mysql-native-password-proxy-users + If set to FALSE (the default), then the + mysql_native_password plugin will not signal for + authenticated users to be checked for mapping to proxy + users. When set to TRUE, the plugin will flag associated + authenticated accounts to be mapped to proxy users when + the server option check_proxy_users is enabled. + --net-buffer-length=# + Buffer length for TCP/IP and socket communication + --net-read-timeout=# + Number of seconds to wait for more data from a connection + before aborting the read + --net-retry-count=# If a read on a communication port is interrupted, retry + this many times before giving up + --net-write-timeout=# + Number of seconds to wait for a block to be written to a + connection before aborting the write + -n, --new Use very new possible "unsafe" functions + --no-dd-upgrade Abort restart if automatic upgrade or downgrade of the + data dictionary is needed. Deprecated option. Use + --upgrade=NONE instead. + --offline-mode Make the server into offline mode + --old Use compatible behavior + --old-alter-table Use old, non-optimized alter table + --old-style-user-limits + Enable old-style user limits (before 5.0.3, user + resources were counted per each user+host vs. per + account). + --open-files-limit=# + If this is not 0, then mysqld will use this value to + reserve file descriptors to use with setrlimit(). If this + value is 0 then mysqld will reserve max_connections*5 or + max_connections + table_open_cache*2 (whichever is + larger) number of file descriptors + --optimizer-prune-level=# + Controls the heuristic(s) applied during query + optimization to prune less-promising partial plans from + the optimizer search space. Meaning: 0 - do not apply any + heuristic, thus perform exhaustive search; 1 - prune + plans based on number of retrieved rows + --optimizer-search-depth=# + Maximum depth of search performed by the query optimizer. + Values larger than the number of relations in a query + result in better query plans, but take longer to compile + a query. Values smaller than the number of tables in a + relation result in faster optimization, but may produce + very bad query plans. If set to 0, the system will + automatically pick a reasonable value + --optimizer-switch=name + optimizer_switch=option=val[,option=val...], where option + is one of {index_merge, index_merge_union, + index_merge_sort_union, index_merge_intersection, + engine_condition_pushdown, index_condition_pushdown, mrr, + mrr_cost_based, materialization, semijoin, loosescan, + firstmatch, duplicateweedout, + subquery_materialization_cost_based, skip_scan, + block_nested_loop, batched_key_access, + use_index_extensions, condition_fanout_filter, + derived_merge, hash_join, subquery_to_derived, + prefer_ordering_index, derived_condition_pushdown} and + val is one of {on, off, default} + --optimizer-trace=name + Controls tracing of the Optimizer: + optimizer_trace=option=val[,option=val...], where option + is one of {enabled, one_line} and val is one of {on, + default} + --optimizer-trace-features=name + Enables/disables tracing of selected features of the + Optimizer: + optimizer_trace_features=option=val[,option=val...], + where option is one of {greedy_search, range_optimizer, + dynamic_range, repeated_subselect} and val is one of {on, + off, default} + --optimizer-trace-limit=# + Maximum number of shown optimizer traces + --optimizer-trace-max-mem-size=# + Maximum allowed cumulated size of stored optimizer traces + --optimizer-trace-offset=# + Offset of first optimizer trace to show; see manual + --parallel-cost-threshold=# + Cost threshold for parallel query. + --parallel-default-dop=# + default degree of parallel query. + --parallel-max-threads=# + max running threads of parallel query. + --parallel-memory-limit=# + upper limit memory size that parallel query can use + --parallel-queue-timeout=# + queue timeout for parallel query when resource is not + enough .the unit is microseconds + --parser-max-mem-size=# + Maximum amount of memory available to the parser + --partial-revokes Access of database objects can be restricted, even if + user has global privileges granted. + --password-history=# + The number of old passwords to check in the history. Set + to 0 (the default) to turn the checks off + --password-require-current + Current password is needed to be specified in order to + change it + --password-reuse-interval=# + The minimum number of days that need to pass before a + password can be reused. Set to 0 (the default) to turn + the checks off + --performance-schema + Enable the performance schema. + (Defaults to on; use --skip-performance-schema to disable.) + --performance-schema-accounts-size=# + Maximum number of instrumented user@host accounts. Use 0 + to disable, -1 for automated scaling. + --performance-schema-consumer-events-stages-current + Default startup value for the events_stages_current + consumer. + --performance-schema-consumer-events-stages-history + Default startup value for the events_stages_history + consumer. + --performance-schema-consumer-events-stages-history-long + Default startup value for the events_stages_history_long + consumer. + --performance-schema-consumer-events-statements-current + Default startup value for the events_statements_current + consumer. + (Defaults to on; use --skip-performance-schema-consumer-events-statements-current to disable.) + --performance-schema-consumer-events-statements-history + Default startup value for the events_statements_history + consumer. + (Defaults to on; use --skip-performance-schema-consumer-events-statements-history to disable.) + --performance-schema-consumer-events-statements-history-long + Default startup value for the + events_statements_history_long consumer. + --performance-schema-consumer-events-transactions-current + Default startup value for the events_transactions_current + consumer. + (Defaults to on; use --skip-performance-schema-consumer-events-transactions-current to disable.) + --performance-schema-consumer-events-transactions-history + Default startup value for the events_transactions_history + consumer. + (Defaults to on; use --skip-performance-schema-consumer-events-transactions-history to disable.) + --performance-schema-consumer-events-transactions-history-long + Default startup value for the + events_transactions_history_long consumer. + --performance-schema-consumer-events-waits-current + Default startup value for the events_waits_current + consumer. + --performance-schema-consumer-events-waits-history + Default startup value for the events_waits_history + consumer. + --performance-schema-consumer-events-waits-history-long + Default startup value for the events_waits_history_long + consumer. + --performance-schema-consumer-global-instrumentation + Default startup value for the global_instrumentation + consumer. + (Defaults to on; use --skip-performance-schema-consumer-global-instrumentation to disable.) + --performance-schema-consumer-statements-digest + Default startup value for the statements_digest consumer. + (Defaults to on; use --skip-performance-schema-consumer-statements-digest to disable.) + --performance-schema-consumer-thread-instrumentation + Default startup value for the thread_instrumentation + consumer. + (Defaults to on; use --skip-performance-schema-consumer-thread-instrumentation to disable.) + --performance-schema-digests-size=# + Size of the statement digest. Use 0 to disable, -1 for + automated sizing. + --performance-schema-error-size=# + Number of server errors instrumented. + --performance-schema-events-stages-history-long-size=# + Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to + disable, -1 for automated sizing. + --performance-schema-events-stages-history-size=# + Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 + to disable, -1 for automated sizing. + --performance-schema-events-statements-history-long-size=# + Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 + to disable, -1 for automated sizing. + --performance-schema-events-statements-history-size=# + Number of rows per thread in EVENTS_STATEMENTS_HISTORY. + Use 0 to disable, -1 for automated sizing. + --performance-schema-events-transactions-history-long-size=# + Number of rows in EVENTS_TRANSACTIONS_HISTORY_LONG. Use 0 + to disable, -1 for automated sizing. + --performance-schema-events-transactions-history-size=# + Number of rows per thread in EVENTS_TRANSACTIONS_HISTORY. + Use 0 to disable, -1 for automated sizing. + --performance-schema-events-waits-history-long-size=# + Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to + disable, -1 for automated sizing. + --performance-schema-events-waits-history-size=# + Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 + to disable, -1 for automated sizing. + --performance-schema-hosts-size=# + Maximum number of instrumented hosts. Use 0 to disable, + -1 for automated scaling. + --performance-schema-instrument[=name] + Default startup value for a performance schema + instrument. + --performance-schema-max-cond-classes=# + Maximum number of condition instruments. + --performance-schema-max-cond-instances=# + Maximum number of instrumented condition objects. Use 0 + to disable, -1 for automated scaling. + --performance-schema-max-digest-length=# + Maximum length considered for digest text, when stored in + performance_schema tables. + --performance-schema-max-digest-sample-age=# + The time in seconds after which a previous query sample + is considered old. When the value is 0, queries are + sampled once. When the value is greater than zero, + queries are re sampled if the last sample is more than + performance_schema_max_digest_sample_age seconds old. + --performance-schema-max-file-classes=# + Maximum number of file instruments. + --performance-schema-max-file-handles=# + Maximum number of opened instrumented files. + --performance-schema-max-file-instances=# + Maximum number of instrumented files. Use 0 to disable, + -1 for automated scaling. + --performance-schema-max-index-stat=# + Maximum number of index statistics for instrumented + tables. Use 0 to disable, -1 for automated scaling. + --performance-schema-max-memory-classes=# + Maximum number of memory pool instruments. + --performance-schema-max-metadata-locks=# + Maximum number of metadata locks. Use 0 to disable, -1 + for automated scaling. + --performance-schema-max-mutex-classes=# + Maximum number of mutex instruments. + --performance-schema-max-mutex-instances=# + Maximum number of instrumented MUTEX objects. Use 0 to + disable, -1 for automated scaling. + --performance-schema-max-prepared-statements-instances=# + Maximum number of instrumented prepared statements. Use 0 + to disable, -1 for automated scaling. + --performance-schema-max-program-instances=# + Maximum number of instrumented programs. Use 0 to + disable, -1 for automated scaling. + --performance-schema-max-rwlock-classes=# + Maximum number of rwlock instruments. + --performance-schema-max-rwlock-instances=# + Maximum number of instrumented RWLOCK objects. Use 0 to + disable, -1 for automated scaling. + --performance-schema-max-socket-classes=# + Maximum number of socket instruments. + --performance-schema-max-socket-instances=# + Maximum number of opened instrumented sockets. Use 0 to + disable, -1 for automated scaling. + --performance-schema-max-sql-text-length=# + Maximum length of displayed sql text. + --performance-schema-max-stage-classes=# + Maximum number of stage instruments. + --performance-schema-max-statement-classes=# + Maximum number of statement instruments. + --performance-schema-max-statement-stack=# + Number of rows per thread in EVENTS_STATEMENTS_CURRENT. + --performance-schema-max-table-handles=# + Maximum number of opened instrumented tables. Use 0 to + disable, -1 for automated scaling. + --performance-schema-max-table-instances=# + Maximum number of instrumented tables. Use 0 to disable, + -1 for automated scaling. + --performance-schema-max-table-lock-stat=# + Maximum number of lock statistics for instrumented + tables. Use 0 to disable, -1 for automated scaling. + --performance-schema-max-thread-classes=# + Maximum number of thread instruments. + --performance-schema-max-thread-instances=# + Maximum number of instrumented threads. Use 0 to disable, + -1 for automated scaling. + --performance-schema-session-connect-attrs-size=# + Size of session attribute string buffer per thread. Use 0 + to disable, -1 for automated sizing. + --performance-schema-setup-actors-size=# + Maximum number of rows in SETUP_ACTORS. Use 0 to disable, + -1 for automated scaling. + --performance-schema-setup-objects-size=# + Maximum number of rows in SETUP_OBJECTS. Use 0 to + disable, -1 for automated scaling. + --performance-schema-show-processlist + Default startup value to enable SHOW PROCESSLIST in the + performance schema. + --performance-schema-users-size=# + Maximum number of instrumented users. Use 0 to disable, + -1 for automated scaling. + --persist-only-admin-x509-subject[=name] + The client peer certificate name required to enable + setting all system variables via SET PERSIST[_ONLY] + --persisted-globals-load + When this option is enabled, config file mysqld-auto.cnf + is read and applied to server, else this file is ignored + even if present. + (Defaults to on; use --skip-persisted-globals-load to disable.) + --pid-file=name Pid file used by safe_mysqld + --plugin-dir=name Directory for plugins + --plugin-load=name Optional semicolon-separated list of plugins to load, + where each plugin is identified as name=library, where + name is the plugin name and library is the plugin library + in plugin_dir. + --plugin-load-add=name + Optional semicolon-separated list of plugins to load, + where each plugin is identified as name=library, where + name is the plugin name and library is the plugin library + in plugin_dir. This option adds to the list specified by + --plugin-load in an incremental way. Multiple + --plugin-load-add are supported. + -P, --port=# Port number to use for connection or 0 to default to, + my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default + (3306), whatever comes first + --port-open-timeout=# + Maximum time in seconds to wait for the port to become + free. (Default: No wait). + --preload-buffer-size=# + The size of the buffer that is allocated when preloading + indexes + --print-identified-with-as-hex + SHOW CREATE USER will print the AS clause as HEX if it + contains non-prinable characters + --profiling-history-size=# + Limit of query profiling memory + --protocol-compression-algorithms=name + List of compression algorithms supported by server. + Supported values are any combination of zlib, zstd, + uncompressed. Command line clients may use the + --compression-algorithms flag to specify a set of + algorithms, and the connection will use an algorithm + supported by both client and server. It picks zlib if + both client and server support it; otherwise it picks + zstd if both support it; otherwise it picks uncompressed + if both support it; otherwise it fails. + --query-alloc-block-size=# + Allocation block size for query parsing and execution + --query-prealloc-size=# + Persistent buffer for query parsing and execution + --range-alloc-block-size=# + Allocation block size for storing ranges during + optimization + --range-optimizer-max-mem-size=# + Maximum amount of memory used by the range optimizer to + allocate predicates during range analysis. The larger the + number, more memory may be consumed during range + analysis. If the value is too low to completed range + optimization of a query, index range scan will not be + considered for this query. A value of 0 means range + optimizer does not have any cap on memory. + --read-buffer-size=# + Each thread that does a sequential scan allocates a + buffer of this size for each table it scans. If you do + many sequential scans, you may want to increase this + value + --read-only Make all non-temporary tables read-only, with the + exception for replication (slave) threads and users with + the SUPER privilege + --read-rnd-buffer-size=# + When reading rows in sorted order after a sort, the rows + are read through this buffer to avoid a disk seeks + --regexp-stack-limit=# + Stack size limit for regular expressions matches + --regexp-time-limit=# + Timeout for regular expressions matches, in steps of the + match engine, typically on the order of milliseconds. + --relay-log=name The location and name to use for relay logs + --relay-log-index=name + File that holds the names for relay log files. + --relay-log-info-file=name + The location and name of the file that remembers where + the SQL replication thread is in the relay logs + --relay-log-info-repository=name + Defines the type of the repository for the relay log + information and associated workers. + --relay-log-purge if disabled - do not purge relay logs. if enabled - purge + them as soon as they are no more needed + (Defaults to on; use --skip-relay-log-purge to disable.) + --relay-log-recovery + Enables automatic relay log recovery right after the + database startup, which means that the IO Thread starts + re-fetching from the master right after the last + transaction processed + --relay-log-space-limit=# + Maximum space to use for all relay logs + --replicate-do-db=name + Tells the slave thread to restrict replication to the + specified database. To specify more than one database, + use the directive multiple times, once for each database. + Note that this will only work if you do not use + cross-database queries such as UPDATE some_db.some_table + SET foo='bar' while having selected a different or no + database. If you need cross database updates to work, + make sure you have 3.23.28 or later, and use + replicate-wild-do-table=db_name.%. + --replicate-do-table=name + Tells the slave thread to restrict replication to the + specified table. To specify more than one table, use the + directive multiple times, once for each table. This will + work for cross-database updates, in contrast to + replicate-do-db. + --replicate-ignore-db=name + Tells the slave thread to not replicate to the specified + database. To specify more than one database to ignore, + use the directive multiple times, once for each database. + This option will not work if you use cross database + updates. If you need cross database updates to work, make + sure you have 3.23.28 or later, and use + replicate-wild-ignore-table=db_name.%. + --replicate-ignore-table=name + Tells the slave thread to not replicate to the specified + table. To specify more than one table to ignore, use the + directive multiple times, once for each table. This will + work for cross-database updates, in contrast to + replicate-ignore-db. + --replicate-rewrite-db=name + Updates to a database with a different name than the + original. Example: + replicate-rewrite-db=master_db_name->slave_db_name. + --replicate-same-server-id + In replication, if set to 1, do not skip events having + our server id. Default value is 0 (to break infinite + loops in circular replication). Can't be set to 1 if + --log-slave-updates is used. + --replicate-wild-do-table=name + Tells the slave thread to restrict replication to the + tables that match the specified wildcard pattern. To + specify more than one table, use the directive multiple + times, once for each table. This will work for + cross-database updates. Example: + replicate-wild-do-table=foo%.bar% will replicate only + updates to tables in all databases that start with foo + and whose table names start with bar. + --replicate-wild-ignore-table=name + Tells the slave thread to not replicate to the tables + that match the given wildcard pattern. To specify more + than one table to ignore, use the directive multiple + times, once for each table. This will work for + cross-database updates. Example: + replicate-wild-ignore-table=foo%.bar% will not do updates + to tables in databases that start with foo and whose + table names start with bar. + --replication-optimize-for-static-plugin-config + Optional flag that blocks plugin install/uninstall and + allows skipping the acquisition of the lock to read from + the plugin list and the usage of read-optimized + spin-locks. Use only when plugin hook callback needs + optimization (a lot of semi-sync slaves, for instance). + --replication-sender-observe-commit-only + Optional flag that allows for only calling back observer + hooks at commit. + --report-host=name Hostname or IP of the slave to be reported to the master + during slave registration. Will appear in the output of + SHOW SLAVE HOSTS. Leave unset if you do not want the + slave to register itself with the master. Note that it is + not sufficient for the master to simply read the IP of + the slave off the socket once the slave connects. Due to + NAT and other routing issues, that IP may not be valid + for connecting to the slave from the master or other + hosts + --report-password=name + The account password of the slave to be reported to the + master during slave registration + --report-port=# Port for connecting to slave reported to the master + during slave registration. Set it only if the slave is + listening on a non-default port or if you have a special + tunnel from the master or other clients to the slave. If + not sure, leave this option unset + --report-user=name The account user name of the slave to be reported to the + master during slave registration + --require-secure-transport + When this option is enabled, connections attempted using + insecure transport will be rejected. Secure transports + are SSL/TLS, Unix socket or Shared Memory (on Windows). + --rpl-read-size=# The size for reads done from the binlog and relay log. It + must be a multiple of 4kb. Making it larger might help + with IO stalls while reading these files when they are + not in the OS buffer cache + --rpl-stop-slave-timeout=# + Timeout in seconds to wait for slave to stop before + returning a warning. + --safe-user-create Don't allow new user creation by the user who has no + write privileges to the mysql.user table. + --schema-definition-cache=# + The number of cached schema definitions + --secondary-engine-cost-threshold[=#] + Controls which statements to consider for execution in a + secondary storage engine. Only statements that have a + cost estimate higher than this value will be attempted + executed in a secondary storage engine. + --secure-file-priv=name + Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to + files within specified directory + --select-into-buffer-size[=#] + Buffer size for SELECT INTO OUTFILE/DUMPFILE. + --select-into-disk-sync + Synchronize flushed buffer with disk for SELECT INTO + OUTFILE/DUMPFILE. + --select-into-disk-sync-delay[=#] + The delay in milliseconds after each buffer sync for + SELECT INTO OUTFILE/DUMPFILE. Requires + select_into_sync_disk = ON. + --server-id=# Uniquely identifies the server instance in the community + of replication partners + --server-id-bits=# Set number of significant bits in server-id + --session-track-gtids=name + Controls the amount of global transaction ids to be + included in the response packet sent by the + server.(Default: OFF). + --session-track-schema + Track changes to the 'default schema'. + (Defaults to on; use --skip-session-track-schema to disable.) + --session-track-state-change + Track changes to the 'session state'. + --session-track-system-variables=name + Track changes in registered system variables. + --session-track-transaction-info=name + Track changes to the transaction attributes. OFF to + disable; STATE to track just transaction state (Is there + an active transaction? Does it have any data? etc.); + CHARACTERISTICS to track transaction state and report all + statements needed to start a transaction with the same + characteristics (isolation level, read only/read write, + snapshot - but not any work done / data modified within + the transaction). + --sha256-password-proxy-users + If set to FALSE (the default), then the sha256_password + authentication plugin will not signal for authenticated + users to be checked for mapping to proxy users. When set + to TRUE, the plugin will flag associated authenticated + accounts to be mapped to proxy users when the server + option check_proxy_users is enabled. + --show-create-table-verbosity + When this option is enabled, it increases the verbosity + of 'SHOW CREATE TABLE'. + --show-old-temporals + When this option is enabled, the pre-5.6.4 temporal types + will be marked in the 'SHOW CREATE TABLE' and + 'INFORMATION_SCHEMA.COLUMNS' table as a comment in + COLUMN_TYPE field. This variable is deprecated and will + be removed in a future release. + --show-slave-auth-info + Show user and password in SHOW SLAVE HOSTS on this + master. + --skip-grant-tables Start without grant tables. This gives all users FULL + ACCESS to all tables. + --skip-host-cache Don't cache host names. + --skip-name-resolve Don't resolve hostnames. All hostnames are IP's or + 'localhost'. + --skip-networking Don't allow connection with TCP/IP + --skip-new Don't use new, possibly wrong routines. + --skip-show-database + Don't allow 'SHOW DATABASE' commands + --skip-slave-start If set, slave is not autostarted. + --skip-stack-trace Don't print a stack trace on failure. + --slave-allow-batching + Allow slave to batch requests + --slave-checkpoint-group=# + Maximum number of processed transactions by + Multi-threaded slave before a checkpoint operation is + called to update progress status. + --slave-checkpoint-period=# + Gather workers' activities to Update progress status of + Multi-threaded slave and flush the relay log info to disk + after every #th milli-seconds. + --slave-compressed-protocol + Use compression on master/slave protocol + --slave-exec-mode=name + Modes for how replication events should be executed. + Legal values are STRICT (default) and IDEMPOTENT. In + IDEMPOTENT mode, replication will not stop for operations + that are idempotent. In STRICT mode, replication will + stop on any unexpected difference between the master and + the slave + --slave-load-tmpdir=name + The location where the slave should put its temporary + files when replicating a LOAD DATA INFILE command + --slave-max-allowed-packet=# + The maximum packet length to sent successfully from the + master to slave. + --slave-net-timeout=# + Number of seconds to wait for more data from a + master/slave connection before aborting the read + --slave-parallel-type=name + Specifies if the slave will use database partitioning or + information from master to parallelize + transactions.(Default: DATABASE). + --slave-parallel-workers=# + Number of worker threads for executing events in parallel + --slave-pending-jobs-size-max=# + Max size of Slave Worker queues holding not yet applied + events. The least possible value must be not less than + the master side max_allowed_packet. + --slave-preserve-commit-order + Force slave workers to make commits in the same order as + on the master. Disabled by default. + --slave-rows-search-algorithms=name + Set of searching algorithms that the slave will use while + searching for records from the storage engine to either + updated or deleted them. Possible values are: INDEX_SCAN, + TABLE_SCAN and HASH_SCAN. Any combination is allowed, and + the slave will always pick the most suitable algorithm + for any given scenario. (Default: INDEX_SCAN, HASH_SCAN). + --slave-skip-errors=name + Tells the slave thread to continue replication when a + query event returns an error from the provided list + --slave-sql-verify-checksum + Force checksum verification of replication events after + reading them from relay log. Note: Events are always + checksum-verified by slave on receiving them from the + network before writing them to the relay log. Enabled by + default. + (Defaults to on; use --skip-slave-sql-verify-checksum to disable.) + --slave-transaction-retries=# + Number of times the slave SQL thread will retry a + transaction in case it failed with a deadlock or elapsed + lock wait timeout, before giving up and stopping + --slave-type-conversions=name + Set of slave type conversions that are enabled. Legal + values are: ALL_LOSSY to enable lossy conversions, + ALL_NON_LOSSY to enable non-lossy conversions, + ALL_UNSIGNED to treat all integer column type data to be + unsigned values, and ALL_SIGNED to treat all integer + column type data to be signed values. Default treatment + is ALL_SIGNED. If ALL_SIGNED and ALL_UNSIGNED both are + specified, ALL_SIGNED will take higher priority than + ALL_UNSIGNED. If the variable is assigned the empty set, + no conversions are allowed and it is expected that the + types match exactly. + --slow-launch-time=# + If creating the thread takes longer than this value (in + seconds), the Slow_launch_threads counter will be + incremented + --slow-query-log Log slow queries to a table or log file. Defaults logging + to a file hostname-slow.log or a table mysql.slow_log if + --log-output=TABLE is used. Must be enabled to activate + other slow log options + --slow-query-log-file=name + Log slow queries to given log file. Defaults logging to + hostname-slow.log. Must be enabled to activate other slow + log options + --socket=name Socket file to use for connection + --sort-buffer-size=# + Each thread that needs to do a sort allocates a buffer of + this size + --sporadic-binlog-dump-fail + Option used by mysql-test for debugging and testing of + replication. + --sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual + for the complete list of valid sql modes + --sql-require-primary-key + When set, tables must be created with a primary key, and + an existing primary key cannot be removed with 'ALTER + TABLE'. Attempts to do so will result in an error. + --stored-program-cache=# + The soft upper limit for number of cached stored routines + for one connection. + --stored-program-definition-cache=# + The number of cached stored program definitions + --super-read-only Make all non-temporary tables read-only, with the + exception for replication (slave) threads. Users with + the SUPER privilege are affected, unlike read_only. + Setting super_read_only to ON also sets read_only to ON. + -s, --symbolic-links + Enable symbolic link support (deprecated and will be + removed in a future release). + --sync-binlog=# Synchronously flush binary log to disk after every #th + write to the file. Use 0 to disable synchronous flushing + --sync-master-info=# + Synchronously flush master info to disk after every #th + event. Use 0 to disable synchronous flushing + --sync-relay-log=# Synchronously flush relay log to disk after every #th + event. Use 0 to disable synchronous flushing + --sync-relay-log-info=# + Synchronously flush relay log info to disk after every + #th transaction. Use 0 to disable synchronous flushing + --sysdate-is-now Non-default option to alias SYSDATE() to NOW() to make it + safe-replicable. Since 5.0, SYSDATE() returns a `dynamic' + value different for different invocations, even within + the same statement. + --table-definition-cache=# + The number of cached table definitions + --table-encryption-privilege-check + Indicates if server enables privilege check when user + tries to use non-default value for CREATE DATABASE or + CREATE TABLESPACE or when user tries to do CREATE TABLE + with ENCRYPTION option which deviates from per-database + default. + --table-open-cache=# + The number of cached open tables (total for all table + cache instances) + --table-open-cache-instances=# + The number of table cache instances + --tablespace-definition-cache=# + The number of cached tablespace definitions + --tc-heuristic-recover=name + Decision to use in heuristic recover process. Possible + values are OFF, COMMIT or ROLLBACK. + --temptable-max-mmap=# + Maximum amount of memory (in bytes) the TempTable storage + engine is allowed to allocate from MMAP-backed files + before starting to store data on disk. + --temptable-max-ram=# + Maximum amount of memory (in bytes) the TempTable storage + engine is allowed to allocate from the main memory (RAM) + before starting to store data on disk. + --temptable-use-mmap + Use mmap files for temptables + (Defaults to on; use --skip-temptable-use-mmap to disable.) + --thread-cache-size=# + How many threads we should keep in a cache for reuse + --thread-handling=name + Define threads usage for handling queries, one of + one-thread-per-connection, no-threads, loaded-dynamically + --thread-stack=# The stack size for each thread + --tls-ciphersuites=name + --tls-version=name TLS version, permitted values are TLSv1, TLSv1.1, + TLSv1.2, TLSv1.3 + --tmp-table-size=# If an internal in-memory temporary table in the MEMORY + storage engine exceeds this size, MySQL will + automatically convert it to an on-disk table + -t, --tmpdir=name Path for temporary files. Several paths may be specified, + separated by a colon (:), in this case they are used in a + round-robin fashion + --transaction-alloc-block-size=# + Allocation block size for transactions to be stored in + binary log + --transaction-isolation=name + Default transaction isolation level. + --transaction-prealloc-size=# + Persistent buffer for transactions to be stored in binary + log + --transaction-read-only + Default transaction access mode. True if transactions are + read-only. + --transaction-write-set-extraction[=name] + This option is used to let the server know when to + extract the write set which will be used for various + purposes. + --updatable-views-with-limit=name + YES = Don't issue an error message (warning only) if a + VIEW without presence of a key of the underlying table is + used in queries with a LIMIT clause for updating. NO = + Prohibit update of a VIEW, which does not contain a key + of the underlying table and the query uses a LIMIT clause + (usually get from GUI tools) + --upgrade=name Set server upgrade mode. NONE to abort server if + automatic upgrade of the server is needed; MINIMAL to + start the server, but skip upgrade steps that are not + absolutely necessary; AUTO (default) to upgrade the + server if required; FORCE to force upgrade server. + -u, --user=name Run mysqld daemon as user. + --validate-config Validate the server configuration specified by the user. + --validate-user-plugins + Turns on additional validation of authentication plugins + assigned to user accounts. + (Defaults to on; use --skip-validate-user-plugins to disable.) + -v, --verbose Used with --help option for detailed help. + -V, --version Output version information and exit. + --wait-timeout=# The number of seconds the server waits for activity on a + connection before closing it + --windowing-use-high-precision + For SQL window functions, determines whether to enable + inversion optimization for moving window frames also for + floating values. + (Defaults to on; use --skip-windowing-use-high-precision to disable.) + +Variables (--variable-name=value) +abort-slave-event-count 0 +activate-all-roles-on-login FALSE +admin-address (No default value) +admin-port 33062 +admin-ssl TRUE +admin-ssl-ca (No default value) +admin-ssl-capath (No default value) +admin-ssl-cert (No default value) +admin-ssl-cipher (No default value) +admin-ssl-crl (No default value) +admin-ssl-crlpath (No default value) +admin-ssl-key (No default value) +admin-tls-ciphersuites (No default value) +allow-suspicious-udfs FALSE +auto-increment-increment 1 +auto-increment-offset 1 +autocommit TRUE +automatic-sp-privileges TRUE +avoid-temporal-upgrade FALSE +back-log 151 +big-tables FALSE +bind-address * +binlog-cache-size 32768 +binlog-checksum CRC32 +binlog-direct-non-transactional-updates FALSE +binlog-encryption FALSE +binlog-error-action ABORT_SERVER +binlog-expire-logs-seconds 2592000 +binlog-format ROW +binlog-group-commit-sync-delay 0 +binlog-group-commit-sync-no-delay-count 0 +binlog-gtid-simple-recovery TRUE +binlog-max-flush-queue-time 0 +binlog-order-commits TRUE +binlog-rotate-encryption-master-key-at-startup FALSE +binlog-row-event-max-size 8192 +binlog-row-image FULL +binlog-row-metadata MINIMAL +binlog-row-value-options +binlog-rows-query-log-events FALSE +binlog-stmt-cache-size 32768 +binlog-transaction-compression FALSE +binlog-transaction-compression-level-zstd 3 +binlog-transaction-dependency-history-size 25000 +binlog-transaction-dependency-tracking COMMIT_ORDER +block-encryption-mode aes-128-ecb +bulk-insert-buffer-size 8388608 +caching-sha2-password-digest-rounds 5000 +caching-sha2-password-private-key-path private_key.pem +caching-sha2-password-public-key-path public_key.pem +character-set-client-handshake TRUE +character-set-filesystem binary +character-set-server utf8mb4 +character-sets-dir MYSQL_CHARSETSDIR/ +check-proxy-users FALSE +chroot (No default value) +collation-server utf8mb4_0900_ai_ci +completion-type NO_CHAIN +concurrent-insert AUTO +connect-timeout 10 +console FALSE +create-admin-listener-thread FALSE +cte-max-recursion-depth 1000 +daemonize FALSE +default-authentication-plugin caching_sha2_password +default-password-lifetime 0 +default-storage-engine InnoDB +default-table-encryption FALSE +default-time-zone (No default value) +default-tmp-storage-engine InnoDB +default-week-format 0 +delay-key-write ON +delayed-insert-limit 100 +delayed-insert-timeout 300 +delayed-queue-size 1000 +disabled-storage-engines +disconnect-on-expired-password TRUE +disconnect-slave-event-count 0 +div-precision-increment 4 +end-markers-in-json FALSE +enforce-gtid-consistency FALSE +eq-range-index-dive-limit 200 +event-scheduler ON +expire-logs-days 0 +explicit-defaults-for-timestamp TRUE +external-locking FALSE +flush FALSE +flush-time 0 +force-parallel-execute FALSE +ft-boolean-syntax + -><()~*:""&| +ft-max-word-len 84 +ft-min-word-len 4 +ft-query-expansion-limit 20 +ft-stopword-file (No default value) +gdb FALSE +general-log FALSE +generated-random-password-length 20 +group-concat-max-len 1024 +group-replication-consistency EVENTUAL +gtid-executed-compression-period 0 +gtid-mode OFF +help TRUE +histogram-generation-max-mem-size 20000000 +host-cache-size 279 +information-schema-stats-expiry 86400 +init-connect +init-file (No default value) +init-slave +initialize TRUE +initialize-insecure TRUE +interactive-timeout 28800 +internal-tmp-mem-storage-engine TempTable +join-buffer-size 262144 +keep-files-on-create FALSE +key-buffer-size 8388608 +key-cache-age-threshold 300 +key-cache-block-size 1024 +key-cache-division-limit 100 +keyring-migration-destination (No default value) +keyring-migration-host (No default value) +keyring-migration-port 0 +keyring-migration-source (No default value) +keyring-migration-to-component FALSE +keyring-migration-user (No default value) +large-pages FALSE +lc-messages en_US +lc-time-names en_US +local-infile FALSE +lock-wait-timeout 31536000 +log-bin (No default value) +log-bin-index (No default value) +log-bin-trust-function-creators FALSE +log-bin-use-v1-row-events FALSE +log-error stderr +log-error-services log_filter_internal; log_sink_internal +log-error-suppression-list +log-error-verbosity 2 +log-isam myisam.log +log-output FILE +log-queries-not-using-indexes FALSE +log-raw FALSE +log-short-format FALSE +log-slave-updates FALSE +log-slow-admin-statements FALSE +log-slow-extra FALSE +log-slow-slave-statements FALSE +log-statements-unsafe-for-binlog TRUE +log-tc tc.log +log-tc-size ##### +log-throttle-queries-not-using-indexes 0 +log-timestamps UTC +long-query-time 10 +low-priority-updates FALSE +lower-case-table-names 1 +mandatory-roles +master-info-file master.info +master-info-repository TABLE +master-retry-count 86400 +master-verify-checksum FALSE +max-allowed-packet 67108864 +max-binlog-cache-size 18446744073709547520 +max-binlog-dump-events 0 +max-binlog-size 1073741824 +max-binlog-stmt-cache-size 18446744073709547520 +max-connect-errors 100 +max-connections 151 +max-delayed-threads 20 +max-digest-length 1024 +max-error-count 1024 +max-execution-time 0 +max-heap-table-size 16777216 +max-join-size 18446744073709551615 +max-length-for-sort-data 4096 +max-points-in-geometry 65536 +max-prepared-stmt-count 16382 +max-relay-log-size 0 +max-seeks-for-key 18446744073709551615 +max-sort-length 1024 +max-sp-recursion-depth 0 +max-user-connections 0 +max-write-lock-count 18446744073709551615 +memlock FALSE +min-examined-row-limit 0 +myisam-block-size 1024 +myisam-data-pointer-size 6 +myisam-max-sort-file-size 9223372036853727232 +myisam-mmap-size 18446744073709551615 +myisam-recover-options OFF +myisam-repair-threads 1 +myisam-sort-buffer-size 8388608 +myisam-stats-method nulls_unequal +myisam-use-mmap FALSE +mysql-native-password-proxy-users FALSE +net-buffer-length 16384 +net-read-timeout 30 +net-retry-count 10 +net-write-timeout 60 +new FALSE +no-dd-upgrade FALSE +offline-mode FALSE +old FALSE +old-alter-table FALSE +old-style-user-limits FALSE +optimizer-prune-level 1 +optimizer-search-depth 62 +optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on,use_invisible_indexes=off,skip_scan=on,hash_join=on,subquery_to_derived=off,prefer_ordering_index=on,hypergraph_optimizer=off,derived_condition_pushdown=on +optimizer-trace +optimizer-trace-features greedy_search=on,range_optimizer=on,dynamic_range=on,repeated_subselect=on +optimizer-trace-limit 1 +optimizer-trace-max-mem-size 1048576 +optimizer-trace-offset -1 +parallel-cost-threshold 1000 +parallel-default-dop 4 +parallel-max-threads 64 +parallel-memory-limit 104857600 +parallel-queue-timeout 0 +parser-max-mem-size 18446744073709551615 +partial-revokes #### +password-history 0 +password-require-current FALSE +password-reuse-interval 0 +performance-schema TRUE +performance-schema-accounts-size -1 +performance-schema-consumer-events-stages-current FALSE +performance-schema-consumer-events-stages-history FALSE +performance-schema-consumer-events-stages-history-long FALSE +performance-schema-consumer-events-statements-current TRUE +performance-schema-consumer-events-statements-history TRUE +performance-schema-consumer-events-statements-history-long FALSE +performance-schema-consumer-events-transactions-current TRUE +performance-schema-consumer-events-transactions-history TRUE +performance-schema-consumer-events-transactions-history-long FALSE +performance-schema-consumer-events-waits-current FALSE +performance-schema-consumer-events-waits-history FALSE +performance-schema-consumer-events-waits-history-long FALSE +performance-schema-consumer-global-instrumentation TRUE +performance-schema-consumer-statements-digest TRUE +performance-schema-consumer-thread-instrumentation TRUE +performance-schema-digests-size -1 +performance-schema-error-size #### +performance-schema-events-stages-history-long-size -1 +performance-schema-events-stages-history-size -1 +performance-schema-events-statements-history-long-size -1 +performance-schema-events-statements-history-size -1 +performance-schema-events-transactions-history-long-size -1 +performance-schema-events-transactions-history-size -1 +performance-schema-events-waits-history-long-size -1 +performance-schema-events-waits-history-size -1 +performance-schema-hosts-size -1 +performance-schema-instrument +performance-schema-max-cond-classes 100 +performance-schema-max-cond-instances -1 +performance-schema-max-digest-length 1024 +performance-schema-max-digest-sample-age 60 +performance-schema-max-file-classes 80 +performance-schema-max-file-handles 32768 +performance-schema-max-file-instances -1 +performance-schema-max-index-stat -1 +performance-schema-max-memory-classes 450 +performance-schema-max-metadata-locks -1 +performance-schema-max-mutex-classes 300 +performance-schema-max-mutex-instances -1 +performance-schema-max-prepared-statements-instances -1 +performance-schema-max-program-instances -1 +performance-schema-max-rwlock-classes 60 +performance-schema-max-rwlock-instances -1 +performance-schema-max-socket-classes 10 +performance-schema-max-socket-instances -1 +performance-schema-max-sql-text-length 1024 +performance-schema-max-stage-classes 175 +performance-schema-max-statement-classes 218 +performance-schema-max-statement-stack 10 +performance-schema-max-table-handles -1 +performance-schema-max-table-instances -1 +performance-schema-max-table-lock-stat -1 +performance-schema-max-thread-classes 100 +performance-schema-max-thread-instances -1 +performance-schema-session-connect-attrs-size -1 +performance-schema-setup-actors-size -1 +performance-schema-setup-objects-size -1 +performance-schema-show-processlist FALSE +performance-schema-users-size -1 +persist-only-admin-x509-subject +persisted-globals-load TRUE +port #### +port-open-timeout 0 +preload-buffer-size 32768 +print-identified-with-as-hex FALSE +profiling-history-size 15 +protocol-compression-algorithms zlib,zstd,uncompressed +query-alloc-block-size 8192 +query-prealloc-size 8192 +range-alloc-block-size 4096 +range-optimizer-max-mem-size 8388608 +read-buffer-size 131072 +read-only FALSE +read-rnd-buffer-size 262144 +regexp-stack-limit 8000000 +regexp-time-limit 32 +relay-log relaylog +relay-log-index relaylog.index +relay-log-info-file relay-log.info +relay-log-info-repository TABLE +relay-log-purge TRUE +relay-log-recovery FALSE +relay-log-space-limit 0 +replicate-same-server-id FALSE +replication-optimize-for-static-plugin-config FALSE +replication-sender-observe-commit-only FALSE +report-host (No default value) +report-password (No default value) +report-port 0 +report-user (No default value) +require-secure-transport FALSE +rpl-read-size 8192 +rpl-stop-slave-timeout 31536000 +safe-user-create FALSE +schema-definition-cache 256 +secondary-engine-cost-threshold 100000 +select-into-buffer-size 131072 +select-into-disk-sync FALSE +select-into-disk-sync-delay 0 +server-id 1 +server-id-bits 32 +session-track-gtids OFF +session-track-schema TRUE +session-track-state-change FALSE +session-track-system-variables time_zone,autocommit,character_set_client,character_set_results,character_set_connection +session-track-transaction-info OFF +sha256-password-proxy-users FALSE +show-create-table-verbosity FALSE +show-old-temporals FALSE +show-slave-auth-info FALSE +skip-grant-tables TRUE +skip-name-resolve FALSE +skip-networking FALSE +skip-show-database FALSE +skip-slave-start FALSE +slave-allow-batching FALSE +slave-checkpoint-group 512 +slave-checkpoint-period 300 +slave-compressed-protocol FALSE +slave-exec-mode STRICT +slave-max-allowed-packet 1073741824 +slave-net-timeout 60 +slave-parallel-type DATABASE +slave-parallel-workers 0 +slave-pending-jobs-size-max 134217728 +slave-preserve-commit-order FALSE +slave-rows-search-algorithms INDEX_SCAN,HASH_SCAN +slave-skip-errors (No default value) +slave-sql-verify-checksum TRUE +slave-transaction-retries 10 +slave-type-conversions +slow-launch-time 2 +slow-query-log FALSE +sort-buffer-size 262144 +sporadic-binlog-dump-fail FALSE +sql-mode ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION +sql-require-primary-key FALSE +stored-program-cache 256 +stored-program-definition-cache 256 +super-read-only FALSE +symbolic-links FALSE +sync-binlog 1 +sync-master-info 10000 +sync-relay-log 10000 +sync-relay-log-info 10000 +sysdate-is-now FALSE +table-encryption-privilege-check FALSE +table-open-cache-instances 16 +tablespace-definition-cache 256 +tc-heuristic-recover OFF +temptable-max-mmap 1073741824 +temptable-max-ram 1073741824 +temptable-use-mmap TRUE +thread-cache-size 9 +thread-handling one-thread-per-connection +thread-stack 262144 +tls-ciphersuites (No default value) +tmp-table-size 16777216 +transaction-alloc-block-size 8192 +transaction-isolation REPEATABLE-READ +transaction-prealloc-size 4096 +transaction-read-only FALSE +transaction-write-set-extraction XXHASH64 +updatable-views-with-limit YES +upgrade AUTO +validate-config FALSE +validate-user-plugins TRUE +verbose TRUE +wait-timeout 28800 +windowing-use-high-precision TRUE + +To see what values a running MySQL server is using, type +'mysqladmin variables' instead of 'mysqld --verbose --help'. diff --git a/mysql-test/r/opt_hints.result-pq b/mysql-test/r/opt_hints.result-pq index 6ef02c6376ed..eae45cc0e798 100644 --- a/mysql-test/r/opt_hints.result-pq +++ b/mysql-test/r/opt_hints.result-pq @@ -978,56 +978,50 @@ INSERT INTO t VALUES (1); SET optimizer_switch='block_nested_loop=on'; EXPLAIN SELECT 1 FROM t t1 LEFT JOIN t t2 ON 1 LEFT JOIN (t t3 LEFT JOIN t t4 ON 1) ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) Warnings: Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t` `t1` left join `test`.`t` `t2` on(true) left join (`test`.`t` `t3` left join `test`.`t` `t4` on(true)) on(true) where true EXPLAIN SELECT /*+ NO_BNL(t1) */ 1 FROM t t1 LEFT JOIN t t2 ON 1 LEFT JOIN (t t3 LEFT JOIN t t4 ON 1) ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) Warnings: Note 1003 /* select#1 */ select /*+ NO_BNL(`t1`@`select#1`) */ 1 AS `1` from `test`.`t` `t1` left join `test`.`t` `t2` on(true) left join (`test`.`t` `t3` left join `test`.`t` `t4` on(true)) on(true) where true EXPLAIN SELECT /*+ NO_BNL(t2) */ 1 FROM t t1 LEFT JOIN t t2 ON 1 LEFT JOIN (t t3 LEFT JOIN t t4 ON 1) ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) Warnings: Note 1003 /* select#1 */ select /*+ NO_BNL(`t2`@`select#1`) */ 1 AS `1` from `test`.`t` `t1` left join `test`.`t` `t2` on(true) left join (`test`.`t` `t3` left join `test`.`t` `t4` on(true)) on(true) where true EXPLAIN SELECT /*+ NO_BNL(t3) */ 1 FROM t t1 LEFT JOIN t t2 ON 1 LEFT JOIN (t t3 LEFT JOIN t t4 ON 1) ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using where Warnings: Note 1003 /* select#1 */ select /*+ NO_BNL(`t3`@`select#1`) */ 1 AS `1` from `test`.`t` `t1` left join `test`.`t` `t2` on(true) left join (`test`.`t` `t3` left join `test`.`t` `t4` on(true)) on(true) where true EXPLAIN SELECT /*+ NO_BNL(t4) */ 1 FROM t t1 LEFT JOIN t t2 ON 1 LEFT JOIN (t t3 LEFT JOIN t t4 ON 1) ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using where Warnings: Note 1003 /* select#1 */ select /*+ NO_BNL(`t4`@`select#1`) */ 1 AS `1` from `test`.`t` `t1` left join `test`.`t` `t2` on(true) left join (`test`.`t` `t3` left join `test`.`t` `t4` on(true)) on(true) where true EXPLAIN SELECT /*+ NO_BNL(t3) */ 1 FROM t t1 LEFT JOIN (t t2 LEFT JOIN t t3 ON 1 LEFT JOIN t t4 ON 1) ON 1 WHERE 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using where Warnings: Note 1003 /* select#1 */ select /*+ NO_BNL(`t3`@`select#1`) */ 1 AS `1` from `test`.`t` `t1` left join (`test`.`t` `t2` left join `test`.`t` `t3` on(true) left join `test`.`t` `t4` on(true)) on(true) where true SELECT /*+ NO_BNL(t4) */ 1 FROM t t1 LEFT JOIN t t2 ON 1 LEFT JOIN (t t3 LEFT JOIN t t4 ON 1) ON 1; @@ -1039,74 +1033,66 @@ SELECT /*+ NO_BNL(t3) */ 1 FROM t t1 LEFT JOIN (t t2 LEFT JOIN t t3 ON 1 LEFT JO SET optimizer_switch='block_nested_loop=off'; EXPLAIN SELECT 1 FROM t t1 LEFT JOIN (t t2 LEFT JOIN t t3 ON 1 INNER JOIN t t4 ON 1) ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 NULL Warnings: Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t` `t1` left join (`test`.`t` `t2` left join `test`.`t` `t3` on(true) join `test`.`t` `t4`) on((true)) where true EXPLAIN SELECT /*+ BNL(t1) */ 1 FROM t t1 LEFT JOIN (t t2 LEFT JOIN t t3 ON 1 INNER JOIN t t4 ON 1) ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 NULL Warnings: Note 1003 /* select#1 */ select /*+ BNL(`t1`@`select#1`) */ 1 AS `1` from `test`.`t` `t1` left join (`test`.`t` `t2` left join `test`.`t` `t3` on(true) join `test`.`t` `t4`) on((true)) where true EXPLAIN SELECT /*+ BNL(t2) */ 1 FROM t t1 LEFT JOIN (t t2 LEFT JOIN t t3 ON 1 INNER JOIN t t4 ON 1) ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 NULL Warnings: Note 1003 /* select#1 */ select /*+ BNL(`t2`@`select#1`) */ 1 AS `1` from `test`.`t` `t1` left join (`test`.`t` `t2` left join `test`.`t` `t3` on(true) join `test`.`t` `t4`) on((true)) where true EXPLAIN SELECT /*+ BNL(t3) */ 1 FROM t t1 LEFT JOIN (t t2 LEFT JOIN t t3 ON 1 INNER JOIN t t4 ON 1) ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 NULL Warnings: Note 1003 /* select#1 */ select /*+ BNL(`t3`@`select#1`) */ 1 AS `1` from `test`.`t` `t1` left join (`test`.`t` `t2` left join `test`.`t` `t3` on(true) join `test`.`t` `t4`) on((true)) where true EXPLAIN SELECT /*+ BNL(t4) */ 1 FROM t t1 LEFT JOIN (t t2 LEFT JOIN t t3 ON 1 INNER JOIN t t4 ON 1) ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 NULL Warnings: Note 1003 /* select#1 */ select /*+ BNL(`t4`@`select#1`) */ 1 AS `1` from `test`.`t` `t1` left join (`test`.`t` `t2` left join `test`.`t` `t3` on(true) join `test`.`t` `t4`) on((true)) where true EXPLAIN SELECT /*+ BNL(t2, t3) */ 1 FROM t t1 LEFT JOIN (t t2 LEFT JOIN t t3 ON 1 INNER JOIN t t4 ON 1) ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 NULL Warnings: Note 1003 /* select#1 */ select /*+ BNL(`t2`@`select#1`) BNL(`t3`@`select#1`) */ 1 AS `1` from `test`.`t` `t1` left join (`test`.`t` `t2` left join `test`.`t` `t3` on(true) join `test`.`t` `t4`) on((true)) where true EXPLAIN SELECT /*+ BNL(t3, t4) */ 1 FROM t t1 LEFT JOIN (t t2 LEFT JOIN t t3 ON 1 INNER JOIN t t4 ON 1) ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 NULL Warnings: Note 1003 /* select#1 */ select /*+ BNL(`t3`@`select#1`) BNL(`t4`@`select#1`) */ 1 AS `1` from `test`.`t` `t1` left join (`test`.`t` `t2` left join `test`.`t` `t3` on(true) join `test`.`t` `t4`) on((true)) where true EXPLAIN SELECT /*+ BNL(t2, t3, t4) */ 1 FROM t t1 LEFT JOIN (t t2 LEFT JOIN t t3 ON 1 INNER JOIN t t4 ON 1) ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) Warnings: Note 1003 /* select#1 */ select /*+ BNL(`t2`@`select#1`) BNL(`t3`@`select#1`) BNL(`t4`@`select#1`) */ 1 AS `1` from `test`.`t` `t1` left join (`test`.`t` `t2` left join `test`.`t` `t3` on(true) join `test`.`t` `t4`) on((true)) where true DROP TABLE t; @@ -1856,8 +1842,7 @@ DROP TABLE t1; CREATE TABLE t1 (i INT); EXPLAIN SELECT /*+ QB_NAME(1a) BKA(t1@1a) */ 1 FROM t1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL Warnings: Note 1003 /* select#1 */ select /*+ QB_NAME(`1a`) BKA(`t1`@`1a`) */ 1 AS `1` from `test`.`t1` DROP TABLE t1; diff --git a/mysql-test/r/opt_hints_join_order.result-pq b/mysql-test/r/opt_hints_join_order.result-pq index ac1e0dfe0be2..f5cc6ada8338 100644 --- a/mysql-test/r/opt_hints_join_order.result-pq +++ b/mysql-test/r/opt_hints_join_order.result-pq @@ -481,11 +481,10 @@ JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) Warnings: Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t3` left join (`test`.`t1` join `test`.`t2`) on((true)) join `test`.`t4` where true EXPLAIN SELECT /*+ JOIN_ORDER(t2, t1, t4) */ 1 FROM t1 @@ -493,11 +492,10 @@ JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) Warnings: Note 1003 /* select#1 */ select /*+ JOIN_ORDER(@`select#1` `t2`,`t1`,`t4`) */ 1 AS `1` from `test`.`t3` left join (`test`.`t1` join `test`.`t2`) on((true)) join `test`.`t4` where true EXPLAIN SELECT /*+ JOIN_ORDER(t4, t1, t2) */ 1 FROM t1 @@ -505,11 +503,10 @@ JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) Warnings: Note 1003 /* select#1 */ select /*+ JOIN_ORDER(@`select#1` `t4`,`t1`,`t2`) */ 1 AS `1` from `test`.`t3` left join (`test`.`t1` join `test`.`t2`) on((true)) join `test`.`t4` where true EXPLAIN SELECT /*+ JOIN_ORDER(t3, t4) */ 1 FROM t1 @@ -517,11 +514,10 @@ JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) Warnings: Note 1003 /* select#1 */ select /*+ JOIN_ORDER(@`select#1` `t3`,`t4`) */ 1 AS `1` from `test`.`t3` left join (`test`.`t1` join `test`.`t2`) on((true)) join `test`.`t4` where true EXPLAIN SELECT /*+ JOIN_ORDER(t4, t3) */ 1 FROM t1 @@ -529,11 +525,10 @@ JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) Warnings: Note 1003 /* select#1 */ select /*+ JOIN_ORDER(@`select#1` `t4`,`t3`) */ 1 AS `1` from `test`.`t3` left join (`test`.`t1` join `test`.`t2`) on((true)) join `test`.`t4` where true EXPLAIN SELECT /*+ JOIN_SUFFIX(t1) */ 1 FROM t1 @@ -541,11 +536,10 @@ JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) Warnings: Note 1003 /* select#1 */ select /*+ JOIN_SUFFIX(@`select#1` `t1`) */ 1 AS `1` from `test`.`t3` left join (`test`.`t1` join `test`.`t2`) on((true)) join `test`.`t4` where true EXPLAIN SELECT /*+ JOIN_SUFFIX(t2, t1) */ 1 FROM t1 @@ -553,11 +547,10 @@ JOIN t2 ON 1 RIGHT JOIN t3 ON 1 JOIN t4 ON 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 NULL -2 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) -2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) +1 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t4 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using join buffer (hash join) Warnings: Note 1003 /* select#1 */ select /*+ JOIN_SUFFIX(@`select#1` `t2`,`t1`) */ 1 AS `1` from `test`.`t3` left join (`test`.`t1` join `test`.`t2`) on((true)) join `test`.`t4` where true DROP TABLE t1, t2, t3, t4; @@ -963,15 +956,14 @@ ON alias6.f1 = alias5.f1 ON alias5.f3 = alias7.f1 ON alias1.f2 = alias7.f1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE alias1 NULL index NULL f2 1023 NULL 1 100.00 Using index -2 SIMPLE alias7 NULL ALL NULL NULL NULL NULL 1 100.00 Using where -2 SIMPLE alias2 NULL ref f2 f2 5 test.alias7.f1 1 100.00 Using where -2 SIMPLE alias4 NULL ref f1 f1 5 test.alias2.f1 1 100.00 Using where -2 SIMPLE alias3 NULL eq_ref PRIMARY PRIMARY 4 test.alias4.f2 1 100.00 Using index -2 SIMPLE alias5 NULL ref f3 f3 43 test.alias7.f1 1 100.00 Using where; Using index -2 SIMPLE alias8 NULL ref f2 f2 5 test.alias5.f1 1 100.00 Using index -2 SIMPLE alias6 NULL eq_ref PRIMARY PRIMARY 4 test.alias5.f1 1 100.00 Using index +1 SIMPLE alias1 NULL index NULL f2 1023 NULL 1 100.00 Using index +1 SIMPLE alias7 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +1 SIMPLE alias2 NULL ref f2 f2 5 test.alias7.f1 1 100.00 Using where +1 SIMPLE alias4 NULL ref f1 f1 5 test.alias2.f1 1 100.00 Using where +1 SIMPLE alias3 NULL eq_ref PRIMARY PRIMARY 4 test.alias4.f2 1 100.00 Using index +1 SIMPLE alias5 NULL ref f3 f3 43 test.alias7.f1 1 100.00 Using where; Using index +1 SIMPLE alias8 NULL ref f2 f2 5 test.alias5.f1 1 100.00 Using index +1 SIMPLE alias6 NULL eq_ref PRIMARY PRIMARY 4 test.alias5.f1 1 100.00 Using index Warnings: Note 1003 /* select#1 */ select /*+ JOIN_ORDER(@`select#1` `alias8`,`alias6`) */ 1 AS `1` from `test`.`t1` `alias1` left join (`test`.`t7` `alias7` join `test`.`t2` `alias2` left join (`test`.`t3` `alias3` join `test`.`t4` `alias4`) on(((`test`.`alias3`.`f1` = `test`.`alias4`.`f2`) and (cast(`test`.`alias4`.`f1` as double) = cast(`test`.`alias2`.`f1` as double)))) join `test`.`t10` `alias5` left join (`test`.`t6` `alias6` join `test`.`t2` `alias8`) on(((`test`.`alias8`.`f2` = `test`.`alias5`.`f1`) and (`test`.`alias6`.`f1` = `test`.`alias5`.`f1`)))) on(((`test`.`alias7`.`f1` = `test`.`alias1`.`f2`) and (`test`.`alias5`.`f3` = `test`.`alias1`.`f2`) and (cast(`test`.`alias2`.`f2` as double) = cast(`test`.`alias1`.`f2` as double)))) where true DROP TABLES t1, t2, t3, t4, t6, t7, t10; diff --git a/mysql-test/r/outfile.result-pq b/mysql-test/r/outfile.result-pq new file mode 100644 index 0000000000000000000000000000000000000000..e48f80f29774be30d9d7c978bd487a2cd7ff05ce GIT binary patch literal 2457 zcmd^AZEqqs5boFYuNct}yfhG&i~rc4%EEtToB$l-=wg4Yp5#-H+I*!FwkK_q*Q&Kk=#;Cq?tS*-tE* zPRCRDbl2^6-@z@x2K7$ooIV8SH%QijODbx<-j?|U-`)@SUL5(Jh>Oy$T@mvnd=9;s z=N`-VRQCiwF^kKSqWj$}WbAqx^^*va{>M1-tQL8~At!^|LyRC&^$u>c{aNM5F6?JlmRTb%+O}=*Z>X z+^g!q>3CR4gvf&ph^eClgGxn$B{xnup_L7)f0x=?LGqG5;o1hY_-`sv1qK&^(JwZj zZg*%f529CRI17W>U^t1R;MYg)3N*dn0$;y?GTr>B-u6ovgxzkZ+YKh%a4As|zcE{p zcr`+=Mo(yLll8uy>cancTt%8cxluwr+IMWE9r{QY!FdZd_x?Hb_-~2yBPE=Bt($k| zE~JHYwm$>^SQuTxfsNfv$CDkIuGq?wK$GW@S`*DkocC(m+GzDwS)n$(oBbZANi<8+ zo5A#rPK32hSl=RV#3d;ZhHLVp3!7&&AS{@b^5_8Zv;e9VwA+@TH`uNed}+ipc*bf4 zR)cVmaYc=}E08Pb5bJ2rl&IXd9l9MsIVWaux@x($Ux+CO_ay)f_$3WLNS$$6Xm6!f zQI6D30tMcAby`64>Uj6Iel{zxIPo(&}E7rf( z?6Ox4gnpKxwUDC{m|wwKuRtNC(%>|Kky}RqA?QW3DqbZYzGgH=9 NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL Warnings: Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` DROP TABLE t1; diff --git a/mysql-test/r/select_all.result-pq b/mysql-test/r/select_all.result-pq new file mode 100644 index 000000000000..a78d9df9adbe --- /dev/null +++ b/mysql-test/r/select_all.result-pq @@ -0,0 +1,5700 @@ +set optimizer_switch='semijoin=on,materialization=on,firstmatch=on,loosescan=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=off'; +drop table if exists t1,t2,t3,t4,t11; +drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; +drop view if exists v1; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +); +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +select * from t1; +Period Varor_period +9410 9412 +select t1.* from t1; +Period Varor_period +9410 9412 +CREATE TABLE t2 ( +auto int not null auto_increment, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL, +UNIQUE fld1 (fld1), +KEY fld3 (fld3), +PRIMARY KEY (auto) +) charset utf8mb4; +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +imaginable +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +cultivation +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3 from t2 order by fld3 desc limit 10; +fld3 +youthfulness +yelped +Wotan +workers +Witt +witchcraft +Winsett +Willy +willed +wildcats +select fld3 from t2 order by fld3 desc limit 5; +fld3 +youthfulness +yelped +Wotan +workers +Witt +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +witchcraft +Winsett +Willy +willed +wildcats +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'h%le'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; +fld3 +explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 0.09 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 0.09 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` IGNORE INDEX (`fld3`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 0.09 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 0.09 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld1`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld3`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld3`) USE INDEX (`fld1`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 ignore index (fld3,not_used); +ERROR 42000: Key 'not_used' doesn't exist in table 't2' +explain select fld3 from t2 use index (not_used); +ERROR 42000: Key 'not_used' doesn't exist in table 't2' +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +honeysuckle +honoring +explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range fld3 fld3 120 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where ((`test`.`t2`.`fld3` >= 'honeysuckle') and (`test`.`t2`.`fld3` <= 'honoring')) order by `test`.`t2`.`fld3` +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +fld1 fld3 +148504 Colombo +068305 Colombo +000000 nondecreasing +select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes'; +fld1 fld3 +232605 appendixes +1232605 appendixes +1232606 appendixes +1232607 appendixes +1232608 appendixes +1232609 appendixes +select fld1 from t2 where fld1=250501 or fld1="250502"; +fld1 +250501 +250502 +explain select fld1 from t2 where fld1=250501 or fld1="250502"; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL range fld1 fld1 4 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld1` AS `fld1` from `test`.`t2` where ((`test`.`t2`.`fld1` = 250501) or (`test`.`t2`.`fld1` = 250502)) +select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +fld1 +250501 +250502 +250505 +250601 +explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL range fld1 fld1 4 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld1` AS `fld1` from `test`.`t2` where ((`test`.`t2`.`fld1` = 250501) or (`test`.`t2`.`fld1` = 250502) or ((`test`.`t2`.`fld1` >= 250505) and (`test`.`t2`.`fld1` <= 250601)) or (`test`.`t2`.`fld1` between 250501 and 250502)) +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +fld1 fld3 +012001 flanking +013602 foldout +013606 fingerings +018007 fanatic +018017 featherweight +018054 fetters +018103 flint +018104 flopping +036002 funereal +038017 fetched +038205 firearm +058004 Fenton +088303 feminine +186002 freakish +188007 flurried +188505 fitting +198006 furthermore +202301 Fitzpatrick +208101 fiftieth +208113 freest +218008 finishers +218022 feed +218401 faithful +226205 foothill +226209 furnishings +228306 forthcoming +228311 fated +231315 freezes +232102 forgivably +238007 filial +238008 fixedly +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +fld3 +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +fld3 +Chantilly +select fld1,fld3 from t2 where fld1 like "25050%"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select fld1,fld3 from t2 where fld1 like "25050_"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select distinct companynr from t2; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr desc; +companynr +68 +65 +58 +53 +50 +41 +40 +37 +36 +34 +29 +00 +select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%" order by fld3; +fld3 period +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +select distinct fld3 from t2 where companynr = 34 order by fld3; +fld3 +absentee +accessed +ahead +alphabetic +Asiaticizations +attitude +aye +bankruptcies +belays +Blythe +bomb +boulevard +bulldozes +cannot +caressing +charcoal +checksumming +chess +clubroom +colorful +cosy +creator +crying +Darius +diffusing +duality +Eiffel +Epiphany +Ernestine +explorers +exterminated +famine +forked +Gershwins +heaving +Hodges +Iraqis +Italianization +Lagos +landslide +libretto +Majorca +mastering +narrowed +occurred +offerers +Palestine +Peruvianizes +pharmaceutic +poisoning +population +Pygmalion +rats +realest +recording +regimented +retransmitting +reviver +rouses +scars +sicker +sleepwalk +stopped +sugars +translatable +uncles +unexpected +uprisings +versatility +vest +select distinct fld3 from t2 limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct fld3 from t2 having fld3 like "A%" limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct substring(fld3,1,3) from t2 where fld3 like "A%"; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +Adl +adm +Ado +ads +adv +aer +aff +afi +afl +afo +agi +ahe +aim +air +Ald +alg +ali +all +alp +alr +ama +ame +amm +ana +and +ane +Ang +ani +Ann +Ant +api +app +aqu +Ara +arc +Arm +arr +Art +Asi +ask +asp +ass +ast +att +aud +Aug +aut +ave +avo +awe +aye +Azt +select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +create table t3 ( +period int not null, +name char(32) not null, +companynr int not null, +price double(11,0), +price2 double(11,0), +key (period), +key (name) +); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +create temporary table tmp select * from t3; +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +alter table t3 add t2nr int not null auto_increment primary key first; +drop table tmp; +SET BIG_TABLES=1; +select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10; +namn +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +SET BIG_TABLES=0; +select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10; +concat(fld3," ",fld3) +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +select distinct fld5 from t2 limit 10; +fld5 +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +select distinct companynr, fld3,count(*) from t2 group by companynr, fld3 order by companynr, fld3 limit 10; +companynr fld3 count(*) +00 affixed 1 +00 and 1 +00 annoyers 1 +00 Anthony 1 +00 assayed 1 +00 assurers 1 +00 attendants 1 +00 bedlam 1 +00 bedpost 1 +00 boasted 1 +SET BIG_TABLES=1; +select distinct companynr, fld3,count(*) from t2 group by companynr, fld3 order by companynr, fld3 limit 10; +companynr fld3 count(*) +00 affixed 1 +00 and 1 +00 annoyers 1 +00 Anthony 1 +00 assayed 1 +00 assurers 1 +00 attendants 1 +00 bedlam 1 +00 bedpost 1 +00 boasted 1 +SET BIG_TABLES=0; +select distinct companynr, fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr ,fld3 order by companynr, fld3 limit 100,10; +companynr fld3 repeat("a",length(fld3)) count(*) +29 chancellor aaaaaaaaaa 1 +29 Chippewa aaaaaaaa 1 +29 circumference aaaaaaaaaaaaa 1 +29 circus aaaaaa 1 +29 cited aaaaa 1 +29 Colombo aaaaaaa 1 +29 congresswoman aaaaaaaaaaaaa 1 +29 contrition aaaaaaaaaa 1 +29 corny aaaaa 1 +29 cultivation aaaaaaaaaaa 1 +select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2; +companynr rtrim(space(512+companynr)) +37 +78 +101 +154 +311 +447 +512 +select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; +fld3 +explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 10.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL fld1 NULL NULL NULL 1199 10.00 Using where; Using temporary; Using filesort +2 SIMPLE t3 NULL eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`t2nr` AS `t2nr`,`test`.`t2`.`fld3` AS `fld3` from `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld1` = `test`.`t3`.`t2nr`)) order by `test`.`t3`.`t2nr`,`test`.`t2`.`fld3` +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 41736 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL period NULL NULL NULL 41736 100.00 Using temporary; Using filesort +2 SIMPLE t3 NULL ref period period 4 test.t1.period 4173 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t3`.`period` = `test`.`t1`.`period`) order by `test`.`t3`.`period` +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (4 workers) +2 SIMPLE t3 NULL index period period 4 NULL 1 100.00 NULL +2 SIMPLE t1 NULL ref period period 4 test.t3.period 4173 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t1`.`period` = `test`.`t3`.`period`) order by `test`.`t3`.`period` limit 10 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL index period period 4 NULL 1 100.00 NULL +2 SIMPLE t3 NULL ref period period 4 test.t1.period 4173 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t3`.`period` = `test`.`t1`.`period`) order by `test`.`t1`.`period` limit 10 +select period from t1; +period +9410 +select period from t1 where period=1900; +period +select fld3,period from t1,t2 where fld1 = 011401 order by period; +fld3 period +breaking 9410 +select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001; +fld3 period +breaking 1001 +explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const fld1 fld1 4 const 1 100.00 NULL +1 SIMPLE t3 NULL const PRIMARY,period PRIMARY 4 const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select 'breaking' AS `fld3`,'1001' AS `period` from `test`.`t2` join `test`.`t3` where true +select fld3,period from t2,t1 where companynr*10 = 37*10 order by fld3; +fld3 period +abates 9410 +Abraham 9410 +abrogating 9410 +accessed 9410 +Aden 9410 +admiring 9410 +admonishing 9410 +Adolph 9410 +afield 9410 +afore 9410 +aging 9410 +airships 9410 +Aldrich 9410 +alike 9410 +Alison 9410 +allot 9410 +already 9410 +amenities 9410 +ammonium 9410 +analogy 9410 +analyzable 9410 +Anatole 9410 +animals 9410 +animized 9410 +annihilates 9410 +announced 9410 +announces 9410 +Antarctica 9410 +Antares 9410 +apiary 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +Arabia 9410 +arriving 9410 +Artemia 9410 +arteriole 9410 +assails 9410 +astound 9410 +attainments 9410 +attrition 9410 +audiology 9410 +Augustine 9410 +avenge 9410 +avoidable 9410 +babies 9410 +babysitting 9410 +Baird 9410 +balled 9410 +beaner 9410 +beaters 9410 +bee 9410 +Beebe 9410 +befouled 9410 +bellow 9410 +bestseller 9410 +betroth 9410 +bewilderingly 9410 +bills 9410 +bitterroot 9410 +bivalves 9410 +bloater 9410 +bloodbath 9410 +boat 9410 +boom 9410 +boorish 9410 +boulder 9410 +breaking 9410 +brunch 9410 +buckboards 9410 +burlesque 9410 +Butterfield 9410 +cage 9410 +capably 9410 +capped 9410 +cascade 9410 +Cassites 9410 +causality 9410 +cautioned 9410 +ceiling 9410 +celery 9410 +CERN 9410 +certificates 9410 +chafe 9410 +chaperone 9410 +charges 9410 +chasm 9410 +checkpoints 9410 +chewing 9410 +chews 9410 +Chicana 9410 +chillingly 9410 +Chippewa 9410 +chronicle 9410 +ciphers 9410 +civics 9410 +clamored 9410 +Clayton 9410 +clenched 9410 +clockers 9410 +coexist 9410 +cokes 9410 +combed 9410 +coming 9410 +commencements 9410 +commonplace 9410 +communicants 9410 +compartment 9410 +comprehensive 9410 +comprised 9410 +conceptions 9410 +concludes 9410 +congregates 9410 +Conley 9410 +Connally 9410 +contrary 9410 +contrasted 9410 +convenient 9410 +convulsion 9410 +corset 9410 +count 9410 +coverings 9410 +Crays 9410 +craziness 9410 +creak 9410 +creek 9410 +critiques 9410 +crunches 9410 +culled 9410 +cult 9410 +cupboard 9410 +cured 9410 +cute 9410 +daughter 9410 +decliner 9410 +decomposition 9410 +deductions 9410 +dehydrate 9410 +deludes 9410 +denizen 9410 +denotative 9410 +denounces 9410 +dental 9410 +dentally 9410 +descendants 9410 +despot 9410 +destroyer 9410 +detectably 9410 +dialysis 9410 +DiMaggio 9410 +dimensions 9410 +disable 9410 +discounts 9410 +disentangle 9410 +disobedience 9410 +dissociate 9410 +dogging 9410 +dopers 9410 +drains 9410 +dreaded 9410 +ducks 9410 +dusted 9410 +Dutchman 9410 +effortlessly 9410 +electroencephalography 9410 +elite 9410 +embassies 9410 +employing 9410 +encompass 9410 +encompasses 9410 +environing 9410 +epistle 9410 +equilibrium 9410 +erases 9410 +error 9410 +eschew 9410 +eternal 9410 +Eulerian 9410 +Evanston 9410 +evened 9410 +evenhandedly 9410 +eventful 9410 +Everhart 9410 +excises 9410 +exclamation 9410 +excrete 9410 +exhausts 9410 +expelled 9410 +extents 9410 +externally 9410 +extracted 9410 +faithful 9410 +fanatic 9410 +fated 9410 +featherweight 9410 +feed 9410 +feminine 9410 +Fenton 9410 +fetched 9410 +fetters 9410 +fiftieth 9410 +filial 9410 +fingerings 9410 +finishers 9410 +firearm 9410 +fitting 9410 +Fitzpatrick 9410 +fixedly 9410 +flanking 9410 +flint 9410 +flopping 9410 +flurried 9410 +foldout 9410 +foothill 9410 +forgivably 9410 +forthcoming 9410 +freakish 9410 +freest 9410 +freezes 9410 +funereal 9410 +furnishings 9410 +furthermore 9410 +gadfly 9410 +gainful 9410 +Galatean 9410 +galling 9410 +Gandhian 9410 +Ganymede 9410 +garage 9410 +gentleman 9410 +gifted 9410 +gleaning 9410 +glut 9410 +goblins 9410 +Goldstine 9410 +Gothicism 9410 +governing 9410 +gradually 9410 +Graves 9410 +grazing 9410 +Greenberg 9410 +gritty 9410 +groupings 9410 +guides 9410 +guitars 9410 +Gurkha 9410 +handgun 9410 +handy 9410 +Hawaii 9410 +Hegelian 9410 +heiress 9410 +hoarder 9410 +honoring 9410 +Hornblower 9410 +hostess 9410 +Huffman 9410 +humanness 9410 +humiliation 9410 +humility 9410 +Hunter 9410 +hushes 9410 +husky 9410 +hypothesizer 9410 +icon 9410 +ideas 9410 +impelling 9410 +impending 9410 +imperial 9410 +imperiously 9410 +imprint 9410 +impulsive 9410 +inaccuracy 9410 +inch 9410 +incidentals 9410 +incorrectly 9410 +incurring 9410 +index 9410 +indulge 9410 +indulgences 9410 +ineffective 9410 +infallibly 9410 +infest 9410 +inform 9410 +inmate 9410 +insolence 9410 +instruments 9410 +intelligibility 9410 +intentness 9410 +intercepted 9410 +interdependent 9410 +interrelationships 9410 +interrogate 9410 +investigations 9410 +irresponsibly 9410 +jarring 9410 +Joplin 9410 +journalizing 9410 +Judas 9410 +juveniles 9410 +Kane 9410 +kanji 9410 +Kantian 9410 +Kevin 9410 +kingdom 9410 +Kinsey 9410 +kiting 9410 +Kline 9410 +labeled 9410 +languages 9410 +Lars 9410 +laterally 9410 +Latinizes 9410 +lawgiver 9410 +leaflet 9410 +leavings 9410 +lectured 9410 +leftover 9410 +lewdly 9410 +lied 9410 +Lillian 9410 +linear 9410 +lists 9410 +lithograph 9410 +Lizzy 9410 +lore 9410 +luckily 9410 +Majorca 9410 +males 9410 +Manhattanize 9410 +marginal 9410 +mastering 9410 +mayoral 9410 +McGovern 9410 +meanwhile 9410 +measures 9410 +measures 9410 +mechanizing 9410 +medical 9410 +meditation 9410 +Melinda 9410 +Merritt 9410 +metaphysically 9410 +Micronesia 9410 +Miles 9410 +Miltonism 9410 +mineral 9410 +miniaturizes 9410 +minima 9410 +minion 9410 +minting 9410 +misted 9410 +misunderstander 9410 +mixture 9410 +motors 9410 +mournfulness 9410 +multilayer 9410 +mumbles 9410 +mushrooms 9410 +mystic 9410 +Nabisco 9410 +navies 9410 +navigate 9410 +Nazis 9410 +neat 9410 +neonatal 9410 +nested 9410 +Newtonian 9410 +noncritical 9410 +normalizes 9410 +Norwalk 9410 +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +Pandora 9410 +parametrized 9410 +parenthood 9410 +Parsifal 9410 +parters 9410 +participated 9410 +partridges 9410 +peacock 9410 +peeked 9410 +pellagra 9410 +percentage 9410 +percentage 9410 +persist 9410 +perturb 9410 +Peruvian 9410 +pessimist 9410 +pests 9410 +petted 9410 +pictures 9410 +pithed 9410 +pityingly 9410 +poison 9410 +posed 9410 +positioning 9410 +postulation 9410 +praised 9410 +precaution 9410 +precipitable 9410 +preclude 9410 +presentation 9410 +pressure 9410 +previewing 9410 +priceless 9410 +primary 9410 +psychic 9410 +publicly 9410 +puddings 9410 +Punjab 9410 +Pyle 9410 +quagmire 9410 +quitter 9410 +Quixotism 9410 +railway 9410 +raining 9410 +rains 9410 +ravines 9410 +readable 9410 +realized 9410 +realtor 9410 +reassigned 9410 +recruited 9410 +reduce 9410 +regimented 9410 +registration 9410 +relatively 9410 +relaxing 9410 +relishing 9410 +relives 9410 +renew 9410 +repelled 9410 +repetitions 9410 +reporters 9410 +reporters 9410 +repressions 9410 +resplendent 9410 +resumes 9410 +rifles 9410 +rightful 9410 +rightfully 9410 +rightfulness 9410 +ripeness 9410 +riser 9410 +Romano 9410 +Romans 9410 +roped 9410 +rudeness 9410 +rules 9410 +rural 9410 +rusting 9410 +Sabine 9410 +sadly 9410 +sags 9410 +sanding 9410 +saplings 9410 +sating 9410 +Sault 9410 +save 9410 +sawtooth 9410 +Saxony 9410 +scarf 9410 +scatterbrain 9410 +scheduling 9410 +schemer 9410 +scholastics 9410 +scornfully 9410 +secures 9410 +securing 9410 +Selfridge 9410 +seminaries 9410 +serializations 9410 +serpents 9410 +serving 9410 +severely 9410 +sews 9410 +Shanghais 9410 +shapelessly 9410 +shipyard 9410 +shooter 9410 +similarities 9410 +Simla 9410 +Simon 9410 +skulking 9410 +slaughter 9410 +sloping 9410 +smoothed 9410 +snatching 9410 +socializes 9410 +sophomore 9410 +sorters 9410 +spatial 9410 +specification 9410 +specifics 9410 +spongers 9410 +spools 9410 +sportswriting 9410 +sporty 9410 +squabbled 9410 +squeaking 9410 +squeezes 9410 +stabilizes 9410 +stairway 9410 +Stalin 9410 +standardizes 9410 +star 9410 +starlet 9410 +stated 9410 +Steinberg 9410 +stint 9410 +stodgy 9410 +store 9410 +straight 9410 +stranglings 9410 +subdirectory 9410 +subjective 9410 +subschema 9410 +succumbed 9410 +suites 9410 +sumac 9410 +sureties 9410 +swaying 9410 +sweetish 9410 +swelling 9410 +syndicate 9410 +Taoism 9410 +taxonomically 9410 +techniques 9410 +teem 9410 +teethe 9410 +tempering 9410 +Teresa 9410 +terminal 9410 +terminator 9410 +terminators 9410 +test 9410 +testicle 9410 +textures 9410 +theorizers 9410 +throttles 9410 +tidiness 9410 +timesharing 9410 +tinily 9410 +tinting 9410 +Tipperary 9410 +title 9410 +tragedies 9410 +traitor 9410 +trimmings 9410 +tropics 9410 +unaffected 9410 +uncovering 9410 +undoes 9410 +ungrateful 9410 +universals 9410 +unplug 9410 +unruly 9410 +untying 9410 +unwilling 9410 +vacuuming 9410 +validate 9410 +vanish 9410 +ventilate 9410 +veranda 9410 +vests 9410 +wallet 9410 +waltz 9410 +warm 9410 +warningly 9410 +watering 9410 +weasels 9410 +Weissmuller 9410 +western 9410 +whiteners 9410 +widens 9410 +Winsett 9410 +witchcraft 9410 +workers 9410 +Wotan 9410 +yelped 9410 +youthfulness 9410 +analyze table t2, t3; +Table Op Msg_type Msg_text +test.t2 analyze status OK +test.t3 analyze status OK +EXPLAIN select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 10.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL fld1 NULL NULL NULL 1199 10.00 Using where; Using temporary; Using filesort +2 SIMPLE t3 NULL eq_ref PRIMARY,period PRIMARY 4 test.t2.fld1 1 20.04 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`companynr` = 37) and (`test`.`t2`.`fld1` = `test`.`t3`.`t2nr`) and (`test`.`t3`.`period` >= 1001) and (`test`.`t3`.`period` <= 1002)) order by `test`.`t2`.`fld3`,`test`.`t3`.`period`,`test`.`t3`.`price` +select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +fld3 period price price2 +admonishing 1002 28357832 8723648 +analyzable 1002 28357832 8723648 +annihilates 1001 5987435 234724 +Antares 1002 28357832 8723648 +astound 1001 5987435 234724 +audiology 1001 5987435 234724 +Augustine 1002 28357832 8723648 +Baird 1002 28357832 8723648 +bewilderingly 1001 5987435 234724 +breaking 1001 5987435 234724 +Conley 1001 5987435 234724 +dentally 1002 28357832 8723648 +dissociate 1002 28357832 8723648 +elite 1001 5987435 234724 +eschew 1001 5987435 234724 +Eulerian 1001 5987435 234724 +flanking 1001 5987435 234724 +foldout 1002 28357832 8723648 +funereal 1002 28357832 8723648 +galling 1002 28357832 8723648 +Graves 1001 5987435 234724 +grazing 1001 5987435 234724 +groupings 1001 5987435 234724 +handgun 1001 5987435 234724 +humility 1002 28357832 8723648 +impulsive 1002 28357832 8723648 +inch 1001 5987435 234724 +intelligibility 1001 5987435 234724 +jarring 1001 5987435 234724 +lawgiver 1001 5987435 234724 +lectured 1002 28357832 8723648 +Merritt 1002 28357832 8723648 +neonatal 1001 5987435 234724 +offload 1002 28357832 8723648 +parters 1002 28357832 8723648 +pityingly 1002 28357832 8723648 +puddings 1002 28357832 8723648 +Punjab 1001 5987435 234724 +quitter 1002 28357832 8723648 +realtor 1001 5987435 234724 +relaxing 1001 5987435 234724 +repetitions 1001 5987435 234724 +resumes 1001 5987435 234724 +Romans 1002 28357832 8723648 +rusting 1001 5987435 234724 +scholastics 1001 5987435 234724 +skulking 1002 28357832 8723648 +stated 1002 28357832 8723648 +suites 1002 28357832 8723648 +sureties 1001 5987435 234724 +testicle 1002 28357832 8723648 +tinily 1002 28357832 8723648 +tragedies 1001 5987435 234724 +trimmings 1001 5987435 234724 +vacuuming 1001 5987435 234724 +ventilate 1001 5987435 234724 +wallet 1001 5987435 234724 +Weissmuller 1002 28357832 8723648 +Wotan 1002 28357832 8723648 +select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37; +fld1 fld3 period price price2 +018201 relaxing 1001 5987435 234724 +018601 vacuuming 1001 5987435 234724 +018801 inch 1001 5987435 234724 +018811 repetitions 1001 5987435 234724 +create table t4 ( +companynr tinyint(2) unsigned zerofill NOT NULL default '00', +companyname char(30) NOT NULL default '', +PRIMARY KEY (companynr), +UNIQUE KEY companyname(companyname) +) ENGINE=INNODB MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select * from t1,t1 t12; +Period Varor_period Period Varor_period +9410 9412 9410 9412 +select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505; +fld1 fld1 +250501 250501 +250501 250502 +250501 250503 +250501 250504 +250501 250505 +250502 250501 +250502 250502 +250502 250503 +250502 250504 +250502 250505 +250503 250501 +250503 250502 +250503 250503 +250503 250504 +250503 250505 +250504 250501 +250504 250502 +250504 250503 +250504 250504 +250504 250505 +250505 250501 +250505 250502 +250505 250503 +250505 250504 +250505 250505 +insert into t2 (fld1, companynr) values (999999,99); +ANALYZE TABLE t2, t4; +Table Op Msg_type Msg_text +test.t2 analyze status OK +test.t4 analyze status OK +select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +companynr companyname +99 NULL +select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null; +count(*) +1199 +explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1200 100.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1200 100.00 NULL +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 Using where; Not exists +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t2` left join `test`.`t4` on((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`)) where (`test`.`t4`.`companynr` is null) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1200 10.00 Using where; Not exists; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t2`.`companynr` is null) +select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +companynr companyname +select count(*) from t2 left join t4 using (companynr) where companynr is not null; +count(*) +1200 +explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t2` left join `test`.`t4` on(multiple equal(`test`.`t2`.`companynr`, `test`.`t4`.`companynr`)) where false +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on(multiple equal(`test`.`t4`.`companynr`, `test`.`t2`.`companynr`)) where false +delete from t2 where fld1=999999; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0) and (`test`.`t2`.`companynr` > 0)) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t4`.`companynr` > 0) and (`test`.`t4`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 40.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t2`.`companynr` > 0) or (`test`.`t2`.`companynr` is null)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index PRIMARY companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t2`.`companynr` > 0) or (`test`.`t4`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (ifnull(`test`.`t2`.`companynr`,1) > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t4`.`companynr` > 0) or (`test`.`t4`.`companynr` > 0)) +explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using where; Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (ifnull(`test`.`t4`.`companynr`,1) > 0) +select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +companynr companynr +37 36 +41 40 +explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index; Using temporary +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 10.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select distinct `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companynr` AS `companynr` from `test`.`t2` join `test`.`t4` where (`test`.`t2`.`companynr` = (`test`.`t4`.`companynr` + 1)) +select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909); +period +9410 +select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6))); +period +9410 +select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1; +fld1 +250501 +250502 +250503 +250505 +select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606); +fld1 +250502 +250503 +select fld1 from t2 where fld1 between 250502 and 250504; +fld1 +250502 +250503 +250504 +select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ; +fld3 +Lillian +label +labeled +labeled +landslide +laterally +leaflet +lewdly +luckily +select count(*) from t1; +count(*) +1 +select companynr,count(*),sum(fld1) from t2 group by companynr; +companynr count(*) sum(fld1) +00 82 10355753 +29 95 14473298 +34 70 17788966 +36 215 22786296 +37 588 83602098 +40 37 6618386 +41 52 12816335 +50 11 1595438 +53 4 793210 +58 23 2254293 +65 10 2284055 +68 12 3097288 +select companynr,count(*) from t2 group by companynr order by companynr desc limit 5; +companynr count(*) +68 12 +65 10 +58 23 +53 4 +50 11 +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +70 absentee vest 17788966 254128.0857 3272.5939722090234 10709871.306938833 +explain select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 9.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 order 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.97568479746 13352027981.708656 +29 95 abut wetness 14473298 152350.5053 8368.547956641249 70032594.90260443 +34 70 absentee vest 17788966 254128.0857 3272.5939722090234 10709871.306938833 +select +companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from +t3 where companynr = 37 group by companynr,t2nr order by companynr, t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select /*! SQL_SMALL_RESULT */ +companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from +t3 where companynr = 37 group by companynr,t2nr order by companynr, t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ; +companynr count(price) sum(price) min(price) max(price) avg(price) +101 4181 3489454238 834598 834598 834598.0000 +154 4181 4112197254950 983543950 983543950 983543950.0000 +311 4181 979599938 234298 234298 234298.0000 +37 12543 309394878010 5987435 39654943 24666736.6667 +447 4181 9929180954 2374834 2374834 2374834.0000 +512 4181 3288532102 786542 786542 786542.0000 +78 8362 414611089292 726498 98439034 49582766.0000 +select distinct mod(companynr,10) from t4 group by companynr; +mod(companynr,10) +0 +1 +3 +4 +5 +6 +7 +8 +9 +select distinct 1 from t4 group by companynr; +1 +1 +select count(distinct fld1) from t2; +count(distinct fld1) +1199 +select companynr,count(distinct fld1) from t2 group by companynr; +companynr count(distinct fld1) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(*) from t2 group by companynr; +companynr count(*) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,1000))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,200))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct floor(fld1/100)) from t2 group by companynr; +companynr count(distinct floor(fld1/100)) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr; +companynr count(distinct concat(repeat(65,1000),floor(fld1/100))) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10; +sum(fld1) fld3 +11402 Romans +select name,count(*) from t3 where name='cloakroom' group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name='cloakroom' and price>10 group by name; +name count(*) +cloakroom 4181 +select count(*) from t3 where name='cloakroom' and price2=823742; +count(*) +4181 +select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name; +name count(*) +extramarital 4181 +gazer 4181 +gems 4181 +Iranizes 4181 +spates 4181 +tucked 4181 +violinist 4181 +select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld3 count(*) +spates 4181 +select companynr|0,companyname from t4 group by 1; +companynr|0 companyname +0 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname; +companynr companyname count(*) +29 company 1 95 +68 company 10 12 +50 company 11 11 +34 company 2 70 +36 company 3 215 +37 company 4 588 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +00 Unknown 82 +select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld1 count(*) +158402 4181 +select sum(Period)/count(*) from t1; +sum(Period)/count(*) +9410.0000 +select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; +companynr count sum diff func +101 4181 3489454238 0.0000 422281 +154 4181 4112197254950 0.0000 643874 +311 4181 979599938 0.0000 1300291 +37 12543 309394878010 0.0000 464091 +447 4181 9929180954 0.0000 1868907 +512 4181 3288532102 0.0000 2140672 +78 8362 414611089292 0.0000 652236 +select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; +companynr avg +154 983543950.0000 +select companynr,count(*) from t2 group by companynr order by 2 desc; +companynr count(*) +37 588 +36 215 +29 95 +00 82 +34 70 +41 52 +40 37 +58 23 +68 12 +50 11 +65 10 +53 4 +select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc; +companynr count(*) +41 52 +58 23 +68 12 +50 11 +65 10 +53 4 +select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4; +fld4 fld1 count(price) sum(price) min(price) max(price) avg(price) +Abraham 018103 1 39654943 39654943 39654943 39654943.0000 +Anatole 038102 1 28357832 28357832 28357832 28357832.0000 +Beebe 018602 1 28357832 28357832 28357832 28357832.0000 +Chicana 038203 1 39654943 39654943 39654943 39654943.0000 +Conley 018101 1 5987435 5987435 5987435 5987435.0000 +Connally 018801 1 5987435 5987435 5987435 5987435.0000 +Graves 018052 1 28357832 28357832 28357832 28357832.0000 +Judas 018032 1 28357832 28357832 28357832 28357832.0000 +Kline 038101 1 5987435 5987435 5987435 5987435.0000 +Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000 +Merritt 016303 1 39654943 39654943 39654943 39654943.0000 +Parsifal 013802 1 28357832 28357832 28357832 28357832.0000 +Punjab 016302 1 28357832 28357832 28357832 28357832.0000 +Selfridge 019102 1 28357832 28357832 28357832 28357832.0000 +Simla 018402 1 28357832 28357832 28357832 28357832.0000 +Steinberg 012003 1 39654943 39654943 39654943 39654943.0000 +Taoism 018603 1 39654943 39654943 39654943 39654943.0000 +attainments 012303 1 39654943 39654943 39654943 39654943.0000 +audiology 011403 1 39654943 39654943 39654943 39654943.0000 +balled 012301 1 5987435 5987435 5987435 5987435.0000 +bee 038001 1 5987435 5987435 5987435 5987435.0000 +betroth 030501 1 5987435 5987435 5987435 5987435.0000 +bivalves 018013 1 39654943 39654943 39654943 39654943.0000 +bloodbath 018042 1 28357832 28357832 28357832 28357832.0000 +cage 018201 1 5987435 5987435 5987435 5987435.0000 +capably 012501 1 5987435 5987435 5987435 5987435.0000 +checkpoints 018803 1 39654943 39654943 39654943 39654943.0000 +coexist 018601 1 5987435 5987435 5987435 5987435.0000 +contrasted 016001 1 5987435 5987435 5987435 5987435.0000 +daughter 012703 1 39654943 39654943 39654943 39654943.0000 +dental 038003 1 39654943 39654943 39654943 39654943.0000 +dimensions 038202 1 28357832 28357832 28357832 28357832.0000 +disable 019103 1 39654943 39654943 39654943 39654943.0000 +dogging 018002 1 28357832 28357832 28357832 28357832.0000 +dreaded 011401 1 5987435 5987435 5987435 5987435.0000 +epistle 018062 1 28357832 28357832 28357832 28357832.0000 +erases 016301 1 5987435 5987435 5987435 5987435.0000 +eschew 011702 1 28357832 28357832 28357832 28357832.0000 +featherweight 012701 1 5987435 5987435 5987435 5987435.0000 +fetched 018802 1 28357832 28357832 28357832 28357832.0000 +fetters 018012 1 28357832 28357832 28357832 28357832.0000 +firearm 018812 1 28357832 28357832 28357832 28357832.0000 +flint 018022 1 28357832 28357832 28357832 28357832.0000 +flopping 018023 1 39654943 39654943 39654943 39654943.0000 +gritty 018811 1 5987435 5987435 5987435 5987435.0000 +hushes 018202 1 28357832 28357832 28357832 28357832.0000 +imprint 030503 1 39654943 39654943 39654943 39654943.0000 +impulsive 012602 1 28357832 28357832 28357832 28357832.0000 +interdependent 018051 1 5987435 5987435 5987435 5987435.0000 +interrelationships 036001 1 5987435 5987435 5987435 5987435.0000 +kanji 038002 1 28357832 28357832 28357832 28357832.0000 +lawgiver 013601 1 5987435 5987435 5987435 5987435.0000 +leavings 013803 1 39654943 39654943 39654943 39654943.0000 +lectured 018102 1 28357832 28357832 28357832 28357832.0000 +leftover 016201 1 5987435 5987435 5987435 5987435.0000 +medical 018041 1 5987435 5987435 5987435 5987435.0000 +minima 019101 1 5987435 5987435 5987435 5987435.0000 +neat 012001 1 5987435 5987435 5987435 5987435.0000 +neonatal 018053 1 39654943 39654943 39654943 39654943.0000 +normalizes 038013 1 39654943 39654943 39654943 39654943.0000 +parters 011701 1 5987435 5987435 5987435 5987435.0000 +partridges 038103 1 39654943 39654943 39654943 39654943.0000 +persist 012302 1 28357832 28357832 28357832 28357832.0000 +pessimist 012702 1 28357832 28357832 28357832 28357832.0000 +quitter 011703 1 39654943 39654943 39654943 39654943.0000 +railway 038011 1 5987435 5987435 5987435 5987435.0000 +readable 013603 1 39654943 39654943 39654943 39654943.0000 +recruited 038201 1 5987435 5987435 5987435 5987435.0000 +reporters 018403 1 39654943 39654943 39654943 39654943.0000 +riser 036002 1 28357832 28357832 28357832 28357832.0000 +scholastics 011402 1 28357832 28357832 28357832 28357832.0000 +scornfully 018003 1 39654943 39654943 39654943 39654943.0000 +skulking 018021 1 5987435 5987435 5987435 5987435.0000 +sorters 018061 1 5987435 5987435 5987435 5987435.0000 +squeaking 013901 1 5987435 5987435 5987435 5987435.0000 +starlet 012603 1 39654943 39654943 39654943 39654943.0000 +stated 013602 1 28357832 28357832 28357832 28357832.0000 +subschema 018043 1 39654943 39654943 39654943 39654943.0000 +sweetish 018001 1 5987435 5987435 5987435 5987435.0000 +swelling 031901 1 5987435 5987435 5987435 5987435.0000 +teethe 000001 1 5987435 5987435 5987435 5987435.0000 +testicle 013801 1 5987435 5987435 5987435 5987435.0000 +vacuuming 018033 1 39654943 39654943 39654943 39654943.0000 +validate 038012 1 28357832 28357832 28357832 28357832.0000 +wallet 011501 1 5987435 5987435 5987435 5987435.0000 +whiteners 016202 1 28357832 28357832 28357832 28357832.0000 +witchcraft 019201 1 5987435 5987435 5987435 5987435.0000 +select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3; +companynr fld3 sum(price) +512 Micronesia 786542 +512 Miles 786542 +512 boat 786542 +512 capably 786542 +512 cupboard 786542 +512 decliner 786542 +512 descendants 786542 +512 dopers 786542 +512 erases 786542 +512 skies 786542 +select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr; +companynr count(*) min(fld3) max(fld3) sum(price) avg(price) +00 1 Omaha Omaha 5987435 5987435.0000 +36 1 dubbed dubbed 28357832 28357832.0000 +37 83 Abraham Wotan 1908978016 22999735.1325 +50 2 scribbled tapestry 68012775 34006387.5000 +select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1; +t3.companynr+0 t2nr fld3 sum(price) +37 1 Omaha 5987435 +37 11401 breaking 5987435 +37 11402 Romans 28357832 +37 11403 intercepted 39654943 +37 11501 bewilderingly 5987435 +37 11701 astound 5987435 +37 11702 admonishing 28357832 +37 11703 sumac 39654943 +37 12001 flanking 5987435 +37 12003 combed 39654943 +37 12301 Eulerian 5987435 +37 12302 dubbed 28357832 +37 12303 Kane 39654943 +37 12501 annihilates 5987435 +37 12602 Wotan 28357832 +37 12603 snatching 39654943 +37 12701 grazing 5987435 +37 12702 Baird 28357832 +37 12703 celery 39654943 +37 13601 handgun 5987435 +37 13602 foldout 28357832 +37 13603 mystic 39654943 +37 13801 intelligibility 5987435 +37 13802 Augustine 28357832 +37 13803 teethe 39654943 +37 13901 scholastics 5987435 +37 16001 audiology 5987435 +37 16201 wallet 5987435 +37 16202 parters 28357832 +37 16301 eschew 5987435 +37 16302 quitter 28357832 +37 16303 neat 39654943 +37 18001 jarring 5987435 +37 18002 tinily 28357832 +37 18003 balled 39654943 +37 18012 impulsive 28357832 +37 18013 starlet 39654943 +37 18021 lawgiver 5987435 +37 18022 stated 28357832 +37 18023 readable 39654943 +37 18032 testicle 28357832 +37 18033 Parsifal 39654943 +37 18041 Punjab 5987435 +37 18042 Merritt 28357832 +37 18043 Quixotism 39654943 +37 18051 sureties 5987435 +37 18052 puddings 28357832 +37 18053 tapestry 39654943 +37 18061 trimmings 5987435 +37 18062 humility 28357832 +37 18101 tragedies 5987435 +37 18102 skulking 28357832 +37 18103 flint 39654943 +37 18201 relaxing 5987435 +37 18202 offload 28357832 +37 18402 suites 28357832 +37 18403 lists 39654943 +37 18601 vacuuming 5987435 +37 18602 dentally 28357832 +37 18603 humanness 39654943 +37 18801 inch 5987435 +37 18802 Weissmuller 28357832 +37 18803 irresponsibly 39654943 +37 18811 repetitions 5987435 +37 18812 Antares 28357832 +37 19101 ventilate 5987435 +37 19102 pityingly 28357832 +37 19103 interdependent 39654943 +37 19201 Graves 5987435 +37 30501 neonatal 5987435 +37 30502 scribbled 28357832 +37 30503 chafe 39654943 +37 31901 realtor 5987435 +37 36001 elite 5987435 +37 36002 funereal 28357832 +37 38001 Conley 5987435 +37 38002 lectured 28357832 +37 38003 Abraham 39654943 +37 38011 groupings 5987435 +37 38012 dissociate 28357832 +37 38013 coexist 39654943 +37 38101 rusting 5987435 +37 38102 galling 28357832 +37 38103 obliterates 39654943 +37 38201 resumes 5987435 +37 38202 analyzable 28357832 +37 38203 terminator 39654943 +select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008; +sum(price) +234298 +select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1; +fld1 sum(price) +038008 234298 +explain select fld3 from t2 where 1>2 or 2>3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where false +explain select fld3 from t2 where fld1=fld1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 100.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where true +select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000; +companynr count sum +00 82 10355753 +29 95 14473298 +34 70 17788966 +37 588 83602098 +41 52 12816335 +select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ; +companynr +00 +29 +34 +37 +41 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40; +companynr companyname count(*) +40 company 5 37 +41 company 6 52 +50 company 11 11 +53 company 7 4 +58 company 8 23 +65 company 9 10 +68 company 10 12 +select count(*) from t2; +count(*) +1199 +select count(*) from t2 where fld1 < 098024; +count(*) +387 +select min(fld1) from t2 where fld1>= 098024; +min(fld1) +98024 +select max(fld1) from t2 where fld1>= 098024; +max(fld1) +1232609 +select count(*) from t3 where price2=76234234; +count(*) +4181 +select count(*) from t3 where companynr=512 and price2=76234234; +count(*) +4181 +explain select min(fld1),max(fld1),count(*) from t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL index NULL fld1 4 NULL 1199 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t2`.`fld1`) AS `min(fld1)`,max(`test`.`t2`.`fld1`) AS `max(fld1)`,count(0) AS `count(*)` from `test`.`t2` +explain format=tree select min(fld1),max(fld1),count(*) from t2; +EXPLAIN +-> Count rows in t2 + +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +explain format=tree select min(fld1),max(fld1),count(*) from t2 where rand() > 0.5; +EXPLAIN +-> Aggregate: min(`min(fld1)`), max(`max(fld1)`), count(`count(*)`) + -> Parallel scan on + -> Aggregate: + -> Filter: (rand() > 0.5) (cost=123.65 rows=1199) + -> PQblock scan on t2 using fld1 (cost=123.65 rows=1199) + +select min(fld1),max(fld1),count(*) from t2; +min(fld1) max(fld1) count(*) +0 1232609 1199 +select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; +min(t2nr) max(t2nr) +2115 2115 +select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; +count(*) min(t2nr) max(t2nr) +4181 4 41804 +select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; +t2nr count(*) +9 1 +19 1 +29 1 +39 1 +49 1 +59 1 +69 1 +79 1 +89 1 +99 1 +109 1 +119 1 +129 1 +139 1 +149 1 +159 1 +169 1 +179 1 +189 1 +199 1 +select max(t2nr) from t3 where price=983543950; +max(t2nr) +41807 +select t1.period from t3 t1 limit 1; +period +1001 +select t1.period from t1 as t1 limit 1; +period +9410 +select t1.period as "Nuvarande period" from t1 as t1 limit 1; +Nuvarande period +9410 +select period as ok_period from t1 limit 1; +ok_period +9410 +select period as ok_period from t1 group by ok_period limit 1; +ok_period +9410 +select 1+1 as summa from t1 group by summa limit 1; +summa +2 +select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1; +Nuvarande period +9410 +show tables; +Tables_in_test +t1 +t2 +t3 +t4 +show tables from test like "s%"; +Tables_in_test (s%) +show tables from test like "t?"; +Tables_in_test (t?) +show full columns from t2; +Field Type Collation Null Key Default Extra Privileges Comment +auto int NULL NO PRI NULL auto_increment select,insert,update,references +fld1 int(6) unsigned zerofill NULL NO UNI 000000 select,insert,update,references +companynr tinyint(2) unsigned zerofill NULL NO 00 select,insert,update,references +fld3 char(30) utf8mb4_0900_ai_ci NO MUL select,insert,update,references +fld4 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld5 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld6 char(4) utf8mb4_0900_ai_ci NO select,insert,update,references +show full columns from t2 from test like 'f%'; +Field Type Collation Null Key Default Extra Privileges Comment +fld1 int(6) unsigned zerofill NULL NO UNI 000000 select,insert,update,references +fld3 char(30) utf8mb4_0900_ai_ci NO MUL select,insert,update,references +fld4 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld5 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld6 char(4) utf8mb4_0900_ai_ci NO select,insert,update,references +show full columns from t2 from test like 's%'; +Field Type Collation Null Key Default Extra Privileges Comment +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +show keys from t2; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Visible Expression +t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE YES NULL +t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE YES NULL +t2 1 fld3 1 fld3 A 1171 NULL NULL BTREE YES NULL +drop table t4, t3, t2, t1; +DO 1; +DO benchmark(100,1+1),1,1; +do default; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +do foobar; +ERROR 42S22: Unknown column 'foobar' in 'field list' +CREATE TABLE t1 ( +id mediumint(8) unsigned NOT NULL auto_increment, +pseudo varchar(35) NOT NULL default '', +PRIMARY KEY (id), +UNIQUE KEY pseudo (pseudo) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 (pseudo) VALUES ('test'); +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 1 as rnd1 from t1 where rand() > 2; +rnd1 +DROP TABLE t1; +CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1287 'BINARY as attribute of a type' is deprecated and will be removed in a future release. Please use a CHARACTER SET clause with _bin collation instead +INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); +CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +ERROR HY000: Incorrect DATETIME value: 'wrong-date-value' +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +DROP TABLE t1,t2; +create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); +select wss_type from t1 where wss_type ='102935229216544106'; +wss_type +select wss_type from t1 where wss_type ='102935229216544105'; +wss_type +select wss_type from t1 where wss_type ='102935229216544104'; +wss_type +select wss_type from t1 where wss_type ='102935229216544093'; +wss_type +102935229216544093 +select wss_type from t1 where wss_type =102935229216544093; +wss_type +102935229216544093 +drop table t1; +select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; +select @a; +@a +3 +select @b; +@b +aaaa +select @c; +@c +6.260 +create table t1 (a int not null auto_increment primary key); +insert into t1 values (); +insert into t1 values (); +insert into t1 values (); +select * from (t1 as t2 left join t1 as t3 using (a)), t1; +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from t1, (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); +a +1 +2 +3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +1 NULL +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); +a +1 +2 +3 +select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; +a +1 +2 +3 +select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +NULL 1 +select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); +a +1 +2 +3 +select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; +a +1 +2 +3 +select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; +a +1 +2 +3 +drop table t1; +CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); +CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); +select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; +aa id t2_id id +2 8299 2517 2517 +3 8301 2518 2518 +4 8302 2519 2519 +5 8303 2520 2520 +6 8304 2521 2521 +drop table t1,t2; +create table t1 (id1 int NOT NULL); +create table t2 (id2 int NOT NULL); +create table t3 (id3 int NOT NULL); +create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); +insert into t1 values (1); +insert into t1 values (2); +insert into t2 values (1); +insert into t4 values (1,1); +explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t4 NULL ALL id4 NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`id1` AS `id1`,`test`.`t2`.`id2` AS `id2`,`test`.`t3`.`id3` AS `id3`,`test`.`t4`.`id4` AS `id4`,`test`.`t4`.`id44` AS `id44` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`id2` = `test`.`t1`.`id1`)) left join `test`.`t3` on((`test`.`t3`.`id3` = `test`.`t1`.`id1`)) left join `test`.`t4` on((`test`.`t4`.`id4` = `test`.`t3`.`id3`)) where ((`test`.`t2`.`id2` = 1) or (`test`.`t4`.`id4` = 1)) +select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id1 id2 id3 id4 id44 +1 1 NULL NULL NULL +drop table t1,t2,t3,t4; +create table t1(s varchar(10) not null); +create table t2(s varchar(10) not null primary key); +create table t3(s varchar(10) not null primary key); +insert into t1 values ('one\t'), ('two\t'); +insert into t2 values ('one\r'), ('two\t'); +insert into t3 values ('one\b'), ('two\t'); +select * from t1 where s = 'one'; +s +select * from t2 where s = 'one'; +s +select * from t3 where s = 'one'; +s +one +select * from t1,t2 where t1.s = t2.s; +s s +two two +select * from t2,t3 where t2.s = t3.s; +s s +two two +drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +explain select * from t1 left join t2 on a=c where d in (4); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref c,d d 5 const 2 100.00 Using where +2 SIMPLE t1 NULL ref a a 5 test.t2.c 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ 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`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = 4)) +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref c,d d 5 const 2 100.00 Using where +2 SIMPLE t1 NULL ref a a 5 test.t2.c 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ 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`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = 4)) +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; +CREATE TABLE t1 ( +i int(11) NOT NULL default '0', +c char(10) NOT NULL default '', +PRIMARY KEY (i), +UNIQUE KEY c (c) +) ; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (1,'a'); +INSERT INTO t1 VALUES (2,'b'); +INSERT INTO t1 VALUES (3,'c'); +EXPLAIN SELECT i FROM t1 WHERE i=1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '1' AS `i` from `test`.`t1` where true +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref a a 23 test.t1.a 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` USE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref a a 23 test.t1.a 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` FORCE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +DROP TABLE t1, t2; +CREATE TABLE t1 ( city char(30) ) charset utf8mb4; +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`city` AS `city` from `test`.`t1` where (`test`.`t1`.`city` = 'London') +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`city` AS `city` from `test`.`t1` where ((`test`.`t1`.`city` = 'London') and (`test`.`t1`.`city` like '%london%')) +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,0), (1,1), (4294967295,1); +select a-b from t1 order by 1; +a-b +0 +1 +4294967294 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +4294967294 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +4294967294 +drop table t1; +create table t1 (a int(11)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +kunde_intern_id int(10) unsigned NOT NULL default '0', +kunde_id int(10) unsigned NOT NULL default '0', +FK_firma_id int(10) unsigned NOT NULL default '0', +aktuell enum('Ja','Nein') NOT NULL default 'Ja', +vorname varchar(128) NOT NULL default '', +nachname varchar(128) NOT NULL default '', +geloescht enum('Ja','Nein') NOT NULL default 'Nein', +firma varchar(128) NOT NULL default '' +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), +(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 +WHERE +( +( +( '' != '' AND firma LIKE CONCAT('%', '', '%')) +OR +(vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND +'Vorname1' != '' AND 'xxxx' != '') +) +AND +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, +geloescht FROM t1 +WHERE +( +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +AND +( +( '' != '' AND firma LIKE CONCAT('%', '', '%') ) +OR +( vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND +'xxxx' != '') +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT COUNT(*) FROM t1 WHERE +( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) +AND FK_firma_id = 2; +COUNT(*) +0 +drop table t1; +CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (0x8000000000000000); +SELECT b FROM t1 WHERE b=0x8000000000000000; +b +9223372036854775808 +DROP TABLE t1; +CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `t2` VALUES (0,'READ'); +CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `t3` VALUES (1,'fs'); +select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); +id name gid uid ident level +1 fs NULL NULL 0 READ +drop table t1,t2,t3; +CREATE TABLE t1 ( +acct_id int(11) NOT NULL default '0', +profile_id smallint(6) default NULL, +UNIQUE KEY t1$acct_id (acct_id), +KEY t1$profile_id (profile_id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (132,17),(133,18); +CREATE TABLE t2 ( +profile_id smallint(6) default NULL, +queue_id int(11) default NULL, +seq int(11) default NULL, +KEY t2$queue_id (queue_id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); +CREATE TABLE t3 ( +id int(11) NOT NULL default '0', +qtype int(11) default NULL, +seq int(11) default NULL, +warn_lvl int(11) default NULL, +crit_lvl int(11) default NULL, +rr1 tinyint(4) NOT NULL default '0', +rr2 int(11) default NULL, +default_queue tinyint(4) NOT NULL default '0', +KEY t3$qtype (qtype), +KEY t3$id (id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), +(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); +SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q +WHERE +(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND +(pq.queue_id = q.id) AND (q.rr1 <> 1); +COUNT(*) +4 +drop table t1,t2,t3; +create table t1 (f1 int); +insert into t1 values (1),(NULL); +create table t2 (f2 int, f3 int, f4 int); +create index idx1 on t2 (f4); +insert into t2 values (1,2,3),(2,4,6); +select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) +from t2 C where A.f4 = C.f4) or A.f3 IS NULL; +f2 +1 +NULL +drop table t1,t2; +create table t2 (a tinyint unsigned); +create index t2i on t2(a); +insert into t2 values (0), (254), (255); +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +explain select * from t2 where a > -1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index t2i t2i 2 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a` is not null) +select * from t2 where a > -1; +a +0 +254 +255 +drop table t2; +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +SELECT * FROM t1; +a b c +50 3 3 +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +select found_rows(); +found_rows() +0 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +SELECT * FROM t1; +a b c +50 3 3 +select count(*) from t1; +count(*) +1 +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +select count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; +count(*) +Warnings: +Warning 1287 SQL_CALC_FOUND_ROWS is deprecated and will be removed in a future release. Consider using two separate queries instead. +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +(SELECT a, b AS c FROM t1) ORDER BY c+1; +a c +(SELECT a, b AS c FROM t1) ORDER BY b+1; +a c +SELECT a, b AS c FROM t1 ORDER BY c+1; +a c +SELECT a, b AS c FROM t1 ORDER BY b+1; +a c +drop table t1; +create table t1(f1 int, f2 int); +create table t2(f3 int); +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); +f1 +insert into t1 values(1,1),(2,null); +insert into t2 values(2); +select * from t1,t2 where f1=f3 and (f1,f2) = (2,null); +f1 f2 f3 +select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null); +f1 f2 f3 +2 NULL 2 +drop table t1,t2; +create table t1 (f1 int not null auto_increment primary key, f2 varchar(10)); +create table t11 like t1; +insert into t1 values(1,""),(2,""); +analyze table t1, t11; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t11 analyze status OK +show table status like 't1%'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 InnoDB 10 Dynamic 2 8192 X X X X X X X X X NULL +t11 InnoDB 10 Dynamic 0 0 X X X X X X X X X NULL +select 123 as a from t1 where f1 is null; +a +drop table t1,t11; +CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); +INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); +CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, e INT ); +INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2),(1,2,3); +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 10 2 +1 11 2 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c; +a b c d +1 10 4 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c; +a b c d +1 10 2 +1 11 2 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2,t1 +WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 2 1 1 +1 2 2 1 +1 2 3 1 +DROP TABLE IF EXISTS t1, t2; +create table t1 (f1 int primary key, f2 int); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t1 values (1,1); +insert into t2 values (1,1),(1,2); +select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1; +count(f2) >0 +1 +drop table t1,t2; +create table t1 (f1 int,f2 int); +insert into t1 values(1,1); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t2 values(1,1); +select * from t1 where f1 in (select f3 from t2 where (f3,f4)= (select f3,f4 from t2)); +f1 f2 +1 1 +drop table t1,t2; +CREATE TABLE t1(a int, b int, c int, KEY b(b), KEY c(c)); +insert into t1 values (1,0,0),(2,0,0); +CREATE TABLE t2 (a int, b varchar(2), c varchar(2), PRIMARY KEY(a)); +insert into t2 values (1,'',''), (2,'',''); +CREATE TABLE t3 (a int, b int, PRIMARY KEY (a,b), KEY a (a), KEY b (b)); +insert into t3 values (1,1),(1,2); +explain select straight_join DISTINCT t2.a,t2.b, t1.c from t1, t3, t2 +where (t1.c=t2.a or (t1.c=t3.a and t2.a=t3.b)) and t1.b=556476786 and +t2.b like '%%' order by t2.b limit 0,1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ref b,c b 5 const 1 100.00 Using temporary; Using filesort +1 SIMPLE t3 NULL index PRIMARY,a,b a 4 NULL 2 100.00 Using index; Using join buffer (hash join) +1 SIMPLE t2 NULL ALL PRIMARY NULL NULL NULL 2 50.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select straight_join distinct `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t1`.`b` = 556476786) and ((`test`.`t2`.`a` = `test`.`t1`.`c`) or ((`test`.`t2`.`a` = `test`.`t3`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`c`))) and (`test`.`t2`.`b` like '%%')) order by `test`.`t2`.`b` limit 0,1 +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (a int, INDEX idx(a)); +INSERT INTO t1 VALUES (2), (3), (1); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 IGNORE INDEX (idx); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` IGNORE INDEX (`idx`) +EXPLAIN SELECT * FROM t1 IGNORE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +EXPLAIN SELECT * FROM t1 FORCE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +DROP TABLE t1; +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 VALUES (1,1), (2,1), (4,10); +CREATE TABLE t2 (a int PRIMARY KEY, b int, KEY b (b)); +INSERT INTO t2 VALUES (1,NULL), (2,10); +ALTER TABLE t1 ENABLE KEYS; +Warnings: +Note 1031 Table storage engine for 't1' doesn't have this option +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index b b 5 NULL 2 100.00 Using index +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select straight_join count(0) AS `COUNT(*)` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) or (`test`.`t2`.`b` is null)) +SELECT STRAIGHT_JOIN * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +a b a b +1 NULL 1 1 +1 NULL 2 1 +1 NULL 4 10 +2 10 4 10 +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index b b 5 NULL 2 100.00 Using index +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select straight_join count(0) AS `COUNT(*)` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) or (`test`.`t2`.`b` is null)) +SELECT STRAIGHT_JOIN * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +a b a b +1 NULL 1 1 +1 NULL 2 1 +1 NULL 4 10 +2 10 4 10 +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (key1 double default NULL, UNIQUE KEY key1 (key1)); +CREATE TABLE t2 (key2 double default NULL, UNIQUE KEY key2 (key2)); +INSERT INTO t1 VALUES (0.3762),(0.3845),(0.6158),(0.7941); +INSERT INTO t2 VALUES (1.3762),(1.3845),(1.6158),(1.7941); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +explain select max(key1) from t1 where key1 <= 0.6158; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)` from `test`.`t1` where (`test`.`t1`.`key1` <= 0.6158) +explain select max(key2) from t2 where key2 <= 1.6158; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t2`.`key2`) AS `max(key2)` from `test`.`t2` where (`test`.`t2`.`key2` <= 1.6158) +explain select min(key1) from t1 where key1 >= 0.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where (`test`.`t1`.`key1` >= 0.3762) +explain select min(key2) from t2 where key2 >= 1.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t2`.`key2`) AS `min(key2)` from `test`.`t2` where (`test`.`t2`.`key2` >= 1.3762) +explain select max(key1), min(key2) from t1, t2 +where key1 <= 0.6158 and key2 >= 1.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)`,min(`test`.`t2`.`key2`) AS `min(key2)` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`key1` <= 0.6158) and (`test`.`t2`.`key2` >= 1.3762)) +explain select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range key1 key1 9 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` <= 0.6158) and ((rand() + 0.5) >= 0.5)) +explain select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index key1 key1 9 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` >= 0.3762) and ((rand() + 0.5) >= 0.5)) +select max(key1) from t1 where key1 <= 0.6158; +max(key1) +0.6158 +select max(key2) from t2 where key2 <= 1.6158; +max(key2) +1.6158 +select min(key1) from t1 where key1 >= 0.3762; +min(key1) +0.3762 +select min(key2) from t2 where key2 >= 1.3762; +min(key2) +1.3762 +select max(key1), min(key2) from t1, t2 +where key1 <= 0.6158 and key2 >= 1.3762; +max(key1) min(key2) +0.6158 1.3762 +select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; +max(key1) +0.6158 +select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; +min(key1) +0.3762 +DROP TABLE t1,t2; +CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL); +INSERT INTO t1 VALUES (10); +SELECT i='1e+01',i=1e+01, i in (1e+01,1e+01), i in ('1e+01','1e+01') FROM t1; +i='1e+01' i=1e+01 i in (1e+01,1e+01) i in ('1e+01','1e+01') +1 1 1 1 +DROP TABLE t1; +create table t1(a bigint unsigned, b bigint); +insert ignore into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff), +(0x10000000000000000, 0x10000000000000000), +(0x8fffffffffffffff, 0x8fffffffffffffff); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'a' at row 2 +Warning 1264 Out of range value for column 'b' at row 2 +Warning 1264 Out of range value for column 'b' at row 3 +select hex(a), hex(b) from t1; +hex(a) hex(b) +FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +8FFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +drop table t1; +CREATE TABLE t1 (c0 int); +CREATE TABLE t2 (c0 int); +INSERT INTO t1 VALUES(@@connect_timeout); +INSERT INTO t2 VALUES(@@connect_timeout); +SELECT * FROM t1 JOIN t2 ON t1.c0 = t2.c0 WHERE (t1.c0 <=> @@connect_timeout); +c0 c0 +X X +DROP TABLE t1, t2; +End of 4.1 tests +CREATE TABLE t1 ( +K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', +K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', +F2I4 int(11) NOT NULL default '0' +) DEFAULT CHARSET=latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +('W%RT', '0100', 1), +('W-RT', '0100', 1), +('WART', '0100', 1), +('WART', '0200', 1), +('WERT', '0100', 2), +('WORT','0200', 2), +('WT', '0100', 2), +('W_RT', '0100', 2), +('WaRT', '0100', 3), +('WART', '0300', 3), +('WRT' , '0400', 3), +('WURM', '0500', 3), +('W%T', '0600', 4), +('WA%T', '0700', 4), +('WA_T', '0800', 4); +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND +(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); +K2C4 K4N4 F2I4 +WART 0200 1 +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); +K2C4 K4N4 F2I4 +WART 0100 1 +WART 0200 1 +WART 0300 3 +DROP TABLE t1; +create table t1 (a int, b int); +create table t2 like t1; +select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; +a +select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; +a +select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; +a a a +drop table t1,t2; +create table t1 (s1 varchar(5)); +insert into t1 values ('Wall'); +select min(s1) from t1 group by s1 with rollup; +min(s1) +Wall +Wall +drop table t1; +create table t1 (s1 int); +insert into t1 values (0); +select avg(distinct s1) from t1 group by s1 with rollup; +avg(distinct s1) +0.0000 +0.0000 +drop table t1; +create table t1 (s1 int); +insert into t1 values (null),(1); +select avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +1.0000 +select distinct avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +drop table t1; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +INSERT INTO t2 VALUES (2), (4), (6); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +a +2 +4 +EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 3 33.33 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` straight_join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`a`) +EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 20.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`) +DROP TABLE t1,t2; +select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; +x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 +16 16 2 2 +create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); +insert into t1 values (" 2", 2); +insert into t2 values (" 2", " one "),(" 2", " two "); +select * from t1 left join t2 on f1 = f3; +f1 f2 f3 f4 + 2 2 2 one + 2 2 2 two +drop table t1,t2; +create table t1 (empnum smallint, grp int); +create table t2 (empnum int, name char(5)); +insert into t1 values(1,1); +insert into t2 values(1,'bob'); +create view v1 as select * from t2 inner join t1 using (empnum); +select * from v1; +empnum name grp +1 bob 1 +drop table t1,t2; +drop view v1; +create table t1 (pk int primary key, b int); +create table t2 (pk int primary key, c int); +select pk from t1 inner join t2 using (pk); +pk +drop table t1,t2; +create table t1 (s1 int, s2 char(5), s3 decimal(10)); +create view v1 as select s1, s2, 'x' as s3 from t1; +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'x' +insert into t1 values (1,'x',5); +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'x' +drop table t1; +drop view v1; +create table t1(a1 int); +create table t2(a2 int); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +create view v2 (c) as select a1 from t1; +select * from t1 natural left join t2; +a1 a2 +1 1 +1 2 +2 1 +2 2 +select * from t1 natural right join t2; +a2 a1 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural left join t2; +c a2 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural right join t2; +a2 c +1 1 +1 2 +2 1 +2 2 +drop table t1, t2; +drop view v2; +create table t1 (a int(10), t1_val int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (b int(10), t2_val int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t3 (a int(10), b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,1),(2,2); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(2,1),(3,1),(4,1); +select * from t1 natural join t2 natural join t3; +a b t1_val t2_val +1 1 1 1 +2 1 2 1 +select * from t1 natural join t3 natural join t2; +b a t1_val t2_val +1 1 1 1 +1 2 2 1 +drop table t1, t2, t3; +DO IFNULL(NULL, NULL); +SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); +CAST(IFNULL(NULL, NULL) AS DECIMAL) +NULL +SELECT ABS(IFNULL(NULL, NULL)); +ABS(IFNULL(NULL, NULL)) +NULL +SELECT IFNULL(NULL, NULL); +IFNULL(NULL, NULL) +NULL +SET @OLD_SQL_MODE12595=@@SQL_MODE, @@SQL_MODE=''; +SHOW LOCAL VARIABLES LIKE 'SQL_MODE'; +Variable_name Value +sql_mode +CREATE TABLE BUG_12595(a varchar(100)) charset latin1; +INSERT INTO BUG_12595 VALUES ('hakan%'), ('hakank'), ("ha%an"); +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE ''; +a +hakan% +hakank +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE ''; +a +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha%%an' ESCAPE '%'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE '\\'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|'; +a +ha%an +SET @@SQL_MODE='NO_BACKSLASH_ESCAPES'; +SHOW LOCAL VARIABLES LIKE 'SQL_MODE'; +Variable_name Value +sql_mode NO_BACKSLASH_ESCAPES +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%'; +a +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE '\\'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE ''; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\n%' ESCAPE '\n'; +ERROR HY000: Incorrect arguments to ESCAPE +SET @@SQL_MODE=@OLD_SQL_MODE12595; +DROP TABLE BUG_12595; +create table t1 (a char(1)); +create table t2 (a char(1)); +insert into t1 values ('a'),('b'),('c'); +insert into t2 values ('b'),('c'),('d'); +select a from t1 natural join t2; +a +b +c +select * from t1 natural join t2 where a = 'b'; +a +b +drop table t1, t2; +CREATE TABLE t1 (`id` TINYINT); +CREATE TABLE t2 (`id` TINYINT); +CREATE TABLE t3 (`id` TINYINT); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +drop table t1, t2, t3; +create table t1 (a int(10),b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (a int(10),b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,10),(2,20),(3,30); +insert into t2 values (1,10); +select * from t1 inner join t2 using (A); +a b b +1 10 10 +select * from t1 inner join t2 using (a); +a b b +1 10 10 +drop table t1, t2; +create table t1 (a int, c int); +create table t2 (b int); +create table t3 (b int, a int); +create table t4 (c int); +insert into t1 values (1,1); +insert into t2 values (1); +insert into t3 values (1,1); +insert into t4 values (1); +select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +a c b b a +1 1 1 1 1 +select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +ERROR 42S22: Unknown column 't1.a' in 'on clause' +select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); +a c b b a c +1 1 1 1 1 1 +select * from t1 join t2 join t4 using (c); +c a b +1 1 1 +drop table t1, t2, t3, t4; +create table t1(x int, y int); +create table t2(x int, y int); +create table t3(x int, primary key(x)); +insert into t1 values (1, 1), (2, 1), (3, 1), (4, 3), (5, 6), (6, 6); +insert into t2 values (1, 1), (2, 1), (3, 3), (4, 6), (5, 6); +insert into t3 values (1), (2), (3), (4), (5); +select t1.x, t3.x from t1, t2, t3 where t1.x = t2.x and t3.x >= t1.y and t3.x <= t2.y; +x x +1 1 +2 1 +3 1 +3 2 +3 3 +4 3 +4 4 +4 5 +drop table t1,t2,t3; +create table t1 (id char(16) not null default '', primary key (id)); +insert into t1 values ('100'),('101'),('102'); +create table t2 (id char(16) default null); +insert into t2 values (1); +create view v1 as select t1.id from t1; +create view v2 as select t2.id from t2; +create view v3 as select (t1.id+2) as id from t1 natural left join t2; +select t1.id from t1 left join v2 using (id); +id +100 +101 +102 +select t1.id from v2 right join t1 using (id); +id +100 +101 +102 +select t1.id from t1 left join v3 using (id); +id +100 +101 +102 +select * from t1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join t1 using (id); +id +100 +101 +102 +select * from t1 left join v3 using (id); +id +100 +101 +102 +select v1.id from v1 left join v2 using (id); +id +100 +101 +102 +select v1.id from v2 right join v1 using (id); +id +100 +101 +102 +select v1.id from v1 left join v3 using (id); +id +100 +101 +102 +select * from v1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join v1 using (id); +id +100 +101 +102 +select * from v1 left join v3 using (id); +id +100 +101 +102 +drop table t1, t2; +drop view v1, v2, v3; +create table t1 (id int(11) not null default '0'); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (123),(191),(192); +create table t2 (id char(16) character set utf8 not null); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t2 values ('58013'),('58014'),('58015'),('58016'); +create table t3 (a_id int(11) not null, b_id char(16) character set utf8); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t3 values (123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013'); +select count(*) +from t1 inner join (t3 left join t2 on t2.id = t3.b_id) on t1.id = t3.a_id; +count(*) +6 +select count(*) +from t1 inner join (t2 right join t3 on t2.id = t3.b_id) on t1.id = t3.a_id; +count(*) +6 +drop table t1,t2,t3; +create table t1 (a int); +create table t2 (b int); +create table t3 (c int); +select * from t1 join t2 join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 left join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 right join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 straight_join t3 on (t1.a=t3.c); +a b c +drop table t1, t2 ,t3; +create table t1(f1 int, f2 date); +insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'), +(4,'2005-10-01'),(5,'2005-12-30'); +select * from t1 where f2 >= 0 order by f2; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +select * from t1 where f2 >= '0000-00-00' order by f2; +ERROR HY000: Incorrect DATE value: '0000-00-00' +select * from t1 where f2 >= '2005-09-31' order by f2; +ERROR HY000: Incorrect DATE value: '2005-09-31' +select * from t1 where f2 >= '2005-09-3a' order by f2; +f1 f2 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +select * from t1 where f2 <= '2005-09-31' order by f2; +ERROR HY000: Incorrect DATE value: '2005-09-31' +select * from t1 where f2 <= '2005-09-3a' order by f2; +f1 f2 +1 2005-01-01 +2 2005-09-01 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +drop table t1; +create table t1 (f1 int, f2 int); +insert into t1 values (1, 30), (2, 20), (3, 10); +create algorithm=merge view v1 as select f1, f2 from t1; +create algorithm=merge view v2 (f2, f1) as select f1, f2 from t1; +create algorithm=merge view v3 as select t1.f1 as f2, t1.f2 as f1 from t1; +select t1.f1 as x1, f1 from t1 order by t1.f1; +x1 f1 +1 1 +2 2 +3 3 +select v1.f1 as x1, f1 from v1 order by v1.f1; +x1 f1 +1 1 +2 2 +3 3 +select v2.f1 as x1, f1 from v2 order by v2.f1; +x1 f1 +10 10 +20 20 +30 30 +select v3.f1 as x1, f1 from v3 order by v3.f1; +x1 f1 +10 10 +20 20 +30 30 +select f1, f2, v1.f1 as x1 from v1 order by v1.f1; +f1 f2 x1 +1 30 1 +2 20 2 +3 10 3 +select f1, f2, v2.f1 as x1 from v2 order by v2.f1; +f1 f2 x1 +10 3 10 +20 2 20 +30 1 30 +select f1, f2, v3.f1 as x1 from v3 order by v3.f1; +f1 f2 x1 +10 3 10 +20 2 20 +30 1 30 +drop table t1; +drop view v1, v2, v3; +CREATE TABLE t1(key_a int4 NOT NULL, optimus varchar(32), PRIMARY KEY(key_a)); +CREATE TABLE t2(key_a int4 NOT NULL, prime varchar(32), PRIMARY KEY(key_a)); +CREATE table t3(key_a int4 NOT NULL, key_b int4 NOT NULL, foo varchar(32), +PRIMARY KEY(key_a,key_b)); +INSERT INTO t1 VALUES (0,''); +INSERT INTO t1 VALUES (1,'i'); +INSERT INTO t1 VALUES (2,'j'); +INSERT INTO t1 VALUES (3,'k'); +INSERT INTO t2 VALUES (1,'r'); +INSERT INTO t2 VALUES (2,'s'); +INSERT INTO t2 VALUES (3,'t'); +INSERT INTO t3 VALUES (1,5,'x'); +INSERT INTO t3 VALUES (1,6,'y'); +INSERT INTO t3 VALUES (2,5,'xx'); +INSERT INTO t3 VALUES (2,6,'yy'); +INSERT INTO t3 VALUES (2,7,'zz'); +INSERT INTO t3 VALUES (3,5,'xxx'); +SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +key_a foo +2 xx +EXPLAIN SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t3 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `key_a`,'xx' AS `foo` from `test`.`t1` join `test`.`t2` join `test`.`t3` where true +SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +key_a foo +2 xx +EXPLAIN SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t3 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `key_a`,'xx' AS `foo` from `test`.`t1` join `test`.`t2` join `test`.`t3` where true +DROP TABLE t1,t2,t3; +create table t1 (f1 int); +insert into t1 values(1),(2); +create table t2 (f2 int, f3 int, key(f2)); +insert into t2 values(1,1),(2,2); +create table t3 (f4 int not null); +insert into t3 values (2),(2),(2); +select f1,(select count(*) from t2,t3 where f2=f1 and f3=f4) as count from t1; +f1 count +1 0 +2 3 +drop table t1,t2,t3; +create table t1 (f1 int unique); +create table t2 (f2 int unique); +create table t3 (f3 int unique); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +insert into t3 values(1),(NULL); +select * from t3 where f3 is null; +f3 +NULL +select t2.f2 from t1 left join t2 on f1=f2 join t3 on f1=f3 where f1=1; +f2 +1 +drop table t1,t2,t3; +create table t1(f1 char, f2 char not null); +insert into t1 values(null,'a'); +create table t2 (f2 char not null); +insert into t2 values('b'); +select * from t1 left join t2 on f1=t2.f2 where t1.f2='a'; +f1 f2 f2 +NULL a NULL +drop table t1,t2; +select * from (select * left join t on f1=f2) tt; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left join t on f1=f2) tt' at line 1 +CREATE TABLE t1 (sku int PRIMARY KEY, pr int); +CREATE TABLE t2 (sku int PRIMARY KEY, sppr int, name varchar(255)); +INSERT INTO t1 VALUES +(10, 10), (20, 10), (30, 20), (40, 30), (50, 10), (60, 10); +INSERT INTO t2 VALUES +(10, 10, 'aaa'), (20, 10, 'bbb'), (30, 10, 'ccc'), (40, 20, 'ddd'), +(50, 10, 'eee'), (60, 20, 'fff'), (70, 20, 'ggg'), (80, 30, 'hhh'); +SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr +FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku); +sku sppr name sku pr +20 10 bbb 10 10 +20 10 bbb 20 10 +EXPLAIN +SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr +FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select '20' AS `sku`,'10' AS `sppr`,'bbb' AS `name`,`test`.`t1`.`sku` AS `sku`,`test`.`t1`.`pr` AS `pr` from `test`.`t2` join `test`.`t1` where (((`test`.`t1`.`sku` = 20) or (`test`.`t1`.`sku` = '10'))) +DROP TABLE t1,t2; +SET SQL_MODE='NO_UNSIGNED_SUBTRACTION'; +CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL); +INSERT t1 SET i = 0; +UPDATE t1 SET i = -1; +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +UPDATE t1 SET i = CAST(i - 1 AS SIGNED); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +UPDATE t1 SET i = i - 1; +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +DROP TABLE t1; +SET SQL_MODE=default; +create table t1 (a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t2 (a int, b int, c int, e int, primary key(a,b,c)); +# The "ANALYZE TABLE"-command that is executed further down will get +# different results depending on the order of rows in table t2. Since the +# INSERT INTO ... SELECT may be executed using different execution plans, +# we've added ORDER BY to ensure that we rows has the same order every +# time. If not, the estimated number of rows for t2 (alias 'a') in the +# EXPLAIN may change on different platforms. Note that both table t1 and +# t2 may be MYISAM, since many of the test files that includes this file +# forces MYISAM as the default storage engine. +insert into t2 select A.a, B.a, C.a, C.a from t1 A, t1 B, t1 C +ORDER BY A.a, B.a, C.a; +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select 'In next EXPLAIN, B.rows must be exactly 10:' Z; +Z +In next EXPLAIN, B.rows must be exactly 10: +explain select * from t2 a, t2 b where a.a=5 and a.b=5 and a.c<5 +and b.a=5 and b.b=a.e and (b.b =1 or b.b = 3 or b.b=5); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 27.10 Parallel execute (1 workers) +2 SIMPLE a NULL range PRIMARY PRIMARY 12 NULL 5 27.10 Using where +2 SIMPLE b NULL ref PRIMARY PRIMARY 8 const,test.a.e 10 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`b` AS `b`,`test`.`a`.`c` AS `c`,`test`.`a`.`e` AS `e`,`test`.`b`.`a` AS `a`,`test`.`b`.`b` AS `b`,`test`.`b`.`c` AS `c`,`test`.`b`.`e` AS `e` from `test`.`t2` `a` join `test`.`t2` `b` where ((`test`.`b`.`b` = `test`.`a`.`e`) and (`test`.`b`.`a` = 5) and (`test`.`a`.`b` = 5) and (`test`.`a`.`a` = 5) and (`test`.`a`.`c` < 5) and ((`test`.`a`.`e` = 1) or (`test`.`a`.`e` = 3) or (`test`.`a`.`e` = 5))) +drop table t1, t2; +CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX(b)); +INSERT INTO t1 VALUES (1, 3), (9,4), (7,5), (4,5), (6,2), +(3,1), (5,1), (8,9), (2,2), (0,9); +CREATE TABLE t2 (c int, d int, f int, INDEX(c,f)); +INSERT INTO t2 VALUES +(1,0,0), (1,0,1), (2,0,0), (2,0,1), (3,0,0), (4,0,1), +(5,0,0), (5,0,1), (6,0,0), (0,0,1), (7,0,0), (7,0,1), +(0,0,0), (0,0,1), (8,0,0), (8,0,1), (9,0,0), (9,0,1); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,b b 5 NULL 3 100.00 Using where; Using index +2 SIMPLE t2 NULL ref c c 5 test.t1.a 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2`.`f` AS `f` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` between 4 and 6)) +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6 AND a > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 90.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,b b 9 NULL 3 90.00 Using where; Using index +2 SIMPLE t2 NULL ref c c 5 test.t1.a 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2`.`f` AS `f` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` between 4 and 6) and (`test`.`t1`.`a` > 0)) +DROP TABLE t1, t2; +create table t1 ( +a int unsigned not null auto_increment primary key, +b bit not null, +c bit not null +); +create table t2 ( +a int unsigned not null auto_increment primary key, +b bit not null, +c int unsigned not null, +d varchar(50) +); +insert into t1 (b,c) values (0,1), (0,1); +insert into t2 (b,c) values (0,1); +select t1.a, t1.b + 0, t1.c + 0, t2.a, t2.b + 0, t2.c, t2.d +from t1 left outer join t2 on t1.a = t2.c and t2.b <> 1 +where t1.b <> 1 order by t1.a; +a t1.b + 0 t1.c + 0 a t2.b + 0 c d +1 0 1 1 0 1 NULL +2 0 1 NULL NULL NULL NULL +drop table t1,t2; +SELECT 0.9888889889 * 1.011111411911; +0.9888889889 * 1.011111411911 +0.9998769417899202067879 +prepare stmt from 'select 1 as " a "'; +Warnings: +Warning 1466 Leading spaces are removed from name ' a ' +execute stmt; +a +1 +CREATE TABLE t1 (a int NOT NULL PRIMARY KEY, b int NOT NULL); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +CREATE TABLE t2 (c int NOT NULL, INDEX idx(c)); +INSERT INTO t2 VALUES +(1), (1), (1), (1), (1), (1), (1), (1), +(2), (2), (2), (2), +(3), (3), +(4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL ref idx idx 4 const 8 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '1' AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = '1')) +EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=4; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL ref idx idx 4 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '4' AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = '4')) +DROP TABLE t1, t2; +CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a int); +INSERT INTO t1 VALUES (1,2), (2,NULL), (3,2); +CREATE TABLE t2 (b int, c INT, INDEX idx1(b)); +INSERT INTO t2 VALUES (2,1), (3,2); +CREATE TABLE t3 (d int, e int, INDEX idx1(d)); +INSERT INTO t3 VALUES (2,10), (2,20), (1,30), (2,40), (2,50); +EXPLAIN +SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id +WHERE t1.id=2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL const idx1 NULL NULL NULL 1 100.00 Impossible ON condition +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL const idx1 NULL NULL NULL 1 100.00 Impossible ON condition +2 SIMPLE t3 NULL ref idx1 idx1 5 const 4 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `id`,NULL AS `a`,NULL AS `b`,NULL AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t3`.`e` AS `e` from `test`.`t1` left join `test`.`t2` on(multiple equal(NULL, NULL)) join `test`.`t3` where (`test`.`t3`.`d` = 2) +SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id +WHERE t1.id=2; +id a b c d e +2 NULL NULL NULL 2 10 +2 NULL NULL NULL 2 20 +2 NULL NULL NULL 2 40 +2 NULL NULL NULL 2 50 +DROP TABLE t1,t2,t3; +create table t1 (c1 varchar(1), c2 int, c3 int, c4 int, c5 int, c6 int, +c7 int, c8 int, c9 int, fulltext key (`c1`)); +select distinct match (`c1`) against ('z') , c2, c3, c4,c5, c6,c7, c8 +from t1 where c9=1 order by c2, c2; +match (`c1`) against ('z') c2 c3 c4 c5 c6 c7 c8 +drop table t1; +CREATE TABLE t1 (pk varchar(10) PRIMARY KEY, fk varchar(16)) charset utf8mb4; +CREATE TABLE t2 (pk varchar(16) PRIMARY KEY, fk varchar(10)) charset utf8mb4; +INSERT INTO t1 VALUES +('d','dddd'), ('i','iii'), ('a','aa'), ('b','bb'), ('g','gg'), +('e','eee'), ('c','cccc'), ('h','hhh'), ('j','jjj'), ('f','fff'); +INSERT INTO t2 VALUES +('jjj', 'j'), ('cc','c'), ('ccc','c'), ('aaa', 'a'), ('jjjj','j'), +('hhh','h'), ('gg','g'), ('fff','f'), ('ee','e'), ('ffff','f'), +('bbb','b'), ('ff','f'), ('cccc','c'), ('dddd','d'), ('jj','j'), +('aaaa','a'), ('bb','b'), ('eeee','e'), ('aa','a'), ('hh','h'); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk < 'c' AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` < 'c')) +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk BETWEEN 'a' AND 'b' AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` between 'a' and 'b')) +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk IN ('a','b') AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` in ('a','b'))) +DROP TABLE t1,t2; +CREATE TABLE t1 (a int, b varchar(20) NOT NULL, PRIMARY KEY(a)) charset utf8mb4; +CREATE TABLE t2 (a int, b varchar(20) NOT NULL, +PRIMARY KEY (a), UNIQUE KEY (b)) charset utf8mb4; +INSERT INTO t1 VALUES (1,'a'),(2,'b'),(3,'c'); +INSERT INTO t2 VALUES (1,'a'),(2,'b'),(3,'c'); +EXPLAIN SELECT t1.a FROM t1 LEFT JOIN t2 ON t2.b=t1.b WHERE t1.a=3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL const b b 82 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '3' AS `a` from `test`.`t1` left join `test`.`t2` on(multiple equal('c', 'c')) where true +DROP TABLE t1,t2; +CREATE TABLE t1(id int PRIMARY KEY, b int, e int); +CREATE TABLE t2(i int, a int, INDEX si(i), INDEX ai(a)); +CREATE TABLE t3(a int PRIMARY KEY, c char(4), INDEX ci(c)); +INSERT INTO t1 VALUES +(1,10,19), (2,20,22), (4,41,42), (9,93,95), (7, 77,79), +(6,63,67), (5,55,58), (3,38,39), (8,81,89); +INSERT INTO t2 VALUES +(21,210), (41,410), (82,820), (83,830), (84,840), +(65,650), (51,510), (37,370), (94,940), (76,760), +(22,220), (33,330), (40,400), (95,950), (38,380), +(67,670), (88,880), (57,570), (96,960), (97,970); +INSERT INTO t3 VALUES +(210,'bb'), (950,'ii'), (400,'ab'), (500,'ee'), (220,'gg'), +(440,'gg'), (310,'eg'), (380,'ee'), (840,'bb'), (830,'ff'), +(230,'aa'), (960,'ii'), (410,'aa'), (510,'ee'), (290,'bb'), +(450,'gg'), (320,'dd'), (390,'hh'), (850,'jj'), (860,'ff'); +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 +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si si 5 NULL 4 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` FORCE INDEX (`si`) join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t2`.`i` between '81' and '89') and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2,t3 +WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee') ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si,ai si 5 NULL 4 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t2`.`i` between '81' and '89') and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND +t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si si 5 NULL 2 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` FORCE INDEX (`si`) join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((`test`.`t2`.`i` = '81') or (`test`.`t2`.`i` = '89')) and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2,t3 +WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND +t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si,ai si 5 NULL 2 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((`test`.`t2`.`i` = '81') or (`test`.`t2`.`i` = '89')) and (`test`.`t3`.`c` in ('bb','ee'))) +DROP TABLE t1,t2,t3; +CREATE TABLE t1 ( f1 int primary key, f2 int, f3 int, f4 int, f5 int, f6 int, checked_out int); +CREATE TABLE t2 ( f11 int PRIMARY KEY ); +INSERT INTO t1 VALUES (1,1,1,0,0,0,0),(2,1,1,3,8,1,0),(3,1,1,4,12,1,0); +INSERT INTO t2 VALUES (62); +SELECT * FROM t1 LEFT JOIN t2 ON f11 = t1.checked_out GROUP BY f1 ORDER BY f2, f3, f4, f5 LIMIT 0, 1; +f1 f2 f3 f4 f5 f6 checked_out f11 +1 1 1 0 0 0 0 NULL +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(a int); +INSERT into t1 values (1), (2), (3); +SELECT * FROM t1 LIMIT 2, -1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1 +DROP TABLE t1; +set optimizer_switch='index_merge=off'; +CREATE TABLE t1 ( +ID_with_null int NULL, +ID_better int NOT NULL, +INDEX idx1 (ID_with_null), +INDEX idx2 (ID_better) +); +INSERT INTO t1 VALUES (1,1), (2,1), (null,3), (null,3), (null,3), (null,3); +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SELECT COUNT(*) FROM t1 WHERE ID_with_null IS NULL; +COUNT(*) +128 +SELECT COUNT(*) FROM t1 WHERE ID_better=1; +COUNT(*) +2 +EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 98.46 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 98.46 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID_with_null` AS `ID_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID_with_null` is null)) +DROP INDEX idx1 ON t1; +CREATE UNIQUE INDEX idx1 ON t1(ID_with_null); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 98.46 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 98.46 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID_with_null` AS `ID_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID_with_null` is null)) +DROP TABLE t1; +CREATE TABLE t1 ( +ID1_with_null int NULL, +ID2_with_null int NULL, +ID_better int NOT NULL, +INDEX idx1 (ID1_with_null, ID2_with_null), +INDEX idx2 (ID_better) +) ; +INSERT INTO t1 VALUES (1,1,1), (2,2,1), (3,null,3), (null,3,3), (null,null,3), +(3,null,3), (null,3,3), (null,null,3), (3,null,3), (null,3,3), (null,null,3); +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null=3; +COUNT(*) +24 +SELECT COUNT(*) FROM t1 WHERE ID1_with_null=3 AND ID2_with_null IS NULL; +COUNT(*) +24 +SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null IS NULL; +COUNT(*) +192 +SELECT COUNT(*) FROM t1 WHERE ID_better=1; +COUNT(*) +2 +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID2_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID1_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and ((`test`.`t1`.`ID2_with_null` = 3) is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 79.34 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 79.34 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and (`test`.`t1`.`ID2_with_null` is null)) +DROP INDEX idx1 ON t1; +CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID2_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null IS NULL ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID1_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID2_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 79.34 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 79.34 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and (`test`.`t1`.`ID2_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND +(ID2_with_null=1 OR ID2_with_null=2); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 2.50 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 2.50 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and ((`test`.`t1`.`ID2_with_null` = 1) or (`test`.`t1`.`ID2_with_null` = 2))) +DROP TABLE t1; +set optimizer_switch='index_merge=on'; +CREATE TABLE t1 (a INT, ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY ts(ts)); +INSERT INTO t1 VALUES (30,"2006-01-03 23:00:00"), (31,"2006-01-03 23:00:00"); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CREATE TABLE t2 (a INT, dt1 DATETIME, dt2 DATETIME, PRIMARY KEY (a)); +INSERT INTO t2 VALUES (30, "2006-01-01 00:00:00", "2999-12-31 00:00:00"); +INSERT INTO t2 SELECT a+1,dt1,dt2 FROM t2; +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +EXPLAIN +SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 +AND t1.ts BETWEEN t2.dt1 AND t2.dt2 +AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t1 NULL range ts ts 4 NULL 2 50.00 Using index condition; Using where; Using MRR +Warnings: +Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`ts` AS `ts`,'30' AS `a`,'2006-01-01 00:00:00' AS `dt1`,'2999-12-31 00:00:00' AS `dt2` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = 30) and (`test`.`t1`.`ts` between '2006-01-01 00:00:00' and '2999-12-31 00:00:00') and (`test`.`t1`.`ts` between '2006-01-01' and '2006-12-31')) +SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 +AND t1.ts BETWEEN t2.dt1 AND t2.dt2 +AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; +a ts a dt1 dt2 +30 2006-01-03 23:00:00 30 2006-01-01 00:00:00 2999-12-31 00:00:00 +Warnings: +Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 +DROP TABLE t1,t2; +create table t1 (a bigint unsigned); +insert into t1 values +(if(1, 9223372036854775808, 1)), +(case when 1 then 9223372036854775808 else 1 end), +(coalesce(9223372036854775808, 1)); +select * from t1; +a +9223372036854775808 +9223372036854775808 +9223372036854775808 +drop table t1; +create table t1 charset utf8mb4 select +if(1, 9223372036854775808, 1) i, +case when 1 then 9223372036854775808 else 1 end c, +coalesce(9223372036854775808, 1) co; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` decimal(19,0) NOT NULL DEFAULT '0', + `c` decimal(19,0) NOT NULL DEFAULT '0', + `co` decimal(19,0) NOT NULL DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +select +if(1, cast(1111111111111111111 as unsigned), 1) i, +case when 1 then cast(1111111111111111111 as unsigned) else 1 end c, +coalesce(cast(1111111111111111111 as unsigned), 1) co; +i c co +1111111111111111111 1111111111111111111 1111111111111111111 +CREATE TABLE t1 (name varchar(255)) charset latin1; +CREATE TABLE t2 (name varchar(255), n int, KEY (name(3))) charset latin1; +INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); +INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); +INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); +INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT * FROM t2; +name n +bb 1 +aa 2 +cc 3 +cc  4 +cc 5 +bb 6 +cc 7 +SELECT * FROM t2 ORDER BY name; +name n +aa 2 +bb 1 +bb 6 +cc  4 +cc 3 +cc 5 +cc 7 +SELECT name, LENGTH(name), n FROM t2 ORDER BY name; +name LENGTH(name) n +aa 2 2 +bb 2 1 +bb 3 6 +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref name name 6 const 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` = 'cc ') +SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +name LENGTH(name) n +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +name LENGTH(name) n +cc 5 3 +cc  4 4 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') order by `test`.`t2`.`name` +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +name LENGTH(name) n +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +2 SIMPLE t2 NULL ref name name 6 test.t1.name 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`name` AS `name`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`n` AS `n` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`name` = `test`.`t1`.`name`)) where true +SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +name name n +aa aa 2 +aa aa 2 +bb bb 1 +bb bb 6 +cc cc 5 +cc cc 7 +cc cc 3 +ccc NULL NULL +DROP TABLE t1,t2; +CREATE TABLE t1 (name text) charset latin1; +CREATE TABLE t2 (name text, n int, KEY (name(3))) charset latin1; +INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); +INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); +INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); +INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT * FROM t2; +name n +bb 1 +aa 2 +cc 3 +cc  4 +cc 5 +bb 6 +cc 7 +SELECT * FROM t2 ORDER BY name; +name n +aa 2 +bb 1 +bb 6 +cc  4 +cc 3 +cc 5 +cc 7 +SELECT name, LENGTH(name), n FROM t2 ORDER BY name; +name LENGTH(name) n +aa 2 2 +bb 2 1 +bb 3 6 +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ref name name 6 const 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` = 'cc ') +SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +name LENGTH(name) n +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +name LENGTH(name) n +cc 5 3 +cc  4 4 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') order by `test`.`t2`.`name` +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +name LENGTH(name) n +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref name name 6 test.t1.name 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`name` AS `name`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`n` AS `n` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`name` = `test`.`t1`.`name`)) where true +SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +name name n +aa aa 2 +aa aa 2 +bb bb 1 +bb bb 6 +cc cc 5 +cc cc 7 +cc cc 3 +ccc NULL NULL +DROP TABLE t1,t2; +CREATE TABLE t1 ( +access_id int NOT NULL default '0', +name varchar(20) default NULL, +`rank` int NOT NULL default '0', +KEY idx (access_id) +); +CREATE TABLE t2 ( +faq_group_id int NOT NULL default '0', +faq_id int NOT NULL default '0', +access_id int default NULL, +UNIQUE KEY idx1 (faq_id), +KEY idx2 (faq_group_id,faq_id) +); +INSERT INTO t1 VALUES +(1,'Everyone',2),(2,'Help',3),(3,'Technical Support',1),(4,'Chat User',4); +INSERT INTO t2 VALUES +(261,265,1),(490,494,1); +SELECT t2.faq_id +FROM t1 INNER JOIN t2 IGNORE INDEX (idx1) +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +SELECT t2.faq_id +FROM t1 INNER JOIN t2 +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +DROP TABLE t1,t2; +CREATE TABLE t1 (a INT, b INT, KEY inx (b,a)); +INSERT INTO t1 VALUES (1,1), (1,2), (1,3), (1,4), (1,5), (1, 6), (1,7); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT COUNT(*) FROM t1 f1 INNER JOIN t1 f2 +ON ( f1.b=f2.b AND f1.a NULL ALL NULL NULL NULL NULL 7 100.00 Parallel execute (1 workers) +2 SIMPLE f1 NULL index inx inx 10 NULL 7 100.00 Using where; Using index +2 SIMPLE f2 NULL ref inx inx 5 test.f1.b 1 33.33 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` `f1` join `test`.`t1` `f2` where ((`test`.`f2`.`b` = `test`.`f1`.`b`) and (`test`.`f1`.`b` not in (100,2232,3343,51111)) and (`test`.`f1`.`a` < `test`.`f2`.`a`)) +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 INT); +INSERT INTO t1 VALUES (1,11), (2,22), (2,22); +EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2)))))))))))))))))))))))))))))) > 0; +EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) > 0; +ERROR HY000: Too high level of nesting for select +DROP TABLE t1; +CREATE TABLE t1 ( +c1 int(11) NOT NULL AUTO_INCREMENT, +c2 varchar(1000) DEFAULT NULL, +c3 bigint(20) DEFAULT NULL, +c4 bigint(20) DEFAULT NULL, +PRIMARY KEY (c1) +) charset utf8mb4; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN +SELECT join_2.c1 +FROM +t1 AS join_0, +t1 AS join_1, +t1 AS join_2, +t1 AS join_3, +t1 AS join_4, +t1 AS join_5, +t1 AS join_6, +t1 AS join_7 +WHERE +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +OR +join_0.c2 < '?' AND +join_1.c2 < '?' AND +join_2.c2 > '?' AND +join_2.c2 < '!' AND +join_3.c2 > '?' AND +join_4.c2 = '?' AND +join_5.c2 <> '?' AND +join_6.c2 <> '?' AND +join_7.c2 >= '?' AND +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +GROUP BY +join_3.c1, +join_2.c1, +join_7.c1, +join_1.c1, +join_0.c1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL # 1 100.00 # +2 SIMPLE join_0 NULL ALL PRIMARY NULL NULL # 1 100.00 # +2 SIMPLE join_1 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_2 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_3 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_4 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_5 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_6 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_7 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +Warnings: +Note 1003 /* select#1 */ select `test`.`join_2`.`c1` AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where (((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`)) or ((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c2` = '?') and (`test`.`join_0`.`c2` < '?') and (`test`.`join_1`.`c2` < '?') and (`test`.`join_2`.`c2` > '?') and (`test`.`join_2`.`c2` < '!') and (`test`.`join_3`.`c2` > '?') and (`test`.`join_5`.`c2` <> '?') and (`test`.`join_6`.`c2` <> '?') and (`test`.`join_7`.`c2` >= '?'))) group by `test`.`join_3`.`c1`,`test`.`join_2`.`c1`,`test`.`join_7`.`c1`,`test`.`join_1`.`c1`,`test`.`join_0`.`c1` +SHOW WARNINGS; +Level Code Message +Note 1003 /* select#1 */ select `test`.`join_2`.`c1` AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where (((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`)) or ((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c2` = '?') and (`test`.`join_0`.`c2` < '?') and (`test`.`join_1`.`c2` < '?') and (`test`.`join_2`.`c2` > '?') and (`test`.`join_2`.`c2` < '!') and (`test`.`join_3`.`c2` > '?') and (`test`.`join_5`.`c2` <> '?') and (`test`.`join_6`.`c2` <> '?') and (`test`.`join_7`.`c2` >= '?'))) group by `test`.`join_3`.`c1`,`test`.`join_2`.`c1`,`test`.`join_7`.`c1`,`test`.`join_1`.`c1`,`test`.`join_0`.`c1` +DROP TABLE t1; +SELECT 1 AS ` `; + +1 +Warnings: +Warning 1474 Name ' ' has become '' +SELECT 1 AS ` `; + +1 +Warnings: +Warning 1474 Name ' ' has become '' +SELECT 1 AS ` x`; +x +1 +Warnings: +Warning 1466 Leading spaces are removed from name ' x' +CREATE VIEW v1 AS SELECT 1 AS ``; +ERROR 42000: Incorrect column name '' +CREATE VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT (SELECT 1 AS ` `); +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` x`; +Warnings: +Warning 1466 Leading spaces are removed from name ' x' +SELECT `x` FROM v1; +x +1 +ALTER VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +DROP VIEW v1; +select str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' + and '2007/10/20 00:00:00 GMT'; +str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' + and '2007/10/20 00:00:00 GMT' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT' +Warning 1292 Truncated incorrect date value: '2007/10/20 00:00:00 GMT' +select str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6'; +str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT-6' +select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6'; +ERROR HY000: Incorrect DATE value: '2007/10/2000:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007-10-1 00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007-10-01 x00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:x00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 x12:34:56 GMT-6' +select str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; +str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6' +select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; +str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' +0 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6' +select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56'; +str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56' +1 +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00' +0 +select str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00' +1 +select str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34' +select str_to_date('2007-02-30 12:34','%Y-%m-%d %H:%i') = '2007-02-30 12:34:00'; +ERROR HY000: Incorrect DATETIME value: '2007-02-30 12:34:00' +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00' + and '2007/10/20 00:00:00'; +str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00' + and '2007/10/20 00:00:00' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +set SQL_MODE=TRADITIONAL; +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00 12:34' for function str_to_date +select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01' + and '2007/10/20'; +str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01' + and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +set SQL_MODE=DEFAULT; +select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'; +str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +select str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20'; +str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '' for function str_to_date +select str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '' for function str_to_date +select str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = ''; +ERROR HY000: Incorrect DATETIME value: '' +select str_to_date('1','%Y-%m-%d') = '1'; +ERROR HY000: Incorrect DATE value: '1' +select str_to_date('1','%Y-%m-%d') = '1'; +ERROR HY000: Incorrect DATE value: '1' +select str_to_date('','%Y-%m-%d') = ''; +ERROR HY000: Incorrect DATE value: '' +select str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL; +str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL +0 +Warnings: +Warning 1292 Truncated incorrect date value: '0000-00-00' +select str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00'; +str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00' +NULL +Warnings: +Warning 1292 Truncated incorrect date value: '2000-00-00' +select str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL; +str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL +0 +CREATE TABLE t1 (c11 INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY); +CREATE TABLE t2 (c21 INT UNSIGNED NOT NULL, +c22 INT DEFAULT NULL, +KEY(c21, c22)); +CREATE TABLE t3 (c31 INT UNSIGNED NOT NULL DEFAULT 0, +c32 INT DEFAULT NULL, +c33 INT NOT NULL, +c34 INT UNSIGNED DEFAULT 0, +KEY (c33, c34, c32)); +INSERT INTO t1 values (),(),(),(),(); +INSERT INTO t2 SELECT a.c11, b.c11 FROM t1 a, t1 b; +INSERT INTO t3 VALUES (1, 1, 1, 0), +(2, 2, 0, 0), +(3, 3, 1, 0), +(4, 4, 0, 0), +(5, 5, 1, 0); +SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND +t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND +t3.c33 = 1 AND t2.c22 in (1, 3) +ORDER BY c32; +c32 +1 +1 +3 +3 +5 +5 +SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND +t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND +t3.c33 = 1 AND t2.c22 in (1, 3) +ORDER BY c32 DESC; +c32 +5 +5 +3 +3 +1 +1 +DROP TABLE t1, t2, t3; + +# +# Bug#30736: Row Size Too Large Error Creating a Table and +# Inserting Data. +# +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; + +CREATE TABLE t1( +c1 DECIMAL(10, 2), +c2 FLOAT); + +INSERT INTO t1 VALUES (0, 1), (2, 3), (4, 5); + +CREATE TABLE t2( +c3 DECIMAL(10, 2)) +SELECT +c1 * c2 AS c3 +FROM t1; + +SELECT * FROM t1; +c1 c2 +0.00 1 +2.00 3 +4.00 5 + +SELECT * FROM t2; +c3 +0.00 +6.00 +20.00 + +DROP TABLE t1; +DROP TABLE t2; + +CREATE TABLE t1 (c1 BIGINT NOT NULL); +INSERT INTO t1 (c1) VALUES (1); +SELECT * FROM t1 WHERE c1 > NULL + 1; +c1 +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10) NOT NULL PRIMARY KEY); +INSERT INTO t1 (a) VALUES ('foo0'), ('bar0'), ('baz0'); +SELECT * FROM t1 WHERE a IN (CONCAT('foo', 0), 'bar'); +a +foo0 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +CREATE TABLE t2 (a INT, c INT, KEY(a)); +INSERT INTO t1 VALUES (1, 1), (2, 2); +INSERT INTO t2 VALUES (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), +(2, 1), (2, 2), (2, 3), (2, 4), (2, 5), +(3, 1), (3, 2), (3, 3), (3, 4), (3, 5), +(4, 1), (4, 2), (4, 3), (4, 4), (4, 5); +FLUSH STATUS; +SELECT DISTINCT b FROM t1 LEFT JOIN t2 USING(a) WHERE c <= 3; +b +1 +2 +SHOW STATUS LIKE 'Handler_read%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 3 +Handler_read_last 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 6 +DROP TABLE t1, t2; +CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0', +f2 int(11) NOT NULL default '0', +f3 bigint(20) NOT NULL default '0', +f4 varchar(255) NOT NULL default '', +PRIMARY KEY (f1), +KEY key1 (f4), +KEY key2 (f2)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t2 (f1 int(11) NOT NULL default '0', +f2 enum('A1','A2','A3') NOT NULL default 'A1', +f3 int(11) NOT NULL default '0', +PRIMARY KEY (f1), +KEY key1 (f3)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0', +f2 datetime NOT NULL default '1980-01-01 00:00:00', +PRIMARY KEY (f1)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1, 1, 1, 'abc'); +insert into t1 values (2, 1, 2, 'def'); +insert into t1 values (3, 1, 2, 'def'); +insert into t2 values (1, 'A1', 1); +insert into t3 values (1, '1980-01-01'); +SELECT a.f3, cr.f4, count(*) count +FROM t2 a +STRAIGHT_JOIN t1 cr ON cr.f2 = a.f1 +LEFT JOIN +(t1 cr2 +JOIN t3 ae2 ON cr2.f3 = ae2.f1 +) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND +cr.f4 = cr2.f4 +GROUP BY a.f3, cr.f4; +f3 f4 count +1 abc 1 +1 def 2 +drop table t1, t2, t3; +CREATE TABLE t1 (a INT KEY, b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a, b FROM t1 WHERE a > 1 AND a = b LIMIT 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 25.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 3 25.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 SELECT a, b FROM t1 WHERE a > 1 AND b = a LIMIT 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 25.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 3 25.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` > 1)) limit 2 +DROP TABLE t1; +# +# Bug#47019: Assertion failed: 0, file .\rt_mbr.c, line 138 when +# forcing a spatial index +# +CREATE TABLE t1(a LINESTRING NOT NULL SRID 0, SPATIAL KEY(a)); +INSERT INTO t1 VALUES +(ST_GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')), +(ST_GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')); +EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t2 NULL ALL a NULL NULL NULL 2 100.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; +1 +1 +1 +1 +1 +EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t2 NULL ALL a NULL NULL NULL 2 100.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` FORCE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); +1 +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug #48291 : crash with row() operator,select into @var, and +# subquery returning multiple rows +# +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (2),(3); +# Should not crash +SELECT 1 FROM t1 WHERE a <> 1 AND NOT +ROW(1,a) <=> ROW(1,(SELECT 1 FROM t1)) +INTO @var0; +ERROR 21000: Subquery returns more than 1 row +DROP TABLE t1; +# +# Bug #48458: simple query tries to allocate enormous amount of +# memory +# +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1(a INT NOT NULL, b YEAR); +INSERT INTO t1 VALUES (); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +CREATE TABLE t2(c INT); +# Should not err out because of out-of-memory +SELECT 1 FROM t2 JOIN t1 ON 1=1 +WHERE a != '1' AND NOT a >= b OR NOT ROW(b,a )<> ROW(a,a); +1 +DROP TABLE t1,t2; +SET sql_mode = default; +# +# Bug #49199: Optimizer handles incorrectly: +# field='const1' AND field='const2' in some cases + +CREATE TABLE t1(a DATETIME NOT NULL); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 00:00:00 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +DROP TABLE t1; +CREATE TABLE t1(a DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2001-01-01') +DROP TABLE t1; +CREATE TABLE t1(a TIMESTAMP NOT NULL NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 00:00:00 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +a b +2001-01-01 00:00:00 2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = DATE'2001-01-01') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b VARCHAR(20) NOT NULL) charset utf8mb4; +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +a b +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = '2001-01-01 00:00:00') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01'; +a b +2001-01-01 00:00:00 2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = '2001-01-01') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT x.a, y.a, z.a FROM t1 x +JOIN t1 y ON x.a=y.a +JOIN t1 z ON y.a=z.a +WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; +a a a +2001-01-01 00:00:00 2001-01-01 00:00:00 2001-01-01 00:00:00 +EXPLAIN SELECT x.a, y.a, z.a FROM t1 x +JOIN t1 y ON x.a=y.a +JOIN t1 z ON y.a=z.a +WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE x NULL ALL NULL NULL NULL NULL 1 100.00 Using where +2 SIMPLE y NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +2 SIMPLE z NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`y`.`a` AS `a`,`test`.`z`.`a` AS `a` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` where ((`test`.`x`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (`test`.`y`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (`test`.`z`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +# +# Bug #49897: crash in ptr_compare when char(0) NOT NULL +# column is used for ORDER BY +# +SET @old_sort_buffer_size= @@session.sort_buffer_size; +SET @@sort_buffer_size= 40000; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1(a CHAR(0) NOT NULL); +INSERT INTO t1 VALUES (0), (0), (0); +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a FROM t1 ORDER BY a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24404 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24404 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `test`.`t1`.`a` +SELECT a FROM t1 ORDER BY a; +DROP TABLE t1; +CREATE TABLE t1(a CHAR(0) NOT NULL, b CHAR(0) NOT NULL, c int); +INSERT INTO t1 VALUES (0, 0, 0), (0, 0, 2), (0, 0, 1); +# Since ANALYZE TABLE only reads a subset of the data, the statistics for +# table t1 depends on the row order. And since the INSERT INTO ... SELECT +# may be executed using different execution plans, we've added ORDER BY +# to ensure that we rows has the same order every time. If not, the +# estimated number of rows in EXPLAIN may change on different platforms. +# Note that the tables may MYISAM, since many of the test files that +# includes this file forces MYISAM as the default storage engine. +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a FROM t1 ORDER BY a LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `test`.`t1`.`a` limit 5 +SELECT a FROM t1 ORDER BY a LIMIT 5; +a + + + + + +EXPLAIN SELECT * FROM t1 ORDER BY a, b LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b` limit 5 +SELECT * FROM t1 ORDER BY a, b LIMIT 5; +a b c + 2 + 2 + 2 + 2 + 2 +EXPLAIN SELECT * FROM t1 ORDER BY a, b, c LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b`,`test`.`t1`.`c` limit 5 +SELECT * FROM t1 ORDER BY a, b, c LIMIT 5; +a b c + 0 + 0 + 0 + 0 + 0 +EXPLAIN SELECT * FROM t1 ORDER BY c, a LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`c`,`test`.`t1`.`a` limit 5 +SELECT * FROM t1 ORDER BY c, a LIMIT 5; +a b c + 0 + 0 + 0 + 0 + 0 +SET @@sort_buffer_size= @old_sort_buffer_size; +DROP TABLE t1; +SET sql_mode = default; +End of 5.0 tests +create table t1(a INT, KEY (a)); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5); +SELECT a FROM t1 ORDER BY a LIMIT 2; +a +1 +2 +SELECT a FROM t1 ORDER BY a LIMIT 2,4294967296; +a +3 +4 +5 +SELECT a FROM t1 ORDER BY a LIMIT 2,4294967297; +a +3 +4 +5 +DROP TABLE t1; +CREATE TABLE A (date_key date); +CREATE TABLE C ( +pk int, +int_nokey int, +int_key int, +date_key date NOT NULL, +date_nokey date, +varchar_key varchar(1) +); +INSERT IGNORE INTO C VALUES +(1,1,1,'0000-00-00',NULL,NULL), +(1,1,1,'0000-00-00',NULL,NULL); +Warnings: +Warning 1264 Out of range value for column 'date_key' at row 1 +Warning 1264 Out of range value for column 'date_key' at row 2 +SELECT 1 FROM C WHERE pk > ANY (SELECT 1 FROM C); +1 +SELECT COUNT(DISTINCT 1) FROM C +WHERE date_key = (SELECT 1 FROM A WHERE C.date_key IS NULL) GROUP BY pk; +COUNT(DISTINCT 1) +SELECT date_nokey FROM C +WHERE int_key IN (SELECT 1 FROM A) +HAVING date_nokey = '10:41:7' +ORDER BY date_key; +ERROR HY000: Incorrect DATE value: '10:41:7' +DROP TABLE A,C; +CREATE TABLE t1 (a INT NOT NULL, b INT); +INSERT INTO t1 VALUES (1, 1); +EXPLAIN SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where true +SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2; +a b +1 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL); +EXPLAIN SELECT * FROM t1 WHERE (a=a AND b=b AND c=c) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +EXPLAIN SELECT * FROM t1 WHERE (a=a AND a=a AND b=b) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +EXPLAIN SELECT * FROM t1 WHERE (a=a AND b=b AND a=a) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +DROP TABLE t1; +# +# Bug#45266: Uninitialized variable lead to an empty result. +# +drop table if exists A,AA,B,BB; +CREATE TABLE `A` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`date_key` date NOT NULL, +`date_nokey` date NOT NULL, +`datetime_key` datetime NOT NULL, +`int_nokey` int(11) NOT NULL, +`time_key` time NOT NULL, +`time_nokey` time NOT NULL, +PRIMARY KEY (`pk`), +KEY `date_key` (`date_key`), +KEY `time_key` (`time_key`), +KEY `datetime_key` (`datetime_key`) +); +CREATE TABLE `AA` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`int_nokey` int(11) NOT NULL, +`time_key` time NOT NULL, +KEY `time_key` (`time_key`), +PRIMARY KEY (`pk`) +); +CREATE TABLE `B` ( +`date_nokey` date NOT NULL, +`date_key` date NOT NULL, +`time_key` time NOT NULL, +`datetime_nokey` datetime NOT NULL, +`varchar_key` varchar(1) NOT NULL, +KEY `date_key` (`date_key`), +KEY `time_key` (`time_key`), +KEY `varchar_key` (`varchar_key`) +); +INSERT IGNORE INTO `B` VALUES ('2003-07-28','2003-07-28','15:13:38','0000-00-00 00:00:00','f'),('0000-00-00','0000-00-00','00:05:48','2004-07-02 14:34:13','x'); +CREATE TABLE `BB` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`int_nokey` int(11) NOT NULL, +`date_key` date NOT NULL, +`varchar_nokey` varchar(1) NOT NULL, +`date_nokey` date NOT NULL, +PRIMARY KEY (`pk`), +KEY `date_key` (`date_key`) +); +INSERT IGNORE INTO `BB` VALUES (10,8,'0000-00-00','i','0000-00-00'),(11,0,'2005-08-18','','2005-08-18'); +SELECT table1 . `pk` AS field1 +FROM +(BB AS table1 INNER JOIN +(AA AS table2 STRAIGHT_JOIN A AS table3 +ON ( table3 . `date_key` = table2 . `pk` )) +ON ( table3 . `datetime_key` = table2 . `int_nokey` )) +WHERE ( table3 . `date_key` <= 4 AND table2 . `pk` = table1 . `varchar_nokey`) +GROUP BY field1 ; +field1 +SELECT table3 .`date_key` field1 +FROM +B table1 LEFT JOIN B table3 JOIN +(BB table6 JOIN A table7 ON table6 .`varchar_nokey`) +ON table6 .`int_nokey` ON table6 .`date_key` + WHERE NOT ( table1 .`varchar_key` AND table7 .`pk`) GROUP BY field1; +field1 +NULL +SELECT table4 . `time_nokey` AS field1 FROM +(AA AS table1 CROSS JOIN +(AA AS table2 STRAIGHT_JOIN +(B AS table3 STRAIGHT_JOIN A AS table4 +ON ( table4 . `date_key` = table3 . `time_key` )) +ON ( table4 . `pk` = table3 . `date_nokey` )) +ON ( table4 . `time_key` = table3 . `datetime_nokey` )) +WHERE ( table4 . `time_key` < table1 . `time_key` AND +table1 . `int_nokey` != 'f') +GROUP BY field1 ORDER BY field1 , field1; +field1 +SELECT table1 .`time_key` field2 FROM B table1 LEFT JOIN BB JOIN A table5 ON table5 .`date_nokey` ON table5 .`int_nokey` GROUP BY field2; +field2 +00:05:48 +15:13:38 +drop table A,AA,B,BB; +#end of test for bug#45266 +# +# Bug#33546: Slowdown on re-evaluation of constant expressions. +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (2); +SELECT * FROM t1 WHERE a = 1 + 1; +a +2 +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE a = 1 + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 10.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = ((1 + 1))) +SELECT * FROM t1 HAVING a = 1 + 1; +a +2 +EXPLAIN SELECT * FROM t1 HAVING a = 1 + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 100.00 NULL +Warnings: +Note 1003 /* select#1 */ 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 +EXPLAIN SELECT * FROM t1, t2 WHERE a = b + (1 + 1); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = (`test`.`t2`.`b` + ((1 + 1)))) +SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; +b a +2 3 +EXPLAIN SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t2` left join `test`.`t1` on((`test`.`t1`.`a` = (`test`.`t2`.`b` + 1))) where true +EXPLAIN SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 33.33 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 33.33 Using where +Warnings: +Note 1003 /* select#1 */ 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; +RETURN 1; +END;| +SET @cnt := 0; +SELECT * FROM t1 WHERE a = f1(); +a +1 +SELECT @cnt; +@cnt +1 +EXPLAIN SELECT * FROM t1 WHERE a = f1(); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 +# +# BUG#48052: Valgrind warning - uninitialized value in init_read_record() +# +# Disable Index condition pushdown +SELECT @old_optimizer_switch:=@@optimizer_switch; +@old_optimizer_switch:=@@optimizer_switch +# +Warnings: +# 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +CREATE TABLE t1 ( +pk int(11) NOT NULL, +i int(11) DEFAULT NULL, +v varchar(1) DEFAULT NULL, +PRIMARY KEY (pk) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (2,7,'m'); +INSERT INTO t1 VALUES (3,9,'m'); +SELECT v +FROM t1 +WHERE NOT pk > 0 +HAVING v <= 't' +ORDER BY pk; +v +# Restore old value for Index condition pushdown +SET SESSION optimizer_switch=@old_optimizer_switch; +DROP TABLE t1; +# +# Bug#49489 Uninitialized cache led to a wrong result. +# +CREATE TABLE t1(c1 DOUBLE(5,4)); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (9.1234); +SELECT * FROM t1 WHERE c1 < 9.12345; +c1 +9.1234 +DROP TABLE t1; +# End of test for bug#49489. +# +# Bug #49517: Inconsistent behavior while using +# NULLable BIGINT and INT columns in comparison +# +CREATE TABLE t1(a BIGINT UNSIGNED NOT NULL, b BIGINT NULL, c INT NULL); +INSERT INTO t1 VALUES(105, NULL, NULL); +SELECT * FROM t1 WHERE b < 102; +a b c +SELECT * FROM t1 WHERE c < 102; +a b c +SELECT * FROM t1 WHERE 102 < b; +a b c +SELECT * FROM t1 WHERE 102 < c; +a b c +DROP TABLE t1; +# +# Bug #54459: Assertion failed: param.sort_length, +# file .\filesort.cc, line 149 (part II) +# +CREATE TABLE t1(a ENUM('') NOT NULL) charset latin1; +INSERT INTO t1 VALUES (), (), (); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` order by `(t1.a collate latin1_german2_ci)` +SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug #58422: Incorrect result when OUTER JOIN'ing +# with an empty table +# +CREATE TABLE t_empty(pk INT PRIMARY KEY, i INT); +CREATE TABLE t1(pk INT PRIMARY KEY, i INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3); +CREATE TABLE t2(pk INT PRIMARY KEY, i INT) ; +INSERT INTO t2 VALUES (1,1), (2,2), (3,3); +ANALYZE TABLE t_empty, t1, t2; +Table Op Msg_type Msg_text +test.t_empty analyze status OK +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`pk` = `test`.`t1`.`pk`) and (`test`.`t1`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`pk` = `test`.`t1`.`pk`) and (`test`.`t1`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t2 NULL range PRIMARY PRIMARY 4 NULL 2 33.33 Using where; Using join buffer (hash join) +2 SIMPLE t1 NULL eq_ref PRIMARY PRIMARY 4 test.t2.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`i` = `test`.`t_empty`.`i`) and (`test`.`t1`.`pk` = `test`.`t2`.`pk`) and (`test`.`t2`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +DROP TABLE t1,t2,t_empty; +End of 5.1 tests +# +# Bug#45227: Lost HAVING clause led to a wrong result. +# +CREATE TABLE `cc` ( +`int_nokey` int(11) NOT NULL, +`int_key` int(11) NOT NULL, +`varchar_key` varchar(1) NOT NULL, +`varchar_nokey` varchar(1) NOT NULL, +KEY `int_key` (`int_key`), +KEY `varchar_key` (`varchar_key`) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `cc` VALUES +(0,8,'q','q'),(5,8,'m','m'),(7,3,'j','j'),(1,2,'z','z'),(8,2,'a','a'),(2,6,'',''),(1,8,'e' +,'e'),(8,9,'t','t'),(5,2,'q','q'),(4,6,'b','b'),(5,5,'w','w'),(3,2,'m','m'),(0,4,'x','x'), +(8,9,'',''),(0,6,'w','w'),(4,5,'x','x'),(0,0,'e','e'),(0,0,'e','e'),(2,8,'p','p'),(0,0,'x' +,'x'); +EXPLAIN SELECT `varchar_nokey` g1 FROM cc WHERE `int_nokey` AND `int_key` <= 4 +HAVING g1 ORDER BY `varchar_key` LIMIT 6 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 9 90.00 Parallel execute (1 workers) +2 SIMPLE cc NULL range int_key int_key 4 NULL 9 90.00 Using index condition; Using where; Using MRR; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`cc`.`varchar_nokey` AS `g1` from `test`.`cc` where ((0 <> `test`.`cc`.`int_nokey`) and (`test`.`cc`.`int_key` <= 4)) having (0 <> `g1`) order by `test`.`cc`.`varchar_key` limit 6 +SELECT `varchar_nokey` g1 FROM cc WHERE `int_nokey` AND `int_key` <= 4 +HAVING g1 ORDER BY `varchar_key` LIMIT 6 ; +g1 +Warning 1292 Truncated incorrect DOUBLE value: 'a' +Warning 1292 Truncated incorrect DOUBLE value: 'j' +Warning 1292 Truncated incorrect DOUBLE value: 'm' +Warning 1292 Truncated incorrect DOUBLE value: 'q' +Warning 1292 Truncated incorrect DOUBLE value: 'z' +Warnings: +DROP TABLE cc; +# End of test#45227 +# +# Bug#54515: Crash in opt_range.cc::get_best_group_min_max on +# SELECT from VIEW with GROUP BY +# +CREATE TABLE t1 ( +col_int_key int DEFAULT NULL, +KEY int_key (col_int_key) +) ; +INSERT INTO t1 VALUES (1),(2); +CREATE VIEW view_t1 AS +SELECT t1.col_int_key AS col_int_key +FROM t1; +SELECT col_int_key FROM view_t1 GROUP BY col_int_key; +col_int_key +1 +2 +DROP VIEW view_t1; +DROP TABLE t1; +# End of test BUG#54515 +# +# Bug #57203 Assertion `field_length <= 255' failed. +# +SELECT coalesce((avg(distinct (ST_geomfromtext("point(25379 -22010)"))))) +UNION ALL +SELECT coalesce((avg(distinct (ST_geomfromtext("point(25379 -22010)"))))) +AS foo +; +ERROR HY000: Incorrect arguments to avg +CREATE table t1(a text); +INSERT INTO t1 VALUES (''), (''); +SELECT avg(distinct(t1.a)) FROM t1, t1 t2 +GROUP BY t2.a ORDER BY t1.a; +avg(distinct(t1.a)) +0 +DROP TABLE t1; +# End of test BUG#57203 +# +# Bug#63020: Function "format"'s 'locale' argument is not considered +# when creating a "view' +# +CREATE TABLE t1 (f1 DECIMAL(10,2)); +INSERT INTO t1 VALUES (11.67),(17865.3),(12345678.92); +CREATE VIEW view_t1 AS SELECT FORMAT(f1,1,'sk_SK') AS f1 FROM t1; +SHOW CREATE VIEW view_t1; +View Create View character_set_client collation_connection +view_t1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_t1` AS select format(`t1`.`f1`,1,'sk_SK') AS `f1` from `t1` utf8mb4 utf8mb4_0900_ai_ci +SELECT * FROM view_t1; +f1 +11,7 +17 865,3 +12 345 678,9 +DROP TABLE t1; +DROP VIEW view_t1; +# End of test BUG#63020 +# +# Bug #13571700 TINYBLOB NOT NULL, CRASH IN PROTOCOL::NET_STORE_DATA +# +CREATE TABLE t1 (a TINYBLOB NOT NULL); +SELECT a, COUNT(*) FROM t1 WHERE 0; +a COUNT(*) +NULL 0 +DROP TABLE t1; +# End of test BUG#13571700 +# +# Bug #18766378: CRASH IN ITEM_SUM_BIT::RESET_FIELD +# +CREATE TABLE t1(b int); +CREATE TABLE t2(a int); +INSERT INTO t1 VALUES (),(); +INSERT INTO t2 VALUES (),(); +SELECT +( SELECT 1 FROM t1 GROUP BY a +HAVING avg(distinct 1) ORDER BY max(a) +) +FROM t1, t2 +GROUP BY a; +( SELECT 1 FROM t1 GROUP BY a +HAVING avg(distinct 1) ORDER BY max(a) +) +1 +DROP TABLE t1,t2; +# End of test BUG#18766378 +# +# WL#13002: RESULTSET DIFFERENT NUMBER OF ROWS +# +CREATE TABLE t1 ( +f1 INTEGER, +f2 INTEGER, +INDEX i1 (f2) +); +INSERT INTO t1 VALUES (NULL,1); +INSERT INTO t1 VALUES (2,NULL); +INSERT INTO t1 VALUES (3,1); +INSERT INTO t1 VALUES (4,6); +INSERT INTO t1 VALUES (NULL,5); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (13,1); +INSERT INTO t1 VALUES (NULL,0); +INSERT INTO t1 VALUES (5,2); +INSERT INTO t1 VALUES (NULL,8); +INSERT INTO t1 VALUES (NULL,7); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (NULL,4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN FORMAT=tree SELECT * +FROM t1 AS alias1 LEFT JOIN t1 AS alias2 ON alias1.f1 = alias2.f2 +WHERE alias2.f1 NOT BETWEEN 4 AND 12; +EXPLAIN +-> Parallel scan on + -> Nested loop inner join (cost=9.27 rows=19) + -> PQblock scan on alias1 (cost=1.65 rows=14) + -> Filter: (alias2.f1 not between 4 and 12) (cost=0.40 rows=1) + -> Index lookup on alias2 using i1 (f2=alias1.f1) (cost=0.40 rows=2) + +SELECT * +FROM t1 AS alias1 LEFT JOIN t1 AS alias2 ON alias1.f1 = alias2.f2 +WHERE alias2.f1 NOT BETWEEN 4 AND 12; +f1 f2 f1 f2 +DROP TABLE t1; +set optimizer_switch=default; diff --git a/mysql-test/r/select_all_bka.result-pq b/mysql-test/r/select_all_bka.result-pq new file mode 100644 index 000000000000..ac8a3290b28b --- /dev/null +++ b/mysql-test/r/select_all_bka.result-pq @@ -0,0 +1,5703 @@ +set optimizer_switch='batched_key_access=on,mrr_cost_based=off'; +set optimizer_switch='semijoin=on,materialization=on,firstmatch=on,loosescan=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=off'; +drop table if exists t1,t2,t3,t4,t11; +drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; +drop view if exists v1; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +); +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +select * from t1; +Period Varor_period +9410 9412 +select t1.* from t1; +Period Varor_period +9410 9412 +CREATE TABLE t2 ( +auto int not null auto_increment, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL, +UNIQUE fld1 (fld1), +KEY fld3 (fld3), +PRIMARY KEY (auto) +) charset utf8mb4; +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +imaginable +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +cultivation +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3 from t2 order by fld3 desc limit 10; +fld3 +youthfulness +yelped +Wotan +workers +Witt +witchcraft +Winsett +Willy +willed +wildcats +select fld3 from t2 order by fld3 desc limit 5; +fld3 +youthfulness +yelped +Wotan +workers +Witt +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +witchcraft +Winsett +Willy +willed +wildcats +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'h%le'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; +fld3 +explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 0.09 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 0.09 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` IGNORE INDEX (`fld3`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 0.09 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 0.09 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld1`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld3`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld3`) USE INDEX (`fld1`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 ignore index (fld3,not_used); +ERROR 42000: Key 'not_used' doesn't exist in table 't2' +explain select fld3 from t2 use index (not_used); +ERROR 42000: Key 'not_used' doesn't exist in table 't2' +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +honeysuckle +honoring +explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range fld3 fld3 120 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where ((`test`.`t2`.`fld3` >= 'honeysuckle') and (`test`.`t2`.`fld3` <= 'honoring')) order by `test`.`t2`.`fld3` +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +fld1 fld3 +148504 Colombo +068305 Colombo +000000 nondecreasing +select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes'; +fld1 fld3 +232605 appendixes +1232605 appendixes +1232606 appendixes +1232607 appendixes +1232608 appendixes +1232609 appendixes +select fld1 from t2 where fld1=250501 or fld1="250502"; +fld1 +250501 +250502 +explain select fld1 from t2 where fld1=250501 or fld1="250502"; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL range fld1 fld1 4 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld1` AS `fld1` from `test`.`t2` where ((`test`.`t2`.`fld1` = 250501) or (`test`.`t2`.`fld1` = 250502)) +select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +fld1 +250501 +250502 +250505 +250601 +explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL range fld1 fld1 4 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld1` AS `fld1` from `test`.`t2` where ((`test`.`t2`.`fld1` = 250501) or (`test`.`t2`.`fld1` = 250502) or ((`test`.`t2`.`fld1` >= 250505) and (`test`.`t2`.`fld1` <= 250601)) or (`test`.`t2`.`fld1` between 250501 and 250502)) +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +fld1 fld3 +012001 flanking +013602 foldout +013606 fingerings +018007 fanatic +018017 featherweight +018054 fetters +018103 flint +018104 flopping +036002 funereal +038017 fetched +038205 firearm +058004 Fenton +088303 feminine +186002 freakish +188007 flurried +188505 fitting +198006 furthermore +202301 Fitzpatrick +208101 fiftieth +208113 freest +218008 finishers +218022 feed +218401 faithful +226205 foothill +226209 furnishings +228306 forthcoming +228311 fated +231315 freezes +232102 forgivably +238007 filial +238008 fixedly +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +fld3 +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +fld3 +Chantilly +select fld1,fld3 from t2 where fld1 like "25050%"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select fld1,fld3 from t2 where fld1 like "25050_"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select distinct companynr from t2; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr desc; +companynr +68 +65 +58 +53 +50 +41 +40 +37 +36 +34 +29 +00 +select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%" order by fld3; +fld3 period +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +select distinct fld3 from t2 where companynr = 34 order by fld3; +fld3 +absentee +accessed +ahead +alphabetic +Asiaticizations +attitude +aye +bankruptcies +belays +Blythe +bomb +boulevard +bulldozes +cannot +caressing +charcoal +checksumming +chess +clubroom +colorful +cosy +creator +crying +Darius +diffusing +duality +Eiffel +Epiphany +Ernestine +explorers +exterminated +famine +forked +Gershwins +heaving +Hodges +Iraqis +Italianization +Lagos +landslide +libretto +Majorca +mastering +narrowed +occurred +offerers +Palestine +Peruvianizes +pharmaceutic +poisoning +population +Pygmalion +rats +realest +recording +regimented +retransmitting +reviver +rouses +scars +sicker +sleepwalk +stopped +sugars +translatable +uncles +unexpected +uprisings +versatility +vest +select distinct fld3 from t2 limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct fld3 from t2 having fld3 like "A%" limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct substring(fld3,1,3) from t2 where fld3 like "A%"; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +Adl +adm +Ado +ads +adv +aer +aff +afi +afl +afo +agi +ahe +aim +air +Ald +alg +ali +all +alp +alr +ama +ame +amm +ana +and +ane +Ang +ani +Ann +Ant +api +app +aqu +Ara +arc +Arm +arr +Art +Asi +ask +asp +ass +ast +att +aud +Aug +aut +ave +avo +awe +aye +Azt +select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +create table t3 ( +period int not null, +name char(32) not null, +companynr int not null, +price double(11,0), +price2 double(11,0), +key (period), +key (name) +); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +create temporary table tmp select * from t3; +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +alter table t3 add t2nr int not null auto_increment primary key first; +drop table tmp; +SET BIG_TABLES=1; +select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10; +namn +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +SET BIG_TABLES=0; +select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10; +concat(fld3," ",fld3) +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +select distinct fld5 from t2 limit 10; +fld5 +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +select distinct companynr, fld3,count(*) from t2 group by companynr, fld3 order by companynr, fld3 limit 10; +companynr fld3 count(*) +00 affixed 1 +00 and 1 +00 annoyers 1 +00 Anthony 1 +00 assayed 1 +00 assurers 1 +00 attendants 1 +00 bedlam 1 +00 bedpost 1 +00 boasted 1 +SET BIG_TABLES=1; +select distinct companynr, fld3,count(*) from t2 group by companynr, fld3 order by companynr, fld3 limit 10; +companynr fld3 count(*) +00 affixed 1 +00 and 1 +00 annoyers 1 +00 Anthony 1 +00 assayed 1 +00 assurers 1 +00 attendants 1 +00 bedlam 1 +00 bedpost 1 +00 boasted 1 +SET BIG_TABLES=0; +select distinct companynr, fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr ,fld3 order by companynr, fld3 limit 100,10; +companynr fld3 repeat("a",length(fld3)) count(*) +29 chancellor aaaaaaaaaa 1 +29 Chippewa aaaaaaaa 1 +29 circumference aaaaaaaaaaaaa 1 +29 circus aaaaaa 1 +29 cited aaaaa 1 +29 Colombo aaaaaaa 1 +29 congresswoman aaaaaaaaaaaaa 1 +29 contrition aaaaaaaaaa 1 +29 corny aaaaa 1 +29 cultivation aaaaaaaaaaa 1 +select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2; +companynr rtrim(space(512+companynr)) +37 +78 +101 +154 +311 +447 +512 +select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; +fld3 +explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 10.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL fld1 NULL NULL NULL 1199 10.00 Using where; Using temporary; Using filesort +2 SIMPLE t3 NULL eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`t2nr` AS `t2nr`,`test`.`t2`.`fld3` AS `fld3` from `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld1` = `test`.`t3`.`t2nr`)) order by `test`.`t3`.`t2nr`,`test`.`t2`.`fld3` +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 41736 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL period NULL NULL NULL 41736 100.00 Using temporary; Using filesort +2 SIMPLE t3 NULL ref period period 4 test.t1.period 4173 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t3`.`period` = `test`.`t1`.`period`) order by `test`.`t3`.`period` +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 41736 100.00 Parallel execute (4 workers) +2 SIMPLE t3 NULL ALL period NULL NULL NULL 41736 100.00 Using temporary; Using filesort +2 SIMPLE t1 NULL ref period period 4 test.t3.period 4173 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t1`.`period` = `test`.`t3`.`period`) order by `test`.`t3`.`period` limit 10 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 41736 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL period NULL NULL NULL 41736 100.00 Using temporary; Using filesort +2 SIMPLE t3 NULL ref period period 4 test.t1.period 4173 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t3`.`period` = `test`.`t1`.`period`) order by `test`.`t1`.`period` limit 10 +select period from t1; +period +9410 +select period from t1 where period=1900; +period +select fld3,period from t1,t2 where fld1 = 011401 order by period; +fld3 period +breaking 9410 +select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001; +fld3 period +breaking 1001 +explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const fld1 fld1 4 const 1 100.00 NULL +1 SIMPLE t3 NULL const PRIMARY,period PRIMARY 4 const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select 'breaking' AS `fld3`,'1001' AS `period` from `test`.`t2` join `test`.`t3` where true +select fld3,period from t2,t1 where companynr*10 = 37*10 order by fld3; +fld3 period +abates 9410 +Abraham 9410 +abrogating 9410 +accessed 9410 +Aden 9410 +admiring 9410 +admonishing 9410 +Adolph 9410 +afield 9410 +afore 9410 +aging 9410 +airships 9410 +Aldrich 9410 +alike 9410 +Alison 9410 +allot 9410 +already 9410 +amenities 9410 +ammonium 9410 +analogy 9410 +analyzable 9410 +Anatole 9410 +animals 9410 +animized 9410 +annihilates 9410 +announced 9410 +announces 9410 +Antarctica 9410 +Antares 9410 +apiary 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +Arabia 9410 +arriving 9410 +Artemia 9410 +arteriole 9410 +assails 9410 +astound 9410 +attainments 9410 +attrition 9410 +audiology 9410 +Augustine 9410 +avenge 9410 +avoidable 9410 +babies 9410 +babysitting 9410 +Baird 9410 +balled 9410 +beaner 9410 +beaters 9410 +bee 9410 +Beebe 9410 +befouled 9410 +bellow 9410 +bestseller 9410 +betroth 9410 +bewilderingly 9410 +bills 9410 +bitterroot 9410 +bivalves 9410 +bloater 9410 +bloodbath 9410 +boat 9410 +boom 9410 +boorish 9410 +boulder 9410 +breaking 9410 +brunch 9410 +buckboards 9410 +burlesque 9410 +Butterfield 9410 +cage 9410 +capably 9410 +capped 9410 +cascade 9410 +Cassites 9410 +causality 9410 +cautioned 9410 +ceiling 9410 +celery 9410 +CERN 9410 +certificates 9410 +chafe 9410 +chaperone 9410 +charges 9410 +chasm 9410 +checkpoints 9410 +chewing 9410 +chews 9410 +Chicana 9410 +chillingly 9410 +Chippewa 9410 +chronicle 9410 +ciphers 9410 +civics 9410 +clamored 9410 +Clayton 9410 +clenched 9410 +clockers 9410 +coexist 9410 +cokes 9410 +combed 9410 +coming 9410 +commencements 9410 +commonplace 9410 +communicants 9410 +compartment 9410 +comprehensive 9410 +comprised 9410 +conceptions 9410 +concludes 9410 +congregates 9410 +Conley 9410 +Connally 9410 +contrary 9410 +contrasted 9410 +convenient 9410 +convulsion 9410 +corset 9410 +count 9410 +coverings 9410 +Crays 9410 +craziness 9410 +creak 9410 +creek 9410 +critiques 9410 +crunches 9410 +culled 9410 +cult 9410 +cupboard 9410 +cured 9410 +cute 9410 +daughter 9410 +decliner 9410 +decomposition 9410 +deductions 9410 +dehydrate 9410 +deludes 9410 +denizen 9410 +denotative 9410 +denounces 9410 +dental 9410 +dentally 9410 +descendants 9410 +despot 9410 +destroyer 9410 +detectably 9410 +dialysis 9410 +DiMaggio 9410 +dimensions 9410 +disable 9410 +discounts 9410 +disentangle 9410 +disobedience 9410 +dissociate 9410 +dogging 9410 +dopers 9410 +drains 9410 +dreaded 9410 +ducks 9410 +dusted 9410 +Dutchman 9410 +effortlessly 9410 +electroencephalography 9410 +elite 9410 +embassies 9410 +employing 9410 +encompass 9410 +encompasses 9410 +environing 9410 +epistle 9410 +equilibrium 9410 +erases 9410 +error 9410 +eschew 9410 +eternal 9410 +Eulerian 9410 +Evanston 9410 +evened 9410 +evenhandedly 9410 +eventful 9410 +Everhart 9410 +excises 9410 +exclamation 9410 +excrete 9410 +exhausts 9410 +expelled 9410 +extents 9410 +externally 9410 +extracted 9410 +faithful 9410 +fanatic 9410 +fated 9410 +featherweight 9410 +feed 9410 +feminine 9410 +Fenton 9410 +fetched 9410 +fetters 9410 +fiftieth 9410 +filial 9410 +fingerings 9410 +finishers 9410 +firearm 9410 +fitting 9410 +Fitzpatrick 9410 +fixedly 9410 +flanking 9410 +flint 9410 +flopping 9410 +flurried 9410 +foldout 9410 +foothill 9410 +forgivably 9410 +forthcoming 9410 +freakish 9410 +freest 9410 +freezes 9410 +funereal 9410 +furnishings 9410 +furthermore 9410 +gadfly 9410 +gainful 9410 +Galatean 9410 +galling 9410 +Gandhian 9410 +Ganymede 9410 +garage 9410 +gentleman 9410 +gifted 9410 +gleaning 9410 +glut 9410 +goblins 9410 +Goldstine 9410 +Gothicism 9410 +governing 9410 +gradually 9410 +Graves 9410 +grazing 9410 +Greenberg 9410 +gritty 9410 +groupings 9410 +guides 9410 +guitars 9410 +Gurkha 9410 +handgun 9410 +handy 9410 +Hawaii 9410 +Hegelian 9410 +heiress 9410 +hoarder 9410 +honoring 9410 +Hornblower 9410 +hostess 9410 +Huffman 9410 +humanness 9410 +humiliation 9410 +humility 9410 +Hunter 9410 +hushes 9410 +husky 9410 +hypothesizer 9410 +icon 9410 +ideas 9410 +impelling 9410 +impending 9410 +imperial 9410 +imperiously 9410 +imprint 9410 +impulsive 9410 +inaccuracy 9410 +inch 9410 +incidentals 9410 +incorrectly 9410 +incurring 9410 +index 9410 +indulge 9410 +indulgences 9410 +ineffective 9410 +infallibly 9410 +infest 9410 +inform 9410 +inmate 9410 +insolence 9410 +instruments 9410 +intelligibility 9410 +intentness 9410 +intercepted 9410 +interdependent 9410 +interrelationships 9410 +interrogate 9410 +investigations 9410 +irresponsibly 9410 +jarring 9410 +Joplin 9410 +journalizing 9410 +Judas 9410 +juveniles 9410 +Kane 9410 +kanji 9410 +Kantian 9410 +Kevin 9410 +kingdom 9410 +Kinsey 9410 +kiting 9410 +Kline 9410 +labeled 9410 +languages 9410 +Lars 9410 +laterally 9410 +Latinizes 9410 +lawgiver 9410 +leaflet 9410 +leavings 9410 +lectured 9410 +leftover 9410 +lewdly 9410 +lied 9410 +Lillian 9410 +linear 9410 +lists 9410 +lithograph 9410 +Lizzy 9410 +lore 9410 +luckily 9410 +Majorca 9410 +males 9410 +Manhattanize 9410 +marginal 9410 +mastering 9410 +mayoral 9410 +McGovern 9410 +meanwhile 9410 +measures 9410 +measures 9410 +mechanizing 9410 +medical 9410 +meditation 9410 +Melinda 9410 +Merritt 9410 +metaphysically 9410 +Micronesia 9410 +Miles 9410 +Miltonism 9410 +mineral 9410 +miniaturizes 9410 +minima 9410 +minion 9410 +minting 9410 +misted 9410 +misunderstander 9410 +mixture 9410 +motors 9410 +mournfulness 9410 +multilayer 9410 +mumbles 9410 +mushrooms 9410 +mystic 9410 +Nabisco 9410 +navies 9410 +navigate 9410 +Nazis 9410 +neat 9410 +neonatal 9410 +nested 9410 +Newtonian 9410 +noncritical 9410 +normalizes 9410 +Norwalk 9410 +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +Pandora 9410 +parametrized 9410 +parenthood 9410 +Parsifal 9410 +parters 9410 +participated 9410 +partridges 9410 +peacock 9410 +peeked 9410 +pellagra 9410 +percentage 9410 +percentage 9410 +persist 9410 +perturb 9410 +Peruvian 9410 +pessimist 9410 +pests 9410 +petted 9410 +pictures 9410 +pithed 9410 +pityingly 9410 +poison 9410 +posed 9410 +positioning 9410 +postulation 9410 +praised 9410 +precaution 9410 +precipitable 9410 +preclude 9410 +presentation 9410 +pressure 9410 +previewing 9410 +priceless 9410 +primary 9410 +psychic 9410 +publicly 9410 +puddings 9410 +Punjab 9410 +Pyle 9410 +quagmire 9410 +quitter 9410 +Quixotism 9410 +railway 9410 +raining 9410 +rains 9410 +ravines 9410 +readable 9410 +realized 9410 +realtor 9410 +reassigned 9410 +recruited 9410 +reduce 9410 +regimented 9410 +registration 9410 +relatively 9410 +relaxing 9410 +relishing 9410 +relives 9410 +renew 9410 +repelled 9410 +repetitions 9410 +reporters 9410 +reporters 9410 +repressions 9410 +resplendent 9410 +resumes 9410 +rifles 9410 +rightful 9410 +rightfully 9410 +rightfulness 9410 +ripeness 9410 +riser 9410 +Romano 9410 +Romans 9410 +roped 9410 +rudeness 9410 +rules 9410 +rural 9410 +rusting 9410 +Sabine 9410 +sadly 9410 +sags 9410 +sanding 9410 +saplings 9410 +sating 9410 +Sault 9410 +save 9410 +sawtooth 9410 +Saxony 9410 +scarf 9410 +scatterbrain 9410 +scheduling 9410 +schemer 9410 +scholastics 9410 +scornfully 9410 +secures 9410 +securing 9410 +Selfridge 9410 +seminaries 9410 +serializations 9410 +serpents 9410 +serving 9410 +severely 9410 +sews 9410 +Shanghais 9410 +shapelessly 9410 +shipyard 9410 +shooter 9410 +similarities 9410 +Simla 9410 +Simon 9410 +skulking 9410 +slaughter 9410 +sloping 9410 +smoothed 9410 +snatching 9410 +socializes 9410 +sophomore 9410 +sorters 9410 +spatial 9410 +specification 9410 +specifics 9410 +spongers 9410 +spools 9410 +sportswriting 9410 +sporty 9410 +squabbled 9410 +squeaking 9410 +squeezes 9410 +stabilizes 9410 +stairway 9410 +Stalin 9410 +standardizes 9410 +star 9410 +starlet 9410 +stated 9410 +Steinberg 9410 +stint 9410 +stodgy 9410 +store 9410 +straight 9410 +stranglings 9410 +subdirectory 9410 +subjective 9410 +subschema 9410 +succumbed 9410 +suites 9410 +sumac 9410 +sureties 9410 +swaying 9410 +sweetish 9410 +swelling 9410 +syndicate 9410 +Taoism 9410 +taxonomically 9410 +techniques 9410 +teem 9410 +teethe 9410 +tempering 9410 +Teresa 9410 +terminal 9410 +terminator 9410 +terminators 9410 +test 9410 +testicle 9410 +textures 9410 +theorizers 9410 +throttles 9410 +tidiness 9410 +timesharing 9410 +tinily 9410 +tinting 9410 +Tipperary 9410 +title 9410 +tragedies 9410 +traitor 9410 +trimmings 9410 +tropics 9410 +unaffected 9410 +uncovering 9410 +undoes 9410 +ungrateful 9410 +universals 9410 +unplug 9410 +unruly 9410 +untying 9410 +unwilling 9410 +vacuuming 9410 +validate 9410 +vanish 9410 +ventilate 9410 +veranda 9410 +vests 9410 +wallet 9410 +waltz 9410 +warm 9410 +warningly 9410 +watering 9410 +weasels 9410 +Weissmuller 9410 +western 9410 +whiteners 9410 +widens 9410 +Winsett 9410 +witchcraft 9410 +workers 9410 +Wotan 9410 +yelped 9410 +youthfulness 9410 +analyze table t2, t3; +Table Op Msg_type Msg_text +test.t2 analyze status OK +test.t3 analyze status OK +EXPLAIN select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 10.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL fld1 NULL NULL NULL 1199 10.00 Using where; Using temporary; Using filesort +2 SIMPLE t3 NULL eq_ref PRIMARY,period PRIMARY 4 test.t2.fld1 1 20.04 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`companynr` = 37) and (`test`.`t2`.`fld1` = `test`.`t3`.`t2nr`) and (`test`.`t3`.`period` >= 1001) and (`test`.`t3`.`period` <= 1002)) order by `test`.`t2`.`fld3`,`test`.`t3`.`period`,`test`.`t3`.`price` +select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +fld3 period price price2 +admonishing 1002 28357832 8723648 +analyzable 1002 28357832 8723648 +annihilates 1001 5987435 234724 +Antares 1002 28357832 8723648 +astound 1001 5987435 234724 +audiology 1001 5987435 234724 +Augustine 1002 28357832 8723648 +Baird 1002 28357832 8723648 +bewilderingly 1001 5987435 234724 +breaking 1001 5987435 234724 +Conley 1001 5987435 234724 +dentally 1002 28357832 8723648 +dissociate 1002 28357832 8723648 +elite 1001 5987435 234724 +eschew 1001 5987435 234724 +Eulerian 1001 5987435 234724 +flanking 1001 5987435 234724 +foldout 1002 28357832 8723648 +funereal 1002 28357832 8723648 +galling 1002 28357832 8723648 +Graves 1001 5987435 234724 +grazing 1001 5987435 234724 +groupings 1001 5987435 234724 +handgun 1001 5987435 234724 +humility 1002 28357832 8723648 +impulsive 1002 28357832 8723648 +inch 1001 5987435 234724 +intelligibility 1001 5987435 234724 +jarring 1001 5987435 234724 +lawgiver 1001 5987435 234724 +lectured 1002 28357832 8723648 +Merritt 1002 28357832 8723648 +neonatal 1001 5987435 234724 +offload 1002 28357832 8723648 +parters 1002 28357832 8723648 +pityingly 1002 28357832 8723648 +puddings 1002 28357832 8723648 +Punjab 1001 5987435 234724 +quitter 1002 28357832 8723648 +realtor 1001 5987435 234724 +relaxing 1001 5987435 234724 +repetitions 1001 5987435 234724 +resumes 1001 5987435 234724 +Romans 1002 28357832 8723648 +rusting 1001 5987435 234724 +scholastics 1001 5987435 234724 +skulking 1002 28357832 8723648 +stated 1002 28357832 8723648 +suites 1002 28357832 8723648 +sureties 1001 5987435 234724 +testicle 1002 28357832 8723648 +tinily 1002 28357832 8723648 +tragedies 1001 5987435 234724 +trimmings 1001 5987435 234724 +vacuuming 1001 5987435 234724 +ventilate 1001 5987435 234724 +wallet 1001 5987435 234724 +Weissmuller 1002 28357832 8723648 +Wotan 1002 28357832 8723648 +select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37; +fld1 fld3 period price price2 +018201 relaxing 1001 5987435 234724 +018601 vacuuming 1001 5987435 234724 +018801 inch 1001 5987435 234724 +018811 repetitions 1001 5987435 234724 +create table t4 ( +companynr tinyint(2) unsigned zerofill NOT NULL default '00', +companyname char(30) NOT NULL default '', +PRIMARY KEY (companynr), +UNIQUE KEY companyname(companyname) +) ENGINE=INNODB MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select * from t1,t1 t12; +Period Varor_period Period Varor_period +9410 9412 9410 9412 +select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505; +fld1 fld1 +250501 250501 +250501 250502 +250501 250503 +250501 250504 +250501 250505 +250502 250501 +250502 250502 +250502 250503 +250502 250504 +250502 250505 +250503 250501 +250503 250502 +250503 250503 +250503 250504 +250503 250505 +250504 250501 +250504 250502 +250504 250503 +250504 250504 +250504 250505 +250505 250501 +250505 250502 +250505 250503 +250505 250504 +250505 250505 +insert into t2 (fld1, companynr) values (999999,99); +ANALYZE TABLE t2, t4; +Table Op Msg_type Msg_text +test.t2 analyze status OK +test.t4 analyze status OK +select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +companynr companyname +99 NULL +select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null; +count(*) +1199 +explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1200 100.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1200 100.00 NULL +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 Using where; Not exists +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t2` left join `test`.`t4` on((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`)) where (`test`.`t4`.`companynr` is null) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1200 10.00 Using where; Not exists; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t2`.`companynr` is null) +select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +companynr companyname +select count(*) from t2 left join t4 using (companynr) where companynr is not null; +count(*) +1200 +explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t2` left join `test`.`t4` on(multiple equal(`test`.`t2`.`companynr`, `test`.`t4`.`companynr`)) where false +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on(multiple equal(`test`.`t4`.`companynr`, `test`.`t2`.`companynr`)) where false +delete from t2 where fld1=999999; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0) and (`test`.`t2`.`companynr` > 0)) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t4`.`companynr` > 0) and (`test`.`t4`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 40.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t2`.`companynr` > 0) or (`test`.`t2`.`companynr` is null)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index PRIMARY companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t2`.`companynr` > 0) or (`test`.`t4`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (ifnull(`test`.`t2`.`companynr`,1) > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t4`.`companynr` > 0) or (`test`.`t4`.`companynr` > 0)) +explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using where; Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (ifnull(`test`.`t4`.`companynr`,1) > 0) +select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +companynr companynr +37 36 +41 40 +explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index; Using temporary +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 10.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select distinct `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companynr` AS `companynr` from `test`.`t2` join `test`.`t4` where (`test`.`t2`.`companynr` = (`test`.`t4`.`companynr` + 1)) +select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909); +period +9410 +select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6))); +period +9410 +select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1; +fld1 +250501 +250502 +250503 +250505 +select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606); +fld1 +250502 +250503 +select fld1 from t2 where fld1 between 250502 and 250504; +fld1 +250502 +250503 +250504 +select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ; +fld3 +Lillian +label +labeled +labeled +landslide +laterally +leaflet +lewdly +luckily +select count(*) from t1; +count(*) +1 +select companynr,count(*),sum(fld1) from t2 group by companynr; +companynr count(*) sum(fld1) +00 82 10355753 +29 95 14473298 +34 70 17788966 +36 215 22786296 +37 588 83602098 +40 37 6618386 +41 52 12816335 +50 11 1595438 +53 4 793210 +58 23 2254293 +65 10 2284055 +68 12 3097288 +select companynr,count(*) from t2 group by companynr order by companynr desc limit 5; +companynr count(*) +68 12 +65 10 +58 23 +53 4 +50 11 +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +70 absentee vest 17788966 254128.0857 3272.5939722090234 10709871.306938833 +explain select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 9.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 order 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.97568479746 13352027981.708656 +29 95 abut wetness 14473298 152350.5053 8368.547956641249 70032594.90260443 +34 70 absentee vest 17788966 254128.0857 3272.5939722090234 10709871.306938833 +select +companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from +t3 where companynr = 37 group by companynr,t2nr order by companynr, t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select /*! SQL_SMALL_RESULT */ +companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from +t3 where companynr = 37 group by companynr,t2nr order by companynr, t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ; +companynr count(price) sum(price) min(price) max(price) avg(price) +101 4181 3489454238 834598 834598 834598.0000 +154 4181 4112197254950 983543950 983543950 983543950.0000 +311 4181 979599938 234298 234298 234298.0000 +37 12543 309394878010 5987435 39654943 24666736.6667 +447 4181 9929180954 2374834 2374834 2374834.0000 +512 4181 3288532102 786542 786542 786542.0000 +78 8362 414611089292 726498 98439034 49582766.0000 +select distinct mod(companynr,10) from t4 group by companynr; +mod(companynr,10) +0 +1 +3 +4 +5 +6 +7 +8 +9 +select distinct 1 from t4 group by companynr; +1 +1 +select count(distinct fld1) from t2; +count(distinct fld1) +1199 +select companynr,count(distinct fld1) from t2 group by companynr; +companynr count(distinct fld1) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(*) from t2 group by companynr; +companynr count(*) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,1000))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,200))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct floor(fld1/100)) from t2 group by companynr; +companynr count(distinct floor(fld1/100)) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr; +companynr count(distinct concat(repeat(65,1000),floor(fld1/100))) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10; +sum(fld1) fld3 +11402 Romans +select name,count(*) from t3 where name='cloakroom' group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name='cloakroom' and price>10 group by name; +name count(*) +cloakroom 4181 +select count(*) from t3 where name='cloakroom' and price2=823742; +count(*) +4181 +select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name; +name count(*) +extramarital 4181 +gazer 4181 +gems 4181 +Iranizes 4181 +spates 4181 +tucked 4181 +violinist 4181 +select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld3 count(*) +spates 4181 +select companynr|0,companyname from t4 group by 1; +companynr|0 companyname +0 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname; +companynr companyname count(*) +29 company 1 95 +68 company 10 12 +50 company 11 11 +34 company 2 70 +36 company 3 215 +37 company 4 588 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +00 Unknown 82 +select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld1 count(*) +158402 4181 +select sum(Period)/count(*) from t1; +sum(Period)/count(*) +9410.0000 +select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; +companynr count sum diff func +101 4181 3489454238 0.0000 422281 +154 4181 4112197254950 0.0000 643874 +311 4181 979599938 0.0000 1300291 +37 12543 309394878010 0.0000 464091 +447 4181 9929180954 0.0000 1868907 +512 4181 3288532102 0.0000 2140672 +78 8362 414611089292 0.0000 652236 +select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; +companynr avg +154 983543950.0000 +select companynr,count(*) from t2 group by companynr order by 2 desc; +companynr count(*) +37 588 +36 215 +29 95 +00 82 +34 70 +41 52 +40 37 +58 23 +68 12 +50 11 +65 10 +53 4 +select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc; +companynr count(*) +41 52 +58 23 +68 12 +50 11 +65 10 +53 4 +select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4; +fld4 fld1 count(price) sum(price) min(price) max(price) avg(price) +Abraham 018103 1 39654943 39654943 39654943 39654943.0000 +Anatole 038102 1 28357832 28357832 28357832 28357832.0000 +Beebe 018602 1 28357832 28357832 28357832 28357832.0000 +Chicana 038203 1 39654943 39654943 39654943 39654943.0000 +Conley 018101 1 5987435 5987435 5987435 5987435.0000 +Connally 018801 1 5987435 5987435 5987435 5987435.0000 +Graves 018052 1 28357832 28357832 28357832 28357832.0000 +Judas 018032 1 28357832 28357832 28357832 28357832.0000 +Kline 038101 1 5987435 5987435 5987435 5987435.0000 +Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000 +Merritt 016303 1 39654943 39654943 39654943 39654943.0000 +Parsifal 013802 1 28357832 28357832 28357832 28357832.0000 +Punjab 016302 1 28357832 28357832 28357832 28357832.0000 +Selfridge 019102 1 28357832 28357832 28357832 28357832.0000 +Simla 018402 1 28357832 28357832 28357832 28357832.0000 +Steinberg 012003 1 39654943 39654943 39654943 39654943.0000 +Taoism 018603 1 39654943 39654943 39654943 39654943.0000 +attainments 012303 1 39654943 39654943 39654943 39654943.0000 +audiology 011403 1 39654943 39654943 39654943 39654943.0000 +balled 012301 1 5987435 5987435 5987435 5987435.0000 +bee 038001 1 5987435 5987435 5987435 5987435.0000 +betroth 030501 1 5987435 5987435 5987435 5987435.0000 +bivalves 018013 1 39654943 39654943 39654943 39654943.0000 +bloodbath 018042 1 28357832 28357832 28357832 28357832.0000 +cage 018201 1 5987435 5987435 5987435 5987435.0000 +capably 012501 1 5987435 5987435 5987435 5987435.0000 +checkpoints 018803 1 39654943 39654943 39654943 39654943.0000 +coexist 018601 1 5987435 5987435 5987435 5987435.0000 +contrasted 016001 1 5987435 5987435 5987435 5987435.0000 +daughter 012703 1 39654943 39654943 39654943 39654943.0000 +dental 038003 1 39654943 39654943 39654943 39654943.0000 +dimensions 038202 1 28357832 28357832 28357832 28357832.0000 +disable 019103 1 39654943 39654943 39654943 39654943.0000 +dogging 018002 1 28357832 28357832 28357832 28357832.0000 +dreaded 011401 1 5987435 5987435 5987435 5987435.0000 +epistle 018062 1 28357832 28357832 28357832 28357832.0000 +erases 016301 1 5987435 5987435 5987435 5987435.0000 +eschew 011702 1 28357832 28357832 28357832 28357832.0000 +featherweight 012701 1 5987435 5987435 5987435 5987435.0000 +fetched 018802 1 28357832 28357832 28357832 28357832.0000 +fetters 018012 1 28357832 28357832 28357832 28357832.0000 +firearm 018812 1 28357832 28357832 28357832 28357832.0000 +flint 018022 1 28357832 28357832 28357832 28357832.0000 +flopping 018023 1 39654943 39654943 39654943 39654943.0000 +gritty 018811 1 5987435 5987435 5987435 5987435.0000 +hushes 018202 1 28357832 28357832 28357832 28357832.0000 +imprint 030503 1 39654943 39654943 39654943 39654943.0000 +impulsive 012602 1 28357832 28357832 28357832 28357832.0000 +interdependent 018051 1 5987435 5987435 5987435 5987435.0000 +interrelationships 036001 1 5987435 5987435 5987435 5987435.0000 +kanji 038002 1 28357832 28357832 28357832 28357832.0000 +lawgiver 013601 1 5987435 5987435 5987435 5987435.0000 +leavings 013803 1 39654943 39654943 39654943 39654943.0000 +lectured 018102 1 28357832 28357832 28357832 28357832.0000 +leftover 016201 1 5987435 5987435 5987435 5987435.0000 +medical 018041 1 5987435 5987435 5987435 5987435.0000 +minima 019101 1 5987435 5987435 5987435 5987435.0000 +neat 012001 1 5987435 5987435 5987435 5987435.0000 +neonatal 018053 1 39654943 39654943 39654943 39654943.0000 +normalizes 038013 1 39654943 39654943 39654943 39654943.0000 +parters 011701 1 5987435 5987435 5987435 5987435.0000 +partridges 038103 1 39654943 39654943 39654943 39654943.0000 +persist 012302 1 28357832 28357832 28357832 28357832.0000 +pessimist 012702 1 28357832 28357832 28357832 28357832.0000 +quitter 011703 1 39654943 39654943 39654943 39654943.0000 +railway 038011 1 5987435 5987435 5987435 5987435.0000 +readable 013603 1 39654943 39654943 39654943 39654943.0000 +recruited 038201 1 5987435 5987435 5987435 5987435.0000 +reporters 018403 1 39654943 39654943 39654943 39654943.0000 +riser 036002 1 28357832 28357832 28357832 28357832.0000 +scholastics 011402 1 28357832 28357832 28357832 28357832.0000 +scornfully 018003 1 39654943 39654943 39654943 39654943.0000 +skulking 018021 1 5987435 5987435 5987435 5987435.0000 +sorters 018061 1 5987435 5987435 5987435 5987435.0000 +squeaking 013901 1 5987435 5987435 5987435 5987435.0000 +starlet 012603 1 39654943 39654943 39654943 39654943.0000 +stated 013602 1 28357832 28357832 28357832 28357832.0000 +subschema 018043 1 39654943 39654943 39654943 39654943.0000 +sweetish 018001 1 5987435 5987435 5987435 5987435.0000 +swelling 031901 1 5987435 5987435 5987435 5987435.0000 +teethe 000001 1 5987435 5987435 5987435 5987435.0000 +testicle 013801 1 5987435 5987435 5987435 5987435.0000 +vacuuming 018033 1 39654943 39654943 39654943 39654943.0000 +validate 038012 1 28357832 28357832 28357832 28357832.0000 +wallet 011501 1 5987435 5987435 5987435 5987435.0000 +whiteners 016202 1 28357832 28357832 28357832 28357832.0000 +witchcraft 019201 1 5987435 5987435 5987435 5987435.0000 +select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3; +companynr fld3 sum(price) +512 Micronesia 786542 +512 Miles 786542 +512 boat 786542 +512 capably 786542 +512 cupboard 786542 +512 decliner 786542 +512 descendants 786542 +512 dopers 786542 +512 erases 786542 +512 skies 786542 +select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr; +companynr count(*) min(fld3) max(fld3) sum(price) avg(price) +00 1 Omaha Omaha 5987435 5987435.0000 +36 1 dubbed dubbed 28357832 28357832.0000 +37 83 Abraham Wotan 1908978016 22999735.1325 +50 2 scribbled tapestry 68012775 34006387.5000 +select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1; +t3.companynr+0 t2nr fld3 sum(price) +37 1 Omaha 5987435 +37 11401 breaking 5987435 +37 11402 Romans 28357832 +37 11403 intercepted 39654943 +37 11501 bewilderingly 5987435 +37 11701 astound 5987435 +37 11702 admonishing 28357832 +37 11703 sumac 39654943 +37 12001 flanking 5987435 +37 12003 combed 39654943 +37 12301 Eulerian 5987435 +37 12302 dubbed 28357832 +37 12303 Kane 39654943 +37 12501 annihilates 5987435 +37 12602 Wotan 28357832 +37 12603 snatching 39654943 +37 12701 grazing 5987435 +37 12702 Baird 28357832 +37 12703 celery 39654943 +37 13601 handgun 5987435 +37 13602 foldout 28357832 +37 13603 mystic 39654943 +37 13801 intelligibility 5987435 +37 13802 Augustine 28357832 +37 13803 teethe 39654943 +37 13901 scholastics 5987435 +37 16001 audiology 5987435 +37 16201 wallet 5987435 +37 16202 parters 28357832 +37 16301 eschew 5987435 +37 16302 quitter 28357832 +37 16303 neat 39654943 +37 18001 jarring 5987435 +37 18002 tinily 28357832 +37 18003 balled 39654943 +37 18012 impulsive 28357832 +37 18013 starlet 39654943 +37 18021 lawgiver 5987435 +37 18022 stated 28357832 +37 18023 readable 39654943 +37 18032 testicle 28357832 +37 18033 Parsifal 39654943 +37 18041 Punjab 5987435 +37 18042 Merritt 28357832 +37 18043 Quixotism 39654943 +37 18051 sureties 5987435 +37 18052 puddings 28357832 +37 18053 tapestry 39654943 +37 18061 trimmings 5987435 +37 18062 humility 28357832 +37 18101 tragedies 5987435 +37 18102 skulking 28357832 +37 18103 flint 39654943 +37 18201 relaxing 5987435 +37 18202 offload 28357832 +37 18402 suites 28357832 +37 18403 lists 39654943 +37 18601 vacuuming 5987435 +37 18602 dentally 28357832 +37 18603 humanness 39654943 +37 18801 inch 5987435 +37 18802 Weissmuller 28357832 +37 18803 irresponsibly 39654943 +37 18811 repetitions 5987435 +37 18812 Antares 28357832 +37 19101 ventilate 5987435 +37 19102 pityingly 28357832 +37 19103 interdependent 39654943 +37 19201 Graves 5987435 +37 30501 neonatal 5987435 +37 30502 scribbled 28357832 +37 30503 chafe 39654943 +37 31901 realtor 5987435 +37 36001 elite 5987435 +37 36002 funereal 28357832 +37 38001 Conley 5987435 +37 38002 lectured 28357832 +37 38003 Abraham 39654943 +37 38011 groupings 5987435 +37 38012 dissociate 28357832 +37 38013 coexist 39654943 +37 38101 rusting 5987435 +37 38102 galling 28357832 +37 38103 obliterates 39654943 +37 38201 resumes 5987435 +37 38202 analyzable 28357832 +37 38203 terminator 39654943 +select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008; +sum(price) +234298 +select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1; +fld1 sum(price) +038008 234298 +explain select fld3 from t2 where 1>2 or 2>3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where false +explain select fld3 from t2 where fld1=fld1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 100.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where true +select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000; +companynr count sum +00 82 10355753 +29 95 14473298 +34 70 17788966 +37 588 83602098 +41 52 12816335 +select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ; +companynr +00 +29 +34 +37 +41 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40; +companynr companyname count(*) +40 company 5 37 +41 company 6 52 +50 company 11 11 +53 company 7 4 +58 company 8 23 +65 company 9 10 +68 company 10 12 +select count(*) from t2; +count(*) +1199 +select count(*) from t2 where fld1 < 098024; +count(*) +387 +select min(fld1) from t2 where fld1>= 098024; +min(fld1) +98024 +select max(fld1) from t2 where fld1>= 098024; +max(fld1) +1232609 +select count(*) from t3 where price2=76234234; +count(*) +4181 +select count(*) from t3 where companynr=512 and price2=76234234; +count(*) +4181 +explain select min(fld1),max(fld1),count(*) from t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL index NULL fld1 4 NULL 1199 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t2`.`fld1`) AS `min(fld1)`,max(`test`.`t2`.`fld1`) AS `max(fld1)`,count(0) AS `count(*)` from `test`.`t2` +explain format=tree select min(fld1),max(fld1),count(*) from t2; +EXPLAIN +-> Count rows in t2 + +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +explain format=tree select min(fld1),max(fld1),count(*) from t2 where rand() > 0.5; +EXPLAIN +-> Aggregate: min(`min(fld1)`), max(`max(fld1)`), count(`count(*)`) + -> Parallel scan on + -> Aggregate: + -> Filter: (rand() > 0.5) (cost=123.65 rows=1199) + -> PQblock scan on t2 using fld1 (cost=123.65 rows=1199) + +select min(fld1),max(fld1),count(*) from t2; +min(fld1) max(fld1) count(*) +0 1232609 1199 +select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; +min(t2nr) max(t2nr) +2115 2115 +select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; +count(*) min(t2nr) max(t2nr) +4181 4 41804 +select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; +t2nr count(*) +9 1 +19 1 +29 1 +39 1 +49 1 +59 1 +69 1 +79 1 +89 1 +99 1 +109 1 +119 1 +129 1 +139 1 +149 1 +159 1 +169 1 +179 1 +189 1 +199 1 +select max(t2nr) from t3 where price=983543950; +max(t2nr) +41807 +select t1.period from t3 t1 limit 1; +period +1001 +select t1.period from t1 as t1 limit 1; +period +9410 +select t1.period as "Nuvarande period" from t1 as t1 limit 1; +Nuvarande period +9410 +select period as ok_period from t1 limit 1; +ok_period +9410 +select period as ok_period from t1 group by ok_period limit 1; +ok_period +9410 +select 1+1 as summa from t1 group by summa limit 1; +summa +2 +select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1; +Nuvarande period +9410 +show tables; +Tables_in_test +t1 +t2 +t3 +t4 +show tables from test like "s%"; +Tables_in_test (s%) +show tables from test like "t?"; +Tables_in_test (t?) +show full columns from t2; +Field Type Collation Null Key Default Extra Privileges Comment +auto int NULL NO PRI NULL auto_increment select,insert,update,references +fld1 int(6) unsigned zerofill NULL NO UNI 000000 select,insert,update,references +companynr tinyint(2) unsigned zerofill NULL NO 00 select,insert,update,references +fld3 char(30) utf8mb4_0900_ai_ci NO MUL select,insert,update,references +fld4 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld5 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld6 char(4) utf8mb4_0900_ai_ci NO select,insert,update,references +show full columns from t2 from test like 'f%'; +Field Type Collation Null Key Default Extra Privileges Comment +fld1 int(6) unsigned zerofill NULL NO UNI 000000 select,insert,update,references +fld3 char(30) utf8mb4_0900_ai_ci NO MUL select,insert,update,references +fld4 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld5 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld6 char(4) utf8mb4_0900_ai_ci NO select,insert,update,references +show full columns from t2 from test like 's%'; +Field Type Collation Null Key Default Extra Privileges Comment +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +show keys from t2; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Visible Expression +t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE YES NULL +t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE YES NULL +t2 1 fld3 1 fld3 A 1171 NULL NULL BTREE YES NULL +drop table t4, t3, t2, t1; +DO 1; +DO benchmark(100,1+1),1,1; +do default; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +do foobar; +ERROR 42S22: Unknown column 'foobar' in 'field list' +CREATE TABLE t1 ( +id mediumint(8) unsigned NOT NULL auto_increment, +pseudo varchar(35) NOT NULL default '', +PRIMARY KEY (id), +UNIQUE KEY pseudo (pseudo) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 (pseudo) VALUES ('test'); +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 1 as rnd1 from t1 where rand() > 2; +rnd1 +DROP TABLE t1; +CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1287 'BINARY as attribute of a type' is deprecated and will be removed in a future release. Please use a CHARACTER SET clause with _bin collation instead +INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); +CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +ERROR HY000: Incorrect DATETIME value: 'wrong-date-value' +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +DROP TABLE t1,t2; +create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); +select wss_type from t1 where wss_type ='102935229216544106'; +wss_type +select wss_type from t1 where wss_type ='102935229216544105'; +wss_type +select wss_type from t1 where wss_type ='102935229216544104'; +wss_type +select wss_type from t1 where wss_type ='102935229216544093'; +wss_type +102935229216544093 +select wss_type from t1 where wss_type =102935229216544093; +wss_type +102935229216544093 +drop table t1; +select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; +select @a; +@a +3 +select @b; +@b +aaaa +select @c; +@c +6.260 +create table t1 (a int not null auto_increment primary key); +insert into t1 values (); +insert into t1 values (); +insert into t1 values (); +select * from (t1 as t2 left join t1 as t3 using (a)), t1; +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from t1, (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); +a +1 +2 +3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +1 NULL +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); +a +1 +2 +3 +select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; +a +1 +2 +3 +select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +NULL 1 +select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); +a +1 +2 +3 +select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; +a +1 +2 +3 +select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; +a +1 +2 +3 +drop table t1; +CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); +CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); +select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; +aa id t2_id id +2 8299 2517 2517 +3 8301 2518 2518 +4 8302 2519 2519 +5 8303 2520 2520 +6 8304 2521 2521 +drop table t1,t2; +create table t1 (id1 int NOT NULL); +create table t2 (id2 int NOT NULL); +create table t3 (id3 int NOT NULL); +create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); +insert into t1 values (1); +insert into t1 values (2); +insert into t2 values (1); +insert into t4 values (1,1); +explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t4 NULL ALL id4 NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`id1` AS `id1`,`test`.`t2`.`id2` AS `id2`,`test`.`t3`.`id3` AS `id3`,`test`.`t4`.`id4` AS `id4`,`test`.`t4`.`id44` AS `id44` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`id2` = `test`.`t1`.`id1`)) left join `test`.`t3` on((`test`.`t3`.`id3` = `test`.`t1`.`id1`)) left join `test`.`t4` on((`test`.`t4`.`id4` = `test`.`t3`.`id3`)) where ((`test`.`t2`.`id2` = 1) or (`test`.`t4`.`id4` = 1)) +select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id1 id2 id3 id4 id44 +1 1 NULL NULL NULL +drop table t1,t2,t3,t4; +create table t1(s varchar(10) not null); +create table t2(s varchar(10) not null primary key); +create table t3(s varchar(10) not null primary key); +insert into t1 values ('one\t'), ('two\t'); +insert into t2 values ('one\r'), ('two\t'); +insert into t3 values ('one\b'), ('two\t'); +select * from t1 where s = 'one'; +s +select * from t2 where s = 'one'; +s +select * from t3 where s = 'one'; +s +one +select * from t1,t2 where t1.s = t2.s; +s s +two two +select * from t2,t3 where t2.s = t3.s; +s s +two two +drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +explain select * from t1 left join t2 on a=c where d in (4); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref c,d d 5 const 2 100.00 Using where +2 SIMPLE t1 NULL ref a a 5 test.t2.c 1 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ 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`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = 4)) +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref c,d d 5 const 2 100.00 Using where +2 SIMPLE t1 NULL ref a a 5 test.t2.c 1 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ 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`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = 4)) +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; +CREATE TABLE t1 ( +i int(11) NOT NULL default '0', +c char(10) NOT NULL default '', +PRIMARY KEY (i), +UNIQUE KEY c (c) +) ; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (1,'a'); +INSERT INTO t1 VALUES (2,'b'); +INSERT INTO t1 VALUES (3,'c'); +EXPLAIN SELECT i FROM t1 WHERE i=1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '1' AS `i` from `test`.`t1` where true +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref a a 23 test.t1.a 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` USE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref a a 23 test.t1.a 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` FORCE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +DROP TABLE t1, t2; +CREATE TABLE t1 ( city char(30) ) charset utf8mb4; +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`city` AS `city` from `test`.`t1` where (`test`.`t1`.`city` = 'London') +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`city` AS `city` from `test`.`t1` where ((`test`.`t1`.`city` = 'London') and (`test`.`t1`.`city` like '%london%')) +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,0), (1,1), (4294967295,1); +select a-b from t1 order by 1; +a-b +0 +1 +4294967294 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +4294967294 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +4294967294 +drop table t1; +create table t1 (a int(11)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +kunde_intern_id int(10) unsigned NOT NULL default '0', +kunde_id int(10) unsigned NOT NULL default '0', +FK_firma_id int(10) unsigned NOT NULL default '0', +aktuell enum('Ja','Nein') NOT NULL default 'Ja', +vorname varchar(128) NOT NULL default '', +nachname varchar(128) NOT NULL default '', +geloescht enum('Ja','Nein') NOT NULL default 'Nein', +firma varchar(128) NOT NULL default '' +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), +(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 +WHERE +( +( +( '' != '' AND firma LIKE CONCAT('%', '', '%')) +OR +(vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND +'Vorname1' != '' AND 'xxxx' != '') +) +AND +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, +geloescht FROM t1 +WHERE +( +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +AND +( +( '' != '' AND firma LIKE CONCAT('%', '', '%') ) +OR +( vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND +'xxxx' != '') +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT COUNT(*) FROM t1 WHERE +( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) +AND FK_firma_id = 2; +COUNT(*) +0 +drop table t1; +CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (0x8000000000000000); +SELECT b FROM t1 WHERE b=0x8000000000000000; +b +9223372036854775808 +DROP TABLE t1; +CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `t2` VALUES (0,'READ'); +CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `t3` VALUES (1,'fs'); +select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); +id name gid uid ident level +1 fs NULL NULL 0 READ +drop table t1,t2,t3; +CREATE TABLE t1 ( +acct_id int(11) NOT NULL default '0', +profile_id smallint(6) default NULL, +UNIQUE KEY t1$acct_id (acct_id), +KEY t1$profile_id (profile_id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (132,17),(133,18); +CREATE TABLE t2 ( +profile_id smallint(6) default NULL, +queue_id int(11) default NULL, +seq int(11) default NULL, +KEY t2$queue_id (queue_id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); +CREATE TABLE t3 ( +id int(11) NOT NULL default '0', +qtype int(11) default NULL, +seq int(11) default NULL, +warn_lvl int(11) default NULL, +crit_lvl int(11) default NULL, +rr1 tinyint(4) NOT NULL default '0', +rr2 int(11) default NULL, +default_queue tinyint(4) NOT NULL default '0', +KEY t3$qtype (qtype), +KEY t3$id (id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), +(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); +SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q +WHERE +(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND +(pq.queue_id = q.id) AND (q.rr1 <> 1); +COUNT(*) +4 +drop table t1,t2,t3; +create table t1 (f1 int); +insert into t1 values (1),(NULL); +create table t2 (f2 int, f3 int, f4 int); +create index idx1 on t2 (f4); +insert into t2 values (1,2,3),(2,4,6); +select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) +from t2 C where A.f4 = C.f4) or A.f3 IS NULL; +f2 +1 +NULL +drop table t1,t2; +create table t2 (a tinyint unsigned); +create index t2i on t2(a); +insert into t2 values (0), (254), (255); +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +explain select * from t2 where a > -1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index t2i t2i 2 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a` is not null) +select * from t2 where a > -1; +a +0 +254 +255 +drop table t2; +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +SELECT * FROM t1; +a b c +50 3 3 +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +select found_rows(); +found_rows() +0 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +SELECT * FROM t1; +a b c +50 3 3 +select count(*) from t1; +count(*) +1 +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +select count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; +count(*) +Warnings: +Warning 1287 SQL_CALC_FOUND_ROWS is deprecated and will be removed in a future release. Consider using two separate queries instead. +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +(SELECT a, b AS c FROM t1) ORDER BY c+1; +a c +(SELECT a, b AS c FROM t1) ORDER BY b+1; +a c +SELECT a, b AS c FROM t1 ORDER BY c+1; +a c +SELECT a, b AS c FROM t1 ORDER BY b+1; +a c +drop table t1; +create table t1(f1 int, f2 int); +create table t2(f3 int); +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); +f1 +insert into t1 values(1,1),(2,null); +insert into t2 values(2); +select * from t1,t2 where f1=f3 and (f1,f2) = (2,null); +f1 f2 f3 +select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null); +f1 f2 f3 +2 NULL 2 +drop table t1,t2; +create table t1 (f1 int not null auto_increment primary key, f2 varchar(10)); +create table t11 like t1; +insert into t1 values(1,""),(2,""); +analyze table t1, t11; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t11 analyze status OK +show table status like 't1%'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 InnoDB 10 Dynamic 2 8192 X X X X X X X X X NULL +t11 InnoDB 10 Dynamic 0 0 X X X X X X X X X NULL +select 123 as a from t1 where f1 is null; +a +drop table t1,t11; +CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); +INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); +CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, e INT ); +INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2),(1,2,3); +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 10 2 +1 11 2 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c; +a b c d +1 10 4 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c; +a b c d +1 10 2 +1 11 2 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2,t1 +WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 2 1 1 +1 2 2 1 +1 2 3 1 +DROP TABLE IF EXISTS t1, t2; +create table t1 (f1 int primary key, f2 int); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t1 values (1,1); +insert into t2 values (1,1),(1,2); +select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1; +count(f2) >0 +1 +drop table t1,t2; +create table t1 (f1 int,f2 int); +insert into t1 values(1,1); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t2 values(1,1); +select * from t1 where f1 in (select f3 from t2 where (f3,f4)= (select f3,f4 from t2)); +f1 f2 +1 1 +drop table t1,t2; +CREATE TABLE t1(a int, b int, c int, KEY b(b), KEY c(c)); +insert into t1 values (1,0,0),(2,0,0); +CREATE TABLE t2 (a int, b varchar(2), c varchar(2), PRIMARY KEY(a)); +insert into t2 values (1,'',''), (2,'',''); +CREATE TABLE t3 (a int, b int, PRIMARY KEY (a,b), KEY a (a), KEY b (b)); +insert into t3 values (1,1),(1,2); +explain select straight_join DISTINCT t2.a,t2.b, t1.c from t1, t3, t2 +where (t1.c=t2.a or (t1.c=t3.a and t2.a=t3.b)) and t1.b=556476786 and +t2.b like '%%' order by t2.b limit 0,1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ref b,c b 5 const 1 100.00 Using temporary; Using filesort +1 SIMPLE t3 NULL index PRIMARY,a,b a 4 NULL 2 100.00 Using index; Using join buffer (hash join) +1 SIMPLE t2 NULL ALL PRIMARY NULL NULL NULL 2 50.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select straight_join distinct `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t1`.`b` = 556476786) and ((`test`.`t2`.`a` = `test`.`t1`.`c`) or ((`test`.`t2`.`a` = `test`.`t3`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`c`))) and (`test`.`t2`.`b` like '%%')) order by `test`.`t2`.`b` limit 0,1 +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (a int, INDEX idx(a)); +INSERT INTO t1 VALUES (2), (3), (1); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 IGNORE INDEX (idx); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` IGNORE INDEX (`idx`) +EXPLAIN SELECT * FROM t1 IGNORE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +EXPLAIN SELECT * FROM t1 FORCE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +DROP TABLE t1; +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 VALUES (1,1), (2,1), (4,10); +CREATE TABLE t2 (a int PRIMARY KEY, b int, KEY b (b)); +INSERT INTO t2 VALUES (1,NULL), (2,10); +ALTER TABLE t1 ENABLE KEYS; +Warnings: +Note 1031 Table storage engine for 't1' doesn't have this option +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index b b 5 NULL 2 100.00 Using index +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select straight_join count(0) AS `COUNT(*)` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) or (`test`.`t2`.`b` is null)) +SELECT STRAIGHT_JOIN * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +a b a b +1 NULL 1 1 +1 NULL 2 1 +1 NULL 4 10 +2 10 4 10 +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index b b 5 NULL 2 100.00 Using index +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select straight_join count(0) AS `COUNT(*)` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) or (`test`.`t2`.`b` is null)) +SELECT STRAIGHT_JOIN * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +a b a b +1 NULL 1 1 +1 NULL 2 1 +1 NULL 4 10 +2 10 4 10 +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (key1 double default NULL, UNIQUE KEY key1 (key1)); +CREATE TABLE t2 (key2 double default NULL, UNIQUE KEY key2 (key2)); +INSERT INTO t1 VALUES (0.3762),(0.3845),(0.6158),(0.7941); +INSERT INTO t2 VALUES (1.3762),(1.3845),(1.6158),(1.7941); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +explain select max(key1) from t1 where key1 <= 0.6158; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)` from `test`.`t1` where (`test`.`t1`.`key1` <= 0.6158) +explain select max(key2) from t2 where key2 <= 1.6158; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t2`.`key2`) AS `max(key2)` from `test`.`t2` where (`test`.`t2`.`key2` <= 1.6158) +explain select min(key1) from t1 where key1 >= 0.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where (`test`.`t1`.`key1` >= 0.3762) +explain select min(key2) from t2 where key2 >= 1.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t2`.`key2`) AS `min(key2)` from `test`.`t2` where (`test`.`t2`.`key2` >= 1.3762) +explain select max(key1), min(key2) from t1, t2 +where key1 <= 0.6158 and key2 >= 1.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)`,min(`test`.`t2`.`key2`) AS `min(key2)` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`key1` <= 0.6158) and (`test`.`t2`.`key2` >= 1.3762)) +explain select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range key1 key1 9 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` <= 0.6158) and ((rand() + 0.5) >= 0.5)) +explain select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index key1 key1 9 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` >= 0.3762) and ((rand() + 0.5) >= 0.5)) +select max(key1) from t1 where key1 <= 0.6158; +max(key1) +0.6158 +select max(key2) from t2 where key2 <= 1.6158; +max(key2) +1.6158 +select min(key1) from t1 where key1 >= 0.3762; +min(key1) +0.3762 +select min(key2) from t2 where key2 >= 1.3762; +min(key2) +1.3762 +select max(key1), min(key2) from t1, t2 +where key1 <= 0.6158 and key2 >= 1.3762; +max(key1) min(key2) +0.6158 1.3762 +select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; +max(key1) +0.6158 +select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; +min(key1) +0.3762 +DROP TABLE t1,t2; +CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL); +INSERT INTO t1 VALUES (10); +SELECT i='1e+01',i=1e+01, i in (1e+01,1e+01), i in ('1e+01','1e+01') FROM t1; +i='1e+01' i=1e+01 i in (1e+01,1e+01) i in ('1e+01','1e+01') +1 1 1 1 +DROP TABLE t1; +create table t1(a bigint unsigned, b bigint); +insert ignore into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff), +(0x10000000000000000, 0x10000000000000000), +(0x8fffffffffffffff, 0x8fffffffffffffff); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'a' at row 2 +Warning 1264 Out of range value for column 'b' at row 2 +Warning 1264 Out of range value for column 'b' at row 3 +select hex(a), hex(b) from t1; +hex(a) hex(b) +FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +8FFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +drop table t1; +CREATE TABLE t1 (c0 int); +CREATE TABLE t2 (c0 int); +INSERT INTO t1 VALUES(@@connect_timeout); +INSERT INTO t2 VALUES(@@connect_timeout); +SELECT * FROM t1 JOIN t2 ON t1.c0 = t2.c0 WHERE (t1.c0 <=> @@connect_timeout); +c0 c0 +X X +DROP TABLE t1, t2; +End of 4.1 tests +CREATE TABLE t1 ( +K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', +K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', +F2I4 int(11) NOT NULL default '0' +) DEFAULT CHARSET=latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +('W%RT', '0100', 1), +('W-RT', '0100', 1), +('WART', '0100', 1), +('WART', '0200', 1), +('WERT', '0100', 2), +('WORT','0200', 2), +('WT', '0100', 2), +('W_RT', '0100', 2), +('WaRT', '0100', 3), +('WART', '0300', 3), +('WRT' , '0400', 3), +('WURM', '0500', 3), +('W%T', '0600', 4), +('WA%T', '0700', 4), +('WA_T', '0800', 4); +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND +(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); +K2C4 K4N4 F2I4 +WART 0200 1 +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); +K2C4 K4N4 F2I4 +WART 0100 1 +WART 0200 1 +WART 0300 3 +DROP TABLE t1; +create table t1 (a int, b int); +create table t2 like t1; +select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; +a +select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; +a +select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; +a a a +drop table t1,t2; +create table t1 (s1 varchar(5)); +insert into t1 values ('Wall'); +select min(s1) from t1 group by s1 with rollup; +min(s1) +Wall +Wall +drop table t1; +create table t1 (s1 int); +insert into t1 values (0); +select avg(distinct s1) from t1 group by s1 with rollup; +avg(distinct s1) +0.0000 +0.0000 +drop table t1; +create table t1 (s1 int); +insert into t1 values (null),(1); +select avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +1.0000 +select distinct avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +drop table t1; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +INSERT INTO t2 VALUES (2), (4), (6); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +a +2 +4 +EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 3 33.33 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` straight_join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`a`) +EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 20.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`) +DROP TABLE t1,t2; +select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; +x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 +16 16 2 2 +create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); +insert into t1 values (" 2", 2); +insert into t2 values (" 2", " one "),(" 2", " two "); +select * from t1 left join t2 on f1 = f3; +f1 f2 f3 f4 + 2 2 2 one + 2 2 2 two +drop table t1,t2; +create table t1 (empnum smallint, grp int); +create table t2 (empnum int, name char(5)); +insert into t1 values(1,1); +insert into t2 values(1,'bob'); +create view v1 as select * from t2 inner join t1 using (empnum); +select * from v1; +empnum name grp +1 bob 1 +drop table t1,t2; +drop view v1; +create table t1 (pk int primary key, b int); +create table t2 (pk int primary key, c int); +select pk from t1 inner join t2 using (pk); +pk +drop table t1,t2; +create table t1 (s1 int, s2 char(5), s3 decimal(10)); +create view v1 as select s1, s2, 'x' as s3 from t1; +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'x' +insert into t1 values (1,'x',5); +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'x' +drop table t1; +drop view v1; +create table t1(a1 int); +create table t2(a2 int); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +create view v2 (c) as select a1 from t1; +select * from t1 natural left join t2; +a1 a2 +1 1 +1 2 +2 1 +2 2 +select * from t1 natural right join t2; +a2 a1 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural left join t2; +c a2 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural right join t2; +a2 c +1 1 +1 2 +2 1 +2 2 +drop table t1, t2; +drop view v2; +create table t1 (a int(10), t1_val int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (b int(10), t2_val int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t3 (a int(10), b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,1),(2,2); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(2,1),(3,1),(4,1); +select * from t1 natural join t2 natural join t3; +a b t1_val t2_val +1 1 1 1 +2 1 2 1 +select * from t1 natural join t3 natural join t2; +b a t1_val t2_val +1 1 1 1 +1 2 2 1 +drop table t1, t2, t3; +DO IFNULL(NULL, NULL); +SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); +CAST(IFNULL(NULL, NULL) AS DECIMAL) +NULL +SELECT ABS(IFNULL(NULL, NULL)); +ABS(IFNULL(NULL, NULL)) +NULL +SELECT IFNULL(NULL, NULL); +IFNULL(NULL, NULL) +NULL +SET @OLD_SQL_MODE12595=@@SQL_MODE, @@SQL_MODE=''; +SHOW LOCAL VARIABLES LIKE 'SQL_MODE'; +Variable_name Value +sql_mode +CREATE TABLE BUG_12595(a varchar(100)) charset latin1; +INSERT INTO BUG_12595 VALUES ('hakan%'), ('hakank'), ("ha%an"); +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE ''; +a +hakan% +hakank +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE ''; +a +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha%%an' ESCAPE '%'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE '\\'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|'; +a +ha%an +SET @@SQL_MODE='NO_BACKSLASH_ESCAPES'; +SHOW LOCAL VARIABLES LIKE 'SQL_MODE'; +Variable_name Value +sql_mode NO_BACKSLASH_ESCAPES +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%'; +a +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE '\\'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE ''; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\n%' ESCAPE '\n'; +ERROR HY000: Incorrect arguments to ESCAPE +SET @@SQL_MODE=@OLD_SQL_MODE12595; +DROP TABLE BUG_12595; +create table t1 (a char(1)); +create table t2 (a char(1)); +insert into t1 values ('a'),('b'),('c'); +insert into t2 values ('b'),('c'),('d'); +select a from t1 natural join t2; +a +b +c +select * from t1 natural join t2 where a = 'b'; +a +b +drop table t1, t2; +CREATE TABLE t1 (`id` TINYINT); +CREATE TABLE t2 (`id` TINYINT); +CREATE TABLE t3 (`id` TINYINT); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +drop table t1, t2, t3; +create table t1 (a int(10),b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (a int(10),b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,10),(2,20),(3,30); +insert into t2 values (1,10); +select * from t1 inner join t2 using (A); +a b b +1 10 10 +select * from t1 inner join t2 using (a); +a b b +1 10 10 +drop table t1, t2; +create table t1 (a int, c int); +create table t2 (b int); +create table t3 (b int, a int); +create table t4 (c int); +insert into t1 values (1,1); +insert into t2 values (1); +insert into t3 values (1,1); +insert into t4 values (1); +select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +a c b b a +1 1 1 1 1 +select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +ERROR 42S22: Unknown column 't1.a' in 'on clause' +select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); +a c b b a c +1 1 1 1 1 1 +select * from t1 join t2 join t4 using (c); +c a b +1 1 1 +drop table t1, t2, t3, t4; +create table t1(x int, y int); +create table t2(x int, y int); +create table t3(x int, primary key(x)); +insert into t1 values (1, 1), (2, 1), (3, 1), (4, 3), (5, 6), (6, 6); +insert into t2 values (1, 1), (2, 1), (3, 3), (4, 6), (5, 6); +insert into t3 values (1), (2), (3), (4), (5); +select t1.x, t3.x from t1, t2, t3 where t1.x = t2.x and t3.x >= t1.y and t3.x <= t2.y; +x x +1 1 +2 1 +3 1 +3 2 +3 3 +4 3 +4 4 +4 5 +drop table t1,t2,t3; +create table t1 (id char(16) not null default '', primary key (id)); +insert into t1 values ('100'),('101'),('102'); +create table t2 (id char(16) default null); +insert into t2 values (1); +create view v1 as select t1.id from t1; +create view v2 as select t2.id from t2; +create view v3 as select (t1.id+2) as id from t1 natural left join t2; +select t1.id from t1 left join v2 using (id); +id +100 +101 +102 +select t1.id from v2 right join t1 using (id); +id +100 +101 +102 +select t1.id from t1 left join v3 using (id); +id +100 +101 +102 +select * from t1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join t1 using (id); +id +100 +101 +102 +select * from t1 left join v3 using (id); +id +100 +101 +102 +select v1.id from v1 left join v2 using (id); +id +100 +101 +102 +select v1.id from v2 right join v1 using (id); +id +100 +101 +102 +select v1.id from v1 left join v3 using (id); +id +100 +101 +102 +select * from v1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join v1 using (id); +id +100 +101 +102 +select * from v1 left join v3 using (id); +id +100 +101 +102 +drop table t1, t2; +drop view v1, v2, v3; +create table t1 (id int(11) not null default '0'); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (123),(191),(192); +create table t2 (id char(16) character set utf8 not null); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t2 values ('58013'),('58014'),('58015'),('58016'); +create table t3 (a_id int(11) not null, b_id char(16) character set utf8); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t3 values (123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013'); +select count(*) +from t1 inner join (t3 left join t2 on t2.id = t3.b_id) on t1.id = t3.a_id; +count(*) +6 +select count(*) +from t1 inner join (t2 right join t3 on t2.id = t3.b_id) on t1.id = t3.a_id; +count(*) +6 +drop table t1,t2,t3; +create table t1 (a int); +create table t2 (b int); +create table t3 (c int); +select * from t1 join t2 join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 left join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 right join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 straight_join t3 on (t1.a=t3.c); +a b c +drop table t1, t2 ,t3; +create table t1(f1 int, f2 date); +insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'), +(4,'2005-10-01'),(5,'2005-12-30'); +select * from t1 where f2 >= 0 order by f2; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +select * from t1 where f2 >= '0000-00-00' order by f2; +ERROR HY000: Incorrect DATE value: '0000-00-00' +select * from t1 where f2 >= '2005-09-31' order by f2; +ERROR HY000: Incorrect DATE value: '2005-09-31' +select * from t1 where f2 >= '2005-09-3a' order by f2; +f1 f2 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +select * from t1 where f2 <= '2005-09-31' order by f2; +ERROR HY000: Incorrect DATE value: '2005-09-31' +select * from t1 where f2 <= '2005-09-3a' order by f2; +f1 f2 +1 2005-01-01 +2 2005-09-01 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +drop table t1; +create table t1 (f1 int, f2 int); +insert into t1 values (1, 30), (2, 20), (3, 10); +create algorithm=merge view v1 as select f1, f2 from t1; +create algorithm=merge view v2 (f2, f1) as select f1, f2 from t1; +create algorithm=merge view v3 as select t1.f1 as f2, t1.f2 as f1 from t1; +select t1.f1 as x1, f1 from t1 order by t1.f1; +x1 f1 +1 1 +2 2 +3 3 +select v1.f1 as x1, f1 from v1 order by v1.f1; +x1 f1 +1 1 +2 2 +3 3 +select v2.f1 as x1, f1 from v2 order by v2.f1; +x1 f1 +10 10 +20 20 +30 30 +select v3.f1 as x1, f1 from v3 order by v3.f1; +x1 f1 +10 10 +20 20 +30 30 +select f1, f2, v1.f1 as x1 from v1 order by v1.f1; +f1 f2 x1 +1 30 1 +2 20 2 +3 10 3 +select f1, f2, v2.f1 as x1 from v2 order by v2.f1; +f1 f2 x1 +10 3 10 +20 2 20 +30 1 30 +select f1, f2, v3.f1 as x1 from v3 order by v3.f1; +f1 f2 x1 +10 3 10 +20 2 20 +30 1 30 +drop table t1; +drop view v1, v2, v3; +CREATE TABLE t1(key_a int4 NOT NULL, optimus varchar(32), PRIMARY KEY(key_a)); +CREATE TABLE t2(key_a int4 NOT NULL, prime varchar(32), PRIMARY KEY(key_a)); +CREATE table t3(key_a int4 NOT NULL, key_b int4 NOT NULL, foo varchar(32), +PRIMARY KEY(key_a,key_b)); +INSERT INTO t1 VALUES (0,''); +INSERT INTO t1 VALUES (1,'i'); +INSERT INTO t1 VALUES (2,'j'); +INSERT INTO t1 VALUES (3,'k'); +INSERT INTO t2 VALUES (1,'r'); +INSERT INTO t2 VALUES (2,'s'); +INSERT INTO t2 VALUES (3,'t'); +INSERT INTO t3 VALUES (1,5,'x'); +INSERT INTO t3 VALUES (1,6,'y'); +INSERT INTO t3 VALUES (2,5,'xx'); +INSERT INTO t3 VALUES (2,6,'yy'); +INSERT INTO t3 VALUES (2,7,'zz'); +INSERT INTO t3 VALUES (3,5,'xxx'); +SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +key_a foo +2 xx +EXPLAIN SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t3 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `key_a`,'xx' AS `foo` from `test`.`t1` join `test`.`t2` join `test`.`t3` where true +SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +key_a foo +2 xx +EXPLAIN SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t3 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `key_a`,'xx' AS `foo` from `test`.`t1` join `test`.`t2` join `test`.`t3` where true +DROP TABLE t1,t2,t3; +create table t1 (f1 int); +insert into t1 values(1),(2); +create table t2 (f2 int, f3 int, key(f2)); +insert into t2 values(1,1),(2,2); +create table t3 (f4 int not null); +insert into t3 values (2),(2),(2); +select f1,(select count(*) from t2,t3 where f2=f1 and f3=f4) as count from t1; +f1 count +1 0 +2 3 +drop table t1,t2,t3; +create table t1 (f1 int unique); +create table t2 (f2 int unique); +create table t3 (f3 int unique); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +insert into t3 values(1),(NULL); +select * from t3 where f3 is null; +f3 +NULL +select t2.f2 from t1 left join t2 on f1=f2 join t3 on f1=f3 where f1=1; +f2 +1 +drop table t1,t2,t3; +create table t1(f1 char, f2 char not null); +insert into t1 values(null,'a'); +create table t2 (f2 char not null); +insert into t2 values('b'); +select * from t1 left join t2 on f1=t2.f2 where t1.f2='a'; +f1 f2 f2 +NULL a NULL +drop table t1,t2; +select * from (select * left join t on f1=f2) tt; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left join t on f1=f2) tt' at line 1 +CREATE TABLE t1 (sku int PRIMARY KEY, pr int); +CREATE TABLE t2 (sku int PRIMARY KEY, sppr int, name varchar(255)); +INSERT INTO t1 VALUES +(10, 10), (20, 10), (30, 20), (40, 30), (50, 10), (60, 10); +INSERT INTO t2 VALUES +(10, 10, 'aaa'), (20, 10, 'bbb'), (30, 10, 'ccc'), (40, 20, 'ddd'), +(50, 10, 'eee'), (60, 20, 'fff'), (70, 20, 'ggg'), (80, 30, 'hhh'); +SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr +FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku); +sku sppr name sku pr +20 10 bbb 10 10 +20 10 bbb 20 10 +EXPLAIN +SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr +FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select '20' AS `sku`,'10' AS `sppr`,'bbb' AS `name`,`test`.`t1`.`sku` AS `sku`,`test`.`t1`.`pr` AS `pr` from `test`.`t2` join `test`.`t1` where (((`test`.`t1`.`sku` = 20) or (`test`.`t1`.`sku` = '10'))) +DROP TABLE t1,t2; +SET SQL_MODE='NO_UNSIGNED_SUBTRACTION'; +CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL); +INSERT t1 SET i = 0; +UPDATE t1 SET i = -1; +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +UPDATE t1 SET i = CAST(i - 1 AS SIGNED); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +UPDATE t1 SET i = i - 1; +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +DROP TABLE t1; +SET SQL_MODE=default; +create table t1 (a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t2 (a int, b int, c int, e int, primary key(a,b,c)); +# The "ANALYZE TABLE"-command that is executed further down will get +# different results depending on the order of rows in table t2. Since the +# INSERT INTO ... SELECT may be executed using different execution plans, +# we've added ORDER BY to ensure that we rows has the same order every +# time. If not, the estimated number of rows for t2 (alias 'a') in the +# EXPLAIN may change on different platforms. Note that both table t1 and +# t2 may be MYISAM, since many of the test files that includes this file +# forces MYISAM as the default storage engine. +insert into t2 select A.a, B.a, C.a, C.a from t1 A, t1 B, t1 C +ORDER BY A.a, B.a, C.a; +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select 'In next EXPLAIN, B.rows must be exactly 10:' Z; +Z +In next EXPLAIN, B.rows must be exactly 10: +explain select * from t2 a, t2 b where a.a=5 and a.b=5 and a.c<5 +and b.a=5 and b.b=a.e and (b.b =1 or b.b = 3 or b.b=5); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 27.10 Parallel execute (1 workers) +2 SIMPLE a NULL range PRIMARY PRIMARY 12 NULL 5 27.10 Using where +2 SIMPLE b NULL ref PRIMARY PRIMARY 8 const,test.a.e 10 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`b` AS `b`,`test`.`a`.`c` AS `c`,`test`.`a`.`e` AS `e`,`test`.`b`.`a` AS `a`,`test`.`b`.`b` AS `b`,`test`.`b`.`c` AS `c`,`test`.`b`.`e` AS `e` from `test`.`t2` `a` join `test`.`t2` `b` where ((`test`.`b`.`b` = `test`.`a`.`e`) and (`test`.`b`.`a` = 5) and (`test`.`a`.`b` = 5) and (`test`.`a`.`a` = 5) and (`test`.`a`.`c` < 5) and ((`test`.`a`.`e` = 1) or (`test`.`a`.`e` = 3) or (`test`.`a`.`e` = 5))) +drop table t1, t2; +CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX(b)); +INSERT INTO t1 VALUES (1, 3), (9,4), (7,5), (4,5), (6,2), +(3,1), (5,1), (8,9), (2,2), (0,9); +CREATE TABLE t2 (c int, d int, f int, INDEX(c,f)); +INSERT INTO t2 VALUES +(1,0,0), (1,0,1), (2,0,0), (2,0,1), (3,0,0), (4,0,1), +(5,0,0), (5,0,1), (6,0,0), (0,0,1), (7,0,0), (7,0,1), +(0,0,0), (0,0,1), (8,0,0), (8,0,1), (9,0,0), (9,0,1); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,b b 5 NULL 3 100.00 Using where; Using index +2 SIMPLE t2 NULL ref c c 5 test.t1.a 1 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2`.`f` AS `f` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` between 4 and 6)) +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6 AND a > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 90.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,b b 9 NULL 3 90.00 Using where; Using index +2 SIMPLE t2 NULL ref c c 5 test.t1.a 1 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2`.`f` AS `f` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` between 4 and 6) and (`test`.`t1`.`a` > 0)) +DROP TABLE t1, t2; +create table t1 ( +a int unsigned not null auto_increment primary key, +b bit not null, +c bit not null +); +create table t2 ( +a int unsigned not null auto_increment primary key, +b bit not null, +c int unsigned not null, +d varchar(50) +); +insert into t1 (b,c) values (0,1), (0,1); +insert into t2 (b,c) values (0,1); +select t1.a, t1.b + 0, t1.c + 0, t2.a, t2.b + 0, t2.c, t2.d +from t1 left outer join t2 on t1.a = t2.c and t2.b <> 1 +where t1.b <> 1 order by t1.a; +a t1.b + 0 t1.c + 0 a t2.b + 0 c d +1 0 1 1 0 1 NULL +2 0 1 NULL NULL NULL NULL +drop table t1,t2; +SELECT 0.9888889889 * 1.011111411911; +0.9888889889 * 1.011111411911 +0.9998769417899202067879 +prepare stmt from 'select 1 as " a "'; +Warnings: +Warning 1466 Leading spaces are removed from name ' a ' +execute stmt; +a +1 +CREATE TABLE t1 (a int NOT NULL PRIMARY KEY, b int NOT NULL); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +CREATE TABLE t2 (c int NOT NULL, INDEX idx(c)); +INSERT INTO t2 VALUES +(1), (1), (1), (1), (1), (1), (1), (1), +(2), (2), (2), (2), +(3), (3), +(4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL ref idx idx 4 const 8 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '1' AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = '1')) +EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=4; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL ref idx idx 4 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '4' AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = '4')) +DROP TABLE t1, t2; +CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a int); +INSERT INTO t1 VALUES (1,2), (2,NULL), (3,2); +CREATE TABLE t2 (b int, c INT, INDEX idx1(b)); +INSERT INTO t2 VALUES (2,1), (3,2); +CREATE TABLE t3 (d int, e int, INDEX idx1(d)); +INSERT INTO t3 VALUES (2,10), (2,20), (1,30), (2,40), (2,50); +EXPLAIN +SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id +WHERE t1.id=2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL const idx1 NULL NULL NULL 1 100.00 Impossible ON condition +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL const idx1 NULL NULL NULL 1 100.00 Impossible ON condition +2 SIMPLE t3 NULL ref idx1 idx1 5 const 4 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `id`,NULL AS `a`,NULL AS `b`,NULL AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t3`.`e` AS `e` from `test`.`t1` left join `test`.`t2` on(multiple equal(NULL, NULL)) join `test`.`t3` where (`test`.`t3`.`d` = 2) +SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id +WHERE t1.id=2; +id a b c d e +2 NULL NULL NULL 2 10 +2 NULL NULL NULL 2 20 +2 NULL NULL NULL 2 40 +2 NULL NULL NULL 2 50 +DROP TABLE t1,t2,t3; +create table t1 (c1 varchar(1), c2 int, c3 int, c4 int, c5 int, c6 int, +c7 int, c8 int, c9 int, fulltext key (`c1`)); +select distinct match (`c1`) against ('z') , c2, c3, c4,c5, c6,c7, c8 +from t1 where c9=1 order by c2, c2; +match (`c1`) against ('z') c2 c3 c4 c5 c6 c7 c8 +drop table t1; +CREATE TABLE t1 (pk varchar(10) PRIMARY KEY, fk varchar(16)) charset utf8mb4; +CREATE TABLE t2 (pk varchar(16) PRIMARY KEY, fk varchar(10)) charset utf8mb4; +INSERT INTO t1 VALUES +('d','dddd'), ('i','iii'), ('a','aa'), ('b','bb'), ('g','gg'), +('e','eee'), ('c','cccc'), ('h','hhh'), ('j','jjj'), ('f','fff'); +INSERT INTO t2 VALUES +('jjj', 'j'), ('cc','c'), ('ccc','c'), ('aaa', 'a'), ('jjjj','j'), +('hhh','h'), ('gg','g'), ('fff','f'), ('ee','e'), ('ffff','f'), +('bbb','b'), ('ff','f'), ('cccc','c'), ('dddd','d'), ('jj','j'), +('aaaa','a'), ('bb','b'), ('eeee','e'), ('aa','a'), ('hh','h'); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk < 'c' AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` < 'c')) +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk BETWEEN 'a' AND 'b' AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` between 'a' and 'b')) +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk IN ('a','b') AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` in ('a','b'))) +DROP TABLE t1,t2; +CREATE TABLE t1 (a int, b varchar(20) NOT NULL, PRIMARY KEY(a)) charset utf8mb4; +CREATE TABLE t2 (a int, b varchar(20) NOT NULL, +PRIMARY KEY (a), UNIQUE KEY (b)) charset utf8mb4; +INSERT INTO t1 VALUES (1,'a'),(2,'b'),(3,'c'); +INSERT INTO t2 VALUES (1,'a'),(2,'b'),(3,'c'); +EXPLAIN SELECT t1.a FROM t1 LEFT JOIN t2 ON t2.b=t1.b WHERE t1.a=3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL const b b 82 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '3' AS `a` from `test`.`t1` left join `test`.`t2` on(multiple equal('c', 'c')) where true +DROP TABLE t1,t2; +CREATE TABLE t1(id int PRIMARY KEY, b int, e int); +CREATE TABLE t2(i int, a int, INDEX si(i), INDEX ai(a)); +CREATE TABLE t3(a int PRIMARY KEY, c char(4), INDEX ci(c)); +INSERT INTO t1 VALUES +(1,10,19), (2,20,22), (4,41,42), (9,93,95), (7, 77,79), +(6,63,67), (5,55,58), (3,38,39), (8,81,89); +INSERT INTO t2 VALUES +(21,210), (41,410), (82,820), (83,830), (84,840), +(65,650), (51,510), (37,370), (94,940), (76,760), +(22,220), (33,330), (40,400), (95,950), (38,380), +(67,670), (88,880), (57,570), (96,960), (97,970); +INSERT INTO t3 VALUES +(210,'bb'), (950,'ii'), (400,'ab'), (500,'ee'), (220,'gg'), +(440,'gg'), (310,'eg'), (380,'ee'), (840,'bb'), (830,'ff'), +(230,'aa'), (960,'ii'), (410,'aa'), (510,'ee'), (290,'bb'), +(450,'gg'), (320,'dd'), (390,'hh'), (850,'jj'), (860,'ff'); +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 +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si si 5 NULL 4 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` FORCE INDEX (`si`) join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t2`.`i` between '81' and '89') and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2,t3 +WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee') ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si,ai si 5 NULL 4 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t2`.`i` between '81' and '89') and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND +t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si si 5 NULL 2 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` FORCE INDEX (`si`) join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((`test`.`t2`.`i` = '81') or (`test`.`t2`.`i` = '89')) and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2,t3 +WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND +t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si,ai si 5 NULL 2 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((`test`.`t2`.`i` = '81') or (`test`.`t2`.`i` = '89')) and (`test`.`t3`.`c` in ('bb','ee'))) +DROP TABLE t1,t2,t3; +CREATE TABLE t1 ( f1 int primary key, f2 int, f3 int, f4 int, f5 int, f6 int, checked_out int); +CREATE TABLE t2 ( f11 int PRIMARY KEY ); +INSERT INTO t1 VALUES (1,1,1,0,0,0,0),(2,1,1,3,8,1,0),(3,1,1,4,12,1,0); +INSERT INTO t2 VALUES (62); +SELECT * FROM t1 LEFT JOIN t2 ON f11 = t1.checked_out GROUP BY f1 ORDER BY f2, f3, f4, f5 LIMIT 0, 1; +f1 f2 f3 f4 f5 f6 checked_out f11 +1 1 1 0 0 0 0 NULL +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(a int); +INSERT into t1 values (1), (2), (3); +SELECT * FROM t1 LIMIT 2, -1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1 +DROP TABLE t1; +set optimizer_switch='index_merge=off'; +CREATE TABLE t1 ( +ID_with_null int NULL, +ID_better int NOT NULL, +INDEX idx1 (ID_with_null), +INDEX idx2 (ID_better) +); +INSERT INTO t1 VALUES (1,1), (2,1), (null,3), (null,3), (null,3), (null,3); +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SELECT COUNT(*) FROM t1 WHERE ID_with_null IS NULL; +COUNT(*) +128 +SELECT COUNT(*) FROM t1 WHERE ID_better=1; +COUNT(*) +2 +EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 98.46 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 98.46 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID_with_null` AS `ID_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID_with_null` is null)) +DROP INDEX idx1 ON t1; +CREATE UNIQUE INDEX idx1 ON t1(ID_with_null); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 98.46 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 98.46 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID_with_null` AS `ID_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID_with_null` is null)) +DROP TABLE t1; +CREATE TABLE t1 ( +ID1_with_null int NULL, +ID2_with_null int NULL, +ID_better int NOT NULL, +INDEX idx1 (ID1_with_null, ID2_with_null), +INDEX idx2 (ID_better) +) ; +INSERT INTO t1 VALUES (1,1,1), (2,2,1), (3,null,3), (null,3,3), (null,null,3), +(3,null,3), (null,3,3), (null,null,3), (3,null,3), (null,3,3), (null,null,3); +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null=3; +COUNT(*) +24 +SELECT COUNT(*) FROM t1 WHERE ID1_with_null=3 AND ID2_with_null IS NULL; +COUNT(*) +24 +SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null IS NULL; +COUNT(*) +192 +SELECT COUNT(*) FROM t1 WHERE ID_better=1; +COUNT(*) +2 +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID2_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID1_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and ((`test`.`t1`.`ID2_with_null` = 3) is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 79.34 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 79.34 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and (`test`.`t1`.`ID2_with_null` is null)) +DROP INDEX idx1 ON t1; +CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID2_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null IS NULL ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID1_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID2_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 79.34 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 79.34 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and (`test`.`t1`.`ID2_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND +(ID2_with_null=1 OR ID2_with_null=2); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 2.50 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 2.50 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and ((`test`.`t1`.`ID2_with_null` = 1) or (`test`.`t1`.`ID2_with_null` = 2))) +DROP TABLE t1; +set optimizer_switch='index_merge=on'; +CREATE TABLE t1 (a INT, ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY ts(ts)); +INSERT INTO t1 VALUES (30,"2006-01-03 23:00:00"), (31,"2006-01-03 23:00:00"); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CREATE TABLE t2 (a INT, dt1 DATETIME, dt2 DATETIME, PRIMARY KEY (a)); +INSERT INTO t2 VALUES (30, "2006-01-01 00:00:00", "2999-12-31 00:00:00"); +INSERT INTO t2 SELECT a+1,dt1,dt2 FROM t2; +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +EXPLAIN +SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 +AND t1.ts BETWEEN t2.dt1 AND t2.dt2 +AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t1 NULL range ts ts 4 NULL 2 50.00 Using index condition; Using where; Using MRR +Warnings: +Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`ts` AS `ts`,'30' AS `a`,'2006-01-01 00:00:00' AS `dt1`,'2999-12-31 00:00:00' AS `dt2` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = 30) and (`test`.`t1`.`ts` between '2006-01-01 00:00:00' and '2999-12-31 00:00:00') and (`test`.`t1`.`ts` between '2006-01-01' and '2006-12-31')) +SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 +AND t1.ts BETWEEN t2.dt1 AND t2.dt2 +AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; +a ts a dt1 dt2 +30 2006-01-03 23:00:00 30 2006-01-01 00:00:00 2999-12-31 00:00:00 +Warnings: +Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 +DROP TABLE t1,t2; +create table t1 (a bigint unsigned); +insert into t1 values +(if(1, 9223372036854775808, 1)), +(case when 1 then 9223372036854775808 else 1 end), +(coalesce(9223372036854775808, 1)); +select * from t1; +a +9223372036854775808 +9223372036854775808 +9223372036854775808 +drop table t1; +create table t1 charset utf8mb4 select +if(1, 9223372036854775808, 1) i, +case when 1 then 9223372036854775808 else 1 end c, +coalesce(9223372036854775808, 1) co; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` decimal(19,0) NOT NULL DEFAULT '0', + `c` decimal(19,0) NOT NULL DEFAULT '0', + `co` decimal(19,0) NOT NULL DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +select +if(1, cast(1111111111111111111 as unsigned), 1) i, +case when 1 then cast(1111111111111111111 as unsigned) else 1 end c, +coalesce(cast(1111111111111111111 as unsigned), 1) co; +i c co +1111111111111111111 1111111111111111111 1111111111111111111 +CREATE TABLE t1 (name varchar(255)) charset latin1; +CREATE TABLE t2 (name varchar(255), n int, KEY (name(3))) charset latin1; +INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); +INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); +INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); +INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT * FROM t2; +name n +bb 1 +aa 2 +cc 3 +cc  4 +cc 5 +bb 6 +cc 7 +SELECT * FROM t2 ORDER BY name; +name n +aa 2 +bb 1 +bb 6 +cc  4 +cc 3 +cc 5 +cc 7 +SELECT name, LENGTH(name), n FROM t2 ORDER BY name; +name LENGTH(name) n +aa 2 2 +bb 2 1 +bb 3 6 +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref name name 6 const 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` = 'cc ') +SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +name LENGTH(name) n +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +name LENGTH(name) n +cc 5 3 +cc  4 4 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') order by `test`.`t2`.`name` +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +name LENGTH(name) n +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +2 SIMPLE t2 NULL ref name name 6 test.t1.name 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`name` AS `name`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`n` AS `n` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`name` = `test`.`t1`.`name`)) where true +SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +name name n +aa aa 2 +aa aa 2 +bb bb 1 +bb bb 6 +cc cc 5 +cc cc 7 +cc cc 3 +ccc NULL NULL +DROP TABLE t1,t2; +CREATE TABLE t1 (name text) charset latin1; +CREATE TABLE t2 (name text, n int, KEY (name(3))) charset latin1; +INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); +INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); +INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); +INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT * FROM t2; +name n +bb 1 +aa 2 +cc 3 +cc  4 +cc 5 +bb 6 +cc 7 +SELECT * FROM t2 ORDER BY name; +name n +aa 2 +bb 1 +bb 6 +cc  4 +cc 3 +cc 5 +cc 7 +SELECT name, LENGTH(name), n FROM t2 ORDER BY name; +name LENGTH(name) n +aa 2 2 +bb 2 1 +bb 3 6 +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ref name name 6 const 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` = 'cc ') +SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +name LENGTH(name) n +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +name LENGTH(name) n +cc 5 3 +cc  4 4 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') order by `test`.`t2`.`name` +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +name LENGTH(name) n +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref name name 6 test.t1.name 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`name` AS `name`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`n` AS `n` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`name` = `test`.`t1`.`name`)) where true +SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +name name n +aa aa 2 +aa aa 2 +bb bb 1 +bb bb 6 +cc cc 5 +cc cc 7 +cc cc 3 +ccc NULL NULL +DROP TABLE t1,t2; +CREATE TABLE t1 ( +access_id int NOT NULL default '0', +name varchar(20) default NULL, +`rank` int NOT NULL default '0', +KEY idx (access_id) +); +CREATE TABLE t2 ( +faq_group_id int NOT NULL default '0', +faq_id int NOT NULL default '0', +access_id int default NULL, +UNIQUE KEY idx1 (faq_id), +KEY idx2 (faq_group_id,faq_id) +); +INSERT INTO t1 VALUES +(1,'Everyone',2),(2,'Help',3),(3,'Technical Support',1),(4,'Chat User',4); +INSERT INTO t2 VALUES +(261,265,1),(490,494,1); +SELECT t2.faq_id +FROM t1 INNER JOIN t2 IGNORE INDEX (idx1) +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +SELECT t2.faq_id +FROM t1 INNER JOIN t2 +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +DROP TABLE t1,t2; +CREATE TABLE t1 (a INT, b INT, KEY inx (b,a)); +INSERT INTO t1 VALUES (1,1), (1,2), (1,3), (1,4), (1,5), (1, 6), (1,7); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT COUNT(*) FROM t1 f1 INNER JOIN t1 f2 +ON ( f1.b=f2.b AND f1.a NULL ALL NULL NULL NULL NULL 7 100.00 Parallel execute (1 workers) +2 SIMPLE f1 NULL index inx inx 10 NULL 7 100.00 Using where; Using index +2 SIMPLE f2 NULL ref inx inx 5 test.f1.b 1 33.33 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` `f1` join `test`.`t1` `f2` where ((`test`.`f2`.`b` = `test`.`f1`.`b`) and (`test`.`f1`.`b` not in (100,2232,3343,51111)) and (`test`.`f1`.`a` < `test`.`f2`.`a`)) +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 INT); +INSERT INTO t1 VALUES (1,11), (2,22), (2,22); +EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2)))))))))))))))))))))))))))))) > 0; +EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) > 0; +ERROR HY000: Too high level of nesting for select +DROP TABLE t1; +CREATE TABLE t1 ( +c1 int(11) NOT NULL AUTO_INCREMENT, +c2 varchar(1000) DEFAULT NULL, +c3 bigint(20) DEFAULT NULL, +c4 bigint(20) DEFAULT NULL, +PRIMARY KEY (c1) +) charset utf8mb4; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN +SELECT join_2.c1 +FROM +t1 AS join_0, +t1 AS join_1, +t1 AS join_2, +t1 AS join_3, +t1 AS join_4, +t1 AS join_5, +t1 AS join_6, +t1 AS join_7 +WHERE +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +OR +join_0.c2 < '?' AND +join_1.c2 < '?' AND +join_2.c2 > '?' AND +join_2.c2 < '!' AND +join_3.c2 > '?' AND +join_4.c2 = '?' AND +join_5.c2 <> '?' AND +join_6.c2 <> '?' AND +join_7.c2 >= '?' AND +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +GROUP BY +join_3.c1, +join_2.c1, +join_7.c1, +join_1.c1, +join_0.c1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL # 1 100.00 # +2 SIMPLE join_0 NULL ALL PRIMARY NULL NULL # 1 100.00 # +2 SIMPLE join_1 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_2 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_3 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_4 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_5 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_6 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_7 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +Warnings: +Note 1003 /* select#1 */ select `test`.`join_2`.`c1` AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where (((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`)) or ((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c2` = '?') and (`test`.`join_0`.`c2` < '?') and (`test`.`join_1`.`c2` < '?') and (`test`.`join_2`.`c2` > '?') and (`test`.`join_2`.`c2` < '!') and (`test`.`join_3`.`c2` > '?') and (`test`.`join_5`.`c2` <> '?') and (`test`.`join_6`.`c2` <> '?') and (`test`.`join_7`.`c2` >= '?'))) group by `test`.`join_3`.`c1`,`test`.`join_2`.`c1`,`test`.`join_7`.`c1`,`test`.`join_1`.`c1`,`test`.`join_0`.`c1` +SHOW WARNINGS; +Level Code Message +Note 1003 /* select#1 */ select `test`.`join_2`.`c1` AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where (((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`)) or ((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c2` = '?') and (`test`.`join_0`.`c2` < '?') and (`test`.`join_1`.`c2` < '?') and (`test`.`join_2`.`c2` > '?') and (`test`.`join_2`.`c2` < '!') and (`test`.`join_3`.`c2` > '?') and (`test`.`join_5`.`c2` <> '?') and (`test`.`join_6`.`c2` <> '?') and (`test`.`join_7`.`c2` >= '?'))) group by `test`.`join_3`.`c1`,`test`.`join_2`.`c1`,`test`.`join_7`.`c1`,`test`.`join_1`.`c1`,`test`.`join_0`.`c1` +DROP TABLE t1; +SELECT 1 AS ` `; + +1 +Warnings: +Warning 1474 Name ' ' has become '' +SELECT 1 AS ` `; + +1 +Warnings: +Warning 1474 Name ' ' has become '' +SELECT 1 AS ` x`; +x +1 +Warnings: +Warning 1466 Leading spaces are removed from name ' x' +CREATE VIEW v1 AS SELECT 1 AS ``; +ERROR 42000: Incorrect column name '' +CREATE VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT (SELECT 1 AS ` `); +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` x`; +Warnings: +Warning 1466 Leading spaces are removed from name ' x' +SELECT `x` FROM v1; +x +1 +ALTER VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +DROP VIEW v1; +select str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' + and '2007/10/20 00:00:00 GMT'; +str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' + and '2007/10/20 00:00:00 GMT' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT' +Warning 1292 Truncated incorrect date value: '2007/10/20 00:00:00 GMT' +select str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6'; +str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT-6' +select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6'; +ERROR HY000: Incorrect DATE value: '2007/10/2000:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007-10-1 00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007-10-01 x00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:x00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 x12:34:56 GMT-6' +select str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; +str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6' +select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; +str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' +0 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6' +select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56'; +str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56' +1 +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00' +0 +select str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00' +1 +select str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34' +select str_to_date('2007-02-30 12:34','%Y-%m-%d %H:%i') = '2007-02-30 12:34:00'; +ERROR HY000: Incorrect DATETIME value: '2007-02-30 12:34:00' +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00' + and '2007/10/20 00:00:00'; +str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00' + and '2007/10/20 00:00:00' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +set SQL_MODE=TRADITIONAL; +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00 12:34' for function str_to_date +select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01' + and '2007/10/20'; +str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01' + and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +set SQL_MODE=DEFAULT; +select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'; +str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +select str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20'; +str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '' for function str_to_date +select str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '' for function str_to_date +select str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = ''; +ERROR HY000: Incorrect DATETIME value: '' +select str_to_date('1','%Y-%m-%d') = '1'; +ERROR HY000: Incorrect DATE value: '1' +select str_to_date('1','%Y-%m-%d') = '1'; +ERROR HY000: Incorrect DATE value: '1' +select str_to_date('','%Y-%m-%d') = ''; +ERROR HY000: Incorrect DATE value: '' +select str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL; +str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL +0 +Warnings: +Warning 1292 Truncated incorrect date value: '0000-00-00' +select str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00'; +str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00' +NULL +Warnings: +Warning 1292 Truncated incorrect date value: '2000-00-00' +select str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL; +str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL +0 +CREATE TABLE t1 (c11 INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY); +CREATE TABLE t2 (c21 INT UNSIGNED NOT NULL, +c22 INT DEFAULT NULL, +KEY(c21, c22)); +CREATE TABLE t3 (c31 INT UNSIGNED NOT NULL DEFAULT 0, +c32 INT DEFAULT NULL, +c33 INT NOT NULL, +c34 INT UNSIGNED DEFAULT 0, +KEY (c33, c34, c32)); +INSERT INTO t1 values (),(),(),(),(); +INSERT INTO t2 SELECT a.c11, b.c11 FROM t1 a, t1 b; +INSERT INTO t3 VALUES (1, 1, 1, 0), +(2, 2, 0, 0), +(3, 3, 1, 0), +(4, 4, 0, 0), +(5, 5, 1, 0); +SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND +t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND +t3.c33 = 1 AND t2.c22 in (1, 3) +ORDER BY c32; +c32 +1 +1 +3 +3 +5 +5 +SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND +t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND +t3.c33 = 1 AND t2.c22 in (1, 3) +ORDER BY c32 DESC; +c32 +5 +5 +3 +3 +1 +1 +DROP TABLE t1, t2, t3; + +# +# Bug#30736: Row Size Too Large Error Creating a Table and +# Inserting Data. +# +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; + +CREATE TABLE t1( +c1 DECIMAL(10, 2), +c2 FLOAT); + +INSERT INTO t1 VALUES (0, 1), (2, 3), (4, 5); + +CREATE TABLE t2( +c3 DECIMAL(10, 2)) +SELECT +c1 * c2 AS c3 +FROM t1; + +SELECT * FROM t1; +c1 c2 +0.00 1 +2.00 3 +4.00 5 + +SELECT * FROM t2; +c3 +0.00 +6.00 +20.00 + +DROP TABLE t1; +DROP TABLE t2; + +CREATE TABLE t1 (c1 BIGINT NOT NULL); +INSERT INTO t1 (c1) VALUES (1); +SELECT * FROM t1 WHERE c1 > NULL + 1; +c1 +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10) NOT NULL PRIMARY KEY); +INSERT INTO t1 (a) VALUES ('foo0'), ('bar0'), ('baz0'); +SELECT * FROM t1 WHERE a IN (CONCAT('foo', 0), 'bar'); +a +foo0 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +CREATE TABLE t2 (a INT, c INT, KEY(a)); +INSERT INTO t1 VALUES (1, 1), (2, 2); +INSERT INTO t2 VALUES (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), +(2, 1), (2, 2), (2, 3), (2, 4), (2, 5), +(3, 1), (3, 2), (3, 3), (3, 4), (3, 5), +(4, 1), (4, 2), (4, 3), (4, 4), (4, 5); +FLUSH STATUS; +SELECT DISTINCT b FROM t1 LEFT JOIN t2 USING(a) WHERE c <= 3; +b +1 +2 +SHOW STATUS LIKE 'Handler_read%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 13 +Handler_read_last 0 +Handler_read_next 10 +Handler_read_prev 0 +Handler_read_rnd 10 +Handler_read_rnd_next 6 +DROP TABLE t1, t2; +CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0', +f2 int(11) NOT NULL default '0', +f3 bigint(20) NOT NULL default '0', +f4 varchar(255) NOT NULL default '', +PRIMARY KEY (f1), +KEY key1 (f4), +KEY key2 (f2)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t2 (f1 int(11) NOT NULL default '0', +f2 enum('A1','A2','A3') NOT NULL default 'A1', +f3 int(11) NOT NULL default '0', +PRIMARY KEY (f1), +KEY key1 (f3)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0', +f2 datetime NOT NULL default '1980-01-01 00:00:00', +PRIMARY KEY (f1)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1, 1, 1, 'abc'); +insert into t1 values (2, 1, 2, 'def'); +insert into t1 values (3, 1, 2, 'def'); +insert into t2 values (1, 'A1', 1); +insert into t3 values (1, '1980-01-01'); +SELECT a.f3, cr.f4, count(*) count +FROM t2 a +STRAIGHT_JOIN t1 cr ON cr.f2 = a.f1 +LEFT JOIN +(t1 cr2 +JOIN t3 ae2 ON cr2.f3 = ae2.f1 +) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND +cr.f4 = cr2.f4 +GROUP BY a.f3, cr.f4; +f3 f4 count +1 abc 1 +1 def 2 +drop table t1, t2, t3; +CREATE TABLE t1 (a INT KEY, b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a, b FROM t1 WHERE a > 1 AND a = b LIMIT 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 25.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 3 25.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 SELECT a, b FROM t1 WHERE a > 1 AND b = a LIMIT 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 25.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 3 25.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` > 1)) limit 2 +DROP TABLE t1; +# +# Bug#47019: Assertion failed: 0, file .\rt_mbr.c, line 138 when +# forcing a spatial index +# +CREATE TABLE t1(a LINESTRING NOT NULL SRID 0, SPATIAL KEY(a)); +INSERT INTO t1 VALUES +(ST_GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')), +(ST_GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')); +EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t2 NULL ALL a NULL NULL NULL 2 100.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; +1 +1 +1 +1 +1 +EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t2 NULL ALL a NULL NULL NULL 2 100.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` FORCE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); +1 +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug #48291 : crash with row() operator,select into @var, and +# subquery returning multiple rows +# +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (2),(3); +# Should not crash +SELECT 1 FROM t1 WHERE a <> 1 AND NOT +ROW(1,a) <=> ROW(1,(SELECT 1 FROM t1)) +INTO @var0; +ERROR 21000: Subquery returns more than 1 row +DROP TABLE t1; +# +# Bug #48458: simple query tries to allocate enormous amount of +# memory +# +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1(a INT NOT NULL, b YEAR); +INSERT INTO t1 VALUES (); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +CREATE TABLE t2(c INT); +# Should not err out because of out-of-memory +SELECT 1 FROM t2 JOIN t1 ON 1=1 +WHERE a != '1' AND NOT a >= b OR NOT ROW(b,a )<> ROW(a,a); +1 +DROP TABLE t1,t2; +SET sql_mode = default; +# +# Bug #49199: Optimizer handles incorrectly: +# field='const1' AND field='const2' in some cases + +CREATE TABLE t1(a DATETIME NOT NULL); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 00:00:00 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +DROP TABLE t1; +CREATE TABLE t1(a DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2001-01-01') +DROP TABLE t1; +CREATE TABLE t1(a TIMESTAMP NOT NULL NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 00:00:00 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +a b +2001-01-01 00:00:00 2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = DATE'2001-01-01') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b VARCHAR(20) NOT NULL) charset utf8mb4; +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +a b +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = '2001-01-01 00:00:00') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01'; +a b +2001-01-01 00:00:00 2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = '2001-01-01') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT x.a, y.a, z.a FROM t1 x +JOIN t1 y ON x.a=y.a +JOIN t1 z ON y.a=z.a +WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; +a a a +2001-01-01 00:00:00 2001-01-01 00:00:00 2001-01-01 00:00:00 +EXPLAIN SELECT x.a, y.a, z.a FROM t1 x +JOIN t1 y ON x.a=y.a +JOIN t1 z ON y.a=z.a +WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE x NULL ALL NULL NULL NULL NULL 1 100.00 Using where +2 SIMPLE y NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +2 SIMPLE z NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`y`.`a` AS `a`,`test`.`z`.`a` AS `a` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` where ((`test`.`x`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (`test`.`y`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (`test`.`z`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +# +# Bug #49897: crash in ptr_compare when char(0) NOT NULL +# column is used for ORDER BY +# +SET @old_sort_buffer_size= @@session.sort_buffer_size; +SET @@sort_buffer_size= 40000; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1(a CHAR(0) NOT NULL); +INSERT INTO t1 VALUES (0), (0), (0); +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a FROM t1 ORDER BY a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24404 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24404 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `test`.`t1`.`a` +SELECT a FROM t1 ORDER BY a; +DROP TABLE t1; +CREATE TABLE t1(a CHAR(0) NOT NULL, b CHAR(0) NOT NULL, c int); +INSERT INTO t1 VALUES (0, 0, 0), (0, 0, 2), (0, 0, 1); +# Since ANALYZE TABLE only reads a subset of the data, the statistics for +# table t1 depends on the row order. And since the INSERT INTO ... SELECT +# may be executed using different execution plans, we've added ORDER BY +# to ensure that we rows has the same order every time. If not, the +# estimated number of rows in EXPLAIN may change on different platforms. +# Note that the tables may MYISAM, since many of the test files that +# includes this file forces MYISAM as the default storage engine. +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a FROM t1 ORDER BY a LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `test`.`t1`.`a` limit 5 +SELECT a FROM t1 ORDER BY a LIMIT 5; +a + + + + + +EXPLAIN SELECT * FROM t1 ORDER BY a, b LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b` limit 5 +SELECT * FROM t1 ORDER BY a, b LIMIT 5; +a b c + 2 + 2 + 2 + 2 + 2 +EXPLAIN SELECT * FROM t1 ORDER BY a, b, c LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b`,`test`.`t1`.`c` limit 5 +SELECT * FROM t1 ORDER BY a, b, c LIMIT 5; +a b c + 0 + 0 + 0 + 0 + 0 +EXPLAIN SELECT * FROM t1 ORDER BY c, a LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`c`,`test`.`t1`.`a` limit 5 +SELECT * FROM t1 ORDER BY c, a LIMIT 5; +a b c + 0 + 0 + 0 + 0 + 0 +SET @@sort_buffer_size= @old_sort_buffer_size; +DROP TABLE t1; +SET sql_mode = default; +End of 5.0 tests +create table t1(a INT, KEY (a)); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5); +SELECT a FROM t1 ORDER BY a LIMIT 2; +a +1 +2 +SELECT a FROM t1 ORDER BY a LIMIT 2,4294967296; +a +3 +4 +5 +SELECT a FROM t1 ORDER BY a LIMIT 2,4294967297; +a +3 +4 +5 +DROP TABLE t1; +CREATE TABLE A (date_key date); +CREATE TABLE C ( +pk int, +int_nokey int, +int_key int, +date_key date NOT NULL, +date_nokey date, +varchar_key varchar(1) +); +INSERT IGNORE INTO C VALUES +(1,1,1,'0000-00-00',NULL,NULL), +(1,1,1,'0000-00-00',NULL,NULL); +Warnings: +Warning 1264 Out of range value for column 'date_key' at row 1 +Warning 1264 Out of range value for column 'date_key' at row 2 +SELECT 1 FROM C WHERE pk > ANY (SELECT 1 FROM C); +1 +SELECT COUNT(DISTINCT 1) FROM C +WHERE date_key = (SELECT 1 FROM A WHERE C.date_key IS NULL) GROUP BY pk; +COUNT(DISTINCT 1) +SELECT date_nokey FROM C +WHERE int_key IN (SELECT 1 FROM A) +HAVING date_nokey = '10:41:7' +ORDER BY date_key; +ERROR HY000: Incorrect DATE value: '10:41:7' +DROP TABLE A,C; +CREATE TABLE t1 (a INT NOT NULL, b INT); +INSERT INTO t1 VALUES (1, 1); +EXPLAIN SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where true +SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2; +a b +1 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL); +EXPLAIN SELECT * FROM t1 WHERE (a=a AND b=b AND c=c) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +EXPLAIN SELECT * FROM t1 WHERE (a=a AND a=a AND b=b) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +EXPLAIN SELECT * FROM t1 WHERE (a=a AND b=b AND a=a) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +DROP TABLE t1; +# +# Bug#45266: Uninitialized variable lead to an empty result. +# +drop table if exists A,AA,B,BB; +CREATE TABLE `A` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`date_key` date NOT NULL, +`date_nokey` date NOT NULL, +`datetime_key` datetime NOT NULL, +`int_nokey` int(11) NOT NULL, +`time_key` time NOT NULL, +`time_nokey` time NOT NULL, +PRIMARY KEY (`pk`), +KEY `date_key` (`date_key`), +KEY `time_key` (`time_key`), +KEY `datetime_key` (`datetime_key`) +); +CREATE TABLE `AA` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`int_nokey` int(11) NOT NULL, +`time_key` time NOT NULL, +KEY `time_key` (`time_key`), +PRIMARY KEY (`pk`) +); +CREATE TABLE `B` ( +`date_nokey` date NOT NULL, +`date_key` date NOT NULL, +`time_key` time NOT NULL, +`datetime_nokey` datetime NOT NULL, +`varchar_key` varchar(1) NOT NULL, +KEY `date_key` (`date_key`), +KEY `time_key` (`time_key`), +KEY `varchar_key` (`varchar_key`) +); +INSERT IGNORE INTO `B` VALUES ('2003-07-28','2003-07-28','15:13:38','0000-00-00 00:00:00','f'),('0000-00-00','0000-00-00','00:05:48','2004-07-02 14:34:13','x'); +CREATE TABLE `BB` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`int_nokey` int(11) NOT NULL, +`date_key` date NOT NULL, +`varchar_nokey` varchar(1) NOT NULL, +`date_nokey` date NOT NULL, +PRIMARY KEY (`pk`), +KEY `date_key` (`date_key`) +); +INSERT IGNORE INTO `BB` VALUES (10,8,'0000-00-00','i','0000-00-00'),(11,0,'2005-08-18','','2005-08-18'); +SELECT table1 . `pk` AS field1 +FROM +(BB AS table1 INNER JOIN +(AA AS table2 STRAIGHT_JOIN A AS table3 +ON ( table3 . `date_key` = table2 . `pk` )) +ON ( table3 . `datetime_key` = table2 . `int_nokey` )) +WHERE ( table3 . `date_key` <= 4 AND table2 . `pk` = table1 . `varchar_nokey`) +GROUP BY field1 ; +field1 +SELECT table3 .`date_key` field1 +FROM +B table1 LEFT JOIN B table3 JOIN +(BB table6 JOIN A table7 ON table6 .`varchar_nokey`) +ON table6 .`int_nokey` ON table6 .`date_key` + WHERE NOT ( table1 .`varchar_key` AND table7 .`pk`) GROUP BY field1; +field1 +NULL +SELECT table4 . `time_nokey` AS field1 FROM +(AA AS table1 CROSS JOIN +(AA AS table2 STRAIGHT_JOIN +(B AS table3 STRAIGHT_JOIN A AS table4 +ON ( table4 . `date_key` = table3 . `time_key` )) +ON ( table4 . `pk` = table3 . `date_nokey` )) +ON ( table4 . `time_key` = table3 . `datetime_nokey` )) +WHERE ( table4 . `time_key` < table1 . `time_key` AND +table1 . `int_nokey` != 'f') +GROUP BY field1 ORDER BY field1 , field1; +field1 +SELECT table1 .`time_key` field2 FROM B table1 LEFT JOIN BB JOIN A table5 ON table5 .`date_nokey` ON table5 .`int_nokey` GROUP BY field2; +field2 +00:05:48 +15:13:38 +drop table A,AA,B,BB; +#end of test for bug#45266 +# +# Bug#33546: Slowdown on re-evaluation of constant expressions. +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (2); +SELECT * FROM t1 WHERE a = 1 + 1; +a +2 +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE a = 1 + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 10.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = ((1 + 1))) +SELECT * FROM t1 HAVING a = 1 + 1; +a +2 +EXPLAIN SELECT * FROM t1 HAVING a = 1 + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 100.00 NULL +Warnings: +Note 1003 /* select#1 */ 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 +EXPLAIN SELECT * FROM t1, t2 WHERE a = b + (1 + 1); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = (`test`.`t2`.`b` + ((1 + 1)))) +SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; +b a +2 3 +EXPLAIN SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t2` left join `test`.`t1` on((`test`.`t1`.`a` = (`test`.`t2`.`b` + 1))) where true +EXPLAIN SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 33.33 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 33.33 Using where +Warnings: +Note 1003 /* select#1 */ 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; +RETURN 1; +END;| +SET @cnt := 0; +SELECT * FROM t1 WHERE a = f1(); +a +1 +SELECT @cnt; +@cnt +1 +EXPLAIN SELECT * FROM t1 WHERE a = f1(); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 +# +# BUG#48052: Valgrind warning - uninitialized value in init_read_record() +# +# Disable Index condition pushdown +SELECT @old_optimizer_switch:=@@optimizer_switch; +@old_optimizer_switch:=@@optimizer_switch +# +Warnings: +# 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +CREATE TABLE t1 ( +pk int(11) NOT NULL, +i int(11) DEFAULT NULL, +v varchar(1) DEFAULT NULL, +PRIMARY KEY (pk) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (2,7,'m'); +INSERT INTO t1 VALUES (3,9,'m'); +SELECT v +FROM t1 +WHERE NOT pk > 0 +HAVING v <= 't' +ORDER BY pk; +v +# Restore old value for Index condition pushdown +SET SESSION optimizer_switch=@old_optimizer_switch; +DROP TABLE t1; +# +# Bug#49489 Uninitialized cache led to a wrong result. +# +CREATE TABLE t1(c1 DOUBLE(5,4)); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (9.1234); +SELECT * FROM t1 WHERE c1 < 9.12345; +c1 +9.1234 +DROP TABLE t1; +# End of test for bug#49489. +# +# Bug #49517: Inconsistent behavior while using +# NULLable BIGINT and INT columns in comparison +# +CREATE TABLE t1(a BIGINT UNSIGNED NOT NULL, b BIGINT NULL, c INT NULL); +INSERT INTO t1 VALUES(105, NULL, NULL); +SELECT * FROM t1 WHERE b < 102; +a b c +SELECT * FROM t1 WHERE c < 102; +a b c +SELECT * FROM t1 WHERE 102 < b; +a b c +SELECT * FROM t1 WHERE 102 < c; +a b c +DROP TABLE t1; +# +# Bug #54459: Assertion failed: param.sort_length, +# file .\filesort.cc, line 149 (part II) +# +CREATE TABLE t1(a ENUM('') NOT NULL) charset latin1; +INSERT INTO t1 VALUES (), (), (); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` order by `(t1.a collate latin1_german2_ci)` +SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug #58422: Incorrect result when OUTER JOIN'ing +# with an empty table +# +CREATE TABLE t_empty(pk INT PRIMARY KEY, i INT); +CREATE TABLE t1(pk INT PRIMARY KEY, i INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3); +CREATE TABLE t2(pk INT PRIMARY KEY, i INT) ; +INSERT INTO t2 VALUES (1,1), (2,2), (3,3); +ANALYZE TABLE t_empty, t1, t2; +Table Op Msg_type Msg_text +test.t_empty analyze status OK +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`pk` = `test`.`t1`.`pk`) and (`test`.`t1`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`pk` = `test`.`t1`.`pk`) and (`test`.`t1`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t2 NULL range PRIMARY PRIMARY 4 NULL 2 33.33 Using where; Using join buffer (hash join) +2 SIMPLE t1 NULL eq_ref PRIMARY PRIMARY 4 test.t2.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`i` = `test`.`t_empty`.`i`) and (`test`.`t1`.`pk` = `test`.`t2`.`pk`) and (`test`.`t2`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +DROP TABLE t1,t2,t_empty; +End of 5.1 tests +# +# Bug#45227: Lost HAVING clause led to a wrong result. +# +CREATE TABLE `cc` ( +`int_nokey` int(11) NOT NULL, +`int_key` int(11) NOT NULL, +`varchar_key` varchar(1) NOT NULL, +`varchar_nokey` varchar(1) NOT NULL, +KEY `int_key` (`int_key`), +KEY `varchar_key` (`varchar_key`) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `cc` VALUES +(0,8,'q','q'),(5,8,'m','m'),(7,3,'j','j'),(1,2,'z','z'),(8,2,'a','a'),(2,6,'',''),(1,8,'e' +,'e'),(8,9,'t','t'),(5,2,'q','q'),(4,6,'b','b'),(5,5,'w','w'),(3,2,'m','m'),(0,4,'x','x'), +(8,9,'',''),(0,6,'w','w'),(4,5,'x','x'),(0,0,'e','e'),(0,0,'e','e'),(2,8,'p','p'),(0,0,'x' +,'x'); +EXPLAIN SELECT `varchar_nokey` g1 FROM cc WHERE `int_nokey` AND `int_key` <= 4 +HAVING g1 ORDER BY `varchar_key` LIMIT 6 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 9 90.00 Parallel execute (1 workers) +2 SIMPLE cc NULL range int_key int_key 4 NULL 9 90.00 Using index condition; Using where; Using MRR; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`cc`.`varchar_nokey` AS `g1` from `test`.`cc` where ((0 <> `test`.`cc`.`int_nokey`) and (`test`.`cc`.`int_key` <= 4)) having (0 <> `g1`) order by `test`.`cc`.`varchar_key` limit 6 +SELECT `varchar_nokey` g1 FROM cc WHERE `int_nokey` AND `int_key` <= 4 +HAVING g1 ORDER BY `varchar_key` LIMIT 6 ; +g1 +Warning 1292 Truncated incorrect DOUBLE value: 'a' +Warning 1292 Truncated incorrect DOUBLE value: 'j' +Warning 1292 Truncated incorrect DOUBLE value: 'm' +Warning 1292 Truncated incorrect DOUBLE value: 'q' +Warning 1292 Truncated incorrect DOUBLE value: 'z' +Warnings: +DROP TABLE cc; +# End of test#45227 +# +# Bug#54515: Crash in opt_range.cc::get_best_group_min_max on +# SELECT from VIEW with GROUP BY +# +CREATE TABLE t1 ( +col_int_key int DEFAULT NULL, +KEY int_key (col_int_key) +) ; +INSERT INTO t1 VALUES (1),(2); +CREATE VIEW view_t1 AS +SELECT t1.col_int_key AS col_int_key +FROM t1; +SELECT col_int_key FROM view_t1 GROUP BY col_int_key; +col_int_key +1 +2 +DROP VIEW view_t1; +DROP TABLE t1; +# End of test BUG#54515 +# +# Bug #57203 Assertion `field_length <= 255' failed. +# +SELECT coalesce((avg(distinct (ST_geomfromtext("point(25379 -22010)"))))) +UNION ALL +SELECT coalesce((avg(distinct (ST_geomfromtext("point(25379 -22010)"))))) +AS foo +; +ERROR HY000: Incorrect arguments to avg +CREATE table t1(a text); +INSERT INTO t1 VALUES (''), (''); +SELECT avg(distinct(t1.a)) FROM t1, t1 t2 +GROUP BY t2.a ORDER BY t1.a; +avg(distinct(t1.a)) +0 +DROP TABLE t1; +# End of test BUG#57203 +# +# Bug#63020: Function "format"'s 'locale' argument is not considered +# when creating a "view' +# +CREATE TABLE t1 (f1 DECIMAL(10,2)); +INSERT INTO t1 VALUES (11.67),(17865.3),(12345678.92); +CREATE VIEW view_t1 AS SELECT FORMAT(f1,1,'sk_SK') AS f1 FROM t1; +SHOW CREATE VIEW view_t1; +View Create View character_set_client collation_connection +view_t1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_t1` AS select format(`t1`.`f1`,1,'sk_SK') AS `f1` from `t1` utf8mb4 utf8mb4_0900_ai_ci +SELECT * FROM view_t1; +f1 +11,7 +17 865,3 +12 345 678,9 +DROP TABLE t1; +DROP VIEW view_t1; +# End of test BUG#63020 +# +# Bug #13571700 TINYBLOB NOT NULL, CRASH IN PROTOCOL::NET_STORE_DATA +# +CREATE TABLE t1 (a TINYBLOB NOT NULL); +SELECT a, COUNT(*) FROM t1 WHERE 0; +a COUNT(*) +NULL 0 +DROP TABLE t1; +# End of test BUG#13571700 +# +# Bug #18766378: CRASH IN ITEM_SUM_BIT::RESET_FIELD +# +CREATE TABLE t1(b int); +CREATE TABLE t2(a int); +INSERT INTO t1 VALUES (),(); +INSERT INTO t2 VALUES (),(); +SELECT +( SELECT 1 FROM t1 GROUP BY a +HAVING avg(distinct 1) ORDER BY max(a) +) +FROM t1, t2 +GROUP BY a; +( SELECT 1 FROM t1 GROUP BY a +HAVING avg(distinct 1) ORDER BY max(a) +) +1 +DROP TABLE t1,t2; +# End of test BUG#18766378 +# +# WL#13002: RESULTSET DIFFERENT NUMBER OF ROWS +# +CREATE TABLE t1 ( +f1 INTEGER, +f2 INTEGER, +INDEX i1 (f2) +); +INSERT INTO t1 VALUES (NULL,1); +INSERT INTO t1 VALUES (2,NULL); +INSERT INTO t1 VALUES (3,1); +INSERT INTO t1 VALUES (4,6); +INSERT INTO t1 VALUES (NULL,5); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (13,1); +INSERT INTO t1 VALUES (NULL,0); +INSERT INTO t1 VALUES (5,2); +INSERT INTO t1 VALUES (NULL,8); +INSERT INTO t1 VALUES (NULL,7); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (NULL,4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN FORMAT=tree SELECT * +FROM t1 AS alias1 LEFT JOIN t1 AS alias2 ON alias1.f1 = alias2.f2 +WHERE alias2.f1 NOT BETWEEN 4 AND 12; +EXPLAIN +-> Parallel scan on + -> Batched key access inner join + -> Batch input rows + -> PQblock scan on alias1 (cost=1.65 rows=14) + -> Filter: (alias2.f1 not between 4 and 12) + -> Multi-range index lookup on alias2 using i1 (f2=alias1.f1) + +SELECT * +FROM t1 AS alias1 LEFT JOIN t1 AS alias2 ON alias1.f1 = alias2.f2 +WHERE alias2.f1 NOT BETWEEN 4 AND 12; +f1 f2 f1 f2 +DROP TABLE t1; +set optimizer_switch=default; +set optimizer_switch=default; diff --git a/mysql-test/r/select_all_bka_nobnl.result-pq b/mysql-test/r/select_all_bka_nobnl.result-pq new file mode 100644 index 000000000000..6010b825a904 --- /dev/null +++ b/mysql-test/r/select_all_bka_nobnl.result-pq @@ -0,0 +1,5703 @@ +set optimizer_switch='batched_key_access=on,block_nested_loop=off,mrr_cost_based=off'; +set optimizer_switch='semijoin=on,materialization=on,firstmatch=on,loosescan=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=off'; +drop table if exists t1,t2,t3,t4,t11; +drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; +drop view if exists v1; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +); +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +select * from t1; +Period Varor_period +9410 9412 +select t1.* from t1; +Period Varor_period +9410 9412 +CREATE TABLE t2 ( +auto int not null auto_increment, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL, +UNIQUE fld1 (fld1), +KEY fld3 (fld3), +PRIMARY KEY (auto) +) charset utf8mb4; +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +imaginable +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +cultivation +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3 from t2 order by fld3 desc limit 10; +fld3 +youthfulness +yelped +Wotan +workers +Witt +witchcraft +Winsett +Willy +willed +wildcats +select fld3 from t2 order by fld3 desc limit 5; +fld3 +youthfulness +yelped +Wotan +workers +Witt +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +witchcraft +Winsett +Willy +willed +wildcats +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'h%le'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; +fld3 +explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 0.09 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 0.09 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` IGNORE INDEX (`fld3`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 0.09 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 0.09 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld1`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld3`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld3`) USE INDEX (`fld1`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 ignore index (fld3,not_used); +ERROR 42000: Key 'not_used' doesn't exist in table 't2' +explain select fld3 from t2 use index (not_used); +ERROR 42000: Key 'not_used' doesn't exist in table 't2' +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +honeysuckle +honoring +explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range fld3 fld3 120 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where ((`test`.`t2`.`fld3` >= 'honeysuckle') and (`test`.`t2`.`fld3` <= 'honoring')) order by `test`.`t2`.`fld3` +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +fld1 fld3 +148504 Colombo +068305 Colombo +000000 nondecreasing +select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes'; +fld1 fld3 +232605 appendixes +1232605 appendixes +1232606 appendixes +1232607 appendixes +1232608 appendixes +1232609 appendixes +select fld1 from t2 where fld1=250501 or fld1="250502"; +fld1 +250501 +250502 +explain select fld1 from t2 where fld1=250501 or fld1="250502"; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL range fld1 fld1 4 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld1` AS `fld1` from `test`.`t2` where ((`test`.`t2`.`fld1` = 250501) or (`test`.`t2`.`fld1` = 250502)) +select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +fld1 +250501 +250502 +250505 +250601 +explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL range fld1 fld1 4 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld1` AS `fld1` from `test`.`t2` where ((`test`.`t2`.`fld1` = 250501) or (`test`.`t2`.`fld1` = 250502) or ((`test`.`t2`.`fld1` >= 250505) and (`test`.`t2`.`fld1` <= 250601)) or (`test`.`t2`.`fld1` between 250501 and 250502)) +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +fld1 fld3 +012001 flanking +013602 foldout +013606 fingerings +018007 fanatic +018017 featherweight +018054 fetters +018103 flint +018104 flopping +036002 funereal +038017 fetched +038205 firearm +058004 Fenton +088303 feminine +186002 freakish +188007 flurried +188505 fitting +198006 furthermore +202301 Fitzpatrick +208101 fiftieth +208113 freest +218008 finishers +218022 feed +218401 faithful +226205 foothill +226209 furnishings +228306 forthcoming +228311 fated +231315 freezes +232102 forgivably +238007 filial +238008 fixedly +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +fld3 +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +fld3 +Chantilly +select fld1,fld3 from t2 where fld1 like "25050%"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select fld1,fld3 from t2 where fld1 like "25050_"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select distinct companynr from t2; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr desc; +companynr +68 +65 +58 +53 +50 +41 +40 +37 +36 +34 +29 +00 +select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%" order by fld3; +fld3 period +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +select distinct fld3 from t2 where companynr = 34 order by fld3; +fld3 +absentee +accessed +ahead +alphabetic +Asiaticizations +attitude +aye +bankruptcies +belays +Blythe +bomb +boulevard +bulldozes +cannot +caressing +charcoal +checksumming +chess +clubroom +colorful +cosy +creator +crying +Darius +diffusing +duality +Eiffel +Epiphany +Ernestine +explorers +exterminated +famine +forked +Gershwins +heaving +Hodges +Iraqis +Italianization +Lagos +landslide +libretto +Majorca +mastering +narrowed +occurred +offerers +Palestine +Peruvianizes +pharmaceutic +poisoning +population +Pygmalion +rats +realest +recording +regimented +retransmitting +reviver +rouses +scars +sicker +sleepwalk +stopped +sugars +translatable +uncles +unexpected +uprisings +versatility +vest +select distinct fld3 from t2 limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct fld3 from t2 having fld3 like "A%" limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct substring(fld3,1,3) from t2 where fld3 like "A%"; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +Adl +adm +Ado +ads +adv +aer +aff +afi +afl +afo +agi +ahe +aim +air +Ald +alg +ali +all +alp +alr +ama +ame +amm +ana +and +ane +Ang +ani +Ann +Ant +api +app +aqu +Ara +arc +Arm +arr +Art +Asi +ask +asp +ass +ast +att +aud +Aug +aut +ave +avo +awe +aye +Azt +select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +create table t3 ( +period int not null, +name char(32) not null, +companynr int not null, +price double(11,0), +price2 double(11,0), +key (period), +key (name) +); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +create temporary table tmp select * from t3; +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +alter table t3 add t2nr int not null auto_increment primary key first; +drop table tmp; +SET BIG_TABLES=1; +select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10; +namn +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +SET BIG_TABLES=0; +select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10; +concat(fld3," ",fld3) +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +select distinct fld5 from t2 limit 10; +fld5 +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +select distinct companynr, fld3,count(*) from t2 group by companynr, fld3 order by companynr, fld3 limit 10; +companynr fld3 count(*) +00 affixed 1 +00 and 1 +00 annoyers 1 +00 Anthony 1 +00 assayed 1 +00 assurers 1 +00 attendants 1 +00 bedlam 1 +00 bedpost 1 +00 boasted 1 +SET BIG_TABLES=1; +select distinct companynr, fld3,count(*) from t2 group by companynr, fld3 order by companynr, fld3 limit 10; +companynr fld3 count(*) +00 affixed 1 +00 and 1 +00 annoyers 1 +00 Anthony 1 +00 assayed 1 +00 assurers 1 +00 attendants 1 +00 bedlam 1 +00 bedpost 1 +00 boasted 1 +SET BIG_TABLES=0; +select distinct companynr, fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr ,fld3 order by companynr, fld3 limit 100,10; +companynr fld3 repeat("a",length(fld3)) count(*) +29 chancellor aaaaaaaaaa 1 +29 Chippewa aaaaaaaa 1 +29 circumference aaaaaaaaaaaaa 1 +29 circus aaaaaa 1 +29 cited aaaaa 1 +29 Colombo aaaaaaa 1 +29 congresswoman aaaaaaaaaaaaa 1 +29 contrition aaaaaaaaaa 1 +29 corny aaaaa 1 +29 cultivation aaaaaaaaaaa 1 +select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2; +companynr rtrim(space(512+companynr)) +37 +78 +101 +154 +311 +447 +512 +select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; +fld3 +explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 10.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL fld1 NULL NULL NULL 1199 10.00 Using where; Using temporary; Using filesort +2 SIMPLE t3 NULL eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`t2nr` AS `t2nr`,`test`.`t2`.`fld3` AS `fld3` from `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld1` = `test`.`t3`.`t2nr`)) order by `test`.`t3`.`t2nr`,`test`.`t2`.`fld3` +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 41736 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL period NULL NULL NULL 41736 100.00 Using temporary; Using filesort +2 SIMPLE t3 NULL ref period period 4 test.t1.period 4173 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t3`.`period` = `test`.`t1`.`period`) order by `test`.`t3`.`period` +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 41736 100.00 Parallel execute (4 workers) +2 SIMPLE t3 NULL ALL period NULL NULL NULL 41736 100.00 Using temporary; Using filesort +2 SIMPLE t1 NULL ref period period 4 test.t3.period 4173 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t1`.`period` = `test`.`t3`.`period`) order by `test`.`t3`.`period` limit 10 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 41736 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL period NULL NULL NULL 41736 100.00 Using temporary; Using filesort +2 SIMPLE t3 NULL ref period period 4 test.t1.period 4173 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t3`.`period` = `test`.`t1`.`period`) order by `test`.`t1`.`period` limit 10 +select period from t1; +period +9410 +select period from t1 where period=1900; +period +select fld3,period from t1,t2 where fld1 = 011401 order by period; +fld3 period +breaking 9410 +select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001; +fld3 period +breaking 1001 +explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const fld1 fld1 4 const 1 100.00 NULL +1 SIMPLE t3 NULL const PRIMARY,period PRIMARY 4 const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select 'breaking' AS `fld3`,'1001' AS `period` from `test`.`t2` join `test`.`t3` where true +select fld3,period from t2,t1 where companynr*10 = 37*10 order by fld3; +fld3 period +abates 9410 +Abraham 9410 +abrogating 9410 +accessed 9410 +Aden 9410 +admiring 9410 +admonishing 9410 +Adolph 9410 +afield 9410 +afore 9410 +aging 9410 +airships 9410 +Aldrich 9410 +alike 9410 +Alison 9410 +allot 9410 +already 9410 +amenities 9410 +ammonium 9410 +analogy 9410 +analyzable 9410 +Anatole 9410 +animals 9410 +animized 9410 +annihilates 9410 +announced 9410 +announces 9410 +Antarctica 9410 +Antares 9410 +apiary 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +Arabia 9410 +arriving 9410 +Artemia 9410 +arteriole 9410 +assails 9410 +astound 9410 +attainments 9410 +attrition 9410 +audiology 9410 +Augustine 9410 +avenge 9410 +avoidable 9410 +babies 9410 +babysitting 9410 +Baird 9410 +balled 9410 +beaner 9410 +beaters 9410 +bee 9410 +Beebe 9410 +befouled 9410 +bellow 9410 +bestseller 9410 +betroth 9410 +bewilderingly 9410 +bills 9410 +bitterroot 9410 +bivalves 9410 +bloater 9410 +bloodbath 9410 +boat 9410 +boom 9410 +boorish 9410 +boulder 9410 +breaking 9410 +brunch 9410 +buckboards 9410 +burlesque 9410 +Butterfield 9410 +cage 9410 +capably 9410 +capped 9410 +cascade 9410 +Cassites 9410 +causality 9410 +cautioned 9410 +ceiling 9410 +celery 9410 +CERN 9410 +certificates 9410 +chafe 9410 +chaperone 9410 +charges 9410 +chasm 9410 +checkpoints 9410 +chewing 9410 +chews 9410 +Chicana 9410 +chillingly 9410 +Chippewa 9410 +chronicle 9410 +ciphers 9410 +civics 9410 +clamored 9410 +Clayton 9410 +clenched 9410 +clockers 9410 +coexist 9410 +cokes 9410 +combed 9410 +coming 9410 +commencements 9410 +commonplace 9410 +communicants 9410 +compartment 9410 +comprehensive 9410 +comprised 9410 +conceptions 9410 +concludes 9410 +congregates 9410 +Conley 9410 +Connally 9410 +contrary 9410 +contrasted 9410 +convenient 9410 +convulsion 9410 +corset 9410 +count 9410 +coverings 9410 +Crays 9410 +craziness 9410 +creak 9410 +creek 9410 +critiques 9410 +crunches 9410 +culled 9410 +cult 9410 +cupboard 9410 +cured 9410 +cute 9410 +daughter 9410 +decliner 9410 +decomposition 9410 +deductions 9410 +dehydrate 9410 +deludes 9410 +denizen 9410 +denotative 9410 +denounces 9410 +dental 9410 +dentally 9410 +descendants 9410 +despot 9410 +destroyer 9410 +detectably 9410 +dialysis 9410 +DiMaggio 9410 +dimensions 9410 +disable 9410 +discounts 9410 +disentangle 9410 +disobedience 9410 +dissociate 9410 +dogging 9410 +dopers 9410 +drains 9410 +dreaded 9410 +ducks 9410 +dusted 9410 +Dutchman 9410 +effortlessly 9410 +electroencephalography 9410 +elite 9410 +embassies 9410 +employing 9410 +encompass 9410 +encompasses 9410 +environing 9410 +epistle 9410 +equilibrium 9410 +erases 9410 +error 9410 +eschew 9410 +eternal 9410 +Eulerian 9410 +Evanston 9410 +evened 9410 +evenhandedly 9410 +eventful 9410 +Everhart 9410 +excises 9410 +exclamation 9410 +excrete 9410 +exhausts 9410 +expelled 9410 +extents 9410 +externally 9410 +extracted 9410 +faithful 9410 +fanatic 9410 +fated 9410 +featherweight 9410 +feed 9410 +feminine 9410 +Fenton 9410 +fetched 9410 +fetters 9410 +fiftieth 9410 +filial 9410 +fingerings 9410 +finishers 9410 +firearm 9410 +fitting 9410 +Fitzpatrick 9410 +fixedly 9410 +flanking 9410 +flint 9410 +flopping 9410 +flurried 9410 +foldout 9410 +foothill 9410 +forgivably 9410 +forthcoming 9410 +freakish 9410 +freest 9410 +freezes 9410 +funereal 9410 +furnishings 9410 +furthermore 9410 +gadfly 9410 +gainful 9410 +Galatean 9410 +galling 9410 +Gandhian 9410 +Ganymede 9410 +garage 9410 +gentleman 9410 +gifted 9410 +gleaning 9410 +glut 9410 +goblins 9410 +Goldstine 9410 +Gothicism 9410 +governing 9410 +gradually 9410 +Graves 9410 +grazing 9410 +Greenberg 9410 +gritty 9410 +groupings 9410 +guides 9410 +guitars 9410 +Gurkha 9410 +handgun 9410 +handy 9410 +Hawaii 9410 +Hegelian 9410 +heiress 9410 +hoarder 9410 +honoring 9410 +Hornblower 9410 +hostess 9410 +Huffman 9410 +humanness 9410 +humiliation 9410 +humility 9410 +Hunter 9410 +hushes 9410 +husky 9410 +hypothesizer 9410 +icon 9410 +ideas 9410 +impelling 9410 +impending 9410 +imperial 9410 +imperiously 9410 +imprint 9410 +impulsive 9410 +inaccuracy 9410 +inch 9410 +incidentals 9410 +incorrectly 9410 +incurring 9410 +index 9410 +indulge 9410 +indulgences 9410 +ineffective 9410 +infallibly 9410 +infest 9410 +inform 9410 +inmate 9410 +insolence 9410 +instruments 9410 +intelligibility 9410 +intentness 9410 +intercepted 9410 +interdependent 9410 +interrelationships 9410 +interrogate 9410 +investigations 9410 +irresponsibly 9410 +jarring 9410 +Joplin 9410 +journalizing 9410 +Judas 9410 +juveniles 9410 +Kane 9410 +kanji 9410 +Kantian 9410 +Kevin 9410 +kingdom 9410 +Kinsey 9410 +kiting 9410 +Kline 9410 +labeled 9410 +languages 9410 +Lars 9410 +laterally 9410 +Latinizes 9410 +lawgiver 9410 +leaflet 9410 +leavings 9410 +lectured 9410 +leftover 9410 +lewdly 9410 +lied 9410 +Lillian 9410 +linear 9410 +lists 9410 +lithograph 9410 +Lizzy 9410 +lore 9410 +luckily 9410 +Majorca 9410 +males 9410 +Manhattanize 9410 +marginal 9410 +mastering 9410 +mayoral 9410 +McGovern 9410 +meanwhile 9410 +measures 9410 +measures 9410 +mechanizing 9410 +medical 9410 +meditation 9410 +Melinda 9410 +Merritt 9410 +metaphysically 9410 +Micronesia 9410 +Miles 9410 +Miltonism 9410 +mineral 9410 +miniaturizes 9410 +minima 9410 +minion 9410 +minting 9410 +misted 9410 +misunderstander 9410 +mixture 9410 +motors 9410 +mournfulness 9410 +multilayer 9410 +mumbles 9410 +mushrooms 9410 +mystic 9410 +Nabisco 9410 +navies 9410 +navigate 9410 +Nazis 9410 +neat 9410 +neonatal 9410 +nested 9410 +Newtonian 9410 +noncritical 9410 +normalizes 9410 +Norwalk 9410 +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +Pandora 9410 +parametrized 9410 +parenthood 9410 +Parsifal 9410 +parters 9410 +participated 9410 +partridges 9410 +peacock 9410 +peeked 9410 +pellagra 9410 +percentage 9410 +percentage 9410 +persist 9410 +perturb 9410 +Peruvian 9410 +pessimist 9410 +pests 9410 +petted 9410 +pictures 9410 +pithed 9410 +pityingly 9410 +poison 9410 +posed 9410 +positioning 9410 +postulation 9410 +praised 9410 +precaution 9410 +precipitable 9410 +preclude 9410 +presentation 9410 +pressure 9410 +previewing 9410 +priceless 9410 +primary 9410 +psychic 9410 +publicly 9410 +puddings 9410 +Punjab 9410 +Pyle 9410 +quagmire 9410 +quitter 9410 +Quixotism 9410 +railway 9410 +raining 9410 +rains 9410 +ravines 9410 +readable 9410 +realized 9410 +realtor 9410 +reassigned 9410 +recruited 9410 +reduce 9410 +regimented 9410 +registration 9410 +relatively 9410 +relaxing 9410 +relishing 9410 +relives 9410 +renew 9410 +repelled 9410 +repetitions 9410 +reporters 9410 +reporters 9410 +repressions 9410 +resplendent 9410 +resumes 9410 +rifles 9410 +rightful 9410 +rightfully 9410 +rightfulness 9410 +ripeness 9410 +riser 9410 +Romano 9410 +Romans 9410 +roped 9410 +rudeness 9410 +rules 9410 +rural 9410 +rusting 9410 +Sabine 9410 +sadly 9410 +sags 9410 +sanding 9410 +saplings 9410 +sating 9410 +Sault 9410 +save 9410 +sawtooth 9410 +Saxony 9410 +scarf 9410 +scatterbrain 9410 +scheduling 9410 +schemer 9410 +scholastics 9410 +scornfully 9410 +secures 9410 +securing 9410 +Selfridge 9410 +seminaries 9410 +serializations 9410 +serpents 9410 +serving 9410 +severely 9410 +sews 9410 +Shanghais 9410 +shapelessly 9410 +shipyard 9410 +shooter 9410 +similarities 9410 +Simla 9410 +Simon 9410 +skulking 9410 +slaughter 9410 +sloping 9410 +smoothed 9410 +snatching 9410 +socializes 9410 +sophomore 9410 +sorters 9410 +spatial 9410 +specification 9410 +specifics 9410 +spongers 9410 +spools 9410 +sportswriting 9410 +sporty 9410 +squabbled 9410 +squeaking 9410 +squeezes 9410 +stabilizes 9410 +stairway 9410 +Stalin 9410 +standardizes 9410 +star 9410 +starlet 9410 +stated 9410 +Steinberg 9410 +stint 9410 +stodgy 9410 +store 9410 +straight 9410 +stranglings 9410 +subdirectory 9410 +subjective 9410 +subschema 9410 +succumbed 9410 +suites 9410 +sumac 9410 +sureties 9410 +swaying 9410 +sweetish 9410 +swelling 9410 +syndicate 9410 +Taoism 9410 +taxonomically 9410 +techniques 9410 +teem 9410 +teethe 9410 +tempering 9410 +Teresa 9410 +terminal 9410 +terminator 9410 +terminators 9410 +test 9410 +testicle 9410 +textures 9410 +theorizers 9410 +throttles 9410 +tidiness 9410 +timesharing 9410 +tinily 9410 +tinting 9410 +Tipperary 9410 +title 9410 +tragedies 9410 +traitor 9410 +trimmings 9410 +tropics 9410 +unaffected 9410 +uncovering 9410 +undoes 9410 +ungrateful 9410 +universals 9410 +unplug 9410 +unruly 9410 +untying 9410 +unwilling 9410 +vacuuming 9410 +validate 9410 +vanish 9410 +ventilate 9410 +veranda 9410 +vests 9410 +wallet 9410 +waltz 9410 +warm 9410 +warningly 9410 +watering 9410 +weasels 9410 +Weissmuller 9410 +western 9410 +whiteners 9410 +widens 9410 +Winsett 9410 +witchcraft 9410 +workers 9410 +Wotan 9410 +yelped 9410 +youthfulness 9410 +analyze table t2, t3; +Table Op Msg_type Msg_text +test.t2 analyze status OK +test.t3 analyze status OK +EXPLAIN select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 10.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL fld1 NULL NULL NULL 1199 10.00 Using where; Using temporary; Using filesort +2 SIMPLE t3 NULL eq_ref PRIMARY,period PRIMARY 4 test.t2.fld1 1 20.04 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`companynr` = 37) and (`test`.`t2`.`fld1` = `test`.`t3`.`t2nr`) and (`test`.`t3`.`period` >= 1001) and (`test`.`t3`.`period` <= 1002)) order by `test`.`t2`.`fld3`,`test`.`t3`.`period`,`test`.`t3`.`price` +select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +fld3 period price price2 +admonishing 1002 28357832 8723648 +analyzable 1002 28357832 8723648 +annihilates 1001 5987435 234724 +Antares 1002 28357832 8723648 +astound 1001 5987435 234724 +audiology 1001 5987435 234724 +Augustine 1002 28357832 8723648 +Baird 1002 28357832 8723648 +bewilderingly 1001 5987435 234724 +breaking 1001 5987435 234724 +Conley 1001 5987435 234724 +dentally 1002 28357832 8723648 +dissociate 1002 28357832 8723648 +elite 1001 5987435 234724 +eschew 1001 5987435 234724 +Eulerian 1001 5987435 234724 +flanking 1001 5987435 234724 +foldout 1002 28357832 8723648 +funereal 1002 28357832 8723648 +galling 1002 28357832 8723648 +Graves 1001 5987435 234724 +grazing 1001 5987435 234724 +groupings 1001 5987435 234724 +handgun 1001 5987435 234724 +humility 1002 28357832 8723648 +impulsive 1002 28357832 8723648 +inch 1001 5987435 234724 +intelligibility 1001 5987435 234724 +jarring 1001 5987435 234724 +lawgiver 1001 5987435 234724 +lectured 1002 28357832 8723648 +Merritt 1002 28357832 8723648 +neonatal 1001 5987435 234724 +offload 1002 28357832 8723648 +parters 1002 28357832 8723648 +pityingly 1002 28357832 8723648 +puddings 1002 28357832 8723648 +Punjab 1001 5987435 234724 +quitter 1002 28357832 8723648 +realtor 1001 5987435 234724 +relaxing 1001 5987435 234724 +repetitions 1001 5987435 234724 +resumes 1001 5987435 234724 +Romans 1002 28357832 8723648 +rusting 1001 5987435 234724 +scholastics 1001 5987435 234724 +skulking 1002 28357832 8723648 +stated 1002 28357832 8723648 +suites 1002 28357832 8723648 +sureties 1001 5987435 234724 +testicle 1002 28357832 8723648 +tinily 1002 28357832 8723648 +tragedies 1001 5987435 234724 +trimmings 1001 5987435 234724 +vacuuming 1001 5987435 234724 +ventilate 1001 5987435 234724 +wallet 1001 5987435 234724 +Weissmuller 1002 28357832 8723648 +Wotan 1002 28357832 8723648 +select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37; +fld1 fld3 period price price2 +018201 relaxing 1001 5987435 234724 +018601 vacuuming 1001 5987435 234724 +018801 inch 1001 5987435 234724 +018811 repetitions 1001 5987435 234724 +create table t4 ( +companynr tinyint(2) unsigned zerofill NOT NULL default '00', +companyname char(30) NOT NULL default '', +PRIMARY KEY (companynr), +UNIQUE KEY companyname(companyname) +) ENGINE=INNODB MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select * from t1,t1 t12; +Period Varor_period Period Varor_period +9410 9412 9410 9412 +select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505; +fld1 fld1 +250501 250501 +250501 250502 +250501 250503 +250501 250504 +250501 250505 +250502 250501 +250502 250502 +250502 250503 +250502 250504 +250502 250505 +250503 250501 +250503 250502 +250503 250503 +250503 250504 +250503 250505 +250504 250501 +250504 250502 +250504 250503 +250504 250504 +250504 250505 +250505 250501 +250505 250502 +250505 250503 +250505 250504 +250505 250505 +insert into t2 (fld1, companynr) values (999999,99); +ANALYZE TABLE t2, t4; +Table Op Msg_type Msg_text +test.t2 analyze status OK +test.t4 analyze status OK +select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +companynr companyname +99 NULL +select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null; +count(*) +1199 +explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1200 100.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1200 100.00 NULL +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 Using where; Not exists +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t2` left join `test`.`t4` on((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`)) where (`test`.`t4`.`companynr` is null) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1200 10.00 Using where; Not exists +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t2`.`companynr` is null) +select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +companynr companyname +select count(*) from t2 left join t4 using (companynr) where companynr is not null; +count(*) +1200 +explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t2` left join `test`.`t4` on(multiple equal(`test`.`t2`.`companynr`, `test`.`t4`.`companynr`)) where false +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on(multiple equal(`test`.`t4`.`companynr`, `test`.`t2`.`companynr`)) where false +delete from t2 where fld1=999999; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0) and (`test`.`t2`.`companynr` > 0)) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t4`.`companynr` > 0) and (`test`.`t4`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 40.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t2`.`companynr` > 0) or (`test`.`t2`.`companynr` is null)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index PRIMARY companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t2`.`companynr` > 0) or (`test`.`t4`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (ifnull(`test`.`t2`.`companynr`,1) > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t4`.`companynr` > 0) or (`test`.`t4`.`companynr` > 0)) +explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using where; Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (ifnull(`test`.`t4`.`companynr`,1) > 0) +select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +companynr companynr +37 36 +41 40 +explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index; Using temporary +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select distinct `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companynr` AS `companynr` from `test`.`t2` join `test`.`t4` where (`test`.`t2`.`companynr` = (`test`.`t4`.`companynr` + 1)) +select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909); +period +9410 +select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6))); +period +9410 +select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1; +fld1 +250501 +250502 +250503 +250505 +select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606); +fld1 +250502 +250503 +select fld1 from t2 where fld1 between 250502 and 250504; +fld1 +250502 +250503 +250504 +select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ; +fld3 +Lillian +label +labeled +labeled +landslide +laterally +leaflet +lewdly +luckily +select count(*) from t1; +count(*) +1 +select companynr,count(*),sum(fld1) from t2 group by companynr; +companynr count(*) sum(fld1) +00 82 10355753 +29 95 14473298 +34 70 17788966 +36 215 22786296 +37 588 83602098 +40 37 6618386 +41 52 12816335 +50 11 1595438 +53 4 793210 +58 23 2254293 +65 10 2284055 +68 12 3097288 +select companynr,count(*) from t2 group by companynr order by companynr desc limit 5; +companynr count(*) +68 12 +65 10 +58 23 +53 4 +50 11 +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +70 absentee vest 17788966 254128.0857 3272.5939722090234 10709871.306938833 +explain select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 9.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 order 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.97568479746 13352027981.708656 +29 95 abut wetness 14473298 152350.5053 8368.547956641249 70032594.90260443 +34 70 absentee vest 17788966 254128.0857 3272.5939722090234 10709871.306938833 +select +companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from +t3 where companynr = 37 group by companynr,t2nr order by companynr, t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select /*! SQL_SMALL_RESULT */ +companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from +t3 where companynr = 37 group by companynr,t2nr order by companynr, t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ; +companynr count(price) sum(price) min(price) max(price) avg(price) +101 4181 3489454238 834598 834598 834598.0000 +154 4181 4112197254950 983543950 983543950 983543950.0000 +311 4181 979599938 234298 234298 234298.0000 +37 12543 309394878010 5987435 39654943 24666736.6667 +447 4181 9929180954 2374834 2374834 2374834.0000 +512 4181 3288532102 786542 786542 786542.0000 +78 8362 414611089292 726498 98439034 49582766.0000 +select distinct mod(companynr,10) from t4 group by companynr; +mod(companynr,10) +0 +1 +3 +4 +5 +6 +7 +8 +9 +select distinct 1 from t4 group by companynr; +1 +1 +select count(distinct fld1) from t2; +count(distinct fld1) +1199 +select companynr,count(distinct fld1) from t2 group by companynr; +companynr count(distinct fld1) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(*) from t2 group by companynr; +companynr count(*) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,1000))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,200))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct floor(fld1/100)) from t2 group by companynr; +companynr count(distinct floor(fld1/100)) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr; +companynr count(distinct concat(repeat(65,1000),floor(fld1/100))) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10; +sum(fld1) fld3 +11402 Romans +select name,count(*) from t3 where name='cloakroom' group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name='cloakroom' and price>10 group by name; +name count(*) +cloakroom 4181 +select count(*) from t3 where name='cloakroom' and price2=823742; +count(*) +4181 +select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name; +name count(*) +extramarital 4181 +gazer 4181 +gems 4181 +Iranizes 4181 +spates 4181 +tucked 4181 +violinist 4181 +select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld3 count(*) +spates 4181 +select companynr|0,companyname from t4 group by 1; +companynr|0 companyname +0 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname; +companynr companyname count(*) +29 company 1 95 +68 company 10 12 +50 company 11 11 +34 company 2 70 +36 company 3 215 +37 company 4 588 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +00 Unknown 82 +select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld1 count(*) +158402 4181 +select sum(Period)/count(*) from t1; +sum(Period)/count(*) +9410.0000 +select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; +companynr count sum diff func +101 4181 3489454238 0.0000 422281 +154 4181 4112197254950 0.0000 643874 +311 4181 979599938 0.0000 1300291 +37 12543 309394878010 0.0000 464091 +447 4181 9929180954 0.0000 1868907 +512 4181 3288532102 0.0000 2140672 +78 8362 414611089292 0.0000 652236 +select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; +companynr avg +154 983543950.0000 +select companynr,count(*) from t2 group by companynr order by 2 desc; +companynr count(*) +37 588 +36 215 +29 95 +00 82 +34 70 +41 52 +40 37 +58 23 +68 12 +50 11 +65 10 +53 4 +select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc; +companynr count(*) +41 52 +58 23 +68 12 +50 11 +65 10 +53 4 +select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4; +fld4 fld1 count(price) sum(price) min(price) max(price) avg(price) +Abraham 018103 1 39654943 39654943 39654943 39654943.0000 +Anatole 038102 1 28357832 28357832 28357832 28357832.0000 +Beebe 018602 1 28357832 28357832 28357832 28357832.0000 +Chicana 038203 1 39654943 39654943 39654943 39654943.0000 +Conley 018101 1 5987435 5987435 5987435 5987435.0000 +Connally 018801 1 5987435 5987435 5987435 5987435.0000 +Graves 018052 1 28357832 28357832 28357832 28357832.0000 +Judas 018032 1 28357832 28357832 28357832 28357832.0000 +Kline 038101 1 5987435 5987435 5987435 5987435.0000 +Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000 +Merritt 016303 1 39654943 39654943 39654943 39654943.0000 +Parsifal 013802 1 28357832 28357832 28357832 28357832.0000 +Punjab 016302 1 28357832 28357832 28357832 28357832.0000 +Selfridge 019102 1 28357832 28357832 28357832 28357832.0000 +Simla 018402 1 28357832 28357832 28357832 28357832.0000 +Steinberg 012003 1 39654943 39654943 39654943 39654943.0000 +Taoism 018603 1 39654943 39654943 39654943 39654943.0000 +attainments 012303 1 39654943 39654943 39654943 39654943.0000 +audiology 011403 1 39654943 39654943 39654943 39654943.0000 +balled 012301 1 5987435 5987435 5987435 5987435.0000 +bee 038001 1 5987435 5987435 5987435 5987435.0000 +betroth 030501 1 5987435 5987435 5987435 5987435.0000 +bivalves 018013 1 39654943 39654943 39654943 39654943.0000 +bloodbath 018042 1 28357832 28357832 28357832 28357832.0000 +cage 018201 1 5987435 5987435 5987435 5987435.0000 +capably 012501 1 5987435 5987435 5987435 5987435.0000 +checkpoints 018803 1 39654943 39654943 39654943 39654943.0000 +coexist 018601 1 5987435 5987435 5987435 5987435.0000 +contrasted 016001 1 5987435 5987435 5987435 5987435.0000 +daughter 012703 1 39654943 39654943 39654943 39654943.0000 +dental 038003 1 39654943 39654943 39654943 39654943.0000 +dimensions 038202 1 28357832 28357832 28357832 28357832.0000 +disable 019103 1 39654943 39654943 39654943 39654943.0000 +dogging 018002 1 28357832 28357832 28357832 28357832.0000 +dreaded 011401 1 5987435 5987435 5987435 5987435.0000 +epistle 018062 1 28357832 28357832 28357832 28357832.0000 +erases 016301 1 5987435 5987435 5987435 5987435.0000 +eschew 011702 1 28357832 28357832 28357832 28357832.0000 +featherweight 012701 1 5987435 5987435 5987435 5987435.0000 +fetched 018802 1 28357832 28357832 28357832 28357832.0000 +fetters 018012 1 28357832 28357832 28357832 28357832.0000 +firearm 018812 1 28357832 28357832 28357832 28357832.0000 +flint 018022 1 28357832 28357832 28357832 28357832.0000 +flopping 018023 1 39654943 39654943 39654943 39654943.0000 +gritty 018811 1 5987435 5987435 5987435 5987435.0000 +hushes 018202 1 28357832 28357832 28357832 28357832.0000 +imprint 030503 1 39654943 39654943 39654943 39654943.0000 +impulsive 012602 1 28357832 28357832 28357832 28357832.0000 +interdependent 018051 1 5987435 5987435 5987435 5987435.0000 +interrelationships 036001 1 5987435 5987435 5987435 5987435.0000 +kanji 038002 1 28357832 28357832 28357832 28357832.0000 +lawgiver 013601 1 5987435 5987435 5987435 5987435.0000 +leavings 013803 1 39654943 39654943 39654943 39654943.0000 +lectured 018102 1 28357832 28357832 28357832 28357832.0000 +leftover 016201 1 5987435 5987435 5987435 5987435.0000 +medical 018041 1 5987435 5987435 5987435 5987435.0000 +minima 019101 1 5987435 5987435 5987435 5987435.0000 +neat 012001 1 5987435 5987435 5987435 5987435.0000 +neonatal 018053 1 39654943 39654943 39654943 39654943.0000 +normalizes 038013 1 39654943 39654943 39654943 39654943.0000 +parters 011701 1 5987435 5987435 5987435 5987435.0000 +partridges 038103 1 39654943 39654943 39654943 39654943.0000 +persist 012302 1 28357832 28357832 28357832 28357832.0000 +pessimist 012702 1 28357832 28357832 28357832 28357832.0000 +quitter 011703 1 39654943 39654943 39654943 39654943.0000 +railway 038011 1 5987435 5987435 5987435 5987435.0000 +readable 013603 1 39654943 39654943 39654943 39654943.0000 +recruited 038201 1 5987435 5987435 5987435 5987435.0000 +reporters 018403 1 39654943 39654943 39654943 39654943.0000 +riser 036002 1 28357832 28357832 28357832 28357832.0000 +scholastics 011402 1 28357832 28357832 28357832 28357832.0000 +scornfully 018003 1 39654943 39654943 39654943 39654943.0000 +skulking 018021 1 5987435 5987435 5987435 5987435.0000 +sorters 018061 1 5987435 5987435 5987435 5987435.0000 +squeaking 013901 1 5987435 5987435 5987435 5987435.0000 +starlet 012603 1 39654943 39654943 39654943 39654943.0000 +stated 013602 1 28357832 28357832 28357832 28357832.0000 +subschema 018043 1 39654943 39654943 39654943 39654943.0000 +sweetish 018001 1 5987435 5987435 5987435 5987435.0000 +swelling 031901 1 5987435 5987435 5987435 5987435.0000 +teethe 000001 1 5987435 5987435 5987435 5987435.0000 +testicle 013801 1 5987435 5987435 5987435 5987435.0000 +vacuuming 018033 1 39654943 39654943 39654943 39654943.0000 +validate 038012 1 28357832 28357832 28357832 28357832.0000 +wallet 011501 1 5987435 5987435 5987435 5987435.0000 +whiteners 016202 1 28357832 28357832 28357832 28357832.0000 +witchcraft 019201 1 5987435 5987435 5987435 5987435.0000 +select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3; +companynr fld3 sum(price) +512 Micronesia 786542 +512 Miles 786542 +512 boat 786542 +512 capably 786542 +512 cupboard 786542 +512 decliner 786542 +512 descendants 786542 +512 dopers 786542 +512 erases 786542 +512 skies 786542 +select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr; +companynr count(*) min(fld3) max(fld3) sum(price) avg(price) +00 1 Omaha Omaha 5987435 5987435.0000 +36 1 dubbed dubbed 28357832 28357832.0000 +37 83 Abraham Wotan 1908978016 22999735.1325 +50 2 scribbled tapestry 68012775 34006387.5000 +select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1; +t3.companynr+0 t2nr fld3 sum(price) +37 1 Omaha 5987435 +37 11401 breaking 5987435 +37 11402 Romans 28357832 +37 11403 intercepted 39654943 +37 11501 bewilderingly 5987435 +37 11701 astound 5987435 +37 11702 admonishing 28357832 +37 11703 sumac 39654943 +37 12001 flanking 5987435 +37 12003 combed 39654943 +37 12301 Eulerian 5987435 +37 12302 dubbed 28357832 +37 12303 Kane 39654943 +37 12501 annihilates 5987435 +37 12602 Wotan 28357832 +37 12603 snatching 39654943 +37 12701 grazing 5987435 +37 12702 Baird 28357832 +37 12703 celery 39654943 +37 13601 handgun 5987435 +37 13602 foldout 28357832 +37 13603 mystic 39654943 +37 13801 intelligibility 5987435 +37 13802 Augustine 28357832 +37 13803 teethe 39654943 +37 13901 scholastics 5987435 +37 16001 audiology 5987435 +37 16201 wallet 5987435 +37 16202 parters 28357832 +37 16301 eschew 5987435 +37 16302 quitter 28357832 +37 16303 neat 39654943 +37 18001 jarring 5987435 +37 18002 tinily 28357832 +37 18003 balled 39654943 +37 18012 impulsive 28357832 +37 18013 starlet 39654943 +37 18021 lawgiver 5987435 +37 18022 stated 28357832 +37 18023 readable 39654943 +37 18032 testicle 28357832 +37 18033 Parsifal 39654943 +37 18041 Punjab 5987435 +37 18042 Merritt 28357832 +37 18043 Quixotism 39654943 +37 18051 sureties 5987435 +37 18052 puddings 28357832 +37 18053 tapestry 39654943 +37 18061 trimmings 5987435 +37 18062 humility 28357832 +37 18101 tragedies 5987435 +37 18102 skulking 28357832 +37 18103 flint 39654943 +37 18201 relaxing 5987435 +37 18202 offload 28357832 +37 18402 suites 28357832 +37 18403 lists 39654943 +37 18601 vacuuming 5987435 +37 18602 dentally 28357832 +37 18603 humanness 39654943 +37 18801 inch 5987435 +37 18802 Weissmuller 28357832 +37 18803 irresponsibly 39654943 +37 18811 repetitions 5987435 +37 18812 Antares 28357832 +37 19101 ventilate 5987435 +37 19102 pityingly 28357832 +37 19103 interdependent 39654943 +37 19201 Graves 5987435 +37 30501 neonatal 5987435 +37 30502 scribbled 28357832 +37 30503 chafe 39654943 +37 31901 realtor 5987435 +37 36001 elite 5987435 +37 36002 funereal 28357832 +37 38001 Conley 5987435 +37 38002 lectured 28357832 +37 38003 Abraham 39654943 +37 38011 groupings 5987435 +37 38012 dissociate 28357832 +37 38013 coexist 39654943 +37 38101 rusting 5987435 +37 38102 galling 28357832 +37 38103 obliterates 39654943 +37 38201 resumes 5987435 +37 38202 analyzable 28357832 +37 38203 terminator 39654943 +select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008; +sum(price) +234298 +select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1; +fld1 sum(price) +038008 234298 +explain select fld3 from t2 where 1>2 or 2>3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where false +explain select fld3 from t2 where fld1=fld1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 100.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where true +select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000; +companynr count sum +00 82 10355753 +29 95 14473298 +34 70 17788966 +37 588 83602098 +41 52 12816335 +select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ; +companynr +00 +29 +34 +37 +41 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40; +companynr companyname count(*) +40 company 5 37 +41 company 6 52 +50 company 11 11 +53 company 7 4 +58 company 8 23 +65 company 9 10 +68 company 10 12 +select count(*) from t2; +count(*) +1199 +select count(*) from t2 where fld1 < 098024; +count(*) +387 +select min(fld1) from t2 where fld1>= 098024; +min(fld1) +98024 +select max(fld1) from t2 where fld1>= 098024; +max(fld1) +1232609 +select count(*) from t3 where price2=76234234; +count(*) +4181 +select count(*) from t3 where companynr=512 and price2=76234234; +count(*) +4181 +explain select min(fld1),max(fld1),count(*) from t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL index NULL fld1 4 NULL 1199 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t2`.`fld1`) AS `min(fld1)`,max(`test`.`t2`.`fld1`) AS `max(fld1)`,count(0) AS `count(*)` from `test`.`t2` +explain format=tree select min(fld1),max(fld1),count(*) from t2; +EXPLAIN +-> Count rows in t2 + +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +explain format=tree select min(fld1),max(fld1),count(*) from t2 where rand() > 0.5; +EXPLAIN +-> Aggregate: min(`min(fld1)`), max(`max(fld1)`), count(`count(*)`) + -> Parallel scan on + -> Aggregate: + -> Filter: (rand() > 0.5) (cost=123.65 rows=1199) + -> PQblock scan on t2 using fld1 (cost=123.65 rows=1199) + +select min(fld1),max(fld1),count(*) from t2; +min(fld1) max(fld1) count(*) +0 1232609 1199 +select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; +min(t2nr) max(t2nr) +2115 2115 +select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; +count(*) min(t2nr) max(t2nr) +4181 4 41804 +select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; +t2nr count(*) +9 1 +19 1 +29 1 +39 1 +49 1 +59 1 +69 1 +79 1 +89 1 +99 1 +109 1 +119 1 +129 1 +139 1 +149 1 +159 1 +169 1 +179 1 +189 1 +199 1 +select max(t2nr) from t3 where price=983543950; +max(t2nr) +41807 +select t1.period from t3 t1 limit 1; +period +1001 +select t1.period from t1 as t1 limit 1; +period +9410 +select t1.period as "Nuvarande period" from t1 as t1 limit 1; +Nuvarande period +9410 +select period as ok_period from t1 limit 1; +ok_period +9410 +select period as ok_period from t1 group by ok_period limit 1; +ok_period +9410 +select 1+1 as summa from t1 group by summa limit 1; +summa +2 +select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1; +Nuvarande period +9410 +show tables; +Tables_in_test +t1 +t2 +t3 +t4 +show tables from test like "s%"; +Tables_in_test (s%) +show tables from test like "t?"; +Tables_in_test (t?) +show full columns from t2; +Field Type Collation Null Key Default Extra Privileges Comment +auto int NULL NO PRI NULL auto_increment select,insert,update,references +fld1 int(6) unsigned zerofill NULL NO UNI 000000 select,insert,update,references +companynr tinyint(2) unsigned zerofill NULL NO 00 select,insert,update,references +fld3 char(30) utf8mb4_0900_ai_ci NO MUL select,insert,update,references +fld4 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld5 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld6 char(4) utf8mb4_0900_ai_ci NO select,insert,update,references +show full columns from t2 from test like 'f%'; +Field Type Collation Null Key Default Extra Privileges Comment +fld1 int(6) unsigned zerofill NULL NO UNI 000000 select,insert,update,references +fld3 char(30) utf8mb4_0900_ai_ci NO MUL select,insert,update,references +fld4 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld5 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld6 char(4) utf8mb4_0900_ai_ci NO select,insert,update,references +show full columns from t2 from test like 's%'; +Field Type Collation Null Key Default Extra Privileges Comment +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +show keys from t2; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Visible Expression +t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE YES NULL +t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE YES NULL +t2 1 fld3 1 fld3 A 1171 NULL NULL BTREE YES NULL +drop table t4, t3, t2, t1; +DO 1; +DO benchmark(100,1+1),1,1; +do default; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +do foobar; +ERROR 42S22: Unknown column 'foobar' in 'field list' +CREATE TABLE t1 ( +id mediumint(8) unsigned NOT NULL auto_increment, +pseudo varchar(35) NOT NULL default '', +PRIMARY KEY (id), +UNIQUE KEY pseudo (pseudo) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 (pseudo) VALUES ('test'); +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 1 as rnd1 from t1 where rand() > 2; +rnd1 +DROP TABLE t1; +CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1287 'BINARY as attribute of a type' is deprecated and will be removed in a future release. Please use a CHARACTER SET clause with _bin collation instead +INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); +CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +ERROR HY000: Incorrect DATETIME value: 'wrong-date-value' +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +DROP TABLE t1,t2; +create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); +select wss_type from t1 where wss_type ='102935229216544106'; +wss_type +select wss_type from t1 where wss_type ='102935229216544105'; +wss_type +select wss_type from t1 where wss_type ='102935229216544104'; +wss_type +select wss_type from t1 where wss_type ='102935229216544093'; +wss_type +102935229216544093 +select wss_type from t1 where wss_type =102935229216544093; +wss_type +102935229216544093 +drop table t1; +select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; +select @a; +@a +3 +select @b; +@b +aaaa +select @c; +@c +6.260 +create table t1 (a int not null auto_increment primary key); +insert into t1 values (); +insert into t1 values (); +insert into t1 values (); +select * from (t1 as t2 left join t1 as t3 using (a)), t1; +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from t1, (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); +a +1 +2 +3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +1 NULL +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); +a +1 +2 +3 +select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; +a +1 +2 +3 +select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +NULL 1 +select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); +a +1 +2 +3 +select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; +a +1 +2 +3 +select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; +a +1 +2 +3 +drop table t1; +CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); +CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); +select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; +aa id t2_id id +2 8299 2517 2517 +3 8301 2518 2518 +4 8302 2519 2519 +5 8303 2520 2520 +6 8304 2521 2521 +drop table t1,t2; +create table t1 (id1 int NOT NULL); +create table t2 (id2 int NOT NULL); +create table t3 (id3 int NOT NULL); +create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); +insert into t1 values (1); +insert into t1 values (2); +insert into t2 values (1); +insert into t4 values (1,1); +explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +2 SIMPLE t4 NULL ref id4 id4 4 test.t3.id3 1 100.00 Using where; Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`id1` AS `id1`,`test`.`t2`.`id2` AS `id2`,`test`.`t3`.`id3` AS `id3`,`test`.`t4`.`id4` AS `id4`,`test`.`t4`.`id44` AS `id44` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`id2` = `test`.`t1`.`id1`)) left join `test`.`t3` on((`test`.`t3`.`id3` = `test`.`t1`.`id1`)) left join `test`.`t4` on((`test`.`t4`.`id4` = `test`.`t3`.`id3`)) where ((`test`.`t2`.`id2` = 1) or (`test`.`t4`.`id4` = 1)) +select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id1 id2 id3 id4 id44 +1 1 NULL NULL NULL +drop table t1,t2,t3,t4; +create table t1(s varchar(10) not null); +create table t2(s varchar(10) not null primary key); +create table t3(s varchar(10) not null primary key); +insert into t1 values ('one\t'), ('two\t'); +insert into t2 values ('one\r'), ('two\t'); +insert into t3 values ('one\b'), ('two\t'); +select * from t1 where s = 'one'; +s +select * from t2 where s = 'one'; +s +select * from t3 where s = 'one'; +s +one +select * from t1,t2 where t1.s = t2.s; +s s +two two +select * from t2,t3 where t2.s = t3.s; +s s +two two +drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +explain select * from t1 left join t2 on a=c where d in (4); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref c,d d 5 const 2 100.00 Using where +2 SIMPLE t1 NULL ref a a 5 test.t2.c 1 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ 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`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = 4)) +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref c,d d 5 const 2 100.00 Using where +2 SIMPLE t1 NULL ref a a 5 test.t2.c 1 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ 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`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = 4)) +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; +CREATE TABLE t1 ( +i int(11) NOT NULL default '0', +c char(10) NOT NULL default '', +PRIMARY KEY (i), +UNIQUE KEY c (c) +) ; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (1,'a'); +INSERT INTO t1 VALUES (2,'b'); +INSERT INTO t1 VALUES (3,'c'); +EXPLAIN SELECT i FROM t1 WHERE i=1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '1' AS `i` from `test`.`t1` where true +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref a a 23 test.t1.a 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` USE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref a a 23 test.t1.a 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` FORCE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +DROP TABLE t1, t2; +CREATE TABLE t1 ( city char(30) ) charset utf8mb4; +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`city` AS `city` from `test`.`t1` where (`test`.`t1`.`city` = 'London') +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`city` AS `city` from `test`.`t1` where ((`test`.`t1`.`city` = 'London') and (`test`.`t1`.`city` like '%london%')) +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,0), (1,1), (4294967295,1); +select a-b from t1 order by 1; +a-b +0 +1 +4294967294 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +4294967294 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +4294967294 +drop table t1; +create table t1 (a int(11)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +kunde_intern_id int(10) unsigned NOT NULL default '0', +kunde_id int(10) unsigned NOT NULL default '0', +FK_firma_id int(10) unsigned NOT NULL default '0', +aktuell enum('Ja','Nein') NOT NULL default 'Ja', +vorname varchar(128) NOT NULL default '', +nachname varchar(128) NOT NULL default '', +geloescht enum('Ja','Nein') NOT NULL default 'Nein', +firma varchar(128) NOT NULL default '' +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), +(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 +WHERE +( +( +( '' != '' AND firma LIKE CONCAT('%', '', '%')) +OR +(vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND +'Vorname1' != '' AND 'xxxx' != '') +) +AND +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, +geloescht FROM t1 +WHERE +( +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +AND +( +( '' != '' AND firma LIKE CONCAT('%', '', '%') ) +OR +( vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND +'xxxx' != '') +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT COUNT(*) FROM t1 WHERE +( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) +AND FK_firma_id = 2; +COUNT(*) +0 +drop table t1; +CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (0x8000000000000000); +SELECT b FROM t1 WHERE b=0x8000000000000000; +b +9223372036854775808 +DROP TABLE t1; +CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `t2` VALUES (0,'READ'); +CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `t3` VALUES (1,'fs'); +select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); +id name gid uid ident level +1 fs NULL NULL 0 READ +drop table t1,t2,t3; +CREATE TABLE t1 ( +acct_id int(11) NOT NULL default '0', +profile_id smallint(6) default NULL, +UNIQUE KEY t1$acct_id (acct_id), +KEY t1$profile_id (profile_id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (132,17),(133,18); +CREATE TABLE t2 ( +profile_id smallint(6) default NULL, +queue_id int(11) default NULL, +seq int(11) default NULL, +KEY t2$queue_id (queue_id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); +CREATE TABLE t3 ( +id int(11) NOT NULL default '0', +qtype int(11) default NULL, +seq int(11) default NULL, +warn_lvl int(11) default NULL, +crit_lvl int(11) default NULL, +rr1 tinyint(4) NOT NULL default '0', +rr2 int(11) default NULL, +default_queue tinyint(4) NOT NULL default '0', +KEY t3$qtype (qtype), +KEY t3$id (id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), +(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); +SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q +WHERE +(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND +(pq.queue_id = q.id) AND (q.rr1 <> 1); +COUNT(*) +4 +drop table t1,t2,t3; +create table t1 (f1 int); +insert into t1 values (1),(NULL); +create table t2 (f2 int, f3 int, f4 int); +create index idx1 on t2 (f4); +insert into t2 values (1,2,3),(2,4,6); +select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) +from t2 C where A.f4 = C.f4) or A.f3 IS NULL; +f2 +1 +NULL +drop table t1,t2; +create table t2 (a tinyint unsigned); +create index t2i on t2(a); +insert into t2 values (0), (254), (255); +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +explain select * from t2 where a > -1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index t2i t2i 2 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a` is not null) +select * from t2 where a > -1; +a +0 +254 +255 +drop table t2; +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +SELECT * FROM t1; +a b c +50 3 3 +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +select found_rows(); +found_rows() +0 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +SELECT * FROM t1; +a b c +50 3 3 +select count(*) from t1; +count(*) +1 +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +select count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; +count(*) +Warnings: +Warning 1287 SQL_CALC_FOUND_ROWS is deprecated and will be removed in a future release. Consider using two separate queries instead. +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +(SELECT a, b AS c FROM t1) ORDER BY c+1; +a c +(SELECT a, b AS c FROM t1) ORDER BY b+1; +a c +SELECT a, b AS c FROM t1 ORDER BY c+1; +a c +SELECT a, b AS c FROM t1 ORDER BY b+1; +a c +drop table t1; +create table t1(f1 int, f2 int); +create table t2(f3 int); +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); +f1 +insert into t1 values(1,1),(2,null); +insert into t2 values(2); +select * from t1,t2 where f1=f3 and (f1,f2) = (2,null); +f1 f2 f3 +select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null); +f1 f2 f3 +2 NULL 2 +drop table t1,t2; +create table t1 (f1 int not null auto_increment primary key, f2 varchar(10)); +create table t11 like t1; +insert into t1 values(1,""),(2,""); +analyze table t1, t11; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t11 analyze status OK +show table status like 't1%'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 InnoDB 10 Dynamic 2 8192 X X X X X X X X X NULL +t11 InnoDB 10 Dynamic 0 0 X X X X X X X X X NULL +select 123 as a from t1 where f1 is null; +a +drop table t1,t11; +CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); +INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); +CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, e INT ); +INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2),(1,2,3); +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 10 2 +1 11 2 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c; +a b c d +1 10 4 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c; +a b c d +1 10 2 +1 11 2 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2,t1 +WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 2 1 1 +1 2 2 1 +1 2 3 1 +DROP TABLE IF EXISTS t1, t2; +create table t1 (f1 int primary key, f2 int); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t1 values (1,1); +insert into t2 values (1,1),(1,2); +select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1; +count(f2) >0 +1 +drop table t1,t2; +create table t1 (f1 int,f2 int); +insert into t1 values(1,1); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t2 values(1,1); +select * from t1 where f1 in (select f3 from t2 where (f3,f4)= (select f3,f4 from t2)); +f1 f2 +1 1 +drop table t1,t2; +CREATE TABLE t1(a int, b int, c int, KEY b(b), KEY c(c)); +insert into t1 values (1,0,0),(2,0,0); +CREATE TABLE t2 (a int, b varchar(2), c varchar(2), PRIMARY KEY(a)); +insert into t2 values (1,'',''), (2,'',''); +CREATE TABLE t3 (a int, b int, PRIMARY KEY (a,b), KEY a (a), KEY b (b)); +insert into t3 values (1,1),(1,2); +explain select straight_join DISTINCT t2.a,t2.b, t1.c from t1, t3, t2 +where (t1.c=t2.a or (t1.c=t3.a and t2.a=t3.b)) and t1.b=556476786 and +t2.b like '%%' order by t2.b limit 0,1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ref b,c b 5 const 1 100.00 Using temporary; Using filesort +1 SIMPLE t3 NULL index PRIMARY,a,b a 4 NULL 2 100.00 Using index +1 SIMPLE t2 NULL ALL PRIMARY NULL NULL NULL 2 50.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select straight_join distinct `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t1`.`b` = 556476786) and ((`test`.`t2`.`a` = `test`.`t1`.`c`) or ((`test`.`t2`.`a` = `test`.`t3`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`c`))) and (`test`.`t2`.`b` like '%%')) order by `test`.`t2`.`b` limit 0,1 +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (a int, INDEX idx(a)); +INSERT INTO t1 VALUES (2), (3), (1); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 IGNORE INDEX (idx); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` IGNORE INDEX (`idx`) +EXPLAIN SELECT * FROM t1 IGNORE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +EXPLAIN SELECT * FROM t1 FORCE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +DROP TABLE t1; +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 VALUES (1,1), (2,1), (4,10); +CREATE TABLE t2 (a int PRIMARY KEY, b int, KEY b (b)); +INSERT INTO t2 VALUES (1,NULL), (2,10); +ALTER TABLE t1 ENABLE KEYS; +Warnings: +Note 1031 Table storage engine for 't1' doesn't have this option +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index b b 5 NULL 2 100.00 Using index +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select straight_join count(0) AS `COUNT(*)` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) or (`test`.`t2`.`b` is null)) +SELECT STRAIGHT_JOIN * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +a b a b +1 NULL 1 1 +1 NULL 2 1 +1 NULL 4 10 +2 10 4 10 +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index b b 5 NULL 2 100.00 Using index +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select straight_join count(0) AS `COUNT(*)` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) or (`test`.`t2`.`b` is null)) +SELECT STRAIGHT_JOIN * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +a b a b +1 NULL 1 1 +1 NULL 2 1 +1 NULL 4 10 +2 10 4 10 +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (key1 double default NULL, UNIQUE KEY key1 (key1)); +CREATE TABLE t2 (key2 double default NULL, UNIQUE KEY key2 (key2)); +INSERT INTO t1 VALUES (0.3762),(0.3845),(0.6158),(0.7941); +INSERT INTO t2 VALUES (1.3762),(1.3845),(1.6158),(1.7941); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +explain select max(key1) from t1 where key1 <= 0.6158; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)` from `test`.`t1` where (`test`.`t1`.`key1` <= 0.6158) +explain select max(key2) from t2 where key2 <= 1.6158; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t2`.`key2`) AS `max(key2)` from `test`.`t2` where (`test`.`t2`.`key2` <= 1.6158) +explain select min(key1) from t1 where key1 >= 0.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where (`test`.`t1`.`key1` >= 0.3762) +explain select min(key2) from t2 where key2 >= 1.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t2`.`key2`) AS `min(key2)` from `test`.`t2` where (`test`.`t2`.`key2` >= 1.3762) +explain select max(key1), min(key2) from t1, t2 +where key1 <= 0.6158 and key2 >= 1.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)`,min(`test`.`t2`.`key2`) AS `min(key2)` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`key1` <= 0.6158) and (`test`.`t2`.`key2` >= 1.3762)) +explain select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range key1 key1 9 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` <= 0.6158) and ((rand() + 0.5) >= 0.5)) +explain select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index key1 key1 9 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` >= 0.3762) and ((rand() + 0.5) >= 0.5)) +select max(key1) from t1 where key1 <= 0.6158; +max(key1) +0.6158 +select max(key2) from t2 where key2 <= 1.6158; +max(key2) +1.6158 +select min(key1) from t1 where key1 >= 0.3762; +min(key1) +0.3762 +select min(key2) from t2 where key2 >= 1.3762; +min(key2) +1.3762 +select max(key1), min(key2) from t1, t2 +where key1 <= 0.6158 and key2 >= 1.3762; +max(key1) min(key2) +0.6158 1.3762 +select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; +max(key1) +0.6158 +select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; +min(key1) +0.3762 +DROP TABLE t1,t2; +CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL); +INSERT INTO t1 VALUES (10); +SELECT i='1e+01',i=1e+01, i in (1e+01,1e+01), i in ('1e+01','1e+01') FROM t1; +i='1e+01' i=1e+01 i in (1e+01,1e+01) i in ('1e+01','1e+01') +1 1 1 1 +DROP TABLE t1; +create table t1(a bigint unsigned, b bigint); +insert ignore into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff), +(0x10000000000000000, 0x10000000000000000), +(0x8fffffffffffffff, 0x8fffffffffffffff); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'a' at row 2 +Warning 1264 Out of range value for column 'b' at row 2 +Warning 1264 Out of range value for column 'b' at row 3 +select hex(a), hex(b) from t1; +hex(a) hex(b) +FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +8FFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +drop table t1; +CREATE TABLE t1 (c0 int); +CREATE TABLE t2 (c0 int); +INSERT INTO t1 VALUES(@@connect_timeout); +INSERT INTO t2 VALUES(@@connect_timeout); +SELECT * FROM t1 JOIN t2 ON t1.c0 = t2.c0 WHERE (t1.c0 <=> @@connect_timeout); +c0 c0 +X X +DROP TABLE t1, t2; +End of 4.1 tests +CREATE TABLE t1 ( +K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', +K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', +F2I4 int(11) NOT NULL default '0' +) DEFAULT CHARSET=latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +('W%RT', '0100', 1), +('W-RT', '0100', 1), +('WART', '0100', 1), +('WART', '0200', 1), +('WERT', '0100', 2), +('WORT','0200', 2), +('WT', '0100', 2), +('W_RT', '0100', 2), +('WaRT', '0100', 3), +('WART', '0300', 3), +('WRT' , '0400', 3), +('WURM', '0500', 3), +('W%T', '0600', 4), +('WA%T', '0700', 4), +('WA_T', '0800', 4); +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND +(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); +K2C4 K4N4 F2I4 +WART 0200 1 +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); +K2C4 K4N4 F2I4 +WART 0100 1 +WART 0200 1 +WART 0300 3 +DROP TABLE t1; +create table t1 (a int, b int); +create table t2 like t1; +select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; +a +select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; +a +select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; +a a a +drop table t1,t2; +create table t1 (s1 varchar(5)); +insert into t1 values ('Wall'); +select min(s1) from t1 group by s1 with rollup; +min(s1) +Wall +Wall +drop table t1; +create table t1 (s1 int); +insert into t1 values (0); +select avg(distinct s1) from t1 group by s1 with rollup; +avg(distinct s1) +0.0000 +0.0000 +drop table t1; +create table t1 (s1 int); +insert into t1 values (null),(1); +select avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +1.0000 +select distinct avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +drop table t1; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +INSERT INTO t2 VALUES (2), (4), (6); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +a +2 +4 +EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 3 33.33 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` straight_join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`a`) +EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 20.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`) +DROP TABLE t1,t2; +select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; +x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 +16 16 2 2 +create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); +insert into t1 values (" 2", 2); +insert into t2 values (" 2", " one "),(" 2", " two "); +select * from t1 left join t2 on f1 = f3; +f1 f2 f3 f4 + 2 2 2 one + 2 2 2 two +drop table t1,t2; +create table t1 (empnum smallint, grp int); +create table t2 (empnum int, name char(5)); +insert into t1 values(1,1); +insert into t2 values(1,'bob'); +create view v1 as select * from t2 inner join t1 using (empnum); +select * from v1; +empnum name grp +1 bob 1 +drop table t1,t2; +drop view v1; +create table t1 (pk int primary key, b int); +create table t2 (pk int primary key, c int); +select pk from t1 inner join t2 using (pk); +pk +drop table t1,t2; +create table t1 (s1 int, s2 char(5), s3 decimal(10)); +create view v1 as select s1, s2, 'x' as s3 from t1; +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'x' +insert into t1 values (1,'x',5); +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'x' +drop table t1; +drop view v1; +create table t1(a1 int); +create table t2(a2 int); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +create view v2 (c) as select a1 from t1; +select * from t1 natural left join t2; +a1 a2 +1 1 +1 2 +2 1 +2 2 +select * from t1 natural right join t2; +a2 a1 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural left join t2; +c a2 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural right join t2; +a2 c +1 1 +1 2 +2 1 +2 2 +drop table t1, t2; +drop view v2; +create table t1 (a int(10), t1_val int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (b int(10), t2_val int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t3 (a int(10), b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,1),(2,2); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(2,1),(3,1),(4,1); +select * from t1 natural join t2 natural join t3; +a b t1_val t2_val +1 1 1 1 +2 1 2 1 +select * from t1 natural join t3 natural join t2; +b a t1_val t2_val +1 1 1 1 +1 2 2 1 +drop table t1, t2, t3; +DO IFNULL(NULL, NULL); +SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); +CAST(IFNULL(NULL, NULL) AS DECIMAL) +NULL +SELECT ABS(IFNULL(NULL, NULL)); +ABS(IFNULL(NULL, NULL)) +NULL +SELECT IFNULL(NULL, NULL); +IFNULL(NULL, NULL) +NULL +SET @OLD_SQL_MODE12595=@@SQL_MODE, @@SQL_MODE=''; +SHOW LOCAL VARIABLES LIKE 'SQL_MODE'; +Variable_name Value +sql_mode +CREATE TABLE BUG_12595(a varchar(100)) charset latin1; +INSERT INTO BUG_12595 VALUES ('hakan%'), ('hakank'), ("ha%an"); +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE ''; +a +hakan% +hakank +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE ''; +a +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha%%an' ESCAPE '%'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE '\\'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|'; +a +ha%an +SET @@SQL_MODE='NO_BACKSLASH_ESCAPES'; +SHOW LOCAL VARIABLES LIKE 'SQL_MODE'; +Variable_name Value +sql_mode NO_BACKSLASH_ESCAPES +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%'; +a +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE '\\'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE ''; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\n%' ESCAPE '\n'; +ERROR HY000: Incorrect arguments to ESCAPE +SET @@SQL_MODE=@OLD_SQL_MODE12595; +DROP TABLE BUG_12595; +create table t1 (a char(1)); +create table t2 (a char(1)); +insert into t1 values ('a'),('b'),('c'); +insert into t2 values ('b'),('c'),('d'); +select a from t1 natural join t2; +a +b +c +select * from t1 natural join t2 where a = 'b'; +a +b +drop table t1, t2; +CREATE TABLE t1 (`id` TINYINT); +CREATE TABLE t2 (`id` TINYINT); +CREATE TABLE t3 (`id` TINYINT); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +drop table t1, t2, t3; +create table t1 (a int(10),b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (a int(10),b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,10),(2,20),(3,30); +insert into t2 values (1,10); +select * from t1 inner join t2 using (A); +a b b +1 10 10 +select * from t1 inner join t2 using (a); +a b b +1 10 10 +drop table t1, t2; +create table t1 (a int, c int); +create table t2 (b int); +create table t3 (b int, a int); +create table t4 (c int); +insert into t1 values (1,1); +insert into t2 values (1); +insert into t3 values (1,1); +insert into t4 values (1); +select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +a c b b a +1 1 1 1 1 +select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +ERROR 42S22: Unknown column 't1.a' in 'on clause' +select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); +a c b b a c +1 1 1 1 1 1 +select * from t1 join t2 join t4 using (c); +c a b +1 1 1 +drop table t1, t2, t3, t4; +create table t1(x int, y int); +create table t2(x int, y int); +create table t3(x int, primary key(x)); +insert into t1 values (1, 1), (2, 1), (3, 1), (4, 3), (5, 6), (6, 6); +insert into t2 values (1, 1), (2, 1), (3, 3), (4, 6), (5, 6); +insert into t3 values (1), (2), (3), (4), (5); +select t1.x, t3.x from t1, t2, t3 where t1.x = t2.x and t3.x >= t1.y and t3.x <= t2.y; +x x +1 1 +2 1 +3 1 +3 2 +3 3 +4 3 +4 4 +4 5 +drop table t1,t2,t3; +create table t1 (id char(16) not null default '', primary key (id)); +insert into t1 values ('100'),('101'),('102'); +create table t2 (id char(16) default null); +insert into t2 values (1); +create view v1 as select t1.id from t1; +create view v2 as select t2.id from t2; +create view v3 as select (t1.id+2) as id from t1 natural left join t2; +select t1.id from t1 left join v2 using (id); +id +100 +101 +102 +select t1.id from v2 right join t1 using (id); +id +100 +101 +102 +select t1.id from t1 left join v3 using (id); +id +100 +101 +102 +select * from t1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join t1 using (id); +id +100 +101 +102 +select * from t1 left join v3 using (id); +id +100 +101 +102 +select v1.id from v1 left join v2 using (id); +id +100 +101 +102 +select v1.id from v2 right join v1 using (id); +id +100 +101 +102 +select v1.id from v1 left join v3 using (id); +id +100 +101 +102 +select * from v1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join v1 using (id); +id +100 +101 +102 +select * from v1 left join v3 using (id); +id +100 +101 +102 +drop table t1, t2; +drop view v1, v2, v3; +create table t1 (id int(11) not null default '0'); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (123),(191),(192); +create table t2 (id char(16) character set utf8 not null); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t2 values ('58013'),('58014'),('58015'),('58016'); +create table t3 (a_id int(11) not null, b_id char(16) character set utf8); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t3 values (123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013'); +select count(*) +from t1 inner join (t3 left join t2 on t2.id = t3.b_id) on t1.id = t3.a_id; +count(*) +6 +select count(*) +from t1 inner join (t2 right join t3 on t2.id = t3.b_id) on t1.id = t3.a_id; +count(*) +6 +drop table t1,t2,t3; +create table t1 (a int); +create table t2 (b int); +create table t3 (c int); +select * from t1 join t2 join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 left join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 right join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 straight_join t3 on (t1.a=t3.c); +a b c +drop table t1, t2 ,t3; +create table t1(f1 int, f2 date); +insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'), +(4,'2005-10-01'),(5,'2005-12-30'); +select * from t1 where f2 >= 0 order by f2; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +select * from t1 where f2 >= '0000-00-00' order by f2; +ERROR HY000: Incorrect DATE value: '0000-00-00' +select * from t1 where f2 >= '2005-09-31' order by f2; +ERROR HY000: Incorrect DATE value: '2005-09-31' +select * from t1 where f2 >= '2005-09-3a' order by f2; +f1 f2 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +select * from t1 where f2 <= '2005-09-31' order by f2; +ERROR HY000: Incorrect DATE value: '2005-09-31' +select * from t1 where f2 <= '2005-09-3a' order by f2; +f1 f2 +1 2005-01-01 +2 2005-09-01 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +drop table t1; +create table t1 (f1 int, f2 int); +insert into t1 values (1, 30), (2, 20), (3, 10); +create algorithm=merge view v1 as select f1, f2 from t1; +create algorithm=merge view v2 (f2, f1) as select f1, f2 from t1; +create algorithm=merge view v3 as select t1.f1 as f2, t1.f2 as f1 from t1; +select t1.f1 as x1, f1 from t1 order by t1.f1; +x1 f1 +1 1 +2 2 +3 3 +select v1.f1 as x1, f1 from v1 order by v1.f1; +x1 f1 +1 1 +2 2 +3 3 +select v2.f1 as x1, f1 from v2 order by v2.f1; +x1 f1 +10 10 +20 20 +30 30 +select v3.f1 as x1, f1 from v3 order by v3.f1; +x1 f1 +10 10 +20 20 +30 30 +select f1, f2, v1.f1 as x1 from v1 order by v1.f1; +f1 f2 x1 +1 30 1 +2 20 2 +3 10 3 +select f1, f2, v2.f1 as x1 from v2 order by v2.f1; +f1 f2 x1 +10 3 10 +20 2 20 +30 1 30 +select f1, f2, v3.f1 as x1 from v3 order by v3.f1; +f1 f2 x1 +10 3 10 +20 2 20 +30 1 30 +drop table t1; +drop view v1, v2, v3; +CREATE TABLE t1(key_a int4 NOT NULL, optimus varchar(32), PRIMARY KEY(key_a)); +CREATE TABLE t2(key_a int4 NOT NULL, prime varchar(32), PRIMARY KEY(key_a)); +CREATE table t3(key_a int4 NOT NULL, key_b int4 NOT NULL, foo varchar(32), +PRIMARY KEY(key_a,key_b)); +INSERT INTO t1 VALUES (0,''); +INSERT INTO t1 VALUES (1,'i'); +INSERT INTO t1 VALUES (2,'j'); +INSERT INTO t1 VALUES (3,'k'); +INSERT INTO t2 VALUES (1,'r'); +INSERT INTO t2 VALUES (2,'s'); +INSERT INTO t2 VALUES (3,'t'); +INSERT INTO t3 VALUES (1,5,'x'); +INSERT INTO t3 VALUES (1,6,'y'); +INSERT INTO t3 VALUES (2,5,'xx'); +INSERT INTO t3 VALUES (2,6,'yy'); +INSERT INTO t3 VALUES (2,7,'zz'); +INSERT INTO t3 VALUES (3,5,'xxx'); +SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +key_a foo +2 xx +EXPLAIN SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t3 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `key_a`,'xx' AS `foo` from `test`.`t1` join `test`.`t2` join `test`.`t3` where true +SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +key_a foo +2 xx +EXPLAIN SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t3 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `key_a`,'xx' AS `foo` from `test`.`t1` join `test`.`t2` join `test`.`t3` where true +DROP TABLE t1,t2,t3; +create table t1 (f1 int); +insert into t1 values(1),(2); +create table t2 (f2 int, f3 int, key(f2)); +insert into t2 values(1,1),(2,2); +create table t3 (f4 int not null); +insert into t3 values (2),(2),(2); +select f1,(select count(*) from t2,t3 where f2=f1 and f3=f4) as count from t1; +f1 count +1 0 +2 3 +drop table t1,t2,t3; +create table t1 (f1 int unique); +create table t2 (f2 int unique); +create table t3 (f3 int unique); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +insert into t3 values(1),(NULL); +select * from t3 where f3 is null; +f3 +NULL +select t2.f2 from t1 left join t2 on f1=f2 join t3 on f1=f3 where f1=1; +f2 +1 +drop table t1,t2,t3; +create table t1(f1 char, f2 char not null); +insert into t1 values(null,'a'); +create table t2 (f2 char not null); +insert into t2 values('b'); +select * from t1 left join t2 on f1=t2.f2 where t1.f2='a'; +f1 f2 f2 +NULL a NULL +drop table t1,t2; +select * from (select * left join t on f1=f2) tt; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left join t on f1=f2) tt' at line 1 +CREATE TABLE t1 (sku int PRIMARY KEY, pr int); +CREATE TABLE t2 (sku int PRIMARY KEY, sppr int, name varchar(255)); +INSERT INTO t1 VALUES +(10, 10), (20, 10), (30, 20), (40, 30), (50, 10), (60, 10); +INSERT INTO t2 VALUES +(10, 10, 'aaa'), (20, 10, 'bbb'), (30, 10, 'ccc'), (40, 20, 'ddd'), +(50, 10, 'eee'), (60, 20, 'fff'), (70, 20, 'ggg'), (80, 30, 'hhh'); +SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr +FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku); +sku sppr name sku pr +20 10 bbb 10 10 +20 10 bbb 20 10 +EXPLAIN +SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr +FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select '20' AS `sku`,'10' AS `sppr`,'bbb' AS `name`,`test`.`t1`.`sku` AS `sku`,`test`.`t1`.`pr` AS `pr` from `test`.`t2` join `test`.`t1` where (((`test`.`t1`.`sku` = 20) or (`test`.`t1`.`sku` = '10'))) +DROP TABLE t1,t2; +SET SQL_MODE='NO_UNSIGNED_SUBTRACTION'; +CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL); +INSERT t1 SET i = 0; +UPDATE t1 SET i = -1; +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +UPDATE t1 SET i = CAST(i - 1 AS SIGNED); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +UPDATE t1 SET i = i - 1; +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +DROP TABLE t1; +SET SQL_MODE=default; +create table t1 (a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t2 (a int, b int, c int, e int, primary key(a,b,c)); +# The "ANALYZE TABLE"-command that is executed further down will get +# different results depending on the order of rows in table t2. Since the +# INSERT INTO ... SELECT may be executed using different execution plans, +# we've added ORDER BY to ensure that we rows has the same order every +# time. If not, the estimated number of rows for t2 (alias 'a') in the +# EXPLAIN may change on different platforms. Note that both table t1 and +# t2 may be MYISAM, since many of the test files that includes this file +# forces MYISAM as the default storage engine. +insert into t2 select A.a, B.a, C.a, C.a from t1 A, t1 B, t1 C +ORDER BY A.a, B.a, C.a; +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select 'In next EXPLAIN, B.rows must be exactly 10:' Z; +Z +In next EXPLAIN, B.rows must be exactly 10: +explain select * from t2 a, t2 b where a.a=5 and a.b=5 and a.c<5 +and b.a=5 and b.b=a.e and (b.b =1 or b.b = 3 or b.b=5); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 27.10 Parallel execute (1 workers) +2 SIMPLE a NULL range PRIMARY PRIMARY 12 NULL 5 27.10 Using where +2 SIMPLE b NULL ref PRIMARY PRIMARY 8 const,test.a.e 10 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`b` AS `b`,`test`.`a`.`c` AS `c`,`test`.`a`.`e` AS `e`,`test`.`b`.`a` AS `a`,`test`.`b`.`b` AS `b`,`test`.`b`.`c` AS `c`,`test`.`b`.`e` AS `e` from `test`.`t2` `a` join `test`.`t2` `b` where ((`test`.`b`.`b` = `test`.`a`.`e`) and (`test`.`b`.`a` = 5) and (`test`.`a`.`b` = 5) and (`test`.`a`.`a` = 5) and (`test`.`a`.`c` < 5) and ((`test`.`a`.`e` = 1) or (`test`.`a`.`e` = 3) or (`test`.`a`.`e` = 5))) +drop table t1, t2; +CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX(b)); +INSERT INTO t1 VALUES (1, 3), (9,4), (7,5), (4,5), (6,2), +(3,1), (5,1), (8,9), (2,2), (0,9); +CREATE TABLE t2 (c int, d int, f int, INDEX(c,f)); +INSERT INTO t2 VALUES +(1,0,0), (1,0,1), (2,0,0), (2,0,1), (3,0,0), (4,0,1), +(5,0,0), (5,0,1), (6,0,0), (0,0,1), (7,0,0), (7,0,1), +(0,0,0), (0,0,1), (8,0,0), (8,0,1), (9,0,0), (9,0,1); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,b b 5 NULL 3 100.00 Using where; Using index +2 SIMPLE t2 NULL ref c c 5 test.t1.a 1 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2`.`f` AS `f` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` between 4 and 6)) +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6 AND a > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 90.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,b b 9 NULL 3 90.00 Using where; Using index +2 SIMPLE t2 NULL ref c c 5 test.t1.a 1 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2`.`f` AS `f` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` between 4 and 6) and (`test`.`t1`.`a` > 0)) +DROP TABLE t1, t2; +create table t1 ( +a int unsigned not null auto_increment primary key, +b bit not null, +c bit not null +); +create table t2 ( +a int unsigned not null auto_increment primary key, +b bit not null, +c int unsigned not null, +d varchar(50) +); +insert into t1 (b,c) values (0,1), (0,1); +insert into t2 (b,c) values (0,1); +select t1.a, t1.b + 0, t1.c + 0, t2.a, t2.b + 0, t2.c, t2.d +from t1 left outer join t2 on t1.a = t2.c and t2.b <> 1 +where t1.b <> 1 order by t1.a; +a t1.b + 0 t1.c + 0 a t2.b + 0 c d +1 0 1 1 0 1 NULL +2 0 1 NULL NULL NULL NULL +drop table t1,t2; +SELECT 0.9888889889 * 1.011111411911; +0.9888889889 * 1.011111411911 +0.9998769417899202067879 +prepare stmt from 'select 1 as " a "'; +Warnings: +Warning 1466 Leading spaces are removed from name ' a ' +execute stmt; +a +1 +CREATE TABLE t1 (a int NOT NULL PRIMARY KEY, b int NOT NULL); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +CREATE TABLE t2 (c int NOT NULL, INDEX idx(c)); +INSERT INTO t2 VALUES +(1), (1), (1), (1), (1), (1), (1), (1), +(2), (2), (2), (2), +(3), (3), +(4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL ref idx idx 4 const 8 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '1' AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = '1')) +EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=4; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL ref idx idx 4 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '4' AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = '4')) +DROP TABLE t1, t2; +CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a int); +INSERT INTO t1 VALUES (1,2), (2,NULL), (3,2); +CREATE TABLE t2 (b int, c INT, INDEX idx1(b)); +INSERT INTO t2 VALUES (2,1), (3,2); +CREATE TABLE t3 (d int, e int, INDEX idx1(d)); +INSERT INTO t3 VALUES (2,10), (2,20), (1,30), (2,40), (2,50); +EXPLAIN +SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id +WHERE t1.id=2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL const idx1 NULL NULL NULL 1 100.00 Impossible ON condition +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL const idx1 NULL NULL NULL 1 100.00 Impossible ON condition +2 SIMPLE t3 NULL ref idx1 idx1 5 const 4 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `id`,NULL AS `a`,NULL AS `b`,NULL AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t3`.`e` AS `e` from `test`.`t1` left join `test`.`t2` on(multiple equal(NULL, NULL)) join `test`.`t3` where (`test`.`t3`.`d` = 2) +SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id +WHERE t1.id=2; +id a b c d e +2 NULL NULL NULL 2 10 +2 NULL NULL NULL 2 20 +2 NULL NULL NULL 2 40 +2 NULL NULL NULL 2 50 +DROP TABLE t1,t2,t3; +create table t1 (c1 varchar(1), c2 int, c3 int, c4 int, c5 int, c6 int, +c7 int, c8 int, c9 int, fulltext key (`c1`)); +select distinct match (`c1`) against ('z') , c2, c3, c4,c5, c6,c7, c8 +from t1 where c9=1 order by c2, c2; +match (`c1`) against ('z') c2 c3 c4 c5 c6 c7 c8 +drop table t1; +CREATE TABLE t1 (pk varchar(10) PRIMARY KEY, fk varchar(16)) charset utf8mb4; +CREATE TABLE t2 (pk varchar(16) PRIMARY KEY, fk varchar(10)) charset utf8mb4; +INSERT INTO t1 VALUES +('d','dddd'), ('i','iii'), ('a','aa'), ('b','bb'), ('g','gg'), +('e','eee'), ('c','cccc'), ('h','hhh'), ('j','jjj'), ('f','fff'); +INSERT INTO t2 VALUES +('jjj', 'j'), ('cc','c'), ('ccc','c'), ('aaa', 'a'), ('jjjj','j'), +('hhh','h'), ('gg','g'), ('fff','f'), ('ee','e'), ('ffff','f'), +('bbb','b'), ('ff','f'), ('cccc','c'), ('dddd','d'), ('jj','j'), +('aaaa','a'), ('bb','b'), ('eeee','e'), ('aa','a'), ('hh','h'); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk < 'c' AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` < 'c')) +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk BETWEEN 'a' AND 'b' AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` between 'a' and 'b')) +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk IN ('a','b') AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` in ('a','b'))) +DROP TABLE t1,t2; +CREATE TABLE t1 (a int, b varchar(20) NOT NULL, PRIMARY KEY(a)) charset utf8mb4; +CREATE TABLE t2 (a int, b varchar(20) NOT NULL, +PRIMARY KEY (a), UNIQUE KEY (b)) charset utf8mb4; +INSERT INTO t1 VALUES (1,'a'),(2,'b'),(3,'c'); +INSERT INTO t2 VALUES (1,'a'),(2,'b'),(3,'c'); +EXPLAIN SELECT t1.a FROM t1 LEFT JOIN t2 ON t2.b=t1.b WHERE t1.a=3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL const b b 82 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '3' AS `a` from `test`.`t1` left join `test`.`t2` on(multiple equal('c', 'c')) where true +DROP TABLE t1,t2; +CREATE TABLE t1(id int PRIMARY KEY, b int, e int); +CREATE TABLE t2(i int, a int, INDEX si(i), INDEX ai(a)); +CREATE TABLE t3(a int PRIMARY KEY, c char(4), INDEX ci(c)); +INSERT INTO t1 VALUES +(1,10,19), (2,20,22), (4,41,42), (9,93,95), (7, 77,79), +(6,63,67), (5,55,58), (3,38,39), (8,81,89); +INSERT INTO t2 VALUES +(21,210), (41,410), (82,820), (83,830), (84,840), +(65,650), (51,510), (37,370), (94,940), (76,760), +(22,220), (33,330), (40,400), (95,950), (38,380), +(67,670), (88,880), (57,570), (96,960), (97,970); +INSERT INTO t3 VALUES +(210,'bb'), (950,'ii'), (400,'ab'), (500,'ee'), (220,'gg'), +(440,'gg'), (310,'eg'), (380,'ee'), (840,'bb'), (830,'ff'), +(230,'aa'), (960,'ii'), (410,'aa'), (510,'ee'), (290,'bb'), +(450,'gg'), (320,'dd'), (390,'hh'), (850,'jj'), (860,'ff'); +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 +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si si 5 NULL 4 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` FORCE INDEX (`si`) join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t2`.`i` between '81' and '89') and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2,t3 +WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee') ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si,ai si 5 NULL 4 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t2`.`i` between '81' and '89') and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND +t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si si 5 NULL 2 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` FORCE INDEX (`si`) join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((`test`.`t2`.`i` = '81') or (`test`.`t2`.`i` = '89')) and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2,t3 +WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND +t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si,ai si 5 NULL 2 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((`test`.`t2`.`i` = '81') or (`test`.`t2`.`i` = '89')) and (`test`.`t3`.`c` in ('bb','ee'))) +DROP TABLE t1,t2,t3; +CREATE TABLE t1 ( f1 int primary key, f2 int, f3 int, f4 int, f5 int, f6 int, checked_out int); +CREATE TABLE t2 ( f11 int PRIMARY KEY ); +INSERT INTO t1 VALUES (1,1,1,0,0,0,0),(2,1,1,3,8,1,0),(3,1,1,4,12,1,0); +INSERT INTO t2 VALUES (62); +SELECT * FROM t1 LEFT JOIN t2 ON f11 = t1.checked_out GROUP BY f1 ORDER BY f2, f3, f4, f5 LIMIT 0, 1; +f1 f2 f3 f4 f5 f6 checked_out f11 +1 1 1 0 0 0 0 NULL +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(a int); +INSERT into t1 values (1), (2), (3); +SELECT * FROM t1 LIMIT 2, -1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1 +DROP TABLE t1; +set optimizer_switch='index_merge=off'; +CREATE TABLE t1 ( +ID_with_null int NULL, +ID_better int NOT NULL, +INDEX idx1 (ID_with_null), +INDEX idx2 (ID_better) +); +INSERT INTO t1 VALUES (1,1), (2,1), (null,3), (null,3), (null,3), (null,3); +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SELECT COUNT(*) FROM t1 WHERE ID_with_null IS NULL; +COUNT(*) +128 +SELECT COUNT(*) FROM t1 WHERE ID_better=1; +COUNT(*) +2 +EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 98.46 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 98.46 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID_with_null` AS `ID_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID_with_null` is null)) +DROP INDEX idx1 ON t1; +CREATE UNIQUE INDEX idx1 ON t1(ID_with_null); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 98.46 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 98.46 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID_with_null` AS `ID_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID_with_null` is null)) +DROP TABLE t1; +CREATE TABLE t1 ( +ID1_with_null int NULL, +ID2_with_null int NULL, +ID_better int NOT NULL, +INDEX idx1 (ID1_with_null, ID2_with_null), +INDEX idx2 (ID_better) +) ; +INSERT INTO t1 VALUES (1,1,1), (2,2,1), (3,null,3), (null,3,3), (null,null,3), +(3,null,3), (null,3,3), (null,null,3), (3,null,3), (null,3,3), (null,null,3); +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null=3; +COUNT(*) +24 +SELECT COUNT(*) FROM t1 WHERE ID1_with_null=3 AND ID2_with_null IS NULL; +COUNT(*) +24 +SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null IS NULL; +COUNT(*) +192 +SELECT COUNT(*) FROM t1 WHERE ID_better=1; +COUNT(*) +2 +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID2_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID1_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and ((`test`.`t1`.`ID2_with_null` = 3) is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 79.34 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 79.34 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and (`test`.`t1`.`ID2_with_null` is null)) +DROP INDEX idx1 ON t1; +CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID2_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null IS NULL ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID1_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID2_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 79.34 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 79.34 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and (`test`.`t1`.`ID2_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND +(ID2_with_null=1 OR ID2_with_null=2); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 2.50 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 2.50 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and ((`test`.`t1`.`ID2_with_null` = 1) or (`test`.`t1`.`ID2_with_null` = 2))) +DROP TABLE t1; +set optimizer_switch='index_merge=on'; +CREATE TABLE t1 (a INT, ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY ts(ts)); +INSERT INTO t1 VALUES (30,"2006-01-03 23:00:00"), (31,"2006-01-03 23:00:00"); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CREATE TABLE t2 (a INT, dt1 DATETIME, dt2 DATETIME, PRIMARY KEY (a)); +INSERT INTO t2 VALUES (30, "2006-01-01 00:00:00", "2999-12-31 00:00:00"); +INSERT INTO t2 SELECT a+1,dt1,dt2 FROM t2; +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +EXPLAIN +SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 +AND t1.ts BETWEEN t2.dt1 AND t2.dt2 +AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t1 NULL range ts ts 4 NULL 2 50.00 Using index condition; Using where; Using MRR +Warnings: +Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`ts` AS `ts`,'30' AS `a`,'2006-01-01 00:00:00' AS `dt1`,'2999-12-31 00:00:00' AS `dt2` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = 30) and (`test`.`t1`.`ts` between '2006-01-01 00:00:00' and '2999-12-31 00:00:00') and (`test`.`t1`.`ts` between '2006-01-01' and '2006-12-31')) +SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 +AND t1.ts BETWEEN t2.dt1 AND t2.dt2 +AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; +a ts a dt1 dt2 +30 2006-01-03 23:00:00 30 2006-01-01 00:00:00 2999-12-31 00:00:00 +Warnings: +Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 +DROP TABLE t1,t2; +create table t1 (a bigint unsigned); +insert into t1 values +(if(1, 9223372036854775808, 1)), +(case when 1 then 9223372036854775808 else 1 end), +(coalesce(9223372036854775808, 1)); +select * from t1; +a +9223372036854775808 +9223372036854775808 +9223372036854775808 +drop table t1; +create table t1 charset utf8mb4 select +if(1, 9223372036854775808, 1) i, +case when 1 then 9223372036854775808 else 1 end c, +coalesce(9223372036854775808, 1) co; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` decimal(19,0) NOT NULL DEFAULT '0', + `c` decimal(19,0) NOT NULL DEFAULT '0', + `co` decimal(19,0) NOT NULL DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +select +if(1, cast(1111111111111111111 as unsigned), 1) i, +case when 1 then cast(1111111111111111111 as unsigned) else 1 end c, +coalesce(cast(1111111111111111111 as unsigned), 1) co; +i c co +1111111111111111111 1111111111111111111 1111111111111111111 +CREATE TABLE t1 (name varchar(255)) charset latin1; +CREATE TABLE t2 (name varchar(255), n int, KEY (name(3))) charset latin1; +INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); +INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); +INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); +INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT * FROM t2; +name n +bb 1 +aa 2 +cc 3 +cc  4 +cc 5 +bb 6 +cc 7 +SELECT * FROM t2 ORDER BY name; +name n +aa 2 +bb 1 +bb 6 +cc  4 +cc 3 +cc 5 +cc 7 +SELECT name, LENGTH(name), n FROM t2 ORDER BY name; +name LENGTH(name) n +aa 2 2 +bb 2 1 +bb 3 6 +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref name name 6 const 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` = 'cc ') +SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +name LENGTH(name) n +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +name LENGTH(name) n +cc 5 3 +cc  4 4 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') order by `test`.`t2`.`name` +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +name LENGTH(name) n +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +2 SIMPLE t2 NULL ref name name 6 test.t1.name 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`name` AS `name`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`n` AS `n` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`name` = `test`.`t1`.`name`)) where true +SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +name name n +aa aa 2 +aa aa 2 +bb bb 1 +bb bb 6 +cc cc 5 +cc cc 7 +cc cc 3 +ccc NULL NULL +DROP TABLE t1,t2; +CREATE TABLE t1 (name text) charset latin1; +CREATE TABLE t2 (name text, n int, KEY (name(3))) charset latin1; +INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); +INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); +INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); +INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT * FROM t2; +name n +bb 1 +aa 2 +cc 3 +cc  4 +cc 5 +bb 6 +cc 7 +SELECT * FROM t2 ORDER BY name; +name n +aa 2 +bb 1 +bb 6 +cc  4 +cc 3 +cc 5 +cc 7 +SELECT name, LENGTH(name), n FROM t2 ORDER BY name; +name LENGTH(name) n +aa 2 2 +bb 2 1 +bb 3 6 +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ref name name 6 const 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` = 'cc ') +SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +name LENGTH(name) n +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +name LENGTH(name) n +cc 5 3 +cc  4 4 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') order by `test`.`t2`.`name` +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +name LENGTH(name) n +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref name name 6 test.t1.name 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`name` AS `name`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`n` AS `n` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`name` = `test`.`t1`.`name`)) where true +SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +name name n +aa aa 2 +aa aa 2 +bb bb 1 +bb bb 6 +cc cc 5 +cc cc 7 +cc cc 3 +ccc NULL NULL +DROP TABLE t1,t2; +CREATE TABLE t1 ( +access_id int NOT NULL default '0', +name varchar(20) default NULL, +`rank` int NOT NULL default '0', +KEY idx (access_id) +); +CREATE TABLE t2 ( +faq_group_id int NOT NULL default '0', +faq_id int NOT NULL default '0', +access_id int default NULL, +UNIQUE KEY idx1 (faq_id), +KEY idx2 (faq_group_id,faq_id) +); +INSERT INTO t1 VALUES +(1,'Everyone',2),(2,'Help',3),(3,'Technical Support',1),(4,'Chat User',4); +INSERT INTO t2 VALUES +(261,265,1),(490,494,1); +SELECT t2.faq_id +FROM t1 INNER JOIN t2 IGNORE INDEX (idx1) +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +SELECT t2.faq_id +FROM t1 INNER JOIN t2 +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +DROP TABLE t1,t2; +CREATE TABLE t1 (a INT, b INT, KEY inx (b,a)); +INSERT INTO t1 VALUES (1,1), (1,2), (1,3), (1,4), (1,5), (1, 6), (1,7); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT COUNT(*) FROM t1 f1 INNER JOIN t1 f2 +ON ( f1.b=f2.b AND f1.a NULL ALL NULL NULL NULL NULL 7 100.00 Parallel execute (1 workers) +2 SIMPLE f1 NULL index inx inx 10 NULL 7 100.00 Using where; Using index +2 SIMPLE f2 NULL ref inx inx 5 test.f1.b 1 33.33 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` `f1` join `test`.`t1` `f2` where ((`test`.`f2`.`b` = `test`.`f1`.`b`) and (`test`.`f1`.`b` not in (100,2232,3343,51111)) and (`test`.`f1`.`a` < `test`.`f2`.`a`)) +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 INT); +INSERT INTO t1 VALUES (1,11), (2,22), (2,22); +EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2)))))))))))))))))))))))))))))) > 0; +EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) > 0; +ERROR HY000: Too high level of nesting for select +DROP TABLE t1; +CREATE TABLE t1 ( +c1 int(11) NOT NULL AUTO_INCREMENT, +c2 varchar(1000) DEFAULT NULL, +c3 bigint(20) DEFAULT NULL, +c4 bigint(20) DEFAULT NULL, +PRIMARY KEY (c1) +) charset utf8mb4; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN +SELECT join_2.c1 +FROM +t1 AS join_0, +t1 AS join_1, +t1 AS join_2, +t1 AS join_3, +t1 AS join_4, +t1 AS join_5, +t1 AS join_6, +t1 AS join_7 +WHERE +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +OR +join_0.c2 < '?' AND +join_1.c2 < '?' AND +join_2.c2 > '?' AND +join_2.c2 < '!' AND +join_3.c2 > '?' AND +join_4.c2 = '?' AND +join_5.c2 <> '?' AND +join_6.c2 <> '?' AND +join_7.c2 >= '?' AND +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +GROUP BY +join_3.c1, +join_2.c1, +join_7.c1, +join_1.c1, +join_0.c1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL # 1 100.00 # +2 SIMPLE join_0 NULL ALL PRIMARY NULL NULL # 1 100.00 # +2 SIMPLE join_1 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_2 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_3 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_4 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_5 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_6 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_7 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +Warnings: +Note 1003 /* select#1 */ select `test`.`join_2`.`c1` AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where (((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`)) or ((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c2` = '?') and (`test`.`join_0`.`c2` < '?') and (`test`.`join_1`.`c2` < '?') and (`test`.`join_2`.`c2` > '?') and (`test`.`join_2`.`c2` < '!') and (`test`.`join_3`.`c2` > '?') and (`test`.`join_5`.`c2` <> '?') and (`test`.`join_6`.`c2` <> '?') and (`test`.`join_7`.`c2` >= '?'))) group by `test`.`join_3`.`c1`,`test`.`join_2`.`c1`,`test`.`join_7`.`c1`,`test`.`join_1`.`c1`,`test`.`join_0`.`c1` +SHOW WARNINGS; +Level Code Message +Note 1003 /* select#1 */ select `test`.`join_2`.`c1` AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where (((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`)) or ((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c2` = '?') and (`test`.`join_0`.`c2` < '?') and (`test`.`join_1`.`c2` < '?') and (`test`.`join_2`.`c2` > '?') and (`test`.`join_2`.`c2` < '!') and (`test`.`join_3`.`c2` > '?') and (`test`.`join_5`.`c2` <> '?') and (`test`.`join_6`.`c2` <> '?') and (`test`.`join_7`.`c2` >= '?'))) group by `test`.`join_3`.`c1`,`test`.`join_2`.`c1`,`test`.`join_7`.`c1`,`test`.`join_1`.`c1`,`test`.`join_0`.`c1` +DROP TABLE t1; +SELECT 1 AS ` `; + +1 +Warnings: +Warning 1474 Name ' ' has become '' +SELECT 1 AS ` `; + +1 +Warnings: +Warning 1474 Name ' ' has become '' +SELECT 1 AS ` x`; +x +1 +Warnings: +Warning 1466 Leading spaces are removed from name ' x' +CREATE VIEW v1 AS SELECT 1 AS ``; +ERROR 42000: Incorrect column name '' +CREATE VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT (SELECT 1 AS ` `); +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` x`; +Warnings: +Warning 1466 Leading spaces are removed from name ' x' +SELECT `x` FROM v1; +x +1 +ALTER VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +DROP VIEW v1; +select str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' + and '2007/10/20 00:00:00 GMT'; +str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' + and '2007/10/20 00:00:00 GMT' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT' +Warning 1292 Truncated incorrect date value: '2007/10/20 00:00:00 GMT' +select str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6'; +str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT-6' +select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6'; +ERROR HY000: Incorrect DATE value: '2007/10/2000:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007-10-1 00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007-10-01 x00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:x00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 x12:34:56 GMT-6' +select str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; +str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6' +select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; +str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' +0 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6' +select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56'; +str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56' +1 +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00' +0 +select str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00' +1 +select str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34' +select str_to_date('2007-02-30 12:34','%Y-%m-%d %H:%i') = '2007-02-30 12:34:00'; +ERROR HY000: Incorrect DATETIME value: '2007-02-30 12:34:00' +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00' + and '2007/10/20 00:00:00'; +str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00' + and '2007/10/20 00:00:00' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +set SQL_MODE=TRADITIONAL; +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00 12:34' for function str_to_date +select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01' + and '2007/10/20'; +str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01' + and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +set SQL_MODE=DEFAULT; +select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'; +str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +select str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20'; +str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '' for function str_to_date +select str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '' for function str_to_date +select str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = ''; +ERROR HY000: Incorrect DATETIME value: '' +select str_to_date('1','%Y-%m-%d') = '1'; +ERROR HY000: Incorrect DATE value: '1' +select str_to_date('1','%Y-%m-%d') = '1'; +ERROR HY000: Incorrect DATE value: '1' +select str_to_date('','%Y-%m-%d') = ''; +ERROR HY000: Incorrect DATE value: '' +select str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL; +str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL +0 +Warnings: +Warning 1292 Truncated incorrect date value: '0000-00-00' +select str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00'; +str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00' +NULL +Warnings: +Warning 1292 Truncated incorrect date value: '2000-00-00' +select str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL; +str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL +0 +CREATE TABLE t1 (c11 INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY); +CREATE TABLE t2 (c21 INT UNSIGNED NOT NULL, +c22 INT DEFAULT NULL, +KEY(c21, c22)); +CREATE TABLE t3 (c31 INT UNSIGNED NOT NULL DEFAULT 0, +c32 INT DEFAULT NULL, +c33 INT NOT NULL, +c34 INT UNSIGNED DEFAULT 0, +KEY (c33, c34, c32)); +INSERT INTO t1 values (),(),(),(),(); +INSERT INTO t2 SELECT a.c11, b.c11 FROM t1 a, t1 b; +INSERT INTO t3 VALUES (1, 1, 1, 0), +(2, 2, 0, 0), +(3, 3, 1, 0), +(4, 4, 0, 0), +(5, 5, 1, 0); +SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND +t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND +t3.c33 = 1 AND t2.c22 in (1, 3) +ORDER BY c32; +c32 +1 +1 +3 +3 +5 +5 +SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND +t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND +t3.c33 = 1 AND t2.c22 in (1, 3) +ORDER BY c32 DESC; +c32 +5 +5 +3 +3 +1 +1 +DROP TABLE t1, t2, t3; + +# +# Bug#30736: Row Size Too Large Error Creating a Table and +# Inserting Data. +# +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; + +CREATE TABLE t1( +c1 DECIMAL(10, 2), +c2 FLOAT); + +INSERT INTO t1 VALUES (0, 1), (2, 3), (4, 5); + +CREATE TABLE t2( +c3 DECIMAL(10, 2)) +SELECT +c1 * c2 AS c3 +FROM t1; + +SELECT * FROM t1; +c1 c2 +0.00 1 +2.00 3 +4.00 5 + +SELECT * FROM t2; +c3 +0.00 +6.00 +20.00 + +DROP TABLE t1; +DROP TABLE t2; + +CREATE TABLE t1 (c1 BIGINT NOT NULL); +INSERT INTO t1 (c1) VALUES (1); +SELECT * FROM t1 WHERE c1 > NULL + 1; +c1 +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10) NOT NULL PRIMARY KEY); +INSERT INTO t1 (a) VALUES ('foo0'), ('bar0'), ('baz0'); +SELECT * FROM t1 WHERE a IN (CONCAT('foo', 0), 'bar'); +a +foo0 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +CREATE TABLE t2 (a INT, c INT, KEY(a)); +INSERT INTO t1 VALUES (1, 1), (2, 2); +INSERT INTO t2 VALUES (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), +(2, 1), (2, 2), (2, 3), (2, 4), (2, 5), +(3, 1), (3, 2), (3, 3), (3, 4), (3, 5), +(4, 1), (4, 2), (4, 3), (4, 4), (4, 5); +FLUSH STATUS; +SELECT DISTINCT b FROM t1 LEFT JOIN t2 USING(a) WHERE c <= 3; +b +1 +2 +SHOW STATUS LIKE 'Handler_read%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 13 +Handler_read_last 0 +Handler_read_next 10 +Handler_read_prev 0 +Handler_read_rnd 10 +Handler_read_rnd_next 6 +DROP TABLE t1, t2; +CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0', +f2 int(11) NOT NULL default '0', +f3 bigint(20) NOT NULL default '0', +f4 varchar(255) NOT NULL default '', +PRIMARY KEY (f1), +KEY key1 (f4), +KEY key2 (f2)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t2 (f1 int(11) NOT NULL default '0', +f2 enum('A1','A2','A3') NOT NULL default 'A1', +f3 int(11) NOT NULL default '0', +PRIMARY KEY (f1), +KEY key1 (f3)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0', +f2 datetime NOT NULL default '1980-01-01 00:00:00', +PRIMARY KEY (f1)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1, 1, 1, 'abc'); +insert into t1 values (2, 1, 2, 'def'); +insert into t1 values (3, 1, 2, 'def'); +insert into t2 values (1, 'A1', 1); +insert into t3 values (1, '1980-01-01'); +SELECT a.f3, cr.f4, count(*) count +FROM t2 a +STRAIGHT_JOIN t1 cr ON cr.f2 = a.f1 +LEFT JOIN +(t1 cr2 +JOIN t3 ae2 ON cr2.f3 = ae2.f1 +) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND +cr.f4 = cr2.f4 +GROUP BY a.f3, cr.f4; +f3 f4 count +1 abc 1 +1 def 2 +drop table t1, t2, t3; +CREATE TABLE t1 (a INT KEY, b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a, b FROM t1 WHERE a > 1 AND a = b LIMIT 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 25.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 3 25.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 SELECT a, b FROM t1 WHERE a > 1 AND b = a LIMIT 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 25.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 3 25.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` > 1)) limit 2 +DROP TABLE t1; +# +# Bug#47019: Assertion failed: 0, file .\rt_mbr.c, line 138 when +# forcing a spatial index +# +CREATE TABLE t1(a LINESTRING NOT NULL SRID 0, SPATIAL KEY(a)); +INSERT INTO t1 VALUES +(ST_GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')), +(ST_GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')); +EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t2 NULL ALL a NULL NULL NULL 2 100.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; +1 +1 +1 +1 +1 +EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t2 NULL ALL a NULL NULL NULL 2 100.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` FORCE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); +1 +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug #48291 : crash with row() operator,select into @var, and +# subquery returning multiple rows +# +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (2),(3); +# Should not crash +SELECT 1 FROM t1 WHERE a <> 1 AND NOT +ROW(1,a) <=> ROW(1,(SELECT 1 FROM t1)) +INTO @var0; +ERROR 21000: Subquery returns more than 1 row +DROP TABLE t1; +# +# Bug #48458: simple query tries to allocate enormous amount of +# memory +# +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1(a INT NOT NULL, b YEAR); +INSERT INTO t1 VALUES (); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +CREATE TABLE t2(c INT); +# Should not err out because of out-of-memory +SELECT 1 FROM t2 JOIN t1 ON 1=1 +WHERE a != '1' AND NOT a >= b OR NOT ROW(b,a )<> ROW(a,a); +1 +DROP TABLE t1,t2; +SET sql_mode = default; +# +# Bug #49199: Optimizer handles incorrectly: +# field='const1' AND field='const2' in some cases + +CREATE TABLE t1(a DATETIME NOT NULL); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 00:00:00 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +DROP TABLE t1; +CREATE TABLE t1(a DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2001-01-01') +DROP TABLE t1; +CREATE TABLE t1(a TIMESTAMP NOT NULL NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 00:00:00 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +a b +2001-01-01 00:00:00 2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = DATE'2001-01-01') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b VARCHAR(20) NOT NULL) charset utf8mb4; +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +a b +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = '2001-01-01 00:00:00') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01'; +a b +2001-01-01 00:00:00 2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = '2001-01-01') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT x.a, y.a, z.a FROM t1 x +JOIN t1 y ON x.a=y.a +JOIN t1 z ON y.a=z.a +WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; +a a a +2001-01-01 00:00:00 2001-01-01 00:00:00 2001-01-01 00:00:00 +EXPLAIN SELECT x.a, y.a, z.a FROM t1 x +JOIN t1 y ON x.a=y.a +JOIN t1 z ON y.a=z.a +WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE x NULL ALL NULL NULL NULL NULL 1 100.00 Using where +2 SIMPLE y NULL ALL NULL NULL NULL NULL 1 100.00 Using where +2 SIMPLE z NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`y`.`a` AS `a`,`test`.`z`.`a` AS `a` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` where ((`test`.`x`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (`test`.`y`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (`test`.`z`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +# +# Bug #49897: crash in ptr_compare when char(0) NOT NULL +# column is used for ORDER BY +# +SET @old_sort_buffer_size= @@session.sort_buffer_size; +SET @@sort_buffer_size= 40000; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1(a CHAR(0) NOT NULL); +INSERT INTO t1 VALUES (0), (0), (0); +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a FROM t1 ORDER BY a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24404 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24404 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `test`.`t1`.`a` +SELECT a FROM t1 ORDER BY a; +DROP TABLE t1; +CREATE TABLE t1(a CHAR(0) NOT NULL, b CHAR(0) NOT NULL, c int); +INSERT INTO t1 VALUES (0, 0, 0), (0, 0, 2), (0, 0, 1); +# Since ANALYZE TABLE only reads a subset of the data, the statistics for +# table t1 depends on the row order. And since the INSERT INTO ... SELECT +# may be executed using different execution plans, we've added ORDER BY +# to ensure that we rows has the same order every time. If not, the +# estimated number of rows in EXPLAIN may change on different platforms. +# Note that the tables may MYISAM, since many of the test files that +# includes this file forces MYISAM as the default storage engine. +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a FROM t1 ORDER BY a LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `test`.`t1`.`a` limit 5 +SELECT a FROM t1 ORDER BY a LIMIT 5; +a + + + + + +EXPLAIN SELECT * FROM t1 ORDER BY a, b LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b` limit 5 +SELECT * FROM t1 ORDER BY a, b LIMIT 5; +a b c + 2 + 2 + 2 + 2 + 2 +EXPLAIN SELECT * FROM t1 ORDER BY a, b, c LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b`,`test`.`t1`.`c` limit 5 +SELECT * FROM t1 ORDER BY a, b, c LIMIT 5; +a b c + 0 + 0 + 0 + 0 + 0 +EXPLAIN SELECT * FROM t1 ORDER BY c, a LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`c`,`test`.`t1`.`a` limit 5 +SELECT * FROM t1 ORDER BY c, a LIMIT 5; +a b c + 0 + 0 + 0 + 0 + 0 +SET @@sort_buffer_size= @old_sort_buffer_size; +DROP TABLE t1; +SET sql_mode = default; +End of 5.0 tests +create table t1(a INT, KEY (a)); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5); +SELECT a FROM t1 ORDER BY a LIMIT 2; +a +1 +2 +SELECT a FROM t1 ORDER BY a LIMIT 2,4294967296; +a +3 +4 +5 +SELECT a FROM t1 ORDER BY a LIMIT 2,4294967297; +a +3 +4 +5 +DROP TABLE t1; +CREATE TABLE A (date_key date); +CREATE TABLE C ( +pk int, +int_nokey int, +int_key int, +date_key date NOT NULL, +date_nokey date, +varchar_key varchar(1) +); +INSERT IGNORE INTO C VALUES +(1,1,1,'0000-00-00',NULL,NULL), +(1,1,1,'0000-00-00',NULL,NULL); +Warnings: +Warning 1264 Out of range value for column 'date_key' at row 1 +Warning 1264 Out of range value for column 'date_key' at row 2 +SELECT 1 FROM C WHERE pk > ANY (SELECT 1 FROM C); +1 +SELECT COUNT(DISTINCT 1) FROM C +WHERE date_key = (SELECT 1 FROM A WHERE C.date_key IS NULL) GROUP BY pk; +COUNT(DISTINCT 1) +SELECT date_nokey FROM C +WHERE int_key IN (SELECT 1 FROM A) +HAVING date_nokey = '10:41:7' +ORDER BY date_key; +ERROR HY000: Incorrect DATE value: '10:41:7' +DROP TABLE A,C; +CREATE TABLE t1 (a INT NOT NULL, b INT); +INSERT INTO t1 VALUES (1, 1); +EXPLAIN SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where true +SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2; +a b +1 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL); +EXPLAIN SELECT * FROM t1 WHERE (a=a AND b=b AND c=c) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +EXPLAIN SELECT * FROM t1 WHERE (a=a AND a=a AND b=b) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +EXPLAIN SELECT * FROM t1 WHERE (a=a AND b=b AND a=a) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +DROP TABLE t1; +# +# Bug#45266: Uninitialized variable lead to an empty result. +# +drop table if exists A,AA,B,BB; +CREATE TABLE `A` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`date_key` date NOT NULL, +`date_nokey` date NOT NULL, +`datetime_key` datetime NOT NULL, +`int_nokey` int(11) NOT NULL, +`time_key` time NOT NULL, +`time_nokey` time NOT NULL, +PRIMARY KEY (`pk`), +KEY `date_key` (`date_key`), +KEY `time_key` (`time_key`), +KEY `datetime_key` (`datetime_key`) +); +CREATE TABLE `AA` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`int_nokey` int(11) NOT NULL, +`time_key` time NOT NULL, +KEY `time_key` (`time_key`), +PRIMARY KEY (`pk`) +); +CREATE TABLE `B` ( +`date_nokey` date NOT NULL, +`date_key` date NOT NULL, +`time_key` time NOT NULL, +`datetime_nokey` datetime NOT NULL, +`varchar_key` varchar(1) NOT NULL, +KEY `date_key` (`date_key`), +KEY `time_key` (`time_key`), +KEY `varchar_key` (`varchar_key`) +); +INSERT IGNORE INTO `B` VALUES ('2003-07-28','2003-07-28','15:13:38','0000-00-00 00:00:00','f'),('0000-00-00','0000-00-00','00:05:48','2004-07-02 14:34:13','x'); +CREATE TABLE `BB` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`int_nokey` int(11) NOT NULL, +`date_key` date NOT NULL, +`varchar_nokey` varchar(1) NOT NULL, +`date_nokey` date NOT NULL, +PRIMARY KEY (`pk`), +KEY `date_key` (`date_key`) +); +INSERT IGNORE INTO `BB` VALUES (10,8,'0000-00-00','i','0000-00-00'),(11,0,'2005-08-18','','2005-08-18'); +SELECT table1 . `pk` AS field1 +FROM +(BB AS table1 INNER JOIN +(AA AS table2 STRAIGHT_JOIN A AS table3 +ON ( table3 . `date_key` = table2 . `pk` )) +ON ( table3 . `datetime_key` = table2 . `int_nokey` )) +WHERE ( table3 . `date_key` <= 4 AND table2 . `pk` = table1 . `varchar_nokey`) +GROUP BY field1 ; +field1 +SELECT table3 .`date_key` field1 +FROM +B table1 LEFT JOIN B table3 JOIN +(BB table6 JOIN A table7 ON table6 .`varchar_nokey`) +ON table6 .`int_nokey` ON table6 .`date_key` + WHERE NOT ( table1 .`varchar_key` AND table7 .`pk`) GROUP BY field1; +field1 +NULL +SELECT table4 . `time_nokey` AS field1 FROM +(AA AS table1 CROSS JOIN +(AA AS table2 STRAIGHT_JOIN +(B AS table3 STRAIGHT_JOIN A AS table4 +ON ( table4 . `date_key` = table3 . `time_key` )) +ON ( table4 . `pk` = table3 . `date_nokey` )) +ON ( table4 . `time_key` = table3 . `datetime_nokey` )) +WHERE ( table4 . `time_key` < table1 . `time_key` AND +table1 . `int_nokey` != 'f') +GROUP BY field1 ORDER BY field1 , field1; +field1 +SELECT table1 .`time_key` field2 FROM B table1 LEFT JOIN BB JOIN A table5 ON table5 .`date_nokey` ON table5 .`int_nokey` GROUP BY field2; +field2 +00:05:48 +15:13:38 +drop table A,AA,B,BB; +#end of test for bug#45266 +# +# Bug#33546: Slowdown on re-evaluation of constant expressions. +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (2); +SELECT * FROM t1 WHERE a = 1 + 1; +a +2 +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE a = 1 + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 10.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = ((1 + 1))) +SELECT * FROM t1 HAVING a = 1 + 1; +a +2 +EXPLAIN SELECT * FROM t1 HAVING a = 1 + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 100.00 NULL +Warnings: +Note 1003 /* select#1 */ 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 +EXPLAIN SELECT * FROM t1, t2 WHERE a = b + (1 + 1); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = (`test`.`t2`.`b` + ((1 + 1)))) +SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; +b a +2 3 +EXPLAIN SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t2` left join `test`.`t1` on((`test`.`t1`.`a` = (`test`.`t2`.`b` + 1))) where true +EXPLAIN SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 33.33 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 33.33 Using where +Warnings: +Note 1003 /* select#1 */ 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; +RETURN 1; +END;| +SET @cnt := 0; +SELECT * FROM t1 WHERE a = f1(); +a +1 +SELECT @cnt; +@cnt +1 +EXPLAIN SELECT * FROM t1 WHERE a = f1(); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 +# +# BUG#48052: Valgrind warning - uninitialized value in init_read_record() +# +# Disable Index condition pushdown +SELECT @old_optimizer_switch:=@@optimizer_switch; +@old_optimizer_switch:=@@optimizer_switch +# +Warnings: +# 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +CREATE TABLE t1 ( +pk int(11) NOT NULL, +i int(11) DEFAULT NULL, +v varchar(1) DEFAULT NULL, +PRIMARY KEY (pk) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (2,7,'m'); +INSERT INTO t1 VALUES (3,9,'m'); +SELECT v +FROM t1 +WHERE NOT pk > 0 +HAVING v <= 't' +ORDER BY pk; +v +# Restore old value for Index condition pushdown +SET SESSION optimizer_switch=@old_optimizer_switch; +DROP TABLE t1; +# +# Bug#49489 Uninitialized cache led to a wrong result. +# +CREATE TABLE t1(c1 DOUBLE(5,4)); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (9.1234); +SELECT * FROM t1 WHERE c1 < 9.12345; +c1 +9.1234 +DROP TABLE t1; +# End of test for bug#49489. +# +# Bug #49517: Inconsistent behavior while using +# NULLable BIGINT and INT columns in comparison +# +CREATE TABLE t1(a BIGINT UNSIGNED NOT NULL, b BIGINT NULL, c INT NULL); +INSERT INTO t1 VALUES(105, NULL, NULL); +SELECT * FROM t1 WHERE b < 102; +a b c +SELECT * FROM t1 WHERE c < 102; +a b c +SELECT * FROM t1 WHERE 102 < b; +a b c +SELECT * FROM t1 WHERE 102 < c; +a b c +DROP TABLE t1; +# +# Bug #54459: Assertion failed: param.sort_length, +# file .\filesort.cc, line 149 (part II) +# +CREATE TABLE t1(a ENUM('') NOT NULL) charset latin1; +INSERT INTO t1 VALUES (), (), (); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` order by `(t1.a collate latin1_german2_ci)` +SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug #58422: Incorrect result when OUTER JOIN'ing +# with an empty table +# +CREATE TABLE t_empty(pk INT PRIMARY KEY, i INT); +CREATE TABLE t1(pk INT PRIMARY KEY, i INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3); +CREATE TABLE t2(pk INT PRIMARY KEY, i INT) ; +INSERT INTO t2 VALUES (1,1), (2,2), (3,3); +ANALYZE TABLE t_empty, t1, t2; +Table Op Msg_type Msg_text +test.t_empty analyze status OK +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`pk` = `test`.`t1`.`pk`) and (`test`.`t1`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`pk` = `test`.`t1`.`pk`) and (`test`.`t1`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t2 NULL range PRIMARY PRIMARY 4 NULL 2 33.33 Using where +2 SIMPLE t1 NULL eq_ref PRIMARY PRIMARY 4 test.t2.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`i` = `test`.`t_empty`.`i`) and (`test`.`t1`.`pk` = `test`.`t2`.`pk`) and (`test`.`t2`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +DROP TABLE t1,t2,t_empty; +End of 5.1 tests +# +# Bug#45227: Lost HAVING clause led to a wrong result. +# +CREATE TABLE `cc` ( +`int_nokey` int(11) NOT NULL, +`int_key` int(11) NOT NULL, +`varchar_key` varchar(1) NOT NULL, +`varchar_nokey` varchar(1) NOT NULL, +KEY `int_key` (`int_key`), +KEY `varchar_key` (`varchar_key`) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `cc` VALUES +(0,8,'q','q'),(5,8,'m','m'),(7,3,'j','j'),(1,2,'z','z'),(8,2,'a','a'),(2,6,'',''),(1,8,'e' +,'e'),(8,9,'t','t'),(5,2,'q','q'),(4,6,'b','b'),(5,5,'w','w'),(3,2,'m','m'),(0,4,'x','x'), +(8,9,'',''),(0,6,'w','w'),(4,5,'x','x'),(0,0,'e','e'),(0,0,'e','e'),(2,8,'p','p'),(0,0,'x' +,'x'); +EXPLAIN SELECT `varchar_nokey` g1 FROM cc WHERE `int_nokey` AND `int_key` <= 4 +HAVING g1 ORDER BY `varchar_key` LIMIT 6 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 9 90.00 Parallel execute (1 workers) +2 SIMPLE cc NULL range int_key int_key 4 NULL 9 90.00 Using index condition; Using where; Using MRR; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`cc`.`varchar_nokey` AS `g1` from `test`.`cc` where ((0 <> `test`.`cc`.`int_nokey`) and (`test`.`cc`.`int_key` <= 4)) having (0 <> `g1`) order by `test`.`cc`.`varchar_key` limit 6 +SELECT `varchar_nokey` g1 FROM cc WHERE `int_nokey` AND `int_key` <= 4 +HAVING g1 ORDER BY `varchar_key` LIMIT 6 ; +g1 +Warning 1292 Truncated incorrect DOUBLE value: 'a' +Warning 1292 Truncated incorrect DOUBLE value: 'j' +Warning 1292 Truncated incorrect DOUBLE value: 'm' +Warning 1292 Truncated incorrect DOUBLE value: 'q' +Warning 1292 Truncated incorrect DOUBLE value: 'z' +Warnings: +DROP TABLE cc; +# End of test#45227 +# +# Bug#54515: Crash in opt_range.cc::get_best_group_min_max on +# SELECT from VIEW with GROUP BY +# +CREATE TABLE t1 ( +col_int_key int DEFAULT NULL, +KEY int_key (col_int_key) +) ; +INSERT INTO t1 VALUES (1),(2); +CREATE VIEW view_t1 AS +SELECT t1.col_int_key AS col_int_key +FROM t1; +SELECT col_int_key FROM view_t1 GROUP BY col_int_key; +col_int_key +1 +2 +DROP VIEW view_t1; +DROP TABLE t1; +# End of test BUG#54515 +# +# Bug #57203 Assertion `field_length <= 255' failed. +# +SELECT coalesce((avg(distinct (ST_geomfromtext("point(25379 -22010)"))))) +UNION ALL +SELECT coalesce((avg(distinct (ST_geomfromtext("point(25379 -22010)"))))) +AS foo +; +ERROR HY000: Incorrect arguments to avg +CREATE table t1(a text); +INSERT INTO t1 VALUES (''), (''); +SELECT avg(distinct(t1.a)) FROM t1, t1 t2 +GROUP BY t2.a ORDER BY t1.a; +avg(distinct(t1.a)) +0 +DROP TABLE t1; +# End of test BUG#57203 +# +# Bug#63020: Function "format"'s 'locale' argument is not considered +# when creating a "view' +# +CREATE TABLE t1 (f1 DECIMAL(10,2)); +INSERT INTO t1 VALUES (11.67),(17865.3),(12345678.92); +CREATE VIEW view_t1 AS SELECT FORMAT(f1,1,'sk_SK') AS f1 FROM t1; +SHOW CREATE VIEW view_t1; +View Create View character_set_client collation_connection +view_t1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_t1` AS select format(`t1`.`f1`,1,'sk_SK') AS `f1` from `t1` utf8mb4 utf8mb4_0900_ai_ci +SELECT * FROM view_t1; +f1 +11,7 +17 865,3 +12 345 678,9 +DROP TABLE t1; +DROP VIEW view_t1; +# End of test BUG#63020 +# +# Bug #13571700 TINYBLOB NOT NULL, CRASH IN PROTOCOL::NET_STORE_DATA +# +CREATE TABLE t1 (a TINYBLOB NOT NULL); +SELECT a, COUNT(*) FROM t1 WHERE 0; +a COUNT(*) +NULL 0 +DROP TABLE t1; +# End of test BUG#13571700 +# +# Bug #18766378: CRASH IN ITEM_SUM_BIT::RESET_FIELD +# +CREATE TABLE t1(b int); +CREATE TABLE t2(a int); +INSERT INTO t1 VALUES (),(); +INSERT INTO t2 VALUES (),(); +SELECT +( SELECT 1 FROM t1 GROUP BY a +HAVING avg(distinct 1) ORDER BY max(a) +) +FROM t1, t2 +GROUP BY a; +( SELECT 1 FROM t1 GROUP BY a +HAVING avg(distinct 1) ORDER BY max(a) +) +1 +DROP TABLE t1,t2; +# End of test BUG#18766378 +# +# WL#13002: RESULTSET DIFFERENT NUMBER OF ROWS +# +CREATE TABLE t1 ( +f1 INTEGER, +f2 INTEGER, +INDEX i1 (f2) +); +INSERT INTO t1 VALUES (NULL,1); +INSERT INTO t1 VALUES (2,NULL); +INSERT INTO t1 VALUES (3,1); +INSERT INTO t1 VALUES (4,6); +INSERT INTO t1 VALUES (NULL,5); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (13,1); +INSERT INTO t1 VALUES (NULL,0); +INSERT INTO t1 VALUES (5,2); +INSERT INTO t1 VALUES (NULL,8); +INSERT INTO t1 VALUES (NULL,7); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (NULL,4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN FORMAT=tree SELECT * +FROM t1 AS alias1 LEFT JOIN t1 AS alias2 ON alias1.f1 = alias2.f2 +WHERE alias2.f1 NOT BETWEEN 4 AND 12; +EXPLAIN +-> Parallel scan on + -> Batched key access inner join + -> Batch input rows + -> PQblock scan on alias1 (cost=1.65 rows=14) + -> Filter: (alias2.f1 not between 4 and 12) + -> Multi-range index lookup on alias2 using i1 (f2=alias1.f1) + +SELECT * +FROM t1 AS alias1 LEFT JOIN t1 AS alias2 ON alias1.f1 = alias2.f2 +WHERE alias2.f1 NOT BETWEEN 4 AND 12; +f1 f2 f1 f2 +DROP TABLE t1; +set optimizer_switch=default; +set optimizer_switch=default; diff --git a/mysql-test/r/select_icp_mrr.result-pq b/mysql-test/r/select_icp_mrr.result-pq new file mode 100644 index 000000000000..2981756dff3b --- /dev/null +++ b/mysql-test/r/select_icp_mrr.result-pq @@ -0,0 +1,5700 @@ +set optimizer_switch='index_condition_pushdown=on,mrr=on,mrr_cost_based=off'; +drop table if exists t1,t2,t3,t4,t11; +drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; +drop view if exists v1; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +); +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +select * from t1; +Period Varor_period +9410 9412 +select t1.* from t1; +Period Varor_period +9410 9412 +CREATE TABLE t2 ( +auto int not null auto_increment, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL, +UNIQUE fld1 (fld1), +KEY fld3 (fld3), +PRIMARY KEY (auto) +) charset utf8mb4; +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +imaginable +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +cultivation +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3 from t2 order by fld3 desc limit 10; +fld3 +youthfulness +yelped +Wotan +workers +Witt +witchcraft +Winsett +Willy +willed +wildcats +select fld3 from t2 order by fld3 desc limit 5; +fld3 +youthfulness +yelped +Wotan +workers +Witt +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +witchcraft +Winsett +Willy +willed +wildcats +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'h%le'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; +fld3 +explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 0.09 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 0.09 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` IGNORE INDEX (`fld3`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 0.09 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 0.09 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld1`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld3`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld3`) USE INDEX (`fld1`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 ignore index (fld3,not_used); +ERROR 42000: Key 'not_used' doesn't exist in table 't2' +explain select fld3 from t2 use index (not_used); +ERROR 42000: Key 'not_used' doesn't exist in table 't2' +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +honeysuckle +honoring +explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range fld3 fld3 120 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where ((`test`.`t2`.`fld3` >= 'honeysuckle') and (`test`.`t2`.`fld3` <= 'honoring')) order by `test`.`t2`.`fld3` +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +fld1 fld3 +148504 Colombo +068305 Colombo +000000 nondecreasing +select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes'; +fld1 fld3 +232605 appendixes +1232605 appendixes +1232606 appendixes +1232607 appendixes +1232608 appendixes +1232609 appendixes +select fld1 from t2 where fld1=250501 or fld1="250502"; +fld1 +250501 +250502 +explain select fld1 from t2 where fld1=250501 or fld1="250502"; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL range fld1 fld1 4 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld1` AS `fld1` from `test`.`t2` where ((`test`.`t2`.`fld1` = 250501) or (`test`.`t2`.`fld1` = 250502)) +select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +fld1 +250501 +250502 +250505 +250601 +explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL range fld1 fld1 4 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld1` AS `fld1` from `test`.`t2` where ((`test`.`t2`.`fld1` = 250501) or (`test`.`t2`.`fld1` = 250502) or ((`test`.`t2`.`fld1` >= 250505) and (`test`.`t2`.`fld1` <= 250601)) or (`test`.`t2`.`fld1` between 250501 and 250502)) +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +fld1 fld3 +012001 flanking +013602 foldout +013606 fingerings +018007 fanatic +018017 featherweight +018054 fetters +018103 flint +018104 flopping +036002 funereal +038017 fetched +038205 firearm +058004 Fenton +088303 feminine +186002 freakish +188007 flurried +188505 fitting +198006 furthermore +202301 Fitzpatrick +208101 fiftieth +208113 freest +218008 finishers +218022 feed +218401 faithful +226205 foothill +226209 furnishings +228306 forthcoming +228311 fated +231315 freezes +232102 forgivably +238007 filial +238008 fixedly +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +fld3 +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +fld3 +Chantilly +select fld1,fld3 from t2 where fld1 like "25050%"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select fld1,fld3 from t2 where fld1 like "25050_"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select distinct companynr from t2; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr desc; +companynr +68 +65 +58 +53 +50 +41 +40 +37 +36 +34 +29 +00 +select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%" order by fld3; +fld3 period +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +select distinct fld3 from t2 where companynr = 34 order by fld3; +fld3 +absentee +accessed +ahead +alphabetic +Asiaticizations +attitude +aye +bankruptcies +belays +Blythe +bomb +boulevard +bulldozes +cannot +caressing +charcoal +checksumming +chess +clubroom +colorful +cosy +creator +crying +Darius +diffusing +duality +Eiffel +Epiphany +Ernestine +explorers +exterminated +famine +forked +Gershwins +heaving +Hodges +Iraqis +Italianization +Lagos +landslide +libretto +Majorca +mastering +narrowed +occurred +offerers +Palestine +Peruvianizes +pharmaceutic +poisoning +population +Pygmalion +rats +realest +recording +regimented +retransmitting +reviver +rouses +scars +sicker +sleepwalk +stopped +sugars +translatable +uncles +unexpected +uprisings +versatility +vest +select distinct fld3 from t2 limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct fld3 from t2 having fld3 like "A%" limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct substring(fld3,1,3) from t2 where fld3 like "A%"; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +Adl +adm +Ado +ads +adv +aer +aff +afi +afl +afo +agi +ahe +aim +air +Ald +alg +ali +all +alp +alr +ama +ame +amm +ana +and +ane +Ang +ani +Ann +Ant +api +app +aqu +Ara +arc +Arm +arr +Art +Asi +ask +asp +ass +ast +att +aud +Aug +aut +ave +avo +awe +aye +Azt +select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +create table t3 ( +period int not null, +name char(32) not null, +companynr int not null, +price double(11,0), +price2 double(11,0), +key (period), +key (name) +); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +create temporary table tmp select * from t3; +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +alter table t3 add t2nr int not null auto_increment primary key first; +drop table tmp; +SET BIG_TABLES=1; +select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10; +namn +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +SET BIG_TABLES=0; +select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10; +concat(fld3," ",fld3) +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +select distinct fld5 from t2 limit 10; +fld5 +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +select distinct companynr, fld3,count(*) from t2 group by companynr, fld3 order by companynr, fld3 limit 10; +companynr fld3 count(*) +00 affixed 1 +00 and 1 +00 annoyers 1 +00 Anthony 1 +00 assayed 1 +00 assurers 1 +00 attendants 1 +00 bedlam 1 +00 bedpost 1 +00 boasted 1 +SET BIG_TABLES=1; +select distinct companynr, fld3,count(*) from t2 group by companynr, fld3 order by companynr, fld3 limit 10; +companynr fld3 count(*) +00 affixed 1 +00 and 1 +00 annoyers 1 +00 Anthony 1 +00 assayed 1 +00 assurers 1 +00 attendants 1 +00 bedlam 1 +00 bedpost 1 +00 boasted 1 +SET BIG_TABLES=0; +select distinct companynr, fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr ,fld3 order by companynr, fld3 limit 100,10; +companynr fld3 repeat("a",length(fld3)) count(*) +29 chancellor aaaaaaaaaa 1 +29 Chippewa aaaaaaaa 1 +29 circumference aaaaaaaaaaaaa 1 +29 circus aaaaaa 1 +29 cited aaaaa 1 +29 Colombo aaaaaaa 1 +29 congresswoman aaaaaaaaaaaaa 1 +29 contrition aaaaaaaaaa 1 +29 corny aaaaa 1 +29 cultivation aaaaaaaaaaa 1 +select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2; +companynr rtrim(space(512+companynr)) +37 +78 +101 +154 +311 +447 +512 +select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; +fld3 +explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 10.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL fld1 NULL NULL NULL 1199 10.00 Using where; Using temporary; Using filesort +2 SIMPLE t3 NULL eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`t2nr` AS `t2nr`,`test`.`t2`.`fld3` AS `fld3` from `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld1` = `test`.`t3`.`t2nr`)) order by `test`.`t3`.`t2nr`,`test`.`t2`.`fld3` +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 41736 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL period NULL NULL NULL 41736 100.00 Using temporary; Using filesort +2 SIMPLE t3 NULL ref period period 4 test.t1.period 4173 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t3`.`period` = `test`.`t1`.`period`) order by `test`.`t3`.`period` +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (4 workers) +2 SIMPLE t3 NULL index period period 4 NULL 1 100.00 NULL +2 SIMPLE t1 NULL ref period period 4 test.t3.period 4173 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t1`.`period` = `test`.`t3`.`period`) order by `test`.`t3`.`period` limit 10 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL index period period 4 NULL 1 100.00 NULL +2 SIMPLE t3 NULL ref period period 4 test.t1.period 4173 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t3`.`period` = `test`.`t1`.`period`) order by `test`.`t1`.`period` limit 10 +select period from t1; +period +9410 +select period from t1 where period=1900; +period +select fld3,period from t1,t2 where fld1 = 011401 order by period; +fld3 period +breaking 9410 +select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001; +fld3 period +breaking 1001 +explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const fld1 fld1 4 const 1 100.00 NULL +1 SIMPLE t3 NULL const PRIMARY,period PRIMARY 4 const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select 'breaking' AS `fld3`,'1001' AS `period` from `test`.`t2` join `test`.`t3` where true +select fld3,period from t2,t1 where companynr*10 = 37*10 order by fld3; +fld3 period +abates 9410 +Abraham 9410 +abrogating 9410 +accessed 9410 +Aden 9410 +admiring 9410 +admonishing 9410 +Adolph 9410 +afield 9410 +afore 9410 +aging 9410 +airships 9410 +Aldrich 9410 +alike 9410 +Alison 9410 +allot 9410 +already 9410 +amenities 9410 +ammonium 9410 +analogy 9410 +analyzable 9410 +Anatole 9410 +animals 9410 +animized 9410 +annihilates 9410 +announced 9410 +announces 9410 +Antarctica 9410 +Antares 9410 +apiary 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +Arabia 9410 +arriving 9410 +Artemia 9410 +arteriole 9410 +assails 9410 +astound 9410 +attainments 9410 +attrition 9410 +audiology 9410 +Augustine 9410 +avenge 9410 +avoidable 9410 +babies 9410 +babysitting 9410 +Baird 9410 +balled 9410 +beaner 9410 +beaters 9410 +bee 9410 +Beebe 9410 +befouled 9410 +bellow 9410 +bestseller 9410 +betroth 9410 +bewilderingly 9410 +bills 9410 +bitterroot 9410 +bivalves 9410 +bloater 9410 +bloodbath 9410 +boat 9410 +boom 9410 +boorish 9410 +boulder 9410 +breaking 9410 +brunch 9410 +buckboards 9410 +burlesque 9410 +Butterfield 9410 +cage 9410 +capably 9410 +capped 9410 +cascade 9410 +Cassites 9410 +causality 9410 +cautioned 9410 +ceiling 9410 +celery 9410 +CERN 9410 +certificates 9410 +chafe 9410 +chaperone 9410 +charges 9410 +chasm 9410 +checkpoints 9410 +chewing 9410 +chews 9410 +Chicana 9410 +chillingly 9410 +Chippewa 9410 +chronicle 9410 +ciphers 9410 +civics 9410 +clamored 9410 +Clayton 9410 +clenched 9410 +clockers 9410 +coexist 9410 +cokes 9410 +combed 9410 +coming 9410 +commencements 9410 +commonplace 9410 +communicants 9410 +compartment 9410 +comprehensive 9410 +comprised 9410 +conceptions 9410 +concludes 9410 +congregates 9410 +Conley 9410 +Connally 9410 +contrary 9410 +contrasted 9410 +convenient 9410 +convulsion 9410 +corset 9410 +count 9410 +coverings 9410 +Crays 9410 +craziness 9410 +creak 9410 +creek 9410 +critiques 9410 +crunches 9410 +culled 9410 +cult 9410 +cupboard 9410 +cured 9410 +cute 9410 +daughter 9410 +decliner 9410 +decomposition 9410 +deductions 9410 +dehydrate 9410 +deludes 9410 +denizen 9410 +denotative 9410 +denounces 9410 +dental 9410 +dentally 9410 +descendants 9410 +despot 9410 +destroyer 9410 +detectably 9410 +dialysis 9410 +DiMaggio 9410 +dimensions 9410 +disable 9410 +discounts 9410 +disentangle 9410 +disobedience 9410 +dissociate 9410 +dogging 9410 +dopers 9410 +drains 9410 +dreaded 9410 +ducks 9410 +dusted 9410 +Dutchman 9410 +effortlessly 9410 +electroencephalography 9410 +elite 9410 +embassies 9410 +employing 9410 +encompass 9410 +encompasses 9410 +environing 9410 +epistle 9410 +equilibrium 9410 +erases 9410 +error 9410 +eschew 9410 +eternal 9410 +Eulerian 9410 +Evanston 9410 +evened 9410 +evenhandedly 9410 +eventful 9410 +Everhart 9410 +excises 9410 +exclamation 9410 +excrete 9410 +exhausts 9410 +expelled 9410 +extents 9410 +externally 9410 +extracted 9410 +faithful 9410 +fanatic 9410 +fated 9410 +featherweight 9410 +feed 9410 +feminine 9410 +Fenton 9410 +fetched 9410 +fetters 9410 +fiftieth 9410 +filial 9410 +fingerings 9410 +finishers 9410 +firearm 9410 +fitting 9410 +Fitzpatrick 9410 +fixedly 9410 +flanking 9410 +flint 9410 +flopping 9410 +flurried 9410 +foldout 9410 +foothill 9410 +forgivably 9410 +forthcoming 9410 +freakish 9410 +freest 9410 +freezes 9410 +funereal 9410 +furnishings 9410 +furthermore 9410 +gadfly 9410 +gainful 9410 +Galatean 9410 +galling 9410 +Gandhian 9410 +Ganymede 9410 +garage 9410 +gentleman 9410 +gifted 9410 +gleaning 9410 +glut 9410 +goblins 9410 +Goldstine 9410 +Gothicism 9410 +governing 9410 +gradually 9410 +Graves 9410 +grazing 9410 +Greenberg 9410 +gritty 9410 +groupings 9410 +guides 9410 +guitars 9410 +Gurkha 9410 +handgun 9410 +handy 9410 +Hawaii 9410 +Hegelian 9410 +heiress 9410 +hoarder 9410 +honoring 9410 +Hornblower 9410 +hostess 9410 +Huffman 9410 +humanness 9410 +humiliation 9410 +humility 9410 +Hunter 9410 +hushes 9410 +husky 9410 +hypothesizer 9410 +icon 9410 +ideas 9410 +impelling 9410 +impending 9410 +imperial 9410 +imperiously 9410 +imprint 9410 +impulsive 9410 +inaccuracy 9410 +inch 9410 +incidentals 9410 +incorrectly 9410 +incurring 9410 +index 9410 +indulge 9410 +indulgences 9410 +ineffective 9410 +infallibly 9410 +infest 9410 +inform 9410 +inmate 9410 +insolence 9410 +instruments 9410 +intelligibility 9410 +intentness 9410 +intercepted 9410 +interdependent 9410 +interrelationships 9410 +interrogate 9410 +investigations 9410 +irresponsibly 9410 +jarring 9410 +Joplin 9410 +journalizing 9410 +Judas 9410 +juveniles 9410 +Kane 9410 +kanji 9410 +Kantian 9410 +Kevin 9410 +kingdom 9410 +Kinsey 9410 +kiting 9410 +Kline 9410 +labeled 9410 +languages 9410 +Lars 9410 +laterally 9410 +Latinizes 9410 +lawgiver 9410 +leaflet 9410 +leavings 9410 +lectured 9410 +leftover 9410 +lewdly 9410 +lied 9410 +Lillian 9410 +linear 9410 +lists 9410 +lithograph 9410 +Lizzy 9410 +lore 9410 +luckily 9410 +Majorca 9410 +males 9410 +Manhattanize 9410 +marginal 9410 +mastering 9410 +mayoral 9410 +McGovern 9410 +meanwhile 9410 +measures 9410 +measures 9410 +mechanizing 9410 +medical 9410 +meditation 9410 +Melinda 9410 +Merritt 9410 +metaphysically 9410 +Micronesia 9410 +Miles 9410 +Miltonism 9410 +mineral 9410 +miniaturizes 9410 +minima 9410 +minion 9410 +minting 9410 +misted 9410 +misunderstander 9410 +mixture 9410 +motors 9410 +mournfulness 9410 +multilayer 9410 +mumbles 9410 +mushrooms 9410 +mystic 9410 +Nabisco 9410 +navies 9410 +navigate 9410 +Nazis 9410 +neat 9410 +neonatal 9410 +nested 9410 +Newtonian 9410 +noncritical 9410 +normalizes 9410 +Norwalk 9410 +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +Pandora 9410 +parametrized 9410 +parenthood 9410 +Parsifal 9410 +parters 9410 +participated 9410 +partridges 9410 +peacock 9410 +peeked 9410 +pellagra 9410 +percentage 9410 +percentage 9410 +persist 9410 +perturb 9410 +Peruvian 9410 +pessimist 9410 +pests 9410 +petted 9410 +pictures 9410 +pithed 9410 +pityingly 9410 +poison 9410 +posed 9410 +positioning 9410 +postulation 9410 +praised 9410 +precaution 9410 +precipitable 9410 +preclude 9410 +presentation 9410 +pressure 9410 +previewing 9410 +priceless 9410 +primary 9410 +psychic 9410 +publicly 9410 +puddings 9410 +Punjab 9410 +Pyle 9410 +quagmire 9410 +quitter 9410 +Quixotism 9410 +railway 9410 +raining 9410 +rains 9410 +ravines 9410 +readable 9410 +realized 9410 +realtor 9410 +reassigned 9410 +recruited 9410 +reduce 9410 +regimented 9410 +registration 9410 +relatively 9410 +relaxing 9410 +relishing 9410 +relives 9410 +renew 9410 +repelled 9410 +repetitions 9410 +reporters 9410 +reporters 9410 +repressions 9410 +resplendent 9410 +resumes 9410 +rifles 9410 +rightful 9410 +rightfully 9410 +rightfulness 9410 +ripeness 9410 +riser 9410 +Romano 9410 +Romans 9410 +roped 9410 +rudeness 9410 +rules 9410 +rural 9410 +rusting 9410 +Sabine 9410 +sadly 9410 +sags 9410 +sanding 9410 +saplings 9410 +sating 9410 +Sault 9410 +save 9410 +sawtooth 9410 +Saxony 9410 +scarf 9410 +scatterbrain 9410 +scheduling 9410 +schemer 9410 +scholastics 9410 +scornfully 9410 +secures 9410 +securing 9410 +Selfridge 9410 +seminaries 9410 +serializations 9410 +serpents 9410 +serving 9410 +severely 9410 +sews 9410 +Shanghais 9410 +shapelessly 9410 +shipyard 9410 +shooter 9410 +similarities 9410 +Simla 9410 +Simon 9410 +skulking 9410 +slaughter 9410 +sloping 9410 +smoothed 9410 +snatching 9410 +socializes 9410 +sophomore 9410 +sorters 9410 +spatial 9410 +specification 9410 +specifics 9410 +spongers 9410 +spools 9410 +sportswriting 9410 +sporty 9410 +squabbled 9410 +squeaking 9410 +squeezes 9410 +stabilizes 9410 +stairway 9410 +Stalin 9410 +standardizes 9410 +star 9410 +starlet 9410 +stated 9410 +Steinberg 9410 +stint 9410 +stodgy 9410 +store 9410 +straight 9410 +stranglings 9410 +subdirectory 9410 +subjective 9410 +subschema 9410 +succumbed 9410 +suites 9410 +sumac 9410 +sureties 9410 +swaying 9410 +sweetish 9410 +swelling 9410 +syndicate 9410 +Taoism 9410 +taxonomically 9410 +techniques 9410 +teem 9410 +teethe 9410 +tempering 9410 +Teresa 9410 +terminal 9410 +terminator 9410 +terminators 9410 +test 9410 +testicle 9410 +textures 9410 +theorizers 9410 +throttles 9410 +tidiness 9410 +timesharing 9410 +tinily 9410 +tinting 9410 +Tipperary 9410 +title 9410 +tragedies 9410 +traitor 9410 +trimmings 9410 +tropics 9410 +unaffected 9410 +uncovering 9410 +undoes 9410 +ungrateful 9410 +universals 9410 +unplug 9410 +unruly 9410 +untying 9410 +unwilling 9410 +vacuuming 9410 +validate 9410 +vanish 9410 +ventilate 9410 +veranda 9410 +vests 9410 +wallet 9410 +waltz 9410 +warm 9410 +warningly 9410 +watering 9410 +weasels 9410 +Weissmuller 9410 +western 9410 +whiteners 9410 +widens 9410 +Winsett 9410 +witchcraft 9410 +workers 9410 +Wotan 9410 +yelped 9410 +youthfulness 9410 +analyze table t2, t3; +Table Op Msg_type Msg_text +test.t2 analyze status OK +test.t3 analyze status OK +EXPLAIN select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 10.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL fld1 NULL NULL NULL 1199 10.00 Using where; Using temporary; Using filesort +2 SIMPLE t3 NULL eq_ref PRIMARY,period PRIMARY 4 test.t2.fld1 1 20.04 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`companynr` = 37) and (`test`.`t2`.`fld1` = `test`.`t3`.`t2nr`) and (`test`.`t3`.`period` >= 1001) and (`test`.`t3`.`period` <= 1002)) order by `test`.`t2`.`fld3`,`test`.`t3`.`period`,`test`.`t3`.`price` +select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +fld3 period price price2 +admonishing 1002 28357832 8723648 +analyzable 1002 28357832 8723648 +annihilates 1001 5987435 234724 +Antares 1002 28357832 8723648 +astound 1001 5987435 234724 +audiology 1001 5987435 234724 +Augustine 1002 28357832 8723648 +Baird 1002 28357832 8723648 +bewilderingly 1001 5987435 234724 +breaking 1001 5987435 234724 +Conley 1001 5987435 234724 +dentally 1002 28357832 8723648 +dissociate 1002 28357832 8723648 +elite 1001 5987435 234724 +eschew 1001 5987435 234724 +Eulerian 1001 5987435 234724 +flanking 1001 5987435 234724 +foldout 1002 28357832 8723648 +funereal 1002 28357832 8723648 +galling 1002 28357832 8723648 +Graves 1001 5987435 234724 +grazing 1001 5987435 234724 +groupings 1001 5987435 234724 +handgun 1001 5987435 234724 +humility 1002 28357832 8723648 +impulsive 1002 28357832 8723648 +inch 1001 5987435 234724 +intelligibility 1001 5987435 234724 +jarring 1001 5987435 234724 +lawgiver 1001 5987435 234724 +lectured 1002 28357832 8723648 +Merritt 1002 28357832 8723648 +neonatal 1001 5987435 234724 +offload 1002 28357832 8723648 +parters 1002 28357832 8723648 +pityingly 1002 28357832 8723648 +puddings 1002 28357832 8723648 +Punjab 1001 5987435 234724 +quitter 1002 28357832 8723648 +realtor 1001 5987435 234724 +relaxing 1001 5987435 234724 +repetitions 1001 5987435 234724 +resumes 1001 5987435 234724 +Romans 1002 28357832 8723648 +rusting 1001 5987435 234724 +scholastics 1001 5987435 234724 +skulking 1002 28357832 8723648 +stated 1002 28357832 8723648 +suites 1002 28357832 8723648 +sureties 1001 5987435 234724 +testicle 1002 28357832 8723648 +tinily 1002 28357832 8723648 +tragedies 1001 5987435 234724 +trimmings 1001 5987435 234724 +vacuuming 1001 5987435 234724 +ventilate 1001 5987435 234724 +wallet 1001 5987435 234724 +Weissmuller 1002 28357832 8723648 +Wotan 1002 28357832 8723648 +select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37; +fld1 fld3 period price price2 +018201 relaxing 1001 5987435 234724 +018601 vacuuming 1001 5987435 234724 +018801 inch 1001 5987435 234724 +018811 repetitions 1001 5987435 234724 +create table t4 ( +companynr tinyint(2) unsigned zerofill NOT NULL default '00', +companyname char(30) NOT NULL default '', +PRIMARY KEY (companynr), +UNIQUE KEY companyname(companyname) +) ENGINE=INNODB MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select * from t1,t1 t12; +Period Varor_period Period Varor_period +9410 9412 9410 9412 +select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505; +fld1 fld1 +250501 250501 +250501 250502 +250501 250503 +250501 250504 +250501 250505 +250502 250501 +250502 250502 +250502 250503 +250502 250504 +250502 250505 +250503 250501 +250503 250502 +250503 250503 +250503 250504 +250503 250505 +250504 250501 +250504 250502 +250504 250503 +250504 250504 +250504 250505 +250505 250501 +250505 250502 +250505 250503 +250505 250504 +250505 250505 +insert into t2 (fld1, companynr) values (999999,99); +ANALYZE TABLE t2, t4; +Table Op Msg_type Msg_text +test.t2 analyze status OK +test.t4 analyze status OK +select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +companynr companyname +99 NULL +select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null; +count(*) +1199 +explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1200 100.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1200 100.00 NULL +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 Using where; Not exists +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t2` left join `test`.`t4` on((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`)) where (`test`.`t4`.`companynr` is null) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1200 10.00 Using where; Not exists; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t2`.`companynr` is null) +select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +companynr companyname +select count(*) from t2 left join t4 using (companynr) where companynr is not null; +count(*) +1200 +explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t2` left join `test`.`t4` on(multiple equal(`test`.`t2`.`companynr`, `test`.`t4`.`companynr`)) where false +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on(multiple equal(`test`.`t4`.`companynr`, `test`.`t2`.`companynr`)) where false +delete from t2 where fld1=999999; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0) and (`test`.`t2`.`companynr` > 0)) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t4`.`companynr` > 0) and (`test`.`t4`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 40.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t2`.`companynr` > 0) or (`test`.`t2`.`companynr` is null)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index PRIMARY companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t2`.`companynr` > 0) or (`test`.`t4`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (ifnull(`test`.`t2`.`companynr`,1) > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t4`.`companynr` > 0) or (`test`.`t4`.`companynr` > 0)) +explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using where; Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (ifnull(`test`.`t4`.`companynr`,1) > 0) +select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +companynr companynr +37 36 +41 40 +explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index; Using temporary +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 10.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select distinct `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companynr` AS `companynr` from `test`.`t2` join `test`.`t4` where (`test`.`t2`.`companynr` = (`test`.`t4`.`companynr` + 1)) +select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909); +period +9410 +select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6))); +period +9410 +select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1; +fld1 +250501 +250502 +250503 +250505 +select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606); +fld1 +250502 +250503 +select fld1 from t2 where fld1 between 250502 and 250504; +fld1 +250502 +250503 +250504 +select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ; +fld3 +Lillian +label +labeled +labeled +landslide +laterally +leaflet +lewdly +luckily +select count(*) from t1; +count(*) +1 +select companynr,count(*),sum(fld1) from t2 group by companynr; +companynr count(*) sum(fld1) +00 82 10355753 +29 95 14473298 +34 70 17788966 +36 215 22786296 +37 588 83602098 +40 37 6618386 +41 52 12816335 +50 11 1595438 +53 4 793210 +58 23 2254293 +65 10 2284055 +68 12 3097288 +select companynr,count(*) from t2 group by companynr order by companynr desc limit 5; +companynr count(*) +68 12 +65 10 +58 23 +53 4 +50 11 +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +70 absentee vest 17788966 254128.0857 3272.5939722090234 10709871.306938833 +explain select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 9.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 order 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.97568479746 13352027981.708656 +29 95 abut wetness 14473298 152350.5053 8368.547956641249 70032594.90260443 +34 70 absentee vest 17788966 254128.0857 3272.5939722090234 10709871.306938833 +select +companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from +t3 where companynr = 37 group by companynr,t2nr order by companynr, t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select /*! SQL_SMALL_RESULT */ +companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from +t3 where companynr = 37 group by companynr,t2nr order by companynr, t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ; +companynr count(price) sum(price) min(price) max(price) avg(price) +101 4181 3489454238 834598 834598 834598.0000 +154 4181 4112197254950 983543950 983543950 983543950.0000 +311 4181 979599938 234298 234298 234298.0000 +37 12543 309394878010 5987435 39654943 24666736.6667 +447 4181 9929180954 2374834 2374834 2374834.0000 +512 4181 3288532102 786542 786542 786542.0000 +78 8362 414611089292 726498 98439034 49582766.0000 +select distinct mod(companynr,10) from t4 group by companynr; +mod(companynr,10) +0 +1 +3 +4 +5 +6 +7 +8 +9 +select distinct 1 from t4 group by companynr; +1 +1 +select count(distinct fld1) from t2; +count(distinct fld1) +1199 +select companynr,count(distinct fld1) from t2 group by companynr; +companynr count(distinct fld1) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(*) from t2 group by companynr; +companynr count(*) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,1000))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,200))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct floor(fld1/100)) from t2 group by companynr; +companynr count(distinct floor(fld1/100)) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr; +companynr count(distinct concat(repeat(65,1000),floor(fld1/100))) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10; +sum(fld1) fld3 +11402 Romans +select name,count(*) from t3 where name='cloakroom' group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name='cloakroom' and price>10 group by name; +name count(*) +cloakroom 4181 +select count(*) from t3 where name='cloakroom' and price2=823742; +count(*) +4181 +select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name; +name count(*) +extramarital 4181 +gazer 4181 +gems 4181 +Iranizes 4181 +spates 4181 +tucked 4181 +violinist 4181 +select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld3 count(*) +spates 4181 +select companynr|0,companyname from t4 group by 1; +companynr|0 companyname +0 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname; +companynr companyname count(*) +29 company 1 95 +68 company 10 12 +50 company 11 11 +34 company 2 70 +36 company 3 215 +37 company 4 588 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +00 Unknown 82 +select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld1 count(*) +158402 4181 +select sum(Period)/count(*) from t1; +sum(Period)/count(*) +9410.0000 +select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; +companynr count sum diff func +101 4181 3489454238 0.0000 422281 +154 4181 4112197254950 0.0000 643874 +311 4181 979599938 0.0000 1300291 +37 12543 309394878010 0.0000 464091 +447 4181 9929180954 0.0000 1868907 +512 4181 3288532102 0.0000 2140672 +78 8362 414611089292 0.0000 652236 +select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; +companynr avg +154 983543950.0000 +select companynr,count(*) from t2 group by companynr order by 2 desc; +companynr count(*) +37 588 +36 215 +29 95 +00 82 +34 70 +41 52 +40 37 +58 23 +68 12 +50 11 +65 10 +53 4 +select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc; +companynr count(*) +41 52 +58 23 +68 12 +50 11 +65 10 +53 4 +select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4; +fld4 fld1 count(price) sum(price) min(price) max(price) avg(price) +Abraham 018103 1 39654943 39654943 39654943 39654943.0000 +Anatole 038102 1 28357832 28357832 28357832 28357832.0000 +Beebe 018602 1 28357832 28357832 28357832 28357832.0000 +Chicana 038203 1 39654943 39654943 39654943 39654943.0000 +Conley 018101 1 5987435 5987435 5987435 5987435.0000 +Connally 018801 1 5987435 5987435 5987435 5987435.0000 +Graves 018052 1 28357832 28357832 28357832 28357832.0000 +Judas 018032 1 28357832 28357832 28357832 28357832.0000 +Kline 038101 1 5987435 5987435 5987435 5987435.0000 +Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000 +Merritt 016303 1 39654943 39654943 39654943 39654943.0000 +Parsifal 013802 1 28357832 28357832 28357832 28357832.0000 +Punjab 016302 1 28357832 28357832 28357832 28357832.0000 +Selfridge 019102 1 28357832 28357832 28357832 28357832.0000 +Simla 018402 1 28357832 28357832 28357832 28357832.0000 +Steinberg 012003 1 39654943 39654943 39654943 39654943.0000 +Taoism 018603 1 39654943 39654943 39654943 39654943.0000 +attainments 012303 1 39654943 39654943 39654943 39654943.0000 +audiology 011403 1 39654943 39654943 39654943 39654943.0000 +balled 012301 1 5987435 5987435 5987435 5987435.0000 +bee 038001 1 5987435 5987435 5987435 5987435.0000 +betroth 030501 1 5987435 5987435 5987435 5987435.0000 +bivalves 018013 1 39654943 39654943 39654943 39654943.0000 +bloodbath 018042 1 28357832 28357832 28357832 28357832.0000 +cage 018201 1 5987435 5987435 5987435 5987435.0000 +capably 012501 1 5987435 5987435 5987435 5987435.0000 +checkpoints 018803 1 39654943 39654943 39654943 39654943.0000 +coexist 018601 1 5987435 5987435 5987435 5987435.0000 +contrasted 016001 1 5987435 5987435 5987435 5987435.0000 +daughter 012703 1 39654943 39654943 39654943 39654943.0000 +dental 038003 1 39654943 39654943 39654943 39654943.0000 +dimensions 038202 1 28357832 28357832 28357832 28357832.0000 +disable 019103 1 39654943 39654943 39654943 39654943.0000 +dogging 018002 1 28357832 28357832 28357832 28357832.0000 +dreaded 011401 1 5987435 5987435 5987435 5987435.0000 +epistle 018062 1 28357832 28357832 28357832 28357832.0000 +erases 016301 1 5987435 5987435 5987435 5987435.0000 +eschew 011702 1 28357832 28357832 28357832 28357832.0000 +featherweight 012701 1 5987435 5987435 5987435 5987435.0000 +fetched 018802 1 28357832 28357832 28357832 28357832.0000 +fetters 018012 1 28357832 28357832 28357832 28357832.0000 +firearm 018812 1 28357832 28357832 28357832 28357832.0000 +flint 018022 1 28357832 28357832 28357832 28357832.0000 +flopping 018023 1 39654943 39654943 39654943 39654943.0000 +gritty 018811 1 5987435 5987435 5987435 5987435.0000 +hushes 018202 1 28357832 28357832 28357832 28357832.0000 +imprint 030503 1 39654943 39654943 39654943 39654943.0000 +impulsive 012602 1 28357832 28357832 28357832 28357832.0000 +interdependent 018051 1 5987435 5987435 5987435 5987435.0000 +interrelationships 036001 1 5987435 5987435 5987435 5987435.0000 +kanji 038002 1 28357832 28357832 28357832 28357832.0000 +lawgiver 013601 1 5987435 5987435 5987435 5987435.0000 +leavings 013803 1 39654943 39654943 39654943 39654943.0000 +lectured 018102 1 28357832 28357832 28357832 28357832.0000 +leftover 016201 1 5987435 5987435 5987435 5987435.0000 +medical 018041 1 5987435 5987435 5987435 5987435.0000 +minima 019101 1 5987435 5987435 5987435 5987435.0000 +neat 012001 1 5987435 5987435 5987435 5987435.0000 +neonatal 018053 1 39654943 39654943 39654943 39654943.0000 +normalizes 038013 1 39654943 39654943 39654943 39654943.0000 +parters 011701 1 5987435 5987435 5987435 5987435.0000 +partridges 038103 1 39654943 39654943 39654943 39654943.0000 +persist 012302 1 28357832 28357832 28357832 28357832.0000 +pessimist 012702 1 28357832 28357832 28357832 28357832.0000 +quitter 011703 1 39654943 39654943 39654943 39654943.0000 +railway 038011 1 5987435 5987435 5987435 5987435.0000 +readable 013603 1 39654943 39654943 39654943 39654943.0000 +recruited 038201 1 5987435 5987435 5987435 5987435.0000 +reporters 018403 1 39654943 39654943 39654943 39654943.0000 +riser 036002 1 28357832 28357832 28357832 28357832.0000 +scholastics 011402 1 28357832 28357832 28357832 28357832.0000 +scornfully 018003 1 39654943 39654943 39654943 39654943.0000 +skulking 018021 1 5987435 5987435 5987435 5987435.0000 +sorters 018061 1 5987435 5987435 5987435 5987435.0000 +squeaking 013901 1 5987435 5987435 5987435 5987435.0000 +starlet 012603 1 39654943 39654943 39654943 39654943.0000 +stated 013602 1 28357832 28357832 28357832 28357832.0000 +subschema 018043 1 39654943 39654943 39654943 39654943.0000 +sweetish 018001 1 5987435 5987435 5987435 5987435.0000 +swelling 031901 1 5987435 5987435 5987435 5987435.0000 +teethe 000001 1 5987435 5987435 5987435 5987435.0000 +testicle 013801 1 5987435 5987435 5987435 5987435.0000 +vacuuming 018033 1 39654943 39654943 39654943 39654943.0000 +validate 038012 1 28357832 28357832 28357832 28357832.0000 +wallet 011501 1 5987435 5987435 5987435 5987435.0000 +whiteners 016202 1 28357832 28357832 28357832 28357832.0000 +witchcraft 019201 1 5987435 5987435 5987435 5987435.0000 +select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3; +companynr fld3 sum(price) +512 Micronesia 786542 +512 Miles 786542 +512 boat 786542 +512 capably 786542 +512 cupboard 786542 +512 decliner 786542 +512 descendants 786542 +512 dopers 786542 +512 erases 786542 +512 skies 786542 +select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr; +companynr count(*) min(fld3) max(fld3) sum(price) avg(price) +00 1 Omaha Omaha 5987435 5987435.0000 +36 1 dubbed dubbed 28357832 28357832.0000 +37 83 Abraham Wotan 1908978016 22999735.1325 +50 2 scribbled tapestry 68012775 34006387.5000 +select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1; +t3.companynr+0 t2nr fld3 sum(price) +37 1 Omaha 5987435 +37 11401 breaking 5987435 +37 11402 Romans 28357832 +37 11403 intercepted 39654943 +37 11501 bewilderingly 5987435 +37 11701 astound 5987435 +37 11702 admonishing 28357832 +37 11703 sumac 39654943 +37 12001 flanking 5987435 +37 12003 combed 39654943 +37 12301 Eulerian 5987435 +37 12302 dubbed 28357832 +37 12303 Kane 39654943 +37 12501 annihilates 5987435 +37 12602 Wotan 28357832 +37 12603 snatching 39654943 +37 12701 grazing 5987435 +37 12702 Baird 28357832 +37 12703 celery 39654943 +37 13601 handgun 5987435 +37 13602 foldout 28357832 +37 13603 mystic 39654943 +37 13801 intelligibility 5987435 +37 13802 Augustine 28357832 +37 13803 teethe 39654943 +37 13901 scholastics 5987435 +37 16001 audiology 5987435 +37 16201 wallet 5987435 +37 16202 parters 28357832 +37 16301 eschew 5987435 +37 16302 quitter 28357832 +37 16303 neat 39654943 +37 18001 jarring 5987435 +37 18002 tinily 28357832 +37 18003 balled 39654943 +37 18012 impulsive 28357832 +37 18013 starlet 39654943 +37 18021 lawgiver 5987435 +37 18022 stated 28357832 +37 18023 readable 39654943 +37 18032 testicle 28357832 +37 18033 Parsifal 39654943 +37 18041 Punjab 5987435 +37 18042 Merritt 28357832 +37 18043 Quixotism 39654943 +37 18051 sureties 5987435 +37 18052 puddings 28357832 +37 18053 tapestry 39654943 +37 18061 trimmings 5987435 +37 18062 humility 28357832 +37 18101 tragedies 5987435 +37 18102 skulking 28357832 +37 18103 flint 39654943 +37 18201 relaxing 5987435 +37 18202 offload 28357832 +37 18402 suites 28357832 +37 18403 lists 39654943 +37 18601 vacuuming 5987435 +37 18602 dentally 28357832 +37 18603 humanness 39654943 +37 18801 inch 5987435 +37 18802 Weissmuller 28357832 +37 18803 irresponsibly 39654943 +37 18811 repetitions 5987435 +37 18812 Antares 28357832 +37 19101 ventilate 5987435 +37 19102 pityingly 28357832 +37 19103 interdependent 39654943 +37 19201 Graves 5987435 +37 30501 neonatal 5987435 +37 30502 scribbled 28357832 +37 30503 chafe 39654943 +37 31901 realtor 5987435 +37 36001 elite 5987435 +37 36002 funereal 28357832 +37 38001 Conley 5987435 +37 38002 lectured 28357832 +37 38003 Abraham 39654943 +37 38011 groupings 5987435 +37 38012 dissociate 28357832 +37 38013 coexist 39654943 +37 38101 rusting 5987435 +37 38102 galling 28357832 +37 38103 obliterates 39654943 +37 38201 resumes 5987435 +37 38202 analyzable 28357832 +37 38203 terminator 39654943 +select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008; +sum(price) +234298 +select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1; +fld1 sum(price) +038008 234298 +explain select fld3 from t2 where 1>2 or 2>3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where false +explain select fld3 from t2 where fld1=fld1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 100.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where true +select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000; +companynr count sum +00 82 10355753 +29 95 14473298 +34 70 17788966 +37 588 83602098 +41 52 12816335 +select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ; +companynr +00 +29 +34 +37 +41 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40; +companynr companyname count(*) +40 company 5 37 +41 company 6 52 +50 company 11 11 +53 company 7 4 +58 company 8 23 +65 company 9 10 +68 company 10 12 +select count(*) from t2; +count(*) +1199 +select count(*) from t2 where fld1 < 098024; +count(*) +387 +select min(fld1) from t2 where fld1>= 098024; +min(fld1) +98024 +select max(fld1) from t2 where fld1>= 098024; +max(fld1) +1232609 +select count(*) from t3 where price2=76234234; +count(*) +4181 +select count(*) from t3 where companynr=512 and price2=76234234; +count(*) +4181 +explain select min(fld1),max(fld1),count(*) from t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL index NULL fld1 4 NULL 1199 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t2`.`fld1`) AS `min(fld1)`,max(`test`.`t2`.`fld1`) AS `max(fld1)`,count(0) AS `count(*)` from `test`.`t2` +explain format=tree select min(fld1),max(fld1),count(*) from t2; +EXPLAIN +-> Count rows in t2 + +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +explain format=tree select min(fld1),max(fld1),count(*) from t2 where rand() > 0.5; +EXPLAIN +-> Aggregate: min(`min(fld1)`), max(`max(fld1)`), count(`count(*)`) + -> Parallel scan on + -> Aggregate: + -> Filter: (rand() > 0.5) (cost=123.65 rows=1199) + -> PQblock scan on t2 using fld1 (cost=123.65 rows=1199) + +select min(fld1),max(fld1),count(*) from t2; +min(fld1) max(fld1) count(*) +0 1232609 1199 +select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; +min(t2nr) max(t2nr) +2115 2115 +select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; +count(*) min(t2nr) max(t2nr) +4181 4 41804 +select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; +t2nr count(*) +9 1 +19 1 +29 1 +39 1 +49 1 +59 1 +69 1 +79 1 +89 1 +99 1 +109 1 +119 1 +129 1 +139 1 +149 1 +159 1 +169 1 +179 1 +189 1 +199 1 +select max(t2nr) from t3 where price=983543950; +max(t2nr) +41807 +select t1.period from t3 t1 limit 1; +period +1001 +select t1.period from t1 as t1 limit 1; +period +9410 +select t1.period as "Nuvarande period" from t1 as t1 limit 1; +Nuvarande period +9410 +select period as ok_period from t1 limit 1; +ok_period +9410 +select period as ok_period from t1 group by ok_period limit 1; +ok_period +9410 +select 1+1 as summa from t1 group by summa limit 1; +summa +2 +select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1; +Nuvarande period +9410 +show tables; +Tables_in_test +t1 +t2 +t3 +t4 +show tables from test like "s%"; +Tables_in_test (s%) +show tables from test like "t?"; +Tables_in_test (t?) +show full columns from t2; +Field Type Collation Null Key Default Extra Privileges Comment +auto int NULL NO PRI NULL auto_increment select,insert,update,references +fld1 int(6) unsigned zerofill NULL NO UNI 000000 select,insert,update,references +companynr tinyint(2) unsigned zerofill NULL NO 00 select,insert,update,references +fld3 char(30) utf8mb4_0900_ai_ci NO MUL select,insert,update,references +fld4 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld5 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld6 char(4) utf8mb4_0900_ai_ci NO select,insert,update,references +show full columns from t2 from test like 'f%'; +Field Type Collation Null Key Default Extra Privileges Comment +fld1 int(6) unsigned zerofill NULL NO UNI 000000 select,insert,update,references +fld3 char(30) utf8mb4_0900_ai_ci NO MUL select,insert,update,references +fld4 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld5 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld6 char(4) utf8mb4_0900_ai_ci NO select,insert,update,references +show full columns from t2 from test like 's%'; +Field Type Collation Null Key Default Extra Privileges Comment +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +show keys from t2; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Visible Expression +t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE YES NULL +t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE YES NULL +t2 1 fld3 1 fld3 A 1171 NULL NULL BTREE YES NULL +drop table t4, t3, t2, t1; +DO 1; +DO benchmark(100,1+1),1,1; +do default; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +do foobar; +ERROR 42S22: Unknown column 'foobar' in 'field list' +CREATE TABLE t1 ( +id mediumint(8) unsigned NOT NULL auto_increment, +pseudo varchar(35) NOT NULL default '', +PRIMARY KEY (id), +UNIQUE KEY pseudo (pseudo) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 (pseudo) VALUES ('test'); +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 1 as rnd1 from t1 where rand() > 2; +rnd1 +DROP TABLE t1; +CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1287 'BINARY as attribute of a type' is deprecated and will be removed in a future release. Please use a CHARACTER SET clause with _bin collation instead +INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); +CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +ERROR HY000: Incorrect DATETIME value: 'wrong-date-value' +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +DROP TABLE t1,t2; +create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); +select wss_type from t1 where wss_type ='102935229216544106'; +wss_type +select wss_type from t1 where wss_type ='102935229216544105'; +wss_type +select wss_type from t1 where wss_type ='102935229216544104'; +wss_type +select wss_type from t1 where wss_type ='102935229216544093'; +wss_type +102935229216544093 +select wss_type from t1 where wss_type =102935229216544093; +wss_type +102935229216544093 +drop table t1; +select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; +select @a; +@a +3 +select @b; +@b +aaaa +select @c; +@c +6.260 +create table t1 (a int not null auto_increment primary key); +insert into t1 values (); +insert into t1 values (); +insert into t1 values (); +select * from (t1 as t2 left join t1 as t3 using (a)), t1; +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from t1, (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); +a +1 +2 +3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +1 NULL +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); +a +1 +2 +3 +select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; +a +1 +2 +3 +select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +NULL 1 +select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); +a +1 +2 +3 +select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; +a +1 +2 +3 +select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; +a +1 +2 +3 +drop table t1; +CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); +CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); +select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; +aa id t2_id id +2 8299 2517 2517 +3 8301 2518 2518 +4 8302 2519 2519 +5 8303 2520 2520 +6 8304 2521 2521 +drop table t1,t2; +create table t1 (id1 int NOT NULL); +create table t2 (id2 int NOT NULL); +create table t3 (id3 int NOT NULL); +create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); +insert into t1 values (1); +insert into t1 values (2); +insert into t2 values (1); +insert into t4 values (1,1); +explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t4 NULL ALL id4 NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`id1` AS `id1`,`test`.`t2`.`id2` AS `id2`,`test`.`t3`.`id3` AS `id3`,`test`.`t4`.`id4` AS `id4`,`test`.`t4`.`id44` AS `id44` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`id2` = `test`.`t1`.`id1`)) left join `test`.`t3` on((`test`.`t3`.`id3` = `test`.`t1`.`id1`)) left join `test`.`t4` on((`test`.`t4`.`id4` = `test`.`t3`.`id3`)) where ((`test`.`t2`.`id2` = 1) or (`test`.`t4`.`id4` = 1)) +select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id1 id2 id3 id4 id44 +1 1 NULL NULL NULL +drop table t1,t2,t3,t4; +create table t1(s varchar(10) not null); +create table t2(s varchar(10) not null primary key); +create table t3(s varchar(10) not null primary key); +insert into t1 values ('one\t'), ('two\t'); +insert into t2 values ('one\r'), ('two\t'); +insert into t3 values ('one\b'), ('two\t'); +select * from t1 where s = 'one'; +s +select * from t2 where s = 'one'; +s +select * from t3 where s = 'one'; +s +one +select * from t1,t2 where t1.s = t2.s; +s s +two two +select * from t2,t3 where t2.s = t3.s; +s s +two two +drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +explain select * from t1 left join t2 on a=c where d in (4); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref c,d d 5 const 2 100.00 Using where +2 SIMPLE t1 NULL ref a a 5 test.t2.c 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ 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`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = 4)) +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref c,d d 5 const 2 100.00 Using where +2 SIMPLE t1 NULL ref a a 5 test.t2.c 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ 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`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = 4)) +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; +CREATE TABLE t1 ( +i int(11) NOT NULL default '0', +c char(10) NOT NULL default '', +PRIMARY KEY (i), +UNIQUE KEY c (c) +) ; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (1,'a'); +INSERT INTO t1 VALUES (2,'b'); +INSERT INTO t1 VALUES (3,'c'); +EXPLAIN SELECT i FROM t1 WHERE i=1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '1' AS `i` from `test`.`t1` where true +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref a a 23 test.t1.a 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` USE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref a a 23 test.t1.a 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` FORCE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +DROP TABLE t1, t2; +CREATE TABLE t1 ( city char(30) ) charset utf8mb4; +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`city` AS `city` from `test`.`t1` where (`test`.`t1`.`city` = 'London') +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`city` AS `city` from `test`.`t1` where ((`test`.`t1`.`city` = 'London') and (`test`.`t1`.`city` like '%london%')) +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,0), (1,1), (4294967295,1); +select a-b from t1 order by 1; +a-b +0 +1 +4294967294 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +4294967294 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +4294967294 +drop table t1; +create table t1 (a int(11)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +kunde_intern_id int(10) unsigned NOT NULL default '0', +kunde_id int(10) unsigned NOT NULL default '0', +FK_firma_id int(10) unsigned NOT NULL default '0', +aktuell enum('Ja','Nein') NOT NULL default 'Ja', +vorname varchar(128) NOT NULL default '', +nachname varchar(128) NOT NULL default '', +geloescht enum('Ja','Nein') NOT NULL default 'Nein', +firma varchar(128) NOT NULL default '' +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), +(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 +WHERE +( +( +( '' != '' AND firma LIKE CONCAT('%', '', '%')) +OR +(vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND +'Vorname1' != '' AND 'xxxx' != '') +) +AND +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, +geloescht FROM t1 +WHERE +( +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +AND +( +( '' != '' AND firma LIKE CONCAT('%', '', '%') ) +OR +( vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND +'xxxx' != '') +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT COUNT(*) FROM t1 WHERE +( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) +AND FK_firma_id = 2; +COUNT(*) +0 +drop table t1; +CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (0x8000000000000000); +SELECT b FROM t1 WHERE b=0x8000000000000000; +b +9223372036854775808 +DROP TABLE t1; +CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `t2` VALUES (0,'READ'); +CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `t3` VALUES (1,'fs'); +select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); +id name gid uid ident level +1 fs NULL NULL 0 READ +drop table t1,t2,t3; +CREATE TABLE t1 ( +acct_id int(11) NOT NULL default '0', +profile_id smallint(6) default NULL, +UNIQUE KEY t1$acct_id (acct_id), +KEY t1$profile_id (profile_id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (132,17),(133,18); +CREATE TABLE t2 ( +profile_id smallint(6) default NULL, +queue_id int(11) default NULL, +seq int(11) default NULL, +KEY t2$queue_id (queue_id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); +CREATE TABLE t3 ( +id int(11) NOT NULL default '0', +qtype int(11) default NULL, +seq int(11) default NULL, +warn_lvl int(11) default NULL, +crit_lvl int(11) default NULL, +rr1 tinyint(4) NOT NULL default '0', +rr2 int(11) default NULL, +default_queue tinyint(4) NOT NULL default '0', +KEY t3$qtype (qtype), +KEY t3$id (id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), +(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); +SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q +WHERE +(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND +(pq.queue_id = q.id) AND (q.rr1 <> 1); +COUNT(*) +4 +drop table t1,t2,t3; +create table t1 (f1 int); +insert into t1 values (1),(NULL); +create table t2 (f2 int, f3 int, f4 int); +create index idx1 on t2 (f4); +insert into t2 values (1,2,3),(2,4,6); +select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) +from t2 C where A.f4 = C.f4) or A.f3 IS NULL; +f2 +1 +NULL +drop table t1,t2; +create table t2 (a tinyint unsigned); +create index t2i on t2(a); +insert into t2 values (0), (254), (255); +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +explain select * from t2 where a > -1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index t2i t2i 2 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a` is not null) +select * from t2 where a > -1; +a +0 +254 +255 +drop table t2; +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +SELECT * FROM t1; +a b c +50 3 3 +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +select found_rows(); +found_rows() +0 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +SELECT * FROM t1; +a b c +50 3 3 +select count(*) from t1; +count(*) +1 +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +select count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; +count(*) +Warnings: +Warning 1287 SQL_CALC_FOUND_ROWS is deprecated and will be removed in a future release. Consider using two separate queries instead. +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +(SELECT a, b AS c FROM t1) ORDER BY c+1; +a c +(SELECT a, b AS c FROM t1) ORDER BY b+1; +a c +SELECT a, b AS c FROM t1 ORDER BY c+1; +a c +SELECT a, b AS c FROM t1 ORDER BY b+1; +a c +drop table t1; +create table t1(f1 int, f2 int); +create table t2(f3 int); +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); +f1 +insert into t1 values(1,1),(2,null); +insert into t2 values(2); +select * from t1,t2 where f1=f3 and (f1,f2) = (2,null); +f1 f2 f3 +select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null); +f1 f2 f3 +2 NULL 2 +drop table t1,t2; +create table t1 (f1 int not null auto_increment primary key, f2 varchar(10)); +create table t11 like t1; +insert into t1 values(1,""),(2,""); +analyze table t1, t11; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t11 analyze status OK +show table status like 't1%'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 InnoDB 10 Dynamic 2 8192 X X X X X X X X X NULL +t11 InnoDB 10 Dynamic 0 0 X X X X X X X X X NULL +select 123 as a from t1 where f1 is null; +a +drop table t1,t11; +CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); +INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); +CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, e INT ); +INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2),(1,2,3); +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 10 2 +1 11 2 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c; +a b c d +1 10 4 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c; +a b c d +1 10 2 +1 11 2 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2,t1 +WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 2 1 1 +1 2 2 1 +1 2 3 1 +DROP TABLE IF EXISTS t1, t2; +create table t1 (f1 int primary key, f2 int); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t1 values (1,1); +insert into t2 values (1,1),(1,2); +select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1; +count(f2) >0 +1 +drop table t1,t2; +create table t1 (f1 int,f2 int); +insert into t1 values(1,1); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t2 values(1,1); +select * from t1 where f1 in (select f3 from t2 where (f3,f4)= (select f3,f4 from t2)); +f1 f2 +1 1 +drop table t1,t2; +CREATE TABLE t1(a int, b int, c int, KEY b(b), KEY c(c)); +insert into t1 values (1,0,0),(2,0,0); +CREATE TABLE t2 (a int, b varchar(2), c varchar(2), PRIMARY KEY(a)); +insert into t2 values (1,'',''), (2,'',''); +CREATE TABLE t3 (a int, b int, PRIMARY KEY (a,b), KEY a (a), KEY b (b)); +insert into t3 values (1,1),(1,2); +explain select straight_join DISTINCT t2.a,t2.b, t1.c from t1, t3, t2 +where (t1.c=t2.a or (t1.c=t3.a and t2.a=t3.b)) and t1.b=556476786 and +t2.b like '%%' order by t2.b limit 0,1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ref b,c b 5 const 1 100.00 Using temporary; Using filesort +1 SIMPLE t3 NULL index PRIMARY,a,b a 4 NULL 2 100.00 Using index; Using join buffer (hash join) +1 SIMPLE t2 NULL ALL PRIMARY NULL NULL NULL 2 50.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select straight_join distinct `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t1`.`b` = 556476786) and ((`test`.`t2`.`a` = `test`.`t1`.`c`) or ((`test`.`t2`.`a` = `test`.`t3`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`c`))) and (`test`.`t2`.`b` like '%%')) order by `test`.`t2`.`b` limit 0,1 +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (a int, INDEX idx(a)); +INSERT INTO t1 VALUES (2), (3), (1); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 IGNORE INDEX (idx); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` IGNORE INDEX (`idx`) +EXPLAIN SELECT * FROM t1 IGNORE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +EXPLAIN SELECT * FROM t1 FORCE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +DROP TABLE t1; +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 VALUES (1,1), (2,1), (4,10); +CREATE TABLE t2 (a int PRIMARY KEY, b int, KEY b (b)); +INSERT INTO t2 VALUES (1,NULL), (2,10); +ALTER TABLE t1 ENABLE KEYS; +Warnings: +Note 1031 Table storage engine for 't1' doesn't have this option +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index b b 5 NULL 2 100.00 Using index +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select straight_join count(0) AS `COUNT(*)` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) or (`test`.`t2`.`b` is null)) +SELECT STRAIGHT_JOIN * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +a b a b +1 NULL 1 1 +1 NULL 2 1 +1 NULL 4 10 +2 10 4 10 +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index b b 5 NULL 2 100.00 Using index +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select straight_join count(0) AS `COUNT(*)` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) or (`test`.`t2`.`b` is null)) +SELECT STRAIGHT_JOIN * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +a b a b +1 NULL 1 1 +1 NULL 2 1 +1 NULL 4 10 +2 10 4 10 +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (key1 double default NULL, UNIQUE KEY key1 (key1)); +CREATE TABLE t2 (key2 double default NULL, UNIQUE KEY key2 (key2)); +INSERT INTO t1 VALUES (0.3762),(0.3845),(0.6158),(0.7941); +INSERT INTO t2 VALUES (1.3762),(1.3845),(1.6158),(1.7941); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +explain select max(key1) from t1 where key1 <= 0.6158; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)` from `test`.`t1` where (`test`.`t1`.`key1` <= 0.6158) +explain select max(key2) from t2 where key2 <= 1.6158; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t2`.`key2`) AS `max(key2)` from `test`.`t2` where (`test`.`t2`.`key2` <= 1.6158) +explain select min(key1) from t1 where key1 >= 0.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where (`test`.`t1`.`key1` >= 0.3762) +explain select min(key2) from t2 where key2 >= 1.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t2`.`key2`) AS `min(key2)` from `test`.`t2` where (`test`.`t2`.`key2` >= 1.3762) +explain select max(key1), min(key2) from t1, t2 +where key1 <= 0.6158 and key2 >= 1.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)`,min(`test`.`t2`.`key2`) AS `min(key2)` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`key1` <= 0.6158) and (`test`.`t2`.`key2` >= 1.3762)) +explain select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range key1 key1 9 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` <= 0.6158) and ((rand() + 0.5) >= 0.5)) +explain select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index key1 key1 9 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` >= 0.3762) and ((rand() + 0.5) >= 0.5)) +select max(key1) from t1 where key1 <= 0.6158; +max(key1) +0.6158 +select max(key2) from t2 where key2 <= 1.6158; +max(key2) +1.6158 +select min(key1) from t1 where key1 >= 0.3762; +min(key1) +0.3762 +select min(key2) from t2 where key2 >= 1.3762; +min(key2) +1.3762 +select max(key1), min(key2) from t1, t2 +where key1 <= 0.6158 and key2 >= 1.3762; +max(key1) min(key2) +0.6158 1.3762 +select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; +max(key1) +0.6158 +select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; +min(key1) +0.3762 +DROP TABLE t1,t2; +CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL); +INSERT INTO t1 VALUES (10); +SELECT i='1e+01',i=1e+01, i in (1e+01,1e+01), i in ('1e+01','1e+01') FROM t1; +i='1e+01' i=1e+01 i in (1e+01,1e+01) i in ('1e+01','1e+01') +1 1 1 1 +DROP TABLE t1; +create table t1(a bigint unsigned, b bigint); +insert ignore into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff), +(0x10000000000000000, 0x10000000000000000), +(0x8fffffffffffffff, 0x8fffffffffffffff); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'a' at row 2 +Warning 1264 Out of range value for column 'b' at row 2 +Warning 1264 Out of range value for column 'b' at row 3 +select hex(a), hex(b) from t1; +hex(a) hex(b) +FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +8FFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +drop table t1; +CREATE TABLE t1 (c0 int); +CREATE TABLE t2 (c0 int); +INSERT INTO t1 VALUES(@@connect_timeout); +INSERT INTO t2 VALUES(@@connect_timeout); +SELECT * FROM t1 JOIN t2 ON t1.c0 = t2.c0 WHERE (t1.c0 <=> @@connect_timeout); +c0 c0 +X X +DROP TABLE t1, t2; +End of 4.1 tests +CREATE TABLE t1 ( +K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', +K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', +F2I4 int(11) NOT NULL default '0' +) DEFAULT CHARSET=latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +('W%RT', '0100', 1), +('W-RT', '0100', 1), +('WART', '0100', 1), +('WART', '0200', 1), +('WERT', '0100', 2), +('WORT','0200', 2), +('WT', '0100', 2), +('W_RT', '0100', 2), +('WaRT', '0100', 3), +('WART', '0300', 3), +('WRT' , '0400', 3), +('WURM', '0500', 3), +('W%T', '0600', 4), +('WA%T', '0700', 4), +('WA_T', '0800', 4); +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND +(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); +K2C4 K4N4 F2I4 +WART 0200 1 +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); +K2C4 K4N4 F2I4 +WART 0100 1 +WART 0200 1 +WART 0300 3 +DROP TABLE t1; +create table t1 (a int, b int); +create table t2 like t1; +select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; +a +select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; +a +select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; +a a a +drop table t1,t2; +create table t1 (s1 varchar(5)); +insert into t1 values ('Wall'); +select min(s1) from t1 group by s1 with rollup; +min(s1) +Wall +Wall +drop table t1; +create table t1 (s1 int); +insert into t1 values (0); +select avg(distinct s1) from t1 group by s1 with rollup; +avg(distinct s1) +0.0000 +0.0000 +drop table t1; +create table t1 (s1 int); +insert into t1 values (null),(1); +select avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +1.0000 +select distinct avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +drop table t1; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +INSERT INTO t2 VALUES (2), (4), (6); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +a +2 +4 +EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 3 33.33 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` straight_join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`a`) +EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 20.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`) +DROP TABLE t1,t2; +select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; +x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 +16 16 2 2 +create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); +insert into t1 values (" 2", 2); +insert into t2 values (" 2", " one "),(" 2", " two "); +select * from t1 left join t2 on f1 = f3; +f1 f2 f3 f4 + 2 2 2 one + 2 2 2 two +drop table t1,t2; +create table t1 (empnum smallint, grp int); +create table t2 (empnum int, name char(5)); +insert into t1 values(1,1); +insert into t2 values(1,'bob'); +create view v1 as select * from t2 inner join t1 using (empnum); +select * from v1; +empnum name grp +1 bob 1 +drop table t1,t2; +drop view v1; +create table t1 (pk int primary key, b int); +create table t2 (pk int primary key, c int); +select pk from t1 inner join t2 using (pk); +pk +drop table t1,t2; +create table t1 (s1 int, s2 char(5), s3 decimal(10)); +create view v1 as select s1, s2, 'x' as s3 from t1; +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'x' +insert into t1 values (1,'x',5); +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'x' +drop table t1; +drop view v1; +create table t1(a1 int); +create table t2(a2 int); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +create view v2 (c) as select a1 from t1; +select * from t1 natural left join t2; +a1 a2 +1 1 +1 2 +2 1 +2 2 +select * from t1 natural right join t2; +a2 a1 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural left join t2; +c a2 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural right join t2; +a2 c +1 1 +1 2 +2 1 +2 2 +drop table t1, t2; +drop view v2; +create table t1 (a int(10), t1_val int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (b int(10), t2_val int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t3 (a int(10), b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,1),(2,2); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(2,1),(3,1),(4,1); +select * from t1 natural join t2 natural join t3; +a b t1_val t2_val +1 1 1 1 +2 1 2 1 +select * from t1 natural join t3 natural join t2; +b a t1_val t2_val +1 1 1 1 +1 2 2 1 +drop table t1, t2, t3; +DO IFNULL(NULL, NULL); +SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); +CAST(IFNULL(NULL, NULL) AS DECIMAL) +NULL +SELECT ABS(IFNULL(NULL, NULL)); +ABS(IFNULL(NULL, NULL)) +NULL +SELECT IFNULL(NULL, NULL); +IFNULL(NULL, NULL) +NULL +SET @OLD_SQL_MODE12595=@@SQL_MODE, @@SQL_MODE=''; +SHOW LOCAL VARIABLES LIKE 'SQL_MODE'; +Variable_name Value +sql_mode +CREATE TABLE BUG_12595(a varchar(100)) charset latin1; +INSERT INTO BUG_12595 VALUES ('hakan%'), ('hakank'), ("ha%an"); +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE ''; +a +hakan% +hakank +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE ''; +a +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha%%an' ESCAPE '%'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE '\\'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|'; +a +ha%an +SET @@SQL_MODE='NO_BACKSLASH_ESCAPES'; +SHOW LOCAL VARIABLES LIKE 'SQL_MODE'; +Variable_name Value +sql_mode NO_BACKSLASH_ESCAPES +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%'; +a +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE '\\'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE ''; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\n%' ESCAPE '\n'; +ERROR HY000: Incorrect arguments to ESCAPE +SET @@SQL_MODE=@OLD_SQL_MODE12595; +DROP TABLE BUG_12595; +create table t1 (a char(1)); +create table t2 (a char(1)); +insert into t1 values ('a'),('b'),('c'); +insert into t2 values ('b'),('c'),('d'); +select a from t1 natural join t2; +a +b +c +select * from t1 natural join t2 where a = 'b'; +a +b +drop table t1, t2; +CREATE TABLE t1 (`id` TINYINT); +CREATE TABLE t2 (`id` TINYINT); +CREATE TABLE t3 (`id` TINYINT); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +drop table t1, t2, t3; +create table t1 (a int(10),b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (a int(10),b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,10),(2,20),(3,30); +insert into t2 values (1,10); +select * from t1 inner join t2 using (A); +a b b +1 10 10 +select * from t1 inner join t2 using (a); +a b b +1 10 10 +drop table t1, t2; +create table t1 (a int, c int); +create table t2 (b int); +create table t3 (b int, a int); +create table t4 (c int); +insert into t1 values (1,1); +insert into t2 values (1); +insert into t3 values (1,1); +insert into t4 values (1); +select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +a c b b a +1 1 1 1 1 +select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +ERROR 42S22: Unknown column 't1.a' in 'on clause' +select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); +a c b b a c +1 1 1 1 1 1 +select * from t1 join t2 join t4 using (c); +c a b +1 1 1 +drop table t1, t2, t3, t4; +create table t1(x int, y int); +create table t2(x int, y int); +create table t3(x int, primary key(x)); +insert into t1 values (1, 1), (2, 1), (3, 1), (4, 3), (5, 6), (6, 6); +insert into t2 values (1, 1), (2, 1), (3, 3), (4, 6), (5, 6); +insert into t3 values (1), (2), (3), (4), (5); +select t1.x, t3.x from t1, t2, t3 where t1.x = t2.x and t3.x >= t1.y and t3.x <= t2.y; +x x +1 1 +2 1 +3 1 +3 2 +3 3 +4 3 +4 4 +4 5 +drop table t1,t2,t3; +create table t1 (id char(16) not null default '', primary key (id)); +insert into t1 values ('100'),('101'),('102'); +create table t2 (id char(16) default null); +insert into t2 values (1); +create view v1 as select t1.id from t1; +create view v2 as select t2.id from t2; +create view v3 as select (t1.id+2) as id from t1 natural left join t2; +select t1.id from t1 left join v2 using (id); +id +100 +101 +102 +select t1.id from v2 right join t1 using (id); +id +100 +101 +102 +select t1.id from t1 left join v3 using (id); +id +100 +101 +102 +select * from t1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join t1 using (id); +id +100 +101 +102 +select * from t1 left join v3 using (id); +id +100 +101 +102 +select v1.id from v1 left join v2 using (id); +id +100 +101 +102 +select v1.id from v2 right join v1 using (id); +id +100 +101 +102 +select v1.id from v1 left join v3 using (id); +id +100 +101 +102 +select * from v1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join v1 using (id); +id +100 +101 +102 +select * from v1 left join v3 using (id); +id +100 +101 +102 +drop table t1, t2; +drop view v1, v2, v3; +create table t1 (id int(11) not null default '0'); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (123),(191),(192); +create table t2 (id char(16) character set utf8 not null); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t2 values ('58013'),('58014'),('58015'),('58016'); +create table t3 (a_id int(11) not null, b_id char(16) character set utf8); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t3 values (123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013'); +select count(*) +from t1 inner join (t3 left join t2 on t2.id = t3.b_id) on t1.id = t3.a_id; +count(*) +6 +select count(*) +from t1 inner join (t2 right join t3 on t2.id = t3.b_id) on t1.id = t3.a_id; +count(*) +6 +drop table t1,t2,t3; +create table t1 (a int); +create table t2 (b int); +create table t3 (c int); +select * from t1 join t2 join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 left join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 right join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 straight_join t3 on (t1.a=t3.c); +a b c +drop table t1, t2 ,t3; +create table t1(f1 int, f2 date); +insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'), +(4,'2005-10-01'),(5,'2005-12-30'); +select * from t1 where f2 >= 0 order by f2; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +select * from t1 where f2 >= '0000-00-00' order by f2; +ERROR HY000: Incorrect DATE value: '0000-00-00' +select * from t1 where f2 >= '2005-09-31' order by f2; +ERROR HY000: Incorrect DATE value: '2005-09-31' +select * from t1 where f2 >= '2005-09-3a' order by f2; +f1 f2 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +select * from t1 where f2 <= '2005-09-31' order by f2; +ERROR HY000: Incorrect DATE value: '2005-09-31' +select * from t1 where f2 <= '2005-09-3a' order by f2; +f1 f2 +1 2005-01-01 +2 2005-09-01 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +drop table t1; +create table t1 (f1 int, f2 int); +insert into t1 values (1, 30), (2, 20), (3, 10); +create algorithm=merge view v1 as select f1, f2 from t1; +create algorithm=merge view v2 (f2, f1) as select f1, f2 from t1; +create algorithm=merge view v3 as select t1.f1 as f2, t1.f2 as f1 from t1; +select t1.f1 as x1, f1 from t1 order by t1.f1; +x1 f1 +1 1 +2 2 +3 3 +select v1.f1 as x1, f1 from v1 order by v1.f1; +x1 f1 +1 1 +2 2 +3 3 +select v2.f1 as x1, f1 from v2 order by v2.f1; +x1 f1 +10 10 +20 20 +30 30 +select v3.f1 as x1, f1 from v3 order by v3.f1; +x1 f1 +10 10 +20 20 +30 30 +select f1, f2, v1.f1 as x1 from v1 order by v1.f1; +f1 f2 x1 +1 30 1 +2 20 2 +3 10 3 +select f1, f2, v2.f1 as x1 from v2 order by v2.f1; +f1 f2 x1 +10 3 10 +20 2 20 +30 1 30 +select f1, f2, v3.f1 as x1 from v3 order by v3.f1; +f1 f2 x1 +10 3 10 +20 2 20 +30 1 30 +drop table t1; +drop view v1, v2, v3; +CREATE TABLE t1(key_a int4 NOT NULL, optimus varchar(32), PRIMARY KEY(key_a)); +CREATE TABLE t2(key_a int4 NOT NULL, prime varchar(32), PRIMARY KEY(key_a)); +CREATE table t3(key_a int4 NOT NULL, key_b int4 NOT NULL, foo varchar(32), +PRIMARY KEY(key_a,key_b)); +INSERT INTO t1 VALUES (0,''); +INSERT INTO t1 VALUES (1,'i'); +INSERT INTO t1 VALUES (2,'j'); +INSERT INTO t1 VALUES (3,'k'); +INSERT INTO t2 VALUES (1,'r'); +INSERT INTO t2 VALUES (2,'s'); +INSERT INTO t2 VALUES (3,'t'); +INSERT INTO t3 VALUES (1,5,'x'); +INSERT INTO t3 VALUES (1,6,'y'); +INSERT INTO t3 VALUES (2,5,'xx'); +INSERT INTO t3 VALUES (2,6,'yy'); +INSERT INTO t3 VALUES (2,7,'zz'); +INSERT INTO t3 VALUES (3,5,'xxx'); +SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +key_a foo +2 xx +EXPLAIN SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t3 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `key_a`,'xx' AS `foo` from `test`.`t1` join `test`.`t2` join `test`.`t3` where true +SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +key_a foo +2 xx +EXPLAIN SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t3 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `key_a`,'xx' AS `foo` from `test`.`t1` join `test`.`t2` join `test`.`t3` where true +DROP TABLE t1,t2,t3; +create table t1 (f1 int); +insert into t1 values(1),(2); +create table t2 (f2 int, f3 int, key(f2)); +insert into t2 values(1,1),(2,2); +create table t3 (f4 int not null); +insert into t3 values (2),(2),(2); +select f1,(select count(*) from t2,t3 where f2=f1 and f3=f4) as count from t1; +f1 count +1 0 +2 3 +drop table t1,t2,t3; +create table t1 (f1 int unique); +create table t2 (f2 int unique); +create table t3 (f3 int unique); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +insert into t3 values(1),(NULL); +select * from t3 where f3 is null; +f3 +NULL +select t2.f2 from t1 left join t2 on f1=f2 join t3 on f1=f3 where f1=1; +f2 +1 +drop table t1,t2,t3; +create table t1(f1 char, f2 char not null); +insert into t1 values(null,'a'); +create table t2 (f2 char not null); +insert into t2 values('b'); +select * from t1 left join t2 on f1=t2.f2 where t1.f2='a'; +f1 f2 f2 +NULL a NULL +drop table t1,t2; +select * from (select * left join t on f1=f2) tt; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left join t on f1=f2) tt' at line 1 +CREATE TABLE t1 (sku int PRIMARY KEY, pr int); +CREATE TABLE t2 (sku int PRIMARY KEY, sppr int, name varchar(255)); +INSERT INTO t1 VALUES +(10, 10), (20, 10), (30, 20), (40, 30), (50, 10), (60, 10); +INSERT INTO t2 VALUES +(10, 10, 'aaa'), (20, 10, 'bbb'), (30, 10, 'ccc'), (40, 20, 'ddd'), +(50, 10, 'eee'), (60, 20, 'fff'), (70, 20, 'ggg'), (80, 30, 'hhh'); +SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr +FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku); +sku sppr name sku pr +20 10 bbb 10 10 +20 10 bbb 20 10 +EXPLAIN +SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr +FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select '20' AS `sku`,'10' AS `sppr`,'bbb' AS `name`,`test`.`t1`.`sku` AS `sku`,`test`.`t1`.`pr` AS `pr` from `test`.`t2` join `test`.`t1` where (((`test`.`t1`.`sku` = 20) or (`test`.`t1`.`sku` = '10'))) +DROP TABLE t1,t2; +SET SQL_MODE='NO_UNSIGNED_SUBTRACTION'; +CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL); +INSERT t1 SET i = 0; +UPDATE t1 SET i = -1; +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +UPDATE t1 SET i = CAST(i - 1 AS SIGNED); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +UPDATE t1 SET i = i - 1; +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +DROP TABLE t1; +SET SQL_MODE=default; +create table t1 (a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t2 (a int, b int, c int, e int, primary key(a,b,c)); +# The "ANALYZE TABLE"-command that is executed further down will get +# different results depending on the order of rows in table t2. Since the +# INSERT INTO ... SELECT may be executed using different execution plans, +# we've added ORDER BY to ensure that we rows has the same order every +# time. If not, the estimated number of rows for t2 (alias 'a') in the +# EXPLAIN may change on different platforms. Note that both table t1 and +# t2 may be MYISAM, since many of the test files that includes this file +# forces MYISAM as the default storage engine. +insert into t2 select A.a, B.a, C.a, C.a from t1 A, t1 B, t1 C +ORDER BY A.a, B.a, C.a; +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select 'In next EXPLAIN, B.rows must be exactly 10:' Z; +Z +In next EXPLAIN, B.rows must be exactly 10: +explain select * from t2 a, t2 b where a.a=5 and a.b=5 and a.c<5 +and b.a=5 and b.b=a.e and (b.b =1 or b.b = 3 or b.b=5); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 27.10 Parallel execute (1 workers) +2 SIMPLE a NULL range PRIMARY PRIMARY 12 NULL 5 27.10 Using where +2 SIMPLE b NULL ref PRIMARY PRIMARY 8 const,test.a.e 10 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`b` AS `b`,`test`.`a`.`c` AS `c`,`test`.`a`.`e` AS `e`,`test`.`b`.`a` AS `a`,`test`.`b`.`b` AS `b`,`test`.`b`.`c` AS `c`,`test`.`b`.`e` AS `e` from `test`.`t2` `a` join `test`.`t2` `b` where ((`test`.`b`.`b` = `test`.`a`.`e`) and (`test`.`b`.`a` = 5) and (`test`.`a`.`b` = 5) and (`test`.`a`.`a` = 5) and (`test`.`a`.`c` < 5) and ((`test`.`a`.`e` = 1) or (`test`.`a`.`e` = 3) or (`test`.`a`.`e` = 5))) +drop table t1, t2; +CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX(b)); +INSERT INTO t1 VALUES (1, 3), (9,4), (7,5), (4,5), (6,2), +(3,1), (5,1), (8,9), (2,2), (0,9); +CREATE TABLE t2 (c int, d int, f int, INDEX(c,f)); +INSERT INTO t2 VALUES +(1,0,0), (1,0,1), (2,0,0), (2,0,1), (3,0,0), (4,0,1), +(5,0,0), (5,0,1), (6,0,0), (0,0,1), (7,0,0), (7,0,1), +(0,0,0), (0,0,1), (8,0,0), (8,0,1), (9,0,0), (9,0,1); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,b b 5 NULL 3 100.00 Using where; Using index +2 SIMPLE t2 NULL ref c c 5 test.t1.a 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2`.`f` AS `f` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` between 4 and 6)) +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6 AND a > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 90.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,b b 9 NULL 3 90.00 Using where; Using index +2 SIMPLE t2 NULL ref c c 5 test.t1.a 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2`.`f` AS `f` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` between 4 and 6) and (`test`.`t1`.`a` > 0)) +DROP TABLE t1, t2; +create table t1 ( +a int unsigned not null auto_increment primary key, +b bit not null, +c bit not null +); +create table t2 ( +a int unsigned not null auto_increment primary key, +b bit not null, +c int unsigned not null, +d varchar(50) +); +insert into t1 (b,c) values (0,1), (0,1); +insert into t2 (b,c) values (0,1); +select t1.a, t1.b + 0, t1.c + 0, t2.a, t2.b + 0, t2.c, t2.d +from t1 left outer join t2 on t1.a = t2.c and t2.b <> 1 +where t1.b <> 1 order by t1.a; +a t1.b + 0 t1.c + 0 a t2.b + 0 c d +1 0 1 1 0 1 NULL +2 0 1 NULL NULL NULL NULL +drop table t1,t2; +SELECT 0.9888889889 * 1.011111411911; +0.9888889889 * 1.011111411911 +0.9998769417899202067879 +prepare stmt from 'select 1 as " a "'; +Warnings: +Warning 1466 Leading spaces are removed from name ' a ' +execute stmt; +a +1 +CREATE TABLE t1 (a int NOT NULL PRIMARY KEY, b int NOT NULL); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +CREATE TABLE t2 (c int NOT NULL, INDEX idx(c)); +INSERT INTO t2 VALUES +(1), (1), (1), (1), (1), (1), (1), (1), +(2), (2), (2), (2), +(3), (3), +(4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL ref idx idx 4 const 8 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '1' AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = '1')) +EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=4; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL ref idx idx 4 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '4' AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = '4')) +DROP TABLE t1, t2; +CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a int); +INSERT INTO t1 VALUES (1,2), (2,NULL), (3,2); +CREATE TABLE t2 (b int, c INT, INDEX idx1(b)); +INSERT INTO t2 VALUES (2,1), (3,2); +CREATE TABLE t3 (d int, e int, INDEX idx1(d)); +INSERT INTO t3 VALUES (2,10), (2,20), (1,30), (2,40), (2,50); +EXPLAIN +SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id +WHERE t1.id=2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL const idx1 NULL NULL NULL 1 100.00 Impossible ON condition +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL const idx1 NULL NULL NULL 1 100.00 Impossible ON condition +2 SIMPLE t3 NULL ref idx1 idx1 5 const 4 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `id`,NULL AS `a`,NULL AS `b`,NULL AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t3`.`e` AS `e` from `test`.`t1` left join `test`.`t2` on(multiple equal(NULL, NULL)) join `test`.`t3` where (`test`.`t3`.`d` = 2) +SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id +WHERE t1.id=2; +id a b c d e +2 NULL NULL NULL 2 10 +2 NULL NULL NULL 2 20 +2 NULL NULL NULL 2 40 +2 NULL NULL NULL 2 50 +DROP TABLE t1,t2,t3; +create table t1 (c1 varchar(1), c2 int, c3 int, c4 int, c5 int, c6 int, +c7 int, c8 int, c9 int, fulltext key (`c1`)); +select distinct match (`c1`) against ('z') , c2, c3, c4,c5, c6,c7, c8 +from t1 where c9=1 order by c2, c2; +match (`c1`) against ('z') c2 c3 c4 c5 c6 c7 c8 +drop table t1; +CREATE TABLE t1 (pk varchar(10) PRIMARY KEY, fk varchar(16)) charset utf8mb4; +CREATE TABLE t2 (pk varchar(16) PRIMARY KEY, fk varchar(10)) charset utf8mb4; +INSERT INTO t1 VALUES +('d','dddd'), ('i','iii'), ('a','aa'), ('b','bb'), ('g','gg'), +('e','eee'), ('c','cccc'), ('h','hhh'), ('j','jjj'), ('f','fff'); +INSERT INTO t2 VALUES +('jjj', 'j'), ('cc','c'), ('ccc','c'), ('aaa', 'a'), ('jjjj','j'), +('hhh','h'), ('gg','g'), ('fff','f'), ('ee','e'), ('ffff','f'), +('bbb','b'), ('ff','f'), ('cccc','c'), ('dddd','d'), ('jj','j'), +('aaaa','a'), ('bb','b'), ('eeee','e'), ('aa','a'), ('hh','h'); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk < 'c' AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` < 'c')) +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk BETWEEN 'a' AND 'b' AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` between 'a' and 'b')) +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk IN ('a','b') AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` in ('a','b'))) +DROP TABLE t1,t2; +CREATE TABLE t1 (a int, b varchar(20) NOT NULL, PRIMARY KEY(a)) charset utf8mb4; +CREATE TABLE t2 (a int, b varchar(20) NOT NULL, +PRIMARY KEY (a), UNIQUE KEY (b)) charset utf8mb4; +INSERT INTO t1 VALUES (1,'a'),(2,'b'),(3,'c'); +INSERT INTO t2 VALUES (1,'a'),(2,'b'),(3,'c'); +EXPLAIN SELECT t1.a FROM t1 LEFT JOIN t2 ON t2.b=t1.b WHERE t1.a=3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL const b b 82 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '3' AS `a` from `test`.`t1` left join `test`.`t2` on(multiple equal('c', 'c')) where true +DROP TABLE t1,t2; +CREATE TABLE t1(id int PRIMARY KEY, b int, e int); +CREATE TABLE t2(i int, a int, INDEX si(i), INDEX ai(a)); +CREATE TABLE t3(a int PRIMARY KEY, c char(4), INDEX ci(c)); +INSERT INTO t1 VALUES +(1,10,19), (2,20,22), (4,41,42), (9,93,95), (7, 77,79), +(6,63,67), (5,55,58), (3,38,39), (8,81,89); +INSERT INTO t2 VALUES +(21,210), (41,410), (82,820), (83,830), (84,840), +(65,650), (51,510), (37,370), (94,940), (76,760), +(22,220), (33,330), (40,400), (95,950), (38,380), +(67,670), (88,880), (57,570), (96,960), (97,970); +INSERT INTO t3 VALUES +(210,'bb'), (950,'ii'), (400,'ab'), (500,'ee'), (220,'gg'), +(440,'gg'), (310,'eg'), (380,'ee'), (840,'bb'), (830,'ff'), +(230,'aa'), (960,'ii'), (410,'aa'), (510,'ee'), (290,'bb'), +(450,'gg'), (320,'dd'), (390,'hh'), (850,'jj'), (860,'ff'); +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 +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si si 5 NULL 4 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` FORCE INDEX (`si`) join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t2`.`i` between '81' and '89') and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2,t3 +WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee') ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si,ai si 5 NULL 4 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t2`.`i` between '81' and '89') and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND +t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si si 5 NULL 2 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` FORCE INDEX (`si`) join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((`test`.`t2`.`i` = '81') or (`test`.`t2`.`i` = '89')) and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2,t3 +WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND +t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si,ai si 5 NULL 2 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((`test`.`t2`.`i` = '81') or (`test`.`t2`.`i` = '89')) and (`test`.`t3`.`c` in ('bb','ee'))) +DROP TABLE t1,t2,t3; +CREATE TABLE t1 ( f1 int primary key, f2 int, f3 int, f4 int, f5 int, f6 int, checked_out int); +CREATE TABLE t2 ( f11 int PRIMARY KEY ); +INSERT INTO t1 VALUES (1,1,1,0,0,0,0),(2,1,1,3,8,1,0),(3,1,1,4,12,1,0); +INSERT INTO t2 VALUES (62); +SELECT * FROM t1 LEFT JOIN t2 ON f11 = t1.checked_out GROUP BY f1 ORDER BY f2, f3, f4, f5 LIMIT 0, 1; +f1 f2 f3 f4 f5 f6 checked_out f11 +1 1 1 0 0 0 0 NULL +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(a int); +INSERT into t1 values (1), (2), (3); +SELECT * FROM t1 LIMIT 2, -1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1 +DROP TABLE t1; +set optimizer_switch='index_merge=off'; +CREATE TABLE t1 ( +ID_with_null int NULL, +ID_better int NOT NULL, +INDEX idx1 (ID_with_null), +INDEX idx2 (ID_better) +); +INSERT INTO t1 VALUES (1,1), (2,1), (null,3), (null,3), (null,3), (null,3); +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SELECT COUNT(*) FROM t1 WHERE ID_with_null IS NULL; +COUNT(*) +128 +SELECT COUNT(*) FROM t1 WHERE ID_better=1; +COUNT(*) +2 +EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 98.46 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 98.46 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID_with_null` AS `ID_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID_with_null` is null)) +DROP INDEX idx1 ON t1; +CREATE UNIQUE INDEX idx1 ON t1(ID_with_null); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 98.46 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 98.46 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID_with_null` AS `ID_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID_with_null` is null)) +DROP TABLE t1; +CREATE TABLE t1 ( +ID1_with_null int NULL, +ID2_with_null int NULL, +ID_better int NOT NULL, +INDEX idx1 (ID1_with_null, ID2_with_null), +INDEX idx2 (ID_better) +) ; +INSERT INTO t1 VALUES (1,1,1), (2,2,1), (3,null,3), (null,3,3), (null,null,3), +(3,null,3), (null,3,3), (null,null,3), (3,null,3), (null,3,3), (null,null,3); +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null=3; +COUNT(*) +24 +SELECT COUNT(*) FROM t1 WHERE ID1_with_null=3 AND ID2_with_null IS NULL; +COUNT(*) +24 +SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null IS NULL; +COUNT(*) +192 +SELECT COUNT(*) FROM t1 WHERE ID_better=1; +COUNT(*) +2 +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID2_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID1_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and ((`test`.`t1`.`ID2_with_null` = 3) is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 79.34 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 79.34 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and (`test`.`t1`.`ID2_with_null` is null)) +DROP INDEX idx1 ON t1; +CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID2_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null IS NULL ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID1_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID2_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 79.34 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 79.34 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and (`test`.`t1`.`ID2_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND +(ID2_with_null=1 OR ID2_with_null=2); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 2.50 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 2.50 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and ((`test`.`t1`.`ID2_with_null` = 1) or (`test`.`t1`.`ID2_with_null` = 2))) +DROP TABLE t1; +set optimizer_switch='index_merge=on'; +CREATE TABLE t1 (a INT, ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY ts(ts)); +INSERT INTO t1 VALUES (30,"2006-01-03 23:00:00"), (31,"2006-01-03 23:00:00"); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CREATE TABLE t2 (a INT, dt1 DATETIME, dt2 DATETIME, PRIMARY KEY (a)); +INSERT INTO t2 VALUES (30, "2006-01-01 00:00:00", "2999-12-31 00:00:00"); +INSERT INTO t2 SELECT a+1,dt1,dt2 FROM t2; +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +EXPLAIN +SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 +AND t1.ts BETWEEN t2.dt1 AND t2.dt2 +AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t1 NULL range ts ts 4 NULL 2 50.00 Using index condition; Using where; Using MRR +Warnings: +Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`ts` AS `ts`,'30' AS `a`,'2006-01-01 00:00:00' AS `dt1`,'2999-12-31 00:00:00' AS `dt2` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = 30) and (`test`.`t1`.`ts` between '2006-01-01 00:00:00' and '2999-12-31 00:00:00') and (`test`.`t1`.`ts` between '2006-01-01' and '2006-12-31')) +SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 +AND t1.ts BETWEEN t2.dt1 AND t2.dt2 +AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; +a ts a dt1 dt2 +30 2006-01-03 23:00:00 30 2006-01-01 00:00:00 2999-12-31 00:00:00 +Warnings: +Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 +DROP TABLE t1,t2; +create table t1 (a bigint unsigned); +insert into t1 values +(if(1, 9223372036854775808, 1)), +(case when 1 then 9223372036854775808 else 1 end), +(coalesce(9223372036854775808, 1)); +select * from t1; +a +9223372036854775808 +9223372036854775808 +9223372036854775808 +drop table t1; +create table t1 charset utf8mb4 select +if(1, 9223372036854775808, 1) i, +case when 1 then 9223372036854775808 else 1 end c, +coalesce(9223372036854775808, 1) co; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` decimal(19,0) NOT NULL DEFAULT '0', + `c` decimal(19,0) NOT NULL DEFAULT '0', + `co` decimal(19,0) NOT NULL DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +select +if(1, cast(1111111111111111111 as unsigned), 1) i, +case when 1 then cast(1111111111111111111 as unsigned) else 1 end c, +coalesce(cast(1111111111111111111 as unsigned), 1) co; +i c co +1111111111111111111 1111111111111111111 1111111111111111111 +CREATE TABLE t1 (name varchar(255)) charset latin1; +CREATE TABLE t2 (name varchar(255), n int, KEY (name(3))) charset latin1; +INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); +INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); +INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); +INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT * FROM t2; +name n +bb 1 +aa 2 +cc 3 +cc  4 +cc 5 +bb 6 +cc 7 +SELECT * FROM t2 ORDER BY name; +name n +aa 2 +bb 1 +bb 6 +cc  4 +cc 3 +cc 5 +cc 7 +SELECT name, LENGTH(name), n FROM t2 ORDER BY name; +name LENGTH(name) n +aa 2 2 +bb 2 1 +bb 3 6 +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref name name 6 const 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` = 'cc ') +SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +name LENGTH(name) n +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +name LENGTH(name) n +cc 5 3 +cc  4 4 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') order by `test`.`t2`.`name` +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +name LENGTH(name) n +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +2 SIMPLE t2 NULL ref name name 6 test.t1.name 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`name` AS `name`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`n` AS `n` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`name` = `test`.`t1`.`name`)) where true +SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +name name n +aa aa 2 +aa aa 2 +bb bb 1 +bb bb 6 +cc cc 5 +cc cc 7 +cc cc 3 +ccc NULL NULL +DROP TABLE t1,t2; +CREATE TABLE t1 (name text) charset latin1; +CREATE TABLE t2 (name text, n int, KEY (name(3))) charset latin1; +INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); +INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); +INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); +INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT * FROM t2; +name n +bb 1 +aa 2 +cc 3 +cc  4 +cc 5 +bb 6 +cc 7 +SELECT * FROM t2 ORDER BY name; +name n +aa 2 +bb 1 +bb 6 +cc  4 +cc 3 +cc 5 +cc 7 +SELECT name, LENGTH(name), n FROM t2 ORDER BY name; +name LENGTH(name) n +aa 2 2 +bb 2 1 +bb 3 6 +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ref name name 6 const 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` = 'cc ') +SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +name LENGTH(name) n +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +name LENGTH(name) n +cc 5 3 +cc  4 4 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') order by `test`.`t2`.`name` +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +name LENGTH(name) n +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref name name 6 test.t1.name 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`name` AS `name`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`n` AS `n` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`name` = `test`.`t1`.`name`)) where true +SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +name name n +aa aa 2 +aa aa 2 +bb bb 1 +bb bb 6 +cc cc 5 +cc cc 7 +cc cc 3 +ccc NULL NULL +DROP TABLE t1,t2; +CREATE TABLE t1 ( +access_id int NOT NULL default '0', +name varchar(20) default NULL, +`rank` int NOT NULL default '0', +KEY idx (access_id) +); +CREATE TABLE t2 ( +faq_group_id int NOT NULL default '0', +faq_id int NOT NULL default '0', +access_id int default NULL, +UNIQUE KEY idx1 (faq_id), +KEY idx2 (faq_group_id,faq_id) +); +INSERT INTO t1 VALUES +(1,'Everyone',2),(2,'Help',3),(3,'Technical Support',1),(4,'Chat User',4); +INSERT INTO t2 VALUES +(261,265,1),(490,494,1); +SELECT t2.faq_id +FROM t1 INNER JOIN t2 IGNORE INDEX (idx1) +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +SELECT t2.faq_id +FROM t1 INNER JOIN t2 +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +DROP TABLE t1,t2; +CREATE TABLE t1 (a INT, b INT, KEY inx (b,a)); +INSERT INTO t1 VALUES (1,1), (1,2), (1,3), (1,4), (1,5), (1, 6), (1,7); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT COUNT(*) FROM t1 f1 INNER JOIN t1 f2 +ON ( f1.b=f2.b AND f1.a NULL ALL NULL NULL NULL NULL 7 100.00 Parallel execute (1 workers) +2 SIMPLE f1 NULL index inx inx 10 NULL 7 100.00 Using where; Using index +2 SIMPLE f2 NULL ref inx inx 5 test.f1.b 1 33.33 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` `f1` join `test`.`t1` `f2` where ((`test`.`f2`.`b` = `test`.`f1`.`b`) and (`test`.`f1`.`b` not in (100,2232,3343,51111)) and (`test`.`f1`.`a` < `test`.`f2`.`a`)) +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 INT); +INSERT INTO t1 VALUES (1,11), (2,22), (2,22); +EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2)))))))))))))))))))))))))))))) > 0; +EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) > 0; +ERROR HY000: Too high level of nesting for select +DROP TABLE t1; +CREATE TABLE t1 ( +c1 int(11) NOT NULL AUTO_INCREMENT, +c2 varchar(1000) DEFAULT NULL, +c3 bigint(20) DEFAULT NULL, +c4 bigint(20) DEFAULT NULL, +PRIMARY KEY (c1) +) charset utf8mb4; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN +SELECT join_2.c1 +FROM +t1 AS join_0, +t1 AS join_1, +t1 AS join_2, +t1 AS join_3, +t1 AS join_4, +t1 AS join_5, +t1 AS join_6, +t1 AS join_7 +WHERE +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +OR +join_0.c2 < '?' AND +join_1.c2 < '?' AND +join_2.c2 > '?' AND +join_2.c2 < '!' AND +join_3.c2 > '?' AND +join_4.c2 = '?' AND +join_5.c2 <> '?' AND +join_6.c2 <> '?' AND +join_7.c2 >= '?' AND +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +GROUP BY +join_3.c1, +join_2.c1, +join_7.c1, +join_1.c1, +join_0.c1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL # 1 100.00 # +2 SIMPLE join_0 NULL ALL PRIMARY NULL NULL # 1 100.00 # +2 SIMPLE join_1 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_2 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_3 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_4 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_5 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_6 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_7 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +Warnings: +Note 1003 /* select#1 */ select `test`.`join_2`.`c1` AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where (((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`)) or ((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c2` = '?') and (`test`.`join_0`.`c2` < '?') and (`test`.`join_1`.`c2` < '?') and (`test`.`join_2`.`c2` > '?') and (`test`.`join_2`.`c2` < '!') and (`test`.`join_3`.`c2` > '?') and (`test`.`join_5`.`c2` <> '?') and (`test`.`join_6`.`c2` <> '?') and (`test`.`join_7`.`c2` >= '?'))) group by `test`.`join_3`.`c1`,`test`.`join_2`.`c1`,`test`.`join_7`.`c1`,`test`.`join_1`.`c1`,`test`.`join_0`.`c1` +SHOW WARNINGS; +Level Code Message +Note 1003 /* select#1 */ select `test`.`join_2`.`c1` AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where (((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`)) or ((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c2` = '?') and (`test`.`join_0`.`c2` < '?') and (`test`.`join_1`.`c2` < '?') and (`test`.`join_2`.`c2` > '?') and (`test`.`join_2`.`c2` < '!') and (`test`.`join_3`.`c2` > '?') and (`test`.`join_5`.`c2` <> '?') and (`test`.`join_6`.`c2` <> '?') and (`test`.`join_7`.`c2` >= '?'))) group by `test`.`join_3`.`c1`,`test`.`join_2`.`c1`,`test`.`join_7`.`c1`,`test`.`join_1`.`c1`,`test`.`join_0`.`c1` +DROP TABLE t1; +SELECT 1 AS ` `; + +1 +Warnings: +Warning 1474 Name ' ' has become '' +SELECT 1 AS ` `; + +1 +Warnings: +Warning 1474 Name ' ' has become '' +SELECT 1 AS ` x`; +x +1 +Warnings: +Warning 1466 Leading spaces are removed from name ' x' +CREATE VIEW v1 AS SELECT 1 AS ``; +ERROR 42000: Incorrect column name '' +CREATE VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT (SELECT 1 AS ` `); +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` x`; +Warnings: +Warning 1466 Leading spaces are removed from name ' x' +SELECT `x` FROM v1; +x +1 +ALTER VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +DROP VIEW v1; +select str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' + and '2007/10/20 00:00:00 GMT'; +str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' + and '2007/10/20 00:00:00 GMT' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT' +Warning 1292 Truncated incorrect date value: '2007/10/20 00:00:00 GMT' +select str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6'; +str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT-6' +select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6'; +ERROR HY000: Incorrect DATE value: '2007/10/2000:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007-10-1 00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007-10-01 x00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:x00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 x12:34:56 GMT-6' +select str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; +str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6' +select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; +str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' +0 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6' +select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56'; +str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56' +1 +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00' +0 +select str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00' +1 +select str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34' +select str_to_date('2007-02-30 12:34','%Y-%m-%d %H:%i') = '2007-02-30 12:34:00'; +ERROR HY000: Incorrect DATETIME value: '2007-02-30 12:34:00' +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00' + and '2007/10/20 00:00:00'; +str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00' + and '2007/10/20 00:00:00' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +set SQL_MODE=TRADITIONAL; +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00 12:34' for function str_to_date +select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01' + and '2007/10/20'; +str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01' + and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +set SQL_MODE=DEFAULT; +select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'; +str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +select str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20'; +str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '' for function str_to_date +select str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '' for function str_to_date +select str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = ''; +ERROR HY000: Incorrect DATETIME value: '' +select str_to_date('1','%Y-%m-%d') = '1'; +ERROR HY000: Incorrect DATE value: '1' +select str_to_date('1','%Y-%m-%d') = '1'; +ERROR HY000: Incorrect DATE value: '1' +select str_to_date('','%Y-%m-%d') = ''; +ERROR HY000: Incorrect DATE value: '' +select str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL; +str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL +0 +Warnings: +Warning 1292 Truncated incorrect date value: '0000-00-00' +select str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00'; +str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00' +NULL +Warnings: +Warning 1292 Truncated incorrect date value: '2000-00-00' +select str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL; +str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL +0 +CREATE TABLE t1 (c11 INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY); +CREATE TABLE t2 (c21 INT UNSIGNED NOT NULL, +c22 INT DEFAULT NULL, +KEY(c21, c22)); +CREATE TABLE t3 (c31 INT UNSIGNED NOT NULL DEFAULT 0, +c32 INT DEFAULT NULL, +c33 INT NOT NULL, +c34 INT UNSIGNED DEFAULT 0, +KEY (c33, c34, c32)); +INSERT INTO t1 values (),(),(),(),(); +INSERT INTO t2 SELECT a.c11, b.c11 FROM t1 a, t1 b; +INSERT INTO t3 VALUES (1, 1, 1, 0), +(2, 2, 0, 0), +(3, 3, 1, 0), +(4, 4, 0, 0), +(5, 5, 1, 0); +SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND +t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND +t3.c33 = 1 AND t2.c22 in (1, 3) +ORDER BY c32; +c32 +1 +1 +3 +3 +5 +5 +SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND +t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND +t3.c33 = 1 AND t2.c22 in (1, 3) +ORDER BY c32 DESC; +c32 +5 +5 +3 +3 +1 +1 +DROP TABLE t1, t2, t3; + +# +# Bug#30736: Row Size Too Large Error Creating a Table and +# Inserting Data. +# +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; + +CREATE TABLE t1( +c1 DECIMAL(10, 2), +c2 FLOAT); + +INSERT INTO t1 VALUES (0, 1), (2, 3), (4, 5); + +CREATE TABLE t2( +c3 DECIMAL(10, 2)) +SELECT +c1 * c2 AS c3 +FROM t1; + +SELECT * FROM t1; +c1 c2 +0.00 1 +2.00 3 +4.00 5 + +SELECT * FROM t2; +c3 +0.00 +6.00 +20.00 + +DROP TABLE t1; +DROP TABLE t2; + +CREATE TABLE t1 (c1 BIGINT NOT NULL); +INSERT INTO t1 (c1) VALUES (1); +SELECT * FROM t1 WHERE c1 > NULL + 1; +c1 +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10) NOT NULL PRIMARY KEY); +INSERT INTO t1 (a) VALUES ('foo0'), ('bar0'), ('baz0'); +SELECT * FROM t1 WHERE a IN (CONCAT('foo', 0), 'bar'); +a +foo0 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +CREATE TABLE t2 (a INT, c INT, KEY(a)); +INSERT INTO t1 VALUES (1, 1), (2, 2); +INSERT INTO t2 VALUES (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), +(2, 1), (2, 2), (2, 3), (2, 4), (2, 5), +(3, 1), (3, 2), (3, 3), (3, 4), (3, 5), +(4, 1), (4, 2), (4, 3), (4, 4), (4, 5); +FLUSH STATUS; +SELECT DISTINCT b FROM t1 LEFT JOIN t2 USING(a) WHERE c <= 3; +b +1 +2 +SHOW STATUS LIKE 'Handler_read%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 3 +Handler_read_last 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 6 +DROP TABLE t1, t2; +CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0', +f2 int(11) NOT NULL default '0', +f3 bigint(20) NOT NULL default '0', +f4 varchar(255) NOT NULL default '', +PRIMARY KEY (f1), +KEY key1 (f4), +KEY key2 (f2)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t2 (f1 int(11) NOT NULL default '0', +f2 enum('A1','A2','A3') NOT NULL default 'A1', +f3 int(11) NOT NULL default '0', +PRIMARY KEY (f1), +KEY key1 (f3)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0', +f2 datetime NOT NULL default '1980-01-01 00:00:00', +PRIMARY KEY (f1)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1, 1, 1, 'abc'); +insert into t1 values (2, 1, 2, 'def'); +insert into t1 values (3, 1, 2, 'def'); +insert into t2 values (1, 'A1', 1); +insert into t3 values (1, '1980-01-01'); +SELECT a.f3, cr.f4, count(*) count +FROM t2 a +STRAIGHT_JOIN t1 cr ON cr.f2 = a.f1 +LEFT JOIN +(t1 cr2 +JOIN t3 ae2 ON cr2.f3 = ae2.f1 +) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND +cr.f4 = cr2.f4 +GROUP BY a.f3, cr.f4; +f3 f4 count +1 abc 1 +1 def 2 +drop table t1, t2, t3; +CREATE TABLE t1 (a INT KEY, b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a, b FROM t1 WHERE a > 1 AND a = b LIMIT 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 25.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 3 25.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 SELECT a, b FROM t1 WHERE a > 1 AND b = a LIMIT 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 25.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 3 25.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` > 1)) limit 2 +DROP TABLE t1; +# +# Bug#47019: Assertion failed: 0, file .\rt_mbr.c, line 138 when +# forcing a spatial index +# +CREATE TABLE t1(a LINESTRING NOT NULL SRID 0, SPATIAL KEY(a)); +INSERT INTO t1 VALUES +(ST_GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')), +(ST_GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')); +EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t2 NULL ALL a NULL NULL NULL 2 100.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; +1 +1 +1 +1 +1 +EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t2 NULL ALL a NULL NULL NULL 2 100.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` FORCE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); +1 +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug #48291 : crash with row() operator,select into @var, and +# subquery returning multiple rows +# +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (2),(3); +# Should not crash +SELECT 1 FROM t1 WHERE a <> 1 AND NOT +ROW(1,a) <=> ROW(1,(SELECT 1 FROM t1)) +INTO @var0; +ERROR 21000: Subquery returns more than 1 row +DROP TABLE t1; +# +# Bug #48458: simple query tries to allocate enormous amount of +# memory +# +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1(a INT NOT NULL, b YEAR); +INSERT INTO t1 VALUES (); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +CREATE TABLE t2(c INT); +# Should not err out because of out-of-memory +SELECT 1 FROM t2 JOIN t1 ON 1=1 +WHERE a != '1' AND NOT a >= b OR NOT ROW(b,a )<> ROW(a,a); +1 +DROP TABLE t1,t2; +SET sql_mode = default; +# +# Bug #49199: Optimizer handles incorrectly: +# field='const1' AND field='const2' in some cases + +CREATE TABLE t1(a DATETIME NOT NULL); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 00:00:00 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +DROP TABLE t1; +CREATE TABLE t1(a DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2001-01-01') +DROP TABLE t1; +CREATE TABLE t1(a TIMESTAMP NOT NULL NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 00:00:00 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +a b +2001-01-01 00:00:00 2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = DATE'2001-01-01') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b VARCHAR(20) NOT NULL) charset utf8mb4; +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +a b +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = '2001-01-01 00:00:00') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01'; +a b +2001-01-01 00:00:00 2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = '2001-01-01') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT x.a, y.a, z.a FROM t1 x +JOIN t1 y ON x.a=y.a +JOIN t1 z ON y.a=z.a +WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; +a a a +2001-01-01 00:00:00 2001-01-01 00:00:00 2001-01-01 00:00:00 +EXPLAIN SELECT x.a, y.a, z.a FROM t1 x +JOIN t1 y ON x.a=y.a +JOIN t1 z ON y.a=z.a +WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE x NULL ALL NULL NULL NULL NULL 1 100.00 Using where +2 SIMPLE y NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +2 SIMPLE z NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`y`.`a` AS `a`,`test`.`z`.`a` AS `a` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` where ((`test`.`x`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (`test`.`y`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (`test`.`z`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +# +# Bug #49897: crash in ptr_compare when char(0) NOT NULL +# column is used for ORDER BY +# +SET @old_sort_buffer_size= @@session.sort_buffer_size; +SET @@sort_buffer_size= 40000; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1(a CHAR(0) NOT NULL); +INSERT INTO t1 VALUES (0), (0), (0); +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a FROM t1 ORDER BY a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24404 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24404 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `test`.`t1`.`a` +SELECT a FROM t1 ORDER BY a; +DROP TABLE t1; +CREATE TABLE t1(a CHAR(0) NOT NULL, b CHAR(0) NOT NULL, c int); +INSERT INTO t1 VALUES (0, 0, 0), (0, 0, 2), (0, 0, 1); +# Since ANALYZE TABLE only reads a subset of the data, the statistics for +# table t1 depends on the row order. And since the INSERT INTO ... SELECT +# may be executed using different execution plans, we've added ORDER BY +# to ensure that we rows has the same order every time. If not, the +# estimated number of rows in EXPLAIN may change on different platforms. +# Note that the tables may MYISAM, since many of the test files that +# includes this file forces MYISAM as the default storage engine. +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a FROM t1 ORDER BY a LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `test`.`t1`.`a` limit 5 +SELECT a FROM t1 ORDER BY a LIMIT 5; +a + + + + + +EXPLAIN SELECT * FROM t1 ORDER BY a, b LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b` limit 5 +SELECT * FROM t1 ORDER BY a, b LIMIT 5; +a b c + 2 + 2 + 2 + 2 + 2 +EXPLAIN SELECT * FROM t1 ORDER BY a, b, c LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b`,`test`.`t1`.`c` limit 5 +SELECT * FROM t1 ORDER BY a, b, c LIMIT 5; +a b c + 0 + 0 + 0 + 0 + 0 +EXPLAIN SELECT * FROM t1 ORDER BY c, a LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`c`,`test`.`t1`.`a` limit 5 +SELECT * FROM t1 ORDER BY c, a LIMIT 5; +a b c + 0 + 0 + 0 + 0 + 0 +SET @@sort_buffer_size= @old_sort_buffer_size; +DROP TABLE t1; +SET sql_mode = default; +End of 5.0 tests +create table t1(a INT, KEY (a)); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5); +SELECT a FROM t1 ORDER BY a LIMIT 2; +a +1 +2 +SELECT a FROM t1 ORDER BY a LIMIT 2,4294967296; +a +3 +4 +5 +SELECT a FROM t1 ORDER BY a LIMIT 2,4294967297; +a +3 +4 +5 +DROP TABLE t1; +CREATE TABLE A (date_key date); +CREATE TABLE C ( +pk int, +int_nokey int, +int_key int, +date_key date NOT NULL, +date_nokey date, +varchar_key varchar(1) +); +INSERT IGNORE INTO C VALUES +(1,1,1,'0000-00-00',NULL,NULL), +(1,1,1,'0000-00-00',NULL,NULL); +Warnings: +Warning 1264 Out of range value for column 'date_key' at row 1 +Warning 1264 Out of range value for column 'date_key' at row 2 +SELECT 1 FROM C WHERE pk > ANY (SELECT 1 FROM C); +1 +SELECT COUNT(DISTINCT 1) FROM C +WHERE date_key = (SELECT 1 FROM A WHERE C.date_key IS NULL) GROUP BY pk; +COUNT(DISTINCT 1) +SELECT date_nokey FROM C +WHERE int_key IN (SELECT 1 FROM A) +HAVING date_nokey = '10:41:7' +ORDER BY date_key; +ERROR HY000: Incorrect DATE value: '10:41:7' +DROP TABLE A,C; +CREATE TABLE t1 (a INT NOT NULL, b INT); +INSERT INTO t1 VALUES (1, 1); +EXPLAIN SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where true +SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2; +a b +1 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL); +EXPLAIN SELECT * FROM t1 WHERE (a=a AND b=b AND c=c) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +EXPLAIN SELECT * FROM t1 WHERE (a=a AND a=a AND b=b) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +EXPLAIN SELECT * FROM t1 WHERE (a=a AND b=b AND a=a) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +DROP TABLE t1; +# +# Bug#45266: Uninitialized variable lead to an empty result. +# +drop table if exists A,AA,B,BB; +CREATE TABLE `A` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`date_key` date NOT NULL, +`date_nokey` date NOT NULL, +`datetime_key` datetime NOT NULL, +`int_nokey` int(11) NOT NULL, +`time_key` time NOT NULL, +`time_nokey` time NOT NULL, +PRIMARY KEY (`pk`), +KEY `date_key` (`date_key`), +KEY `time_key` (`time_key`), +KEY `datetime_key` (`datetime_key`) +); +CREATE TABLE `AA` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`int_nokey` int(11) NOT NULL, +`time_key` time NOT NULL, +KEY `time_key` (`time_key`), +PRIMARY KEY (`pk`) +); +CREATE TABLE `B` ( +`date_nokey` date NOT NULL, +`date_key` date NOT NULL, +`time_key` time NOT NULL, +`datetime_nokey` datetime NOT NULL, +`varchar_key` varchar(1) NOT NULL, +KEY `date_key` (`date_key`), +KEY `time_key` (`time_key`), +KEY `varchar_key` (`varchar_key`) +); +INSERT IGNORE INTO `B` VALUES ('2003-07-28','2003-07-28','15:13:38','0000-00-00 00:00:00','f'),('0000-00-00','0000-00-00','00:05:48','2004-07-02 14:34:13','x'); +CREATE TABLE `BB` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`int_nokey` int(11) NOT NULL, +`date_key` date NOT NULL, +`varchar_nokey` varchar(1) NOT NULL, +`date_nokey` date NOT NULL, +PRIMARY KEY (`pk`), +KEY `date_key` (`date_key`) +); +INSERT IGNORE INTO `BB` VALUES (10,8,'0000-00-00','i','0000-00-00'),(11,0,'2005-08-18','','2005-08-18'); +SELECT table1 . `pk` AS field1 +FROM +(BB AS table1 INNER JOIN +(AA AS table2 STRAIGHT_JOIN A AS table3 +ON ( table3 . `date_key` = table2 . `pk` )) +ON ( table3 . `datetime_key` = table2 . `int_nokey` )) +WHERE ( table3 . `date_key` <= 4 AND table2 . `pk` = table1 . `varchar_nokey`) +GROUP BY field1 ; +field1 +SELECT table3 .`date_key` field1 +FROM +B table1 LEFT JOIN B table3 JOIN +(BB table6 JOIN A table7 ON table6 .`varchar_nokey`) +ON table6 .`int_nokey` ON table6 .`date_key` + WHERE NOT ( table1 .`varchar_key` AND table7 .`pk`) GROUP BY field1; +field1 +NULL +SELECT table4 . `time_nokey` AS field1 FROM +(AA AS table1 CROSS JOIN +(AA AS table2 STRAIGHT_JOIN +(B AS table3 STRAIGHT_JOIN A AS table4 +ON ( table4 . `date_key` = table3 . `time_key` )) +ON ( table4 . `pk` = table3 . `date_nokey` )) +ON ( table4 . `time_key` = table3 . `datetime_nokey` )) +WHERE ( table4 . `time_key` < table1 . `time_key` AND +table1 . `int_nokey` != 'f') +GROUP BY field1 ORDER BY field1 , field1; +field1 +SELECT table1 .`time_key` field2 FROM B table1 LEFT JOIN BB JOIN A table5 ON table5 .`date_nokey` ON table5 .`int_nokey` GROUP BY field2; +field2 +00:05:48 +15:13:38 +drop table A,AA,B,BB; +#end of test for bug#45266 +# +# Bug#33546: Slowdown on re-evaluation of constant expressions. +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (2); +SELECT * FROM t1 WHERE a = 1 + 1; +a +2 +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE a = 1 + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 10.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = ((1 + 1))) +SELECT * FROM t1 HAVING a = 1 + 1; +a +2 +EXPLAIN SELECT * FROM t1 HAVING a = 1 + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 100.00 NULL +Warnings: +Note 1003 /* select#1 */ 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 +EXPLAIN SELECT * FROM t1, t2 WHERE a = b + (1 + 1); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = (`test`.`t2`.`b` + ((1 + 1)))) +SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; +b a +2 3 +EXPLAIN SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t2` left join `test`.`t1` on((`test`.`t1`.`a` = (`test`.`t2`.`b` + 1))) where true +EXPLAIN SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 33.33 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 33.33 Using where +Warnings: +Note 1003 /* select#1 */ 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; +RETURN 1; +END;| +SET @cnt := 0; +SELECT * FROM t1 WHERE a = f1(); +a +1 +SELECT @cnt; +@cnt +1 +EXPLAIN SELECT * FROM t1 WHERE a = f1(); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 +# +# BUG#48052: Valgrind warning - uninitialized value in init_read_record() +# +# Disable Index condition pushdown +SELECT @old_optimizer_switch:=@@optimizer_switch; +@old_optimizer_switch:=@@optimizer_switch +# +Warnings: +# 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +CREATE TABLE t1 ( +pk int(11) NOT NULL, +i int(11) DEFAULT NULL, +v varchar(1) DEFAULT NULL, +PRIMARY KEY (pk) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (2,7,'m'); +INSERT INTO t1 VALUES (3,9,'m'); +SELECT v +FROM t1 +WHERE NOT pk > 0 +HAVING v <= 't' +ORDER BY pk; +v +# Restore old value for Index condition pushdown +SET SESSION optimizer_switch=@old_optimizer_switch; +DROP TABLE t1; +# +# Bug#49489 Uninitialized cache led to a wrong result. +# +CREATE TABLE t1(c1 DOUBLE(5,4)); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (9.1234); +SELECT * FROM t1 WHERE c1 < 9.12345; +c1 +9.1234 +DROP TABLE t1; +# End of test for bug#49489. +# +# Bug #49517: Inconsistent behavior while using +# NULLable BIGINT and INT columns in comparison +# +CREATE TABLE t1(a BIGINT UNSIGNED NOT NULL, b BIGINT NULL, c INT NULL); +INSERT INTO t1 VALUES(105, NULL, NULL); +SELECT * FROM t1 WHERE b < 102; +a b c +SELECT * FROM t1 WHERE c < 102; +a b c +SELECT * FROM t1 WHERE 102 < b; +a b c +SELECT * FROM t1 WHERE 102 < c; +a b c +DROP TABLE t1; +# +# Bug #54459: Assertion failed: param.sort_length, +# file .\filesort.cc, line 149 (part II) +# +CREATE TABLE t1(a ENUM('') NOT NULL) charset latin1; +INSERT INTO t1 VALUES (), (), (); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` order by `(t1.a collate latin1_german2_ci)` +SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug #58422: Incorrect result when OUTER JOIN'ing +# with an empty table +# +CREATE TABLE t_empty(pk INT PRIMARY KEY, i INT); +CREATE TABLE t1(pk INT PRIMARY KEY, i INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3); +CREATE TABLE t2(pk INT PRIMARY KEY, i INT) ; +INSERT INTO t2 VALUES (1,1), (2,2), (3,3); +ANALYZE TABLE t_empty, t1, t2; +Table Op Msg_type Msg_text +test.t_empty analyze status OK +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`pk` = `test`.`t1`.`pk`) and (`test`.`t1`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`pk` = `test`.`t1`.`pk`) and (`test`.`t1`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t2 NULL range PRIMARY PRIMARY 4 NULL 2 33.33 Using where; Using join buffer (hash join) +2 SIMPLE t1 NULL eq_ref PRIMARY PRIMARY 4 test.t2.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`i` = `test`.`t_empty`.`i`) and (`test`.`t1`.`pk` = `test`.`t2`.`pk`) and (`test`.`t2`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +DROP TABLE t1,t2,t_empty; +End of 5.1 tests +# +# Bug#45227: Lost HAVING clause led to a wrong result. +# +CREATE TABLE `cc` ( +`int_nokey` int(11) NOT NULL, +`int_key` int(11) NOT NULL, +`varchar_key` varchar(1) NOT NULL, +`varchar_nokey` varchar(1) NOT NULL, +KEY `int_key` (`int_key`), +KEY `varchar_key` (`varchar_key`) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `cc` VALUES +(0,8,'q','q'),(5,8,'m','m'),(7,3,'j','j'),(1,2,'z','z'),(8,2,'a','a'),(2,6,'',''),(1,8,'e' +,'e'),(8,9,'t','t'),(5,2,'q','q'),(4,6,'b','b'),(5,5,'w','w'),(3,2,'m','m'),(0,4,'x','x'), +(8,9,'',''),(0,6,'w','w'),(4,5,'x','x'),(0,0,'e','e'),(0,0,'e','e'),(2,8,'p','p'),(0,0,'x' +,'x'); +EXPLAIN SELECT `varchar_nokey` g1 FROM cc WHERE `int_nokey` AND `int_key` <= 4 +HAVING g1 ORDER BY `varchar_key` LIMIT 6 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 9 90.00 Parallel execute (1 workers) +2 SIMPLE cc NULL range int_key int_key 4 NULL 9 90.00 Using index condition; Using where; Using MRR; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`cc`.`varchar_nokey` AS `g1` from `test`.`cc` where ((0 <> `test`.`cc`.`int_nokey`) and (`test`.`cc`.`int_key` <= 4)) having (0 <> `g1`) order by `test`.`cc`.`varchar_key` limit 6 +SELECT `varchar_nokey` g1 FROM cc WHERE `int_nokey` AND `int_key` <= 4 +HAVING g1 ORDER BY `varchar_key` LIMIT 6 ; +g1 +Warning 1292 Truncated incorrect DOUBLE value: 'a' +Warning 1292 Truncated incorrect DOUBLE value: 'j' +Warning 1292 Truncated incorrect DOUBLE value: 'm' +Warning 1292 Truncated incorrect DOUBLE value: 'q' +Warning 1292 Truncated incorrect DOUBLE value: 'z' +Warnings: +DROP TABLE cc; +# End of test#45227 +# +# Bug#54515: Crash in opt_range.cc::get_best_group_min_max on +# SELECT from VIEW with GROUP BY +# +CREATE TABLE t1 ( +col_int_key int DEFAULT NULL, +KEY int_key (col_int_key) +) ; +INSERT INTO t1 VALUES (1),(2); +CREATE VIEW view_t1 AS +SELECT t1.col_int_key AS col_int_key +FROM t1; +SELECT col_int_key FROM view_t1 GROUP BY col_int_key; +col_int_key +1 +2 +DROP VIEW view_t1; +DROP TABLE t1; +# End of test BUG#54515 +# +# Bug #57203 Assertion `field_length <= 255' failed. +# +SELECT coalesce((avg(distinct (ST_geomfromtext("point(25379 -22010)"))))) +UNION ALL +SELECT coalesce((avg(distinct (ST_geomfromtext("point(25379 -22010)"))))) +AS foo +; +ERROR HY000: Incorrect arguments to avg +CREATE table t1(a text); +INSERT INTO t1 VALUES (''), (''); +SELECT avg(distinct(t1.a)) FROM t1, t1 t2 +GROUP BY t2.a ORDER BY t1.a; +avg(distinct(t1.a)) +0 +DROP TABLE t1; +# End of test BUG#57203 +# +# Bug#63020: Function "format"'s 'locale' argument is not considered +# when creating a "view' +# +CREATE TABLE t1 (f1 DECIMAL(10,2)); +INSERT INTO t1 VALUES (11.67),(17865.3),(12345678.92); +CREATE VIEW view_t1 AS SELECT FORMAT(f1,1,'sk_SK') AS f1 FROM t1; +SHOW CREATE VIEW view_t1; +View Create View character_set_client collation_connection +view_t1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_t1` AS select format(`t1`.`f1`,1,'sk_SK') AS `f1` from `t1` utf8mb4 utf8mb4_0900_ai_ci +SELECT * FROM view_t1; +f1 +11,7 +17 865,3 +12 345 678,9 +DROP TABLE t1; +DROP VIEW view_t1; +# End of test BUG#63020 +# +# Bug #13571700 TINYBLOB NOT NULL, CRASH IN PROTOCOL::NET_STORE_DATA +# +CREATE TABLE t1 (a TINYBLOB NOT NULL); +SELECT a, COUNT(*) FROM t1 WHERE 0; +a COUNT(*) +NULL 0 +DROP TABLE t1; +# End of test BUG#13571700 +# +# Bug #18766378: CRASH IN ITEM_SUM_BIT::RESET_FIELD +# +CREATE TABLE t1(b int); +CREATE TABLE t2(a int); +INSERT INTO t1 VALUES (),(); +INSERT INTO t2 VALUES (),(); +SELECT +( SELECT 1 FROM t1 GROUP BY a +HAVING avg(distinct 1) ORDER BY max(a) +) +FROM t1, t2 +GROUP BY a; +( SELECT 1 FROM t1 GROUP BY a +HAVING avg(distinct 1) ORDER BY max(a) +) +1 +DROP TABLE t1,t2; +# End of test BUG#18766378 +# +# WL#13002: RESULTSET DIFFERENT NUMBER OF ROWS +# +CREATE TABLE t1 ( +f1 INTEGER, +f2 INTEGER, +INDEX i1 (f2) +); +INSERT INTO t1 VALUES (NULL,1); +INSERT INTO t1 VALUES (2,NULL); +INSERT INTO t1 VALUES (3,1); +INSERT INTO t1 VALUES (4,6); +INSERT INTO t1 VALUES (NULL,5); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (13,1); +INSERT INTO t1 VALUES (NULL,0); +INSERT INTO t1 VALUES (5,2); +INSERT INTO t1 VALUES (NULL,8); +INSERT INTO t1 VALUES (NULL,7); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (NULL,4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN FORMAT=tree SELECT * +FROM t1 AS alias1 LEFT JOIN t1 AS alias2 ON alias1.f1 = alias2.f2 +WHERE alias2.f1 NOT BETWEEN 4 AND 12; +EXPLAIN +-> Parallel scan on + -> Nested loop inner join (cost=9.27 rows=19) + -> PQblock scan on alias1 (cost=1.65 rows=14) + -> Filter: (alias2.f1 not between 4 and 12) (cost=0.40 rows=1) + -> Index lookup on alias2 using i1 (f2=alias1.f1) (cost=0.40 rows=2) + +SELECT * +FROM t1 AS alias1 LEFT JOIN t1 AS alias2 ON alias1.f1 = alias2.f2 +WHERE alias2.f1 NOT BETWEEN 4 AND 12; +f1 f2 f1 f2 +DROP TABLE t1; +set optimizer_switch=default; diff --git a/mysql-test/r/select_icp_mrr_bka.result-pq b/mysql-test/r/select_icp_mrr_bka.result-pq new file mode 100644 index 000000000000..ee3b8a279b66 --- /dev/null +++ b/mysql-test/r/select_icp_mrr_bka.result-pq @@ -0,0 +1,5703 @@ +set optimizer_switch='batched_key_access=on,mrr_cost_based=off'; +set optimizer_switch='index_condition_pushdown=on,mrr=on,mrr_cost_based=off'; +drop table if exists t1,t2,t3,t4,t11; +drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; +drop view if exists v1; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +); +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +select * from t1; +Period Varor_period +9410 9412 +select t1.* from t1; +Period Varor_period +9410 9412 +CREATE TABLE t2 ( +auto int not null auto_increment, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL, +UNIQUE fld1 (fld1), +KEY fld3 (fld3), +PRIMARY KEY (auto) +) charset utf8mb4; +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +imaginable +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +cultivation +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3 from t2 order by fld3 desc limit 10; +fld3 +youthfulness +yelped +Wotan +workers +Witt +witchcraft +Winsett +Willy +willed +wildcats +select fld3 from t2 order by fld3 desc limit 5; +fld3 +youthfulness +yelped +Wotan +workers +Witt +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +witchcraft +Winsett +Willy +willed +wildcats +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'h%le'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; +fld3 +explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 0.09 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 0.09 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` IGNORE INDEX (`fld3`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 0.09 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 0.09 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld1`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld3`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld3`) USE INDEX (`fld1`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 ignore index (fld3,not_used); +ERROR 42000: Key 'not_used' doesn't exist in table 't2' +explain select fld3 from t2 use index (not_used); +ERROR 42000: Key 'not_used' doesn't exist in table 't2' +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +honeysuckle +honoring +explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range fld3 fld3 120 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where ((`test`.`t2`.`fld3` >= 'honeysuckle') and (`test`.`t2`.`fld3` <= 'honoring')) order by `test`.`t2`.`fld3` +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +fld1 fld3 +148504 Colombo +068305 Colombo +000000 nondecreasing +select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes'; +fld1 fld3 +232605 appendixes +1232605 appendixes +1232606 appendixes +1232607 appendixes +1232608 appendixes +1232609 appendixes +select fld1 from t2 where fld1=250501 or fld1="250502"; +fld1 +250501 +250502 +explain select fld1 from t2 where fld1=250501 or fld1="250502"; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL range fld1 fld1 4 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld1` AS `fld1` from `test`.`t2` where ((`test`.`t2`.`fld1` = 250501) or (`test`.`t2`.`fld1` = 250502)) +select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +fld1 +250501 +250502 +250505 +250601 +explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL range fld1 fld1 4 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld1` AS `fld1` from `test`.`t2` where ((`test`.`t2`.`fld1` = 250501) or (`test`.`t2`.`fld1` = 250502) or ((`test`.`t2`.`fld1` >= 250505) and (`test`.`t2`.`fld1` <= 250601)) or (`test`.`t2`.`fld1` between 250501 and 250502)) +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +fld1 fld3 +012001 flanking +013602 foldout +013606 fingerings +018007 fanatic +018017 featherweight +018054 fetters +018103 flint +018104 flopping +036002 funereal +038017 fetched +038205 firearm +058004 Fenton +088303 feminine +186002 freakish +188007 flurried +188505 fitting +198006 furthermore +202301 Fitzpatrick +208101 fiftieth +208113 freest +218008 finishers +218022 feed +218401 faithful +226205 foothill +226209 furnishings +228306 forthcoming +228311 fated +231315 freezes +232102 forgivably +238007 filial +238008 fixedly +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +fld3 +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +fld3 +Chantilly +select fld1,fld3 from t2 where fld1 like "25050%"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select fld1,fld3 from t2 where fld1 like "25050_"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select distinct companynr from t2; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr desc; +companynr +68 +65 +58 +53 +50 +41 +40 +37 +36 +34 +29 +00 +select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%" order by fld3; +fld3 period +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +select distinct fld3 from t2 where companynr = 34 order by fld3; +fld3 +absentee +accessed +ahead +alphabetic +Asiaticizations +attitude +aye +bankruptcies +belays +Blythe +bomb +boulevard +bulldozes +cannot +caressing +charcoal +checksumming +chess +clubroom +colorful +cosy +creator +crying +Darius +diffusing +duality +Eiffel +Epiphany +Ernestine +explorers +exterminated +famine +forked +Gershwins +heaving +Hodges +Iraqis +Italianization +Lagos +landslide +libretto +Majorca +mastering +narrowed +occurred +offerers +Palestine +Peruvianizes +pharmaceutic +poisoning +population +Pygmalion +rats +realest +recording +regimented +retransmitting +reviver +rouses +scars +sicker +sleepwalk +stopped +sugars +translatable +uncles +unexpected +uprisings +versatility +vest +select distinct fld3 from t2 limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct fld3 from t2 having fld3 like "A%" limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct substring(fld3,1,3) from t2 where fld3 like "A%"; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +Adl +adm +Ado +ads +adv +aer +aff +afi +afl +afo +agi +ahe +aim +air +Ald +alg +ali +all +alp +alr +ama +ame +amm +ana +and +ane +Ang +ani +Ann +Ant +api +app +aqu +Ara +arc +Arm +arr +Art +Asi +ask +asp +ass +ast +att +aud +Aug +aut +ave +avo +awe +aye +Azt +select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +create table t3 ( +period int not null, +name char(32) not null, +companynr int not null, +price double(11,0), +price2 double(11,0), +key (period), +key (name) +); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +create temporary table tmp select * from t3; +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +alter table t3 add t2nr int not null auto_increment primary key first; +drop table tmp; +SET BIG_TABLES=1; +select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10; +namn +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +SET BIG_TABLES=0; +select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10; +concat(fld3," ",fld3) +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +select distinct fld5 from t2 limit 10; +fld5 +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +select distinct companynr, fld3,count(*) from t2 group by companynr, fld3 order by companynr, fld3 limit 10; +companynr fld3 count(*) +00 affixed 1 +00 and 1 +00 annoyers 1 +00 Anthony 1 +00 assayed 1 +00 assurers 1 +00 attendants 1 +00 bedlam 1 +00 bedpost 1 +00 boasted 1 +SET BIG_TABLES=1; +select distinct companynr, fld3,count(*) from t2 group by companynr, fld3 order by companynr, fld3 limit 10; +companynr fld3 count(*) +00 affixed 1 +00 and 1 +00 annoyers 1 +00 Anthony 1 +00 assayed 1 +00 assurers 1 +00 attendants 1 +00 bedlam 1 +00 bedpost 1 +00 boasted 1 +SET BIG_TABLES=0; +select distinct companynr, fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr ,fld3 order by companynr, fld3 limit 100,10; +companynr fld3 repeat("a",length(fld3)) count(*) +29 chancellor aaaaaaaaaa 1 +29 Chippewa aaaaaaaa 1 +29 circumference aaaaaaaaaaaaa 1 +29 circus aaaaaa 1 +29 cited aaaaa 1 +29 Colombo aaaaaaa 1 +29 congresswoman aaaaaaaaaaaaa 1 +29 contrition aaaaaaaaaa 1 +29 corny aaaaa 1 +29 cultivation aaaaaaaaaaa 1 +select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2; +companynr rtrim(space(512+companynr)) +37 +78 +101 +154 +311 +447 +512 +select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; +fld3 +explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 10.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL fld1 NULL NULL NULL 1199 10.00 Using where; Using temporary; Using filesort +2 SIMPLE t3 NULL eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`t2nr` AS `t2nr`,`test`.`t2`.`fld3` AS `fld3` from `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld1` = `test`.`t3`.`t2nr`)) order by `test`.`t3`.`t2nr`,`test`.`t2`.`fld3` +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 41736 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL period NULL NULL NULL 41736 100.00 Using temporary; Using filesort +2 SIMPLE t3 NULL ref period period 4 test.t1.period 4173 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t3`.`period` = `test`.`t1`.`period`) order by `test`.`t3`.`period` +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 41736 100.00 Parallel execute (4 workers) +2 SIMPLE t3 NULL ALL period NULL NULL NULL 41736 100.00 Using temporary; Using filesort +2 SIMPLE t1 NULL ref period period 4 test.t3.period 4173 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t1`.`period` = `test`.`t3`.`period`) order by `test`.`t3`.`period` limit 10 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 41736 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL period NULL NULL NULL 41736 100.00 Using temporary; Using filesort +2 SIMPLE t3 NULL ref period period 4 test.t1.period 4173 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t3`.`period` = `test`.`t1`.`period`) order by `test`.`t1`.`period` limit 10 +select period from t1; +period +9410 +select period from t1 where period=1900; +period +select fld3,period from t1,t2 where fld1 = 011401 order by period; +fld3 period +breaking 9410 +select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001; +fld3 period +breaking 1001 +explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const fld1 fld1 4 const 1 100.00 NULL +1 SIMPLE t3 NULL const PRIMARY,period PRIMARY 4 const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select 'breaking' AS `fld3`,'1001' AS `period` from `test`.`t2` join `test`.`t3` where true +select fld3,period from t2,t1 where companynr*10 = 37*10 order by fld3; +fld3 period +abates 9410 +Abraham 9410 +abrogating 9410 +accessed 9410 +Aden 9410 +admiring 9410 +admonishing 9410 +Adolph 9410 +afield 9410 +afore 9410 +aging 9410 +airships 9410 +Aldrich 9410 +alike 9410 +Alison 9410 +allot 9410 +already 9410 +amenities 9410 +ammonium 9410 +analogy 9410 +analyzable 9410 +Anatole 9410 +animals 9410 +animized 9410 +annihilates 9410 +announced 9410 +announces 9410 +Antarctica 9410 +Antares 9410 +apiary 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +Arabia 9410 +arriving 9410 +Artemia 9410 +arteriole 9410 +assails 9410 +astound 9410 +attainments 9410 +attrition 9410 +audiology 9410 +Augustine 9410 +avenge 9410 +avoidable 9410 +babies 9410 +babysitting 9410 +Baird 9410 +balled 9410 +beaner 9410 +beaters 9410 +bee 9410 +Beebe 9410 +befouled 9410 +bellow 9410 +bestseller 9410 +betroth 9410 +bewilderingly 9410 +bills 9410 +bitterroot 9410 +bivalves 9410 +bloater 9410 +bloodbath 9410 +boat 9410 +boom 9410 +boorish 9410 +boulder 9410 +breaking 9410 +brunch 9410 +buckboards 9410 +burlesque 9410 +Butterfield 9410 +cage 9410 +capably 9410 +capped 9410 +cascade 9410 +Cassites 9410 +causality 9410 +cautioned 9410 +ceiling 9410 +celery 9410 +CERN 9410 +certificates 9410 +chafe 9410 +chaperone 9410 +charges 9410 +chasm 9410 +checkpoints 9410 +chewing 9410 +chews 9410 +Chicana 9410 +chillingly 9410 +Chippewa 9410 +chronicle 9410 +ciphers 9410 +civics 9410 +clamored 9410 +Clayton 9410 +clenched 9410 +clockers 9410 +coexist 9410 +cokes 9410 +combed 9410 +coming 9410 +commencements 9410 +commonplace 9410 +communicants 9410 +compartment 9410 +comprehensive 9410 +comprised 9410 +conceptions 9410 +concludes 9410 +congregates 9410 +Conley 9410 +Connally 9410 +contrary 9410 +contrasted 9410 +convenient 9410 +convulsion 9410 +corset 9410 +count 9410 +coverings 9410 +Crays 9410 +craziness 9410 +creak 9410 +creek 9410 +critiques 9410 +crunches 9410 +culled 9410 +cult 9410 +cupboard 9410 +cured 9410 +cute 9410 +daughter 9410 +decliner 9410 +decomposition 9410 +deductions 9410 +dehydrate 9410 +deludes 9410 +denizen 9410 +denotative 9410 +denounces 9410 +dental 9410 +dentally 9410 +descendants 9410 +despot 9410 +destroyer 9410 +detectably 9410 +dialysis 9410 +DiMaggio 9410 +dimensions 9410 +disable 9410 +discounts 9410 +disentangle 9410 +disobedience 9410 +dissociate 9410 +dogging 9410 +dopers 9410 +drains 9410 +dreaded 9410 +ducks 9410 +dusted 9410 +Dutchman 9410 +effortlessly 9410 +electroencephalography 9410 +elite 9410 +embassies 9410 +employing 9410 +encompass 9410 +encompasses 9410 +environing 9410 +epistle 9410 +equilibrium 9410 +erases 9410 +error 9410 +eschew 9410 +eternal 9410 +Eulerian 9410 +Evanston 9410 +evened 9410 +evenhandedly 9410 +eventful 9410 +Everhart 9410 +excises 9410 +exclamation 9410 +excrete 9410 +exhausts 9410 +expelled 9410 +extents 9410 +externally 9410 +extracted 9410 +faithful 9410 +fanatic 9410 +fated 9410 +featherweight 9410 +feed 9410 +feminine 9410 +Fenton 9410 +fetched 9410 +fetters 9410 +fiftieth 9410 +filial 9410 +fingerings 9410 +finishers 9410 +firearm 9410 +fitting 9410 +Fitzpatrick 9410 +fixedly 9410 +flanking 9410 +flint 9410 +flopping 9410 +flurried 9410 +foldout 9410 +foothill 9410 +forgivably 9410 +forthcoming 9410 +freakish 9410 +freest 9410 +freezes 9410 +funereal 9410 +furnishings 9410 +furthermore 9410 +gadfly 9410 +gainful 9410 +Galatean 9410 +galling 9410 +Gandhian 9410 +Ganymede 9410 +garage 9410 +gentleman 9410 +gifted 9410 +gleaning 9410 +glut 9410 +goblins 9410 +Goldstine 9410 +Gothicism 9410 +governing 9410 +gradually 9410 +Graves 9410 +grazing 9410 +Greenberg 9410 +gritty 9410 +groupings 9410 +guides 9410 +guitars 9410 +Gurkha 9410 +handgun 9410 +handy 9410 +Hawaii 9410 +Hegelian 9410 +heiress 9410 +hoarder 9410 +honoring 9410 +Hornblower 9410 +hostess 9410 +Huffman 9410 +humanness 9410 +humiliation 9410 +humility 9410 +Hunter 9410 +hushes 9410 +husky 9410 +hypothesizer 9410 +icon 9410 +ideas 9410 +impelling 9410 +impending 9410 +imperial 9410 +imperiously 9410 +imprint 9410 +impulsive 9410 +inaccuracy 9410 +inch 9410 +incidentals 9410 +incorrectly 9410 +incurring 9410 +index 9410 +indulge 9410 +indulgences 9410 +ineffective 9410 +infallibly 9410 +infest 9410 +inform 9410 +inmate 9410 +insolence 9410 +instruments 9410 +intelligibility 9410 +intentness 9410 +intercepted 9410 +interdependent 9410 +interrelationships 9410 +interrogate 9410 +investigations 9410 +irresponsibly 9410 +jarring 9410 +Joplin 9410 +journalizing 9410 +Judas 9410 +juveniles 9410 +Kane 9410 +kanji 9410 +Kantian 9410 +Kevin 9410 +kingdom 9410 +Kinsey 9410 +kiting 9410 +Kline 9410 +labeled 9410 +languages 9410 +Lars 9410 +laterally 9410 +Latinizes 9410 +lawgiver 9410 +leaflet 9410 +leavings 9410 +lectured 9410 +leftover 9410 +lewdly 9410 +lied 9410 +Lillian 9410 +linear 9410 +lists 9410 +lithograph 9410 +Lizzy 9410 +lore 9410 +luckily 9410 +Majorca 9410 +males 9410 +Manhattanize 9410 +marginal 9410 +mastering 9410 +mayoral 9410 +McGovern 9410 +meanwhile 9410 +measures 9410 +measures 9410 +mechanizing 9410 +medical 9410 +meditation 9410 +Melinda 9410 +Merritt 9410 +metaphysically 9410 +Micronesia 9410 +Miles 9410 +Miltonism 9410 +mineral 9410 +miniaturizes 9410 +minima 9410 +minion 9410 +minting 9410 +misted 9410 +misunderstander 9410 +mixture 9410 +motors 9410 +mournfulness 9410 +multilayer 9410 +mumbles 9410 +mushrooms 9410 +mystic 9410 +Nabisco 9410 +navies 9410 +navigate 9410 +Nazis 9410 +neat 9410 +neonatal 9410 +nested 9410 +Newtonian 9410 +noncritical 9410 +normalizes 9410 +Norwalk 9410 +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +Pandora 9410 +parametrized 9410 +parenthood 9410 +Parsifal 9410 +parters 9410 +participated 9410 +partridges 9410 +peacock 9410 +peeked 9410 +pellagra 9410 +percentage 9410 +percentage 9410 +persist 9410 +perturb 9410 +Peruvian 9410 +pessimist 9410 +pests 9410 +petted 9410 +pictures 9410 +pithed 9410 +pityingly 9410 +poison 9410 +posed 9410 +positioning 9410 +postulation 9410 +praised 9410 +precaution 9410 +precipitable 9410 +preclude 9410 +presentation 9410 +pressure 9410 +previewing 9410 +priceless 9410 +primary 9410 +psychic 9410 +publicly 9410 +puddings 9410 +Punjab 9410 +Pyle 9410 +quagmire 9410 +quitter 9410 +Quixotism 9410 +railway 9410 +raining 9410 +rains 9410 +ravines 9410 +readable 9410 +realized 9410 +realtor 9410 +reassigned 9410 +recruited 9410 +reduce 9410 +regimented 9410 +registration 9410 +relatively 9410 +relaxing 9410 +relishing 9410 +relives 9410 +renew 9410 +repelled 9410 +repetitions 9410 +reporters 9410 +reporters 9410 +repressions 9410 +resplendent 9410 +resumes 9410 +rifles 9410 +rightful 9410 +rightfully 9410 +rightfulness 9410 +ripeness 9410 +riser 9410 +Romano 9410 +Romans 9410 +roped 9410 +rudeness 9410 +rules 9410 +rural 9410 +rusting 9410 +Sabine 9410 +sadly 9410 +sags 9410 +sanding 9410 +saplings 9410 +sating 9410 +Sault 9410 +save 9410 +sawtooth 9410 +Saxony 9410 +scarf 9410 +scatterbrain 9410 +scheduling 9410 +schemer 9410 +scholastics 9410 +scornfully 9410 +secures 9410 +securing 9410 +Selfridge 9410 +seminaries 9410 +serializations 9410 +serpents 9410 +serving 9410 +severely 9410 +sews 9410 +Shanghais 9410 +shapelessly 9410 +shipyard 9410 +shooter 9410 +similarities 9410 +Simla 9410 +Simon 9410 +skulking 9410 +slaughter 9410 +sloping 9410 +smoothed 9410 +snatching 9410 +socializes 9410 +sophomore 9410 +sorters 9410 +spatial 9410 +specification 9410 +specifics 9410 +spongers 9410 +spools 9410 +sportswriting 9410 +sporty 9410 +squabbled 9410 +squeaking 9410 +squeezes 9410 +stabilizes 9410 +stairway 9410 +Stalin 9410 +standardizes 9410 +star 9410 +starlet 9410 +stated 9410 +Steinberg 9410 +stint 9410 +stodgy 9410 +store 9410 +straight 9410 +stranglings 9410 +subdirectory 9410 +subjective 9410 +subschema 9410 +succumbed 9410 +suites 9410 +sumac 9410 +sureties 9410 +swaying 9410 +sweetish 9410 +swelling 9410 +syndicate 9410 +Taoism 9410 +taxonomically 9410 +techniques 9410 +teem 9410 +teethe 9410 +tempering 9410 +Teresa 9410 +terminal 9410 +terminator 9410 +terminators 9410 +test 9410 +testicle 9410 +textures 9410 +theorizers 9410 +throttles 9410 +tidiness 9410 +timesharing 9410 +tinily 9410 +tinting 9410 +Tipperary 9410 +title 9410 +tragedies 9410 +traitor 9410 +trimmings 9410 +tropics 9410 +unaffected 9410 +uncovering 9410 +undoes 9410 +ungrateful 9410 +universals 9410 +unplug 9410 +unruly 9410 +untying 9410 +unwilling 9410 +vacuuming 9410 +validate 9410 +vanish 9410 +ventilate 9410 +veranda 9410 +vests 9410 +wallet 9410 +waltz 9410 +warm 9410 +warningly 9410 +watering 9410 +weasels 9410 +Weissmuller 9410 +western 9410 +whiteners 9410 +widens 9410 +Winsett 9410 +witchcraft 9410 +workers 9410 +Wotan 9410 +yelped 9410 +youthfulness 9410 +analyze table t2, t3; +Table Op Msg_type Msg_text +test.t2 analyze status OK +test.t3 analyze status OK +EXPLAIN select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 10.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL fld1 NULL NULL NULL 1199 10.00 Using where; Using temporary; Using filesort +2 SIMPLE t3 NULL eq_ref PRIMARY,period PRIMARY 4 test.t2.fld1 1 20.04 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`companynr` = 37) and (`test`.`t2`.`fld1` = `test`.`t3`.`t2nr`) and (`test`.`t3`.`period` >= 1001) and (`test`.`t3`.`period` <= 1002)) order by `test`.`t2`.`fld3`,`test`.`t3`.`period`,`test`.`t3`.`price` +select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +fld3 period price price2 +admonishing 1002 28357832 8723648 +analyzable 1002 28357832 8723648 +annihilates 1001 5987435 234724 +Antares 1002 28357832 8723648 +astound 1001 5987435 234724 +audiology 1001 5987435 234724 +Augustine 1002 28357832 8723648 +Baird 1002 28357832 8723648 +bewilderingly 1001 5987435 234724 +breaking 1001 5987435 234724 +Conley 1001 5987435 234724 +dentally 1002 28357832 8723648 +dissociate 1002 28357832 8723648 +elite 1001 5987435 234724 +eschew 1001 5987435 234724 +Eulerian 1001 5987435 234724 +flanking 1001 5987435 234724 +foldout 1002 28357832 8723648 +funereal 1002 28357832 8723648 +galling 1002 28357832 8723648 +Graves 1001 5987435 234724 +grazing 1001 5987435 234724 +groupings 1001 5987435 234724 +handgun 1001 5987435 234724 +humility 1002 28357832 8723648 +impulsive 1002 28357832 8723648 +inch 1001 5987435 234724 +intelligibility 1001 5987435 234724 +jarring 1001 5987435 234724 +lawgiver 1001 5987435 234724 +lectured 1002 28357832 8723648 +Merritt 1002 28357832 8723648 +neonatal 1001 5987435 234724 +offload 1002 28357832 8723648 +parters 1002 28357832 8723648 +pityingly 1002 28357832 8723648 +puddings 1002 28357832 8723648 +Punjab 1001 5987435 234724 +quitter 1002 28357832 8723648 +realtor 1001 5987435 234724 +relaxing 1001 5987435 234724 +repetitions 1001 5987435 234724 +resumes 1001 5987435 234724 +Romans 1002 28357832 8723648 +rusting 1001 5987435 234724 +scholastics 1001 5987435 234724 +skulking 1002 28357832 8723648 +stated 1002 28357832 8723648 +suites 1002 28357832 8723648 +sureties 1001 5987435 234724 +testicle 1002 28357832 8723648 +tinily 1002 28357832 8723648 +tragedies 1001 5987435 234724 +trimmings 1001 5987435 234724 +vacuuming 1001 5987435 234724 +ventilate 1001 5987435 234724 +wallet 1001 5987435 234724 +Weissmuller 1002 28357832 8723648 +Wotan 1002 28357832 8723648 +select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37; +fld1 fld3 period price price2 +018201 relaxing 1001 5987435 234724 +018601 vacuuming 1001 5987435 234724 +018801 inch 1001 5987435 234724 +018811 repetitions 1001 5987435 234724 +create table t4 ( +companynr tinyint(2) unsigned zerofill NOT NULL default '00', +companyname char(30) NOT NULL default '', +PRIMARY KEY (companynr), +UNIQUE KEY companyname(companyname) +) ENGINE=INNODB MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select * from t1,t1 t12; +Period Varor_period Period Varor_period +9410 9412 9410 9412 +select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505; +fld1 fld1 +250501 250501 +250501 250502 +250501 250503 +250501 250504 +250501 250505 +250502 250501 +250502 250502 +250502 250503 +250502 250504 +250502 250505 +250503 250501 +250503 250502 +250503 250503 +250503 250504 +250503 250505 +250504 250501 +250504 250502 +250504 250503 +250504 250504 +250504 250505 +250505 250501 +250505 250502 +250505 250503 +250505 250504 +250505 250505 +insert into t2 (fld1, companynr) values (999999,99); +ANALYZE TABLE t2, t4; +Table Op Msg_type Msg_text +test.t2 analyze status OK +test.t4 analyze status OK +select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +companynr companyname +99 NULL +select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null; +count(*) +1199 +explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1200 100.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1200 100.00 NULL +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 Using where; Not exists +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t2` left join `test`.`t4` on((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`)) where (`test`.`t4`.`companynr` is null) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1200 10.00 Using where; Not exists; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t2`.`companynr` is null) +select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +companynr companyname +select count(*) from t2 left join t4 using (companynr) where companynr is not null; +count(*) +1200 +explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t2` left join `test`.`t4` on(multiple equal(`test`.`t2`.`companynr`, `test`.`t4`.`companynr`)) where false +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on(multiple equal(`test`.`t4`.`companynr`, `test`.`t2`.`companynr`)) where false +delete from t2 where fld1=999999; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0) and (`test`.`t2`.`companynr` > 0)) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t4`.`companynr` > 0) and (`test`.`t4`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 40.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t2`.`companynr` > 0) or (`test`.`t2`.`companynr` is null)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index PRIMARY companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t2`.`companynr` > 0) or (`test`.`t4`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (ifnull(`test`.`t2`.`companynr`,1) > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t4`.`companynr` > 0) or (`test`.`t4`.`companynr` > 0)) +explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using where; Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (ifnull(`test`.`t4`.`companynr`,1) > 0) +select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +companynr companynr +37 36 +41 40 +explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index; Using temporary +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 10.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select distinct `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companynr` AS `companynr` from `test`.`t2` join `test`.`t4` where (`test`.`t2`.`companynr` = (`test`.`t4`.`companynr` + 1)) +select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909); +period +9410 +select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6))); +period +9410 +select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1; +fld1 +250501 +250502 +250503 +250505 +select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606); +fld1 +250502 +250503 +select fld1 from t2 where fld1 between 250502 and 250504; +fld1 +250502 +250503 +250504 +select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ; +fld3 +Lillian +label +labeled +labeled +landslide +laterally +leaflet +lewdly +luckily +select count(*) from t1; +count(*) +1 +select companynr,count(*),sum(fld1) from t2 group by companynr; +companynr count(*) sum(fld1) +00 82 10355753 +29 95 14473298 +34 70 17788966 +36 215 22786296 +37 588 83602098 +40 37 6618386 +41 52 12816335 +50 11 1595438 +53 4 793210 +58 23 2254293 +65 10 2284055 +68 12 3097288 +select companynr,count(*) from t2 group by companynr order by companynr desc limit 5; +companynr count(*) +68 12 +65 10 +58 23 +53 4 +50 11 +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +70 absentee vest 17788966 254128.0857 3272.5939722090234 10709871.306938833 +explain select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 9.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 order 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.97568479746 13352027981.708656 +29 95 abut wetness 14473298 152350.5053 8368.547956641249 70032594.90260443 +34 70 absentee vest 17788966 254128.0857 3272.5939722090234 10709871.306938833 +select +companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from +t3 where companynr = 37 group by companynr,t2nr order by companynr, t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select /*! SQL_SMALL_RESULT */ +companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from +t3 where companynr = 37 group by companynr,t2nr order by companynr, t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ; +companynr count(price) sum(price) min(price) max(price) avg(price) +101 4181 3489454238 834598 834598 834598.0000 +154 4181 4112197254950 983543950 983543950 983543950.0000 +311 4181 979599938 234298 234298 234298.0000 +37 12543 309394878010 5987435 39654943 24666736.6667 +447 4181 9929180954 2374834 2374834 2374834.0000 +512 4181 3288532102 786542 786542 786542.0000 +78 8362 414611089292 726498 98439034 49582766.0000 +select distinct mod(companynr,10) from t4 group by companynr; +mod(companynr,10) +0 +1 +3 +4 +5 +6 +7 +8 +9 +select distinct 1 from t4 group by companynr; +1 +1 +select count(distinct fld1) from t2; +count(distinct fld1) +1199 +select companynr,count(distinct fld1) from t2 group by companynr; +companynr count(distinct fld1) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(*) from t2 group by companynr; +companynr count(*) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,1000))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,200))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct floor(fld1/100)) from t2 group by companynr; +companynr count(distinct floor(fld1/100)) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr; +companynr count(distinct concat(repeat(65,1000),floor(fld1/100))) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10; +sum(fld1) fld3 +11402 Romans +select name,count(*) from t3 where name='cloakroom' group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name='cloakroom' and price>10 group by name; +name count(*) +cloakroom 4181 +select count(*) from t3 where name='cloakroom' and price2=823742; +count(*) +4181 +select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name; +name count(*) +extramarital 4181 +gazer 4181 +gems 4181 +Iranizes 4181 +spates 4181 +tucked 4181 +violinist 4181 +select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld3 count(*) +spates 4181 +select companynr|0,companyname from t4 group by 1; +companynr|0 companyname +0 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname; +companynr companyname count(*) +29 company 1 95 +68 company 10 12 +50 company 11 11 +34 company 2 70 +36 company 3 215 +37 company 4 588 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +00 Unknown 82 +select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld1 count(*) +158402 4181 +select sum(Period)/count(*) from t1; +sum(Period)/count(*) +9410.0000 +select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; +companynr count sum diff func +101 4181 3489454238 0.0000 422281 +154 4181 4112197254950 0.0000 643874 +311 4181 979599938 0.0000 1300291 +37 12543 309394878010 0.0000 464091 +447 4181 9929180954 0.0000 1868907 +512 4181 3288532102 0.0000 2140672 +78 8362 414611089292 0.0000 652236 +select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; +companynr avg +154 983543950.0000 +select companynr,count(*) from t2 group by companynr order by 2 desc; +companynr count(*) +37 588 +36 215 +29 95 +00 82 +34 70 +41 52 +40 37 +58 23 +68 12 +50 11 +65 10 +53 4 +select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc; +companynr count(*) +41 52 +58 23 +68 12 +50 11 +65 10 +53 4 +select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4; +fld4 fld1 count(price) sum(price) min(price) max(price) avg(price) +Abraham 018103 1 39654943 39654943 39654943 39654943.0000 +Anatole 038102 1 28357832 28357832 28357832 28357832.0000 +Beebe 018602 1 28357832 28357832 28357832 28357832.0000 +Chicana 038203 1 39654943 39654943 39654943 39654943.0000 +Conley 018101 1 5987435 5987435 5987435 5987435.0000 +Connally 018801 1 5987435 5987435 5987435 5987435.0000 +Graves 018052 1 28357832 28357832 28357832 28357832.0000 +Judas 018032 1 28357832 28357832 28357832 28357832.0000 +Kline 038101 1 5987435 5987435 5987435 5987435.0000 +Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000 +Merritt 016303 1 39654943 39654943 39654943 39654943.0000 +Parsifal 013802 1 28357832 28357832 28357832 28357832.0000 +Punjab 016302 1 28357832 28357832 28357832 28357832.0000 +Selfridge 019102 1 28357832 28357832 28357832 28357832.0000 +Simla 018402 1 28357832 28357832 28357832 28357832.0000 +Steinberg 012003 1 39654943 39654943 39654943 39654943.0000 +Taoism 018603 1 39654943 39654943 39654943 39654943.0000 +attainments 012303 1 39654943 39654943 39654943 39654943.0000 +audiology 011403 1 39654943 39654943 39654943 39654943.0000 +balled 012301 1 5987435 5987435 5987435 5987435.0000 +bee 038001 1 5987435 5987435 5987435 5987435.0000 +betroth 030501 1 5987435 5987435 5987435 5987435.0000 +bivalves 018013 1 39654943 39654943 39654943 39654943.0000 +bloodbath 018042 1 28357832 28357832 28357832 28357832.0000 +cage 018201 1 5987435 5987435 5987435 5987435.0000 +capably 012501 1 5987435 5987435 5987435 5987435.0000 +checkpoints 018803 1 39654943 39654943 39654943 39654943.0000 +coexist 018601 1 5987435 5987435 5987435 5987435.0000 +contrasted 016001 1 5987435 5987435 5987435 5987435.0000 +daughter 012703 1 39654943 39654943 39654943 39654943.0000 +dental 038003 1 39654943 39654943 39654943 39654943.0000 +dimensions 038202 1 28357832 28357832 28357832 28357832.0000 +disable 019103 1 39654943 39654943 39654943 39654943.0000 +dogging 018002 1 28357832 28357832 28357832 28357832.0000 +dreaded 011401 1 5987435 5987435 5987435 5987435.0000 +epistle 018062 1 28357832 28357832 28357832 28357832.0000 +erases 016301 1 5987435 5987435 5987435 5987435.0000 +eschew 011702 1 28357832 28357832 28357832 28357832.0000 +featherweight 012701 1 5987435 5987435 5987435 5987435.0000 +fetched 018802 1 28357832 28357832 28357832 28357832.0000 +fetters 018012 1 28357832 28357832 28357832 28357832.0000 +firearm 018812 1 28357832 28357832 28357832 28357832.0000 +flint 018022 1 28357832 28357832 28357832 28357832.0000 +flopping 018023 1 39654943 39654943 39654943 39654943.0000 +gritty 018811 1 5987435 5987435 5987435 5987435.0000 +hushes 018202 1 28357832 28357832 28357832 28357832.0000 +imprint 030503 1 39654943 39654943 39654943 39654943.0000 +impulsive 012602 1 28357832 28357832 28357832 28357832.0000 +interdependent 018051 1 5987435 5987435 5987435 5987435.0000 +interrelationships 036001 1 5987435 5987435 5987435 5987435.0000 +kanji 038002 1 28357832 28357832 28357832 28357832.0000 +lawgiver 013601 1 5987435 5987435 5987435 5987435.0000 +leavings 013803 1 39654943 39654943 39654943 39654943.0000 +lectured 018102 1 28357832 28357832 28357832 28357832.0000 +leftover 016201 1 5987435 5987435 5987435 5987435.0000 +medical 018041 1 5987435 5987435 5987435 5987435.0000 +minima 019101 1 5987435 5987435 5987435 5987435.0000 +neat 012001 1 5987435 5987435 5987435 5987435.0000 +neonatal 018053 1 39654943 39654943 39654943 39654943.0000 +normalizes 038013 1 39654943 39654943 39654943 39654943.0000 +parters 011701 1 5987435 5987435 5987435 5987435.0000 +partridges 038103 1 39654943 39654943 39654943 39654943.0000 +persist 012302 1 28357832 28357832 28357832 28357832.0000 +pessimist 012702 1 28357832 28357832 28357832 28357832.0000 +quitter 011703 1 39654943 39654943 39654943 39654943.0000 +railway 038011 1 5987435 5987435 5987435 5987435.0000 +readable 013603 1 39654943 39654943 39654943 39654943.0000 +recruited 038201 1 5987435 5987435 5987435 5987435.0000 +reporters 018403 1 39654943 39654943 39654943 39654943.0000 +riser 036002 1 28357832 28357832 28357832 28357832.0000 +scholastics 011402 1 28357832 28357832 28357832 28357832.0000 +scornfully 018003 1 39654943 39654943 39654943 39654943.0000 +skulking 018021 1 5987435 5987435 5987435 5987435.0000 +sorters 018061 1 5987435 5987435 5987435 5987435.0000 +squeaking 013901 1 5987435 5987435 5987435 5987435.0000 +starlet 012603 1 39654943 39654943 39654943 39654943.0000 +stated 013602 1 28357832 28357832 28357832 28357832.0000 +subschema 018043 1 39654943 39654943 39654943 39654943.0000 +sweetish 018001 1 5987435 5987435 5987435 5987435.0000 +swelling 031901 1 5987435 5987435 5987435 5987435.0000 +teethe 000001 1 5987435 5987435 5987435 5987435.0000 +testicle 013801 1 5987435 5987435 5987435 5987435.0000 +vacuuming 018033 1 39654943 39654943 39654943 39654943.0000 +validate 038012 1 28357832 28357832 28357832 28357832.0000 +wallet 011501 1 5987435 5987435 5987435 5987435.0000 +whiteners 016202 1 28357832 28357832 28357832 28357832.0000 +witchcraft 019201 1 5987435 5987435 5987435 5987435.0000 +select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3; +companynr fld3 sum(price) +512 Micronesia 786542 +512 Miles 786542 +512 boat 786542 +512 capably 786542 +512 cupboard 786542 +512 decliner 786542 +512 descendants 786542 +512 dopers 786542 +512 erases 786542 +512 skies 786542 +select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr; +companynr count(*) min(fld3) max(fld3) sum(price) avg(price) +00 1 Omaha Omaha 5987435 5987435.0000 +36 1 dubbed dubbed 28357832 28357832.0000 +37 83 Abraham Wotan 1908978016 22999735.1325 +50 2 scribbled tapestry 68012775 34006387.5000 +select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1; +t3.companynr+0 t2nr fld3 sum(price) +37 1 Omaha 5987435 +37 11401 breaking 5987435 +37 11402 Romans 28357832 +37 11403 intercepted 39654943 +37 11501 bewilderingly 5987435 +37 11701 astound 5987435 +37 11702 admonishing 28357832 +37 11703 sumac 39654943 +37 12001 flanking 5987435 +37 12003 combed 39654943 +37 12301 Eulerian 5987435 +37 12302 dubbed 28357832 +37 12303 Kane 39654943 +37 12501 annihilates 5987435 +37 12602 Wotan 28357832 +37 12603 snatching 39654943 +37 12701 grazing 5987435 +37 12702 Baird 28357832 +37 12703 celery 39654943 +37 13601 handgun 5987435 +37 13602 foldout 28357832 +37 13603 mystic 39654943 +37 13801 intelligibility 5987435 +37 13802 Augustine 28357832 +37 13803 teethe 39654943 +37 13901 scholastics 5987435 +37 16001 audiology 5987435 +37 16201 wallet 5987435 +37 16202 parters 28357832 +37 16301 eschew 5987435 +37 16302 quitter 28357832 +37 16303 neat 39654943 +37 18001 jarring 5987435 +37 18002 tinily 28357832 +37 18003 balled 39654943 +37 18012 impulsive 28357832 +37 18013 starlet 39654943 +37 18021 lawgiver 5987435 +37 18022 stated 28357832 +37 18023 readable 39654943 +37 18032 testicle 28357832 +37 18033 Parsifal 39654943 +37 18041 Punjab 5987435 +37 18042 Merritt 28357832 +37 18043 Quixotism 39654943 +37 18051 sureties 5987435 +37 18052 puddings 28357832 +37 18053 tapestry 39654943 +37 18061 trimmings 5987435 +37 18062 humility 28357832 +37 18101 tragedies 5987435 +37 18102 skulking 28357832 +37 18103 flint 39654943 +37 18201 relaxing 5987435 +37 18202 offload 28357832 +37 18402 suites 28357832 +37 18403 lists 39654943 +37 18601 vacuuming 5987435 +37 18602 dentally 28357832 +37 18603 humanness 39654943 +37 18801 inch 5987435 +37 18802 Weissmuller 28357832 +37 18803 irresponsibly 39654943 +37 18811 repetitions 5987435 +37 18812 Antares 28357832 +37 19101 ventilate 5987435 +37 19102 pityingly 28357832 +37 19103 interdependent 39654943 +37 19201 Graves 5987435 +37 30501 neonatal 5987435 +37 30502 scribbled 28357832 +37 30503 chafe 39654943 +37 31901 realtor 5987435 +37 36001 elite 5987435 +37 36002 funereal 28357832 +37 38001 Conley 5987435 +37 38002 lectured 28357832 +37 38003 Abraham 39654943 +37 38011 groupings 5987435 +37 38012 dissociate 28357832 +37 38013 coexist 39654943 +37 38101 rusting 5987435 +37 38102 galling 28357832 +37 38103 obliterates 39654943 +37 38201 resumes 5987435 +37 38202 analyzable 28357832 +37 38203 terminator 39654943 +select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008; +sum(price) +234298 +select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1; +fld1 sum(price) +038008 234298 +explain select fld3 from t2 where 1>2 or 2>3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where false +explain select fld3 from t2 where fld1=fld1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 100.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where true +select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000; +companynr count sum +00 82 10355753 +29 95 14473298 +34 70 17788966 +37 588 83602098 +41 52 12816335 +select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ; +companynr +00 +29 +34 +37 +41 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40; +companynr companyname count(*) +40 company 5 37 +41 company 6 52 +50 company 11 11 +53 company 7 4 +58 company 8 23 +65 company 9 10 +68 company 10 12 +select count(*) from t2; +count(*) +1199 +select count(*) from t2 where fld1 < 098024; +count(*) +387 +select min(fld1) from t2 where fld1>= 098024; +min(fld1) +98024 +select max(fld1) from t2 where fld1>= 098024; +max(fld1) +1232609 +select count(*) from t3 where price2=76234234; +count(*) +4181 +select count(*) from t3 where companynr=512 and price2=76234234; +count(*) +4181 +explain select min(fld1),max(fld1),count(*) from t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL index NULL fld1 4 NULL 1199 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t2`.`fld1`) AS `min(fld1)`,max(`test`.`t2`.`fld1`) AS `max(fld1)`,count(0) AS `count(*)` from `test`.`t2` +explain format=tree select min(fld1),max(fld1),count(*) from t2; +EXPLAIN +-> Count rows in t2 + +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +explain format=tree select min(fld1),max(fld1),count(*) from t2 where rand() > 0.5; +EXPLAIN +-> Aggregate: min(`min(fld1)`), max(`max(fld1)`), count(`count(*)`) + -> Parallel scan on + -> Aggregate: + -> Filter: (rand() > 0.5) (cost=123.65 rows=1199) + -> PQblock scan on t2 using fld1 (cost=123.65 rows=1199) + +select min(fld1),max(fld1),count(*) from t2; +min(fld1) max(fld1) count(*) +0 1232609 1199 +select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; +min(t2nr) max(t2nr) +2115 2115 +select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; +count(*) min(t2nr) max(t2nr) +4181 4 41804 +select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; +t2nr count(*) +9 1 +19 1 +29 1 +39 1 +49 1 +59 1 +69 1 +79 1 +89 1 +99 1 +109 1 +119 1 +129 1 +139 1 +149 1 +159 1 +169 1 +179 1 +189 1 +199 1 +select max(t2nr) from t3 where price=983543950; +max(t2nr) +41807 +select t1.period from t3 t1 limit 1; +period +1001 +select t1.period from t1 as t1 limit 1; +period +9410 +select t1.period as "Nuvarande period" from t1 as t1 limit 1; +Nuvarande period +9410 +select period as ok_period from t1 limit 1; +ok_period +9410 +select period as ok_period from t1 group by ok_period limit 1; +ok_period +9410 +select 1+1 as summa from t1 group by summa limit 1; +summa +2 +select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1; +Nuvarande period +9410 +show tables; +Tables_in_test +t1 +t2 +t3 +t4 +show tables from test like "s%"; +Tables_in_test (s%) +show tables from test like "t?"; +Tables_in_test (t?) +show full columns from t2; +Field Type Collation Null Key Default Extra Privileges Comment +auto int NULL NO PRI NULL auto_increment select,insert,update,references +fld1 int(6) unsigned zerofill NULL NO UNI 000000 select,insert,update,references +companynr tinyint(2) unsigned zerofill NULL NO 00 select,insert,update,references +fld3 char(30) utf8mb4_0900_ai_ci NO MUL select,insert,update,references +fld4 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld5 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld6 char(4) utf8mb4_0900_ai_ci NO select,insert,update,references +show full columns from t2 from test like 'f%'; +Field Type Collation Null Key Default Extra Privileges Comment +fld1 int(6) unsigned zerofill NULL NO UNI 000000 select,insert,update,references +fld3 char(30) utf8mb4_0900_ai_ci NO MUL select,insert,update,references +fld4 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld5 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld6 char(4) utf8mb4_0900_ai_ci NO select,insert,update,references +show full columns from t2 from test like 's%'; +Field Type Collation Null Key Default Extra Privileges Comment +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +show keys from t2; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Visible Expression +t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE YES NULL +t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE YES NULL +t2 1 fld3 1 fld3 A 1171 NULL NULL BTREE YES NULL +drop table t4, t3, t2, t1; +DO 1; +DO benchmark(100,1+1),1,1; +do default; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +do foobar; +ERROR 42S22: Unknown column 'foobar' in 'field list' +CREATE TABLE t1 ( +id mediumint(8) unsigned NOT NULL auto_increment, +pseudo varchar(35) NOT NULL default '', +PRIMARY KEY (id), +UNIQUE KEY pseudo (pseudo) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 (pseudo) VALUES ('test'); +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 1 as rnd1 from t1 where rand() > 2; +rnd1 +DROP TABLE t1; +CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1287 'BINARY as attribute of a type' is deprecated and will be removed in a future release. Please use a CHARACTER SET clause with _bin collation instead +INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); +CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +ERROR HY000: Incorrect DATETIME value: 'wrong-date-value' +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +DROP TABLE t1,t2; +create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); +select wss_type from t1 where wss_type ='102935229216544106'; +wss_type +select wss_type from t1 where wss_type ='102935229216544105'; +wss_type +select wss_type from t1 where wss_type ='102935229216544104'; +wss_type +select wss_type from t1 where wss_type ='102935229216544093'; +wss_type +102935229216544093 +select wss_type from t1 where wss_type =102935229216544093; +wss_type +102935229216544093 +drop table t1; +select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; +select @a; +@a +3 +select @b; +@b +aaaa +select @c; +@c +6.260 +create table t1 (a int not null auto_increment primary key); +insert into t1 values (); +insert into t1 values (); +insert into t1 values (); +select * from (t1 as t2 left join t1 as t3 using (a)), t1; +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from t1, (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); +a +1 +2 +3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +1 NULL +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); +a +1 +2 +3 +select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; +a +1 +2 +3 +select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +NULL 1 +select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); +a +1 +2 +3 +select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; +a +1 +2 +3 +select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; +a +1 +2 +3 +drop table t1; +CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); +CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); +select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; +aa id t2_id id +2 8299 2517 2517 +3 8301 2518 2518 +4 8302 2519 2519 +5 8303 2520 2520 +6 8304 2521 2521 +drop table t1,t2; +create table t1 (id1 int NOT NULL); +create table t2 (id2 int NOT NULL); +create table t3 (id3 int NOT NULL); +create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); +insert into t1 values (1); +insert into t1 values (2); +insert into t2 values (1); +insert into t4 values (1,1); +explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t4 NULL ALL id4 NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`id1` AS `id1`,`test`.`t2`.`id2` AS `id2`,`test`.`t3`.`id3` AS `id3`,`test`.`t4`.`id4` AS `id4`,`test`.`t4`.`id44` AS `id44` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`id2` = `test`.`t1`.`id1`)) left join `test`.`t3` on((`test`.`t3`.`id3` = `test`.`t1`.`id1`)) left join `test`.`t4` on((`test`.`t4`.`id4` = `test`.`t3`.`id3`)) where ((`test`.`t2`.`id2` = 1) or (`test`.`t4`.`id4` = 1)) +select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id1 id2 id3 id4 id44 +1 1 NULL NULL NULL +drop table t1,t2,t3,t4; +create table t1(s varchar(10) not null); +create table t2(s varchar(10) not null primary key); +create table t3(s varchar(10) not null primary key); +insert into t1 values ('one\t'), ('two\t'); +insert into t2 values ('one\r'), ('two\t'); +insert into t3 values ('one\b'), ('two\t'); +select * from t1 where s = 'one'; +s +select * from t2 where s = 'one'; +s +select * from t3 where s = 'one'; +s +one +select * from t1,t2 where t1.s = t2.s; +s s +two two +select * from t2,t3 where t2.s = t3.s; +s s +two two +drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +explain select * from t1 left join t2 on a=c where d in (4); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref c,d d 5 const 2 100.00 Using where +2 SIMPLE t1 NULL ref a a 5 test.t2.c 1 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ 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`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = 4)) +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref c,d d 5 const 2 100.00 Using where +2 SIMPLE t1 NULL ref a a 5 test.t2.c 1 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ 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`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = 4)) +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; +CREATE TABLE t1 ( +i int(11) NOT NULL default '0', +c char(10) NOT NULL default '', +PRIMARY KEY (i), +UNIQUE KEY c (c) +) ; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (1,'a'); +INSERT INTO t1 VALUES (2,'b'); +INSERT INTO t1 VALUES (3,'c'); +EXPLAIN SELECT i FROM t1 WHERE i=1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '1' AS `i` from `test`.`t1` where true +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref a a 23 test.t1.a 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` USE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref a a 23 test.t1.a 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` FORCE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +DROP TABLE t1, t2; +CREATE TABLE t1 ( city char(30) ) charset utf8mb4; +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`city` AS `city` from `test`.`t1` where (`test`.`t1`.`city` = 'London') +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`city` AS `city` from `test`.`t1` where ((`test`.`t1`.`city` = 'London') and (`test`.`t1`.`city` like '%london%')) +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,0), (1,1), (4294967295,1); +select a-b from t1 order by 1; +a-b +0 +1 +4294967294 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +4294967294 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +4294967294 +drop table t1; +create table t1 (a int(11)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +kunde_intern_id int(10) unsigned NOT NULL default '0', +kunde_id int(10) unsigned NOT NULL default '0', +FK_firma_id int(10) unsigned NOT NULL default '0', +aktuell enum('Ja','Nein') NOT NULL default 'Ja', +vorname varchar(128) NOT NULL default '', +nachname varchar(128) NOT NULL default '', +geloescht enum('Ja','Nein') NOT NULL default 'Nein', +firma varchar(128) NOT NULL default '' +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), +(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 +WHERE +( +( +( '' != '' AND firma LIKE CONCAT('%', '', '%')) +OR +(vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND +'Vorname1' != '' AND 'xxxx' != '') +) +AND +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, +geloescht FROM t1 +WHERE +( +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +AND +( +( '' != '' AND firma LIKE CONCAT('%', '', '%') ) +OR +( vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND +'xxxx' != '') +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT COUNT(*) FROM t1 WHERE +( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) +AND FK_firma_id = 2; +COUNT(*) +0 +drop table t1; +CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (0x8000000000000000); +SELECT b FROM t1 WHERE b=0x8000000000000000; +b +9223372036854775808 +DROP TABLE t1; +CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `t2` VALUES (0,'READ'); +CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `t3` VALUES (1,'fs'); +select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); +id name gid uid ident level +1 fs NULL NULL 0 READ +drop table t1,t2,t3; +CREATE TABLE t1 ( +acct_id int(11) NOT NULL default '0', +profile_id smallint(6) default NULL, +UNIQUE KEY t1$acct_id (acct_id), +KEY t1$profile_id (profile_id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (132,17),(133,18); +CREATE TABLE t2 ( +profile_id smallint(6) default NULL, +queue_id int(11) default NULL, +seq int(11) default NULL, +KEY t2$queue_id (queue_id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); +CREATE TABLE t3 ( +id int(11) NOT NULL default '0', +qtype int(11) default NULL, +seq int(11) default NULL, +warn_lvl int(11) default NULL, +crit_lvl int(11) default NULL, +rr1 tinyint(4) NOT NULL default '0', +rr2 int(11) default NULL, +default_queue tinyint(4) NOT NULL default '0', +KEY t3$qtype (qtype), +KEY t3$id (id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), +(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); +SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q +WHERE +(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND +(pq.queue_id = q.id) AND (q.rr1 <> 1); +COUNT(*) +4 +drop table t1,t2,t3; +create table t1 (f1 int); +insert into t1 values (1),(NULL); +create table t2 (f2 int, f3 int, f4 int); +create index idx1 on t2 (f4); +insert into t2 values (1,2,3),(2,4,6); +select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) +from t2 C where A.f4 = C.f4) or A.f3 IS NULL; +f2 +1 +NULL +drop table t1,t2; +create table t2 (a tinyint unsigned); +create index t2i on t2(a); +insert into t2 values (0), (254), (255); +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +explain select * from t2 where a > -1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index t2i t2i 2 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a` is not null) +select * from t2 where a > -1; +a +0 +254 +255 +drop table t2; +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +SELECT * FROM t1; +a b c +50 3 3 +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +select found_rows(); +found_rows() +0 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +SELECT * FROM t1; +a b c +50 3 3 +select count(*) from t1; +count(*) +1 +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +select count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; +count(*) +Warnings: +Warning 1287 SQL_CALC_FOUND_ROWS is deprecated and will be removed in a future release. Consider using two separate queries instead. +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +(SELECT a, b AS c FROM t1) ORDER BY c+1; +a c +(SELECT a, b AS c FROM t1) ORDER BY b+1; +a c +SELECT a, b AS c FROM t1 ORDER BY c+1; +a c +SELECT a, b AS c FROM t1 ORDER BY b+1; +a c +drop table t1; +create table t1(f1 int, f2 int); +create table t2(f3 int); +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); +f1 +insert into t1 values(1,1),(2,null); +insert into t2 values(2); +select * from t1,t2 where f1=f3 and (f1,f2) = (2,null); +f1 f2 f3 +select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null); +f1 f2 f3 +2 NULL 2 +drop table t1,t2; +create table t1 (f1 int not null auto_increment primary key, f2 varchar(10)); +create table t11 like t1; +insert into t1 values(1,""),(2,""); +analyze table t1, t11; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t11 analyze status OK +show table status like 't1%'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 InnoDB 10 Dynamic 2 8192 X X X X X X X X X NULL +t11 InnoDB 10 Dynamic 0 0 X X X X X X X X X NULL +select 123 as a from t1 where f1 is null; +a +drop table t1,t11; +CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); +INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); +CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, e INT ); +INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2),(1,2,3); +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 10 2 +1 11 2 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c; +a b c d +1 10 4 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c; +a b c d +1 10 2 +1 11 2 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2,t1 +WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 2 1 1 +1 2 2 1 +1 2 3 1 +DROP TABLE IF EXISTS t1, t2; +create table t1 (f1 int primary key, f2 int); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t1 values (1,1); +insert into t2 values (1,1),(1,2); +select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1; +count(f2) >0 +1 +drop table t1,t2; +create table t1 (f1 int,f2 int); +insert into t1 values(1,1); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t2 values(1,1); +select * from t1 where f1 in (select f3 from t2 where (f3,f4)= (select f3,f4 from t2)); +f1 f2 +1 1 +drop table t1,t2; +CREATE TABLE t1(a int, b int, c int, KEY b(b), KEY c(c)); +insert into t1 values (1,0,0),(2,0,0); +CREATE TABLE t2 (a int, b varchar(2), c varchar(2), PRIMARY KEY(a)); +insert into t2 values (1,'',''), (2,'',''); +CREATE TABLE t3 (a int, b int, PRIMARY KEY (a,b), KEY a (a), KEY b (b)); +insert into t3 values (1,1),(1,2); +explain select straight_join DISTINCT t2.a,t2.b, t1.c from t1, t3, t2 +where (t1.c=t2.a or (t1.c=t3.a and t2.a=t3.b)) and t1.b=556476786 and +t2.b like '%%' order by t2.b limit 0,1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ref b,c b 5 const 1 100.00 Using temporary; Using filesort +1 SIMPLE t3 NULL index PRIMARY,a,b a 4 NULL 2 100.00 Using index; Using join buffer (hash join) +1 SIMPLE t2 NULL ALL PRIMARY NULL NULL NULL 2 50.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select straight_join distinct `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t1`.`b` = 556476786) and ((`test`.`t2`.`a` = `test`.`t1`.`c`) or ((`test`.`t2`.`a` = `test`.`t3`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`c`))) and (`test`.`t2`.`b` like '%%')) order by `test`.`t2`.`b` limit 0,1 +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (a int, INDEX idx(a)); +INSERT INTO t1 VALUES (2), (3), (1); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 IGNORE INDEX (idx); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` IGNORE INDEX (`idx`) +EXPLAIN SELECT * FROM t1 IGNORE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +EXPLAIN SELECT * FROM t1 FORCE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +DROP TABLE t1; +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 VALUES (1,1), (2,1), (4,10); +CREATE TABLE t2 (a int PRIMARY KEY, b int, KEY b (b)); +INSERT INTO t2 VALUES (1,NULL), (2,10); +ALTER TABLE t1 ENABLE KEYS; +Warnings: +Note 1031 Table storage engine for 't1' doesn't have this option +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index b b 5 NULL 2 100.00 Using index +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select straight_join count(0) AS `COUNT(*)` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) or (`test`.`t2`.`b` is null)) +SELECT STRAIGHT_JOIN * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +a b a b +1 NULL 1 1 +1 NULL 2 1 +1 NULL 4 10 +2 10 4 10 +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index b b 5 NULL 2 100.00 Using index +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select straight_join count(0) AS `COUNT(*)` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) or (`test`.`t2`.`b` is null)) +SELECT STRAIGHT_JOIN * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +a b a b +1 NULL 1 1 +1 NULL 2 1 +1 NULL 4 10 +2 10 4 10 +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (key1 double default NULL, UNIQUE KEY key1 (key1)); +CREATE TABLE t2 (key2 double default NULL, UNIQUE KEY key2 (key2)); +INSERT INTO t1 VALUES (0.3762),(0.3845),(0.6158),(0.7941); +INSERT INTO t2 VALUES (1.3762),(1.3845),(1.6158),(1.7941); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +explain select max(key1) from t1 where key1 <= 0.6158; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)` from `test`.`t1` where (`test`.`t1`.`key1` <= 0.6158) +explain select max(key2) from t2 where key2 <= 1.6158; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t2`.`key2`) AS `max(key2)` from `test`.`t2` where (`test`.`t2`.`key2` <= 1.6158) +explain select min(key1) from t1 where key1 >= 0.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where (`test`.`t1`.`key1` >= 0.3762) +explain select min(key2) from t2 where key2 >= 1.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t2`.`key2`) AS `min(key2)` from `test`.`t2` where (`test`.`t2`.`key2` >= 1.3762) +explain select max(key1), min(key2) from t1, t2 +where key1 <= 0.6158 and key2 >= 1.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)`,min(`test`.`t2`.`key2`) AS `min(key2)` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`key1` <= 0.6158) and (`test`.`t2`.`key2` >= 1.3762)) +explain select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range key1 key1 9 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` <= 0.6158) and ((rand() + 0.5) >= 0.5)) +explain select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index key1 key1 9 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` >= 0.3762) and ((rand() + 0.5) >= 0.5)) +select max(key1) from t1 where key1 <= 0.6158; +max(key1) +0.6158 +select max(key2) from t2 where key2 <= 1.6158; +max(key2) +1.6158 +select min(key1) from t1 where key1 >= 0.3762; +min(key1) +0.3762 +select min(key2) from t2 where key2 >= 1.3762; +min(key2) +1.3762 +select max(key1), min(key2) from t1, t2 +where key1 <= 0.6158 and key2 >= 1.3762; +max(key1) min(key2) +0.6158 1.3762 +select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; +max(key1) +0.6158 +select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; +min(key1) +0.3762 +DROP TABLE t1,t2; +CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL); +INSERT INTO t1 VALUES (10); +SELECT i='1e+01',i=1e+01, i in (1e+01,1e+01), i in ('1e+01','1e+01') FROM t1; +i='1e+01' i=1e+01 i in (1e+01,1e+01) i in ('1e+01','1e+01') +1 1 1 1 +DROP TABLE t1; +create table t1(a bigint unsigned, b bigint); +insert ignore into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff), +(0x10000000000000000, 0x10000000000000000), +(0x8fffffffffffffff, 0x8fffffffffffffff); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'a' at row 2 +Warning 1264 Out of range value for column 'b' at row 2 +Warning 1264 Out of range value for column 'b' at row 3 +select hex(a), hex(b) from t1; +hex(a) hex(b) +FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +8FFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +drop table t1; +CREATE TABLE t1 (c0 int); +CREATE TABLE t2 (c0 int); +INSERT INTO t1 VALUES(@@connect_timeout); +INSERT INTO t2 VALUES(@@connect_timeout); +SELECT * FROM t1 JOIN t2 ON t1.c0 = t2.c0 WHERE (t1.c0 <=> @@connect_timeout); +c0 c0 +X X +DROP TABLE t1, t2; +End of 4.1 tests +CREATE TABLE t1 ( +K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', +K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', +F2I4 int(11) NOT NULL default '0' +) DEFAULT CHARSET=latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +('W%RT', '0100', 1), +('W-RT', '0100', 1), +('WART', '0100', 1), +('WART', '0200', 1), +('WERT', '0100', 2), +('WORT','0200', 2), +('WT', '0100', 2), +('W_RT', '0100', 2), +('WaRT', '0100', 3), +('WART', '0300', 3), +('WRT' , '0400', 3), +('WURM', '0500', 3), +('W%T', '0600', 4), +('WA%T', '0700', 4), +('WA_T', '0800', 4); +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND +(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); +K2C4 K4N4 F2I4 +WART 0200 1 +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); +K2C4 K4N4 F2I4 +WART 0100 1 +WART 0200 1 +WART 0300 3 +DROP TABLE t1; +create table t1 (a int, b int); +create table t2 like t1; +select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; +a +select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; +a +select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; +a a a +drop table t1,t2; +create table t1 (s1 varchar(5)); +insert into t1 values ('Wall'); +select min(s1) from t1 group by s1 with rollup; +min(s1) +Wall +Wall +drop table t1; +create table t1 (s1 int); +insert into t1 values (0); +select avg(distinct s1) from t1 group by s1 with rollup; +avg(distinct s1) +0.0000 +0.0000 +drop table t1; +create table t1 (s1 int); +insert into t1 values (null),(1); +select avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +1.0000 +select distinct avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +drop table t1; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +INSERT INTO t2 VALUES (2), (4), (6); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +a +2 +4 +EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 3 33.33 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` straight_join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`a`) +EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 20.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`) +DROP TABLE t1,t2; +select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; +x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 +16 16 2 2 +create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); +insert into t1 values (" 2", 2); +insert into t2 values (" 2", " one "),(" 2", " two "); +select * from t1 left join t2 on f1 = f3; +f1 f2 f3 f4 + 2 2 2 one + 2 2 2 two +drop table t1,t2; +create table t1 (empnum smallint, grp int); +create table t2 (empnum int, name char(5)); +insert into t1 values(1,1); +insert into t2 values(1,'bob'); +create view v1 as select * from t2 inner join t1 using (empnum); +select * from v1; +empnum name grp +1 bob 1 +drop table t1,t2; +drop view v1; +create table t1 (pk int primary key, b int); +create table t2 (pk int primary key, c int); +select pk from t1 inner join t2 using (pk); +pk +drop table t1,t2; +create table t1 (s1 int, s2 char(5), s3 decimal(10)); +create view v1 as select s1, s2, 'x' as s3 from t1; +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'x' +insert into t1 values (1,'x',5); +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'x' +drop table t1; +drop view v1; +create table t1(a1 int); +create table t2(a2 int); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +create view v2 (c) as select a1 from t1; +select * from t1 natural left join t2; +a1 a2 +1 1 +1 2 +2 1 +2 2 +select * from t1 natural right join t2; +a2 a1 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural left join t2; +c a2 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural right join t2; +a2 c +1 1 +1 2 +2 1 +2 2 +drop table t1, t2; +drop view v2; +create table t1 (a int(10), t1_val int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (b int(10), t2_val int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t3 (a int(10), b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,1),(2,2); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(2,1),(3,1),(4,1); +select * from t1 natural join t2 natural join t3; +a b t1_val t2_val +1 1 1 1 +2 1 2 1 +select * from t1 natural join t3 natural join t2; +b a t1_val t2_val +1 1 1 1 +1 2 2 1 +drop table t1, t2, t3; +DO IFNULL(NULL, NULL); +SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); +CAST(IFNULL(NULL, NULL) AS DECIMAL) +NULL +SELECT ABS(IFNULL(NULL, NULL)); +ABS(IFNULL(NULL, NULL)) +NULL +SELECT IFNULL(NULL, NULL); +IFNULL(NULL, NULL) +NULL +SET @OLD_SQL_MODE12595=@@SQL_MODE, @@SQL_MODE=''; +SHOW LOCAL VARIABLES LIKE 'SQL_MODE'; +Variable_name Value +sql_mode +CREATE TABLE BUG_12595(a varchar(100)) charset latin1; +INSERT INTO BUG_12595 VALUES ('hakan%'), ('hakank'), ("ha%an"); +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE ''; +a +hakan% +hakank +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE ''; +a +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha%%an' ESCAPE '%'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE '\\'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|'; +a +ha%an +SET @@SQL_MODE='NO_BACKSLASH_ESCAPES'; +SHOW LOCAL VARIABLES LIKE 'SQL_MODE'; +Variable_name Value +sql_mode NO_BACKSLASH_ESCAPES +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%'; +a +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE '\\'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE ''; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\n%' ESCAPE '\n'; +ERROR HY000: Incorrect arguments to ESCAPE +SET @@SQL_MODE=@OLD_SQL_MODE12595; +DROP TABLE BUG_12595; +create table t1 (a char(1)); +create table t2 (a char(1)); +insert into t1 values ('a'),('b'),('c'); +insert into t2 values ('b'),('c'),('d'); +select a from t1 natural join t2; +a +b +c +select * from t1 natural join t2 where a = 'b'; +a +b +drop table t1, t2; +CREATE TABLE t1 (`id` TINYINT); +CREATE TABLE t2 (`id` TINYINT); +CREATE TABLE t3 (`id` TINYINT); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +drop table t1, t2, t3; +create table t1 (a int(10),b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (a int(10),b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,10),(2,20),(3,30); +insert into t2 values (1,10); +select * from t1 inner join t2 using (A); +a b b +1 10 10 +select * from t1 inner join t2 using (a); +a b b +1 10 10 +drop table t1, t2; +create table t1 (a int, c int); +create table t2 (b int); +create table t3 (b int, a int); +create table t4 (c int); +insert into t1 values (1,1); +insert into t2 values (1); +insert into t3 values (1,1); +insert into t4 values (1); +select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +a c b b a +1 1 1 1 1 +select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +ERROR 42S22: Unknown column 't1.a' in 'on clause' +select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); +a c b b a c +1 1 1 1 1 1 +select * from t1 join t2 join t4 using (c); +c a b +1 1 1 +drop table t1, t2, t3, t4; +create table t1(x int, y int); +create table t2(x int, y int); +create table t3(x int, primary key(x)); +insert into t1 values (1, 1), (2, 1), (3, 1), (4, 3), (5, 6), (6, 6); +insert into t2 values (1, 1), (2, 1), (3, 3), (4, 6), (5, 6); +insert into t3 values (1), (2), (3), (4), (5); +select t1.x, t3.x from t1, t2, t3 where t1.x = t2.x and t3.x >= t1.y and t3.x <= t2.y; +x x +1 1 +2 1 +3 1 +3 2 +3 3 +4 3 +4 4 +4 5 +drop table t1,t2,t3; +create table t1 (id char(16) not null default '', primary key (id)); +insert into t1 values ('100'),('101'),('102'); +create table t2 (id char(16) default null); +insert into t2 values (1); +create view v1 as select t1.id from t1; +create view v2 as select t2.id from t2; +create view v3 as select (t1.id+2) as id from t1 natural left join t2; +select t1.id from t1 left join v2 using (id); +id +100 +101 +102 +select t1.id from v2 right join t1 using (id); +id +100 +101 +102 +select t1.id from t1 left join v3 using (id); +id +100 +101 +102 +select * from t1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join t1 using (id); +id +100 +101 +102 +select * from t1 left join v3 using (id); +id +100 +101 +102 +select v1.id from v1 left join v2 using (id); +id +100 +101 +102 +select v1.id from v2 right join v1 using (id); +id +100 +101 +102 +select v1.id from v1 left join v3 using (id); +id +100 +101 +102 +select * from v1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join v1 using (id); +id +100 +101 +102 +select * from v1 left join v3 using (id); +id +100 +101 +102 +drop table t1, t2; +drop view v1, v2, v3; +create table t1 (id int(11) not null default '0'); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (123),(191),(192); +create table t2 (id char(16) character set utf8 not null); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t2 values ('58013'),('58014'),('58015'),('58016'); +create table t3 (a_id int(11) not null, b_id char(16) character set utf8); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t3 values (123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013'); +select count(*) +from t1 inner join (t3 left join t2 on t2.id = t3.b_id) on t1.id = t3.a_id; +count(*) +6 +select count(*) +from t1 inner join (t2 right join t3 on t2.id = t3.b_id) on t1.id = t3.a_id; +count(*) +6 +drop table t1,t2,t3; +create table t1 (a int); +create table t2 (b int); +create table t3 (c int); +select * from t1 join t2 join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 left join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 right join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 straight_join t3 on (t1.a=t3.c); +a b c +drop table t1, t2 ,t3; +create table t1(f1 int, f2 date); +insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'), +(4,'2005-10-01'),(5,'2005-12-30'); +select * from t1 where f2 >= 0 order by f2; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +select * from t1 where f2 >= '0000-00-00' order by f2; +ERROR HY000: Incorrect DATE value: '0000-00-00' +select * from t1 where f2 >= '2005-09-31' order by f2; +ERROR HY000: Incorrect DATE value: '2005-09-31' +select * from t1 where f2 >= '2005-09-3a' order by f2; +f1 f2 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +select * from t1 where f2 <= '2005-09-31' order by f2; +ERROR HY000: Incorrect DATE value: '2005-09-31' +select * from t1 where f2 <= '2005-09-3a' order by f2; +f1 f2 +1 2005-01-01 +2 2005-09-01 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +drop table t1; +create table t1 (f1 int, f2 int); +insert into t1 values (1, 30), (2, 20), (3, 10); +create algorithm=merge view v1 as select f1, f2 from t1; +create algorithm=merge view v2 (f2, f1) as select f1, f2 from t1; +create algorithm=merge view v3 as select t1.f1 as f2, t1.f2 as f1 from t1; +select t1.f1 as x1, f1 from t1 order by t1.f1; +x1 f1 +1 1 +2 2 +3 3 +select v1.f1 as x1, f1 from v1 order by v1.f1; +x1 f1 +1 1 +2 2 +3 3 +select v2.f1 as x1, f1 from v2 order by v2.f1; +x1 f1 +10 10 +20 20 +30 30 +select v3.f1 as x1, f1 from v3 order by v3.f1; +x1 f1 +10 10 +20 20 +30 30 +select f1, f2, v1.f1 as x1 from v1 order by v1.f1; +f1 f2 x1 +1 30 1 +2 20 2 +3 10 3 +select f1, f2, v2.f1 as x1 from v2 order by v2.f1; +f1 f2 x1 +10 3 10 +20 2 20 +30 1 30 +select f1, f2, v3.f1 as x1 from v3 order by v3.f1; +f1 f2 x1 +10 3 10 +20 2 20 +30 1 30 +drop table t1; +drop view v1, v2, v3; +CREATE TABLE t1(key_a int4 NOT NULL, optimus varchar(32), PRIMARY KEY(key_a)); +CREATE TABLE t2(key_a int4 NOT NULL, prime varchar(32), PRIMARY KEY(key_a)); +CREATE table t3(key_a int4 NOT NULL, key_b int4 NOT NULL, foo varchar(32), +PRIMARY KEY(key_a,key_b)); +INSERT INTO t1 VALUES (0,''); +INSERT INTO t1 VALUES (1,'i'); +INSERT INTO t1 VALUES (2,'j'); +INSERT INTO t1 VALUES (3,'k'); +INSERT INTO t2 VALUES (1,'r'); +INSERT INTO t2 VALUES (2,'s'); +INSERT INTO t2 VALUES (3,'t'); +INSERT INTO t3 VALUES (1,5,'x'); +INSERT INTO t3 VALUES (1,6,'y'); +INSERT INTO t3 VALUES (2,5,'xx'); +INSERT INTO t3 VALUES (2,6,'yy'); +INSERT INTO t3 VALUES (2,7,'zz'); +INSERT INTO t3 VALUES (3,5,'xxx'); +SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +key_a foo +2 xx +EXPLAIN SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t3 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `key_a`,'xx' AS `foo` from `test`.`t1` join `test`.`t2` join `test`.`t3` where true +SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +key_a foo +2 xx +EXPLAIN SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t3 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `key_a`,'xx' AS `foo` from `test`.`t1` join `test`.`t2` join `test`.`t3` where true +DROP TABLE t1,t2,t3; +create table t1 (f1 int); +insert into t1 values(1),(2); +create table t2 (f2 int, f3 int, key(f2)); +insert into t2 values(1,1),(2,2); +create table t3 (f4 int not null); +insert into t3 values (2),(2),(2); +select f1,(select count(*) from t2,t3 where f2=f1 and f3=f4) as count from t1; +f1 count +1 0 +2 3 +drop table t1,t2,t3; +create table t1 (f1 int unique); +create table t2 (f2 int unique); +create table t3 (f3 int unique); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +insert into t3 values(1),(NULL); +select * from t3 where f3 is null; +f3 +NULL +select t2.f2 from t1 left join t2 on f1=f2 join t3 on f1=f3 where f1=1; +f2 +1 +drop table t1,t2,t3; +create table t1(f1 char, f2 char not null); +insert into t1 values(null,'a'); +create table t2 (f2 char not null); +insert into t2 values('b'); +select * from t1 left join t2 on f1=t2.f2 where t1.f2='a'; +f1 f2 f2 +NULL a NULL +drop table t1,t2; +select * from (select * left join t on f1=f2) tt; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left join t on f1=f2) tt' at line 1 +CREATE TABLE t1 (sku int PRIMARY KEY, pr int); +CREATE TABLE t2 (sku int PRIMARY KEY, sppr int, name varchar(255)); +INSERT INTO t1 VALUES +(10, 10), (20, 10), (30, 20), (40, 30), (50, 10), (60, 10); +INSERT INTO t2 VALUES +(10, 10, 'aaa'), (20, 10, 'bbb'), (30, 10, 'ccc'), (40, 20, 'ddd'), +(50, 10, 'eee'), (60, 20, 'fff'), (70, 20, 'ggg'), (80, 30, 'hhh'); +SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr +FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku); +sku sppr name sku pr +20 10 bbb 10 10 +20 10 bbb 20 10 +EXPLAIN +SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr +FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select '20' AS `sku`,'10' AS `sppr`,'bbb' AS `name`,`test`.`t1`.`sku` AS `sku`,`test`.`t1`.`pr` AS `pr` from `test`.`t2` join `test`.`t1` where (((`test`.`t1`.`sku` = 20) or (`test`.`t1`.`sku` = '10'))) +DROP TABLE t1,t2; +SET SQL_MODE='NO_UNSIGNED_SUBTRACTION'; +CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL); +INSERT t1 SET i = 0; +UPDATE t1 SET i = -1; +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +UPDATE t1 SET i = CAST(i - 1 AS SIGNED); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +UPDATE t1 SET i = i - 1; +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +DROP TABLE t1; +SET SQL_MODE=default; +create table t1 (a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t2 (a int, b int, c int, e int, primary key(a,b,c)); +# The "ANALYZE TABLE"-command that is executed further down will get +# different results depending on the order of rows in table t2. Since the +# INSERT INTO ... SELECT may be executed using different execution plans, +# we've added ORDER BY to ensure that we rows has the same order every +# time. If not, the estimated number of rows for t2 (alias 'a') in the +# EXPLAIN may change on different platforms. Note that both table t1 and +# t2 may be MYISAM, since many of the test files that includes this file +# forces MYISAM as the default storage engine. +insert into t2 select A.a, B.a, C.a, C.a from t1 A, t1 B, t1 C +ORDER BY A.a, B.a, C.a; +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select 'In next EXPLAIN, B.rows must be exactly 10:' Z; +Z +In next EXPLAIN, B.rows must be exactly 10: +explain select * from t2 a, t2 b where a.a=5 and a.b=5 and a.c<5 +and b.a=5 and b.b=a.e and (b.b =1 or b.b = 3 or b.b=5); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 27.10 Parallel execute (1 workers) +2 SIMPLE a NULL range PRIMARY PRIMARY 12 NULL 5 27.10 Using where +2 SIMPLE b NULL ref PRIMARY PRIMARY 8 const,test.a.e 10 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`b` AS `b`,`test`.`a`.`c` AS `c`,`test`.`a`.`e` AS `e`,`test`.`b`.`a` AS `a`,`test`.`b`.`b` AS `b`,`test`.`b`.`c` AS `c`,`test`.`b`.`e` AS `e` from `test`.`t2` `a` join `test`.`t2` `b` where ((`test`.`b`.`b` = `test`.`a`.`e`) and (`test`.`b`.`a` = 5) and (`test`.`a`.`b` = 5) and (`test`.`a`.`a` = 5) and (`test`.`a`.`c` < 5) and ((`test`.`a`.`e` = 1) or (`test`.`a`.`e` = 3) or (`test`.`a`.`e` = 5))) +drop table t1, t2; +CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX(b)); +INSERT INTO t1 VALUES (1, 3), (9,4), (7,5), (4,5), (6,2), +(3,1), (5,1), (8,9), (2,2), (0,9); +CREATE TABLE t2 (c int, d int, f int, INDEX(c,f)); +INSERT INTO t2 VALUES +(1,0,0), (1,0,1), (2,0,0), (2,0,1), (3,0,0), (4,0,1), +(5,0,0), (5,0,1), (6,0,0), (0,0,1), (7,0,0), (7,0,1), +(0,0,0), (0,0,1), (8,0,0), (8,0,1), (9,0,0), (9,0,1); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,b b 5 NULL 3 100.00 Using where; Using index +2 SIMPLE t2 NULL ref c c 5 test.t1.a 1 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2`.`f` AS `f` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` between 4 and 6)) +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6 AND a > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 90.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,b b 9 NULL 3 90.00 Using where; Using index +2 SIMPLE t2 NULL ref c c 5 test.t1.a 1 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2`.`f` AS `f` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` between 4 and 6) and (`test`.`t1`.`a` > 0)) +DROP TABLE t1, t2; +create table t1 ( +a int unsigned not null auto_increment primary key, +b bit not null, +c bit not null +); +create table t2 ( +a int unsigned not null auto_increment primary key, +b bit not null, +c int unsigned not null, +d varchar(50) +); +insert into t1 (b,c) values (0,1), (0,1); +insert into t2 (b,c) values (0,1); +select t1.a, t1.b + 0, t1.c + 0, t2.a, t2.b + 0, t2.c, t2.d +from t1 left outer join t2 on t1.a = t2.c and t2.b <> 1 +where t1.b <> 1 order by t1.a; +a t1.b + 0 t1.c + 0 a t2.b + 0 c d +1 0 1 1 0 1 NULL +2 0 1 NULL NULL NULL NULL +drop table t1,t2; +SELECT 0.9888889889 * 1.011111411911; +0.9888889889 * 1.011111411911 +0.9998769417899202067879 +prepare stmt from 'select 1 as " a "'; +Warnings: +Warning 1466 Leading spaces are removed from name ' a ' +execute stmt; +a +1 +CREATE TABLE t1 (a int NOT NULL PRIMARY KEY, b int NOT NULL); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +CREATE TABLE t2 (c int NOT NULL, INDEX idx(c)); +INSERT INTO t2 VALUES +(1), (1), (1), (1), (1), (1), (1), (1), +(2), (2), (2), (2), +(3), (3), +(4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL ref idx idx 4 const 8 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '1' AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = '1')) +EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=4; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL ref idx idx 4 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '4' AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = '4')) +DROP TABLE t1, t2; +CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a int); +INSERT INTO t1 VALUES (1,2), (2,NULL), (3,2); +CREATE TABLE t2 (b int, c INT, INDEX idx1(b)); +INSERT INTO t2 VALUES (2,1), (3,2); +CREATE TABLE t3 (d int, e int, INDEX idx1(d)); +INSERT INTO t3 VALUES (2,10), (2,20), (1,30), (2,40), (2,50); +EXPLAIN +SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id +WHERE t1.id=2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL const idx1 NULL NULL NULL 1 100.00 Impossible ON condition +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL const idx1 NULL NULL NULL 1 100.00 Impossible ON condition +2 SIMPLE t3 NULL ref idx1 idx1 5 const 4 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `id`,NULL AS `a`,NULL AS `b`,NULL AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t3`.`e` AS `e` from `test`.`t1` left join `test`.`t2` on(multiple equal(NULL, NULL)) join `test`.`t3` where (`test`.`t3`.`d` = 2) +SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id +WHERE t1.id=2; +id a b c d e +2 NULL NULL NULL 2 10 +2 NULL NULL NULL 2 20 +2 NULL NULL NULL 2 40 +2 NULL NULL NULL 2 50 +DROP TABLE t1,t2,t3; +create table t1 (c1 varchar(1), c2 int, c3 int, c4 int, c5 int, c6 int, +c7 int, c8 int, c9 int, fulltext key (`c1`)); +select distinct match (`c1`) against ('z') , c2, c3, c4,c5, c6,c7, c8 +from t1 where c9=1 order by c2, c2; +match (`c1`) against ('z') c2 c3 c4 c5 c6 c7 c8 +drop table t1; +CREATE TABLE t1 (pk varchar(10) PRIMARY KEY, fk varchar(16)) charset utf8mb4; +CREATE TABLE t2 (pk varchar(16) PRIMARY KEY, fk varchar(10)) charset utf8mb4; +INSERT INTO t1 VALUES +('d','dddd'), ('i','iii'), ('a','aa'), ('b','bb'), ('g','gg'), +('e','eee'), ('c','cccc'), ('h','hhh'), ('j','jjj'), ('f','fff'); +INSERT INTO t2 VALUES +('jjj', 'j'), ('cc','c'), ('ccc','c'), ('aaa', 'a'), ('jjjj','j'), +('hhh','h'), ('gg','g'), ('fff','f'), ('ee','e'), ('ffff','f'), +('bbb','b'), ('ff','f'), ('cccc','c'), ('dddd','d'), ('jj','j'), +('aaaa','a'), ('bb','b'), ('eeee','e'), ('aa','a'), ('hh','h'); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk < 'c' AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` < 'c')) +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk BETWEEN 'a' AND 'b' AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` between 'a' and 'b')) +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk IN ('a','b') AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` in ('a','b'))) +DROP TABLE t1,t2; +CREATE TABLE t1 (a int, b varchar(20) NOT NULL, PRIMARY KEY(a)) charset utf8mb4; +CREATE TABLE t2 (a int, b varchar(20) NOT NULL, +PRIMARY KEY (a), UNIQUE KEY (b)) charset utf8mb4; +INSERT INTO t1 VALUES (1,'a'),(2,'b'),(3,'c'); +INSERT INTO t2 VALUES (1,'a'),(2,'b'),(3,'c'); +EXPLAIN SELECT t1.a FROM t1 LEFT JOIN t2 ON t2.b=t1.b WHERE t1.a=3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL const b b 82 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '3' AS `a` from `test`.`t1` left join `test`.`t2` on(multiple equal('c', 'c')) where true +DROP TABLE t1,t2; +CREATE TABLE t1(id int PRIMARY KEY, b int, e int); +CREATE TABLE t2(i int, a int, INDEX si(i), INDEX ai(a)); +CREATE TABLE t3(a int PRIMARY KEY, c char(4), INDEX ci(c)); +INSERT INTO t1 VALUES +(1,10,19), (2,20,22), (4,41,42), (9,93,95), (7, 77,79), +(6,63,67), (5,55,58), (3,38,39), (8,81,89); +INSERT INTO t2 VALUES +(21,210), (41,410), (82,820), (83,830), (84,840), +(65,650), (51,510), (37,370), (94,940), (76,760), +(22,220), (33,330), (40,400), (95,950), (38,380), +(67,670), (88,880), (57,570), (96,960), (97,970); +INSERT INTO t3 VALUES +(210,'bb'), (950,'ii'), (400,'ab'), (500,'ee'), (220,'gg'), +(440,'gg'), (310,'eg'), (380,'ee'), (840,'bb'), (830,'ff'), +(230,'aa'), (960,'ii'), (410,'aa'), (510,'ee'), (290,'bb'), +(450,'gg'), (320,'dd'), (390,'hh'), (850,'jj'), (860,'ff'); +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 +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si si 5 NULL 4 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` FORCE INDEX (`si`) join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t2`.`i` between '81' and '89') and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2,t3 +WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee') ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si,ai si 5 NULL 4 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t2`.`i` between '81' and '89') and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND +t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si si 5 NULL 2 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` FORCE INDEX (`si`) join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((`test`.`t2`.`i` = '81') or (`test`.`t2`.`i` = '89')) and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2,t3 +WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND +t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si,ai si 5 NULL 2 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((`test`.`t2`.`i` = '81') or (`test`.`t2`.`i` = '89')) and (`test`.`t3`.`c` in ('bb','ee'))) +DROP TABLE t1,t2,t3; +CREATE TABLE t1 ( f1 int primary key, f2 int, f3 int, f4 int, f5 int, f6 int, checked_out int); +CREATE TABLE t2 ( f11 int PRIMARY KEY ); +INSERT INTO t1 VALUES (1,1,1,0,0,0,0),(2,1,1,3,8,1,0),(3,1,1,4,12,1,0); +INSERT INTO t2 VALUES (62); +SELECT * FROM t1 LEFT JOIN t2 ON f11 = t1.checked_out GROUP BY f1 ORDER BY f2, f3, f4, f5 LIMIT 0, 1; +f1 f2 f3 f4 f5 f6 checked_out f11 +1 1 1 0 0 0 0 NULL +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(a int); +INSERT into t1 values (1), (2), (3); +SELECT * FROM t1 LIMIT 2, -1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1 +DROP TABLE t1; +set optimizer_switch='index_merge=off'; +CREATE TABLE t1 ( +ID_with_null int NULL, +ID_better int NOT NULL, +INDEX idx1 (ID_with_null), +INDEX idx2 (ID_better) +); +INSERT INTO t1 VALUES (1,1), (2,1), (null,3), (null,3), (null,3), (null,3); +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SELECT COUNT(*) FROM t1 WHERE ID_with_null IS NULL; +COUNT(*) +128 +SELECT COUNT(*) FROM t1 WHERE ID_better=1; +COUNT(*) +2 +EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 98.46 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 98.46 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID_with_null` AS `ID_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID_with_null` is null)) +DROP INDEX idx1 ON t1; +CREATE UNIQUE INDEX idx1 ON t1(ID_with_null); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 98.46 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 98.46 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID_with_null` AS `ID_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID_with_null` is null)) +DROP TABLE t1; +CREATE TABLE t1 ( +ID1_with_null int NULL, +ID2_with_null int NULL, +ID_better int NOT NULL, +INDEX idx1 (ID1_with_null, ID2_with_null), +INDEX idx2 (ID_better) +) ; +INSERT INTO t1 VALUES (1,1,1), (2,2,1), (3,null,3), (null,3,3), (null,null,3), +(3,null,3), (null,3,3), (null,null,3), (3,null,3), (null,3,3), (null,null,3); +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null=3; +COUNT(*) +24 +SELECT COUNT(*) FROM t1 WHERE ID1_with_null=3 AND ID2_with_null IS NULL; +COUNT(*) +24 +SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null IS NULL; +COUNT(*) +192 +SELECT COUNT(*) FROM t1 WHERE ID_better=1; +COUNT(*) +2 +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID2_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID1_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and ((`test`.`t1`.`ID2_with_null` = 3) is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 79.34 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 79.34 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and (`test`.`t1`.`ID2_with_null` is null)) +DROP INDEX idx1 ON t1; +CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID2_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null IS NULL ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID1_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID2_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 79.34 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 79.34 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and (`test`.`t1`.`ID2_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND +(ID2_with_null=1 OR ID2_with_null=2); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 2.50 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 2.50 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and ((`test`.`t1`.`ID2_with_null` = 1) or (`test`.`t1`.`ID2_with_null` = 2))) +DROP TABLE t1; +set optimizer_switch='index_merge=on'; +CREATE TABLE t1 (a INT, ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY ts(ts)); +INSERT INTO t1 VALUES (30,"2006-01-03 23:00:00"), (31,"2006-01-03 23:00:00"); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CREATE TABLE t2 (a INT, dt1 DATETIME, dt2 DATETIME, PRIMARY KEY (a)); +INSERT INTO t2 VALUES (30, "2006-01-01 00:00:00", "2999-12-31 00:00:00"); +INSERT INTO t2 SELECT a+1,dt1,dt2 FROM t2; +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +EXPLAIN +SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 +AND t1.ts BETWEEN t2.dt1 AND t2.dt2 +AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t1 NULL range ts ts 4 NULL 2 50.00 Using index condition; Using where; Using MRR +Warnings: +Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`ts` AS `ts`,'30' AS `a`,'2006-01-01 00:00:00' AS `dt1`,'2999-12-31 00:00:00' AS `dt2` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = 30) and (`test`.`t1`.`ts` between '2006-01-01 00:00:00' and '2999-12-31 00:00:00') and (`test`.`t1`.`ts` between '2006-01-01' and '2006-12-31')) +SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 +AND t1.ts BETWEEN t2.dt1 AND t2.dt2 +AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; +a ts a dt1 dt2 +30 2006-01-03 23:00:00 30 2006-01-01 00:00:00 2999-12-31 00:00:00 +Warnings: +Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 +DROP TABLE t1,t2; +create table t1 (a bigint unsigned); +insert into t1 values +(if(1, 9223372036854775808, 1)), +(case when 1 then 9223372036854775808 else 1 end), +(coalesce(9223372036854775808, 1)); +select * from t1; +a +9223372036854775808 +9223372036854775808 +9223372036854775808 +drop table t1; +create table t1 charset utf8mb4 select +if(1, 9223372036854775808, 1) i, +case when 1 then 9223372036854775808 else 1 end c, +coalesce(9223372036854775808, 1) co; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` decimal(19,0) NOT NULL DEFAULT '0', + `c` decimal(19,0) NOT NULL DEFAULT '0', + `co` decimal(19,0) NOT NULL DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +select +if(1, cast(1111111111111111111 as unsigned), 1) i, +case when 1 then cast(1111111111111111111 as unsigned) else 1 end c, +coalesce(cast(1111111111111111111 as unsigned), 1) co; +i c co +1111111111111111111 1111111111111111111 1111111111111111111 +CREATE TABLE t1 (name varchar(255)) charset latin1; +CREATE TABLE t2 (name varchar(255), n int, KEY (name(3))) charset latin1; +INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); +INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); +INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); +INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT * FROM t2; +name n +bb 1 +aa 2 +cc 3 +cc  4 +cc 5 +bb 6 +cc 7 +SELECT * FROM t2 ORDER BY name; +name n +aa 2 +bb 1 +bb 6 +cc  4 +cc 3 +cc 5 +cc 7 +SELECT name, LENGTH(name), n FROM t2 ORDER BY name; +name LENGTH(name) n +aa 2 2 +bb 2 1 +bb 3 6 +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref name name 6 const 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` = 'cc ') +SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +name LENGTH(name) n +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +name LENGTH(name) n +cc 5 3 +cc  4 4 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') order by `test`.`t2`.`name` +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +name LENGTH(name) n +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +2 SIMPLE t2 NULL ref name name 6 test.t1.name 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`name` AS `name`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`n` AS `n` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`name` = `test`.`t1`.`name`)) where true +SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +name name n +aa aa 2 +aa aa 2 +bb bb 1 +bb bb 6 +cc cc 5 +cc cc 7 +cc cc 3 +ccc NULL NULL +DROP TABLE t1,t2; +CREATE TABLE t1 (name text) charset latin1; +CREATE TABLE t2 (name text, n int, KEY (name(3))) charset latin1; +INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); +INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); +INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); +INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT * FROM t2; +name n +bb 1 +aa 2 +cc 3 +cc  4 +cc 5 +bb 6 +cc 7 +SELECT * FROM t2 ORDER BY name; +name n +aa 2 +bb 1 +bb 6 +cc  4 +cc 3 +cc 5 +cc 7 +SELECT name, LENGTH(name), n FROM t2 ORDER BY name; +name LENGTH(name) n +aa 2 2 +bb 2 1 +bb 3 6 +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ref name name 6 const 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` = 'cc ') +SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +name LENGTH(name) n +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +name LENGTH(name) n +cc 5 3 +cc  4 4 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') order by `test`.`t2`.`name` +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +name LENGTH(name) n +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref name name 6 test.t1.name 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`name` AS `name`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`n` AS `n` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`name` = `test`.`t1`.`name`)) where true +SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +name name n +aa aa 2 +aa aa 2 +bb bb 1 +bb bb 6 +cc cc 5 +cc cc 7 +cc cc 3 +ccc NULL NULL +DROP TABLE t1,t2; +CREATE TABLE t1 ( +access_id int NOT NULL default '0', +name varchar(20) default NULL, +`rank` int NOT NULL default '0', +KEY idx (access_id) +); +CREATE TABLE t2 ( +faq_group_id int NOT NULL default '0', +faq_id int NOT NULL default '0', +access_id int default NULL, +UNIQUE KEY idx1 (faq_id), +KEY idx2 (faq_group_id,faq_id) +); +INSERT INTO t1 VALUES +(1,'Everyone',2),(2,'Help',3),(3,'Technical Support',1),(4,'Chat User',4); +INSERT INTO t2 VALUES +(261,265,1),(490,494,1); +SELECT t2.faq_id +FROM t1 INNER JOIN t2 IGNORE INDEX (idx1) +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +SELECT t2.faq_id +FROM t1 INNER JOIN t2 +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +DROP TABLE t1,t2; +CREATE TABLE t1 (a INT, b INT, KEY inx (b,a)); +INSERT INTO t1 VALUES (1,1), (1,2), (1,3), (1,4), (1,5), (1, 6), (1,7); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT COUNT(*) FROM t1 f1 INNER JOIN t1 f2 +ON ( f1.b=f2.b AND f1.a NULL ALL NULL NULL NULL NULL 7 100.00 Parallel execute (1 workers) +2 SIMPLE f1 NULL index inx inx 10 NULL 7 100.00 Using where; Using index +2 SIMPLE f2 NULL ref inx inx 5 test.f1.b 1 33.33 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` `f1` join `test`.`t1` `f2` where ((`test`.`f2`.`b` = `test`.`f1`.`b`) and (`test`.`f1`.`b` not in (100,2232,3343,51111)) and (`test`.`f1`.`a` < `test`.`f2`.`a`)) +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 INT); +INSERT INTO t1 VALUES (1,11), (2,22), (2,22); +EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2)))))))))))))))))))))))))))))) > 0; +EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) > 0; +ERROR HY000: Too high level of nesting for select +DROP TABLE t1; +CREATE TABLE t1 ( +c1 int(11) NOT NULL AUTO_INCREMENT, +c2 varchar(1000) DEFAULT NULL, +c3 bigint(20) DEFAULT NULL, +c4 bigint(20) DEFAULT NULL, +PRIMARY KEY (c1) +) charset utf8mb4; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN +SELECT join_2.c1 +FROM +t1 AS join_0, +t1 AS join_1, +t1 AS join_2, +t1 AS join_3, +t1 AS join_4, +t1 AS join_5, +t1 AS join_6, +t1 AS join_7 +WHERE +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +OR +join_0.c2 < '?' AND +join_1.c2 < '?' AND +join_2.c2 > '?' AND +join_2.c2 < '!' AND +join_3.c2 > '?' AND +join_4.c2 = '?' AND +join_5.c2 <> '?' AND +join_6.c2 <> '?' AND +join_7.c2 >= '?' AND +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +GROUP BY +join_3.c1, +join_2.c1, +join_7.c1, +join_1.c1, +join_0.c1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL # 1 100.00 # +2 SIMPLE join_0 NULL ALL PRIMARY NULL NULL # 1 100.00 # +2 SIMPLE join_1 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_2 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_3 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_4 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_5 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_6 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_7 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +Warnings: +Note 1003 /* select#1 */ select `test`.`join_2`.`c1` AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where (((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`)) or ((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c2` = '?') and (`test`.`join_0`.`c2` < '?') and (`test`.`join_1`.`c2` < '?') and (`test`.`join_2`.`c2` > '?') and (`test`.`join_2`.`c2` < '!') and (`test`.`join_3`.`c2` > '?') and (`test`.`join_5`.`c2` <> '?') and (`test`.`join_6`.`c2` <> '?') and (`test`.`join_7`.`c2` >= '?'))) group by `test`.`join_3`.`c1`,`test`.`join_2`.`c1`,`test`.`join_7`.`c1`,`test`.`join_1`.`c1`,`test`.`join_0`.`c1` +SHOW WARNINGS; +Level Code Message +Note 1003 /* select#1 */ select `test`.`join_2`.`c1` AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where (((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`)) or ((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c2` = '?') and (`test`.`join_0`.`c2` < '?') and (`test`.`join_1`.`c2` < '?') and (`test`.`join_2`.`c2` > '?') and (`test`.`join_2`.`c2` < '!') and (`test`.`join_3`.`c2` > '?') and (`test`.`join_5`.`c2` <> '?') and (`test`.`join_6`.`c2` <> '?') and (`test`.`join_7`.`c2` >= '?'))) group by `test`.`join_3`.`c1`,`test`.`join_2`.`c1`,`test`.`join_7`.`c1`,`test`.`join_1`.`c1`,`test`.`join_0`.`c1` +DROP TABLE t1; +SELECT 1 AS ` `; + +1 +Warnings: +Warning 1474 Name ' ' has become '' +SELECT 1 AS ` `; + +1 +Warnings: +Warning 1474 Name ' ' has become '' +SELECT 1 AS ` x`; +x +1 +Warnings: +Warning 1466 Leading spaces are removed from name ' x' +CREATE VIEW v1 AS SELECT 1 AS ``; +ERROR 42000: Incorrect column name '' +CREATE VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT (SELECT 1 AS ` `); +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` x`; +Warnings: +Warning 1466 Leading spaces are removed from name ' x' +SELECT `x` FROM v1; +x +1 +ALTER VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +DROP VIEW v1; +select str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' + and '2007/10/20 00:00:00 GMT'; +str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' + and '2007/10/20 00:00:00 GMT' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT' +Warning 1292 Truncated incorrect date value: '2007/10/20 00:00:00 GMT' +select str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6'; +str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT-6' +select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6'; +ERROR HY000: Incorrect DATE value: '2007/10/2000:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007-10-1 00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007-10-01 x00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:x00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 x12:34:56 GMT-6' +select str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; +str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6' +select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; +str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' +0 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6' +select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56'; +str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56' +1 +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00' +0 +select str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00' +1 +select str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34' +select str_to_date('2007-02-30 12:34','%Y-%m-%d %H:%i') = '2007-02-30 12:34:00'; +ERROR HY000: Incorrect DATETIME value: '2007-02-30 12:34:00' +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00' + and '2007/10/20 00:00:00'; +str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00' + and '2007/10/20 00:00:00' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +set SQL_MODE=TRADITIONAL; +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00 12:34' for function str_to_date +select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01' + and '2007/10/20'; +str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01' + and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +set SQL_MODE=DEFAULT; +select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'; +str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +select str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20'; +str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '' for function str_to_date +select str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '' for function str_to_date +select str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = ''; +ERROR HY000: Incorrect DATETIME value: '' +select str_to_date('1','%Y-%m-%d') = '1'; +ERROR HY000: Incorrect DATE value: '1' +select str_to_date('1','%Y-%m-%d') = '1'; +ERROR HY000: Incorrect DATE value: '1' +select str_to_date('','%Y-%m-%d') = ''; +ERROR HY000: Incorrect DATE value: '' +select str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL; +str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL +0 +Warnings: +Warning 1292 Truncated incorrect date value: '0000-00-00' +select str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00'; +str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00' +NULL +Warnings: +Warning 1292 Truncated incorrect date value: '2000-00-00' +select str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL; +str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL +0 +CREATE TABLE t1 (c11 INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY); +CREATE TABLE t2 (c21 INT UNSIGNED NOT NULL, +c22 INT DEFAULT NULL, +KEY(c21, c22)); +CREATE TABLE t3 (c31 INT UNSIGNED NOT NULL DEFAULT 0, +c32 INT DEFAULT NULL, +c33 INT NOT NULL, +c34 INT UNSIGNED DEFAULT 0, +KEY (c33, c34, c32)); +INSERT INTO t1 values (),(),(),(),(); +INSERT INTO t2 SELECT a.c11, b.c11 FROM t1 a, t1 b; +INSERT INTO t3 VALUES (1, 1, 1, 0), +(2, 2, 0, 0), +(3, 3, 1, 0), +(4, 4, 0, 0), +(5, 5, 1, 0); +SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND +t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND +t3.c33 = 1 AND t2.c22 in (1, 3) +ORDER BY c32; +c32 +1 +1 +3 +3 +5 +5 +SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND +t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND +t3.c33 = 1 AND t2.c22 in (1, 3) +ORDER BY c32 DESC; +c32 +5 +5 +3 +3 +1 +1 +DROP TABLE t1, t2, t3; + +# +# Bug#30736: Row Size Too Large Error Creating a Table and +# Inserting Data. +# +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; + +CREATE TABLE t1( +c1 DECIMAL(10, 2), +c2 FLOAT); + +INSERT INTO t1 VALUES (0, 1), (2, 3), (4, 5); + +CREATE TABLE t2( +c3 DECIMAL(10, 2)) +SELECT +c1 * c2 AS c3 +FROM t1; + +SELECT * FROM t1; +c1 c2 +0.00 1 +2.00 3 +4.00 5 + +SELECT * FROM t2; +c3 +0.00 +6.00 +20.00 + +DROP TABLE t1; +DROP TABLE t2; + +CREATE TABLE t1 (c1 BIGINT NOT NULL); +INSERT INTO t1 (c1) VALUES (1); +SELECT * FROM t1 WHERE c1 > NULL + 1; +c1 +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10) NOT NULL PRIMARY KEY); +INSERT INTO t1 (a) VALUES ('foo0'), ('bar0'), ('baz0'); +SELECT * FROM t1 WHERE a IN (CONCAT('foo', 0), 'bar'); +a +foo0 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +CREATE TABLE t2 (a INT, c INT, KEY(a)); +INSERT INTO t1 VALUES (1, 1), (2, 2); +INSERT INTO t2 VALUES (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), +(2, 1), (2, 2), (2, 3), (2, 4), (2, 5), +(3, 1), (3, 2), (3, 3), (3, 4), (3, 5), +(4, 1), (4, 2), (4, 3), (4, 4), (4, 5); +FLUSH STATUS; +SELECT DISTINCT b FROM t1 LEFT JOIN t2 USING(a) WHERE c <= 3; +b +1 +2 +SHOW STATUS LIKE 'Handler_read%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 13 +Handler_read_last 0 +Handler_read_next 10 +Handler_read_prev 0 +Handler_read_rnd 10 +Handler_read_rnd_next 6 +DROP TABLE t1, t2; +CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0', +f2 int(11) NOT NULL default '0', +f3 bigint(20) NOT NULL default '0', +f4 varchar(255) NOT NULL default '', +PRIMARY KEY (f1), +KEY key1 (f4), +KEY key2 (f2)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t2 (f1 int(11) NOT NULL default '0', +f2 enum('A1','A2','A3') NOT NULL default 'A1', +f3 int(11) NOT NULL default '0', +PRIMARY KEY (f1), +KEY key1 (f3)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0', +f2 datetime NOT NULL default '1980-01-01 00:00:00', +PRIMARY KEY (f1)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1, 1, 1, 'abc'); +insert into t1 values (2, 1, 2, 'def'); +insert into t1 values (3, 1, 2, 'def'); +insert into t2 values (1, 'A1', 1); +insert into t3 values (1, '1980-01-01'); +SELECT a.f3, cr.f4, count(*) count +FROM t2 a +STRAIGHT_JOIN t1 cr ON cr.f2 = a.f1 +LEFT JOIN +(t1 cr2 +JOIN t3 ae2 ON cr2.f3 = ae2.f1 +) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND +cr.f4 = cr2.f4 +GROUP BY a.f3, cr.f4; +f3 f4 count +1 abc 1 +1 def 2 +drop table t1, t2, t3; +CREATE TABLE t1 (a INT KEY, b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a, b FROM t1 WHERE a > 1 AND a = b LIMIT 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 25.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 3 25.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 SELECT a, b FROM t1 WHERE a > 1 AND b = a LIMIT 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 25.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 3 25.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` > 1)) limit 2 +DROP TABLE t1; +# +# Bug#47019: Assertion failed: 0, file .\rt_mbr.c, line 138 when +# forcing a spatial index +# +CREATE TABLE t1(a LINESTRING NOT NULL SRID 0, SPATIAL KEY(a)); +INSERT INTO t1 VALUES +(ST_GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')), +(ST_GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')); +EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t2 NULL ALL a NULL NULL NULL 2 100.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; +1 +1 +1 +1 +1 +EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t2 NULL ALL a NULL NULL NULL 2 100.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` FORCE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); +1 +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug #48291 : crash with row() operator,select into @var, and +# subquery returning multiple rows +# +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (2),(3); +# Should not crash +SELECT 1 FROM t1 WHERE a <> 1 AND NOT +ROW(1,a) <=> ROW(1,(SELECT 1 FROM t1)) +INTO @var0; +ERROR 21000: Subquery returns more than 1 row +DROP TABLE t1; +# +# Bug #48458: simple query tries to allocate enormous amount of +# memory +# +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1(a INT NOT NULL, b YEAR); +INSERT INTO t1 VALUES (); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +CREATE TABLE t2(c INT); +# Should not err out because of out-of-memory +SELECT 1 FROM t2 JOIN t1 ON 1=1 +WHERE a != '1' AND NOT a >= b OR NOT ROW(b,a )<> ROW(a,a); +1 +DROP TABLE t1,t2; +SET sql_mode = default; +# +# Bug #49199: Optimizer handles incorrectly: +# field='const1' AND field='const2' in some cases + +CREATE TABLE t1(a DATETIME NOT NULL); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 00:00:00 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +DROP TABLE t1; +CREATE TABLE t1(a DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2001-01-01') +DROP TABLE t1; +CREATE TABLE t1(a TIMESTAMP NOT NULL NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 00:00:00 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +a b +2001-01-01 00:00:00 2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = DATE'2001-01-01') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b VARCHAR(20) NOT NULL) charset utf8mb4; +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +a b +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = '2001-01-01 00:00:00') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01'; +a b +2001-01-01 00:00:00 2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = '2001-01-01') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT x.a, y.a, z.a FROM t1 x +JOIN t1 y ON x.a=y.a +JOIN t1 z ON y.a=z.a +WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; +a a a +2001-01-01 00:00:00 2001-01-01 00:00:00 2001-01-01 00:00:00 +EXPLAIN SELECT x.a, y.a, z.a FROM t1 x +JOIN t1 y ON x.a=y.a +JOIN t1 z ON y.a=z.a +WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE x NULL ALL NULL NULL NULL NULL 1 100.00 Using where +2 SIMPLE y NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +2 SIMPLE z NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`y`.`a` AS `a`,`test`.`z`.`a` AS `a` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` where ((`test`.`x`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (`test`.`y`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (`test`.`z`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +# +# Bug #49897: crash in ptr_compare when char(0) NOT NULL +# column is used for ORDER BY +# +SET @old_sort_buffer_size= @@session.sort_buffer_size; +SET @@sort_buffer_size= 40000; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1(a CHAR(0) NOT NULL); +INSERT INTO t1 VALUES (0), (0), (0); +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a FROM t1 ORDER BY a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24404 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24404 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `test`.`t1`.`a` +SELECT a FROM t1 ORDER BY a; +DROP TABLE t1; +CREATE TABLE t1(a CHAR(0) NOT NULL, b CHAR(0) NOT NULL, c int); +INSERT INTO t1 VALUES (0, 0, 0), (0, 0, 2), (0, 0, 1); +# Since ANALYZE TABLE only reads a subset of the data, the statistics for +# table t1 depends on the row order. And since the INSERT INTO ... SELECT +# may be executed using different execution plans, we've added ORDER BY +# to ensure that we rows has the same order every time. If not, the +# estimated number of rows in EXPLAIN may change on different platforms. +# Note that the tables may MYISAM, since many of the test files that +# includes this file forces MYISAM as the default storage engine. +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a FROM t1 ORDER BY a LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `test`.`t1`.`a` limit 5 +SELECT a FROM t1 ORDER BY a LIMIT 5; +a + + + + + +EXPLAIN SELECT * FROM t1 ORDER BY a, b LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b` limit 5 +SELECT * FROM t1 ORDER BY a, b LIMIT 5; +a b c + 2 + 2 + 2 + 2 + 2 +EXPLAIN SELECT * FROM t1 ORDER BY a, b, c LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b`,`test`.`t1`.`c` limit 5 +SELECT * FROM t1 ORDER BY a, b, c LIMIT 5; +a b c + 0 + 0 + 0 + 0 + 0 +EXPLAIN SELECT * FROM t1 ORDER BY c, a LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`c`,`test`.`t1`.`a` limit 5 +SELECT * FROM t1 ORDER BY c, a LIMIT 5; +a b c + 0 + 0 + 0 + 0 + 0 +SET @@sort_buffer_size= @old_sort_buffer_size; +DROP TABLE t1; +SET sql_mode = default; +End of 5.0 tests +create table t1(a INT, KEY (a)); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5); +SELECT a FROM t1 ORDER BY a LIMIT 2; +a +1 +2 +SELECT a FROM t1 ORDER BY a LIMIT 2,4294967296; +a +3 +4 +5 +SELECT a FROM t1 ORDER BY a LIMIT 2,4294967297; +a +3 +4 +5 +DROP TABLE t1; +CREATE TABLE A (date_key date); +CREATE TABLE C ( +pk int, +int_nokey int, +int_key int, +date_key date NOT NULL, +date_nokey date, +varchar_key varchar(1) +); +INSERT IGNORE INTO C VALUES +(1,1,1,'0000-00-00',NULL,NULL), +(1,1,1,'0000-00-00',NULL,NULL); +Warnings: +Warning 1264 Out of range value for column 'date_key' at row 1 +Warning 1264 Out of range value for column 'date_key' at row 2 +SELECT 1 FROM C WHERE pk > ANY (SELECT 1 FROM C); +1 +SELECT COUNT(DISTINCT 1) FROM C +WHERE date_key = (SELECT 1 FROM A WHERE C.date_key IS NULL) GROUP BY pk; +COUNT(DISTINCT 1) +SELECT date_nokey FROM C +WHERE int_key IN (SELECT 1 FROM A) +HAVING date_nokey = '10:41:7' +ORDER BY date_key; +ERROR HY000: Incorrect DATE value: '10:41:7' +DROP TABLE A,C; +CREATE TABLE t1 (a INT NOT NULL, b INT); +INSERT INTO t1 VALUES (1, 1); +EXPLAIN SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where true +SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2; +a b +1 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL); +EXPLAIN SELECT * FROM t1 WHERE (a=a AND b=b AND c=c) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +EXPLAIN SELECT * FROM t1 WHERE (a=a AND a=a AND b=b) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +EXPLAIN SELECT * FROM t1 WHERE (a=a AND b=b AND a=a) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +DROP TABLE t1; +# +# Bug#45266: Uninitialized variable lead to an empty result. +# +drop table if exists A,AA,B,BB; +CREATE TABLE `A` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`date_key` date NOT NULL, +`date_nokey` date NOT NULL, +`datetime_key` datetime NOT NULL, +`int_nokey` int(11) NOT NULL, +`time_key` time NOT NULL, +`time_nokey` time NOT NULL, +PRIMARY KEY (`pk`), +KEY `date_key` (`date_key`), +KEY `time_key` (`time_key`), +KEY `datetime_key` (`datetime_key`) +); +CREATE TABLE `AA` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`int_nokey` int(11) NOT NULL, +`time_key` time NOT NULL, +KEY `time_key` (`time_key`), +PRIMARY KEY (`pk`) +); +CREATE TABLE `B` ( +`date_nokey` date NOT NULL, +`date_key` date NOT NULL, +`time_key` time NOT NULL, +`datetime_nokey` datetime NOT NULL, +`varchar_key` varchar(1) NOT NULL, +KEY `date_key` (`date_key`), +KEY `time_key` (`time_key`), +KEY `varchar_key` (`varchar_key`) +); +INSERT IGNORE INTO `B` VALUES ('2003-07-28','2003-07-28','15:13:38','0000-00-00 00:00:00','f'),('0000-00-00','0000-00-00','00:05:48','2004-07-02 14:34:13','x'); +CREATE TABLE `BB` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`int_nokey` int(11) NOT NULL, +`date_key` date NOT NULL, +`varchar_nokey` varchar(1) NOT NULL, +`date_nokey` date NOT NULL, +PRIMARY KEY (`pk`), +KEY `date_key` (`date_key`) +); +INSERT IGNORE INTO `BB` VALUES (10,8,'0000-00-00','i','0000-00-00'),(11,0,'2005-08-18','','2005-08-18'); +SELECT table1 . `pk` AS field1 +FROM +(BB AS table1 INNER JOIN +(AA AS table2 STRAIGHT_JOIN A AS table3 +ON ( table3 . `date_key` = table2 . `pk` )) +ON ( table3 . `datetime_key` = table2 . `int_nokey` )) +WHERE ( table3 . `date_key` <= 4 AND table2 . `pk` = table1 . `varchar_nokey`) +GROUP BY field1 ; +field1 +SELECT table3 .`date_key` field1 +FROM +B table1 LEFT JOIN B table3 JOIN +(BB table6 JOIN A table7 ON table6 .`varchar_nokey`) +ON table6 .`int_nokey` ON table6 .`date_key` + WHERE NOT ( table1 .`varchar_key` AND table7 .`pk`) GROUP BY field1; +field1 +NULL +SELECT table4 . `time_nokey` AS field1 FROM +(AA AS table1 CROSS JOIN +(AA AS table2 STRAIGHT_JOIN +(B AS table3 STRAIGHT_JOIN A AS table4 +ON ( table4 . `date_key` = table3 . `time_key` )) +ON ( table4 . `pk` = table3 . `date_nokey` )) +ON ( table4 . `time_key` = table3 . `datetime_nokey` )) +WHERE ( table4 . `time_key` < table1 . `time_key` AND +table1 . `int_nokey` != 'f') +GROUP BY field1 ORDER BY field1 , field1; +field1 +SELECT table1 .`time_key` field2 FROM B table1 LEFT JOIN BB JOIN A table5 ON table5 .`date_nokey` ON table5 .`int_nokey` GROUP BY field2; +field2 +00:05:48 +15:13:38 +drop table A,AA,B,BB; +#end of test for bug#45266 +# +# Bug#33546: Slowdown on re-evaluation of constant expressions. +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (2); +SELECT * FROM t1 WHERE a = 1 + 1; +a +2 +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE a = 1 + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 10.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = ((1 + 1))) +SELECT * FROM t1 HAVING a = 1 + 1; +a +2 +EXPLAIN SELECT * FROM t1 HAVING a = 1 + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 100.00 NULL +Warnings: +Note 1003 /* select#1 */ 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 +EXPLAIN SELECT * FROM t1, t2 WHERE a = b + (1 + 1); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = (`test`.`t2`.`b` + ((1 + 1)))) +SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; +b a +2 3 +EXPLAIN SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t2` left join `test`.`t1` on((`test`.`t1`.`a` = (`test`.`t2`.`b` + 1))) where true +EXPLAIN SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 33.33 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 33.33 Using where +Warnings: +Note 1003 /* select#1 */ 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; +RETURN 1; +END;| +SET @cnt := 0; +SELECT * FROM t1 WHERE a = f1(); +a +1 +SELECT @cnt; +@cnt +1 +EXPLAIN SELECT * FROM t1 WHERE a = f1(); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 +# +# BUG#48052: Valgrind warning - uninitialized value in init_read_record() +# +# Disable Index condition pushdown +SELECT @old_optimizer_switch:=@@optimizer_switch; +@old_optimizer_switch:=@@optimizer_switch +# +Warnings: +# 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +CREATE TABLE t1 ( +pk int(11) NOT NULL, +i int(11) DEFAULT NULL, +v varchar(1) DEFAULT NULL, +PRIMARY KEY (pk) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (2,7,'m'); +INSERT INTO t1 VALUES (3,9,'m'); +SELECT v +FROM t1 +WHERE NOT pk > 0 +HAVING v <= 't' +ORDER BY pk; +v +# Restore old value for Index condition pushdown +SET SESSION optimizer_switch=@old_optimizer_switch; +DROP TABLE t1; +# +# Bug#49489 Uninitialized cache led to a wrong result. +# +CREATE TABLE t1(c1 DOUBLE(5,4)); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (9.1234); +SELECT * FROM t1 WHERE c1 < 9.12345; +c1 +9.1234 +DROP TABLE t1; +# End of test for bug#49489. +# +# Bug #49517: Inconsistent behavior while using +# NULLable BIGINT and INT columns in comparison +# +CREATE TABLE t1(a BIGINT UNSIGNED NOT NULL, b BIGINT NULL, c INT NULL); +INSERT INTO t1 VALUES(105, NULL, NULL); +SELECT * FROM t1 WHERE b < 102; +a b c +SELECT * FROM t1 WHERE c < 102; +a b c +SELECT * FROM t1 WHERE 102 < b; +a b c +SELECT * FROM t1 WHERE 102 < c; +a b c +DROP TABLE t1; +# +# Bug #54459: Assertion failed: param.sort_length, +# file .\filesort.cc, line 149 (part II) +# +CREATE TABLE t1(a ENUM('') NOT NULL) charset latin1; +INSERT INTO t1 VALUES (), (), (); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` order by `(t1.a collate latin1_german2_ci)` +SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug #58422: Incorrect result when OUTER JOIN'ing +# with an empty table +# +CREATE TABLE t_empty(pk INT PRIMARY KEY, i INT); +CREATE TABLE t1(pk INT PRIMARY KEY, i INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3); +CREATE TABLE t2(pk INT PRIMARY KEY, i INT) ; +INSERT INTO t2 VALUES (1,1), (2,2), (3,3); +ANALYZE TABLE t_empty, t1, t2; +Table Op Msg_type Msg_text +test.t_empty analyze status OK +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`pk` = `test`.`t1`.`pk`) and (`test`.`t1`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`pk` = `test`.`t1`.`pk`) and (`test`.`t1`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t2 NULL range PRIMARY PRIMARY 4 NULL 2 33.33 Using where; Using join buffer (hash join) +2 SIMPLE t1 NULL eq_ref PRIMARY PRIMARY 4 test.t2.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`i` = `test`.`t_empty`.`i`) and (`test`.`t1`.`pk` = `test`.`t2`.`pk`) and (`test`.`t2`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +DROP TABLE t1,t2,t_empty; +End of 5.1 tests +# +# Bug#45227: Lost HAVING clause led to a wrong result. +# +CREATE TABLE `cc` ( +`int_nokey` int(11) NOT NULL, +`int_key` int(11) NOT NULL, +`varchar_key` varchar(1) NOT NULL, +`varchar_nokey` varchar(1) NOT NULL, +KEY `int_key` (`int_key`), +KEY `varchar_key` (`varchar_key`) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `cc` VALUES +(0,8,'q','q'),(5,8,'m','m'),(7,3,'j','j'),(1,2,'z','z'),(8,2,'a','a'),(2,6,'',''),(1,8,'e' +,'e'),(8,9,'t','t'),(5,2,'q','q'),(4,6,'b','b'),(5,5,'w','w'),(3,2,'m','m'),(0,4,'x','x'), +(8,9,'',''),(0,6,'w','w'),(4,5,'x','x'),(0,0,'e','e'),(0,0,'e','e'),(2,8,'p','p'),(0,0,'x' +,'x'); +EXPLAIN SELECT `varchar_nokey` g1 FROM cc WHERE `int_nokey` AND `int_key` <= 4 +HAVING g1 ORDER BY `varchar_key` LIMIT 6 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 9 90.00 Parallel execute (1 workers) +2 SIMPLE cc NULL range int_key int_key 4 NULL 9 90.00 Using index condition; Using where; Using MRR; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`cc`.`varchar_nokey` AS `g1` from `test`.`cc` where ((0 <> `test`.`cc`.`int_nokey`) and (`test`.`cc`.`int_key` <= 4)) having (0 <> `g1`) order by `test`.`cc`.`varchar_key` limit 6 +SELECT `varchar_nokey` g1 FROM cc WHERE `int_nokey` AND `int_key` <= 4 +HAVING g1 ORDER BY `varchar_key` LIMIT 6 ; +g1 +Warning 1292 Truncated incorrect DOUBLE value: 'a' +Warning 1292 Truncated incorrect DOUBLE value: 'j' +Warning 1292 Truncated incorrect DOUBLE value: 'm' +Warning 1292 Truncated incorrect DOUBLE value: 'q' +Warning 1292 Truncated incorrect DOUBLE value: 'z' +Warnings: +DROP TABLE cc; +# End of test#45227 +# +# Bug#54515: Crash in opt_range.cc::get_best_group_min_max on +# SELECT from VIEW with GROUP BY +# +CREATE TABLE t1 ( +col_int_key int DEFAULT NULL, +KEY int_key (col_int_key) +) ; +INSERT INTO t1 VALUES (1),(2); +CREATE VIEW view_t1 AS +SELECT t1.col_int_key AS col_int_key +FROM t1; +SELECT col_int_key FROM view_t1 GROUP BY col_int_key; +col_int_key +1 +2 +DROP VIEW view_t1; +DROP TABLE t1; +# End of test BUG#54515 +# +# Bug #57203 Assertion `field_length <= 255' failed. +# +SELECT coalesce((avg(distinct (ST_geomfromtext("point(25379 -22010)"))))) +UNION ALL +SELECT coalesce((avg(distinct (ST_geomfromtext("point(25379 -22010)"))))) +AS foo +; +ERROR HY000: Incorrect arguments to avg +CREATE table t1(a text); +INSERT INTO t1 VALUES (''), (''); +SELECT avg(distinct(t1.a)) FROM t1, t1 t2 +GROUP BY t2.a ORDER BY t1.a; +avg(distinct(t1.a)) +0 +DROP TABLE t1; +# End of test BUG#57203 +# +# Bug#63020: Function "format"'s 'locale' argument is not considered +# when creating a "view' +# +CREATE TABLE t1 (f1 DECIMAL(10,2)); +INSERT INTO t1 VALUES (11.67),(17865.3),(12345678.92); +CREATE VIEW view_t1 AS SELECT FORMAT(f1,1,'sk_SK') AS f1 FROM t1; +SHOW CREATE VIEW view_t1; +View Create View character_set_client collation_connection +view_t1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_t1` AS select format(`t1`.`f1`,1,'sk_SK') AS `f1` from `t1` utf8mb4 utf8mb4_0900_ai_ci +SELECT * FROM view_t1; +f1 +11,7 +17 865,3 +12 345 678,9 +DROP TABLE t1; +DROP VIEW view_t1; +# End of test BUG#63020 +# +# Bug #13571700 TINYBLOB NOT NULL, CRASH IN PROTOCOL::NET_STORE_DATA +# +CREATE TABLE t1 (a TINYBLOB NOT NULL); +SELECT a, COUNT(*) FROM t1 WHERE 0; +a COUNT(*) +NULL 0 +DROP TABLE t1; +# End of test BUG#13571700 +# +# Bug #18766378: CRASH IN ITEM_SUM_BIT::RESET_FIELD +# +CREATE TABLE t1(b int); +CREATE TABLE t2(a int); +INSERT INTO t1 VALUES (),(); +INSERT INTO t2 VALUES (),(); +SELECT +( SELECT 1 FROM t1 GROUP BY a +HAVING avg(distinct 1) ORDER BY max(a) +) +FROM t1, t2 +GROUP BY a; +( SELECT 1 FROM t1 GROUP BY a +HAVING avg(distinct 1) ORDER BY max(a) +) +1 +DROP TABLE t1,t2; +# End of test BUG#18766378 +# +# WL#13002: RESULTSET DIFFERENT NUMBER OF ROWS +# +CREATE TABLE t1 ( +f1 INTEGER, +f2 INTEGER, +INDEX i1 (f2) +); +INSERT INTO t1 VALUES (NULL,1); +INSERT INTO t1 VALUES (2,NULL); +INSERT INTO t1 VALUES (3,1); +INSERT INTO t1 VALUES (4,6); +INSERT INTO t1 VALUES (NULL,5); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (13,1); +INSERT INTO t1 VALUES (NULL,0); +INSERT INTO t1 VALUES (5,2); +INSERT INTO t1 VALUES (NULL,8); +INSERT INTO t1 VALUES (NULL,7); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (NULL,4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN FORMAT=tree SELECT * +FROM t1 AS alias1 LEFT JOIN t1 AS alias2 ON alias1.f1 = alias2.f2 +WHERE alias2.f1 NOT BETWEEN 4 AND 12; +EXPLAIN +-> Parallel scan on + -> Batched key access inner join + -> Batch input rows + -> PQblock scan on alias1 (cost=1.65 rows=14) + -> Filter: (alias2.f1 not between 4 and 12) + -> Multi-range index lookup on alias2 using i1 (f2=alias1.f1) + +SELECT * +FROM t1 AS alias1 LEFT JOIN t1 AS alias2 ON alias1.f1 = alias2.f2 +WHERE alias2.f1 NOT BETWEEN 4 AND 12; +f1 f2 f1 f2 +DROP TABLE t1; +set optimizer_switch=default; +set optimizer_switch=default; diff --git a/mysql-test/r/select_icp_mrr_bka_nobnl.result-pq b/mysql-test/r/select_icp_mrr_bka_nobnl.result-pq new file mode 100644 index 000000000000..86d7a0e021bb --- /dev/null +++ b/mysql-test/r/select_icp_mrr_bka_nobnl.result-pq @@ -0,0 +1,5703 @@ +set optimizer_switch='batched_key_access=on,block_nested_loop=off,mrr_cost_based=off'; +set optimizer_switch='index_condition_pushdown=on,mrr=on,mrr_cost_based=off'; +drop table if exists t1,t2,t3,t4,t11; +drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; +drop view if exists v1; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +); +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +select * from t1; +Period Varor_period +9410 9412 +select t1.* from t1; +Period Varor_period +9410 9412 +CREATE TABLE t2 ( +auto int not null auto_increment, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL, +UNIQUE fld1 (fld1), +KEY fld3 (fld3), +PRIMARY KEY (auto) +) charset utf8mb4; +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +imaginable +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +cultivation +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3 from t2 order by fld3 desc limit 10; +fld3 +youthfulness +yelped +Wotan +workers +Witt +witchcraft +Winsett +Willy +willed +wildcats +select fld3 from t2 order by fld3 desc limit 5; +fld3 +youthfulness +yelped +Wotan +workers +Witt +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +witchcraft +Winsett +Willy +willed +wildcats +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'h%le'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; +fld3 +explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 0.09 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 0.09 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` IGNORE INDEX (`fld3`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 0.09 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 0.09 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld1`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld3`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld3`) USE INDEX (`fld1`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 ignore index (fld3,not_used); +ERROR 42000: Key 'not_used' doesn't exist in table 't2' +explain select fld3 from t2 use index (not_used); +ERROR 42000: Key 'not_used' doesn't exist in table 't2' +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +honeysuckle +honoring +explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range fld3 fld3 120 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where ((`test`.`t2`.`fld3` >= 'honeysuckle') and (`test`.`t2`.`fld3` <= 'honoring')) order by `test`.`t2`.`fld3` +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +fld1 fld3 +148504 Colombo +068305 Colombo +000000 nondecreasing +select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes'; +fld1 fld3 +232605 appendixes +1232605 appendixes +1232606 appendixes +1232607 appendixes +1232608 appendixes +1232609 appendixes +select fld1 from t2 where fld1=250501 or fld1="250502"; +fld1 +250501 +250502 +explain select fld1 from t2 where fld1=250501 or fld1="250502"; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL range fld1 fld1 4 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld1` AS `fld1` from `test`.`t2` where ((`test`.`t2`.`fld1` = 250501) or (`test`.`t2`.`fld1` = 250502)) +select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +fld1 +250501 +250502 +250505 +250601 +explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL range fld1 fld1 4 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld1` AS `fld1` from `test`.`t2` where ((`test`.`t2`.`fld1` = 250501) or (`test`.`t2`.`fld1` = 250502) or ((`test`.`t2`.`fld1` >= 250505) and (`test`.`t2`.`fld1` <= 250601)) or (`test`.`t2`.`fld1` between 250501 and 250502)) +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +fld1 fld3 +012001 flanking +013602 foldout +013606 fingerings +018007 fanatic +018017 featherweight +018054 fetters +018103 flint +018104 flopping +036002 funereal +038017 fetched +038205 firearm +058004 Fenton +088303 feminine +186002 freakish +188007 flurried +188505 fitting +198006 furthermore +202301 Fitzpatrick +208101 fiftieth +208113 freest +218008 finishers +218022 feed +218401 faithful +226205 foothill +226209 furnishings +228306 forthcoming +228311 fated +231315 freezes +232102 forgivably +238007 filial +238008 fixedly +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +fld3 +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +fld3 +Chantilly +select fld1,fld3 from t2 where fld1 like "25050%"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select fld1,fld3 from t2 where fld1 like "25050_"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select distinct companynr from t2; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr desc; +companynr +68 +65 +58 +53 +50 +41 +40 +37 +36 +34 +29 +00 +select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%" order by fld3; +fld3 period +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +select distinct fld3 from t2 where companynr = 34 order by fld3; +fld3 +absentee +accessed +ahead +alphabetic +Asiaticizations +attitude +aye +bankruptcies +belays +Blythe +bomb +boulevard +bulldozes +cannot +caressing +charcoal +checksumming +chess +clubroom +colorful +cosy +creator +crying +Darius +diffusing +duality +Eiffel +Epiphany +Ernestine +explorers +exterminated +famine +forked +Gershwins +heaving +Hodges +Iraqis +Italianization +Lagos +landslide +libretto +Majorca +mastering +narrowed +occurred +offerers +Palestine +Peruvianizes +pharmaceutic +poisoning +population +Pygmalion +rats +realest +recording +regimented +retransmitting +reviver +rouses +scars +sicker +sleepwalk +stopped +sugars +translatable +uncles +unexpected +uprisings +versatility +vest +select distinct fld3 from t2 limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct fld3 from t2 having fld3 like "A%" limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct substring(fld3,1,3) from t2 where fld3 like "A%"; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +Adl +adm +Ado +ads +adv +aer +aff +afi +afl +afo +agi +ahe +aim +air +Ald +alg +ali +all +alp +alr +ama +ame +amm +ana +and +ane +Ang +ani +Ann +Ant +api +app +aqu +Ara +arc +Arm +arr +Art +Asi +ask +asp +ass +ast +att +aud +Aug +aut +ave +avo +awe +aye +Azt +select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +create table t3 ( +period int not null, +name char(32) not null, +companynr int not null, +price double(11,0), +price2 double(11,0), +key (period), +key (name) +); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +create temporary table tmp select * from t3; +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +alter table t3 add t2nr int not null auto_increment primary key first; +drop table tmp; +SET BIG_TABLES=1; +select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10; +namn +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +SET BIG_TABLES=0; +select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10; +concat(fld3," ",fld3) +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +select distinct fld5 from t2 limit 10; +fld5 +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +select distinct companynr, fld3,count(*) from t2 group by companynr, fld3 order by companynr, fld3 limit 10; +companynr fld3 count(*) +00 affixed 1 +00 and 1 +00 annoyers 1 +00 Anthony 1 +00 assayed 1 +00 assurers 1 +00 attendants 1 +00 bedlam 1 +00 bedpost 1 +00 boasted 1 +SET BIG_TABLES=1; +select distinct companynr, fld3,count(*) from t2 group by companynr, fld3 order by companynr, fld3 limit 10; +companynr fld3 count(*) +00 affixed 1 +00 and 1 +00 annoyers 1 +00 Anthony 1 +00 assayed 1 +00 assurers 1 +00 attendants 1 +00 bedlam 1 +00 bedpost 1 +00 boasted 1 +SET BIG_TABLES=0; +select distinct companynr, fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr ,fld3 order by companynr, fld3 limit 100,10; +companynr fld3 repeat("a",length(fld3)) count(*) +29 chancellor aaaaaaaaaa 1 +29 Chippewa aaaaaaaa 1 +29 circumference aaaaaaaaaaaaa 1 +29 circus aaaaaa 1 +29 cited aaaaa 1 +29 Colombo aaaaaaa 1 +29 congresswoman aaaaaaaaaaaaa 1 +29 contrition aaaaaaaaaa 1 +29 corny aaaaa 1 +29 cultivation aaaaaaaaaaa 1 +select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2; +companynr rtrim(space(512+companynr)) +37 +78 +101 +154 +311 +447 +512 +select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; +fld3 +explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 10.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL fld1 NULL NULL NULL 1199 10.00 Using where; Using temporary; Using filesort +2 SIMPLE t3 NULL eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`t2nr` AS `t2nr`,`test`.`t2`.`fld3` AS `fld3` from `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld1` = `test`.`t3`.`t2nr`)) order by `test`.`t3`.`t2nr`,`test`.`t2`.`fld3` +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 41736 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL period NULL NULL NULL 41736 100.00 Using temporary; Using filesort +2 SIMPLE t3 NULL ref period period 4 test.t1.period 4173 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t3`.`period` = `test`.`t1`.`period`) order by `test`.`t3`.`period` +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 41736 100.00 Parallel execute (4 workers) +2 SIMPLE t3 NULL ALL period NULL NULL NULL 41736 100.00 Using temporary; Using filesort +2 SIMPLE t1 NULL ref period period 4 test.t3.period 4173 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t1`.`period` = `test`.`t3`.`period`) order by `test`.`t3`.`period` limit 10 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 41736 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL period NULL NULL NULL 41736 100.00 Using temporary; Using filesort +2 SIMPLE t3 NULL ref period period 4 test.t1.period 4173 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t3`.`period` = `test`.`t1`.`period`) order by `test`.`t1`.`period` limit 10 +select period from t1; +period +9410 +select period from t1 where period=1900; +period +select fld3,period from t1,t2 where fld1 = 011401 order by period; +fld3 period +breaking 9410 +select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001; +fld3 period +breaking 1001 +explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const fld1 fld1 4 const 1 100.00 NULL +1 SIMPLE t3 NULL const PRIMARY,period PRIMARY 4 const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select 'breaking' AS `fld3`,'1001' AS `period` from `test`.`t2` join `test`.`t3` where true +select fld3,period from t2,t1 where companynr*10 = 37*10 order by fld3; +fld3 period +abates 9410 +Abraham 9410 +abrogating 9410 +accessed 9410 +Aden 9410 +admiring 9410 +admonishing 9410 +Adolph 9410 +afield 9410 +afore 9410 +aging 9410 +airships 9410 +Aldrich 9410 +alike 9410 +Alison 9410 +allot 9410 +already 9410 +amenities 9410 +ammonium 9410 +analogy 9410 +analyzable 9410 +Anatole 9410 +animals 9410 +animized 9410 +annihilates 9410 +announced 9410 +announces 9410 +Antarctica 9410 +Antares 9410 +apiary 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +Arabia 9410 +arriving 9410 +Artemia 9410 +arteriole 9410 +assails 9410 +astound 9410 +attainments 9410 +attrition 9410 +audiology 9410 +Augustine 9410 +avenge 9410 +avoidable 9410 +babies 9410 +babysitting 9410 +Baird 9410 +balled 9410 +beaner 9410 +beaters 9410 +bee 9410 +Beebe 9410 +befouled 9410 +bellow 9410 +bestseller 9410 +betroth 9410 +bewilderingly 9410 +bills 9410 +bitterroot 9410 +bivalves 9410 +bloater 9410 +bloodbath 9410 +boat 9410 +boom 9410 +boorish 9410 +boulder 9410 +breaking 9410 +brunch 9410 +buckboards 9410 +burlesque 9410 +Butterfield 9410 +cage 9410 +capably 9410 +capped 9410 +cascade 9410 +Cassites 9410 +causality 9410 +cautioned 9410 +ceiling 9410 +celery 9410 +CERN 9410 +certificates 9410 +chafe 9410 +chaperone 9410 +charges 9410 +chasm 9410 +checkpoints 9410 +chewing 9410 +chews 9410 +Chicana 9410 +chillingly 9410 +Chippewa 9410 +chronicle 9410 +ciphers 9410 +civics 9410 +clamored 9410 +Clayton 9410 +clenched 9410 +clockers 9410 +coexist 9410 +cokes 9410 +combed 9410 +coming 9410 +commencements 9410 +commonplace 9410 +communicants 9410 +compartment 9410 +comprehensive 9410 +comprised 9410 +conceptions 9410 +concludes 9410 +congregates 9410 +Conley 9410 +Connally 9410 +contrary 9410 +contrasted 9410 +convenient 9410 +convulsion 9410 +corset 9410 +count 9410 +coverings 9410 +Crays 9410 +craziness 9410 +creak 9410 +creek 9410 +critiques 9410 +crunches 9410 +culled 9410 +cult 9410 +cupboard 9410 +cured 9410 +cute 9410 +daughter 9410 +decliner 9410 +decomposition 9410 +deductions 9410 +dehydrate 9410 +deludes 9410 +denizen 9410 +denotative 9410 +denounces 9410 +dental 9410 +dentally 9410 +descendants 9410 +despot 9410 +destroyer 9410 +detectably 9410 +dialysis 9410 +DiMaggio 9410 +dimensions 9410 +disable 9410 +discounts 9410 +disentangle 9410 +disobedience 9410 +dissociate 9410 +dogging 9410 +dopers 9410 +drains 9410 +dreaded 9410 +ducks 9410 +dusted 9410 +Dutchman 9410 +effortlessly 9410 +electroencephalography 9410 +elite 9410 +embassies 9410 +employing 9410 +encompass 9410 +encompasses 9410 +environing 9410 +epistle 9410 +equilibrium 9410 +erases 9410 +error 9410 +eschew 9410 +eternal 9410 +Eulerian 9410 +Evanston 9410 +evened 9410 +evenhandedly 9410 +eventful 9410 +Everhart 9410 +excises 9410 +exclamation 9410 +excrete 9410 +exhausts 9410 +expelled 9410 +extents 9410 +externally 9410 +extracted 9410 +faithful 9410 +fanatic 9410 +fated 9410 +featherweight 9410 +feed 9410 +feminine 9410 +Fenton 9410 +fetched 9410 +fetters 9410 +fiftieth 9410 +filial 9410 +fingerings 9410 +finishers 9410 +firearm 9410 +fitting 9410 +Fitzpatrick 9410 +fixedly 9410 +flanking 9410 +flint 9410 +flopping 9410 +flurried 9410 +foldout 9410 +foothill 9410 +forgivably 9410 +forthcoming 9410 +freakish 9410 +freest 9410 +freezes 9410 +funereal 9410 +furnishings 9410 +furthermore 9410 +gadfly 9410 +gainful 9410 +Galatean 9410 +galling 9410 +Gandhian 9410 +Ganymede 9410 +garage 9410 +gentleman 9410 +gifted 9410 +gleaning 9410 +glut 9410 +goblins 9410 +Goldstine 9410 +Gothicism 9410 +governing 9410 +gradually 9410 +Graves 9410 +grazing 9410 +Greenberg 9410 +gritty 9410 +groupings 9410 +guides 9410 +guitars 9410 +Gurkha 9410 +handgun 9410 +handy 9410 +Hawaii 9410 +Hegelian 9410 +heiress 9410 +hoarder 9410 +honoring 9410 +Hornblower 9410 +hostess 9410 +Huffman 9410 +humanness 9410 +humiliation 9410 +humility 9410 +Hunter 9410 +hushes 9410 +husky 9410 +hypothesizer 9410 +icon 9410 +ideas 9410 +impelling 9410 +impending 9410 +imperial 9410 +imperiously 9410 +imprint 9410 +impulsive 9410 +inaccuracy 9410 +inch 9410 +incidentals 9410 +incorrectly 9410 +incurring 9410 +index 9410 +indulge 9410 +indulgences 9410 +ineffective 9410 +infallibly 9410 +infest 9410 +inform 9410 +inmate 9410 +insolence 9410 +instruments 9410 +intelligibility 9410 +intentness 9410 +intercepted 9410 +interdependent 9410 +interrelationships 9410 +interrogate 9410 +investigations 9410 +irresponsibly 9410 +jarring 9410 +Joplin 9410 +journalizing 9410 +Judas 9410 +juveniles 9410 +Kane 9410 +kanji 9410 +Kantian 9410 +Kevin 9410 +kingdom 9410 +Kinsey 9410 +kiting 9410 +Kline 9410 +labeled 9410 +languages 9410 +Lars 9410 +laterally 9410 +Latinizes 9410 +lawgiver 9410 +leaflet 9410 +leavings 9410 +lectured 9410 +leftover 9410 +lewdly 9410 +lied 9410 +Lillian 9410 +linear 9410 +lists 9410 +lithograph 9410 +Lizzy 9410 +lore 9410 +luckily 9410 +Majorca 9410 +males 9410 +Manhattanize 9410 +marginal 9410 +mastering 9410 +mayoral 9410 +McGovern 9410 +meanwhile 9410 +measures 9410 +measures 9410 +mechanizing 9410 +medical 9410 +meditation 9410 +Melinda 9410 +Merritt 9410 +metaphysically 9410 +Micronesia 9410 +Miles 9410 +Miltonism 9410 +mineral 9410 +miniaturizes 9410 +minima 9410 +minion 9410 +minting 9410 +misted 9410 +misunderstander 9410 +mixture 9410 +motors 9410 +mournfulness 9410 +multilayer 9410 +mumbles 9410 +mushrooms 9410 +mystic 9410 +Nabisco 9410 +navies 9410 +navigate 9410 +Nazis 9410 +neat 9410 +neonatal 9410 +nested 9410 +Newtonian 9410 +noncritical 9410 +normalizes 9410 +Norwalk 9410 +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +Pandora 9410 +parametrized 9410 +parenthood 9410 +Parsifal 9410 +parters 9410 +participated 9410 +partridges 9410 +peacock 9410 +peeked 9410 +pellagra 9410 +percentage 9410 +percentage 9410 +persist 9410 +perturb 9410 +Peruvian 9410 +pessimist 9410 +pests 9410 +petted 9410 +pictures 9410 +pithed 9410 +pityingly 9410 +poison 9410 +posed 9410 +positioning 9410 +postulation 9410 +praised 9410 +precaution 9410 +precipitable 9410 +preclude 9410 +presentation 9410 +pressure 9410 +previewing 9410 +priceless 9410 +primary 9410 +psychic 9410 +publicly 9410 +puddings 9410 +Punjab 9410 +Pyle 9410 +quagmire 9410 +quitter 9410 +Quixotism 9410 +railway 9410 +raining 9410 +rains 9410 +ravines 9410 +readable 9410 +realized 9410 +realtor 9410 +reassigned 9410 +recruited 9410 +reduce 9410 +regimented 9410 +registration 9410 +relatively 9410 +relaxing 9410 +relishing 9410 +relives 9410 +renew 9410 +repelled 9410 +repetitions 9410 +reporters 9410 +reporters 9410 +repressions 9410 +resplendent 9410 +resumes 9410 +rifles 9410 +rightful 9410 +rightfully 9410 +rightfulness 9410 +ripeness 9410 +riser 9410 +Romano 9410 +Romans 9410 +roped 9410 +rudeness 9410 +rules 9410 +rural 9410 +rusting 9410 +Sabine 9410 +sadly 9410 +sags 9410 +sanding 9410 +saplings 9410 +sating 9410 +Sault 9410 +save 9410 +sawtooth 9410 +Saxony 9410 +scarf 9410 +scatterbrain 9410 +scheduling 9410 +schemer 9410 +scholastics 9410 +scornfully 9410 +secures 9410 +securing 9410 +Selfridge 9410 +seminaries 9410 +serializations 9410 +serpents 9410 +serving 9410 +severely 9410 +sews 9410 +Shanghais 9410 +shapelessly 9410 +shipyard 9410 +shooter 9410 +similarities 9410 +Simla 9410 +Simon 9410 +skulking 9410 +slaughter 9410 +sloping 9410 +smoothed 9410 +snatching 9410 +socializes 9410 +sophomore 9410 +sorters 9410 +spatial 9410 +specification 9410 +specifics 9410 +spongers 9410 +spools 9410 +sportswriting 9410 +sporty 9410 +squabbled 9410 +squeaking 9410 +squeezes 9410 +stabilizes 9410 +stairway 9410 +Stalin 9410 +standardizes 9410 +star 9410 +starlet 9410 +stated 9410 +Steinberg 9410 +stint 9410 +stodgy 9410 +store 9410 +straight 9410 +stranglings 9410 +subdirectory 9410 +subjective 9410 +subschema 9410 +succumbed 9410 +suites 9410 +sumac 9410 +sureties 9410 +swaying 9410 +sweetish 9410 +swelling 9410 +syndicate 9410 +Taoism 9410 +taxonomically 9410 +techniques 9410 +teem 9410 +teethe 9410 +tempering 9410 +Teresa 9410 +terminal 9410 +terminator 9410 +terminators 9410 +test 9410 +testicle 9410 +textures 9410 +theorizers 9410 +throttles 9410 +tidiness 9410 +timesharing 9410 +tinily 9410 +tinting 9410 +Tipperary 9410 +title 9410 +tragedies 9410 +traitor 9410 +trimmings 9410 +tropics 9410 +unaffected 9410 +uncovering 9410 +undoes 9410 +ungrateful 9410 +universals 9410 +unplug 9410 +unruly 9410 +untying 9410 +unwilling 9410 +vacuuming 9410 +validate 9410 +vanish 9410 +ventilate 9410 +veranda 9410 +vests 9410 +wallet 9410 +waltz 9410 +warm 9410 +warningly 9410 +watering 9410 +weasels 9410 +Weissmuller 9410 +western 9410 +whiteners 9410 +widens 9410 +Winsett 9410 +witchcraft 9410 +workers 9410 +Wotan 9410 +yelped 9410 +youthfulness 9410 +analyze table t2, t3; +Table Op Msg_type Msg_text +test.t2 analyze status OK +test.t3 analyze status OK +EXPLAIN select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 10.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL fld1 NULL NULL NULL 1199 10.00 Using where; Using temporary; Using filesort +2 SIMPLE t3 NULL eq_ref PRIMARY,period PRIMARY 4 test.t2.fld1 1 20.04 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`companynr` = 37) and (`test`.`t2`.`fld1` = `test`.`t3`.`t2nr`) and (`test`.`t3`.`period` >= 1001) and (`test`.`t3`.`period` <= 1002)) order by `test`.`t2`.`fld3`,`test`.`t3`.`period`,`test`.`t3`.`price` +select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +fld3 period price price2 +admonishing 1002 28357832 8723648 +analyzable 1002 28357832 8723648 +annihilates 1001 5987435 234724 +Antares 1002 28357832 8723648 +astound 1001 5987435 234724 +audiology 1001 5987435 234724 +Augustine 1002 28357832 8723648 +Baird 1002 28357832 8723648 +bewilderingly 1001 5987435 234724 +breaking 1001 5987435 234724 +Conley 1001 5987435 234724 +dentally 1002 28357832 8723648 +dissociate 1002 28357832 8723648 +elite 1001 5987435 234724 +eschew 1001 5987435 234724 +Eulerian 1001 5987435 234724 +flanking 1001 5987435 234724 +foldout 1002 28357832 8723648 +funereal 1002 28357832 8723648 +galling 1002 28357832 8723648 +Graves 1001 5987435 234724 +grazing 1001 5987435 234724 +groupings 1001 5987435 234724 +handgun 1001 5987435 234724 +humility 1002 28357832 8723648 +impulsive 1002 28357832 8723648 +inch 1001 5987435 234724 +intelligibility 1001 5987435 234724 +jarring 1001 5987435 234724 +lawgiver 1001 5987435 234724 +lectured 1002 28357832 8723648 +Merritt 1002 28357832 8723648 +neonatal 1001 5987435 234724 +offload 1002 28357832 8723648 +parters 1002 28357832 8723648 +pityingly 1002 28357832 8723648 +puddings 1002 28357832 8723648 +Punjab 1001 5987435 234724 +quitter 1002 28357832 8723648 +realtor 1001 5987435 234724 +relaxing 1001 5987435 234724 +repetitions 1001 5987435 234724 +resumes 1001 5987435 234724 +Romans 1002 28357832 8723648 +rusting 1001 5987435 234724 +scholastics 1001 5987435 234724 +skulking 1002 28357832 8723648 +stated 1002 28357832 8723648 +suites 1002 28357832 8723648 +sureties 1001 5987435 234724 +testicle 1002 28357832 8723648 +tinily 1002 28357832 8723648 +tragedies 1001 5987435 234724 +trimmings 1001 5987435 234724 +vacuuming 1001 5987435 234724 +ventilate 1001 5987435 234724 +wallet 1001 5987435 234724 +Weissmuller 1002 28357832 8723648 +Wotan 1002 28357832 8723648 +select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37; +fld1 fld3 period price price2 +018201 relaxing 1001 5987435 234724 +018601 vacuuming 1001 5987435 234724 +018801 inch 1001 5987435 234724 +018811 repetitions 1001 5987435 234724 +create table t4 ( +companynr tinyint(2) unsigned zerofill NOT NULL default '00', +companyname char(30) NOT NULL default '', +PRIMARY KEY (companynr), +UNIQUE KEY companyname(companyname) +) ENGINE=INNODB MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select * from t1,t1 t12; +Period Varor_period Period Varor_period +9410 9412 9410 9412 +select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505; +fld1 fld1 +250501 250501 +250501 250502 +250501 250503 +250501 250504 +250501 250505 +250502 250501 +250502 250502 +250502 250503 +250502 250504 +250502 250505 +250503 250501 +250503 250502 +250503 250503 +250503 250504 +250503 250505 +250504 250501 +250504 250502 +250504 250503 +250504 250504 +250504 250505 +250505 250501 +250505 250502 +250505 250503 +250505 250504 +250505 250505 +insert into t2 (fld1, companynr) values (999999,99); +ANALYZE TABLE t2, t4; +Table Op Msg_type Msg_text +test.t2 analyze status OK +test.t4 analyze status OK +select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +companynr companyname +99 NULL +select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null; +count(*) +1199 +explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1200 100.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1200 100.00 NULL +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 Using where; Not exists +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t2` left join `test`.`t4` on((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`)) where (`test`.`t4`.`companynr` is null) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1200 10.00 Using where; Not exists +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t2`.`companynr` is null) +select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +companynr companyname +select count(*) from t2 left join t4 using (companynr) where companynr is not null; +count(*) +1200 +explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t2` left join `test`.`t4` on(multiple equal(`test`.`t2`.`companynr`, `test`.`t4`.`companynr`)) where false +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on(multiple equal(`test`.`t4`.`companynr`, `test`.`t2`.`companynr`)) where false +delete from t2 where fld1=999999; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0) and (`test`.`t2`.`companynr` > 0)) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t4`.`companynr` > 0) and (`test`.`t4`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 40.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t2`.`companynr` > 0) or (`test`.`t2`.`companynr` is null)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index PRIMARY companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t2`.`companynr` > 0) or (`test`.`t4`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (ifnull(`test`.`t2`.`companynr`,1) > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t4`.`companynr` > 0) or (`test`.`t4`.`companynr` > 0)) +explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using where; Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (ifnull(`test`.`t4`.`companynr`,1) > 0) +select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +companynr companynr +37 36 +41 40 +explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index; Using temporary +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select distinct `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companynr` AS `companynr` from `test`.`t2` join `test`.`t4` where (`test`.`t2`.`companynr` = (`test`.`t4`.`companynr` + 1)) +select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909); +period +9410 +select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6))); +period +9410 +select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1; +fld1 +250501 +250502 +250503 +250505 +select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606); +fld1 +250502 +250503 +select fld1 from t2 where fld1 between 250502 and 250504; +fld1 +250502 +250503 +250504 +select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ; +fld3 +Lillian +label +labeled +labeled +landslide +laterally +leaflet +lewdly +luckily +select count(*) from t1; +count(*) +1 +select companynr,count(*),sum(fld1) from t2 group by companynr; +companynr count(*) sum(fld1) +00 82 10355753 +29 95 14473298 +34 70 17788966 +36 215 22786296 +37 588 83602098 +40 37 6618386 +41 52 12816335 +50 11 1595438 +53 4 793210 +58 23 2254293 +65 10 2284055 +68 12 3097288 +select companynr,count(*) from t2 group by companynr order by companynr desc limit 5; +companynr count(*) +68 12 +65 10 +58 23 +53 4 +50 11 +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +70 absentee vest 17788966 254128.0857 3272.5939722090234 10709871.306938833 +explain select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 9.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 order 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.97568479746 13352027981.708656 +29 95 abut wetness 14473298 152350.5053 8368.547956641249 70032594.90260443 +34 70 absentee vest 17788966 254128.0857 3272.5939722090234 10709871.306938833 +select +companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from +t3 where companynr = 37 group by companynr,t2nr order by companynr, t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select /*! SQL_SMALL_RESULT */ +companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from +t3 where companynr = 37 group by companynr,t2nr order by companynr, t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ; +companynr count(price) sum(price) min(price) max(price) avg(price) +101 4181 3489454238 834598 834598 834598.0000 +154 4181 4112197254950 983543950 983543950 983543950.0000 +311 4181 979599938 234298 234298 234298.0000 +37 12543 309394878010 5987435 39654943 24666736.6667 +447 4181 9929180954 2374834 2374834 2374834.0000 +512 4181 3288532102 786542 786542 786542.0000 +78 8362 414611089292 726498 98439034 49582766.0000 +select distinct mod(companynr,10) from t4 group by companynr; +mod(companynr,10) +0 +1 +3 +4 +5 +6 +7 +8 +9 +select distinct 1 from t4 group by companynr; +1 +1 +select count(distinct fld1) from t2; +count(distinct fld1) +1199 +select companynr,count(distinct fld1) from t2 group by companynr; +companynr count(distinct fld1) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(*) from t2 group by companynr; +companynr count(*) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,1000))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,200))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct floor(fld1/100)) from t2 group by companynr; +companynr count(distinct floor(fld1/100)) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr; +companynr count(distinct concat(repeat(65,1000),floor(fld1/100))) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10; +sum(fld1) fld3 +11402 Romans +select name,count(*) from t3 where name='cloakroom' group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name='cloakroom' and price>10 group by name; +name count(*) +cloakroom 4181 +select count(*) from t3 where name='cloakroom' and price2=823742; +count(*) +4181 +select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name; +name count(*) +extramarital 4181 +gazer 4181 +gems 4181 +Iranizes 4181 +spates 4181 +tucked 4181 +violinist 4181 +select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld3 count(*) +spates 4181 +select companynr|0,companyname from t4 group by 1; +companynr|0 companyname +0 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname; +companynr companyname count(*) +29 company 1 95 +68 company 10 12 +50 company 11 11 +34 company 2 70 +36 company 3 215 +37 company 4 588 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +00 Unknown 82 +select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld1 count(*) +158402 4181 +select sum(Period)/count(*) from t1; +sum(Period)/count(*) +9410.0000 +select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; +companynr count sum diff func +101 4181 3489454238 0.0000 422281 +154 4181 4112197254950 0.0000 643874 +311 4181 979599938 0.0000 1300291 +37 12543 309394878010 0.0000 464091 +447 4181 9929180954 0.0000 1868907 +512 4181 3288532102 0.0000 2140672 +78 8362 414611089292 0.0000 652236 +select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; +companynr avg +154 983543950.0000 +select companynr,count(*) from t2 group by companynr order by 2 desc; +companynr count(*) +37 588 +36 215 +29 95 +00 82 +34 70 +41 52 +40 37 +58 23 +68 12 +50 11 +65 10 +53 4 +select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc; +companynr count(*) +41 52 +58 23 +68 12 +50 11 +65 10 +53 4 +select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4; +fld4 fld1 count(price) sum(price) min(price) max(price) avg(price) +Abraham 018103 1 39654943 39654943 39654943 39654943.0000 +Anatole 038102 1 28357832 28357832 28357832 28357832.0000 +Beebe 018602 1 28357832 28357832 28357832 28357832.0000 +Chicana 038203 1 39654943 39654943 39654943 39654943.0000 +Conley 018101 1 5987435 5987435 5987435 5987435.0000 +Connally 018801 1 5987435 5987435 5987435 5987435.0000 +Graves 018052 1 28357832 28357832 28357832 28357832.0000 +Judas 018032 1 28357832 28357832 28357832 28357832.0000 +Kline 038101 1 5987435 5987435 5987435 5987435.0000 +Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000 +Merritt 016303 1 39654943 39654943 39654943 39654943.0000 +Parsifal 013802 1 28357832 28357832 28357832 28357832.0000 +Punjab 016302 1 28357832 28357832 28357832 28357832.0000 +Selfridge 019102 1 28357832 28357832 28357832 28357832.0000 +Simla 018402 1 28357832 28357832 28357832 28357832.0000 +Steinberg 012003 1 39654943 39654943 39654943 39654943.0000 +Taoism 018603 1 39654943 39654943 39654943 39654943.0000 +attainments 012303 1 39654943 39654943 39654943 39654943.0000 +audiology 011403 1 39654943 39654943 39654943 39654943.0000 +balled 012301 1 5987435 5987435 5987435 5987435.0000 +bee 038001 1 5987435 5987435 5987435 5987435.0000 +betroth 030501 1 5987435 5987435 5987435 5987435.0000 +bivalves 018013 1 39654943 39654943 39654943 39654943.0000 +bloodbath 018042 1 28357832 28357832 28357832 28357832.0000 +cage 018201 1 5987435 5987435 5987435 5987435.0000 +capably 012501 1 5987435 5987435 5987435 5987435.0000 +checkpoints 018803 1 39654943 39654943 39654943 39654943.0000 +coexist 018601 1 5987435 5987435 5987435 5987435.0000 +contrasted 016001 1 5987435 5987435 5987435 5987435.0000 +daughter 012703 1 39654943 39654943 39654943 39654943.0000 +dental 038003 1 39654943 39654943 39654943 39654943.0000 +dimensions 038202 1 28357832 28357832 28357832 28357832.0000 +disable 019103 1 39654943 39654943 39654943 39654943.0000 +dogging 018002 1 28357832 28357832 28357832 28357832.0000 +dreaded 011401 1 5987435 5987435 5987435 5987435.0000 +epistle 018062 1 28357832 28357832 28357832 28357832.0000 +erases 016301 1 5987435 5987435 5987435 5987435.0000 +eschew 011702 1 28357832 28357832 28357832 28357832.0000 +featherweight 012701 1 5987435 5987435 5987435 5987435.0000 +fetched 018802 1 28357832 28357832 28357832 28357832.0000 +fetters 018012 1 28357832 28357832 28357832 28357832.0000 +firearm 018812 1 28357832 28357832 28357832 28357832.0000 +flint 018022 1 28357832 28357832 28357832 28357832.0000 +flopping 018023 1 39654943 39654943 39654943 39654943.0000 +gritty 018811 1 5987435 5987435 5987435 5987435.0000 +hushes 018202 1 28357832 28357832 28357832 28357832.0000 +imprint 030503 1 39654943 39654943 39654943 39654943.0000 +impulsive 012602 1 28357832 28357832 28357832 28357832.0000 +interdependent 018051 1 5987435 5987435 5987435 5987435.0000 +interrelationships 036001 1 5987435 5987435 5987435 5987435.0000 +kanji 038002 1 28357832 28357832 28357832 28357832.0000 +lawgiver 013601 1 5987435 5987435 5987435 5987435.0000 +leavings 013803 1 39654943 39654943 39654943 39654943.0000 +lectured 018102 1 28357832 28357832 28357832 28357832.0000 +leftover 016201 1 5987435 5987435 5987435 5987435.0000 +medical 018041 1 5987435 5987435 5987435 5987435.0000 +minima 019101 1 5987435 5987435 5987435 5987435.0000 +neat 012001 1 5987435 5987435 5987435 5987435.0000 +neonatal 018053 1 39654943 39654943 39654943 39654943.0000 +normalizes 038013 1 39654943 39654943 39654943 39654943.0000 +parters 011701 1 5987435 5987435 5987435 5987435.0000 +partridges 038103 1 39654943 39654943 39654943 39654943.0000 +persist 012302 1 28357832 28357832 28357832 28357832.0000 +pessimist 012702 1 28357832 28357832 28357832 28357832.0000 +quitter 011703 1 39654943 39654943 39654943 39654943.0000 +railway 038011 1 5987435 5987435 5987435 5987435.0000 +readable 013603 1 39654943 39654943 39654943 39654943.0000 +recruited 038201 1 5987435 5987435 5987435 5987435.0000 +reporters 018403 1 39654943 39654943 39654943 39654943.0000 +riser 036002 1 28357832 28357832 28357832 28357832.0000 +scholastics 011402 1 28357832 28357832 28357832 28357832.0000 +scornfully 018003 1 39654943 39654943 39654943 39654943.0000 +skulking 018021 1 5987435 5987435 5987435 5987435.0000 +sorters 018061 1 5987435 5987435 5987435 5987435.0000 +squeaking 013901 1 5987435 5987435 5987435 5987435.0000 +starlet 012603 1 39654943 39654943 39654943 39654943.0000 +stated 013602 1 28357832 28357832 28357832 28357832.0000 +subschema 018043 1 39654943 39654943 39654943 39654943.0000 +sweetish 018001 1 5987435 5987435 5987435 5987435.0000 +swelling 031901 1 5987435 5987435 5987435 5987435.0000 +teethe 000001 1 5987435 5987435 5987435 5987435.0000 +testicle 013801 1 5987435 5987435 5987435 5987435.0000 +vacuuming 018033 1 39654943 39654943 39654943 39654943.0000 +validate 038012 1 28357832 28357832 28357832 28357832.0000 +wallet 011501 1 5987435 5987435 5987435 5987435.0000 +whiteners 016202 1 28357832 28357832 28357832 28357832.0000 +witchcraft 019201 1 5987435 5987435 5987435 5987435.0000 +select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3; +companynr fld3 sum(price) +512 Micronesia 786542 +512 Miles 786542 +512 boat 786542 +512 capably 786542 +512 cupboard 786542 +512 decliner 786542 +512 descendants 786542 +512 dopers 786542 +512 erases 786542 +512 skies 786542 +select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr; +companynr count(*) min(fld3) max(fld3) sum(price) avg(price) +00 1 Omaha Omaha 5987435 5987435.0000 +36 1 dubbed dubbed 28357832 28357832.0000 +37 83 Abraham Wotan 1908978016 22999735.1325 +50 2 scribbled tapestry 68012775 34006387.5000 +select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1; +t3.companynr+0 t2nr fld3 sum(price) +37 1 Omaha 5987435 +37 11401 breaking 5987435 +37 11402 Romans 28357832 +37 11403 intercepted 39654943 +37 11501 bewilderingly 5987435 +37 11701 astound 5987435 +37 11702 admonishing 28357832 +37 11703 sumac 39654943 +37 12001 flanking 5987435 +37 12003 combed 39654943 +37 12301 Eulerian 5987435 +37 12302 dubbed 28357832 +37 12303 Kane 39654943 +37 12501 annihilates 5987435 +37 12602 Wotan 28357832 +37 12603 snatching 39654943 +37 12701 grazing 5987435 +37 12702 Baird 28357832 +37 12703 celery 39654943 +37 13601 handgun 5987435 +37 13602 foldout 28357832 +37 13603 mystic 39654943 +37 13801 intelligibility 5987435 +37 13802 Augustine 28357832 +37 13803 teethe 39654943 +37 13901 scholastics 5987435 +37 16001 audiology 5987435 +37 16201 wallet 5987435 +37 16202 parters 28357832 +37 16301 eschew 5987435 +37 16302 quitter 28357832 +37 16303 neat 39654943 +37 18001 jarring 5987435 +37 18002 tinily 28357832 +37 18003 balled 39654943 +37 18012 impulsive 28357832 +37 18013 starlet 39654943 +37 18021 lawgiver 5987435 +37 18022 stated 28357832 +37 18023 readable 39654943 +37 18032 testicle 28357832 +37 18033 Parsifal 39654943 +37 18041 Punjab 5987435 +37 18042 Merritt 28357832 +37 18043 Quixotism 39654943 +37 18051 sureties 5987435 +37 18052 puddings 28357832 +37 18053 tapestry 39654943 +37 18061 trimmings 5987435 +37 18062 humility 28357832 +37 18101 tragedies 5987435 +37 18102 skulking 28357832 +37 18103 flint 39654943 +37 18201 relaxing 5987435 +37 18202 offload 28357832 +37 18402 suites 28357832 +37 18403 lists 39654943 +37 18601 vacuuming 5987435 +37 18602 dentally 28357832 +37 18603 humanness 39654943 +37 18801 inch 5987435 +37 18802 Weissmuller 28357832 +37 18803 irresponsibly 39654943 +37 18811 repetitions 5987435 +37 18812 Antares 28357832 +37 19101 ventilate 5987435 +37 19102 pityingly 28357832 +37 19103 interdependent 39654943 +37 19201 Graves 5987435 +37 30501 neonatal 5987435 +37 30502 scribbled 28357832 +37 30503 chafe 39654943 +37 31901 realtor 5987435 +37 36001 elite 5987435 +37 36002 funereal 28357832 +37 38001 Conley 5987435 +37 38002 lectured 28357832 +37 38003 Abraham 39654943 +37 38011 groupings 5987435 +37 38012 dissociate 28357832 +37 38013 coexist 39654943 +37 38101 rusting 5987435 +37 38102 galling 28357832 +37 38103 obliterates 39654943 +37 38201 resumes 5987435 +37 38202 analyzable 28357832 +37 38203 terminator 39654943 +select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008; +sum(price) +234298 +select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1; +fld1 sum(price) +038008 234298 +explain select fld3 from t2 where 1>2 or 2>3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where false +explain select fld3 from t2 where fld1=fld1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 100.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where true +select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000; +companynr count sum +00 82 10355753 +29 95 14473298 +34 70 17788966 +37 588 83602098 +41 52 12816335 +select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ; +companynr +00 +29 +34 +37 +41 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40; +companynr companyname count(*) +40 company 5 37 +41 company 6 52 +50 company 11 11 +53 company 7 4 +58 company 8 23 +65 company 9 10 +68 company 10 12 +select count(*) from t2; +count(*) +1199 +select count(*) from t2 where fld1 < 098024; +count(*) +387 +select min(fld1) from t2 where fld1>= 098024; +min(fld1) +98024 +select max(fld1) from t2 where fld1>= 098024; +max(fld1) +1232609 +select count(*) from t3 where price2=76234234; +count(*) +4181 +select count(*) from t3 where companynr=512 and price2=76234234; +count(*) +4181 +explain select min(fld1),max(fld1),count(*) from t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL index NULL fld1 4 NULL 1199 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t2`.`fld1`) AS `min(fld1)`,max(`test`.`t2`.`fld1`) AS `max(fld1)`,count(0) AS `count(*)` from `test`.`t2` +explain format=tree select min(fld1),max(fld1),count(*) from t2; +EXPLAIN +-> Count rows in t2 + +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +explain format=tree select min(fld1),max(fld1),count(*) from t2 where rand() > 0.5; +EXPLAIN +-> Aggregate: min(`min(fld1)`), max(`max(fld1)`), count(`count(*)`) + -> Parallel scan on + -> Aggregate: + -> Filter: (rand() > 0.5) (cost=123.65 rows=1199) + -> PQblock scan on t2 using fld1 (cost=123.65 rows=1199) + +select min(fld1),max(fld1),count(*) from t2; +min(fld1) max(fld1) count(*) +0 1232609 1199 +select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; +min(t2nr) max(t2nr) +2115 2115 +select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; +count(*) min(t2nr) max(t2nr) +4181 4 41804 +select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; +t2nr count(*) +9 1 +19 1 +29 1 +39 1 +49 1 +59 1 +69 1 +79 1 +89 1 +99 1 +109 1 +119 1 +129 1 +139 1 +149 1 +159 1 +169 1 +179 1 +189 1 +199 1 +select max(t2nr) from t3 where price=983543950; +max(t2nr) +41807 +select t1.period from t3 t1 limit 1; +period +1001 +select t1.period from t1 as t1 limit 1; +period +9410 +select t1.period as "Nuvarande period" from t1 as t1 limit 1; +Nuvarande period +9410 +select period as ok_period from t1 limit 1; +ok_period +9410 +select period as ok_period from t1 group by ok_period limit 1; +ok_period +9410 +select 1+1 as summa from t1 group by summa limit 1; +summa +2 +select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1; +Nuvarande period +9410 +show tables; +Tables_in_test +t1 +t2 +t3 +t4 +show tables from test like "s%"; +Tables_in_test (s%) +show tables from test like "t?"; +Tables_in_test (t?) +show full columns from t2; +Field Type Collation Null Key Default Extra Privileges Comment +auto int NULL NO PRI NULL auto_increment select,insert,update,references +fld1 int(6) unsigned zerofill NULL NO UNI 000000 select,insert,update,references +companynr tinyint(2) unsigned zerofill NULL NO 00 select,insert,update,references +fld3 char(30) utf8mb4_0900_ai_ci NO MUL select,insert,update,references +fld4 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld5 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld6 char(4) utf8mb4_0900_ai_ci NO select,insert,update,references +show full columns from t2 from test like 'f%'; +Field Type Collation Null Key Default Extra Privileges Comment +fld1 int(6) unsigned zerofill NULL NO UNI 000000 select,insert,update,references +fld3 char(30) utf8mb4_0900_ai_ci NO MUL select,insert,update,references +fld4 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld5 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld6 char(4) utf8mb4_0900_ai_ci NO select,insert,update,references +show full columns from t2 from test like 's%'; +Field Type Collation Null Key Default Extra Privileges Comment +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +show keys from t2; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Visible Expression +t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE YES NULL +t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE YES NULL +t2 1 fld3 1 fld3 A 1171 NULL NULL BTREE YES NULL +drop table t4, t3, t2, t1; +DO 1; +DO benchmark(100,1+1),1,1; +do default; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +do foobar; +ERROR 42S22: Unknown column 'foobar' in 'field list' +CREATE TABLE t1 ( +id mediumint(8) unsigned NOT NULL auto_increment, +pseudo varchar(35) NOT NULL default '', +PRIMARY KEY (id), +UNIQUE KEY pseudo (pseudo) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 (pseudo) VALUES ('test'); +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 1 as rnd1 from t1 where rand() > 2; +rnd1 +DROP TABLE t1; +CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1287 'BINARY as attribute of a type' is deprecated and will be removed in a future release. Please use a CHARACTER SET clause with _bin collation instead +INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); +CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +ERROR HY000: Incorrect DATETIME value: 'wrong-date-value' +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +DROP TABLE t1,t2; +create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); +select wss_type from t1 where wss_type ='102935229216544106'; +wss_type +select wss_type from t1 where wss_type ='102935229216544105'; +wss_type +select wss_type from t1 where wss_type ='102935229216544104'; +wss_type +select wss_type from t1 where wss_type ='102935229216544093'; +wss_type +102935229216544093 +select wss_type from t1 where wss_type =102935229216544093; +wss_type +102935229216544093 +drop table t1; +select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; +select @a; +@a +3 +select @b; +@b +aaaa +select @c; +@c +6.260 +create table t1 (a int not null auto_increment primary key); +insert into t1 values (); +insert into t1 values (); +insert into t1 values (); +select * from (t1 as t2 left join t1 as t3 using (a)), t1; +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from t1, (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); +a +1 +2 +3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +1 NULL +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); +a +1 +2 +3 +select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; +a +1 +2 +3 +select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +NULL 1 +select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); +a +1 +2 +3 +select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; +a +1 +2 +3 +select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; +a +1 +2 +3 +drop table t1; +CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); +CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); +select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; +aa id t2_id id +2 8299 2517 2517 +3 8301 2518 2518 +4 8302 2519 2519 +5 8303 2520 2520 +6 8304 2521 2521 +drop table t1,t2; +create table t1 (id1 int NOT NULL); +create table t2 (id2 int NOT NULL); +create table t3 (id3 int NOT NULL); +create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); +insert into t1 values (1); +insert into t1 values (2); +insert into t2 values (1); +insert into t4 values (1,1); +explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +2 SIMPLE t4 NULL ref id4 id4 4 test.t3.id3 1 100.00 Using where; Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`id1` AS `id1`,`test`.`t2`.`id2` AS `id2`,`test`.`t3`.`id3` AS `id3`,`test`.`t4`.`id4` AS `id4`,`test`.`t4`.`id44` AS `id44` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`id2` = `test`.`t1`.`id1`)) left join `test`.`t3` on((`test`.`t3`.`id3` = `test`.`t1`.`id1`)) left join `test`.`t4` on((`test`.`t4`.`id4` = `test`.`t3`.`id3`)) where ((`test`.`t2`.`id2` = 1) or (`test`.`t4`.`id4` = 1)) +select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id1 id2 id3 id4 id44 +1 1 NULL NULL NULL +drop table t1,t2,t3,t4; +create table t1(s varchar(10) not null); +create table t2(s varchar(10) not null primary key); +create table t3(s varchar(10) not null primary key); +insert into t1 values ('one\t'), ('two\t'); +insert into t2 values ('one\r'), ('two\t'); +insert into t3 values ('one\b'), ('two\t'); +select * from t1 where s = 'one'; +s +select * from t2 where s = 'one'; +s +select * from t3 where s = 'one'; +s +one +select * from t1,t2 where t1.s = t2.s; +s s +two two +select * from t2,t3 where t2.s = t3.s; +s s +two two +drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +explain select * from t1 left join t2 on a=c where d in (4); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref c,d d 5 const 2 100.00 Using where +2 SIMPLE t1 NULL ref a a 5 test.t2.c 1 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ 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`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = 4)) +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref c,d d 5 const 2 100.00 Using where +2 SIMPLE t1 NULL ref a a 5 test.t2.c 1 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ 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`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = 4)) +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; +CREATE TABLE t1 ( +i int(11) NOT NULL default '0', +c char(10) NOT NULL default '', +PRIMARY KEY (i), +UNIQUE KEY c (c) +) ; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (1,'a'); +INSERT INTO t1 VALUES (2,'b'); +INSERT INTO t1 VALUES (3,'c'); +EXPLAIN SELECT i FROM t1 WHERE i=1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '1' AS `i` from `test`.`t1` where true +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref a a 23 test.t1.a 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` USE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref a a 23 test.t1.a 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` FORCE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +DROP TABLE t1, t2; +CREATE TABLE t1 ( city char(30) ) charset utf8mb4; +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`city` AS `city` from `test`.`t1` where (`test`.`t1`.`city` = 'London') +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`city` AS `city` from `test`.`t1` where ((`test`.`t1`.`city` = 'London') and (`test`.`t1`.`city` like '%london%')) +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,0), (1,1), (4294967295,1); +select a-b from t1 order by 1; +a-b +0 +1 +4294967294 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +4294967294 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +4294967294 +drop table t1; +create table t1 (a int(11)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +kunde_intern_id int(10) unsigned NOT NULL default '0', +kunde_id int(10) unsigned NOT NULL default '0', +FK_firma_id int(10) unsigned NOT NULL default '0', +aktuell enum('Ja','Nein') NOT NULL default 'Ja', +vorname varchar(128) NOT NULL default '', +nachname varchar(128) NOT NULL default '', +geloescht enum('Ja','Nein') NOT NULL default 'Nein', +firma varchar(128) NOT NULL default '' +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), +(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 +WHERE +( +( +( '' != '' AND firma LIKE CONCAT('%', '', '%')) +OR +(vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND +'Vorname1' != '' AND 'xxxx' != '') +) +AND +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, +geloescht FROM t1 +WHERE +( +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +AND +( +( '' != '' AND firma LIKE CONCAT('%', '', '%') ) +OR +( vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND +'xxxx' != '') +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT COUNT(*) FROM t1 WHERE +( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) +AND FK_firma_id = 2; +COUNT(*) +0 +drop table t1; +CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (0x8000000000000000); +SELECT b FROM t1 WHERE b=0x8000000000000000; +b +9223372036854775808 +DROP TABLE t1; +CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `t2` VALUES (0,'READ'); +CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `t3` VALUES (1,'fs'); +select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); +id name gid uid ident level +1 fs NULL NULL 0 READ +drop table t1,t2,t3; +CREATE TABLE t1 ( +acct_id int(11) NOT NULL default '0', +profile_id smallint(6) default NULL, +UNIQUE KEY t1$acct_id (acct_id), +KEY t1$profile_id (profile_id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (132,17),(133,18); +CREATE TABLE t2 ( +profile_id smallint(6) default NULL, +queue_id int(11) default NULL, +seq int(11) default NULL, +KEY t2$queue_id (queue_id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); +CREATE TABLE t3 ( +id int(11) NOT NULL default '0', +qtype int(11) default NULL, +seq int(11) default NULL, +warn_lvl int(11) default NULL, +crit_lvl int(11) default NULL, +rr1 tinyint(4) NOT NULL default '0', +rr2 int(11) default NULL, +default_queue tinyint(4) NOT NULL default '0', +KEY t3$qtype (qtype), +KEY t3$id (id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), +(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); +SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q +WHERE +(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND +(pq.queue_id = q.id) AND (q.rr1 <> 1); +COUNT(*) +4 +drop table t1,t2,t3; +create table t1 (f1 int); +insert into t1 values (1),(NULL); +create table t2 (f2 int, f3 int, f4 int); +create index idx1 on t2 (f4); +insert into t2 values (1,2,3),(2,4,6); +select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) +from t2 C where A.f4 = C.f4) or A.f3 IS NULL; +f2 +1 +NULL +drop table t1,t2; +create table t2 (a tinyint unsigned); +create index t2i on t2(a); +insert into t2 values (0), (254), (255); +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +explain select * from t2 where a > -1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index t2i t2i 2 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a` is not null) +select * from t2 where a > -1; +a +0 +254 +255 +drop table t2; +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +SELECT * FROM t1; +a b c +50 3 3 +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +select found_rows(); +found_rows() +0 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +SELECT * FROM t1; +a b c +50 3 3 +select count(*) from t1; +count(*) +1 +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +select count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; +count(*) +Warnings: +Warning 1287 SQL_CALC_FOUND_ROWS is deprecated and will be removed in a future release. Consider using two separate queries instead. +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +(SELECT a, b AS c FROM t1) ORDER BY c+1; +a c +(SELECT a, b AS c FROM t1) ORDER BY b+1; +a c +SELECT a, b AS c FROM t1 ORDER BY c+1; +a c +SELECT a, b AS c FROM t1 ORDER BY b+1; +a c +drop table t1; +create table t1(f1 int, f2 int); +create table t2(f3 int); +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); +f1 +insert into t1 values(1,1),(2,null); +insert into t2 values(2); +select * from t1,t2 where f1=f3 and (f1,f2) = (2,null); +f1 f2 f3 +select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null); +f1 f2 f3 +2 NULL 2 +drop table t1,t2; +create table t1 (f1 int not null auto_increment primary key, f2 varchar(10)); +create table t11 like t1; +insert into t1 values(1,""),(2,""); +analyze table t1, t11; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t11 analyze status OK +show table status like 't1%'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 InnoDB 10 Dynamic 2 8192 X X X X X X X X X NULL +t11 InnoDB 10 Dynamic 0 0 X X X X X X X X X NULL +select 123 as a from t1 where f1 is null; +a +drop table t1,t11; +CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); +INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); +CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, e INT ); +INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2),(1,2,3); +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 10 2 +1 11 2 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c; +a b c d +1 10 4 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c; +a b c d +1 10 2 +1 11 2 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2,t1 +WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 2 1 1 +1 2 2 1 +1 2 3 1 +DROP TABLE IF EXISTS t1, t2; +create table t1 (f1 int primary key, f2 int); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t1 values (1,1); +insert into t2 values (1,1),(1,2); +select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1; +count(f2) >0 +1 +drop table t1,t2; +create table t1 (f1 int,f2 int); +insert into t1 values(1,1); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t2 values(1,1); +select * from t1 where f1 in (select f3 from t2 where (f3,f4)= (select f3,f4 from t2)); +f1 f2 +1 1 +drop table t1,t2; +CREATE TABLE t1(a int, b int, c int, KEY b(b), KEY c(c)); +insert into t1 values (1,0,0),(2,0,0); +CREATE TABLE t2 (a int, b varchar(2), c varchar(2), PRIMARY KEY(a)); +insert into t2 values (1,'',''), (2,'',''); +CREATE TABLE t3 (a int, b int, PRIMARY KEY (a,b), KEY a (a), KEY b (b)); +insert into t3 values (1,1),(1,2); +explain select straight_join DISTINCT t2.a,t2.b, t1.c from t1, t3, t2 +where (t1.c=t2.a or (t1.c=t3.a and t2.a=t3.b)) and t1.b=556476786 and +t2.b like '%%' order by t2.b limit 0,1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ref b,c b 5 const 1 100.00 Using temporary; Using filesort +1 SIMPLE t3 NULL index PRIMARY,a,b a 4 NULL 2 100.00 Using index +1 SIMPLE t2 NULL ALL PRIMARY NULL NULL NULL 2 50.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select straight_join distinct `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t1`.`b` = 556476786) and ((`test`.`t2`.`a` = `test`.`t1`.`c`) or ((`test`.`t2`.`a` = `test`.`t3`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`c`))) and (`test`.`t2`.`b` like '%%')) order by `test`.`t2`.`b` limit 0,1 +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (a int, INDEX idx(a)); +INSERT INTO t1 VALUES (2), (3), (1); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 IGNORE INDEX (idx); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` IGNORE INDEX (`idx`) +EXPLAIN SELECT * FROM t1 IGNORE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +EXPLAIN SELECT * FROM t1 FORCE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +DROP TABLE t1; +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 VALUES (1,1), (2,1), (4,10); +CREATE TABLE t2 (a int PRIMARY KEY, b int, KEY b (b)); +INSERT INTO t2 VALUES (1,NULL), (2,10); +ALTER TABLE t1 ENABLE KEYS; +Warnings: +Note 1031 Table storage engine for 't1' doesn't have this option +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index b b 5 NULL 2 100.00 Using index +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select straight_join count(0) AS `COUNT(*)` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) or (`test`.`t2`.`b` is null)) +SELECT STRAIGHT_JOIN * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +a b a b +1 NULL 1 1 +1 NULL 2 1 +1 NULL 4 10 +2 10 4 10 +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index b b 5 NULL 2 100.00 Using index +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select straight_join count(0) AS `COUNT(*)` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) or (`test`.`t2`.`b` is null)) +SELECT STRAIGHT_JOIN * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +a b a b +1 NULL 1 1 +1 NULL 2 1 +1 NULL 4 10 +2 10 4 10 +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (key1 double default NULL, UNIQUE KEY key1 (key1)); +CREATE TABLE t2 (key2 double default NULL, UNIQUE KEY key2 (key2)); +INSERT INTO t1 VALUES (0.3762),(0.3845),(0.6158),(0.7941); +INSERT INTO t2 VALUES (1.3762),(1.3845),(1.6158),(1.7941); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +explain select max(key1) from t1 where key1 <= 0.6158; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)` from `test`.`t1` where (`test`.`t1`.`key1` <= 0.6158) +explain select max(key2) from t2 where key2 <= 1.6158; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t2`.`key2`) AS `max(key2)` from `test`.`t2` where (`test`.`t2`.`key2` <= 1.6158) +explain select min(key1) from t1 where key1 >= 0.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where (`test`.`t1`.`key1` >= 0.3762) +explain select min(key2) from t2 where key2 >= 1.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t2`.`key2`) AS `min(key2)` from `test`.`t2` where (`test`.`t2`.`key2` >= 1.3762) +explain select max(key1), min(key2) from t1, t2 +where key1 <= 0.6158 and key2 >= 1.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)`,min(`test`.`t2`.`key2`) AS `min(key2)` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`key1` <= 0.6158) and (`test`.`t2`.`key2` >= 1.3762)) +explain select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range key1 key1 9 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` <= 0.6158) and ((rand() + 0.5) >= 0.5)) +explain select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index key1 key1 9 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` >= 0.3762) and ((rand() + 0.5) >= 0.5)) +select max(key1) from t1 where key1 <= 0.6158; +max(key1) +0.6158 +select max(key2) from t2 where key2 <= 1.6158; +max(key2) +1.6158 +select min(key1) from t1 where key1 >= 0.3762; +min(key1) +0.3762 +select min(key2) from t2 where key2 >= 1.3762; +min(key2) +1.3762 +select max(key1), min(key2) from t1, t2 +where key1 <= 0.6158 and key2 >= 1.3762; +max(key1) min(key2) +0.6158 1.3762 +select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; +max(key1) +0.6158 +select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; +min(key1) +0.3762 +DROP TABLE t1,t2; +CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL); +INSERT INTO t1 VALUES (10); +SELECT i='1e+01',i=1e+01, i in (1e+01,1e+01), i in ('1e+01','1e+01') FROM t1; +i='1e+01' i=1e+01 i in (1e+01,1e+01) i in ('1e+01','1e+01') +1 1 1 1 +DROP TABLE t1; +create table t1(a bigint unsigned, b bigint); +insert ignore into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff), +(0x10000000000000000, 0x10000000000000000), +(0x8fffffffffffffff, 0x8fffffffffffffff); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'a' at row 2 +Warning 1264 Out of range value for column 'b' at row 2 +Warning 1264 Out of range value for column 'b' at row 3 +select hex(a), hex(b) from t1; +hex(a) hex(b) +FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +8FFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +drop table t1; +CREATE TABLE t1 (c0 int); +CREATE TABLE t2 (c0 int); +INSERT INTO t1 VALUES(@@connect_timeout); +INSERT INTO t2 VALUES(@@connect_timeout); +SELECT * FROM t1 JOIN t2 ON t1.c0 = t2.c0 WHERE (t1.c0 <=> @@connect_timeout); +c0 c0 +X X +DROP TABLE t1, t2; +End of 4.1 tests +CREATE TABLE t1 ( +K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', +K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', +F2I4 int(11) NOT NULL default '0' +) DEFAULT CHARSET=latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +('W%RT', '0100', 1), +('W-RT', '0100', 1), +('WART', '0100', 1), +('WART', '0200', 1), +('WERT', '0100', 2), +('WORT','0200', 2), +('WT', '0100', 2), +('W_RT', '0100', 2), +('WaRT', '0100', 3), +('WART', '0300', 3), +('WRT' , '0400', 3), +('WURM', '0500', 3), +('W%T', '0600', 4), +('WA%T', '0700', 4), +('WA_T', '0800', 4); +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND +(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); +K2C4 K4N4 F2I4 +WART 0200 1 +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); +K2C4 K4N4 F2I4 +WART 0100 1 +WART 0200 1 +WART 0300 3 +DROP TABLE t1; +create table t1 (a int, b int); +create table t2 like t1; +select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; +a +select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; +a +select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; +a a a +drop table t1,t2; +create table t1 (s1 varchar(5)); +insert into t1 values ('Wall'); +select min(s1) from t1 group by s1 with rollup; +min(s1) +Wall +Wall +drop table t1; +create table t1 (s1 int); +insert into t1 values (0); +select avg(distinct s1) from t1 group by s1 with rollup; +avg(distinct s1) +0.0000 +0.0000 +drop table t1; +create table t1 (s1 int); +insert into t1 values (null),(1); +select avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +1.0000 +select distinct avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +drop table t1; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +INSERT INTO t2 VALUES (2), (4), (6); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +a +2 +4 +EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 3 33.33 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` straight_join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`a`) +EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 20.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`) +DROP TABLE t1,t2; +select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; +x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 +16 16 2 2 +create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); +insert into t1 values (" 2", 2); +insert into t2 values (" 2", " one "),(" 2", " two "); +select * from t1 left join t2 on f1 = f3; +f1 f2 f3 f4 + 2 2 2 one + 2 2 2 two +drop table t1,t2; +create table t1 (empnum smallint, grp int); +create table t2 (empnum int, name char(5)); +insert into t1 values(1,1); +insert into t2 values(1,'bob'); +create view v1 as select * from t2 inner join t1 using (empnum); +select * from v1; +empnum name grp +1 bob 1 +drop table t1,t2; +drop view v1; +create table t1 (pk int primary key, b int); +create table t2 (pk int primary key, c int); +select pk from t1 inner join t2 using (pk); +pk +drop table t1,t2; +create table t1 (s1 int, s2 char(5), s3 decimal(10)); +create view v1 as select s1, s2, 'x' as s3 from t1; +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'x' +insert into t1 values (1,'x',5); +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'x' +drop table t1; +drop view v1; +create table t1(a1 int); +create table t2(a2 int); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +create view v2 (c) as select a1 from t1; +select * from t1 natural left join t2; +a1 a2 +1 1 +1 2 +2 1 +2 2 +select * from t1 natural right join t2; +a2 a1 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural left join t2; +c a2 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural right join t2; +a2 c +1 1 +1 2 +2 1 +2 2 +drop table t1, t2; +drop view v2; +create table t1 (a int(10), t1_val int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (b int(10), t2_val int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t3 (a int(10), b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,1),(2,2); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(2,1),(3,1),(4,1); +select * from t1 natural join t2 natural join t3; +a b t1_val t2_val +1 1 1 1 +2 1 2 1 +select * from t1 natural join t3 natural join t2; +b a t1_val t2_val +1 1 1 1 +1 2 2 1 +drop table t1, t2, t3; +DO IFNULL(NULL, NULL); +SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); +CAST(IFNULL(NULL, NULL) AS DECIMAL) +NULL +SELECT ABS(IFNULL(NULL, NULL)); +ABS(IFNULL(NULL, NULL)) +NULL +SELECT IFNULL(NULL, NULL); +IFNULL(NULL, NULL) +NULL +SET @OLD_SQL_MODE12595=@@SQL_MODE, @@SQL_MODE=''; +SHOW LOCAL VARIABLES LIKE 'SQL_MODE'; +Variable_name Value +sql_mode +CREATE TABLE BUG_12595(a varchar(100)) charset latin1; +INSERT INTO BUG_12595 VALUES ('hakan%'), ('hakank'), ("ha%an"); +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE ''; +a +hakan% +hakank +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE ''; +a +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha%%an' ESCAPE '%'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE '\\'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|'; +a +ha%an +SET @@SQL_MODE='NO_BACKSLASH_ESCAPES'; +SHOW LOCAL VARIABLES LIKE 'SQL_MODE'; +Variable_name Value +sql_mode NO_BACKSLASH_ESCAPES +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%'; +a +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE '\\'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE ''; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\n%' ESCAPE '\n'; +ERROR HY000: Incorrect arguments to ESCAPE +SET @@SQL_MODE=@OLD_SQL_MODE12595; +DROP TABLE BUG_12595; +create table t1 (a char(1)); +create table t2 (a char(1)); +insert into t1 values ('a'),('b'),('c'); +insert into t2 values ('b'),('c'),('d'); +select a from t1 natural join t2; +a +b +c +select * from t1 natural join t2 where a = 'b'; +a +b +drop table t1, t2; +CREATE TABLE t1 (`id` TINYINT); +CREATE TABLE t2 (`id` TINYINT); +CREATE TABLE t3 (`id` TINYINT); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +drop table t1, t2, t3; +create table t1 (a int(10),b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (a int(10),b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,10),(2,20),(3,30); +insert into t2 values (1,10); +select * from t1 inner join t2 using (A); +a b b +1 10 10 +select * from t1 inner join t2 using (a); +a b b +1 10 10 +drop table t1, t2; +create table t1 (a int, c int); +create table t2 (b int); +create table t3 (b int, a int); +create table t4 (c int); +insert into t1 values (1,1); +insert into t2 values (1); +insert into t3 values (1,1); +insert into t4 values (1); +select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +a c b b a +1 1 1 1 1 +select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +ERROR 42S22: Unknown column 't1.a' in 'on clause' +select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); +a c b b a c +1 1 1 1 1 1 +select * from t1 join t2 join t4 using (c); +c a b +1 1 1 +drop table t1, t2, t3, t4; +create table t1(x int, y int); +create table t2(x int, y int); +create table t3(x int, primary key(x)); +insert into t1 values (1, 1), (2, 1), (3, 1), (4, 3), (5, 6), (6, 6); +insert into t2 values (1, 1), (2, 1), (3, 3), (4, 6), (5, 6); +insert into t3 values (1), (2), (3), (4), (5); +select t1.x, t3.x from t1, t2, t3 where t1.x = t2.x and t3.x >= t1.y and t3.x <= t2.y; +x x +1 1 +2 1 +3 1 +3 2 +3 3 +4 3 +4 4 +4 5 +drop table t1,t2,t3; +create table t1 (id char(16) not null default '', primary key (id)); +insert into t1 values ('100'),('101'),('102'); +create table t2 (id char(16) default null); +insert into t2 values (1); +create view v1 as select t1.id from t1; +create view v2 as select t2.id from t2; +create view v3 as select (t1.id+2) as id from t1 natural left join t2; +select t1.id from t1 left join v2 using (id); +id +100 +101 +102 +select t1.id from v2 right join t1 using (id); +id +100 +101 +102 +select t1.id from t1 left join v3 using (id); +id +100 +101 +102 +select * from t1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join t1 using (id); +id +100 +101 +102 +select * from t1 left join v3 using (id); +id +100 +101 +102 +select v1.id from v1 left join v2 using (id); +id +100 +101 +102 +select v1.id from v2 right join v1 using (id); +id +100 +101 +102 +select v1.id from v1 left join v3 using (id); +id +100 +101 +102 +select * from v1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join v1 using (id); +id +100 +101 +102 +select * from v1 left join v3 using (id); +id +100 +101 +102 +drop table t1, t2; +drop view v1, v2, v3; +create table t1 (id int(11) not null default '0'); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (123),(191),(192); +create table t2 (id char(16) character set utf8 not null); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t2 values ('58013'),('58014'),('58015'),('58016'); +create table t3 (a_id int(11) not null, b_id char(16) character set utf8); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t3 values (123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013'); +select count(*) +from t1 inner join (t3 left join t2 on t2.id = t3.b_id) on t1.id = t3.a_id; +count(*) +6 +select count(*) +from t1 inner join (t2 right join t3 on t2.id = t3.b_id) on t1.id = t3.a_id; +count(*) +6 +drop table t1,t2,t3; +create table t1 (a int); +create table t2 (b int); +create table t3 (c int); +select * from t1 join t2 join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 left join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 right join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 straight_join t3 on (t1.a=t3.c); +a b c +drop table t1, t2 ,t3; +create table t1(f1 int, f2 date); +insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'), +(4,'2005-10-01'),(5,'2005-12-30'); +select * from t1 where f2 >= 0 order by f2; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +select * from t1 where f2 >= '0000-00-00' order by f2; +ERROR HY000: Incorrect DATE value: '0000-00-00' +select * from t1 where f2 >= '2005-09-31' order by f2; +ERROR HY000: Incorrect DATE value: '2005-09-31' +select * from t1 where f2 >= '2005-09-3a' order by f2; +f1 f2 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +select * from t1 where f2 <= '2005-09-31' order by f2; +ERROR HY000: Incorrect DATE value: '2005-09-31' +select * from t1 where f2 <= '2005-09-3a' order by f2; +f1 f2 +1 2005-01-01 +2 2005-09-01 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +drop table t1; +create table t1 (f1 int, f2 int); +insert into t1 values (1, 30), (2, 20), (3, 10); +create algorithm=merge view v1 as select f1, f2 from t1; +create algorithm=merge view v2 (f2, f1) as select f1, f2 from t1; +create algorithm=merge view v3 as select t1.f1 as f2, t1.f2 as f1 from t1; +select t1.f1 as x1, f1 from t1 order by t1.f1; +x1 f1 +1 1 +2 2 +3 3 +select v1.f1 as x1, f1 from v1 order by v1.f1; +x1 f1 +1 1 +2 2 +3 3 +select v2.f1 as x1, f1 from v2 order by v2.f1; +x1 f1 +10 10 +20 20 +30 30 +select v3.f1 as x1, f1 from v3 order by v3.f1; +x1 f1 +10 10 +20 20 +30 30 +select f1, f2, v1.f1 as x1 from v1 order by v1.f1; +f1 f2 x1 +1 30 1 +2 20 2 +3 10 3 +select f1, f2, v2.f1 as x1 from v2 order by v2.f1; +f1 f2 x1 +10 3 10 +20 2 20 +30 1 30 +select f1, f2, v3.f1 as x1 from v3 order by v3.f1; +f1 f2 x1 +10 3 10 +20 2 20 +30 1 30 +drop table t1; +drop view v1, v2, v3; +CREATE TABLE t1(key_a int4 NOT NULL, optimus varchar(32), PRIMARY KEY(key_a)); +CREATE TABLE t2(key_a int4 NOT NULL, prime varchar(32), PRIMARY KEY(key_a)); +CREATE table t3(key_a int4 NOT NULL, key_b int4 NOT NULL, foo varchar(32), +PRIMARY KEY(key_a,key_b)); +INSERT INTO t1 VALUES (0,''); +INSERT INTO t1 VALUES (1,'i'); +INSERT INTO t1 VALUES (2,'j'); +INSERT INTO t1 VALUES (3,'k'); +INSERT INTO t2 VALUES (1,'r'); +INSERT INTO t2 VALUES (2,'s'); +INSERT INTO t2 VALUES (3,'t'); +INSERT INTO t3 VALUES (1,5,'x'); +INSERT INTO t3 VALUES (1,6,'y'); +INSERT INTO t3 VALUES (2,5,'xx'); +INSERT INTO t3 VALUES (2,6,'yy'); +INSERT INTO t3 VALUES (2,7,'zz'); +INSERT INTO t3 VALUES (3,5,'xxx'); +SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +key_a foo +2 xx +EXPLAIN SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t3 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `key_a`,'xx' AS `foo` from `test`.`t1` join `test`.`t2` join `test`.`t3` where true +SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +key_a foo +2 xx +EXPLAIN SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t3 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `key_a`,'xx' AS `foo` from `test`.`t1` join `test`.`t2` join `test`.`t3` where true +DROP TABLE t1,t2,t3; +create table t1 (f1 int); +insert into t1 values(1),(2); +create table t2 (f2 int, f3 int, key(f2)); +insert into t2 values(1,1),(2,2); +create table t3 (f4 int not null); +insert into t3 values (2),(2),(2); +select f1,(select count(*) from t2,t3 where f2=f1 and f3=f4) as count from t1; +f1 count +1 0 +2 3 +drop table t1,t2,t3; +create table t1 (f1 int unique); +create table t2 (f2 int unique); +create table t3 (f3 int unique); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +insert into t3 values(1),(NULL); +select * from t3 where f3 is null; +f3 +NULL +select t2.f2 from t1 left join t2 on f1=f2 join t3 on f1=f3 where f1=1; +f2 +1 +drop table t1,t2,t3; +create table t1(f1 char, f2 char not null); +insert into t1 values(null,'a'); +create table t2 (f2 char not null); +insert into t2 values('b'); +select * from t1 left join t2 on f1=t2.f2 where t1.f2='a'; +f1 f2 f2 +NULL a NULL +drop table t1,t2; +select * from (select * left join t on f1=f2) tt; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left join t on f1=f2) tt' at line 1 +CREATE TABLE t1 (sku int PRIMARY KEY, pr int); +CREATE TABLE t2 (sku int PRIMARY KEY, sppr int, name varchar(255)); +INSERT INTO t1 VALUES +(10, 10), (20, 10), (30, 20), (40, 30), (50, 10), (60, 10); +INSERT INTO t2 VALUES +(10, 10, 'aaa'), (20, 10, 'bbb'), (30, 10, 'ccc'), (40, 20, 'ddd'), +(50, 10, 'eee'), (60, 20, 'fff'), (70, 20, 'ggg'), (80, 30, 'hhh'); +SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr +FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku); +sku sppr name sku pr +20 10 bbb 10 10 +20 10 bbb 20 10 +EXPLAIN +SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr +FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select '20' AS `sku`,'10' AS `sppr`,'bbb' AS `name`,`test`.`t1`.`sku` AS `sku`,`test`.`t1`.`pr` AS `pr` from `test`.`t2` join `test`.`t1` where (((`test`.`t1`.`sku` = 20) or (`test`.`t1`.`sku` = '10'))) +DROP TABLE t1,t2; +SET SQL_MODE='NO_UNSIGNED_SUBTRACTION'; +CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL); +INSERT t1 SET i = 0; +UPDATE t1 SET i = -1; +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +UPDATE t1 SET i = CAST(i - 1 AS SIGNED); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +UPDATE t1 SET i = i - 1; +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +DROP TABLE t1; +SET SQL_MODE=default; +create table t1 (a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t2 (a int, b int, c int, e int, primary key(a,b,c)); +# The "ANALYZE TABLE"-command that is executed further down will get +# different results depending on the order of rows in table t2. Since the +# INSERT INTO ... SELECT may be executed using different execution plans, +# we've added ORDER BY to ensure that we rows has the same order every +# time. If not, the estimated number of rows for t2 (alias 'a') in the +# EXPLAIN may change on different platforms. Note that both table t1 and +# t2 may be MYISAM, since many of the test files that includes this file +# forces MYISAM as the default storage engine. +insert into t2 select A.a, B.a, C.a, C.a from t1 A, t1 B, t1 C +ORDER BY A.a, B.a, C.a; +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select 'In next EXPLAIN, B.rows must be exactly 10:' Z; +Z +In next EXPLAIN, B.rows must be exactly 10: +explain select * from t2 a, t2 b where a.a=5 and a.b=5 and a.c<5 +and b.a=5 and b.b=a.e and (b.b =1 or b.b = 3 or b.b=5); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 27.10 Parallel execute (1 workers) +2 SIMPLE a NULL range PRIMARY PRIMARY 12 NULL 5 27.10 Using where +2 SIMPLE b NULL ref PRIMARY PRIMARY 8 const,test.a.e 10 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`b` AS `b`,`test`.`a`.`c` AS `c`,`test`.`a`.`e` AS `e`,`test`.`b`.`a` AS `a`,`test`.`b`.`b` AS `b`,`test`.`b`.`c` AS `c`,`test`.`b`.`e` AS `e` from `test`.`t2` `a` join `test`.`t2` `b` where ((`test`.`b`.`b` = `test`.`a`.`e`) and (`test`.`b`.`a` = 5) and (`test`.`a`.`b` = 5) and (`test`.`a`.`a` = 5) and (`test`.`a`.`c` < 5) and ((`test`.`a`.`e` = 1) or (`test`.`a`.`e` = 3) or (`test`.`a`.`e` = 5))) +drop table t1, t2; +CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX(b)); +INSERT INTO t1 VALUES (1, 3), (9,4), (7,5), (4,5), (6,2), +(3,1), (5,1), (8,9), (2,2), (0,9); +CREATE TABLE t2 (c int, d int, f int, INDEX(c,f)); +INSERT INTO t2 VALUES +(1,0,0), (1,0,1), (2,0,0), (2,0,1), (3,0,0), (4,0,1), +(5,0,0), (5,0,1), (6,0,0), (0,0,1), (7,0,0), (7,0,1), +(0,0,0), (0,0,1), (8,0,0), (8,0,1), (9,0,0), (9,0,1); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,b b 5 NULL 3 100.00 Using where; Using index +2 SIMPLE t2 NULL ref c c 5 test.t1.a 1 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2`.`f` AS `f` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` between 4 and 6)) +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6 AND a > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 90.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,b b 9 NULL 3 90.00 Using where; Using index +2 SIMPLE t2 NULL ref c c 5 test.t1.a 1 100.00 Using join buffer (Batched Key Access) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2`.`f` AS `f` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` between 4 and 6) and (`test`.`t1`.`a` > 0)) +DROP TABLE t1, t2; +create table t1 ( +a int unsigned not null auto_increment primary key, +b bit not null, +c bit not null +); +create table t2 ( +a int unsigned not null auto_increment primary key, +b bit not null, +c int unsigned not null, +d varchar(50) +); +insert into t1 (b,c) values (0,1), (0,1); +insert into t2 (b,c) values (0,1); +select t1.a, t1.b + 0, t1.c + 0, t2.a, t2.b + 0, t2.c, t2.d +from t1 left outer join t2 on t1.a = t2.c and t2.b <> 1 +where t1.b <> 1 order by t1.a; +a t1.b + 0 t1.c + 0 a t2.b + 0 c d +1 0 1 1 0 1 NULL +2 0 1 NULL NULL NULL NULL +drop table t1,t2; +SELECT 0.9888889889 * 1.011111411911; +0.9888889889 * 1.011111411911 +0.9998769417899202067879 +prepare stmt from 'select 1 as " a "'; +Warnings: +Warning 1466 Leading spaces are removed from name ' a ' +execute stmt; +a +1 +CREATE TABLE t1 (a int NOT NULL PRIMARY KEY, b int NOT NULL); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +CREATE TABLE t2 (c int NOT NULL, INDEX idx(c)); +INSERT INTO t2 VALUES +(1), (1), (1), (1), (1), (1), (1), (1), +(2), (2), (2), (2), +(3), (3), +(4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL ref idx idx 4 const 8 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '1' AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = '1')) +EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=4; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL ref idx idx 4 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '4' AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = '4')) +DROP TABLE t1, t2; +CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a int); +INSERT INTO t1 VALUES (1,2), (2,NULL), (3,2); +CREATE TABLE t2 (b int, c INT, INDEX idx1(b)); +INSERT INTO t2 VALUES (2,1), (3,2); +CREATE TABLE t3 (d int, e int, INDEX idx1(d)); +INSERT INTO t3 VALUES (2,10), (2,20), (1,30), (2,40), (2,50); +EXPLAIN +SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id +WHERE t1.id=2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL const idx1 NULL NULL NULL 1 100.00 Impossible ON condition +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL const idx1 NULL NULL NULL 1 100.00 Impossible ON condition +2 SIMPLE t3 NULL ref idx1 idx1 5 const 4 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `id`,NULL AS `a`,NULL AS `b`,NULL AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t3`.`e` AS `e` from `test`.`t1` left join `test`.`t2` on(multiple equal(NULL, NULL)) join `test`.`t3` where (`test`.`t3`.`d` = 2) +SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id +WHERE t1.id=2; +id a b c d e +2 NULL NULL NULL 2 10 +2 NULL NULL NULL 2 20 +2 NULL NULL NULL 2 40 +2 NULL NULL NULL 2 50 +DROP TABLE t1,t2,t3; +create table t1 (c1 varchar(1), c2 int, c3 int, c4 int, c5 int, c6 int, +c7 int, c8 int, c9 int, fulltext key (`c1`)); +select distinct match (`c1`) against ('z') , c2, c3, c4,c5, c6,c7, c8 +from t1 where c9=1 order by c2, c2; +match (`c1`) against ('z') c2 c3 c4 c5 c6 c7 c8 +drop table t1; +CREATE TABLE t1 (pk varchar(10) PRIMARY KEY, fk varchar(16)) charset utf8mb4; +CREATE TABLE t2 (pk varchar(16) PRIMARY KEY, fk varchar(10)) charset utf8mb4; +INSERT INTO t1 VALUES +('d','dddd'), ('i','iii'), ('a','aa'), ('b','bb'), ('g','gg'), +('e','eee'), ('c','cccc'), ('h','hhh'), ('j','jjj'), ('f','fff'); +INSERT INTO t2 VALUES +('jjj', 'j'), ('cc','c'), ('ccc','c'), ('aaa', 'a'), ('jjjj','j'), +('hhh','h'), ('gg','g'), ('fff','f'), ('ee','e'), ('ffff','f'), +('bbb','b'), ('ff','f'), ('cccc','c'), ('dddd','d'), ('jj','j'), +('aaaa','a'), ('bb','b'), ('eeee','e'), ('aa','a'), ('hh','h'); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk < 'c' AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` < 'c')) +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk BETWEEN 'a' AND 'b' AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` between 'a' and 'b')) +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk IN ('a','b') AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` in ('a','b'))) +DROP TABLE t1,t2; +CREATE TABLE t1 (a int, b varchar(20) NOT NULL, PRIMARY KEY(a)) charset utf8mb4; +CREATE TABLE t2 (a int, b varchar(20) NOT NULL, +PRIMARY KEY (a), UNIQUE KEY (b)) charset utf8mb4; +INSERT INTO t1 VALUES (1,'a'),(2,'b'),(3,'c'); +INSERT INTO t2 VALUES (1,'a'),(2,'b'),(3,'c'); +EXPLAIN SELECT t1.a FROM t1 LEFT JOIN t2 ON t2.b=t1.b WHERE t1.a=3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL const b b 82 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '3' AS `a` from `test`.`t1` left join `test`.`t2` on(multiple equal('c', 'c')) where true +DROP TABLE t1,t2; +CREATE TABLE t1(id int PRIMARY KEY, b int, e int); +CREATE TABLE t2(i int, a int, INDEX si(i), INDEX ai(a)); +CREATE TABLE t3(a int PRIMARY KEY, c char(4), INDEX ci(c)); +INSERT INTO t1 VALUES +(1,10,19), (2,20,22), (4,41,42), (9,93,95), (7, 77,79), +(6,63,67), (5,55,58), (3,38,39), (8,81,89); +INSERT INTO t2 VALUES +(21,210), (41,410), (82,820), (83,830), (84,840), +(65,650), (51,510), (37,370), (94,940), (76,760), +(22,220), (33,330), (40,400), (95,950), (38,380), +(67,670), (88,880), (57,570), (96,960), (97,970); +INSERT INTO t3 VALUES +(210,'bb'), (950,'ii'), (400,'ab'), (500,'ee'), (220,'gg'), +(440,'gg'), (310,'eg'), (380,'ee'), (840,'bb'), (830,'ff'), +(230,'aa'), (960,'ii'), (410,'aa'), (510,'ee'), (290,'bb'), +(450,'gg'), (320,'dd'), (390,'hh'), (850,'jj'), (860,'ff'); +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 +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si si 5 NULL 4 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` FORCE INDEX (`si`) join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t2`.`i` between '81' and '89') and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2,t3 +WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee') ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si,ai si 5 NULL 4 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t2`.`i` between '81' and '89') and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND +t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si si 5 NULL 2 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` FORCE INDEX (`si`) join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((`test`.`t2`.`i` = '81') or (`test`.`t2`.`i` = '89')) and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2,t3 +WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND +t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si,ai si 5 NULL 2 100.00 Using index condition; Using where; Using MRR +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((`test`.`t2`.`i` = '81') or (`test`.`t2`.`i` = '89')) and (`test`.`t3`.`c` in ('bb','ee'))) +DROP TABLE t1,t2,t3; +CREATE TABLE t1 ( f1 int primary key, f2 int, f3 int, f4 int, f5 int, f6 int, checked_out int); +CREATE TABLE t2 ( f11 int PRIMARY KEY ); +INSERT INTO t1 VALUES (1,1,1,0,0,0,0),(2,1,1,3,8,1,0),(3,1,1,4,12,1,0); +INSERT INTO t2 VALUES (62); +SELECT * FROM t1 LEFT JOIN t2 ON f11 = t1.checked_out GROUP BY f1 ORDER BY f2, f3, f4, f5 LIMIT 0, 1; +f1 f2 f3 f4 f5 f6 checked_out f11 +1 1 1 0 0 0 0 NULL +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(a int); +INSERT into t1 values (1), (2), (3); +SELECT * FROM t1 LIMIT 2, -1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1 +DROP TABLE t1; +set optimizer_switch='index_merge=off'; +CREATE TABLE t1 ( +ID_with_null int NULL, +ID_better int NOT NULL, +INDEX idx1 (ID_with_null), +INDEX idx2 (ID_better) +); +INSERT INTO t1 VALUES (1,1), (2,1), (null,3), (null,3), (null,3), (null,3); +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SELECT COUNT(*) FROM t1 WHERE ID_with_null IS NULL; +COUNT(*) +128 +SELECT COUNT(*) FROM t1 WHERE ID_better=1; +COUNT(*) +2 +EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 98.46 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 98.46 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID_with_null` AS `ID_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID_with_null` is null)) +DROP INDEX idx1 ON t1; +CREATE UNIQUE INDEX idx1 ON t1(ID_with_null); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 98.46 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 98.46 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID_with_null` AS `ID_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID_with_null` is null)) +DROP TABLE t1; +CREATE TABLE t1 ( +ID1_with_null int NULL, +ID2_with_null int NULL, +ID_better int NOT NULL, +INDEX idx1 (ID1_with_null, ID2_with_null), +INDEX idx2 (ID_better) +) ; +INSERT INTO t1 VALUES (1,1,1), (2,2,1), (3,null,3), (null,3,3), (null,null,3), +(3,null,3), (null,3,3), (null,null,3), (3,null,3), (null,3,3), (null,null,3); +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null=3; +COUNT(*) +24 +SELECT COUNT(*) FROM t1 WHERE ID1_with_null=3 AND ID2_with_null IS NULL; +COUNT(*) +24 +SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null IS NULL; +COUNT(*) +192 +SELECT COUNT(*) FROM t1 WHERE ID_better=1; +COUNT(*) +2 +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID2_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID1_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and ((`test`.`t1`.`ID2_with_null` = 3) is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 79.34 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 79.34 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and (`test`.`t1`.`ID2_with_null` is null)) +DROP INDEX idx1 ON t1; +CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID2_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null IS NULL ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID1_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID2_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 79.34 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 79.34 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and (`test`.`t1`.`ID2_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND +(ID2_with_null=1 OR ID2_with_null=2); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 2.50 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 2.50 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and ((`test`.`t1`.`ID2_with_null` = 1) or (`test`.`t1`.`ID2_with_null` = 2))) +DROP TABLE t1; +set optimizer_switch='index_merge=on'; +CREATE TABLE t1 (a INT, ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY ts(ts)); +INSERT INTO t1 VALUES (30,"2006-01-03 23:00:00"), (31,"2006-01-03 23:00:00"); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CREATE TABLE t2 (a INT, dt1 DATETIME, dt2 DATETIME, PRIMARY KEY (a)); +INSERT INTO t2 VALUES (30, "2006-01-01 00:00:00", "2999-12-31 00:00:00"); +INSERT INTO t2 SELECT a+1,dt1,dt2 FROM t2; +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +EXPLAIN +SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 +AND t1.ts BETWEEN t2.dt1 AND t2.dt2 +AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t1 NULL range ts ts 4 NULL 2 50.00 Using index condition; Using where; Using MRR +Warnings: +Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`ts` AS `ts`,'30' AS `a`,'2006-01-01 00:00:00' AS `dt1`,'2999-12-31 00:00:00' AS `dt2` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = 30) and (`test`.`t1`.`ts` between '2006-01-01 00:00:00' and '2999-12-31 00:00:00') and (`test`.`t1`.`ts` between '2006-01-01' and '2006-12-31')) +SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 +AND t1.ts BETWEEN t2.dt1 AND t2.dt2 +AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; +a ts a dt1 dt2 +30 2006-01-03 23:00:00 30 2006-01-01 00:00:00 2999-12-31 00:00:00 +Warnings: +Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 +DROP TABLE t1,t2; +create table t1 (a bigint unsigned); +insert into t1 values +(if(1, 9223372036854775808, 1)), +(case when 1 then 9223372036854775808 else 1 end), +(coalesce(9223372036854775808, 1)); +select * from t1; +a +9223372036854775808 +9223372036854775808 +9223372036854775808 +drop table t1; +create table t1 charset utf8mb4 select +if(1, 9223372036854775808, 1) i, +case when 1 then 9223372036854775808 else 1 end c, +coalesce(9223372036854775808, 1) co; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` decimal(19,0) NOT NULL DEFAULT '0', + `c` decimal(19,0) NOT NULL DEFAULT '0', + `co` decimal(19,0) NOT NULL DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +select +if(1, cast(1111111111111111111 as unsigned), 1) i, +case when 1 then cast(1111111111111111111 as unsigned) else 1 end c, +coalesce(cast(1111111111111111111 as unsigned), 1) co; +i c co +1111111111111111111 1111111111111111111 1111111111111111111 +CREATE TABLE t1 (name varchar(255)) charset latin1; +CREATE TABLE t2 (name varchar(255), n int, KEY (name(3))) charset latin1; +INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); +INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); +INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); +INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT * FROM t2; +name n +bb 1 +aa 2 +cc 3 +cc  4 +cc 5 +bb 6 +cc 7 +SELECT * FROM t2 ORDER BY name; +name n +aa 2 +bb 1 +bb 6 +cc  4 +cc 3 +cc 5 +cc 7 +SELECT name, LENGTH(name), n FROM t2 ORDER BY name; +name LENGTH(name) n +aa 2 2 +bb 2 1 +bb 3 6 +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref name name 6 const 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` = 'cc ') +SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +name LENGTH(name) n +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +name LENGTH(name) n +cc 5 3 +cc  4 4 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') order by `test`.`t2`.`name` +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +name LENGTH(name) n +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +2 SIMPLE t2 NULL ref name name 6 test.t1.name 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`name` AS `name`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`n` AS `n` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`name` = `test`.`t1`.`name`)) where true +SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +name name n +aa aa 2 +aa aa 2 +bb bb 1 +bb bb 6 +cc cc 5 +cc cc 7 +cc cc 3 +ccc NULL NULL +DROP TABLE t1,t2; +CREATE TABLE t1 (name text) charset latin1; +CREATE TABLE t2 (name text, n int, KEY (name(3))) charset latin1; +INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); +INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); +INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); +INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT * FROM t2; +name n +bb 1 +aa 2 +cc 3 +cc  4 +cc 5 +bb 6 +cc 7 +SELECT * FROM t2 ORDER BY name; +name n +aa 2 +bb 1 +bb 6 +cc  4 +cc 3 +cc 5 +cc 7 +SELECT name, LENGTH(name), n FROM t2 ORDER BY name; +name LENGTH(name) n +aa 2 2 +bb 2 1 +bb 3 6 +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ref name name 6 const 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` = 'cc ') +SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +name LENGTH(name) n +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +name LENGTH(name) n +cc 5 3 +cc  4 4 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') order by `test`.`t2`.`name` +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +name LENGTH(name) n +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref name name 6 test.t1.name 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`name` AS `name`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`n` AS `n` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`name` = `test`.`t1`.`name`)) where true +SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +name name n +aa aa 2 +aa aa 2 +bb bb 1 +bb bb 6 +cc cc 5 +cc cc 7 +cc cc 3 +ccc NULL NULL +DROP TABLE t1,t2; +CREATE TABLE t1 ( +access_id int NOT NULL default '0', +name varchar(20) default NULL, +`rank` int NOT NULL default '0', +KEY idx (access_id) +); +CREATE TABLE t2 ( +faq_group_id int NOT NULL default '0', +faq_id int NOT NULL default '0', +access_id int default NULL, +UNIQUE KEY idx1 (faq_id), +KEY idx2 (faq_group_id,faq_id) +); +INSERT INTO t1 VALUES +(1,'Everyone',2),(2,'Help',3),(3,'Technical Support',1),(4,'Chat User',4); +INSERT INTO t2 VALUES +(261,265,1),(490,494,1); +SELECT t2.faq_id +FROM t1 INNER JOIN t2 IGNORE INDEX (idx1) +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +SELECT t2.faq_id +FROM t1 INNER JOIN t2 +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +DROP TABLE t1,t2; +CREATE TABLE t1 (a INT, b INT, KEY inx (b,a)); +INSERT INTO t1 VALUES (1,1), (1,2), (1,3), (1,4), (1,5), (1, 6), (1,7); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT COUNT(*) FROM t1 f1 INNER JOIN t1 f2 +ON ( f1.b=f2.b AND f1.a NULL ALL NULL NULL NULL NULL 7 100.00 Parallel execute (1 workers) +2 SIMPLE f1 NULL index inx inx 10 NULL 7 100.00 Using where; Using index +2 SIMPLE f2 NULL ref inx inx 5 test.f1.b 1 33.33 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` `f1` join `test`.`t1` `f2` where ((`test`.`f2`.`b` = `test`.`f1`.`b`) and (`test`.`f1`.`b` not in (100,2232,3343,51111)) and (`test`.`f1`.`a` < `test`.`f2`.`a`)) +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 INT); +INSERT INTO t1 VALUES (1,11), (2,22), (2,22); +EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2)))))))))))))))))))))))))))))) > 0; +EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) > 0; +ERROR HY000: Too high level of nesting for select +DROP TABLE t1; +CREATE TABLE t1 ( +c1 int(11) NOT NULL AUTO_INCREMENT, +c2 varchar(1000) DEFAULT NULL, +c3 bigint(20) DEFAULT NULL, +c4 bigint(20) DEFAULT NULL, +PRIMARY KEY (c1) +) charset utf8mb4; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN +SELECT join_2.c1 +FROM +t1 AS join_0, +t1 AS join_1, +t1 AS join_2, +t1 AS join_3, +t1 AS join_4, +t1 AS join_5, +t1 AS join_6, +t1 AS join_7 +WHERE +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +OR +join_0.c2 < '?' AND +join_1.c2 < '?' AND +join_2.c2 > '?' AND +join_2.c2 < '!' AND +join_3.c2 > '?' AND +join_4.c2 = '?' AND +join_5.c2 <> '?' AND +join_6.c2 <> '?' AND +join_7.c2 >= '?' AND +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +GROUP BY +join_3.c1, +join_2.c1, +join_7.c1, +join_1.c1, +join_0.c1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL # 1 100.00 # +2 SIMPLE join_0 NULL ALL PRIMARY NULL NULL # 1 100.00 # +2 SIMPLE join_1 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_2 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_3 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_4 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_5 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_6 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_7 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +Warnings: +Note 1003 /* select#1 */ select `test`.`join_2`.`c1` AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where (((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`)) or ((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c2` = '?') and (`test`.`join_0`.`c2` < '?') and (`test`.`join_1`.`c2` < '?') and (`test`.`join_2`.`c2` > '?') and (`test`.`join_2`.`c2` < '!') and (`test`.`join_3`.`c2` > '?') and (`test`.`join_5`.`c2` <> '?') and (`test`.`join_6`.`c2` <> '?') and (`test`.`join_7`.`c2` >= '?'))) group by `test`.`join_3`.`c1`,`test`.`join_2`.`c1`,`test`.`join_7`.`c1`,`test`.`join_1`.`c1`,`test`.`join_0`.`c1` +SHOW WARNINGS; +Level Code Message +Note 1003 /* select#1 */ select `test`.`join_2`.`c1` AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where (((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`)) or ((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c2` = '?') and (`test`.`join_0`.`c2` < '?') and (`test`.`join_1`.`c2` < '?') and (`test`.`join_2`.`c2` > '?') and (`test`.`join_2`.`c2` < '!') and (`test`.`join_3`.`c2` > '?') and (`test`.`join_5`.`c2` <> '?') and (`test`.`join_6`.`c2` <> '?') and (`test`.`join_7`.`c2` >= '?'))) group by `test`.`join_3`.`c1`,`test`.`join_2`.`c1`,`test`.`join_7`.`c1`,`test`.`join_1`.`c1`,`test`.`join_0`.`c1` +DROP TABLE t1; +SELECT 1 AS ` `; + +1 +Warnings: +Warning 1474 Name ' ' has become '' +SELECT 1 AS ` `; + +1 +Warnings: +Warning 1474 Name ' ' has become '' +SELECT 1 AS ` x`; +x +1 +Warnings: +Warning 1466 Leading spaces are removed from name ' x' +CREATE VIEW v1 AS SELECT 1 AS ``; +ERROR 42000: Incorrect column name '' +CREATE VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT (SELECT 1 AS ` `); +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` x`; +Warnings: +Warning 1466 Leading spaces are removed from name ' x' +SELECT `x` FROM v1; +x +1 +ALTER VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +DROP VIEW v1; +select str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' + and '2007/10/20 00:00:00 GMT'; +str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' + and '2007/10/20 00:00:00 GMT' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT' +Warning 1292 Truncated incorrect date value: '2007/10/20 00:00:00 GMT' +select str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6'; +str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT-6' +select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6'; +ERROR HY000: Incorrect DATE value: '2007/10/2000:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007-10-1 00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007-10-01 x00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:x00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 x12:34:56 GMT-6' +select str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; +str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6' +select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; +str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' +0 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6' +select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56'; +str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56' +1 +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00' +0 +select str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00' +1 +select str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34' +select str_to_date('2007-02-30 12:34','%Y-%m-%d %H:%i') = '2007-02-30 12:34:00'; +ERROR HY000: Incorrect DATETIME value: '2007-02-30 12:34:00' +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00' + and '2007/10/20 00:00:00'; +str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00' + and '2007/10/20 00:00:00' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +set SQL_MODE=TRADITIONAL; +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00 12:34' for function str_to_date +select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01' + and '2007/10/20'; +str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01' + and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +set SQL_MODE=DEFAULT; +select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'; +str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +select str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20'; +str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '' for function str_to_date +select str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '' for function str_to_date +select str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = ''; +ERROR HY000: Incorrect DATETIME value: '' +select str_to_date('1','%Y-%m-%d') = '1'; +ERROR HY000: Incorrect DATE value: '1' +select str_to_date('1','%Y-%m-%d') = '1'; +ERROR HY000: Incorrect DATE value: '1' +select str_to_date('','%Y-%m-%d') = ''; +ERROR HY000: Incorrect DATE value: '' +select str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL; +str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL +0 +Warnings: +Warning 1292 Truncated incorrect date value: '0000-00-00' +select str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00'; +str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00' +NULL +Warnings: +Warning 1292 Truncated incorrect date value: '2000-00-00' +select str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL; +str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL +0 +CREATE TABLE t1 (c11 INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY); +CREATE TABLE t2 (c21 INT UNSIGNED NOT NULL, +c22 INT DEFAULT NULL, +KEY(c21, c22)); +CREATE TABLE t3 (c31 INT UNSIGNED NOT NULL DEFAULT 0, +c32 INT DEFAULT NULL, +c33 INT NOT NULL, +c34 INT UNSIGNED DEFAULT 0, +KEY (c33, c34, c32)); +INSERT INTO t1 values (),(),(),(),(); +INSERT INTO t2 SELECT a.c11, b.c11 FROM t1 a, t1 b; +INSERT INTO t3 VALUES (1, 1, 1, 0), +(2, 2, 0, 0), +(3, 3, 1, 0), +(4, 4, 0, 0), +(5, 5, 1, 0); +SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND +t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND +t3.c33 = 1 AND t2.c22 in (1, 3) +ORDER BY c32; +c32 +1 +1 +3 +3 +5 +5 +SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND +t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND +t3.c33 = 1 AND t2.c22 in (1, 3) +ORDER BY c32 DESC; +c32 +5 +5 +3 +3 +1 +1 +DROP TABLE t1, t2, t3; + +# +# Bug#30736: Row Size Too Large Error Creating a Table and +# Inserting Data. +# +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; + +CREATE TABLE t1( +c1 DECIMAL(10, 2), +c2 FLOAT); + +INSERT INTO t1 VALUES (0, 1), (2, 3), (4, 5); + +CREATE TABLE t2( +c3 DECIMAL(10, 2)) +SELECT +c1 * c2 AS c3 +FROM t1; + +SELECT * FROM t1; +c1 c2 +0.00 1 +2.00 3 +4.00 5 + +SELECT * FROM t2; +c3 +0.00 +6.00 +20.00 + +DROP TABLE t1; +DROP TABLE t2; + +CREATE TABLE t1 (c1 BIGINT NOT NULL); +INSERT INTO t1 (c1) VALUES (1); +SELECT * FROM t1 WHERE c1 > NULL + 1; +c1 +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10) NOT NULL PRIMARY KEY); +INSERT INTO t1 (a) VALUES ('foo0'), ('bar0'), ('baz0'); +SELECT * FROM t1 WHERE a IN (CONCAT('foo', 0), 'bar'); +a +foo0 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +CREATE TABLE t2 (a INT, c INT, KEY(a)); +INSERT INTO t1 VALUES (1, 1), (2, 2); +INSERT INTO t2 VALUES (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), +(2, 1), (2, 2), (2, 3), (2, 4), (2, 5), +(3, 1), (3, 2), (3, 3), (3, 4), (3, 5), +(4, 1), (4, 2), (4, 3), (4, 4), (4, 5); +FLUSH STATUS; +SELECT DISTINCT b FROM t1 LEFT JOIN t2 USING(a) WHERE c <= 3; +b +1 +2 +SHOW STATUS LIKE 'Handler_read%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 13 +Handler_read_last 0 +Handler_read_next 10 +Handler_read_prev 0 +Handler_read_rnd 10 +Handler_read_rnd_next 6 +DROP TABLE t1, t2; +CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0', +f2 int(11) NOT NULL default '0', +f3 bigint(20) NOT NULL default '0', +f4 varchar(255) NOT NULL default '', +PRIMARY KEY (f1), +KEY key1 (f4), +KEY key2 (f2)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t2 (f1 int(11) NOT NULL default '0', +f2 enum('A1','A2','A3') NOT NULL default 'A1', +f3 int(11) NOT NULL default '0', +PRIMARY KEY (f1), +KEY key1 (f3)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0', +f2 datetime NOT NULL default '1980-01-01 00:00:00', +PRIMARY KEY (f1)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1, 1, 1, 'abc'); +insert into t1 values (2, 1, 2, 'def'); +insert into t1 values (3, 1, 2, 'def'); +insert into t2 values (1, 'A1', 1); +insert into t3 values (1, '1980-01-01'); +SELECT a.f3, cr.f4, count(*) count +FROM t2 a +STRAIGHT_JOIN t1 cr ON cr.f2 = a.f1 +LEFT JOIN +(t1 cr2 +JOIN t3 ae2 ON cr2.f3 = ae2.f1 +) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND +cr.f4 = cr2.f4 +GROUP BY a.f3, cr.f4; +f3 f4 count +1 abc 1 +1 def 2 +drop table t1, t2, t3; +CREATE TABLE t1 (a INT KEY, b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a, b FROM t1 WHERE a > 1 AND a = b LIMIT 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 25.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 3 25.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 SELECT a, b FROM t1 WHERE a > 1 AND b = a LIMIT 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 25.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 3 25.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` > 1)) limit 2 +DROP TABLE t1; +# +# Bug#47019: Assertion failed: 0, file .\rt_mbr.c, line 138 when +# forcing a spatial index +# +CREATE TABLE t1(a LINESTRING NOT NULL SRID 0, SPATIAL KEY(a)); +INSERT INTO t1 VALUES +(ST_GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')), +(ST_GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')); +EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t2 NULL ALL a NULL NULL NULL 2 100.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; +1 +1 +1 +1 +1 +EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t2 NULL ALL a NULL NULL NULL 2 100.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` FORCE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); +1 +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug #48291 : crash with row() operator,select into @var, and +# subquery returning multiple rows +# +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (2),(3); +# Should not crash +SELECT 1 FROM t1 WHERE a <> 1 AND NOT +ROW(1,a) <=> ROW(1,(SELECT 1 FROM t1)) +INTO @var0; +ERROR 21000: Subquery returns more than 1 row +DROP TABLE t1; +# +# Bug #48458: simple query tries to allocate enormous amount of +# memory +# +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1(a INT NOT NULL, b YEAR); +INSERT INTO t1 VALUES (); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +CREATE TABLE t2(c INT); +# Should not err out because of out-of-memory +SELECT 1 FROM t2 JOIN t1 ON 1=1 +WHERE a != '1' AND NOT a >= b OR NOT ROW(b,a )<> ROW(a,a); +1 +DROP TABLE t1,t2; +SET sql_mode = default; +# +# Bug #49199: Optimizer handles incorrectly: +# field='const1' AND field='const2' in some cases + +CREATE TABLE t1(a DATETIME NOT NULL); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 00:00:00 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +DROP TABLE t1; +CREATE TABLE t1(a DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2001-01-01') +DROP TABLE t1; +CREATE TABLE t1(a TIMESTAMP NOT NULL NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 00:00:00 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +a b +2001-01-01 00:00:00 2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = DATE'2001-01-01') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b VARCHAR(20) NOT NULL) charset utf8mb4; +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +a b +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = '2001-01-01 00:00:00') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01'; +a b +2001-01-01 00:00:00 2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = '2001-01-01') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT x.a, y.a, z.a FROM t1 x +JOIN t1 y ON x.a=y.a +JOIN t1 z ON y.a=z.a +WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; +a a a +2001-01-01 00:00:00 2001-01-01 00:00:00 2001-01-01 00:00:00 +EXPLAIN SELECT x.a, y.a, z.a FROM t1 x +JOIN t1 y ON x.a=y.a +JOIN t1 z ON y.a=z.a +WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE x NULL ALL NULL NULL NULL NULL 1 100.00 Using where +2 SIMPLE y NULL ALL NULL NULL NULL NULL 1 100.00 Using where +2 SIMPLE z NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`y`.`a` AS `a`,`test`.`z`.`a` AS `a` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` where ((`test`.`x`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (`test`.`y`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (`test`.`z`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +# +# Bug #49897: crash in ptr_compare when char(0) NOT NULL +# column is used for ORDER BY +# +SET @old_sort_buffer_size= @@session.sort_buffer_size; +SET @@sort_buffer_size= 40000; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1(a CHAR(0) NOT NULL); +INSERT INTO t1 VALUES (0), (0), (0); +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a FROM t1 ORDER BY a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24404 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24404 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `test`.`t1`.`a` +SELECT a FROM t1 ORDER BY a; +DROP TABLE t1; +CREATE TABLE t1(a CHAR(0) NOT NULL, b CHAR(0) NOT NULL, c int); +INSERT INTO t1 VALUES (0, 0, 0), (0, 0, 2), (0, 0, 1); +# Since ANALYZE TABLE only reads a subset of the data, the statistics for +# table t1 depends on the row order. And since the INSERT INTO ... SELECT +# may be executed using different execution plans, we've added ORDER BY +# to ensure that we rows has the same order every time. If not, the +# estimated number of rows in EXPLAIN may change on different platforms. +# Note that the tables may MYISAM, since many of the test files that +# includes this file forces MYISAM as the default storage engine. +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a FROM t1 ORDER BY a LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `test`.`t1`.`a` limit 5 +SELECT a FROM t1 ORDER BY a LIMIT 5; +a + + + + + +EXPLAIN SELECT * FROM t1 ORDER BY a, b LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b` limit 5 +SELECT * FROM t1 ORDER BY a, b LIMIT 5; +a b c + 2 + 2 + 2 + 2 + 2 +EXPLAIN SELECT * FROM t1 ORDER BY a, b, c LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b`,`test`.`t1`.`c` limit 5 +SELECT * FROM t1 ORDER BY a, b, c LIMIT 5; +a b c + 0 + 0 + 0 + 0 + 0 +EXPLAIN SELECT * FROM t1 ORDER BY c, a LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`c`,`test`.`t1`.`a` limit 5 +SELECT * FROM t1 ORDER BY c, a LIMIT 5; +a b c + 0 + 0 + 0 + 0 + 0 +SET @@sort_buffer_size= @old_sort_buffer_size; +DROP TABLE t1; +SET sql_mode = default; +End of 5.0 tests +create table t1(a INT, KEY (a)); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5); +SELECT a FROM t1 ORDER BY a LIMIT 2; +a +1 +2 +SELECT a FROM t1 ORDER BY a LIMIT 2,4294967296; +a +3 +4 +5 +SELECT a FROM t1 ORDER BY a LIMIT 2,4294967297; +a +3 +4 +5 +DROP TABLE t1; +CREATE TABLE A (date_key date); +CREATE TABLE C ( +pk int, +int_nokey int, +int_key int, +date_key date NOT NULL, +date_nokey date, +varchar_key varchar(1) +); +INSERT IGNORE INTO C VALUES +(1,1,1,'0000-00-00',NULL,NULL), +(1,1,1,'0000-00-00',NULL,NULL); +Warnings: +Warning 1264 Out of range value for column 'date_key' at row 1 +Warning 1264 Out of range value for column 'date_key' at row 2 +SELECT 1 FROM C WHERE pk > ANY (SELECT 1 FROM C); +1 +SELECT COUNT(DISTINCT 1) FROM C +WHERE date_key = (SELECT 1 FROM A WHERE C.date_key IS NULL) GROUP BY pk; +COUNT(DISTINCT 1) +SELECT date_nokey FROM C +WHERE int_key IN (SELECT 1 FROM A) +HAVING date_nokey = '10:41:7' +ORDER BY date_key; +ERROR HY000: Incorrect DATE value: '10:41:7' +DROP TABLE A,C; +CREATE TABLE t1 (a INT NOT NULL, b INT); +INSERT INTO t1 VALUES (1, 1); +EXPLAIN SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where true +SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2; +a b +1 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL); +EXPLAIN SELECT * FROM t1 WHERE (a=a AND b=b AND c=c) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +EXPLAIN SELECT * FROM t1 WHERE (a=a AND a=a AND b=b) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +EXPLAIN SELECT * FROM t1 WHERE (a=a AND b=b AND a=a) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +DROP TABLE t1; +# +# Bug#45266: Uninitialized variable lead to an empty result. +# +drop table if exists A,AA,B,BB; +CREATE TABLE `A` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`date_key` date NOT NULL, +`date_nokey` date NOT NULL, +`datetime_key` datetime NOT NULL, +`int_nokey` int(11) NOT NULL, +`time_key` time NOT NULL, +`time_nokey` time NOT NULL, +PRIMARY KEY (`pk`), +KEY `date_key` (`date_key`), +KEY `time_key` (`time_key`), +KEY `datetime_key` (`datetime_key`) +); +CREATE TABLE `AA` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`int_nokey` int(11) NOT NULL, +`time_key` time NOT NULL, +KEY `time_key` (`time_key`), +PRIMARY KEY (`pk`) +); +CREATE TABLE `B` ( +`date_nokey` date NOT NULL, +`date_key` date NOT NULL, +`time_key` time NOT NULL, +`datetime_nokey` datetime NOT NULL, +`varchar_key` varchar(1) NOT NULL, +KEY `date_key` (`date_key`), +KEY `time_key` (`time_key`), +KEY `varchar_key` (`varchar_key`) +); +INSERT IGNORE INTO `B` VALUES ('2003-07-28','2003-07-28','15:13:38','0000-00-00 00:00:00','f'),('0000-00-00','0000-00-00','00:05:48','2004-07-02 14:34:13','x'); +CREATE TABLE `BB` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`int_nokey` int(11) NOT NULL, +`date_key` date NOT NULL, +`varchar_nokey` varchar(1) NOT NULL, +`date_nokey` date NOT NULL, +PRIMARY KEY (`pk`), +KEY `date_key` (`date_key`) +); +INSERT IGNORE INTO `BB` VALUES (10,8,'0000-00-00','i','0000-00-00'),(11,0,'2005-08-18','','2005-08-18'); +SELECT table1 . `pk` AS field1 +FROM +(BB AS table1 INNER JOIN +(AA AS table2 STRAIGHT_JOIN A AS table3 +ON ( table3 . `date_key` = table2 . `pk` )) +ON ( table3 . `datetime_key` = table2 . `int_nokey` )) +WHERE ( table3 . `date_key` <= 4 AND table2 . `pk` = table1 . `varchar_nokey`) +GROUP BY field1 ; +field1 +SELECT table3 .`date_key` field1 +FROM +B table1 LEFT JOIN B table3 JOIN +(BB table6 JOIN A table7 ON table6 .`varchar_nokey`) +ON table6 .`int_nokey` ON table6 .`date_key` + WHERE NOT ( table1 .`varchar_key` AND table7 .`pk`) GROUP BY field1; +field1 +NULL +SELECT table4 . `time_nokey` AS field1 FROM +(AA AS table1 CROSS JOIN +(AA AS table2 STRAIGHT_JOIN +(B AS table3 STRAIGHT_JOIN A AS table4 +ON ( table4 . `date_key` = table3 . `time_key` )) +ON ( table4 . `pk` = table3 . `date_nokey` )) +ON ( table4 . `time_key` = table3 . `datetime_nokey` )) +WHERE ( table4 . `time_key` < table1 . `time_key` AND +table1 . `int_nokey` != 'f') +GROUP BY field1 ORDER BY field1 , field1; +field1 +SELECT table1 .`time_key` field2 FROM B table1 LEFT JOIN BB JOIN A table5 ON table5 .`date_nokey` ON table5 .`int_nokey` GROUP BY field2; +field2 +00:05:48 +15:13:38 +drop table A,AA,B,BB; +#end of test for bug#45266 +# +# Bug#33546: Slowdown on re-evaluation of constant expressions. +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (2); +SELECT * FROM t1 WHERE a = 1 + 1; +a +2 +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE a = 1 + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 10.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = ((1 + 1))) +SELECT * FROM t1 HAVING a = 1 + 1; +a +2 +EXPLAIN SELECT * FROM t1 HAVING a = 1 + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 100.00 NULL +Warnings: +Note 1003 /* select#1 */ 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 +EXPLAIN SELECT * FROM t1, t2 WHERE a = b + (1 + 1); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = (`test`.`t2`.`b` + ((1 + 1)))) +SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; +b a +2 3 +EXPLAIN SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t2` left join `test`.`t1` on((`test`.`t1`.`a` = (`test`.`t2`.`b` + 1))) where true +EXPLAIN SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 33.33 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 33.33 Using where +Warnings: +Note 1003 /* select#1 */ 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; +RETURN 1; +END;| +SET @cnt := 0; +SELECT * FROM t1 WHERE a = f1(); +a +1 +SELECT @cnt; +@cnt +1 +EXPLAIN SELECT * FROM t1 WHERE a = f1(); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 +# +# BUG#48052: Valgrind warning - uninitialized value in init_read_record() +# +# Disable Index condition pushdown +SELECT @old_optimizer_switch:=@@optimizer_switch; +@old_optimizer_switch:=@@optimizer_switch +# +Warnings: +# 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +CREATE TABLE t1 ( +pk int(11) NOT NULL, +i int(11) DEFAULT NULL, +v varchar(1) DEFAULT NULL, +PRIMARY KEY (pk) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (2,7,'m'); +INSERT INTO t1 VALUES (3,9,'m'); +SELECT v +FROM t1 +WHERE NOT pk > 0 +HAVING v <= 't' +ORDER BY pk; +v +# Restore old value for Index condition pushdown +SET SESSION optimizer_switch=@old_optimizer_switch; +DROP TABLE t1; +# +# Bug#49489 Uninitialized cache led to a wrong result. +# +CREATE TABLE t1(c1 DOUBLE(5,4)); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (9.1234); +SELECT * FROM t1 WHERE c1 < 9.12345; +c1 +9.1234 +DROP TABLE t1; +# End of test for bug#49489. +# +# Bug #49517: Inconsistent behavior while using +# NULLable BIGINT and INT columns in comparison +# +CREATE TABLE t1(a BIGINT UNSIGNED NOT NULL, b BIGINT NULL, c INT NULL); +INSERT INTO t1 VALUES(105, NULL, NULL); +SELECT * FROM t1 WHERE b < 102; +a b c +SELECT * FROM t1 WHERE c < 102; +a b c +SELECT * FROM t1 WHERE 102 < b; +a b c +SELECT * FROM t1 WHERE 102 < c; +a b c +DROP TABLE t1; +# +# Bug #54459: Assertion failed: param.sort_length, +# file .\filesort.cc, line 149 (part II) +# +CREATE TABLE t1(a ENUM('') NOT NULL) charset latin1; +INSERT INTO t1 VALUES (), (), (); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` order by `(t1.a collate latin1_german2_ci)` +SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug #58422: Incorrect result when OUTER JOIN'ing +# with an empty table +# +CREATE TABLE t_empty(pk INT PRIMARY KEY, i INT); +CREATE TABLE t1(pk INT PRIMARY KEY, i INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3); +CREATE TABLE t2(pk INT PRIMARY KEY, i INT) ; +INSERT INTO t2 VALUES (1,1), (2,2), (3,3); +ANALYZE TABLE t_empty, t1, t2; +Table Op Msg_type Msg_text +test.t_empty analyze status OK +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`pk` = `test`.`t1`.`pk`) and (`test`.`t1`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`pk` = `test`.`t1`.`pk`) and (`test`.`t1`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t2 NULL range PRIMARY PRIMARY 4 NULL 2 33.33 Using where +2 SIMPLE t1 NULL eq_ref PRIMARY PRIMARY 4 test.t2.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`i` = `test`.`t_empty`.`i`) and (`test`.`t1`.`pk` = `test`.`t2`.`pk`) and (`test`.`t2`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +DROP TABLE t1,t2,t_empty; +End of 5.1 tests +# +# Bug#45227: Lost HAVING clause led to a wrong result. +# +CREATE TABLE `cc` ( +`int_nokey` int(11) NOT NULL, +`int_key` int(11) NOT NULL, +`varchar_key` varchar(1) NOT NULL, +`varchar_nokey` varchar(1) NOT NULL, +KEY `int_key` (`int_key`), +KEY `varchar_key` (`varchar_key`) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `cc` VALUES +(0,8,'q','q'),(5,8,'m','m'),(7,3,'j','j'),(1,2,'z','z'),(8,2,'a','a'),(2,6,'',''),(1,8,'e' +,'e'),(8,9,'t','t'),(5,2,'q','q'),(4,6,'b','b'),(5,5,'w','w'),(3,2,'m','m'),(0,4,'x','x'), +(8,9,'',''),(0,6,'w','w'),(4,5,'x','x'),(0,0,'e','e'),(0,0,'e','e'),(2,8,'p','p'),(0,0,'x' +,'x'); +EXPLAIN SELECT `varchar_nokey` g1 FROM cc WHERE `int_nokey` AND `int_key` <= 4 +HAVING g1 ORDER BY `varchar_key` LIMIT 6 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 9 90.00 Parallel execute (1 workers) +2 SIMPLE cc NULL range int_key int_key 4 NULL 9 90.00 Using index condition; Using where; Using MRR; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`cc`.`varchar_nokey` AS `g1` from `test`.`cc` where ((0 <> `test`.`cc`.`int_nokey`) and (`test`.`cc`.`int_key` <= 4)) having (0 <> `g1`) order by `test`.`cc`.`varchar_key` limit 6 +SELECT `varchar_nokey` g1 FROM cc WHERE `int_nokey` AND `int_key` <= 4 +HAVING g1 ORDER BY `varchar_key` LIMIT 6 ; +g1 +Warning 1292 Truncated incorrect DOUBLE value: 'a' +Warning 1292 Truncated incorrect DOUBLE value: 'j' +Warning 1292 Truncated incorrect DOUBLE value: 'm' +Warning 1292 Truncated incorrect DOUBLE value: 'q' +Warning 1292 Truncated incorrect DOUBLE value: 'z' +Warnings: +DROP TABLE cc; +# End of test#45227 +# +# Bug#54515: Crash in opt_range.cc::get_best_group_min_max on +# SELECT from VIEW with GROUP BY +# +CREATE TABLE t1 ( +col_int_key int DEFAULT NULL, +KEY int_key (col_int_key) +) ; +INSERT INTO t1 VALUES (1),(2); +CREATE VIEW view_t1 AS +SELECT t1.col_int_key AS col_int_key +FROM t1; +SELECT col_int_key FROM view_t1 GROUP BY col_int_key; +col_int_key +1 +2 +DROP VIEW view_t1; +DROP TABLE t1; +# End of test BUG#54515 +# +# Bug #57203 Assertion `field_length <= 255' failed. +# +SELECT coalesce((avg(distinct (ST_geomfromtext("point(25379 -22010)"))))) +UNION ALL +SELECT coalesce((avg(distinct (ST_geomfromtext("point(25379 -22010)"))))) +AS foo +; +ERROR HY000: Incorrect arguments to avg +CREATE table t1(a text); +INSERT INTO t1 VALUES (''), (''); +SELECT avg(distinct(t1.a)) FROM t1, t1 t2 +GROUP BY t2.a ORDER BY t1.a; +avg(distinct(t1.a)) +0 +DROP TABLE t1; +# End of test BUG#57203 +# +# Bug#63020: Function "format"'s 'locale' argument is not considered +# when creating a "view' +# +CREATE TABLE t1 (f1 DECIMAL(10,2)); +INSERT INTO t1 VALUES (11.67),(17865.3),(12345678.92); +CREATE VIEW view_t1 AS SELECT FORMAT(f1,1,'sk_SK') AS f1 FROM t1; +SHOW CREATE VIEW view_t1; +View Create View character_set_client collation_connection +view_t1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_t1` AS select format(`t1`.`f1`,1,'sk_SK') AS `f1` from `t1` utf8mb4 utf8mb4_0900_ai_ci +SELECT * FROM view_t1; +f1 +11,7 +17 865,3 +12 345 678,9 +DROP TABLE t1; +DROP VIEW view_t1; +# End of test BUG#63020 +# +# Bug #13571700 TINYBLOB NOT NULL, CRASH IN PROTOCOL::NET_STORE_DATA +# +CREATE TABLE t1 (a TINYBLOB NOT NULL); +SELECT a, COUNT(*) FROM t1 WHERE 0; +a COUNT(*) +NULL 0 +DROP TABLE t1; +# End of test BUG#13571700 +# +# Bug #18766378: CRASH IN ITEM_SUM_BIT::RESET_FIELD +# +CREATE TABLE t1(b int); +CREATE TABLE t2(a int); +INSERT INTO t1 VALUES (),(); +INSERT INTO t2 VALUES (),(); +SELECT +( SELECT 1 FROM t1 GROUP BY a +HAVING avg(distinct 1) ORDER BY max(a) +) +FROM t1, t2 +GROUP BY a; +( SELECT 1 FROM t1 GROUP BY a +HAVING avg(distinct 1) ORDER BY max(a) +) +1 +DROP TABLE t1,t2; +# End of test BUG#18766378 +# +# WL#13002: RESULTSET DIFFERENT NUMBER OF ROWS +# +CREATE TABLE t1 ( +f1 INTEGER, +f2 INTEGER, +INDEX i1 (f2) +); +INSERT INTO t1 VALUES (NULL,1); +INSERT INTO t1 VALUES (2,NULL); +INSERT INTO t1 VALUES (3,1); +INSERT INTO t1 VALUES (4,6); +INSERT INTO t1 VALUES (NULL,5); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (13,1); +INSERT INTO t1 VALUES (NULL,0); +INSERT INTO t1 VALUES (5,2); +INSERT INTO t1 VALUES (NULL,8); +INSERT INTO t1 VALUES (NULL,7); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (NULL,4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN FORMAT=tree SELECT * +FROM t1 AS alias1 LEFT JOIN t1 AS alias2 ON alias1.f1 = alias2.f2 +WHERE alias2.f1 NOT BETWEEN 4 AND 12; +EXPLAIN +-> Parallel scan on + -> Batched key access inner join + -> Batch input rows + -> PQblock scan on alias1 (cost=1.65 rows=14) + -> Filter: (alias2.f1 not between 4 and 12) + -> Multi-range index lookup on alias2 using i1 (f2=alias1.f1) + +SELECT * +FROM t1 AS alias1 LEFT JOIN t1 AS alias2 ON alias1.f1 = alias2.f2 +WHERE alias2.f1 NOT BETWEEN 4 AND 12; +f1 f2 f1 f2 +DROP TABLE t1; +set optimizer_switch=default; +set optimizer_switch=default; diff --git a/mysql-test/r/select_none.result-pq b/mysql-test/r/select_none.result-pq new file mode 100644 index 000000000000..fa7098fa41f8 --- /dev/null +++ b/mysql-test/r/select_none.result-pq @@ -0,0 +1,5699 @@ +drop table if exists t1,t2,t3,t4,t11; +drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; +drop view if exists v1; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +); +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +select * from t1; +Period Varor_period +9410 9412 +select t1.* from t1; +Period Varor_period +9410 9412 +CREATE TABLE t2 ( +auto int not null auto_increment, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL, +UNIQUE fld1 (fld1), +KEY fld3 (fld3), +PRIMARY KEY (auto) +) charset utf8mb4; +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +imaginable +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +cultivation +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3 from t2 order by fld3 desc limit 10; +fld3 +youthfulness +yelped +Wotan +workers +Witt +witchcraft +Winsett +Willy +willed +wildcats +select fld3 from t2 order by fld3 desc limit 5; +fld3 +youthfulness +yelped +Wotan +workers +Witt +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +witchcraft +Winsett +Willy +willed +wildcats +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'h%le'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; +fld3 +explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 0.09 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 0.09 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` IGNORE INDEX (`fld3`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 0.09 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 0.09 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld1`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld3`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld3`) USE INDEX (`fld1`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 ignore index (fld3,not_used); +ERROR 42000: Key 'not_used' doesn't exist in table 't2' +explain select fld3 from t2 use index (not_used); +ERROR 42000: Key 'not_used' doesn't exist in table 't2' +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +honeysuckle +honoring +explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range fld3 fld3 120 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where ((`test`.`t2`.`fld3` >= 'honeysuckle') and (`test`.`t2`.`fld3` <= 'honoring')) order by `test`.`t2`.`fld3` +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +fld1 fld3 +148504 Colombo +068305 Colombo +000000 nondecreasing +select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes'; +fld1 fld3 +232605 appendixes +1232605 appendixes +1232606 appendixes +1232607 appendixes +1232608 appendixes +1232609 appendixes +select fld1 from t2 where fld1=250501 or fld1="250502"; +fld1 +250501 +250502 +explain select fld1 from t2 where fld1=250501 or fld1="250502"; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL range fld1 fld1 4 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld1` AS `fld1` from `test`.`t2` where ((`test`.`t2`.`fld1` = 250501) or (`test`.`t2`.`fld1` = 250502)) +select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +fld1 +250501 +250502 +250505 +250601 +explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL range fld1 fld1 4 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld1` AS `fld1` from `test`.`t2` where ((`test`.`t2`.`fld1` = 250501) or (`test`.`t2`.`fld1` = 250502) or ((`test`.`t2`.`fld1` >= 250505) and (`test`.`t2`.`fld1` <= 250601)) or (`test`.`t2`.`fld1` between 250501 and 250502)) +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +fld1 fld3 +012001 flanking +013602 foldout +013606 fingerings +018007 fanatic +018017 featherweight +018054 fetters +018103 flint +018104 flopping +036002 funereal +038017 fetched +038205 firearm +058004 Fenton +088303 feminine +186002 freakish +188007 flurried +188505 fitting +198006 furthermore +202301 Fitzpatrick +208101 fiftieth +208113 freest +218008 finishers +218022 feed +218401 faithful +226205 foothill +226209 furnishings +228306 forthcoming +228311 fated +231315 freezes +232102 forgivably +238007 filial +238008 fixedly +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +fld3 +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +fld3 +Chantilly +select fld1,fld3 from t2 where fld1 like "25050%"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select fld1,fld3 from t2 where fld1 like "25050_"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select distinct companynr from t2; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr desc; +companynr +68 +65 +58 +53 +50 +41 +40 +37 +36 +34 +29 +00 +select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%" order by fld3; +fld3 period +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +select distinct fld3 from t2 where companynr = 34 order by fld3; +fld3 +absentee +accessed +ahead +alphabetic +Asiaticizations +attitude +aye +bankruptcies +belays +Blythe +bomb +boulevard +bulldozes +cannot +caressing +charcoal +checksumming +chess +clubroom +colorful +cosy +creator +crying +Darius +diffusing +duality +Eiffel +Epiphany +Ernestine +explorers +exterminated +famine +forked +Gershwins +heaving +Hodges +Iraqis +Italianization +Lagos +landslide +libretto +Majorca +mastering +narrowed +occurred +offerers +Palestine +Peruvianizes +pharmaceutic +poisoning +population +Pygmalion +rats +realest +recording +regimented +retransmitting +reviver +rouses +scars +sicker +sleepwalk +stopped +sugars +translatable +uncles +unexpected +uprisings +versatility +vest +select distinct fld3 from t2 limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct fld3 from t2 having fld3 like "A%" limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct substring(fld3,1,3) from t2 where fld3 like "A%"; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +Adl +adm +Ado +ads +adv +aer +aff +afi +afl +afo +agi +ahe +aim +air +Ald +alg +ali +all +alp +alr +ama +ame +amm +ana +and +ane +Ang +ani +Ann +Ant +api +app +aqu +Ara +arc +Arm +arr +Art +Asi +ask +asp +ass +ast +att +aud +Aug +aut +ave +avo +awe +aye +Azt +select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +create table t3 ( +period int not null, +name char(32) not null, +companynr int not null, +price double(11,0), +price2 double(11,0), +key (period), +key (name) +); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +create temporary table tmp select * from t3; +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +alter table t3 add t2nr int not null auto_increment primary key first; +drop table tmp; +SET BIG_TABLES=1; +select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10; +namn +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +SET BIG_TABLES=0; +select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10; +concat(fld3," ",fld3) +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +select distinct fld5 from t2 limit 10; +fld5 +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +select distinct companynr, fld3,count(*) from t2 group by companynr, fld3 order by companynr, fld3 limit 10; +companynr fld3 count(*) +00 affixed 1 +00 and 1 +00 annoyers 1 +00 Anthony 1 +00 assayed 1 +00 assurers 1 +00 attendants 1 +00 bedlam 1 +00 bedpost 1 +00 boasted 1 +SET BIG_TABLES=1; +select distinct companynr, fld3,count(*) from t2 group by companynr, fld3 order by companynr, fld3 limit 10; +companynr fld3 count(*) +00 affixed 1 +00 and 1 +00 annoyers 1 +00 Anthony 1 +00 assayed 1 +00 assurers 1 +00 attendants 1 +00 bedlam 1 +00 bedpost 1 +00 boasted 1 +SET BIG_TABLES=0; +select distinct companynr, fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr ,fld3 order by companynr, fld3 limit 100,10; +companynr fld3 repeat("a",length(fld3)) count(*) +29 chancellor aaaaaaaaaa 1 +29 Chippewa aaaaaaaa 1 +29 circumference aaaaaaaaaaaaa 1 +29 circus aaaaaa 1 +29 cited aaaaa 1 +29 Colombo aaaaaaa 1 +29 congresswoman aaaaaaaaaaaaa 1 +29 contrition aaaaaaaaaa 1 +29 corny aaaaa 1 +29 cultivation aaaaaaaaaaa 1 +select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2; +companynr rtrim(space(512+companynr)) +37 +78 +101 +154 +311 +447 +512 +select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; +fld3 +explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 10.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL fld1 NULL NULL NULL 1199 10.00 Using where; Using temporary; Using filesort +2 SIMPLE t3 NULL eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`t2nr` AS `t2nr`,`test`.`t2`.`fld3` AS `fld3` from `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld1` = `test`.`t3`.`t2nr`)) order by `test`.`t3`.`t2nr`,`test`.`t2`.`fld3` +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 41736 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL period NULL NULL NULL 41736 100.00 Using temporary; Using filesort +2 SIMPLE t3 NULL ref period period 4 test.t1.period 4173 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t3`.`period` = `test`.`t1`.`period`) order by `test`.`t3`.`period` +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (4 workers) +2 SIMPLE t3 NULL index period period 4 NULL 1 100.00 NULL +2 SIMPLE t1 NULL ref period period 4 test.t3.period 4173 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t1`.`period` = `test`.`t3`.`period`) order by `test`.`t3`.`period` limit 10 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL index period period 4 NULL 1 100.00 NULL +2 SIMPLE t3 NULL ref period period 4 test.t1.period 4173 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t3`.`period` = `test`.`t1`.`period`) order by `test`.`t1`.`period` limit 10 +select period from t1; +period +9410 +select period from t1 where period=1900; +period +select fld3,period from t1,t2 where fld1 = 011401 order by period; +fld3 period +breaking 9410 +select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001; +fld3 period +breaking 1001 +explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const fld1 fld1 4 const 1 100.00 NULL +1 SIMPLE t3 NULL const PRIMARY,period PRIMARY 4 const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select 'breaking' AS `fld3`,'1001' AS `period` from `test`.`t2` join `test`.`t3` where true +select fld3,period from t2,t1 where companynr*10 = 37*10 order by fld3; +fld3 period +abates 9410 +Abraham 9410 +abrogating 9410 +accessed 9410 +Aden 9410 +admiring 9410 +admonishing 9410 +Adolph 9410 +afield 9410 +afore 9410 +aging 9410 +airships 9410 +Aldrich 9410 +alike 9410 +Alison 9410 +allot 9410 +already 9410 +amenities 9410 +ammonium 9410 +analogy 9410 +analyzable 9410 +Anatole 9410 +animals 9410 +animized 9410 +annihilates 9410 +announced 9410 +announces 9410 +Antarctica 9410 +Antares 9410 +apiary 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +Arabia 9410 +arriving 9410 +Artemia 9410 +arteriole 9410 +assails 9410 +astound 9410 +attainments 9410 +attrition 9410 +audiology 9410 +Augustine 9410 +avenge 9410 +avoidable 9410 +babies 9410 +babysitting 9410 +Baird 9410 +balled 9410 +beaner 9410 +beaters 9410 +bee 9410 +Beebe 9410 +befouled 9410 +bellow 9410 +bestseller 9410 +betroth 9410 +bewilderingly 9410 +bills 9410 +bitterroot 9410 +bivalves 9410 +bloater 9410 +bloodbath 9410 +boat 9410 +boom 9410 +boorish 9410 +boulder 9410 +breaking 9410 +brunch 9410 +buckboards 9410 +burlesque 9410 +Butterfield 9410 +cage 9410 +capably 9410 +capped 9410 +cascade 9410 +Cassites 9410 +causality 9410 +cautioned 9410 +ceiling 9410 +celery 9410 +CERN 9410 +certificates 9410 +chafe 9410 +chaperone 9410 +charges 9410 +chasm 9410 +checkpoints 9410 +chewing 9410 +chews 9410 +Chicana 9410 +chillingly 9410 +Chippewa 9410 +chronicle 9410 +ciphers 9410 +civics 9410 +clamored 9410 +Clayton 9410 +clenched 9410 +clockers 9410 +coexist 9410 +cokes 9410 +combed 9410 +coming 9410 +commencements 9410 +commonplace 9410 +communicants 9410 +compartment 9410 +comprehensive 9410 +comprised 9410 +conceptions 9410 +concludes 9410 +congregates 9410 +Conley 9410 +Connally 9410 +contrary 9410 +contrasted 9410 +convenient 9410 +convulsion 9410 +corset 9410 +count 9410 +coverings 9410 +Crays 9410 +craziness 9410 +creak 9410 +creek 9410 +critiques 9410 +crunches 9410 +culled 9410 +cult 9410 +cupboard 9410 +cured 9410 +cute 9410 +daughter 9410 +decliner 9410 +decomposition 9410 +deductions 9410 +dehydrate 9410 +deludes 9410 +denizen 9410 +denotative 9410 +denounces 9410 +dental 9410 +dentally 9410 +descendants 9410 +despot 9410 +destroyer 9410 +detectably 9410 +dialysis 9410 +DiMaggio 9410 +dimensions 9410 +disable 9410 +discounts 9410 +disentangle 9410 +disobedience 9410 +dissociate 9410 +dogging 9410 +dopers 9410 +drains 9410 +dreaded 9410 +ducks 9410 +dusted 9410 +Dutchman 9410 +effortlessly 9410 +electroencephalography 9410 +elite 9410 +embassies 9410 +employing 9410 +encompass 9410 +encompasses 9410 +environing 9410 +epistle 9410 +equilibrium 9410 +erases 9410 +error 9410 +eschew 9410 +eternal 9410 +Eulerian 9410 +Evanston 9410 +evened 9410 +evenhandedly 9410 +eventful 9410 +Everhart 9410 +excises 9410 +exclamation 9410 +excrete 9410 +exhausts 9410 +expelled 9410 +extents 9410 +externally 9410 +extracted 9410 +faithful 9410 +fanatic 9410 +fated 9410 +featherweight 9410 +feed 9410 +feminine 9410 +Fenton 9410 +fetched 9410 +fetters 9410 +fiftieth 9410 +filial 9410 +fingerings 9410 +finishers 9410 +firearm 9410 +fitting 9410 +Fitzpatrick 9410 +fixedly 9410 +flanking 9410 +flint 9410 +flopping 9410 +flurried 9410 +foldout 9410 +foothill 9410 +forgivably 9410 +forthcoming 9410 +freakish 9410 +freest 9410 +freezes 9410 +funereal 9410 +furnishings 9410 +furthermore 9410 +gadfly 9410 +gainful 9410 +Galatean 9410 +galling 9410 +Gandhian 9410 +Ganymede 9410 +garage 9410 +gentleman 9410 +gifted 9410 +gleaning 9410 +glut 9410 +goblins 9410 +Goldstine 9410 +Gothicism 9410 +governing 9410 +gradually 9410 +Graves 9410 +grazing 9410 +Greenberg 9410 +gritty 9410 +groupings 9410 +guides 9410 +guitars 9410 +Gurkha 9410 +handgun 9410 +handy 9410 +Hawaii 9410 +Hegelian 9410 +heiress 9410 +hoarder 9410 +honoring 9410 +Hornblower 9410 +hostess 9410 +Huffman 9410 +humanness 9410 +humiliation 9410 +humility 9410 +Hunter 9410 +hushes 9410 +husky 9410 +hypothesizer 9410 +icon 9410 +ideas 9410 +impelling 9410 +impending 9410 +imperial 9410 +imperiously 9410 +imprint 9410 +impulsive 9410 +inaccuracy 9410 +inch 9410 +incidentals 9410 +incorrectly 9410 +incurring 9410 +index 9410 +indulge 9410 +indulgences 9410 +ineffective 9410 +infallibly 9410 +infest 9410 +inform 9410 +inmate 9410 +insolence 9410 +instruments 9410 +intelligibility 9410 +intentness 9410 +intercepted 9410 +interdependent 9410 +interrelationships 9410 +interrogate 9410 +investigations 9410 +irresponsibly 9410 +jarring 9410 +Joplin 9410 +journalizing 9410 +Judas 9410 +juveniles 9410 +Kane 9410 +kanji 9410 +Kantian 9410 +Kevin 9410 +kingdom 9410 +Kinsey 9410 +kiting 9410 +Kline 9410 +labeled 9410 +languages 9410 +Lars 9410 +laterally 9410 +Latinizes 9410 +lawgiver 9410 +leaflet 9410 +leavings 9410 +lectured 9410 +leftover 9410 +lewdly 9410 +lied 9410 +Lillian 9410 +linear 9410 +lists 9410 +lithograph 9410 +Lizzy 9410 +lore 9410 +luckily 9410 +Majorca 9410 +males 9410 +Manhattanize 9410 +marginal 9410 +mastering 9410 +mayoral 9410 +McGovern 9410 +meanwhile 9410 +measures 9410 +measures 9410 +mechanizing 9410 +medical 9410 +meditation 9410 +Melinda 9410 +Merritt 9410 +metaphysically 9410 +Micronesia 9410 +Miles 9410 +Miltonism 9410 +mineral 9410 +miniaturizes 9410 +minima 9410 +minion 9410 +minting 9410 +misted 9410 +misunderstander 9410 +mixture 9410 +motors 9410 +mournfulness 9410 +multilayer 9410 +mumbles 9410 +mushrooms 9410 +mystic 9410 +Nabisco 9410 +navies 9410 +navigate 9410 +Nazis 9410 +neat 9410 +neonatal 9410 +nested 9410 +Newtonian 9410 +noncritical 9410 +normalizes 9410 +Norwalk 9410 +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +Pandora 9410 +parametrized 9410 +parenthood 9410 +Parsifal 9410 +parters 9410 +participated 9410 +partridges 9410 +peacock 9410 +peeked 9410 +pellagra 9410 +percentage 9410 +percentage 9410 +persist 9410 +perturb 9410 +Peruvian 9410 +pessimist 9410 +pests 9410 +petted 9410 +pictures 9410 +pithed 9410 +pityingly 9410 +poison 9410 +posed 9410 +positioning 9410 +postulation 9410 +praised 9410 +precaution 9410 +precipitable 9410 +preclude 9410 +presentation 9410 +pressure 9410 +previewing 9410 +priceless 9410 +primary 9410 +psychic 9410 +publicly 9410 +puddings 9410 +Punjab 9410 +Pyle 9410 +quagmire 9410 +quitter 9410 +Quixotism 9410 +railway 9410 +raining 9410 +rains 9410 +ravines 9410 +readable 9410 +realized 9410 +realtor 9410 +reassigned 9410 +recruited 9410 +reduce 9410 +regimented 9410 +registration 9410 +relatively 9410 +relaxing 9410 +relishing 9410 +relives 9410 +renew 9410 +repelled 9410 +repetitions 9410 +reporters 9410 +reporters 9410 +repressions 9410 +resplendent 9410 +resumes 9410 +rifles 9410 +rightful 9410 +rightfully 9410 +rightfulness 9410 +ripeness 9410 +riser 9410 +Romano 9410 +Romans 9410 +roped 9410 +rudeness 9410 +rules 9410 +rural 9410 +rusting 9410 +Sabine 9410 +sadly 9410 +sags 9410 +sanding 9410 +saplings 9410 +sating 9410 +Sault 9410 +save 9410 +sawtooth 9410 +Saxony 9410 +scarf 9410 +scatterbrain 9410 +scheduling 9410 +schemer 9410 +scholastics 9410 +scornfully 9410 +secures 9410 +securing 9410 +Selfridge 9410 +seminaries 9410 +serializations 9410 +serpents 9410 +serving 9410 +severely 9410 +sews 9410 +Shanghais 9410 +shapelessly 9410 +shipyard 9410 +shooter 9410 +similarities 9410 +Simla 9410 +Simon 9410 +skulking 9410 +slaughter 9410 +sloping 9410 +smoothed 9410 +snatching 9410 +socializes 9410 +sophomore 9410 +sorters 9410 +spatial 9410 +specification 9410 +specifics 9410 +spongers 9410 +spools 9410 +sportswriting 9410 +sporty 9410 +squabbled 9410 +squeaking 9410 +squeezes 9410 +stabilizes 9410 +stairway 9410 +Stalin 9410 +standardizes 9410 +star 9410 +starlet 9410 +stated 9410 +Steinberg 9410 +stint 9410 +stodgy 9410 +store 9410 +straight 9410 +stranglings 9410 +subdirectory 9410 +subjective 9410 +subschema 9410 +succumbed 9410 +suites 9410 +sumac 9410 +sureties 9410 +swaying 9410 +sweetish 9410 +swelling 9410 +syndicate 9410 +Taoism 9410 +taxonomically 9410 +techniques 9410 +teem 9410 +teethe 9410 +tempering 9410 +Teresa 9410 +terminal 9410 +terminator 9410 +terminators 9410 +test 9410 +testicle 9410 +textures 9410 +theorizers 9410 +throttles 9410 +tidiness 9410 +timesharing 9410 +tinily 9410 +tinting 9410 +Tipperary 9410 +title 9410 +tragedies 9410 +traitor 9410 +trimmings 9410 +tropics 9410 +unaffected 9410 +uncovering 9410 +undoes 9410 +ungrateful 9410 +universals 9410 +unplug 9410 +unruly 9410 +untying 9410 +unwilling 9410 +vacuuming 9410 +validate 9410 +vanish 9410 +ventilate 9410 +veranda 9410 +vests 9410 +wallet 9410 +waltz 9410 +warm 9410 +warningly 9410 +watering 9410 +weasels 9410 +Weissmuller 9410 +western 9410 +whiteners 9410 +widens 9410 +Winsett 9410 +witchcraft 9410 +workers 9410 +Wotan 9410 +yelped 9410 +youthfulness 9410 +analyze table t2, t3; +Table Op Msg_type Msg_text +test.t2 analyze status OK +test.t3 analyze status OK +EXPLAIN select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 10.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL fld1 NULL NULL NULL 1199 10.00 Using where; Using temporary; Using filesort +2 SIMPLE t3 NULL eq_ref PRIMARY,period PRIMARY 4 test.t2.fld1 1 20.04 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`companynr` = 37) and (`test`.`t2`.`fld1` = `test`.`t3`.`t2nr`) and (`test`.`t3`.`period` >= 1001) and (`test`.`t3`.`period` <= 1002)) order by `test`.`t2`.`fld3`,`test`.`t3`.`period`,`test`.`t3`.`price` +select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +fld3 period price price2 +admonishing 1002 28357832 8723648 +analyzable 1002 28357832 8723648 +annihilates 1001 5987435 234724 +Antares 1002 28357832 8723648 +astound 1001 5987435 234724 +audiology 1001 5987435 234724 +Augustine 1002 28357832 8723648 +Baird 1002 28357832 8723648 +bewilderingly 1001 5987435 234724 +breaking 1001 5987435 234724 +Conley 1001 5987435 234724 +dentally 1002 28357832 8723648 +dissociate 1002 28357832 8723648 +elite 1001 5987435 234724 +eschew 1001 5987435 234724 +Eulerian 1001 5987435 234724 +flanking 1001 5987435 234724 +foldout 1002 28357832 8723648 +funereal 1002 28357832 8723648 +galling 1002 28357832 8723648 +Graves 1001 5987435 234724 +grazing 1001 5987435 234724 +groupings 1001 5987435 234724 +handgun 1001 5987435 234724 +humility 1002 28357832 8723648 +impulsive 1002 28357832 8723648 +inch 1001 5987435 234724 +intelligibility 1001 5987435 234724 +jarring 1001 5987435 234724 +lawgiver 1001 5987435 234724 +lectured 1002 28357832 8723648 +Merritt 1002 28357832 8723648 +neonatal 1001 5987435 234724 +offload 1002 28357832 8723648 +parters 1002 28357832 8723648 +pityingly 1002 28357832 8723648 +puddings 1002 28357832 8723648 +Punjab 1001 5987435 234724 +quitter 1002 28357832 8723648 +realtor 1001 5987435 234724 +relaxing 1001 5987435 234724 +repetitions 1001 5987435 234724 +resumes 1001 5987435 234724 +Romans 1002 28357832 8723648 +rusting 1001 5987435 234724 +scholastics 1001 5987435 234724 +skulking 1002 28357832 8723648 +stated 1002 28357832 8723648 +suites 1002 28357832 8723648 +sureties 1001 5987435 234724 +testicle 1002 28357832 8723648 +tinily 1002 28357832 8723648 +tragedies 1001 5987435 234724 +trimmings 1001 5987435 234724 +vacuuming 1001 5987435 234724 +ventilate 1001 5987435 234724 +wallet 1001 5987435 234724 +Weissmuller 1002 28357832 8723648 +Wotan 1002 28357832 8723648 +select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37; +fld1 fld3 period price price2 +018201 relaxing 1001 5987435 234724 +018601 vacuuming 1001 5987435 234724 +018801 inch 1001 5987435 234724 +018811 repetitions 1001 5987435 234724 +create table t4 ( +companynr tinyint(2) unsigned zerofill NOT NULL default '00', +companyname char(30) NOT NULL default '', +PRIMARY KEY (companynr), +UNIQUE KEY companyname(companyname) +) ENGINE=INNODB MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select * from t1,t1 t12; +Period Varor_period Period Varor_period +9410 9412 9410 9412 +select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505; +fld1 fld1 +250501 250501 +250501 250502 +250501 250503 +250501 250504 +250501 250505 +250502 250501 +250502 250502 +250502 250503 +250502 250504 +250502 250505 +250503 250501 +250503 250502 +250503 250503 +250503 250504 +250503 250505 +250504 250501 +250504 250502 +250504 250503 +250504 250504 +250504 250505 +250505 250501 +250505 250502 +250505 250503 +250505 250504 +250505 250505 +insert into t2 (fld1, companynr) values (999999,99); +ANALYZE TABLE t2, t4; +Table Op Msg_type Msg_text +test.t2 analyze status OK +test.t4 analyze status OK +select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +companynr companyname +99 NULL +select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null; +count(*) +1199 +explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1200 100.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1200 100.00 NULL +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 Using where; Not exists +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t2` left join `test`.`t4` on((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`)) where (`test`.`t4`.`companynr` is null) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1200 10.00 Using where; Not exists; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t2`.`companynr` is null) +select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +companynr companyname +select count(*) from t2 left join t4 using (companynr) where companynr is not null; +count(*) +1200 +explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t2` left join `test`.`t4` on(multiple equal(`test`.`t2`.`companynr`, `test`.`t4`.`companynr`)) where false +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on(multiple equal(`test`.`t4`.`companynr`, `test`.`t2`.`companynr`)) where false +delete from t2 where fld1=999999; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0) and (`test`.`t2`.`companynr` > 0)) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t4`.`companynr` > 0) and (`test`.`t4`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 40.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t2`.`companynr` > 0) or (`test`.`t2`.`companynr` is null)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index PRIMARY companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t2`.`companynr` > 0) or (`test`.`t4`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (ifnull(`test`.`t2`.`companynr`,1) > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t4`.`companynr` > 0) or (`test`.`t4`.`companynr` > 0)) +explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using where; Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (ifnull(`test`.`t4`.`companynr`,1) > 0) +select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +companynr companynr +37 36 +41 40 +explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index; Using temporary +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 10.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select distinct `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companynr` AS `companynr` from `test`.`t2` join `test`.`t4` where (`test`.`t2`.`companynr` = (`test`.`t4`.`companynr` + 1)) +select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909); +period +9410 +select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6))); +period +9410 +select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1; +fld1 +250501 +250502 +250503 +250505 +select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606); +fld1 +250502 +250503 +select fld1 from t2 where fld1 between 250502 and 250504; +fld1 +250502 +250503 +250504 +select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ; +fld3 +Lillian +label +labeled +labeled +landslide +laterally +leaflet +lewdly +luckily +select count(*) from t1; +count(*) +1 +select companynr,count(*),sum(fld1) from t2 group by companynr; +companynr count(*) sum(fld1) +00 82 10355753 +29 95 14473298 +34 70 17788966 +36 215 22786296 +37 588 83602098 +40 37 6618386 +41 52 12816335 +50 11 1595438 +53 4 793210 +58 23 2254293 +65 10 2284055 +68 12 3097288 +select companynr,count(*) from t2 group by companynr order by companynr desc limit 5; +companynr count(*) +68 12 +65 10 +58 23 +53 4 +50 11 +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +70 absentee vest 17788966 254128.0857 3272.5939722090234 10709871.306938833 +explain select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 9.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 order 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.97568479746 13352027981.708656 +29 95 abut wetness 14473298 152350.5053 8368.547956641249 70032594.90260443 +34 70 absentee vest 17788966 254128.0857 3272.5939722090234 10709871.306938833 +select +companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from +t3 where companynr = 37 group by companynr,t2nr order by companynr, t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select /*! SQL_SMALL_RESULT */ +companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from +t3 where companynr = 37 group by companynr,t2nr order by companynr, t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ; +companynr count(price) sum(price) min(price) max(price) avg(price) +101 4181 3489454238 834598 834598 834598.0000 +154 4181 4112197254950 983543950 983543950 983543950.0000 +311 4181 979599938 234298 234298 234298.0000 +37 12543 309394878010 5987435 39654943 24666736.6667 +447 4181 9929180954 2374834 2374834 2374834.0000 +512 4181 3288532102 786542 786542 786542.0000 +78 8362 414611089292 726498 98439034 49582766.0000 +select distinct mod(companynr,10) from t4 group by companynr; +mod(companynr,10) +0 +1 +3 +4 +5 +6 +7 +8 +9 +select distinct 1 from t4 group by companynr; +1 +1 +select count(distinct fld1) from t2; +count(distinct fld1) +1199 +select companynr,count(distinct fld1) from t2 group by companynr; +companynr count(distinct fld1) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(*) from t2 group by companynr; +companynr count(*) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,1000))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,200))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct floor(fld1/100)) from t2 group by companynr; +companynr count(distinct floor(fld1/100)) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr; +companynr count(distinct concat(repeat(65,1000),floor(fld1/100))) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10; +sum(fld1) fld3 +11402 Romans +select name,count(*) from t3 where name='cloakroom' group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name='cloakroom' and price>10 group by name; +name count(*) +cloakroom 4181 +select count(*) from t3 where name='cloakroom' and price2=823742; +count(*) +4181 +select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name; +name count(*) +extramarital 4181 +gazer 4181 +gems 4181 +Iranizes 4181 +spates 4181 +tucked 4181 +violinist 4181 +select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld3 count(*) +spates 4181 +select companynr|0,companyname from t4 group by 1; +companynr|0 companyname +0 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname; +companynr companyname count(*) +29 company 1 95 +68 company 10 12 +50 company 11 11 +34 company 2 70 +36 company 3 215 +37 company 4 588 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +00 Unknown 82 +select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld1 count(*) +158402 4181 +select sum(Period)/count(*) from t1; +sum(Period)/count(*) +9410.0000 +select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; +companynr count sum diff func +101 4181 3489454238 0.0000 422281 +154 4181 4112197254950 0.0000 643874 +311 4181 979599938 0.0000 1300291 +37 12543 309394878010 0.0000 464091 +447 4181 9929180954 0.0000 1868907 +512 4181 3288532102 0.0000 2140672 +78 8362 414611089292 0.0000 652236 +select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; +companynr avg +154 983543950.0000 +select companynr,count(*) from t2 group by companynr order by 2 desc; +companynr count(*) +37 588 +36 215 +29 95 +00 82 +34 70 +41 52 +40 37 +58 23 +68 12 +50 11 +65 10 +53 4 +select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc; +companynr count(*) +41 52 +58 23 +68 12 +50 11 +65 10 +53 4 +select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4; +fld4 fld1 count(price) sum(price) min(price) max(price) avg(price) +Abraham 018103 1 39654943 39654943 39654943 39654943.0000 +Anatole 038102 1 28357832 28357832 28357832 28357832.0000 +Beebe 018602 1 28357832 28357832 28357832 28357832.0000 +Chicana 038203 1 39654943 39654943 39654943 39654943.0000 +Conley 018101 1 5987435 5987435 5987435 5987435.0000 +Connally 018801 1 5987435 5987435 5987435 5987435.0000 +Graves 018052 1 28357832 28357832 28357832 28357832.0000 +Judas 018032 1 28357832 28357832 28357832 28357832.0000 +Kline 038101 1 5987435 5987435 5987435 5987435.0000 +Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000 +Merritt 016303 1 39654943 39654943 39654943 39654943.0000 +Parsifal 013802 1 28357832 28357832 28357832 28357832.0000 +Punjab 016302 1 28357832 28357832 28357832 28357832.0000 +Selfridge 019102 1 28357832 28357832 28357832 28357832.0000 +Simla 018402 1 28357832 28357832 28357832 28357832.0000 +Steinberg 012003 1 39654943 39654943 39654943 39654943.0000 +Taoism 018603 1 39654943 39654943 39654943 39654943.0000 +attainments 012303 1 39654943 39654943 39654943 39654943.0000 +audiology 011403 1 39654943 39654943 39654943 39654943.0000 +balled 012301 1 5987435 5987435 5987435 5987435.0000 +bee 038001 1 5987435 5987435 5987435 5987435.0000 +betroth 030501 1 5987435 5987435 5987435 5987435.0000 +bivalves 018013 1 39654943 39654943 39654943 39654943.0000 +bloodbath 018042 1 28357832 28357832 28357832 28357832.0000 +cage 018201 1 5987435 5987435 5987435 5987435.0000 +capably 012501 1 5987435 5987435 5987435 5987435.0000 +checkpoints 018803 1 39654943 39654943 39654943 39654943.0000 +coexist 018601 1 5987435 5987435 5987435 5987435.0000 +contrasted 016001 1 5987435 5987435 5987435 5987435.0000 +daughter 012703 1 39654943 39654943 39654943 39654943.0000 +dental 038003 1 39654943 39654943 39654943 39654943.0000 +dimensions 038202 1 28357832 28357832 28357832 28357832.0000 +disable 019103 1 39654943 39654943 39654943 39654943.0000 +dogging 018002 1 28357832 28357832 28357832 28357832.0000 +dreaded 011401 1 5987435 5987435 5987435 5987435.0000 +epistle 018062 1 28357832 28357832 28357832 28357832.0000 +erases 016301 1 5987435 5987435 5987435 5987435.0000 +eschew 011702 1 28357832 28357832 28357832 28357832.0000 +featherweight 012701 1 5987435 5987435 5987435 5987435.0000 +fetched 018802 1 28357832 28357832 28357832 28357832.0000 +fetters 018012 1 28357832 28357832 28357832 28357832.0000 +firearm 018812 1 28357832 28357832 28357832 28357832.0000 +flint 018022 1 28357832 28357832 28357832 28357832.0000 +flopping 018023 1 39654943 39654943 39654943 39654943.0000 +gritty 018811 1 5987435 5987435 5987435 5987435.0000 +hushes 018202 1 28357832 28357832 28357832 28357832.0000 +imprint 030503 1 39654943 39654943 39654943 39654943.0000 +impulsive 012602 1 28357832 28357832 28357832 28357832.0000 +interdependent 018051 1 5987435 5987435 5987435 5987435.0000 +interrelationships 036001 1 5987435 5987435 5987435 5987435.0000 +kanji 038002 1 28357832 28357832 28357832 28357832.0000 +lawgiver 013601 1 5987435 5987435 5987435 5987435.0000 +leavings 013803 1 39654943 39654943 39654943 39654943.0000 +lectured 018102 1 28357832 28357832 28357832 28357832.0000 +leftover 016201 1 5987435 5987435 5987435 5987435.0000 +medical 018041 1 5987435 5987435 5987435 5987435.0000 +minima 019101 1 5987435 5987435 5987435 5987435.0000 +neat 012001 1 5987435 5987435 5987435 5987435.0000 +neonatal 018053 1 39654943 39654943 39654943 39654943.0000 +normalizes 038013 1 39654943 39654943 39654943 39654943.0000 +parters 011701 1 5987435 5987435 5987435 5987435.0000 +partridges 038103 1 39654943 39654943 39654943 39654943.0000 +persist 012302 1 28357832 28357832 28357832 28357832.0000 +pessimist 012702 1 28357832 28357832 28357832 28357832.0000 +quitter 011703 1 39654943 39654943 39654943 39654943.0000 +railway 038011 1 5987435 5987435 5987435 5987435.0000 +readable 013603 1 39654943 39654943 39654943 39654943.0000 +recruited 038201 1 5987435 5987435 5987435 5987435.0000 +reporters 018403 1 39654943 39654943 39654943 39654943.0000 +riser 036002 1 28357832 28357832 28357832 28357832.0000 +scholastics 011402 1 28357832 28357832 28357832 28357832.0000 +scornfully 018003 1 39654943 39654943 39654943 39654943.0000 +skulking 018021 1 5987435 5987435 5987435 5987435.0000 +sorters 018061 1 5987435 5987435 5987435 5987435.0000 +squeaking 013901 1 5987435 5987435 5987435 5987435.0000 +starlet 012603 1 39654943 39654943 39654943 39654943.0000 +stated 013602 1 28357832 28357832 28357832 28357832.0000 +subschema 018043 1 39654943 39654943 39654943 39654943.0000 +sweetish 018001 1 5987435 5987435 5987435 5987435.0000 +swelling 031901 1 5987435 5987435 5987435 5987435.0000 +teethe 000001 1 5987435 5987435 5987435 5987435.0000 +testicle 013801 1 5987435 5987435 5987435 5987435.0000 +vacuuming 018033 1 39654943 39654943 39654943 39654943.0000 +validate 038012 1 28357832 28357832 28357832 28357832.0000 +wallet 011501 1 5987435 5987435 5987435 5987435.0000 +whiteners 016202 1 28357832 28357832 28357832 28357832.0000 +witchcraft 019201 1 5987435 5987435 5987435 5987435.0000 +select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3; +companynr fld3 sum(price) +512 Micronesia 786542 +512 Miles 786542 +512 boat 786542 +512 capably 786542 +512 cupboard 786542 +512 decliner 786542 +512 descendants 786542 +512 dopers 786542 +512 erases 786542 +512 skies 786542 +select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr; +companynr count(*) min(fld3) max(fld3) sum(price) avg(price) +00 1 Omaha Omaha 5987435 5987435.0000 +36 1 dubbed dubbed 28357832 28357832.0000 +37 83 Abraham Wotan 1908978016 22999735.1325 +50 2 scribbled tapestry 68012775 34006387.5000 +select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1; +t3.companynr+0 t2nr fld3 sum(price) +37 1 Omaha 5987435 +37 11401 breaking 5987435 +37 11402 Romans 28357832 +37 11403 intercepted 39654943 +37 11501 bewilderingly 5987435 +37 11701 astound 5987435 +37 11702 admonishing 28357832 +37 11703 sumac 39654943 +37 12001 flanking 5987435 +37 12003 combed 39654943 +37 12301 Eulerian 5987435 +37 12302 dubbed 28357832 +37 12303 Kane 39654943 +37 12501 annihilates 5987435 +37 12602 Wotan 28357832 +37 12603 snatching 39654943 +37 12701 grazing 5987435 +37 12702 Baird 28357832 +37 12703 celery 39654943 +37 13601 handgun 5987435 +37 13602 foldout 28357832 +37 13603 mystic 39654943 +37 13801 intelligibility 5987435 +37 13802 Augustine 28357832 +37 13803 teethe 39654943 +37 13901 scholastics 5987435 +37 16001 audiology 5987435 +37 16201 wallet 5987435 +37 16202 parters 28357832 +37 16301 eschew 5987435 +37 16302 quitter 28357832 +37 16303 neat 39654943 +37 18001 jarring 5987435 +37 18002 tinily 28357832 +37 18003 balled 39654943 +37 18012 impulsive 28357832 +37 18013 starlet 39654943 +37 18021 lawgiver 5987435 +37 18022 stated 28357832 +37 18023 readable 39654943 +37 18032 testicle 28357832 +37 18033 Parsifal 39654943 +37 18041 Punjab 5987435 +37 18042 Merritt 28357832 +37 18043 Quixotism 39654943 +37 18051 sureties 5987435 +37 18052 puddings 28357832 +37 18053 tapestry 39654943 +37 18061 trimmings 5987435 +37 18062 humility 28357832 +37 18101 tragedies 5987435 +37 18102 skulking 28357832 +37 18103 flint 39654943 +37 18201 relaxing 5987435 +37 18202 offload 28357832 +37 18402 suites 28357832 +37 18403 lists 39654943 +37 18601 vacuuming 5987435 +37 18602 dentally 28357832 +37 18603 humanness 39654943 +37 18801 inch 5987435 +37 18802 Weissmuller 28357832 +37 18803 irresponsibly 39654943 +37 18811 repetitions 5987435 +37 18812 Antares 28357832 +37 19101 ventilate 5987435 +37 19102 pityingly 28357832 +37 19103 interdependent 39654943 +37 19201 Graves 5987435 +37 30501 neonatal 5987435 +37 30502 scribbled 28357832 +37 30503 chafe 39654943 +37 31901 realtor 5987435 +37 36001 elite 5987435 +37 36002 funereal 28357832 +37 38001 Conley 5987435 +37 38002 lectured 28357832 +37 38003 Abraham 39654943 +37 38011 groupings 5987435 +37 38012 dissociate 28357832 +37 38013 coexist 39654943 +37 38101 rusting 5987435 +37 38102 galling 28357832 +37 38103 obliterates 39654943 +37 38201 resumes 5987435 +37 38202 analyzable 28357832 +37 38203 terminator 39654943 +select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008; +sum(price) +234298 +select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1; +fld1 sum(price) +038008 234298 +explain select fld3 from t2 where 1>2 or 2>3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where false +explain select fld3 from t2 where fld1=fld1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 100.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where true +select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000; +companynr count sum +00 82 10355753 +29 95 14473298 +34 70 17788966 +37 588 83602098 +41 52 12816335 +select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ; +companynr +00 +29 +34 +37 +41 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40; +companynr companyname count(*) +40 company 5 37 +41 company 6 52 +50 company 11 11 +53 company 7 4 +58 company 8 23 +65 company 9 10 +68 company 10 12 +select count(*) from t2; +count(*) +1199 +select count(*) from t2 where fld1 < 098024; +count(*) +387 +select min(fld1) from t2 where fld1>= 098024; +min(fld1) +98024 +select max(fld1) from t2 where fld1>= 098024; +max(fld1) +1232609 +select count(*) from t3 where price2=76234234; +count(*) +4181 +select count(*) from t3 where companynr=512 and price2=76234234; +count(*) +4181 +explain select min(fld1),max(fld1),count(*) from t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL index NULL fld1 4 NULL 1199 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t2`.`fld1`) AS `min(fld1)`,max(`test`.`t2`.`fld1`) AS `max(fld1)`,count(0) AS `count(*)` from `test`.`t2` +explain format=tree select min(fld1),max(fld1),count(*) from t2; +EXPLAIN +-> Count rows in t2 + +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +explain format=tree select min(fld1),max(fld1),count(*) from t2 where rand() > 0.5; +EXPLAIN +-> Aggregate: min(`min(fld1)`), max(`max(fld1)`), count(`count(*)`) + -> Parallel scan on + -> Aggregate: + -> Filter: (rand() > 0.5) (cost=123.65 rows=1199) + -> PQblock scan on t2 using fld1 (cost=123.65 rows=1199) + +select min(fld1),max(fld1),count(*) from t2; +min(fld1) max(fld1) count(*) +0 1232609 1199 +select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; +min(t2nr) max(t2nr) +2115 2115 +select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; +count(*) min(t2nr) max(t2nr) +4181 4 41804 +select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; +t2nr count(*) +9 1 +19 1 +29 1 +39 1 +49 1 +59 1 +69 1 +79 1 +89 1 +99 1 +109 1 +119 1 +129 1 +139 1 +149 1 +159 1 +169 1 +179 1 +189 1 +199 1 +select max(t2nr) from t3 where price=983543950; +max(t2nr) +41807 +select t1.period from t3 t1 limit 1; +period +1001 +select t1.period from t1 as t1 limit 1; +period +9410 +select t1.period as "Nuvarande period" from t1 as t1 limit 1; +Nuvarande period +9410 +select period as ok_period from t1 limit 1; +ok_period +9410 +select period as ok_period from t1 group by ok_period limit 1; +ok_period +9410 +select 1+1 as summa from t1 group by summa limit 1; +summa +2 +select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1; +Nuvarande period +9410 +show tables; +Tables_in_test +t1 +t2 +t3 +t4 +show tables from test like "s%"; +Tables_in_test (s%) +show tables from test like "t?"; +Tables_in_test (t?) +show full columns from t2; +Field Type Collation Null Key Default Extra Privileges Comment +auto int NULL NO PRI NULL auto_increment select,insert,update,references +fld1 int(6) unsigned zerofill NULL NO UNI 000000 select,insert,update,references +companynr tinyint(2) unsigned zerofill NULL NO 00 select,insert,update,references +fld3 char(30) utf8mb4_0900_ai_ci NO MUL select,insert,update,references +fld4 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld5 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld6 char(4) utf8mb4_0900_ai_ci NO select,insert,update,references +show full columns from t2 from test like 'f%'; +Field Type Collation Null Key Default Extra Privileges Comment +fld1 int(6) unsigned zerofill NULL NO UNI 000000 select,insert,update,references +fld3 char(30) utf8mb4_0900_ai_ci NO MUL select,insert,update,references +fld4 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld5 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld6 char(4) utf8mb4_0900_ai_ci NO select,insert,update,references +show full columns from t2 from test like 's%'; +Field Type Collation Null Key Default Extra Privileges Comment +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +show keys from t2; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Visible Expression +t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE YES NULL +t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE YES NULL +t2 1 fld3 1 fld3 A 1171 NULL NULL BTREE YES NULL +drop table t4, t3, t2, t1; +DO 1; +DO benchmark(100,1+1),1,1; +do default; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +do foobar; +ERROR 42S22: Unknown column 'foobar' in 'field list' +CREATE TABLE t1 ( +id mediumint(8) unsigned NOT NULL auto_increment, +pseudo varchar(35) NOT NULL default '', +PRIMARY KEY (id), +UNIQUE KEY pseudo (pseudo) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 (pseudo) VALUES ('test'); +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 1 as rnd1 from t1 where rand() > 2; +rnd1 +DROP TABLE t1; +CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1287 'BINARY as attribute of a type' is deprecated and will be removed in a future release. Please use a CHARACTER SET clause with _bin collation instead +INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); +CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +ERROR HY000: Incorrect DATETIME value: 'wrong-date-value' +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +DROP TABLE t1,t2; +create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); +select wss_type from t1 where wss_type ='102935229216544106'; +wss_type +select wss_type from t1 where wss_type ='102935229216544105'; +wss_type +select wss_type from t1 where wss_type ='102935229216544104'; +wss_type +select wss_type from t1 where wss_type ='102935229216544093'; +wss_type +102935229216544093 +select wss_type from t1 where wss_type =102935229216544093; +wss_type +102935229216544093 +drop table t1; +select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; +select @a; +@a +3 +select @b; +@b +aaaa +select @c; +@c +6.260 +create table t1 (a int not null auto_increment primary key); +insert into t1 values (); +insert into t1 values (); +insert into t1 values (); +select * from (t1 as t2 left join t1 as t3 using (a)), t1; +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from t1, (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); +a +1 +2 +3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +1 NULL +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); +a +1 +2 +3 +select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; +a +1 +2 +3 +select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +NULL 1 +select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); +a +1 +2 +3 +select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; +a +1 +2 +3 +select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; +a +1 +2 +3 +drop table t1; +CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); +CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); +select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; +aa id t2_id id +2 8299 2517 2517 +3 8301 2518 2518 +4 8302 2519 2519 +5 8303 2520 2520 +6 8304 2521 2521 +drop table t1,t2; +create table t1 (id1 int NOT NULL); +create table t2 (id2 int NOT NULL); +create table t3 (id3 int NOT NULL); +create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); +insert into t1 values (1); +insert into t1 values (2); +insert into t2 values (1); +insert into t4 values (1,1); +explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t4 NULL ALL id4 NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`id1` AS `id1`,`test`.`t2`.`id2` AS `id2`,`test`.`t3`.`id3` AS `id3`,`test`.`t4`.`id4` AS `id4`,`test`.`t4`.`id44` AS `id44` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`id2` = `test`.`t1`.`id1`)) left join `test`.`t3` on((`test`.`t3`.`id3` = `test`.`t1`.`id1`)) left join `test`.`t4` on((`test`.`t4`.`id4` = `test`.`t3`.`id3`)) where ((`test`.`t2`.`id2` = 1) or (`test`.`t4`.`id4` = 1)) +select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id1 id2 id3 id4 id44 +1 1 NULL NULL NULL +drop table t1,t2,t3,t4; +create table t1(s varchar(10) not null); +create table t2(s varchar(10) not null primary key); +create table t3(s varchar(10) not null primary key); +insert into t1 values ('one\t'), ('two\t'); +insert into t2 values ('one\r'), ('two\t'); +insert into t3 values ('one\b'), ('two\t'); +select * from t1 where s = 'one'; +s +select * from t2 where s = 'one'; +s +select * from t3 where s = 'one'; +s +one +select * from t1,t2 where t1.s = t2.s; +s s +two two +select * from t2,t3 where t2.s = t3.s; +s s +two two +drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +explain select * from t1 left join t2 on a=c where d in (4); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref c,d d 5 const 2 100.00 Using where +2 SIMPLE t1 NULL ref a a 5 test.t2.c 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ 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`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = 4)) +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref c,d d 5 const 2 100.00 Using where +2 SIMPLE t1 NULL ref a a 5 test.t2.c 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ 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`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = 4)) +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; +CREATE TABLE t1 ( +i int(11) NOT NULL default '0', +c char(10) NOT NULL default '', +PRIMARY KEY (i), +UNIQUE KEY c (c) +) ; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (1,'a'); +INSERT INTO t1 VALUES (2,'b'); +INSERT INTO t1 VALUES (3,'c'); +EXPLAIN SELECT i FROM t1 WHERE i=1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '1' AS `i` from `test`.`t1` where true +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref a a 23 test.t1.a 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` USE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref a a 23 test.t1.a 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` FORCE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +DROP TABLE t1, t2; +CREATE TABLE t1 ( city char(30) ) charset utf8mb4; +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`city` AS `city` from `test`.`t1` where (`test`.`t1`.`city` = 'London') +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`city` AS `city` from `test`.`t1` where ((`test`.`t1`.`city` = 'London') and (`test`.`t1`.`city` like '%london%')) +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,0), (1,1), (4294967295,1); +select a-b from t1 order by 1; +a-b +0 +1 +4294967294 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +4294967294 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +4294967294 +drop table t1; +create table t1 (a int(11)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +kunde_intern_id int(10) unsigned NOT NULL default '0', +kunde_id int(10) unsigned NOT NULL default '0', +FK_firma_id int(10) unsigned NOT NULL default '0', +aktuell enum('Ja','Nein') NOT NULL default 'Ja', +vorname varchar(128) NOT NULL default '', +nachname varchar(128) NOT NULL default '', +geloescht enum('Ja','Nein') NOT NULL default 'Nein', +firma varchar(128) NOT NULL default '' +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), +(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 +WHERE +( +( +( '' != '' AND firma LIKE CONCAT('%', '', '%')) +OR +(vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND +'Vorname1' != '' AND 'xxxx' != '') +) +AND +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, +geloescht FROM t1 +WHERE +( +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +AND +( +( '' != '' AND firma LIKE CONCAT('%', '', '%') ) +OR +( vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND +'xxxx' != '') +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT COUNT(*) FROM t1 WHERE +( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) +AND FK_firma_id = 2; +COUNT(*) +0 +drop table t1; +CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (0x8000000000000000); +SELECT b FROM t1 WHERE b=0x8000000000000000; +b +9223372036854775808 +DROP TABLE t1; +CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `t2` VALUES (0,'READ'); +CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `t3` VALUES (1,'fs'); +select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); +id name gid uid ident level +1 fs NULL NULL 0 READ +drop table t1,t2,t3; +CREATE TABLE t1 ( +acct_id int(11) NOT NULL default '0', +profile_id smallint(6) default NULL, +UNIQUE KEY t1$acct_id (acct_id), +KEY t1$profile_id (profile_id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (132,17),(133,18); +CREATE TABLE t2 ( +profile_id smallint(6) default NULL, +queue_id int(11) default NULL, +seq int(11) default NULL, +KEY t2$queue_id (queue_id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); +CREATE TABLE t3 ( +id int(11) NOT NULL default '0', +qtype int(11) default NULL, +seq int(11) default NULL, +warn_lvl int(11) default NULL, +crit_lvl int(11) default NULL, +rr1 tinyint(4) NOT NULL default '0', +rr2 int(11) default NULL, +default_queue tinyint(4) NOT NULL default '0', +KEY t3$qtype (qtype), +KEY t3$id (id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), +(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); +SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q +WHERE +(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND +(pq.queue_id = q.id) AND (q.rr1 <> 1); +COUNT(*) +4 +drop table t1,t2,t3; +create table t1 (f1 int); +insert into t1 values (1),(NULL); +create table t2 (f2 int, f3 int, f4 int); +create index idx1 on t2 (f4); +insert into t2 values (1,2,3),(2,4,6); +select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) +from t2 C where A.f4 = C.f4) or A.f3 IS NULL; +f2 +1 +NULL +drop table t1,t2; +create table t2 (a tinyint unsigned); +create index t2i on t2(a); +insert into t2 values (0), (254), (255); +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +explain select * from t2 where a > -1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index t2i t2i 2 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a` is not null) +select * from t2 where a > -1; +a +0 +254 +255 +drop table t2; +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +SELECT * FROM t1; +a b c +50 3 3 +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +select found_rows(); +found_rows() +0 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +SELECT * FROM t1; +a b c +50 3 3 +select count(*) from t1; +count(*) +1 +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +select count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; +count(*) +Warnings: +Warning 1287 SQL_CALC_FOUND_ROWS is deprecated and will be removed in a future release. Consider using two separate queries instead. +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +(SELECT a, b AS c FROM t1) ORDER BY c+1; +a c +(SELECT a, b AS c FROM t1) ORDER BY b+1; +a c +SELECT a, b AS c FROM t1 ORDER BY c+1; +a c +SELECT a, b AS c FROM t1 ORDER BY b+1; +a c +drop table t1; +create table t1(f1 int, f2 int); +create table t2(f3 int); +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); +f1 +insert into t1 values(1,1),(2,null); +insert into t2 values(2); +select * from t1,t2 where f1=f3 and (f1,f2) = (2,null); +f1 f2 f3 +select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null); +f1 f2 f3 +2 NULL 2 +drop table t1,t2; +create table t1 (f1 int not null auto_increment primary key, f2 varchar(10)); +create table t11 like t1; +insert into t1 values(1,""),(2,""); +analyze table t1, t11; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t11 analyze status OK +show table status like 't1%'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 InnoDB 10 Dynamic 2 8192 X X X X X X X X X NULL +t11 InnoDB 10 Dynamic 0 0 X X X X X X X X X NULL +select 123 as a from t1 where f1 is null; +a +drop table t1,t11; +CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); +INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); +CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, e INT ); +INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2),(1,2,3); +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 10 2 +1 11 2 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c; +a b c d +1 10 4 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c; +a b c d +1 10 2 +1 11 2 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2,t1 +WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 2 1 1 +1 2 2 1 +1 2 3 1 +DROP TABLE IF EXISTS t1, t2; +create table t1 (f1 int primary key, f2 int); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t1 values (1,1); +insert into t2 values (1,1),(1,2); +select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1; +count(f2) >0 +1 +drop table t1,t2; +create table t1 (f1 int,f2 int); +insert into t1 values(1,1); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t2 values(1,1); +select * from t1 where f1 in (select f3 from t2 where (f3,f4)= (select f3,f4 from t2)); +f1 f2 +1 1 +drop table t1,t2; +CREATE TABLE t1(a int, b int, c int, KEY b(b), KEY c(c)); +insert into t1 values (1,0,0),(2,0,0); +CREATE TABLE t2 (a int, b varchar(2), c varchar(2), PRIMARY KEY(a)); +insert into t2 values (1,'',''), (2,'',''); +CREATE TABLE t3 (a int, b int, PRIMARY KEY (a,b), KEY a (a), KEY b (b)); +insert into t3 values (1,1),(1,2); +explain select straight_join DISTINCT t2.a,t2.b, t1.c from t1, t3, t2 +where (t1.c=t2.a or (t1.c=t3.a and t2.a=t3.b)) and t1.b=556476786 and +t2.b like '%%' order by t2.b limit 0,1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ref b,c b 5 const 1 100.00 Using temporary; Using filesort +1 SIMPLE t3 NULL index PRIMARY,a,b a 4 NULL 2 100.00 Using index; Using join buffer (hash join) +1 SIMPLE t2 NULL ALL PRIMARY NULL NULL NULL 2 50.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select straight_join distinct `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t1`.`b` = 556476786) and ((`test`.`t2`.`a` = `test`.`t1`.`c`) or ((`test`.`t2`.`a` = `test`.`t3`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`c`))) and (`test`.`t2`.`b` like '%%')) order by `test`.`t2`.`b` limit 0,1 +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (a int, INDEX idx(a)); +INSERT INTO t1 VALUES (2), (3), (1); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 IGNORE INDEX (idx); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` IGNORE INDEX (`idx`) +EXPLAIN SELECT * FROM t1 IGNORE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +EXPLAIN SELECT * FROM t1 FORCE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +DROP TABLE t1; +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 VALUES (1,1), (2,1), (4,10); +CREATE TABLE t2 (a int PRIMARY KEY, b int, KEY b (b)); +INSERT INTO t2 VALUES (1,NULL), (2,10); +ALTER TABLE t1 ENABLE KEYS; +Warnings: +Note 1031 Table storage engine for 't1' doesn't have this option +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index b b 5 NULL 2 100.00 Using index +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select straight_join count(0) AS `COUNT(*)` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) or (`test`.`t2`.`b` is null)) +SELECT STRAIGHT_JOIN * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +a b a b +1 NULL 1 1 +1 NULL 2 1 +1 NULL 4 10 +2 10 4 10 +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index b b 5 NULL 2 100.00 Using index +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select straight_join count(0) AS `COUNT(*)` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) or (`test`.`t2`.`b` is null)) +SELECT STRAIGHT_JOIN * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +a b a b +1 NULL 1 1 +1 NULL 2 1 +1 NULL 4 10 +2 10 4 10 +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (key1 double default NULL, UNIQUE KEY key1 (key1)); +CREATE TABLE t2 (key2 double default NULL, UNIQUE KEY key2 (key2)); +INSERT INTO t1 VALUES (0.3762),(0.3845),(0.6158),(0.7941); +INSERT INTO t2 VALUES (1.3762),(1.3845),(1.6158),(1.7941); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +explain select max(key1) from t1 where key1 <= 0.6158; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)` from `test`.`t1` where (`test`.`t1`.`key1` <= 0.6158) +explain select max(key2) from t2 where key2 <= 1.6158; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t2`.`key2`) AS `max(key2)` from `test`.`t2` where (`test`.`t2`.`key2` <= 1.6158) +explain select min(key1) from t1 where key1 >= 0.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where (`test`.`t1`.`key1` >= 0.3762) +explain select min(key2) from t2 where key2 >= 1.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t2`.`key2`) AS `min(key2)` from `test`.`t2` where (`test`.`t2`.`key2` >= 1.3762) +explain select max(key1), min(key2) from t1, t2 +where key1 <= 0.6158 and key2 >= 1.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)`,min(`test`.`t2`.`key2`) AS `min(key2)` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`key1` <= 0.6158) and (`test`.`t2`.`key2` >= 1.3762)) +explain select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range key1 key1 9 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` <= 0.6158) and ((rand() + 0.5) >= 0.5)) +explain select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index key1 key1 9 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` >= 0.3762) and ((rand() + 0.5) >= 0.5)) +select max(key1) from t1 where key1 <= 0.6158; +max(key1) +0.6158 +select max(key2) from t2 where key2 <= 1.6158; +max(key2) +1.6158 +select min(key1) from t1 where key1 >= 0.3762; +min(key1) +0.3762 +select min(key2) from t2 where key2 >= 1.3762; +min(key2) +1.3762 +select max(key1), min(key2) from t1, t2 +where key1 <= 0.6158 and key2 >= 1.3762; +max(key1) min(key2) +0.6158 1.3762 +select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; +max(key1) +0.6158 +select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; +min(key1) +0.3762 +DROP TABLE t1,t2; +CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL); +INSERT INTO t1 VALUES (10); +SELECT i='1e+01',i=1e+01, i in (1e+01,1e+01), i in ('1e+01','1e+01') FROM t1; +i='1e+01' i=1e+01 i in (1e+01,1e+01) i in ('1e+01','1e+01') +1 1 1 1 +DROP TABLE t1; +create table t1(a bigint unsigned, b bigint); +insert ignore into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff), +(0x10000000000000000, 0x10000000000000000), +(0x8fffffffffffffff, 0x8fffffffffffffff); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'a' at row 2 +Warning 1264 Out of range value for column 'b' at row 2 +Warning 1264 Out of range value for column 'b' at row 3 +select hex(a), hex(b) from t1; +hex(a) hex(b) +FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +8FFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +drop table t1; +CREATE TABLE t1 (c0 int); +CREATE TABLE t2 (c0 int); +INSERT INTO t1 VALUES(@@connect_timeout); +INSERT INTO t2 VALUES(@@connect_timeout); +SELECT * FROM t1 JOIN t2 ON t1.c0 = t2.c0 WHERE (t1.c0 <=> @@connect_timeout); +c0 c0 +X X +DROP TABLE t1, t2; +End of 4.1 tests +CREATE TABLE t1 ( +K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', +K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', +F2I4 int(11) NOT NULL default '0' +) DEFAULT CHARSET=latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +('W%RT', '0100', 1), +('W-RT', '0100', 1), +('WART', '0100', 1), +('WART', '0200', 1), +('WERT', '0100', 2), +('WORT','0200', 2), +('WT', '0100', 2), +('W_RT', '0100', 2), +('WaRT', '0100', 3), +('WART', '0300', 3), +('WRT' , '0400', 3), +('WURM', '0500', 3), +('W%T', '0600', 4), +('WA%T', '0700', 4), +('WA_T', '0800', 4); +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND +(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); +K2C4 K4N4 F2I4 +WART 0200 1 +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); +K2C4 K4N4 F2I4 +WART 0100 1 +WART 0200 1 +WART 0300 3 +DROP TABLE t1; +create table t1 (a int, b int); +create table t2 like t1; +select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; +a +select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; +a +select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; +a a a +drop table t1,t2; +create table t1 (s1 varchar(5)); +insert into t1 values ('Wall'); +select min(s1) from t1 group by s1 with rollup; +min(s1) +Wall +Wall +drop table t1; +create table t1 (s1 int); +insert into t1 values (0); +select avg(distinct s1) from t1 group by s1 with rollup; +avg(distinct s1) +0.0000 +0.0000 +drop table t1; +create table t1 (s1 int); +insert into t1 values (null),(1); +select avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +1.0000 +select distinct avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +drop table t1; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +INSERT INTO t2 VALUES (2), (4), (6); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +a +2 +4 +EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 3 33.33 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` straight_join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`a`) +EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 20.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`) +DROP TABLE t1,t2; +select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; +x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 +16 16 2 2 +create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); +insert into t1 values (" 2", 2); +insert into t2 values (" 2", " one "),(" 2", " two "); +select * from t1 left join t2 on f1 = f3; +f1 f2 f3 f4 + 2 2 2 one + 2 2 2 two +drop table t1,t2; +create table t1 (empnum smallint, grp int); +create table t2 (empnum int, name char(5)); +insert into t1 values(1,1); +insert into t2 values(1,'bob'); +create view v1 as select * from t2 inner join t1 using (empnum); +select * from v1; +empnum name grp +1 bob 1 +drop table t1,t2; +drop view v1; +create table t1 (pk int primary key, b int); +create table t2 (pk int primary key, c int); +select pk from t1 inner join t2 using (pk); +pk +drop table t1,t2; +create table t1 (s1 int, s2 char(5), s3 decimal(10)); +create view v1 as select s1, s2, 'x' as s3 from t1; +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'x' +insert into t1 values (1,'x',5); +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'x' +drop table t1; +drop view v1; +create table t1(a1 int); +create table t2(a2 int); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +create view v2 (c) as select a1 from t1; +select * from t1 natural left join t2; +a1 a2 +1 1 +1 2 +2 1 +2 2 +select * from t1 natural right join t2; +a2 a1 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural left join t2; +c a2 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural right join t2; +a2 c +1 1 +1 2 +2 1 +2 2 +drop table t1, t2; +drop view v2; +create table t1 (a int(10), t1_val int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (b int(10), t2_val int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t3 (a int(10), b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,1),(2,2); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(2,1),(3,1),(4,1); +select * from t1 natural join t2 natural join t3; +a b t1_val t2_val +1 1 1 1 +2 1 2 1 +select * from t1 natural join t3 natural join t2; +b a t1_val t2_val +1 1 1 1 +1 2 2 1 +drop table t1, t2, t3; +DO IFNULL(NULL, NULL); +SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); +CAST(IFNULL(NULL, NULL) AS DECIMAL) +NULL +SELECT ABS(IFNULL(NULL, NULL)); +ABS(IFNULL(NULL, NULL)) +NULL +SELECT IFNULL(NULL, NULL); +IFNULL(NULL, NULL) +NULL +SET @OLD_SQL_MODE12595=@@SQL_MODE, @@SQL_MODE=''; +SHOW LOCAL VARIABLES LIKE 'SQL_MODE'; +Variable_name Value +sql_mode +CREATE TABLE BUG_12595(a varchar(100)) charset latin1; +INSERT INTO BUG_12595 VALUES ('hakan%'), ('hakank'), ("ha%an"); +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE ''; +a +hakan% +hakank +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE ''; +a +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha%%an' ESCAPE '%'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE '\\'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|'; +a +ha%an +SET @@SQL_MODE='NO_BACKSLASH_ESCAPES'; +SHOW LOCAL VARIABLES LIKE 'SQL_MODE'; +Variable_name Value +sql_mode NO_BACKSLASH_ESCAPES +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%'; +a +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE '\\'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE ''; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\n%' ESCAPE '\n'; +ERROR HY000: Incorrect arguments to ESCAPE +SET @@SQL_MODE=@OLD_SQL_MODE12595; +DROP TABLE BUG_12595; +create table t1 (a char(1)); +create table t2 (a char(1)); +insert into t1 values ('a'),('b'),('c'); +insert into t2 values ('b'),('c'),('d'); +select a from t1 natural join t2; +a +b +c +select * from t1 natural join t2 where a = 'b'; +a +b +drop table t1, t2; +CREATE TABLE t1 (`id` TINYINT); +CREATE TABLE t2 (`id` TINYINT); +CREATE TABLE t3 (`id` TINYINT); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +drop table t1, t2, t3; +create table t1 (a int(10),b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (a int(10),b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,10),(2,20),(3,30); +insert into t2 values (1,10); +select * from t1 inner join t2 using (A); +a b b +1 10 10 +select * from t1 inner join t2 using (a); +a b b +1 10 10 +drop table t1, t2; +create table t1 (a int, c int); +create table t2 (b int); +create table t3 (b int, a int); +create table t4 (c int); +insert into t1 values (1,1); +insert into t2 values (1); +insert into t3 values (1,1); +insert into t4 values (1); +select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +a c b b a +1 1 1 1 1 +select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +ERROR 42S22: Unknown column 't1.a' in 'on clause' +select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); +a c b b a c +1 1 1 1 1 1 +select * from t1 join t2 join t4 using (c); +c a b +1 1 1 +drop table t1, t2, t3, t4; +create table t1(x int, y int); +create table t2(x int, y int); +create table t3(x int, primary key(x)); +insert into t1 values (1, 1), (2, 1), (3, 1), (4, 3), (5, 6), (6, 6); +insert into t2 values (1, 1), (2, 1), (3, 3), (4, 6), (5, 6); +insert into t3 values (1), (2), (3), (4), (5); +select t1.x, t3.x from t1, t2, t3 where t1.x = t2.x and t3.x >= t1.y and t3.x <= t2.y; +x x +1 1 +2 1 +3 1 +3 2 +3 3 +4 3 +4 4 +4 5 +drop table t1,t2,t3; +create table t1 (id char(16) not null default '', primary key (id)); +insert into t1 values ('100'),('101'),('102'); +create table t2 (id char(16) default null); +insert into t2 values (1); +create view v1 as select t1.id from t1; +create view v2 as select t2.id from t2; +create view v3 as select (t1.id+2) as id from t1 natural left join t2; +select t1.id from t1 left join v2 using (id); +id +100 +101 +102 +select t1.id from v2 right join t1 using (id); +id +100 +101 +102 +select t1.id from t1 left join v3 using (id); +id +100 +101 +102 +select * from t1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join t1 using (id); +id +100 +101 +102 +select * from t1 left join v3 using (id); +id +100 +101 +102 +select v1.id from v1 left join v2 using (id); +id +100 +101 +102 +select v1.id from v2 right join v1 using (id); +id +100 +101 +102 +select v1.id from v1 left join v3 using (id); +id +100 +101 +102 +select * from v1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join v1 using (id); +id +100 +101 +102 +select * from v1 left join v3 using (id); +id +100 +101 +102 +drop table t1, t2; +drop view v1, v2, v3; +create table t1 (id int(11) not null default '0'); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (123),(191),(192); +create table t2 (id char(16) character set utf8 not null); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t2 values ('58013'),('58014'),('58015'),('58016'); +create table t3 (a_id int(11) not null, b_id char(16) character set utf8); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t3 values (123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013'); +select count(*) +from t1 inner join (t3 left join t2 on t2.id = t3.b_id) on t1.id = t3.a_id; +count(*) +6 +select count(*) +from t1 inner join (t2 right join t3 on t2.id = t3.b_id) on t1.id = t3.a_id; +count(*) +6 +drop table t1,t2,t3; +create table t1 (a int); +create table t2 (b int); +create table t3 (c int); +select * from t1 join t2 join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 left join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 right join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 straight_join t3 on (t1.a=t3.c); +a b c +drop table t1, t2 ,t3; +create table t1(f1 int, f2 date); +insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'), +(4,'2005-10-01'),(5,'2005-12-30'); +select * from t1 where f2 >= 0 order by f2; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +select * from t1 where f2 >= '0000-00-00' order by f2; +ERROR HY000: Incorrect DATE value: '0000-00-00' +select * from t1 where f2 >= '2005-09-31' order by f2; +ERROR HY000: Incorrect DATE value: '2005-09-31' +select * from t1 where f2 >= '2005-09-3a' order by f2; +f1 f2 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +select * from t1 where f2 <= '2005-09-31' order by f2; +ERROR HY000: Incorrect DATE value: '2005-09-31' +select * from t1 where f2 <= '2005-09-3a' order by f2; +f1 f2 +1 2005-01-01 +2 2005-09-01 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +drop table t1; +create table t1 (f1 int, f2 int); +insert into t1 values (1, 30), (2, 20), (3, 10); +create algorithm=merge view v1 as select f1, f2 from t1; +create algorithm=merge view v2 (f2, f1) as select f1, f2 from t1; +create algorithm=merge view v3 as select t1.f1 as f2, t1.f2 as f1 from t1; +select t1.f1 as x1, f1 from t1 order by t1.f1; +x1 f1 +1 1 +2 2 +3 3 +select v1.f1 as x1, f1 from v1 order by v1.f1; +x1 f1 +1 1 +2 2 +3 3 +select v2.f1 as x1, f1 from v2 order by v2.f1; +x1 f1 +10 10 +20 20 +30 30 +select v3.f1 as x1, f1 from v3 order by v3.f1; +x1 f1 +10 10 +20 20 +30 30 +select f1, f2, v1.f1 as x1 from v1 order by v1.f1; +f1 f2 x1 +1 30 1 +2 20 2 +3 10 3 +select f1, f2, v2.f1 as x1 from v2 order by v2.f1; +f1 f2 x1 +10 3 10 +20 2 20 +30 1 30 +select f1, f2, v3.f1 as x1 from v3 order by v3.f1; +f1 f2 x1 +10 3 10 +20 2 20 +30 1 30 +drop table t1; +drop view v1, v2, v3; +CREATE TABLE t1(key_a int4 NOT NULL, optimus varchar(32), PRIMARY KEY(key_a)); +CREATE TABLE t2(key_a int4 NOT NULL, prime varchar(32), PRIMARY KEY(key_a)); +CREATE table t3(key_a int4 NOT NULL, key_b int4 NOT NULL, foo varchar(32), +PRIMARY KEY(key_a,key_b)); +INSERT INTO t1 VALUES (0,''); +INSERT INTO t1 VALUES (1,'i'); +INSERT INTO t1 VALUES (2,'j'); +INSERT INTO t1 VALUES (3,'k'); +INSERT INTO t2 VALUES (1,'r'); +INSERT INTO t2 VALUES (2,'s'); +INSERT INTO t2 VALUES (3,'t'); +INSERT INTO t3 VALUES (1,5,'x'); +INSERT INTO t3 VALUES (1,6,'y'); +INSERT INTO t3 VALUES (2,5,'xx'); +INSERT INTO t3 VALUES (2,6,'yy'); +INSERT INTO t3 VALUES (2,7,'zz'); +INSERT INTO t3 VALUES (3,5,'xxx'); +SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +key_a foo +2 xx +EXPLAIN SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t3 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `key_a`,'xx' AS `foo` from `test`.`t1` join `test`.`t2` join `test`.`t3` where true +SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +key_a foo +2 xx +EXPLAIN SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t3 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `key_a`,'xx' AS `foo` from `test`.`t1` join `test`.`t2` join `test`.`t3` where true +DROP TABLE t1,t2,t3; +create table t1 (f1 int); +insert into t1 values(1),(2); +create table t2 (f2 int, f3 int, key(f2)); +insert into t2 values(1,1),(2,2); +create table t3 (f4 int not null); +insert into t3 values (2),(2),(2); +select f1,(select count(*) from t2,t3 where f2=f1 and f3=f4) as count from t1; +f1 count +1 0 +2 3 +drop table t1,t2,t3; +create table t1 (f1 int unique); +create table t2 (f2 int unique); +create table t3 (f3 int unique); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +insert into t3 values(1),(NULL); +select * from t3 where f3 is null; +f3 +NULL +select t2.f2 from t1 left join t2 on f1=f2 join t3 on f1=f3 where f1=1; +f2 +1 +drop table t1,t2,t3; +create table t1(f1 char, f2 char not null); +insert into t1 values(null,'a'); +create table t2 (f2 char not null); +insert into t2 values('b'); +select * from t1 left join t2 on f1=t2.f2 where t1.f2='a'; +f1 f2 f2 +NULL a NULL +drop table t1,t2; +select * from (select * left join t on f1=f2) tt; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left join t on f1=f2) tt' at line 1 +CREATE TABLE t1 (sku int PRIMARY KEY, pr int); +CREATE TABLE t2 (sku int PRIMARY KEY, sppr int, name varchar(255)); +INSERT INTO t1 VALUES +(10, 10), (20, 10), (30, 20), (40, 30), (50, 10), (60, 10); +INSERT INTO t2 VALUES +(10, 10, 'aaa'), (20, 10, 'bbb'), (30, 10, 'ccc'), (40, 20, 'ddd'), +(50, 10, 'eee'), (60, 20, 'fff'), (70, 20, 'ggg'), (80, 30, 'hhh'); +SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr +FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku); +sku sppr name sku pr +20 10 bbb 10 10 +20 10 bbb 20 10 +EXPLAIN +SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr +FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select '20' AS `sku`,'10' AS `sppr`,'bbb' AS `name`,`test`.`t1`.`sku` AS `sku`,`test`.`t1`.`pr` AS `pr` from `test`.`t2` join `test`.`t1` where (((`test`.`t1`.`sku` = 20) or (`test`.`t1`.`sku` = '10'))) +DROP TABLE t1,t2; +SET SQL_MODE='NO_UNSIGNED_SUBTRACTION'; +CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL); +INSERT t1 SET i = 0; +UPDATE t1 SET i = -1; +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +UPDATE t1 SET i = CAST(i - 1 AS SIGNED); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +UPDATE t1 SET i = i - 1; +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +DROP TABLE t1; +SET SQL_MODE=default; +create table t1 (a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t2 (a int, b int, c int, e int, primary key(a,b,c)); +# The "ANALYZE TABLE"-command that is executed further down will get +# different results depending on the order of rows in table t2. Since the +# INSERT INTO ... SELECT may be executed using different execution plans, +# we've added ORDER BY to ensure that we rows has the same order every +# time. If not, the estimated number of rows for t2 (alias 'a') in the +# EXPLAIN may change on different platforms. Note that both table t1 and +# t2 may be MYISAM, since many of the test files that includes this file +# forces MYISAM as the default storage engine. +insert into t2 select A.a, B.a, C.a, C.a from t1 A, t1 B, t1 C +ORDER BY A.a, B.a, C.a; +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select 'In next EXPLAIN, B.rows must be exactly 10:' Z; +Z +In next EXPLAIN, B.rows must be exactly 10: +explain select * from t2 a, t2 b where a.a=5 and a.b=5 and a.c<5 +and b.a=5 and b.b=a.e and (b.b =1 or b.b = 3 or b.b=5); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 27.10 Parallel execute (1 workers) +2 SIMPLE a NULL range PRIMARY PRIMARY 12 NULL 5 27.10 Using where +2 SIMPLE b NULL ref PRIMARY PRIMARY 8 const,test.a.e 10 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`b` AS `b`,`test`.`a`.`c` AS `c`,`test`.`a`.`e` AS `e`,`test`.`b`.`a` AS `a`,`test`.`b`.`b` AS `b`,`test`.`b`.`c` AS `c`,`test`.`b`.`e` AS `e` from `test`.`t2` `a` join `test`.`t2` `b` where ((`test`.`b`.`b` = `test`.`a`.`e`) and (`test`.`b`.`a` = 5) and (`test`.`a`.`b` = 5) and (`test`.`a`.`a` = 5) and (`test`.`a`.`c` < 5) and ((`test`.`a`.`e` = 1) or (`test`.`a`.`e` = 3) or (`test`.`a`.`e` = 5))) +drop table t1, t2; +CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX(b)); +INSERT INTO t1 VALUES (1, 3), (9,4), (7,5), (4,5), (6,2), +(3,1), (5,1), (8,9), (2,2), (0,9); +CREATE TABLE t2 (c int, d int, f int, INDEX(c,f)); +INSERT INTO t2 VALUES +(1,0,0), (1,0,1), (2,0,0), (2,0,1), (3,0,0), (4,0,1), +(5,0,0), (5,0,1), (6,0,0), (0,0,1), (7,0,0), (7,0,1), +(0,0,0), (0,0,1), (8,0,0), (8,0,1), (9,0,0), (9,0,1); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,b b 5 NULL 3 100.00 Using where; Using index +2 SIMPLE t2 NULL ref c c 5 test.t1.a 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2`.`f` AS `f` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` between 4 and 6)) +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6 AND a > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 90.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,b b 9 NULL 3 90.00 Using where; Using index +2 SIMPLE t2 NULL ref c c 5 test.t1.a 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2`.`f` AS `f` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` between 4 and 6) and (`test`.`t1`.`a` > 0)) +DROP TABLE t1, t2; +create table t1 ( +a int unsigned not null auto_increment primary key, +b bit not null, +c bit not null +); +create table t2 ( +a int unsigned not null auto_increment primary key, +b bit not null, +c int unsigned not null, +d varchar(50) +); +insert into t1 (b,c) values (0,1), (0,1); +insert into t2 (b,c) values (0,1); +select t1.a, t1.b + 0, t1.c + 0, t2.a, t2.b + 0, t2.c, t2.d +from t1 left outer join t2 on t1.a = t2.c and t2.b <> 1 +where t1.b <> 1 order by t1.a; +a t1.b + 0 t1.c + 0 a t2.b + 0 c d +1 0 1 1 0 1 NULL +2 0 1 NULL NULL NULL NULL +drop table t1,t2; +SELECT 0.9888889889 * 1.011111411911; +0.9888889889 * 1.011111411911 +0.9998769417899202067879 +prepare stmt from 'select 1 as " a "'; +Warnings: +Warning 1466 Leading spaces are removed from name ' a ' +execute stmt; +a +1 +CREATE TABLE t1 (a int NOT NULL PRIMARY KEY, b int NOT NULL); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +CREATE TABLE t2 (c int NOT NULL, INDEX idx(c)); +INSERT INTO t2 VALUES +(1), (1), (1), (1), (1), (1), (1), (1), +(2), (2), (2), (2), +(3), (3), +(4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL ref idx idx 4 const 8 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '1' AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = '1')) +EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=4; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL ref idx idx 4 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '4' AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = '4')) +DROP TABLE t1, t2; +CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a int); +INSERT INTO t1 VALUES (1,2), (2,NULL), (3,2); +CREATE TABLE t2 (b int, c INT, INDEX idx1(b)); +INSERT INTO t2 VALUES (2,1), (3,2); +CREATE TABLE t3 (d int, e int, INDEX idx1(d)); +INSERT INTO t3 VALUES (2,10), (2,20), (1,30), (2,40), (2,50); +EXPLAIN +SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id +WHERE t1.id=2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL const idx1 NULL NULL NULL 1 100.00 Impossible ON condition +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL const idx1 NULL NULL NULL 1 100.00 Impossible ON condition +2 SIMPLE t3 NULL ref idx1 idx1 5 const 4 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `id`,NULL AS `a`,NULL AS `b`,NULL AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t3`.`e` AS `e` from `test`.`t1` left join `test`.`t2` on(multiple equal(NULL, NULL)) join `test`.`t3` where (`test`.`t3`.`d` = 2) +SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id +WHERE t1.id=2; +id a b c d e +2 NULL NULL NULL 2 10 +2 NULL NULL NULL 2 20 +2 NULL NULL NULL 2 40 +2 NULL NULL NULL 2 50 +DROP TABLE t1,t2,t3; +create table t1 (c1 varchar(1), c2 int, c3 int, c4 int, c5 int, c6 int, +c7 int, c8 int, c9 int, fulltext key (`c1`)); +select distinct match (`c1`) against ('z') , c2, c3, c4,c5, c6,c7, c8 +from t1 where c9=1 order by c2, c2; +match (`c1`) against ('z') c2 c3 c4 c5 c6 c7 c8 +drop table t1; +CREATE TABLE t1 (pk varchar(10) PRIMARY KEY, fk varchar(16)) charset utf8mb4; +CREATE TABLE t2 (pk varchar(16) PRIMARY KEY, fk varchar(10)) charset utf8mb4; +INSERT INTO t1 VALUES +('d','dddd'), ('i','iii'), ('a','aa'), ('b','bb'), ('g','gg'), +('e','eee'), ('c','cccc'), ('h','hhh'), ('j','jjj'), ('f','fff'); +INSERT INTO t2 VALUES +('jjj', 'j'), ('cc','c'), ('ccc','c'), ('aaa', 'a'), ('jjjj','j'), +('hhh','h'), ('gg','g'), ('fff','f'), ('ee','e'), ('ffff','f'), +('bbb','b'), ('ff','f'), ('cccc','c'), ('dddd','d'), ('jj','j'), +('aaaa','a'), ('bb','b'), ('eeee','e'), ('aa','a'), ('hh','h'); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk < 'c' AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` < 'c')) +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk BETWEEN 'a' AND 'b' AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` between 'a' and 'b')) +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk IN ('a','b') AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` in ('a','b'))) +DROP TABLE t1,t2; +CREATE TABLE t1 (a int, b varchar(20) NOT NULL, PRIMARY KEY(a)) charset utf8mb4; +CREATE TABLE t2 (a int, b varchar(20) NOT NULL, +PRIMARY KEY (a), UNIQUE KEY (b)) charset utf8mb4; +INSERT INTO t1 VALUES (1,'a'),(2,'b'),(3,'c'); +INSERT INTO t2 VALUES (1,'a'),(2,'b'),(3,'c'); +EXPLAIN SELECT t1.a FROM t1 LEFT JOIN t2 ON t2.b=t1.b WHERE t1.a=3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL const b b 82 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '3' AS `a` from `test`.`t1` left join `test`.`t2` on(multiple equal('c', 'c')) where true +DROP TABLE t1,t2; +CREATE TABLE t1(id int PRIMARY KEY, b int, e int); +CREATE TABLE t2(i int, a int, INDEX si(i), INDEX ai(a)); +CREATE TABLE t3(a int PRIMARY KEY, c char(4), INDEX ci(c)); +INSERT INTO t1 VALUES +(1,10,19), (2,20,22), (4,41,42), (9,93,95), (7, 77,79), +(6,63,67), (5,55,58), (3,38,39), (8,81,89); +INSERT INTO t2 VALUES +(21,210), (41,410), (82,820), (83,830), (84,840), +(65,650), (51,510), (37,370), (94,940), (76,760), +(22,220), (33,330), (40,400), (95,950), (38,380), +(67,670), (88,880), (57,570), (96,960), (97,970); +INSERT INTO t3 VALUES +(210,'bb'), (950,'ii'), (400,'ab'), (500,'ee'), (220,'gg'), +(440,'gg'), (310,'eg'), (380,'ee'), (840,'bb'), (830,'ff'), +(230,'aa'), (960,'ii'), (410,'aa'), (510,'ee'), (290,'bb'), +(450,'gg'), (320,'dd'), (390,'hh'), (850,'jj'), (860,'ff'); +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 +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si si 5 NULL 4 100.00 Using where +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` FORCE INDEX (`si`) join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t2`.`i` between '81' and '89') and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2,t3 +WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee') ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si,ai si 5 NULL 4 100.00 Using where +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t2`.`i` between '81' and '89') and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND +t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si si 5 NULL 2 100.00 Using where +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` FORCE INDEX (`si`) join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((`test`.`t2`.`i` = '81') or (`test`.`t2`.`i` = '89')) and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2,t3 +WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND +t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si,ai si 5 NULL 2 100.00 Using where +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((`test`.`t2`.`i` = '81') or (`test`.`t2`.`i` = '89')) and (`test`.`t3`.`c` in ('bb','ee'))) +DROP TABLE t1,t2,t3; +CREATE TABLE t1 ( f1 int primary key, f2 int, f3 int, f4 int, f5 int, f6 int, checked_out int); +CREATE TABLE t2 ( f11 int PRIMARY KEY ); +INSERT INTO t1 VALUES (1,1,1,0,0,0,0),(2,1,1,3,8,1,0),(3,1,1,4,12,1,0); +INSERT INTO t2 VALUES (62); +SELECT * FROM t1 LEFT JOIN t2 ON f11 = t1.checked_out GROUP BY f1 ORDER BY f2, f3, f4, f5 LIMIT 0, 1; +f1 f2 f3 f4 f5 f6 checked_out f11 +1 1 1 0 0 0 0 NULL +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(a int); +INSERT into t1 values (1), (2), (3); +SELECT * FROM t1 LIMIT 2, -1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1 +DROP TABLE t1; +set optimizer_switch='index_merge=off'; +CREATE TABLE t1 ( +ID_with_null int NULL, +ID_better int NOT NULL, +INDEX idx1 (ID_with_null), +INDEX idx2 (ID_better) +); +INSERT INTO t1 VALUES (1,1), (2,1), (null,3), (null,3), (null,3), (null,3); +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SELECT COUNT(*) FROM t1 WHERE ID_with_null IS NULL; +COUNT(*) +128 +SELECT COUNT(*) FROM t1 WHERE ID_better=1; +COUNT(*) +2 +EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 98.46 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 98.46 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID_with_null` AS `ID_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID_with_null` is null)) +DROP INDEX idx1 ON t1; +CREATE UNIQUE INDEX idx1 ON t1(ID_with_null); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 98.46 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 98.46 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID_with_null` AS `ID_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID_with_null` is null)) +DROP TABLE t1; +CREATE TABLE t1 ( +ID1_with_null int NULL, +ID2_with_null int NULL, +ID_better int NOT NULL, +INDEX idx1 (ID1_with_null, ID2_with_null), +INDEX idx2 (ID_better) +) ; +INSERT INTO t1 VALUES (1,1,1), (2,2,1), (3,null,3), (null,3,3), (null,null,3), +(3,null,3), (null,3,3), (null,null,3), (3,null,3), (null,3,3), (null,null,3); +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null=3; +COUNT(*) +24 +SELECT COUNT(*) FROM t1 WHERE ID1_with_null=3 AND ID2_with_null IS NULL; +COUNT(*) +24 +SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null IS NULL; +COUNT(*) +192 +SELECT COUNT(*) FROM t1 WHERE ID_better=1; +COUNT(*) +2 +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID2_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID1_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and ((`test`.`t1`.`ID2_with_null` = 3) is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 79.34 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 79.34 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and (`test`.`t1`.`ID2_with_null` is null)) +DROP INDEX idx1 ON t1; +CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID2_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null IS NULL ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID1_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID2_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 79.34 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 79.34 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and (`test`.`t1`.`ID2_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND +(ID2_with_null=1 OR ID2_with_null=2); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 2.50 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 2.50 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and ((`test`.`t1`.`ID2_with_null` = 1) or (`test`.`t1`.`ID2_with_null` = 2))) +DROP TABLE t1; +set optimizer_switch='index_merge=on'; +CREATE TABLE t1 (a INT, ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY ts(ts)); +INSERT INTO t1 VALUES (30,"2006-01-03 23:00:00"), (31,"2006-01-03 23:00:00"); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CREATE TABLE t2 (a INT, dt1 DATETIME, dt2 DATETIME, PRIMARY KEY (a)); +INSERT INTO t2 VALUES (30, "2006-01-01 00:00:00", "2999-12-31 00:00:00"); +INSERT INTO t2 SELECT a+1,dt1,dt2 FROM t2; +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +EXPLAIN +SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 +AND t1.ts BETWEEN t2.dt1 AND t2.dt2 +AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t1 NULL range ts ts 4 NULL 2 50.00 Using where +Warnings: +Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`ts` AS `ts`,'30' AS `a`,'2006-01-01 00:00:00' AS `dt1`,'2999-12-31 00:00:00' AS `dt2` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = 30) and (`test`.`t1`.`ts` between '2006-01-01 00:00:00' and '2999-12-31 00:00:00') and (`test`.`t1`.`ts` between '2006-01-01' and '2006-12-31')) +SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 +AND t1.ts BETWEEN t2.dt1 AND t2.dt2 +AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; +a ts a dt1 dt2 +30 2006-01-03 23:00:00 30 2006-01-01 00:00:00 2999-12-31 00:00:00 +Warnings: +Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 +DROP TABLE t1,t2; +create table t1 (a bigint unsigned); +insert into t1 values +(if(1, 9223372036854775808, 1)), +(case when 1 then 9223372036854775808 else 1 end), +(coalesce(9223372036854775808, 1)); +select * from t1; +a +9223372036854775808 +9223372036854775808 +9223372036854775808 +drop table t1; +create table t1 charset utf8mb4 select +if(1, 9223372036854775808, 1) i, +case when 1 then 9223372036854775808 else 1 end c, +coalesce(9223372036854775808, 1) co; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` decimal(19,0) NOT NULL DEFAULT '0', + `c` decimal(19,0) NOT NULL DEFAULT '0', + `co` decimal(19,0) NOT NULL DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +select +if(1, cast(1111111111111111111 as unsigned), 1) i, +case when 1 then cast(1111111111111111111 as unsigned) else 1 end c, +coalesce(cast(1111111111111111111 as unsigned), 1) co; +i c co +1111111111111111111 1111111111111111111 1111111111111111111 +CREATE TABLE t1 (name varchar(255)) charset latin1; +CREATE TABLE t2 (name varchar(255), n int, KEY (name(3))) charset latin1; +INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); +INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); +INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); +INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT * FROM t2; +name n +bb 1 +aa 2 +cc 3 +cc  4 +cc 5 +bb 6 +cc 7 +SELECT * FROM t2 ORDER BY name; +name n +aa 2 +bb 1 +bb 6 +cc  4 +cc 3 +cc 5 +cc 7 +SELECT name, LENGTH(name), n FROM t2 ORDER BY name; +name LENGTH(name) n +aa 2 2 +bb 2 1 +bb 3 6 +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref name name 6 const 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` = 'cc ') +SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +name LENGTH(name) n +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +name LENGTH(name) n +cc 5 3 +cc  4 4 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') order by `test`.`t2`.`name` +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +name LENGTH(name) n +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +2 SIMPLE t2 NULL ref name name 6 test.t1.name 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`name` AS `name`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`n` AS `n` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`name` = `test`.`t1`.`name`)) where true +SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +name name n +aa aa 2 +aa aa 2 +bb bb 1 +bb bb 6 +cc cc 5 +cc cc 7 +cc cc 3 +ccc NULL NULL +DROP TABLE t1,t2; +CREATE TABLE t1 (name text) charset latin1; +CREATE TABLE t2 (name text, n int, KEY (name(3))) charset latin1; +INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); +INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); +INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); +INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT * FROM t2; +name n +bb 1 +aa 2 +cc 3 +cc  4 +cc 5 +bb 6 +cc 7 +SELECT * FROM t2 ORDER BY name; +name n +aa 2 +bb 1 +bb 6 +cc  4 +cc 3 +cc 5 +cc 7 +SELECT name, LENGTH(name), n FROM t2 ORDER BY name; +name LENGTH(name) n +aa 2 2 +bb 2 1 +bb 3 6 +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ref name name 6 const 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` = 'cc ') +SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +name LENGTH(name) n +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +name LENGTH(name) n +cc 5 3 +cc  4 4 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') order by `test`.`t2`.`name` +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +name LENGTH(name) n +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref name name 6 test.t1.name 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`name` AS `name`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`n` AS `n` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`name` = `test`.`t1`.`name`)) where true +SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +name name n +aa aa 2 +aa aa 2 +bb bb 1 +bb bb 6 +cc cc 5 +cc cc 7 +cc cc 3 +ccc NULL NULL +DROP TABLE t1,t2; +CREATE TABLE t1 ( +access_id int NOT NULL default '0', +name varchar(20) default NULL, +`rank` int NOT NULL default '0', +KEY idx (access_id) +); +CREATE TABLE t2 ( +faq_group_id int NOT NULL default '0', +faq_id int NOT NULL default '0', +access_id int default NULL, +UNIQUE KEY idx1 (faq_id), +KEY idx2 (faq_group_id,faq_id) +); +INSERT INTO t1 VALUES +(1,'Everyone',2),(2,'Help',3),(3,'Technical Support',1),(4,'Chat User',4); +INSERT INTO t2 VALUES +(261,265,1),(490,494,1); +SELECT t2.faq_id +FROM t1 INNER JOIN t2 IGNORE INDEX (idx1) +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +SELECT t2.faq_id +FROM t1 INNER JOIN t2 +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +DROP TABLE t1,t2; +CREATE TABLE t1 (a INT, b INT, KEY inx (b,a)); +INSERT INTO t1 VALUES (1,1), (1,2), (1,3), (1,4), (1,5), (1, 6), (1,7); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT COUNT(*) FROM t1 f1 INNER JOIN t1 f2 +ON ( f1.b=f2.b AND f1.a NULL ALL NULL NULL NULL NULL 7 100.00 Parallel execute (1 workers) +2 SIMPLE f1 NULL index inx inx 10 NULL 7 100.00 Using where; Using index +2 SIMPLE f2 NULL ref inx inx 5 test.f1.b 1 33.33 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` `f1` join `test`.`t1` `f2` where ((`test`.`f2`.`b` = `test`.`f1`.`b`) and (`test`.`f1`.`b` not in (100,2232,3343,51111)) and (`test`.`f1`.`a` < `test`.`f2`.`a`)) +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 INT); +INSERT INTO t1 VALUES (1,11), (2,22), (2,22); +EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2)))))))))))))))))))))))))))))) > 0; +EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) > 0; +ERROR HY000: Too high level of nesting for select +DROP TABLE t1; +CREATE TABLE t1 ( +c1 int(11) NOT NULL AUTO_INCREMENT, +c2 varchar(1000) DEFAULT NULL, +c3 bigint(20) DEFAULT NULL, +c4 bigint(20) DEFAULT NULL, +PRIMARY KEY (c1) +) charset utf8mb4; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN +SELECT join_2.c1 +FROM +t1 AS join_0, +t1 AS join_1, +t1 AS join_2, +t1 AS join_3, +t1 AS join_4, +t1 AS join_5, +t1 AS join_6, +t1 AS join_7 +WHERE +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +OR +join_0.c2 < '?' AND +join_1.c2 < '?' AND +join_2.c2 > '?' AND +join_2.c2 < '!' AND +join_3.c2 > '?' AND +join_4.c2 = '?' AND +join_5.c2 <> '?' AND +join_6.c2 <> '?' AND +join_7.c2 >= '?' AND +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +GROUP BY +join_3.c1, +join_2.c1, +join_7.c1, +join_1.c1, +join_0.c1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL # 1 100.00 # +2 SIMPLE join_0 NULL ALL PRIMARY NULL NULL # 1 100.00 # +2 SIMPLE join_1 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_2 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_3 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_4 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_5 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_6 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_7 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +Warnings: +Note 1003 /* select#1 */ select `test`.`join_2`.`c1` AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where (((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`)) or ((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c2` = '?') and (`test`.`join_0`.`c2` < '?') and (`test`.`join_1`.`c2` < '?') and (`test`.`join_2`.`c2` > '?') and (`test`.`join_2`.`c2` < '!') and (`test`.`join_3`.`c2` > '?') and (`test`.`join_5`.`c2` <> '?') and (`test`.`join_6`.`c2` <> '?') and (`test`.`join_7`.`c2` >= '?'))) group by `test`.`join_3`.`c1`,`test`.`join_2`.`c1`,`test`.`join_7`.`c1`,`test`.`join_1`.`c1`,`test`.`join_0`.`c1` +SHOW WARNINGS; +Level Code Message +Note 1003 /* select#1 */ select `test`.`join_2`.`c1` AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where (((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`)) or ((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c2` = '?') and (`test`.`join_0`.`c2` < '?') and (`test`.`join_1`.`c2` < '?') and (`test`.`join_2`.`c2` > '?') and (`test`.`join_2`.`c2` < '!') and (`test`.`join_3`.`c2` > '?') and (`test`.`join_5`.`c2` <> '?') and (`test`.`join_6`.`c2` <> '?') and (`test`.`join_7`.`c2` >= '?'))) group by `test`.`join_3`.`c1`,`test`.`join_2`.`c1`,`test`.`join_7`.`c1`,`test`.`join_1`.`c1`,`test`.`join_0`.`c1` +DROP TABLE t1; +SELECT 1 AS ` `; + +1 +Warnings: +Warning 1474 Name ' ' has become '' +SELECT 1 AS ` `; + +1 +Warnings: +Warning 1474 Name ' ' has become '' +SELECT 1 AS ` x`; +x +1 +Warnings: +Warning 1466 Leading spaces are removed from name ' x' +CREATE VIEW v1 AS SELECT 1 AS ``; +ERROR 42000: Incorrect column name '' +CREATE VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT (SELECT 1 AS ` `); +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` x`; +Warnings: +Warning 1466 Leading spaces are removed from name ' x' +SELECT `x` FROM v1; +x +1 +ALTER VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +DROP VIEW v1; +select str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' + and '2007/10/20 00:00:00 GMT'; +str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' + and '2007/10/20 00:00:00 GMT' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT' +Warning 1292 Truncated incorrect date value: '2007/10/20 00:00:00 GMT' +select str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6'; +str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT-6' +select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6'; +ERROR HY000: Incorrect DATE value: '2007/10/2000:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007-10-1 00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007-10-01 x00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:x00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 x12:34:56 GMT-6' +select str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; +str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6' +select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; +str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' +0 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6' +select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56'; +str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56' +1 +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00' +0 +select str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00' +1 +select str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34' +select str_to_date('2007-02-30 12:34','%Y-%m-%d %H:%i') = '2007-02-30 12:34:00'; +ERROR HY000: Incorrect DATETIME value: '2007-02-30 12:34:00' +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00' + and '2007/10/20 00:00:00'; +str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00' + and '2007/10/20 00:00:00' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +set SQL_MODE=TRADITIONAL; +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00 12:34' for function str_to_date +select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01' + and '2007/10/20'; +str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01' + and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +set SQL_MODE=DEFAULT; +select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'; +str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +select str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20'; +str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '' for function str_to_date +select str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '' for function str_to_date +select str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = ''; +ERROR HY000: Incorrect DATETIME value: '' +select str_to_date('1','%Y-%m-%d') = '1'; +ERROR HY000: Incorrect DATE value: '1' +select str_to_date('1','%Y-%m-%d') = '1'; +ERROR HY000: Incorrect DATE value: '1' +select str_to_date('','%Y-%m-%d') = ''; +ERROR HY000: Incorrect DATE value: '' +select str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL; +str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL +0 +Warnings: +Warning 1292 Truncated incorrect date value: '0000-00-00' +select str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00'; +str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00' +NULL +Warnings: +Warning 1292 Truncated incorrect date value: '2000-00-00' +select str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL; +str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL +0 +CREATE TABLE t1 (c11 INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY); +CREATE TABLE t2 (c21 INT UNSIGNED NOT NULL, +c22 INT DEFAULT NULL, +KEY(c21, c22)); +CREATE TABLE t3 (c31 INT UNSIGNED NOT NULL DEFAULT 0, +c32 INT DEFAULT NULL, +c33 INT NOT NULL, +c34 INT UNSIGNED DEFAULT 0, +KEY (c33, c34, c32)); +INSERT INTO t1 values (),(),(),(),(); +INSERT INTO t2 SELECT a.c11, b.c11 FROM t1 a, t1 b; +INSERT INTO t3 VALUES (1, 1, 1, 0), +(2, 2, 0, 0), +(3, 3, 1, 0), +(4, 4, 0, 0), +(5, 5, 1, 0); +SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND +t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND +t3.c33 = 1 AND t2.c22 in (1, 3) +ORDER BY c32; +c32 +1 +1 +3 +3 +5 +5 +SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND +t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND +t3.c33 = 1 AND t2.c22 in (1, 3) +ORDER BY c32 DESC; +c32 +5 +5 +3 +3 +1 +1 +DROP TABLE t1, t2, t3; + +# +# Bug#30736: Row Size Too Large Error Creating a Table and +# Inserting Data. +# +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; + +CREATE TABLE t1( +c1 DECIMAL(10, 2), +c2 FLOAT); + +INSERT INTO t1 VALUES (0, 1), (2, 3), (4, 5); + +CREATE TABLE t2( +c3 DECIMAL(10, 2)) +SELECT +c1 * c2 AS c3 +FROM t1; + +SELECT * FROM t1; +c1 c2 +0.00 1 +2.00 3 +4.00 5 + +SELECT * FROM t2; +c3 +0.00 +6.00 +20.00 + +DROP TABLE t1; +DROP TABLE t2; + +CREATE TABLE t1 (c1 BIGINT NOT NULL); +INSERT INTO t1 (c1) VALUES (1); +SELECT * FROM t1 WHERE c1 > NULL + 1; +c1 +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10) NOT NULL PRIMARY KEY); +INSERT INTO t1 (a) VALUES ('foo0'), ('bar0'), ('baz0'); +SELECT * FROM t1 WHERE a IN (CONCAT('foo', 0), 'bar'); +a +foo0 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +CREATE TABLE t2 (a INT, c INT, KEY(a)); +INSERT INTO t1 VALUES (1, 1), (2, 2); +INSERT INTO t2 VALUES (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), +(2, 1), (2, 2), (2, 3), (2, 4), (2, 5), +(3, 1), (3, 2), (3, 3), (3, 4), (3, 5), +(4, 1), (4, 2), (4, 3), (4, 4), (4, 5); +FLUSH STATUS; +SELECT DISTINCT b FROM t1 LEFT JOIN t2 USING(a) WHERE c <= 3; +b +1 +2 +SHOW STATUS LIKE 'Handler_read%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 3 +Handler_read_last 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 6 +DROP TABLE t1, t2; +CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0', +f2 int(11) NOT NULL default '0', +f3 bigint(20) NOT NULL default '0', +f4 varchar(255) NOT NULL default '', +PRIMARY KEY (f1), +KEY key1 (f4), +KEY key2 (f2)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t2 (f1 int(11) NOT NULL default '0', +f2 enum('A1','A2','A3') NOT NULL default 'A1', +f3 int(11) NOT NULL default '0', +PRIMARY KEY (f1), +KEY key1 (f3)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0', +f2 datetime NOT NULL default '1980-01-01 00:00:00', +PRIMARY KEY (f1)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1, 1, 1, 'abc'); +insert into t1 values (2, 1, 2, 'def'); +insert into t1 values (3, 1, 2, 'def'); +insert into t2 values (1, 'A1', 1); +insert into t3 values (1, '1980-01-01'); +SELECT a.f3, cr.f4, count(*) count +FROM t2 a +STRAIGHT_JOIN t1 cr ON cr.f2 = a.f1 +LEFT JOIN +(t1 cr2 +JOIN t3 ae2 ON cr2.f3 = ae2.f1 +) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND +cr.f4 = cr2.f4 +GROUP BY a.f3, cr.f4; +f3 f4 count +1 abc 1 +1 def 2 +drop table t1, t2, t3; +CREATE TABLE t1 (a INT KEY, b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a, b FROM t1 WHERE a > 1 AND a = b LIMIT 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 25.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 3 25.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 SELECT a, b FROM t1 WHERE a > 1 AND b = a LIMIT 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 25.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 3 25.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` > 1)) limit 2 +DROP TABLE t1; +# +# Bug#47019: Assertion failed: 0, file .\rt_mbr.c, line 138 when +# forcing a spatial index +# +CREATE TABLE t1(a LINESTRING NOT NULL SRID 0, SPATIAL KEY(a)); +INSERT INTO t1 VALUES +(ST_GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')), +(ST_GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')); +EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t2 NULL ALL a NULL NULL NULL 2 100.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; +1 +1 +1 +1 +1 +EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t2 NULL ALL a NULL NULL NULL 2 100.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` FORCE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); +1 +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug #48291 : crash with row() operator,select into @var, and +# subquery returning multiple rows +# +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (2),(3); +# Should not crash +SELECT 1 FROM t1 WHERE a <> 1 AND NOT +ROW(1,a) <=> ROW(1,(SELECT 1 FROM t1)) +INTO @var0; +ERROR 21000: Subquery returns more than 1 row +DROP TABLE t1; +# +# Bug #48458: simple query tries to allocate enormous amount of +# memory +# +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1(a INT NOT NULL, b YEAR); +INSERT INTO t1 VALUES (); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +CREATE TABLE t2(c INT); +# Should not err out because of out-of-memory +SELECT 1 FROM t2 JOIN t1 ON 1=1 +WHERE a != '1' AND NOT a >= b OR NOT ROW(b,a )<> ROW(a,a); +1 +DROP TABLE t1,t2; +SET sql_mode = default; +# +# Bug #49199: Optimizer handles incorrectly: +# field='const1' AND field='const2' in some cases + +CREATE TABLE t1(a DATETIME NOT NULL); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 00:00:00 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +DROP TABLE t1; +CREATE TABLE t1(a DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2001-01-01') +DROP TABLE t1; +CREATE TABLE t1(a TIMESTAMP NOT NULL NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 00:00:00 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +a b +2001-01-01 00:00:00 2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = DATE'2001-01-01') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b VARCHAR(20) NOT NULL) charset utf8mb4; +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +a b +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = '2001-01-01 00:00:00') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01'; +a b +2001-01-01 00:00:00 2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = '2001-01-01') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT x.a, y.a, z.a FROM t1 x +JOIN t1 y ON x.a=y.a +JOIN t1 z ON y.a=z.a +WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; +a a a +2001-01-01 00:00:00 2001-01-01 00:00:00 2001-01-01 00:00:00 +EXPLAIN SELECT x.a, y.a, z.a FROM t1 x +JOIN t1 y ON x.a=y.a +JOIN t1 z ON y.a=z.a +WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE x NULL ALL NULL NULL NULL NULL 1 100.00 Using where +2 SIMPLE y NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +2 SIMPLE z NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`y`.`a` AS `a`,`test`.`z`.`a` AS `a` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` where ((`test`.`x`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (`test`.`y`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (`test`.`z`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +# +# Bug #49897: crash in ptr_compare when char(0) NOT NULL +# column is used for ORDER BY +# +SET @old_sort_buffer_size= @@session.sort_buffer_size; +SET @@sort_buffer_size= 40000; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1(a CHAR(0) NOT NULL); +INSERT INTO t1 VALUES (0), (0), (0); +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a FROM t1 ORDER BY a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24404 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24404 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `test`.`t1`.`a` +SELECT a FROM t1 ORDER BY a; +DROP TABLE t1; +CREATE TABLE t1(a CHAR(0) NOT NULL, b CHAR(0) NOT NULL, c int); +INSERT INTO t1 VALUES (0, 0, 0), (0, 0, 2), (0, 0, 1); +# Since ANALYZE TABLE only reads a subset of the data, the statistics for +# table t1 depends on the row order. And since the INSERT INTO ... SELECT +# may be executed using different execution plans, we've added ORDER BY +# to ensure that we rows has the same order every time. If not, the +# estimated number of rows in EXPLAIN may change on different platforms. +# Note that the tables may MYISAM, since many of the test files that +# includes this file forces MYISAM as the default storage engine. +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a FROM t1 ORDER BY a LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `test`.`t1`.`a` limit 5 +SELECT a FROM t1 ORDER BY a LIMIT 5; +a + + + + + +EXPLAIN SELECT * FROM t1 ORDER BY a, b LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b` limit 5 +SELECT * FROM t1 ORDER BY a, b LIMIT 5; +a b c + 2 + 2 + 2 + 2 + 2 +EXPLAIN SELECT * FROM t1 ORDER BY a, b, c LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b`,`test`.`t1`.`c` limit 5 +SELECT * FROM t1 ORDER BY a, b, c LIMIT 5; +a b c + 0 + 0 + 0 + 0 + 0 +EXPLAIN SELECT * FROM t1 ORDER BY c, a LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`c`,`test`.`t1`.`a` limit 5 +SELECT * FROM t1 ORDER BY c, a LIMIT 5; +a b c + 0 + 0 + 0 + 0 + 0 +SET @@sort_buffer_size= @old_sort_buffer_size; +DROP TABLE t1; +SET sql_mode = default; +End of 5.0 tests +create table t1(a INT, KEY (a)); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5); +SELECT a FROM t1 ORDER BY a LIMIT 2; +a +1 +2 +SELECT a FROM t1 ORDER BY a LIMIT 2,4294967296; +a +3 +4 +5 +SELECT a FROM t1 ORDER BY a LIMIT 2,4294967297; +a +3 +4 +5 +DROP TABLE t1; +CREATE TABLE A (date_key date); +CREATE TABLE C ( +pk int, +int_nokey int, +int_key int, +date_key date NOT NULL, +date_nokey date, +varchar_key varchar(1) +); +INSERT IGNORE INTO C VALUES +(1,1,1,'0000-00-00',NULL,NULL), +(1,1,1,'0000-00-00',NULL,NULL); +Warnings: +Warning 1264 Out of range value for column 'date_key' at row 1 +Warning 1264 Out of range value for column 'date_key' at row 2 +SELECT 1 FROM C WHERE pk > ANY (SELECT 1 FROM C); +1 +SELECT COUNT(DISTINCT 1) FROM C +WHERE date_key = (SELECT 1 FROM A WHERE C.date_key IS NULL) GROUP BY pk; +COUNT(DISTINCT 1) +SELECT date_nokey FROM C +WHERE int_key IN (SELECT 1 FROM A) +HAVING date_nokey = '10:41:7' +ORDER BY date_key; +ERROR HY000: Incorrect DATE value: '10:41:7' +DROP TABLE A,C; +CREATE TABLE t1 (a INT NOT NULL, b INT); +INSERT INTO t1 VALUES (1, 1); +EXPLAIN SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where true +SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2; +a b +1 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL); +EXPLAIN SELECT * FROM t1 WHERE (a=a AND b=b AND c=c) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +EXPLAIN SELECT * FROM t1 WHERE (a=a AND a=a AND b=b) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +EXPLAIN SELECT * FROM t1 WHERE (a=a AND b=b AND a=a) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +DROP TABLE t1; +# +# Bug#45266: Uninitialized variable lead to an empty result. +# +drop table if exists A,AA,B,BB; +CREATE TABLE `A` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`date_key` date NOT NULL, +`date_nokey` date NOT NULL, +`datetime_key` datetime NOT NULL, +`int_nokey` int(11) NOT NULL, +`time_key` time NOT NULL, +`time_nokey` time NOT NULL, +PRIMARY KEY (`pk`), +KEY `date_key` (`date_key`), +KEY `time_key` (`time_key`), +KEY `datetime_key` (`datetime_key`) +); +CREATE TABLE `AA` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`int_nokey` int(11) NOT NULL, +`time_key` time NOT NULL, +KEY `time_key` (`time_key`), +PRIMARY KEY (`pk`) +); +CREATE TABLE `B` ( +`date_nokey` date NOT NULL, +`date_key` date NOT NULL, +`time_key` time NOT NULL, +`datetime_nokey` datetime NOT NULL, +`varchar_key` varchar(1) NOT NULL, +KEY `date_key` (`date_key`), +KEY `time_key` (`time_key`), +KEY `varchar_key` (`varchar_key`) +); +INSERT IGNORE INTO `B` VALUES ('2003-07-28','2003-07-28','15:13:38','0000-00-00 00:00:00','f'),('0000-00-00','0000-00-00','00:05:48','2004-07-02 14:34:13','x'); +CREATE TABLE `BB` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`int_nokey` int(11) NOT NULL, +`date_key` date NOT NULL, +`varchar_nokey` varchar(1) NOT NULL, +`date_nokey` date NOT NULL, +PRIMARY KEY (`pk`), +KEY `date_key` (`date_key`) +); +INSERT IGNORE INTO `BB` VALUES (10,8,'0000-00-00','i','0000-00-00'),(11,0,'2005-08-18','','2005-08-18'); +SELECT table1 . `pk` AS field1 +FROM +(BB AS table1 INNER JOIN +(AA AS table2 STRAIGHT_JOIN A AS table3 +ON ( table3 . `date_key` = table2 . `pk` )) +ON ( table3 . `datetime_key` = table2 . `int_nokey` )) +WHERE ( table3 . `date_key` <= 4 AND table2 . `pk` = table1 . `varchar_nokey`) +GROUP BY field1 ; +field1 +SELECT table3 .`date_key` field1 +FROM +B table1 LEFT JOIN B table3 JOIN +(BB table6 JOIN A table7 ON table6 .`varchar_nokey`) +ON table6 .`int_nokey` ON table6 .`date_key` + WHERE NOT ( table1 .`varchar_key` AND table7 .`pk`) GROUP BY field1; +field1 +NULL +SELECT table4 . `time_nokey` AS field1 FROM +(AA AS table1 CROSS JOIN +(AA AS table2 STRAIGHT_JOIN +(B AS table3 STRAIGHT_JOIN A AS table4 +ON ( table4 . `date_key` = table3 . `time_key` )) +ON ( table4 . `pk` = table3 . `date_nokey` )) +ON ( table4 . `time_key` = table3 . `datetime_nokey` )) +WHERE ( table4 . `time_key` < table1 . `time_key` AND +table1 . `int_nokey` != 'f') +GROUP BY field1 ORDER BY field1 , field1; +field1 +SELECT table1 .`time_key` field2 FROM B table1 LEFT JOIN BB JOIN A table5 ON table5 .`date_nokey` ON table5 .`int_nokey` GROUP BY field2; +field2 +00:05:48 +15:13:38 +drop table A,AA,B,BB; +#end of test for bug#45266 +# +# Bug#33546: Slowdown on re-evaluation of constant expressions. +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (2); +SELECT * FROM t1 WHERE a = 1 + 1; +a +2 +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE a = 1 + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 10.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = ((1 + 1))) +SELECT * FROM t1 HAVING a = 1 + 1; +a +2 +EXPLAIN SELECT * FROM t1 HAVING a = 1 + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 100.00 NULL +Warnings: +Note 1003 /* select#1 */ 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 +EXPLAIN SELECT * FROM t1, t2 WHERE a = b + (1 + 1); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = (`test`.`t2`.`b` + ((1 + 1)))) +SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; +b a +2 3 +EXPLAIN SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t2` left join `test`.`t1` on((`test`.`t1`.`a` = (`test`.`t2`.`b` + 1))) where true +EXPLAIN SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 33.33 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 33.33 Using where +Warnings: +Note 1003 /* select#1 */ 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; +RETURN 1; +END;| +SET @cnt := 0; +SELECT * FROM t1 WHERE a = f1(); +a +1 +SELECT @cnt; +@cnt +1 +EXPLAIN SELECT * FROM t1 WHERE a = f1(); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 +# +# BUG#48052: Valgrind warning - uninitialized value in init_read_record() +# +# Disable Index condition pushdown +SELECT @old_optimizer_switch:=@@optimizer_switch; +@old_optimizer_switch:=@@optimizer_switch +# +Warnings: +# 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +CREATE TABLE t1 ( +pk int(11) NOT NULL, +i int(11) DEFAULT NULL, +v varchar(1) DEFAULT NULL, +PRIMARY KEY (pk) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (2,7,'m'); +INSERT INTO t1 VALUES (3,9,'m'); +SELECT v +FROM t1 +WHERE NOT pk > 0 +HAVING v <= 't' +ORDER BY pk; +v +# Restore old value for Index condition pushdown +SET SESSION optimizer_switch=@old_optimizer_switch; +DROP TABLE t1; +# +# Bug#49489 Uninitialized cache led to a wrong result. +# +CREATE TABLE t1(c1 DOUBLE(5,4)); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (9.1234); +SELECT * FROM t1 WHERE c1 < 9.12345; +c1 +9.1234 +DROP TABLE t1; +# End of test for bug#49489. +# +# Bug #49517: Inconsistent behavior while using +# NULLable BIGINT and INT columns in comparison +# +CREATE TABLE t1(a BIGINT UNSIGNED NOT NULL, b BIGINT NULL, c INT NULL); +INSERT INTO t1 VALUES(105, NULL, NULL); +SELECT * FROM t1 WHERE b < 102; +a b c +SELECT * FROM t1 WHERE c < 102; +a b c +SELECT * FROM t1 WHERE 102 < b; +a b c +SELECT * FROM t1 WHERE 102 < c; +a b c +DROP TABLE t1; +# +# Bug #54459: Assertion failed: param.sort_length, +# file .\filesort.cc, line 149 (part II) +# +CREATE TABLE t1(a ENUM('') NOT NULL) charset latin1; +INSERT INTO t1 VALUES (), (), (); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` order by `(t1.a collate latin1_german2_ci)` +SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug #58422: Incorrect result when OUTER JOIN'ing +# with an empty table +# +CREATE TABLE t_empty(pk INT PRIMARY KEY, i INT); +CREATE TABLE t1(pk INT PRIMARY KEY, i INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3); +CREATE TABLE t2(pk INT PRIMARY KEY, i INT) ; +INSERT INTO t2 VALUES (1,1), (2,2), (3,3); +ANALYZE TABLE t_empty, t1, t2; +Table Op Msg_type Msg_text +test.t_empty analyze status OK +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`pk` = `test`.`t1`.`pk`) and (`test`.`t1`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`pk` = `test`.`t1`.`pk`) and (`test`.`t1`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t2 NULL range PRIMARY PRIMARY 4 NULL 2 33.33 Using where; Using join buffer (hash join) +2 SIMPLE t1 NULL eq_ref PRIMARY PRIMARY 4 test.t2.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`i` = `test`.`t_empty`.`i`) and (`test`.`t1`.`pk` = `test`.`t2`.`pk`) and (`test`.`t2`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +DROP TABLE t1,t2,t_empty; +End of 5.1 tests +# +# Bug#45227: Lost HAVING clause led to a wrong result. +# +CREATE TABLE `cc` ( +`int_nokey` int(11) NOT NULL, +`int_key` int(11) NOT NULL, +`varchar_key` varchar(1) NOT NULL, +`varchar_nokey` varchar(1) NOT NULL, +KEY `int_key` (`int_key`), +KEY `varchar_key` (`varchar_key`) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `cc` VALUES +(0,8,'q','q'),(5,8,'m','m'),(7,3,'j','j'),(1,2,'z','z'),(8,2,'a','a'),(2,6,'',''),(1,8,'e' +,'e'),(8,9,'t','t'),(5,2,'q','q'),(4,6,'b','b'),(5,5,'w','w'),(3,2,'m','m'),(0,4,'x','x'), +(8,9,'',''),(0,6,'w','w'),(4,5,'x','x'),(0,0,'e','e'),(0,0,'e','e'),(2,8,'p','p'),(0,0,'x' +,'x'); +EXPLAIN SELECT `varchar_nokey` g1 FROM cc WHERE `int_nokey` AND `int_key` <= 4 +HAVING g1 ORDER BY `varchar_key` LIMIT 6 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 9 90.00 Parallel execute (1 workers) +2 SIMPLE cc NULL range int_key int_key 4 NULL 9 90.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`cc`.`varchar_nokey` AS `g1` from `test`.`cc` where ((0 <> `test`.`cc`.`int_nokey`) and (`test`.`cc`.`int_key` <= 4)) having (0 <> `g1`) order by `test`.`cc`.`varchar_key` limit 6 +SELECT `varchar_nokey` g1 FROM cc WHERE `int_nokey` AND `int_key` <= 4 +HAVING g1 ORDER BY `varchar_key` LIMIT 6 ; +g1 +Warning 1292 Truncated incorrect DOUBLE value: 'a' +Warning 1292 Truncated incorrect DOUBLE value: 'j' +Warning 1292 Truncated incorrect DOUBLE value: 'm' +Warning 1292 Truncated incorrect DOUBLE value: 'q' +Warning 1292 Truncated incorrect DOUBLE value: 'z' +Warnings: +DROP TABLE cc; +# End of test#45227 +# +# Bug#54515: Crash in opt_range.cc::get_best_group_min_max on +# SELECT from VIEW with GROUP BY +# +CREATE TABLE t1 ( +col_int_key int DEFAULT NULL, +KEY int_key (col_int_key) +) ; +INSERT INTO t1 VALUES (1),(2); +CREATE VIEW view_t1 AS +SELECT t1.col_int_key AS col_int_key +FROM t1; +SELECT col_int_key FROM view_t1 GROUP BY col_int_key; +col_int_key +1 +2 +DROP VIEW view_t1; +DROP TABLE t1; +# End of test BUG#54515 +# +# Bug #57203 Assertion `field_length <= 255' failed. +# +SELECT coalesce((avg(distinct (ST_geomfromtext("point(25379 -22010)"))))) +UNION ALL +SELECT coalesce((avg(distinct (ST_geomfromtext("point(25379 -22010)"))))) +AS foo +; +ERROR HY000: Incorrect arguments to avg +CREATE table t1(a text); +INSERT INTO t1 VALUES (''), (''); +SELECT avg(distinct(t1.a)) FROM t1, t1 t2 +GROUP BY t2.a ORDER BY t1.a; +avg(distinct(t1.a)) +0 +DROP TABLE t1; +# End of test BUG#57203 +# +# Bug#63020: Function "format"'s 'locale' argument is not considered +# when creating a "view' +# +CREATE TABLE t1 (f1 DECIMAL(10,2)); +INSERT INTO t1 VALUES (11.67),(17865.3),(12345678.92); +CREATE VIEW view_t1 AS SELECT FORMAT(f1,1,'sk_SK') AS f1 FROM t1; +SHOW CREATE VIEW view_t1; +View Create View character_set_client collation_connection +view_t1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_t1` AS select format(`t1`.`f1`,1,'sk_SK') AS `f1` from `t1` utf8mb4 utf8mb4_0900_ai_ci +SELECT * FROM view_t1; +f1 +11,7 +17 865,3 +12 345 678,9 +DROP TABLE t1; +DROP VIEW view_t1; +# End of test BUG#63020 +# +# Bug #13571700 TINYBLOB NOT NULL, CRASH IN PROTOCOL::NET_STORE_DATA +# +CREATE TABLE t1 (a TINYBLOB NOT NULL); +SELECT a, COUNT(*) FROM t1 WHERE 0; +a COUNT(*) +NULL 0 +DROP TABLE t1; +# End of test BUG#13571700 +# +# Bug #18766378: CRASH IN ITEM_SUM_BIT::RESET_FIELD +# +CREATE TABLE t1(b int); +CREATE TABLE t2(a int); +INSERT INTO t1 VALUES (),(); +INSERT INTO t2 VALUES (),(); +SELECT +( SELECT 1 FROM t1 GROUP BY a +HAVING avg(distinct 1) ORDER BY max(a) +) +FROM t1, t2 +GROUP BY a; +( SELECT 1 FROM t1 GROUP BY a +HAVING avg(distinct 1) ORDER BY max(a) +) +1 +DROP TABLE t1,t2; +# End of test BUG#18766378 +# +# WL#13002: RESULTSET DIFFERENT NUMBER OF ROWS +# +CREATE TABLE t1 ( +f1 INTEGER, +f2 INTEGER, +INDEX i1 (f2) +); +INSERT INTO t1 VALUES (NULL,1); +INSERT INTO t1 VALUES (2,NULL); +INSERT INTO t1 VALUES (3,1); +INSERT INTO t1 VALUES (4,6); +INSERT INTO t1 VALUES (NULL,5); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (13,1); +INSERT INTO t1 VALUES (NULL,0); +INSERT INTO t1 VALUES (5,2); +INSERT INTO t1 VALUES (NULL,8); +INSERT INTO t1 VALUES (NULL,7); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (NULL,4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN FORMAT=tree SELECT * +FROM t1 AS alias1 LEFT JOIN t1 AS alias2 ON alias1.f1 = alias2.f2 +WHERE alias2.f1 NOT BETWEEN 4 AND 12; +EXPLAIN +-> Parallel scan on + -> Nested loop inner join (cost=9.27 rows=19) + -> PQblock scan on alias1 (cost=1.65 rows=14) + -> Filter: (alias2.f1 not between 4 and 12) (cost=0.40 rows=1) + -> Index lookup on alias2 using i1 (f2=alias1.f1) (cost=0.40 rows=2) + +SELECT * +FROM t1 AS alias1 LEFT JOIN t1 AS alias2 ON alias1.f1 = alias2.f2 +WHERE alias2.f1 NOT BETWEEN 4 AND 12; +f1 f2 f1 f2 +DROP TABLE t1; +set optimizer_switch=default; diff --git a/mysql-test/r/select_none_bka.result-pq b/mysql-test/r/select_none_bka.result-pq new file mode 100644 index 000000000000..491a4cdb9070 --- /dev/null +++ b/mysql-test/r/select_none_bka.result-pq @@ -0,0 +1,5701 @@ +set optimizer_switch='batched_key_access=on,mrr_cost_based=off'; +drop table if exists t1,t2,t3,t4,t11; +drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; +drop view if exists v1; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +); +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +select * from t1; +Period Varor_period +9410 9412 +select t1.* from t1; +Period Varor_period +9410 9412 +CREATE TABLE t2 ( +auto int not null auto_increment, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL, +UNIQUE fld1 (fld1), +KEY fld3 (fld3), +PRIMARY KEY (auto) +) charset utf8mb4; +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +imaginable +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +cultivation +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3 from t2 order by fld3 desc limit 10; +fld3 +youthfulness +yelped +Wotan +workers +Witt +witchcraft +Winsett +Willy +willed +wildcats +select fld3 from t2 order by fld3 desc limit 5; +fld3 +youthfulness +yelped +Wotan +workers +Witt +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +witchcraft +Winsett +Willy +willed +wildcats +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'h%le'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; +fld3 +explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 0.09 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 0.09 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` IGNORE INDEX (`fld3`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 0.09 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 0.09 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld1`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld3`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld3`) USE INDEX (`fld1`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 ignore index (fld3,not_used); +ERROR 42000: Key 'not_used' doesn't exist in table 't2' +explain select fld3 from t2 use index (not_used); +ERROR 42000: Key 'not_used' doesn't exist in table 't2' +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +honeysuckle +honoring +explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range fld3 fld3 120 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where ((`test`.`t2`.`fld3` >= 'honeysuckle') and (`test`.`t2`.`fld3` <= 'honoring')) order by `test`.`t2`.`fld3` +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +fld1 fld3 +148504 Colombo +068305 Colombo +000000 nondecreasing +select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes'; +fld1 fld3 +232605 appendixes +1232605 appendixes +1232606 appendixes +1232607 appendixes +1232608 appendixes +1232609 appendixes +select fld1 from t2 where fld1=250501 or fld1="250502"; +fld1 +250501 +250502 +explain select fld1 from t2 where fld1=250501 or fld1="250502"; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL range fld1 fld1 4 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld1` AS `fld1` from `test`.`t2` where ((`test`.`t2`.`fld1` = 250501) or (`test`.`t2`.`fld1` = 250502)) +select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +fld1 +250501 +250502 +250505 +250601 +explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL range fld1 fld1 4 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld1` AS `fld1` from `test`.`t2` where ((`test`.`t2`.`fld1` = 250501) or (`test`.`t2`.`fld1` = 250502) or ((`test`.`t2`.`fld1` >= 250505) and (`test`.`t2`.`fld1` <= 250601)) or (`test`.`t2`.`fld1` between 250501 and 250502)) +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +fld1 fld3 +012001 flanking +013602 foldout +013606 fingerings +018007 fanatic +018017 featherweight +018054 fetters +018103 flint +018104 flopping +036002 funereal +038017 fetched +038205 firearm +058004 Fenton +088303 feminine +186002 freakish +188007 flurried +188505 fitting +198006 furthermore +202301 Fitzpatrick +208101 fiftieth +208113 freest +218008 finishers +218022 feed +218401 faithful +226205 foothill +226209 furnishings +228306 forthcoming +228311 fated +231315 freezes +232102 forgivably +238007 filial +238008 fixedly +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +fld3 +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +fld3 +Chantilly +select fld1,fld3 from t2 where fld1 like "25050%"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select fld1,fld3 from t2 where fld1 like "25050_"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select distinct companynr from t2; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr desc; +companynr +68 +65 +58 +53 +50 +41 +40 +37 +36 +34 +29 +00 +select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%" order by fld3; +fld3 period +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +select distinct fld3 from t2 where companynr = 34 order by fld3; +fld3 +absentee +accessed +ahead +alphabetic +Asiaticizations +attitude +aye +bankruptcies +belays +Blythe +bomb +boulevard +bulldozes +cannot +caressing +charcoal +checksumming +chess +clubroom +colorful +cosy +creator +crying +Darius +diffusing +duality +Eiffel +Epiphany +Ernestine +explorers +exterminated +famine +forked +Gershwins +heaving +Hodges +Iraqis +Italianization +Lagos +landslide +libretto +Majorca +mastering +narrowed +occurred +offerers +Palestine +Peruvianizes +pharmaceutic +poisoning +population +Pygmalion +rats +realest +recording +regimented +retransmitting +reviver +rouses +scars +sicker +sleepwalk +stopped +sugars +translatable +uncles +unexpected +uprisings +versatility +vest +select distinct fld3 from t2 limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct fld3 from t2 having fld3 like "A%" limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct substring(fld3,1,3) from t2 where fld3 like "A%"; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +Adl +adm +Ado +ads +adv +aer +aff +afi +afl +afo +agi +ahe +aim +air +Ald +alg +ali +all +alp +alr +ama +ame +amm +ana +and +ane +Ang +ani +Ann +Ant +api +app +aqu +Ara +arc +Arm +arr +Art +Asi +ask +asp +ass +ast +att +aud +Aug +aut +ave +avo +awe +aye +Azt +select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +create table t3 ( +period int not null, +name char(32) not null, +companynr int not null, +price double(11,0), +price2 double(11,0), +key (period), +key (name) +); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +create temporary table tmp select * from t3; +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +alter table t3 add t2nr int not null auto_increment primary key first; +drop table tmp; +SET BIG_TABLES=1; +select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10; +namn +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +SET BIG_TABLES=0; +select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10; +concat(fld3," ",fld3) +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +select distinct fld5 from t2 limit 10; +fld5 +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +select distinct companynr, fld3,count(*) from t2 group by companynr, fld3 order by companynr, fld3 limit 10; +companynr fld3 count(*) +00 affixed 1 +00 and 1 +00 annoyers 1 +00 Anthony 1 +00 assayed 1 +00 assurers 1 +00 attendants 1 +00 bedlam 1 +00 bedpost 1 +00 boasted 1 +SET BIG_TABLES=1; +select distinct companynr, fld3,count(*) from t2 group by companynr, fld3 order by companynr, fld3 limit 10; +companynr fld3 count(*) +00 affixed 1 +00 and 1 +00 annoyers 1 +00 Anthony 1 +00 assayed 1 +00 assurers 1 +00 attendants 1 +00 bedlam 1 +00 bedpost 1 +00 boasted 1 +SET BIG_TABLES=0; +select distinct companynr, fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr ,fld3 order by companynr, fld3 limit 100,10; +companynr fld3 repeat("a",length(fld3)) count(*) +29 chancellor aaaaaaaaaa 1 +29 Chippewa aaaaaaaa 1 +29 circumference aaaaaaaaaaaaa 1 +29 circus aaaaaa 1 +29 cited aaaaa 1 +29 Colombo aaaaaaa 1 +29 congresswoman aaaaaaaaaaaaa 1 +29 contrition aaaaaaaaaa 1 +29 corny aaaaa 1 +29 cultivation aaaaaaaaaaa 1 +select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2; +companynr rtrim(space(512+companynr)) +37 +78 +101 +154 +311 +447 +512 +select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; +fld3 +explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 10.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL fld1 NULL NULL NULL 1199 10.00 Using where; Using temporary; Using filesort +2 SIMPLE t3 NULL eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`t2nr` AS `t2nr`,`test`.`t2`.`fld3` AS `fld3` from `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld1` = `test`.`t3`.`t2nr`)) order by `test`.`t3`.`t2nr`,`test`.`t2`.`fld3` +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 41736 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL period NULL NULL NULL 41736 100.00 Using temporary; Using filesort +2 SIMPLE t3 NULL ref period period 4 test.t1.period 4173 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t3`.`period` = `test`.`t1`.`period`) order by `test`.`t3`.`period` +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (4 workers) +2 SIMPLE t3 NULL index period period 4 NULL 1 100.00 NULL +2 SIMPLE t1 NULL ref period period 4 test.t3.period 4173 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t1`.`period` = `test`.`t3`.`period`) order by `test`.`t3`.`period` limit 10 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL index period period 4 NULL 1 100.00 NULL +2 SIMPLE t3 NULL ref period period 4 test.t1.period 4173 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t3`.`period` = `test`.`t1`.`period`) order by `test`.`t1`.`period` limit 10 +select period from t1; +period +9410 +select period from t1 where period=1900; +period +select fld3,period from t1,t2 where fld1 = 011401 order by period; +fld3 period +breaking 9410 +select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001; +fld3 period +breaking 1001 +explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const fld1 fld1 4 const 1 100.00 NULL +1 SIMPLE t3 NULL const PRIMARY,period PRIMARY 4 const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select 'breaking' AS `fld3`,'1001' AS `period` from `test`.`t2` join `test`.`t3` where true +select fld3,period from t2,t1 where companynr*10 = 37*10 order by fld3; +fld3 period +abates 9410 +Abraham 9410 +abrogating 9410 +accessed 9410 +Aden 9410 +admiring 9410 +admonishing 9410 +Adolph 9410 +afield 9410 +afore 9410 +aging 9410 +airships 9410 +Aldrich 9410 +alike 9410 +Alison 9410 +allot 9410 +already 9410 +amenities 9410 +ammonium 9410 +analogy 9410 +analyzable 9410 +Anatole 9410 +animals 9410 +animized 9410 +annihilates 9410 +announced 9410 +announces 9410 +Antarctica 9410 +Antares 9410 +apiary 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +Arabia 9410 +arriving 9410 +Artemia 9410 +arteriole 9410 +assails 9410 +astound 9410 +attainments 9410 +attrition 9410 +audiology 9410 +Augustine 9410 +avenge 9410 +avoidable 9410 +babies 9410 +babysitting 9410 +Baird 9410 +balled 9410 +beaner 9410 +beaters 9410 +bee 9410 +Beebe 9410 +befouled 9410 +bellow 9410 +bestseller 9410 +betroth 9410 +bewilderingly 9410 +bills 9410 +bitterroot 9410 +bivalves 9410 +bloater 9410 +bloodbath 9410 +boat 9410 +boom 9410 +boorish 9410 +boulder 9410 +breaking 9410 +brunch 9410 +buckboards 9410 +burlesque 9410 +Butterfield 9410 +cage 9410 +capably 9410 +capped 9410 +cascade 9410 +Cassites 9410 +causality 9410 +cautioned 9410 +ceiling 9410 +celery 9410 +CERN 9410 +certificates 9410 +chafe 9410 +chaperone 9410 +charges 9410 +chasm 9410 +checkpoints 9410 +chewing 9410 +chews 9410 +Chicana 9410 +chillingly 9410 +Chippewa 9410 +chronicle 9410 +ciphers 9410 +civics 9410 +clamored 9410 +Clayton 9410 +clenched 9410 +clockers 9410 +coexist 9410 +cokes 9410 +combed 9410 +coming 9410 +commencements 9410 +commonplace 9410 +communicants 9410 +compartment 9410 +comprehensive 9410 +comprised 9410 +conceptions 9410 +concludes 9410 +congregates 9410 +Conley 9410 +Connally 9410 +contrary 9410 +contrasted 9410 +convenient 9410 +convulsion 9410 +corset 9410 +count 9410 +coverings 9410 +Crays 9410 +craziness 9410 +creak 9410 +creek 9410 +critiques 9410 +crunches 9410 +culled 9410 +cult 9410 +cupboard 9410 +cured 9410 +cute 9410 +daughter 9410 +decliner 9410 +decomposition 9410 +deductions 9410 +dehydrate 9410 +deludes 9410 +denizen 9410 +denotative 9410 +denounces 9410 +dental 9410 +dentally 9410 +descendants 9410 +despot 9410 +destroyer 9410 +detectably 9410 +dialysis 9410 +DiMaggio 9410 +dimensions 9410 +disable 9410 +discounts 9410 +disentangle 9410 +disobedience 9410 +dissociate 9410 +dogging 9410 +dopers 9410 +drains 9410 +dreaded 9410 +ducks 9410 +dusted 9410 +Dutchman 9410 +effortlessly 9410 +electroencephalography 9410 +elite 9410 +embassies 9410 +employing 9410 +encompass 9410 +encompasses 9410 +environing 9410 +epistle 9410 +equilibrium 9410 +erases 9410 +error 9410 +eschew 9410 +eternal 9410 +Eulerian 9410 +Evanston 9410 +evened 9410 +evenhandedly 9410 +eventful 9410 +Everhart 9410 +excises 9410 +exclamation 9410 +excrete 9410 +exhausts 9410 +expelled 9410 +extents 9410 +externally 9410 +extracted 9410 +faithful 9410 +fanatic 9410 +fated 9410 +featherweight 9410 +feed 9410 +feminine 9410 +Fenton 9410 +fetched 9410 +fetters 9410 +fiftieth 9410 +filial 9410 +fingerings 9410 +finishers 9410 +firearm 9410 +fitting 9410 +Fitzpatrick 9410 +fixedly 9410 +flanking 9410 +flint 9410 +flopping 9410 +flurried 9410 +foldout 9410 +foothill 9410 +forgivably 9410 +forthcoming 9410 +freakish 9410 +freest 9410 +freezes 9410 +funereal 9410 +furnishings 9410 +furthermore 9410 +gadfly 9410 +gainful 9410 +Galatean 9410 +galling 9410 +Gandhian 9410 +Ganymede 9410 +garage 9410 +gentleman 9410 +gifted 9410 +gleaning 9410 +glut 9410 +goblins 9410 +Goldstine 9410 +Gothicism 9410 +governing 9410 +gradually 9410 +Graves 9410 +grazing 9410 +Greenberg 9410 +gritty 9410 +groupings 9410 +guides 9410 +guitars 9410 +Gurkha 9410 +handgun 9410 +handy 9410 +Hawaii 9410 +Hegelian 9410 +heiress 9410 +hoarder 9410 +honoring 9410 +Hornblower 9410 +hostess 9410 +Huffman 9410 +humanness 9410 +humiliation 9410 +humility 9410 +Hunter 9410 +hushes 9410 +husky 9410 +hypothesizer 9410 +icon 9410 +ideas 9410 +impelling 9410 +impending 9410 +imperial 9410 +imperiously 9410 +imprint 9410 +impulsive 9410 +inaccuracy 9410 +inch 9410 +incidentals 9410 +incorrectly 9410 +incurring 9410 +index 9410 +indulge 9410 +indulgences 9410 +ineffective 9410 +infallibly 9410 +infest 9410 +inform 9410 +inmate 9410 +insolence 9410 +instruments 9410 +intelligibility 9410 +intentness 9410 +intercepted 9410 +interdependent 9410 +interrelationships 9410 +interrogate 9410 +investigations 9410 +irresponsibly 9410 +jarring 9410 +Joplin 9410 +journalizing 9410 +Judas 9410 +juveniles 9410 +Kane 9410 +kanji 9410 +Kantian 9410 +Kevin 9410 +kingdom 9410 +Kinsey 9410 +kiting 9410 +Kline 9410 +labeled 9410 +languages 9410 +Lars 9410 +laterally 9410 +Latinizes 9410 +lawgiver 9410 +leaflet 9410 +leavings 9410 +lectured 9410 +leftover 9410 +lewdly 9410 +lied 9410 +Lillian 9410 +linear 9410 +lists 9410 +lithograph 9410 +Lizzy 9410 +lore 9410 +luckily 9410 +Majorca 9410 +males 9410 +Manhattanize 9410 +marginal 9410 +mastering 9410 +mayoral 9410 +McGovern 9410 +meanwhile 9410 +measures 9410 +measures 9410 +mechanizing 9410 +medical 9410 +meditation 9410 +Melinda 9410 +Merritt 9410 +metaphysically 9410 +Micronesia 9410 +Miles 9410 +Miltonism 9410 +mineral 9410 +miniaturizes 9410 +minima 9410 +minion 9410 +minting 9410 +misted 9410 +misunderstander 9410 +mixture 9410 +motors 9410 +mournfulness 9410 +multilayer 9410 +mumbles 9410 +mushrooms 9410 +mystic 9410 +Nabisco 9410 +navies 9410 +navigate 9410 +Nazis 9410 +neat 9410 +neonatal 9410 +nested 9410 +Newtonian 9410 +noncritical 9410 +normalizes 9410 +Norwalk 9410 +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +Pandora 9410 +parametrized 9410 +parenthood 9410 +Parsifal 9410 +parters 9410 +participated 9410 +partridges 9410 +peacock 9410 +peeked 9410 +pellagra 9410 +percentage 9410 +percentage 9410 +persist 9410 +perturb 9410 +Peruvian 9410 +pessimist 9410 +pests 9410 +petted 9410 +pictures 9410 +pithed 9410 +pityingly 9410 +poison 9410 +posed 9410 +positioning 9410 +postulation 9410 +praised 9410 +precaution 9410 +precipitable 9410 +preclude 9410 +presentation 9410 +pressure 9410 +previewing 9410 +priceless 9410 +primary 9410 +psychic 9410 +publicly 9410 +puddings 9410 +Punjab 9410 +Pyle 9410 +quagmire 9410 +quitter 9410 +Quixotism 9410 +railway 9410 +raining 9410 +rains 9410 +ravines 9410 +readable 9410 +realized 9410 +realtor 9410 +reassigned 9410 +recruited 9410 +reduce 9410 +regimented 9410 +registration 9410 +relatively 9410 +relaxing 9410 +relishing 9410 +relives 9410 +renew 9410 +repelled 9410 +repetitions 9410 +reporters 9410 +reporters 9410 +repressions 9410 +resplendent 9410 +resumes 9410 +rifles 9410 +rightful 9410 +rightfully 9410 +rightfulness 9410 +ripeness 9410 +riser 9410 +Romano 9410 +Romans 9410 +roped 9410 +rudeness 9410 +rules 9410 +rural 9410 +rusting 9410 +Sabine 9410 +sadly 9410 +sags 9410 +sanding 9410 +saplings 9410 +sating 9410 +Sault 9410 +save 9410 +sawtooth 9410 +Saxony 9410 +scarf 9410 +scatterbrain 9410 +scheduling 9410 +schemer 9410 +scholastics 9410 +scornfully 9410 +secures 9410 +securing 9410 +Selfridge 9410 +seminaries 9410 +serializations 9410 +serpents 9410 +serving 9410 +severely 9410 +sews 9410 +Shanghais 9410 +shapelessly 9410 +shipyard 9410 +shooter 9410 +similarities 9410 +Simla 9410 +Simon 9410 +skulking 9410 +slaughter 9410 +sloping 9410 +smoothed 9410 +snatching 9410 +socializes 9410 +sophomore 9410 +sorters 9410 +spatial 9410 +specification 9410 +specifics 9410 +spongers 9410 +spools 9410 +sportswriting 9410 +sporty 9410 +squabbled 9410 +squeaking 9410 +squeezes 9410 +stabilizes 9410 +stairway 9410 +Stalin 9410 +standardizes 9410 +star 9410 +starlet 9410 +stated 9410 +Steinberg 9410 +stint 9410 +stodgy 9410 +store 9410 +straight 9410 +stranglings 9410 +subdirectory 9410 +subjective 9410 +subschema 9410 +succumbed 9410 +suites 9410 +sumac 9410 +sureties 9410 +swaying 9410 +sweetish 9410 +swelling 9410 +syndicate 9410 +Taoism 9410 +taxonomically 9410 +techniques 9410 +teem 9410 +teethe 9410 +tempering 9410 +Teresa 9410 +terminal 9410 +terminator 9410 +terminators 9410 +test 9410 +testicle 9410 +textures 9410 +theorizers 9410 +throttles 9410 +tidiness 9410 +timesharing 9410 +tinily 9410 +tinting 9410 +Tipperary 9410 +title 9410 +tragedies 9410 +traitor 9410 +trimmings 9410 +tropics 9410 +unaffected 9410 +uncovering 9410 +undoes 9410 +ungrateful 9410 +universals 9410 +unplug 9410 +unruly 9410 +untying 9410 +unwilling 9410 +vacuuming 9410 +validate 9410 +vanish 9410 +ventilate 9410 +veranda 9410 +vests 9410 +wallet 9410 +waltz 9410 +warm 9410 +warningly 9410 +watering 9410 +weasels 9410 +Weissmuller 9410 +western 9410 +whiteners 9410 +widens 9410 +Winsett 9410 +witchcraft 9410 +workers 9410 +Wotan 9410 +yelped 9410 +youthfulness 9410 +analyze table t2, t3; +Table Op Msg_type Msg_text +test.t2 analyze status OK +test.t3 analyze status OK +EXPLAIN select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 10.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL fld1 NULL NULL NULL 1199 10.00 Using where; Using temporary; Using filesort +2 SIMPLE t3 NULL eq_ref PRIMARY,period PRIMARY 4 test.t2.fld1 1 20.04 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`companynr` = 37) and (`test`.`t2`.`fld1` = `test`.`t3`.`t2nr`) and (`test`.`t3`.`period` >= 1001) and (`test`.`t3`.`period` <= 1002)) order by `test`.`t2`.`fld3`,`test`.`t3`.`period`,`test`.`t3`.`price` +select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +fld3 period price price2 +admonishing 1002 28357832 8723648 +analyzable 1002 28357832 8723648 +annihilates 1001 5987435 234724 +Antares 1002 28357832 8723648 +astound 1001 5987435 234724 +audiology 1001 5987435 234724 +Augustine 1002 28357832 8723648 +Baird 1002 28357832 8723648 +bewilderingly 1001 5987435 234724 +breaking 1001 5987435 234724 +Conley 1001 5987435 234724 +dentally 1002 28357832 8723648 +dissociate 1002 28357832 8723648 +elite 1001 5987435 234724 +eschew 1001 5987435 234724 +Eulerian 1001 5987435 234724 +flanking 1001 5987435 234724 +foldout 1002 28357832 8723648 +funereal 1002 28357832 8723648 +galling 1002 28357832 8723648 +Graves 1001 5987435 234724 +grazing 1001 5987435 234724 +groupings 1001 5987435 234724 +handgun 1001 5987435 234724 +humility 1002 28357832 8723648 +impulsive 1002 28357832 8723648 +inch 1001 5987435 234724 +intelligibility 1001 5987435 234724 +jarring 1001 5987435 234724 +lawgiver 1001 5987435 234724 +lectured 1002 28357832 8723648 +Merritt 1002 28357832 8723648 +neonatal 1001 5987435 234724 +offload 1002 28357832 8723648 +parters 1002 28357832 8723648 +pityingly 1002 28357832 8723648 +puddings 1002 28357832 8723648 +Punjab 1001 5987435 234724 +quitter 1002 28357832 8723648 +realtor 1001 5987435 234724 +relaxing 1001 5987435 234724 +repetitions 1001 5987435 234724 +resumes 1001 5987435 234724 +Romans 1002 28357832 8723648 +rusting 1001 5987435 234724 +scholastics 1001 5987435 234724 +skulking 1002 28357832 8723648 +stated 1002 28357832 8723648 +suites 1002 28357832 8723648 +sureties 1001 5987435 234724 +testicle 1002 28357832 8723648 +tinily 1002 28357832 8723648 +tragedies 1001 5987435 234724 +trimmings 1001 5987435 234724 +vacuuming 1001 5987435 234724 +ventilate 1001 5987435 234724 +wallet 1001 5987435 234724 +Weissmuller 1002 28357832 8723648 +Wotan 1002 28357832 8723648 +select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37; +fld1 fld3 period price price2 +018201 relaxing 1001 5987435 234724 +018601 vacuuming 1001 5987435 234724 +018801 inch 1001 5987435 234724 +018811 repetitions 1001 5987435 234724 +create table t4 ( +companynr tinyint(2) unsigned zerofill NOT NULL default '00', +companyname char(30) NOT NULL default '', +PRIMARY KEY (companynr), +UNIQUE KEY companyname(companyname) +) ENGINE=INNODB MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select * from t1,t1 t12; +Period Varor_period Period Varor_period +9410 9412 9410 9412 +select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505; +fld1 fld1 +250501 250501 +250501 250502 +250501 250503 +250501 250504 +250501 250505 +250502 250501 +250502 250502 +250502 250503 +250502 250504 +250502 250505 +250503 250501 +250503 250502 +250503 250503 +250503 250504 +250503 250505 +250504 250501 +250504 250502 +250504 250503 +250504 250504 +250504 250505 +250505 250501 +250505 250502 +250505 250503 +250505 250504 +250505 250505 +insert into t2 (fld1, companynr) values (999999,99); +ANALYZE TABLE t2, t4; +Table Op Msg_type Msg_text +test.t2 analyze status OK +test.t4 analyze status OK +select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +companynr companyname +99 NULL +select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null; +count(*) +1199 +explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1200 100.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1200 100.00 NULL +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 Using where; Not exists +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t2` left join `test`.`t4` on((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`)) where (`test`.`t4`.`companynr` is null) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1200 10.00 Using where; Not exists; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t2`.`companynr` is null) +select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +companynr companyname +select count(*) from t2 left join t4 using (companynr) where companynr is not null; +count(*) +1200 +explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t2` left join `test`.`t4` on(multiple equal(`test`.`t2`.`companynr`, `test`.`t4`.`companynr`)) where false +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on(multiple equal(`test`.`t4`.`companynr`, `test`.`t2`.`companynr`)) where false +delete from t2 where fld1=999999; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0) and (`test`.`t2`.`companynr` > 0)) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t4`.`companynr` > 0) and (`test`.`t4`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 40.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t2`.`companynr` > 0) or (`test`.`t2`.`companynr` is null)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index PRIMARY companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t2`.`companynr` > 0) or (`test`.`t4`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (ifnull(`test`.`t2`.`companynr`,1) > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t4`.`companynr` > 0) or (`test`.`t4`.`companynr` > 0)) +explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using where; Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (ifnull(`test`.`t4`.`companynr`,1) > 0) +select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +companynr companynr +37 36 +41 40 +explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index; Using temporary +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 10.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select distinct `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companynr` AS `companynr` from `test`.`t2` join `test`.`t4` where (`test`.`t2`.`companynr` = (`test`.`t4`.`companynr` + 1)) +select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909); +period +9410 +select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6))); +period +9410 +select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1; +fld1 +250501 +250502 +250503 +250505 +select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606); +fld1 +250502 +250503 +select fld1 from t2 where fld1 between 250502 and 250504; +fld1 +250502 +250503 +250504 +select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ; +fld3 +Lillian +label +labeled +labeled +landslide +laterally +leaflet +lewdly +luckily +select count(*) from t1; +count(*) +1 +select companynr,count(*),sum(fld1) from t2 group by companynr; +companynr count(*) sum(fld1) +00 82 10355753 +29 95 14473298 +34 70 17788966 +36 215 22786296 +37 588 83602098 +40 37 6618386 +41 52 12816335 +50 11 1595438 +53 4 793210 +58 23 2254293 +65 10 2284055 +68 12 3097288 +select companynr,count(*) from t2 group by companynr order by companynr desc limit 5; +companynr count(*) +68 12 +65 10 +58 23 +53 4 +50 11 +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +70 absentee vest 17788966 254128.0857 3272.5939722090234 10709871.306938833 +explain select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 9.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 order 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.97568479746 13352027981.708656 +29 95 abut wetness 14473298 152350.5053 8368.547956641249 70032594.90260443 +34 70 absentee vest 17788966 254128.0857 3272.5939722090234 10709871.306938833 +select +companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from +t3 where companynr = 37 group by companynr,t2nr order by companynr, t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select /*! SQL_SMALL_RESULT */ +companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from +t3 where companynr = 37 group by companynr,t2nr order by companynr, t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ; +companynr count(price) sum(price) min(price) max(price) avg(price) +101 4181 3489454238 834598 834598 834598.0000 +154 4181 4112197254950 983543950 983543950 983543950.0000 +311 4181 979599938 234298 234298 234298.0000 +37 12543 309394878010 5987435 39654943 24666736.6667 +447 4181 9929180954 2374834 2374834 2374834.0000 +512 4181 3288532102 786542 786542 786542.0000 +78 8362 414611089292 726498 98439034 49582766.0000 +select distinct mod(companynr,10) from t4 group by companynr; +mod(companynr,10) +0 +1 +3 +4 +5 +6 +7 +8 +9 +select distinct 1 from t4 group by companynr; +1 +1 +select count(distinct fld1) from t2; +count(distinct fld1) +1199 +select companynr,count(distinct fld1) from t2 group by companynr; +companynr count(distinct fld1) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(*) from t2 group by companynr; +companynr count(*) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,1000))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,200))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct floor(fld1/100)) from t2 group by companynr; +companynr count(distinct floor(fld1/100)) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr; +companynr count(distinct concat(repeat(65,1000),floor(fld1/100))) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10; +sum(fld1) fld3 +11402 Romans +select name,count(*) from t3 where name='cloakroom' group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name='cloakroom' and price>10 group by name; +name count(*) +cloakroom 4181 +select count(*) from t3 where name='cloakroom' and price2=823742; +count(*) +4181 +select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name; +name count(*) +extramarital 4181 +gazer 4181 +gems 4181 +Iranizes 4181 +spates 4181 +tucked 4181 +violinist 4181 +select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld3 count(*) +spates 4181 +select companynr|0,companyname from t4 group by 1; +companynr|0 companyname +0 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname; +companynr companyname count(*) +29 company 1 95 +68 company 10 12 +50 company 11 11 +34 company 2 70 +36 company 3 215 +37 company 4 588 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +00 Unknown 82 +select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld1 count(*) +158402 4181 +select sum(Period)/count(*) from t1; +sum(Period)/count(*) +9410.0000 +select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; +companynr count sum diff func +101 4181 3489454238 0.0000 422281 +154 4181 4112197254950 0.0000 643874 +311 4181 979599938 0.0000 1300291 +37 12543 309394878010 0.0000 464091 +447 4181 9929180954 0.0000 1868907 +512 4181 3288532102 0.0000 2140672 +78 8362 414611089292 0.0000 652236 +select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; +companynr avg +154 983543950.0000 +select companynr,count(*) from t2 group by companynr order by 2 desc; +companynr count(*) +37 588 +36 215 +29 95 +00 82 +34 70 +41 52 +40 37 +58 23 +68 12 +50 11 +65 10 +53 4 +select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc; +companynr count(*) +41 52 +58 23 +68 12 +50 11 +65 10 +53 4 +select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4; +fld4 fld1 count(price) sum(price) min(price) max(price) avg(price) +Abraham 018103 1 39654943 39654943 39654943 39654943.0000 +Anatole 038102 1 28357832 28357832 28357832 28357832.0000 +Beebe 018602 1 28357832 28357832 28357832 28357832.0000 +Chicana 038203 1 39654943 39654943 39654943 39654943.0000 +Conley 018101 1 5987435 5987435 5987435 5987435.0000 +Connally 018801 1 5987435 5987435 5987435 5987435.0000 +Graves 018052 1 28357832 28357832 28357832 28357832.0000 +Judas 018032 1 28357832 28357832 28357832 28357832.0000 +Kline 038101 1 5987435 5987435 5987435 5987435.0000 +Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000 +Merritt 016303 1 39654943 39654943 39654943 39654943.0000 +Parsifal 013802 1 28357832 28357832 28357832 28357832.0000 +Punjab 016302 1 28357832 28357832 28357832 28357832.0000 +Selfridge 019102 1 28357832 28357832 28357832 28357832.0000 +Simla 018402 1 28357832 28357832 28357832 28357832.0000 +Steinberg 012003 1 39654943 39654943 39654943 39654943.0000 +Taoism 018603 1 39654943 39654943 39654943 39654943.0000 +attainments 012303 1 39654943 39654943 39654943 39654943.0000 +audiology 011403 1 39654943 39654943 39654943 39654943.0000 +balled 012301 1 5987435 5987435 5987435 5987435.0000 +bee 038001 1 5987435 5987435 5987435 5987435.0000 +betroth 030501 1 5987435 5987435 5987435 5987435.0000 +bivalves 018013 1 39654943 39654943 39654943 39654943.0000 +bloodbath 018042 1 28357832 28357832 28357832 28357832.0000 +cage 018201 1 5987435 5987435 5987435 5987435.0000 +capably 012501 1 5987435 5987435 5987435 5987435.0000 +checkpoints 018803 1 39654943 39654943 39654943 39654943.0000 +coexist 018601 1 5987435 5987435 5987435 5987435.0000 +contrasted 016001 1 5987435 5987435 5987435 5987435.0000 +daughter 012703 1 39654943 39654943 39654943 39654943.0000 +dental 038003 1 39654943 39654943 39654943 39654943.0000 +dimensions 038202 1 28357832 28357832 28357832 28357832.0000 +disable 019103 1 39654943 39654943 39654943 39654943.0000 +dogging 018002 1 28357832 28357832 28357832 28357832.0000 +dreaded 011401 1 5987435 5987435 5987435 5987435.0000 +epistle 018062 1 28357832 28357832 28357832 28357832.0000 +erases 016301 1 5987435 5987435 5987435 5987435.0000 +eschew 011702 1 28357832 28357832 28357832 28357832.0000 +featherweight 012701 1 5987435 5987435 5987435 5987435.0000 +fetched 018802 1 28357832 28357832 28357832 28357832.0000 +fetters 018012 1 28357832 28357832 28357832 28357832.0000 +firearm 018812 1 28357832 28357832 28357832 28357832.0000 +flint 018022 1 28357832 28357832 28357832 28357832.0000 +flopping 018023 1 39654943 39654943 39654943 39654943.0000 +gritty 018811 1 5987435 5987435 5987435 5987435.0000 +hushes 018202 1 28357832 28357832 28357832 28357832.0000 +imprint 030503 1 39654943 39654943 39654943 39654943.0000 +impulsive 012602 1 28357832 28357832 28357832 28357832.0000 +interdependent 018051 1 5987435 5987435 5987435 5987435.0000 +interrelationships 036001 1 5987435 5987435 5987435 5987435.0000 +kanji 038002 1 28357832 28357832 28357832 28357832.0000 +lawgiver 013601 1 5987435 5987435 5987435 5987435.0000 +leavings 013803 1 39654943 39654943 39654943 39654943.0000 +lectured 018102 1 28357832 28357832 28357832 28357832.0000 +leftover 016201 1 5987435 5987435 5987435 5987435.0000 +medical 018041 1 5987435 5987435 5987435 5987435.0000 +minima 019101 1 5987435 5987435 5987435 5987435.0000 +neat 012001 1 5987435 5987435 5987435 5987435.0000 +neonatal 018053 1 39654943 39654943 39654943 39654943.0000 +normalizes 038013 1 39654943 39654943 39654943 39654943.0000 +parters 011701 1 5987435 5987435 5987435 5987435.0000 +partridges 038103 1 39654943 39654943 39654943 39654943.0000 +persist 012302 1 28357832 28357832 28357832 28357832.0000 +pessimist 012702 1 28357832 28357832 28357832 28357832.0000 +quitter 011703 1 39654943 39654943 39654943 39654943.0000 +railway 038011 1 5987435 5987435 5987435 5987435.0000 +readable 013603 1 39654943 39654943 39654943 39654943.0000 +recruited 038201 1 5987435 5987435 5987435 5987435.0000 +reporters 018403 1 39654943 39654943 39654943 39654943.0000 +riser 036002 1 28357832 28357832 28357832 28357832.0000 +scholastics 011402 1 28357832 28357832 28357832 28357832.0000 +scornfully 018003 1 39654943 39654943 39654943 39654943.0000 +skulking 018021 1 5987435 5987435 5987435 5987435.0000 +sorters 018061 1 5987435 5987435 5987435 5987435.0000 +squeaking 013901 1 5987435 5987435 5987435 5987435.0000 +starlet 012603 1 39654943 39654943 39654943 39654943.0000 +stated 013602 1 28357832 28357832 28357832 28357832.0000 +subschema 018043 1 39654943 39654943 39654943 39654943.0000 +sweetish 018001 1 5987435 5987435 5987435 5987435.0000 +swelling 031901 1 5987435 5987435 5987435 5987435.0000 +teethe 000001 1 5987435 5987435 5987435 5987435.0000 +testicle 013801 1 5987435 5987435 5987435 5987435.0000 +vacuuming 018033 1 39654943 39654943 39654943 39654943.0000 +validate 038012 1 28357832 28357832 28357832 28357832.0000 +wallet 011501 1 5987435 5987435 5987435 5987435.0000 +whiteners 016202 1 28357832 28357832 28357832 28357832.0000 +witchcraft 019201 1 5987435 5987435 5987435 5987435.0000 +select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3; +companynr fld3 sum(price) +512 Micronesia 786542 +512 Miles 786542 +512 boat 786542 +512 capably 786542 +512 cupboard 786542 +512 decliner 786542 +512 descendants 786542 +512 dopers 786542 +512 erases 786542 +512 skies 786542 +select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr; +companynr count(*) min(fld3) max(fld3) sum(price) avg(price) +00 1 Omaha Omaha 5987435 5987435.0000 +36 1 dubbed dubbed 28357832 28357832.0000 +37 83 Abraham Wotan 1908978016 22999735.1325 +50 2 scribbled tapestry 68012775 34006387.5000 +select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1; +t3.companynr+0 t2nr fld3 sum(price) +37 1 Omaha 5987435 +37 11401 breaking 5987435 +37 11402 Romans 28357832 +37 11403 intercepted 39654943 +37 11501 bewilderingly 5987435 +37 11701 astound 5987435 +37 11702 admonishing 28357832 +37 11703 sumac 39654943 +37 12001 flanking 5987435 +37 12003 combed 39654943 +37 12301 Eulerian 5987435 +37 12302 dubbed 28357832 +37 12303 Kane 39654943 +37 12501 annihilates 5987435 +37 12602 Wotan 28357832 +37 12603 snatching 39654943 +37 12701 grazing 5987435 +37 12702 Baird 28357832 +37 12703 celery 39654943 +37 13601 handgun 5987435 +37 13602 foldout 28357832 +37 13603 mystic 39654943 +37 13801 intelligibility 5987435 +37 13802 Augustine 28357832 +37 13803 teethe 39654943 +37 13901 scholastics 5987435 +37 16001 audiology 5987435 +37 16201 wallet 5987435 +37 16202 parters 28357832 +37 16301 eschew 5987435 +37 16302 quitter 28357832 +37 16303 neat 39654943 +37 18001 jarring 5987435 +37 18002 tinily 28357832 +37 18003 balled 39654943 +37 18012 impulsive 28357832 +37 18013 starlet 39654943 +37 18021 lawgiver 5987435 +37 18022 stated 28357832 +37 18023 readable 39654943 +37 18032 testicle 28357832 +37 18033 Parsifal 39654943 +37 18041 Punjab 5987435 +37 18042 Merritt 28357832 +37 18043 Quixotism 39654943 +37 18051 sureties 5987435 +37 18052 puddings 28357832 +37 18053 tapestry 39654943 +37 18061 trimmings 5987435 +37 18062 humility 28357832 +37 18101 tragedies 5987435 +37 18102 skulking 28357832 +37 18103 flint 39654943 +37 18201 relaxing 5987435 +37 18202 offload 28357832 +37 18402 suites 28357832 +37 18403 lists 39654943 +37 18601 vacuuming 5987435 +37 18602 dentally 28357832 +37 18603 humanness 39654943 +37 18801 inch 5987435 +37 18802 Weissmuller 28357832 +37 18803 irresponsibly 39654943 +37 18811 repetitions 5987435 +37 18812 Antares 28357832 +37 19101 ventilate 5987435 +37 19102 pityingly 28357832 +37 19103 interdependent 39654943 +37 19201 Graves 5987435 +37 30501 neonatal 5987435 +37 30502 scribbled 28357832 +37 30503 chafe 39654943 +37 31901 realtor 5987435 +37 36001 elite 5987435 +37 36002 funereal 28357832 +37 38001 Conley 5987435 +37 38002 lectured 28357832 +37 38003 Abraham 39654943 +37 38011 groupings 5987435 +37 38012 dissociate 28357832 +37 38013 coexist 39654943 +37 38101 rusting 5987435 +37 38102 galling 28357832 +37 38103 obliterates 39654943 +37 38201 resumes 5987435 +37 38202 analyzable 28357832 +37 38203 terminator 39654943 +select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008; +sum(price) +234298 +select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1; +fld1 sum(price) +038008 234298 +explain select fld3 from t2 where 1>2 or 2>3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where false +explain select fld3 from t2 where fld1=fld1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 100.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where true +select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000; +companynr count sum +00 82 10355753 +29 95 14473298 +34 70 17788966 +37 588 83602098 +41 52 12816335 +select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ; +companynr +00 +29 +34 +37 +41 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40; +companynr companyname count(*) +40 company 5 37 +41 company 6 52 +50 company 11 11 +53 company 7 4 +58 company 8 23 +65 company 9 10 +68 company 10 12 +select count(*) from t2; +count(*) +1199 +select count(*) from t2 where fld1 < 098024; +count(*) +387 +select min(fld1) from t2 where fld1>= 098024; +min(fld1) +98024 +select max(fld1) from t2 where fld1>= 098024; +max(fld1) +1232609 +select count(*) from t3 where price2=76234234; +count(*) +4181 +select count(*) from t3 where companynr=512 and price2=76234234; +count(*) +4181 +explain select min(fld1),max(fld1),count(*) from t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL index NULL fld1 4 NULL 1199 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t2`.`fld1`) AS `min(fld1)`,max(`test`.`t2`.`fld1`) AS `max(fld1)`,count(0) AS `count(*)` from `test`.`t2` +explain format=tree select min(fld1),max(fld1),count(*) from t2; +EXPLAIN +-> Count rows in t2 + +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +explain format=tree select min(fld1),max(fld1),count(*) from t2 where rand() > 0.5; +EXPLAIN +-> Aggregate: min(`min(fld1)`), max(`max(fld1)`), count(`count(*)`) + -> Parallel scan on + -> Aggregate: + -> Filter: (rand() > 0.5) (cost=123.65 rows=1199) + -> PQblock scan on t2 using fld1 (cost=123.65 rows=1199) + +select min(fld1),max(fld1),count(*) from t2; +min(fld1) max(fld1) count(*) +0 1232609 1199 +select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; +min(t2nr) max(t2nr) +2115 2115 +select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; +count(*) min(t2nr) max(t2nr) +4181 4 41804 +select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; +t2nr count(*) +9 1 +19 1 +29 1 +39 1 +49 1 +59 1 +69 1 +79 1 +89 1 +99 1 +109 1 +119 1 +129 1 +139 1 +149 1 +159 1 +169 1 +179 1 +189 1 +199 1 +select max(t2nr) from t3 where price=983543950; +max(t2nr) +41807 +select t1.period from t3 t1 limit 1; +period +1001 +select t1.period from t1 as t1 limit 1; +period +9410 +select t1.period as "Nuvarande period" from t1 as t1 limit 1; +Nuvarande period +9410 +select period as ok_period from t1 limit 1; +ok_period +9410 +select period as ok_period from t1 group by ok_period limit 1; +ok_period +9410 +select 1+1 as summa from t1 group by summa limit 1; +summa +2 +select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1; +Nuvarande period +9410 +show tables; +Tables_in_test +t1 +t2 +t3 +t4 +show tables from test like "s%"; +Tables_in_test (s%) +show tables from test like "t?"; +Tables_in_test (t?) +show full columns from t2; +Field Type Collation Null Key Default Extra Privileges Comment +auto int NULL NO PRI NULL auto_increment select,insert,update,references +fld1 int(6) unsigned zerofill NULL NO UNI 000000 select,insert,update,references +companynr tinyint(2) unsigned zerofill NULL NO 00 select,insert,update,references +fld3 char(30) utf8mb4_0900_ai_ci NO MUL select,insert,update,references +fld4 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld5 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld6 char(4) utf8mb4_0900_ai_ci NO select,insert,update,references +show full columns from t2 from test like 'f%'; +Field Type Collation Null Key Default Extra Privileges Comment +fld1 int(6) unsigned zerofill NULL NO UNI 000000 select,insert,update,references +fld3 char(30) utf8mb4_0900_ai_ci NO MUL select,insert,update,references +fld4 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld5 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld6 char(4) utf8mb4_0900_ai_ci NO select,insert,update,references +show full columns from t2 from test like 's%'; +Field Type Collation Null Key Default Extra Privileges Comment +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +show keys from t2; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Visible Expression +t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE YES NULL +t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE YES NULL +t2 1 fld3 1 fld3 A 1171 NULL NULL BTREE YES NULL +drop table t4, t3, t2, t1; +DO 1; +DO benchmark(100,1+1),1,1; +do default; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +do foobar; +ERROR 42S22: Unknown column 'foobar' in 'field list' +CREATE TABLE t1 ( +id mediumint(8) unsigned NOT NULL auto_increment, +pseudo varchar(35) NOT NULL default '', +PRIMARY KEY (id), +UNIQUE KEY pseudo (pseudo) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 (pseudo) VALUES ('test'); +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 1 as rnd1 from t1 where rand() > 2; +rnd1 +DROP TABLE t1; +CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1287 'BINARY as attribute of a type' is deprecated and will be removed in a future release. Please use a CHARACTER SET clause with _bin collation instead +INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); +CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +ERROR HY000: Incorrect DATETIME value: 'wrong-date-value' +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +DROP TABLE t1,t2; +create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); +select wss_type from t1 where wss_type ='102935229216544106'; +wss_type +select wss_type from t1 where wss_type ='102935229216544105'; +wss_type +select wss_type from t1 where wss_type ='102935229216544104'; +wss_type +select wss_type from t1 where wss_type ='102935229216544093'; +wss_type +102935229216544093 +select wss_type from t1 where wss_type =102935229216544093; +wss_type +102935229216544093 +drop table t1; +select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; +select @a; +@a +3 +select @b; +@b +aaaa +select @c; +@c +6.260 +create table t1 (a int not null auto_increment primary key); +insert into t1 values (); +insert into t1 values (); +insert into t1 values (); +select * from (t1 as t2 left join t1 as t3 using (a)), t1; +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from t1, (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); +a +1 +2 +3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +1 NULL +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); +a +1 +2 +3 +select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; +a +1 +2 +3 +select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +NULL 1 +select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); +a +1 +2 +3 +select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; +a +1 +2 +3 +select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; +a +1 +2 +3 +drop table t1; +CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); +CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); +select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; +aa id t2_id id +2 8299 2517 2517 +3 8301 2518 2518 +4 8302 2519 2519 +5 8303 2520 2520 +6 8304 2521 2521 +drop table t1,t2; +create table t1 (id1 int NOT NULL); +create table t2 (id2 int NOT NULL); +create table t3 (id3 int NOT NULL); +create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); +insert into t1 values (1); +insert into t1 values (2); +insert into t2 values (1); +insert into t4 values (1,1); +explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t4 NULL ALL id4 NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`id1` AS `id1`,`test`.`t2`.`id2` AS `id2`,`test`.`t3`.`id3` AS `id3`,`test`.`t4`.`id4` AS `id4`,`test`.`t4`.`id44` AS `id44` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`id2` = `test`.`t1`.`id1`)) left join `test`.`t3` on((`test`.`t3`.`id3` = `test`.`t1`.`id1`)) left join `test`.`t4` on((`test`.`t4`.`id4` = `test`.`t3`.`id3`)) where ((`test`.`t2`.`id2` = 1) or (`test`.`t4`.`id4` = 1)) +select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id1 id2 id3 id4 id44 +1 1 NULL NULL NULL +drop table t1,t2,t3,t4; +create table t1(s varchar(10) not null); +create table t2(s varchar(10) not null primary key); +create table t3(s varchar(10) not null primary key); +insert into t1 values ('one\t'), ('two\t'); +insert into t2 values ('one\r'), ('two\t'); +insert into t3 values ('one\b'), ('two\t'); +select * from t1 where s = 'one'; +s +select * from t2 where s = 'one'; +s +select * from t3 where s = 'one'; +s +one +select * from t1,t2 where t1.s = t2.s; +s s +two two +select * from t2,t3 where t2.s = t3.s; +s s +two two +drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +explain select * from t1 left join t2 on a=c where d in (4); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref c,d d 5 const 2 100.00 Using where +2 SIMPLE t1 NULL ref a a 5 test.t2.c 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ 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`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = 4)) +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref c,d d 5 const 2 100.00 Using where +2 SIMPLE t1 NULL ref a a 5 test.t2.c 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ 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`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = 4)) +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; +CREATE TABLE t1 ( +i int(11) NOT NULL default '0', +c char(10) NOT NULL default '', +PRIMARY KEY (i), +UNIQUE KEY c (c) +) ; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (1,'a'); +INSERT INTO t1 VALUES (2,'b'); +INSERT INTO t1 VALUES (3,'c'); +EXPLAIN SELECT i FROM t1 WHERE i=1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '1' AS `i` from `test`.`t1` where true +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref a a 23 test.t1.a 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` USE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref a a 23 test.t1.a 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` FORCE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +DROP TABLE t1, t2; +CREATE TABLE t1 ( city char(30) ) charset utf8mb4; +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`city` AS `city` from `test`.`t1` where (`test`.`t1`.`city` = 'London') +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`city` AS `city` from `test`.`t1` where ((`test`.`t1`.`city` = 'London') and (`test`.`t1`.`city` like '%london%')) +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,0), (1,1), (4294967295,1); +select a-b from t1 order by 1; +a-b +0 +1 +4294967294 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +4294967294 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +4294967294 +drop table t1; +create table t1 (a int(11)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +kunde_intern_id int(10) unsigned NOT NULL default '0', +kunde_id int(10) unsigned NOT NULL default '0', +FK_firma_id int(10) unsigned NOT NULL default '0', +aktuell enum('Ja','Nein') NOT NULL default 'Ja', +vorname varchar(128) NOT NULL default '', +nachname varchar(128) NOT NULL default '', +geloescht enum('Ja','Nein') NOT NULL default 'Nein', +firma varchar(128) NOT NULL default '' +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), +(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 +WHERE +( +( +( '' != '' AND firma LIKE CONCAT('%', '', '%')) +OR +(vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND +'Vorname1' != '' AND 'xxxx' != '') +) +AND +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, +geloescht FROM t1 +WHERE +( +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +AND +( +( '' != '' AND firma LIKE CONCAT('%', '', '%') ) +OR +( vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND +'xxxx' != '') +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT COUNT(*) FROM t1 WHERE +( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) +AND FK_firma_id = 2; +COUNT(*) +0 +drop table t1; +CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (0x8000000000000000); +SELECT b FROM t1 WHERE b=0x8000000000000000; +b +9223372036854775808 +DROP TABLE t1; +CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `t2` VALUES (0,'READ'); +CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `t3` VALUES (1,'fs'); +select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); +id name gid uid ident level +1 fs NULL NULL 0 READ +drop table t1,t2,t3; +CREATE TABLE t1 ( +acct_id int(11) NOT NULL default '0', +profile_id smallint(6) default NULL, +UNIQUE KEY t1$acct_id (acct_id), +KEY t1$profile_id (profile_id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (132,17),(133,18); +CREATE TABLE t2 ( +profile_id smallint(6) default NULL, +queue_id int(11) default NULL, +seq int(11) default NULL, +KEY t2$queue_id (queue_id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); +CREATE TABLE t3 ( +id int(11) NOT NULL default '0', +qtype int(11) default NULL, +seq int(11) default NULL, +warn_lvl int(11) default NULL, +crit_lvl int(11) default NULL, +rr1 tinyint(4) NOT NULL default '0', +rr2 int(11) default NULL, +default_queue tinyint(4) NOT NULL default '0', +KEY t3$qtype (qtype), +KEY t3$id (id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), +(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); +SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q +WHERE +(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND +(pq.queue_id = q.id) AND (q.rr1 <> 1); +COUNT(*) +4 +drop table t1,t2,t3; +create table t1 (f1 int); +insert into t1 values (1),(NULL); +create table t2 (f2 int, f3 int, f4 int); +create index idx1 on t2 (f4); +insert into t2 values (1,2,3),(2,4,6); +select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) +from t2 C where A.f4 = C.f4) or A.f3 IS NULL; +f2 +1 +NULL +drop table t1,t2; +create table t2 (a tinyint unsigned); +create index t2i on t2(a); +insert into t2 values (0), (254), (255); +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +explain select * from t2 where a > -1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index t2i t2i 2 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a` is not null) +select * from t2 where a > -1; +a +0 +254 +255 +drop table t2; +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +SELECT * FROM t1; +a b c +50 3 3 +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +select found_rows(); +found_rows() +0 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +SELECT * FROM t1; +a b c +50 3 3 +select count(*) from t1; +count(*) +1 +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +select count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; +count(*) +Warnings: +Warning 1287 SQL_CALC_FOUND_ROWS is deprecated and will be removed in a future release. Consider using two separate queries instead. +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +(SELECT a, b AS c FROM t1) ORDER BY c+1; +a c +(SELECT a, b AS c FROM t1) ORDER BY b+1; +a c +SELECT a, b AS c FROM t1 ORDER BY c+1; +a c +SELECT a, b AS c FROM t1 ORDER BY b+1; +a c +drop table t1; +create table t1(f1 int, f2 int); +create table t2(f3 int); +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); +f1 +insert into t1 values(1,1),(2,null); +insert into t2 values(2); +select * from t1,t2 where f1=f3 and (f1,f2) = (2,null); +f1 f2 f3 +select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null); +f1 f2 f3 +2 NULL 2 +drop table t1,t2; +create table t1 (f1 int not null auto_increment primary key, f2 varchar(10)); +create table t11 like t1; +insert into t1 values(1,""),(2,""); +analyze table t1, t11; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t11 analyze status OK +show table status like 't1%'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 InnoDB 10 Dynamic 2 8192 X X X X X X X X X NULL +t11 InnoDB 10 Dynamic 0 0 X X X X X X X X X NULL +select 123 as a from t1 where f1 is null; +a +drop table t1,t11; +CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); +INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); +CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, e INT ); +INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2),(1,2,3); +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 10 2 +1 11 2 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c; +a b c d +1 10 4 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c; +a b c d +1 10 2 +1 11 2 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2,t1 +WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 2 1 1 +1 2 2 1 +1 2 3 1 +DROP TABLE IF EXISTS t1, t2; +create table t1 (f1 int primary key, f2 int); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t1 values (1,1); +insert into t2 values (1,1),(1,2); +select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1; +count(f2) >0 +1 +drop table t1,t2; +create table t1 (f1 int,f2 int); +insert into t1 values(1,1); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t2 values(1,1); +select * from t1 where f1 in (select f3 from t2 where (f3,f4)= (select f3,f4 from t2)); +f1 f2 +1 1 +drop table t1,t2; +CREATE TABLE t1(a int, b int, c int, KEY b(b), KEY c(c)); +insert into t1 values (1,0,0),(2,0,0); +CREATE TABLE t2 (a int, b varchar(2), c varchar(2), PRIMARY KEY(a)); +insert into t2 values (1,'',''), (2,'',''); +CREATE TABLE t3 (a int, b int, PRIMARY KEY (a,b), KEY a (a), KEY b (b)); +insert into t3 values (1,1),(1,2); +explain select straight_join DISTINCT t2.a,t2.b, t1.c from t1, t3, t2 +where (t1.c=t2.a or (t1.c=t3.a and t2.a=t3.b)) and t1.b=556476786 and +t2.b like '%%' order by t2.b limit 0,1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ref b,c b 5 const 1 100.00 Using temporary; Using filesort +1 SIMPLE t3 NULL index PRIMARY,a,b a 4 NULL 2 100.00 Using index; Using join buffer (hash join) +1 SIMPLE t2 NULL ALL PRIMARY NULL NULL NULL 2 50.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select straight_join distinct `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t1`.`b` = 556476786) and ((`test`.`t2`.`a` = `test`.`t1`.`c`) or ((`test`.`t2`.`a` = `test`.`t3`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`c`))) and (`test`.`t2`.`b` like '%%')) order by `test`.`t2`.`b` limit 0,1 +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (a int, INDEX idx(a)); +INSERT INTO t1 VALUES (2), (3), (1); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 IGNORE INDEX (idx); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` IGNORE INDEX (`idx`) +EXPLAIN SELECT * FROM t1 IGNORE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +EXPLAIN SELECT * FROM t1 FORCE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +DROP TABLE t1; +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 VALUES (1,1), (2,1), (4,10); +CREATE TABLE t2 (a int PRIMARY KEY, b int, KEY b (b)); +INSERT INTO t2 VALUES (1,NULL), (2,10); +ALTER TABLE t1 ENABLE KEYS; +Warnings: +Note 1031 Table storage engine for 't1' doesn't have this option +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index b b 5 NULL 2 100.00 Using index +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select straight_join count(0) AS `COUNT(*)` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) or (`test`.`t2`.`b` is null)) +SELECT STRAIGHT_JOIN * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +a b a b +1 NULL 1 1 +1 NULL 2 1 +1 NULL 4 10 +2 10 4 10 +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index b b 5 NULL 2 100.00 Using index +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select straight_join count(0) AS `COUNT(*)` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) or (`test`.`t2`.`b` is null)) +SELECT STRAIGHT_JOIN * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +a b a b +1 NULL 1 1 +1 NULL 2 1 +1 NULL 4 10 +2 10 4 10 +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (key1 double default NULL, UNIQUE KEY key1 (key1)); +CREATE TABLE t2 (key2 double default NULL, UNIQUE KEY key2 (key2)); +INSERT INTO t1 VALUES (0.3762),(0.3845),(0.6158),(0.7941); +INSERT INTO t2 VALUES (1.3762),(1.3845),(1.6158),(1.7941); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +explain select max(key1) from t1 where key1 <= 0.6158; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)` from `test`.`t1` where (`test`.`t1`.`key1` <= 0.6158) +explain select max(key2) from t2 where key2 <= 1.6158; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t2`.`key2`) AS `max(key2)` from `test`.`t2` where (`test`.`t2`.`key2` <= 1.6158) +explain select min(key1) from t1 where key1 >= 0.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where (`test`.`t1`.`key1` >= 0.3762) +explain select min(key2) from t2 where key2 >= 1.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t2`.`key2`) AS `min(key2)` from `test`.`t2` where (`test`.`t2`.`key2` >= 1.3762) +explain select max(key1), min(key2) from t1, t2 +where key1 <= 0.6158 and key2 >= 1.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)`,min(`test`.`t2`.`key2`) AS `min(key2)` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`key1` <= 0.6158) and (`test`.`t2`.`key2` >= 1.3762)) +explain select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range key1 key1 9 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` <= 0.6158) and ((rand() + 0.5) >= 0.5)) +explain select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index key1 key1 9 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` >= 0.3762) and ((rand() + 0.5) >= 0.5)) +select max(key1) from t1 where key1 <= 0.6158; +max(key1) +0.6158 +select max(key2) from t2 where key2 <= 1.6158; +max(key2) +1.6158 +select min(key1) from t1 where key1 >= 0.3762; +min(key1) +0.3762 +select min(key2) from t2 where key2 >= 1.3762; +min(key2) +1.3762 +select max(key1), min(key2) from t1, t2 +where key1 <= 0.6158 and key2 >= 1.3762; +max(key1) min(key2) +0.6158 1.3762 +select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; +max(key1) +0.6158 +select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; +min(key1) +0.3762 +DROP TABLE t1,t2; +CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL); +INSERT INTO t1 VALUES (10); +SELECT i='1e+01',i=1e+01, i in (1e+01,1e+01), i in ('1e+01','1e+01') FROM t1; +i='1e+01' i=1e+01 i in (1e+01,1e+01) i in ('1e+01','1e+01') +1 1 1 1 +DROP TABLE t1; +create table t1(a bigint unsigned, b bigint); +insert ignore into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff), +(0x10000000000000000, 0x10000000000000000), +(0x8fffffffffffffff, 0x8fffffffffffffff); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'a' at row 2 +Warning 1264 Out of range value for column 'b' at row 2 +Warning 1264 Out of range value for column 'b' at row 3 +select hex(a), hex(b) from t1; +hex(a) hex(b) +FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +8FFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +drop table t1; +CREATE TABLE t1 (c0 int); +CREATE TABLE t2 (c0 int); +INSERT INTO t1 VALUES(@@connect_timeout); +INSERT INTO t2 VALUES(@@connect_timeout); +SELECT * FROM t1 JOIN t2 ON t1.c0 = t2.c0 WHERE (t1.c0 <=> @@connect_timeout); +c0 c0 +X X +DROP TABLE t1, t2; +End of 4.1 tests +CREATE TABLE t1 ( +K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', +K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', +F2I4 int(11) NOT NULL default '0' +) DEFAULT CHARSET=latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +('W%RT', '0100', 1), +('W-RT', '0100', 1), +('WART', '0100', 1), +('WART', '0200', 1), +('WERT', '0100', 2), +('WORT','0200', 2), +('WT', '0100', 2), +('W_RT', '0100', 2), +('WaRT', '0100', 3), +('WART', '0300', 3), +('WRT' , '0400', 3), +('WURM', '0500', 3), +('W%T', '0600', 4), +('WA%T', '0700', 4), +('WA_T', '0800', 4); +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND +(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); +K2C4 K4N4 F2I4 +WART 0200 1 +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); +K2C4 K4N4 F2I4 +WART 0100 1 +WART 0200 1 +WART 0300 3 +DROP TABLE t1; +create table t1 (a int, b int); +create table t2 like t1; +select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; +a +select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; +a +select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; +a a a +drop table t1,t2; +create table t1 (s1 varchar(5)); +insert into t1 values ('Wall'); +select min(s1) from t1 group by s1 with rollup; +min(s1) +Wall +Wall +drop table t1; +create table t1 (s1 int); +insert into t1 values (0); +select avg(distinct s1) from t1 group by s1 with rollup; +avg(distinct s1) +0.0000 +0.0000 +drop table t1; +create table t1 (s1 int); +insert into t1 values (null),(1); +select avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +1.0000 +select distinct avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +drop table t1; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +INSERT INTO t2 VALUES (2), (4), (6); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +a +2 +4 +EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 3 33.33 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` straight_join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`a`) +EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 20.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`) +DROP TABLE t1,t2; +select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; +x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 +16 16 2 2 +create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); +insert into t1 values (" 2", 2); +insert into t2 values (" 2", " one "),(" 2", " two "); +select * from t1 left join t2 on f1 = f3; +f1 f2 f3 f4 + 2 2 2 one + 2 2 2 two +drop table t1,t2; +create table t1 (empnum smallint, grp int); +create table t2 (empnum int, name char(5)); +insert into t1 values(1,1); +insert into t2 values(1,'bob'); +create view v1 as select * from t2 inner join t1 using (empnum); +select * from v1; +empnum name grp +1 bob 1 +drop table t1,t2; +drop view v1; +create table t1 (pk int primary key, b int); +create table t2 (pk int primary key, c int); +select pk from t1 inner join t2 using (pk); +pk +drop table t1,t2; +create table t1 (s1 int, s2 char(5), s3 decimal(10)); +create view v1 as select s1, s2, 'x' as s3 from t1; +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'x' +insert into t1 values (1,'x',5); +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'x' +drop table t1; +drop view v1; +create table t1(a1 int); +create table t2(a2 int); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +create view v2 (c) as select a1 from t1; +select * from t1 natural left join t2; +a1 a2 +1 1 +1 2 +2 1 +2 2 +select * from t1 natural right join t2; +a2 a1 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural left join t2; +c a2 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural right join t2; +a2 c +1 1 +1 2 +2 1 +2 2 +drop table t1, t2; +drop view v2; +create table t1 (a int(10), t1_val int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (b int(10), t2_val int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t3 (a int(10), b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,1),(2,2); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(2,1),(3,1),(4,1); +select * from t1 natural join t2 natural join t3; +a b t1_val t2_val +1 1 1 1 +2 1 2 1 +select * from t1 natural join t3 natural join t2; +b a t1_val t2_val +1 1 1 1 +1 2 2 1 +drop table t1, t2, t3; +DO IFNULL(NULL, NULL); +SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); +CAST(IFNULL(NULL, NULL) AS DECIMAL) +NULL +SELECT ABS(IFNULL(NULL, NULL)); +ABS(IFNULL(NULL, NULL)) +NULL +SELECT IFNULL(NULL, NULL); +IFNULL(NULL, NULL) +NULL +SET @OLD_SQL_MODE12595=@@SQL_MODE, @@SQL_MODE=''; +SHOW LOCAL VARIABLES LIKE 'SQL_MODE'; +Variable_name Value +sql_mode +CREATE TABLE BUG_12595(a varchar(100)) charset latin1; +INSERT INTO BUG_12595 VALUES ('hakan%'), ('hakank'), ("ha%an"); +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE ''; +a +hakan% +hakank +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE ''; +a +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha%%an' ESCAPE '%'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE '\\'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|'; +a +ha%an +SET @@SQL_MODE='NO_BACKSLASH_ESCAPES'; +SHOW LOCAL VARIABLES LIKE 'SQL_MODE'; +Variable_name Value +sql_mode NO_BACKSLASH_ESCAPES +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%'; +a +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE '\\'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE ''; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\n%' ESCAPE '\n'; +ERROR HY000: Incorrect arguments to ESCAPE +SET @@SQL_MODE=@OLD_SQL_MODE12595; +DROP TABLE BUG_12595; +create table t1 (a char(1)); +create table t2 (a char(1)); +insert into t1 values ('a'),('b'),('c'); +insert into t2 values ('b'),('c'),('d'); +select a from t1 natural join t2; +a +b +c +select * from t1 natural join t2 where a = 'b'; +a +b +drop table t1, t2; +CREATE TABLE t1 (`id` TINYINT); +CREATE TABLE t2 (`id` TINYINT); +CREATE TABLE t3 (`id` TINYINT); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +drop table t1, t2, t3; +create table t1 (a int(10),b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (a int(10),b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,10),(2,20),(3,30); +insert into t2 values (1,10); +select * from t1 inner join t2 using (A); +a b b +1 10 10 +select * from t1 inner join t2 using (a); +a b b +1 10 10 +drop table t1, t2; +create table t1 (a int, c int); +create table t2 (b int); +create table t3 (b int, a int); +create table t4 (c int); +insert into t1 values (1,1); +insert into t2 values (1); +insert into t3 values (1,1); +insert into t4 values (1); +select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +a c b b a +1 1 1 1 1 +select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +ERROR 42S22: Unknown column 't1.a' in 'on clause' +select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); +a c b b a c +1 1 1 1 1 1 +select * from t1 join t2 join t4 using (c); +c a b +1 1 1 +drop table t1, t2, t3, t4; +create table t1(x int, y int); +create table t2(x int, y int); +create table t3(x int, primary key(x)); +insert into t1 values (1, 1), (2, 1), (3, 1), (4, 3), (5, 6), (6, 6); +insert into t2 values (1, 1), (2, 1), (3, 3), (4, 6), (5, 6); +insert into t3 values (1), (2), (3), (4), (5); +select t1.x, t3.x from t1, t2, t3 where t1.x = t2.x and t3.x >= t1.y and t3.x <= t2.y; +x x +1 1 +2 1 +3 1 +3 2 +3 3 +4 3 +4 4 +4 5 +drop table t1,t2,t3; +create table t1 (id char(16) not null default '', primary key (id)); +insert into t1 values ('100'),('101'),('102'); +create table t2 (id char(16) default null); +insert into t2 values (1); +create view v1 as select t1.id from t1; +create view v2 as select t2.id from t2; +create view v3 as select (t1.id+2) as id from t1 natural left join t2; +select t1.id from t1 left join v2 using (id); +id +100 +101 +102 +select t1.id from v2 right join t1 using (id); +id +100 +101 +102 +select t1.id from t1 left join v3 using (id); +id +100 +101 +102 +select * from t1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join t1 using (id); +id +100 +101 +102 +select * from t1 left join v3 using (id); +id +100 +101 +102 +select v1.id from v1 left join v2 using (id); +id +100 +101 +102 +select v1.id from v2 right join v1 using (id); +id +100 +101 +102 +select v1.id from v1 left join v3 using (id); +id +100 +101 +102 +select * from v1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join v1 using (id); +id +100 +101 +102 +select * from v1 left join v3 using (id); +id +100 +101 +102 +drop table t1, t2; +drop view v1, v2, v3; +create table t1 (id int(11) not null default '0'); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (123),(191),(192); +create table t2 (id char(16) character set utf8 not null); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t2 values ('58013'),('58014'),('58015'),('58016'); +create table t3 (a_id int(11) not null, b_id char(16) character set utf8); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t3 values (123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013'); +select count(*) +from t1 inner join (t3 left join t2 on t2.id = t3.b_id) on t1.id = t3.a_id; +count(*) +6 +select count(*) +from t1 inner join (t2 right join t3 on t2.id = t3.b_id) on t1.id = t3.a_id; +count(*) +6 +drop table t1,t2,t3; +create table t1 (a int); +create table t2 (b int); +create table t3 (c int); +select * from t1 join t2 join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 left join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 right join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 straight_join t3 on (t1.a=t3.c); +a b c +drop table t1, t2 ,t3; +create table t1(f1 int, f2 date); +insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'), +(4,'2005-10-01'),(5,'2005-12-30'); +select * from t1 where f2 >= 0 order by f2; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +select * from t1 where f2 >= '0000-00-00' order by f2; +ERROR HY000: Incorrect DATE value: '0000-00-00' +select * from t1 where f2 >= '2005-09-31' order by f2; +ERROR HY000: Incorrect DATE value: '2005-09-31' +select * from t1 where f2 >= '2005-09-3a' order by f2; +f1 f2 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +select * from t1 where f2 <= '2005-09-31' order by f2; +ERROR HY000: Incorrect DATE value: '2005-09-31' +select * from t1 where f2 <= '2005-09-3a' order by f2; +f1 f2 +1 2005-01-01 +2 2005-09-01 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +drop table t1; +create table t1 (f1 int, f2 int); +insert into t1 values (1, 30), (2, 20), (3, 10); +create algorithm=merge view v1 as select f1, f2 from t1; +create algorithm=merge view v2 (f2, f1) as select f1, f2 from t1; +create algorithm=merge view v3 as select t1.f1 as f2, t1.f2 as f1 from t1; +select t1.f1 as x1, f1 from t1 order by t1.f1; +x1 f1 +1 1 +2 2 +3 3 +select v1.f1 as x1, f1 from v1 order by v1.f1; +x1 f1 +1 1 +2 2 +3 3 +select v2.f1 as x1, f1 from v2 order by v2.f1; +x1 f1 +10 10 +20 20 +30 30 +select v3.f1 as x1, f1 from v3 order by v3.f1; +x1 f1 +10 10 +20 20 +30 30 +select f1, f2, v1.f1 as x1 from v1 order by v1.f1; +f1 f2 x1 +1 30 1 +2 20 2 +3 10 3 +select f1, f2, v2.f1 as x1 from v2 order by v2.f1; +f1 f2 x1 +10 3 10 +20 2 20 +30 1 30 +select f1, f2, v3.f1 as x1 from v3 order by v3.f1; +f1 f2 x1 +10 3 10 +20 2 20 +30 1 30 +drop table t1; +drop view v1, v2, v3; +CREATE TABLE t1(key_a int4 NOT NULL, optimus varchar(32), PRIMARY KEY(key_a)); +CREATE TABLE t2(key_a int4 NOT NULL, prime varchar(32), PRIMARY KEY(key_a)); +CREATE table t3(key_a int4 NOT NULL, key_b int4 NOT NULL, foo varchar(32), +PRIMARY KEY(key_a,key_b)); +INSERT INTO t1 VALUES (0,''); +INSERT INTO t1 VALUES (1,'i'); +INSERT INTO t1 VALUES (2,'j'); +INSERT INTO t1 VALUES (3,'k'); +INSERT INTO t2 VALUES (1,'r'); +INSERT INTO t2 VALUES (2,'s'); +INSERT INTO t2 VALUES (3,'t'); +INSERT INTO t3 VALUES (1,5,'x'); +INSERT INTO t3 VALUES (1,6,'y'); +INSERT INTO t3 VALUES (2,5,'xx'); +INSERT INTO t3 VALUES (2,6,'yy'); +INSERT INTO t3 VALUES (2,7,'zz'); +INSERT INTO t3 VALUES (3,5,'xxx'); +SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +key_a foo +2 xx +EXPLAIN SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t3 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `key_a`,'xx' AS `foo` from `test`.`t1` join `test`.`t2` join `test`.`t3` where true +SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +key_a foo +2 xx +EXPLAIN SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t3 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `key_a`,'xx' AS `foo` from `test`.`t1` join `test`.`t2` join `test`.`t3` where true +DROP TABLE t1,t2,t3; +create table t1 (f1 int); +insert into t1 values(1),(2); +create table t2 (f2 int, f3 int, key(f2)); +insert into t2 values(1,1),(2,2); +create table t3 (f4 int not null); +insert into t3 values (2),(2),(2); +select f1,(select count(*) from t2,t3 where f2=f1 and f3=f4) as count from t1; +f1 count +1 0 +2 3 +drop table t1,t2,t3; +create table t1 (f1 int unique); +create table t2 (f2 int unique); +create table t3 (f3 int unique); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +insert into t3 values(1),(NULL); +select * from t3 where f3 is null; +f3 +NULL +select t2.f2 from t1 left join t2 on f1=f2 join t3 on f1=f3 where f1=1; +f2 +1 +drop table t1,t2,t3; +create table t1(f1 char, f2 char not null); +insert into t1 values(null,'a'); +create table t2 (f2 char not null); +insert into t2 values('b'); +select * from t1 left join t2 on f1=t2.f2 where t1.f2='a'; +f1 f2 f2 +NULL a NULL +drop table t1,t2; +select * from (select * left join t on f1=f2) tt; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left join t on f1=f2) tt' at line 1 +CREATE TABLE t1 (sku int PRIMARY KEY, pr int); +CREATE TABLE t2 (sku int PRIMARY KEY, sppr int, name varchar(255)); +INSERT INTO t1 VALUES +(10, 10), (20, 10), (30, 20), (40, 30), (50, 10), (60, 10); +INSERT INTO t2 VALUES +(10, 10, 'aaa'), (20, 10, 'bbb'), (30, 10, 'ccc'), (40, 20, 'ddd'), +(50, 10, 'eee'), (60, 20, 'fff'), (70, 20, 'ggg'), (80, 30, 'hhh'); +SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr +FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku); +sku sppr name sku pr +20 10 bbb 10 10 +20 10 bbb 20 10 +EXPLAIN +SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr +FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select '20' AS `sku`,'10' AS `sppr`,'bbb' AS `name`,`test`.`t1`.`sku` AS `sku`,`test`.`t1`.`pr` AS `pr` from `test`.`t2` join `test`.`t1` where (((`test`.`t1`.`sku` = 20) or (`test`.`t1`.`sku` = '10'))) +DROP TABLE t1,t2; +SET SQL_MODE='NO_UNSIGNED_SUBTRACTION'; +CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL); +INSERT t1 SET i = 0; +UPDATE t1 SET i = -1; +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +UPDATE t1 SET i = CAST(i - 1 AS SIGNED); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +UPDATE t1 SET i = i - 1; +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +DROP TABLE t1; +SET SQL_MODE=default; +create table t1 (a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t2 (a int, b int, c int, e int, primary key(a,b,c)); +# The "ANALYZE TABLE"-command that is executed further down will get +# different results depending on the order of rows in table t2. Since the +# INSERT INTO ... SELECT may be executed using different execution plans, +# we've added ORDER BY to ensure that we rows has the same order every +# time. If not, the estimated number of rows for t2 (alias 'a') in the +# EXPLAIN may change on different platforms. Note that both table t1 and +# t2 may be MYISAM, since many of the test files that includes this file +# forces MYISAM as the default storage engine. +insert into t2 select A.a, B.a, C.a, C.a from t1 A, t1 B, t1 C +ORDER BY A.a, B.a, C.a; +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select 'In next EXPLAIN, B.rows must be exactly 10:' Z; +Z +In next EXPLAIN, B.rows must be exactly 10: +explain select * from t2 a, t2 b where a.a=5 and a.b=5 and a.c<5 +and b.a=5 and b.b=a.e and (b.b =1 or b.b = 3 or b.b=5); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 27.10 Parallel execute (1 workers) +2 SIMPLE a NULL range PRIMARY PRIMARY 12 NULL 5 27.10 Using where +2 SIMPLE b NULL ref PRIMARY PRIMARY 8 const,test.a.e 10 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`b` AS `b`,`test`.`a`.`c` AS `c`,`test`.`a`.`e` AS `e`,`test`.`b`.`a` AS `a`,`test`.`b`.`b` AS `b`,`test`.`b`.`c` AS `c`,`test`.`b`.`e` AS `e` from `test`.`t2` `a` join `test`.`t2` `b` where ((`test`.`b`.`b` = `test`.`a`.`e`) and (`test`.`b`.`a` = 5) and (`test`.`a`.`b` = 5) and (`test`.`a`.`a` = 5) and (`test`.`a`.`c` < 5) and ((`test`.`a`.`e` = 1) or (`test`.`a`.`e` = 3) or (`test`.`a`.`e` = 5))) +drop table t1, t2; +CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX(b)); +INSERT INTO t1 VALUES (1, 3), (9,4), (7,5), (4,5), (6,2), +(3,1), (5,1), (8,9), (2,2), (0,9); +CREATE TABLE t2 (c int, d int, f int, INDEX(c,f)); +INSERT INTO t2 VALUES +(1,0,0), (1,0,1), (2,0,0), (2,0,1), (3,0,0), (4,0,1), +(5,0,0), (5,0,1), (6,0,0), (0,0,1), (7,0,0), (7,0,1), +(0,0,0), (0,0,1), (8,0,0), (8,0,1), (9,0,0), (9,0,1); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,b b 5 NULL 3 100.00 Using where; Using index +2 SIMPLE t2 NULL ref c c 5 test.t1.a 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2`.`f` AS `f` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` between 4 and 6)) +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6 AND a > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 90.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,b b 9 NULL 3 90.00 Using where; Using index +2 SIMPLE t2 NULL ref c c 5 test.t1.a 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2`.`f` AS `f` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` between 4 and 6) and (`test`.`t1`.`a` > 0)) +DROP TABLE t1, t2; +create table t1 ( +a int unsigned not null auto_increment primary key, +b bit not null, +c bit not null +); +create table t2 ( +a int unsigned not null auto_increment primary key, +b bit not null, +c int unsigned not null, +d varchar(50) +); +insert into t1 (b,c) values (0,1), (0,1); +insert into t2 (b,c) values (0,1); +select t1.a, t1.b + 0, t1.c + 0, t2.a, t2.b + 0, t2.c, t2.d +from t1 left outer join t2 on t1.a = t2.c and t2.b <> 1 +where t1.b <> 1 order by t1.a; +a t1.b + 0 t1.c + 0 a t2.b + 0 c d +1 0 1 1 0 1 NULL +2 0 1 NULL NULL NULL NULL +drop table t1,t2; +SELECT 0.9888889889 * 1.011111411911; +0.9888889889 * 1.011111411911 +0.9998769417899202067879 +prepare stmt from 'select 1 as " a "'; +Warnings: +Warning 1466 Leading spaces are removed from name ' a ' +execute stmt; +a +1 +CREATE TABLE t1 (a int NOT NULL PRIMARY KEY, b int NOT NULL); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +CREATE TABLE t2 (c int NOT NULL, INDEX idx(c)); +INSERT INTO t2 VALUES +(1), (1), (1), (1), (1), (1), (1), (1), +(2), (2), (2), (2), +(3), (3), +(4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL ref idx idx 4 const 8 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '1' AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = '1')) +EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=4; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL ref idx idx 4 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '4' AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = '4')) +DROP TABLE t1, t2; +CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a int); +INSERT INTO t1 VALUES (1,2), (2,NULL), (3,2); +CREATE TABLE t2 (b int, c INT, INDEX idx1(b)); +INSERT INTO t2 VALUES (2,1), (3,2); +CREATE TABLE t3 (d int, e int, INDEX idx1(d)); +INSERT INTO t3 VALUES (2,10), (2,20), (1,30), (2,40), (2,50); +EXPLAIN +SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id +WHERE t1.id=2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL const idx1 NULL NULL NULL 1 100.00 Impossible ON condition +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL const idx1 NULL NULL NULL 1 100.00 Impossible ON condition +2 SIMPLE t3 NULL ref idx1 idx1 5 const 4 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `id`,NULL AS `a`,NULL AS `b`,NULL AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t3`.`e` AS `e` from `test`.`t1` left join `test`.`t2` on(multiple equal(NULL, NULL)) join `test`.`t3` where (`test`.`t3`.`d` = 2) +SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id +WHERE t1.id=2; +id a b c d e +2 NULL NULL NULL 2 10 +2 NULL NULL NULL 2 20 +2 NULL NULL NULL 2 40 +2 NULL NULL NULL 2 50 +DROP TABLE t1,t2,t3; +create table t1 (c1 varchar(1), c2 int, c3 int, c4 int, c5 int, c6 int, +c7 int, c8 int, c9 int, fulltext key (`c1`)); +select distinct match (`c1`) against ('z') , c2, c3, c4,c5, c6,c7, c8 +from t1 where c9=1 order by c2, c2; +match (`c1`) against ('z') c2 c3 c4 c5 c6 c7 c8 +drop table t1; +CREATE TABLE t1 (pk varchar(10) PRIMARY KEY, fk varchar(16)) charset utf8mb4; +CREATE TABLE t2 (pk varchar(16) PRIMARY KEY, fk varchar(10)) charset utf8mb4; +INSERT INTO t1 VALUES +('d','dddd'), ('i','iii'), ('a','aa'), ('b','bb'), ('g','gg'), +('e','eee'), ('c','cccc'), ('h','hhh'), ('j','jjj'), ('f','fff'); +INSERT INTO t2 VALUES +('jjj', 'j'), ('cc','c'), ('ccc','c'), ('aaa', 'a'), ('jjjj','j'), +('hhh','h'), ('gg','g'), ('fff','f'), ('ee','e'), ('ffff','f'), +('bbb','b'), ('ff','f'), ('cccc','c'), ('dddd','d'), ('jj','j'), +('aaaa','a'), ('bb','b'), ('eeee','e'), ('aa','a'), ('hh','h'); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk < 'c' AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` < 'c')) +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk BETWEEN 'a' AND 'b' AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` between 'a' and 'b')) +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk IN ('a','b') AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` in ('a','b'))) +DROP TABLE t1,t2; +CREATE TABLE t1 (a int, b varchar(20) NOT NULL, PRIMARY KEY(a)) charset utf8mb4; +CREATE TABLE t2 (a int, b varchar(20) NOT NULL, +PRIMARY KEY (a), UNIQUE KEY (b)) charset utf8mb4; +INSERT INTO t1 VALUES (1,'a'),(2,'b'),(3,'c'); +INSERT INTO t2 VALUES (1,'a'),(2,'b'),(3,'c'); +EXPLAIN SELECT t1.a FROM t1 LEFT JOIN t2 ON t2.b=t1.b WHERE t1.a=3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL const b b 82 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '3' AS `a` from `test`.`t1` left join `test`.`t2` on(multiple equal('c', 'c')) where true +DROP TABLE t1,t2; +CREATE TABLE t1(id int PRIMARY KEY, b int, e int); +CREATE TABLE t2(i int, a int, INDEX si(i), INDEX ai(a)); +CREATE TABLE t3(a int PRIMARY KEY, c char(4), INDEX ci(c)); +INSERT INTO t1 VALUES +(1,10,19), (2,20,22), (4,41,42), (9,93,95), (7, 77,79), +(6,63,67), (5,55,58), (3,38,39), (8,81,89); +INSERT INTO t2 VALUES +(21,210), (41,410), (82,820), (83,830), (84,840), +(65,650), (51,510), (37,370), (94,940), (76,760), +(22,220), (33,330), (40,400), (95,950), (38,380), +(67,670), (88,880), (57,570), (96,960), (97,970); +INSERT INTO t3 VALUES +(210,'bb'), (950,'ii'), (400,'ab'), (500,'ee'), (220,'gg'), +(440,'gg'), (310,'eg'), (380,'ee'), (840,'bb'), (830,'ff'), +(230,'aa'), (960,'ii'), (410,'aa'), (510,'ee'), (290,'bb'), +(450,'gg'), (320,'dd'), (390,'hh'), (850,'jj'), (860,'ff'); +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 +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si si 5 NULL 4 100.00 Using where +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` FORCE INDEX (`si`) join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t2`.`i` between '81' and '89') and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2,t3 +WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee') ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si,ai si 5 NULL 4 100.00 Using where +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t2`.`i` between '81' and '89') and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND +t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si si 5 NULL 2 100.00 Using where +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` FORCE INDEX (`si`) join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((`test`.`t2`.`i` = '81') or (`test`.`t2`.`i` = '89')) and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2,t3 +WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND +t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si,ai si 5 NULL 2 100.00 Using where +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((`test`.`t2`.`i` = '81') or (`test`.`t2`.`i` = '89')) and (`test`.`t3`.`c` in ('bb','ee'))) +DROP TABLE t1,t2,t3; +CREATE TABLE t1 ( f1 int primary key, f2 int, f3 int, f4 int, f5 int, f6 int, checked_out int); +CREATE TABLE t2 ( f11 int PRIMARY KEY ); +INSERT INTO t1 VALUES (1,1,1,0,0,0,0),(2,1,1,3,8,1,0),(3,1,1,4,12,1,0); +INSERT INTO t2 VALUES (62); +SELECT * FROM t1 LEFT JOIN t2 ON f11 = t1.checked_out GROUP BY f1 ORDER BY f2, f3, f4, f5 LIMIT 0, 1; +f1 f2 f3 f4 f5 f6 checked_out f11 +1 1 1 0 0 0 0 NULL +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(a int); +INSERT into t1 values (1), (2), (3); +SELECT * FROM t1 LIMIT 2, -1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1 +DROP TABLE t1; +set optimizer_switch='index_merge=off'; +CREATE TABLE t1 ( +ID_with_null int NULL, +ID_better int NOT NULL, +INDEX idx1 (ID_with_null), +INDEX idx2 (ID_better) +); +INSERT INTO t1 VALUES (1,1), (2,1), (null,3), (null,3), (null,3), (null,3); +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SELECT COUNT(*) FROM t1 WHERE ID_with_null IS NULL; +COUNT(*) +128 +SELECT COUNT(*) FROM t1 WHERE ID_better=1; +COUNT(*) +2 +EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 98.46 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 98.46 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID_with_null` AS `ID_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID_with_null` is null)) +DROP INDEX idx1 ON t1; +CREATE UNIQUE INDEX idx1 ON t1(ID_with_null); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 98.46 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 98.46 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID_with_null` AS `ID_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID_with_null` is null)) +DROP TABLE t1; +CREATE TABLE t1 ( +ID1_with_null int NULL, +ID2_with_null int NULL, +ID_better int NOT NULL, +INDEX idx1 (ID1_with_null, ID2_with_null), +INDEX idx2 (ID_better) +) ; +INSERT INTO t1 VALUES (1,1,1), (2,2,1), (3,null,3), (null,3,3), (null,null,3), +(3,null,3), (null,3,3), (null,null,3), (3,null,3), (null,3,3), (null,null,3); +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null=3; +COUNT(*) +24 +SELECT COUNT(*) FROM t1 WHERE ID1_with_null=3 AND ID2_with_null IS NULL; +COUNT(*) +24 +SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null IS NULL; +COUNT(*) +192 +SELECT COUNT(*) FROM t1 WHERE ID_better=1; +COUNT(*) +2 +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID2_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID1_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and ((`test`.`t1`.`ID2_with_null` = 3) is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 79.34 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 79.34 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and (`test`.`t1`.`ID2_with_null` is null)) +DROP INDEX idx1 ON t1; +CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID2_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null IS NULL ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID1_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID2_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 79.34 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 79.34 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and (`test`.`t1`.`ID2_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND +(ID2_with_null=1 OR ID2_with_null=2); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 2.50 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 2.50 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and ((`test`.`t1`.`ID2_with_null` = 1) or (`test`.`t1`.`ID2_with_null` = 2))) +DROP TABLE t1; +set optimizer_switch='index_merge=on'; +CREATE TABLE t1 (a INT, ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY ts(ts)); +INSERT INTO t1 VALUES (30,"2006-01-03 23:00:00"), (31,"2006-01-03 23:00:00"); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CREATE TABLE t2 (a INT, dt1 DATETIME, dt2 DATETIME, PRIMARY KEY (a)); +INSERT INTO t2 VALUES (30, "2006-01-01 00:00:00", "2999-12-31 00:00:00"); +INSERT INTO t2 SELECT a+1,dt1,dt2 FROM t2; +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +EXPLAIN +SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 +AND t1.ts BETWEEN t2.dt1 AND t2.dt2 +AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t1 NULL range ts ts 4 NULL 2 50.00 Using where +Warnings: +Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`ts` AS `ts`,'30' AS `a`,'2006-01-01 00:00:00' AS `dt1`,'2999-12-31 00:00:00' AS `dt2` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = 30) and (`test`.`t1`.`ts` between '2006-01-01 00:00:00' and '2999-12-31 00:00:00') and (`test`.`t1`.`ts` between '2006-01-01' and '2006-12-31')) +SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 +AND t1.ts BETWEEN t2.dt1 AND t2.dt2 +AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; +a ts a dt1 dt2 +30 2006-01-03 23:00:00 30 2006-01-01 00:00:00 2999-12-31 00:00:00 +Warnings: +Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 +DROP TABLE t1,t2; +create table t1 (a bigint unsigned); +insert into t1 values +(if(1, 9223372036854775808, 1)), +(case when 1 then 9223372036854775808 else 1 end), +(coalesce(9223372036854775808, 1)); +select * from t1; +a +9223372036854775808 +9223372036854775808 +9223372036854775808 +drop table t1; +create table t1 charset utf8mb4 select +if(1, 9223372036854775808, 1) i, +case when 1 then 9223372036854775808 else 1 end c, +coalesce(9223372036854775808, 1) co; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` decimal(19,0) NOT NULL DEFAULT '0', + `c` decimal(19,0) NOT NULL DEFAULT '0', + `co` decimal(19,0) NOT NULL DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +select +if(1, cast(1111111111111111111 as unsigned), 1) i, +case when 1 then cast(1111111111111111111 as unsigned) else 1 end c, +coalesce(cast(1111111111111111111 as unsigned), 1) co; +i c co +1111111111111111111 1111111111111111111 1111111111111111111 +CREATE TABLE t1 (name varchar(255)) charset latin1; +CREATE TABLE t2 (name varchar(255), n int, KEY (name(3))) charset latin1; +INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); +INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); +INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); +INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT * FROM t2; +name n +bb 1 +aa 2 +cc 3 +cc  4 +cc 5 +bb 6 +cc 7 +SELECT * FROM t2 ORDER BY name; +name n +aa 2 +bb 1 +bb 6 +cc  4 +cc 3 +cc 5 +cc 7 +SELECT name, LENGTH(name), n FROM t2 ORDER BY name; +name LENGTH(name) n +aa 2 2 +bb 2 1 +bb 3 6 +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref name name 6 const 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` = 'cc ') +SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +name LENGTH(name) n +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +name LENGTH(name) n +cc 5 3 +cc  4 4 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') order by `test`.`t2`.`name` +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +name LENGTH(name) n +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +2 SIMPLE t2 NULL ref name name 6 test.t1.name 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`name` AS `name`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`n` AS `n` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`name` = `test`.`t1`.`name`)) where true +SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +name name n +aa aa 2 +aa aa 2 +bb bb 1 +bb bb 6 +cc cc 5 +cc cc 7 +cc cc 3 +ccc NULL NULL +DROP TABLE t1,t2; +CREATE TABLE t1 (name text) charset latin1; +CREATE TABLE t2 (name text, n int, KEY (name(3))) charset latin1; +INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); +INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); +INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); +INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT * FROM t2; +name n +bb 1 +aa 2 +cc 3 +cc  4 +cc 5 +bb 6 +cc 7 +SELECT * FROM t2 ORDER BY name; +name n +aa 2 +bb 1 +bb 6 +cc  4 +cc 3 +cc 5 +cc 7 +SELECT name, LENGTH(name), n FROM t2 ORDER BY name; +name LENGTH(name) n +aa 2 2 +bb 2 1 +bb 3 6 +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ref name name 6 const 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` = 'cc ') +SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +name LENGTH(name) n +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +name LENGTH(name) n +cc 5 3 +cc  4 4 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') order by `test`.`t2`.`name` +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +name LENGTH(name) n +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref name name 6 test.t1.name 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`name` AS `name`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`n` AS `n` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`name` = `test`.`t1`.`name`)) where true +SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +name name n +aa aa 2 +aa aa 2 +bb bb 1 +bb bb 6 +cc cc 5 +cc cc 7 +cc cc 3 +ccc NULL NULL +DROP TABLE t1,t2; +CREATE TABLE t1 ( +access_id int NOT NULL default '0', +name varchar(20) default NULL, +`rank` int NOT NULL default '0', +KEY idx (access_id) +); +CREATE TABLE t2 ( +faq_group_id int NOT NULL default '0', +faq_id int NOT NULL default '0', +access_id int default NULL, +UNIQUE KEY idx1 (faq_id), +KEY idx2 (faq_group_id,faq_id) +); +INSERT INTO t1 VALUES +(1,'Everyone',2),(2,'Help',3),(3,'Technical Support',1),(4,'Chat User',4); +INSERT INTO t2 VALUES +(261,265,1),(490,494,1); +SELECT t2.faq_id +FROM t1 INNER JOIN t2 IGNORE INDEX (idx1) +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +SELECT t2.faq_id +FROM t1 INNER JOIN t2 +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +DROP TABLE t1,t2; +CREATE TABLE t1 (a INT, b INT, KEY inx (b,a)); +INSERT INTO t1 VALUES (1,1), (1,2), (1,3), (1,4), (1,5), (1, 6), (1,7); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT COUNT(*) FROM t1 f1 INNER JOIN t1 f2 +ON ( f1.b=f2.b AND f1.a NULL ALL NULL NULL NULL NULL 7 100.00 Parallel execute (1 workers) +2 SIMPLE f1 NULL index inx inx 10 NULL 7 100.00 Using where; Using index +2 SIMPLE f2 NULL ref inx inx 5 test.f1.b 1 33.33 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` `f1` join `test`.`t1` `f2` where ((`test`.`f2`.`b` = `test`.`f1`.`b`) and (`test`.`f1`.`b` not in (100,2232,3343,51111)) and (`test`.`f1`.`a` < `test`.`f2`.`a`)) +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 INT); +INSERT INTO t1 VALUES (1,11), (2,22), (2,22); +EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2)))))))))))))))))))))))))))))) > 0; +EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) > 0; +ERROR HY000: Too high level of nesting for select +DROP TABLE t1; +CREATE TABLE t1 ( +c1 int(11) NOT NULL AUTO_INCREMENT, +c2 varchar(1000) DEFAULT NULL, +c3 bigint(20) DEFAULT NULL, +c4 bigint(20) DEFAULT NULL, +PRIMARY KEY (c1) +) charset utf8mb4; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN +SELECT join_2.c1 +FROM +t1 AS join_0, +t1 AS join_1, +t1 AS join_2, +t1 AS join_3, +t1 AS join_4, +t1 AS join_5, +t1 AS join_6, +t1 AS join_7 +WHERE +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +OR +join_0.c2 < '?' AND +join_1.c2 < '?' AND +join_2.c2 > '?' AND +join_2.c2 < '!' AND +join_3.c2 > '?' AND +join_4.c2 = '?' AND +join_5.c2 <> '?' AND +join_6.c2 <> '?' AND +join_7.c2 >= '?' AND +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +GROUP BY +join_3.c1, +join_2.c1, +join_7.c1, +join_1.c1, +join_0.c1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL # 1 100.00 # +2 SIMPLE join_0 NULL ALL PRIMARY NULL NULL # 1 100.00 # +2 SIMPLE join_1 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_2 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_3 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_4 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_5 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_6 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_7 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +Warnings: +Note 1003 /* select#1 */ select `test`.`join_2`.`c1` AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where (((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`)) or ((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c2` = '?') and (`test`.`join_0`.`c2` < '?') and (`test`.`join_1`.`c2` < '?') and (`test`.`join_2`.`c2` > '?') and (`test`.`join_2`.`c2` < '!') and (`test`.`join_3`.`c2` > '?') and (`test`.`join_5`.`c2` <> '?') and (`test`.`join_6`.`c2` <> '?') and (`test`.`join_7`.`c2` >= '?'))) group by `test`.`join_3`.`c1`,`test`.`join_2`.`c1`,`test`.`join_7`.`c1`,`test`.`join_1`.`c1`,`test`.`join_0`.`c1` +SHOW WARNINGS; +Level Code Message +Note 1003 /* select#1 */ select `test`.`join_2`.`c1` AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where (((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`)) or ((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c2` = '?') and (`test`.`join_0`.`c2` < '?') and (`test`.`join_1`.`c2` < '?') and (`test`.`join_2`.`c2` > '?') and (`test`.`join_2`.`c2` < '!') and (`test`.`join_3`.`c2` > '?') and (`test`.`join_5`.`c2` <> '?') and (`test`.`join_6`.`c2` <> '?') and (`test`.`join_7`.`c2` >= '?'))) group by `test`.`join_3`.`c1`,`test`.`join_2`.`c1`,`test`.`join_7`.`c1`,`test`.`join_1`.`c1`,`test`.`join_0`.`c1` +DROP TABLE t1; +SELECT 1 AS ` `; + +1 +Warnings: +Warning 1474 Name ' ' has become '' +SELECT 1 AS ` `; + +1 +Warnings: +Warning 1474 Name ' ' has become '' +SELECT 1 AS ` x`; +x +1 +Warnings: +Warning 1466 Leading spaces are removed from name ' x' +CREATE VIEW v1 AS SELECT 1 AS ``; +ERROR 42000: Incorrect column name '' +CREATE VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT (SELECT 1 AS ` `); +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` x`; +Warnings: +Warning 1466 Leading spaces are removed from name ' x' +SELECT `x` FROM v1; +x +1 +ALTER VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +DROP VIEW v1; +select str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' + and '2007/10/20 00:00:00 GMT'; +str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' + and '2007/10/20 00:00:00 GMT' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT' +Warning 1292 Truncated incorrect date value: '2007/10/20 00:00:00 GMT' +select str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6'; +str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT-6' +select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6'; +ERROR HY000: Incorrect DATE value: '2007/10/2000:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007-10-1 00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007-10-01 x00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:x00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 x12:34:56 GMT-6' +select str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; +str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6' +select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; +str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' +0 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6' +select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56'; +str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56' +1 +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00' +0 +select str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00' +1 +select str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34' +select str_to_date('2007-02-30 12:34','%Y-%m-%d %H:%i') = '2007-02-30 12:34:00'; +ERROR HY000: Incorrect DATETIME value: '2007-02-30 12:34:00' +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00' + and '2007/10/20 00:00:00'; +str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00' + and '2007/10/20 00:00:00' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +set SQL_MODE=TRADITIONAL; +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00 12:34' for function str_to_date +select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01' + and '2007/10/20'; +str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01' + and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +set SQL_MODE=DEFAULT; +select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'; +str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +select str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20'; +str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '' for function str_to_date +select str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '' for function str_to_date +select str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = ''; +ERROR HY000: Incorrect DATETIME value: '' +select str_to_date('1','%Y-%m-%d') = '1'; +ERROR HY000: Incorrect DATE value: '1' +select str_to_date('1','%Y-%m-%d') = '1'; +ERROR HY000: Incorrect DATE value: '1' +select str_to_date('','%Y-%m-%d') = ''; +ERROR HY000: Incorrect DATE value: '' +select str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL; +str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL +0 +Warnings: +Warning 1292 Truncated incorrect date value: '0000-00-00' +select str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00'; +str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00' +NULL +Warnings: +Warning 1292 Truncated incorrect date value: '2000-00-00' +select str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL; +str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL +0 +CREATE TABLE t1 (c11 INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY); +CREATE TABLE t2 (c21 INT UNSIGNED NOT NULL, +c22 INT DEFAULT NULL, +KEY(c21, c22)); +CREATE TABLE t3 (c31 INT UNSIGNED NOT NULL DEFAULT 0, +c32 INT DEFAULT NULL, +c33 INT NOT NULL, +c34 INT UNSIGNED DEFAULT 0, +KEY (c33, c34, c32)); +INSERT INTO t1 values (),(),(),(),(); +INSERT INTO t2 SELECT a.c11, b.c11 FROM t1 a, t1 b; +INSERT INTO t3 VALUES (1, 1, 1, 0), +(2, 2, 0, 0), +(3, 3, 1, 0), +(4, 4, 0, 0), +(5, 5, 1, 0); +SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND +t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND +t3.c33 = 1 AND t2.c22 in (1, 3) +ORDER BY c32; +c32 +1 +1 +3 +3 +5 +5 +SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND +t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND +t3.c33 = 1 AND t2.c22 in (1, 3) +ORDER BY c32 DESC; +c32 +5 +5 +3 +3 +1 +1 +DROP TABLE t1, t2, t3; + +# +# Bug#30736: Row Size Too Large Error Creating a Table and +# Inserting Data. +# +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; + +CREATE TABLE t1( +c1 DECIMAL(10, 2), +c2 FLOAT); + +INSERT INTO t1 VALUES (0, 1), (2, 3), (4, 5); + +CREATE TABLE t2( +c3 DECIMAL(10, 2)) +SELECT +c1 * c2 AS c3 +FROM t1; + +SELECT * FROM t1; +c1 c2 +0.00 1 +2.00 3 +4.00 5 + +SELECT * FROM t2; +c3 +0.00 +6.00 +20.00 + +DROP TABLE t1; +DROP TABLE t2; + +CREATE TABLE t1 (c1 BIGINT NOT NULL); +INSERT INTO t1 (c1) VALUES (1); +SELECT * FROM t1 WHERE c1 > NULL + 1; +c1 +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10) NOT NULL PRIMARY KEY); +INSERT INTO t1 (a) VALUES ('foo0'), ('bar0'), ('baz0'); +SELECT * FROM t1 WHERE a IN (CONCAT('foo', 0), 'bar'); +a +foo0 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +CREATE TABLE t2 (a INT, c INT, KEY(a)); +INSERT INTO t1 VALUES (1, 1), (2, 2); +INSERT INTO t2 VALUES (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), +(2, 1), (2, 2), (2, 3), (2, 4), (2, 5), +(3, 1), (3, 2), (3, 3), (3, 4), (3, 5), +(4, 1), (4, 2), (4, 3), (4, 4), (4, 5); +FLUSH STATUS; +SELECT DISTINCT b FROM t1 LEFT JOIN t2 USING(a) WHERE c <= 3; +b +1 +2 +SHOW STATUS LIKE 'Handler_read%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 3 +Handler_read_last 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 6 +DROP TABLE t1, t2; +CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0', +f2 int(11) NOT NULL default '0', +f3 bigint(20) NOT NULL default '0', +f4 varchar(255) NOT NULL default '', +PRIMARY KEY (f1), +KEY key1 (f4), +KEY key2 (f2)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t2 (f1 int(11) NOT NULL default '0', +f2 enum('A1','A2','A3') NOT NULL default 'A1', +f3 int(11) NOT NULL default '0', +PRIMARY KEY (f1), +KEY key1 (f3)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0', +f2 datetime NOT NULL default '1980-01-01 00:00:00', +PRIMARY KEY (f1)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1, 1, 1, 'abc'); +insert into t1 values (2, 1, 2, 'def'); +insert into t1 values (3, 1, 2, 'def'); +insert into t2 values (1, 'A1', 1); +insert into t3 values (1, '1980-01-01'); +SELECT a.f3, cr.f4, count(*) count +FROM t2 a +STRAIGHT_JOIN t1 cr ON cr.f2 = a.f1 +LEFT JOIN +(t1 cr2 +JOIN t3 ae2 ON cr2.f3 = ae2.f1 +) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND +cr.f4 = cr2.f4 +GROUP BY a.f3, cr.f4; +f3 f4 count +1 abc 1 +1 def 2 +drop table t1, t2, t3; +CREATE TABLE t1 (a INT KEY, b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a, b FROM t1 WHERE a > 1 AND a = b LIMIT 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 25.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 3 25.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 SELECT a, b FROM t1 WHERE a > 1 AND b = a LIMIT 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 25.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 3 25.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` > 1)) limit 2 +DROP TABLE t1; +# +# Bug#47019: Assertion failed: 0, file .\rt_mbr.c, line 138 when +# forcing a spatial index +# +CREATE TABLE t1(a LINESTRING NOT NULL SRID 0, SPATIAL KEY(a)); +INSERT INTO t1 VALUES +(ST_GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')), +(ST_GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')); +EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t2 NULL ALL a NULL NULL NULL 2 100.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; +1 +1 +1 +1 +1 +EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t2 NULL ALL a NULL NULL NULL 2 100.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` FORCE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); +1 +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug #48291 : crash with row() operator,select into @var, and +# subquery returning multiple rows +# +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (2),(3); +# Should not crash +SELECT 1 FROM t1 WHERE a <> 1 AND NOT +ROW(1,a) <=> ROW(1,(SELECT 1 FROM t1)) +INTO @var0; +ERROR 21000: Subquery returns more than 1 row +DROP TABLE t1; +# +# Bug #48458: simple query tries to allocate enormous amount of +# memory +# +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1(a INT NOT NULL, b YEAR); +INSERT INTO t1 VALUES (); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +CREATE TABLE t2(c INT); +# Should not err out because of out-of-memory +SELECT 1 FROM t2 JOIN t1 ON 1=1 +WHERE a != '1' AND NOT a >= b OR NOT ROW(b,a )<> ROW(a,a); +1 +DROP TABLE t1,t2; +SET sql_mode = default; +# +# Bug #49199: Optimizer handles incorrectly: +# field='const1' AND field='const2' in some cases + +CREATE TABLE t1(a DATETIME NOT NULL); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 00:00:00 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +DROP TABLE t1; +CREATE TABLE t1(a DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2001-01-01') +DROP TABLE t1; +CREATE TABLE t1(a TIMESTAMP NOT NULL NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 00:00:00 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +a b +2001-01-01 00:00:00 2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = DATE'2001-01-01') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b VARCHAR(20) NOT NULL) charset utf8mb4; +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +a b +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = '2001-01-01 00:00:00') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01'; +a b +2001-01-01 00:00:00 2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = '2001-01-01') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT x.a, y.a, z.a FROM t1 x +JOIN t1 y ON x.a=y.a +JOIN t1 z ON y.a=z.a +WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; +a a a +2001-01-01 00:00:00 2001-01-01 00:00:00 2001-01-01 00:00:00 +EXPLAIN SELECT x.a, y.a, z.a FROM t1 x +JOIN t1 y ON x.a=y.a +JOIN t1 z ON y.a=z.a +WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE x NULL ALL NULL NULL NULL NULL 1 100.00 Using where +2 SIMPLE y NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +2 SIMPLE z NULL ALL NULL NULL NULL NULL 1 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`y`.`a` AS `a`,`test`.`z`.`a` AS `a` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` where ((`test`.`x`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (`test`.`y`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (`test`.`z`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +# +# Bug #49897: crash in ptr_compare when char(0) NOT NULL +# column is used for ORDER BY +# +SET @old_sort_buffer_size= @@session.sort_buffer_size; +SET @@sort_buffer_size= 40000; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1(a CHAR(0) NOT NULL); +INSERT INTO t1 VALUES (0), (0), (0); +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a FROM t1 ORDER BY a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24404 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24404 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `test`.`t1`.`a` +SELECT a FROM t1 ORDER BY a; +DROP TABLE t1; +CREATE TABLE t1(a CHAR(0) NOT NULL, b CHAR(0) NOT NULL, c int); +INSERT INTO t1 VALUES (0, 0, 0), (0, 0, 2), (0, 0, 1); +# Since ANALYZE TABLE only reads a subset of the data, the statistics for +# table t1 depends on the row order. And since the INSERT INTO ... SELECT +# may be executed using different execution plans, we've added ORDER BY +# to ensure that we rows has the same order every time. If not, the +# estimated number of rows in EXPLAIN may change on different platforms. +# Note that the tables may MYISAM, since many of the test files that +# includes this file forces MYISAM as the default storage engine. +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a FROM t1 ORDER BY a LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `test`.`t1`.`a` limit 5 +SELECT a FROM t1 ORDER BY a LIMIT 5; +a + + + + + +EXPLAIN SELECT * FROM t1 ORDER BY a, b LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b` limit 5 +SELECT * FROM t1 ORDER BY a, b LIMIT 5; +a b c + 2 + 2 + 2 + 2 + 2 +EXPLAIN SELECT * FROM t1 ORDER BY a, b, c LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b`,`test`.`t1`.`c` limit 5 +SELECT * FROM t1 ORDER BY a, b, c LIMIT 5; +a b c + 0 + 0 + 0 + 0 + 0 +EXPLAIN SELECT * FROM t1 ORDER BY c, a LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`c`,`test`.`t1`.`a` limit 5 +SELECT * FROM t1 ORDER BY c, a LIMIT 5; +a b c + 0 + 0 + 0 + 0 + 0 +SET @@sort_buffer_size= @old_sort_buffer_size; +DROP TABLE t1; +SET sql_mode = default; +End of 5.0 tests +create table t1(a INT, KEY (a)); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5); +SELECT a FROM t1 ORDER BY a LIMIT 2; +a +1 +2 +SELECT a FROM t1 ORDER BY a LIMIT 2,4294967296; +a +3 +4 +5 +SELECT a FROM t1 ORDER BY a LIMIT 2,4294967297; +a +3 +4 +5 +DROP TABLE t1; +CREATE TABLE A (date_key date); +CREATE TABLE C ( +pk int, +int_nokey int, +int_key int, +date_key date NOT NULL, +date_nokey date, +varchar_key varchar(1) +); +INSERT IGNORE INTO C VALUES +(1,1,1,'0000-00-00',NULL,NULL), +(1,1,1,'0000-00-00',NULL,NULL); +Warnings: +Warning 1264 Out of range value for column 'date_key' at row 1 +Warning 1264 Out of range value for column 'date_key' at row 2 +SELECT 1 FROM C WHERE pk > ANY (SELECT 1 FROM C); +1 +SELECT COUNT(DISTINCT 1) FROM C +WHERE date_key = (SELECT 1 FROM A WHERE C.date_key IS NULL) GROUP BY pk; +COUNT(DISTINCT 1) +SELECT date_nokey FROM C +WHERE int_key IN (SELECT 1 FROM A) +HAVING date_nokey = '10:41:7' +ORDER BY date_key; +ERROR HY000: Incorrect DATE value: '10:41:7' +DROP TABLE A,C; +CREATE TABLE t1 (a INT NOT NULL, b INT); +INSERT INTO t1 VALUES (1, 1); +EXPLAIN SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where true +SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2; +a b +1 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL); +EXPLAIN SELECT * FROM t1 WHERE (a=a AND b=b AND c=c) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +EXPLAIN SELECT * FROM t1 WHERE (a=a AND a=a AND b=b) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +EXPLAIN SELECT * FROM t1 WHERE (a=a AND b=b AND a=a) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +DROP TABLE t1; +# +# Bug#45266: Uninitialized variable lead to an empty result. +# +drop table if exists A,AA,B,BB; +CREATE TABLE `A` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`date_key` date NOT NULL, +`date_nokey` date NOT NULL, +`datetime_key` datetime NOT NULL, +`int_nokey` int(11) NOT NULL, +`time_key` time NOT NULL, +`time_nokey` time NOT NULL, +PRIMARY KEY (`pk`), +KEY `date_key` (`date_key`), +KEY `time_key` (`time_key`), +KEY `datetime_key` (`datetime_key`) +); +CREATE TABLE `AA` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`int_nokey` int(11) NOT NULL, +`time_key` time NOT NULL, +KEY `time_key` (`time_key`), +PRIMARY KEY (`pk`) +); +CREATE TABLE `B` ( +`date_nokey` date NOT NULL, +`date_key` date NOT NULL, +`time_key` time NOT NULL, +`datetime_nokey` datetime NOT NULL, +`varchar_key` varchar(1) NOT NULL, +KEY `date_key` (`date_key`), +KEY `time_key` (`time_key`), +KEY `varchar_key` (`varchar_key`) +); +INSERT IGNORE INTO `B` VALUES ('2003-07-28','2003-07-28','15:13:38','0000-00-00 00:00:00','f'),('0000-00-00','0000-00-00','00:05:48','2004-07-02 14:34:13','x'); +CREATE TABLE `BB` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`int_nokey` int(11) NOT NULL, +`date_key` date NOT NULL, +`varchar_nokey` varchar(1) NOT NULL, +`date_nokey` date NOT NULL, +PRIMARY KEY (`pk`), +KEY `date_key` (`date_key`) +); +INSERT IGNORE INTO `BB` VALUES (10,8,'0000-00-00','i','0000-00-00'),(11,0,'2005-08-18','','2005-08-18'); +SELECT table1 . `pk` AS field1 +FROM +(BB AS table1 INNER JOIN +(AA AS table2 STRAIGHT_JOIN A AS table3 +ON ( table3 . `date_key` = table2 . `pk` )) +ON ( table3 . `datetime_key` = table2 . `int_nokey` )) +WHERE ( table3 . `date_key` <= 4 AND table2 . `pk` = table1 . `varchar_nokey`) +GROUP BY field1 ; +field1 +SELECT table3 .`date_key` field1 +FROM +B table1 LEFT JOIN B table3 JOIN +(BB table6 JOIN A table7 ON table6 .`varchar_nokey`) +ON table6 .`int_nokey` ON table6 .`date_key` + WHERE NOT ( table1 .`varchar_key` AND table7 .`pk`) GROUP BY field1; +field1 +NULL +SELECT table4 . `time_nokey` AS field1 FROM +(AA AS table1 CROSS JOIN +(AA AS table2 STRAIGHT_JOIN +(B AS table3 STRAIGHT_JOIN A AS table4 +ON ( table4 . `date_key` = table3 . `time_key` )) +ON ( table4 . `pk` = table3 . `date_nokey` )) +ON ( table4 . `time_key` = table3 . `datetime_nokey` )) +WHERE ( table4 . `time_key` < table1 . `time_key` AND +table1 . `int_nokey` != 'f') +GROUP BY field1 ORDER BY field1 , field1; +field1 +SELECT table1 .`time_key` field2 FROM B table1 LEFT JOIN BB JOIN A table5 ON table5 .`date_nokey` ON table5 .`int_nokey` GROUP BY field2; +field2 +00:05:48 +15:13:38 +drop table A,AA,B,BB; +#end of test for bug#45266 +# +# Bug#33546: Slowdown on re-evaluation of constant expressions. +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (2); +SELECT * FROM t1 WHERE a = 1 + 1; +a +2 +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE a = 1 + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 10.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = ((1 + 1))) +SELECT * FROM t1 HAVING a = 1 + 1; +a +2 +EXPLAIN SELECT * FROM t1 HAVING a = 1 + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 100.00 NULL +Warnings: +Note 1003 /* select#1 */ 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 +EXPLAIN SELECT * FROM t1, t2 WHERE a = b + (1 + 1); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = (`test`.`t2`.`b` + ((1 + 1)))) +SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; +b a +2 3 +EXPLAIN SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer (hash join) +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t2` left join `test`.`t1` on((`test`.`t1`.`a` = (`test`.`t2`.`b` + 1))) where true +EXPLAIN SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 33.33 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 33.33 Using where +Warnings: +Note 1003 /* select#1 */ 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; +RETURN 1; +END;| +SET @cnt := 0; +SELECT * FROM t1 WHERE a = f1(); +a +1 +SELECT @cnt; +@cnt +1 +EXPLAIN SELECT * FROM t1 WHERE a = f1(); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 +# +# BUG#48052: Valgrind warning - uninitialized value in init_read_record() +# +# Disable Index condition pushdown +SELECT @old_optimizer_switch:=@@optimizer_switch; +@old_optimizer_switch:=@@optimizer_switch +# +Warnings: +# 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +CREATE TABLE t1 ( +pk int(11) NOT NULL, +i int(11) DEFAULT NULL, +v varchar(1) DEFAULT NULL, +PRIMARY KEY (pk) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (2,7,'m'); +INSERT INTO t1 VALUES (3,9,'m'); +SELECT v +FROM t1 +WHERE NOT pk > 0 +HAVING v <= 't' +ORDER BY pk; +v +# Restore old value for Index condition pushdown +SET SESSION optimizer_switch=@old_optimizer_switch; +DROP TABLE t1; +# +# Bug#49489 Uninitialized cache led to a wrong result. +# +CREATE TABLE t1(c1 DOUBLE(5,4)); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (9.1234); +SELECT * FROM t1 WHERE c1 < 9.12345; +c1 +9.1234 +DROP TABLE t1; +# End of test for bug#49489. +# +# Bug #49517: Inconsistent behavior while using +# NULLable BIGINT and INT columns in comparison +# +CREATE TABLE t1(a BIGINT UNSIGNED NOT NULL, b BIGINT NULL, c INT NULL); +INSERT INTO t1 VALUES(105, NULL, NULL); +SELECT * FROM t1 WHERE b < 102; +a b c +SELECT * FROM t1 WHERE c < 102; +a b c +SELECT * FROM t1 WHERE 102 < b; +a b c +SELECT * FROM t1 WHERE 102 < c; +a b c +DROP TABLE t1; +# +# Bug #54459: Assertion failed: param.sort_length, +# file .\filesort.cc, line 149 (part II) +# +CREATE TABLE t1(a ENUM('') NOT NULL) charset latin1; +INSERT INTO t1 VALUES (), (), (); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` order by `(t1.a collate latin1_german2_ci)` +SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug #58422: Incorrect result when OUTER JOIN'ing +# with an empty table +# +CREATE TABLE t_empty(pk INT PRIMARY KEY, i INT); +CREATE TABLE t1(pk INT PRIMARY KEY, i INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3); +CREATE TABLE t2(pk INT PRIMARY KEY, i INT) ; +INSERT INTO t2 VALUES (1,1), (2,2), (3,3); +ANALYZE TABLE t_empty, t1, t2; +Table Op Msg_type Msg_text +test.t_empty analyze status OK +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`pk` = `test`.`t1`.`pk`) and (`test`.`t1`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using join buffer (hash join) +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`pk` = `test`.`t1`.`pk`) and (`test`.`t1`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t2 NULL range PRIMARY PRIMARY 4 NULL 2 33.33 Using where; Using join buffer (hash join) +2 SIMPLE t1 NULL eq_ref PRIMARY PRIMARY 4 test.t2.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`i` = `test`.`t_empty`.`i`) and (`test`.`t1`.`pk` = `test`.`t2`.`pk`) and (`test`.`t2`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +DROP TABLE t1,t2,t_empty; +End of 5.1 tests +# +# Bug#45227: Lost HAVING clause led to a wrong result. +# +CREATE TABLE `cc` ( +`int_nokey` int(11) NOT NULL, +`int_key` int(11) NOT NULL, +`varchar_key` varchar(1) NOT NULL, +`varchar_nokey` varchar(1) NOT NULL, +KEY `int_key` (`int_key`), +KEY `varchar_key` (`varchar_key`) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `cc` VALUES +(0,8,'q','q'),(5,8,'m','m'),(7,3,'j','j'),(1,2,'z','z'),(8,2,'a','a'),(2,6,'',''),(1,8,'e' +,'e'),(8,9,'t','t'),(5,2,'q','q'),(4,6,'b','b'),(5,5,'w','w'),(3,2,'m','m'),(0,4,'x','x'), +(8,9,'',''),(0,6,'w','w'),(4,5,'x','x'),(0,0,'e','e'),(0,0,'e','e'),(2,8,'p','p'),(0,0,'x' +,'x'); +EXPLAIN SELECT `varchar_nokey` g1 FROM cc WHERE `int_nokey` AND `int_key` <= 4 +HAVING g1 ORDER BY `varchar_key` LIMIT 6 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 9 90.00 Parallel execute (1 workers) +2 SIMPLE cc NULL range int_key int_key 4 NULL 9 90.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`cc`.`varchar_nokey` AS `g1` from `test`.`cc` where ((0 <> `test`.`cc`.`int_nokey`) and (`test`.`cc`.`int_key` <= 4)) having (0 <> `g1`) order by `test`.`cc`.`varchar_key` limit 6 +SELECT `varchar_nokey` g1 FROM cc WHERE `int_nokey` AND `int_key` <= 4 +HAVING g1 ORDER BY `varchar_key` LIMIT 6 ; +g1 +Warning 1292 Truncated incorrect DOUBLE value: 'a' +Warning 1292 Truncated incorrect DOUBLE value: 'j' +Warning 1292 Truncated incorrect DOUBLE value: 'm' +Warning 1292 Truncated incorrect DOUBLE value: 'q' +Warning 1292 Truncated incorrect DOUBLE value: 'z' +Warnings: +DROP TABLE cc; +# End of test#45227 +# +# Bug#54515: Crash in opt_range.cc::get_best_group_min_max on +# SELECT from VIEW with GROUP BY +# +CREATE TABLE t1 ( +col_int_key int DEFAULT NULL, +KEY int_key (col_int_key) +) ; +INSERT INTO t1 VALUES (1),(2); +CREATE VIEW view_t1 AS +SELECT t1.col_int_key AS col_int_key +FROM t1; +SELECT col_int_key FROM view_t1 GROUP BY col_int_key; +col_int_key +1 +2 +DROP VIEW view_t1; +DROP TABLE t1; +# End of test BUG#54515 +# +# Bug #57203 Assertion `field_length <= 255' failed. +# +SELECT coalesce((avg(distinct (ST_geomfromtext("point(25379 -22010)"))))) +UNION ALL +SELECT coalesce((avg(distinct (ST_geomfromtext("point(25379 -22010)"))))) +AS foo +; +ERROR HY000: Incorrect arguments to avg +CREATE table t1(a text); +INSERT INTO t1 VALUES (''), (''); +SELECT avg(distinct(t1.a)) FROM t1, t1 t2 +GROUP BY t2.a ORDER BY t1.a; +avg(distinct(t1.a)) +0 +DROP TABLE t1; +# End of test BUG#57203 +# +# Bug#63020: Function "format"'s 'locale' argument is not considered +# when creating a "view' +# +CREATE TABLE t1 (f1 DECIMAL(10,2)); +INSERT INTO t1 VALUES (11.67),(17865.3),(12345678.92); +CREATE VIEW view_t1 AS SELECT FORMAT(f1,1,'sk_SK') AS f1 FROM t1; +SHOW CREATE VIEW view_t1; +View Create View character_set_client collation_connection +view_t1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_t1` AS select format(`t1`.`f1`,1,'sk_SK') AS `f1` from `t1` utf8mb4 utf8mb4_0900_ai_ci +SELECT * FROM view_t1; +f1 +11,7 +17 865,3 +12 345 678,9 +DROP TABLE t1; +DROP VIEW view_t1; +# End of test BUG#63020 +# +# Bug #13571700 TINYBLOB NOT NULL, CRASH IN PROTOCOL::NET_STORE_DATA +# +CREATE TABLE t1 (a TINYBLOB NOT NULL); +SELECT a, COUNT(*) FROM t1 WHERE 0; +a COUNT(*) +NULL 0 +DROP TABLE t1; +# End of test BUG#13571700 +# +# Bug #18766378: CRASH IN ITEM_SUM_BIT::RESET_FIELD +# +CREATE TABLE t1(b int); +CREATE TABLE t2(a int); +INSERT INTO t1 VALUES (),(); +INSERT INTO t2 VALUES (),(); +SELECT +( SELECT 1 FROM t1 GROUP BY a +HAVING avg(distinct 1) ORDER BY max(a) +) +FROM t1, t2 +GROUP BY a; +( SELECT 1 FROM t1 GROUP BY a +HAVING avg(distinct 1) ORDER BY max(a) +) +1 +DROP TABLE t1,t2; +# End of test BUG#18766378 +# +# WL#13002: RESULTSET DIFFERENT NUMBER OF ROWS +# +CREATE TABLE t1 ( +f1 INTEGER, +f2 INTEGER, +INDEX i1 (f2) +); +INSERT INTO t1 VALUES (NULL,1); +INSERT INTO t1 VALUES (2,NULL); +INSERT INTO t1 VALUES (3,1); +INSERT INTO t1 VALUES (4,6); +INSERT INTO t1 VALUES (NULL,5); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (13,1); +INSERT INTO t1 VALUES (NULL,0); +INSERT INTO t1 VALUES (5,2); +INSERT INTO t1 VALUES (NULL,8); +INSERT INTO t1 VALUES (NULL,7); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (NULL,4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN FORMAT=tree SELECT * +FROM t1 AS alias1 LEFT JOIN t1 AS alias2 ON alias1.f1 = alias2.f2 +WHERE alias2.f1 NOT BETWEEN 4 AND 12; +EXPLAIN +-> Parallel scan on + -> Nested loop inner join (cost=9.27 rows=19) + -> PQblock scan on alias1 (cost=1.65 rows=14) + -> Filter: (alias2.f1 not between 4 and 12) (cost=0.40 rows=1) + -> Index lookup on alias2 using i1 (f2=alias1.f1) (cost=0.40 rows=2) + +SELECT * +FROM t1 AS alias1 LEFT JOIN t1 AS alias2 ON alias1.f1 = alias2.f2 +WHERE alias2.f1 NOT BETWEEN 4 AND 12; +f1 f2 f1 f2 +DROP TABLE t1; +set optimizer_switch=default; +set optimizer_switch=default; diff --git a/mysql-test/r/select_none_bka_nobnl.result-pq b/mysql-test/r/select_none_bka_nobnl.result-pq new file mode 100644 index 000000000000..b8548dafb216 --- /dev/null +++ b/mysql-test/r/select_none_bka_nobnl.result-pq @@ -0,0 +1,5701 @@ +set optimizer_switch='batched_key_access=on,block_nested_loop=off,mrr_cost_based=off'; +drop table if exists t1,t2,t3,t4,t11; +drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa; +drop view if exists v1; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +); +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (9410,9412); +select period from t1; +period +9410 +select * from t1; +Period Varor_period +9410 9412 +select t1.* from t1; +Period Varor_period +9410 9412 +CREATE TABLE t2 ( +auto int not null auto_increment, +fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL, +companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL, +fld3 char(30) DEFAULT '' NOT NULL, +fld4 char(35) DEFAULT '' NOT NULL, +fld5 char(35) DEFAULT '' NOT NULL, +fld6 char(4) DEFAULT '' NOT NULL, +UNIQUE fld1 (fld1), +KEY fld3 (fld3), +PRIMARY KEY (auto) +) charset utf8mb4; +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%"; +fld3 +imaginable +select fld3 from t2 where fld3 like "%cultivation" ; +fld3 +cultivation +select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3,companynr from t2 where companynr = 58 order by fld3; +fld3 companynr +concoct 58 +druggists 58 +engrossing 58 +Eurydice 58 +exclaimers 58 +ferociousness 58 +hopelessness 58 +Huey 58 +imaginable 58 +judges 58 +merging 58 +ostrich 58 +peering 58 +Phelps 58 +presumes 58 +Ruth 58 +sentences 58 +Shylock 58 +straggled 58 +synergy 58 +thanking 58 +tying 58 +unlocks 58 +select fld3 from t2 order by fld3 desc limit 10; +fld3 +youthfulness +yelped +Wotan +workers +Witt +witchcraft +Winsett +Willy +willed +wildcats +select fld3 from t2 order by fld3 desc limit 5; +fld3 +youthfulness +yelped +Wotan +workers +Witt +select fld3 from t2 order by fld3 desc limit 5,5; +fld3 +witchcraft +Winsett +Willy +willed +wildcats +select t2.fld3 from t2 where fld3 = 'honeysuckle'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'h%le'; +fld3 +honeysuckle +select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_'; +fld3 +select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%'; +fld3 +explain select t2.fld3 from t2 where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 0.09 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 0.09 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` IGNORE INDEX (`fld3`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 0.09 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 0.09 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld1`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld3`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref fld3 fld3 120 const 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` USE INDEX (`fld3`) USE INDEX (`fld1`) where (`test`.`t2`.`fld3` = 'honeysuckle') +explain select fld3 from t2 ignore index (fld3,not_used); +ERROR 42000: Key 'not_used' doesn't exist in table 't2' +explain select fld3 from t2 use index (not_used); +ERROR 42000: Key 'not_used' doesn't exist in table 't2' +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +honeysuckle +honoring +explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range fld3 fld3 120 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where ((`test`.`t2`.`fld3` >= 'honeysuckle') and (`test`.`t2`.`fld3` <= 'honoring')) order by `test`.`t2`.`fld3` +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; +fld1 fld3 +148504 Colombo +068305 Colombo +000000 nondecreasing +select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes'; +fld1 fld3 +232605 appendixes +1232605 appendixes +1232606 appendixes +1232607 appendixes +1232608 appendixes +1232609 appendixes +select fld1 from t2 where fld1=250501 or fld1="250502"; +fld1 +250501 +250502 +explain select fld1 from t2 where fld1=250501 or fld1="250502"; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL range fld1 fld1 4 NULL 2 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld1` AS `fld1` from `test`.`t2` where ((`test`.`t2`.`fld1` = 250501) or (`test`.`t2`.`fld1` = 250502)) +select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +fld1 +250501 +250502 +250505 +250601 +explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL range fld1 fld1 4 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld1` AS `fld1` from `test`.`t2` where ((`test`.`t2`.`fld1` = 250501) or (`test`.`t2`.`fld1` = 250502) or ((`test`.`t2`.`fld1` >= 250505) and (`test`.`t2`.`fld1` <= 250601)) or (`test`.`t2`.`fld1` between 250501 and 250502)) +select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%'; +fld1 fld3 +012001 flanking +013602 foldout +013606 fingerings +018007 fanatic +018017 featherweight +018054 fetters +018103 flint +018104 flopping +036002 funereal +038017 fetched +038205 firearm +058004 Fenton +088303 feminine +186002 freakish +188007 flurried +188505 fitting +198006 furthermore +202301 Fitzpatrick +208101 fiftieth +208113 freest +218008 finishers +218022 feed +218401 faithful +226205 foothill +226209 furnishings +228306 forthcoming +228311 fated +231315 freezes +232102 forgivably +238007 filial +238008 fixedly +select fld3 from t2 where fld3 like "L%" and fld3 = "ok"; +fld3 +select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly"); +fld3 +Chantilly +select fld1,fld3 from t2 where fld1 like "25050%"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select fld1,fld3 from t2 where fld1 like "25050_"; +fld1 fld3 +250501 poisoning +250502 Iraqis +250503 heaving +250504 population +250505 bomb +select distinct companynr from t2; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr; +companynr +00 +29 +34 +36 +37 +40 +41 +50 +53 +58 +65 +68 +select distinct companynr from t2 order by companynr desc; +companynr +68 +65 +58 +53 +50 +41 +40 +37 +36 +34 +29 +00 +select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%" order by fld3; +fld3 period +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +select distinct fld3 from t2 where companynr = 34 order by fld3; +fld3 +absentee +accessed +ahead +alphabetic +Asiaticizations +attitude +aye +bankruptcies +belays +Blythe +bomb +boulevard +bulldozes +cannot +caressing +charcoal +checksumming +chess +clubroom +colorful +cosy +creator +crying +Darius +diffusing +duality +Eiffel +Epiphany +Ernestine +explorers +exterminated +famine +forked +Gershwins +heaving +Hodges +Iraqis +Italianization +Lagos +landslide +libretto +Majorca +mastering +narrowed +occurred +offerers +Palestine +Peruvianizes +pharmaceutic +poisoning +population +Pygmalion +rats +realest +recording +regimented +retransmitting +reviver +rouses +scars +sicker +sleepwalk +stopped +sugars +translatable +uncles +unexpected +uprisings +versatility +vest +select distinct fld3 from t2 limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct fld3 from t2 having fld3 like "A%" limit 10; +fld3 +abates +abiding +Abraham +abrogating +absentee +abut +accessed +accruing +accumulating +accuracies +select distinct substring(fld3,1,3) from t2 where fld3 like "A%"; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +Adl +adm +Ado +ads +adv +aer +aff +afi +afl +afo +agi +ahe +aim +air +Ald +alg +ali +all +alp +alr +ama +ame +amm +ana +and +ane +Ang +ani +Ann +Ant +api +app +aqu +Ara +arc +Arm +arr +Art +Asi +ask +asp +ass +ast +att +aud +Aug +aut +ave +avo +awe +aye +Azt +select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10; +substring(fld3,1,3) +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10; +a +aba +abi +Abr +abs +abu +acc +acq +acu +Ade +adj +create table t3 ( +period int not null, +name char(32) not null, +companynr int not null, +price double(11,0), +price2 double(11,0), +key (period), +key (name) +); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +create temporary table tmp select * from t3; +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +insert into tmp select * from t3; +insert into t3 select * from tmp; +alter table t3 add t2nr int not null auto_increment primary key first; +drop table tmp; +SET BIG_TABLES=1; +select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10; +namn +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +SET BIG_TABLES=0; +select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10; +concat(fld3," ",fld3) +Abraham Abraham +abrogating abrogating +admonishing admonishing +Adolph Adolph +afield afield +aging aging +ammonium ammonium +analyzable analyzable +animals animals +animized animized +select distinct fld5 from t2 limit 10; +fld5 +neat +Steinberg +jarring +tinily +balled +persist +attainments +fanatic +measures +rightfulness +select distinct companynr, fld3,count(*) from t2 group by companynr, fld3 order by companynr, fld3 limit 10; +companynr fld3 count(*) +00 affixed 1 +00 and 1 +00 annoyers 1 +00 Anthony 1 +00 assayed 1 +00 assurers 1 +00 attendants 1 +00 bedlam 1 +00 bedpost 1 +00 boasted 1 +SET BIG_TABLES=1; +select distinct companynr, fld3,count(*) from t2 group by companynr, fld3 order by companynr, fld3 limit 10; +companynr fld3 count(*) +00 affixed 1 +00 and 1 +00 annoyers 1 +00 Anthony 1 +00 assayed 1 +00 assurers 1 +00 attendants 1 +00 bedlam 1 +00 bedpost 1 +00 boasted 1 +SET BIG_TABLES=0; +select distinct companynr, fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr ,fld3 order by companynr, fld3 limit 100,10; +companynr fld3 repeat("a",length(fld3)) count(*) +29 chancellor aaaaaaaaaa 1 +29 Chippewa aaaaaaaa 1 +29 circumference aaaaaaaaaaaaa 1 +29 circus aaaaaa 1 +29 cited aaaaa 1 +29 Colombo aaaaaaa 1 +29 congresswoman aaaaaaaaaaaaa 1 +29 contrition aaaaaaaaaa 1 +29 corny aaaaa 1 +29 cultivation aaaaaaaaaaa 1 +select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2; +companynr rtrim(space(512+companynr)) +37 +78 +101 +154 +311 +447 +512 +select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3; +fld3 +explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 10.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL fld1 NULL NULL NULL 1199 10.00 Using where; Using temporary; Using filesort +2 SIMPLE t3 NULL eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`t2nr` AS `t2nr`,`test`.`t2`.`fld3` AS `fld3` from `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld1` = `test`.`t3`.`t2nr`)) order by `test`.`t3`.`t2nr`,`test`.`t2`.`fld3` +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 41736 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL period NULL NULL NULL 41736 100.00 Using temporary; Using filesort +2 SIMPLE t3 NULL ref period period 4 test.t1.period 4173 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t3`.`period` = `test`.`t1`.`period`) order by `test`.`t3`.`period` +explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (4 workers) +2 SIMPLE t3 NULL index period period 4 NULL 1 100.00 NULL +2 SIMPLE t1 NULL ref period period 4 test.t3.period 4173 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t1`.`period` = `test`.`t3`.`period`) order by `test`.`t3`.`period` limit 10 +explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL index period period 4 NULL 1 100.00 NULL +2 SIMPLE t3 NULL ref period period 4 test.t1.period 4173 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`t2nr` AS `t2nr`,`test`.`t1`.`period` AS `period`,`test`.`t1`.`name` AS `name`,`test`.`t1`.`companynr` AS `companynr`,`test`.`t1`.`price` AS `price`,`test`.`t1`.`price2` AS `price2`,`test`.`t3`.`t2nr` AS `t2nr`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`name` AS `name`,`test`.`t3`.`companynr` AS `companynr`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t3` `t1` join `test`.`t3` where (`test`.`t3`.`period` = `test`.`t1`.`period`) order by `test`.`t1`.`period` limit 10 +select period from t1; +period +9410 +select period from t1 where period=1900; +period +select fld3,period from t1,t2 where fld1 = 011401 order by period; +fld3 period +breaking 9410 +select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001; +fld3 period +breaking 1001 +explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const fld1 fld1 4 const 1 100.00 NULL +1 SIMPLE t3 NULL const PRIMARY,period PRIMARY 4 const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select 'breaking' AS `fld3`,'1001' AS `period` from `test`.`t2` join `test`.`t3` where true +select fld3,period from t2,t1 where companynr*10 = 37*10 order by fld3; +fld3 period +abates 9410 +Abraham 9410 +abrogating 9410 +accessed 9410 +Aden 9410 +admiring 9410 +admonishing 9410 +Adolph 9410 +afield 9410 +afore 9410 +aging 9410 +airships 9410 +Aldrich 9410 +alike 9410 +Alison 9410 +allot 9410 +already 9410 +amenities 9410 +ammonium 9410 +analogy 9410 +analyzable 9410 +Anatole 9410 +animals 9410 +animized 9410 +annihilates 9410 +announced 9410 +announces 9410 +Antarctica 9410 +Antares 9410 +apiary 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +appendixes 9410 +Arabia 9410 +arriving 9410 +Artemia 9410 +arteriole 9410 +assails 9410 +astound 9410 +attainments 9410 +attrition 9410 +audiology 9410 +Augustine 9410 +avenge 9410 +avoidable 9410 +babies 9410 +babysitting 9410 +Baird 9410 +balled 9410 +beaner 9410 +beaters 9410 +bee 9410 +Beebe 9410 +befouled 9410 +bellow 9410 +bestseller 9410 +betroth 9410 +bewilderingly 9410 +bills 9410 +bitterroot 9410 +bivalves 9410 +bloater 9410 +bloodbath 9410 +boat 9410 +boom 9410 +boorish 9410 +boulder 9410 +breaking 9410 +brunch 9410 +buckboards 9410 +burlesque 9410 +Butterfield 9410 +cage 9410 +capably 9410 +capped 9410 +cascade 9410 +Cassites 9410 +causality 9410 +cautioned 9410 +ceiling 9410 +celery 9410 +CERN 9410 +certificates 9410 +chafe 9410 +chaperone 9410 +charges 9410 +chasm 9410 +checkpoints 9410 +chewing 9410 +chews 9410 +Chicana 9410 +chillingly 9410 +Chippewa 9410 +chronicle 9410 +ciphers 9410 +civics 9410 +clamored 9410 +Clayton 9410 +clenched 9410 +clockers 9410 +coexist 9410 +cokes 9410 +combed 9410 +coming 9410 +commencements 9410 +commonplace 9410 +communicants 9410 +compartment 9410 +comprehensive 9410 +comprised 9410 +conceptions 9410 +concludes 9410 +congregates 9410 +Conley 9410 +Connally 9410 +contrary 9410 +contrasted 9410 +convenient 9410 +convulsion 9410 +corset 9410 +count 9410 +coverings 9410 +Crays 9410 +craziness 9410 +creak 9410 +creek 9410 +critiques 9410 +crunches 9410 +culled 9410 +cult 9410 +cupboard 9410 +cured 9410 +cute 9410 +daughter 9410 +decliner 9410 +decomposition 9410 +deductions 9410 +dehydrate 9410 +deludes 9410 +denizen 9410 +denotative 9410 +denounces 9410 +dental 9410 +dentally 9410 +descendants 9410 +despot 9410 +destroyer 9410 +detectably 9410 +dialysis 9410 +DiMaggio 9410 +dimensions 9410 +disable 9410 +discounts 9410 +disentangle 9410 +disobedience 9410 +dissociate 9410 +dogging 9410 +dopers 9410 +drains 9410 +dreaded 9410 +ducks 9410 +dusted 9410 +Dutchman 9410 +effortlessly 9410 +electroencephalography 9410 +elite 9410 +embassies 9410 +employing 9410 +encompass 9410 +encompasses 9410 +environing 9410 +epistle 9410 +equilibrium 9410 +erases 9410 +error 9410 +eschew 9410 +eternal 9410 +Eulerian 9410 +Evanston 9410 +evened 9410 +evenhandedly 9410 +eventful 9410 +Everhart 9410 +excises 9410 +exclamation 9410 +excrete 9410 +exhausts 9410 +expelled 9410 +extents 9410 +externally 9410 +extracted 9410 +faithful 9410 +fanatic 9410 +fated 9410 +featherweight 9410 +feed 9410 +feminine 9410 +Fenton 9410 +fetched 9410 +fetters 9410 +fiftieth 9410 +filial 9410 +fingerings 9410 +finishers 9410 +firearm 9410 +fitting 9410 +Fitzpatrick 9410 +fixedly 9410 +flanking 9410 +flint 9410 +flopping 9410 +flurried 9410 +foldout 9410 +foothill 9410 +forgivably 9410 +forthcoming 9410 +freakish 9410 +freest 9410 +freezes 9410 +funereal 9410 +furnishings 9410 +furthermore 9410 +gadfly 9410 +gainful 9410 +Galatean 9410 +galling 9410 +Gandhian 9410 +Ganymede 9410 +garage 9410 +gentleman 9410 +gifted 9410 +gleaning 9410 +glut 9410 +goblins 9410 +Goldstine 9410 +Gothicism 9410 +governing 9410 +gradually 9410 +Graves 9410 +grazing 9410 +Greenberg 9410 +gritty 9410 +groupings 9410 +guides 9410 +guitars 9410 +Gurkha 9410 +handgun 9410 +handy 9410 +Hawaii 9410 +Hegelian 9410 +heiress 9410 +hoarder 9410 +honoring 9410 +Hornblower 9410 +hostess 9410 +Huffman 9410 +humanness 9410 +humiliation 9410 +humility 9410 +Hunter 9410 +hushes 9410 +husky 9410 +hypothesizer 9410 +icon 9410 +ideas 9410 +impelling 9410 +impending 9410 +imperial 9410 +imperiously 9410 +imprint 9410 +impulsive 9410 +inaccuracy 9410 +inch 9410 +incidentals 9410 +incorrectly 9410 +incurring 9410 +index 9410 +indulge 9410 +indulgences 9410 +ineffective 9410 +infallibly 9410 +infest 9410 +inform 9410 +inmate 9410 +insolence 9410 +instruments 9410 +intelligibility 9410 +intentness 9410 +intercepted 9410 +interdependent 9410 +interrelationships 9410 +interrogate 9410 +investigations 9410 +irresponsibly 9410 +jarring 9410 +Joplin 9410 +journalizing 9410 +Judas 9410 +juveniles 9410 +Kane 9410 +kanji 9410 +Kantian 9410 +Kevin 9410 +kingdom 9410 +Kinsey 9410 +kiting 9410 +Kline 9410 +labeled 9410 +languages 9410 +Lars 9410 +laterally 9410 +Latinizes 9410 +lawgiver 9410 +leaflet 9410 +leavings 9410 +lectured 9410 +leftover 9410 +lewdly 9410 +lied 9410 +Lillian 9410 +linear 9410 +lists 9410 +lithograph 9410 +Lizzy 9410 +lore 9410 +luckily 9410 +Majorca 9410 +males 9410 +Manhattanize 9410 +marginal 9410 +mastering 9410 +mayoral 9410 +McGovern 9410 +meanwhile 9410 +measures 9410 +measures 9410 +mechanizing 9410 +medical 9410 +meditation 9410 +Melinda 9410 +Merritt 9410 +metaphysically 9410 +Micronesia 9410 +Miles 9410 +Miltonism 9410 +mineral 9410 +miniaturizes 9410 +minima 9410 +minion 9410 +minting 9410 +misted 9410 +misunderstander 9410 +mixture 9410 +motors 9410 +mournfulness 9410 +multilayer 9410 +mumbles 9410 +mushrooms 9410 +mystic 9410 +Nabisco 9410 +navies 9410 +navigate 9410 +Nazis 9410 +neat 9410 +neonatal 9410 +nested 9410 +Newtonian 9410 +noncritical 9410 +normalizes 9410 +Norwalk 9410 +obliterates 9410 +offload 9410 +opaquely 9410 +organizer 9410 +overestimating 9410 +overlay 9410 +Pandora 9410 +parametrized 9410 +parenthood 9410 +Parsifal 9410 +parters 9410 +participated 9410 +partridges 9410 +peacock 9410 +peeked 9410 +pellagra 9410 +percentage 9410 +percentage 9410 +persist 9410 +perturb 9410 +Peruvian 9410 +pessimist 9410 +pests 9410 +petted 9410 +pictures 9410 +pithed 9410 +pityingly 9410 +poison 9410 +posed 9410 +positioning 9410 +postulation 9410 +praised 9410 +precaution 9410 +precipitable 9410 +preclude 9410 +presentation 9410 +pressure 9410 +previewing 9410 +priceless 9410 +primary 9410 +psychic 9410 +publicly 9410 +puddings 9410 +Punjab 9410 +Pyle 9410 +quagmire 9410 +quitter 9410 +Quixotism 9410 +railway 9410 +raining 9410 +rains 9410 +ravines 9410 +readable 9410 +realized 9410 +realtor 9410 +reassigned 9410 +recruited 9410 +reduce 9410 +regimented 9410 +registration 9410 +relatively 9410 +relaxing 9410 +relishing 9410 +relives 9410 +renew 9410 +repelled 9410 +repetitions 9410 +reporters 9410 +reporters 9410 +repressions 9410 +resplendent 9410 +resumes 9410 +rifles 9410 +rightful 9410 +rightfully 9410 +rightfulness 9410 +ripeness 9410 +riser 9410 +Romano 9410 +Romans 9410 +roped 9410 +rudeness 9410 +rules 9410 +rural 9410 +rusting 9410 +Sabine 9410 +sadly 9410 +sags 9410 +sanding 9410 +saplings 9410 +sating 9410 +Sault 9410 +save 9410 +sawtooth 9410 +Saxony 9410 +scarf 9410 +scatterbrain 9410 +scheduling 9410 +schemer 9410 +scholastics 9410 +scornfully 9410 +secures 9410 +securing 9410 +Selfridge 9410 +seminaries 9410 +serializations 9410 +serpents 9410 +serving 9410 +severely 9410 +sews 9410 +Shanghais 9410 +shapelessly 9410 +shipyard 9410 +shooter 9410 +similarities 9410 +Simla 9410 +Simon 9410 +skulking 9410 +slaughter 9410 +sloping 9410 +smoothed 9410 +snatching 9410 +socializes 9410 +sophomore 9410 +sorters 9410 +spatial 9410 +specification 9410 +specifics 9410 +spongers 9410 +spools 9410 +sportswriting 9410 +sporty 9410 +squabbled 9410 +squeaking 9410 +squeezes 9410 +stabilizes 9410 +stairway 9410 +Stalin 9410 +standardizes 9410 +star 9410 +starlet 9410 +stated 9410 +Steinberg 9410 +stint 9410 +stodgy 9410 +store 9410 +straight 9410 +stranglings 9410 +subdirectory 9410 +subjective 9410 +subschema 9410 +succumbed 9410 +suites 9410 +sumac 9410 +sureties 9410 +swaying 9410 +sweetish 9410 +swelling 9410 +syndicate 9410 +Taoism 9410 +taxonomically 9410 +techniques 9410 +teem 9410 +teethe 9410 +tempering 9410 +Teresa 9410 +terminal 9410 +terminator 9410 +terminators 9410 +test 9410 +testicle 9410 +textures 9410 +theorizers 9410 +throttles 9410 +tidiness 9410 +timesharing 9410 +tinily 9410 +tinting 9410 +Tipperary 9410 +title 9410 +tragedies 9410 +traitor 9410 +trimmings 9410 +tropics 9410 +unaffected 9410 +uncovering 9410 +undoes 9410 +ungrateful 9410 +universals 9410 +unplug 9410 +unruly 9410 +untying 9410 +unwilling 9410 +vacuuming 9410 +validate 9410 +vanish 9410 +ventilate 9410 +veranda 9410 +vests 9410 +wallet 9410 +waltz 9410 +warm 9410 +warningly 9410 +watering 9410 +weasels 9410 +Weissmuller 9410 +western 9410 +whiteners 9410 +widens 9410 +Winsett 9410 +witchcraft 9410 +workers 9410 +Wotan 9410 +yelped 9410 +youthfulness 9410 +analyze table t2, t3; +Table Op Msg_type Msg_text +test.t2 analyze status OK +test.t3 analyze status OK +EXPLAIN select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 10.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL fld1 NULL NULL NULL 1199 10.00 Using where; Using temporary; Using filesort +2 SIMPLE t3 NULL eq_ref PRIMARY,period PRIMARY 4 test.t2.fld1 1 20.04 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3`,`test`.`t3`.`period` AS `period`,`test`.`t3`.`price` AS `price`,`test`.`t3`.`price2` AS `price2` from `test`.`t2` join `test`.`t3` where ((`test`.`t2`.`companynr` = 37) and (`test`.`t2`.`fld1` = `test`.`t3`.`t2nr`) and (`test`.`t3`.`period` >= 1001) and (`test`.`t3`.`period` <= 1002)) order by `test`.`t2`.`fld3`,`test`.`t3`.`period`,`test`.`t3`.`price` +select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price; +fld3 period price price2 +admonishing 1002 28357832 8723648 +analyzable 1002 28357832 8723648 +annihilates 1001 5987435 234724 +Antares 1002 28357832 8723648 +astound 1001 5987435 234724 +audiology 1001 5987435 234724 +Augustine 1002 28357832 8723648 +Baird 1002 28357832 8723648 +bewilderingly 1001 5987435 234724 +breaking 1001 5987435 234724 +Conley 1001 5987435 234724 +dentally 1002 28357832 8723648 +dissociate 1002 28357832 8723648 +elite 1001 5987435 234724 +eschew 1001 5987435 234724 +Eulerian 1001 5987435 234724 +flanking 1001 5987435 234724 +foldout 1002 28357832 8723648 +funereal 1002 28357832 8723648 +galling 1002 28357832 8723648 +Graves 1001 5987435 234724 +grazing 1001 5987435 234724 +groupings 1001 5987435 234724 +handgun 1001 5987435 234724 +humility 1002 28357832 8723648 +impulsive 1002 28357832 8723648 +inch 1001 5987435 234724 +intelligibility 1001 5987435 234724 +jarring 1001 5987435 234724 +lawgiver 1001 5987435 234724 +lectured 1002 28357832 8723648 +Merritt 1002 28357832 8723648 +neonatal 1001 5987435 234724 +offload 1002 28357832 8723648 +parters 1002 28357832 8723648 +pityingly 1002 28357832 8723648 +puddings 1002 28357832 8723648 +Punjab 1001 5987435 234724 +quitter 1002 28357832 8723648 +realtor 1001 5987435 234724 +relaxing 1001 5987435 234724 +repetitions 1001 5987435 234724 +resumes 1001 5987435 234724 +Romans 1002 28357832 8723648 +rusting 1001 5987435 234724 +scholastics 1001 5987435 234724 +skulking 1002 28357832 8723648 +stated 1002 28357832 8723648 +suites 1002 28357832 8723648 +sureties 1001 5987435 234724 +testicle 1002 28357832 8723648 +tinily 1002 28357832 8723648 +tragedies 1001 5987435 234724 +trimmings 1001 5987435 234724 +vacuuming 1001 5987435 234724 +ventilate 1001 5987435 234724 +wallet 1001 5987435 234724 +Weissmuller 1002 28357832 8723648 +Wotan 1002 28357832 8723648 +select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37; +fld1 fld3 period price price2 +018201 relaxing 1001 5987435 234724 +018601 vacuuming 1001 5987435 234724 +018801 inch 1001 5987435 234724 +018811 repetitions 1001 5987435 234724 +create table t4 ( +companynr tinyint(2) unsigned zerofill NOT NULL default '00', +companyname char(30) NOT NULL default '', +PRIMARY KEY (companynr), +UNIQUE KEY companyname(companyname) +) ENGINE=INNODB MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames'; +Warnings: +Warning 1681 The ZEROFILL attribute is deprecated and will be removed in a future release. Use the LPAD function to zero-pad numbers, or store the formatted numbers in a CHAR column. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr; +companynr companyname +00 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select * from t1,t1 t12; +Period Varor_period Period Varor_period +9410 9412 9410 9412 +select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505; +fld1 fld1 +250501 250501 +250501 250502 +250501 250503 +250501 250504 +250501 250505 +250502 250501 +250502 250502 +250502 250503 +250502 250504 +250502 250505 +250503 250501 +250503 250502 +250503 250503 +250503 250504 +250503 250505 +250504 250501 +250504 250502 +250504 250503 +250504 250504 +250504 250505 +250505 250501 +250505 250502 +250505 250503 +250505 250504 +250505 250505 +insert into t2 (fld1, companynr) values (999999,99); +ANALYZE TABLE t2, t4; +Table Op Msg_type Msg_text +test.t2 analyze status OK +test.t4 analyze status OK +select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +companynr companyname +99 NULL +select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null; +count(*) +1199 +explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1200 100.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1200 100.00 NULL +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 Using where; Not exists +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t2` left join `test`.`t4` on((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`)) where (`test`.`t4`.`companynr` is null) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1200 10.00 Using where; Not exists +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t2`.`companynr` is null) +select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +companynr companyname +select count(*) from t2 left join t4 using (companynr) where companynr is not null; +count(*) +1200 +explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t2` left join `test`.`t4` on(multiple equal(`test`.`t2`.`companynr`, `test`.`t4`.`companynr`)) where false +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on(multiple equal(`test`.`t4`.`companynr`, `test`.`t2`.`companynr`)) where false +delete from t2 where fld1=999999; +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 33.33 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 33.33 Using where +2 SIMPLE t4 NULL eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` join `test`.`t2` where ((`test`.`t4`.`companynr` = `test`.`t2`.`companynr`) and (`test`.`t2`.`companynr` > 0) and (`test`.`t2`.`companynr` > 0)) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t4`.`companynr` > 0) and (`test`.`t4`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 40.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t2`.`companynr` > 0) or (`test`.`t2`.`companynr` is null)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index PRIMARY companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t2`.`companynr` > 0) or (`test`.`t4`.`companynr` > 0)) +explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (ifnull(`test`.`t2`.`companynr`,1) > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (`test`.`t4`.`companynr` > 0) +explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 11 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL range PRIMARY PRIMARY 1 NULL 11 100.00 Using where +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where ((`test`.`t4`.`companynr` > 0) or (`test`.`t4`.`companynr` > 0)) +explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 12 100.00 Parallel execute (1 workers) +2 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using where; Using index +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t4`.`companynr` AS `companynr`,`test`.`t4`.`companyname` AS `companyname` from `test`.`t4` left join `test`.`t2` on((`test`.`t2`.`companynr` = `test`.`t4`.`companynr`)) where (ifnull(`test`.`t4`.`companynr`,1) > 0) +select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +companynr companynr +37 36 +41 40 +explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t4 NULL index NULL companyname 120 NULL 12 100.00 Using index; Using temporary +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select distinct `test`.`t2`.`companynr` AS `companynr`,`test`.`t4`.`companynr` AS `companynr` from `test`.`t2` join `test`.`t4` where (`test`.`t2`.`companynr` = (`test`.`t4`.`companynr` + 1)) +select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009; +fld1 companynr fld3 period +038008 37 reporters 1008 +038208 37 Selfridge 1008 +select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909); +period +9410 +select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6))); +period +9410 +select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1; +fld1 +250501 +250502 +250503 +250505 +select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606); +fld1 +250502 +250503 +select fld1 from t2 where fld1 between 250502 and 250504; +fld1 +250502 +250503 +250504 +select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ; +fld3 +Lillian +label +labeled +labeled +landslide +laterally +leaflet +lewdly +luckily +select count(*) from t1; +count(*) +1 +select companynr,count(*),sum(fld1) from t2 group by companynr; +companynr count(*) sum(fld1) +00 82 10355753 +29 95 14473298 +34 70 17788966 +36 215 22786296 +37 588 83602098 +40 37 6618386 +41 52 12816335 +50 11 1595438 +53 4 793210 +58 23 2254293 +65 10 2284055 +68 12 3097288 +select companynr,count(*) from t2 group by companynr order by companynr desc limit 5; +companynr count(*) +68 12 +65 10 +58 23 +53 4 +50 11 +select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1) +70 absentee vest 17788966 254128.0857 3272.5939722090234 10709871.306938833 +explain select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>""; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 9.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 order 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.97568479746 13352027981.708656 +29 95 abut wetness 14473298 152350.5053 8368.547956641249 70032594.90260443 +34 70 absentee vest 17788966 254128.0857 3272.5939722090234 10709871.306938833 +select +companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from +t3 where companynr = 37 group by companynr,t2nr order by companynr, t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select /*! SQL_SMALL_RESULT */ +companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from +t3 where companynr = 37 group by companynr,t2nr order by companynr, t2nr limit 10; +companynr t2nr count(price) sum(price) min(price) max(price) avg(price) +37 1 1 5987435 5987435 5987435 5987435.0000 +37 2 1 28357832 28357832 28357832 28357832.0000 +37 3 1 39654943 39654943 39654943 39654943.0000 +37 11 1 5987435 5987435 5987435 5987435.0000 +37 12 1 28357832 28357832 28357832 28357832.0000 +37 13 1 39654943 39654943 39654943 39654943.0000 +37 21 1 5987435 5987435 5987435 5987435.0000 +37 22 1 28357832 28357832 28357832 28357832.0000 +37 23 1 39654943 39654943 39654943 39654943.0000 +37 31 1 5987435 5987435 5987435 5987435.0000 +select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ; +companynr count(price) sum(price) min(price) max(price) avg(price) +101 4181 3489454238 834598 834598 834598.0000 +154 4181 4112197254950 983543950 983543950 983543950.0000 +311 4181 979599938 234298 234298 234298.0000 +37 12543 309394878010 5987435 39654943 24666736.6667 +447 4181 9929180954 2374834 2374834 2374834.0000 +512 4181 3288532102 786542 786542 786542.0000 +78 8362 414611089292 726498 98439034 49582766.0000 +select distinct mod(companynr,10) from t4 group by companynr; +mod(companynr,10) +0 +1 +3 +4 +5 +6 +7 +8 +9 +select distinct 1 from t4 group by companynr; +1 +1 +select count(distinct fld1) from t2; +count(distinct fld1) +1199 +select companynr,count(distinct fld1) from t2 group by companynr; +companynr count(distinct fld1) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(*) from t2 group by companynr; +companynr count(*) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,1000))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr; +companynr count(distinct concat(fld1,repeat(65,200))) +00 82 +29 95 +34 70 +36 215 +37 588 +40 37 +41 52 +50 11 +53 4 +58 23 +65 10 +68 12 +select companynr,count(distinct floor(fld1/100)) from t2 group by companynr; +companynr count(distinct floor(fld1/100)) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr; +companynr count(distinct concat(repeat(65,1000),floor(fld1/100))) +00 47 +29 35 +34 14 +36 69 +37 108 +40 16 +41 11 +50 9 +53 1 +58 1 +65 1 +68 1 +select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10; +sum(fld1) fld3 +11402 Romans +select name,count(*) from t3 where name='cloakroom' group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name='cloakroom' and price>10 group by name; +name count(*) +cloakroom 4181 +select count(*) from t3 where name='cloakroom' and price2=823742; +count(*) +4181 +select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name; +name count(*) +cloakroom 4181 +select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name; +name count(*) +extramarital 4181 +gazer 4181 +gems 4181 +Iranizes 4181 +spates 4181 +tucked 4181 +violinist 4181 +select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld3 count(*) +spates 4181 +select companynr|0,companyname from t4 group by 1; +companynr|0 companyname +0 Unknown +29 company 1 +34 company 2 +36 company 3 +37 company 4 +40 company 5 +41 company 6 +50 company 11 +53 company 7 +58 company 8 +65 company 9 +68 company 10 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname; +companynr companyname count(*) +29 company 1 95 +68 company 10 12 +50 company 11 11 +34 company 2 70 +36 company 3 215 +37 company 4 588 +40 company 5 37 +41 company 6 52 +53 company 7 4 +58 company 8 23 +65 company 9 10 +00 Unknown 82 +select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name; +fld1 count(*) +158402 4181 +select sum(Period)/count(*) from t1; +sum(Period)/count(*) +9410.0000 +select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; +companynr count sum diff func +101 4181 3489454238 0.0000 422281 +154 4181 4112197254950 0.0000 643874 +311 4181 979599938 0.0000 1300291 +37 12543 309394878010 0.0000 464091 +447 4181 9929180954 0.0000 1868907 +512 4181 3288532102 0.0000 2140672 +78 8362 414611089292 0.0000 652236 +select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg; +companynr avg +154 983543950.0000 +select companynr,count(*) from t2 group by companynr order by 2 desc; +companynr count(*) +37 588 +36 215 +29 95 +00 82 +34 70 +41 52 +40 37 +58 23 +68 12 +50 11 +65 10 +53 4 +select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc; +companynr count(*) +41 52 +58 23 +68 12 +50 11 +65 10 +53 4 +select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4; +fld4 fld1 count(price) sum(price) min(price) max(price) avg(price) +Abraham 018103 1 39654943 39654943 39654943 39654943.0000 +Anatole 038102 1 28357832 28357832 28357832 28357832.0000 +Beebe 018602 1 28357832 28357832 28357832 28357832.0000 +Chicana 038203 1 39654943 39654943 39654943 39654943.0000 +Conley 018101 1 5987435 5987435 5987435 5987435.0000 +Connally 018801 1 5987435 5987435 5987435 5987435.0000 +Graves 018052 1 28357832 28357832 28357832 28357832.0000 +Judas 018032 1 28357832 28357832 28357832 28357832.0000 +Kline 038101 1 5987435 5987435 5987435 5987435.0000 +Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000 +Merritt 016303 1 39654943 39654943 39654943 39654943.0000 +Parsifal 013802 1 28357832 28357832 28357832 28357832.0000 +Punjab 016302 1 28357832 28357832 28357832 28357832.0000 +Selfridge 019102 1 28357832 28357832 28357832 28357832.0000 +Simla 018402 1 28357832 28357832 28357832 28357832.0000 +Steinberg 012003 1 39654943 39654943 39654943 39654943.0000 +Taoism 018603 1 39654943 39654943 39654943 39654943.0000 +attainments 012303 1 39654943 39654943 39654943 39654943.0000 +audiology 011403 1 39654943 39654943 39654943 39654943.0000 +balled 012301 1 5987435 5987435 5987435 5987435.0000 +bee 038001 1 5987435 5987435 5987435 5987435.0000 +betroth 030501 1 5987435 5987435 5987435 5987435.0000 +bivalves 018013 1 39654943 39654943 39654943 39654943.0000 +bloodbath 018042 1 28357832 28357832 28357832 28357832.0000 +cage 018201 1 5987435 5987435 5987435 5987435.0000 +capably 012501 1 5987435 5987435 5987435 5987435.0000 +checkpoints 018803 1 39654943 39654943 39654943 39654943.0000 +coexist 018601 1 5987435 5987435 5987435 5987435.0000 +contrasted 016001 1 5987435 5987435 5987435 5987435.0000 +daughter 012703 1 39654943 39654943 39654943 39654943.0000 +dental 038003 1 39654943 39654943 39654943 39654943.0000 +dimensions 038202 1 28357832 28357832 28357832 28357832.0000 +disable 019103 1 39654943 39654943 39654943 39654943.0000 +dogging 018002 1 28357832 28357832 28357832 28357832.0000 +dreaded 011401 1 5987435 5987435 5987435 5987435.0000 +epistle 018062 1 28357832 28357832 28357832 28357832.0000 +erases 016301 1 5987435 5987435 5987435 5987435.0000 +eschew 011702 1 28357832 28357832 28357832 28357832.0000 +featherweight 012701 1 5987435 5987435 5987435 5987435.0000 +fetched 018802 1 28357832 28357832 28357832 28357832.0000 +fetters 018012 1 28357832 28357832 28357832 28357832.0000 +firearm 018812 1 28357832 28357832 28357832 28357832.0000 +flint 018022 1 28357832 28357832 28357832 28357832.0000 +flopping 018023 1 39654943 39654943 39654943 39654943.0000 +gritty 018811 1 5987435 5987435 5987435 5987435.0000 +hushes 018202 1 28357832 28357832 28357832 28357832.0000 +imprint 030503 1 39654943 39654943 39654943 39654943.0000 +impulsive 012602 1 28357832 28357832 28357832 28357832.0000 +interdependent 018051 1 5987435 5987435 5987435 5987435.0000 +interrelationships 036001 1 5987435 5987435 5987435 5987435.0000 +kanji 038002 1 28357832 28357832 28357832 28357832.0000 +lawgiver 013601 1 5987435 5987435 5987435 5987435.0000 +leavings 013803 1 39654943 39654943 39654943 39654943.0000 +lectured 018102 1 28357832 28357832 28357832 28357832.0000 +leftover 016201 1 5987435 5987435 5987435 5987435.0000 +medical 018041 1 5987435 5987435 5987435 5987435.0000 +minima 019101 1 5987435 5987435 5987435 5987435.0000 +neat 012001 1 5987435 5987435 5987435 5987435.0000 +neonatal 018053 1 39654943 39654943 39654943 39654943.0000 +normalizes 038013 1 39654943 39654943 39654943 39654943.0000 +parters 011701 1 5987435 5987435 5987435 5987435.0000 +partridges 038103 1 39654943 39654943 39654943 39654943.0000 +persist 012302 1 28357832 28357832 28357832 28357832.0000 +pessimist 012702 1 28357832 28357832 28357832 28357832.0000 +quitter 011703 1 39654943 39654943 39654943 39654943.0000 +railway 038011 1 5987435 5987435 5987435 5987435.0000 +readable 013603 1 39654943 39654943 39654943 39654943.0000 +recruited 038201 1 5987435 5987435 5987435 5987435.0000 +reporters 018403 1 39654943 39654943 39654943 39654943.0000 +riser 036002 1 28357832 28357832 28357832 28357832.0000 +scholastics 011402 1 28357832 28357832 28357832 28357832.0000 +scornfully 018003 1 39654943 39654943 39654943 39654943.0000 +skulking 018021 1 5987435 5987435 5987435 5987435.0000 +sorters 018061 1 5987435 5987435 5987435 5987435.0000 +squeaking 013901 1 5987435 5987435 5987435 5987435.0000 +starlet 012603 1 39654943 39654943 39654943 39654943.0000 +stated 013602 1 28357832 28357832 28357832 28357832.0000 +subschema 018043 1 39654943 39654943 39654943 39654943.0000 +sweetish 018001 1 5987435 5987435 5987435 5987435.0000 +swelling 031901 1 5987435 5987435 5987435 5987435.0000 +teethe 000001 1 5987435 5987435 5987435 5987435.0000 +testicle 013801 1 5987435 5987435 5987435 5987435.0000 +vacuuming 018033 1 39654943 39654943 39654943 39654943.0000 +validate 038012 1 28357832 28357832 28357832 28357832.0000 +wallet 011501 1 5987435 5987435 5987435 5987435.0000 +whiteners 016202 1 28357832 28357832 28357832 28357832.0000 +witchcraft 019201 1 5987435 5987435 5987435 5987435.0000 +select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3; +companynr fld3 sum(price) +512 Micronesia 786542 +512 Miles 786542 +512 boat 786542 +512 capably 786542 +512 cupboard 786542 +512 decliner 786542 +512 descendants 786542 +512 dopers 786542 +512 erases 786542 +512 skies 786542 +select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr; +companynr count(*) min(fld3) max(fld3) sum(price) avg(price) +00 1 Omaha Omaha 5987435 5987435.0000 +36 1 dubbed dubbed 28357832 28357832.0000 +37 83 Abraham Wotan 1908978016 22999735.1325 +50 2 scribbled tapestry 68012775 34006387.5000 +select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1; +t3.companynr+0 t2nr fld3 sum(price) +37 1 Omaha 5987435 +37 11401 breaking 5987435 +37 11402 Romans 28357832 +37 11403 intercepted 39654943 +37 11501 bewilderingly 5987435 +37 11701 astound 5987435 +37 11702 admonishing 28357832 +37 11703 sumac 39654943 +37 12001 flanking 5987435 +37 12003 combed 39654943 +37 12301 Eulerian 5987435 +37 12302 dubbed 28357832 +37 12303 Kane 39654943 +37 12501 annihilates 5987435 +37 12602 Wotan 28357832 +37 12603 snatching 39654943 +37 12701 grazing 5987435 +37 12702 Baird 28357832 +37 12703 celery 39654943 +37 13601 handgun 5987435 +37 13602 foldout 28357832 +37 13603 mystic 39654943 +37 13801 intelligibility 5987435 +37 13802 Augustine 28357832 +37 13803 teethe 39654943 +37 13901 scholastics 5987435 +37 16001 audiology 5987435 +37 16201 wallet 5987435 +37 16202 parters 28357832 +37 16301 eschew 5987435 +37 16302 quitter 28357832 +37 16303 neat 39654943 +37 18001 jarring 5987435 +37 18002 tinily 28357832 +37 18003 balled 39654943 +37 18012 impulsive 28357832 +37 18013 starlet 39654943 +37 18021 lawgiver 5987435 +37 18022 stated 28357832 +37 18023 readable 39654943 +37 18032 testicle 28357832 +37 18033 Parsifal 39654943 +37 18041 Punjab 5987435 +37 18042 Merritt 28357832 +37 18043 Quixotism 39654943 +37 18051 sureties 5987435 +37 18052 puddings 28357832 +37 18053 tapestry 39654943 +37 18061 trimmings 5987435 +37 18062 humility 28357832 +37 18101 tragedies 5987435 +37 18102 skulking 28357832 +37 18103 flint 39654943 +37 18201 relaxing 5987435 +37 18202 offload 28357832 +37 18402 suites 28357832 +37 18403 lists 39654943 +37 18601 vacuuming 5987435 +37 18602 dentally 28357832 +37 18603 humanness 39654943 +37 18801 inch 5987435 +37 18802 Weissmuller 28357832 +37 18803 irresponsibly 39654943 +37 18811 repetitions 5987435 +37 18812 Antares 28357832 +37 19101 ventilate 5987435 +37 19102 pityingly 28357832 +37 19103 interdependent 39654943 +37 19201 Graves 5987435 +37 30501 neonatal 5987435 +37 30502 scribbled 28357832 +37 30503 chafe 39654943 +37 31901 realtor 5987435 +37 36001 elite 5987435 +37 36002 funereal 28357832 +37 38001 Conley 5987435 +37 38002 lectured 28357832 +37 38003 Abraham 39654943 +37 38011 groupings 5987435 +37 38012 dissociate 28357832 +37 38013 coexist 39654943 +37 38101 rusting 5987435 +37 38102 galling 28357832 +37 38103 obliterates 39654943 +37 38201 resumes 5987435 +37 38202 analyzable 28357832 +37 38203 terminator 39654943 +select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008; +sum(price) +234298 +select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1; +fld1 sum(price) +038008 234298 +explain select fld3 from t2 where 1>2 or 2>3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where false +explain select fld3 from t2 where fld1=fld1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1199 100.00 Parallel execute (4 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1199 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`fld3` AS `fld3` from `test`.`t2` where true +select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502; +companynr fld1 +34 250501 +34 250502 +select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000; +companynr count sum +00 82 10355753 +29 95 14473298 +34 70 17788966 +37 588 83602098 +41 52 12816335 +select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ; +companynr +00 +29 +34 +37 +41 +select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40; +companynr companyname count(*) +40 company 5 37 +41 company 6 52 +50 company 11 11 +53 company 7 4 +58 company 8 23 +65 company 9 10 +68 company 10 12 +select count(*) from t2; +count(*) +1199 +select count(*) from t2 where fld1 < 098024; +count(*) +387 +select min(fld1) from t2 where fld1>= 098024; +min(fld1) +98024 +select max(fld1) from t2 where fld1>= 098024; +max(fld1) +1232609 +select count(*) from t3 where price2=76234234; +count(*) +4181 +select count(*) from t3 where companynr=512 and price2=76234234; +count(*) +4181 +explain select min(fld1),max(fld1),count(*) from t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL index NULL fld1 4 NULL 1199 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t2`.`fld1`) AS `min(fld1)`,max(`test`.`t2`.`fld1`) AS `max(fld1)`,count(0) AS `count(*)` from `test`.`t2` +explain format=tree select min(fld1),max(fld1),count(*) from t2; +EXPLAIN +-> Count rows in t2 + +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +explain format=tree select min(fld1),max(fld1),count(*) from t2 where rand() > 0.5; +EXPLAIN +-> Aggregate: min(`min(fld1)`), max(`max(fld1)`), count(`count(*)`) + -> Parallel scan on + -> Aggregate: + -> Filter: (rand() > 0.5) (cost=123.65 rows=1199) + -> PQblock scan on t2 using fld1 (cost=123.65 rows=1199) + +select min(fld1),max(fld1),count(*) from t2; +min(fld1) max(fld1) count(*) +0 1232609 1199 +select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; +min(t2nr) max(t2nr) +2115 2115 +select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; +count(*) min(t2nr) max(t2nr) +4181 4 41804 +select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; +t2nr count(*) +9 1 +19 1 +29 1 +39 1 +49 1 +59 1 +69 1 +79 1 +89 1 +99 1 +109 1 +119 1 +129 1 +139 1 +149 1 +159 1 +169 1 +179 1 +189 1 +199 1 +select max(t2nr) from t3 where price=983543950; +max(t2nr) +41807 +select t1.period from t3 t1 limit 1; +period +1001 +select t1.period from t1 as t1 limit 1; +period +9410 +select t1.period as "Nuvarande period" from t1 as t1 limit 1; +Nuvarande period +9410 +select period as ok_period from t1 limit 1; +ok_period +9410 +select period as ok_period from t1 group by ok_period limit 1; +ok_period +9410 +select 1+1 as summa from t1 group by summa limit 1; +summa +2 +select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1; +Nuvarande period +9410 +show tables; +Tables_in_test +t1 +t2 +t3 +t4 +show tables from test like "s%"; +Tables_in_test (s%) +show tables from test like "t?"; +Tables_in_test (t?) +show full columns from t2; +Field Type Collation Null Key Default Extra Privileges Comment +auto int NULL NO PRI NULL auto_increment select,insert,update,references +fld1 int(6) unsigned zerofill NULL NO UNI 000000 select,insert,update,references +companynr tinyint(2) unsigned zerofill NULL NO 00 select,insert,update,references +fld3 char(30) utf8mb4_0900_ai_ci NO MUL select,insert,update,references +fld4 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld5 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld6 char(4) utf8mb4_0900_ai_ci NO select,insert,update,references +show full columns from t2 from test like 'f%'; +Field Type Collation Null Key Default Extra Privileges Comment +fld1 int(6) unsigned zerofill NULL NO UNI 000000 select,insert,update,references +fld3 char(30) utf8mb4_0900_ai_ci NO MUL select,insert,update,references +fld4 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld5 char(35) utf8mb4_0900_ai_ci NO select,insert,update,references +fld6 char(4) utf8mb4_0900_ai_ci NO select,insert,update,references +show full columns from t2 from test like 's%'; +Field Type Collation Null Key Default Extra Privileges Comment +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +show keys from t2; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Visible Expression +t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE YES NULL +t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE YES NULL +t2 1 fld3 1 fld3 A 1171 NULL NULL BTREE YES NULL +drop table t4, t3, t2, t1; +DO 1; +DO benchmark(100,1+1),1,1; +do default; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +do foobar; +ERROR 42S22: Unknown column 'foobar' in 'field list' +CREATE TABLE t1 ( +id mediumint(8) unsigned NOT NULL auto_increment, +pseudo varchar(35) NOT NULL default '', +PRIMARY KEY (id), +UNIQUE KEY pseudo (pseudo) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 (pseudo) VALUES ('test'); +INSERT INTO t1 (pseudo) VALUES ('test1'); +SELECT 1 as rnd1 from t1 where rand() > 2; +rnd1 +DROP TABLE t1; +CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1287 'BINARY as attribute of a type' is deprecated and will be removed in a future release. Please use a CHARACTER SET clause with _bin collation instead +INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); +CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +ERROR HY000: Incorrect DATETIME value: 'wrong-date-value' +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +DROP TABLE t1,t2; +create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (102935998719055004,'brade',1029359987,2,102935229116544068,102935229216544093); +select wss_type from t1 where wss_type ='102935229216544106'; +wss_type +select wss_type from t1 where wss_type ='102935229216544105'; +wss_type +select wss_type from t1 where wss_type ='102935229216544104'; +wss_type +select wss_type from t1 where wss_type ='102935229216544093'; +wss_type +102935229216544093 +select wss_type from t1 where wss_type =102935229216544093; +wss_type +102935229216544093 +drop table t1; +select 1+2,"aaaa",3.13*2.0 into @a,@b,@c; +select @a; +@a +3 +select @b; +@b +aaaa +select @c; +@c +6.260 +create table t1 (a int not null auto_increment primary key); +insert into t1 values (); +insert into t1 values (); +insert into t1 values (); +select * from (t1 as t2 left join t1 as t3 using (a)), t1; +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from t1, (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) straight_join t1; +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from t1 straight_join (t1 as t2 left join t1 as t3 using (a)); +a a +1 1 +1 2 +1 3 +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); +a +1 +2 +3 +select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +1 NULL +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); +a +1 +2 +3 +select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; +a +1 +2 +3 +select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; +a a +1 2 +1 3 +2 2 +2 3 +3 2 +3 3 +NULL 1 +select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; +a a +2 1 +2 2 +2 3 +3 1 +3 2 +3 3 +select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); +a +1 +2 +3 +select * from t1 right outer join (t1 as t2 left join t1 as t3 using (a)) using ( a ); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural right join t1; +a +1 +2 +3 +select * from t1 natural right join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from t1 natural join (t1 as t2 left join t1 as t3 using (a)); +a +1 +2 +3 +select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1; +a +1 +2 +3 +drop table t1; +CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522); +CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=INNODB; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522); +select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5; +aa id t2_id id +2 8299 2517 2517 +3 8301 2518 2518 +4 8302 2519 2519 +5 8303 2520 2520 +6 8304 2521 2521 +drop table t1,t2; +create table t1 (id1 int NOT NULL); +create table t2 (id2 int NOT NULL); +create table t3 (id3 int NOT NULL); +create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4)); +insert into t1 values (1); +insert into t1 values (2); +insert into t2 values (1); +insert into t4 values (1,1); +explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +2 SIMPLE t3 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +2 SIMPLE t4 NULL ref id4 id4 4 test.t3.id3 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`id1` AS `id1`,`test`.`t2`.`id2` AS `id2`,`test`.`t3`.`id3` AS `id3`,`test`.`t4`.`id4` AS `id4`,`test`.`t4`.`id44` AS `id44` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`id2` = `test`.`t1`.`id1`)) left join `test`.`t3` on((`test`.`t3`.`id3` = `test`.`t1`.`id1`)) left join `test`.`t4` on((`test`.`t4`.`id4` = `test`.`t3`.`id3`)) where ((`test`.`t2`.`id2` = 1) or (`test`.`t4`.`id4` = 1)) +select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3 +left join t4 on id3 = id4 where id2 = 1 or id4 = 1; +id1 id2 id3 id4 id44 +1 1 NULL NULL NULL +drop table t1,t2,t3,t4; +create table t1(s varchar(10) not null); +create table t2(s varchar(10) not null primary key); +create table t3(s varchar(10) not null primary key); +insert into t1 values ('one\t'), ('two\t'); +insert into t2 values ('one\r'), ('two\t'); +insert into t3 values ('one\b'), ('two\t'); +select * from t1 where s = 'one'; +s +select * from t2 where s = 'one'; +s +select * from t3 where s = 'one'; +s +one +select * from t1,t2 where t1.s = t2.s; +s s +two two +select * from t2,t3 where t2.s = t3.s; +s s +two two +drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +explain select * from t1 left join t2 on a=c where d in (4); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref c,d d 5 const 2 100.00 Using where +2 SIMPLE t1 NULL ref a a 5 test.t2.c 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ 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`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = 4)) +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref c,d d 5 const 2 100.00 Using where +2 SIMPLE t1 NULL ref a a 5 test.t2.c 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ 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`.`t1`.`a` = `test`.`t2`.`c`) and (`test`.`t2`.`d` = 4)) +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; +CREATE TABLE t1 ( +i int(11) NOT NULL default '0', +c char(10) NOT NULL default '', +PRIMARY KEY (i), +UNIQUE KEY c (c) +) ; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (1,'a'); +INSERT INTO t1 VALUES (2,'b'); +INSERT INTO t1 VALUES (3,'c'); +EXPLAIN SELECT i FROM t1 WHERE i=1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '1' AS `i` from `test`.`t1` where true +DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref a a 23 test.t1.a 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` USE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref a a 23 test.t1.a 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a` from `test`.`t1` left join `test`.`t2` FORCE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +DROP TABLE t1, t2; +CREATE TABLE t1 ( city char(30) ) charset utf8mb4; +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`city` AS `city` from `test`.`t1` where (`test`.`t1`.`city` = 'London') +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 50.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`city` AS `city` from `test`.`t1` where ((`test`.`t1`.`city` = 'London') and (`test`.`t1`.`city` like '%london%')) +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; +create table t1 (a int(11) unsigned, b int(11) unsigned); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,0), (1,1), (4294967295,1); +select a-b from t1 order by 1; +a-b +0 +1 +4294967294 +select a-b , (a-b < 0) from t1 order by 1; +a-b (a-b < 0) +0 0 +1 0 +4294967294 0 +select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0; +d (a-b >= 0) b +1 1 0 +0 1 1 +select cast((a - b) as unsigned) from t1 order by 1; +cast((a - b) as unsigned) +0 +1 +4294967294 +drop table t1; +create table t1 (a int(11)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +select all all * from t1; +a +select distinct distinct * from t1; +a +select all distinct * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +select distinct all * from t1; +ERROR HY000: Incorrect usage of ALL and DISTINCT +drop table t1; +CREATE TABLE t1 ( +kunde_intern_id int(10) unsigned NOT NULL default '0', +kunde_id int(10) unsigned NOT NULL default '0', +FK_firma_id int(10) unsigned NOT NULL default '0', +aktuell enum('Ja','Nein') NOT NULL default 'Ja', +vorname varchar(128) NOT NULL default '', +nachname varchar(128) NOT NULL default '', +geloescht enum('Ja','Nein') NOT NULL default 'Nein', +firma varchar(128) NOT NULL default '' +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +(3964,3051,1,'Ja','Vorname1','1Nachname','Nein','Print Schau XXXX'), +(3965,3051111,1,'Ja','Vorname1111','1111Nachname','Nein','Print Schau XXXX'); +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, geloescht FROM t1 +WHERE +( +( +( '' != '' AND firma LIKE CONCAT('%', '', '%')) +OR +(vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND +'Vorname1' != '' AND 'xxxx' != '') +) +AND +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT kunde_id ,FK_firma_id ,aktuell, vorname, nachname, +geloescht FROM t1 +WHERE +( +( +aktuell = 'Ja' AND geloescht = 'Nein' AND FK_firma_id = 2 +) +AND +( +( '' != '' AND firma LIKE CONCAT('%', '', '%') ) +OR +( vorname LIKE CONCAT('%', 'Vorname1', '%') AND +nachname LIKE CONCAT('%', '1Nachname', '%') AND 'Vorname1' != '' AND +'xxxx' != '') +) +) +; +kunde_id FK_firma_id aktuell vorname nachname geloescht +SELECT COUNT(*) FROM t1 WHERE +( 0 OR (vorname LIKE '%Vorname1%' AND nachname LIKE '%1Nachname%' AND 1)) +AND FK_firma_id = 2; +COUNT(*) +0 +drop table t1; +CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (0x8000000000000000); +SELECT b FROM t1 WHERE b=0x8000000000000000; +b +9223372036854775808 +DROP TABLE t1; +CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `t2` VALUES (0,'READ'); +CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `t3` VALUES (1,'fs'); +select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0); +id name gid uid ident level +1 fs NULL NULL 0 READ +drop table t1,t2,t3; +CREATE TABLE t1 ( +acct_id int(11) NOT NULL default '0', +profile_id smallint(6) default NULL, +UNIQUE KEY t1$acct_id (acct_id), +KEY t1$profile_id (profile_id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (132,17),(133,18); +CREATE TABLE t2 ( +profile_id smallint(6) default NULL, +queue_id int(11) default NULL, +seq int(11) default NULL, +KEY t2$queue_id (queue_id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1); +CREATE TABLE t3 ( +id int(11) NOT NULL default '0', +qtype int(11) default NULL, +seq int(11) default NULL, +warn_lvl int(11) default NULL, +crit_lvl int(11) default NULL, +rr1 tinyint(4) NOT NULL default '0', +rr2 int(11) default NULL, +default_queue tinyint(4) NOT NULL default '0', +KEY t3$qtype (qtype), +KEY t3$id (id) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0), +(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0); +SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q +WHERE +(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND +(pq.queue_id = q.id) AND (q.rr1 <> 1); +COUNT(*) +4 +drop table t1,t2,t3; +create table t1 (f1 int); +insert into t1 values (1),(NULL); +create table t2 (f2 int, f3 int, f4 int); +create index idx1 on t2 (f4); +insert into t2 values (1,2,3),(2,4,6); +select A.f2 from t1 left join t2 A on A.f2 = f1 where A.f3=(select min(f3) +from t2 C where A.f4 = C.f4) or A.f3 IS NULL; +f2 +1 +NULL +drop table t1,t2; +create table t2 (a tinyint unsigned); +create index t2i on t2(a); +insert into t2 values (0), (254), (255); +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +explain select * from t2 where a > -1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index t2i t2i 2 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a` is not null) +select * from t2 where a > -1; +a +0 +254 +255 +drop table t2; +CREATE TABLE t1 (a int, b int, c int); +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +SELECT * FROM t1; +a b c +50 3 3 +INSERT INTO t1 +SELECT 50, 3, 3 FROM DUAL +WHERE NOT EXISTS +(SELECT * FROM t1 WHERE a = 50 AND b = 3); +select found_rows(); +found_rows() +0 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +SELECT * FROM t1; +a b c +50 3 3 +select count(*) from t1; +count(*) +1 +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +select count(*) from t1 limit 2,3; +count(*) +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +select SQL_CALC_FOUND_ROWS count(*) from t1 limit 2,3; +count(*) +Warnings: +Warning 1287 SQL_CALC_FOUND_ROWS is deprecated and will be removed in a future release. Consider using two separate queries instead. +select found_rows(); +found_rows() +1 +Warnings: +Warning 1287 FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead. +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +(SELECT a, b AS c FROM t1) ORDER BY c+1; +a c +(SELECT a, b AS c FROM t1) ORDER BY b+1; +a c +SELECT a, b AS c FROM t1 ORDER BY c+1; +a c +SELECT a, b AS c FROM t1 ORDER BY b+1; +a c +drop table t1; +create table t1(f1 int, f2 int); +create table t2(f3 int); +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1)); +f1 +select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL)); +f1 +insert into t1 values(1,1),(2,null); +insert into t2 values(2); +select * from t1,t2 where f1=f3 and (f1,f2) = (2,null); +f1 f2 f3 +select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null); +f1 f2 f3 +2 NULL 2 +drop table t1,t2; +create table t1 (f1 int not null auto_increment primary key, f2 varchar(10)); +create table t11 like t1; +insert into t1 values(1,""),(2,""); +analyze table t1, t11; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t11 analyze status OK +show table status like 't1%'; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 InnoDB 10 Dynamic 2 8192 X X X X X X X X X NULL +t11 InnoDB 10 Dynamic 0 0 X X X X X X X X X NULL +select 123 as a from t1 where f1 is null; +a +drop table t1,t11; +CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) ); +INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4); +CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, e INT ); +INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2),(1,2,3); +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 10 2 +1 11 2 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c; +a b c d +1 10 4 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN +t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c; +a b c d +1 10 2 +1 11 2 +1 2 1 1 +1 2 2 1 +1 2 3 1 +SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2,t1 +WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c; +a b c d +1 2 1 1 +1 2 2 1 +1 2 3 1 +DROP TABLE IF EXISTS t1, t2; +create table t1 (f1 int primary key, f2 int); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t1 values (1,1); +insert into t2 values (1,1),(1,2); +select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1; +count(f2) >0 +1 +drop table t1,t2; +create table t1 (f1 int,f2 int); +insert into t1 values(1,1); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t2 values(1,1); +select * from t1 where f1 in (select f3 from t2 where (f3,f4)= (select f3,f4 from t2)); +f1 f2 +1 1 +drop table t1,t2; +CREATE TABLE t1(a int, b int, c int, KEY b(b), KEY c(c)); +insert into t1 values (1,0,0),(2,0,0); +CREATE TABLE t2 (a int, b varchar(2), c varchar(2), PRIMARY KEY(a)); +insert into t2 values (1,'',''), (2,'',''); +CREATE TABLE t3 (a int, b int, PRIMARY KEY (a,b), KEY a (a), KEY b (b)); +insert into t3 values (1,1),(1,2); +explain select straight_join DISTINCT t2.a,t2.b, t1.c from t1, t3, t2 +where (t1.c=t2.a or (t1.c=t3.a and t2.a=t3.b)) and t1.b=556476786 and +t2.b like '%%' order by t2.b limit 0,1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ref b,c b 5 const 1 100.00 Using temporary; Using filesort +1 SIMPLE t3 NULL index PRIMARY,a,b a 4 NULL 2 100.00 Using index +1 SIMPLE t2 NULL ALL PRIMARY NULL NULL NULL 2 50.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select straight_join distinct `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` join `test`.`t3` join `test`.`t2` where ((`test`.`t1`.`b` = 556476786) and ((`test`.`t2`.`a` = `test`.`t1`.`c`) or ((`test`.`t2`.`a` = `test`.`t3`.`b`) and (`test`.`t3`.`a` = `test`.`t1`.`c`))) and (`test`.`t2`.`b` like '%%')) order by `test`.`t2`.`b` limit 0,1 +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (a int, INDEX idx(a)); +INSERT INTO t1 VALUES (2), (3), (1); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 IGNORE INDEX (idx); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` IGNORE INDEX (`idx`) +EXPLAIN SELECT * FROM t1 IGNORE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +EXPLAIN SELECT * FROM t1 FORCE INDEX (a); +ERROR 42000: Key 'a' doesn't exist in table 't1' +DROP TABLE t1; +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 VALUES (1,1), (2,1), (4,10); +CREATE TABLE t2 (a int PRIMARY KEY, b int, KEY b (b)); +INSERT INTO t2 VALUES (1,NULL), (2,10); +ALTER TABLE t1 ENABLE KEYS; +Warnings: +Note 1031 Table storage engine for 't1' doesn't have this option +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index b b 5 NULL 2 100.00 Using index +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select straight_join count(0) AS `COUNT(*)` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) or (`test`.`t2`.`b` is null)) +SELECT STRAIGHT_JOIN * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +a b a b +1 NULL 1 1 +1 NULL 2 1 +1 NULL 4 10 +2 10 4 10 +EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL index b b 5 NULL 2 100.00 Using index +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select straight_join count(0) AS `COUNT(*)` from `test`.`t2` join `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`b`) or (`test`.`t2`.`b` is null)) +SELECT STRAIGHT_JOIN * FROM t2, t1 WHERE t1.b = t2.b OR t2.b IS NULL; +a b a b +1 NULL 1 1 +1 NULL 2 1 +1 NULL 4 10 +2 10 4 10 +DROP TABLE IF EXISTS t1,t2; +CREATE TABLE t1 (key1 double default NULL, UNIQUE KEY key1 (key1)); +CREATE TABLE t2 (key2 double default NULL, UNIQUE KEY key2 (key2)); +INSERT INTO t1 VALUES (0.3762),(0.3845),(0.6158),(0.7941); +INSERT INTO t2 VALUES (1.3762),(1.3845),(1.6158),(1.7941); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +explain select max(key1) from t1 where key1 <= 0.6158; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)` from `test`.`t1` where (`test`.`t1`.`key1` <= 0.6158) +explain select max(key2) from t2 where key2 <= 1.6158; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t2`.`key2`) AS `max(key2)` from `test`.`t2` where (`test`.`t2`.`key2` <= 1.6158) +explain select min(key1) from t1 where key1 >= 0.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where (`test`.`t1`.`key1` >= 0.3762) +explain select min(key2) from t2 where key2 >= 1.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t2`.`key2`) AS `min(key2)` from `test`.`t2` where (`test`.`t2`.`key2` >= 1.3762) +explain select max(key1), min(key2) from t1, t2 +where key1 <= 0.6158 and key2 >= 1.3762; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)`,min(`test`.`t2`.`key2`) AS `min(key2)` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`key1` <= 0.6158) and (`test`.`t2`.`key2` >= 1.3762)) +explain select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range key1 key1 9 NULL 3 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select max(`test`.`t1`.`key1`) AS `max(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` <= 0.6158) and ((rand() + 0.5) >= 0.5)) +explain select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL index key1 key1 9 NULL 4 100.00 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select min(`test`.`t1`.`key1`) AS `min(key1)` from `test`.`t1` where ((`test`.`t1`.`key1` >= 0.3762) and ((rand() + 0.5) >= 0.5)) +select max(key1) from t1 where key1 <= 0.6158; +max(key1) +0.6158 +select max(key2) from t2 where key2 <= 1.6158; +max(key2) +1.6158 +select min(key1) from t1 where key1 >= 0.3762; +min(key1) +0.3762 +select min(key2) from t2 where key2 >= 1.3762; +min(key2) +1.3762 +select max(key1), min(key2) from t1, t2 +where key1 <= 0.6158 and key2 >= 1.3762; +max(key1) min(key2) +0.6158 1.3762 +select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; +max(key1) +0.6158 +select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; +min(key1) +0.3762 +DROP TABLE t1,t2; +CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL); +INSERT INTO t1 VALUES (10); +SELECT i='1e+01',i=1e+01, i in (1e+01,1e+01), i in ('1e+01','1e+01') FROM t1; +i='1e+01' i=1e+01 i in (1e+01,1e+01) i in ('1e+01','1e+01') +1 1 1 1 +DROP TABLE t1; +create table t1(a bigint unsigned, b bigint); +insert ignore into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff), +(0x10000000000000000, 0x10000000000000000), +(0x8fffffffffffffff, 0x8fffffffffffffff); +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +Warning 1264 Out of range value for column 'b' at row 1 +Warning 1264 Out of range value for column 'a' at row 2 +Warning 1264 Out of range value for column 'b' at row 2 +Warning 1264 Out of range value for column 'b' at row 3 +select hex(a), hex(b) from t1; +hex(a) hex(b) +FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +8FFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF +drop table t1; +CREATE TABLE t1 (c0 int); +CREATE TABLE t2 (c0 int); +INSERT INTO t1 VALUES(@@connect_timeout); +INSERT INTO t2 VALUES(@@connect_timeout); +SELECT * FROM t1 JOIN t2 ON t1.c0 = t2.c0 WHERE (t1.c0 <=> @@connect_timeout); +c0 c0 +X X +DROP TABLE t1, t2; +End of 4.1 tests +CREATE TABLE t1 ( +K2C4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '', +K4N4 varchar(4) character set latin1 collate latin1_bin NOT NULL default '0000', +F2I4 int(11) NOT NULL default '0' +) DEFAULT CHARSET=latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES +('W%RT', '0100', 1), +('W-RT', '0100', 1), +('WART', '0100', 1), +('WART', '0200', 1), +('WERT', '0100', 2), +('WORT','0200', 2), +('WT', '0100', 2), +('W_RT', '0100', 2), +('WaRT', '0100', 3), +('WART', '0300', 3), +('WRT' , '0400', 3), +('WURM', '0500', 3), +('W%T', '0600', 4), +('WA%T', '0700', 4), +('WA_T', '0800', 4); +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND +(F2I4 = 2 AND K2C4 = 'WART' OR (F2I4 = 2 OR K4N4 = '0200')); +K2C4 K4N4 F2I4 +WART 0200 1 +SELECT K2C4, K4N4, F2I4 FROM t1 +WHERE K2C4 = 'WART' AND (K2C4 = 'WART' OR K4N4 = '0200'); +K2C4 K4N4 F2I4 +WART 0100 1 +WART 0200 1 +WART 0300 3 +DROP TABLE t1; +create table t1 (a int, b int); +create table t2 like t1; +select t1.a from (t1 inner join t2 on t1.a=t2.a) where t2.a=1; +a +select t1.a from ((t1 inner join t2 on t1.a=t2.a)) where t2.a=1; +a +select x.a, y.a, z.a from ( (t1 x inner join t2 y on x.a=y.a) inner join t2 z on y.a=z.a) WHERE x.a=1; +a a a +drop table t1,t2; +create table t1 (s1 varchar(5)); +insert into t1 values ('Wall'); +select min(s1) from t1 group by s1 with rollup; +min(s1) +Wall +Wall +drop table t1; +create table t1 (s1 int); +insert into t1 values (0); +select avg(distinct s1) from t1 group by s1 with rollup; +avg(distinct s1) +0.0000 +0.0000 +drop table t1; +create table t1 (s1 int); +insert into t1 values (null),(1); +select avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +1.0000 +select distinct avg(s1) as x from t1 group by s1 with rollup; +x +NULL +1.0000 +drop table t1; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +INSERT INTO t2 VALUES (2), (4), (6); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +a +2 +4 +EXPLAIN SELECT t1.a FROM t1 STRAIGHT_JOIN t2 ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 3 33.33 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` straight_join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`a`) +EXPLAIN SELECT t1.a FROM t1 INNER JOIN t2 ON t1.a=t2.a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 3 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 20.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`) +DROP TABLE t1,t2; +select x'10' + 0, X'10' + 0, b'10' + 0, B'10' + 0; +x'10' + 0 X'10' + 0 b'10' + 0 B'10' + 0 +16 16 2 2 +create table t1 (f1 varchar(6) default NULL, f2 int(6) primary key not null); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (f3 varchar(5) not null, f4 varchar(5) not null, UNIQUE KEY UKEY (f3,f4)); +insert into t1 values (" 2", 2); +insert into t2 values (" 2", " one "),(" 2", " two "); +select * from t1 left join t2 on f1 = f3; +f1 f2 f3 f4 + 2 2 2 one + 2 2 2 two +drop table t1,t2; +create table t1 (empnum smallint, grp int); +create table t2 (empnum int, name char(5)); +insert into t1 values(1,1); +insert into t2 values(1,'bob'); +create view v1 as select * from t2 inner join t1 using (empnum); +select * from v1; +empnum name grp +1 bob 1 +drop table t1,t2; +drop view v1; +create table t1 (pk int primary key, b int); +create table t2 (pk int primary key, c int); +select pk from t1 inner join t2 using (pk); +pk +drop table t1,t2; +create table t1 (s1 int, s2 char(5), s3 decimal(10)); +create view v1 as select s1, s2, 'x' as s3 from t1; +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'x' +insert into t1 values (1,'x',5); +select * from t1 natural join v1; +s1 s2 s3 +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: 'x' +drop table t1; +drop view v1; +create table t1(a1 int); +create table t2(a2 int); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +create view v2 (c) as select a1 from t1; +select * from t1 natural left join t2; +a1 a2 +1 1 +1 2 +2 1 +2 2 +select * from t1 natural right join t2; +a2 a1 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural left join t2; +c a2 +1 1 +1 2 +2 1 +2 2 +select * from v2 natural right join t2; +a2 c +1 1 +1 2 +2 1 +2 2 +drop table t1, t2; +drop view v2; +create table t1 (a int(10), t1_val int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (b int(10), t2_val int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t3 (a int(10), b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,1),(2,2); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(2,1),(3,1),(4,1); +select * from t1 natural join t2 natural join t3; +a b t1_val t2_val +1 1 1 1 +2 1 2 1 +select * from t1 natural join t3 natural join t2; +b a t1_val t2_val +1 1 1 1 +1 2 2 1 +drop table t1, t2, t3; +DO IFNULL(NULL, NULL); +SELECT CAST(IFNULL(NULL, NULL) AS DECIMAL); +CAST(IFNULL(NULL, NULL) AS DECIMAL) +NULL +SELECT ABS(IFNULL(NULL, NULL)); +ABS(IFNULL(NULL, NULL)) +NULL +SELECT IFNULL(NULL, NULL); +IFNULL(NULL, NULL) +NULL +SET @OLD_SQL_MODE12595=@@SQL_MODE, @@SQL_MODE=''; +SHOW LOCAL VARIABLES LIKE 'SQL_MODE'; +Variable_name Value +sql_mode +CREATE TABLE BUG_12595(a varchar(100)) charset latin1; +INSERT INTO BUG_12595 VALUES ('hakan%'), ('hakank'), ("ha%an"); +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE ''; +a +hakan% +hakank +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE ''; +a +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha%%an' ESCAPE '%'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE '\\'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|'; +a +ha%an +SET @@SQL_MODE='NO_BACKSLASH_ESCAPES'; +SHOW LOCAL VARIABLES LIKE 'SQL_MODE'; +Variable_name Value +sql_mode NO_BACKSLASH_ESCAPES +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%'; +a +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*'; +a +hakan% +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE '\\'; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE ''; +ERROR HY000: Incorrect arguments to ESCAPE +SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|'; +a +ha%an +SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\n%' ESCAPE '\n'; +ERROR HY000: Incorrect arguments to ESCAPE +SET @@SQL_MODE=@OLD_SQL_MODE12595; +DROP TABLE BUG_12595; +create table t1 (a char(1)); +create table t2 (a char(1)); +insert into t1 values ('a'),('b'),('c'); +insert into t2 values ('b'),('c'),('d'); +select a from t1 natural join t2; +a +b +c +select * from t1 natural join t2 where a = 'b'; +a +b +drop table t1, t2; +CREATE TABLE t1 (`id` TINYINT); +CREATE TABLE t2 (`id` TINYINT); +CREATE TABLE t3 (`id` TINYINT); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (2); +INSERT INTO t3 VALUES (3); +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT t1.id,t3.id FROM t1 JOIN t2 ON (t2.notacolumn=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM t1 JOIN t2 ON (t2.id=t1.id) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +SELECT id,t3.id FROM (t1 JOIN t2 ON (t2.id=t1.id)) LEFT JOIN t3 USING (id); +ERROR 23000: Column 'id' in from clause is ambiguous +drop table t1, t2, t3; +create table t1 (a int(10),b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +create table t2 (a int(10),b int(10)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1,10),(2,20),(3,30); +insert into t2 values (1,10); +select * from t1 inner join t2 using (A); +a b b +1 10 10 +select * from t1 inner join t2 using (a); +a b b +1 10 10 +drop table t1, t2; +create table t1 (a int, c int); +create table t2 (b int); +create table t3 (b int, a int); +create table t4 (c int); +insert into t1 values (1,1); +insert into t2 values (1); +insert into t3 values (1,1); +insert into t4 values (1); +select * from t1 join t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +a c b b a +1 1 1 1 1 +select * from t1, t2 join t3 on (t2.b = t3.b and t1.a = t3.a); +ERROR 42S22: Unknown column 't1.a' in 'on clause' +select * from t1 join t2 join t3 join t4 on (t1.a = t4.c and t2.b = t4.c); +a c b b a c +1 1 1 1 1 1 +select * from t1 join t2 join t4 using (c); +c a b +1 1 1 +drop table t1, t2, t3, t4; +create table t1(x int, y int); +create table t2(x int, y int); +create table t3(x int, primary key(x)); +insert into t1 values (1, 1), (2, 1), (3, 1), (4, 3), (5, 6), (6, 6); +insert into t2 values (1, 1), (2, 1), (3, 3), (4, 6), (5, 6); +insert into t3 values (1), (2), (3), (4), (5); +select t1.x, t3.x from t1, t2, t3 where t1.x = t2.x and t3.x >= t1.y and t3.x <= t2.y; +x x +1 1 +2 1 +3 1 +3 2 +3 3 +4 3 +4 4 +4 5 +drop table t1,t2,t3; +create table t1 (id char(16) not null default '', primary key (id)); +insert into t1 values ('100'),('101'),('102'); +create table t2 (id char(16) default null); +insert into t2 values (1); +create view v1 as select t1.id from t1; +create view v2 as select t2.id from t2; +create view v3 as select (t1.id+2) as id from t1 natural left join t2; +select t1.id from t1 left join v2 using (id); +id +100 +101 +102 +select t1.id from v2 right join t1 using (id); +id +100 +101 +102 +select t1.id from t1 left join v3 using (id); +id +100 +101 +102 +select * from t1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join t1 using (id); +id +100 +101 +102 +select * from t1 left join v3 using (id); +id +100 +101 +102 +select v1.id from v1 left join v2 using (id); +id +100 +101 +102 +select v1.id from v2 right join v1 using (id); +id +100 +101 +102 +select v1.id from v1 left join v3 using (id); +id +100 +101 +102 +select * from v1 left join v2 using (id); +id +100 +101 +102 +select * from v2 right join v1 using (id); +id +100 +101 +102 +select * from v1 left join v3 using (id); +id +100 +101 +102 +drop table t1, t2; +drop view v1, v2, v3; +create table t1 (id int(11) not null default '0'); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (123),(191),(192); +create table t2 (id char(16) character set utf8 not null); +Warnings: +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t2 values ('58013'),('58014'),('58015'),('58016'); +create table t3 (a_id int(11) not null, b_id char(16) character set utf8); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. +insert into t3 values (123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013'); +select count(*) +from t1 inner join (t3 left join t2 on t2.id = t3.b_id) on t1.id = t3.a_id; +count(*) +6 +select count(*) +from t1 inner join (t2 right join t3 on t2.id = t3.b_id) on t1.id = t3.a_id; +count(*) +6 +drop table t1,t2,t3; +create table t1 (a int); +create table t2 (b int); +create table t3 (c int); +select * from t1 join t2 join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 left join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 right join t3 on (t1.a=t3.c); +a b c +select * from t1 join t2 straight_join t3 on (t1.a=t3.c); +a b c +drop table t1, t2 ,t3; +create table t1(f1 int, f2 date); +insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'), +(4,'2005-10-01'),(5,'2005-12-30'); +select * from t1 where f2 >= 0 order by f2; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +select * from t1 where f2 >= '0000-00-00' order by f2; +ERROR HY000: Incorrect DATE value: '0000-00-00' +select * from t1 where f2 >= '2005-09-31' order by f2; +ERROR HY000: Incorrect DATE value: '2005-09-31' +select * from t1 where f2 >= '2005-09-3a' order by f2; +f1 f2 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +select * from t1 where f2 <= '2005-09-31' order by f2; +ERROR HY000: Incorrect DATE value: '2005-09-31' +select * from t1 where f2 <= '2005-09-3a' order by f2; +f1 f2 +1 2005-01-01 +2 2005-09-01 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +drop table t1; +create table t1 (f1 int, f2 int); +insert into t1 values (1, 30), (2, 20), (3, 10); +create algorithm=merge view v1 as select f1, f2 from t1; +create algorithm=merge view v2 (f2, f1) as select f1, f2 from t1; +create algorithm=merge view v3 as select t1.f1 as f2, t1.f2 as f1 from t1; +select t1.f1 as x1, f1 from t1 order by t1.f1; +x1 f1 +1 1 +2 2 +3 3 +select v1.f1 as x1, f1 from v1 order by v1.f1; +x1 f1 +1 1 +2 2 +3 3 +select v2.f1 as x1, f1 from v2 order by v2.f1; +x1 f1 +10 10 +20 20 +30 30 +select v3.f1 as x1, f1 from v3 order by v3.f1; +x1 f1 +10 10 +20 20 +30 30 +select f1, f2, v1.f1 as x1 from v1 order by v1.f1; +f1 f2 x1 +1 30 1 +2 20 2 +3 10 3 +select f1, f2, v2.f1 as x1 from v2 order by v2.f1; +f1 f2 x1 +10 3 10 +20 2 20 +30 1 30 +select f1, f2, v3.f1 as x1 from v3 order by v3.f1; +f1 f2 x1 +10 3 10 +20 2 20 +30 1 30 +drop table t1; +drop view v1, v2, v3; +CREATE TABLE t1(key_a int4 NOT NULL, optimus varchar(32), PRIMARY KEY(key_a)); +CREATE TABLE t2(key_a int4 NOT NULL, prime varchar(32), PRIMARY KEY(key_a)); +CREATE table t3(key_a int4 NOT NULL, key_b int4 NOT NULL, foo varchar(32), +PRIMARY KEY(key_a,key_b)); +INSERT INTO t1 VALUES (0,''); +INSERT INTO t1 VALUES (1,'i'); +INSERT INTO t1 VALUES (2,'j'); +INSERT INTO t1 VALUES (3,'k'); +INSERT INTO t2 VALUES (1,'r'); +INSERT INTO t2 VALUES (2,'s'); +INSERT INTO t2 VALUES (3,'t'); +INSERT INTO t3 VALUES (1,5,'x'); +INSERT INTO t3 VALUES (1,6,'y'); +INSERT INTO t3 VALUES (2,5,'xx'); +INSERT INTO t3 VALUES (2,6,'yy'); +INSERT INTO t3 VALUES (2,7,'zz'); +INSERT INTO t3 VALUES (3,5,'xxx'); +SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +key_a foo +2 xx +EXPLAIN SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t1.key_a = t2.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t3 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `key_a`,'xx' AS `foo` from `test`.`t1` join `test`.`t2` join `test`.`t3` where true +SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +key_a foo +2 xx +EXPLAIN SELECT t2.key_a,foo +FROM t1 INNER JOIN t2 ON t2.key_a = t1.key_a +INNER JOIN t3 ON t1.key_a = t3.key_a +WHERE t2.key_a=2 and key_b=5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 Using index +1 SIMPLE t3 NULL const PRIMARY PRIMARY 8 const,const 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `key_a`,'xx' AS `foo` from `test`.`t1` join `test`.`t2` join `test`.`t3` where true +DROP TABLE t1,t2,t3; +create table t1 (f1 int); +insert into t1 values(1),(2); +create table t2 (f2 int, f3 int, key(f2)); +insert into t2 values(1,1),(2,2); +create table t3 (f4 int not null); +insert into t3 values (2),(2),(2); +select f1,(select count(*) from t2,t3 where f2=f1 and f3=f4) as count from t1; +f1 count +1 0 +2 3 +drop table t1,t2,t3; +create table t1 (f1 int unique); +create table t2 (f2 int unique); +create table t3 (f3 int unique); +insert into t1 values(1),(2); +insert into t2 values(1),(2); +insert into t3 values(1),(NULL); +select * from t3 where f3 is null; +f3 +NULL +select t2.f2 from t1 left join t2 on f1=f2 join t3 on f1=f3 where f1=1; +f2 +1 +drop table t1,t2,t3; +create table t1(f1 char, f2 char not null); +insert into t1 values(null,'a'); +create table t2 (f2 char not null); +insert into t2 values('b'); +select * from t1 left join t2 on f1=t2.f2 where t1.f2='a'; +f1 f2 f2 +NULL a NULL +drop table t1,t2; +select * from (select * left join t on f1=f2) tt; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'left join t on f1=f2) tt' at line 1 +CREATE TABLE t1 (sku int PRIMARY KEY, pr int); +CREATE TABLE t2 (sku int PRIMARY KEY, sppr int, name varchar(255)); +INSERT INTO t1 VALUES +(10, 10), (20, 10), (30, 20), (40, 30), (50, 10), (60, 10); +INSERT INTO t2 VALUES +(10, 10, 'aaa'), (20, 10, 'bbb'), (30, 10, 'ccc'), (40, 20, 'ddd'), +(50, 10, 'eee'), (60, 20, 'fff'), (70, 20, 'ggg'), (80, 30, 'hhh'); +SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr +FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku); +sku sppr name sku pr +20 10 bbb 10 10 +20 10 bbb 20 10 +EXPLAIN +SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr +FROM t2, t1 WHERE t2.sku=20 AND (t2.sku=t1.sku OR t2.sppr=t1.sku); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select '20' AS `sku`,'10' AS `sppr`,'bbb' AS `name`,`test`.`t1`.`sku` AS `sku`,`test`.`t1`.`pr` AS `pr` from `test`.`t2` join `test`.`t1` where (((`test`.`t1`.`sku` = 20) or (`test`.`t1`.`sku` = '10'))) +DROP TABLE t1,t2; +SET SQL_MODE='NO_UNSIGNED_SUBTRACTION'; +CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL); +INSERT t1 SET i = 0; +UPDATE t1 SET i = -1; +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +UPDATE t1 SET i = CAST(i - 1 AS SIGNED); +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +UPDATE t1 SET i = i - 1; +Warnings: +Warning 1264 Out of range value for column 'i' at row 1 +SELECT * FROM t1; +i +0 +DROP TABLE t1; +SET SQL_MODE=default; +create table t1 (a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t2 (a int, b int, c int, e int, primary key(a,b,c)); +# The "ANALYZE TABLE"-command that is executed further down will get +# different results depending on the order of rows in table t2. Since the +# INSERT INTO ... SELECT may be executed using different execution plans, +# we've added ORDER BY to ensure that we rows has the same order every +# time. If not, the estimated number of rows for t2 (alias 'a') in the +# EXPLAIN may change on different platforms. Note that both table t1 and +# t2 may be MYISAM, since many of the test files that includes this file +# forces MYISAM as the default storage engine. +insert into t2 select A.a, B.a, C.a, C.a from t1 A, t1 B, t1 C +ORDER BY A.a, B.a, C.a; +analyze table t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +select 'In next EXPLAIN, B.rows must be exactly 10:' Z; +Z +In next EXPLAIN, B.rows must be exactly 10: +explain select * from t2 a, t2 b where a.a=5 and a.b=5 and a.c<5 +and b.a=5 and b.b=a.e and (b.b =1 or b.b = 3 or b.b=5); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 27.10 Parallel execute (1 workers) +2 SIMPLE a NULL range PRIMARY PRIMARY 12 NULL 5 27.10 Using where +2 SIMPLE b NULL ref PRIMARY PRIMARY 8 const,test.a.e 10 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`a`.`a` AS `a`,`test`.`a`.`b` AS `b`,`test`.`a`.`c` AS `c`,`test`.`a`.`e` AS `e`,`test`.`b`.`a` AS `a`,`test`.`b`.`b` AS `b`,`test`.`b`.`c` AS `c`,`test`.`b`.`e` AS `e` from `test`.`t2` `a` join `test`.`t2` `b` where ((`test`.`b`.`b` = `test`.`a`.`e`) and (`test`.`b`.`a` = 5) and (`test`.`a`.`b` = 5) and (`test`.`a`.`a` = 5) and (`test`.`a`.`c` < 5) and ((`test`.`a`.`e` = 1) or (`test`.`a`.`e` = 3) or (`test`.`a`.`e` = 5))) +drop table t1, t2; +CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX(b)); +INSERT INTO t1 VALUES (1, 3), (9,4), (7,5), (4,5), (6,2), +(3,1), (5,1), (8,9), (2,2), (0,9); +CREATE TABLE t2 (c int, d int, f int, INDEX(c,f)); +INSERT INTO t2 VALUES +(1,0,0), (1,0,1), (2,0,0), (2,0,1), (3,0,0), (4,0,1), +(5,0,0), (5,0,1), (6,0,0), (0,0,1), (7,0,0), (7,0,1), +(0,0,0), (0,0,1), (8,0,0), (8,0,1), (9,0,0), (9,0,1); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,b b 5 NULL 3 100.00 Using where; Using index +2 SIMPLE t2 NULL ref c c 5 test.t1.a 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2`.`f` AS `f` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` between 4 and 6)) +EXPLAIN +SELECT a, c, d, f FROM t1,t2 WHERE a=c AND b BETWEEN 4 AND 6 AND a > 0; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 90.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY,b b 9 NULL 3 90.00 Using where; Using index +2 SIMPLE t2 NULL ref c c 5 test.t1.a 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t2`.`f` AS `f` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` between 4 and 6) and (`test`.`t1`.`a` > 0)) +DROP TABLE t1, t2; +create table t1 ( +a int unsigned not null auto_increment primary key, +b bit not null, +c bit not null +); +create table t2 ( +a int unsigned not null auto_increment primary key, +b bit not null, +c int unsigned not null, +d varchar(50) +); +insert into t1 (b,c) values (0,1), (0,1); +insert into t2 (b,c) values (0,1); +select t1.a, t1.b + 0, t1.c + 0, t2.a, t2.b + 0, t2.c, t2.d +from t1 left outer join t2 on t1.a = t2.c and t2.b <> 1 +where t1.b <> 1 order by t1.a; +a t1.b + 0 t1.c + 0 a t2.b + 0 c d +1 0 1 1 0 1 NULL +2 0 1 NULL NULL NULL NULL +drop table t1,t2; +SELECT 0.9888889889 * 1.011111411911; +0.9888889889 * 1.011111411911 +0.9998769417899202067879 +prepare stmt from 'select 1 as " a "'; +Warnings: +Warning 1466 Leading spaces are removed from name ' a ' +execute stmt; +a +1 +CREATE TABLE t1 (a int NOT NULL PRIMARY KEY, b int NOT NULL); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +CREATE TABLE t2 (c int NOT NULL, INDEX idx(c)); +INSERT INTO t2 VALUES +(1), (1), (1), (1), (1), (1), (1), (1), +(2), (2), (2), (2), +(3), (3), +(4); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL ref idx idx 4 const 8 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '1' AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = '1')) +EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=4; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL ref idx idx 4 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '4' AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`c` = '4')) +DROP TABLE t1, t2; +CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a int); +INSERT INTO t1 VALUES (1,2), (2,NULL), (3,2); +CREATE TABLE t2 (b int, c INT, INDEX idx1(b)); +INSERT INTO t2 VALUES (2,1), (3,2); +CREATE TABLE t3 (d int, e int, INDEX idx1(d)); +INSERT INTO t3 VALUES (2,10), (2,20), (1,30), (2,40), (2,50); +EXPLAIN +SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id +WHERE t1.id=2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL const idx1 NULL NULL NULL 1 100.00 Impossible ON condition +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL const idx1 NULL NULL NULL 1 100.00 Impossible ON condition +2 SIMPLE t3 NULL ref idx1 idx1 5 const 4 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select '2' AS `id`,NULL AS `a`,NULL AS `b`,NULL AS `c`,`test`.`t3`.`d` AS `d`,`test`.`t3`.`e` AS `e` from `test`.`t1` left join `test`.`t2` on(multiple equal(NULL, NULL)) join `test`.`t3` where (`test`.`t3`.`d` = 2) +SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id +WHERE t1.id=2; +id a b c d e +2 NULL NULL NULL 2 10 +2 NULL NULL NULL 2 20 +2 NULL NULL NULL 2 40 +2 NULL NULL NULL 2 50 +DROP TABLE t1,t2,t3; +create table t1 (c1 varchar(1), c2 int, c3 int, c4 int, c5 int, c6 int, +c7 int, c8 int, c9 int, fulltext key (`c1`)); +select distinct match (`c1`) against ('z') , c2, c3, c4,c5, c6,c7, c8 +from t1 where c9=1 order by c2, c2; +match (`c1`) against ('z') c2 c3 c4 c5 c6 c7 c8 +drop table t1; +CREATE TABLE t1 (pk varchar(10) PRIMARY KEY, fk varchar(16)) charset utf8mb4; +CREATE TABLE t2 (pk varchar(16) PRIMARY KEY, fk varchar(10)) charset utf8mb4; +INSERT INTO t1 VALUES +('d','dddd'), ('i','iii'), ('a','aa'), ('b','bb'), ('g','gg'), +('e','eee'), ('c','cccc'), ('h','hhh'), ('j','jjj'), ('f','fff'); +INSERT INTO t2 VALUES +('jjj', 'j'), ('cc','c'), ('ccc','c'), ('aaa', 'a'), ('jjjj','j'), +('hhh','h'), ('gg','g'), ('fff','f'), ('ee','e'), ('ffff','f'), +('bbb','b'), ('ff','f'), ('cccc','c'), ('dddd','d'), ('jj','j'), +('aaaa','a'), ('bb','b'), ('eeee','e'), ('aa','a'), ('hh','h'); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk < 'c' AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` < 'c')) +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk BETWEEN 'a' AND 'b' AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` between 'a' and 'b')) +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk IN ('a','b') AND t2.pk=t1.fk; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 42 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 66 test.t1.fk 1 5.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`pk` AS `pk`,`test`.`t2`.`fk` AS `fk` from `test`.`t1` join `test`.`t2` where ((`test`.`t2`.`fk` = `test`.`t1`.`pk`) and (`test`.`t2`.`pk` = `test`.`t1`.`fk`) and (`test`.`t1`.`pk` in ('a','b'))) +DROP TABLE t1,t2; +CREATE TABLE t1 (a int, b varchar(20) NOT NULL, PRIMARY KEY(a)) charset utf8mb4; +CREATE TABLE t2 (a int, b varchar(20) NOT NULL, +PRIMARY KEY (a), UNIQUE KEY (b)) charset utf8mb4; +INSERT INTO t1 VALUES (1,'a'),(2,'b'),(3,'c'); +INSERT INTO t2 VALUES (1,'a'),(2,'b'),(3,'c'); +EXPLAIN SELECT t1.a FROM t1 LEFT JOIN t2 ON t2.b=t1.b WHERE t1.a=3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE t2 NULL const b b 82 const 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ select '3' AS `a` from `test`.`t1` left join `test`.`t2` on(multiple equal('c', 'c')) where true +DROP TABLE t1,t2; +CREATE TABLE t1(id int PRIMARY KEY, b int, e int); +CREATE TABLE t2(i int, a int, INDEX si(i), INDEX ai(a)); +CREATE TABLE t3(a int PRIMARY KEY, c char(4), INDEX ci(c)); +INSERT INTO t1 VALUES +(1,10,19), (2,20,22), (4,41,42), (9,93,95), (7, 77,79), +(6,63,67), (5,55,58), (3,38,39), (8,81,89); +INSERT INTO t2 VALUES +(21,210), (41,410), (82,820), (83,830), (84,840), +(65,650), (51,510), (37,370), (94,940), (76,760), +(22,220), (33,330), (40,400), (95,950), (38,380), +(67,670), (88,880), (57,570), (96,960), (97,970); +INSERT INTO t3 VALUES +(210,'bb'), (950,'ii'), (400,'ab'), (500,'ee'), (220,'gg'), +(440,'gg'), (310,'eg'), (380,'ee'), (840,'bb'), (830,'ff'), +(230,'aa'), (960,'ii'), (410,'aa'), (510,'ee'), (290,'bb'), +(450,'gg'), (320,'dd'), (390,'hh'), (850,'jj'), (860,'ff'); +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 +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si si 5 NULL 4 100.00 Using where +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` FORCE INDEX (`si`) join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t2`.`i` between '81' and '89') and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2,t3 +WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee') ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si,ai si 5 NULL 4 100.00 Using where +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and (`test`.`t2`.`i` between '81' and '89') and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND +t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si si 5 NULL 2 100.00 Using where +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` FORCE INDEX (`si`) join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((`test`.`t2`.`i` = '81') or (`test`.`t2`.`i` = '89')) and (`test`.`t3`.`c` in ('bb','ee'))) +EXPLAIN +SELECT t3.a FROM t1,t2,t3 +WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND +t3.c IN ('bb','ee'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (2 workers) +2 SIMPLE t1 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t2 NULL range si,ai si 5 NULL 2 100.00 Using where +2 SIMPLE t3 NULL eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 30.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((`test`.`t2`.`i` = '81') or (`test`.`t2`.`i` = '89')) and (`test`.`t3`.`c` in ('bb','ee'))) +DROP TABLE t1,t2,t3; +CREATE TABLE t1 ( f1 int primary key, f2 int, f3 int, f4 int, f5 int, f6 int, checked_out int); +CREATE TABLE t2 ( f11 int PRIMARY KEY ); +INSERT INTO t1 VALUES (1,1,1,0,0,0,0),(2,1,1,3,8,1,0),(3,1,1,4,12,1,0); +INSERT INTO t2 VALUES (62); +SELECT * FROM t1 LEFT JOIN t2 ON f11 = t1.checked_out GROUP BY f1 ORDER BY f2, f3, f4, f5 LIMIT 0, 1; +f1 f2 f3 f4 f5 f6 checked_out f11 +1 1 1 0 0 0 0 NULL +DROP TABLE t1, t2; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(a int); +INSERT into t1 values (1), (2), (3); +SELECT * FROM t1 LIMIT 2, -1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1 +DROP TABLE t1; +set optimizer_switch='index_merge=off'; +CREATE TABLE t1 ( +ID_with_null int NULL, +ID_better int NOT NULL, +INDEX idx1 (ID_with_null), +INDEX idx2 (ID_better) +); +INSERT INTO t1 VALUES (1,1), (2,1), (null,3), (null,3), (null,3), (null,3); +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID_with_null IS NULL; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SELECT COUNT(*) FROM t1 WHERE ID_with_null IS NULL; +COUNT(*) +128 +SELECT COUNT(*) FROM t1 WHERE ID_better=1; +COUNT(*) +2 +EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 98.46 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 98.46 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID_with_null` AS `ID_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID_with_null` is null)) +DROP INDEX idx1 ON t1; +CREATE UNIQUE INDEX idx1 ON t1(ID_with_null); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 98.46 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 98.46 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID_with_null` AS `ID_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID_with_null` is null)) +DROP TABLE t1; +CREATE TABLE t1 ( +ID1_with_null int NULL, +ID2_with_null int NULL, +ID_better int NOT NULL, +INDEX idx1 (ID1_with_null, ID2_with_null), +INDEX idx2 (ID_better) +) ; +INSERT INTO t1 VALUES (1,1,1), (2,2,1), (3,null,3), (null,3,3), (null,null,3), +(3,null,3), (null,3,3), (null,null,3), (3,null,3), (null,3,3), (null,null,3); +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID1_with_null IS NULL; +INSERT INTO t1 SELECT * FROM t1 WHERE ID2_with_null IS NULL; +SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null=3; +COUNT(*) +24 +SELECT COUNT(*) FROM t1 WHERE ID1_with_null=3 AND ID2_with_null IS NULL; +COUNT(*) +24 +SELECT COUNT(*) FROM t1 WHERE ID1_with_null IS NULL AND ID2_with_null IS NULL; +COUNT(*) +192 +SELECT COUNT(*) FROM t1 WHERE ID_better=1; +COUNT(*) +2 +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID2_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID1_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and ((`test`.`t1`.`ID2_with_null` = 3) is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 79.34 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 79.34 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and (`test`.`t1`.`ID2_with_null` is null)) +DROP INDEX idx1 ON t1; +CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID2_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null IS NULL ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 9.92 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 9.92 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID1_with_null` = 3) and (`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID2_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null IS NULL; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 79.34 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 79.34 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and (`test`.`t1`.`ID2_with_null` is null)) +EXPLAIN SELECT * FROM t1 +WHERE ID_better=1 AND ID1_with_null IS NULL AND +(ID2_with_null=1 OR ID2_with_null=2); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 2.50 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref idx1,idx2 idx2 4 const 2 2.50 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`ID1_with_null` AS `ID1_with_null`,`test`.`t1`.`ID2_with_null` AS `ID2_with_null`,`test`.`t1`.`ID_better` AS `ID_better` from `test`.`t1` where ((`test`.`t1`.`ID_better` = 1) and (`test`.`t1`.`ID1_with_null` is null) and ((`test`.`t1`.`ID2_with_null` = 1) or (`test`.`t1`.`ID2_with_null` = 2))) +DROP TABLE t1; +set optimizer_switch='index_merge=on'; +CREATE TABLE t1 (a INT, ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY ts(ts)); +INSERT INTO t1 VALUES (30,"2006-01-03 23:00:00"), (31,"2006-01-03 23:00:00"); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +CREATE TABLE t2 (a INT, dt1 DATETIME, dt2 DATETIME, PRIMARY KEY (a)); +INSERT INTO t2 VALUES (30, "2006-01-01 00:00:00", "2999-12-31 00:00:00"); +INSERT INTO t2 SELECT a+1,dt1,dt2 FROM t2; +ANALYZE TABLE t2; +Table Op Msg_type Msg_text +test.t2 analyze status OK +EXPLAIN +SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 +AND t1.ts BETWEEN t2.dt1 AND t2.dt2 +AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 50.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL const PRIMARY PRIMARY 4 const 1 100.00 NULL +2 SIMPLE t1 NULL range ts ts 4 NULL 2 50.00 Using where +Warnings: +Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`ts` AS `ts`,'30' AS `a`,'2006-01-01 00:00:00' AS `dt1`,'2999-12-31 00:00:00' AS `dt2` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = 30) and (`test`.`t1`.`ts` between '2006-01-01 00:00:00' and '2999-12-31 00:00:00') and (`test`.`t1`.`ts` between '2006-01-01' and '2006-12-31')) +SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 +AND t1.ts BETWEEN t2.dt1 AND t2.dt2 +AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; +a ts a dt1 dt2 +30 2006-01-03 23:00:00 30 2006-01-01 00:00:00 2999-12-31 00:00:00 +Warnings: +Warning 1292 Incorrect datetime value: '2999-12-31 00:00:00' for column 'ts' at row 1 +DROP TABLE t1,t2; +create table t1 (a bigint unsigned); +insert into t1 values +(if(1, 9223372036854775808, 1)), +(case when 1 then 9223372036854775808 else 1 end), +(coalesce(9223372036854775808, 1)); +select * from t1; +a +9223372036854775808 +9223372036854775808 +9223372036854775808 +drop table t1; +create table t1 charset utf8mb4 select +if(1, 9223372036854775808, 1) i, +case when 1 then 9223372036854775808 else 1 end c, +coalesce(9223372036854775808, 1) co; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` decimal(19,0) NOT NULL DEFAULT '0', + `c` decimal(19,0) NOT NULL DEFAULT '0', + `co` decimal(19,0) NOT NULL DEFAULT '0' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +select +if(1, cast(1111111111111111111 as unsigned), 1) i, +case when 1 then cast(1111111111111111111 as unsigned) else 1 end c, +coalesce(cast(1111111111111111111 as unsigned), 1) co; +i c co +1111111111111111111 1111111111111111111 1111111111111111111 +CREATE TABLE t1 (name varchar(255)) charset latin1; +CREATE TABLE t2 (name varchar(255), n int, KEY (name(3))) charset latin1; +INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); +INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); +INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); +INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT * FROM t2; +name n +bb 1 +aa 2 +cc 3 +cc  4 +cc 5 +bb 6 +cc 7 +SELECT * FROM t2 ORDER BY name; +name n +aa 2 +bb 1 +bb 6 +cc  4 +cc 3 +cc 5 +cc 7 +SELECT name, LENGTH(name), n FROM t2 ORDER BY name; +name LENGTH(name) n +aa 2 2 +bb 2 1 +bb 3 6 +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ref name name 6 const 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` = 'cc ') +SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +name LENGTH(name) n +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +name LENGTH(name) n +cc 5 3 +cc  4 4 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 4 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') order by `test`.`t2`.`name` +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +name LENGTH(name) n +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 5 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +2 SIMPLE t2 NULL ref name name 6 test.t1.name 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`name` AS `name`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`n` AS `n` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`name` = `test`.`t1`.`name`)) where true +SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +name name n +aa aa 2 +aa aa 2 +bb bb 1 +bb bb 6 +cc cc 5 +cc cc 7 +cc cc 3 +ccc NULL NULL +DROP TABLE t1,t2; +CREATE TABLE t1 (name text) charset latin1; +CREATE TABLE t2 (name text, n int, KEY (name(3))) charset latin1; +INSERT INTO t1 VALUES ('ccc'), ('bb'), ('cc '), ('aa '), ('aa'); +INSERT INTO t2 VALUES ('bb',1), ('aa',2), ('cc ',3); +INSERT INTO t2 VALUES (concat('cc ', 0x06), 4); +INSERT INTO t2 VALUES ('cc',5), ('bb ',6), ('cc ',7); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +SELECT * FROM t2; +name n +bb 1 +aa 2 +cc 3 +cc  4 +cc 5 +bb 6 +cc 7 +SELECT * FROM t2 ORDER BY name; +name n +aa 2 +bb 1 +bb 6 +cc  4 +cc 3 +cc 5 +cc 7 +SELECT name, LENGTH(name), n FROM t2 ORDER BY name; +name LENGTH(name) n +aa 2 2 +bb 2 1 +bb 3 6 +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL ref name name 6 const 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` = 'cc ') +SELECT name, LENGTH(name), n FROM t2 WHERE name='cc '; +name LENGTH(name) n +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%'; +name LENGTH(name) n +cc 5 3 +cc  4 4 +cc 2 5 +cc 3 7 +EXPLAIN SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 NULL range name name 6 NULL 4 100.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`name` AS `name`,length(`test`.`t2`.`name`) AS `LENGTH(name)`,`test`.`t2`.`n` AS `n` from `test`.`t2` where (`test`.`t2`.`name` like 'cc%') order by `test`.`t2`.`name` +SELECT name , LENGTH(name), n FROM t2 WHERE name LIKE 'cc%' ORDER BY name; +name LENGTH(name) n +cc  4 4 +cc 5 3 +cc 2 5 +cc 3 7 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 100.00 NULL +1 SIMPLE t2 NULL ref name name 6 test.t1.name 2 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`name` AS `name`,`test`.`t2`.`name` AS `name`,`test`.`t2`.`n` AS `n` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`name` = `test`.`t1`.`name`)) where true +SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name; +name name n +aa aa 2 +aa aa 2 +bb bb 1 +bb bb 6 +cc cc 5 +cc cc 7 +cc cc 3 +ccc NULL NULL +DROP TABLE t1,t2; +CREATE TABLE t1 ( +access_id int NOT NULL default '0', +name varchar(20) default NULL, +`rank` int NOT NULL default '0', +KEY idx (access_id) +); +CREATE TABLE t2 ( +faq_group_id int NOT NULL default '0', +faq_id int NOT NULL default '0', +access_id int default NULL, +UNIQUE KEY idx1 (faq_id), +KEY idx2 (faq_group_id,faq_id) +); +INSERT INTO t1 VALUES +(1,'Everyone',2),(2,'Help',3),(3,'Technical Support',1),(4,'Chat User',4); +INSERT INTO t2 VALUES +(261,265,1),(490,494,1); +SELECT t2.faq_id +FROM t1 INNER JOIN t2 IGNORE INDEX (idx1) +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +SELECT t2.faq_id +FROM t1 INNER JOIN t2 +ON (t1.access_id = t2.access_id) +LEFT JOIN t2 t +ON (t.faq_group_id = t2.faq_group_id AND +find_in_set(t.access_id, '1,4') < find_in_set(t2.access_id, '1,4')) +WHERE +t2.access_id IN (1,4) AND t.access_id IS NULL AND t2.faq_id in (265); +faq_id +265 +DROP TABLE t1,t2; +CREATE TABLE t1 (a INT, b INT, KEY inx (b,a)); +INSERT INTO t1 VALUES (1,1), (1,2), (1,3), (1,4), (1,5), (1, 6), (1,7); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT COUNT(*) FROM t1 f1 INNER JOIN t1 f2 +ON ( f1.b=f2.b AND f1.a NULL ALL NULL NULL NULL NULL 7 100.00 Parallel execute (1 workers) +2 SIMPLE f1 NULL index inx inx 10 NULL 7 100.00 Using where; Using index +2 SIMPLE f2 NULL ref inx inx 5 test.f1.b 1 33.33 Using where; Using index +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` `f1` join `test`.`t1` `f2` where ((`test`.`f2`.`b` = `test`.`f1`.`b`) and (`test`.`f1`.`b` not in (100,2232,3343,51111)) and (`test`.`f1`.`a` < `test`.`f2`.`a`)) +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 INT); +INSERT INTO t1 VALUES (1,11), (2,22), (2,22); +EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2)))))))))))))))))))))))))))))) > 0; +EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) > 0; +ERROR HY000: Too high level of nesting for select +DROP TABLE t1; +CREATE TABLE t1 ( +c1 int(11) NOT NULL AUTO_INCREMENT, +c2 varchar(1000) DEFAULT NULL, +c3 bigint(20) DEFAULT NULL, +c4 bigint(20) DEFAULT NULL, +PRIMARY KEY (c1) +) charset utf8mb4; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN +SELECT join_2.c1 +FROM +t1 AS join_0, +t1 AS join_1, +t1 AS join_2, +t1 AS join_3, +t1 AS join_4, +t1 AS join_5, +t1 AS join_6, +t1 AS join_7 +WHERE +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +OR +join_0.c2 < '?' AND +join_1.c2 < '?' AND +join_2.c2 > '?' AND +join_2.c2 < '!' AND +join_3.c2 > '?' AND +join_4.c2 = '?' AND +join_5.c2 <> '?' AND +join_6.c2 <> '?' AND +join_7.c2 >= '?' AND +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +GROUP BY +join_3.c1, +join_2.c1, +join_7.c1, +join_1.c1, +join_0.c1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL # 1 100.00 # +2 SIMPLE join_0 NULL ALL PRIMARY NULL NULL # 1 100.00 # +2 SIMPLE join_1 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_2 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_3 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_4 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_5 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_6 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +2 SIMPLE join_7 NULL eq_ref PRIMARY PRIMARY 4 # 1 100.00 # +Warnings: +Note 1003 /* select#1 */ select `test`.`join_2`.`c1` AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where (((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`)) or ((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c2` = '?') and (`test`.`join_0`.`c2` < '?') and (`test`.`join_1`.`c2` < '?') and (`test`.`join_2`.`c2` > '?') and (`test`.`join_2`.`c2` < '!') and (`test`.`join_3`.`c2` > '?') and (`test`.`join_5`.`c2` <> '?') and (`test`.`join_6`.`c2` <> '?') and (`test`.`join_7`.`c2` >= '?'))) group by `test`.`join_3`.`c1`,`test`.`join_2`.`c1`,`test`.`join_7`.`c1`,`test`.`join_1`.`c1`,`test`.`join_0`.`c1` +SHOW WARNINGS; +Level Code Message +Note 1003 /* select#1 */ select `test`.`join_2`.`c1` AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where (((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`)) or ((`test`.`join_1`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_2`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_3`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_5`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_6`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_7`.`c1` = `test`.`join_0`.`c1`) and (`test`.`join_4`.`c2` = '?') and (`test`.`join_0`.`c2` < '?') and (`test`.`join_1`.`c2` < '?') and (`test`.`join_2`.`c2` > '?') and (`test`.`join_2`.`c2` < '!') and (`test`.`join_3`.`c2` > '?') and (`test`.`join_5`.`c2` <> '?') and (`test`.`join_6`.`c2` <> '?') and (`test`.`join_7`.`c2` >= '?'))) group by `test`.`join_3`.`c1`,`test`.`join_2`.`c1`,`test`.`join_7`.`c1`,`test`.`join_1`.`c1`,`test`.`join_0`.`c1` +DROP TABLE t1; +SELECT 1 AS ` `; + +1 +Warnings: +Warning 1474 Name ' ' has become '' +SELECT 1 AS ` `; + +1 +Warnings: +Warning 1474 Name ' ' has become '' +SELECT 1 AS ` x`; +x +1 +Warnings: +Warning 1466 Leading spaces are removed from name ' x' +CREATE VIEW v1 AS SELECT 1 AS ``; +ERROR 42000: Incorrect column name '' +CREATE VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT (SELECT 1 AS ` `); +ERROR 42000: Incorrect column name ' ' +CREATE VIEW v1 AS SELECT 1 AS ` x`; +Warnings: +Warning 1466 Leading spaces are removed from name ' x' +SELECT `x` FROM v1; +x +1 +ALTER VIEW v1 AS SELECT 1 AS ` `; +ERROR 42000: Incorrect column name ' ' +DROP VIEW v1; +select str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' + and '2007/10/20 00:00:00 GMT'; +str_to_date('2007-10-09','%Y-%m-%d') between '2007/10/01 00:00:00 GMT' + and '2007/10/20 00:00:00 GMT' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT' +Warning 1292 Truncated incorrect date value: '2007/10/20 00:00:00 GMT' +select str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6'; +str_to_date('2007-10-09','%Y-%m-%d') > '2007/10/01 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007/10/01 00:00:00 GMT-6' +select str_to_date('2007-10-09','%Y-%m-%d') <= '2007/10/2000:00:00 GMT-6'; +ERROR HY000: Incorrect DATE value: '2007/10/2000:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-1 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007-10-1 00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 x00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect date value: '2007-10-01 x00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 00:x00:00 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 00:x00:00 GMT-6' +select str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6'; +str_to_date('2007-10-01','%Y-%m-%d %H:%i:%s') = '2007-10-01 x12:34:56 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 x12:34:56 GMT-6' +select str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; +str_to_date('2007-10-01 12:34:00','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6' +select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6'; +str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34x:56 GMT-6' +0 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34x:56 GMT-6' +select str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56'; +str_to_date('2007-10-01 12:34:56','%Y-%m-%d %H:%i:%s') = '2007-10-01 12:34:56' +1 +select str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01','%Y-%m-%d') = '2007-10-01 12:00:00' +0 +select str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01 12','%Y-%m-%d %H') = '2007-10-01 12:00:00' +1 +select str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00'; +str_to_date('2007-10-01 12:34','%Y-%m-%d %H') = '2007-10-01 12:00:00' +1 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2007-10-01 12:34' +select str_to_date('2007-02-30 12:34','%Y-%m-%d %H:%i') = '2007-02-30 12:34:00'; +ERROR HY000: Incorrect DATETIME value: '2007-02-30 12:34:00' +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00' + and '2007/10/20 00:00:00'; +str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01 00:00:00' + and '2007/10/20 00:00:00' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +set SQL_MODE=TRADITIONAL; +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-01 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34'; +ERROR HY000: Incorrect DATETIME value: '2007-10-00 12:34' +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00 12:34' for function str_to_date +select str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01' + and '2007/10/20'; +str_to_date('2007-10-00','%Y-%m-%d') between '2007/09/01' + and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +set SQL_MODE=DEFAULT; +select str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20'; +str_to_date('2007-10-00','%Y-%m-%d') between '' and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '2007-10-00' for function str_to_date +select str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20'; +str_to_date('','%Y-%m-%d') between '2007/10/01' and '2007/10/20' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '' for function str_to_date +select str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date('','%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +Warnings: +Warning 1411 Incorrect datetime value: '' for function str_to_date +select str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34'; +str_to_date(NULL,'%Y-%m-%d %H:%i') = '2007-10-01 12:34' +NULL +select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = ''; +ERROR HY000: Incorrect DATETIME value: '' +select str_to_date('1','%Y-%m-%d') = '1'; +ERROR HY000: Incorrect DATE value: '1' +select str_to_date('1','%Y-%m-%d') = '1'; +ERROR HY000: Incorrect DATE value: '1' +select str_to_date('','%Y-%m-%d') = ''; +ERROR HY000: Incorrect DATE value: '' +select str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL; +str_to_date('1000-01-01','%Y-%m-%d') between '0000-00-00' and NULL +0 +Warnings: +Warning 1292 Truncated incorrect date value: '0000-00-00' +select str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00'; +str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00' +NULL +Warnings: +Warning 1292 Truncated incorrect date value: '2000-00-00' +select str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL; +str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL +0 +CREATE TABLE t1 (c11 INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY); +CREATE TABLE t2 (c21 INT UNSIGNED NOT NULL, +c22 INT DEFAULT NULL, +KEY(c21, c22)); +CREATE TABLE t3 (c31 INT UNSIGNED NOT NULL DEFAULT 0, +c32 INT DEFAULT NULL, +c33 INT NOT NULL, +c34 INT UNSIGNED DEFAULT 0, +KEY (c33, c34, c32)); +INSERT INTO t1 values (),(),(),(),(); +INSERT INTO t2 SELECT a.c11, b.c11 FROM t1 a, t1 b; +INSERT INTO t3 VALUES (1, 1, 1, 0), +(2, 2, 0, 0), +(3, 3, 1, 0), +(4, 4, 0, 0), +(5, 5, 1, 0); +SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND +t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND +t3.c33 = 1 AND t2.c22 in (1, 3) +ORDER BY c32; +c32 +1 +1 +3 +3 +5 +5 +SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND +t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND +t3.c33 = 1 AND t2.c22 in (1, 3) +ORDER BY c32 DESC; +c32 +5 +5 +3 +3 +1 +1 +DROP TABLE t1, t2, t3; + +# +# Bug#30736: Row Size Too Large Error Creating a Table and +# Inserting Data. +# +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; + +CREATE TABLE t1( +c1 DECIMAL(10, 2), +c2 FLOAT); + +INSERT INTO t1 VALUES (0, 1), (2, 3), (4, 5); + +CREATE TABLE t2( +c3 DECIMAL(10, 2)) +SELECT +c1 * c2 AS c3 +FROM t1; + +SELECT * FROM t1; +c1 c2 +0.00 1 +2.00 3 +4.00 5 + +SELECT * FROM t2; +c3 +0.00 +6.00 +20.00 + +DROP TABLE t1; +DROP TABLE t2; + +CREATE TABLE t1 (c1 BIGINT NOT NULL); +INSERT INTO t1 (c1) VALUES (1); +SELECT * FROM t1 WHERE c1 > NULL + 1; +c1 +DROP TABLE t1; + +CREATE TABLE t1 (a VARCHAR(10) NOT NULL PRIMARY KEY); +INSERT INTO t1 (a) VALUES ('foo0'), ('bar0'), ('baz0'); +SELECT * FROM t1 WHERE a IN (CONCAT('foo', 0), 'bar'); +a +foo0 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT); +CREATE TABLE t2 (a INT, c INT, KEY(a)); +INSERT INTO t1 VALUES (1, 1), (2, 2); +INSERT INTO t2 VALUES (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), +(2, 1), (2, 2), (2, 3), (2, 4), (2, 5), +(3, 1), (3, 2), (3, 3), (3, 4), (3, 5), +(4, 1), (4, 2), (4, 3), (4, 4), (4, 5); +FLUSH STATUS; +SELECT DISTINCT b FROM t1 LEFT JOIN t2 USING(a) WHERE c <= 3; +b +1 +2 +SHOW STATUS LIKE 'Handler_read%'; +Variable_name Value +Handler_read_first 1 +Handler_read_key 3 +Handler_read_last 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 6 +DROP TABLE t1, t2; +CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0', +f2 int(11) NOT NULL default '0', +f3 bigint(20) NOT NULL default '0', +f4 varchar(255) NOT NULL default '', +PRIMARY KEY (f1), +KEY key1 (f4), +KEY key2 (f2)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t2 (f1 int(11) NOT NULL default '0', +f2 enum('A1','A2','A3') NOT NULL default 'A1', +f3 int(11) NOT NULL default '0', +PRIMARY KEY (f1), +KEY key1 (f3)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0', +f2 datetime NOT NULL default '1980-01-01 00:00:00', +PRIMARY KEY (f1)) charset latin1; +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +insert into t1 values (1, 1, 1, 'abc'); +insert into t1 values (2, 1, 2, 'def'); +insert into t1 values (3, 1, 2, 'def'); +insert into t2 values (1, 'A1', 1); +insert into t3 values (1, '1980-01-01'); +SELECT a.f3, cr.f4, count(*) count +FROM t2 a +STRAIGHT_JOIN t1 cr ON cr.f2 = a.f1 +LEFT JOIN +(t1 cr2 +JOIN t3 ae2 ON cr2.f3 = ae2.f1 +) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND +cr.f4 = cr2.f4 +GROUP BY a.f3, cr.f4; +f3 f4 count +1 abc 1 +1 def 2 +drop table t1, t2, t3; +CREATE TABLE t1 (a INT KEY, b INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a, b FROM t1 WHERE a > 1 AND a = b LIMIT 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 25.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 3 25.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 SELECT a, b FROM t1 WHERE a > 1 AND b = a LIMIT 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 25.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 3 25.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`a` = `test`.`t1`.`b`) and (`test`.`t1`.`a` > 1)) limit 2 +DROP TABLE t1; +# +# Bug#47019: Assertion failed: 0, file .\rt_mbr.c, line 138 when +# forcing a spatial index +# +CREATE TABLE t1(a LINESTRING NOT NULL SRID 0, SPATIAL KEY(a)); +INSERT INTO t1 VALUES +(ST_GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')), +(ST_GEOMFROMTEXT('LINESTRING(-1 -1, 1 -1, -1 -1, -1 1, 1 1)')); +EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t2 NULL ALL a NULL NULL NULL 2 100.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2; +1 +1 +1 +1 +1 +EXPLAIN SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t2 NULL ALL a NULL NULL NULL 2 100.00 Range checked for each record (index map: 0x1) +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` left join `test`.`t1` `t2` FORCE INDEX (`a`) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where true +SELECT 1 FROM t1 NATURAL LEFT JOIN t1 AS t2 FORCE INDEX(a); +1 +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug #48291 : crash with row() operator,select into @var, and +# subquery returning multiple rows +# +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (2),(3); +# Should not crash +SELECT 1 FROM t1 WHERE a <> 1 AND NOT +ROW(1,a) <=> ROW(1,(SELECT 1 FROM t1)) +INTO @var0; +ERROR 21000: Subquery returns more than 1 row +DROP TABLE t1; +# +# Bug #48458: simple query tries to allocate enormous amount of +# memory +# +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1(a INT NOT NULL, b YEAR); +INSERT INTO t1 VALUES (); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +CREATE TABLE t2(c INT); +# Should not err out because of out-of-memory +SELECT 1 FROM t2 JOIN t1 ON 1=1 +WHERE a != '1' AND NOT a >= b OR NOT ROW(b,a )<> ROW(a,a); +1 +DROP TABLE t1,t2; +SET sql_mode = default; +# +# Bug #49199: Optimizer handles incorrectly: +# field='const1' AND field='const2' in some cases + +CREATE TABLE t1(a DATETIME NOT NULL); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 00:00:00 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +DROP TABLE t1; +CREATE TABLE t1(a DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = DATE'2001-01-01') +DROP TABLE t1; +CREATE TABLE t1(a TIMESTAMP NOT NULL NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP); +INSERT INTO t1 VALUES('2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +a +2001-01-01 00:00:00 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00') +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +a b +2001-01-01 00:00:00 2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = DATE'2001-01-01') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b VARCHAR(20) NOT NULL) charset utf8mb4; +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +a b +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = '2001-01-01 00:00:00') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01'; +a b +2001-01-01 00:00:00 2001-01-01 +EXPLAIN SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where ((`test`.`t1`.`b` = '2001-01-01') and (`test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL); +INSERT INTO t1 VALUES('2001-01-01', '2001-01-01'); +SELECT x.a, y.a, z.a FROM t1 x +JOIN t1 y ON x.a=y.a +JOIN t1 z ON y.a=z.a +WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; +a a a +2001-01-01 00:00:00 2001-01-01 00:00:00 2001-01-01 00:00:00 +EXPLAIN SELECT x.a, y.a, z.a FROM t1 x +JOIN t1 y ON x.a=y.a +JOIN t1 z ON y.a=z.a +WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE x NULL ALL NULL NULL NULL NULL 1 100.00 Using where +2 SIMPLE y NULL ALL NULL NULL NULL NULL 1 100.00 Using where +2 SIMPLE z NULL ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`x`.`a` AS `a`,`test`.`y`.`a` AS `a`,`test`.`z`.`a` AS `a` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` where ((`test`.`x`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (`test`.`y`.`a` = TIMESTAMP'2001-01-01 00:00:00') and (`test`.`z`.`a` = TIMESTAMP'2001-01-01 00:00:00')) +DROP TABLE t1; +# +# Bug #49897: crash in ptr_compare when char(0) NOT NULL +# column is used for ORDER BY +# +SET @old_sort_buffer_size= @@session.sort_buffer_size; +SET @@sort_buffer_size= 40000; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE TABLE t1(a CHAR(0) NOT NULL); +INSERT INTO t1 VALUES (0), (0), (0); +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +INSERT INTO t1 SELECT t11.a FROM t1 t11, t1 t12; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a FROM t1 ORDER BY a; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24404 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24404 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `test`.`t1`.`a` +SELECT a FROM t1 ORDER BY a; +DROP TABLE t1; +CREATE TABLE t1(a CHAR(0) NOT NULL, b CHAR(0) NOT NULL, c int); +INSERT INTO t1 VALUES (0, 0, 0), (0, 0, 2), (0, 0, 1); +# Since ANALYZE TABLE only reads a subset of the data, the statistics for +# table t1 depends on the row order. And since the INSERT INTO ... SELECT +# may be executed using different execution plans, we've added ORDER BY +# to ensure that we rows has the same order every time. If not, the +# estimated number of rows in EXPLAIN may change on different platforms. +# Note that the tables may MYISAM, since many of the test files that +# includes this file forces MYISAM as the default storage engine. +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +INSERT INTO t1 SELECT t11.a, t11.b, t11.c FROM t1 t11, t1 t12 +ORDER BY t11.a, t11.b, t11.c; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT a FROM t1 ORDER BY a LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` order by `test`.`t1`.`a` limit 5 +SELECT a FROM t1 ORDER BY a LIMIT 5; +a + + + + + +EXPLAIN SELECT * FROM t1 ORDER BY a, b LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b` limit 5 +SELECT * FROM t1 ORDER BY a, b LIMIT 5; +a b c + 2 + 2 + 2 + 2 + 2 +EXPLAIN SELECT * FROM t1 ORDER BY a, b, c LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b`,`test`.`t1`.`c` limit 5 +SELECT * FROM t1 ORDER BY a, b, c LIMIT 5; +a b c + 0 + 0 + 0 + 0 + 0 +EXPLAIN SELECT * FROM t1 ORDER BY c, a LIMIT 5; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 24434 100.00 Parallel execute (4 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 24434 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` order by `test`.`t1`.`c`,`test`.`t1`.`a` limit 5 +SELECT * FROM t1 ORDER BY c, a LIMIT 5; +a b c + 0 + 0 + 0 + 0 + 0 +SET @@sort_buffer_size= @old_sort_buffer_size; +DROP TABLE t1; +SET sql_mode = default; +End of 5.0 tests +create table t1(a INT, KEY (a)); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5); +SELECT a FROM t1 ORDER BY a LIMIT 2; +a +1 +2 +SELECT a FROM t1 ORDER BY a LIMIT 2,4294967296; +a +3 +4 +5 +SELECT a FROM t1 ORDER BY a LIMIT 2,4294967297; +a +3 +4 +5 +DROP TABLE t1; +CREATE TABLE A (date_key date); +CREATE TABLE C ( +pk int, +int_nokey int, +int_key int, +date_key date NOT NULL, +date_nokey date, +varchar_key varchar(1) +); +INSERT IGNORE INTO C VALUES +(1,1,1,'0000-00-00',NULL,NULL), +(1,1,1,'0000-00-00',NULL,NULL); +Warnings: +Warning 1264 Out of range value for column 'date_key' at row 1 +Warning 1264 Out of range value for column 'date_key' at row 2 +SELECT 1 FROM C WHERE pk > ANY (SELECT 1 FROM C); +1 +SELECT COUNT(DISTINCT 1) FROM C +WHERE date_key = (SELECT 1 FROM A WHERE C.date_key IS NULL) GROUP BY pk; +COUNT(DISTINCT 1) +SELECT date_nokey FROM C +WHERE int_key IN (SELECT 1 FROM A) +HAVING date_nokey = '10:41:7' +ORDER BY date_key; +ERROR HY000: Incorrect DATE value: '10:41:7' +DROP TABLE A,C; +CREATE TABLE t1 (a INT NOT NULL, b INT); +INSERT INTO t1 VALUES (1, 1); +EXPLAIN SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where true +SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2; +a b +1 1 +DROP TABLE t1; +CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL); +EXPLAIN SELECT * FROM t1 WHERE (a=a AND b=b AND c=c) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +EXPLAIN SELECT * FROM t1 WHERE (a=a AND a=a AND b=b) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +EXPLAIN SELECT * FROM t1 WHERE (a=a AND b=b AND a=a) OR b > 20; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where true +DROP TABLE t1; +# +# Bug#45266: Uninitialized variable lead to an empty result. +# +drop table if exists A,AA,B,BB; +CREATE TABLE `A` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`date_key` date NOT NULL, +`date_nokey` date NOT NULL, +`datetime_key` datetime NOT NULL, +`int_nokey` int(11) NOT NULL, +`time_key` time NOT NULL, +`time_nokey` time NOT NULL, +PRIMARY KEY (`pk`), +KEY `date_key` (`date_key`), +KEY `time_key` (`time_key`), +KEY `datetime_key` (`datetime_key`) +); +CREATE TABLE `AA` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`int_nokey` int(11) NOT NULL, +`time_key` time NOT NULL, +KEY `time_key` (`time_key`), +PRIMARY KEY (`pk`) +); +CREATE TABLE `B` ( +`date_nokey` date NOT NULL, +`date_key` date NOT NULL, +`time_key` time NOT NULL, +`datetime_nokey` datetime NOT NULL, +`varchar_key` varchar(1) NOT NULL, +KEY `date_key` (`date_key`), +KEY `time_key` (`time_key`), +KEY `varchar_key` (`varchar_key`) +); +INSERT IGNORE INTO `B` VALUES ('2003-07-28','2003-07-28','15:13:38','0000-00-00 00:00:00','f'),('0000-00-00','0000-00-00','00:05:48','2004-07-02 14:34:13','x'); +CREATE TABLE `BB` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`int_nokey` int(11) NOT NULL, +`date_key` date NOT NULL, +`varchar_nokey` varchar(1) NOT NULL, +`date_nokey` date NOT NULL, +PRIMARY KEY (`pk`), +KEY `date_key` (`date_key`) +); +INSERT IGNORE INTO `BB` VALUES (10,8,'0000-00-00','i','0000-00-00'),(11,0,'2005-08-18','','2005-08-18'); +SELECT table1 . `pk` AS field1 +FROM +(BB AS table1 INNER JOIN +(AA AS table2 STRAIGHT_JOIN A AS table3 +ON ( table3 . `date_key` = table2 . `pk` )) +ON ( table3 . `datetime_key` = table2 . `int_nokey` )) +WHERE ( table3 . `date_key` <= 4 AND table2 . `pk` = table1 . `varchar_nokey`) +GROUP BY field1 ; +field1 +SELECT table3 .`date_key` field1 +FROM +B table1 LEFT JOIN B table3 JOIN +(BB table6 JOIN A table7 ON table6 .`varchar_nokey`) +ON table6 .`int_nokey` ON table6 .`date_key` + WHERE NOT ( table1 .`varchar_key` AND table7 .`pk`) GROUP BY field1; +field1 +NULL +SELECT table4 . `time_nokey` AS field1 FROM +(AA AS table1 CROSS JOIN +(AA AS table2 STRAIGHT_JOIN +(B AS table3 STRAIGHT_JOIN A AS table4 +ON ( table4 . `date_key` = table3 . `time_key` )) +ON ( table4 . `pk` = table3 . `date_nokey` )) +ON ( table4 . `time_key` = table3 . `datetime_nokey` )) +WHERE ( table4 . `time_key` < table1 . `time_key` AND +table1 . `int_nokey` != 'f') +GROUP BY field1 ORDER BY field1 , field1; +field1 +SELECT table1 .`time_key` field2 FROM B table1 LEFT JOIN BB JOIN A table5 ON table5 .`date_nokey` ON table5 .`int_nokey` GROUP BY field2; +field2 +00:05:48 +15:13:38 +drop table A,AA,B,BB; +#end of test for bug#45266 +# +# Bug#33546: Slowdown on re-evaluation of constant expressions. +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +CREATE TABLE t2 (b INT); +INSERT INTO t2 VALUES (2); +SELECT * FROM t1 WHERE a = 1 + 1; +a +2 +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN SELECT * FROM t1 WHERE a = 1 + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 10.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = ((1 + 1))) +SELECT * FROM t1 HAVING a = 1 + 1; +a +2 +EXPLAIN SELECT * FROM t1 HAVING a = 1 + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 100.00 NULL +Warnings: +Note 1003 /* select#1 */ 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 +EXPLAIN SELECT * FROM t1, t2 WHERE a = b + (1 + 1); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = (`test`.`t2`.`b` + ((1 + 1)))) +SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; +b a +2 3 +EXPLAIN SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 100.00 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t2` left join `test`.`t1` on((`test`.`t1`.`a` = (`test`.`t2`.`b` + 1))) where true +EXPLAIN SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00'); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 10 33.33 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 33.33 Using where +Warnings: +Note 1003 /* select#1 */ 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; +RETURN 1; +END;| +SET @cnt := 0; +SELECT * FROM t1 WHERE a = f1(); +a +1 +SELECT @cnt; +@cnt +1 +EXPLAIN SELECT * FROM t1 WHERE a = f1(); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ 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 +# +# BUG#48052: Valgrind warning - uninitialized value in init_read_record() +# +# Disable Index condition pushdown +SELECT @old_optimizer_switch:=@@optimizer_switch; +@old_optimizer_switch:=@@optimizer_switch +# +Warnings: +# 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +CREATE TABLE t1 ( +pk int(11) NOT NULL, +i int(11) DEFAULT NULL, +v varchar(1) DEFAULT NULL, +PRIMARY KEY (pk) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (2,7,'m'); +INSERT INTO t1 VALUES (3,9,'m'); +SELECT v +FROM t1 +WHERE NOT pk > 0 +HAVING v <= 't' +ORDER BY pk; +v +# Restore old value for Index condition pushdown +SET SESSION optimizer_switch=@old_optimizer_switch; +DROP TABLE t1; +# +# Bug#49489 Uninitialized cache led to a wrong result. +# +CREATE TABLE t1(c1 DOUBLE(5,4)); +Warnings: +Warning 1681 Specifying number of digits for floating point data types is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES (9.1234); +SELECT * FROM t1 WHERE c1 < 9.12345; +c1 +9.1234 +DROP TABLE t1; +# End of test for bug#49489. +# +# Bug #49517: Inconsistent behavior while using +# NULLable BIGINT and INT columns in comparison +# +CREATE TABLE t1(a BIGINT UNSIGNED NOT NULL, b BIGINT NULL, c INT NULL); +INSERT INTO t1 VALUES(105, NULL, NULL); +SELECT * FROM t1 WHERE b < 102; +a b c +SELECT * FROM t1 WHERE c < 102; +a b c +SELECT * FROM t1 WHERE 102 < b; +a b c +SELECT * FROM t1 WHERE 102 < c; +a b c +DROP TABLE t1; +# +# Bug #54459: Assertion failed: param.sort_length, +# file .\filesort.cc, line 149 (part II) +# +CREATE TABLE t1(a ENUM('') NOT NULL) charset latin1; +INSERT INTO t1 VALUES (), (), (); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` order by `(t1.a collate latin1_german2_ci)` +SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; +1 +1 +1 +1 +DROP TABLE t1; +# +# Bug #58422: Incorrect result when OUTER JOIN'ing +# with an empty table +# +CREATE TABLE t_empty(pk INT PRIMARY KEY, i INT); +CREATE TABLE t1(pk INT PRIMARY KEY, i INT); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3); +CREATE TABLE t2(pk INT PRIMARY KEY, i INT) ; +INSERT INTO t2 VALUES (1,1), (2,2), (3,3); +ANALYZE TABLE t_empty, t1, t2; +Table Op Msg_type Msg_text +test.t_empty analyze status OK +test.t1 analyze status OK +test.t2 analyze status OK +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`pk` = `test`.`t1`.`pk`) and (`test`.`t1`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t1 NULL range PRIMARY PRIMARY 4 NULL 2 100.00 Using where +2 SIMPLE t2 NULL eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`pk` = `test`.`t1`.`pk`) and (`test`.`t1`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) +2 SIMPLE t_empty NULL ALL NULL NULL NULL NULL 1 100.00 NULL +2 SIMPLE t2 NULL range PRIMARY PRIMARY 4 NULL 2 33.33 Using where +2 SIMPLE t1 NULL eq_ref PRIMARY PRIMARY 4 test.t2.pk 1 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`i` AS `i`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`i` AS `i`,`test`.`t_empty`.`pk` AS `pk`,`test`.`t_empty`.`i` AS `i` from `test`.`t1` join `test`.`t2` join `test`.`t_empty` where ((`test`.`t2`.`i` = `test`.`t_empty`.`i`) and (`test`.`t1`.`pk` = `test`.`t2`.`pk`) and (`test`.`t2`.`pk` <> 2)) +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +DROP TABLE t1,t2,t_empty; +End of 5.1 tests +# +# Bug#45227: Lost HAVING clause led to a wrong result. +# +CREATE TABLE `cc` ( +`int_nokey` int(11) NOT NULL, +`int_key` int(11) NOT NULL, +`varchar_key` varchar(1) NOT NULL, +`varchar_nokey` varchar(1) NOT NULL, +KEY `int_key` (`int_key`), +KEY `varchar_key` (`varchar_key`) +); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO `cc` VALUES +(0,8,'q','q'),(5,8,'m','m'),(7,3,'j','j'),(1,2,'z','z'),(8,2,'a','a'),(2,6,'',''),(1,8,'e' +,'e'),(8,9,'t','t'),(5,2,'q','q'),(4,6,'b','b'),(5,5,'w','w'),(3,2,'m','m'),(0,4,'x','x'), +(8,9,'',''),(0,6,'w','w'),(4,5,'x','x'),(0,0,'e','e'),(0,0,'e','e'),(2,8,'p','p'),(0,0,'x' +,'x'); +EXPLAIN SELECT `varchar_nokey` g1 FROM cc WHERE `int_nokey` AND `int_key` <= 4 +HAVING g1 ORDER BY `varchar_key` LIMIT 6 ; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 9 90.00 Parallel execute (1 workers) +2 SIMPLE cc NULL range int_key int_key 4 NULL 9 90.00 Using where; Using filesort +Warnings: +Note 1003 /* select#1 */ select `test`.`cc`.`varchar_nokey` AS `g1` from `test`.`cc` where ((0 <> `test`.`cc`.`int_nokey`) and (`test`.`cc`.`int_key` <= 4)) having (0 <> `g1`) order by `test`.`cc`.`varchar_key` limit 6 +SELECT `varchar_nokey` g1 FROM cc WHERE `int_nokey` AND `int_key` <= 4 +HAVING g1 ORDER BY `varchar_key` LIMIT 6 ; +g1 +Warning 1292 Truncated incorrect DOUBLE value: 'a' +Warning 1292 Truncated incorrect DOUBLE value: 'j' +Warning 1292 Truncated incorrect DOUBLE value: 'm' +Warning 1292 Truncated incorrect DOUBLE value: 'q' +Warning 1292 Truncated incorrect DOUBLE value: 'z' +Warnings: +DROP TABLE cc; +# End of test#45227 +# +# Bug#54515: Crash in opt_range.cc::get_best_group_min_max on +# SELECT from VIEW with GROUP BY +# +CREATE TABLE t1 ( +col_int_key int DEFAULT NULL, +KEY int_key (col_int_key) +) ; +INSERT INTO t1 VALUES (1),(2); +CREATE VIEW view_t1 AS +SELECT t1.col_int_key AS col_int_key +FROM t1; +SELECT col_int_key FROM view_t1 GROUP BY col_int_key; +col_int_key +1 +2 +DROP VIEW view_t1; +DROP TABLE t1; +# End of test BUG#54515 +# +# Bug #57203 Assertion `field_length <= 255' failed. +# +SELECT coalesce((avg(distinct (ST_geomfromtext("point(25379 -22010)"))))) +UNION ALL +SELECT coalesce((avg(distinct (ST_geomfromtext("point(25379 -22010)"))))) +AS foo +; +ERROR HY000: Incorrect arguments to avg +CREATE table t1(a text); +INSERT INTO t1 VALUES (''), (''); +SELECT avg(distinct(t1.a)) FROM t1, t1 t2 +GROUP BY t2.a ORDER BY t1.a; +avg(distinct(t1.a)) +0 +DROP TABLE t1; +# End of test BUG#57203 +# +# Bug#63020: Function "format"'s 'locale' argument is not considered +# when creating a "view' +# +CREATE TABLE t1 (f1 DECIMAL(10,2)); +INSERT INTO t1 VALUES (11.67),(17865.3),(12345678.92); +CREATE VIEW view_t1 AS SELECT FORMAT(f1,1,'sk_SK') AS f1 FROM t1; +SHOW CREATE VIEW view_t1; +View Create View character_set_client collation_connection +view_t1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_t1` AS select format(`t1`.`f1`,1,'sk_SK') AS `f1` from `t1` utf8mb4 utf8mb4_0900_ai_ci +SELECT * FROM view_t1; +f1 +11,7 +17 865,3 +12 345 678,9 +DROP TABLE t1; +DROP VIEW view_t1; +# End of test BUG#63020 +# +# Bug #13571700 TINYBLOB NOT NULL, CRASH IN PROTOCOL::NET_STORE_DATA +# +CREATE TABLE t1 (a TINYBLOB NOT NULL); +SELECT a, COUNT(*) FROM t1 WHERE 0; +a COUNT(*) +NULL 0 +DROP TABLE t1; +# End of test BUG#13571700 +# +# Bug #18766378: CRASH IN ITEM_SUM_BIT::RESET_FIELD +# +CREATE TABLE t1(b int); +CREATE TABLE t2(a int); +INSERT INTO t1 VALUES (),(); +INSERT INTO t2 VALUES (),(); +SELECT +( SELECT 1 FROM t1 GROUP BY a +HAVING avg(distinct 1) ORDER BY max(a) +) +FROM t1, t2 +GROUP BY a; +( SELECT 1 FROM t1 GROUP BY a +HAVING avg(distinct 1) ORDER BY max(a) +) +1 +DROP TABLE t1,t2; +# End of test BUG#18766378 +# +# WL#13002: RESULTSET DIFFERENT NUMBER OF ROWS +# +CREATE TABLE t1 ( +f1 INTEGER, +f2 INTEGER, +INDEX i1 (f2) +); +INSERT INTO t1 VALUES (NULL,1); +INSERT INTO t1 VALUES (2,NULL); +INSERT INTO t1 VALUES (3,1); +INSERT INTO t1 VALUES (4,6); +INSERT INTO t1 VALUES (NULL,5); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (13,1); +INSERT INTO t1 VALUES (NULL,0); +INSERT INTO t1 VALUES (5,2); +INSERT INTO t1 VALUES (NULL,8); +INSERT INTO t1 VALUES (NULL,7); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (NULL,NULL); +INSERT INTO t1 VALUES (NULL,4); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +EXPLAIN FORMAT=tree SELECT * +FROM t1 AS alias1 LEFT JOIN t1 AS alias2 ON alias1.f1 = alias2.f2 +WHERE alias2.f1 NOT BETWEEN 4 AND 12; +EXPLAIN +-> Parallel scan on + -> Nested loop inner join (cost=9.27 rows=19) + -> PQblock scan on alias1 (cost=1.65 rows=14) + -> Filter: (alias2.f1 not between 4 and 12) (cost=0.40 rows=1) + -> Index lookup on alias2 using i1 (f2=alias1.f1) (cost=0.40 rows=2) + +SELECT * +FROM t1 AS alias1 LEFT JOIN t1 AS alias2 ON alias1.f1 = alias2.f2 +WHERE alias2.f1 NOT BETWEEN 4 AND 12; +f1 f2 f1 f2 +DROP TABLE t1; +set optimizer_switch=default; +set optimizer_switch=default; diff --git a/mysql-test/r/subquery_sj_firstmatch.result-pq b/mysql-test/r/subquery_sj_firstmatch.result-pq index 2bb8f7e38bc7..97cee946abd0 100644 --- a/mysql-test/r/subquery_sj_firstmatch.result-pq +++ b/mysql-test/r/subquery_sj_firstmatch.result-pq @@ -12113,9 +12113,8 @@ WHERE innr.pk <= 7 ) ; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) -2 SIMPLE outr NULL ALL NULL NULL NULL NULL 3 100.00 Using where -2 SIMPLE innr NULL ref PRIMARY,col_varchar_key col_varchar_key 7 test.outr.col_varchar_nokey 1 50.00 Using where; Using index; FirstMatch(outr) +1 SIMPLE outr NULL ALL NULL NULL NULL NULL 3 100.00 Using where +1 SIMPLE innr NULL ref PRIMARY,col_varchar_key col_varchar_key 7 test.outr.col_varchar_nokey 1 50.00 Using where; Using index; FirstMatch(outr) Warnings: Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` `outr` semi join (`test`.`t2` `innr`) where ((`test`.`innr`.`col_varchar_key` = `test`.`outr`.`col_varchar_nokey`) and (`test`.`innr`.`pk` <= 7)) SELECT 1 diff --git a/mysql-test/r/subquery_sj_firstmatch_bka.result-pq b/mysql-test/r/subquery_sj_firstmatch_bka.result-pq index 26f3e9af5c69..395d042c96d6 100644 --- a/mysql-test/r/subquery_sj_firstmatch_bka.result-pq +++ b/mysql-test/r/subquery_sj_firstmatch_bka.result-pq @@ -12114,9 +12114,8 @@ WHERE innr.pk <= 7 ) ; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) -2 SIMPLE outr NULL ALL NULL NULL NULL NULL 3 100.00 Using where -2 SIMPLE innr NULL ref PRIMARY,col_varchar_key col_varchar_key 7 test.outr.col_varchar_nokey 1 50.00 Using where; Using index; FirstMatch(outr) +1 SIMPLE outr NULL ALL NULL NULL NULL NULL 3 100.00 Using where +1 SIMPLE innr NULL ref PRIMARY,col_varchar_key col_varchar_key 7 test.outr.col_varchar_nokey 1 50.00 Using where; Using index; FirstMatch(outr) Warnings: Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` `outr` semi join (`test`.`t2` `innr`) where ((`test`.`innr`.`col_varchar_key` = `test`.`outr`.`col_varchar_nokey`) and (`test`.`innr`.`pk` <= 7)) SELECT 1 diff --git a/mysql-test/r/subquery_sj_firstmatch_bka_nobnl.result-pq b/mysql-test/r/subquery_sj_firstmatch_bka_nobnl.result-pq index 2959356db0d8..596ad04d9539 100644 --- a/mysql-test/r/subquery_sj_firstmatch_bka_nobnl.result-pq +++ b/mysql-test/r/subquery_sj_firstmatch_bka_nobnl.result-pq @@ -12104,9 +12104,8 @@ WHERE innr.pk <= 7 ) ; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 3 100.00 Parallel execute (1 workers) -2 SIMPLE outr NULL ALL NULL NULL NULL NULL 3 100.00 Using where -2 SIMPLE innr NULL ref PRIMARY,col_varchar_key col_varchar_key 7 test.outr.col_varchar_nokey 1 50.00 Using where; Using index; FirstMatch(outr) +1 SIMPLE outr NULL ALL NULL NULL NULL NULL 3 100.00 Using where +1 SIMPLE innr NULL ref PRIMARY,col_varchar_key col_varchar_key 7 test.outr.col_varchar_nokey 1 50.00 Using where; Using index; FirstMatch(outr) Warnings: Note 1003 /* select#1 */ select 1 AS `1` from `test`.`t1` `outr` semi join (`test`.`t2` `innr`) where ((`test`.`innr`.`col_varchar_key` = `test`.`outr`.`col_varchar_nokey`) and (`test`.`innr`.`pk` <= 7)) SELECT 1 diff --git a/mysql-test/r/user_var.result-pq b/mysql-test/r/user_var.result-pq new file mode 100644 index 000000000000..9429eb2ca24a --- /dev/null +++ b/mysql-test/r/user_var.result-pq @@ -0,0 +1,1087 @@ +drop table if exists t1,t2; +set @a := foo; +ERROR 42S22: Unknown column 'foo' in 'field list' +set @a := connection_id() + 3; +select @a - connection_id(); +@a - connection_id() +3 +set @b := 1; +select @b; +@b +1 +CREATE TABLE t1 ( i int not null, v int not null,index (i)); +insert into t1 values (1,1),(1,3),(2,1); +create table t2 (i int not null, unique (i)); +insert into t2 select distinct i from t1; +select * from t2; +i +1 +2 +select distinct t2.i,@vv1:=if(sv1.i,1,0),@vv2:=if(sv2.i,1,0),@vv3:=if(sv3.i,1,0), @vv1+@vv2+@vv3 from t2 left join t1 as sv1 on sv1.i=t2.i and sv1.v=1 left join t1 as sv2 on sv2.i=t2.i and sv2.v=2 left join t1 as sv3 on sv3.i=t2.i and sv3.v=3; +i @vv1:=if(sv1.i,1,0) @vv2:=if(sv2.i,1,0) @vv3:=if(sv3.i,1,0) @vv1+@vv2+@vv3 +1 1 0 1 2 +2 1 0 0 1 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +explain select * from t1 where i=@vv1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref i i 4 const 2 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`i` AS `i`,`test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`i` = (@`vv1`)) +select @vv1,i,v from t1 where i=@vv1; +@vv1 i v +1 1 1 +1 1 3 +explain select * from t1 where @vv1:=@vv1+1 and i=@vv1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 100.00 Using where +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Note 1003 /* select#1 */ select `test`.`t1`.`i` AS `i`,`test`.`t1`.`v` AS `v` from `test`.`t1` where (0 <> (@vv1:=((0 <> ((@`vv1`) + 1)) and (`test`.`t1`.`i` = (@`vv1`))))) +explain select @vv1:=i from t1 where i=@vv1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL index NULL i 4 NULL 3 33.33 Using where; Using index +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Note 1003 /* select#1 */ select (@vv1:=`test`.`t1`.`i`) AS `@vv1:=i` from `test`.`t1` where (`test`.`t1`.`i` = (@`vv1`)) +explain select * from t1 where i=@vv1; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ref i i 4 const 2 100.00 NULL +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`i` AS `i`,`test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`i` = (@`vv1`)) +drop table t1,t2; +set @a=0,@b=0; +select @a:=10, @b:=1, @a > @b, @a < @b; +@a:=10 @b:=1 @a > @b @a < @b +10 1 1 0 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @a:="10", @b:="1", @a > @b, @a < @b; +@a:="10" @b:="1" @a > @b @a < @b +10 1 1 0 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @a:=10, @b:=2, @a > @b, @a < @b; +@a:=10 @b:=2 @a > @b @a < @b +10 2 0 1 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @a:="10", @b:="2", @a > @b, @a < @b; +@a:="10" @b:="2" @a > @b @a < @b +10 2 1 0 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @a:=1; +@a:=1 +1 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @a, @a:=1; +@a @a:=1 +1 1 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +create table t1 (id int, d double, c char(10)); +insert into t1 values (1,2.0, "test"); +select @c:=0; +@c:=0 +0 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +update t1 SET id=(@c:=@c+1); +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @c; +@c +1 +select @c:=0; +@c:=0 +0 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +update t1 set id=(@c:=@c+1); +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @c; +@c +1 +select @c:=0; +@c:=0 +0 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @c:=@c+1; +@c:=@c+1 +1 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @d,(@d:=id),@d from t1; +@d (@d:=id) @d +NULL 1 1 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @e,(@e:=d),@e from t1; +@e (@e:=d) @e +NULL 2 2 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @f,(@f:=c),@f from t1; +@f (@f:=c) @f +NULL test test +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +set @g=1; +select @g,(@g:=c),@g from t1; +@g (@g:=c) @g +1 test 0 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @c, @d, @e, @f; +@c @d @e @f +1 1 2 test +select @d:=id, @e:=id, @f:=id, @g:=@id from t1; +@d:=id @e:=id @f:=id @g:=@id +1 1 1 NULL +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @c, @d, @e, @f, @g; +@c @d @e @f @g +1 1 1 1 NULL +drop table t1; +select @a:=10, @b:=2, @a>@b, @a:="10", @b:="2", @a>@b, @a:=10, @b:=2, @a>@b, @a:="10", @b:="2", @a>@b; +@a:=10 @b:=2 @a>@b @a:="10" @b:="2" @a>@b @a:=10 @b:=2 @a>@b @a:="10" @b:="2" @a>@b +10 2 1 10 2 1 10 2 1 10 2 1 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +create table t1 (i int not null); +insert t1 values (1),(2),(2),(3),(3),(3); +select @a:=0; +@a:=0 +0 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @a, @a:=@a+count(*), count(*), @a from t1 group by i; +@a @a:=@a+count(*) count(*) @a +0 1 1 0 +0 2 2 0 +0 3 3 0 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @a:=0; +@a:=0 +0 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i; +@a+0 @a:=@a+0+count(*) count(*) @a+0 +0 1 1 0 +0 2 2 0 +0 3 3 0 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +set @a=0; +select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i; +@a @a:="hello" @a @a:=3 @a @a:="hello again" +0 hello 0 3 0 hello again +0 hello 0 3 0 hello again +0 hello 0 3 0 hello again +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i; +@a @a:="hello" @a @a:=3 @a @a:="hello again" +hello again hello hello again 3 hello again hello again +hello again hello hello again 3 hello again hello again +hello again hello hello again 3 hello again hello again +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +drop table t1; +set @a=_latin2'test'; +select charset(@a),collation(@a),coercibility(@a); +charset(@a) collation(@a) coercibility(@a) +latin2 latin2_general_ci 2 +select @a=_latin2'TEST'; +@a=_latin2'TEST' +1 +select @a=_latin2'TEST' collate latin2_bin; +@a=_latin2'TEST' collate latin2_bin +0 +set @a=_latin2'test' collate latin2_general_ci; +select charset(@a),collation(@a),coercibility(@a); +charset(@a) collation(@a) coercibility(@a) +latin2 latin2_general_ci 2 +select @a=_latin2'TEST'; +@a=_latin2'TEST' +1 +select @a=_latin2'TEST' collate latin2_bin; +@a=_latin2'TEST' collate latin2_bin +0 +select charset(@a:=_latin2'test'); +charset(@a:=_latin2'test') +latin2 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select collation(@a:=_latin2'test'); +collation(@a:=_latin2'test') +latin2_general_ci +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select coercibility(@a:=_latin2'test'); +coercibility(@a:=_latin2'test') +2 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select collation(@a:=_latin2'test' collate latin2_bin); +collation(@a:=_latin2'test' collate latin2_bin) +latin2_bin +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select coercibility(@a:=_latin2'test' collate latin2_bin); +coercibility(@a:=_latin2'test' collate latin2_bin) +2 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST'; +(@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' +0 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select charset(@a),collation(@a),coercibility(@a); +charset(@a) collation(@a) coercibility(@a) +latin2 latin2_bin 2 +select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci; +(@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci +1 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +set @var= NULL ; +select FIELD( @var,'1it','Hit') as my_column; +my_column +0 +select @v, coercibility(@v); +@v coercibility(@v) +NULL 2 +set @v1=null, @v2=1, @v3=1.1, @v4=now(); +select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4); +coercibility(@v1) coercibility(@v2) coercibility(@v3) coercibility(@v4) +2 2 2 2 +set session @honk=99; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@honk=99' at line 1 +select @@local.max_allowed_packet; +@@local.max_allowed_packet +# +select @@session.max_allowed_packet; +@@session.max_allowed_packet +# +select @@global.max_allowed_packet; +@@global.max_allowed_packet +# +select @@max_allowed_packet; +@@max_allowed_packet +# +select @@Max_Allowed_Packet; +@@Max_Allowed_Packet +# +select @@version; +@@version +# +select @@global.version; +@@global.version +# +End of 4.1 tests +set @first_var= NULL; +create table t1 select @first_var; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `@first_var` longblob +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +set @first_var= cast(NULL as signed integer); +create table t1 select @first_var; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `@first_var` bigint DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +set @first_var= NULL; +create table t1 select @first_var; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `@first_var` bigint DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +set @first_var= concat(NULL); +create table t1 select @first_var; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `@first_var` longblob +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +set @first_var=1; +set @first_var= cast(NULL as CHAR); +create table t1 select @first_var; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `@first_var` longtext +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +drop table t1; +set @a=18446744071710965857; +select @a; +@a +18446744071710965857 +CREATE TABLE `bigfailure` ( +`afield` BIGINT UNSIGNED NOT NULL +); +INSERT INTO `bigfailure` VALUES (18446744071710965857); +SELECT * FROM bigfailure; +afield +18446744071710965857 +select * from (SELECT afield FROM bigfailure) as b; +afield +18446744071710965857 +select * from bigfailure where afield = (SELECT afield FROM bigfailure); +afield +18446744071710965857 +select * from bigfailure where afield = 18446744071710965857; +afield +18446744071710965857 +select * from bigfailure where afield = 18446744071710965856+1; +afield +18446744071710965857 +SET @a := (SELECT afield FROM bigfailure); +SELECT @a; +@a +18446744071710965857 +SET @a := (select afield from (SELECT afield FROM bigfailure) as b); +SELECT @a; +@a +18446744071710965857 +SET @a := (select * from bigfailure where afield = (SELECT afield FROM bigfailure)); +SELECT @a; +@a +18446744071710965857 +drop table bigfailure; +create table t1(f1 int, f2 int); +insert into t1 values (1,2),(2,3),(3,1); +select @var:=f2 from t1 group by f1 order by f2 desc limit 1; +@var:=f2 +3 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @var; +@var +3 +create table t2 as select @var:=f2 from t1 group by f1 order by f2 desc limit 1; +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select * from t2; +@var:=f2 +3 +select @var; +@var +3 +drop table t1,t2; +insert into city 'blah'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''blah'' at line 1 +SHOW COUNT(*) WARNINGS; +@@session.warning_count +1 +SHOW COUNT(*) ERRORS; +@@session.error_count +1 +create table t1(f1 int, f2 varchar(2), f3 float, f4 decimal(2,1)); +insert into t1 values +(1, "a", 1.5, 1.6), (1, "a", 1.5, 1.6), (2, "b", 2.5, 2.6), +(3, "c", 3.5, 3.6), (4, "d", 4.5, 4.6), (1, "a", 1.5, 1.6), +(3, "c", 3.5, 3.6), (1, "a", 1.5, 1.6); +select @a:=f1, count(f1) from t1 group by 1 order by 1 desc; +@a:=f1 count(f1) +4 1 +3 2 +2 1 +1 4 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @a:=f1, count(f1) from t1 group by 1 order by 1 asc; +@a:=f1 count(f1) +1 4 +2 1 +3 2 +4 1 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @a:=f2, count(f2) from t1 group by 1 order by 1 desc; +@a:=f2 count(f2) +d 1 +c 2 +b 1 +a 4 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @a:=f3, count(f3) from t1 group by 1 order by 1 desc; +@a:=f3 count(f3) +4.5 1 +3.5 2 +2.5 1 +1.5 4 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +select @a:=f4, count(f4) from t1 group by 1 order by 1 desc; +@a:=f4 count(f4) +4.6 1 +3.6 2 +2.6 1 +1.6 4 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +drop table t1; +create table t1 (f1 int); +insert into t1 values (2), (1); +select @i := f1 as j from t1 order by 1; +j +1 +2 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +drop table t1; +create table t1(a int); +insert into t1 values(5),(4),(4),(3),(2),(2),(2),(1); +set @rownum := 0; +set @rank := 0; +set @prev_score := NULL; +select @rownum := @rownum + 1 as `row`, +@rank := IF(@prev_score!=a, @rownum, @rank) as `rank`, +@prev_score := a as score +from t1 order by score desc; +drop table t1; +create table t1(b bigint); +insert into t1 (b) values (10), (30), (10); +set @var := 0; +select if(b=@var, 999, b) , @var := b from t1 order by b; +if(b=@var, 999, b) @var := b +10 10 +999 10 +30 30 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +drop table t1; +create temporary table t1 (id int); +insert into t1 values (2), (3), (3), (4); +set @lastid=-1; +select @lastid != id, @lastid, @lastid := id from t1; +@lastid != id @lastid @lastid := id +1 -1 2 +1 2 3 +0 3 3 +1 3 4 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +drop table t1; +create temporary table t1 (id bigint); +insert into t1 values (2), (3), (3), (4); +set @lastid=-1; +select @lastid != id, @lastid, @lastid := id from t1; +@lastid != id @lastid @lastid := id +1 -1 2 +1 2 3 +0 3 3 +1 3 4 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +drop table t1; +CREATE TABLE t1(a INT, b INT); +INSERT INTO t1 VALUES (0, 0), (2, 1), (2, 3), (1, 1), (30, 20); +SELECT a, b INTO @a, @b FROM t1 WHERE a=2 AND b=3 GROUP BY a, b; +SELECT @a, @b; +@a @b +2 3 +SELECT a, b FROM t1 WHERE a=2 AND b=3 GROUP BY a, b; +a b +2 3 +DROP TABLE t1; +CREATE TABLE t1 (f1 int(11) default NULL, f2 int(11) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t2 (f1 int(11) default NULL, f2 int(11) default NULL, foo int(11)); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +CREATE TABLE t3 (f1 int(11) default NULL, f2 int(11) default NULL); +Warnings: +Warning 1681 Integer display width is deprecated and will be removed in a future release. +Warning 1681 Integer display width is deprecated and will be removed in a future release. +INSERT INTO t1 VALUES(10, 10); +INSERT INTO t1 VALUES(10, 10); +INSERT INTO t2 VALUES(10, 10, 10); +INSERT INTO t2 VALUES(10, 10, 10); +INSERT INTO t3 VALUES(10, 10); +INSERT INTO t3 VALUES(10, 10); +SELECT MIN(t2.f1), +@bar:= (SELECT MIN(t3.f2) FROM t3 WHERE t3.f2 > foo) +FROM t1,t2 WHERE t1.f1 = t2.f1 ORDER BY t2.f1; +MIN(t2.f1) @bar:= (SELECT MIN(t3.f2) FROM t3 WHERE t3.f2 > foo) +10 NULL +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +DROP TABLE t1, t2, t3; +End of 5.0 tests +CREATE TABLE t1 (i INT); +CREATE TRIGGER t_after_insert AFTER INSERT ON t1 FOR EACH ROW SET @bug42188 = 10; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (1); +DROP TABLE t1; +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (0),(0); +# BUG#55615 : should not crash +SELECT (@a:=(SELECT @a:=1 FROM t1 LIMIT 1)) AND COUNT(1) FROM t1 GROUP BY @a; +(@a:=(SELECT @a:=1 FROM t1 LIMIT 1)) AND COUNT(1) +1 +1 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +# BUG#55564 : should not crash +SELECT IF( +@v:=LEAST((SELECT 1 FROM t1 t2 LEFT JOIN t1 ON (@v) GROUP BY t1.a), a), +count(*), 1) +FROM t1 GROUP BY a LIMIT 1; +IF( +@v:=LEAST((SELECT 1 FROM t1 t2 LEFT JOIN t1 ON (@v) GROUP BY t1.a), a), +count(*), 1) +1 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +DROP TABLE t1; +select @v:=@v:=sum(1) from dual; +@v:=@v:=sum(1) +1 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +CREATE TABLE t1(a DECIMAL(31,21)); +INSERT INTO t1 VALUES (0); +SELECT (@v:=a) <> (@v:=1) FROM t1; +(@v:=a) <> (@v:=1) +1 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +DROP TABLE t1; +End of 5.1 tests +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(f1 INT AUTO_INCREMENT, PRIMARY KEY(f1)); +INSERT INTO t1 SET f1 = NULL ; +SET @aux = NULL ; +INSERT INTO t1 SET f1 = @aux ; +SET @aux1 = 0.123E-1; +SET @aux1 = NULL; +INSERT INTO t1 SET f1 = @aux1 ; +SELECT * FROM t1; +f1 +1 +2 +3 +DROP TABLE t1; +CREATE TABLE t1(f1 VARCHAR(257) , f2 INT, PRIMARY KEY(f2)); +CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @aux = 1; +SET @aux = 1; +SET @aux = NULL; +INSERT INTO test.t1 (f1, f2) VALUES (1, 1), (@aux, 2); +SET @aux = 'text'; +SET @aux = NULL; +INSERT INTO t1(f1, f2) VALUES (1, 3), (@aux, 4); +SELECT f1, f2 FROM t1 ORDER BY f2; +f1 f2 +1 1 +1 2 +1 3 +1 4 +DROP TRIGGER trg1; +DROP TABLE t1; +# +# Bug #12408412: GROUP_CONCAT + ORDER BY + INPUT/OUTPUT +# SAME USER VARIABLE = CRASH +# +SET @bug12408412=1; +SELECT GROUP_CONCAT(@bug12408412 ORDER BY 1) INTO @bug12408412; +End of 5.5 tests +CREATE TABLE t1(a int); +INSERT INTO t1 VALUES (1), (2); +SELECT DISTINCT @a:=MIN(t1.a) FROM t1, t1 AS t2 +GROUP BY @b:=(SELECT COUNT(*) > t2.a); +@a:=MIN(t1.a) +1 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +DROP TABLE t1; +CREATE TABLE t1(a INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (0); +SELECT DISTINCT POW(COUNT(*), @a:=(SELECT 1 FROM t1 LEFT JOIN t1 AS t2 ON @a)) +AS b FROM t1 GROUP BY a; +b +1 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +SELECT @a; +@a +1 +DROP TABLE t1; +CREATE TABLE t1(f1 INT, f2 INT); +INSERT INTO t1 VALUES (1,2),(2,3),(3,1); +CREATE TABLE t2(a INT); +INSERT INTO t2 VALUES (1); +SET @var=NULL; +SELECT @var:=(SELECT f2 FROM t2 WHERE @var) FROM t1 GROUP BY f1 ORDER BY f2 DESC +LIMIT 1; +@var:=(SELECT f2 FROM t2 WHERE @var) +NULL +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +SELECT @var; +@var +NULL +DROP TABLE t1, t2; +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +CREATE TABLE t2(a INT); +INSERT INTO t2 VALUES (1), (3), (5), (7), (9); +CREATE TABLE t3(a INT); +INSERT INTO t3 VALUES (1), (4), (7), (10); +SET @var1 = 6; +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 +explain format=json SELECT t1.a, t2.a, t3.a, (@var1:= @var1+0) AS var +FROM t1 +LEFT JOIN t2 ON t1.a=t2.a AND t2.a < @var1 +LEFT JOIN t3 ON t1.a=t3.a AND t3.a < @var1; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "cost_info": { + "query_cost": "26.75" + }, + "nested_loop": [ + { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows_examined_per_scan": 10, + "rows_produced_per_join": 10, + "filtered": "100.00", + "cost_info": { + "read_cost": "0.25", + "eval_cost": "1.00", + "prefix_cost": "1.25", + "data_read_per_join": "80" + }, + "used_columns": [ + "a" + ] + } + }, + { + "table": { + "table_name": "t2", + "access_type": "ALL", + "rows_examined_per_scan": 5, + "rows_produced_per_join": 50, + "filtered": "100.00", + "using_join_buffer": "hash join", + "cost_info": { + "read_cost": "0.25", + "eval_cost": "5.00", + "prefix_cost": "6.50", + "data_read_per_join": "400" + }, + "used_columns": [ + "a" + ], + "attached_condition": "(is_not_null_compl(t2), ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t1`.`a` < (@`var1`))), true)" + } + }, + { + "table": { + "table_name": "t3", + "access_type": "ALL", + "rows_examined_per_scan": 4, + "rows_produced_per_join": 200, + "filtered": "100.00", + "using_join_buffer": "hash join", + "cost_info": { + "read_cost": "0.25", + "eval_cost": "20.00", + "prefix_cost": "26.75", + "data_read_per_join": "1K" + }, + "used_columns": [ + "a" + ], + "attached_condition": "(is_not_null_compl(t3), ((`test`.`t3`.`a` = `test`.`t1`.`a`) and (`test`.`t1`.`a` < (@`var1`))), true)" + } + } + ] + } +} +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,(@var1:=((@`var1`) + 0)) AS `var` from `test`.`t1` left join `test`.`t2` on(((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t1`.`a` < (@`var1`)))) left join `test`.`t3` on(((`test`.`t3`.`a` = `test`.`t1`.`a`) and (`test`.`t1`.`a` < (@`var1`)))) where true +SELECT t1.a, t2.a, t3.a, (@var1:= @var1+0) AS var +FROM t1 +LEFT JOIN t2 ON t1.a=t2.a AND t2.a < @var1 +LEFT JOIN t3 ON t1.a=t3.a AND t3.a < @var1; +a a a var +1 1 1 6 +10 NULL NULL 6 +2 NULL NULL 6 +3 3 NULL 6 +4 NULL 4 6 +5 5 NULL 6 +6 NULL NULL 6 +7 NULL NULL 6 +8 NULL NULL 6 +9 NULL NULL 6 +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warnings: +DROP TABLE t1, t2, t3; +set @X234567890123456789012345678901234567890123456789012345678901234 = 12; +select @X234567890123456789012345678901234567890123456789012345678901234; +@X234567890123456789012345678901234567890123456789012345678901234 +12 +set @X2345678901234567890123456789012345678901234567890123456789012345 = 12; +ERROR 42000: User variable name 'X2345678901234567890123456789012345678901234567890123456789012345' is illegal +set @``= "illegal"; +ERROR 42000: User variable name '' is illegal +set @`endswithspace `= "illegal"; +ERROR 42000: User variable name 'endswithspace ' is illegal +select @X2345678901234567890123456789012345678901234567890123456789012345; +@X2345678901234567890123456789012345678901234567890123456789012345 +NULL +select @``; +@`` +NULL +select @`endswithspace `; +@`endswithspace ` +NULL +CREATE TABLE t1(a INT,KEY(a))ENGINE=INNODB; +SELECT 1 NOT IN (SELECT 1 FROM t1 as t1 GROUP BY 1 LIKE (SELECT 1 FROM t1 as t2)) AS col; +col +1 +SELECT 1 NOT IN (SELECT 1 FROM t1 as t1 ORDER BY 1 LIKE (SELECT 1 FROM t1 as t2)) AS col; +col +1 +SET @c =(SELECT 1 NOT IN (SELECT 1 FROM t1 as t1 GROUP BY 1 LIKE (SELECT 1 FROM t1 as t2)) AS col); +SET @d =(SELECT 1 NOT IN (SELECT 1 FROM t1 as t1 ORDER BY 1 LIKE (SELECT 1 FROM t1 as t2)) AS col); +DROP TABLE t1; +Bug#25727892: Refactor Item::const_item() as a non-virtual function +Coverage for cached and non-cached user variables +CREATE TABLE t1(a INTEGER, b INTEGER); +INSERT INTO t1 VALUES (1,1), (1,2), (2,1); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +explain SELECT a FROM t1 WHERE a = @x; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 3 33.33 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 33.33 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = ((@`x`))) +explain SELECT a FROM t1 WHERE a = @x AND (@x:= @x); +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 33.33 Using where +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = (@`x`)) and (0 <> (@x:=(@`x`)))) +explain SELECT a FROM t1 WHERE a = @x INTO @x; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 3 33.33 Using where +Warnings: +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = ((@`x`))) +SET @x= 1; +SELECT a FROM t1 WHERE a = @x; +a +1 +1 +SELECT a FROM t1 WHERE a = @x AND (@x:= @x); +a +1 +1 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +SELECT a FROM t1 WHERE a = @x INTO @x; +ERROR 42000: Result consisted of more than one row +SET @x= 2; +SELECT a FROM t1 WHERE a = @x INTO @x; +DROP TABLE t1; +# +# Bug#28960901: ASSERTION FAILED: (TLEN % 2) == 0 +# +CREATE TABLE t1(a VARCHAR(10) CHARSET latin1, b VARCHAR(20) CHARSET utf16); +INSERT INTO t1 VALUES ('a', 'abcd'); +SELECT (@x:=b) FROM t1; +(@x:=b) +abcd +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +SELECT * FROM t1 WHERE b = (SELECT (@x:=1) FROM t1) OR a = @x; +a b +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +Warning 1292 Truncated incorrect DOUBLE value: '' +SELECT (@x:=a) FROM t1; +(@x:=a) +a +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +SELECT * FROM t1 WHERE a = (SELECT (@x:=_utf16 0x1023) FROM t1) OR b = @x; +ERROR HY000: Invalid latin1 character string: '\x10\x23' +DROP TABLE t1; +# +# Bug#29665165: REGRESSION: SOUNDS LIKE CRASHING TO ME +# +SET @c := FROM_UNIXTIME(1537002029); +DO ((@c := (_utf32' -'))) SOUNDS LIKE(@c); +ERROR HY000: Invalid latin1 character string: '\x00\x00\x20\x2D' +# 'Temporal = string literal' compares as temporals, but +# 'Temporal = string user variable' compares as DOUBLE. +# It is a behaviour change introduced by WL#6570. +# Note that +# https://dev.mysql.com/doc/refman/8.0/en/type-conversion.html +# suggests explicit casts as safer. Bug#90076 should fix this. +CREATE TABLE t1 (pk INTEGER PRIMARY KEY, d DATE); +INSERT INTO t1 VALUES(1, '2017-01-01'); +SELECT d < 00010101000000.0 AS a FROM t1; +a +0 +set @tsn= 00010101000000.0; +SELECT d < @tsn AS a FROM t1; +a +1 +DROP TABLE t1; +CREATE TABLE numbers +(pk INTEGER PRIMARY KEY, +ui BIGINT UNSIGNED, +si BIGINT +); +INSERT INTO numbers VALUES +(0, 0, -9223372036854775808), (1, 18446744073709551615, 9223372036854775807); +SET @ui_min = CAST(0 AS UNSIGNED); +SET @ui_max = CAST(18446744073709551615 AS UNSIGNED); +SET @si_min = CAST(-9223372036854775808 AS SIGNED); +SET @si_max = CAST(9223372036854775807 AS SIGNED); +PREPARE s1 FROM 'SELECT * FROM numbers WHERE ui=?'; +PREPARE s2 FROM 'SELECT * FROM numbers WHERE si=?'; +EXECUTE s1 USING @ui_min; +pk ui si +0 0 -9223372036854775808 +EXECUTE s1 USING @ui_max; +pk ui si +1 18446744073709551615 9223372036854775807 +EXECUTE s1 USING @si_min; +pk ui si +EXECUTE s1 USING @si_max; +pk ui si +EXECUTE s2 USING @ui_min; +pk ui si +EXECUTE s2 USING @ui_max; +pk ui si +EXECUTE s2 USING @si_min; +pk ui si +0 0 -9223372036854775808 +EXECUTE s2 USING @si_max; +pk ui si +1 18446744073709551615 9223372036854775807 +DEALLOCATE PREPARE s1; +DEALLOCATE PREPARE s2; +DROP TABLE numbers; +CREATE TABLE strings +(pk INTEGER PRIMARY KEY, +vc_ascii VARCHAR(20) COLLATE ascii_general_ci, +vc_latin1 VARCHAR(20) COLLATE latin1_general_ci, +vc_utf8mb4 VARCHAR(20) COLLATE utf8mb4_0900_ai_ci, +vc_utf16 VARCHAR(20) COLLATE utf16_general_ci, +vc_utf32 VARCHAR(20) COLLATE utf32_general_ci +); +SET @str_ascii=_ASCII'abcxyz'; +SET @str_utf8mb4=CONVERT(x'616263C3A6C3B8C3A578797A' USING utf8mb4); +SET @str_latin1=CONVERT(@str_utf8mb4 USING latin1); +SET @str_utf16=CONVERT(@str_utf8mb4 USING utf16); +SET @str_utf32=CONVERT(@str_utf8mb4 USING utf32); +INSERT INTO strings VALUES +(0, @str_ascii, @str_ascii, @str_ascii, @str_ascii, @str_ascii), +(1, @str_ascii, @str_utf8mb4, @str_utf8mb4, @str_utf8mb4, @str_utf8mb4); +PREPARE s1 FROM 'SELECT HEX(vc_utf8mb4) FROM strings WHERE vc_ascii = ?'; +PREPARE s2 FROM 'SELECT HEX(vc_utf8mb4) FROM strings WHERE vc_latin1 = ?'; +PREPARE s3 FROM 'SELECT HEX(vc_utf8mb4) FROM strings WHERE vc_utf8mb4 = ?'; +PREPARE s4 FROM 'SELECT HEX(vc_utf8mb4) FROM strings WHERE vc_utf16 = ?'; +PREPARE s5 FROM 'SELECT HEX(vc_utf8mb4) FROM strings WHERE vc_utf32 = ?'; +EXECUTE s1 USING @str_ascii; +HEX(vc_utf8mb4) +61626378797A +616263C3A6C3B8C3A578797A +EXECUTE s1 USING @str_latin1; +ERROR HY000: Conversion from collation latin1_swedish_ci into ascii_general_ci impossible for parameter +EXECUTE s1 USING @str_utf8mb4; +ERROR HY000: Conversion from collation utf8mb4_0900_ai_ci into ascii_general_ci impossible for parameter +EXECUTE s1 USING @str_utf16; +ERROR HY000: Conversion from collation utf16_general_ci into ascii_general_ci impossible for parameter +EXECUTE s1 USING @str_utf32; +ERROR HY000: Conversion from collation utf32_general_ci into ascii_general_ci impossible for parameter +EXECUTE s2 USING @str_ascii; +HEX(vc_utf8mb4) +61626378797A +EXECUTE s2 USING @str_latin1; +HEX(vc_utf8mb4) +616263C3A6C3B8C3A578797A +EXECUTE s2 USING @str_utf8mb4; +HEX(vc_utf8mb4) +616263C3A6C3B8C3A578797A +EXECUTE s2 USING @str_utf16; +HEX(vc_utf8mb4) +616263C3A6C3B8C3A578797A +EXECUTE s2 USING @str_utf32; +HEX(vc_utf8mb4) +616263C3A6C3B8C3A578797A +EXECUTE s3 USING @str_ascii; +HEX(vc_utf8mb4) +61626378797A +EXECUTE s3 USING @str_latin1; +HEX(vc_utf8mb4) +616263C3A6C3B8C3A578797A +EXECUTE s3 USING @str_utf8mb4; +HEX(vc_utf8mb4) +616263C3A6C3B8C3A578797A +EXECUTE s3 USING @str_utf16; +HEX(vc_utf8mb4) +616263C3A6C3B8C3A578797A +EXECUTE s3 USING @str_utf32; +HEX(vc_utf8mb4) +616263C3A6C3B8C3A578797A +EXECUTE s4 USING @str_ascii; +HEX(vc_utf8mb4) +61626378797A +EXECUTE s4 USING @str_latin1; +HEX(vc_utf8mb4) +616263C3A6C3B8C3A578797A +EXECUTE s4 USING @str_utf8mb4; +HEX(vc_utf8mb4) +616263C3A6C3B8C3A578797A +EXECUTE s4 USING @str_utf16; +HEX(vc_utf8mb4) +616263C3A6C3B8C3A578797A +EXECUTE s4 USING @str_utf32; +HEX(vc_utf8mb4) +616263C3A6C3B8C3A578797A +EXECUTE s5 USING @str_ascii; +HEX(vc_utf8mb4) +61626378797A +EXECUTE s5 USING @str_latin1; +HEX(vc_utf8mb4) +616263C3A6C3B8C3A578797A +EXECUTE s5 USING @str_utf8mb4; +HEX(vc_utf8mb4) +616263C3A6C3B8C3A578797A +EXECUTE s5 USING @str_utf16; +HEX(vc_utf8mb4) +616263C3A6C3B8C3A578797A +EXECUTE s5 USING @str_utf32; +HEX(vc_utf8mb4) +616263C3A6C3B8C3A578797A +DEALLOCATE PREPARE s1; +DEALLOCATE PREPARE s2; +DEALLOCATE PREPARE s3; +DEALLOCATE PREPARE s4; +DEALLOCATE PREPARE s5; +DROP TABLE strings; +set @maxint=18446744073709551615; +SELECT @maxint + 0e0; +@maxint + 0e0 +1.8446744073709552e19 +SELECT 18446744073709551615 + 0e0; +18446744073709551615 + 0e0 +1.8446744073709552e19 +SELECT @maxint + 0.0; +@maxint + 0.0 +18446744073709551615.0 +SELECT 18446744073709551615 + 0.0; +18446744073709551615 + 0.0 +18446744073709551615.0 +PREPARE s FROM 'SELECT 0e0 + ?'; +EXECUTE s USING @maxint; +0e0 + ? +1.8446744073709552e19 +DEALLOCATE PREPARE s; +PREPARE s FROM 'SELECT 0.0 + ?'; +EXECUTE s USING @maxint; +0.0 + ? +18446744073709551615.000000000000000000000000000000 +DEALLOCATE PREPARE s; +PREPARE s FROM 'SELECT 0 + ?'; +EXECUTE s USING @maxint; +0 + ? +18446744073709551615 +DEALLOCATE PREPARE s; +PREPARE s FROM 'SELECT concat(?,"")'; +EXECUTE s USING @maxint; +concat(?,"") +18446744073709551615 +DEALLOCATE PREPARE s; +# Bug#31358565: Assertion `false' failed. In Item_func_get_user_var::propagate_type' +do null not between 1 and @undefined_var; +do null not between @undefined_var and 1; +# Bug#28013997: Assertion failed: (slen % 4) == 0 +SET @f = _utf32 'a'; +CREATE TABLE t1 (a TIMESTAMP); +INSERT INTO t1 VALUES ('2018-05-12 07:43:04'), ('2018-05-12 07:43:04'); +SELECT 1 FROM t1 WHERE @f<>'3761-03-28' XOR (@f:='5570-12-30') > a; +1 +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +DROP TABLE t1; +# Bug#31599885: Global-buffer-overflow in decimal_bin_size_inline +CREATE TABLE t(a BIT(4), b INTEGER); +SELECT AVG((@e:= a)) FROM t; +AVG((@e:= a)) +NULL +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +SELECT AVG((@e:= a)) FROM t GROUP BY b; +AVG((@e:= a)) +Warnings: +Warning 1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. +DROP TABLE t; diff --git a/mysql-test/r/with_non_recursive.result-pq b/mysql-test/r/with_non_recursive.result-pq index 74e488487ad6..4b9e1338970a 100644 --- a/mysql-test/r/with_non_recursive.result-pq +++ b/mysql-test/r/with_non_recursive.result-pq @@ -457,9 +457,8 @@ foo bar foo bar 1 2 1 2 explain with qn (foo, bar) as (select 1, 2 from t1) select * from qn, qn qn1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 Using join buffer (hash join) +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 Using join buffer (hash join) Warnings: Note 1003 /* select#1 */ select 1 AS `foo`,2 AS `bar`,1 AS `foo`,2 AS `bar` from `test`.`t1` join `test`.`t1` with qn (foo, bar) as (select 1 as col, 2 as coll from t1) select * from qn, qn qn1; @@ -1573,9 +1572,8 @@ foo bar foo bar 1 2 1 2 explain with qn (foo, bar) as (select 1, 2 from t1) select * from qn, qn qn1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 2 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 Using join buffer (hash join) +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 NULL +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2 100.00 Using join buffer (hash join) Warnings: Note 1003 /* select#1 */ select 1 AS `foo`,2 AS `bar`,1 AS `foo`,2 AS `bar` from `test`.`t1` join `test`.`t1` with qn (foo, bar) as (select 1 as col, 2 as coll from t1) select * from qn, qn qn1; diff --git a/mysql-test/suite/opt_trace/r/charset.result-pq b/mysql-test/suite/opt_trace/r/charset.result-pq index 2d8156cd8bb0..3cb43d67b287 100644 --- a/mysql-test/suite/opt_trace/r/charset.result-pq +++ b/mysql-test/suite/opt_trace/r/charset.result-pq @@ -5,8 +5,7 @@ insert into t1 values(1); set names latin1; explain select '', _latin1'' from t1 limit 1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra -1 SIMPLE NULL ALL NULL NULL NULL NULL 1 100.00 Parallel execute (1 workers) -2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL +1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 1 100.00 NULL Warnings: Note 1003 /* select#1 */ select '' AS ``,_latin1'\xC1\xC2\xC3\xC4\xC5' AS `` from `test`.`t1` limit 1 select (@query:=QUERY)+NULL, (@trace:=TRACE)+NULL from information_schema.OPTIMIZER_TRACE; @@ -103,17 +102,6 @@ explain select ' ] /* steps */ } /* join_optimization */ }, - { - "make_parallel_query_plan": { - "select#": 1, - "detail": [ - { - "table": "`t1`", - "degree of parallel": 4 - } - ] /* detail */ - } /* make_parallel_query_plan */ - }, { "join_explain": { "select#": 1, @@ -217,17 +205,6 @@ explain select 'ÁÂÃÄÅ', _latin1'ÁÂÃÄÅ' from t1 limit 1 { ] /* steps */ } /* join_optimization */ }, - { - "make_parallel_query_plan": { - "select#": 1, - "detail": [ - { - "table": "`t1`", - "degree of parallel": 4 - } - ] /* detail */ - } /* make_parallel_query_plan */ - }, { "join_explain": { "select#": 1, diff --git a/mysql-test/suite/parts/r/partition_alter3_innodb.result-pq b/mysql-test/suite/parts/r/partition_alter3_innodb.result-pq new file mode 100644 index 000000000000..d5c6f47dcda4 --- /dev/null +++ b/mysql-test/suite/parts/r/partition_alter3_innodb.result-pq @@ -0,0 +1,818 @@ +SET @max_row = 20; +SET @@session.default_storage_engine = 'InnoDB'; + +#------------------------------------------------------------------------ +# 0. Setting of auxiliary variables + Creation of an auxiliary tables +# needed in many testcases +#------------------------------------------------------------------------ +SELECT @max_row DIV 2 INTO @max_row_div2; +SELECT @max_row DIV 3 INTO @max_row_div3; +SELECT @max_row DIV 4 INTO @max_row_div4; +SET @max_int_4 = 2147483647; +DROP TABLE IF EXISTS t0_template; +CREATE TABLE t0_template ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) , +PRIMARY KEY(f_int1)) +ENGINE = MEMORY; +# Logging of INSERTs into t0_template suppressed +DROP TABLE IF EXISTS t0_definition; +CREATE TABLE t0_definition ( +state CHAR(3), +create_command VARBINARY(5000), +file_list VARBINARY(10000), +PRIMARY KEY (state) +) ENGINE = MEMORY; +DROP TABLE IF EXISTS t0_aux; +CREATE TABLE t0_aux ( f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) ) +ENGINE = MEMORY; +SET AUTOCOMMIT= 1; +SET @@session.sql_mode= ''; +# End of basic preparations needed for all tests +#----------------------------------------------- + +#======================================================================== +# 1. Partition management commands on HASH partitioned table +# column in partitioning function is of type DATE +#======================================================================== +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30)); +INSERT INTO t1 (f_date, f_varchar) +SELECT CONCAT(CAST((f_int1 + 999) AS CHAR),'-02-10'), CAST(f_char1 AS CHAR) +FROM t0_template +WHERE f_int1 + 999 BETWEEN 1000 AND 9999; +SELECT IF(9999 - 1000 + 1 > @max_row, @max_row , 9999 - 1000 + 1) +INTO @exp_row_count; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_date` date DEFAULT NULL, + `f_varchar` varchar(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +t1.ibd +EXPLAIN SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 20 10.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`f_date` = DATE'1000-02-10') +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +#------------------------------------------------------------------------ +# 1.1 Increase number of PARTITIONS +#------------------------------------------------------------------------ +# 1.1.1 ADD PARTITION to not partitioned table --> must fail +ALTER TABLE t1 ADD PARTITION (PARTITION part2); +ERROR HY000: Partition management on a not partitioned table is not possible +# 1.1.2 Assign HASH partitioning +ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_date` date DEFAULT NULL, + `f_varchar` varchar(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 PARTITION BY HASH (year(`f_date`)) */ +t1#P#p0.ibd +EXPLAIN SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`f_date` = DATE'1000-02-10') +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +# 1.1.3 Assign other HASH partitioning to already partitioned table +# + test and switch back + test +ALTER TABLE t1 PARTITION BY HASH(DAYOFYEAR(f_date)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_date` date DEFAULT NULL, + `f_varchar` varchar(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 PARTITION BY HASH (dayofyear(`f_date`)) */ +t1#P#p0.ibd +EXPLAIN SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`f_date` = DATE'1000-02-10') +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +ALTER TABLE t1 PARTITION BY HASH(YEAR(f_date)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_date` date DEFAULT NULL, + `f_varchar` varchar(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 PARTITION BY HASH (year(`f_date`)) */ +t1#P#p0.ibd +EXPLAIN SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`f_date` = DATE'1000-02-10') +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +# 1.1.4 Add PARTITIONS not fitting to HASH --> must fail +ALTER TABLE t1 ADD PARTITION (PARTITION part1 VALUES IN (0)); +ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition +ALTER TABLE t1 ADD PARTITION (PARTITION part2 VALUES LESS THAN (0)); +ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition +# 1.1.5 Add two named partitions + test +ALTER TABLE t1 ADD PARTITION (PARTITION part1, PARTITION part7); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_date` date DEFAULT NULL, + `f_varchar` varchar(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 PARTITION BY HASH (year(`f_date`)) +(PARTITION p0 ENGINE = InnoDB, + PARTITION part1 ENGINE = InnoDB, + PARTITION part7 ENGINE = InnoDB) */ +t1#P#p0.ibd +t1#P#part1.ibd +t1#P#part7.ibd +EXPLAIN SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 14.29 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`f_date` = DATE'1000-02-10') +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +# 1.1.6 Add two named partitions, name clash --> must fail +ALTER TABLE t1 ADD PARTITION (PARTITION part1, PARTITION part7); +ERROR HY000: Duplicate partition name part1 +# 1.1.7 Add one named partition + test +ALTER TABLE t1 ADD PARTITION (PARTITION part2); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_date` date DEFAULT NULL, + `f_varchar` varchar(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 PARTITION BY HASH (year(`f_date`)) +(PARTITION p0 ENGINE = InnoDB, + PARTITION part1 ENGINE = InnoDB, + PARTITION part7 ENGINE = InnoDB, + PARTITION part2 ENGINE = InnoDB) */ +t1#P#p0.ibd +t1#P#part1.ibd +t1#P#part2.ibd +t1#P#part7.ibd +EXPLAIN SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 20.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`f_date` = DATE'1000-02-10') +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +# 1.1.8 Add four not named partitions + test +ALTER TABLE t1 ADD PARTITION PARTITIONS 4; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_date` date DEFAULT NULL, + `f_varchar` varchar(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 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 p7 ENGINE = InnoDB) */ +t1#P#p0.ibd +t1#P#p4.ibd +t1#P#p5.ibd +t1#P#p6.ibd +t1#P#p7.ibd +t1#P#part1.ibd +t1#P#part2.ibd +t1#P#part7.ibd +EXPLAIN SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 3 33.33 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`f_date` = DATE'1000-02-10') +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +#------------------------------------------------------------------------ +# 1.2 Decrease number of PARTITIONS +#------------------------------------------------------------------------ +# 1.2.1 DROP PARTITION is not supported for HASH --> must fail +ALTER TABLE t1 DROP PARTITION part1; +ERROR HY000: DROP PARTITION can only be used on RANGE/LIST partitions +# 1.2.2 COALESCE PARTITION partitionname is not supported +ALTER TABLE t1 COALESCE PARTITION part1; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'part1' at line 1 +# 1.2.3 Decrease by 0 is non sense --> must fail +ALTER TABLE t1 COALESCE PARTITION 0; +ERROR HY000: At least one partition must be coalesced +# 1.2.4 COALESCE one partition + test loop +ALTER TABLE t1 COALESCE PARTITION 1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_date` date DEFAULT NULL, + `f_varchar` varchar(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 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) */ +t1#P#p0.ibd +t1#P#p4.ibd +t1#P#p5.ibd +t1#P#p6.ibd +t1#P#part1.ibd +t1#P#part2.ibd +t1#P#part7.ibd +EXPLAIN SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 33.33 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`f_date` = DATE'1000-02-10') +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +ALTER TABLE t1 COALESCE PARTITION 1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_date` date DEFAULT NULL, + `f_varchar` varchar(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 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) */ +t1#P#p0.ibd +t1#P#p4.ibd +t1#P#p5.ibd +t1#P#part1.ibd +t1#P#part2.ibd +t1#P#part7.ibd +EXPLAIN SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 4 25.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`f_date` = DATE'1000-02-10') +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +ALTER TABLE t1 COALESCE PARTITION 1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_date` date DEFAULT NULL, + `f_varchar` varchar(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 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) */ +t1#P#p0.ibd +t1#P#p4.ibd +t1#P#part1.ibd +t1#P#part2.ibd +t1#P#part7.ibd +EXPLAIN SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 25.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`f_date` = DATE'1000-02-10') +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +ALTER TABLE t1 COALESCE PARTITION 1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_date` date DEFAULT NULL, + `f_varchar` varchar(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 PARTITION BY HASH (year(`f_date`)) +(PARTITION p0 ENGINE = InnoDB, + PARTITION part1 ENGINE = InnoDB, + PARTITION part7 ENGINE = InnoDB, + PARTITION part2 ENGINE = InnoDB) */ +t1#P#p0.ibd +t1#P#part1.ibd +t1#P#part2.ibd +t1#P#part7.ibd +EXPLAIN SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 20.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`f_date` = DATE'1000-02-10') +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +ALTER TABLE t1 COALESCE PARTITION 1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_date` date DEFAULT NULL, + `f_varchar` varchar(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 PARTITION BY HASH (year(`f_date`)) +(PARTITION p0 ENGINE = InnoDB, + PARTITION part1 ENGINE = InnoDB, + PARTITION part7 ENGINE = InnoDB) */ +t1#P#p0.ibd +t1#P#part1.ibd +t1#P#part7.ibd +EXPLAIN SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 part1 ALL NULL NULL NULL NULL 7 14.29 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`f_date` = DATE'1000-02-10') +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +ALTER TABLE t1 COALESCE PARTITION 1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_date` date DEFAULT NULL, + `f_varchar` varchar(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 PARTITION BY HASH (year(`f_date`)) +(PARTITION p0 ENGINE = InnoDB, + PARTITION part1 ENGINE = InnoDB) */ +t1#P#p0.ibd +t1#P#part1.ibd +EXPLAIN SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`f_date` = DATE'1000-02-10') +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +ALTER TABLE t1 COALESCE PARTITION 1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_date` date DEFAULT NULL, + `f_varchar` varchar(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 PARTITION BY HASH (year(`f_date`)) +(PARTITION p0 ENGINE = InnoDB) */ +t1#P#p0.ibd +EXPLAIN SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`f_date` = DATE'1000-02-10') +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +# 1.2.5 COALESCE of last partition --> must fail +ALTER TABLE t1 COALESCE PARTITION 1; +ERROR HY000: Cannot remove all partitions, use DROP TABLE instead +# 1.2.6 Remove partitioning +ALTER TABLE t1 REMOVE PARTITIONING; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_date` date DEFAULT NULL, + `f_varchar` varchar(30) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +t1.ibd +EXPLAIN SELECT COUNT(*) FROM t1 WHERE f_date = '1000-02-10'; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 20 10.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` where (`test`.`t1`.`f_date` = DATE'1000-02-10') +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +# 1.2.7 Remove partitioning from not partitioned table --> ???? +ALTER TABLE t1 REMOVE PARTITIONING; +ERROR HY000: Partition management on a not partitioned table is not possible +DROP TABLE t1; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- + +#======================================================================== +# 2. Partition management commands on KEY partitioned table +#======================================================================== +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +); +INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) +SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int DEFAULT NULL, + `f_int2` int DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +t1.ibd +EXPLAIN SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 20 10.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select (count(`count(0)`) <> 1) AS `COUNT(*) <> 1` from `test`.`t1` where (`test`.`t1`.`f_int1` = 3) +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +#------------------------------------------------------------------------ +# 2.1 Increase number of PARTITIONS +# Some negative testcases are omitted (already checked with HASH). +#------------------------------------------------------------------------ +# 2.1.1 Assign KEY partitioning +ALTER TABLE t1 PARTITION BY KEY(f_int1); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int DEFAULT NULL, + `f_int2` int DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 PARTITION BY KEY (f_int1) */ +t1#P#p0.ibd +EXPLAIN SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select (count(0) <> 1) AS `COUNT(*) <> 1` from `test`.`t1` where (`test`.`t1`.`f_int1` = 3) +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +# 2.1.2 Add PARTITIONS not fitting to KEY --> must fail +ALTER TABLE t1 ADD PARTITION (PARTITION part1 VALUES IN (0)); +ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition +ALTER TABLE t1 ADD PARTITION (PARTITION part2 VALUES LESS THAN (0)); +ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition +# 2.1.3 Add two named partitions + test +ALTER TABLE t1 ADD PARTITION (PARTITION part1, PARTITION part7); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int DEFAULT NULL, + `f_int2` int DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 PARTITION BY KEY (f_int1) +(PARTITION p0 ENGINE = InnoDB, + PARTITION part1 ENGINE = InnoDB, + PARTITION part7 ENGINE = InnoDB) */ +t1#P#p0.ibd +t1#P#part1.ibd +t1#P#part7.ibd +EXPLAIN SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 14.29 Using where +Warnings: +Note 1003 /* select#1 */ select (count(0) <> 1) AS `COUNT(*) <> 1` from `test`.`t1` where (`test`.`t1`.`f_int1` = 3) +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +# 2.1.4 Add one named partition + test +ALTER TABLE t1 ADD PARTITION (PARTITION part2); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int DEFAULT NULL, + `f_int2` int DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 PARTITION BY KEY (f_int1) +(PARTITION p0 ENGINE = InnoDB, + PARTITION part1 ENGINE = InnoDB, + PARTITION part7 ENGINE = InnoDB, + PARTITION part2 ENGINE = InnoDB) */ +t1#P#p0.ibd +t1#P#part1.ibd +t1#P#part2.ibd +t1#P#part7.ibd +EXPLAIN SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 20.00 Using where +Warnings: +Note 1003 /* select#1 */ select (count(0) <> 1) AS `COUNT(*) <> 1` from `test`.`t1` where (`test`.`t1`.`f_int1` = 3) +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +# 2.1.5 Add four not named partitions + test +ALTER TABLE t1 ADD PARTITION PARTITIONS 4; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int DEFAULT NULL, + `f_int2` int DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 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 p7 ENGINE = InnoDB) */ +t1#P#p0.ibd +t1#P#p4.ibd +t1#P#p5.ibd +t1#P#p6.ibd +t1#P#p7.ibd +t1#P#part1.ibd +t1#P#part2.ibd +t1#P#part7.ibd +EXPLAIN SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 p6 ALL NULL NULL NULL NULL 3 33.33 Using where +Warnings: +Note 1003 /* select#1 */ select (count(0) <> 1) AS `COUNT(*) <> 1` from `test`.`t1` where (`test`.`t1`.`f_int1` = 3) +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +#------------------------------------------------------------------------ +# 2.2 Decrease number of PARTITIONS +# Some negative testcases are omitted (already checked with HASH). +#------------------------------------------------------------------------ +# 2.2.1 DROP PARTITION is not supported for KEY --> must fail +ALTER TABLE t1 DROP PARTITION part1; +ERROR HY000: DROP PARTITION can only be used on RANGE/LIST partitions +# 2.2.4 COALESCE one partition + test loop +ALTER TABLE t1 COALESCE PARTITION 1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int DEFAULT NULL, + `f_int2` int DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 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) */ +t1#P#p0.ibd +t1#P#p4.ibd +t1#P#p5.ibd +t1#P#p6.ibd +t1#P#part1.ibd +t1#P#part2.ibd +t1#P#part7.ibd +EXPLAIN SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 25.00 Using where +Warnings: +Note 1003 /* select#1 */ select (count(0) <> 1) AS `COUNT(*) <> 1` from `test`.`t1` where (`test`.`t1`.`f_int1` = 3) +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +ALTER TABLE t1 COALESCE PARTITION 1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int DEFAULT NULL, + `f_int2` int DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 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) */ +t1#P#p0.ibd +t1#P#p4.ibd +t1#P#p5.ibd +t1#P#part1.ibd +t1#P#part2.ibd +t1#P#part7.ibd +EXPLAIN SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 3 33.33 Using where +Warnings: +Note 1003 /* select#1 */ select (count(0) <> 1) AS `COUNT(*) <> 1` from `test`.`t1` where (`test`.`t1`.`f_int1` = 3) +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +ALTER TABLE t1 COALESCE PARTITION 1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int DEFAULT NULL, + `f_int2` int DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 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) */ +t1#P#p0.ibd +t1#P#p4.ibd +t1#P#part1.ibd +t1#P#part2.ibd +t1#P#part7.ibd +EXPLAIN SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 p4 ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select (count(0) <> 1) AS `COUNT(*) <> 1` from `test`.`t1` where (`test`.`t1`.`f_int1` = 3) +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +ALTER TABLE t1 COALESCE PARTITION 1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int DEFAULT NULL, + `f_int2` int DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 PARTITION BY KEY (f_int1) +(PARTITION p0 ENGINE = InnoDB, + PARTITION part1 ENGINE = InnoDB, + PARTITION part7 ENGINE = InnoDB, + PARTITION part2 ENGINE = InnoDB) */ +t1#P#p0.ibd +t1#P#part1.ibd +t1#P#part2.ibd +t1#P#part7.ibd +EXPLAIN SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 5 20.00 Using where +Warnings: +Note 1003 /* select#1 */ select (count(0) <> 1) AS `COUNT(*) <> 1` from `test`.`t1` where (`test`.`t1`.`f_int1` = 3) +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +ALTER TABLE t1 COALESCE PARTITION 1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int DEFAULT NULL, + `f_int2` int DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 PARTITION BY KEY (f_int1) +(PARTITION p0 ENGINE = InnoDB, + PARTITION part1 ENGINE = InnoDB, + PARTITION part7 ENGINE = InnoDB) */ +t1#P#p0.ibd +t1#P#part1.ibd +t1#P#part7.ibd +EXPLAIN SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 part7 ALL NULL NULL NULL NULL 7 14.29 Using where +Warnings: +Note 1003 /* select#1 */ select (count(0) <> 1) AS `COUNT(*) <> 1` from `test`.`t1` where (`test`.`t1`.`f_int1` = 3) +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +ALTER TABLE t1 COALESCE PARTITION 1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int DEFAULT NULL, + `f_int2` int DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 PARTITION BY KEY (f_int1) +(PARTITION p0 ENGINE = InnoDB, + PARTITION part1 ENGINE = InnoDB) */ +t1#P#p0.ibd +t1#P#part1.ibd +EXPLAIN SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select (count(0) <> 1) AS `COUNT(*) <> 1` from `test`.`t1` where (`test`.`t1`.`f_int1` = 3) +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +ALTER TABLE t1 COALESCE PARTITION 1; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int DEFAULT NULL, + `f_int2` int DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +/*!50100 PARTITION BY KEY (f_int1) +(PARTITION p0 ENGINE = InnoDB) */ +t1#P#p0.ibd +EXPLAIN SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 20 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select (count(0) <> 1) AS `COUNT(*) <> 1` from `test`.`t1` where (`test`.`t1`.`f_int1` = 3) +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +# 2.2.5 COALESCE of last partition --> must fail +ALTER TABLE t1 COALESCE PARTITION 1; +ERROR HY000: Cannot remove all partitions, use DROP TABLE instead +# 2.2.6 Remove partitioning +ALTER TABLE t1 REMOVE PARTITIONING; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_int1` int DEFAULT NULL, + `f_int2` int DEFAULT NULL, + `f_char1` char(20) DEFAULT NULL, + `f_char2` char(20) DEFAULT NULL, + `f_charbig` varchar(1000) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +t1.ibd +EXPLAIN SELECT COUNT(*) <> 1 FROM t1 WHERE f_int1 = 3; +id select_type table partitions type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL ALL NULL NULL NULL NULL 20 10.00 Parallel execute (1 workers) +2 SIMPLE t1 NULL ALL NULL NULL NULL NULL 20 10.00 Using where +Warnings: +Note 1003 /* select#1 */ select (count(`count(0)`) <> 1) AS `COUNT(*) <> 1` from `test`.`t1` where (`test`.`t1`.`f_int1` = 3) +# check read single success: 1 +# check read all success: 1 +# check read row by row success: 1 +# 2.2.7 Remove partitioning from not partitioned table --> ???? +ALTER TABLE t1 REMOVE PARTITIONING; +ERROR HY000: Partition management on a not partitioned table is not possible +DROP TABLE t1; +# Attention: There are unused files. +# Either the DROP TABLE or a preceding ALTER TABLE +# worked incomplete. +# We found: +unified filelist +--- not determined --- +DROP VIEW IF EXISTS v1; +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t0_aux; +DROP TABLE IF EXISTS t0_definition; +DROP TABLE IF EXISTS t0_template;