From 4652260d656ea871fe1ff31176b6d85eeffde932 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Wed, 25 Jan 2023 11:46:28 -0800 Subject: [PATCH 001/260] MDEV-28616 Crash when using derived table over union with order by clause This bug manifested itself when the server processed a query containing a derived table over union whose ORDER BY clause included a subquery with unresolvable column reference. For such a query the server crashed when trying to resolve column references in the ORDER BY clause used by union. For any union with ORDER BY clause an extra SELECT_LEX structure is created and it is attached to SELECT_LEX_UNIT structure of the union via the field fake_select_lex. The outer context for fake_select_lex must be the same as for other selects of the union. If the union is used in the FROM list of a derived table then the outer context for fake_select_lex must be set to NULL in line with other selects of the union. It was not done and it caused a crash when searching for possible resolution of an unresolvable column reference occurred in a subquery used in the ORDER BY clause. Approved by Oleksandr Byelkin --- mysql-test/main/derived.result | 23 +++++++++++++++++++++++ mysql-test/main/derived.test | 30 ++++++++++++++++++++++++++++++ sql/sql_derived.cc | 3 +++ 3 files changed, 56 insertions(+) diff --git a/mysql-test/main/derived.result b/mysql-test/main/derived.result index 2761fdfa287..0cb029fa7a4 100644 --- a/mysql-test/main/derived.result +++ b/mysql-test/main/derived.result @@ -1327,5 +1327,28 @@ a b DROP VIEW v1; DROP TABLE t1; # +# MDEV-28616: derived table over union with order by clause that +# contains subquery with unresolvable column reference +# +SELECT 1 FROM ( +SELECT 1 UNION SELECT 2 ORDER BY (SELECT 1 FROM DUAL WHERE xxx = 0) +) dt; +ERROR 42S22: Unknown column 'xxx' in 'where clause' +create table t1 (a int, b int); +insert into t1 values (3,8), (7,2), (1,4), (5,9); +create table t2 (a int, b int); +insert into t2 values (9,1), (7,3), (2,6); +create table t3 (c int, d int); +insert into t3 values (7,8), (1,2), (3,8); +select * from +( +select a,b from t1 where t1.a > 3 +union +select a,b from t2 where t2.b < 6 +order by (a - b / (select a + max(c) from t3 where d = x)) +) dt; +ERROR 42S22: Unknown column 'x' in 'where clause' +drop table t1,t2,t3; +# # End of 10.3 tests # diff --git a/mysql-test/main/derived.test b/mysql-test/main/derived.test index 6a831000e57..dca7243febb 100644 --- a/mysql-test/main/derived.test +++ b/mysql-test/main/derived.test @@ -1137,6 +1137,36 @@ SELECT * FROM v1 WHERE b > 0; DROP VIEW v1; DROP TABLE t1; +--echo # +--echo # MDEV-28616: derived table over union with order by clause that +--echo # contains subquery with unresolvable column reference +--echo # + +--error ER_BAD_FIELD_ERROR +SELECT 1 FROM ( + SELECT 1 UNION SELECT 2 ORDER BY (SELECT 1 FROM DUAL WHERE xxx = 0) +) dt; + +create table t1 (a int, b int); +insert into t1 values (3,8), (7,2), (1,4), (5,9); + +create table t2 (a int, b int); +insert into t2 values (9,1), (7,3), (2,6); + +create table t3 (c int, d int); +insert into t3 values (7,8), (1,2), (3,8); + +--error ER_BAD_FIELD_ERROR +select * from +( + select a,b from t1 where t1.a > 3 + union + select a,b from t2 where t2.b < 6 + order by (a - b / (select a + max(c) from t3 where d = x)) +) dt; + +drop table t1,t2,t3; + --echo # --echo # End of 10.3 tests --echo # diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 93dc62828ac..8177ee27943 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -771,6 +771,9 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived) cursor->outer_join|= JOIN_TYPE_OUTER; } } + // Prevent it for possible ORDER BY clause + if (unit->fake_select_lex) + unit->fake_select_lex->context.outer_context= 0; /* Above cascade call of prepare is important for PS protocol, but after it From b1043ea0ed01a7caa398d4a066b415d6eeebb08e Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 26 Jan 2023 10:57:01 +0400 Subject: [PATCH 002/260] Revert "MDEV-30151 parse error 1=2 not between/in" This reverts commit eba099184e1f6704894694ea41f97f216eae5f21. A different patch with less shift-reduce conflicts is coming. --- mysql-test/main/parser.result | 11 ----------- mysql-test/main/parser.test | 8 -------- sql/sql_yacc.yy | 6 +++--- sql/sql_yacc_ora.yy | 6 +++--- 4 files changed, 6 insertions(+), 25 deletions(-) diff --git a/mysql-test/main/parser.result b/mysql-test/main/parser.result index f44478727ae..0bb4e82c8b8 100644 --- a/mysql-test/main/parser.result +++ b/mysql-test/main/parser.result @@ -1866,15 +1866,4 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp EXECUTE IMMEDIATE 'CREATE PROCEDURE p() UPDATE t SET c=\'\'"abc'; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '"abc' at line 1 SET @@sql_mode=@save_sql_mode; -# -# MDEV-30151 parse error 1=2 not between/in -# -select 1=2 not in (3,4); -1=2 not in (3,4) -1 -select 1=2 not between 3 and 4; -1=2 not between 3 and 4 -1 -# # End of 10.3 tests -# diff --git a/mysql-test/main/parser.test b/mysql-test/main/parser.test index cfe4f9d6f53..9df18c50ee3 100644 --- a/mysql-test/main/parser.test +++ b/mysql-test/main/parser.test @@ -1673,12 +1673,4 @@ EXECUTE IMMEDIATE 'CREATE PROCEDURE p() UPDATE t SET c=\'\'"abc'; SET @@sql_mode=@save_sql_mode; ---echo # ---echo # MDEV-30151 parse error 1=2 not between/in ---echo # -select 1=2 not in (3,4); -select 1=2 not between 3 and 4; - ---echo # --echo # End of 10.3 tests ---echo # diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 3025d93de0f..7766049c104 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -899,7 +899,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); /* We should not introduce any further shift/reduce conflicts. */ -%expect 96 +%expect 85 /* Comments for TOKENS. @@ -1687,7 +1687,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %left PREC_BELOW_NOT -%nonassoc LOW_PRIORITY_NOT +%nonassoc NOT_SYM %left '=' EQUAL_SYM GE '>' LE '<' NE %nonassoc IS %right BETWEEN_SYM @@ -9840,7 +9840,7 @@ expr: MYSQL_YYABORT; } } - | NOT_SYM expr %prec LOW_PRIORITY_NOT + | NOT_SYM expr %prec NOT_SYM { $$= negate_expression(thd, $2); if (unlikely($$ == NULL)) diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy index df90ba6c634..a5ee1892e5e 100644 --- a/sql/sql_yacc_ora.yy +++ b/sql/sql_yacc_ora.yy @@ -293,7 +293,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); /* We should not introduce any further shift/reduce conflicts. */ -%expect 98 +%expect 87 /* Comments for TOKENS. @@ -1081,7 +1081,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %left PREC_BELOW_NOT -%nonassoc LOW_PRIORITY_NOT +%nonassoc NOT_SYM %left '=' EQUAL_SYM GE '>' LE '<' NE %nonassoc IS %right BETWEEN_SYM @@ -9797,7 +9797,7 @@ expr: MYSQL_YYABORT; } } - | NOT_SYM expr %prec LOW_PRIORITY_NOT + | NOT_SYM expr %prec NOT_SYM { $$= negate_expression(thd, $2); if (unlikely($$ == NULL)) From 895673dae52d36c20caf900e6179694de1c7699b Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 12 Dec 2022 17:45:48 +0400 Subject: [PATCH 003/260] MDEV-30151 parse error 1=2 not between/in This patch fixes the problem by adding a new rule booleat_test. This makes the grammar clearer and less conflicting. Additionally, fixing %prec in this grammar branch: - | boolean_test IS NULL_SYM %prec PREC_BELOW_NOT + | boolean_test IS NULL_SYM %prec IS to have consistently "%prec IS" in all grammar branches starting with "boolean_test IS ...". It's not clear why these three rules needed different %prec before the fix: - boolean_test IS TRUE - boolean_test IS UNKNOWN - boolean_test IS NULL --- mysql-test/main/parser.result | 31 ++++++++++++++++++++ mysql-test/main/parser.test | 21 ++++++++++++++ sql/sql_yacc.yy | 54 +++++++++++++++++++++++++---------- sql/sql_yacc_ora.yy | 54 +++++++++++++++++++++++++---------- 4 files changed, 130 insertions(+), 30 deletions(-) diff --git a/mysql-test/main/parser.result b/mysql-test/main/parser.result index 0bb4e82c8b8..a8ee4440b5e 100644 --- a/mysql-test/main/parser.result +++ b/mysql-test/main/parser.result @@ -1866,4 +1866,35 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp EXECUTE IMMEDIATE 'CREATE PROCEDURE p() UPDATE t SET c=\'\'"abc'; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '"abc' at line 1 SET @@sql_mode=@save_sql_mode; +# +# MDEV-30151 parse error 1=2 not between/in +# +SELECT 1=2 NOT IN (3,4); +1=2 NOT IN (3,4) +1 +SELECT 1=2 NOT BETWEEN 3 AND 4; +1=2 NOT BETWEEN 3 AND 4 +1 +CREATE TABLE t1 ( f INT AS ( 1 IN ( 2 NOT BETWEEN 3 AND 4 ) ) ); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f` int(11) GENERATED ALWAYS AS (1 = 2 not between 3 and 4) VIRTUAL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +DROP TABLE t1; +CREATE TABLE t1 ( f INT, CHECK ( 1 IN ( 2 NOT BETWEEN 3 AND 4 ) ) ); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f` int(11) DEFAULT NULL, + CONSTRAINT `CONSTRAINT_1` CHECK (1 = 2 not between 3 and 4) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +DROP TABLE t1; +CREATE VIEW v1 AS SELECT 1 IN ( 2 NOT BETWEEN 3 AND 4 ); +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 = 2 not between 3 and 4 AS `1 IN ( 2 NOT BETWEEN 3 AND 4 )` latin1 latin1_swedish_ci +DROP VIEW v1; +# # End of 10.3 tests +# diff --git a/mysql-test/main/parser.test b/mysql-test/main/parser.test index 9df18c50ee3..9e46f859d5c 100644 --- a/mysql-test/main/parser.test +++ b/mysql-test/main/parser.test @@ -1673,4 +1673,25 @@ EXECUTE IMMEDIATE 'CREATE PROCEDURE p() UPDATE t SET c=\'\'"abc'; SET @@sql_mode=@save_sql_mode; +--echo # +--echo # MDEV-30151 parse error 1=2 not between/in +--echo # + +SELECT 1=2 NOT IN (3,4); +SELECT 1=2 NOT BETWEEN 3 AND 4; + +CREATE TABLE t1 ( f INT AS ( 1 IN ( 2 NOT BETWEEN 3 AND 4 ) ) ); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +CREATE TABLE t1 ( f INT, CHECK ( 1 IN ( 2 NOT BETWEEN 3 AND 4 ) ) ); +SHOW CREATE TABLE t1; +DROP TABLE t1; + +CREATE VIEW v1 AS SELECT 1 IN ( 2 NOT BETWEEN 3 AND 4 ); +SHOW CREATE VIEW v1; +DROP VIEW v1; + +--echo # --echo # End of 10.3 tests +--echo # diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 7766049c104..e03bde31832 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -899,7 +899,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); /* We should not introduce any further shift/reduce conflicts. */ -%expect 85 +%expect 78 /* Comments for TOKENS. @@ -1687,7 +1687,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %left PREC_BELOW_NOT -%nonassoc NOT_SYM +/* The precendence of boolean NOT is in fact here. See the comment below. */ + %left '=' EQUAL_SYM GE '>' LE '<' NE %nonassoc IS %right BETWEEN_SYM @@ -1699,6 +1700,24 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %left '*' '/' '%' DIV_SYM MOD_SYM %left '^' %left MYSQL_CONCAT_SYM +/* + Boolean negation has a special branch in "expr" starting with NOT_SYM. + The precedence of logical negation is determined by the grammar itself + (without using Bison terminal symbol precedence) in this order + - Boolean factor (i.e. logical AND) + - Boolean NOT + - Boolean test (such as '=', IS NULL, IS TRUE) + + But we also need a precedence for NOT_SYM in other contexts, + to shift (without reduce) in these cases: + predicate NOT IN ... + predicate NOT BETWEEN ... + predicate NOT LIKE ... + predicate NOT REGEXP ... + If the precedence of NOT_SYM was low, it would reduce immediately + after scanning "predicate" and then produce a syntax error on "NOT". +*/ +%nonassoc NOT_SYM %nonassoc NEG '~' NOT2_SYM BINARY %nonassoc COLLATE_SYM @@ -1938,6 +1957,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); literal insert_ident order_ident temporal_literal simple_ident expr sum_expr in_sum_expr variable variable_aux + boolean_test predicate bit_expr parenthesized_expr table_wild simple_expr column_default_non_parenthesized_expr udf_expr primary_expr string_factor_expr mysql_concatenation_expr @@ -9840,79 +9860,83 @@ expr: MYSQL_YYABORT; } } - | NOT_SYM expr %prec NOT_SYM + | NOT_SYM expr { $$= negate_expression(thd, $2); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr IS TRUE_SYM %prec IS + | boolean_test %prec PREC_BELOW_NOT + ; + +boolean_test: + boolean_test IS TRUE_SYM %prec IS { $$= new (thd->mem_root) Item_func_istrue(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr IS not TRUE_SYM %prec IS + | boolean_test IS not TRUE_SYM %prec IS { $$= new (thd->mem_root) Item_func_isnottrue(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr IS FALSE_SYM %prec IS + | boolean_test IS FALSE_SYM %prec IS { $$= new (thd->mem_root) Item_func_isfalse(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr IS not FALSE_SYM %prec IS + | boolean_test IS not FALSE_SYM %prec IS { $$= new (thd->mem_root) Item_func_isnotfalse(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr IS UNKNOWN_SYM %prec IS + | boolean_test IS UNKNOWN_SYM %prec IS { $$= new (thd->mem_root) Item_func_isnull(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr IS not UNKNOWN_SYM %prec IS + | boolean_test IS not UNKNOWN_SYM %prec IS { $$= new (thd->mem_root) Item_func_isnotnull(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr IS NULL_SYM %prec PREC_BELOW_NOT + | boolean_test IS NULL_SYM %prec IS { $$= new (thd->mem_root) Item_func_isnull(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr IS not NULL_SYM %prec IS + | boolean_test IS not NULL_SYM %prec IS { $$= new (thd->mem_root) Item_func_isnotnull(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr EQUAL_SYM predicate %prec EQUAL_SYM + | boolean_test EQUAL_SYM predicate %prec EQUAL_SYM { $$= new (thd->mem_root) Item_func_equal(thd, $1, $3); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr comp_op predicate %prec '=' + | boolean_test comp_op predicate %prec '=' { $$= (*$2)(0)->create(thd, $1, $3); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr comp_op all_or_any '(' subselect ')' %prec '=' + | boolean_test comp_op all_or_any '(' subselect ')' %prec '=' { $$= all_any_subquery_creator(thd, $1, $2, $3, $5); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | predicate + | predicate %prec BETWEEN_SYM ; predicate: diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy index a5ee1892e5e..89f7412ea89 100644 --- a/sql/sql_yacc_ora.yy +++ b/sql/sql_yacc_ora.yy @@ -293,7 +293,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); /* We should not introduce any further shift/reduce conflicts. */ -%expect 87 +%expect 80 /* Comments for TOKENS. @@ -1081,7 +1081,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %left PREC_BELOW_NOT -%nonassoc NOT_SYM +/* The precendence of boolean NOT is in fact here. See the comment below. */ + %left '=' EQUAL_SYM GE '>' LE '<' NE %nonassoc IS %right BETWEEN_SYM @@ -1093,6 +1094,24 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %left '*' '/' '%' DIV_SYM MOD_SYM %left '^' %left MYSQL_CONCAT_SYM +/* + Boolean negation has a special branch in "expr" starting with NOT_SYM. + The precedence of logical negation is determined by the grammar itself + (without using Bison terminal symbol precedence) in this order + - Boolean factor (i.e. logical AND) + - Boolean NOT + - Boolean test (such as '=', IS NULL, IS TRUE) + + But we also need a precedence for NOT_SYM in other contexts, + to shift (without reduce) in these cases: + predicate NOT IN ... + predicate NOT BETWEEN ... + predicate NOT LIKE ... + predicate NOT REGEXP ... + If the precedence of NOT_SYM was low, it would reduce immediately + after scanning "predicate" and then produce a syntax error on "NOT". +*/ +%nonassoc NOT_SYM %nonassoc NEG '~' NOT2_SYM BINARY %nonassoc COLLATE_SYM @@ -1339,6 +1358,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); literal insert_ident order_ident temporal_literal simple_ident expr sum_expr in_sum_expr variable variable_aux + boolean_test predicate bit_expr parenthesized_expr table_wild simple_expr column_default_non_parenthesized_expr udf_expr primary_expr string_factor_expr mysql_concatenation_expr @@ -9797,79 +9817,83 @@ expr: MYSQL_YYABORT; } } - | NOT_SYM expr %prec NOT_SYM + | NOT_SYM expr { $$= negate_expression(thd, $2); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr IS TRUE_SYM %prec IS + | boolean_test %prec PREC_BELOW_NOT + ; + +boolean_test: + boolean_test IS TRUE_SYM %prec IS { $$= new (thd->mem_root) Item_func_istrue(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr IS not TRUE_SYM %prec IS + | boolean_test IS not TRUE_SYM %prec IS { $$= new (thd->mem_root) Item_func_isnottrue(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr IS FALSE_SYM %prec IS + | boolean_test IS FALSE_SYM %prec IS { $$= new (thd->mem_root) Item_func_isfalse(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr IS not FALSE_SYM %prec IS + | boolean_test IS not FALSE_SYM %prec IS { $$= new (thd->mem_root) Item_func_isnotfalse(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr IS UNKNOWN_SYM %prec IS + | boolean_test IS UNKNOWN_SYM %prec IS { $$= new (thd->mem_root) Item_func_isnull(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr IS not UNKNOWN_SYM %prec IS + | boolean_test IS not UNKNOWN_SYM %prec IS { $$= new (thd->mem_root) Item_func_isnotnull(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr IS NULL_SYM %prec PREC_BELOW_NOT + | boolean_test IS NULL_SYM %prec IS { $$= new (thd->mem_root) Item_func_isnull(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr IS not NULL_SYM %prec IS + | boolean_test IS not NULL_SYM %prec IS { $$= new (thd->mem_root) Item_func_isnotnull(thd, $1); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr EQUAL_SYM predicate %prec EQUAL_SYM + | boolean_test EQUAL_SYM predicate %prec EQUAL_SYM { $$= new (thd->mem_root) Item_func_equal(thd, $1, $3); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr comp_op predicate %prec '=' + | boolean_test comp_op predicate %prec '=' { $$= (*$2)(0)->create(thd, $1, $3); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | expr comp_op all_or_any '(' subselect ')' %prec '=' + | boolean_test comp_op all_or_any '(' subselect ')' %prec '=' { $$= all_any_subquery_creator(thd, $1, $2, $3, $5); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | predicate + | predicate %prec BETWEEN_SYM ; predicate: From f812f8e1ab7acc5dd17daf5ab5f73495c7963af5 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 26 Jan 2023 12:22:38 +0100 Subject: [PATCH 004/260] MDEV-30475 Windows, mtr - Remove outdated instructions on how to install post-mortem debugger Also, use standard C:\symbols location for OS debugging symbols cache, rather than own invention C:\cdb_symbols. --- mysql-test/lib/My/CoreDump.pm | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/mysql-test/lib/My/CoreDump.pm b/mysql-test/lib/My/CoreDump.pm index 05b6edf1385..be6d21146d1 100644 --- a/mysql-test/lib/My/CoreDump.pm +++ b/mysql-test/lib/My/CoreDump.pm @@ -310,16 +310,8 @@ sub cdb_check { `cdb -? 2>&1`; if ($? >> 8) { - print "Cannot find cdb. Please Install Debugging tools for Windows\n"; - print "from http://www.microsoft.com/whdc/devtools/debugging/"; - if($ENV{'ProgramW6432'}) - { - print "install64bit.mspx (native x64 version)\n"; - } - else - { - print "installx86.mspx\n"; - } + print "Cannot find the cdb debugger. Please install Debugging tools for Windows\n"; + print "and set PATH environment variable to include location of cdb.exe"; } } @@ -328,25 +320,6 @@ sub _cdb { my ($core_name, $format)= @_; print "\nTrying 'cdb' to get a backtrace\n"; return unless -f $core_name; - - # Try to set environment for debugging tools for Windows - if ($ENV{'PATH'} !~ /Debugging Tools/) - { - if ($ENV{'ProgramW6432'}) - { - # On x64 computer - $ENV{'PATH'}.= ";".$ENV{'ProgramW6432'}."\\Debugging Tools For Windows (x64)"; - } - else - { - # On x86 computer. Newest versions of Debugging tools are installed in the - # directory with (x86) suffix, older versions did not have this suffix. - $ENV{'PATH'}.= ";".$ENV{'ProgramFiles'}."\\Debugging Tools For Windows (x86)"; - $ENV{'PATH'}.= ";".$ENV{'ProgramFiles'}."\\Debugging Tools For Windows"; - } - } - - # Read module list, find out the name of executable and # build symbol path (required by cdb if executable was built on # different machine) @@ -384,7 +357,7 @@ sub _cdb { if (!$ENV{'_NT_SYMBOL_PATH'}) { my $windir= $ENV{'windir'}; - my $symbol_cache= substr($windir ,0, index($windir,'\\'))."\\cdb_symbols"; + my $symbol_cache= substr($windir ,0, index($windir,'\\'))."\\symbols"; print "OS debug symbols will be downloaded and stored in $symbol_cache.\n"; print "You can control the location of symbol cache with _NT_SYMBOL_PATH\n"; From 2a78c3ef6fd6663d6731dd5cec2f462420b61123 Mon Sep 17 00:00:00 2001 From: Salman Mohammadi Date: Sun, 8 Jan 2023 20:14:58 +0100 Subject: [PATCH 005/260] MDEV-30509: mariadb-plugin-connect: introduce curl as recommends in order to be able to retrieve files using REST queries. Otherwise, `ERROR 1105 (HY000): Curl not installed.` will be thrown. --- debian/control | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/control b/debian/control index aed073e5c8c..09e0fd74d57 100644 --- a/debian/control +++ b/debian/control @@ -525,6 +525,7 @@ Depends: libxml2, unixodbc, ${misc:Depends}, ${shlibs:Depends} +Recommends: curl Breaks: mariadb-connect-engine-10.1, mariadb-connect-engine-10.2, mariadb-connect-engine-10.3 From 9b32e4b192303421ca26625153ae1190429e307f Mon Sep 17 00:00:00 2001 From: Nayuta Yanagisawa Date: Tue, 27 Sep 2022 15:22:57 +0900 Subject: [PATCH 006/260] MDEV-29644 a potential bug of null pointer dereference in spider_db_mbase::print_warnings() The function spider_db_mbase::print_warnings() can potentially result in a null pointer dereference. Remove the null pointer dereference by cleaning up the function. Some small changes to the original commit 422fb63a9bbee35c50b6c7be19d199afe0bc98fa. Co-Authored-By: Yuchen Pei --- .../spider/bugfix/r/mdev_29644.result | 41 +++++++++ .../mysql-test/spider/bugfix/t/mdev_29644.cnf | 3 + .../spider/bugfix/t/mdev_29644.test | 56 ++++++++++++ storage/spider/spd_db_mysql.cc | 90 ++++++++----------- storage/spider/spd_db_mysql.h | 4 +- 5 files changed, 137 insertions(+), 57 deletions(-) create mode 100644 storage/spider/mysql-test/spider/bugfix/r/mdev_29644.result create mode 100644 storage/spider/mysql-test/spider/bugfix/t/mdev_29644.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/t/mdev_29644.test diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29644.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29644.result new file mode 100644 index 00000000000..b52cecc5bb7 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29644.result @@ -0,0 +1,41 @@ +# +# MDEV-29644 a potential bug of null pointer dereference in spider_db_mbase::print_warnings() +# +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection child2_1; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +CREATE TABLE tbl_a ( +a CHAR(5) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +SET GLOBAL sql_mode=''; +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +CREATE TABLE tbl_a ( +a CHAR(255) +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; +SET sql_mode=''; +INSERT INTO tbl_a VALUES ("this will be truncated"); +NOT FOUND /\[WARN SPIDER RESULT\].* Warning 1265 Data truncated for column 'a' at row 1.*/ in mysqld.1.1.err +SET GLOBAL spider_log_result_errors=4; +INSERT INTO tbl_a VALUES ("this will be truncated"); +FOUND 1 /\[WARN SPIDER RESULT\].* Warning 1265 Data truncated for column 'a' at row 1.*/ in mysqld.1.1.err +connection master_1; +SET GLOBAL spider_log_result_errors=DEFAULT; +SET sql_mode=DEFAULT; +DROP DATABASE IF EXISTS auto_test_local; +connection child2_1; +SET GLOBAL sql_mode=DEFAULT; +DROP DATABASE IF EXISTS auto_test_remote; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.cnf new file mode 100644 index 00000000000..05dfd8a0bce --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.cnf @@ -0,0 +1,3 @@ +!include include/default_mysqld.cnf +!include ../my_1_1.cnf +!include ../my_2_1.cnf diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.test new file mode 100644 index 00000000000..3a8fbb251e1 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29644.test @@ -0,0 +1,56 @@ +--echo # +--echo # MDEV-29644 a potential bug of null pointer dereference in spider_db_mbase::print_warnings() +--echo # + +# The test case below does not cause the potential null pointer dereference. +# It is just for checking spider_db_mbase::fetch_and_print_warnings() works. + +--disable_query_log +--disable_result_log +--source ../../t/test_init.inc +--enable_result_log +--enable_query_log + +--connection child2_1 +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +eval CREATE TABLE tbl_a ( + a CHAR(5) +) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; + +SET GLOBAL sql_mode=''; + +--connection master_1 +CREATE DATABASE auto_test_local; +USE auto_test_local; +eval CREATE TABLE tbl_a ( + a CHAR(255) +) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_a", srv "s_2_1"'; + +SET sql_mode=''; + +let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.1.err; +let SEARCH_PATTERN= \[WARN SPIDER RESULT\].* Warning 1265 Data truncated for column 'a' at row 1.*; + +INSERT INTO tbl_a VALUES ("this will be truncated"); +--source include/search_pattern_in_file.inc # should not find + +SET GLOBAL spider_log_result_errors=4; + +INSERT INTO tbl_a VALUES ("this will be truncated"); +--source include/search_pattern_in_file.inc # should find + +--connection master_1 +SET GLOBAL spider_log_result_errors=DEFAULT; +SET sql_mode=DEFAULT; +DROP DATABASE IF EXISTS auto_test_local; + +--connection child2_1 +SET GLOBAL sql_mode=DEFAULT; +DROP DATABASE IF EXISTS auto_test_remote; + +--disable_query_log +--disable_result_log +--source ../t/test_deinit.inc +--enable_query_log +--enable_result_log diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc index e942d1d9063..b1c222d193a 100644 --- a/storage/spider/spd_db_mysql.cc +++ b/storage/spider/spd_db_mysql.cc @@ -2090,7 +2090,7 @@ int spider_db_mbase::exec_query( db_conn->affected_rows, db_conn->insert_id, db_conn->server_status, db_conn->warning_count); if (spider_param_log_result_errors() >= 3) - print_warnings(l_time); + fetch_and_print_warnings(l_time); } else if (log_result_errors >= 4) { time_t cur_time = (time_t) time((time_t*) 0); @@ -2172,61 +2172,43 @@ bool spider_db_mbase::is_xa_nota_error( DBUG_RETURN(xa_nota); } -void spider_db_mbase::print_warnings( - struct tm *l_time -) { - DBUG_ENTER("spider_db_mbase::print_warnings"); - DBUG_PRINT("info",("spider this=%p", this)); - if (db_conn->status == MYSQL_STATUS_READY) +void spider_db_mbase::fetch_and_print_warnings(struct tm *l_time) +{ + DBUG_ENTER("spider_db_mbase::fetch_and_print_warnings"); + + if (spider_param_dry_access() || db_conn->status != MYSQL_STATUS_READY || + db_conn->server_status & SERVER_MORE_RESULTS_EXISTS) + DBUG_VOID_RETURN; + + if (mysql_real_query(db_conn, SPIDER_SQL_SHOW_WARNINGS_STR, + SPIDER_SQL_SHOW_WARNINGS_LEN)) + DBUG_VOID_RETURN; + + MYSQL_RES *res= mysql_store_result(db_conn); + if (!res) + DBUG_VOID_RETURN; + + uint num_fields= mysql_num_fields(res); + if (num_fields != 3) { -#if MYSQL_VERSION_ID < 50500 - if (!(db_conn->last_used_con->server_status & SERVER_MORE_RESULTS_EXISTS)) -#else - if (!(db_conn->server_status & SERVER_MORE_RESULTS_EXISTS)) -#endif - { - if ( - spider_param_dry_access() || - !mysql_real_query(db_conn, SPIDER_SQL_SHOW_WARNINGS_STR, - SPIDER_SQL_SHOW_WARNINGS_LEN) - ) { - MYSQL_RES *res = NULL; - MYSQL_ROW row = NULL; - uint num_fields; - if ( - spider_param_dry_access() || - !(res = mysql_store_result(db_conn)) || - !(row = mysql_fetch_row(res)) - ) { - if (mysql_errno(db_conn)) - { - if (res) - mysql_free_result(res); - DBUG_VOID_RETURN; - } - /* no record is ok */ - } - num_fields = mysql_num_fields(res); - if (num_fields != 3) - { - mysql_free_result(res); - DBUG_VOID_RETURN; - } - while (row) - { - fprintf(stderr, "%04d%02d%02d %02d:%02d:%02d [WARN SPIDER RESULT] " - "from [%s] %ld to %ld: %s %s %s\n", - l_time->tm_year + 1900, l_time->tm_mon + 1, l_time->tm_mday, - l_time->tm_hour, l_time->tm_min, l_time->tm_sec, - conn->tgt_host, (ulong) db_conn->thread_id, - (ulong) current_thd->thread_id, row[0], row[1], row[2]); - row = mysql_fetch_row(res); - } - if (res) - mysql_free_result(res); - } - } + mysql_free_result(res); + DBUG_VOID_RETURN; } + + MYSQL_ROW row= mysql_fetch_row(res); + while (row) + { + fprintf(stderr, + "%04d%02d%02d %02d:%02d:%02d [WARN SPIDER RESULT] from [%s] %ld " + "to %ld: %s %s %s\n", + l_time->tm_year + 1900, l_time->tm_mon + 1, l_time->tm_mday, + l_time->tm_hour, l_time->tm_min, l_time->tm_sec, conn->tgt_host, + (ulong) db_conn->thread_id, (ulong) current_thd->thread_id, row[0], + row[1], row[2]); + row= mysql_fetch_row(res); + } + mysql_free_result(res); + DBUG_VOID_RETURN; } diff --git a/storage/spider/spd_db_mysql.h b/storage/spider/spd_db_mysql.h index 4d5327b7533..576162b2b55 100644 --- a/storage/spider/spd_db_mysql.h +++ b/storage/spider/spd_db_mysql.h @@ -392,9 +392,7 @@ public: bool is_xa_nota_error( int error_num ); - void print_warnings( - struct tm *l_time - ); + void fetch_and_print_warnings(struct tm *l_time); spider_db_result *store_result( spider_db_result_buffer **spider_res_buf, st_spider_db_request_key *request_key, From a80eb9832e7b86bf2697788926505cf3fab57101 Mon Sep 17 00:00:00 2001 From: Weijun Huang Date: Sun, 12 Feb 2023 16:40:40 +0100 Subject: [PATCH 007/260] MDEV-24538: JSON_LENGTH does not return error upon wrong number of parameters --- mysql-test/main/func_json.result | 7 +++++++ mysql-test/main/func_json.test | 9 +++++++++ sql/item_jsonfunc.h | 5 +++++ 3 files changed, 21 insertions(+) diff --git a/mysql-test/main/func_json.result b/mysql-test/main/func_json.result index 1e59256b517..415e367f455 100644 --- a/mysql-test/main/func_json.result +++ b/mysql-test/main/func_json.result @@ -1289,5 +1289,12 @@ JSON_LOOSE(JSON_EXTRACT(a, '$**.analyzing_range_alternatives')) [{"range_scan_alternatives": [{"index": "a_b", "ranges": ["2 <= a <= 2 AND 4 <= b <= 4", "123"], "rowid_ordered": true, "using_mrr": false, "index_only": true, "rows": 1, "cost": 1.1752, "chosen": true}], "analyzing_roworder_intersect": {"cause": "too few roworder scans"}, "analyzing_index_merge_union": [], "test_one_line_array": ["123"]}] drop table t200; # +# MDEV-24538: JSON_LENGTH does not return error upon wrong number of parameters +# +SELECT JSON_LENGTH('{"a":"b"}','$','$', 'foo'); +ERROR 42000: Incorrect parameter count in the call to native function 'json_length' +SELECT JSON_LENGTH(); +ERROR 42000: Incorrect parameter count in the call to native function 'JSON_LENGTH' +# # End of 10.4 tests # diff --git a/mysql-test/main/func_json.test b/mysql-test/main/func_json.test index b3e19f76972..56d90e93936 100644 --- a/mysql-test/main/func_json.test +++ b/mysql-test/main/func_json.test @@ -665,6 +665,7 @@ SELECT 1 + JSON_VALUE('{"nulltest": null}', '$.nulltest'); SELECT NULL; SELECT JSON_EXTRACT('{"a":null, "b":10, "c":"null"}', '$.a'); + --echo # --echo # End of 10.3 tests --echo # @@ -816,6 +817,14 @@ select JSON_PRETTY(JSON_EXTRACT(a, '$**.analyzing_range_alternatives')) from t20 select JSON_LOOSE(JSON_EXTRACT(a, '$**.analyzing_range_alternatives')) from t200; drop table t200; +--echo # +--echo # MDEV-24538: JSON_LENGTH does not return error upon wrong number of parameters +--echo # +--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +SELECT JSON_LENGTH('{"a":"b"}','$','$', 'foo'); +--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +SELECT JSON_LENGTH(); + --echo # --echo # End of 10.4 tests --echo # diff --git a/sql/item_jsonfunc.h b/sql/item_jsonfunc.h index 798c5d502db..b44207ec73f 100644 --- a/sql/item_jsonfunc.h +++ b/sql/item_jsonfunc.h @@ -310,6 +310,11 @@ class Item_func_json_length: public Item_long_func { bool check_arguments() const { + if (arg_count == 0 || arg_count > 2) + { + my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), func_name()); + return true; + } return args[0]->check_type_can_return_text(func_name()) || (arg_count > 1 && args[1]->check_type_general_purpose_string(func_name())); From 7170db3c3a1a1c59cd7beb591dcab25c69e02847 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Mon, 13 Feb 2023 16:54:13 +0300 Subject: [PATCH 008/260] MDEV-30596: Assertion 'pushed_rowid_filter != __null ...' failed ha_partition doesn't forward Rowid Filter API calls to the storage engines handling partitions. An attempt to use rowid filtering with caused either - Rowid Filter being shown in EXPLAIN but not actually used - Assertion failure when subquery code tried to disable/enable rowid filter, which was not present. Fixed by returning correct flags from ha_partition::index_flags() --- mysql-test/main/partition.result | 38 +++++++++++++++++++++++++++++++ mysql-test/main/partition.test | 39 +++++++++++++++++++++++++++++++- sql/ha_partition.h | 13 ++++++++++- 3 files changed, 88 insertions(+), 2 deletions(-) diff --git a/mysql-test/main/partition.result b/mysql-test/main/partition.result index a1f7864e660..79bfef652f4 100644 --- a/mysql-test/main/partition.result +++ b/mysql-test/main/partition.result @@ -2816,3 +2816,41 @@ DROP TABLE t1,t2; # # End of 10.1 tests # +# +# MDEV-30596: Assertion 'pushed_rowid_filter != __null ...' failed +# +create table t1 (a int); +insert into t1 values (NULL),(1),(2); +create table t2 (a int); +insert into t2 select seq from seq_1_to_1000; +create table t3 ( +a1 int, +a2 int, +b int, +c int, +filler1 char(200), +filler2 char(200), +key(a1,a2), +key(b) +) partition by hash(a1) partitions 2; +insert into t3 select seq/100, seq/100, seq, seq, seq, seq from seq_1_to_10000; +analyze table t3 persistent for all; +Table Op Msg_type Msg_text +test.t3 analyze status Engine-independent statistics collected +test.t3 analyze status OK +set @tmp_os= @@optimizer_switch; +set optimizer_switch='materialization=off'; +# Must not show "Using rowid filter": +explain +select * +from t1 +where +t1.a not in (select straight_join t3.a1 +from t2, t3 +where t3.b < 3000 and t3.a2=t2.a); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1000 Using where +2 DEPENDENT SUBQUERY t3 ref_or_null a1,b a1 10 func,test.t2.a 198 Using where; Full scan on NULL key +set optimizer_switch=@tmp_os; +drop table t1,t2,t3; diff --git a/mysql-test/main/partition.test b/mysql-test/main/partition.test index cc19bb83494..40736d3a08f 100644 --- a/mysql-test/main/partition.test +++ b/mysql-test/main/partition.test @@ -3016,7 +3016,44 @@ INSERT INTO t2 VALUES (1),(2); UPDATE t1 SET a = 7 WHERE a = ( SELECT b FROM t2 ) ORDER BY a LIMIT 6; DROP TABLE t1,t2; - --echo # --echo # End of 10.1 tests --echo # + +--echo # +--echo # MDEV-30596: Assertion 'pushed_rowid_filter != __null ...' failed +--echo # +--source include/have_sequence.inc +create table t1 (a int); +insert into t1 values (NULL),(1),(2); +create table t2 (a int); +insert into t2 select seq from seq_1_to_1000; + +create table t3 ( + a1 int, + a2 int, + b int, + c int, + filler1 char(200), + filler2 char(200), + key(a1,a2), + key(b) +) partition by hash(a1) partitions 2; +insert into t3 select seq/100, seq/100, seq, seq, seq, seq from seq_1_to_10000; +analyze table t3 persistent for all; + +set @tmp_os= @@optimizer_switch; +set optimizer_switch='materialization=off'; + +--echo # Must not show "Using rowid filter": +explain +select * +from t1 +where + t1.a not in (select straight_join t3.a1 + from t2, t3 + where t3.b < 3000 and t3.a2=t2.a); +set optimizer_switch=@tmp_os; + +drop table t1,t2,t3; + diff --git a/sql/ha_partition.h b/sql/ha_partition.h index 9255df9d519..59dacd2cd7f 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -1294,7 +1294,18 @@ public: The following code is not safe if you are using different storage engines or different index types per partition. */ - return m_file[0]->index_flags(inx, part, all_parts); + ulong part_flags= m_file[0]->index_flags(inx, part, all_parts); + + /* + The underlying storage engine might support Rowid Filtering. But + ha_partition does not forward the needed SE API calls, so the feature + will not be used. + + Note: It's the same with IndexConditionPushdown, except for its variant + of IndexConditionPushdown+BatchedKeyAccess (that one works). Because of + that, we do not clear HA_DO_INDEX_COND_PUSHDOWN here. + */ + return part_flags & ~HA_DO_RANGE_FILTER_PUSHDOWN; } /** From 81faf41786cfcded18d5b20d341175367ef1453f Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Tue, 14 Feb 2023 14:20:48 +0530 Subject: [PATCH 009/260] MDEV-30597 Assertion `flag == 1' failed in row_build_index_entry_low - InnoDB tries to build the previous version of the record for the virtual index, but the undo log record doesn't contain virtual column information. This leads to assert failure while building the tuple. --- mysql-test/suite/gcol/r/gcol_rollback.result | 21 +++++++++++++++++- mysql-test/suite/gcol/t/gcol_rollback.test | 23 +++++++++++++++++++- storage/innobase/row/row0vers.cc | 18 +++++++++++++++ 3 files changed, 60 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/gcol/r/gcol_rollback.result b/mysql-test/suite/gcol/r/gcol_rollback.result index 5ee94d3ef44..0bbf034122b 100644 --- a/mysql-test/suite/gcol/r/gcol_rollback.result +++ b/mysql-test/suite/gcol/r/gcol_rollback.result @@ -79,10 +79,29 @@ a b c d ROLLBACK; SET DEBUG_SYNC = 'now SIGNAL dml_done'; connection con1; -disconnect con1; connection default; SELECT * FROM t; a b d 9 10 29 DROP TABLE t; SET DEBUG_SYNC = 'RESET'; +# +# MDEV-30597 Assertion `flag == 1' failed in +# row_build_index_entry_low +# +CREATE TABLE t1 ( +col1 INT PRIMARY KEY, col_text TEXT, +col_text_g TEXT GENERATED ALWAYS AS (SUBSTR(col_text,1,499)) +) ENGINE = InnoDB ROW_FORMAT = Compact; +connection con1; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +connection default; +INSERT INTO t1 (col1) VALUES (1) ; +DELETE FROM t1 WHERE col1 = 1; +ALTER TABLE t1 ADD UNIQUE INDEX (col_text_g(9)); +BEGIN; +INSERT INTO t1 (col1) VALUES (1); +ROLLBACK; +disconnect con1; +DROP TABLE t1; +# End of 10.4 tests diff --git a/mysql-test/suite/gcol/t/gcol_rollback.test b/mysql-test/suite/gcol/t/gcol_rollback.test index ba88dda45d7..888e6be861e 100644 --- a/mysql-test/suite/gcol/t/gcol_rollback.test +++ b/mysql-test/suite/gcol/t/gcol_rollback.test @@ -103,7 +103,6 @@ SET DEBUG_SYNC = 'now SIGNAL dml_done'; connection con1; reap; -disconnect con1; connection default; SELECT * FROM t; @@ -111,5 +110,27 @@ SELECT * FROM t; DROP TABLE t; SET DEBUG_SYNC = 'RESET'; +--echo # +--echo # MDEV-30597 Assertion `flag == 1' failed in +--echo # row_build_index_entry_low +--echo # +CREATE TABLE t1 ( +col1 INT PRIMARY KEY, col_text TEXT, +col_text_g TEXT GENERATED ALWAYS AS (SUBSTR(col_text,1,499)) +) ENGINE = InnoDB ROW_FORMAT = Compact; +connection con1; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +connection default; +INSERT INTO t1 (col1) VALUES (1) ; +DELETE FROM t1 WHERE col1 = 1; +ALTER TABLE t1 ADD UNIQUE INDEX (col_text_g(9)); +BEGIN; +INSERT INTO t1 (col1) VALUES (1); +ROLLBACK; +disconnect con1; +DROP TABLE t1; + # Wait till all disconnects are completed --source include/wait_until_count_sessions.inc + +--echo # End of 10.4 tests diff --git a/storage/innobase/row/row0vers.cc b/storage/innobase/row/row0vers.cc index d1ff7bc540e..0679f883897 100644 --- a/storage/innobase/row/row0vers.cc +++ b/storage/innobase/row/row0vers.cc @@ -860,6 +860,20 @@ row_vers_build_cur_vrow( return(cur_vrow); } +/** Find out whether data tuple has missing data type +for virtualcolumn. +@param tuple data tuple +@return true if tuple has missing column type */ +static bool dtuple_vcol_data_missing(const dtuple_t &tuple) +{ + for (ulint i= 0; i < tuple.n_v_fields; i++) + { + if (tuple.v_fields[i].type.mtype == DATA_MISSING) + return true; + } + return false; +} + /** Finds out if a version of the record, where the version >= the current purge view, should have ientry as its secondary index entry. We check if there is any not delete marked version of the record where the trx @@ -1088,6 +1102,9 @@ unsafe_to_purge: if (dict_index_has_virtual(index)) { if (vrow) { + if (dtuple_vcol_data_missing(*vrow)) { + goto nochange_index; + } /* Keep the virtual row info for the next version, unless it is changed */ mem_heap_empty(v_heap); @@ -1098,6 +1115,7 @@ unsafe_to_purge: if (!cur_vrow) { /* Nothing for this index has changed, continue */ +nochange_index: version = prev_version; continue; } From 60f96b58e4b4d24708b63401ac12f1f058684ea7 Mon Sep 17 00:00:00 2001 From: Robin Newhouse Date: Thu, 8 Dec 2022 20:46:26 +0000 Subject: [PATCH 010/260] Backport GitLab CI to earlier branches Add .gitlab-ci.yml file to earliest supported branch to enable automated building and testing for all MariaDB major branches. For 10.4 we use the bundled SSL to build MariaDB when the platform does not have OpenSSL 1.1 available. This requires the installation of gnutls-devel as a dependency of MariaDB Connector/C. OpenSSL 3.0 support was backported to MariaDB 10.5 (see https://github.com/MariaDB/server/pull/2036, f0fa40ef, 8a9c1e9c) All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc. --- .gitlab-ci.yml | 494 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 494 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000000..39dae0facb8 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,494 @@ +--- +# This Gitlab-CI pipeline offers basic validation that a commit did not +# introduce easily detectable regressions. Builds run primairly on a new Fedora, +# which has all the latest upstream build dependencies and thus is the primary +# testing target, as eventually everything in Fedora becomes the next CentOS and +# Red Hat releases. +# +# In addition test building on CentOS 7 and 8 to ensure that the code base +# remains reasonably backwards compatible. +# +# This is now intentionally simple, to keep it fast and accurate with minimal +# false positive failures. If one wants to extend it, see debian/salsa-ci.yml +# for inspiration on more integration tests to run. +# +# Also make sure the pipeline stays within the bounds of what CI workers on +# Gitlab-CI are capable of executing, thus ensuring that any potential +# contributor can at any point in time fork to their own Gitlab account and +# start working towards meaningful contributions! +# +# NOTE TO MERGERS: Most of the contents in the Gitlab-CI configuration has been +# tailored for a specific release or MariaDB. As a general rule, do not merge +# changes in this file across MariaDB branches to avoid breaking the CI. Updates +# the Gitlab-CI pipeline are most of the time better done manually per major +# release branch. + +stages: + - build + - test + - Salsa-CI + +default: + # Base image for builds and tests unless otherwise defined + image: fedora:latest + # Extend build jobs to have longer timeout as the default GitLab + # timeout (1h) is often not enough + timeout: 3h + +# Define common CMAKE_FLAGS for all builds. Skim down build by omitting all +# submodules (a commit in this repo does not affect their builds anyway) and +# many components that are otherwise slow to build. +variables: + CMAKE_FLAGS: "-DPLUGIN_COLUMNSTORE=NO -DPLUGIN_ROCKSDB=NO -DPLUGIN_S3=NO -DPLUGIN_MROONGA=NO -DPLUGIN_CONNECT=NO -DPLUGIN_MROONGA=NO -DPLUGIN_TOKUDB=NO -DPLUGIN_PERFSCHEMA=NO -DWITH_WSREP=OFF" + # Major version dictates which branches share the same ccache. E.g. 10.6-abc + # and 10.6-xyz will have the same cache. + MARIADB_MAJOR_VERSION: "10.6" + # NOTE! Currently ccache is only used on the Centos8 build. As each job has + # sufficiently different environments they are unable to benefit from each + # other's ccaches. As each build generates about 1 GB of ccache, having + # multiple caches would quickly consume all free storage on Gitlab-CI and + # grind all builds to a halt. Also the network overhead of download/upload + # decreases the benefit of ccache in Gitlab-CI, and current cache:when and + # cache:policy are not flexible enough to have a system where the cache is + # uploaded only once a week and not on every build. Having ccache on at least + # one build still helps ensure that ccache compatibility is at least tested + # and if the Centos 8 build is always significantly faster than all other + # builds (e.g. on self-hosted Gitlab instances) then users would at least be + # able to discover it. + # + # Most steps don't need the source code, only artifacts + GIT_STRATEGY: none + # Hack to satisfy directory name length requirement by CPackRPM in CMake 3.x + # https://cmake.org/cmake/help/v3.7/module/CPackRPM.html#variable:CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX + GIT_CLONE_PATH: $CI_BUILDS_DIR/CPACK_BUILD_SOURCE_DIRS_LONG_NAME_REQUIREMENT + +# Define once, use many times +.rpm_listfiles: &rpm_listfiles + - | + echo "Generating rpmlist-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log ..." + for package in *.rpm + do + echo "$package" + rpm -qlpv "$package" | awk '{print $1 " " $3 "/" $4 " ." $9 " " $10 " " $11}' | sort -k 3 + echo "------------------------------------------------" + done >> "../rpmlist-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log" + # CPackRPM lists contents in build log, so no need to show the output of this, + # just store it as a build artifact that can be downloaded and diffed against + # other builds to detect which files where added/removed/moved + +fedora: + stage: build + variables: + GIT_STRATEGY: fetch + GIT_SUBMODULE_STRATEGY: normal + script: + - yum install -y yum-utils rpm-build openssl-devel graphviz clang gnutls-devel + # Accelerate builds with unsafe disk access, as we can afford to loose the entire build anyway + - yum install -y https://github.com/stewartsmith/libeatmydata/releases/download/v129/libeatmydata-129-1.fc33.x86_64.rpm + # This repository does not have any .spec files, so install dependencies based on Fedora spec file + - yum-builddep -y mariadb-server + - mkdir builddir; cd builddir + - cmake -DRPM=$CI_JOB_NAME $CMAKE_FLAGS -DWITH_SSL=bundled .. 2>&1 | tee -a ../build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + - cmake --graphviz=../dependencies.dot .. && dot -Tpng -o ../dependencies.png ../dependencies.dot + - eatmydata make package -j 2 2>&1 | tee -a ../build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + # @TODO: Don't use -j without the limit of 2 on Gitlab.com as builds just + # get stuck when running multi-proc and out of memory, see https://jira.mariadb.org/browse/MDEV-25968 + - make test + # - make test-force # mysql-test-runner takes too long, run MTR in a separate job instead + - *rpm_listfiles + - mkdir ../rpm; mv *.rpm ../rpm + artifacts: + when: always # Must be able to see logs + paths: + - build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + - rpmlist-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + - rpm + - builddir/_CPack_Packages/Linux/RPM/SPECS/ + - dependencies.dot + - dependencies.png + +fedora-ninja: + stage: build + variables: + GIT_STRATEGY: fetch + GIT_SUBMODULE_STRATEGY: normal + script: + - yum install -y yum-utils rpm-build openssl-devel graphviz ninja-build gnutls-devel + # Accelerate builds with unsafe disk access, as we can afford to loose the entire build anyway + - yum install -y https://github.com/stewartsmith/libeatmydata/releases/download/v129/libeatmydata-129-1.fc33.x86_64.rpm + # This repository does not have any .spec files, so install dependencies based on Fedora spec file + - yum-builddep -y mariadb-server + - mkdir builddir; cd builddir + - cmake -DRPM=generic $CMAKE_FLAGS -DWITH_SSL=bundled -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -G Ninja .. 2>&1 | tee -a ../build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + - ninja -t graph > ../dependencies.dot && dot -Tpng -o ../dependencies.png ../dependencies.dot + - eatmydata ninja package -j 2 --verbose 2>&1 | tee -a ../build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + # @TODO: Unlike other builds, the Ninja builds using Gitlab.com runners don't get stuck, but they do get + # stuck on runners with more processors, see https://jira.mariadb.org/browse/MDEV-25968. + # Thus, use the same limitation on Ninja builds as well to ensure it never gets stuck due to this bug. + - ninja test + - *rpm_listfiles + - mkdir ../rpm; mv *.rpm ../rpm + artifacts: + when: always # Must be able to see logs + paths: + - build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + - rpmlist-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + - rpm + - builddir/_CPack_Packages/Linux/RPM/SPECS/ + - dependencies.dot + - dependencies.png + +fedora-clang: + stage: build + variables: + GIT_STRATEGY: fetch + GIT_SUBMODULE_STRATEGY: normal + script: + - yum install -y yum-utils rpm-build openssl-devel graphviz clang gnutls-devel + # Accelerate builds with unsafe disk access, as we can afford to loose the entire build anyway + - yum install -y https://github.com/stewartsmith/libeatmydata/releases/download/v129/libeatmydata-129-1.fc33.x86_64.rpm + # This repository does not have any .spec files, so install dependencies based on Fedora spec file + - yum-builddep -y mariadb-server + - mkdir builddir; cd builddir + - export CXX=${CXX:-clang++} + - export CC=${CC:-clang} + - export CXX_FOR_BUILD=${CXX_FOR_BUILD:-clang++} + - export CC_FOR_BUILD=${CC_FOR_BUILD:-clang} + - export CFLAGS='-Wno-unused-command-line-argument' + - export CXXFLAGS='-Wno-unused-command-line-argument' + - cmake -DRPM=generic $CMAKE_FLAGS -DWITH_SSL=bundled .. 2>&1 | tee -a ../build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + - cmake --graphviz=../dependencies.dot .. && dot -Tpng -o ../dependencies.png ../dependencies.dot + - eatmydata make package -j 2 2>&1 | tee -a ../build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + # @TODO: Don't use -j without the limit of 2 on Gitlab.com as builds just + # get stuck when running multi-proc and out of memory, see https://jira.mariadb.org/browse/MDEV-25968 + - make test + # - make test-force # mysql-test-runner takes too long, run MTr in a separate job instead + - *rpm_listfiles + - mkdir ../rpm; mv *.rpm ../rpm + artifacts: + when: always # Must be able to see logs + paths: + - build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + - rpmlist-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + - rpm + - builddir/_CPack_Packages/Linux/RPM/SPECS/ + - dependencies.dot + - dependencies.png + +fedora-sanitizer: + stage: build + variables: + GIT_STRATEGY: fetch + GIT_SUBMODULE_STRATEGY: normal + script: + - yum install -y yum-utils rpm-build openssl-devel clang gnutls-devel + - yum install -y libasan libtsan libubsan + # This repository does not have any .spec files, so install dependencies based on Fedora spec file + - yum-builddep -y mariadb-server + - mkdir builddir; cd builddir + - export CXX=${CXX:-clang++} + - export CC=${CC:-clang} + - export CXX_FOR_BUILD=${CXX_FOR_BUILD:-clang++} + - export CC_FOR_BUILD=${CC_FOR_BUILD:-clang} + - export CFLAGS='-Wno-unused-command-line-argument' + - export CXXFLAGS='-Wno-unused-command-line-argument' + - cmake -DRPM=$CI_JOB_NAME $CMAKE_FLAGS -DWITH_SSL=bundled $SANITIZER .. 2>&1 | tee -a ../build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + # @TODO: the build will fail consistently at 24% when trying to make using eatmydata + - make package -j 2 2>&1 | tee -a ../build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + - *rpm_listfiles + - mkdir ../rpm; mv *.rpm ../rpm + artifacts: + when: always # Must be able to see logs + paths: + - build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + - rpmlist-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + - rpm + - builddir/_CPack_Packages/Linux/RPM/SPECS/ + parallel: + matrix: + - SANITIZER: [-DWITH_ASAN=YES, -DWITH_TSAN=YES, -DWITH_UBSAN=YES, -DWITH_MSAN=YES] + +centos8: + stage: build + image: quay.io/centos/centos:stream8 # CentOS 8 is deprecated, use this Stream8 instead + variables: + GIT_STRATEGY: fetch + GIT_SUBMODULE_STRATEGY: normal + script: + - yum install -y yum-utils rpm-build openssl-devel pcre2-devel + - yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm + # dnf --enablerepo=powertools install Judy-devel #--> not found + - dnf config-manager --set-enabled powertools + # Error: + # Problem: conflicting requests + # - package Judy-devel-1.0.5-18.module_el8.3.0+757+d382997d.i686 is filtered out by modular filtering + # - package Judy-devel-1.0.5-18.module_el8.3.0+757+d382997d.x86_64 is filtered out by modular filtering + # Solution: install Judy-devel directly from downloaded rpm file: + - yum install -y http://vault.centos.org/centos/8/PowerTools/x86_64/os/Packages/Judy-devel-1.0.5-18.module_el8.3.0+757+d382997d.x86_64.rpm + # Use eatmydata to speed up build + - yum install -y https://github.com/stewartsmith/libeatmydata/releases/download/v129/libeatmydata-129-1.fc33.x86_64.rpm + - yum install -y ccache # From EPEL + - source /etc/profile.d/ccache.sh + - export CCACHE_DIR="$(pwd)/.ccache"; ccache --zero-stats + # This repository does not have any .spec files, so install dependencies based on CentOS spec file + - yum-builddep -y mariadb-server + - mkdir builddir; cd builddir + - cmake -DRPM=$CI_JOB_NAME $CMAKE_FLAGS -DWITH_SSL=system .. 2>&1 | tee -a ../build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + - eatmydata make package -j 2 2>&1 | tee -a ../build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + # @TODO: Don't use -j without the limit of 2 on Gitlab.com as builds just + # get stuck when running multi-proc and out of memory, see https://jira.mariadb.org/browse/MDEV-25968 + - make test + # - make test-force # mysql-test-runner takes too long, run it MTR a separate job instead + - *rpm_listfiles + - mkdir ../rpm; mv *.rpm ../rpm + - ccache -s + artifacts: + when: always # Must be able to see logs + paths: + - build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + - rpmlist-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + - rpm + - builddir/_CPack_Packages/Linux/RPM/SPECS/ + cache: + key: $MARIADB_MAJOR_VERSION + paths: + - .ccache + +centos7: + stage: build + image: centos:7 + variables: + GIT_STRATEGY: fetch + GIT_SUBMODULE_STRATEGY: normal + script: + # This repository does not have any .spec files, so install dependencies based on Fedora spec file + - yum-builddep -y mariadb-server + # ..with a few extra ones, as CentOS 7 is very old and these are added in newer MariaDB releases + - yum install -y yum-utils rpm-build gcc gcc-c++ bison libxml2-devel libevent-devel openssl-devel pcre2-devel + - mkdir builddir; cd builddir + - cmake -DRPM=$CI_JOB_NAME $CMAKE_FLAGS -DWITH_SSL=system .. 2>&1 | tee -a ../build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + - make package -j 2 2>&1 | tee -a ../build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + # @TODO: Don't use -j without the limit of 2 on Gitlab.com as builds just + # get stuck when running multi-proc and out of memory, see https://jira.mariadb.org/browse/MDEV-25968 + - make test + # - make test-force # mysql-test-runner takes too long, run it in a separate job instead + - *rpm_listfiles + - mkdir ../rpm; mv *.rpm ../rpm + artifacts: + when: always # Must be able to see logs + paths: + - build-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + - rpmlist-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + - rpm + - builddir/_CPack_Packages/Linux/RPM/SPECS/ + +.mysql-test-run: &mysql-test-run-def + stage: test + script: + # Install packages so tests and the dependencies install + # @TODO: RPM missing 'patch' and 'diff' as dependency, so installing it manually for now + - yum install -y rpm/*.rpm patch diffutils + # @TODO: Fix on packaging level for /usr/share/mariadb to work and errormsg.sys be found + - rm -rf /usr/share/mariadb; ln -s /usr/share/mysql /usr/share/mariadb + # mtr expects to be launched in-place and with write access to it's own directories + - cd /usr/share/mysql-test + # Skip failing tests + - | + echo " + main.mysqldump : Field separator argument is not what is expected; check the manual when executing 'SELECT INTO OUTFILE' + main.flush_logs_not_windows : query 'flush logs' succeeded - should have failed with error ER_CANT_CREATE_FILE (1004) + main.mysql_upgrade_noengine : upgrade output order does not match the expected + " > skiplist + - ./mtr --suite=main --force --parallel=auto --xml-report=$CI_PROJECT_DIR/junit.xml --skip-test-list=skiplist $RESTART_POLICY + +mysql-test-run: + stage: test + dependencies: + - fedora + needs: + - fedora + <<: *mysql-test-run-def + artifacts: + when: always # Also show results when tests fail + reports: + junit: + - junit.xml + +# Duplicate of the above jobs, except we use sanitizer build jobs as a dependency. This is so we can keep +# sanitizer errors separate from functional test failures. Currently, there is no way to run the same +# job for different dependencies. +# +# Additionally, for each sanitizer MTR job, we enable --force-restart so that +# sanitizer errors can be traced to individual tests. The difference in test +# suite runtime as a result of this flag is negligable (~30s for the entire test suite). +# (see https://dev.mysql.com/doc/dev/mysql-server/latest/PAGE_MYSQL_TEST_RUN_PL.html) +mysql-test-run-asan: + stage: test + variables: + RESTART_POLICY: "--force-restart" + dependencies: + - "fedora-sanitizer: [-DWITH_ASAN=YES]" + needs: + - "fedora-sanitizer: [-DWITH_ASAN=YES]" + <<: *mysql-test-run-def + artifacts: + when: always # Also show results when tests fail + reports: + junit: + - junit.xml + +mysql-test-run-tsan: + stage: test + variables: + RESTART_POLICY: "--force-restart" + dependencies: + - "fedora-sanitizer: [-DWITH_TSAN=YES]" + needs: + - "fedora-sanitizer: [-DWITH_TSAN=YES]" + <<: *mysql-test-run-def + allow_failure: true + artifacts: + when: always # Also show results when tests fail + reports: + junit: + - junit.xml + +mysql-test-run-ubsan: + stage: test + variables: + RESTART_POLICY: "--force-restart" + dependencies: + - "fedora-sanitizer: [-DWITH_UBSAN=YES]" + needs: + - "fedora-sanitizer: [-DWITH_UBSAN=YES]" + <<: *mysql-test-run-def + allow_failure: true + artifacts: + when: always # Also show results when tests fail + reports: + junit: + - junit.xml + +mysql-test-run-msan: + stage: test + variables: + RESTART_POLICY: "--force-restart" + dependencies: + - "fedora-sanitizer: [-DWITH_MSAN=YES]" + needs: + - "fedora-sanitizer: [-DWITH_MSAN=YES]" + <<: *mysql-test-run-def + allow_failure: true + artifacts: + when: always # Also show results when tests fail + reports: + junit: + - junit.xml + +rpmlint: + stage: test + dependencies: + - fedora + needs: + - fedora + script: + - yum install -y rpmlint + - rm -f rpm/*debuginfo* # Not relevant in this test + # Limit output to 1000 lines as Gitlab-CI max output is 4194304 bytes + # Save everything in a log file so it can be viewed in full via artifacts + - rpmlint --info rpm/*.rpm | tee -a rpmlint-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + artifacts: + when: always # Also show results when tests fail + paths: + - rpmlint-$CI_JOB_NAME-$CI_COMMIT_REF_SLUG.log + allow_failure: true + # @TODO: The package is not rpmlint clean, must allow failure for now + +fedora install: + stage: test + dependencies: + - fedora + needs: + - fedora + script: + - rm -f rpm/*debuginfo* # Not relevant in this test + # Nothing provides galera-4 on Fedora, so this step fails if built with wsrep + - yum install -y rpm/*.rpm + # Fedora does not support running services in Docker (like Debian packages do) so start it manually + - /usr/bin/mariadb-install-db -u mysql + - sudo -u mysql /usr/sbin/mariadbd & sleep 10 + # Dump database contents as is before upgrade + - mariadb-dump --all-databases --all-tablespaces --triggers --routines --events --skip-extended-insert > installed-database.sql + # Since we did a manual start, we also need to run upgrade manually + - /usr/bin/mariadb-upgrade -u root + # Dump database contents as is after upgrade + - mariadb-dump --all-databases --all-tablespaces --triggers --routines --events --skip-extended-insert > upgraded-database.sql + - | + mariadb --skip-column-names -e "SELECT @@version, @@version_comment" | tee /tmp/version + grep $MARIADB_MAJOR_VERSION /tmp/version || echo "MariaDB didn't install properly" + - mariadb --table -e "SELECT * FROM mysql.global_priv; SHOW CREATE USER root@localhost; SHOW CREATE USER 'mariadb.sys'@localhost" + - mariadb --table -e "SELECT * FROM mysql.plugin; SHOW PLUGINS" + - mariadb -e "SHUTDOWN;" + - rm -rf /var/lib/mysql/* # Clear datadir before next run + # Start database without install-db step + - sudo -u mysql /usr/sbin/mariadbd --skip-network --skip-grant & sleep 10 + # Dump database contents in initial state + - mariadb-dump --all-databases --all-tablespaces --triggers --routines --events --skip-extended-insert > empty-database.sql + artifacts: + paths: + - installed-database.sql + - upgraded-database.sql + +fedora upgrade: + stage: test + dependencies: + - fedora + needs: + - fedora + script: + - dnf install -y mariadb-server + # Fedora does not support running services in Docker (like Debian packages do) so start it manually + - /usr/libexec/mariadb-check-socket + - /usr/libexec/mariadb-prepare-db-dir + - sudo -u mysql /usr/libexec/mariadbd --basedir=/usr & sleep 10 + # Dump database contents in installed state + - mariadb-dump --all-databases --all-tablespaces --triggers --routines --events --skip-extended-insert > old-installed-database.sql + - /usr/libexec/mariadb-check-upgrade + # Dump database contents in upgraded state + - mariadb-dump --all-databases --all-tablespaces --triggers --routines --events --skip-extended-insert > old-upgraded-database.sql + - mariadb --skip-column-names -e "SELECT @@version, @@version_comment" # Show version + # @TODO: Upgrade from Fedora 33 MariaDB 10.4 to MariaDB.org latest does not work + # so do this manual step to remove conflicts until packaging is fixed + - yum remove -y mariadb-server-utils mariadb-gssapi-server mariadb-cracklib-password-check mariadb-backup mariadb-connector-c-config + - rm -f rpm/*debuginfo* # Not relevant in this test + - yum install -y rpm/*.rpm + # nothing provides galera-4 on Fedora, so this step fails if built with wsrep + - mysql -e "SHUTDOWN;" + - /usr/bin/mariadb-install-db # This step should not do anything on upgrades, just exit + - sudo -u mysql /usr/sbin/mariadbd & sleep 10 + # Dump database contents in installed state + - mariadb-dump --all-databases --all-tablespaces --triggers --routines --events --skip-extended-insert > new-installed-database.sql || true + # The step above fails on: mariadb-dump: Couldn't execute 'show events': Cannot proceed, because event scheduler is disabled (1577) + # @TODO: Since we did a manual start, we also need to run upgrade manually + - /usr/bin/mariadb-upgrade + # Dump database contents in upgraded state + - mariadb-dump --all-databases --all-tablespaces --triggers --routines --events --skip-extended-insert > new-upgraded-database.sql + - | + mariadb --skip-column-names -e "SELECT @@version, @@version_comment" | tee /tmp/version + grep $MARIADB_MAJOR_VERSION /tmp/version || echo "MariaDB didn't upgrade properly" + - mariadb --table -e "SELECT * FROM mysql.global_priv; SHOW CREATE USER root@localhost; SHOW CREATE USER 'mariadb.sys'@localhost" + - mariadb --table -e "SELECT * FROM mysql.plugin; SHOW PLUGINS" + artifacts: + paths: + - old-installed-database.sql + - old-upgraded-database.sql + - new-installed-database.sql + - new-upgraded-database.sql + +# Once all RPM builds and tests have passed, also run the DEB builds and tests +# @NOTE: This is likely to work well only on salsa.debian.org as the Gitlab.com +# runners are too small for everything this stage does. +# build_deb: +# stage: Salsa-CI +# trigger: +# include: debian/salsa-ci.yml From fab166532f3317c9d04c6f0be17babe7e0927e52 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 9 Feb 2023 18:41:45 +1100 Subject: [PATCH 011/260] MDEV-30630 locale: Chinese error messages for ZH_CN MDEV-28227 added the error messages in simplified characters. Lets use these for those running a zh_CN profile. From Haidong Ji in the MDEV, Taiwan/Hong Kong (zh_TW/zh_HK) would expect traditional characters so this is left for when we have these. --- mysql-test/main/locale.result | 10 ++++++++++ mysql-test/main/locale.test | 14 ++++++++++++++ mysql-test/suite/plugins/r/locales.result | 4 ++-- sql/sql_locale.cc | 5 +++-- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/mysql-test/main/locale.result b/mysql-test/main/locale.result index f136e9e99ab..8ff5bde39e1 100644 --- a/mysql-test/main/locale.result +++ b/mysql-test/main/locale.result @@ -306,3 +306,13 @@ date_format('2001-01-06', '%w %a %W', 'de_CH') select date_format('2001-09-01', '%c %b %M', 'de_CH'); date_format('2001-09-01', '%c %b %M', 'de_CH') 9 Sep September +# +# MDEV-30630 locale: Chinese error message for ZH_CN +# +SET lc_messages=ZH_CN; +SELECT x; +ERROR 42S22: 未知列'x'在'field list' +SET lc_messages=DEFAULT; +# +# End of 10.4 tests +# diff --git a/mysql-test/main/locale.test b/mysql-test/main/locale.test index a9a507bc387..7d9a07178ee 100644 --- a/mysql-test/main/locale.test +++ b/mysql-test/main/locale.test @@ -181,3 +181,17 @@ select date_format('2001-10-01', '%c %b %M', 'rm_CH'); select date_format('2001-12-01', '%c %b %M', 'rm_CH'); select date_format('2001-01-06', '%w %a %W', 'de_CH'); select date_format('2001-09-01', '%c %b %M', 'de_CH'); + +--echo # +--echo # MDEV-30630 locale: Chinese error message for ZH_CN +--echo # + +SET lc_messages=ZH_CN; +--error ER_BAD_FIELD_ERROR +SELECT x; + +SET lc_messages=DEFAULT; + +--echo # +--echo # End of 10.4 tests +--echo # diff --git a/mysql-test/suite/plugins/r/locales.result b/mysql-test/suite/plugins/r/locales.result index e906d27c21e..5229b7ffaa8 100644 --- a/mysql-test/suite/plugins/r/locales.result +++ b/mysql-test/suite/plugins/r/locales.result @@ -57,7 +57,7 @@ ID NAME DESCRIPTION MAX_MONTH_NAME_LENGTH MAX_DAY_NAME_LENGTH DECIMAL_POINT THOU 53 uk_UA Ukrainian - Ukraine 8 9 , . ukrainian 54 ur_PK Urdu - Pakistan 6 6 . , english 55 vi_VN Vietnamese - Vietnam 16 11 , . english -56 zh_CN Chinese - Peoples Republic of China 3 3 . , english +56 zh_CN Chinese - Peoples Republic of China 3 3 . , chinese 57 zh_TW Chinese - Taiwan 3 2 . , english 58 ar_DZ Arabic - Algeria 6 8 . , english 59 ar_EG Arabic - Egypt 6 8 . , english @@ -170,7 +170,7 @@ Id Name Description Error_Message_Language 53 uk_UA Ukrainian - Ukraine ukrainian 54 ur_PK Urdu - Pakistan english 55 vi_VN Vietnamese - Vietnam english -56 zh_CN Chinese - Peoples Republic of China english +56 zh_CN Chinese - Peoples Republic of China chinese 57 zh_TW Chinese - Taiwan english 58 ar_DZ Arabic - Algeria english 59 ar_EG Arabic - Egypt english diff --git a/sql/sql_locale.cc b/sql/sql_locale.cc index dd19807dd6d..60e7abc3fa2 100644 --- a/sql/sql_locale.cc +++ b/sql/sql_locale.cc @@ -29,7 +29,7 @@ enum err_msgs_index { - en_US= 0, cs_CZ, da_DK, nl_NL, et_EE, fr_FR, de_DE, el_GR, hu_HU, it_IT, + en_US= 0, zh_CN, cs_CZ, da_DK, nl_NL, et_EE, fr_FR, de_DE, el_GR, hu_HU, it_IT, ja_JP, ko_KR, no_NO, nn_NO, pl_PL, pt_PT, ro_RO, ru_RU, sr_RS, sk_SK, es_ES, sv_SE, uk_UA, hi_IN } ERR_MSGS_INDEX; @@ -38,6 +38,7 @@ enum err_msgs_index MY_LOCALE_ERRMSGS global_errmsgs[]= { {"english", NULL}, + {"chinese", NULL}, {"czech", NULL}, {"danish", NULL}, {"dutch", NULL}, @@ -2095,7 +2096,7 @@ MY_LOCALE my_locale_zh_CN '.', /* decimal point zh_CN */ ',', /* thousands_sep zh_CN */ "\x03", /* grouping zh_CN */ - &global_errmsgs[en_US] + &global_errmsgs[zh_CN] ); /***** LOCALE END zh_CN *****/ From 03c9a4ef4a0363ba0ffd1843284332fb9c5fd692 Mon Sep 17 00:00:00 2001 From: Haidong Ji Date: Wed, 7 Dec 2022 16:54:27 +0000 Subject: [PATCH 012/260] MDEV-29091: Correct event_name in PFS for wait caused by FOR UPDATE When one session SELECT ... FOR UPDATE and holds the lock, subsequent sessions that SELECT ... FOR UPDATE will wait to get the lock. Currently, that event is labeled as `wait/io/table/sql/handler`, which is incorrect. Instead, it should have been `wait/lock/table/sql/handler`. Two factors contribute to this bug: 1. Instrumentation interface and the heavy usage of `TABLE_IO_WAIT` in `sql/handler.cc` file. See interface [^1] for better understanding; 2. The balancing act [^2] of doing instrumentation aggregration _AND_ having good performance. For example, EVENTS_WAITS_SUMMARY... is aggregated using EVENTS_WAITS_CURRENT. Aggregration needs to be based on the same wait class, and the code was overly aggressive in label a LOCK operation as an IO operation in this case. The proposed fix is pretty simple, but understanding the bug took a while. Hence the footnotes below. For future improvement and refactoring, we may want to consider renaming `TABLE_IO_WAIT` and making it less coarse and more targeted. Note that newly added test case, events_waits_current_MDEV-29091, initially didn't pass Buildbot CI for embedded build tests. Further research showed that other impacted tests all included not_embedded.inc. This oversight was fixed later. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc. [^1]: To understand `performance_schema` instrumentation interface, I found this URL is the most helpful: https://dev.mysql.com/doc/dev/mysql-server/latest/PAGE_PFS_PSI.html [^2]: The best place to understand instrumentation projection, composition, and aggregration is through the source file. Although I prefer reading Doxygen produced html file, but for whatever reason, the rendering is not ideal. Here is link to 10.6's pfs.cc: https://github.com/MariaDB/server/blob/10.6/storage/perfschema/pfs.cc --- .../r/events_waits_current_MDEV-29091.result | 41 +++++ .../r/table_aggregate_hist_2u_2t.result | 114 ++++-------- .../r/table_aggregate_hist_2u_3t.result | 171 ++++++------------ .../r/table_aggregate_hist_4u_2t.result | 114 ++++-------- .../r/table_aggregate_hist_4u_3t.result | 171 ++++++------------ .../t/events_waits_current_MDEV-29091.test | 62 +++++++ storage/perfschema/pfs.cc | 3 +- 7 files changed, 295 insertions(+), 381 deletions(-) create mode 100644 mysql-test/suite/perfschema/r/events_waits_current_MDEV-29091.result create mode 100644 mysql-test/suite/perfschema/t/events_waits_current_MDEV-29091.test diff --git a/mysql-test/suite/perfschema/r/events_waits_current_MDEV-29091.result b/mysql-test/suite/perfschema/r/events_waits_current_MDEV-29091.result new file mode 100644 index 00000000000..8f3a17a0fc5 --- /dev/null +++ b/mysql-test/suite/perfschema/r/events_waits_current_MDEV-29091.result @@ -0,0 +1,41 @@ +SET default_storage_engine=InnoDB; +SELECT @save_instrument_enabled := ENABLED +, @save_instrument_timed := TIMED +FROM performance_schema.setup_instruments +WHERE NAME = 'wait/lock/table/sql/handler'; +@save_instrument_enabled := ENABLED @save_instrument_timed := TIMED +YES YES +SELECT @save_consumer_enabled := ENABLED +FROM performance_schema.setup_consumers +WHERE NAME = 'events_waits_current'; +@save_consumer_enabled := ENABLED +YES +UPDATE performance_schema.setup_instruments +SET ENABLED = 'YES', TIMED = 'YES' +WHERE NAME = 'wait/lock/table/sql/handler'; +UPDATE performance_schema.setup_consumers +SET ENABLED = 'YES' +WHERE NAME = 'events_waits_current'; +CREATE TABLE t1 (id1 INT(11), col1 VARCHAR (200)); +INSERT INTO t1 VALUES (1, 'aa'); +INSERT INTO t1 VALUES (2, 'bb'); +connect con1,localhost,root,,test; +connect con2,localhost,root,,test; +connection con1; +START TRANSACTION; +connection con2; +START TRANSACTION; +SELECT id1 FROM t1 WHERE id1=1 FOR UPDATE; +connection default; +SELECT event_name FROM performance_schema.events_waits_current +WHERE event_name LIKE '%wait/lock/table/sql/handler%'; +event_name +UPDATE performance_schema.setup_instruments +SET ENABLED = @save_instrument_enabled, TIMED = @save_instrument_timed +WHERE NAME = 'wait/lock/table/sql/handler'; +UPDATE performance_schema.setup_consumers +SET ENABLED = @save_consumer_enabled +WHERE NAME = 'events_waits_current'; +disconnect con1; +disconnect con2; +DROP TABLE t1; diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result index ee95e4c0417..ac0d5391fc0 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result @@ -215,10 +215,8 @@ wait/io/table/sql/handler 25 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 -wait/lock/table/sql/handler 10 TABLE test t1 -wait/io/table/sql/handler 17 TABLE test t3 -wait/lock/table/sql/handler 14 TABLE test t3 +wait/lock/table/sql/handler 18 TABLE test t1 +wait/lock/table/sql/handler 31 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -287,10 +285,8 @@ wait/io/table/sql/handler 25 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 -wait/lock/table/sql/handler 10 TABLE test t1 -wait/io/table/sql/handler 17 TABLE test t3 -wait/lock/table/sql/handler 14 TABLE test t3 +wait/lock/table/sql/handler 18 TABLE test t1 +wait/lock/table/sql/handler 31 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -394,10 +390,8 @@ wait/io/table/sql/handler 25 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 -wait/lock/table/sql/handler 10 TABLE test t1 -wait/io/table/sql/handler 17 TABLE test t3 -wait/lock/table/sql/handler 14 TABLE test t3 +wait/lock/table/sql/handler 18 TABLE test t1 +wait/lock/table/sql/handler 31 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -471,10 +465,8 @@ wait/io/table/sql/handler 25 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 -wait/lock/table/sql/handler 10 TABLE test t1 -wait/io/table/sql/handler 17 TABLE test t3 -wait/lock/table/sql/handler 14 TABLE test t3 +wait/lock/table/sql/handler 18 TABLE test t1 +wait/lock/table/sql/handler 31 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -590,10 +582,8 @@ wait/io/table/sql/handler 77 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 20 TABLE test t1 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 28 TABLE test t3 +wait/lock/table/sql/handler 43 TABLE test t1 +wait/lock/table/sql/handler 82 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -672,10 +662,8 @@ wait/io/table/sql/handler 77 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 20 TABLE test t1 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 28 TABLE test t3 +wait/lock/table/sql/handler 43 TABLE test t1 +wait/lock/table/sql/handler 82 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -803,10 +791,8 @@ wait/io/table/sql/handler 77 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 20 TABLE test t1 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 28 TABLE test t3 +wait/lock/table/sql/handler 43 TABLE test t1 +wait/lock/table/sql/handler 82 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -886,10 +872,8 @@ wait/io/table/sql/handler 77 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -966,10 +950,8 @@ wait/io/table/sql/handler 77 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1046,10 +1028,8 @@ wait/io/table/sql/handler 77 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1123,10 +1103,8 @@ wait/io/table/sql/handler 77 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1199,10 +1177,8 @@ wait/io/table/sql/handler 77 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1274,10 +1250,8 @@ wait/io/table/sql/handler 77 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1348,10 +1322,8 @@ wait/io/table/sql/handler 77 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1424,10 +1396,8 @@ wait/io/table/sql/handler 77 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1499,10 +1469,8 @@ wait/io/table/sql/handler 77 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1574,10 +1542,8 @@ wait/io/table/sql/handler 77 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1649,10 +1615,8 @@ wait/io/table/sql/handler 77 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1724,10 +1688,8 @@ wait/io/table/sql/handler 0 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 0 0 0 0 0 0 0 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result index d6e4e674258..372bdc094f3 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result @@ -214,12 +214,9 @@ wait/io/table/sql/handler 37 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 -wait/lock/table/sql/handler 10 TABLE test t1 -wait/io/table/sql/handler 12 TABLE test t2 -wait/lock/table/sql/handler 12 TABLE test t2 -wait/io/table/sql/handler 17 TABLE test t3 -wait/lock/table/sql/handler 14 TABLE test t3 +wait/lock/table/sql/handler 18 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t2 +wait/lock/table/sql/handler 31 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -288,12 +285,9 @@ wait/io/table/sql/handler 37 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 -wait/lock/table/sql/handler 10 TABLE test t1 -wait/io/table/sql/handler 12 TABLE test t2 -wait/lock/table/sql/handler 12 TABLE test t2 -wait/io/table/sql/handler 17 TABLE test t3 -wait/lock/table/sql/handler 14 TABLE test t3 +wait/lock/table/sql/handler 18 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t2 +wait/lock/table/sql/handler 31 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -397,12 +391,9 @@ wait/io/table/sql/handler 37 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 -wait/lock/table/sql/handler 10 TABLE test t1 -wait/io/table/sql/handler 12 TABLE test t2 -wait/lock/table/sql/handler 12 TABLE test t2 -wait/io/table/sql/handler 17 TABLE test t3 -wait/lock/table/sql/handler 14 TABLE test t3 +wait/lock/table/sql/handler 18 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t2 +wait/lock/table/sql/handler 31 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -476,12 +467,9 @@ wait/io/table/sql/handler 37 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 -wait/lock/table/sql/handler 10 TABLE test t1 -wait/io/table/sql/handler 12 TABLE test t2 -wait/lock/table/sql/handler 12 TABLE test t2 -wait/io/table/sql/handler 17 TABLE test t3 -wait/lock/table/sql/handler 14 TABLE test t3 +wait/lock/table/sql/handler 18 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t2 +wait/lock/table/sql/handler 31 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -597,12 +585,9 @@ wait/io/table/sql/handler 113 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 20 TABLE test t1 -wait/io/table/sql/handler 36 TABLE test t2 -wait/lock/table/sql/handler 24 TABLE test t2 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 28 TABLE test t3 +wait/lock/table/sql/handler 43 TABLE test t1 +wait/lock/table/sql/handler 60 TABLE test t2 +wait/lock/table/sql/handler 82 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -681,12 +666,9 @@ wait/io/table/sql/handler 113 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 20 TABLE test t1 -wait/io/table/sql/handler 36 TABLE test t2 -wait/lock/table/sql/handler 24 TABLE test t2 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 28 TABLE test t3 +wait/lock/table/sql/handler 43 TABLE test t1 +wait/lock/table/sql/handler 60 TABLE test t2 +wait/lock/table/sql/handler 82 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -814,12 +796,9 @@ wait/io/table/sql/handler 113 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 20 TABLE test t1 -wait/io/table/sql/handler 36 TABLE test t2 -wait/lock/table/sql/handler 24 TABLE test t2 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 28 TABLE test t3 +wait/lock/table/sql/handler 43 TABLE test t1 +wait/lock/table/sql/handler 60 TABLE test t2 +wait/lock/table/sql/handler 82 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -899,12 +878,9 @@ wait/io/table/sql/handler 113 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 36 TABLE test t2 -wait/lock/table/sql/handler 28 TABLE test t2 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 64 TABLE test t2 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -981,12 +957,9 @@ wait/io/table/sql/handler 113 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 36 TABLE test t2 -wait/lock/table/sql/handler 28 TABLE test t2 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 64 TABLE test t2 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1063,12 +1036,9 @@ wait/io/table/sql/handler 113 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 36 TABLE test t2 -wait/lock/table/sql/handler 28 TABLE test t2 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 64 TABLE test t2 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1142,12 +1112,9 @@ wait/io/table/sql/handler 113 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 36 TABLE test t2 -wait/lock/table/sql/handler 28 TABLE test t2 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 64 TABLE test t2 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1220,12 +1187,9 @@ wait/io/table/sql/handler 113 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 36 TABLE test t2 -wait/lock/table/sql/handler 28 TABLE test t2 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 64 TABLE test t2 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1297,12 +1261,9 @@ wait/io/table/sql/handler 113 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 36 TABLE test t2 -wait/lock/table/sql/handler 28 TABLE test t2 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 64 TABLE test t2 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1373,12 +1334,9 @@ wait/io/table/sql/handler 113 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 36 TABLE test t2 -wait/lock/table/sql/handler 28 TABLE test t2 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 64 TABLE test t2 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1451,12 +1409,9 @@ wait/io/table/sql/handler 113 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 36 TABLE test t2 -wait/lock/table/sql/handler 28 TABLE test t2 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 64 TABLE test t2 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1528,12 +1483,9 @@ wait/io/table/sql/handler 113 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 36 TABLE test t2 -wait/lock/table/sql/handler 28 TABLE test t2 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 64 TABLE test t2 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1605,12 +1557,9 @@ wait/io/table/sql/handler 113 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 36 TABLE test t2 -wait/lock/table/sql/handler 28 TABLE test t2 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 64 TABLE test t2 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1682,12 +1631,9 @@ wait/io/table/sql/handler 113 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 36 TABLE test t2 -wait/lock/table/sql/handler 28 TABLE test t2 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 64 TABLE test t2 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 18 12 6 12 2 4 0 @@ -1759,12 +1705,9 @@ wait/io/table/sql/handler 0 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 23 TABLE test t1 -wait/lock/table/sql/handler 24 TABLE test t1 -wait/io/table/sql/handler 36 TABLE test t2 -wait/lock/table/sql/handler 28 TABLE test t2 -wait/io/table/sql/handler 54 TABLE test t3 -wait/lock/table/sql/handler 32 TABLE test t3 +wait/lock/table/sql/handler 47 TABLE test t1 +wait/lock/table/sql/handler 64 TABLE test t2 +wait/lock/table/sql/handler 86 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 0 0 0 0 0 0 0 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result index 2d2a55efa77..3643a854291 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result @@ -215,10 +215,8 @@ wait/io/table/sql/handler 25 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 -wait/lock/table/sql/handler 10 TABLE test t1 -wait/io/table/sql/handler 17 TABLE test t3 -wait/lock/table/sql/handler 14 TABLE test t3 +wait/lock/table/sql/handler 18 TABLE test t1 +wait/lock/table/sql/handler 31 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -287,10 +285,8 @@ wait/io/table/sql/handler 25 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 -wait/lock/table/sql/handler 10 TABLE test t1 -wait/io/table/sql/handler 17 TABLE test t3 -wait/lock/table/sql/handler 14 TABLE test t3 +wait/lock/table/sql/handler 18 TABLE test t1 +wait/lock/table/sql/handler 31 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -394,10 +390,8 @@ wait/io/table/sql/handler 64 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 20 TABLE test t1 -wait/lock/table/sql/handler 20 TABLE test t1 -wait/io/table/sql/handler 44 TABLE test t3 -wait/lock/table/sql/handler 28 TABLE test t3 +wait/lock/table/sql/handler 40 TABLE test t1 +wait/lock/table/sql/handler 72 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 15 10 5 10 2 3 0 @@ -471,10 +465,8 @@ wait/io/table/sql/handler 64 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 20 TABLE test t1 -wait/lock/table/sql/handler 20 TABLE test t1 -wait/io/table/sql/handler 44 TABLE test t3 -wait/lock/table/sql/handler 28 TABLE test t3 +wait/lock/table/sql/handler 40 TABLE test t1 +wait/lock/table/sql/handler 72 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 15 10 5 10 2 3 0 @@ -590,10 +582,8 @@ wait/io/table/sql/handler 116 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 35 TABLE test t1 -wait/lock/table/sql/handler 30 TABLE test t1 -wait/io/table/sql/handler 81 TABLE test t3 -wait/lock/table/sql/handler 42 TABLE test t3 +wait/lock/table/sql/handler 65 TABLE test t1 +wait/lock/table/sql/handler 123 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 27 18 9 18 3 6 0 @@ -672,10 +662,8 @@ wait/io/table/sql/handler 116 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 35 TABLE test t1 -wait/lock/table/sql/handler 30 TABLE test t1 -wait/io/table/sql/handler 81 TABLE test t3 -wait/lock/table/sql/handler 42 TABLE test t3 +wait/lock/table/sql/handler 65 TABLE test t1 +wait/lock/table/sql/handler 123 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 27 18 9 18 3 6 0 @@ -803,10 +791,8 @@ wait/io/table/sql/handler 181 wait/lock/table/sql/handler 96 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 40 TABLE test t1 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 56 TABLE test t3 +wait/lock/table/sql/handler 93 TABLE test t1 +wait/lock/table/sql/handler 184 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -886,10 +872,8 @@ wait/io/table/sql/handler 181 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -966,10 +950,8 @@ wait/io/table/sql/handler 181 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1046,10 +1028,8 @@ wait/io/table/sql/handler 181 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1123,10 +1103,8 @@ wait/io/table/sql/handler 181 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1199,10 +1177,8 @@ wait/io/table/sql/handler 181 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1274,10 +1250,8 @@ wait/io/table/sql/handler 181 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1348,10 +1322,8 @@ wait/io/table/sql/handler 181 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1424,10 +1396,8 @@ wait/io/table/sql/handler 181 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1499,10 +1469,8 @@ wait/io/table/sql/handler 181 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1574,10 +1542,8 @@ wait/io/table/sql/handler 181 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1649,10 +1615,8 @@ wait/io/table/sql/handler 181 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1724,10 +1688,8 @@ wait/io/table/sql/handler 0 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 0 0 0 0 0 0 0 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result index de8fc4702a6..90adf00b734 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result @@ -214,12 +214,9 @@ wait/io/table/sql/handler 37 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 -wait/lock/table/sql/handler 10 TABLE test t1 -wait/io/table/sql/handler 12 TABLE test t2 -wait/lock/table/sql/handler 12 TABLE test t2 -wait/io/table/sql/handler 17 TABLE test t3 -wait/lock/table/sql/handler 14 TABLE test t3 +wait/lock/table/sql/handler 18 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t2 +wait/lock/table/sql/handler 31 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -288,12 +285,9 @@ wait/io/table/sql/handler 37 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 -wait/lock/table/sql/handler 10 TABLE test t1 -wait/io/table/sql/handler 12 TABLE test t2 -wait/lock/table/sql/handler 12 TABLE test t2 -wait/io/table/sql/handler 17 TABLE test t3 -wait/lock/table/sql/handler 14 TABLE test t3 +wait/lock/table/sql/handler 18 TABLE test t1 +wait/lock/table/sql/handler 24 TABLE test t2 +wait/lock/table/sql/handler 31 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 6 4 2 4 1 1 0 @@ -397,12 +391,9 @@ wait/io/table/sql/handler 94 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 20 TABLE test t1 -wait/lock/table/sql/handler 20 TABLE test t1 -wait/io/table/sql/handler 30 TABLE test t2 -wait/lock/table/sql/handler 24 TABLE test t2 -wait/io/table/sql/handler 44 TABLE test t3 -wait/lock/table/sql/handler 28 TABLE test t3 +wait/lock/table/sql/handler 40 TABLE test t1 +wait/lock/table/sql/handler 54 TABLE test t2 +wait/lock/table/sql/handler 72 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 15 10 5 10 2 3 0 @@ -476,12 +467,9 @@ wait/io/table/sql/handler 94 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 20 TABLE test t1 -wait/lock/table/sql/handler 20 TABLE test t1 -wait/io/table/sql/handler 30 TABLE test t2 -wait/lock/table/sql/handler 24 TABLE test t2 -wait/io/table/sql/handler 44 TABLE test t3 -wait/lock/table/sql/handler 28 TABLE test t3 +wait/lock/table/sql/handler 40 TABLE test t1 +wait/lock/table/sql/handler 54 TABLE test t2 +wait/lock/table/sql/handler 72 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 15 10 5 10 2 3 0 @@ -597,12 +585,9 @@ wait/io/table/sql/handler 170 wait/lock/table/sql/handler 108 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 35 TABLE test t1 -wait/lock/table/sql/handler 30 TABLE test t1 -wait/io/table/sql/handler 54 TABLE test t2 -wait/lock/table/sql/handler 36 TABLE test t2 -wait/io/table/sql/handler 81 TABLE test t3 -wait/lock/table/sql/handler 42 TABLE test t3 +wait/lock/table/sql/handler 65 TABLE test t1 +wait/lock/table/sql/handler 90 TABLE test t2 +wait/lock/table/sql/handler 123 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 27 18 9 18 3 6 0 @@ -681,12 +666,9 @@ wait/io/table/sql/handler 170 wait/lock/table/sql/handler 108 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 35 TABLE test t1 -wait/lock/table/sql/handler 30 TABLE test t1 -wait/io/table/sql/handler 54 TABLE test t2 -wait/lock/table/sql/handler 36 TABLE test t2 -wait/io/table/sql/handler 81 TABLE test t3 -wait/lock/table/sql/handler 42 TABLE test t3 +wait/lock/table/sql/handler 65 TABLE test t1 +wait/lock/table/sql/handler 90 TABLE test t2 +wait/lock/table/sql/handler 123 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 27 18 9 18 3 6 0 @@ -814,12 +796,9 @@ wait/io/table/sql/handler 265 wait/lock/table/sql/handler 144 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 40 TABLE test t1 -wait/io/table/sql/handler 84 TABLE test t2 -wait/lock/table/sql/handler 48 TABLE test t2 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 56 TABLE test t3 +wait/lock/table/sql/handler 93 TABLE test t1 +wait/lock/table/sql/handler 132 TABLE test t2 +wait/lock/table/sql/handler 184 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -899,12 +878,9 @@ wait/io/table/sql/handler 265 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 84 TABLE test t2 -wait/lock/table/sql/handler 52 TABLE test t2 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 136 TABLE test t2 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -981,12 +957,9 @@ wait/io/table/sql/handler 265 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 84 TABLE test t2 -wait/lock/table/sql/handler 52 TABLE test t2 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 136 TABLE test t2 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1063,12 +1036,9 @@ wait/io/table/sql/handler 265 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 84 TABLE test t2 -wait/lock/table/sql/handler 52 TABLE test t2 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 136 TABLE test t2 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1142,12 +1112,9 @@ wait/io/table/sql/handler 265 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 84 TABLE test t2 -wait/lock/table/sql/handler 52 TABLE test t2 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 136 TABLE test t2 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1220,12 +1187,9 @@ wait/io/table/sql/handler 265 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 84 TABLE test t2 -wait/lock/table/sql/handler 52 TABLE test t2 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 136 TABLE test t2 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1297,12 +1261,9 @@ wait/io/table/sql/handler 265 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 84 TABLE test t2 -wait/lock/table/sql/handler 52 TABLE test t2 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 136 TABLE test t2 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1373,12 +1334,9 @@ wait/io/table/sql/handler 265 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 84 TABLE test t2 -wait/lock/table/sql/handler 52 TABLE test t2 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 136 TABLE test t2 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1451,12 +1409,9 @@ wait/io/table/sql/handler 265 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 84 TABLE test t2 -wait/lock/table/sql/handler 52 TABLE test t2 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 136 TABLE test t2 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1528,12 +1483,9 @@ wait/io/table/sql/handler 265 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 84 TABLE test t2 -wait/lock/table/sql/handler 52 TABLE test t2 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 136 TABLE test t2 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1605,12 +1557,9 @@ wait/io/table/sql/handler 265 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 84 TABLE test t2 -wait/lock/table/sql/handler 52 TABLE test t2 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 136 TABLE test t2 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1682,12 +1631,9 @@ wait/io/table/sql/handler 265 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 84 TABLE test t2 -wait/lock/table/sql/handler 52 TABLE test t2 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 136 TABLE test t2 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 42 28 14 28 4 10 0 @@ -1759,12 +1705,9 @@ wait/io/table/sql/handler 0 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 53 TABLE test t1 -wait/lock/table/sql/handler 44 TABLE test t1 -wait/io/table/sql/handler 84 TABLE test t2 -wait/lock/table/sql/handler 52 TABLE test t2 -wait/io/table/sql/handler 128 TABLE test t3 -wait/lock/table/sql/handler 60 TABLE test t3 +wait/lock/table/sql/handler 97 TABLE test t1 +wait/lock/table/sql/handler 136 TABLE test t2 +wait/lock/table/sql/handler 188 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete TABLE test t1 NULL 0 0 0 0 0 0 0 diff --git a/mysql-test/suite/perfschema/t/events_waits_current_MDEV-29091.test b/mysql-test/suite/perfschema/t/events_waits_current_MDEV-29091.test new file mode 100644 index 00000000000..d9330ee5a9d --- /dev/null +++ b/mysql-test/suite/perfschema/t/events_waits_current_MDEV-29091.test @@ -0,0 +1,62 @@ +# +# proper event name wait/lock/table/sql/handler recorded in +# PERFORMANCE_SCHEMA.EVENTS_WAITS_CURRENT. Before this fix, it was +# labeled as wait/io/table/sql/handler. +# + +--source include/have_innodb.inc +--source include/have_perfschema.inc +--source include/not_embedded.inc + +SET default_storage_engine=InnoDB; + +SELECT @save_instrument_enabled := ENABLED +, @save_instrument_timed := TIMED +FROM performance_schema.setup_instruments +WHERE NAME = 'wait/lock/table/sql/handler'; + +SELECT @save_consumer_enabled := ENABLED +FROM performance_schema.setup_consumers +WHERE NAME = 'events_waits_current'; + +UPDATE performance_schema.setup_instruments +SET ENABLED = 'YES', TIMED = 'YES' +WHERE NAME = 'wait/lock/table/sql/handler'; + +UPDATE performance_schema.setup_consumers +SET ENABLED = 'YES' +WHERE NAME = 'events_waits_current'; + +CREATE TABLE t1 (id1 INT(11), col1 VARCHAR (200)); +INSERT INTO t1 VALUES (1, 'aa'); +INSERT INTO t1 VALUES (2, 'bb'); + +connect (con1,localhost,root,,test); +connect (con2,localhost,root,,test); + +connection con1; +START TRANSACTION; +let $wait_condition= + SELECT id1 FROM t1 WHERE id1=1 FOR UPDATE; +--source include/wait_condition.inc + +connection con2; +START TRANSACTION; +send SELECT id1 FROM t1 WHERE id1=1 FOR UPDATE; + +connection default; +SELECT event_name FROM performance_schema.events_waits_current +WHERE event_name LIKE '%wait/lock/table/sql/handler%'; + +# clean up +UPDATE performance_schema.setup_instruments +SET ENABLED = @save_instrument_enabled, TIMED = @save_instrument_timed +WHERE NAME = 'wait/lock/table/sql/handler'; + +UPDATE performance_schema.setup_consumers +SET ENABLED = @save_consumer_enabled +WHERE NAME = 'events_waits_current'; + +disconnect con1; +disconnect con2; +DROP TABLE t1; diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc index 44bcbad87d7..63b406f065b 100644 --- a/storage/perfschema/pfs.cc +++ b/storage/perfschema/pfs.cc @@ -2610,7 +2610,8 @@ start_table_io_wait_v1(PSI_table_locker_state *state, PFS_table_share *share= pfs_table->m_share; wait->m_thread= pfs_thread; - wait->m_class= &global_table_io_class; + if (wait->m_class == NULL || wait->m_class->m_type != PFS_CLASS_TABLE_LOCK) + wait->m_class= &global_table_io_class; wait->m_timer_start= timer_start; wait->m_timer_end= 0; wait->m_object_instance_addr= pfs_table->m_identity; From d1a46c68cd4f6557cbb76de22cd6faee50e41725 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Tue, 31 Jan 2023 13:14:53 -0800 Subject: [PATCH 013/260] MDEV-30218 Incorrect optimization for rowid_filtering Correction over the last patch for this MDEV. --- mysql-test/main/join_nested_jcl6.result | 2 +- mysql-test/main/opt_trace.result | 13 +- .../main/opt_trace_index_merge_innodb.result | 1 - mysql-test/main/range.result | 2 +- mysql-test/main/rowid_filter.result | 189 ++++++++++-------- mysql-test/main/rowid_filter_innodb.result | 102 +++++++--- mysql-test/main/select.result | 2 +- mysql-test/main/select_jcl6.result | 2 +- mysql-test/main/select_pkeycache.result | 2 +- mysql-test/main/selectivity.result | 2 +- sql/sql_select.cc | 130 ++++++------ 11 files changed, 250 insertions(+), 197 deletions(-) diff --git a/mysql-test/main/join_nested_jcl6.result b/mysql-test/main/join_nested_jcl6.result index 7226a5d62b1..91fe367c378 100644 --- a/mysql-test/main/join_nested_jcl6.result +++ b/mysql-test/main/join_nested_jcl6.result @@ -2085,7 +2085,7 @@ ON t6.b >= 2 AND t5.b=t7.b AND (t8.a > 0 OR t8.c IS NULL) AND t6.a>0 AND t7.a>0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t5 ALL NULL NULL NULL NULL 3 -1 SIMPLE t7 ref PRIMARY,b_i b_i 5 test.t5.b 2 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE t7 ref|filter PRIMARY,b_i b_i|PRIMARY 5|4 test.t5.b 2 (29%) Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan; Using rowid filter 1 SIMPLE t6 range PRIMARY,b_i PRIMARY 4 NULL 3 Using where; Rowid-ordered scan; Using join buffer (incremental, BNL join) 1 SIMPLE t8 ref b_i b_i 5 test.t5.b 2 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan SELECT t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b diff --git a/mysql-test/main/opt_trace.result b/mysql-test/main/opt_trace.result index 2eef0da62bb..92cd3eb7848 100644 --- a/mysql-test/main/opt_trace.result +++ b/mysql-test/main/opt_trace.result @@ -1016,7 +1016,6 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b { "index": "a", "used_range_estimates": false, "cause": "not available", - "rowid_filter_skipped": "cost_factor <= 0", "rows": 1, "cost": 200, "chosen": true @@ -1073,7 +1072,6 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b { "index": "a", "used_range_estimates": false, "cause": "not available", - "rowid_filter_skipped": "cost_factor <= 0", "rows": 1, "cost": 200, "chosen": true @@ -2120,7 +2118,6 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 { "access_type": "ref", "index": "a_c", "used_range_estimates": true, - "rowid_filter_skipped": "worst/max seeks clipping", "rows": 180, "cost": 92, "chosen": true @@ -3346,7 +3343,6 @@ explain select * from t1 where pk = 2 and a=5 and b=1 { "access_type": "ref", "index": "pk", "used_range_estimates": true, - "rowid_filter_skipped": "cost_factor <= 0", "rows": 1, "cost": 2, "chosen": true @@ -3355,7 +3351,6 @@ explain select * from t1 where pk = 2 and a=5 and b=1 { "access_type": "ref", "index": "pk_a", "used_range_estimates": true, - "rowid_filter_skipped": "cost_factor <= 0", "rows": 1, "cost": 2, "chosen": false, @@ -3365,7 +3360,6 @@ explain select * from t1 where pk = 2 and a=5 and b=1 { "access_type": "ref", "index": "pk_a_b", "used_range_estimates": true, - "rowid_filter_skipped": "cost_factor <= 0", "rows": 1, "cost": 1.0043, "chosen": true @@ -3974,6 +3968,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "best_access_path": { "considered_access_paths": [ { + "rowid_filter_skipped": "cost_factor <= 0", "access_type": "range", "resulting_rows": 3, "cost": 1.407, @@ -4000,7 +3995,6 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "index": "a", "used_range_estimates": false, "cause": "not better than ref estimates", - "rowid_filter_skipped": "cost_factor <= 0", "rows": 1, "cost": 3.007, "chosen": true @@ -4030,6 +4024,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "best_access_path": { "considered_access_paths": [ { + "rowid_filter_skipped": "cost_factor <= 0", "access_type": "range", "resulting_rows": 3, "cost": 1.407, @@ -4056,7 +4051,6 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "index": "a", "used_range_estimates": false, "cause": "not better than ref estimates", - "rowid_filter_skipped": "worst/max seeks clipping", "rows": 2, "cost": 3.014, "chosen": true @@ -8069,7 +8063,6 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "index": "b", "used_range_estimates": false, "cause": "not available", - "rowid_filter_skipped": "cost_factor <= 0", "rows": 1, "cost": 20, "chosen": true @@ -8273,7 +8266,6 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "index": "a", "used_range_estimates": false, "cause": "not available", - "rowid_filter_skipped": "cost_factor <= 0", "rows": 1, "cost": 20, "chosen": true @@ -8341,7 +8333,6 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "index": "a", "used_range_estimates": false, "cause": "not available", - "rowid_filter_skipped": "cost_factor <= 0", "rows": 1, "cost": 200, "chosen": true diff --git a/mysql-test/main/opt_trace_index_merge_innodb.result b/mysql-test/main/opt_trace_index_merge_innodb.result index 82f09dffa14..5786f741996 100644 --- a/mysql-test/main/opt_trace_index_merge_innodb.result +++ b/mysql-test/main/opt_trace_index_merge_innodb.result @@ -208,7 +208,6 @@ explain select * from t1 where pk1 != 0 and key1 = 1 { "access_type": "ref", "index": "key1", "used_range_estimates": true, - "rowid_filter_skipped": "cost_factor <= 0", "rows": 1, "cost": 2, "chosen": true diff --git a/mysql-test/main/range.result b/mysql-test/main/range.result index a3ce10fe38a..0e728d76a3e 100644 --- a/mysql-test/main/range.result +++ b/mysql-test/main/range.result @@ -281,7 +281,7 @@ INSERT INTO t1 VALUES (33,5),(33,5),(33,5),(33,5),(34,5),(35,5); EXPLAIN SELECT * FROM t1 WHERE a IN(1,2) AND b=5; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a,b a 5 NULL 2 Using index condition; Using where +1 SIMPLE t1 ref|filter a,b b|a 5|5 const 15 (5%) Using where; Using rowid filter SELECT * FROM t1 WHERE a IN(1,2) AND b=5; a b DROP TABLE t1; diff --git a/mysql-test/main/rowid_filter.result b/mysql-test/main/rowid_filter.result index b35021b8513..efe1fe16283 100644 --- a/mysql-test/main/rowid_filter.result +++ b/mysql-test/main/rowid_filter.result @@ -335,8 +335,8 @@ FROM orders JOIN lineitem ON o_orderkey=l_orderkey WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND o_totalprice between 200000 and 230000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate 4 NULL 98 Using index condition -1 SIMPLE orders eq_ref|filter PRIMARY,i_o_totalprice PRIMARY|i_o_totalprice 4|9 dbt3_s001.lineitem.l_orderkey 1 (5%) Using where; Using rowid filter +1 SIMPLE orders range PRIMARY,i_o_totalprice i_o_totalprice 9 NULL 69 Using index condition +1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (2%) Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice FROM orders JOIN lineitem ON o_orderkey=l_orderkey WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND @@ -346,40 +346,40 @@ EXPLAIN "query_block": { "select_id": 1, "table": { - "table_name": "lineitem", + "table_name": "orders", "access_type": "range", + "possible_keys": ["PRIMARY", "i_o_totalprice"], + "key": "i_o_totalprice", + "key_length": "9", + "used_key_parts": ["o_totalprice"], + "rows": 69, + "filtered": 100, + "index_condition": "orders.o_totalprice between 200000 and 230000" + }, + "table": { + "table_name": "lineitem", + "access_type": "ref", "possible_keys": [ "PRIMARY", "i_l_shipdate", "i_l_orderkey", "i_l_orderkey_quantity" ], - "key": "i_l_shipdate", + "key": "i_l_orderkey", "key_length": "4", - "used_key_parts": ["l_shipDATE"], - "rows": 98, - "filtered": 100, - "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'" - }, - "table": { - "table_name": "orders", - "access_type": "eq_ref", - "possible_keys": ["PRIMARY", "i_o_totalprice"], - "key": "PRIMARY", - "key_length": "4", - "used_key_parts": ["o_orderkey"], - "ref": ["dbt3_s001.lineitem.l_orderkey"], + "used_key_parts": ["l_orderkey"], + "ref": ["dbt3_s001.orders.o_orderkey"], "rowid_filter": { "range": { - "key": "i_o_totalprice", - "used_key_parts": ["o_totalprice"] + "key": "i_l_shipdate", + "used_key_parts": ["l_shipDATE"] }, - "rows": 69, - "selectivity_pct": 4.6 + "rows": 98, + "selectivity_pct": 1.632 }, - "rows": 1, - "filtered": 4.6, - "attached_condition": "orders.o_totalprice between 200000 and 230000" + "rows": 4, + "filtered": 1.632, + "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'" } } } @@ -388,8 +388,8 @@ FROM orders JOIN lineitem ON o_orderkey=l_orderkey WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND o_totalprice between 200000 and 230000; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate 4 NULL 98 98.00 100.00 100.00 Using index condition -1 SIMPLE orders eq_ref|filter PRIMARY,i_o_totalprice PRIMARY|i_o_totalprice 4|9 dbt3_s001.lineitem.l_orderkey 1 (5%) 0.11 (10%) 4.60 100.00 Using where; Using rowid filter +1 SIMPLE orders range PRIMARY,i_o_totalprice i_o_totalprice 9 NULL 69 71.00 100.00 100.00 Using index condition +1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (2%) 0.15 (2%) 1.63 100.00 Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice FROM orders JOIN lineitem ON o_orderkey=l_orderkey WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND @@ -401,53 +401,53 @@ ANALYZE "r_loops": 1, "r_total_time_ms": "REPLACED", "table": { - "table_name": "lineitem", + "table_name": "orders", "access_type": "range", + "possible_keys": ["PRIMARY", "i_o_totalprice"], + "key": "i_o_totalprice", + "key_length": "9", + "used_key_parts": ["o_totalprice"], + "r_loops": 1, + "rows": 69, + "r_rows": 71, + "r_total_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 100, + "index_condition": "orders.o_totalprice between 200000 and 230000" + }, + "table": { + "table_name": "lineitem", + "access_type": "ref", "possible_keys": [ "PRIMARY", "i_l_shipdate", "i_l_orderkey", "i_l_orderkey_quantity" ], - "key": "i_l_shipdate", + "key": "i_l_orderkey", "key_length": "4", - "used_key_parts": ["l_shipDATE"], - "r_loops": 1, - "rows": 98, - "r_rows": 98, - "r_total_time_ms": "REPLACED", - "filtered": 100, - "r_filtered": 100, - "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'" - }, - "table": { - "table_name": "orders", - "access_type": "eq_ref", - "possible_keys": ["PRIMARY", "i_o_totalprice"], - "key": "PRIMARY", - "key_length": "4", - "used_key_parts": ["o_orderkey"], - "ref": ["dbt3_s001.lineitem.l_orderkey"], + "used_key_parts": ["l_orderkey"], + "ref": ["dbt3_s001.orders.o_orderkey"], "rowid_filter": { "range": { - "key": "i_o_totalprice", - "used_key_parts": ["o_totalprice"] + "key": "i_l_shipdate", + "used_key_parts": ["l_shipDATE"] }, - "rows": 69, - "selectivity_pct": 4.6, - "r_rows": 71, - "r_lookups": 96, - "r_selectivity_pct": 10.417, + "rows": 98, + "selectivity_pct": 1.632, + "r_rows": 98, + "r_lookups": 476, + "r_selectivity_pct": 2.3109, "r_buffer_size": "REPLACED", "r_filling_time_ms": "REPLACED" }, - "r_loops": 98, - "rows": 1, - "r_rows": 0.1122, + "r_loops": 71, + "rows": 4, + "r_rows": 0.1549, "r_total_time_ms": "REPLACED", - "filtered": 4.6, + "filtered": 1.632, "r_filtered": 100, - "attached_condition": "orders.o_totalprice between 200000 and 230000" + "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'" } } } @@ -2072,7 +2072,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 INNER JOIN t2 ON ( pk1+1 = pk2+2 AND a1 = a2 ) WHERE b1 <= ( SELECT MAX(b2) FROM t2 WHERE pk2 <= 1 ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 101 100.00 Using where -1 PRIMARY t1 ref a1,b1 a1 5 test.t2.a2 36 28.75 Using where +1 PRIMARY t1 ref|filter a1,b1 a1|b1 5|4 test.t2.a2 36 (29%) 28.75 Using where; Using rowid filter 2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 100.00 Using index condition Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`pk2` AS `pk2`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a1` = `test`.`t2`.`a2` and `test`.`t1`.`b1` <= (/* select#2 */ select max(`test`.`t2`.`b2`) from `test`.`t2` where `test`.`t2`.`pk2` <= 1) and `test`.`t1`.`pk1` + 1 = `test`.`t2`.`pk2` + 2 @@ -2097,6 +2097,14 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a1"], "ref": ["test.t2.a2"], + "rowid_filter": { + "range": { + "key": "b1", + "used_key_parts": ["b1"] + }, + "rows": 115, + "selectivity_pct": 28.75 + }, "rows": 36, "filtered": 28.75, "attached_condition": "t1.b1 <= (subquery#2) and t1.pk1 + 1 = t2.pk2 + 2" @@ -2179,7 +2187,7 @@ test.t1 analyze status OK explain SELECT * FROM t1 WHERE a > 0 AND b=0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a,b b 5 const 151 Using where +1 SIMPLE t1 ref|filter a,b b|a 5|5 const 151 (17%) Using where; Using rowid filter SELECT * FROM t1 WHERE a > 0 AND b=0; a b 1 0 @@ -2514,19 +2522,32 @@ ANALYZE "r_total_time_ms": "REPLACED", "table": { "table_name": "t1", - "access_type": "range", + "access_type": "ref", "possible_keys": ["idx1", "idx2"], - "key": "idx1", - "key_length": "35", - "used_key_parts": ["nm"], + "key": "idx2", + "key_length": "5", + "used_key_parts": ["fl2"], + "ref": ["const"], + "rowid_filter": { + "range": { + "key": "idx1", + "used_key_parts": ["nm"] + }, + "rows": 44, + "selectivity_pct": 0.44, + "r_rows": 44, + "r_lookups": 1000, + "r_selectivity_pct": 0, + "r_buffer_size": "REPLACED", + "r_filling_time_ms": "REPLACED" + }, "r_loops": 1, - "rows": 44, - "r_rows": 44, + "rows": 921, + "r_rows": 0, "r_total_time_ms": "REPLACED", - "filtered": 9.21, - "r_filtered": 0, - "index_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'", - "attached_condition": "t1.fl2 = 0" + "filtered": 0.44, + "r_filtered": 100, + "attached_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'" } } } @@ -2559,19 +2580,31 @@ ANALYZE "r_total_time_ms": "REPLACED", "table": { "table_name": "t1", - "access_type": "range", + "access_type": "ref", "possible_keys": ["idx1", "idx2"], - "key": "idx1", - "key_length": "35", - "used_key_parts": ["nm"], + "key": "idx2", + "key_length": "5", + "used_key_parts": ["fl2"], + "ref": ["const"], + "rowid_filter": { + "range": { + "key": "idx1", + "used_key_parts": ["nm"] + }, + "rows": 44, + "selectivity_pct": 0.44, + "r_rows": 0, + "r_lookups": 0, + "r_selectivity_pct": 0, + "r_buffer_size": "REPLACED", + "r_filling_time_ms": "REPLACED" + }, "r_loops": 1, - "rows": 44, + "rows": 911, "r_rows": 0, - "r_total_time_ms": "REPLACED", - "filtered": 9.11, + "filtered": 0.44, "r_filtered": 100, - "index_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'", - "attached_condition": "t1.fl2 = 0" + "attached_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'" } } } diff --git a/mysql-test/main/rowid_filter_innodb.result b/mysql-test/main/rowid_filter_innodb.result index 1bf63d9a378..d7f1fe4a0d3 100644 --- a/mysql-test/main/rowid_filter_innodb.result +++ b/mysql-test/main/rowid_filter_innodb.result @@ -1997,7 +1997,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 INNER JOIN t2 ON ( pk1+1 = pk2+2 AND a1 = a2 ) WHERE b1 <= ( SELECT MAX(b2) FROM t2 WHERE pk2 <= 1 ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 101 100.00 Using where -1 PRIMARY t1 ref a1,b1 a1 5 test.t2.a2 36 28.75 Using where +1 PRIMARY t1 ref|filter a1,b1 a1|b1 5|4 test.t2.a2 36 (29%) 28.75 Using where; Using rowid filter 2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 100.00 Using index condition Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`pk2` AS `pk2`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a1` = `test`.`t2`.`a2` and `test`.`t1`.`b1` <= (/* select#2 */ select max(`test`.`t2`.`b2`) from `test`.`t2` where `test`.`t2`.`pk2` <= 1) and `test`.`t1`.`pk1` + 1 = `test`.`t2`.`pk2` + 2 @@ -2022,6 +2022,14 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a1"], "ref": ["test.t2.a2"], + "rowid_filter": { + "range": { + "key": "b1", + "used_key_parts": ["b1"] + }, + "rows": 115, + "selectivity_pct": 28.75 + }, "rows": 36, "filtered": 28.75, "attached_condition": "t1.b1 <= (subquery#2) and t1.pk1 + 1 = t2.pk2 + 2" @@ -2104,7 +2112,7 @@ test.t1 analyze status OK explain SELECT * FROM t1 WHERE a > 0 AND b=0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a,b b 5 const 128 Using where +1 SIMPLE t1 ref|filter a,b b|a 5|5 const 128 (14%) Using where; Using rowid filter SELECT * FROM t1 WHERE a > 0 AND b=0; a b 1 0 @@ -2439,19 +2447,32 @@ ANALYZE "r_total_time_ms": "REPLACED", "table": { "table_name": "t1", - "access_type": "range", + "access_type": "ref", "possible_keys": ["idx1", "idx2"], - "key": "idx1", - "key_length": "35", - "used_key_parts": ["nm"], + "key": "idx2", + "key_length": "5", + "used_key_parts": ["fl2"], + "ref": ["const"], + "rowid_filter": { + "range": { + "key": "idx1", + "used_key_parts": ["nm"] + }, + "rows": 44, + "selectivity_pct": 0.44, + "r_rows": 44, + "r_lookups": 1000, + "r_selectivity_pct": 0, + "r_buffer_size": "REPLACED", + "r_filling_time_ms": "REPLACED" + }, "r_loops": 1, - "rows": 44, - "r_rows": 44, + "rows": 921, + "r_rows": 0, "r_total_time_ms": "REPLACED", - "filtered": 9.21, - "r_filtered": 0, - "index_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'", - "attached_condition": "t1.fl2 = 0" + "filtered": 0.44, + "r_filtered": 100, + "attached_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'" } } } @@ -2484,19 +2505,31 @@ ANALYZE "r_total_time_ms": "REPLACED", "table": { "table_name": "t1", - "access_type": "range", + "access_type": "ref", "possible_keys": ["idx1", "idx2"], - "key": "idx1", - "key_length": "35", - "used_key_parts": ["nm"], + "key": "idx2", + "key_length": "5", + "used_key_parts": ["fl2"], + "ref": ["const"], + "rowid_filter": { + "range": { + "key": "idx1", + "used_key_parts": ["nm"] + }, + "rows": 44, + "selectivity_pct": 0.44, + "r_rows": 0, + "r_lookups": 0, + "r_selectivity_pct": 0, + "r_buffer_size": "REPLACED", + "r_filling_time_ms": "REPLACED" + }, "r_loops": 1, - "rows": 44, + "rows": 911, "r_rows": 0, - "r_total_time_ms": "REPLACED", - "filtered": 9.11, + "filtered": 0.44, "r_filtered": 100, - "index_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'", - "attached_condition": "t1.fl2 = 0" + "attached_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'" } } } @@ -2671,7 +2704,7 @@ count(*) 5 explain extended select count(*) from t1 where a between 21 and 30 and b=2; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ref b,a b 5 const 24 9.60 Using where +1 SIMPLE t1 ref|filter b,a b|a 5|5 const 24 (10%) 9.60 Using where; Using rowid filter Warnings: Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` between 21 and 30 select * from t1 where a between 21 and 30 and b=2; @@ -3133,7 +3166,7 @@ WHERE 1 = 1 AND domain = 'www.mailhost.i-dev.fr' AND timestamp >= DATE_ADD('2017-01-30 08:24:51', INTERVAL -1 MONTH) ORDER BY timestamp DESC; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ref ixEventWhoisDomainDomain,ixEventWhoisDomainTimestamp ixEventWhoisDomainDomain 98 const 40 33.33 Using index condition; Using where; Using filesort +1 SIMPLE t1 ref|filter ixEventWhoisDomainDomain,ixEventWhoisDomainTimestamp ixEventWhoisDomainDomain|ixEventWhoisDomainTimestamp 98|4 const 40 (33%) 33.33 Using index condition; Using where; Using filesort; Using rowid filter Warnings: Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`domain` AS `domain`,`test`.`t1`.`registrant_name` AS `registrant_name`,`test`.`t1`.`registrant_organization` AS `registrant_organization`,`test`.`t1`.`registrant_street1` AS `registrant_street1`,`test`.`t1`.`registrant_street2` AS `registrant_street2`,`test`.`t1`.`registrant_street3` AS `registrant_street3`,`test`.`t1`.`registrant_street4` AS `registrant_street4`,`test`.`t1`.`registrant_street5` AS `registrant_street5`,`test`.`t1`.`registrant_city` AS `registrant_city`,`test`.`t1`.`registrant_postal_code` AS `registrant_postal_code`,`test`.`t1`.`registrant_country` AS `registrant_country`,`test`.`t1`.`registrant_email` AS `registrant_email`,`test`.`t1`.`registrant_telephone` AS `registrant_telephone`,`test`.`t1`.`administrative_name` AS `administrative_name`,`test`.`t1`.`administrative_organization` AS `administrative_organization`,`test`.`t1`.`administrative_street1` AS `administrative_street1`,`test`.`t1`.`administrative_street2` AS `administrative_street2`,`test`.`t1`.`administrative_street3` AS `administrative_street3`,`test`.`t1`.`administrative_street4` AS `administrative_street4`,`test`.`t1`.`administrative_street5` AS `administrative_street5`,`test`.`t1`.`administrative_city` AS `administrative_city`,`test`.`t1`.`administrative_postal_code` AS `administrative_postal_code`,`test`.`t1`.`administrative_country` AS `administrative_country`,`test`.`t1`.`administrative_email` AS `administrative_email`,`test`.`t1`.`administrative_telephone` AS `administrative_telephone`,`test`.`t1`.`technical_name` AS `technical_name`,`test`.`t1`.`technical_organization` AS `technical_organization`,`test`.`t1`.`technical_street1` AS `technical_street1`,`test`.`t1`.`technical_street2` AS `technical_street2`,`test`.`t1`.`technical_street3` AS `technical_street3`,`test`.`t1`.`technical_street4` AS `technical_street4`,`test`.`t1`.`technical_street5` AS `technical_street5`,`test`.`t1`.`technical_city` AS `technical_city`,`test`.`t1`.`technical_postal_code` AS `technical_postal_code`,`test`.`t1`.`technical_country` AS `technical_country`,`test`.`t1`.`technical_email` AS `technical_email`,`test`.`t1`.`technical_telephone` AS `technical_telephone`,`test`.`t1`.`json` AS `json`,`test`.`t1`.`timestamp` AS `timestamp` from `test`.`t1` where `test`.`t1`.`domain` = 'www.mailhost.i-dev.fr' and `test`.`t1`.`timestamp` >= ('2017-01-30 08:24:51' + interval -1 month) order by `test`.`t1`.`timestamp` desc SET optimizer_switch=@save_optimizer_switch; @@ -3382,7 +3415,7 @@ fi.fh in (6311439873746261694,-397087483897438286, id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t index_merge PRIMARY,acli_rid,acli_tp acli_tp,acli_rid 2,767 NULL 2 100.00 Using intersect(acli_tp,acli_rid); Using where; Using index 1 SIMPLE a ref PRIMARY,acei_aclid acei_aclid 8 test.t.id 1 100.00 Using where -1 SIMPLE fi ref filt_aceid,filt_fh filt_aceid 8 test.a.id 24 14.46 Using where +1 SIMPLE fi ref|filter filt_aceid,filt_fh filt_aceid|filt_fh 8|8 test.a.id 24 (14%) 14.46 Using where; Using rowid filter Warnings: Note 1003 select `test`.`t`.`id` AS `id`,`test`.`fi`.`id` AS `id`,`test`.`fi`.`aceid` AS `aceid`,`test`.`fi`.`clid` AS `clid`,`test`.`fi`.`fh` AS `fh` from `test`.`acli` `t` join `test`.`acei` `a` join `test`.`filt` `fi` where `test`.`t`.`tp` = 121 and `test`.`a`.`atp` = 1 and `test`.`fi`.`aceid` = `test`.`a`.`id` and `test`.`a`.`aclid` = `test`.`t`.`id` and `test`.`t`.`rid` = 'B5FCC8C7111E4E3CBC21AAF5012F59C2' and `test`.`fi`.`fh` in (6311439873746261694,-397087483897438286,8518228073041491534,-5420422472375069774) set statement optimizer_switch='rowid_filter=on' for select t.id, fi.* @@ -3498,7 +3531,7 @@ fi.fh in (6311439873746261694,-397087483897438286, id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t index_merge PRIMARY,acli_rid,acli_tp acli_tp,acli_rid 2,767 NULL 2 100.00 Using intersect(acli_tp,acli_rid); Using where; Using index 1 SIMPLE a ref PRIMARY,acei_aclid acei_aclid 8 test.t.id 1 100.00 Using where; Using join buffer (flat, BKA join); Rowid-ordered scan -1 SIMPLE fi ref filt_aceid,filt_fh filt_aceid 8 test.a.id 24 14.46 Using where; Using join buffer (incremental, BKA join); Rowid-ordered scan +1 SIMPLE fi ref|filter filt_aceid,filt_fh filt_aceid|filt_fh 8|8 test.a.id 24 (14%) 14.46 Using where; Using join buffer (incremental, BKA join); Rowid-ordered scan; Using rowid filter Warnings: Note 1003 select `test`.`t`.`id` AS `id`,`test`.`fi`.`id` AS `id`,`test`.`fi`.`aceid` AS `aceid`,`test`.`fi`.`clid` AS `clid`,`test`.`fi`.`fh` AS `fh` from `test`.`acli` `t` join `test`.`acei` `a` join `test`.`filt` `fi` where `test`.`t`.`tp` = 121 and `test`.`a`.`atp` = 1 and `test`.`fi`.`aceid` = `test`.`a`.`id` and `test`.`a`.`aclid` = `test`.`t`.`id` and `test`.`t`.`rid` = 'B5FCC8C7111E4E3CBC21AAF5012F59C2' and `test`.`fi`.`fh` in (6311439873746261694,-397087483897438286,8518228073041491534,-5420422472375069774) set statement optimizer_switch='rowid_filter=on' for select t.id, fi.* @@ -3616,9 +3649,22 @@ ANALYZE "key_length": "8", "used_key_parts": ["aceid"], "ref": ["test.a.id"], + "rowid_filter": { + "range": { + "key": "filt_fh", + "used_key_parts": ["fh"] + }, + "rows": 81, + "selectivity_pct": 14.464, + "r_rows": 80, + "r_lookups": 80, + "r_selectivity_pct": 40, + "r_buffer_size": "REPLACED", + "r_filling_time_ms": "REPLACED" + }, "r_loops": 1, "rows": 24, - "r_rows": 80, + "r_rows": 32, "r_total_time_ms": "REPLACED", "filtered": 14.464, "r_filtered": 100 @@ -3628,7 +3674,7 @@ ANALYZE "join_type": "BKA", "mrr_type": "Rowid-ordered scan", "attached_condition": "fi.fh in (6311439873746261694,-397087483897438286,8518228073041491534,-5420422472375069774)", - "r_filtered": 40 + "r_filtered": 100 } } } @@ -3732,7 +3778,7 @@ WHERE t1.c1 NOT IN (SELECT t2.c1 FROM t2, t1 AS a1 WHERE t2.i1 = t1.pk AND t2.i1 BETWEEN 3 AND 5); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 60 100.00 Using where -2 DEPENDENT SUBQUERY t2 ref c1,i1 i1 5 test.t1.pk 20 100.00 Using index condition; Using where +2 DEPENDENT SUBQUERY t2 ref|filter c1,i1 c1|i1 3|5 func 38 (25%) 25.00 Using where; Full scan on NULL key; Using rowid filter 2 DEPENDENT SUBQUERY a1 ALL NULL NULL NULL NULL 60 100.00 Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1 diff --git a/mysql-test/main/select.result b/mysql-test/main/select.result index fc3a29094ae..6652b1a6375 100644 --- a/mysql-test/main/select.result +++ b/mysql-test/main/select.result @@ -3744,7 +3744,7 @@ 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 type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where +1 SIMPLE t1 ref|filter idx1,idx2 idx1|idx2 5|4 const 2 (1%) Using index condition; Using where; Using rowid filter DROP TABLE t1; 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"); diff --git a/mysql-test/main/select_jcl6.result b/mysql-test/main/select_jcl6.result index e7c2e3e4807..cef6e0fcf2a 100644 --- a/mysql-test/main/select_jcl6.result +++ b/mysql-test/main/select_jcl6.result @@ -3755,7 +3755,7 @@ 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 type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where +1 SIMPLE t1 ref|filter idx1,idx2 idx1|idx2 5|4 const 2 (1%) Using index condition; Using where; Using rowid filter DROP TABLE t1; 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"); diff --git a/mysql-test/main/select_pkeycache.result b/mysql-test/main/select_pkeycache.result index fc3a29094ae..6652b1a6375 100644 --- a/mysql-test/main/select_pkeycache.result +++ b/mysql-test/main/select_pkeycache.result @@ -3744,7 +3744,7 @@ 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 type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where +1 SIMPLE t1 ref|filter idx1,idx2 idx1|idx2 5|4 const 2 (1%) Using index condition; Using where; Using rowid filter DROP TABLE t1; 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"); diff --git a/mysql-test/main/selectivity.result b/mysql-test/main/selectivity.result index 4113779a11e..7e3202337ec 100644 --- a/mysql-test/main/selectivity.result +++ b/mysql-test/main/selectivity.result @@ -1661,7 +1661,7 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` # gives selectivity data explain extended select * from t1 where a in (17,51,5) and b=2; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ref b,a b 5 const 58 2.90 Using where +1 SIMPLE t1 ref|filter b,a b|a 5|5 const 58 (3%) 2.90 Using where; Using rowid filter Warnings: Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` in (17,51,5) drop table t1; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 0f8ead46ffc..4bdfb659513 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7557,7 +7557,6 @@ best_access_path(JOIN *join, rec= MATCHING_ROWS_IN_OTHER_TABLE; // Fix for small tables Json_writer_object trace_access_idx(thd); - double eq_ref_rows= 0; /* full text keys require special treatment */ @@ -7596,8 +7595,7 @@ best_access_path(JOIN *join, type= JT_EQ_REF; trace_access_idx.add("access_type", join_type_str[type]) .add("index", keyinfo->name); - eq_ref_rows= tmp = prev_record_reads(join_positions, idx, - found_ref); + tmp = prev_record_reads(join_positions, idx, found_ref); records=1.0; } else @@ -7904,28 +7902,7 @@ best_access_path(JOIN *join, (s->table->file->index_flags(start_key->key,0,1) & HA_DO_RANGE_FILTER_PUSHDOWN)) { - double rows; - if (type == JT_EQ_REF) - { - /* - Treat EQ_REF access in a special way: - 1. We have no cost for index-only read. Assume its cost is 50% of - the cost of the full read. - - 2. A regular ref access will do #record_count lookups, but eq_ref - has "lookup cache" which reduces the number of lookups made. - The estimation code uses prev_record_reads() call to estimate: - - tmp = prev_record_reads(join_positions, idx, found_ref); - - Set the effective number of rows from "tmp" here. - */ - keyread_tmp= COST_ADD(eq_ref_rows / 2, s->startup_cost); - rows= eq_ref_rows; - } - else - rows= record_count * records; - + double rows= record_count * records; /* If we use filter F with selectivity s the the cost of fetching data by key using this filter will be @@ -7947,46 +7924,53 @@ best_access_path(JOIN *join, cost_of_fetching_1_row = tmp/rows cost_of_fetching_1_key_tuple = keyread_tmp/rows - access_cost_factor is the gain we expect for using rowid filter. - An access_cost_factor of 1.0 means that keyread_tmp is 0 - (using key read is infinitely fast) and the gain for each row when - using filter is great. - An access_cost_factor if 0.0 means that using keyread has the - same cost as reading rows, so there is no gain to get with - filter. - access_cost_factor should never be bigger than 1.0 (if all - calculations are correct) as the cost of keyread should always be - smaller than the cost of fetching the same number of keys + rows. - access_cost_factor should also never be smaller than 0.0. - The one exception is if number of records is 1 (eq_ref), then - because we are comparing rows to cost of keyread_tmp, keyread_tmp - is higher by 1.0. This is a big that will be fixed in a later - version. + Here's a more detailed explanation that uses the formulas behind + the function the call filter->get_adjusted_gain(). The function + takes as a parameter the number of probes/look-ups into the filter + that is equal to the number of fetched key entries that is equal to + the number of row fetches when no filter is used (assuming no + index condition pushdown is employed for the used key access). + Let this number be N. Then the total gain from using the filter is + N*a_adj - b where b is the cost of building the filter and + a_adj is calcilated as follows: + a - (1-access_cost_factor)*(1-s) = + (1+1_cond_eval_cost)*(1-s)-1_probe_cost - (1-access_cost_factor)*(1-s) + = (1-s)*(1_cond_eval_cost+access_cost_factor) - 1_probe_cost. + Here ((1-s)*(1_cond_eval_cost) * N is the gain from checking less + conditions pushed into the table, 1_probe_cost*N is the cost of the + probes and (1*s) * access_cost_factor * N must be the gain from + accessing less rows. + It does not matter how we calculate the cost of N full row fetches + cost_of_fetching_N_rows or + how we calculate the cost of fetching N key entries + cost_of_fetching_N_key_entries + the gain from less row fetches will be + (cost_of_fetching_N_rows - cost_of_fetching_N_key_entries) * (1-s) + and this should be equal to (1*s) * access_cost_factor * N. + Thus access_cost_factor must be calculated as + (cost_of_fetching_N_rows - cost_of_fetching_N_key_entries) / N. - If we have limited the cost (=tmp) of reading rows with 'worst_seek' - we cannot use filters as the cost calculation below would cause - tmp to become negative. The future resultion is to not limit - cost with worst_seek. + For safety we clip cost_of_fetching_N_key_entries by the value + of cost_of_fetching_N_row though formally it's not necessary. */ - double access_cost_factor= MY_MIN((rows - keyread_tmp) / rows, 1.0); - if (!(records < s->worst_seeks && - records <= thd->variables.max_seeks_for_key)) - trace_access_idx.add("rowid_filter_skipped", "worst/max seeks clipping"); - else if (access_cost_factor <= 0.0) - trace_access_idx.add("rowid_filter_skipped", "cost_factor <= 0"); - else + /* + For eq_ref access we assume that the cost of fetching N key entries + is equal to the half of fetching N rows + */ + double key_access_cost= + type == JT_EQ_REF ? 0.5 * tmp : MY_MIN(tmp, keyread_tmp); + double access_cost_factor= MY_MIN((tmp - key_access_cost) / rows, 1.0); + + filter= + table->best_range_rowid_filter_for_partial_join(start_key->key, + rows, + access_cost_factor); + if (filter) { - filter= - table->best_range_rowid_filter_for_partial_join(start_key->key, - rows, - access_cost_factor); - if (filter) - { - tmp-= filter->get_adjusted_gain(rows) - filter->get_cmp_gain(rows); - DBUG_ASSERT(tmp >= 0); - trace_access_idx.add("rowid_filter_key", + tmp-= filter->get_adjusted_gain(rows) - filter->get_cmp_gain(rows); + DBUG_ASSERT(tmp >= 0); + trace_access_idx.add("rowid_filter_key", s->table->key_info[filter->key_no].name); - } } } trace_access_idx.add("rows", records).add("cost", tmp); @@ -8139,19 +8123,19 @@ best_access_path(JOIN *join, uint key_no= s->quick->index; /* See the comment concerning using rowid filter for with ref access */ - keyread_tmp= s->table->quick_index_only_costs[key_no] * record_count; - double access_cost_factor= MY_MIN((rows - keyread_tmp) / rows, 1.0); - if (access_cost_factor > 0.0) + double row_access_cost= s->quick->read_time * record_count; + double key_access_cost= + MY_MIN(row_access_cost, + s->table->quick_index_only_costs[key_no] * record_count); + double access_cost_factor= MY_MIN((row_access_cost - key_access_cost) / + rows, 1.0); + filter= + s->table->best_range_rowid_filter_for_partial_join(key_no, rows, + access_cost_factor); + if (filter) { - filter= - s->table-> - best_range_rowid_filter_for_partial_join(key_no, rows, - access_cost_factor); - if (filter) - { - tmp-= filter->get_adjusted_gain(rows); - DBUG_ASSERT(tmp >= 0); - } + tmp-= filter->get_adjusted_gain(rows); + DBUG_ASSERT(tmp >= 0); } else trace_access_scan.add("rowid_filter_skipped", "cost_factor <= 0"); From 2e6872791af2aab48490c24279ca3e24b64e377c Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Thu, 2 Feb 2023 17:12:39 +0200 Subject: [PATCH 014/260] MDEV-30218: Incorrect optimization for rowid_filtering, correction Final corrections: - Remove incorrect tracing, "rowid_filter_skipped" - Put the worst_seeks sanity check back --- mysql-test/main/join_nested_jcl6.result | 2 +- mysql-test/main/opt_trace.result | 4 +- mysql-test/main/range.result | 2 +- mysql-test/main/rowid_filter.result | 75 +++++---------- mysql-test/main/rowid_filter_innodb.result | 102 ++++++--------------- mysql-test/main/selectivity.result | 2 +- sql/sql_select.cc | 20 ++-- 7 files changed, 68 insertions(+), 139 deletions(-) diff --git a/mysql-test/main/join_nested_jcl6.result b/mysql-test/main/join_nested_jcl6.result index 91fe367c378..7226a5d62b1 100644 --- a/mysql-test/main/join_nested_jcl6.result +++ b/mysql-test/main/join_nested_jcl6.result @@ -2085,7 +2085,7 @@ ON t6.b >= 2 AND t5.b=t7.b AND (t8.a > 0 OR t8.c IS NULL) AND t6.a>0 AND t7.a>0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t5 ALL NULL NULL NULL NULL 3 -1 SIMPLE t7 ref|filter PRIMARY,b_i b_i|PRIMARY 5|4 test.t5.b 2 (29%) Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan; Using rowid filter +1 SIMPLE t7 ref PRIMARY,b_i b_i 5 test.t5.b 2 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan 1 SIMPLE t6 range PRIMARY,b_i PRIMARY 4 NULL 3 Using where; Rowid-ordered scan; Using join buffer (incremental, BNL join) 1 SIMPLE t8 ref b_i b_i 5 test.t5.b 2 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan SELECT t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b diff --git a/mysql-test/main/opt_trace.result b/mysql-test/main/opt_trace.result index 92cd3eb7848..a97d0074d24 100644 --- a/mysql-test/main/opt_trace.result +++ b/mysql-test/main/opt_trace.result @@ -2118,6 +2118,7 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 { "access_type": "ref", "index": "a_c", "used_range_estimates": true, + "rowid_filter_skipped": "worst/max seeks clipping", "rows": 180, "cost": 92, "chosen": true @@ -3968,7 +3969,6 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "best_access_path": { "considered_access_paths": [ { - "rowid_filter_skipped": "cost_factor <= 0", "access_type": "range", "resulting_rows": 3, "cost": 1.407, @@ -4024,7 +4024,6 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "best_access_path": { "considered_access_paths": [ { - "rowid_filter_skipped": "cost_factor <= 0", "access_type": "range", "resulting_rows": 3, "cost": 1.407, @@ -4051,6 +4050,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "index": "a", "used_range_estimates": false, "cause": "not better than ref estimates", + "rowid_filter_skipped": "worst/max seeks clipping", "rows": 2, "cost": 3.014, "chosen": true diff --git a/mysql-test/main/range.result b/mysql-test/main/range.result index 0e728d76a3e..a3ce10fe38a 100644 --- a/mysql-test/main/range.result +++ b/mysql-test/main/range.result @@ -281,7 +281,7 @@ INSERT INTO t1 VALUES (33,5),(33,5),(33,5),(33,5),(34,5),(35,5); EXPLAIN SELECT * FROM t1 WHERE a IN(1,2) AND b=5; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref|filter a,b b|a 5|5 const 15 (5%) Using where; Using rowid filter +1 SIMPLE t1 range a,b a 5 NULL 2 Using index condition; Using where SELECT * FROM t1 WHERE a IN(1,2) AND b=5; a b DROP TABLE t1; diff --git a/mysql-test/main/rowid_filter.result b/mysql-test/main/rowid_filter.result index efe1fe16283..2cd45748675 100644 --- a/mysql-test/main/rowid_filter.result +++ b/mysql-test/main/rowid_filter.result @@ -2072,7 +2072,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 INNER JOIN t2 ON ( pk1+1 = pk2+2 AND a1 = a2 ) WHERE b1 <= ( SELECT MAX(b2) FROM t2 WHERE pk2 <= 1 ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 101 100.00 Using where -1 PRIMARY t1 ref|filter a1,b1 a1|b1 5|4 test.t2.a2 36 (29%) 28.75 Using where; Using rowid filter +1 PRIMARY t1 ref a1,b1 a1 5 test.t2.a2 36 28.75 Using where 2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 100.00 Using index condition Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`pk2` AS `pk2`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a1` = `test`.`t2`.`a2` and `test`.`t1`.`b1` <= (/* select#2 */ select max(`test`.`t2`.`b2`) from `test`.`t2` where `test`.`t2`.`pk2` <= 1) and `test`.`t1`.`pk1` + 1 = `test`.`t2`.`pk2` + 2 @@ -2097,14 +2097,6 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a1"], "ref": ["test.t2.a2"], - "rowid_filter": { - "range": { - "key": "b1", - "used_key_parts": ["b1"] - }, - "rows": 115, - "selectivity_pct": 28.75 - }, "rows": 36, "filtered": 28.75, "attached_condition": "t1.b1 <= (subquery#2) and t1.pk1 + 1 = t2.pk2 + 2" @@ -2187,7 +2179,7 @@ test.t1 analyze status OK explain SELECT * FROM t1 WHERE a > 0 AND b=0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref|filter a,b b|a 5|5 const 151 (17%) Using where; Using rowid filter +1 SIMPLE t1 ref a,b b 5 const 151 Using where SELECT * FROM t1 WHERE a > 0 AND b=0; a b 1 0 @@ -2522,32 +2514,19 @@ ANALYZE "r_total_time_ms": "REPLACED", "table": { "table_name": "t1", - "access_type": "ref", + "access_type": "range", "possible_keys": ["idx1", "idx2"], - "key": "idx2", - "key_length": "5", - "used_key_parts": ["fl2"], - "ref": ["const"], - "rowid_filter": { - "range": { - "key": "idx1", - "used_key_parts": ["nm"] - }, - "rows": 44, - "selectivity_pct": 0.44, - "r_rows": 44, - "r_lookups": 1000, - "r_selectivity_pct": 0, - "r_buffer_size": "REPLACED", - "r_filling_time_ms": "REPLACED" - }, + "key": "idx1", + "key_length": "35", + "used_key_parts": ["nm"], "r_loops": 1, - "rows": 921, - "r_rows": 0, + "rows": 44, + "r_rows": 44, "r_total_time_ms": "REPLACED", - "filtered": 0.44, - "r_filtered": 100, - "attached_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'" + "filtered": 9.21, + "r_filtered": 0, + "index_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'", + "attached_condition": "t1.fl2 = 0" } } } @@ -2580,31 +2559,19 @@ ANALYZE "r_total_time_ms": "REPLACED", "table": { "table_name": "t1", - "access_type": "ref", + "access_type": "range", "possible_keys": ["idx1", "idx2"], - "key": "idx2", - "key_length": "5", - "used_key_parts": ["fl2"], - "ref": ["const"], - "rowid_filter": { - "range": { - "key": "idx1", - "used_key_parts": ["nm"] - }, - "rows": 44, - "selectivity_pct": 0.44, - "r_rows": 0, - "r_lookups": 0, - "r_selectivity_pct": 0, - "r_buffer_size": "REPLACED", - "r_filling_time_ms": "REPLACED" - }, + "key": "idx1", + "key_length": "35", + "used_key_parts": ["nm"], "r_loops": 1, - "rows": 911, + "rows": 44, "r_rows": 0, - "filtered": 0.44, + "r_total_time_ms": "REPLACED", + "filtered": 9.11, "r_filtered": 100, - "attached_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'" + "index_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'", + "attached_condition": "t1.fl2 = 0" } } } diff --git a/mysql-test/main/rowid_filter_innodb.result b/mysql-test/main/rowid_filter_innodb.result index d7f1fe4a0d3..1bf63d9a378 100644 --- a/mysql-test/main/rowid_filter_innodb.result +++ b/mysql-test/main/rowid_filter_innodb.result @@ -1997,7 +1997,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 INNER JOIN t2 ON ( pk1+1 = pk2+2 AND a1 = a2 ) WHERE b1 <= ( SELECT MAX(b2) FROM t2 WHERE pk2 <= 1 ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 101 100.00 Using where -1 PRIMARY t1 ref|filter a1,b1 a1|b1 5|4 test.t2.a2 36 (29%) 28.75 Using where; Using rowid filter +1 PRIMARY t1 ref a1,b1 a1 5 test.t2.a2 36 28.75 Using where 2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 100.00 Using index condition Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`pk2` AS `pk2`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a1` = `test`.`t2`.`a2` and `test`.`t1`.`b1` <= (/* select#2 */ select max(`test`.`t2`.`b2`) from `test`.`t2` where `test`.`t2`.`pk2` <= 1) and `test`.`t1`.`pk1` + 1 = `test`.`t2`.`pk2` + 2 @@ -2022,14 +2022,6 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a1"], "ref": ["test.t2.a2"], - "rowid_filter": { - "range": { - "key": "b1", - "used_key_parts": ["b1"] - }, - "rows": 115, - "selectivity_pct": 28.75 - }, "rows": 36, "filtered": 28.75, "attached_condition": "t1.b1 <= (subquery#2) and t1.pk1 + 1 = t2.pk2 + 2" @@ -2112,7 +2104,7 @@ test.t1 analyze status OK explain SELECT * FROM t1 WHERE a > 0 AND b=0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref|filter a,b b|a 5|5 const 128 (14%) Using where; Using rowid filter +1 SIMPLE t1 ref a,b b 5 const 128 Using where SELECT * FROM t1 WHERE a > 0 AND b=0; a b 1 0 @@ -2447,32 +2439,19 @@ ANALYZE "r_total_time_ms": "REPLACED", "table": { "table_name": "t1", - "access_type": "ref", + "access_type": "range", "possible_keys": ["idx1", "idx2"], - "key": "idx2", - "key_length": "5", - "used_key_parts": ["fl2"], - "ref": ["const"], - "rowid_filter": { - "range": { - "key": "idx1", - "used_key_parts": ["nm"] - }, - "rows": 44, - "selectivity_pct": 0.44, - "r_rows": 44, - "r_lookups": 1000, - "r_selectivity_pct": 0, - "r_buffer_size": "REPLACED", - "r_filling_time_ms": "REPLACED" - }, + "key": "idx1", + "key_length": "35", + "used_key_parts": ["nm"], "r_loops": 1, - "rows": 921, - "r_rows": 0, + "rows": 44, + "r_rows": 44, "r_total_time_ms": "REPLACED", - "filtered": 0.44, - "r_filtered": 100, - "attached_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'" + "filtered": 9.21, + "r_filtered": 0, + "index_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'", + "attached_condition": "t1.fl2 = 0" } } } @@ -2505,31 +2484,19 @@ ANALYZE "r_total_time_ms": "REPLACED", "table": { "table_name": "t1", - "access_type": "ref", + "access_type": "range", "possible_keys": ["idx1", "idx2"], - "key": "idx2", - "key_length": "5", - "used_key_parts": ["fl2"], - "ref": ["const"], - "rowid_filter": { - "range": { - "key": "idx1", - "used_key_parts": ["nm"] - }, - "rows": 44, - "selectivity_pct": 0.44, - "r_rows": 0, - "r_lookups": 0, - "r_selectivity_pct": 0, - "r_buffer_size": "REPLACED", - "r_filling_time_ms": "REPLACED" - }, + "key": "idx1", + "key_length": "35", + "used_key_parts": ["nm"], "r_loops": 1, - "rows": 911, + "rows": 44, "r_rows": 0, - "filtered": 0.44, + "r_total_time_ms": "REPLACED", + "filtered": 9.11, "r_filtered": 100, - "attached_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'" + "index_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'", + "attached_condition": "t1.fl2 = 0" } } } @@ -2704,7 +2671,7 @@ count(*) 5 explain extended select count(*) from t1 where a between 21 and 30 and b=2; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ref|filter b,a b|a 5|5 const 24 (10%) 9.60 Using where; Using rowid filter +1 SIMPLE t1 ref b,a b 5 const 24 9.60 Using where Warnings: Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` between 21 and 30 select * from t1 where a between 21 and 30 and b=2; @@ -3166,7 +3133,7 @@ WHERE 1 = 1 AND domain = 'www.mailhost.i-dev.fr' AND timestamp >= DATE_ADD('2017-01-30 08:24:51', INTERVAL -1 MONTH) ORDER BY timestamp DESC; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ref|filter ixEventWhoisDomainDomain,ixEventWhoisDomainTimestamp ixEventWhoisDomainDomain|ixEventWhoisDomainTimestamp 98|4 const 40 (33%) 33.33 Using index condition; Using where; Using filesort; Using rowid filter +1 SIMPLE t1 ref ixEventWhoisDomainDomain,ixEventWhoisDomainTimestamp ixEventWhoisDomainDomain 98 const 40 33.33 Using index condition; Using where; Using filesort Warnings: Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`domain` AS `domain`,`test`.`t1`.`registrant_name` AS `registrant_name`,`test`.`t1`.`registrant_organization` AS `registrant_organization`,`test`.`t1`.`registrant_street1` AS `registrant_street1`,`test`.`t1`.`registrant_street2` AS `registrant_street2`,`test`.`t1`.`registrant_street3` AS `registrant_street3`,`test`.`t1`.`registrant_street4` AS `registrant_street4`,`test`.`t1`.`registrant_street5` AS `registrant_street5`,`test`.`t1`.`registrant_city` AS `registrant_city`,`test`.`t1`.`registrant_postal_code` AS `registrant_postal_code`,`test`.`t1`.`registrant_country` AS `registrant_country`,`test`.`t1`.`registrant_email` AS `registrant_email`,`test`.`t1`.`registrant_telephone` AS `registrant_telephone`,`test`.`t1`.`administrative_name` AS `administrative_name`,`test`.`t1`.`administrative_organization` AS `administrative_organization`,`test`.`t1`.`administrative_street1` AS `administrative_street1`,`test`.`t1`.`administrative_street2` AS `administrative_street2`,`test`.`t1`.`administrative_street3` AS `administrative_street3`,`test`.`t1`.`administrative_street4` AS `administrative_street4`,`test`.`t1`.`administrative_street5` AS `administrative_street5`,`test`.`t1`.`administrative_city` AS `administrative_city`,`test`.`t1`.`administrative_postal_code` AS `administrative_postal_code`,`test`.`t1`.`administrative_country` AS `administrative_country`,`test`.`t1`.`administrative_email` AS `administrative_email`,`test`.`t1`.`administrative_telephone` AS `administrative_telephone`,`test`.`t1`.`technical_name` AS `technical_name`,`test`.`t1`.`technical_organization` AS `technical_organization`,`test`.`t1`.`technical_street1` AS `technical_street1`,`test`.`t1`.`technical_street2` AS `technical_street2`,`test`.`t1`.`technical_street3` AS `technical_street3`,`test`.`t1`.`technical_street4` AS `technical_street4`,`test`.`t1`.`technical_street5` AS `technical_street5`,`test`.`t1`.`technical_city` AS `technical_city`,`test`.`t1`.`technical_postal_code` AS `technical_postal_code`,`test`.`t1`.`technical_country` AS `technical_country`,`test`.`t1`.`technical_email` AS `technical_email`,`test`.`t1`.`technical_telephone` AS `technical_telephone`,`test`.`t1`.`json` AS `json`,`test`.`t1`.`timestamp` AS `timestamp` from `test`.`t1` where `test`.`t1`.`domain` = 'www.mailhost.i-dev.fr' and `test`.`t1`.`timestamp` >= ('2017-01-30 08:24:51' + interval -1 month) order by `test`.`t1`.`timestamp` desc SET optimizer_switch=@save_optimizer_switch; @@ -3415,7 +3382,7 @@ fi.fh in (6311439873746261694,-397087483897438286, id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t index_merge PRIMARY,acli_rid,acli_tp acli_tp,acli_rid 2,767 NULL 2 100.00 Using intersect(acli_tp,acli_rid); Using where; Using index 1 SIMPLE a ref PRIMARY,acei_aclid acei_aclid 8 test.t.id 1 100.00 Using where -1 SIMPLE fi ref|filter filt_aceid,filt_fh filt_aceid|filt_fh 8|8 test.a.id 24 (14%) 14.46 Using where; Using rowid filter +1 SIMPLE fi ref filt_aceid,filt_fh filt_aceid 8 test.a.id 24 14.46 Using where Warnings: Note 1003 select `test`.`t`.`id` AS `id`,`test`.`fi`.`id` AS `id`,`test`.`fi`.`aceid` AS `aceid`,`test`.`fi`.`clid` AS `clid`,`test`.`fi`.`fh` AS `fh` from `test`.`acli` `t` join `test`.`acei` `a` join `test`.`filt` `fi` where `test`.`t`.`tp` = 121 and `test`.`a`.`atp` = 1 and `test`.`fi`.`aceid` = `test`.`a`.`id` and `test`.`a`.`aclid` = `test`.`t`.`id` and `test`.`t`.`rid` = 'B5FCC8C7111E4E3CBC21AAF5012F59C2' and `test`.`fi`.`fh` in (6311439873746261694,-397087483897438286,8518228073041491534,-5420422472375069774) set statement optimizer_switch='rowid_filter=on' for select t.id, fi.* @@ -3531,7 +3498,7 @@ fi.fh in (6311439873746261694,-397087483897438286, id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t index_merge PRIMARY,acli_rid,acli_tp acli_tp,acli_rid 2,767 NULL 2 100.00 Using intersect(acli_tp,acli_rid); Using where; Using index 1 SIMPLE a ref PRIMARY,acei_aclid acei_aclid 8 test.t.id 1 100.00 Using where; Using join buffer (flat, BKA join); Rowid-ordered scan -1 SIMPLE fi ref|filter filt_aceid,filt_fh filt_aceid|filt_fh 8|8 test.a.id 24 (14%) 14.46 Using where; Using join buffer (incremental, BKA join); Rowid-ordered scan; Using rowid filter +1 SIMPLE fi ref filt_aceid,filt_fh filt_aceid 8 test.a.id 24 14.46 Using where; Using join buffer (incremental, BKA join); Rowid-ordered scan Warnings: Note 1003 select `test`.`t`.`id` AS `id`,`test`.`fi`.`id` AS `id`,`test`.`fi`.`aceid` AS `aceid`,`test`.`fi`.`clid` AS `clid`,`test`.`fi`.`fh` AS `fh` from `test`.`acli` `t` join `test`.`acei` `a` join `test`.`filt` `fi` where `test`.`t`.`tp` = 121 and `test`.`a`.`atp` = 1 and `test`.`fi`.`aceid` = `test`.`a`.`id` and `test`.`a`.`aclid` = `test`.`t`.`id` and `test`.`t`.`rid` = 'B5FCC8C7111E4E3CBC21AAF5012F59C2' and `test`.`fi`.`fh` in (6311439873746261694,-397087483897438286,8518228073041491534,-5420422472375069774) set statement optimizer_switch='rowid_filter=on' for select t.id, fi.* @@ -3649,22 +3616,9 @@ ANALYZE "key_length": "8", "used_key_parts": ["aceid"], "ref": ["test.a.id"], - "rowid_filter": { - "range": { - "key": "filt_fh", - "used_key_parts": ["fh"] - }, - "rows": 81, - "selectivity_pct": 14.464, - "r_rows": 80, - "r_lookups": 80, - "r_selectivity_pct": 40, - "r_buffer_size": "REPLACED", - "r_filling_time_ms": "REPLACED" - }, "r_loops": 1, "rows": 24, - "r_rows": 32, + "r_rows": 80, "r_total_time_ms": "REPLACED", "filtered": 14.464, "r_filtered": 100 @@ -3674,7 +3628,7 @@ ANALYZE "join_type": "BKA", "mrr_type": "Rowid-ordered scan", "attached_condition": "fi.fh in (6311439873746261694,-397087483897438286,8518228073041491534,-5420422472375069774)", - "r_filtered": 100 + "r_filtered": 40 } } } @@ -3778,7 +3732,7 @@ WHERE t1.c1 NOT IN (SELECT t2.c1 FROM t2, t1 AS a1 WHERE t2.i1 = t1.pk AND t2.i1 BETWEEN 3 AND 5); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 60 100.00 Using where -2 DEPENDENT SUBQUERY t2 ref|filter c1,i1 c1|i1 3|5 func 38 (25%) 25.00 Using where; Full scan on NULL key; Using rowid filter +2 DEPENDENT SUBQUERY t2 ref c1,i1 i1 5 test.t1.pk 20 100.00 Using index condition; Using where 2 DEPENDENT SUBQUERY a1 ALL NULL NULL NULL NULL 60 100.00 Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1 diff --git a/mysql-test/main/selectivity.result b/mysql-test/main/selectivity.result index 7e3202337ec..0b922609916 100644 --- a/mysql-test/main/selectivity.result +++ b/mysql-test/main/selectivity.result @@ -1661,7 +1661,7 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` # gives selectivity data explain extended select * from t1 where a in (17,51,5) and b=2; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ref|filter b,a b|a 5|5 const 58 (3%) 2.90 Using where; Using rowid filter +1 SIMPLE t1 range|filter b,a a|b 5|5 NULL 29 (6%) 5.80 Using index condition; Using where; Using rowid filter Warnings: Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` in (17,51,5) drop table t1; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 4bdfb659513..3f02d21ad0b 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7961,10 +7961,20 @@ best_access_path(JOIN *join, type == JT_EQ_REF ? 0.5 * tmp : MY_MIN(tmp, keyread_tmp); double access_cost_factor= MY_MIN((tmp - key_access_cost) / rows, 1.0); - filter= - table->best_range_rowid_filter_for_partial_join(start_key->key, - rows, - access_cost_factor); + if (!(records < s->worst_seeks && + records <= thd->variables.max_seeks_for_key)) + { + // Don't use rowid filter + trace_access_idx.add("rowid_filter_skipped", "worst/max seeks clipping"); + filter= NULL; + } + else + { + filter= + table->best_range_rowid_filter_for_partial_join(start_key->key, + rows, + access_cost_factor); + } if (filter) { tmp-= filter->get_adjusted_gain(rows) - filter->get_cmp_gain(rows); @@ -8137,8 +8147,6 @@ best_access_path(JOIN *join, tmp-= filter->get_adjusted_gain(rows); DBUG_ASSERT(tmp >= 0); } - else - trace_access_scan.add("rowid_filter_skipped", "cost_factor <= 0"); type= JT_RANGE; } From 702d1af32c563146d2c2d1bef1a5c53bb9644a7b Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Wed, 15 Feb 2023 01:18:26 +0530 Subject: [PATCH 015/260] MDEV-30615 Can't read from I_S.INNODB_SYS_INDEXES when having a discarded tablesace - MY_I_S_MAYBE_NULL field attributes is added PAGE_NO and SPACE in innodb_sys_index table. By doing this, InnoDB can set null for these fields when it encounters discarded tablespace --- mysql-test/suite/innodb/r/full_crc32_import.result | 11 +++++++++++ mysql-test/suite/innodb/t/full_crc32_import.test | 10 ++++++++++ storage/innobase/handler/i_s.cc | 8 +++++--- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/innodb/r/full_crc32_import.result b/mysql-test/suite/innodb/r/full_crc32_import.result index 0cfcf6f4ddb..07c8571945f 100644 --- a/mysql-test/suite/innodb/r/full_crc32_import.result +++ b/mysql-test/suite/innodb/r/full_crc32_import.result @@ -173,6 +173,17 @@ UNLOCK TABLES; SET GLOBAL innodb_compression_algorithm=0; ALTER TABLE t1 FORCE; ALTER TABLE t1 DISCARD TABLESPACE; +# Display the discarded table name by using SPACE and PAGE_NO +# column in INNODB_SYS_INDEXES and discard doesn't affect the +# SPACE in INNODB_SYS_TABLES +SELECT t.NAME, t.SPACE BETWEEN 1 and 0xFFFFFFEF as SYS_TABLE_SPACE_RANGE +FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t +WHERE t.TABLE_ID IN ( +SELECT i.TABLE_ID FROM +INFORMATION_SCHEMA.INNODB_SYS_INDEXES i WHERE +i.PAGE_NO IS NULL and i.SPACE IS NULL); +NAME SYS_TABLE_SPACE_RANGE +test/t1 1 db.opt t1.frm restore: t1 .ibd and .cfg files diff --git a/mysql-test/suite/innodb/t/full_crc32_import.test b/mysql-test/suite/innodb/t/full_crc32_import.test index c9195111c05..481db2f4ec7 100644 --- a/mysql-test/suite/innodb/t/full_crc32_import.test +++ b/mysql-test/suite/innodb/t/full_crc32_import.test @@ -195,6 +195,16 @@ SET GLOBAL innodb_compression_algorithm=0; ALTER TABLE t1 FORCE; ALTER TABLE t1 DISCARD TABLESPACE; +--echo # Display the discarded table name by using SPACE and PAGE_NO +--echo # column in INNODB_SYS_INDEXES and discard doesn't affect the +--echo # SPACE in INNODB_SYS_TABLES +SELECT t.NAME, t.SPACE BETWEEN 1 and 0xFFFFFFEF as SYS_TABLE_SPACE_RANGE +FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t +WHERE t.TABLE_ID IN ( + SELECT i.TABLE_ID FROM + INFORMATION_SCHEMA.INNODB_SYS_INDEXES i WHERE + i.PAGE_NO IS NULL and i.SPACE IS NULL); + --list_files $MYSQLD_DATADIR/test perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index bc9d24cd00f..f01c4162701 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -5430,10 +5430,10 @@ static ST_FIELD_INFO innodb_sysindex_fields_info[]= 0, 0, "", SKIP_OPEN_TABLE}, #define SYS_INDEX_PAGE_NO 5 {"PAGE_NO", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, - 0, 0, "", SKIP_OPEN_TABLE}, + 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE}, #define SYS_INDEX_SPACE 6 {"SPACE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, - 0, 0, "", SKIP_OPEN_TABLE}, + 0, MY_I_S_MAYBE_NULL, "", SKIP_OPEN_TABLE}, #define SYS_INDEX_MERGE_THRESHOLD 7 {"MERGE_THRESHOLD", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, "", SKIP_OPEN_TABLE}, @@ -5483,12 +5483,14 @@ i_s_dict_fill_sys_indexes( if (index->page == FIL_NULL) { fields[SYS_INDEX_PAGE_NO]->set_null(); } else { + fields[SYS_INDEX_PAGE_NO]->set_notnull(); OK(fields[SYS_INDEX_PAGE_NO]->store(index->page, true)); } - if (space_id == ULINT_UNDEFINED) { + if (space_id == FIL_NULL) { fields[SYS_INDEX_SPACE]->set_null(); } else { + fields[SYS_INDEX_SPACE]->set_notnull(); OK(fields[SYS_INDEX_SPACE]->store(space_id, true)); } From 9ab16e7f3e3d9fe5980605464e91e6f3da30cbc1 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Sun, 15 Jan 2023 19:12:05 +0100 Subject: [PATCH 016/260] include/ssl_compat.h: fix build with libressl >= 3.5.0 Fix the following build failure with libressl >= 3.5.0: In file included from /tmp/instance-10/output-1/build/mariadb-10.3.36/vio/viosslfactories.c:18: /tmp/instance-10/output-1/build/mariadb-10.3.36/vio/viosslfactories.c: In function 'get_dh2048': /tmp/instance-10/output-1/build/mariadb-10.3.36/include/ssl_compat.h:68:45: error: invalid use of incomplete typedef 'DH' {aka 'struct dh_st'} 68 | #define DH_set0_pqg(D,P,Q,G) ((D)->p= (P), (D)->g= (G)) | ^~ Fixes: - http://autobuild.buildroot.org/results/524198344aafca58d214537af64c5961c407b0f8 Signed-off-by: Fabrice Fontaine --- include/ssl_compat.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/ssl_compat.h b/include/ssl_compat.h index 8dc1225407e..9541a68cbdc 100644 --- a/include/ssl_compat.h +++ b/include/ssl_compat.h @@ -19,7 +19,8 @@ /* OpenSSL version specific definitions */ #if defined(OPENSSL_VERSION_NUMBER) -#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) +#if OPENSSL_VERSION_NUMBER >= 0x10100000L && \ + !(defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x30500000L) #define HAVE_OPENSSL11 1 #define SSL_LIBRARY OpenSSL_version(OPENSSL_VERSION) #define ERR_remove_state(X) ERR_clear_error() From 560c15c44be665e5d73194d84411c69acf8606a1 Mon Sep 17 00:00:00 2001 From: Anel Husakovic Date: Sat, 4 Feb 2023 22:10:49 +0100 Subject: [PATCH 017/260] MDBF-534: Coverity scan: fix client folder --------------------------------- File: `mysql` --------------------------------- - Coverity (RESOURCE_LEAK): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728394&defectInstanceId=53073025&mergedDefectId=1520090&eventId=53073025-15 `mysql`: memory allocated by `mysql_fetch_row` is not freed. - FALSE POSITIVES: - Coverity (TAINTED_SCALAR): - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728394&defectInstanceId=53074559&mergedDefectId=1520403 - Coverity (COPY_PASTE_ERROR): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728394&defectInstanceId=53074521&mergedDefectId=1520300 - Coverity (STRING_NULL): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728394&defectInstanceId=53072524&mergedDefectId=1519374 - Coverity (CHECKED_RETURN): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728394&defectInstanceId=53074932&mergedDefectId=971708 - INTENTIONAL: - Coverity (UNINIT): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728394&defectInstanceId=53074758&mergedDefectId=1519932 https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728394&defectInstanceId=53073939&mergedDefectId=1519738 - Coverity(BAD_FREE): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728394&defectInstanceId=53073938&mergedDefectId=1519491 https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728394&defectInstanceId=53074819&mergedDefectId=1519462 --------------------------------- File: `mysql_plugin` --------------------------------- - Coverity (FORWARD_NULL): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728420&defectInstanceId=53074485&mergedDefectId=971915 Dereference after null check when using `fclose`. - FALSE POSITIVES: - Coverity (STRING_OVERFLOW): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728420&defectInstanceId=53075014&mergedDefectId=972410 - Additionally fix typo --- client/mysql.cc | 1 + sql/sql_string.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/client/mysql.cc b/client/mysql.cc index 02ffacc722f..b1042d1be00 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -5357,6 +5357,7 @@ static void init_username() full_username=my_strdup(cur[0],MYF(MY_WME)); part_username=my_strdup(strtok(cur[0],"@"),MYF(MY_WME)); (void) mysql_fetch_row(result); // Read eof + mysql_free_result(result); } } diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 68a15d65d1b..c6b7f3e68ed 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -553,7 +553,7 @@ bool String::append(const char *s,size_t size) } /* - For an ASCII compatinble string we can just append. + For an ASCII compatible string we can just append. */ return Binary_string::append(s, arg_length); } From 487889119386cdab9923c570e0eb23b6c7e002ea Mon Sep 17 00:00:00 2001 From: Anel Husakovic Date: Wed, 8 Feb 2023 03:18:14 +0100 Subject: [PATCH 018/260] MDBF-534: Coverity scan: fix client folder --------------------------------- File: `mysqladmin` --------------------------------- - Coverity (PRINTF_ARGS): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728412&defectInstanceId=53073308&mergedDefectId=1520228&eventId=53073308-0 `mysql_upgrade` - extra argument to printf format specifiera - Coverity (TAINTED_SCALAR) - FAlSE POSITIVE: https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728412&defectInstanceId=53072897&mergedDefectId=1519349 --- client/mysql_upgrade.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index cd70f14e94a..99c9e7415a7 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -848,8 +848,7 @@ static int upgrade_already_done(int silent) "There is no need to run mysql_upgrade again for %s.", upgrade_from_version, version); if (!opt_check_upgrade) - verbose("You can use --force if you still want to run mysql_upgrade", - upgrade_from_version, version); + verbose("You can use --force if you still want to run mysql_upgrade"); } return 0; } From f0ea22a1e22c84affa91ec0e596fbd387d11ff8a Mon Sep 17 00:00:00 2001 From: Anel Husakovic Date: Wed, 8 Feb 2023 05:16:29 +0100 Subject: [PATCH 019/260] MDBF-534: Coverity scan: fix client folder --------------------------------- File: `mysqlbinlog` --------------------------------- - Coverity (FORWARD_NULL): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728438&defectInstanceId=53074517&mergedDefectId=1519690&eventId=53074517-46 `mysqlbinlog` - for `opt_raw_mode` file is set to 0, make sure it opened before. --- client/mysqlbinlog.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index aa994df7557..28108922538 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -3169,7 +3169,7 @@ int main(int argc, char** argv) /* Set delimiter back to semicolon */ if (retval != ERROR_STOP) { - if (!stop_event_string.is_empty()) + if (!stop_event_string.is_empty() && result_file) fprintf(result_file, "%s", stop_event_string.ptr()); if (!opt_raw_mode && opt_flashback) fprintf(result_file, "DELIMITER ;\n"); From ff7e0977f3cd9a7c6cf61dcfe874378bc72e20dd Mon Sep 17 00:00:00 2001 From: Anel Husakovic Date: Wed, 8 Feb 2023 05:26:34 +0100 Subject: [PATCH 020/260] MDBF-534: Coverity scan: fix client folder --------------------------------- File: `mysqlcheck` --------------------------------- - Coverity (FORWARD_NULL): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728409&defectInstanceId=53075052&mergedDefectId=1520314&eventId=53075052-7 `mysqlcheck` - make sure `op` is non-null - Coverity (TAINTED_SCALAR) - FALSE POSITIVES: https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728409&defectInstanceId=53074482&mergedDefectId=1519904 --- client/mysqlcheck.c | 1 + 1 file changed, 1 insertion(+) diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 3e341f13e5a..b32e21ff18f 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -942,6 +942,7 @@ static int handle_request_for_tables(char *tables, size_t length, DBUG_RETURN(1); if (dont_quote) { + DBUG_ASSERT(op); DBUG_ASSERT(strlen(op)+strlen(tables)+strlen(options)+8+1 <= query_size); /* No backticks here as we added them before */ From 023bb2fc201eb53017a505e621ae40df28abf9e0 Mon Sep 17 00:00:00 2001 From: Anel Husakovic Date: Mon, 13 Feb 2023 13:39:25 +0100 Subject: [PATCH 021/260] MDBF-534: Coverity scan: fix client folder -------------------------------- File: `mysqldump`: -------------------------------- -Coverity (`BAD_SHIFT`): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53073433&mergedDefectId=1211186&eventId=53073433-25 `mysqldump` - Error obtained by coverity is implication of type conversion. It may happen that function `find_type` returns -1 which is assigned to `uint` that gets converted by compiler to max (UINT_32/64). In that situation left bit shift may lead to UB. Converting from `uint` to `int` will solve the problem. - Coverity (`RESOURCE_LEAK`): - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53072912&mergedDefectId=1519239 - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53073706&mergedDefectId=1519368 - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53073560&mergedDefectId=1519655 - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53074494&mergedDefectId=1519822&fileStart=4001&fileEnd=4250 - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53074999&mergedDefectId=1519915&eventId=53074999-53 - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53075060&mergedDefectId=1519964 - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53073268&mergedDefectId=1519967 - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53073015&mergedDefectId=1520164 `mysqldump` - in case of error memory should be freeed. - Coverity (`UNINT`) - FALSE POSITIVES: - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53074364&mergedDefectId=1519587&eventId=53074364-10 - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53072619&mergedDefectId=1519684&eventId=53072619-1 - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53073256&mergedDefectId=1519722 - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53074251&mergedDefectId=1519979 - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53074996&mergedDefectId=1520021 - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53073425&mergedDefectId=1520166&eventId=53073425-9 --------------------------------- File: `mysqladmin` --------------------------------- - Coverity (PRECEDANCE_ERROR) a.k.a MDEV-15736: https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728425&defectInstanceId=53074187&mergedDefectId=1519944 - Coverity (BAD_FREE) - FALSE POSITIVE: https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728425&defectInstanceId=53074614&mergedDefectId=1520042 --------------------------------- File: `mysqlimport` --------------------------------- - FALSE POSITIVES - Coverity (TAINTED_SCALAR): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/ fileInstanceId=231728411&defectInstanceId=53074012&mergedDefectId=1519158&eventId=53074012-6 - Coverity (UNINT): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728411&defectInstanceId=53072860&mergedDefectId=1520020 --------------------------------- File: `mysqlshow` --------------------------------- - FALSE POSITIVES - Coverity (TAINTED_SCALAR): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728418&defectInstanceId=53074361&mergedDefectId=1519232&eventId=53074361-4 - Coverity (UNINT): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728411&defectInstanceId=53072860&mergedDefectId=1520020 - Coverity (BAD_FREE): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728418&defectInstanceId=53073408&mergedDefectId=1519972 --- client/mysqladmin.cc | 3 ++- client/mysqldump.c | 33 ++++++++++++++++++++++++++------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 6cf553c2ca9..fadefaed449 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -1589,7 +1589,8 @@ static void print_relative_row_vert(MYSQL_RES *result __attribute__((unused)), llstr((tmp - last_values[row]), buff)); /* Find the minimum row length needed to output the relative value */ - if ((length=(uint) strlen(buff) > ex_val_max_len[row]) && ex_status_printed) + length=(uint) strlen(buff); + if (length > ex_val_max_len[row] && ex_status_printed) ex_val_max_len[row] = length; last_values[row] = tmp; } diff --git a/client/mysqldump.c b/client/mysqldump.c index 010679b6ff2..cf943918084 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2480,7 +2480,10 @@ static uint dump_events_for_db(char *db) /* Get database collation. */ if (fetch_db_collation(db_name_buff, db_cl_name, sizeof (db_cl_name))) + { + mysql_free_result(event_list_res); DBUG_RETURN(1); + } } if (switch_character_set_results(mysql, "binary")) @@ -3262,7 +3265,10 @@ static uint get_table_structure(const char *table, const char *db, char *table_t if (path) { if (!(sql_file= open_sql_file_for_table(table, O_WRONLY))) + { + mysql_free_result(result); DBUG_RETURN(0); + } write_header(sql_file, db); } @@ -3663,7 +3669,7 @@ static int dump_triggers_for_table(char *table_name, char *db_name) char name_buff[NAME_LEN*4+3]; char query_buff[QUERY_LENGTH]; uint old_opt_compatible_mode= opt_compatible_mode; - MYSQL_RES *show_triggers_rs; + MYSQL_RES *show_triggers_rs= NULL; MYSQL_ROW row; FILE *sql_file= md_result_file; @@ -3747,8 +3753,6 @@ static int dump_triggers_for_table(char *table_name, char *db_name) } skip: - mysql_free_result(show_triggers_rs); - if (switch_character_set_results(mysql, default_charset)) goto done; @@ -3763,7 +3767,7 @@ skip: done: if (path) my_fclose(sql_file, MYF(0)); - + mysql_free_result(show_triggers_rs); DBUG_RETURN(ret); } @@ -3869,7 +3873,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key, uint num_fields; size_t total_length, init_length; - MYSQL_RES *res; + MYSQL_RES *res= NULL; MYSQL_FIELD *field; MYSQL_ROW row; DBUG_ENTER("dump_table"); @@ -4055,6 +4059,8 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key, fprintf(stderr,"%s: Error in field count for table: %s ! Aborting.\n", my_progname_short, result_table); error= EX_CONSCHECK; + if (!quick) + mysql_free_result(res); goto err; } @@ -4354,6 +4360,7 @@ static void dump_table(const char *table, const char *db, const uchar *hash_key, err: dynstr_free(&query_string); maybe_exit(error); + mysql_free_result(res); DBUG_VOID_RETURN; } /* dump_table */ @@ -4619,7 +4626,11 @@ static int dump_all_users_roles_and_grants() " '@', QUOTE(DEFAULT_ROLE_HOST))) as r," " CONCAT(QUOTE(mu.USER),'@',QUOTE(mu.HOST)) as u " "FROM mysql.user mu LEFT JOIN mysql.default_roles using (USER, HOST)")) + { + mysql_free_result(tableres); return 1; + } + while ((row= mysql_fetch_row(tableres))) { if (dump_grants(row[1])) @@ -5696,7 +5707,8 @@ static int get_sys_var_lower_case_table_names() lower_case_table_names= atoi(row[1]); mysql_free_result(table_res); } - + if (!row) + mysql_free_result(table_res); return lower_case_table_names; } @@ -5939,7 +5951,11 @@ static int do_show_master_status(MYSQL *mysql_con, int consistent_binlog_pos, } if (have_mariadb_gtid && get_gtid_pos(gtid_pos, 1)) + { + mysql_free_result(master); return 1; + } + } /* SHOW MASTER STATUS reports file and position */ @@ -6061,7 +6077,10 @@ static int do_show_slave_status(MYSQL *mysql_con, int use_gtid, { char gtid_pos[MAX_GTID_LENGTH]; if (have_mariadb_gtid && get_gtid_pos(gtid_pos, 0)) + { + mysql_free_result(slave); return 1; + } if (opt_comments) fprintf(md_result_file, "\n--\n-- Gtid position to start replication " "from\n--\n\n"); @@ -6257,7 +6276,7 @@ static ulong find_set(TYPELIB *lib, const char *x, size_t length, { const char *end= x + length; ulong found= 0; - uint find; + int find; char buff[255]; *err_pos= 0; /* No error yet */ From 24911a34b3409e0f18cf4ff7f695c902e39a9644 Mon Sep 17 00:00:00 2001 From: Anel Husakovic Date: Wed, 8 Feb 2023 12:24:25 +0100 Subject: [PATCH 022/260] MDBF-534: Coverity scan: fix client folder --------------------------------- File: `mysqlslap` --------------------------------- - Coverity (CHECKED_RETURN): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53073524&mergedDefectId=1520114 - FALSE POSITIVES - Coverity (DC.WEAK_CRYPTO) (`random()`): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53073112&mergedDefectId=1225806 https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53074491&mergedDefectId=1409160 https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53074151&mergedDefectId=1409180 https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53073799&mergedDefectId=1409183 - Coverity (TAINTED_SCALAR): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53074667&mergedDefectId=1519586 - Coverity (UNINT): - Coverity (BAD_FREE): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53074415&mergedDefectId=1520371 --- client/mysqlslap.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 8c65dccbb43..78e9b6aa646 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -1768,6 +1768,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) uint x; struct timeval start_time, end_time; thread_context con; + int error; pthread_t mainthread; /* Thread descriptor */ pthread_attr_t attr; /* Thread attributes */ DBUG_ENTER("run_scheduler"); @@ -1776,8 +1777,11 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit) con.limit= limit; pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, - PTHREAD_CREATE_DETACHED); + if ((error= pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED))) + { + printf("Got error: %d from pthread_attr_setdetachstate\n", error); + exit(1); + } pthread_mutex_lock(&counter_mutex); thread_counter= 0; From bd0d7ea540b9ee57b583b721ddbe6c606f2f75c9 Mon Sep 17 00:00:00 2001 From: Anel Husakovic Date: Wed, 8 Feb 2023 12:57:03 +0100 Subject: [PATCH 023/260] MDBF-534: Coverity scan: fix client folder --------------------------------- File: `mysqltest` --------------------------------- - Coverity (SIZEOF_MISMATCH): - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53074863&mergedDefectId=972322 Function `qsort` have to use size of element that is `uchar *` - Coverity (REVERSE_INULL): - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53074524&mergedDefectId=1519693&fileStart=3376&fileEnd=3625 First check if null and then use `strlen`, not reversed. - FALSE POSITIVES - Coverity (TAINTED_SCALAR): https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53074760&mergedDefectId=1519321 - Coverity (CHECKED_RETURN): - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53074692&mergedDefectId=971714 - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53072839&mergedDefectId=971715 - Coverity (FORWARD_NULL): There is already issued DBUG_ASSERT(query_end) few lines before https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53074002&mergedDefectId=971916&eventId=53074002-5 - Coverity (OVERRUN): - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53074470&mergedDefectId=1519697 - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53074862&mergedDefectId=1520391 `uint64_max` and `SIZE_MAX` (max for `size_t`) are same as `count` argument for `memcmp`. - Coverity (RESOURCE_LEAK): - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53074163&mergedDefectId=1519889&eventId=53074163-446 - INTENTION: - Coverity (SIZEOF_MISMATCH): - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53074650&mergedDefectId=1520109 `len` argument is used only in printing so it is not making impact (may be removed as an alternative). In this example size of pointer (8B) is used, that is not the size of value that pointer points to. --- client/mysqltest.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 05a26fed059..214b7542374 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -3563,9 +3563,11 @@ void do_system(struct st_command *command) /* returns TRUE if path is inside a sandbox */ bool is_sub_path(const char *path, size_t plen, const char *sandbox) { - size_t len= strlen(sandbox); - if (!sandbox || !len || plen <= len || memcmp(path, sandbox, len - 1) - || path[len] != '/') + size_t len; + if (!sandbox) + return false; + len= strlen(sandbox); + if (plen <= len || memcmp(path, sandbox, len-1) || path[len] != '/') return false; return true; } @@ -11696,7 +11698,7 @@ void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING *ds_input, /* Sort array */ qsort(lines.buffer, lines.elements, - sizeof(char**), (qsort_cmp)comp_lines); + sizeof(uchar *), (qsort_cmp)comp_lines); /* Create new result */ for (i= 0; i < lines.elements ; i++) From 476b24d084e7e717310155bb986eb086d3c1e1a6 Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 16 Feb 2023 14:19:33 +0200 Subject: [PATCH 024/260] MDEV-20057 Distinct SUM on CROSS JOIN and grouped returns wrong result SELECT DISTINCT did not work with expressions with sum functions. Distinct was only done on the values stored in the intermediate temporary tables, which only stored the value of each sum function. In other words: SELECT DISTINCT sum(a),sum(b),avg(c) ... worked. SELECT DISTINCT sum(a),sum(b) > 2,sum(c)+sum(d) would not work. The later query would do ONLY apply distinct on the sum(a) part. Reviewer: Sergei Petrunia This was fixed by extending remove_dup_with_hash_index() and remove_dup_with_compare() to take into account the columns in the result list that where not stored in the temporary table. Note that in many cases the above dup removal functions are not used as the optimizer may be able to either remove duplicates early or it will discover that duplicate remove is not needed. The later happens for example if the group by fields is part of the result. Other things: - Backported from 11.0 the change of Sort_param.tmp_buffer from char* to String. - Changed Type_handler::make_sort_key() to take String as a parameter instead of Sort_param. This was done to allow make_sort_key() functions to be reused by distinct elimination functions. This makes Type_handler_string_result::make_sort_key() similar to code in 11.0 - Simplied error handling in remove_dup_with_compare() to remove code duplication. --- mysql-test/main/distinct.result | 37 +++++++ mysql-test/main/distinct.test | 23 ++++ sql/filesort.cc | 42 ++++--- sql/sql_select.cc | 190 +++++++++++++++++++++++++------- sql/sql_sort.h | 11 +- sql/sql_type.h | 16 +-- 6 files changed, 245 insertions(+), 74 deletions(-) diff --git a/mysql-test/main/distinct.result b/mysql-test/main/distinct.result index 93a1ea834df..331b57faa27 100644 --- a/mysql-test/main/distinct.result +++ b/mysql-test/main/distinct.result @@ -1070,3 +1070,40 @@ UNION 1 drop table t1; End of 5.5 tests +# +# MDEV-20057 Distinct SUM on CROSS JOIN and grouped returns wrong result +# +create table t1 (c int, d int); +insert into t1 values (5, 1), (0, 3); +select distinct sum(distinct 1), sum(t1.d) > 2 from (t1 e join t1) group by t1.c; +sum(distinct 1) sum(t1.d) > 2 +1 1 +1 0 +select distinct sum(distinct 1), sum(t1.d) > 2, t1.c from (t1 e join t1) group by t1.c; +sum(distinct 1) sum(t1.d) > 2 c +1 1 0 +1 0 5 +insert into t1 values (6,6); +select distinct sum(distinct 1), sum(t1.d) > 5 from (t1 e join t1) group by t1.c; +sum(distinct 1) sum(t1.d) > 5 +1 1 +1 0 +select distinct sum(distinct 1), sum(t1.d) > 5, t1.c from (t1 e join t1) group by t1.c; +sum(distinct 1) sum(t1.d) > 5 c +1 1 0 +1 0 5 +1 1 6 +set @@sort_buffer_size=1024; +insert into t1 select -seq,-seq from seq_1_to_100; +select distinct sum(distinct 1), sum(t1.d) > 2, length(group_concat(t1.d)) > 1000 from (t1 e join t1) group by t1.c having t1.c > -2 ; +sum(distinct 1) sum(t1.d) > 2 length(group_concat(t1.d)) > 1000 +1 0 0 +1 1 0 +select distinct sum(distinct 1), sum(t1.d) > 2, length(group_concat(t1.d)) > 1000,t1.c from (t1 e join t1) group by t1.c having t1.c > -2; +sum(distinct 1) sum(t1.d) > 2 length(group_concat(t1.d)) > 1000 c +1 0 0 -1 +1 1 0 0 +1 1 0 5 +1 1 0 6 +drop table t1; +# End of 10.4 tests diff --git a/mysql-test/main/distinct.test b/mysql-test/main/distinct.test index da12c7273b2..a2a0f14e008 100644 --- a/mysql-test/main/distinct.test +++ b/mysql-test/main/distinct.test @@ -4,6 +4,7 @@ # --source include/default_optimizer_switch.inc +--source include/have_sequence.inc --disable_warnings drop table if exists t1,t2,t3; --enable_warnings @@ -818,3 +819,25 @@ UNION drop table t1; --echo End of 5.5 tests + +--echo # +--echo # MDEV-20057 Distinct SUM on CROSS JOIN and grouped returns wrong result +--echo # + +create table t1 (c int, d int); +insert into t1 values (5, 1), (0, 3); +select distinct sum(distinct 1), sum(t1.d) > 2 from (t1 e join t1) group by t1.c; +select distinct sum(distinct 1), sum(t1.d) > 2, t1.c from (t1 e join t1) group by t1.c; + +insert into t1 values (6,6); +select distinct sum(distinct 1), sum(t1.d) > 5 from (t1 e join t1) group by t1.c; +select distinct sum(distinct 1), sum(t1.d) > 5, t1.c from (t1 e join t1) group by t1.c; + +# Force usage of remove_dup_with_compare() algorithm +set @@sort_buffer_size=1024; +insert into t1 select -seq,-seq from seq_1_to_100; +select distinct sum(distinct 1), sum(t1.d) > 2, length(group_concat(t1.d)) > 1000 from (t1 e join t1) group by t1.c having t1.c > -2 ; +select distinct sum(distinct 1), sum(t1.d) > 2, length(group_concat(t1.d)) > 1000,t1.c from (t1 e join t1) group by t1.c having t1.c > -2; +drop table t1; + +--echo # End of 10.4 tests diff --git a/sql/filesort.cc b/sql/filesort.cc index ee19dfcb386..79c8f6fb234 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -159,7 +159,7 @@ SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort, MYSQL_FILESORT_START(table->s->db.str, table->s->table_name.str); DEBUG_SYNC(thd, "filesort_start"); - if (!(sort= new SORT_INFO)) + if (!(sort= new SORT_INFO)) // Note that this is not automatically freed! return 0; if (subselect && subselect->filesort_buffer.is_allocated()) @@ -186,10 +186,6 @@ SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort, sort->addon_buf= param.addon_buf; sort->addon_field= param.addon_field; sort->unpack= unpack_addon_fields; - if (multi_byte_charset && - !(param.tmp_buffer= (char*) my_malloc(param.sort_length, - MYF(MY_WME | MY_THREAD_SPECIFIC)))) - goto err; if (select && select->quick) thd->inc_status_sort_range(); @@ -254,6 +250,9 @@ SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort, tracker->report_sort_buffer_size(sort->sort_buffer_size()); } + if (param.tmp_buffer.alloc(param.sort_length)) + goto err; + if (open_cached_file(&buffpek_pointers,mysql_tmpdir,TEMP_PREFIX, DISK_BUFFER_SIZE, MYF(MY_WME))) goto err; @@ -337,7 +336,7 @@ SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort, error= 0; err: - my_free(param.tmp_buffer); + param.tmp_buffer.free(); if (!subselect || !subselect->is_uncacheable()) { sort->free_sort_buffer(); @@ -977,17 +976,15 @@ static inline void store_length(uchar *to, uint length, uint pack_length) void Type_handler_string_result::make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, - Sort_param *param) const + String *tmp_buffer) const { CHARSET_INFO *cs= item->collation.collation; bool maybe_null= item->maybe_null; if (maybe_null) *to++= 1; - char *tmp_buffer= param->tmp_buffer ? param->tmp_buffer : (char*) to; - String tmp(tmp_buffer, param->tmp_buffer ? param->sort_length : - sort_field->length, cs); - String *res= item->str_result(&tmp); + + Binary_string *res= item->str_result(tmp_buffer); if (!res) { if (maybe_null) @@ -1015,11 +1012,11 @@ Type_handler_string_result::make_sort_key(uchar *to, Item *item, size_t tmp_length= #endif cs->coll->strnxfrm(cs, to, sort_field->length, - item->max_char_length() * - cs->strxfrm_multiply, - (uchar*) res->ptr(), res->length(), - MY_STRXFRM_PAD_WITH_SPACE | - MY_STRXFRM_PAD_TO_MAXLEN); + item->max_char_length() * + cs->strxfrm_multiply, + (uchar*) res->ptr(), res->length(), + MY_STRXFRM_PAD_WITH_SPACE | + MY_STRXFRM_PAD_TO_MAXLEN); DBUG_ASSERT(tmp_length == sort_field->length); } else @@ -1050,7 +1047,7 @@ Type_handler_string_result::make_sort_key(uchar *to, Item *item, void Type_handler_int_result::make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, - Sort_param *param) const + String *tmp_buffer) const { longlong value= item->val_int_result(); make_sort_key_longlong(to, item->maybe_null, item->null_value, @@ -1061,7 +1058,7 @@ Type_handler_int_result::make_sort_key(uchar *to, Item *item, void Type_handler_temporal_result::make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, - Sort_param *param) const + String *tmp_buffer) const { MYSQL_TIME buf; // This is a temporal type. No nanoseconds. Rounding mode is not important. @@ -1083,7 +1080,7 @@ Type_handler_temporal_result::make_sort_key(uchar *to, Item *item, void Type_handler_timestamp_common::make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, - Sort_param *param) const + String *tmp_buffer) const { THD *thd= current_thd; uint binlen= my_timestamp_binary_length(item->decimals); @@ -1147,7 +1144,7 @@ Type_handler::make_sort_key_longlong(uchar *to, void Type_handler_decimal_result::make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, - Sort_param *param) const + String *tmp_buffer) const { my_decimal dec_buf, *dec_val= item->val_decimal_result(&dec_buf); if (item->maybe_null) @@ -1167,7 +1164,7 @@ Type_handler_decimal_result::make_sort_key(uchar *to, Item *item, void Type_handler_real_result::make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, - Sort_param *param) const + String *tmp_buffer) const { double value= item->val_result(); if (item->maybe_null) @@ -1205,7 +1202,8 @@ static void make_sortkey(Sort_param *param, uchar *to, uchar *ref_pos) else { // Item sort_field->item->type_handler()->make_sort_key(to, sort_field->item, - sort_field, param); + sort_field, + ¶m->tmp_buffer); if ((maybe_null= sort_field->item->maybe_null)) to++; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 3f02d21ad0b..f83bf32130e 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -244,10 +244,12 @@ static bool find_field_in_item_list (Field *field, void *data); static bool find_field_in_order_list (Field *field, void *data); int create_sort_index(THD *thd, JOIN *join, JOIN_TAB *tab, Filesort *fsort); static int remove_dup_with_compare(THD *thd, TABLE *entry, Field **field, - Item *having); + SORT_FIELD *sortorder, ulong keylength, + Item *having); static int remove_dup_with_hash_index(THD *thd,TABLE *table, - uint field_count, Field **first_field, - ulong key_length,Item *having); + uint field_count, Field **first_field, + SORT_FIELD *sortorder, + ulong key_length,Item *having); static bool cmp_buffer_with_ref(THD *thd, TABLE *table, TABLE_REF *tab_ref); static bool setup_new_fields(THD *thd, List &fields, List &all_fields, ORDER *new_order); @@ -24208,39 +24210,70 @@ JOIN_TAB::remove_duplicates() { bool error; - ulong keylength= 0; - uint field_count; + ulong keylength= 0, sort_field_keylength= 0; + uint field_count, item_count; List *fields= (this-1)->fields; + Item *item; THD *thd= join->thd; - + SORT_FIELD *sortorder, *sorder; DBUG_ENTER("remove_duplicates"); DBUG_ASSERT(join->aggr_tables > 0 && table->s->tmp_table != NO_TMP_TABLE); THD_STAGE_INFO(join->thd, stage_removing_duplicates); - //join->explain->ops_tracker.report_duplicate_removal(); - - table->reginfo.lock_type=TL_WRITE; + if (!(sortorder= (SORT_FIELD*) my_malloc((fields->elements+1) * + sizeof(SORT_FIELD), + MYF(MY_WME)))) + DBUG_RETURN(TRUE); /* Calculate how many saved fields there is in list */ - field_count=0; - List_iterator it(*fields); - Item *item; - while ((item=it++)) - { - if (item->get_tmp_table_field() && ! item->const_item()) - field_count++; - } + field_count= item_count= 0; - if (!field_count && !(join->select_options & OPTION_FOUND_ROWS) && !having) - { // only const items with no OPTION_FOUND_ROWS + List_iterator it(*fields); + for (sorder= sortorder ; (item=it++) ;) + { + if (!item->const_item()) + { + if (item->get_tmp_table_field()) + { + /* Field is stored in temporary table, skipp */ + field_count++; + } + else + { + /* Item is not stored in temporary table, remember it */ + sorder->field= 0; // Safety, not used + sorder->item= item; + /* Calculate sorder->length */ + item->type_handler()->sortlength(thd, item, sorder); + sorder++; + item_count++; + } + } + } + sorder->item= 0; // End marker + + if ((field_count + item_count == 0) && ! having && + !(join->select_options & OPTION_FOUND_ROWS)) + { + // only const items with no OPTION_FOUND_ROWS join->unit->select_limit_cnt= 1; // Only send first row + my_free(sortorder); DBUG_RETURN(false); } + /* + The table contains first fields that will be in the output, then + temporary results pointed to by the fields list. + Example: SELECT DISTINCT sum(a), sum(d) > 2 FROM ... + In this case the temporary table contains sum(a), sum(d). + */ + Field **first_field=table->field+table->s->fields - field_count; for (Field **ptr=first_field; *ptr; ptr++) keylength+= (*ptr)->sort_length() + (*ptr)->maybe_null(); + for (SORT_FIELD *ptr= sortorder ; ptr->item ; ptr++) + sort_field_keylength+= ptr->length + (ptr->item->maybe_null ? 1 : 0); /* Disable LIMIT ROWS EXAMINED in order to avoid interrupting prematurely @@ -24251,30 +24284,79 @@ JOIN_TAB::remove_duplicates() thd->reset_killed(); table->file->info(HA_STATUS_VARIABLE); + table->reginfo.lock_type=TL_WRITE; + if (table->s->db_type() == heap_hton || (!table->s->blob_fields && ((ALIGN_SIZE(keylength) + HASH_OVERHEAD) * table->file->stats.records < thd->variables.sortbuff_size))) - error=remove_dup_with_hash_index(join->thd, table, field_count, first_field, - keylength, having); + error= remove_dup_with_hash_index(join->thd, table, field_count, + first_field, sortorder, + keylength + sort_field_keylength, having); else - error=remove_dup_with_compare(join->thd, table, first_field, having); + error=remove_dup_with_compare(join->thd, table, first_field, sortorder, + sort_field_keylength, having); if (join->select_lex != join->select_lex->master_unit()->fake_select_lex) thd->lex->set_limit_rows_examined(); free_blobs(first_field); + my_free(sortorder); DBUG_RETURN(error); } +/* + Create a sort/compare key from items + + Key is of fixed length and binary comparable +*/ + +static uchar *make_sort_key(SORT_FIELD *sortorder, uchar *key_buffer, + String *tmp_value) +{ + for (SORT_FIELD *ptr= sortorder ; ptr->item ; ptr++) + { + ptr->item->type_handler()->make_sort_key(key_buffer, + ptr->item, + ptr, tmp_value); + key_buffer+= (ptr->item->maybe_null ? 1 : 0) + ptr->length; + } + return key_buffer; +} + + +/* + Remove duplicates by comparing all rows with all other rows + + @param thd THD + @param table Temporary table + @param first_field Pointer to fields in temporary table that are part of + distinct, ends with null pointer + @param sortorder An array of Items part of distsinct. Terminated with an + element N with sortorder[N]->item=NULL. + @param keylength Length of key produced by sortorder + @param having Having expression (NULL if no having) +*/ + static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field, + SORT_FIELD *sortorder, ulong keylength, Item *having) { handler *file=table->file; - uchar *record=table->record[0]; + uchar *record=table->record[0], *key_buffer, *key_buffer2; + char *tmp_buffer; int error; + String tmp_value; DBUG_ENTER("remove_dup_with_compare"); + if (unlikely(!my_multi_malloc(MYF(MY_WME), + &key_buffer, keylength, + &key_buffer2, keylength, + &tmp_buffer, keylength+1, + NullS))) + DBUG_RETURN(1); + tmp_value.set(tmp_buffer, keylength, &my_charset_bin); + if (unlikely(file->ha_rnd_init_with_error(1))) DBUG_RETURN(1); @@ -24283,8 +24365,8 @@ static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field, { if (unlikely(thd->check_killed())) { - error=0; - goto err; + error= 1; + goto end; } if (unlikely(error)) { @@ -24303,9 +24385,10 @@ static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field, { my_message(ER_OUTOFMEMORY, ER_THD(thd,ER_OUTOFMEMORY), MYF(ME_FATAL)); - error=0; - goto err; + error= 1; + goto end; } + make_sort_key(sortorder, key_buffer, &tmp_value); store_record(table,record[1]); /* Read through rest of file and mark duplicated rows deleted */ @@ -24318,7 +24401,10 @@ static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field, break; goto err; } - if (compare_record(table, first_field) == 0) + make_sort_key(sortorder, key_buffer2, &tmp_value); + if (compare_record(table, first_field) == 0 && + (!keylength || + memcmp(key_buffer, key_buffer2, keylength) == 0)) { if (unlikely((error= file->ha_delete_row(record)))) goto err; @@ -24337,38 +24423,52 @@ static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field, goto err; } + error= 0; +end: + my_free(key_buffer); file->extra(HA_EXTRA_NO_CACHE); (void) file->ha_rnd_end(); - DBUG_RETURN(0); + DBUG_RETURN(error); + err: - file->extra(HA_EXTRA_NO_CACHE); - (void) file->ha_rnd_end(); - if (error) - file->print_error(error,MYF(0)); - DBUG_RETURN(1); + DBUG_ASSERT(error); + file->print_error(error,MYF(0)); + goto end; } /** - Generate a hash index for each row to quickly find duplicate rows. + Generate a hash index for each row to quickly find duplicate rows. - @note - Note that this will not work on tables with blobs! + @param thd THD + @param table Temporary table + @param field_count Number of fields part of distinct + @param first_field Pointer to fields in temporary table that are part of + distinct, ends with null pointer + @param sortorder An array of Items part of distsinct. Terminated with an + element N with sortorder[N]->item=NULL. + @param keylength Length of hash key + @param having Having expression (NULL if no having) + + @note + Note that this will not work on tables with blobs! */ static int remove_dup_with_hash_index(THD *thd, TABLE *table, uint field_count, Field **first_field, + SORT_FIELD *sortorder, ulong key_length, Item *having) { uchar *key_buffer, *key_pos, *record=table->record[0]; + char *tmp_buffer; int error; handler *file= table->file; ulong extra_length= ALIGN_SIZE(key_length)-key_length; uint *field_lengths, *field_length; HASH hash; - Field **ptr; + String tmp_value; DBUG_ENTER("remove_dup_with_hash_index"); if (unlikely(!my_multi_malloc(MYF(MY_WME), @@ -24376,11 +24476,14 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table, (uint) ((key_length + extra_length) * (long) file->stats.records), &field_lengths, - (uint) (field_count*sizeof(*field_lengths)), + (uint) (field_count * sizeof(*field_lengths)), + &tmp_buffer, key_length+1, NullS))) DBUG_RETURN(1); - for (ptr= first_field, field_length=field_lengths ; *ptr ; ptr++) + tmp_value.set(tmp_buffer, key_length, &my_charset_bin); + field_length= field_lengths; + for (Field **ptr= first_field ; *ptr ; ptr++) (*field_length++)= (*ptr)->sort_length(); if (unlikely(my_hash_init(&hash, &my_charset_bin, @@ -24394,7 +24497,7 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table, if (unlikely((error= file->ha_rnd_init(1)))) goto err; - key_pos=key_buffer; + key_pos= key_buffer; for (;;) { uchar *org_key_pos; @@ -24419,11 +24522,14 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table, /* copy fields to key buffer */ org_key_pos= key_pos; field_length=field_lengths; - for (ptr= first_field ; *ptr ; ptr++) + for (Field **ptr= first_field ; *ptr ; ptr++) { (*ptr)->make_sort_key(key_pos, *field_length); key_pos+= (*ptr)->maybe_null() + *field_length++; } + /* Copy result fields not stored in table to key buffer */ + key_pos= make_sort_key(sortorder, key_pos, &tmp_value); + /* Check if it exists before */ if (my_hash_search(&hash, org_key_pos, key_length)) { diff --git a/sql/sql_sort.h b/sql/sql_sort.h index 7abbc808632..5d5d1a0b988 100644 --- a/sql/sql_sort.h +++ b/sql/sql_sort.h @@ -19,6 +19,7 @@ #include "my_base.h" /* ha_rows */ #include /* qsort2_cmp */ #include "queues.h" +#include "sql_string.h" typedef struct st_buffpek BUFFPEK; @@ -82,14 +83,20 @@ public: uchar *unique_buff; bool not_killable; - char* tmp_buffer; + String tmp_buffer; // The fields below are used only by Unique class. qsort2_cmp compare; BUFFPEK_COMPARE_CONTEXT cmp_context; Sort_param() { - memset(this, 0, sizeof(*this)); + memset(reinterpret_cast(this), 0, sizeof(*this)); + tmp_buffer.set_thread_specific(); + /* + Fix memset() clearing the charset. + TODO: The constructor should be eventually rewritten not to use memset(). + */ + tmp_buffer.set_charset(&my_charset_bin); } void init_for_filesort(uint sortlen, TABLE *table, ha_rows maxrows, bool sort_positions); diff --git a/sql/sql_type.h b/sql/sql_type.h index 1e44be37d52..bf76806c44a 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -3734,7 +3734,7 @@ public: virtual void make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, - Sort_param *param) const= 0; + String *tmp) const= 0; virtual void sortlength(THD *thd, const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const= 0; @@ -4120,7 +4120,7 @@ public: const Bit_addr &bit, const Column_definition_attributes *attr, uint32 flags) const override; - void make_sort_key(uchar *, Item *, const SORT_FIELD_ATTR *, Sort_param *) + void make_sort_key(uchar *, Item *, const SORT_FIELD_ATTR *, String *tmp) const override { MY_ASSERT_UNREACHABLE(); @@ -4431,7 +4431,7 @@ public: const Item *outer, bool is_in_predicate) const; void make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, - Sort_param *param) const; + String *tmp) const; void sortlength(THD *thd, const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; @@ -4519,7 +4519,7 @@ public: bool is_in_predicate) const; Field *make_num_distinct_aggregator_field(MEM_ROOT *, const Item *) const; void make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, - Sort_param *param) const; + String *tmp) const; void sortlength(THD *thd, const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; @@ -4745,7 +4745,7 @@ public: bool is_in_predicate) const; Field *make_num_distinct_aggregator_field(MEM_ROOT *, const Item *) const; void make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, - Sort_param *param) const; + String *tmp) const; void sortlength(THD *thd, const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; @@ -4834,7 +4834,7 @@ public: Item_result cmp_type() const { return TIME_RESULT; } virtual ~Type_handler_temporal_result() = default; void make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, - Sort_param *param) const; + String *tmp) const; void sortlength(THD *thd, const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; @@ -4921,7 +4921,7 @@ public: type_handler_adjusted_to_max_octet_length(uint max_octet_length, CHARSET_INFO *cs) const; void make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, - Sort_param *param) const; + String *tmp) const; void sortlength(THD *thd, const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; @@ -5953,7 +5953,7 @@ public: cmp_item *make_cmp_item(THD *thd, CHARSET_INFO *cs) const; in_vector *make_in_vector(THD *thd, const Item_func_in *f, uint nargs) const; void make_sort_key(uchar *to, Item *item, const SORT_FIELD_ATTR *sort_field, - Sort_param *param) const; + String *tmp) const; void sortlength(THD *thd, const Type_std_attributes *item, SORT_FIELD_ATTR *attr) const; From 358635bbad5082026603deda0cff93427a38c069 Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Mon, 31 Oct 2022 15:51:00 +0000 Subject: [PATCH 025/260] MDEV-29782 CONNECT YEAR type conversion fix When using the MySQL table type the CONNECT engine converted the YEAR datatype to DATETIME for INSERT queries. This is incorrect, causing an error on the INSERT. It should be SHORT instead. --- storage/connect/mysql-test/connect/r/mysql.result | 11 +++++++++++ storage/connect/mysql-test/connect/t/mysql.test | 15 +++++++++++++++ storage/connect/myutil.cpp | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/storage/connect/mysql-test/connect/r/mysql.result b/storage/connect/mysql-test/connect/r/mysql.result index d3c244b277a..1dcbca88a7b 100644 --- a/storage/connect/mysql-test/connect/r/mysql.result +++ b/storage/connect/mysql-test/connect/r/mysql.result @@ -364,5 +364,16 @@ hex(col) DROP TABLE t2; DROP TABLE t1; # +# MDEV-29782 CONNECT engine converted YEAR to DATETIME, causing INSERT to fail +# +CREATE TABLE t1 (id year); +CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL DBNAME='test' TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=PORT'; +INSERT INTO t2 VALUES (1999); +SELECT * FROM t2; +id +1999 +DROP TABLE t2; +DROP TABLE t1; +# # End of 10.3 tests # diff --git a/storage/connect/mysql-test/connect/t/mysql.test b/storage/connect/mysql-test/connect/t/mysql.test index a50db4a6457..cd52f78fb30 100644 --- a/storage/connect/mysql-test/connect/t/mysql.test +++ b/storage/connect/mysql-test/connect/t/mysql.test @@ -533,6 +533,21 @@ DROP TABLE t2; DROP TABLE t1; +--echo # +--echo # MDEV-29782 CONNECT engine converted YEAR to DATETIME, causing INSERT to fail +--echo # + +CREATE TABLE t1 (id year); + +--replace_result $PORT PORT +--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL DBNAME='test' TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' + +INSERT INTO t2 VALUES (1999); +SELECT * FROM t2; + +DROP TABLE t2; +DROP TABLE t1; + --echo # --echo # End of 10.3 tests --echo # diff --git a/storage/connect/myutil.cpp b/storage/connect/myutil.cpp index c49db48bfb3..45b2c46e217 100644 --- a/storage/connect/myutil.cpp +++ b/storage/connect/myutil.cpp @@ -183,6 +183,7 @@ int MYSQLtoPLG(int mytype, char *var) switch (mytype) { case MYSQL_TYPE_SHORT: + case MYSQL_TYPE_YEAR: type = TYPE_SHORT; break; case MYSQL_TYPE_LONG: @@ -209,7 +210,6 @@ int MYSQLtoPLG(int mytype, char *var) case MYSQL_TYPE_TIMESTAMP: case MYSQL_TYPE_DATE: case MYSQL_TYPE_DATETIME: - case MYSQL_TYPE_YEAR: case MYSQL_TYPE_TIME: type = TYPE_DATE; break; From 3c6f108540862ef91889ee2bf975fad64237dabb Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 31 Jan 2023 16:07:27 +0100 Subject: [PATCH 026/260] Revert "ignore changes in submodules when committing everything" This reverts commit d78ac04ee609b0b63bb688be2a837a6ca7670392. The benefits of `ignore=all` are that submodules are omitted from `git status` and `git citool`. The drawbacks are - submodules are not omitted from `git commit -a` *and* they are omitted from `git diff` and `git show` output. As a result one can unintentionally commit changes to submodules and not see it in the history. Thus drawbacks outweigh benefits here. --- .gitmodules | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 30f950b00e7..921a4782f4f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,17 +1,13 @@ [submodule "libmariadb"] path = libmariadb url = https://github.com/MariaDB/mariadb-connector-c.git - ignore = all [submodule "storage/rocksdb/rocksdb"] path = storage/rocksdb/rocksdb url = https://github.com/facebook/rocksdb.git - ignore = all [submodule "wsrep-lib"] path = wsrep-lib url = https://github.com/codership/wsrep-lib.git branch = master - ignore = all [submodule "extra/wolfssl/wolfssl"] path = extra/wolfssl/wolfssl url = https://github.com/wolfSSL/wolfssl.git - ignore = all From 2e6a9886a9f0aea55035dbdcf74bf09c0f7e2a30 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 1 Feb 2023 18:56:10 +0100 Subject: [PATCH 027/260] MDEV-30526 Assertion `rights == merged->cols' failed in update_role_columns another case of the antipattern "iterate the HASH and delete elements as we go" --- mysql-test/suite/roles/role_grant_propagate.result | 13 +++++++++++++ mysql-test/suite/roles/role_grant_propagate.test | 11 +++++++++++ sql/sql_acl.cc | 2 ++ 3 files changed, 26 insertions(+) diff --git a/mysql-test/suite/roles/role_grant_propagate.result b/mysql-test/suite/roles/role_grant_propagate.result index 7804b7b7a3c..111fd4dbc28 100644 --- a/mysql-test/suite/roles/role_grant_propagate.result +++ b/mysql-test/suite/roles/role_grant_propagate.result @@ -163,5 +163,18 @@ drop role student; drop role admin; drop database crm; # +# MDEV-30526 Assertion `rights == merged->cols' failed in update_role_columns +# +create table t1 ( pk int, i int); +create role a; +grant select (i), update (pk) on t1 to a; +revoke update (pk) on t1 from a; +show grants for a; +Grants for a +GRANT USAGE ON *.* TO `a` +GRANT SELECT (`i`) ON `test`.`t1` TO `a` +drop role a; +drop table t1; +# # End of 10.3 tests # diff --git a/mysql-test/suite/roles/role_grant_propagate.test b/mysql-test/suite/roles/role_grant_propagate.test index bf20bc00809..02d451f0afd 100644 --- a/mysql-test/suite/roles/role_grant_propagate.test +++ b/mysql-test/suite/roles/role_grant_propagate.test @@ -196,6 +196,17 @@ drop role student; drop role admin; drop database crm; +--echo # +--echo # MDEV-30526 Assertion `rights == merged->cols' failed in update_role_columns +--echo # +create table t1 ( pk int, i int); +create role a; +grant select (i), update (pk) on t1 to a; +revoke update (pk) on t1 from a; +show grants for a; +drop role a; +drop table t1; + --echo # --echo # End of 10.3 tests --echo # diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index c6b1631523c..54ad81f94ce 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -6550,6 +6550,7 @@ static int update_role_columns(GRANT_TABLE *merged, } } +restart: for (uint i=0 ; i < mh->records ; i++) { GRANT_COLUMN *col = (GRANT_COLUMN *)my_hash_element(mh, i); @@ -6558,6 +6559,7 @@ static int update_role_columns(GRANT_TABLE *merged, { changed= 1; my_hash_delete(mh, (uchar*)col); + goto restart; } } DBUG_ASSERT(rights == merged->cols); From 90c39c5a500278d19240550f7c4bf370c441c100 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 1 Feb 2023 20:20:57 +0100 Subject: [PATCH 028/260] hopefully the last case of walk-and-delete HASH antipattern here global_index_stats is expected to be big, so we don't restart the search, but use a two-pass approach --- sql/handler.cc | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/sql/handler.cc b/sql/handler.cc index 42bfec6652f..d90522f0a13 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -7233,11 +7233,13 @@ static int del_global_index_stats_for_table(THD *thd, uchar* cache_key, size_t cache_key_length) { int res = 0; + uint to_delete_counter= 0; + INDEX_STATS *index_stats_to_delete[MAX_INDEXES]; DBUG_ENTER("del_global_index_stats_for_table"); mysql_mutex_lock(&LOCK_global_index_stats); - for (uint i= 0; i < global_index_stats.records;) + for (uint i= 0; i < global_index_stats.records; i++) { INDEX_STATS *index_stats = (INDEX_STATS*) my_hash_element(&global_index_stats, i); @@ -7247,19 +7249,13 @@ int del_global_index_stats_for_table(THD *thd, uchar* cache_key, size_t cache_ke index_stats->index_name_length >= cache_key_length && !memcmp(index_stats->index, cache_key, cache_key_length)) { - res= my_hash_delete(&global_index_stats, (uchar*)index_stats); - /* - In our HASH implementation on deletion one elements - is moved into a place where a deleted element was, - and the last element is moved into the empty space. - Thus we need to re-examine the current element, but - we don't have to restart the search from the beginning. - */ + index_stats_to_delete[to_delete_counter++]= index_stats; } - else - i++; } + for (uint i= 0; i < to_delete_counter; i++) + res= my_hash_delete(&global_index_stats, (uchar*)index_stats_to_delete[i]); + mysql_mutex_unlock(&LOCK_global_index_stats); DBUG_RETURN(res); } From a777a8a6a3c71ede8b88d20ab5c1a95590138611 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 2 Feb 2023 19:29:03 +0100 Subject: [PATCH 029/260] KILL USER and missing privileges note that `KILL USER foo` should *not* fail with ER_KILL_DENIED_ERROR when SHOW PROCESSLIST doesn't show connections of that user. Because no connections exist or because the caller has no PROCESS - doesn't matter. also, fix the error message to make sense ("You are not owner of thread " is ridiculous) --- mysql-test/main/kill-2.result | 31 +++++++++++++++++++++++++++++++ mysql-test/main/kill-2.test | 27 +++++++++++++++++++++++++++ sql/sql_parse.cc | 9 +++++++-- 3 files changed, 65 insertions(+), 2 deletions(-) diff --git a/mysql-test/main/kill-2.result b/mysql-test/main/kill-2.result index daaba2c092a..919078f3efb 100644 --- a/mysql-test/main/kill-2.result +++ b/mysql-test/main/kill-2.result @@ -10,3 +10,34 @@ foo root kill user foo@'127.0.0.1'; drop user foo@'127.0.0.1'; +# +# KILL USER and missing privileges +# +create user a@'127.0.0.1'; +create user b@'127.0.0.1'; +grant process on *.* to a@'127.0.0.1'; +grant select on *.* to b@'127.0.0.1'; +connect a,127.0.0.1,a; +show grants; +Grants for a@127.0.0.1 +GRANT PROCESS ON *.* TO `a`@`127.0.0.1` +connect b,127.0.0.1,b; +show processlist; +Id User Host db Command Time State Info Progress +# b # test # # Init show processlist # +kill user a; +kill user x; +connection a; +show processlist; +Id User Host db Command Time State Info Progress +# root # test # # # # # +# a # test # # # # # +# b # test # # # # # +kill user b; +ERROR HY000: Operation KILL USER failed for b@% +connection default; +drop user a@'127.0.0.1'; +drop user b@'127.0.0.1'; +# +# End of 10.3 tests +# diff --git a/mysql-test/main/kill-2.test b/mysql-test/main/kill-2.test index a30324fac44..1bbe395371c 100644 --- a/mysql-test/main/kill-2.test +++ b/mysql-test/main/kill-2.test @@ -28,3 +28,30 @@ let $wait_condition= --source include/wait_condition.inc drop user foo@'127.0.0.1'; --enable_service_connection + +--echo # +--echo # KILL USER and missing privileges +--echo # +create user a@'127.0.0.1'; +create user b@'127.0.0.1'; +grant process on *.* to a@'127.0.0.1'; +grant select on *.* to b@'127.0.0.1'; +--connect a,127.0.0.1,a +show grants; +--connect b,127.0.0.1,b +--replace_column 1 # 3 # 5 # 6 # 9 # +show processlist; +kill user a; # existing connection, but not visible to current_user +kill user x; # not existing connection +--connection a +--replace_column 1 # 3 # 5 # 6 # 7 # 8 # 9 # +show processlist; +--error ER_KILL_DENIED_ERROR +kill user b; +--connection default +drop user a@'127.0.0.1'; +drop user b@'127.0.0.1'; + +--echo # +--echo # End of 10.3 tests +--echo # diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index a00e5b82b12..1f1962a5d44 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -9258,7 +9258,9 @@ static my_bool kill_threads_callback(THD *thd, kill_threads_callback_arg *arg) { if (!(arg->thd->security_ctx->master_access & SUPER_ACL) && !arg->thd->security_ctx->user_matches(thd->security_ctx)) - return 1; + { + return MY_TEST(arg->thd->security_ctx->master_access & PROCESS_ACL); + } if (!arg->threads_to_kill.push_back(thd, arg->thd->mem_root)) { mysql_mutex_lock(&thd->LOCK_thd_kill); // Lock from delete @@ -9380,7 +9382,10 @@ void sql_kill_user(THD *thd, LEX_USER *user, killed_state state) my_ok(thd, rows); break; case ER_KILL_DENIED_ERROR: - my_error(error, MYF(0), (long long) thd->thread_id); + char buf[DEFINER_LENGTH+1]; + strxnmov(buf, sizeof(buf), user->user.str, "@", user->host.str, NULL); + my_printf_error(ER_KILL_DENIED_ERROR, ER_THD(thd, ER_CANNOT_USER), MYF(0), + "KILL USER", buf); break; case ER_OUT_OF_RESOURCES: default: From 839c7fcf38ef17f9627f63ebec3e82d814912973 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Thu, 23 Feb 2023 19:56:07 +0530 Subject: [PATCH 030/260] MDEV-30597 Assertion `flag == 1' failed in row_build_index_entry_low - dtuple_vcol_data_missing() should check the DATA_MISSING only for indexed virtual column. --- storage/innobase/row/row0vers.cc | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/storage/innobase/row/row0vers.cc b/storage/innobase/row/row0vers.cc index 0679f883897..9d2e6654c46 100644 --- a/storage/innobase/row/row0vers.cc +++ b/storage/innobase/row/row0vers.cc @@ -861,15 +861,25 @@ row_vers_build_cur_vrow( } /** Find out whether data tuple has missing data type -for virtualcolumn. +for indexed virtual column. @param tuple data tuple +@param index virtual index @return true if tuple has missing column type */ -static bool dtuple_vcol_data_missing(const dtuple_t &tuple) +static bool dtuple_vcol_data_missing(const dtuple_t &tuple, + dict_index_t *index) { - for (ulint i= 0; i < tuple.n_v_fields; i++) + for (ulint i= 0; i < index->n_uniq; i++) { - if (tuple.v_fields[i].type.mtype == DATA_MISSING) - return true; + dict_col_t *col= index->fields[i].col; + if (!col->is_virtual()) + continue; + dict_v_col_t *vcol= reinterpret_cast(col); + for (ulint j= 0; j < index->table->n_v_cols; j++) + { + if (vcol == &index->table->v_cols[j] + && tuple.v_fields[j].type.mtype == DATA_MISSING) + return true; + } } return false; } @@ -1102,7 +1112,7 @@ unsafe_to_purge: if (dict_index_has_virtual(index)) { if (vrow) { - if (dtuple_vcol_data_missing(*vrow)) { + if (dtuple_vcol_data_missing(*vrow, index)) { goto nochange_index; } /* Keep the virtual row info for the next From 841e8877ccb8ef5d692a22b4447383a360557326 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Mon, 27 Feb 2023 10:51:22 -0800 Subject: [PATCH 031/260] MDEV-28603 Invalid view when its definition uses TVC as single-value subquery Subselect_single_value_engine cannot handle table value constructor used as subquery. That's why any table value constructor TVC used as subquery is converted into a select over derived table whose specification is TVC. Currently the names of the columns of the derived table DT are taken from the first element of TVC and if the k-th component of the element happens to be a subquery the text representation of this subquery serves as the name of the k-th column of the derived table. References of all columns of the derived table DT compose the select list of the result of the conversion. If a definition of a view contained a table value constructor used as a subquery and the view was registered after this conversion had been applied we could register an invalid view definition if the first element of TVC contained a subquery as its component: the name of this component was taken from the original subquery, while the name of the corresponding column of the derived table was taken from the text representation of the subquery produced by the function SELECT_LEX::print() and these names were usually differ from each other. To avoid registration of such invalid views the function SELECT_LEX::print() now prints the original TVC instead of the select in which this TVC has been wrapped. Now the specification of registered view looks like as if no conversions from TVC to selects were done. Approved by Oleksandr Byelkin --- mysql-test/main/table_value_constr.result | 119 ++++++++++++++++++++++ mysql-test/main/table_value_constr.test | 74 ++++++++++++++ sql/mysqld.h | 2 + sql/sql_lex.cc | 1 + sql/sql_lex.h | 3 +- sql/sql_select.cc | 6 ++ sql/sql_show.cc | 3 +- sql/sql_tvc.cc | 1 + sql/sql_view.cc | 6 +- 9 files changed, 211 insertions(+), 4 deletions(-) diff --git a/mysql-test/main/table_value_constr.result b/mysql-test/main/table_value_constr.result index c8e6363c110..bd0aac5edce 100644 --- a/mysql-test/main/table_value_constr.result +++ b/mysql-test/main/table_value_constr.result @@ -3133,5 +3133,124 @@ INSERT INTO t1 (VALUES (IGNORE) UNION VALUES (IGNORE)); ERROR HY000: 'ignore' is not allowed in this context DROP TABLE t1; # +# MDEV-28603: VIEW with table value constructor used as single-value +# subquery contains subquery as its first element +# +create table t1 (a int); +insert into t1 values (3), (7), (1); +create table t2 (b int); +insert into t2 values (1), (2); +create view v as select (values ((select * from t1 where a > 5))) as m from t2; +select (values ((select * from t1 where a > 5))) as m from t2; +m +7 +7 +select * from v; +m +7 +7 +with cte as ( select (values ((select * from t1 where a > 5))) as m from t2 ) select * from cte; +m +7 +7 +explain select (values ((select * from t1 where a > 5))) as m from t2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 +4 SUBQUERY ALL NULL NULL NULL NULL 2 +2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used +3 SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where +explain select * from v; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 +5 SUBQUERY ALL NULL NULL NULL NULL 2 +3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used +4 SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where +explain with cte as ( select (values ((select * from t1 where a > 5))) as m from t2 ) select * from cte; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 +5 SUBQUERY ALL NULL NULL NULL NULL 2 +3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used +4 SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where +prepare stmt from "select (values ((select * from t1 where a > 5))) as m from t2"; +execute stmt; +m +7 +7 +execute stmt; +m +7 +7 +deallocate prepare stmt; +prepare stmt from "select * from v"; +execute stmt; +m +7 +7 +execute stmt; +m +7 +7 +deallocate prepare stmt; +prepare stmt from "with cte as ( select (values ((select * from t1 where a > 5))) as m from t2 ) select * from cte"; +execute stmt; +m +7 +7 +execute stmt; +m +7 +7 +deallocate prepare stmt; +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 (values ((select `t1`.`a` from `t1` where `t1`.`a` > 5))) AS `m` from `t2` latin1 latin1_swedish_ci +drop view v; +prepare stmt from "create view v as select (values ((select * from t1 where a > 5))) as m from t2"; +execute stmt; +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 (values ((select `t1`.`a` from `t1` where `t1`.`a` > 5))) AS `m` from `t2` latin1 latin1_swedish_ci +select * from v; +m +7 +7 +drop view v; +execute stmt; +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 (values ((select `t1`.`a` from `t1` where `t1`.`a` > 5))) AS `m` from `t2` latin1 latin1_swedish_ci +select * from v; +m +7 +7 +deallocate prepare stmt; +prepare stmt from "show create view v"; +execute stmt; +View Create View character_set_client collation_connection +v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select (values ((select `t1`.`a` from `t1` where `t1`.`a` > 5))) AS `m` from `t2` latin1 latin1_swedish_ci +execute stmt; +View Create View character_set_client collation_connection +v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select (values ((select `t1`.`a` from `t1` where `t1`.`a` > 5))) AS `m` from `t2` latin1 latin1_swedish_ci +deallocate prepare stmt; +drop view v; +create view v as select (values ((select * from t1 where a > 5 +union +select * from t1 where a > 7))) as m from t2; +select (values ((select * from t1 where a > 5 +union +select * from t1 where a > 7))) as m from t2; +m +7 +7 +select * from v; +m +7 +7 +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 (values ((select `t1`.`a` from `t1` where `t1`.`a` > 5 union select `t1`.`a` from `t1` where `t1`.`a` > 7))) AS `m` from `t2` latin1 latin1_swedish_ci +drop view v; +drop table t1,t2; +# # End of 10.4 tests # diff --git a/mysql-test/main/table_value_constr.test b/mysql-test/main/table_value_constr.test index 19af93e0137..1d58cd0819d 100644 --- a/mysql-test/main/table_value_constr.test +++ b/mysql-test/main/table_value_constr.test @@ -1736,6 +1736,80 @@ INSERT INTO t1 (VALUES (DEFAULT) UNION VALUES (DEFAULT)); INSERT INTO t1 (VALUES (IGNORE) UNION VALUES (IGNORE)); DROP TABLE t1; +--echo # +--echo # MDEV-28603: VIEW with table value constructor used as single-value +--echo # subquery contains subquery as its first element +--echo # + +create table t1 (a int); +insert into t1 values (3), (7), (1); +create table t2 (b int); +insert into t2 values (1), (2); + +let $q= +select (values ((select * from t1 where a > 5))) as m from t2; + +eval create view v as $q; + +eval $q; +eval select * from v; +eval with cte as ( $q ) select * from cte; + +eval explain $q; +eval explain select * from v; +eval explain with cte as ( $q ) select * from cte; + +eval prepare stmt from "$q"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +eval prepare stmt from "select * from v"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +eval prepare stmt from "with cte as ( $q ) select * from cte"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +show create view v; + +drop view v; + +eval prepare stmt from "create view v as $q"; +execute stmt; +show create view v; +select * from v; +drop view v; +execute stmt; +show create view v; +select * from v; +deallocate prepare stmt; + +prepare stmt from "show create view v"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +drop view v; + +let $q= +select (values ((select * from t1 where a > 5 + union + select * from t1 where a > 7))) as m from t2; + +eval create view v as $q; + +eval $q; +eval select * from v; + +show create view v; + +drop view v; +drop table t1,t2; + --echo # --echo # End of 10.4 tests --echo # diff --git a/sql/mysqld.h b/sql/mysqld.h index 60afb0b9dba..f521ea23638 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -755,6 +755,8 @@ enum enum_query_type // it evaluates to. Should be used for error messages, so that they // don't reveal values. QT_NO_DATA_EXPANSION= (1 << 9), + // Remove wrappers added for TVC when creating or showing view + QT_NO_WRAPPERS_FOR_TVC_IN_VIEW= (1 << 11), }; diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 24958b5adcc..62c7556dcd6 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -2487,6 +2487,7 @@ void st_select_lex::init_select() curr_tvc_name= 0; in_tvc= false; versioned_tables= 0; + is_tvc_wrapper= false; } /* diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 3545a4e8d74..8f25426a09c 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1132,7 +1132,8 @@ public: st_select_lex. */ uint curr_tvc_name; - + /* true <=> select has been created a TVC wrapper */ + bool is_tvc_wrapper; /* Needed to correctly generate 'PRIMARY' or 'SIMPLE' for select_type column of EXPLAIN diff --git a/sql/sql_select.cc b/sql/sql_select.cc index f83bf32130e..2c12d1c4c65 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -27992,6 +27992,12 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type) return; } + if (is_tvc_wrapper && (query_type & QT_NO_WRAPPERS_FOR_TVC_IN_VIEW)) + { + first_inner_unit()->first_select()->print(thd, str, query_type); + return; + } + if ((query_type & QT_SHOW_SELECT_NUMBER) && thd->lex->all_selects_list && thd->lex->all_selects_list->link_next && diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 9fee8ce5a6c..1ad20ac7593 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2707,7 +2707,8 @@ static int show_create_view(THD *thd, TABLE_LIST *table, String *buff) a different syntax, like when ANSI_QUOTES is defined. */ table->view->unit.print(buff, enum_query_type(QT_VIEW_INTERNAL | - QT_ITEM_ORIGINAL_FUNC_NULLIF)); + QT_ITEM_ORIGINAL_FUNC_NULLIF | + QT_NO_WRAPPERS_FOR_TVC_IN_VIEW)); if (table->with_check != VIEW_CHECK_NONE) { diff --git a/sql/sql_tvc.cc b/sql/sql_tvc.cc index d8e6770465d..71377d3661d 100644 --- a/sql/sql_tvc.cc +++ b/sql/sql_tvc.cc @@ -673,6 +673,7 @@ st_select_lex *wrap_tvc(THD *thd, st_select_lex *tvc_sl, wrapper_sl->parent_lex= lex; /* Used in init_query. */ wrapper_sl->init_query(); wrapper_sl->init_select(); + wrapper_sl->is_tvc_wrapper= true; wrapper_sl->nest_level= tvc_sl->nest_level; wrapper_sl->parsing_place= tvc_sl->parsing_place; diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 1efbc68fb8a..54debf98eff 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -956,10 +956,12 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view, thd->variables.sql_mode&= ~MODE_ANSI_QUOTES; lex->unit.print(&view_query, enum_query_type(QT_VIEW_INTERNAL | - QT_ITEM_ORIGINAL_FUNC_NULLIF)); + QT_ITEM_ORIGINAL_FUNC_NULLIF | + QT_NO_WRAPPERS_FOR_TVC_IN_VIEW)); lex->unit.print(&is_query, enum_query_type(QT_TO_SYSTEM_CHARSET | QT_WITHOUT_INTRODUCERS | - QT_ITEM_ORIGINAL_FUNC_NULLIF)); + QT_ITEM_ORIGINAL_FUNC_NULLIF | + QT_NO_WRAPPERS_FOR_TVC_IN_VIEW)); thd->variables.sql_mode|= sql_mode; } From 965bdf3e66a9265345003c6e172aad7b1864e280 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 28 Feb 2023 10:49:25 +0400 Subject: [PATCH 032/260] MDEV-30746 Regression in ucs2_general_mysql500_ci 1. Adding a separate MY_COLLATION_HANDLER my_collation_ucs2_general_mysql500_ci_handler implementing a proper order for ucs2_general_mysql500_ci The problem happened because ucs2_general_mysql500_ci erroneously used my_collation_ucs2_general_ci_handler. 2. Cosmetic changes: Renaming: - plane00_mysql500 to my_unicase_mysql500_page00 - my_unicase_pages_mysql500 to my_unicase_mysql500_pages to use the same naming style with: - my_unicase_default_page00 - my_unicase_defaul_pages 3. Moving code fragments from - handler::check_collation_compatibility() in handler.cc - upgrade_collation() in table.cc into new methods in class Charset, to reuse the code easier. --- mysql-test/main/ctype_ucs.result | 17 ++++ mysql-test/main/ctype_ucs.test | 12 +++ mysql-test/main/ctype_upgrade.result | 53 ++++++++++++ mysql-test/main/ctype_upgrade.test | 35 ++++++++ .../mariadb100428_ucs2_general_ci.MYD | Bin 0 -> 60 bytes .../mariadb100428_ucs2_general_ci.MYI | Bin 0 -> 2048 bytes .../mariadb100428_ucs2_general_ci.frm | Bin 0 -> 982 bytes sql/handler.cc | 15 +--- sql/sql_string.h | 77 ++++++++++++++++++ sql/table.cc | 40 ++------- strings/ctype-ucs2.c | 39 ++++++++- strings/ctype-unidata.h | 3 + strings/ctype-utf8.c | 18 ++-- 13 files changed, 251 insertions(+), 58 deletions(-) create mode 100644 mysql-test/std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.MYD create mode 100644 mysql-test/std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.MYI create mode 100644 mysql-test/std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.frm diff --git a/mysql-test/main/ctype_ucs.result b/mysql-test/main/ctype_ucs.result index 3e3115028ff..efd77990010 100644 --- a/mysql-test/main/ctype_ucs.result +++ b/mysql-test/main/ctype_ucs.result @@ -6442,5 +6442,22 @@ IS_IPV4('10.0.0.1') 1 SET NAMES utf8; # +# MDEV-30746 Regression in ucs2_general_mysql500_ci +# +SET NAMES utf8mb3; +CREATE TABLE t1 (a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_general_mysql500_ci); +INSERT INTO t1 VALUES ('s'),('z'),(_latin1 0xDF); +SELECT GROUP_CONCAT(a) FROM t1 GROUP BY a ORDER BY a; +GROUP_CONCAT(a) +s +z +ß +SELECT a, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 ORDER BY a; +a HEX(a) HEX(WEIGHT_STRING(a)) +s 0073 0053 +z 007A 005A +ß 00DF 00DF +DROP TABLE t1; +# # End of 10.4 tests # diff --git a/mysql-test/main/ctype_ucs.test b/mysql-test/main/ctype_ucs.test index e0bcae3f13d..9bff79abe22 100644 --- a/mysql-test/main/ctype_ucs.test +++ b/mysql-test/main/ctype_ucs.test @@ -1136,6 +1136,18 @@ SELECT IS_IPV6('::'); SELECT IS_IPV4('10.0.0.1'); SET NAMES utf8; +--echo # +--echo # MDEV-30746 Regression in ucs2_general_mysql500_ci +--echo # + +SET NAMES utf8mb3; +CREATE TABLE t1 (a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_general_mysql500_ci); +INSERT INTO t1 VALUES ('s'),('z'),(_latin1 0xDF); +SELECT GROUP_CONCAT(a) FROM t1 GROUP BY a ORDER BY a; +SELECT a, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 ORDER BY a; +DROP TABLE t1; + + --echo # --echo # End of 10.4 tests --echo # diff --git a/mysql-test/main/ctype_upgrade.result b/mysql-test/main/ctype_upgrade.result index 960d44f5937..b995e9f6265 100644 --- a/mysql-test/main/ctype_upgrade.result +++ b/mysql-test/main/ctype_upgrade.result @@ -399,3 +399,56 @@ DROP TABLE maria050313_utf8_croatian_ci; DROP TABLE maria050533_xxx_croatian_ci; DROP TABLE maria100004_xxx_croatian_ci; DROP TABLE mysql050614_xxx_croatian_ci; +# +# Start of 10.4 tests +# +# +# MDEV-30746 Regression in ucs2_general_mysql500_ci +# +SET NAMES utf8mb3; +SHOW CREATE TABLE t1; +ERROR HY000: Table rebuild required. Please do "ALTER TABLE `test.t1` FORCE" or dump/reload to fix it! +SELECT * FROM t1; +ERROR HY000: Table rebuild required. Please do "ALTER TABLE `test.t1` FORCE" or dump/reload to fix it! +SELECT * FROM t1 IGNORE KEY(a); +ERROR HY000: Table rebuild required. Please do "ALTER TABLE `test.t1` FORCE" or dump/reload to fix it! +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check error Upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it! +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +SELECT a, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 ORDER BY a; +a HEX(a) HEX(WEIGHT_STRING(a)) +s 0073 0053 +z 007A 005A +ß 00DF 00DF +SELECT a, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 FORCE KEY(a) ORDER BY a; +a HEX(a) HEX(WEIGHT_STRING(a)) +s 0073 0053 +z 007A 005A +ß 00DF 00DF +SELECT a, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 IGNORE KEY(a) ORDER BY a; +a HEX(a) HEX(WEIGHT_STRING(a)) +s 0073 0053 +z 007A 005A +ß 00DF 00DF +SELECT GROUP_CONCAT(a) FROM t1 GROUP BY a ORDER BY a; +GROUP_CONCAT(a) +s +z +ß +SELECT GROUP_CONCAT(a) FROM t1 IGNORE KEY(a) GROUP BY a ORDER BY a; +GROUP_CONCAT(a) +s +z +ß +SELECT GROUP_CONCAT(a) FROM t1 FORCE KEY(a) GROUP BY a ORDER BY a; +GROUP_CONCAT(a) +s +z +ß +DROP TABLE t1; +# +# End of 10.4 tests +# diff --git a/mysql-test/main/ctype_upgrade.test b/mysql-test/main/ctype_upgrade.test index fee962e7ceb..7cb1ec9b69d 100644 --- a/mysql-test/main/ctype_upgrade.test +++ b/mysql-test/main/ctype_upgrade.test @@ -203,3 +203,38 @@ DROP TABLE maria050313_utf8_croatian_ci; DROP TABLE maria050533_xxx_croatian_ci; DROP TABLE maria100004_xxx_croatian_ci; DROP TABLE mysql050614_xxx_croatian_ci; + + +--echo # +--echo # Start of 10.4 tests +--echo # + +--echo # +--echo # MDEV-30746 Regression in ucs2_general_mysql500_ci +--echo # + +SET NAMES utf8mb3; + +copy_file std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.frm $MYSQLD_DATADIR/test/t1.frm; +copy_file std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.MYD $MYSQLD_DATADIR/test/t1.MYD; +copy_file std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.MYI $MYSQLD_DATADIR/test/t1.MYI; + +--error ER_TABLE_NEEDS_REBUILD +SHOW CREATE TABLE t1; +--error ER_TABLE_NEEDS_REBUILD +SELECT * FROM t1; +--error ER_TABLE_NEEDS_REBUILD +SELECT * FROM t1 IGNORE KEY(a); +CHECK TABLE t1; +REPAIR TABLE t1; +SELECT a, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 ORDER BY a; +SELECT a, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 FORCE KEY(a) ORDER BY a; +SELECT a, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1 IGNORE KEY(a) ORDER BY a; +SELECT GROUP_CONCAT(a) FROM t1 GROUP BY a ORDER BY a; +SELECT GROUP_CONCAT(a) FROM t1 IGNORE KEY(a) GROUP BY a ORDER BY a; +SELECT GROUP_CONCAT(a) FROM t1 FORCE KEY(a) GROUP BY a ORDER BY a; +DROP TABLE t1; + +--echo # +--echo # End of 10.4 tests +--echo # diff --git a/mysql-test/std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.MYD b/mysql-test/std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.MYD new file mode 100644 index 0000000000000000000000000000000000000000..77a281667b55cc2362fbb0d7734cbc65665140c3 GIT binary patch literal 60 dcmZQ(VBz`4#8AwD1ehUWRY*b%P_g^SVgRRh1qJ{B literal 0 HcmV?d00001 diff --git a/mysql-test/std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.MYI b/mysql-test/std_data/ctype_upgrade/mariadb100428_ucs2_general_ci.MYI new file mode 100644 index 0000000000000000000000000000000000000000..20fc1b97c00fd3e7270fab2b6ceb7444023b1a8c GIT binary patch literal 2048 zcmezOkDZZ$nK6W6149bK5e7yEAmRX$3=Ee4K_n0`Lnt`O{2vM+A{;OY8yEvO?RpI; zX91N5+rq%W!hmWX14HuPnX$-fkodTb2AV@8a003WVJ0AU24WE?n}LlD;v}F+0YEVn zz{tpu0Tg#<;9&6JpAY0QFi0>s07Xf|W4;fj VHJGcwG$>s->mysql_version; - if (mysql_version < 50124) + if (mysql_version < Charset::latest_mariadb_version_with_collation_change()) { KEY *key= table->key_info; KEY *key_end= key + table->s->keys; @@ -4124,18 +4124,7 @@ int handler::check_collation_compatibility() continue; Field *field= table->field[key_part->fieldnr - 1]; uint cs_number= field->charset()->number; - if ((mysql_version < 50048 && - (cs_number == 11 || /* ascii_general_ci - bug #29499, bug #27562 */ - cs_number == 41 || /* latin7_general_ci - bug #29461 */ - cs_number == 42 || /* latin7_general_cs - bug #29461 */ - cs_number == 20 || /* latin7_estonian_cs - bug #29461 */ - cs_number == 21 || /* latin2_hungarian_ci - bug #29461 */ - cs_number == 22 || /* koi8u_general_ci - bug #29461 */ - cs_number == 23 || /* cp1251_ukrainian_ci - bug #29461 */ - cs_number == 26)) || /* cp1250_general_ci - bug #29461 */ - (mysql_version < 50124 && - (cs_number == 33 || /* utf8_general_ci - bug #27877 */ - cs_number == 35))) /* ucs2_general_ci - bug #27877 */ + if (Charset::collation_changed_order(mysql_version, cs_number)) return HA_ADMIN_NEEDS_UPGRADE; } } diff --git a/sql/sql_string.h b/sql/sql_string.h index 33efd783d73..491e2766643 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -184,6 +184,83 @@ public: { return m_charset != &my_charset_bin; } + + /* + The MariaDB version when the last collation change happened, + e.g. due to a bug fix. See functions below. + */ + static ulong latest_mariadb_version_with_collation_change() + { + return 110002; + } + + /* + Check if the collation with the given ID changed its order + since the given MariaDB version. + */ + static bool collation_changed_order(ulong mysql_version, uint cs_number) + { + if ((mysql_version < 50048 && + (cs_number == 11 || /* ascii_general_ci - bug #29499, bug #27562 */ + cs_number == 41 || /* latin7_general_ci - bug #29461 */ + cs_number == 42 || /* latin7_general_cs - bug #29461 */ + cs_number == 20 || /* latin7_estonian_cs - bug #29461 */ + cs_number == 21 || /* latin2_hungarian_ci - bug #29461 */ + cs_number == 22 || /* koi8u_general_ci - bug #29461 */ + cs_number == 23 || /* cp1251_ukrainian_ci - bug #29461 */ + cs_number == 26)) || /* cp1250_general_ci - bug #29461 */ + (mysql_version < 50124 && + (cs_number == 33 || /* utf8_general_ci - bug #27877 */ + cs_number == 35))) /* ucs2_general_ci - bug #27877 */ + return true; + + if (cs_number == 159 && /* ucs2_general_mysql500_ci - MDEV-30746 */ + ((mysql_version >= 100400 && mysql_version < 100429) || + (mysql_version >= 100500 && mysql_version < 100520) || + (mysql_version >= 100600 && mysql_version < 100613) || + (mysql_version >= 100700 && mysql_version < 100708) || + (mysql_version >= 100800 && mysql_version < 100808) || + (mysql_version >= 100900 && mysql_version < 100906) || + (mysql_version >= 101000 && mysql_version < 101004) || + (mysql_version >= 101100 && mysql_version < 101103) || + (mysql_version >= 110000 && mysql_version < 110002))) + return true; + return false; + } + + /** + Check if a collation has changed ID since the given version. + Return the new ID. + + @param mysql_version + @param cs_number - collation ID + + @retval the new collation ID (or cs_number, if no change) + */ + + static uint upgrade_collation_id(ulong mysql_version, uint cs_number) + { + if (mysql_version >= 50300 && mysql_version <= 50399) + { + switch (cs_number) { + case 149: return MY_PAGE2_COLLATION_ID_UCS2; // ucs2_crotian_ci + case 213: return MY_PAGE2_COLLATION_ID_UTF8; // utf8_crotian_ci + } + } + if ((mysql_version >= 50500 && mysql_version <= 50599) || + (mysql_version >= 100000 && mysql_version <= 100005)) + { + switch (cs_number) { + case 149: return MY_PAGE2_COLLATION_ID_UCS2; // ucs2_crotian_ci + case 213: return MY_PAGE2_COLLATION_ID_UTF8; // utf8_crotian_ci + case 214: return MY_PAGE2_COLLATION_ID_UTF32; // utf32_croatian_ci + case 215: return MY_PAGE2_COLLATION_ID_UTF16; // utf16_croatian_ci + case 245: return MY_PAGE2_COLLATION_ID_UTF8MB4;// utf8mb4_croatian_ci + } + } + return cs_number; + } + }; diff --git a/sql/table.cc b/sql/table.cc index 141b2e48880..20622d0e09f 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -929,39 +929,6 @@ static uint enum_value_with_check(THD *thd, TABLE_SHARE *share, } -/** - Check if a collation has changed number - - @param mysql_version - @param current collation number - - @retval new collation number (same as current collation number of no change) -*/ - -static uint upgrade_collation(ulong mysql_version, uint cs_number) -{ - if (mysql_version >= 50300 && mysql_version <= 50399) - { - switch (cs_number) { - case 149: return MY_PAGE2_COLLATION_ID_UCS2; // ucs2_crotian_ci - case 213: return MY_PAGE2_COLLATION_ID_UTF8; // utf8_crotian_ci - } - } - if ((mysql_version >= 50500 && mysql_version <= 50599) || - (mysql_version >= 100000 && mysql_version <= 100005)) - { - switch (cs_number) { - case 149: return MY_PAGE2_COLLATION_ID_UCS2; // ucs2_crotian_ci - case 213: return MY_PAGE2_COLLATION_ID_UTF8; // utf8_crotian_ci - case 214: return MY_PAGE2_COLLATION_ID_UTF32; // utf32_croatian_ci - case 215: return MY_PAGE2_COLLATION_ID_UTF16; // utf16_croatian_ci - case 245: return MY_PAGE2_COLLATION_ID_UTF8MB4;// utf8mb4_croatian_ci - } - } - return cs_number; -} - - void Column_definition_attributes::frm_pack_basic(uchar *buff) const { int2store(buff + 3, length); @@ -989,7 +956,7 @@ bool Column_definition_attributes::frm_unpack_charset(TABLE_SHARE *share, const uchar *buff) { uint cs_org= buff[14] + (((uint) buff[11]) << 8); - uint cs_new= upgrade_collation(share->mysql_version, cs_org); + uint cs_new= Charset::upgrade_collation_id(share->mysql_version, cs_org); if (cs_org != cs_new) share->incompatible_version|= HA_CREATE_USED_CHARSET; if (cs_new && !(charset= get_charset(cs_new, MYF(0)))) @@ -1735,7 +1702,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, if (!frm_image[32]) // New frm file in 3.23 { uint cs_org= (((uint) frm_image[41]) << 8) + (uint) frm_image[38]; - uint cs_new= upgrade_collation(share->mysql_version, cs_org); + uint cs_new= Charset::upgrade_collation_id(share->mysql_version, cs_org); if (cs_org != cs_new) share->incompatible_version|= HA_CREATE_USED_CHARSET; @@ -2760,6 +2727,9 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, goto err; field= key_part->field= share->field[key_part->fieldnr-1]; + if (Charset::collation_changed_order(share->mysql_version, + field->charset()->number)) + share->incompatible_version|= HA_CREATE_USED_CHARSET; key_part->type= field->key_type(); if (field->invisible > INVISIBLE_USER && !field->vers_sys_field()) diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index 2e6b1239c0a..80a267dbf1d 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -2987,6 +2987,14 @@ static inline int my_weight_mb2_ucs2_general_ci(uchar b0, uchar b1) } +static inline int my_weight_mb2_ucs2_general_mysql500_ci(uchar b0, uchar b1) +{ + my_wc_t wc= UCS2_CODE(b0, b1); + MY_UNICASE_CHARACTER *page= my_unicase_mysql500_pages[wc >> 8]; + return (int) (page ? page[wc & 0xFF].sort : wc); +} + + #define MY_FUNCTION_NAME(x) my_ ## x ## _ucs2_general_ci #define DEFINE_STRNXFRM_UNICODE #define DEFINE_STRNXFRM_UNICODE_NOPAD @@ -3000,6 +3008,18 @@ static inline int my_weight_mb2_ucs2_general_ci(uchar b0, uchar b1) #include "strcoll.inl" +#define MY_FUNCTION_NAME(x) my_ ## x ## _ucs2_general_mysql500_ci +#define DEFINE_STRNXFRM_UNICODE +#define MY_MB_WC(cs, pwc, s, e) my_mb_wc_ucs2_quick(pwc, s, e) +#define OPTIMIZE_ASCII 0 +#define UNICASE_MAXCHAR MY_UNICASE_INFO_DEFAULT_MAXCHAR +#define UNICASE_PAGE0 my_unicase_mysql500_page00 +#define UNICASE_PAGES my_unicase_mysql500_pages +#define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) +#define WEIGHT_MB2(b0,b1) my_weight_mb2_ucs2_general_mysql500_ci(b0,b1) +#include "strcoll.inl" + + #define MY_FUNCTION_NAME(x) my_ ## x ## _ucs2_bin #define DEFINE_STRNXFRM_UNICODE_BIN2 #define MY_MB_WC(cs, pwc, s, e) my_mb_wc_ucs2_quick(pwc, s, e) @@ -3285,6 +3305,23 @@ static MY_COLLATION_HANDLER my_collation_ucs2_general_ci_handler = }; +static MY_COLLATION_HANDLER my_collation_ucs2_general_mysql500_ci_handler = +{ + NULL, /* init */ + my_strnncoll_ucs2_general_mysql500_ci, + my_strnncollsp_ucs2_general_mysql500_ci, + my_strnncollsp_nchars_ucs2_general_mysql500_ci, + my_strnxfrm_ucs2_general_mysql500_ci, + my_strnxfrmlen_unicode, + my_like_range_generic, + my_wildcmp_ucs2_ci, + my_strcasecmp_mb2_or_mb4, + my_instr_mb, + my_hash_sort_ucs2, + my_propagate_simple +}; + + static MY_COLLATION_HANDLER my_collation_ucs2_bin_handler = { NULL, /* init */ @@ -3431,7 +3468,7 @@ struct charset_info_st my_charset_ucs2_general_mysql500_ci= 0, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_order */ &my_charset_ucs2_handler, - &my_collation_ucs2_general_ci_handler + &my_collation_ucs2_general_mysql500_ci_handler }; diff --git a/strings/ctype-unidata.h b/strings/ctype-unidata.h index 6712f5e1d79..9900fd0cedd 100644 --- a/strings/ctype-unidata.h +++ b/strings/ctype-unidata.h @@ -21,6 +21,9 @@ extern MY_UNICASE_CHARACTER my_unicase_default_page00[256]; extern MY_UNICASE_CHARACTER *my_unicase_default_pages[256]; +extern MY_UNICASE_CHARACTER my_unicase_mysql500_page00[256]; +extern MY_UNICASE_CHARACTER *my_unicase_mysql500_pages[256]; + size_t my_strxfrm_pad_nweights_unicode(uchar *str, uchar *strend, size_t nweights); size_t my_strxfrm_pad_unicode(uchar *str, uchar *strend); diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 69ebb6b523e..cdac17be3c6 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -248,7 +248,7 @@ MY_UNICASE_CHARACTER my_unicase_default_page00[]={ Almost similar to my_unicase_default_page00, but maps sorting order for U+00DF to 0x00DF instead of 0x0053. */ -static MY_UNICASE_CHARACTER plane00_mysql500[]={ +MY_UNICASE_CHARACTER my_unicase_mysql500_page00[]={ {0x0000,0x0000,0x0000}, {0x0001,0x0001,0x0001}, {0x0002,0x0002,0x0002}, {0x0003,0x0003,0x0003}, {0x0004,0x0004,0x0004}, {0x0005,0x0005,0x0005}, @@ -1739,8 +1739,8 @@ MY_UNICASE_INFO my_unicase_default= /* Reproduce old utf8_general_ci behaviour before we fixed Bug#27877. */ -MY_UNICASE_CHARACTER *my_unicase_pages_mysql500[256]={ - plane00_mysql500, +MY_UNICASE_CHARACTER *my_unicase_mysql500_pages[256]={ + my_unicase_mysql500_page00, plane01, plane02, plane03, plane04, plane05, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -1780,7 +1780,7 @@ MY_UNICASE_CHARACTER *my_unicase_pages_mysql500[256]={ MY_UNICASE_INFO my_unicase_mysql500= { 0xFFFF, - my_unicase_pages_mysql500 + my_unicase_mysql500_pages }; @@ -5266,14 +5266,14 @@ static inline int my_weight_mb3_utf8_general_ci(uchar b0, uchar b1, uchar b2) static inline int my_weight_mb1_utf8_general_mysql500_ci(uchar b) { - return (int) plane00_mysql500[b & 0xFF].sort; + return (int) my_unicase_mysql500_page00[b & 0xFF].sort; } static inline int my_weight_mb2_utf8_general_mysql500_ci(uchar b0, uchar b1) { my_wc_t wc= UTF8MB2_CODE(b0, b1); - MY_UNICASE_CHARACTER *page= my_unicase_pages_mysql500[wc >> 8]; + MY_UNICASE_CHARACTER *page= my_unicase_mysql500_pages[wc >> 8]; return (int) (page ? page[wc & 0xFF].sort : wc); } @@ -5282,7 +5282,7 @@ static inline int my_weight_mb3_utf8_general_mysql500_ci(uchar b0, uchar b1, uchar b2) { my_wc_t wc= UTF8MB3_CODE(b0, b1, b2); - MY_UNICASE_CHARACTER *page= my_unicase_pages_mysql500[wc >> 8]; + MY_UNICASE_CHARACTER *page= my_unicase_mysql500_pages[wc >> 8]; return (int) (page ? page[wc & 0xFF].sort : wc); } @@ -5292,8 +5292,8 @@ my_weight_mb3_utf8_general_mysql500_ci(uchar b0, uchar b1, uchar b2) #define MY_MB_WC(cs, pwc, s, e) my_mb_wc_utf8mb3_quick(pwc, s, e) #define OPTIMIZE_ASCII 1 #define UNICASE_MAXCHAR MY_UNICASE_INFO_DEFAULT_MAXCHAR -#define UNICASE_PAGE0 plane00_mysql500 -#define UNICASE_PAGES my_unicase_pages_mysql500 +#define UNICASE_PAGE0 my_unicase_mysql500_page00 +#define UNICASE_PAGES my_unicase_mysql500_pages #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB1(x) my_weight_mb1_utf8_general_mysql500_ci(x) #define WEIGHT_MB2(x,y) my_weight_mb2_utf8_general_mysql500_ci(x,y) From acfb5dfd973e0b63090a32bbf90f380317192ab5 Mon Sep 17 00:00:00 2001 From: Lorna Luo Date: Wed, 1 Mar 2023 20:46:18 +0000 Subject: [PATCH 033/260] MDEV-22683: Ensure system tables are correctly upgraded in MariaDB 10.4 Running mysql_upgrade should end up with the exact same system tables as fresh installations have after running mysql_install_db. To ensure the upgrade is correct and complete: - Remove the redundant modification of thread_id`. On 5.5 version, the `general_log` table was created as `CREATE TABLE IF NOT EXISTS general_log (..., thread_id INTEGER NOT NULL, ...)`, and starting from 10.0+, the table is created as `CREATE TABLE IF NOT EXISTS general_log (..., thread_id BIGINT(21) UNSIGNED NOT NULL, ...)`, but mysql_upgrade is not properly upgrading the table. It modifies the `thread_id` twice in one query, which could leave the table not modified and lead to other potential error when upgrading from MariaDB 5.5 or older. - Update `servers` to ensure `Host` and `User` has correct data type if upgrading from 10.1 or older. On versions 10.0 and 10.1, the `servers` table was created as `CREATE TABLE IF NOT EXISTS servers (..., Host char(64) NOT NULL DEFAULT , ..., Owner char(64) NOT NULL DEFAULT , ...)`, and starting from 10.2, the table is created as `CREATE TABLE IF NOT EXISTS servers (..., Host varchar(2048) NOT NULL DEFAULT , ..., Owner varchar(512) NOT NULL DEFAULT , ...)`. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc. --- .../main/system_mysql_db_fix50030.result | 4 +- .../main/system_mysql_db_fix50117.result | 4 +- .../main/system_mysql_db_fix50568.result | 297 ++++++++++++++++++ mysql-test/main/system_mysql_db_fix50568.test | 99 ++++++ scripts/mysql_system_tables_fix.sql | 6 +- 5 files changed, 405 insertions(+), 5 deletions(-) create mode 100644 mysql-test/main/system_mysql_db_fix50568.result create mode 100644 mysql-test/main/system_mysql_db_fix50568.test diff --git a/mysql-test/main/system_mysql_db_fix50030.result b/mysql-test/main/system_mysql_db_fix50030.result index f6edd821822..b02a50a8d3d 100644 --- a/mysql-test/main/system_mysql_db_fix50030.result +++ b/mysql-test/main/system_mysql_db_fix50030.result @@ -166,14 +166,14 @@ show create table servers; Table Create Table servers CREATE TABLE `servers` ( `Server_name` char(64) NOT NULL DEFAULT '', - `Host` char(64) NOT NULL DEFAULT '', + `Host` varchar(2048) NOT NULL DEFAULT '', `Db` char(64) NOT NULL DEFAULT '', `Username` char(80) NOT NULL DEFAULT '', `Password` char(64) NOT NULL DEFAULT '', `Port` int(4) NOT NULL DEFAULT 0, `Socket` char(64) NOT NULL DEFAULT '', `Wrapper` char(64) NOT NULL DEFAULT '', - `Owner` char(64) NOT NULL DEFAULT '', + `Owner` varchar(512) NOT NULL DEFAULT '', PRIMARY KEY (`Server_name`) ) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='MySQL Foreign Servers table' show create table proc; diff --git a/mysql-test/main/system_mysql_db_fix50117.result b/mysql-test/main/system_mysql_db_fix50117.result index 84861744a70..ca817b198c6 100644 --- a/mysql-test/main/system_mysql_db_fix50117.result +++ b/mysql-test/main/system_mysql_db_fix50117.result @@ -146,14 +146,14 @@ show create table servers; Table Create Table servers CREATE TABLE `servers` ( `Server_name` char(64) NOT NULL DEFAULT '', - `Host` char(64) NOT NULL DEFAULT '', + `Host` varchar(2048) NOT NULL DEFAULT '', `Db` char(64) NOT NULL DEFAULT '', `Username` char(80) NOT NULL DEFAULT '', `Password` char(64) NOT NULL DEFAULT '', `Port` int(4) NOT NULL DEFAULT 0, `Socket` char(64) NOT NULL DEFAULT '', `Wrapper` char(64) NOT NULL DEFAULT '', - `Owner` char(64) NOT NULL DEFAULT '', + `Owner` varchar(512) NOT NULL DEFAULT '', PRIMARY KEY (`Server_name`) ) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='MySQL Foreign Servers table' show create table proc; diff --git a/mysql-test/main/system_mysql_db_fix50568.result b/mysql-test/main/system_mysql_db_fix50568.result new file mode 100644 index 00000000000..898b11a6ce4 --- /dev/null +++ b/mysql-test/main/system_mysql_db_fix50568.result @@ -0,0 +1,297 @@ +use test; +CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; +Warnings: +Warning 1280 Name 'Host' ignored for PRIMARY key. +CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; +Warnings: +Warning 1280 Name 'Host' ignored for PRIMARY key. +CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) DEFAULT 0 NOT NULL, plugin char(64) CHARACTER SET latin1 DEFAULT '' NOT NULL, authentication_string TEXT NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; +Warnings: +Warning 1280 Name 'Host' ignored for PRIMARY key. +CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; +CREATE TABLE IF NOT EXISTS plugin ( name varchar(64) DEFAULT '' NOT NULL, dl varchar(128) DEFAULT '' NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci comment='MySQL plugins'; +CREATE TABLE IF NOT EXISTS servers ( Server_name char(64) NOT NULL DEFAULT '', Host char(64) NOT NULL DEFAULT '', Db char(64) NOT NULL DEFAULT '', Username char(64) NOT NULL DEFAULT '', Password char(64) NOT NULL DEFAULT '', Port INT(4) NOT NULL DEFAULT '0', Socket char(64) NOT NULL DEFAULT '', Wrapper char(64) NOT NULL DEFAULT '', Owner char(64) NOT NULL DEFAULT '', PRIMARY KEY (Server_name)) CHARACTER SET utf8 comment='MySQL Foreign Servers table'; +CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp, Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; +CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; +CREATE TABLE IF NOT EXISTS help_topic ( help_topic_id int unsigned not null, name char(64) not null, help_category_id smallint unsigned not null, description text not null, example text not null, url text not null, primary key (help_topic_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help topics'; +CREATE TABLE IF NOT EXISTS help_category ( help_category_id smallint unsigned not null, name char(64) not null, parent_category_id smallint unsigned null, url text not null, primary key (help_category_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help categories'; +CREATE TABLE IF NOT EXISTS help_relation ( help_topic_id int unsigned not null references help_topic, help_keyword_id int unsigned not null references help_keyword, primary key (help_keyword_id, help_topic_id) ) engine=MyISAM CHARACTER SET utf8 comment='keyword-topic relation'; +CREATE TABLE IF NOT EXISTS help_keyword ( help_keyword_id int unsigned not null, name char(64) not null, primary key (help_keyword_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help keywords'; +CREATE TABLE IF NOT EXISTS time_zone_name ( Name char(64) NOT NULL, Time_zone_id int unsigned NOT NULL, PRIMARY KEY Name (Name) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone names'; +Warnings: +Warning 1280 Name 'Name' ignored for PRIMARY key. +CREATE TABLE IF NOT EXISTS time_zone ( Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY TzId (Time_zone_id) ) engine=MyISAM CHARACTER SET utf8 comment='Time zones'; +Warnings: +Warning 1280 Name 'TzId' ignored for PRIMARY key. +CREATE TABLE IF NOT EXISTS time_zone_transition ( Time_zone_id int unsigned NOT NULL, Transition_time bigint signed NOT NULL, Transition_type_id int unsigned NOT NULL, PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone transitions'; +Warnings: +Warning 1280 Name 'TzIdTranTime' ignored for PRIMARY key. +CREATE TABLE IF NOT EXISTS time_zone_transition_type ( Time_zone_id int unsigned NOT NULL, Transition_type_id int unsigned NOT NULL, Offset int signed DEFAULT 0 NOT NULL, Is_DST tinyint unsigned DEFAULT 0 NOT NULL, Abbreviation char(8) DEFAULT '' NOT NULL, PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone transition types'; +Warnings: +Warning 1280 Name 'TzIdTrTId' ignored for PRIMARY key. +CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint signed NOT NULL, Correction int signed NOT NULL, PRIMARY KEY TranTime (Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones'; +Warnings: +Warning 1280 Name 'TranTime' ignored for PRIMARY key. +CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns longblob DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'IGNORE_BAD_TABLE_OPTIONS', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE', 'NO_ENGINE_SUBSTITUTION', 'PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment text collate utf8_bin NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures'; +CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) COLLATE utf8_general_ci DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp, PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; +CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator INTEGER UNSIGNED NOT NULL, time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; +CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; +CREATE TABLE IF NOT EXISTS proxies_priv (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Proxied_host char(60) binary DEFAULT '' NOT NULL, Proxied_user char(16) binary DEFAULT '' NOT NULL, With_grant BOOL DEFAULT 0 NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp, PRIMARY KEY Host (Host,User,Proxied_host,Proxied_user), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User proxy privileges'; +Warnings: +Warning 1280 Name 'Host' ignored for PRIMARY key. +show tables; +Tables_in_db +column_stats +columns_priv +db +event +func +general_log +global_priv +gtid_slave_pos +help_category +help_keyword +help_relation +help_topic +host +index_stats +innodb_index_stats +innodb_table_stats +ndb_binlog_index +plugin +proc +procs_priv +proxies_priv +roles_mapping +servers +slow_log +table_stats +tables_priv +time_zone +time_zone_leap_second +time_zone_name +time_zone_transition +time_zone_transition_type +transaction_registry +user +show create table db; +Table Create Table +db CREATE TABLE `db` ( + `Host` char(60) NOT NULL DEFAULT '', + `Db` char(64) NOT NULL DEFAULT '', + `User` char(80) NOT NULL DEFAULT '', + `Select_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + `Insert_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + `Update_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + `Delete_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + `Create_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + `Drop_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + `Grant_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + `References_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + `Index_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + `Alter_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + `Create_view_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + `Show_view_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + `Execute_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + `Event_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + `Trigger_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + `Delete_history_priv` enum('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N', + PRIMARY KEY (`Host`,`Db`,`User`), + KEY `User` (`User`) +) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges' +show create table user; +View Create View character_set_client collation_connection +user CREATE ALGORITHM=UNDEFINED DEFINER=`mariadb.sys`@`localhost` SQL SECURITY DEFINER VIEW `user` AS select `global_priv`.`Host` AS `Host`,`global_priv`.`User` AS `User`,if(json_value(`global_priv`.`Priv`,'$.plugin') in ('mysql_native_password','mysql_old_password'),ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),''),'') AS `Password`,if(json_value(`global_priv`.`Priv`,'$.access') & 1,'Y','N') AS `Select_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2,'Y','N') AS `Insert_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4,'Y','N') AS `Update_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8,'Y','N') AS `Delete_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16,'Y','N') AS `Create_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32,'Y','N') AS `Drop_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 64,'Y','N') AS `Reload_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 128,'Y','N') AS `Shutdown_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 256,'Y','N') AS `Process_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 512,'Y','N') AS `File_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1024,'Y','N') AS `Grant_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2048,'Y','N') AS `References_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4096,'Y','N') AS `Index_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8192,'Y','N') AS `Alter_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16384,'Y','N') AS `Show_db_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 32768,'Y','N') AS `Super_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 65536,'Y','N') AS `Create_tmp_table_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 131072,'Y','N') AS `Lock_tables_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 262144,'Y','N') AS `Execute_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 524288,'Y','N') AS `Repl_slave_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 1048576,'Y','N') AS `Repl_client_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 2097152,'Y','N') AS `Create_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 4194304,'Y','N') AS `Show_view_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 8388608,'Y','N') AS `Create_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 16777216,'Y','N') AS `Alter_routine_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 33554432,'Y','N') AS `Create_user_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 67108864,'Y','N') AS `Event_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 134217728,'Y','N') AS `Trigger_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 268435456,'Y','N') AS `Create_tablespace_priv`,if(json_value(`global_priv`.`Priv`,'$.access') & 536870912,'Y','N') AS `Delete_history_priv`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.ssl_type'),0) + 1,'','ANY','X509','SPECIFIED') AS `ssl_type`,ifnull(json_value(`global_priv`.`Priv`,'$.ssl_cipher'),'') AS `ssl_cipher`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_issuer'),'') AS `x509_issuer`,ifnull(json_value(`global_priv`.`Priv`,'$.x509_subject'),'') AS `x509_subject`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_questions'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_updates'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_connections'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_user_connections'),0) as signed) AS `max_user_connections`,ifnull(json_value(`global_priv`.`Priv`,'$.plugin'),'') AS `plugin`,ifnull(json_value(`global_priv`.`Priv`,'$.authentication_string'),'') AS `authentication_string`,if(ifnull(json_value(`global_priv`.`Priv`,'$.password_last_changed'),1) = 0,'Y','N') AS `password_expired`,elt(ifnull(json_value(`global_priv`.`Priv`,'$.is_role'),0) + 1,'N','Y') AS `is_role`,ifnull(json_value(`global_priv`.`Priv`,'$.default_role'),'') AS `default_role`,cast(ifnull(json_value(`global_priv`.`Priv`,'$.max_statement_time'),0.0) as decimal(12,6)) AS `max_statement_time` from `global_priv` latin1 latin1_swedish_ci +show create table func; +Table Create Table +func CREATE TABLE `func` ( + `name` char(64) NOT NULL DEFAULT '', + `ret` tinyint(1) NOT NULL DEFAULT 0, + `dl` char(128) NOT NULL DEFAULT '', + `type` enum('function','aggregate') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + PRIMARY KEY (`name`) +) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='User defined functions' +show create table global_priv; +Table Create Table +global_priv CREATE TABLE `global_priv` ( + `Host` char(60) NOT NULL DEFAULT '', + `User` char(80) NOT NULL DEFAULT '', + `Priv` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '{}' CHECK (json_valid(`Priv`)), + PRIMARY KEY (`Host`,`User`) +) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Users and global privileges' +show create table tables_priv; +Table Create Table +tables_priv CREATE TABLE `tables_priv` ( + `Host` char(60) NOT NULL DEFAULT '', + `Db` char(64) NOT NULL DEFAULT '', + `User` char(80) NOT NULL DEFAULT '', + `Table_name` char(64) NOT NULL DEFAULT '', + `Grantor` char(141) NOT NULL DEFAULT '', + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger','Delete versioning rows') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '', + `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '', + PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`), + KEY `Grantor` (`Grantor`) +) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Table privileges' +show create table columns_priv; +Table Create Table +columns_priv CREATE TABLE `columns_priv` ( + `Host` char(60) NOT NULL DEFAULT '', + `Db` char(64) NOT NULL DEFAULT '', + `User` char(80) NOT NULL DEFAULT '', + `Table_name` char(64) NOT NULL DEFAULT '', + `Column_name` char(64) NOT NULL DEFAULT '', + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '', + PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`) +) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Column privileges' +show create table procs_priv; +Table Create Table +procs_priv CREATE TABLE `procs_priv` ( + `Host` char(60) NOT NULL DEFAULT '', + `Db` char(64) NOT NULL DEFAULT '', + `User` char(80) NOT NULL DEFAULT '', + `Routine_name` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '', + `Routine_type` enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') NOT NULL, + `Grantor` char(141) NOT NULL DEFAULT '', + `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '', + `Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`), + KEY `Grantor` (`Grantor`) +) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Procedure privileges' +show create table servers; +Table Create Table +servers CREATE TABLE `servers` ( + `Server_name` char(64) NOT NULL DEFAULT '', + `Host` varchar(2048) NOT NULL DEFAULT '', + `Db` char(64) NOT NULL DEFAULT '', + `Username` char(80) NOT NULL DEFAULT '', + `Password` char(64) NOT NULL DEFAULT '', + `Port` int(4) NOT NULL DEFAULT 0, + `Socket` char(64) NOT NULL DEFAULT '', + `Wrapper` char(64) NOT NULL DEFAULT '', + `Owner` varchar(512) NOT NULL DEFAULT '', + PRIMARY KEY (`Server_name`) +) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='MySQL Foreign Servers table' +show create table proc; +Table Create Table +proc CREATE TABLE `proc` ( + `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `name` char(64) NOT NULL DEFAULT '', + `type` enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') NOT NULL, + `specific_name` char(64) NOT NULL DEFAULT '', + `language` enum('SQL') NOT NULL DEFAULT 'SQL', + `sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL DEFAULT 'CONTAINS_SQL', + `is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO', + `security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER', + `param_list` blob NOT NULL, + `returns` longblob NOT NULL, + `body` longblob NOT NULL, + `definer` char(141) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT','TIME_ROUND_FRACTIONAL') NOT NULL DEFAULT '', + `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `body_utf8` longblob DEFAULT NULL, + `aggregate` enum('NONE','GROUP') NOT NULL DEFAULT 'NONE', + PRIMARY KEY (`db`,`name`,`type`) +) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Stored Procedures' +show create table event; +Table Create Table +event CREATE TABLE `event` ( + `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `name` char(64) NOT NULL DEFAULT '', + `body` longblob NOT NULL, + `definer` char(141) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `execute_at` datetime DEFAULT NULL, + `interval_value` int(11) DEFAULT NULL, + `interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL, + `created` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `last_executed` datetime DEFAULT NULL, + `starts` datetime DEFAULT NULL, + `ends` datetime DEFAULT NULL, + `status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED', + `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP', + `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT','TIME_ROUND_FRACTIONAL') NOT NULL DEFAULT '', + `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', + `originator` int(10) unsigned NOT NULL, + `time_zone` char(64) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'SYSTEM', + `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `body_utf8` longblob DEFAULT NULL, + PRIMARY KEY (`db`,`name`) +) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Events' +show create table general_log; +Table Create Table +general_log CREATE TABLE `general_log` ( + `event_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), + `user_host` mediumtext NOT NULL, + `thread_id` bigint(21) unsigned NOT NULL, + `server_id` int(10) unsigned NOT NULL, + `command_type` varchar(64) NOT NULL, + `argument` mediumtext NOT NULL +) ENGINE=CSV DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='General log' +show create table slow_log; +Table Create Table +slow_log CREATE TABLE `slow_log` ( + `start_time` timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6), + `user_host` mediumtext NOT NULL, + `query_time` time(6) NOT NULL, + `lock_time` time(6) NOT NULL, + `rows_sent` int(11) NOT NULL, + `rows_examined` int(11) NOT NULL, + `db` varchar(512) NOT NULL, + `last_insert_id` int(11) NOT NULL, + `insert_id` int(11) NOT NULL, + `server_id` int(10) unsigned NOT NULL, + `sql_text` mediumtext NOT NULL, + `thread_id` bigint(21) unsigned NOT NULL, + `rows_affected` int(11) NOT NULL +) ENGINE=CSV DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='Slow log' +show create table table_stats; +Table Create Table +table_stats CREATE TABLE `table_stats` ( + `db_name` varchar(64) NOT NULL, + `table_name` varchar(64) NOT NULL, + `cardinality` bigint(21) unsigned DEFAULT NULL, + PRIMARY KEY (`db_name`,`table_name`) +) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=0 COMMENT='Statistics on Tables' +show create table column_stats; +Table Create Table +column_stats CREATE TABLE `column_stats` ( + `db_name` varchar(64) NOT NULL, + `table_name` varchar(64) NOT NULL, + `column_name` varchar(64) NOT NULL, + `min_value` varbinary(255) DEFAULT NULL, + `max_value` varbinary(255) DEFAULT NULL, + `nulls_ratio` decimal(12,4) DEFAULT NULL, + `avg_length` decimal(12,4) DEFAULT NULL, + `avg_frequency` decimal(12,4) DEFAULT NULL, + `hist_size` tinyint(3) unsigned DEFAULT NULL, + `hist_type` enum('SINGLE_PREC_HB','DOUBLE_PREC_HB') DEFAULT NULL, + `histogram` varbinary(255) DEFAULT NULL, + PRIMARY KEY (`db_name`,`table_name`,`column_name`) +) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=0 COMMENT='Statistics on Columns' +show create table index_stats; +Table Create Table +index_stats CREATE TABLE `index_stats` ( + `db_name` varchar(64) NOT NULL, + `table_name` varchar(64) NOT NULL, + `index_name` varchar(64) NOT NULL, + `prefix_arity` int(11) unsigned NOT NULL, + `avg_frequency` decimal(12,4) DEFAULT NULL, + PRIMARY KEY (`db_name`,`table_name`,`index_name`,`prefix_arity`) +) ENGINE=Aria DEFAULT CHARSET=utf8 COLLATE=utf8_bin PAGE_CHECKSUM=1 TRANSACTIONAL=0 COMMENT='Statistics on Indexes' +DROP VIEW user; +DROP TABLE db, host, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, event, proxies_priv, general_log, slow_log, innodb_index_stats, innodb_table_stats, transaction_registry, table_stats, column_stats, index_stats, roles_mapping, gtid_slave_pos, global_priv, ndb_binlog_index; +show tables; +Tables_in_test diff --git a/mysql-test/main/system_mysql_db_fix50568.test b/mysql-test/main/system_mysql_db_fix50568.test new file mode 100644 index 00000000000..9ecb2a23d5f --- /dev/null +++ b/mysql-test/main/system_mysql_db_fix50568.test @@ -0,0 +1,99 @@ +# Embedded server doesn't support external clients +--source include/not_embedded.inc +--source include/have_innodb.inc + +# Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set +# to the location of mysql_fix_privilege_tables.sql +if (!$MYSQL_FIX_PRIVILEGE_TABLES) +{ + skip Test needs MYSQL_FIX_PRIVILEGE_TABLES; +} + +# +# This is the test for mysql_fix_privilege_tables +# It checks that a system tables from mysql 5.5.68 +# can be upgraded to current system table format +# +# Note: If this test fails, don't be confused about the errors reported +# by mysql-test-run This shows warnings generated by +# mysql_fix_system_tables which should be ignored. +# Instead, concentrate on the errors in r/system_mysql_db.reject + +use test; + +# create system tables as in mysql-5.5.68 +CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; + +CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; + +CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) DEFAULT 0 NOT NULL, plugin char(64) CHARACTER SET latin1 DEFAULT '' NOT NULL, authentication_string TEXT NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; + +CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; + + +CREATE TABLE IF NOT EXISTS plugin ( name varchar(64) DEFAULT '' NOT NULL, dl varchar(128) DEFAULT '' NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci comment='MySQL plugins'; + + +CREATE TABLE IF NOT EXISTS servers ( Server_name char(64) NOT NULL DEFAULT '', Host char(64) NOT NULL DEFAULT '', Db char(64) NOT NULL DEFAULT '', Username char(64) NOT NULL DEFAULT '', Password char(64) NOT NULL DEFAULT '', Port INT(4) NOT NULL DEFAULT '0', Socket char(64) NOT NULL DEFAULT '', Wrapper char(64) NOT NULL DEFAULT '', Owner char(64) NOT NULL DEFAULT '', PRIMARY KEY (Server_name)) CHARACTER SET utf8 comment='MySQL Foreign Servers table'; + + +CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp, Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; + +CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; + + +CREATE TABLE IF NOT EXISTS help_topic ( help_topic_id int unsigned not null, name char(64) not null, help_category_id smallint unsigned not null, description text not null, example text not null, url text not null, primary key (help_topic_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help topics'; + + +CREATE TABLE IF NOT EXISTS help_category ( help_category_id smallint unsigned not null, name char(64) not null, parent_category_id smallint unsigned null, url text not null, primary key (help_category_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help categories'; + + +CREATE TABLE IF NOT EXISTS help_relation ( help_topic_id int unsigned not null references help_topic, help_keyword_id int unsigned not null references help_keyword, primary key (help_keyword_id, help_topic_id) ) engine=MyISAM CHARACTER SET utf8 comment='keyword-topic relation'; + + +CREATE TABLE IF NOT EXISTS help_keyword ( help_keyword_id int unsigned not null, name char(64) not null, primary key (help_keyword_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help keywords'; + + +CREATE TABLE IF NOT EXISTS time_zone_name ( Name char(64) NOT NULL, Time_zone_id int unsigned NOT NULL, PRIMARY KEY Name (Name) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone names'; + + +CREATE TABLE IF NOT EXISTS time_zone ( Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY TzId (Time_zone_id) ) engine=MyISAM CHARACTER SET utf8 comment='Time zones'; + + +CREATE TABLE IF NOT EXISTS time_zone_transition ( Time_zone_id int unsigned NOT NULL, Transition_time bigint signed NOT NULL, Transition_type_id int unsigned NOT NULL, PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone transitions'; + + +CREATE TABLE IF NOT EXISTS time_zone_transition_type ( Time_zone_id int unsigned NOT NULL, Transition_type_id int unsigned NOT NULL, Offset int signed DEFAULT 0 NOT NULL, Is_DST tinyint unsigned DEFAULT 0 NOT NULL, Abbreviation char(8) DEFAULT '' NOT NULL, PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone transition types'; + + +CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint signed NOT NULL, Correction int signed NOT NULL, PRIMARY KEY TranTime (Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones'; + +CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns longblob DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'IGNORE_BAD_TABLE_OPTIONS', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE', 'NO_ENGINE_SUBSTITUTION', 'PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment text collate utf8_bin NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures'; + +CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) COLLATE utf8_general_ci DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp, PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; + + +CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL, modified TIMESTAMP NOT NULL, last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator INTEGER UNSIGNED NOT NULL, time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; + + +CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; + +CREATE TABLE IF NOT EXISTS proxies_priv (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Proxied_host char(60) binary DEFAULT '' NOT NULL, Proxied_user char(16) binary DEFAULT '' NOT NULL, With_grant BOOL DEFAULT 0 NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp, PRIMARY KEY Host (Host,User,Proxied_host,Proxied_user), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User proxy privileges'; + + +-- disable_result_log +# Run the mysql_fix_privilege_tables.sql using "mysql --force" +--exec $MYSQL --force test < $MYSQL_FIX_PRIVILEGE_TABLES +-- enable_result_log + +# Dump the tables that should be compared +-- source include/system_db_struct.inc + +# Drop all tables created by this test +DROP VIEW user; +DROP TABLE db, host, func, plugin, tables_priv, columns_priv, procs_priv, servers, help_category, help_keyword, help_relation, help_topic, proc, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type, event, proxies_priv, general_log, slow_log, innodb_index_stats, innodb_table_stats, transaction_registry, table_stats, column_stats, index_stats, roles_mapping, gtid_slave_pos, global_priv, ndb_binlog_index; + +# check that we dropped all system tables +show tables; + +# End of 4.1 tests diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 796bc90a2ee..c009a3de4a0 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -239,7 +239,6 @@ SET GLOBAL general_log = 'OFF'; ALTER TABLE general_log MODIFY event_time TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, MODIFY user_host MEDIUMTEXT NOT NULL, - MODIFY thread_id INTEGER NOT NULL, MODIFY server_id INTEGER UNSIGNED NOT NULL, MODIFY command_type VARCHAR(64) NOT NULL, MODIFY argument MEDIUMTEXT NOT NULL, @@ -841,3 +840,8 @@ IF 1 = (SELECT count(*) FROM information_schema.VIEWS WHERE TABLE_CATALOG = 'def END IF// DELIMITER ; + +# MDEV-22683 - upgrade Host and Owner of servers +ALTER TABLE servers + MODIFY Host varchar(2048) NOT NULL DEFAULT '', + MODIFY Owner varchar(512) NOT NULL DEFAULT ''; From 7bdd878ae40e19b69736ed01fd2bc861c83d1784 Mon Sep 17 00:00:00 2001 From: Hugo Wen Date: Thu, 23 Feb 2023 23:56:44 +0000 Subject: [PATCH 034/260] Fix few vulnerabilities found by Cppcheck While performing SAST scanning using Cppcheck against source code of commit 81196469, several code vulnerabilities were found. Fix following issues: 1. Parameters of `snprintf` function are incorrect. Cppcheck error: client/mysql_plugin.c:1228: error: snprintf format string requires 6 parameters but only 5 are given. It is due to commit 630d7229 introduced option `--lc-messages-dir` in the bootstrap command. However the parameter was not even given in the `snprintf` after changing the format string. Fix: Restructure the code logic and correct the function parameters for `snprintf`. 2. Null pointer is used in a `snprintf` which could cause a crash. Cppcheck error: extra/mariabackup/xbcloud.cc:2534: error: Null pointer dereference The code intended to print the swift_project name, if the opt_swift_project_id is NULL but opt_swift_project is not NULL. However the parameter of `snprintf` was mistakenly using `opt_swift_project_id`. Fix: Change to use the correct string from `opt_swift_project`. 3. Potential double release of a memory Cppcheck error: plugin/auth_pam/testing/pam_mariadb_mtr.c:69: error: Memory pointed to by 'resp' is freed twice. A pointer `resp` is reused and allocated new memory after it has been freed. However, `resp` was not set to NULL after freed. Potential double release of the same pointer if the call back function doesn't allocate new memory for `resp` pointer. Fix: Set the `resp` pointer to NULL after the first free() to make sure the same address is not freed twice. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc. --- client/mysql_plugin.c | 112 ++++++++++------------ extra/mariabackup/xbcloud.cc | 2 +- plugin/auth_pam/testing/pam_mariadb_mtr.c | 1 + 3 files changed, 54 insertions(+), 61 deletions(-) diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c index d87d4269f89..97dc48a1ff4 100644 --- a/client/mysql_plugin.c +++ b/client/mysql_plugin.c @@ -102,7 +102,7 @@ int main(int argc,char *argv[]) MY_INIT(argv[0]); sf_leaking_memory=1; /* don't report memory leaks on early exits */ plugin_data.name= 0; /* initialize name */ - + /* The following operations comprise the method for enabling or disabling a plugin. We begin by processing the command options then check the @@ -110,15 +110,15 @@ int main(int argc,char *argv[]) --plugin-ini (if specified). If the directories are Ok, we then look for the mysqld executable and the plugin soname. Finally, we build a bootstrap command file for use in bootstraping the server. - + If any step fails, the method issues an error message and the tool exits. - + 1) Parse, execute, and verify command options. 2) Check access to directories. 3) Look for mysqld executable. 4) Look for the plugin. 5) Build a bootstrap file with commands to enable or disable plugin. - + */ if ((error= process_options(argc, argv, operation)) || (error= check_access()) || @@ -126,11 +126,11 @@ int main(int argc,char *argv[]) (error= find_plugin(tp_path)) || (error= build_bootstrap_file(operation, bootstrap))) goto exit; - + /* Dump the bootstrap file if --verbose specified. */ if (opt_verbose && ((error= dump_bootstrap_file(bootstrap)))) goto exit; - + /* Start the server in bootstrap mode and execute bootstrap commands */ error= bootstrap_server(server_path, bootstrap); @@ -238,7 +238,7 @@ static int run_command(char* cmd, const char *mode) #ifdef __WIN__ /** Check to see if there are spaces in a path. - + @param[in] path The Windows path to examine. @retval int spaces found = 1, no spaces = 0 @@ -253,7 +253,7 @@ static int has_spaces(const char *path) /** Convert a Unix path to a Windows path. - + @param[in] path The Windows path to examine. @returns string containing path with / changed to \\ @@ -335,12 +335,12 @@ static int get_default_values() #ifdef __WIN__ { char *format_str= 0; - + if (has_spaces(tool_path) || has_spaces(defaults_file)) format_str = "\"%s --mysqld > %s\""; else format_str = "%s --mysqld > %s"; - + snprintf(defaults_cmd, sizeof(defaults_cmd), format_str, add_quotes(tool_path), add_quotes(defaults_file)); if (opt_verbose) @@ -675,7 +675,7 @@ static int load_plugin_data(char *plugin_name, char *config_file) { reason= "Bad format in plugin configuration file."; fclose(file_ptr); - goto error; + goto error; } break; } @@ -709,7 +709,7 @@ static int load_plugin_data(char *plugin_name, char *config_file) } } } - + fclose(file_ptr); return 0; @@ -740,7 +740,7 @@ static int check_options(int argc, char **argv, char *operation) int num_found= 0; /* number of options found (shortcut loop) */ char config_file[FN_REFLEN]; /* configuration file name */ char plugin_name[FN_REFLEN]; /* plugin name */ - + /* Form prefix strings for the options. */ const char *basedir_prefix = "--basedir="; size_t basedir_len= strlen(basedir_prefix); @@ -815,7 +815,7 @@ static int check_options(int argc, char **argv, char *operation) return 1; } /* If a plugin was specified, read the config file. */ - else if (strlen(plugin_name) > 0) + else if (strlen(plugin_name) > 0) { if (load_plugin_data(plugin_name, config_file)) { @@ -847,22 +847,22 @@ static int check_options(int argc, char **argv, char *operation) /** Parse, execute, and verify command options. - + This method handles all of the option processing including the optional features for displaying data (--print-defaults, --help ,etc.) that do not result in an attempt to ENABLE or DISABLE of a plugin. - + @param[in] arc Count of arguments @param[in] argv Array of arguments @param[out] operation Operation (ENABLE or DISABLE) - + @retval int error = 1, success = 0, exit program = -1 */ static int process_options(int argc, char *argv[], char *operation) { int error= 0; - + /* Parse and execute command-line options */ if ((error= handle_options(&argc, &argv, my_long_options, get_one_option))) return error; @@ -881,7 +881,7 @@ static int process_options(int argc, char *argv[], char *operation) char buff[FN_REFLEN]; if (basedir_len + 2 > FN_REFLEN) return -1; - + memcpy(buff, opt_basedir, basedir_len); buff[basedir_len]= '/'; buff[basedir_len + 1]= '\0'; @@ -890,7 +890,7 @@ static int process_options(int argc, char *argv[], char *operation) opt_basedir= my_strdup(buff, MYF(MY_FAE)); } } - + /* If the user did not specify the option to skip loading defaults from a config file and the required options are not present or there was an error @@ -925,18 +925,18 @@ static int process_options(int argc, char *argv[], char *operation) /** Check access - + This method checks to ensure all of the directories (opt_basedir, opt_plugin_dir, opt_datadir, and opt_plugin_ini) are accessible by the user. - + @retval int error = 1, success = 0 */ static int check_access() { int error= 0; - + if ((error= my_access(opt_basedir, F_OK))) { fprintf(stderr, "ERROR: Cannot access basedir at '%s'.\n", @@ -1048,13 +1048,13 @@ static int find_plugin(char *tp_path) /** Build the bootstrap file. - + Create a new file and populate it with SQL commands to ENABLE or DISABLE the plugin via REPLACE and DELETE operations on the mysql.plugin table. param[in] operation The type of operation (ENABLE or DISABLE) param[out] bootstrap A FILE* pointer - + @retval int error = 1, success = 0 */ @@ -1062,7 +1062,7 @@ static int build_bootstrap_file(char *operation, char *bootstrap) { int error= 0; FILE *file= 0; - + /* Perform plugin operation : ENABLE or DISABLE @@ -1073,10 +1073,10 @@ static int build_bootstrap_file(char *operation, char *bootstrap) .ini configuration file. Once the file is built, a call to mysqld is made in read only, bootstrap modes to read the SQL statements and execute them. - + Note: Replace was used so that if a user loads a newer version of a library with a different library name, the new library name is - used for symbols that match. + used for symbols that match. */ if ((error= make_tempfile(bootstrap, "sql"))) { @@ -1123,7 +1123,7 @@ static int build_bootstrap_file(char *operation, char *bootstrap) printf("# Disabling %s...\n", plugin_data.name); } } - + exit: fclose(file); return error; @@ -1132,11 +1132,11 @@ exit: /** Dump bootstrap file. - + Read the contents of the bootstrap file and print it out. - + @param[in] bootstrap_file Name of bootstrap file to read - + @retval int error = 1, success = 0 */ @@ -1173,7 +1173,7 @@ exit: /** Bootstrap the server - + Create a command line sequence to launch mysqld in bootstrap mode. This will allow mysqld to launch a minimal server instance to read and execute SQL commands from a file piped in (the bootstrap file). We use @@ -1194,47 +1194,39 @@ exit: static int bootstrap_server(char *server_path, char *bootstrap_file) { - char bootstrap_cmd[FN_REFLEN]; + char bootstrap_cmd[FN_REFLEN]= {0}; + char lc_messages_dir_str[FN_REFLEN]= {0}; int error= 0; #ifdef __WIN__ char *format_str= 0; const char *verbose_str= NULL; - - +#endif + + if (opt_lc_messages_dir != NULL) + snprintf(lc_messages_dir_str, sizeof(lc_messages_dir_str), "--lc-messages-dir=%s", + opt_lc_messages_dir); + +#ifdef __WIN__ if (opt_verbose) verbose_str= "--console"; else verbose_str= ""; + if (has_spaces(opt_datadir) || has_spaces(opt_basedir) || - has_spaces(bootstrap_file)) - { - if (opt_lc_messages_dir != NULL) - format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s --lc-messages-dir=%s <%s\""; - else - format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s <%s\""; - } + has_spaces(bootstrap_file) || has_spaces(lc_messages_dir_str)) + format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s %s <%s\""; else - { - if (opt_lc_messages_dir != NULL) - format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s --lc-messages-dir=%s <%s\""; - else - format_str= "%s %s --bootstrap --datadir=%s --basedir=%s <%s"; - } + format_str= "%s %s --bootstrap --datadir=%s --basedir=%s %s <%s"; + snprintf(bootstrap_cmd, sizeof(bootstrap_cmd), format_str, add_quotes(convert_path(server_path)), verbose_str, add_quotes(opt_datadir), add_quotes(opt_basedir), - add_quotes(bootstrap_file)); + add_quotes(lc_messages_dir_str), add_quotes(bootstrap_file)); #else - if (opt_lc_messages_dir != NULL) - snprintf(bootstrap_cmd, sizeof(bootstrap_cmd), - "%s --no-defaults --bootstrap --datadir=%s --basedir=%s --lc-messages-dir=%s" - " <%s", server_path, opt_datadir, opt_basedir, opt_lc_messages_dir, bootstrap_file); - else - snprintf(bootstrap_cmd, sizeof(bootstrap_cmd), - "%s --no-defaults --bootstrap --datadir=%s --basedir=%s" - " <%s", server_path, opt_datadir, opt_basedir, bootstrap_file); - + snprintf(bootstrap_cmd, sizeof(bootstrap_cmd), + "%s --no-defaults --bootstrap --datadir=%s --basedir=%s %s" + " <%s", server_path, opt_datadir, opt_basedir, lc_messages_dir_str, bootstrap_file); #endif /* Execute the command */ @@ -1247,6 +1239,6 @@ static int bootstrap_server(char *server_path, char *bootstrap_file) fprintf(stderr, "ERROR: Unexpected result from bootstrap. Error code: %d.\n", error); - + return error; } diff --git a/extra/mariabackup/xbcloud.cc b/extra/mariabackup/xbcloud.cc index cee76e5f3d7..588a15eb791 100644 --- a/extra/mariabackup/xbcloud.cc +++ b/extra/mariabackup/xbcloud.cc @@ -2534,7 +2534,7 @@ swift_keystone_auth_v3(const char *auth_url, swift_auth_info *info) } else if (opt_swift_project != NULL) { snprintf(scope, sizeof(scope), ",\"scope\":{\"project\":{\"name\":\"%s\"%s}}", - opt_swift_project_id, domain); + opt_swift_project, domain); } snprintf(payload, sizeof(payload), "{\"auth\":{\"identity\":" diff --git a/plugin/auth_pam/testing/pam_mariadb_mtr.c b/plugin/auth_pam/testing/pam_mariadb_mtr.c index 2075d5fdbf3..d4c79f31330 100644 --- a/plugin/auth_pam/testing/pam_mariadb_mtr.c +++ b/plugin/auth_pam/testing/pam_mariadb_mtr.c @@ -45,6 +45,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags __attribute__((unused)), else { free(resp); + resp= NULL; msg[0].msg_style = PAM_PROMPT_ECHO_ON; msg[0].msg = "PIN:"; pam_err = (*conv->conv)(1, msgp, &resp, conv->appdata_ptr); From a6a906d76697d5487418d51b251a3070ac6e8c80 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Fri, 25 Nov 2022 12:54:24 +0100 Subject: [PATCH 035/260] MDEV-26831 fallout: fix problems of name resolution cache - Avoid passing real field cache as a parameter when we check for duplicates. - Correct cache cleanup (cached field number also have to be reset). - Name resolution cache simple test added. --- .../main/name_resolution_cache_debug.result | 25 +++++++++++++ .../main/name_resolution_cache_debug.test | 36 +++++++++++++++++++ sql/sql_base.cc | 30 +++++++++++++--- 3 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 mysql-test/main/name_resolution_cache_debug.result create mode 100644 mysql-test/main/name_resolution_cache_debug.test diff --git a/mysql-test/main/name_resolution_cache_debug.result b/mysql-test/main/name_resolution_cache_debug.result new file mode 100644 index 00000000000..7030176c5fe --- /dev/null +++ b/mysql-test/main/name_resolution_cache_debug.result @@ -0,0 +1,25 @@ +connect con1,localhost,root; +create table t1 (a int, b int); +create table t2 (c int, d int); +create view v1 as select c+1 as e, d+1 as f from t2; +SET DEBUG_SYNC= 'table_field_cached SIGNAL in_sync WAIT_FOR go'; +prepare stmt1 from "select a from t1"; +execute stmt1; +connection default; +SET DEBUG_SYNC= 'now WAIT_FOR in_sync'; +SET DEBUG_SYNC= 'now SIGNAL go'; +connection con1; +a +SET DEBUG_SYNC= 'table_field_cached SIGNAL in_sync WAIT_FOR go'; +prepare stmt1 from "select e from v1"; +execute stmt1; +connection default; +SET DEBUG_SYNC= 'now WAIT_FOR in_sync'; +SET DEBUG_SYNC= 'now SIGNAL go'; +connection con1; +e +connection default; +disconnect con1; +SET DEBUG_SYNC = 'RESET'; +drop view v1; +drop table t1,t2; diff --git a/mysql-test/main/name_resolution_cache_debug.test b/mysql-test/main/name_resolution_cache_debug.test new file mode 100644 index 00000000000..362d883cbd1 --- /dev/null +++ b/mysql-test/main/name_resolution_cache_debug.test @@ -0,0 +1,36 @@ + +source include/have_debug_sync.inc; + +connect con1,localhost,root; +create table t1 (a int, b int); +create table t2 (c int, d int); +create view v1 as select c+1 as e, d+1 as f from t2; + +SET DEBUG_SYNC= 'table_field_cached SIGNAL in_sync WAIT_FOR go'; +prepare stmt1 from "select a from t1"; +--send execute stmt1 + +connection default; +SET DEBUG_SYNC= 'now WAIT_FOR in_sync'; +SET DEBUG_SYNC= 'now SIGNAL go'; + +connection con1; +--reap + +SET DEBUG_SYNC= 'table_field_cached SIGNAL in_sync WAIT_FOR go'; +prepare stmt1 from "select e from v1"; +--send execute stmt1 + +connection default; +SET DEBUG_SYNC= 'now WAIT_FOR in_sync'; +SET DEBUG_SYNC= 'now SIGNAL go'; + +connection con1; +--reap + +connection default; +disconnect con1; + +SET DEBUG_SYNC = 'RESET'; +drop view v1; +drop table t1,t2; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index d1ee15fb085..dd633f0bb92 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -6037,7 +6037,10 @@ find_field_in_table(THD *thd, TABLE *table, const char *name, size_t length, if (cached_field_index < table->s->fields && !my_strcasecmp(system_charset_info, table->field[cached_field_index]->field_name.str, name)) + { field= table->field[cached_field_index]; + DEBUG_SYNC(thd, "table_field_cached"); + } else { LEX_CSTRING fname= {name, length}; @@ -6485,6 +6488,13 @@ find_field_in_tables(THD *thd, Item_ident *item, if (last_table) last_table= last_table->next_name_resolution_table; + uint fake_index_for_duplicate_search= NO_CACHED_FIELD_INDEX; + /* + For the field search it will point to field cache, but for duplicate + search it will point to fake_index_for_duplicate_search (no cache + present). + */ + uint *current_cache= &(item->cached_field_index); for (; cur_table != last_table ; cur_table= cur_table->next_name_resolution_table) { @@ -6494,7 +6504,7 @@ find_field_in_tables(THD *thd, Item_ident *item, SQLCOM_SHOW_FIELDS) ? false : check_privileges, allow_rowid, - &(item->cached_field_index), + current_cache, register_tree_change, &actual_table); if (cur_field) @@ -6509,7 +6519,7 @@ find_field_in_tables(THD *thd, Item_ident *item, item->name.str, db, table_name, ref, false, allow_rowid, - &(item->cached_field_index), + current_cache, register_tree_change, &actual_table); if (cur_field) @@ -6526,8 +6536,19 @@ find_field_in_tables(THD *thd, Item_ident *item, Store the original table of the field, which may be different from cur_table in the case of NATURAL/USING join. */ - item->cached_table= (!actual_table->cacheable_table || found) ? - 0 : actual_table; + if (actual_table->cacheable_table /*(1)*/ && !found /*(2)*/) + { + /* + We have just found a field allowed to cache (1) and + it is not dublicate search (2). + */ + item->cached_table= actual_table; + } + else + { + item->cached_table= NULL; + item->cached_field_index= NO_CACHED_FIELD_INDEX; + } DBUG_ASSERT(thd->where); /* @@ -6546,6 +6567,7 @@ find_field_in_tables(THD *thd, Item_ident *item, return (Field*) 0; } found= cur_field; + current_cache= &fake_index_for_duplicate_search; } } From ccec9b1de95a66b7597bc30e0a60bd61866f225d Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Wed, 1 Mar 2023 22:49:27 -0800 Subject: [PATCH 036/260] MDEV-30706 Different results of selects from view and CTE with same definition MDEV-30668 Set function aggregated in outer select used in view definition This patch fixes two bugs concerning views whose specifications contain subqueries with set functions aggregated in outer selects. Due to the first bug those such views that have implicit grouping were considered as mergeable. This led to wrong result sets for selects from these views. Due to the second bug the aggregation select was determined incorrectly and this led to bogus error messages. The patch added several test cases for these two bugs and for four other duplicate bugs. The patch also enables view-protocol for many other test cases. Approved by Oleksandr Byelkin --- mysql-test/main/derived_view.result | 482 ++++++++++++++++++ mysql-test/main/derived_view.test | 297 +++++++++++ mysql-test/main/func_group.result | 9 +- mysql-test/main/func_group.test | 11 +- mysql-test/main/group_by.result | 10 +- mysql-test/main/group_by.test | 23 +- mysql-test/main/opt_trace.result | 12 +- mysql-test/main/subselect.result | 262 ++++++---- mysql-test/main/subselect.test | 215 ++++---- mysql-test/main/subselect4.result | 4 +- .../main/subselect_no_exists_to_in.result | 262 ++++++---- mysql-test/main/subselect_no_mat.result | 262 ++++++---- mysql-test/main/subselect_no_opts.result | 262 ++++++---- mysql-test/main/subselect_no_scache.result | 262 ++++++---- mysql-test/main/subselect_no_semijoin.result | 262 ++++++---- sql/item.cc | 16 +- sql/item_sum.cc | 3 +- sql/sql_base.cc | 3 +- sql/sql_derived.cc | 18 - sql/sql_lex.cc | 43 +- sql/sql_lex.h | 2 + sql/table.cc | 16 +- sql/table.h | 7 +- 23 files changed, 2021 insertions(+), 722 deletions(-) diff --git a/mysql-test/main/derived_view.result b/mysql-test/main/derived_view.result index 3df1acc66e4..ab32e477816 100644 --- a/mysql-test/main/derived_view.result +++ b/mysql-test/main/derived_view.result @@ -3691,3 +3691,485 @@ drop procedure sp2; drop view v, v2; drop table t1,t2; # End of 10.2 tests +# +# MDEV-30706: view defined as select with implicit grouping and +# a set function used in a subquery +# +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); +CREATE TABLE t3 (a INT PRIMARY KEY, b INT); +INSERT INTO t3 VALUES (2,2), (4,4), (7,7); +CREATE TABLE t4 (a INT PRIMARY KEY, b INT); +INSERT INTO t4 VALUES (2,2), (5,5), (7,7); +CREATE VIEW v AS SELECT +(SELECT SUM(t4.b) FROM t1, t2 WHERE t1.a = t2.b GROUP BY t1.a) AS m +FROM t3, t4 +WHERE t3.a = t4.b; +SELECT +(SELECT SUM(t4.b) FROM t1, t2 WHERE t1.a = t2.b GROUP BY t1.a) AS m +FROM t3, t4 +WHERE t3.a = t4.b; +m +9 +SELECT * FROM v; +m +9 +WITH cte AS ( SELECT +(SELECT SUM(t4.b) FROM t1, t2 WHERE t1.a = t2.b GROUP BY t1.a) AS m +FROM t3, t4 +WHERE t3.a = t4.b ) SELECT * FROM cte; +m +9 +EXPLAIN SELECT +(SELECT SUM(t4.b) FROM t1, t2 WHERE t1.a = t2.b GROUP BY t1.a) AS m +FROM t3, t4 +WHERE t3.a = t4.b; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t4 ALL NULL NULL NULL NULL 3 Using where +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.b 1 Using index +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 Using index +EXPLAIN SELECT * FROM v; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 3 +2 SUBQUERY t4 ALL NULL NULL NULL NULL 3 Using where +2 SUBQUERY t3 eq_ref PRIMARY PRIMARY 4 test.t4.b 1 Using index +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +3 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 Using index +EXPLAIN WITH cte AS ( SELECT +(SELECT SUM(t4.b) FROM t1, t2 WHERE t1.a = t2.b GROUP BY t1.a) AS m +FROM t3, t4 +WHERE t3.a = t4.b ) SELECT * FROM cte; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 3 +2 DERIVED t4 ALL NULL NULL NULL NULL 3 Using where +2 DERIVED t3 eq_ref PRIMARY PRIMARY 4 test.t4.b 1 Using index +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort +3 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 Using index +PREPARE stmt FROM "SELECT +(SELECT SUM(t4.b) FROM t1, t2 WHERE t1.a = t2.b GROUP BY t1.a) AS m +FROM t3, t4 +WHERE t3.a = t4.b"; +execute stmt; +m +9 +execute stmt; +m +9 +DEALLOCATE PREPARE stmt; +PREPARE stmt FROM "SELECT * FROM v"; +execute stmt; +m +9 +execute stmt; +m +9 +DEALLOCATE PREPARE stmt; +PREPARE stmt FROM "WITH cte AS ( SELECT +(SELECT SUM(t4.b) FROM t1, t2 WHERE t1.a = t2.b GROUP BY t1.a) AS m +FROM t3, t4 +WHERE t3.a = t4.b ) SELECT * FROM cte"; +execute stmt; +m +9 +execute stmt; +m +9 +DEALLOCATE PREPARE stmt; +DROP VIEW v; +DROP TABLE t1,t2,t3,t4; +# +# MDEV-29224: view defined as select with implicit grouping and +# a set function used in a subquery +# +CREATE TABLE t1 (f1 INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (f2 int); +INSERT INTO t2 VALUES (3); +CREATE VIEW v AS SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1; +SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1; +( SELECT MAX(f1) FROM t2 ) +2 +SELECT * FROM v; +( SELECT MAX(f1) FROM t2 ) +2 +WITH cte AS ( SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1 ) SELECT * FROM cte; +( SELECT MAX(f1) FROM t2 ) +2 +EXPLAIN SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 +2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1 +EXPLAIN SELECT * FROM v; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 2 +2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 +3 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1 +EXPLAIN WITH cte AS ( SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1 ) SELECT * FROM cte; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 2 +2 DERIVED t1 ALL NULL NULL NULL NULL 2 +3 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1 +PREPARE stmt FROM "SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1"; +execute stmt; +( SELECT MAX(f1) FROM t2 ) +2 +execute stmt; +( SELECT MAX(f1) FROM t2 ) +2 +DEALLOCATE PREPARE stmt; +PREPARE stmt FROM "SELECT * FROM v"; +execute stmt; +( SELECT MAX(f1) FROM t2 ) +2 +execute stmt; +( SELECT MAX(f1) FROM t2 ) +2 +DEALLOCATE PREPARE stmt; +PREPARE stmt FROM "WITH cte AS ( SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1 ) SELECT * FROM cte"; +execute stmt; +( SELECT MAX(f1) FROM t2 ) +2 +execute stmt; +( SELECT MAX(f1) FROM t2 ) +2 +DEALLOCATE PREPARE stmt; +DROP VIEW v; +DROP TABLE t1,t2; +# +# MDEV-28573: view defined as select with implicit grouping and +# a set function used in a subquery +# +CREATE TABLE t1 (a INTEGER, b INTEGER); +CREATE TABLE t2 (c INTEGER); +INSERT INTO t1 VALUES (1,11), (2,22), (2,22); +INSERT INTO t2 VALUES (1), (2); +CREATE VIEW v1 AS SELECT (SELECT COUNT(b) FROM t2) FROM t1; +CREATE VIEW v2 AS SELECT (SELECT COUNT(b) FROM t2 WHERE c > 1) FROM t1; +SELECT (SELECT COUNT(b) FROM t2) FROM t1; +ERROR 21000: Subquery returns more than 1 row +SELECT * FROM v1; +ERROR 21000: Subquery returns more than 1 row +WITH cte AS ( SELECT (SELECT COUNT(b) FROM t2) FROM t1 ) SELECT * FROM cte; +ERROR 21000: Subquery returns more than 1 row +SELECT (SELECT COUNT(b) FROM t2 WHERE c > 1) FROM t1; +(SELECT COUNT(b) FROM t2 WHERE c > 1) +3 +SELECT * FROM v2; +(SELECT COUNT(b) FROM t2 WHERE c > 1) +3 +WITH cte AS ( SELECT (SELECT COUNT(b) FROM t2 WHERE c > 1) FROM t1 ) SELECT * FROM cte; +(SELECT COUNT(b) FROM t2 WHERE c > 1) +3 +EXPLAIN SELECT (SELECT COUNT(b) FROM t2) FROM t1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 +EXPLAIN SELECT * FROM v1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 3 +2 SUBQUERY t1 ALL NULL NULL NULL NULL 3 +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 +EXPLAIN WITH cte AS ( SELECT (SELECT COUNT(b) FROM t2) FROM t1 ) SELECT * FROM cte; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 3 +2 DERIVED t1 ALL NULL NULL NULL NULL 3 +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 +PREPARE stmt FROM "SELECT (SELECT COUNT(b) FROM t2) FROM t1"; +execute stmt; +ERROR 21000: Subquery returns more than 1 row +execute stmt; +ERROR 21000: Subquery returns more than 1 row +DEALLOCATE PREPARE stmt; +PREPARE stmt FROM "SELECT * FROM v1"; +execute stmt; +ERROR 21000: Subquery returns more than 1 row +execute stmt; +ERROR 21000: Subquery returns more than 1 row +DEALLOCATE PREPARE stmt; +PREPARE stmt FROM "WITH cte AS ( SELECT (SELECT COUNT(b) FROM t2) FROM t1 ) SELECT * FROM cte"; +execute stmt; +ERROR 21000: Subquery returns more than 1 row +execute stmt; +ERROR 21000: Subquery returns more than 1 row +DEALLOCATE PREPARE stmt; +PREPARE stmt FROM "SELECT (SELECT COUNT(b) FROM t2 WHERE c > 1) FROM t1"; +execute stmt; +(SELECT COUNT(b) FROM t2 WHERE c > 1) +3 +execute stmt; +(SELECT COUNT(b) FROM t2 WHERE c > 1) +3 +DEALLOCATE PREPARE stmt; +PREPARE stmt FROM "SELECT * FROM v2"; +execute stmt; +(SELECT COUNT(b) FROM t2 WHERE c > 1) +3 +execute stmt; +(SELECT COUNT(b) FROM t2 WHERE c > 1) +3 +DEALLOCATE PREPARE stmt; +PREPARE stmt FROM "WITH cte AS ( SELECT (SELECT COUNT(b) FROM t2 WHERE c > 1) FROM t1 ) SELECT * FROM cte"; +execute stmt; +(SELECT COUNT(b) FROM t2 WHERE c > 1) +3 +execute stmt; +(SELECT COUNT(b) FROM t2 WHERE c > 1) +3 +DEALLOCATE PREPARE stmt; +DROP VIEW v1,v2; +DROP TABLE t1,t2; +# +# MDEV-28570: VIEW with WHERE containing subquery +# with set function aggregated in query +# +CREATE TABLE t1 (a int, b int); +CREATE TABLE t2 (c int, d int); +INSERT INTO t1 VALUES +(1,10), (2,10), (1,20), (2,20), (3,20), (2,30), (4,40); +INSERT INTO t2 VALUES +(2,10), (2,20), (4,10), (5,10), (3,20), (2,40); +CREATE VIEW v AS SELECT a FROM t1 GROUP BY a +HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20); +SELECT a FROM t1 GROUP BY a +HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20); +a +2 +4 +SELECT * FROM v; +a +2 +4 +WITH cte AS ( SELECT a FROM t1 GROUP BY a +HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20) ) SELECT * FROM cte; +a +2 +4 +EXPLAIN SELECT a FROM t1 GROUP BY a +HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 7 Using temporary; Using filesort +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 6 +EXPLAIN SELECT * FROM v; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 7 +2 DERIVED t1 ALL NULL NULL NULL NULL 7 Using temporary; Using filesort +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 6 +EXPLAIN WITH cte AS ( SELECT a FROM t1 GROUP BY a +HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20) ) SELECT * FROM cte; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 7 +2 DERIVED t1 ALL NULL NULL NULL NULL 7 Using temporary; Using filesort +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 6 +PREPARE stmt FROM "SELECT a FROM t1 GROUP BY a +HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20)"; +execute stmt; +a +2 +4 +execute stmt; +a +2 +4 +DEALLOCATE PREPARE stmt; +PREPARE stmt FROM "SELECT * FROM v"; +execute stmt; +a +2 +4 +execute stmt; +a +2 +4 +DEALLOCATE PREPARE stmt; +PREPARE stmt FROM "WITH cte AS ( SELECT a FROM t1 GROUP BY a +HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20) ) SELECT * FROM cte"; +execute stmt; +a +2 +4 +execute stmt; +a +2 +4 +DEALLOCATE PREPARE stmt; +DROP VIEW v; +DROP TABLE t1,t2; +# +# MDEV-28571: VIEW with select list containing subquery +# with set function aggregated in query +# +CREATE TABLE t1 (a int, b int); +CREATE TABLE t2 (m int, n int); +INSERT INTO t1 VALUES (2,2), (2,2), (3,3), (3,3), (3,3), (4,4); +INSERT INTO t2 VALUES (1,11), (2,22), (3,32), (4,44), (4,44); +CREATE VIEW v AS SELECT (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) AS c +FROM t1 +GROUP BY a; +SELECT (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) AS c +FROM t1 +GROUP BY a; +c +2 +3 +1,1 +SELECT * FROM v; +c +2 +3 +1,1 +WITH cte AS ( SELECT (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) AS c +FROM t1 +GROUP BY a ) SELECT * FROM cte; +c +2 +3 +1,1 +EXPLAIN SELECT (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) AS c +FROM t1 +GROUP BY a; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 Using where +EXPLAIN SELECT * FROM v; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 6 +2 DERIVED t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 Using where +EXPLAIN WITH cte AS ( SELECT (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) AS c +FROM t1 +GROUP BY a ) SELECT * FROM cte; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 6 +2 DERIVED t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 Using where +PREPARE stmt FROM "SELECT (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) AS c +FROM t1 +GROUP BY a"; +execute stmt; +c +2 +3 +1,1 +execute stmt; +c +2 +3 +1,1 +DEALLOCATE PREPARE stmt; +PREPARE stmt FROM "SELECT * FROM v"; +execute stmt; +c +2 +3 +1,1 +execute stmt; +c +2 +3 +1,1 +DEALLOCATE PREPARE stmt; +PREPARE stmt FROM "WITH cte AS ( SELECT (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) AS c +FROM t1 +GROUP BY a ) SELECT * FROM cte"; +execute stmt; +c +2 +3 +1,1 +execute stmt; +c +2 +3 +1,1 +DEALLOCATE PREPARE stmt; +DROP VIEW v; +DROP TABLE t1,t2; +# +# MDEV-30668: VIEW with WHERE containing nested subquery +# with set function aggregated in outer subquery +# +create table t1 (a int); +insert into t1 values (3), (7), (1); +create table t2 (b int); +insert into t2 values (2), (1), (4), (7); +create table t3 (a int, b int); +insert into t3 values (2,10), (7,30), (2,30), (1,10), (7,40); +create view v as select * from t1 +where t1.a in (select t3.a from t3 group by t3.a +having t3.a > any (select t2.b from t2 +where t2.b*10 < sum(t3.b))); +select * from t1 +where t1.a in (select t3.a from t3 group by t3.a +having t3.a > any (select t2.b from t2 +where t2.b*10 < sum(t3.b))); +a +7 +select * from v; +a +7 +with cte as ( select * from t1 +where t1.a in (select t3.a from t3 group by t3.a +having t3.a > any (select t2.b from t2 +where t2.b*10 < sum(t3.b))) ) select * from cte; +a +7 +explain select * from t1 +where t1.a in (select t3.a from t3 group by t3.a +having t3.a > any (select t2.b from t2 +where t2.b*10 < sum(t3.b))); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where +1 PRIMARY eq_ref distinct_key distinct_key 4 test.t1.a 1 +2 MATERIALIZED t3 ALL NULL NULL NULL NULL 5 Using temporary +3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 4 Using where +explain select * from v; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where +1 PRIMARY eq_ref distinct_key distinct_key 4 test.t1.a 1 +3 MATERIALIZED t3 ALL NULL NULL NULL NULL 5 Using temporary +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 4 Using where +explain with cte as ( select * from t1 +where t1.a in (select t3.a from t3 group by t3.a +having t3.a > any (select t2.b from t2 +where t2.b*10 < sum(t3.b))) ) select * from cte; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where +1 PRIMARY eq_ref distinct_key distinct_key 4 test.t1.a 1 +3 MATERIALIZED t3 ALL NULL NULL NULL NULL 5 Using temporary +4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 4 Using where +prepare stmt from "select * from t1 +where t1.a in (select t3.a from t3 group by t3.a +having t3.a > any (select t2.b from t2 +where t2.b*10 < sum(t3.b)))"; +execute stmt; +a +7 +execute stmt; +a +7 +deallocate prepare stmt; +prepare stmt from "select * from v"; +execute stmt; +a +7 +execute stmt; +a +7 +deallocate prepare stmt; +prepare stmt from "with cte as ( select * from t1 +where t1.a in (select t3.a from t3 group by t3.a +having t3.a > any (select t2.b from t2 +where t2.b*10 < sum(t3.b))) ) select * from cte"; +execute stmt; +a +7 +execute stmt; +a +7 +deallocate prepare stmt; +drop view v; +drop table t1,t2,t3; +# End of 10.4 tests diff --git a/mysql-test/main/derived_view.test b/mysql-test/main/derived_view.test index caccc7dafa1..5422fbcfd1d 100644 --- a/mysql-test/main/derived_view.test +++ b/mysql-test/main/derived_view.test @@ -2455,3 +2455,300 @@ drop view v, v2; drop table t1,t2; --echo # End of 10.2 tests + +--echo # +--echo # MDEV-30706: view defined as select with implicit grouping and +--echo # a set function used in a subquery +--echo # + +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); +CREATE TABLE t3 (a INT PRIMARY KEY, b INT); +INSERT INTO t3 VALUES (2,2), (4,4), (7,7); +CREATE TABLE t4 (a INT PRIMARY KEY, b INT); +INSERT INTO t4 VALUES (2,2), (5,5), (7,7); + +let $q= +SELECT + (SELECT SUM(t4.b) FROM t1, t2 WHERE t1.a = t2.b GROUP BY t1.a) AS m +FROM t3, t4 + WHERE t3.a = t4.b; + +eval CREATE VIEW v AS $q; + +eval $q; +SELECT * FROM v; +eval WITH cte AS ( $q ) SELECT * FROM cte; + +eval EXPLAIN $q; +EXPLAIN SELECT * FROM v; +eval EXPLAIN WITH cte AS ( $q ) SELECT * FROM cte; + +eval PREPARE stmt FROM "$q"; +execute stmt; +execute stmt; +DEALLOCATE PREPARE stmt; + +eval PREPARE stmt FROM "SELECT * FROM v"; +execute stmt; +execute stmt; +DEALLOCATE PREPARE stmt; + +eval PREPARE stmt FROM "WITH cte AS ( $q ) SELECT * FROM cte"; +execute stmt; +execute stmt; +DEALLOCATE PREPARE stmt; + +DROP VIEW v; +DROP TABLE t1,t2,t3,t4; + +--echo # +--echo # MDEV-29224: view defined as select with implicit grouping and +--echo # a set function used in a subquery +--echo # + +CREATE TABLE t1 (f1 INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (f2 int); +INSERT INTO t2 VALUES (3); + +let $q= +SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1; + +eval CREATE VIEW v AS $q; + +eval $q; +SELECT * FROM v; +eval WITH cte AS ( $q ) SELECT * FROM cte; + +eval EXPLAIN $q; +EXPLAIN SELECT * FROM v; +eval EXPLAIN WITH cte AS ( $q ) SELECT * FROM cte; + +eval PREPARE stmt FROM "$q"; +execute stmt; +execute stmt; +DEALLOCATE PREPARE stmt; + +eval PREPARE stmt FROM "SELECT * FROM v"; +execute stmt; +execute stmt; +DEALLOCATE PREPARE stmt; + +eval PREPARE stmt FROM "WITH cte AS ( $q ) SELECT * FROM cte"; +execute stmt; +execute stmt; +DEALLOCATE PREPARE stmt; + +DROP VIEW v; +DROP TABLE t1,t2; + +--echo # +--echo # MDEV-28573: view defined as select with implicit grouping and +--echo # a set function used in a subquery +--echo # + +CREATE TABLE t1 (a INTEGER, b INTEGER); +CREATE TABLE t2 (c INTEGER); +INSERT INTO t1 VALUES (1,11), (2,22), (2,22); +INSERT INTO t2 VALUES (1), (2); + +let $q1= +SELECT (SELECT COUNT(b) FROM t2) FROM t1; +let $q2= +SELECT (SELECT COUNT(b) FROM t2 WHERE c > 1) FROM t1; + +eval CREATE VIEW v1 AS $q1; +eval CREATE VIEW v2 AS $q2; + +--error ER_SUBQUERY_NO_1_ROW +eval $q1; +--error ER_SUBQUERY_NO_1_ROW +SELECT * FROM v1; +--error ER_SUBQUERY_NO_1_ROW +eval WITH cte AS ( $q1 ) SELECT * FROM cte; +eval $q2; +SELECT * FROM v2; +eval WITH cte AS ( $q2 ) SELECT * FROM cte; + +eval EXPLAIN $q1; +EXPLAIN SELECT * FROM v1; +eval EXPLAIN WITH cte AS ( $q1 ) SELECT * FROM cte; + +eval PREPARE stmt FROM "$q1"; +--error ER_SUBQUERY_NO_1_ROW +execute stmt; +--error ER_SUBQUERY_NO_1_ROW +execute stmt; +DEALLOCATE PREPARE stmt; + +eval PREPARE stmt FROM "SELECT * FROM v1"; +--error ER_SUBQUERY_NO_1_ROW +execute stmt; +--error ER_SUBQUERY_NO_1_ROW +execute stmt; +DEALLOCATE PREPARE stmt; + +eval PREPARE stmt FROM "WITH cte AS ( $q1 ) SELECT * FROM cte"; +--error ER_SUBQUERY_NO_1_ROW +execute stmt; +--error ER_SUBQUERY_NO_1_ROW +execute stmt; +DEALLOCATE PREPARE stmt; + +eval PREPARE stmt FROM "$q2"; +execute stmt; +execute stmt; +DEALLOCATE PREPARE stmt; + +eval PREPARE stmt FROM "SELECT * FROM v2"; +execute stmt; +execute stmt; +DEALLOCATE PREPARE stmt; + +eval PREPARE stmt FROM "WITH cte AS ( $q2 ) SELECT * FROM cte"; +execute stmt; +execute stmt; +DEALLOCATE PREPARE stmt; + +DROP VIEW v1,v2; +DROP TABLE t1,t2; + +--echo # +--echo # MDEV-28570: VIEW with WHERE containing subquery +--echo # with set function aggregated in query +--echo # + +CREATE TABLE t1 (a int, b int); +CREATE TABLE t2 (c int, d int); + +INSERT INTO t1 VALUES + (1,10), (2,10), (1,20), (2,20), (3,20), (2,30), (4,40); +INSERT INTO t2 VALUES + (2,10), (2,20), (4,10), (5,10), (3,20), (2,40); + +let $q= +SELECT a FROM t1 GROUP BY a + HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20); + +eval CREATE VIEW v AS $q; + +eval $q; +SELECT * FROM v; +eval WITH cte AS ( $q ) SELECT * FROM cte; + +eval EXPLAIN $q; +EXPLAIN SELECT * FROM v; +eval EXPLAIN WITH cte AS ( $q ) SELECT * FROM cte; + +eval PREPARE stmt FROM "$q"; +execute stmt; +execute stmt; +DEALLOCATE PREPARE stmt; + +eval PREPARE stmt FROM "SELECT * FROM v"; +execute stmt; +execute stmt; +DEALLOCATE PREPARE stmt; + +eval PREPARE stmt FROM "WITH cte AS ( $q ) SELECT * FROM cte"; +execute stmt; +execute stmt; +DEALLOCATE PREPARE stmt; + +DROP VIEW v; +DROP TABLE t1,t2; + +--echo # +--echo # MDEV-28571: VIEW with select list containing subquery +--echo # with set function aggregated in query +--echo # + +CREATE TABLE t1 (a int, b int); +CREATE TABLE t2 (m int, n int); +INSERT INTO t1 VALUES (2,2), (2,2), (3,3), (3,3), (3,3), (4,4); +INSERT INTO t2 VALUES (1,11), (2,22), (3,32), (4,44), (4,44); + +let $q= +SELECT (SELECT GROUP_CONCAT(COUNT(a)) FROM t2 WHERE m = a) AS c +FROM t1 +GROUP BY a; + +eval CREATE VIEW v AS $q; + +eval $q; +SELECT * FROM v; +eval WITH cte AS ( $q ) SELECT * FROM cte; + +eval EXPLAIN $q; +EXPLAIN SELECT * FROM v; +eval EXPLAIN WITH cte AS ( $q ) SELECT * FROM cte; + +eval PREPARE stmt FROM "$q"; +execute stmt; +execute stmt; +DEALLOCATE PREPARE stmt; + +eval PREPARE stmt FROM "SELECT * FROM v"; +execute stmt; +execute stmt; +DEALLOCATE PREPARE stmt; + +eval PREPARE stmt FROM "WITH cte AS ( $q ) SELECT * FROM cte"; +execute stmt; +execute stmt; +DEALLOCATE PREPARE stmt; + +DROP VIEW v; +DROP TABLE t1,t2; + +--echo # +--echo # MDEV-30668: VIEW with WHERE containing nested subquery +--echo # with set function aggregated in outer subquery +--echo # + +create table t1 (a int); +insert into t1 values (3), (7), (1); + +create table t2 (b int); +insert into t2 values (2), (1), (4), (7); + +create table t3 (a int, b int); +insert into t3 values (2,10), (7,30), (2,30), (1,10), (7,40); + +let $q= +select * from t1 + where t1.a in (select t3.a from t3 group by t3.a + having t3.a > any (select t2.b from t2 + where t2.b*10 < sum(t3.b))); +eval create view v as $q; + +eval $q; +eval select * from v; +eval with cte as ( $q ) select * from cte; + +eval explain $q; +eval explain select * from v; +eval explain with cte as ( $q ) select * from cte; + +eval prepare stmt from "$q"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +eval prepare stmt from "select * from v"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +eval prepare stmt from "with cte as ( $q ) select * from cte"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +drop view v; +drop table t1,t2,t3; + +--echo # End of 10.4 tests diff --git a/mysql-test/main/func_group.result b/mysql-test/main/func_group.result index a0ee121df06..f6fcc61dcfe 100644 --- a/mysql-test/main/func_group.result +++ b/mysql-test/main/func_group.result @@ -1443,16 +1443,11 @@ FROM derived1 AS X WHERE X.int_nokey < 61 GROUP BY pk -LIMIT 1) +LIMIT 1) AS m FROM D AS X WHERE X.int_key < 13 GROUP BY int_nokey LIMIT 1; -(SELECT COUNT( int_nokey ) -FROM derived1 AS X -WHERE -X.int_nokey < 61 -GROUP BY pk -LIMIT 1) +m 1 DROP TABLE derived1; DROP TABLE D; diff --git a/mysql-test/main/func_group.test b/mysql-test/main/func_group.test index e5ae33f7208..446154e517b 100644 --- a/mysql-test/main/func_group.test +++ b/mysql-test/main/func_group.test @@ -579,8 +579,6 @@ DROP TABLE t1; # # Bug #16792 query with subselect, join, and group not returning proper values # -#enable after fix MDEV-28573 ---disable_view_protocol CREATE TABLE t1 (a INT, b INT); INSERT INTO t1 VALUES (1,1),(1,2),(2,3); @@ -591,7 +589,6 @@ SELECT AVG(2), BIT_AND(2), BIT_OR(2), BIT_XOR(2), COUNT(*), COUNT(12), COUNT(DISTINCT 12), MIN(2),MAX(2),STD(2), VARIANCE(2),SUM(2), GROUP_CONCAT(2),GROUP_CONCAT(DISTINCT 2); DROP TABLE t1; ---enable_view_protocol # End of 4.1 tests @@ -623,13 +620,10 @@ drop table t1, t2, t3; # # BUG#3190, WL#1639: Standard Deviation STDDEV - 2 different calculations # -#enable after fix MDEV-28573 ---disable_view_protocol CREATE TABLE t1 (id int(11),value1 float(10,2)); INSERT INTO t1 VALUES (1,0.00),(1,1.00), (1,2.00), (2,10.00), (2,11.00), (2,12.00), (2,13.00); select id, stddev_pop(value1), var_pop(value1), stddev_samp(value1), var_samp(value1) from t1 group by id; DROP TABLE t1; ---enable_view_protocol # # BUG#8464 decimal AVG returns incorrect result @@ -966,22 +960,19 @@ INSERT INTO D VALUES (83,45,4,repeat(' X', 42)), (105,53,12,NULL); -#enable after fix MDEV-27871 ---disable_view_protocol SELECT (SELECT COUNT( int_nokey ) FROM derived1 AS X WHERE X.int_nokey < 61 GROUP BY pk - LIMIT 1) + LIMIT 1) AS m FROM D AS X WHERE X.int_key < 13 GROUP BY int_nokey LIMIT 1; DROP TABLE derived1; DROP TABLE D; ---enable_view_protocol # # Bug #39656: Behaviour different for agg functions with & without where - diff --git a/mysql-test/main/group_by.result b/mysql-test/main/group_by.result index 06138b3030c..07629a2bcf2 100644 --- a/mysql-test/main/group_by.result +++ b/mysql-test/main/group_by.result @@ -1027,8 +1027,9 @@ FROM t1 AS t1_outer GROUP BY t1_outer.b; 21 21 SELECT (SELECT SUM(t1_inner.a) FROM t1 AS t1_inner GROUP BY t1_inner.b LIMIT 1) +AS m FROM t1 AS t1_outer; -(SELECT SUM(t1_inner.a) FROM t1 AS t1_inner GROUP BY t1_inner.b LIMIT 1) +m 3 3 3 @@ -1268,12 +1269,9 @@ a select avg ( (select (select sum(outr.a + innr.a) from t1 as innr limit 1) as tt -from t1 as outr order by outr.a limit 1)) +from t1 as outr order by outr.a limit 1)) as m from t1 as most_outer; -avg ( -(select -(select sum(outr.a + innr.a) from t1 as innr limit 1) as tt -from t1 as outr order by outr.a limit 1)) +m 29.0000 select avg ( (select ( diff --git a/mysql-test/main/group_by.test b/mysql-test/main/group_by.test index 95518c37160..9bbe1e0bf2b 100644 --- a/mysql-test/main/group_by.test +++ b/mysql-test/main/group_by.test @@ -774,11 +774,9 @@ SELECT 1 FROM t1 as t1_outer GROUP BY a SELECT (SELECT SUM(t1_inner.a) FROM t1 AS t1_inner LIMIT 1) FROM t1 AS t1_outer GROUP BY t1_outer.b; -#enable after fix MDEV-27871 ---disable_view_protocol SELECT (SELECT SUM(t1_inner.a) FROM t1 AS t1_inner GROUP BY t1_inner.b LIMIT 1) +AS m FROM t1 AS t1_outer; ---enable_view_protocol --error ER_WRONG_FIELD_WITH_GROUP SELECT (SELECT SUM(t1_outer.a) FROM t1 AS t1_inner LIMIT 1) @@ -854,6 +852,7 @@ DROP TABLE t1; --echo # --echo # Bug#27219: Aggregate functions in ORDER BY. --echo # + SET @save_sql_mode=@@sql_mode; SET @@sql_mode='ONLY_FULL_GROUP_BY'; @@ -875,6 +874,8 @@ SELECT 1 FROM t1 ORDER BY SUM(a) + 1; --error 1140 SELECT 1 FROM t1 ORDER BY SUM(a), b; +--disable_service_connection + --error 1140 SELECT a FROM t1 ORDER BY COUNT(b); @@ -887,9 +888,6 @@ SELECT t1.a FROM t1 ORDER BY (SELECT SUM(t2.a) FROM t2 ORDER BY t2.a); --error 1140 SELECT t1.a FROM t1 ORDER BY (SELECT t2.a FROM t2 ORDER BY SUM(t2.b) LIMIT 1); -#enable after fix MDEV-28570 ---disable_view_protocol - --error 1140 SELECT t1.a FROM t1 WHERE t1.a = (SELECT t2.a FROM t2 ORDER BY SUM(t2.b) LIMIT 1); @@ -927,7 +925,7 @@ SELECT 1 FROM t1 GROUP BY t1.a SELECT 1 FROM t1 GROUP BY t1.a HAVING (SELECT AVG(t1.b + t2.b) FROM t2 ORDER BY t2.a LIMIT 1); ---enable_view_protocol +--enable_service_connection # Both SUMs are aggregated in the subquery, no mixture: SELECT t1.a FROM t1 @@ -952,18 +950,17 @@ SELECT t1.a, SUM(t1.b) FROM t1 ORDER BY SUM(t2.b + t1.a) LIMIT 1) GROUP BY t1.a; -#enable after fix MDEV-28570, MDEV-28571 ---disable_view_protocol - SELECT t1.a FROM t1 GROUP BY t1.a HAVING (1, 1) = (SELECT SUM(t1.a), t1.a FROM t2 LIMIT 1); select avg ( (select (select sum(outr.a + innr.a) from t1 as innr limit 1) as tt - from t1 as outr order by outr.a limit 1)) + from t1 as outr order by outr.a limit 1)) as m from t1 as most_outer; +--disable_service_connection + --error 1140 select avg ( (select ( @@ -971,7 +968,7 @@ select avg ( from t1 as outr order by count(outr.a) limit 1)) as tt from t1 as most_outer; ---enable_view_protocol +--enable_service_connection select (select sum(outr.a + t1.a) from t1 limit 1) as tt from t1 as outr order by outr.a; @@ -1369,7 +1366,7 @@ DROP TABLE t1; --echo # Bug#11765254 (58200): Assertion failed: param.sort_length when grouping --echo # by functions --echo # -#createing view adds one new warning +#creating view adds one new warning --disable_view_protocol SET BIG_TABLES=1; diff --git a/mysql-test/main/opt_trace.result b/mysql-test/main/opt_trace.result index a97d0074d24..a343d5941f1 100644 --- a/mysql-test/main/opt_trace.result +++ b/mysql-test/main/opt_trace.result @@ -4130,7 +4130,7 @@ explain select * from (select rand() from t1)q { "derived": { "table": "q", "select_id": 2, - "algorithm": "merged" + "algorithm": "materialized" } }, { @@ -4144,7 +4144,7 @@ explain select * from (select rand() from t1)q { } }, { - "expanded_query": "/* select#1 */ select rand() AS `rand()` from (/* select#2 */ select rand() AS `rand()` from t1) q" + "expanded_query": "/* select#1 */ select q.`rand()` AS `rand()` from (/* select#2 */ select rand() AS `rand()` from t1) q" } ] } @@ -4153,14 +4153,6 @@ explain select * from (select rand() from t1)q { "join_optimization": { "select_id": 1, "steps": [ - { - "derived": { - "table": "q", - "select_id": 2, - "algorithm": "materialized", - "cause": "Random function in the select" - } - }, { "join_optimization": { "select_id": 2, diff --git a/mysql-test/main/subselect.result b/mysql-test/main/subselect.result index c57cae70965..d2ae34029be 100644 --- a/mysql-test/main/subselect.result +++ b/mysql-test/main/subselect.result @@ -118,27 +118,27 @@ ROW(1,2,3) > (SELECT 1,2,1) SELECT ROW(1,2,3) = (SELECT 1,2,NULL); ROW(1,2,3) = (SELECT 1,2,NULL) NULL -SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a'); -(SELECT 1.5,2,'a') = ROW(1.5,2,'a') +SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a') AS m; +m 1 -SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b'); -(SELECT 1.5,2,'a') = ROW(1.5,2,'b') +SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b') AS m; +m 0 -SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b'); -(SELECT 1.5,2,'a') = ROW('1.5b',2,'b') +SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b') AS m; +m 0 Warnings: Warning 1292 Truncated incorrect DOUBLE value: '1.5b' -SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a'); -(SELECT 'b',2,'a') = ROW(1.5,2,'a') +SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a') AS m; +m 0 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'b' -SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a'); -(SELECT 1.5,2,'a') = ROW(1.5,'2','a') +SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a') AS m; +m 1 -SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a'); -(SELECT 1.5,'c','a') = ROW(1.5,2,'a') +SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a') AS m; +m 0 Warnings: Warning 1292 Truncated incorrect DECIMAL value: 'c' @@ -228,19 +228,26 @@ a 2 select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a < t1.a) order by 1 desc limit 1); a -select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4; -b (select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) +select +b, +(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m +from t4; +b m 8 7.5000 8 4.5000 9 7.5000 -explain extended select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4; +explain extended +select +b, +(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m +from t4; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t4 ALL NULL NULL NULL NULL 3 100.00 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,<`test`.`t4`.`a`>((/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4` +Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,<`test`.`t4`.`a`>((/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `m` from `test`.`t4` select * from t3 where exists (select * from t2 where t2.b=t3.a); a 7 @@ -307,21 +314,34 @@ select b,max(a) as ma from t4 group by b having b >= (select max(t2.a) from t2 w b ma 7 12 create table t5 (a int); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; -(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; +m a NULL 1 2 2 insert into t5 values (5); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; -(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; +m a NULL 1 2 2 insert into t5 values (2); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; -(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; +m a NULL 1 2 2 -explain extended select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; +explain extended +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00 @@ -330,7 +350,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select <`test`.`t2`.`a`>((/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` +Note 1003 /* select#1 */ select <`test`.`t2`.`a`>((/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `m`,`test`.`t2`.`a` AS `a` from `test`.`t2` select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; ERROR 21000: Subquery returns more than 1 row create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq)); @@ -486,8 +506,11 @@ SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING t mot topic date pseudo joce 40143 2002-10-22 joce joce 43506 2002-10-22 joce -SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) from t2; -mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) +SELECT +*, +topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) AS m +FROM t2; +mot topic date pseudo m joce 40143 2002-10-22 joce 1 joce 43506 2002-10-22 joce 1 SELECT * from t2 where topic = all (SELECT SUM(topic) FROM t2); @@ -505,8 +528,11 @@ joce 40143 2002-10-22 joce SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000); mot topic date pseudo joce 40143 2002-10-22 joce -SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) from t2; -mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) +SELECT +*, +topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) AS m +FROM t2; +mot topic date pseudo m joce 40143 2002-10-22 joce 1 joce 43506 2002-10-22 joce 0 drop table t1,t2; @@ -881,6 +907,25 @@ NULL select 1.5 > ANY (SELECT * from t1); 1.5 > ANY (SELECT * from t1) NULL +update t1 set a=NULL where a=2.5; +select 1.5 IN (SELECT * from t1); +1.5 IN (SELECT * from t1) +1 +select 3.5 IN (SELECT * from t1); +3.5 IN (SELECT * from t1) +1 +select 10.5 IN (SELECT * from t1); +10.5 IN (SELECT * from t1) +NULL +select 1.5 > ALL (SELECT * from t1); +1.5 > ALL (SELECT * from t1) +0 +select 10.5 > ALL (SELECT * from t1); +10.5 > ALL (SELECT * from t1) +NULL +select 1.5 > ANY (SELECT * from t1); +1.5 > ANY (SELECT * from t1) +NULL select 10.5 > ANY (SELECT * from t1); 10.5 > ANY (SELECT * from t1) 1 @@ -891,6 +936,20 @@ Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1249 Select 2 was reduced during optimization Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` +explain extended select (select a+1) from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1249 Select 2 was reduced during optimization +Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` +explain extended select (select a+1) from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1249 Select 2 was reduced during optimization +Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` select (select a+1) from t1; (select a+1) 2.5 @@ -1532,8 +1591,8 @@ create table t3 (a int, b int); insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), (2,-1), (3,10); insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1); insert into t3 values (3,3), (2,2), (1,1); -select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3; -a (select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) +select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) as m from t3; +a m 3 1 2 2 1 2 @@ -1728,8 +1787,8 @@ CREATE TABLE `t3` (`taskgenid` mediumint(9) NOT NULL auto_increment,`dbid` int(1 INSERT INTO `t3` (`taskgenid`, `dbid`, `taskid`, `mon`, `tues`,`wed`, `thur`, `fri`, `sat`, `sun`, `how_often`, `userid`, `active`) VALUES (1,-1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1); CREATE TABLE `t4` (`task_id` smallint(6) NOT NULL default '0',`description` varchar(200) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; INSERT INTO `t4` (`task_id`, `description`) VALUES (1, 'Daily Check List'),(2, 'Weekly Status'); -select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid; -dbid name (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') +select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') as m FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') as m from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid; +dbid name m -1 Valid 1 -1 Valid 2 1 -1 Should Not Return 0 @@ -3784,9 +3843,10 @@ SELECT (SELECT COUNT(DISTINCT t1.b) from t2) FROM t1 GROUP BY t1.a; 2 1 1 -SELECT (SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) +SELECT +(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) AS m FROM t1 GROUP BY t1.a; -(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) +m 2 1 1 @@ -3796,9 +3856,9 @@ COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b)) 1 1 1 1 SELECT COUNT(DISTINCT t1.b), -(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) +(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) AS m FROM t1 GROUP BY t1.a; -COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) +COUNT(DISTINCT t1.b) m 2 2 1 1 1 1 @@ -3822,16 +3882,10 @@ SELECT ( SELECT COUNT(DISTINCT t1.b) ) ) -FROM t1 GROUP BY t1.a LIMIT 1) +FROM t1 GROUP BY t1.a LIMIT 1) AS m FROM t1 t2 GROUP BY t2.a; -( -SELECT ( -SELECT ( -SELECT COUNT(DISTINCT t1.b) -) -) -FROM t1 GROUP BY t1.a LIMIT 1) +m 2 2 2 @@ -6425,11 +6479,10 @@ CREATE TABLE t3 (a int, b int); INSERT INTO t3 VALUES (10,7), (0,7); SELECT SUM(DISTINCT b), (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0 -WHERE t.a != 0 AND t2.a != 0) +WHERE t.a != 0 AND t2.a != 0) AS m FROM (SELECT * FROM t3) AS t GROUP BY 2; -SUM(DISTINCT b) (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0 -WHERE t.a != 0 AND t2.a != 0) +SUM(DISTINCT b) m 7 NULL SELECT SUM(DISTINCT b), (SELECT t2.a FROM t1,t2 WHERE t.a != 0 or 1=2 LIMIT 1) @@ -6562,66 +6615,93 @@ CREATE TABLE t3 (f3a int default 1, f3b int default 2); INSERT INTO t3 VALUES (1,1),(2,2); set @old_optimizer_switch = @@session.optimizer_switch; set @@optimizer_switch='materialization=on,partial_match_rowid_merge=on,partial_match_table_scan=off,subquery_cache=off,semijoin=off'; -SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2; -(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) +SELECT +(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m; +m NULL -SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2; -(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) +SELECT +(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m; +m NULL set @@session.optimizer_switch=@old_optimizer_switch; -SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2; -(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) +SELECT +(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m; +m NULL -SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2; +SELECT +(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2 AS m; (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m; +m NULL select (null, null) = (null, null); (null, null) = (null, null) @@ -6667,8 +6747,10 @@ INSERT INTO t2 VALUES (1); CREATE TABLE t3 ( c INT ); INSERT INTO t3 VALUES (4),(5); SET optimizer_switch='subquery_cache=off'; -SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; -( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) +SELECT +( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) AS m +FROM t1; +m 1 NULL SELECT ( SELECT b FROM t2 WHERE b = a OR b * 0) FROM t1; @@ -6885,7 +6967,9 @@ CREATE TABLE t3 (c INT); INSERT INTO t3 VALUES (8),(3); set @@expensive_subquery_limit= 0; EXPLAIN -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 @@ -6895,9 +6979,11 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) 3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +m NULL NULL NULL @@ -6923,7 +7009,9 @@ Handler_read_rnd_deleted 0 Handler_read_rnd_next 22 set @@expensive_subquery_limit= default; EXPLAIN -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 @@ -6933,9 +7021,11 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) 3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +m NULL NULL NULL diff --git a/mysql-test/main/subselect.test b/mysql-test/main/subselect.test index 187dc80b4b4..77da710a535 100644 --- a/mysql-test/main/subselect.test +++ b/mysql-test/main/subselect.test @@ -74,13 +74,13 @@ SELECT ROW(1,2,3) > (SELECT 1,2,1); #enable after fix MDEV-28585 --disable_view_protocol SELECT ROW(1,2,3) = (SELECT 1,2,NULL); -SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a'); -SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b'); -SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b'); -SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a'); -SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a'); -SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a'); --enable_view_protocol +SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a') AS m; +SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b') AS m; +SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b') AS m; +SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a') AS m; +SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a') AS m; +SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a') AS m; -- error ER_OPERAND_COLUMNS SELECT (SELECT * FROM (SELECT 'test' a,'test' b) a); @@ -118,11 +118,15 @@ set optimizer_switch=@tmp_optimizer_switch; select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1); select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a > t1.a) order by 1 desc limit 1); select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a < t1.a) order by 1 desc limit 1); -#enable afte fix MDEV-27871 ---disable_view_protocol -select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4; -explain extended select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4; ---enable_view_protocol +select + b, + (select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m +from t4; +explain extended +select + b, + (select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m +from t4; select * from t3 where exists (select * from t2 where t2.b=t3.a); select * from t3 where not exists (select * from t2 where t2.b=t3.a); select * from t3 where a in (select b from t2); @@ -155,16 +159,25 @@ delete from t2 where a=2 and b=10; select b,max(a) as ma from t4 group by b having b >= (select max(t2.a) from t2 where t2.b=t4.b); create table t5 (a int); -#enable afte fix MDEV-27871 ---disable_view_protocol - -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; +select + (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, + a +from t2; insert into t5 values (5); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; +select + (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, + a +from t2; insert into t5 values (2); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; -explain extended select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; ---enable_view_protocol +select + (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, + a +from t2; +explain extended +select + (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, + a +from t2; -- error ER_SUBQUERY_NO_1_ROW select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; @@ -269,19 +282,19 @@ SELECT * from t2 where topic = any (SELECT topic FROM t2 GROUP BY topic HAVING t SELECT * from t2 where topic = any (SELECT SUM(topic) FROM t1); SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic); SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100); -#enable after fix MDEV-27871 ---disable_view_protocol -SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) from t2; ---enable_view_protocol +SELECT + *, + topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) AS m +FROM t2; SELECT * from t2 where topic = all (SELECT SUM(topic) FROM t2); SELECT * from t2 where topic <> any (SELECT SUM(topic) FROM t2); SELECT * from t2 where topic IN (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000); SELECT * from t2 where topic = any (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000); SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000); -#enable after fix MDEV-27871 ---disable_view_protocol -SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) from t2; ---enable_view_protocol +SELECT + *, + topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) AS m +FROM t2; drop table t1,t2; #forumconthardwarefr7 @@ -523,11 +536,20 @@ select 10.5 IN (SELECT * from t1); select 1.5 > ALL (SELECT * from t1); select 10.5 > ALL (SELECT * from t1); select 1.5 > ANY (SELECT * from t1); +update t1 set a=NULL where a=2.5; +select 1.5 IN (SELECT * from t1); +select 3.5 IN (SELECT * from t1); +select 10.5 IN (SELECT * from t1); +select 1.5 > ALL (SELECT * from t1); +select 10.5 > ALL (SELECT * from t1); +select 1.5 > ANY (SELECT * from t1); select 10.5 > ANY (SELECT * from t1); +--enable_view_protocol +explain extended select (select a+1) from t1; +explain extended select (select a+1) from t1; explain extended select (select a+1) from t1; select (select a+1) from t1; drop table t1; ---enable_view_protocol # # Null with keys @@ -947,10 +969,7 @@ create table t3 (a int, b int); insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), (2,-1), (3,10); insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1); insert into t3 values (3,3), (2,2), (1,1); -#enable after fix MDEV-27871 ---disable_view_protocol -select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3; ---enable_view_protocol +select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) as m from t3; drop table t1,t2,t3; # @@ -1068,10 +1087,7 @@ CREATE TABLE `t3` (`taskgenid` mediumint(9) NOT NULL auto_increment,`dbid` int(1 INSERT INTO `t3` (`taskgenid`, `dbid`, `taskid`, `mon`, `tues`,`wed`, `thur`, `fri`, `sat`, `sun`, `how_often`, `userid`, `active`) VALUES (1,-1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1); CREATE TABLE `t4` (`task_id` smallint(6) NOT NULL default '0',`description` varchar(200) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; INSERT INTO `t4` (`task_id`, `description`) VALUES (1, 'Daily Check List'),(2, 'Weekly Status'); -#enable after fix MDEV-27871 ---disable_view_protocol -select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid; ---enable_view_protocol +select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') as m FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') as m from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid; SELECT dbid, name FROM t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND ((date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01')) AND t4.task_id = taskid; drop table t1,t2,t3,t4; @@ -2390,9 +2406,6 @@ SELECT a, MAX(b), MIN(b) FROM t1 GROUP BY a; SELECT * FROM t2; SELECT * FROM t3; -#enable after fix MDEV-28570 ---disable_view_protocol - SELECT a FROM t1 GROUP BY a HAVING a IN (SELECT c FROM t2 WHERE MAX(b)>20); SELECT a FROM t1 GROUP BY a @@ -2457,8 +2470,6 @@ SELECT t1.a, SUM(b) AS sum FROM t1 GROUP BY t1.a HAVING t1.a IN (SELECT t2.c FROM t2 GROUP BY t2.c HAVING t2.c+sum > 20); ---enable_view_protocol - DROP TABLE t1,t2,t3; @@ -2689,19 +2700,17 @@ DROP TABLE t1; # Bug#21540 Subqueries with no from and aggregate functions return # wrong results -#enable after fix MDEV-27871, MDEV-28573 ---disable_view_protocol - CREATE TABLE t1 (a INT, b INT); CREATE TABLE t2 (a INT); INSERT INTO t2 values (1); INSERT INTO t1 VALUES (1,1),(1,2),(2,3),(3,4); SELECT (SELECT COUNT(DISTINCT t1.b) from t2) FROM t1 GROUP BY t1.a; -SELECT (SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) +SELECT + (SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) AS m FROM t1 GROUP BY t1.a; SELECT COUNT(DISTINCT t1.b), (SELECT COUNT(DISTINCT t1.b)) FROM t1 GROUP BY t1.a; SELECT COUNT(DISTINCT t1.b), - (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) + (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) AS m FROM t1 GROUP BY t1.a; SELECT ( SELECT ( @@ -2715,11 +2724,10 @@ SELECT ( SELECT COUNT(DISTINCT t1.b) ) ) - FROM t1 GROUP BY t1.a LIMIT 1) + FROM t1 GROUP BY t1.a LIMIT 1) AS m FROM t1 t2 GROUP BY t2.a; DROP TABLE t1,t2; ---enable_view_protocol # # Bug#21727 Correlated subquery that requires filesort: @@ -2954,8 +2962,6 @@ DROP TABLE t1,t2; # Bug#27229 GROUP_CONCAT in subselect with COUNT() as an argument # -#enable after fix MDEV-28571 ---disable_view_protocol CREATE TABLE t1 (a int, b int); CREATE TABLE t2 (m int, n int); INSERT INTO t1 VALUES (2,2), (2,2), (3,3), (3,3), (3,3), (4,4); @@ -2970,7 +2976,6 @@ SELECT COUNT(*) c, a, FROM t1 GROUP BY a; DROP table t1,t2; ---enable_view_protocol # # Bug#27321 Wrong subquery result in a grouping select @@ -3001,14 +3006,11 @@ SELECT tt.a, FROM t1 WHERE t1.a=tt.a GROUP BY a LIMIT 1) as test FROM t1 as tt GROUP BY tt.a; -#enable after fix MDEV-28571 ---disable_view_protocol SELECT tt.a, MAX( (SELECT (SELECT t.c FROM t1 AS t WHERE t1.a=t.a AND t.d=MAX(t1.b + tt.a) LIMIT 1) FROM t1 WHERE t1.a=tt.a GROUP BY a LIMIT 1)) as test FROM t1 as tt GROUP BY tt.a; ---enable_view_protocol DROP TABLE t1; @@ -3163,8 +3165,6 @@ CREATE TABLE t2 (x INTEGER); INSERT INTO t1 VALUES (1,11), (2,22), (2,22); INSERT INTO t2 VALUES (1), (2); -#enable after fix MDEV-28573 ---disable_view_protocol # wasn't failing, but should --error ER_SUBQUERY_NO_1_ROW SELECT a, COUNT(b), (SELECT COUNT(b) FROM t2) FROM t1 GROUP BY a; @@ -3174,7 +3174,6 @@ SELECT a, COUNT(b), (SELECT COUNT(b) FROM t2) FROM t1 GROUP BY a; SELECT a, COUNT(b), (SELECT COUNT(b)+0 FROM t2) FROM t1 GROUP BY a; SELECT (SELECT SUM(t1.a)/AVG(t2.x) FROM t2) FROM t1; ---enable_view_protocol DROP TABLE t1,t2; @@ -3189,8 +3188,6 @@ GROUP BY a1.a; DROP TABLE t1; #test cases from 29297 -#enable after fix MDEV-28573 ---disable_view_protocol CREATE TABLE t1 (a INT); CREATE TABLE t2 (a INT); INSERT INTO t1 VALUES (1),(2); @@ -3200,7 +3197,6 @@ SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=0) FROM t1; SELECT (SELECT SUM(t1.a) FROM t2 WHERE a!=0) FROM t1; SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=1) FROM t1; DROP TABLE t1,t2; ---enable_view_protocol # # Bug#31884 Assertion + crash in subquery in the SELECT clause. @@ -5402,14 +5398,11 @@ INSERT INTO t2 VALUES (10,7,0), (0,7,0); CREATE TABLE t3 (a int, b int); INSERT INTO t3 VALUES (10,7), (0,7); -#enable after fix MDEV-27871 ---disable_view_protocol SELECT SUM(DISTINCT b), (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0 - WHERE t.a != 0 AND t2.a != 0) + WHERE t.a != 0 AND t2.a != 0) AS m FROM (SELECT * FROM t3) AS t GROUP BY 2; ---enable_view_protocol SELECT SUM(DISTINCT b), (SELECT t2.a FROM t1,t2 WHERE t.a != 0 or 1=2 LIMIT 1) @@ -5567,29 +5560,53 @@ INSERT INTO t3 VALUES (1,1),(2,2); set @old_optimizer_switch = @@session.optimizer_switch; set @@optimizer_switch='materialization=on,partial_match_rowid_merge=on,partial_match_table_scan=off,subquery_cache=off,semijoin=off'; -#enable after fix MDEV-27871 ---disable_view_protocol -SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2; -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2; -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2; -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1); -SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2; -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2; -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2; -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1); +SELECT + (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m +FROM t2; +SELECT + (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m + FROM t2; +SELECT + (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +SELECT + (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m; +SELECT + (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) AS m +FROM t2; +SELECT + (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +SELECT + (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +SELECT + (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m; set @@session.optimizer_switch=@old_optimizer_switch; # check different IN with default switches -SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2; -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2; -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2; -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1); -SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2; -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2; -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2; -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1); ---enable_view_protocol +SELECT + (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m +FROM t2; +SELECT + (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +SELECT + (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +SELECT + (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m; +SELECT + (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2 AS m; +SELECT + (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +SELECT + (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +SELECT + (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m; # other row operation with NULL single row subquery also should work select (null, null) = (null, null); @@ -5629,10 +5646,9 @@ INSERT INTO t3 VALUES (4),(5); SET optimizer_switch='subquery_cache=off'; -#enable after fix MDEV-27871 ---disable_view_protocol -SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; ---enable_view_protocol +SELECT + ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) AS m +FROM t1; # This query just for example, it should return the same as above (1 and NULL) SELECT ( SELECT b FROM t2 WHERE b = a OR b * 0) FROM t1; @@ -5821,15 +5837,17 @@ INSERT INTO t3 VALUES (8),(3); set @@expensive_subquery_limit= 0; -#enable after fix MDEV-27871 ---disable_view_protocol EXPLAIN -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT + (SELECT MIN(b) FROM t1, t2 + WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; flush status; -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT + (SELECT MIN(b) FROM t1, t2 + WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; show status like "subquery_cache%"; @@ -5838,17 +5856,20 @@ show status like '%Handler_read%'; set @@expensive_subquery_limit= default; EXPLAIN -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT + (SELECT MIN(b) FROM t1, t2 + WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; flush status; -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT + (SELECT MIN(b) FROM t1, t2 + WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; show status like "subquery_cache%"; show status like '%Handler_read%'; ---enable_view_protocol drop table t1, t2, t3; @@ -6102,22 +6123,16 @@ INSERT INTO t1 VALUES (1),(2); CREATE TABLE t2 (f2 int); INSERT INTO t2 VALUES (3); -#enable after fix MDEV-29224 ---disable_view_protocol SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1; SELECT ( SELECT MAX(f1) FROM t2 ) FROM v1; ---enable_view_protocol INSERT INTO t2 VALUES (4); -#enable after fix MDEV-28573 ---disable_view_protocol --error ER_SUBQUERY_NO_1_ROW SELECT ( SELECT MAX(f1) FROM t2 ) FROM v1; --error ER_SUBQUERY_NO_1_ROW SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1; ---enable_view_protocol drop view v1; drop table t1,t2; diff --git a/mysql-test/main/subselect4.result b/mysql-test/main/subselect4.result index 262adc51d3a..259337cf646 100644 --- a/mysql-test/main/subselect4.result +++ b/mysql-test/main/subselect4.result @@ -20,8 +20,8 @@ WHERE NOT EXISTS (SELECT 1 FROM t2 WHERE 1 = (SELECT MIN(t2.b) FROM t3)) ORDER BY count(*); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL a 5 NULL 2 Using index -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where -3 DEPENDENT SUBQUERY t3 system NULL NULL NULL NULL 0 Const row not found +2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where +3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table # should not crash the next statement SELECT 1 FROM t1 WHERE NOT EXISTS (SELECT 1 FROM t2 WHERE 1 = (SELECT MIN(t2.b) FROM t3)) diff --git a/mysql-test/main/subselect_no_exists_to_in.result b/mysql-test/main/subselect_no_exists_to_in.result index 8746f7278c3..f508cb259bb 100644 --- a/mysql-test/main/subselect_no_exists_to_in.result +++ b/mysql-test/main/subselect_no_exists_to_in.result @@ -122,27 +122,27 @@ ROW(1,2,3) > (SELECT 1,2,1) SELECT ROW(1,2,3) = (SELECT 1,2,NULL); ROW(1,2,3) = (SELECT 1,2,NULL) NULL -SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a'); -(SELECT 1.5,2,'a') = ROW(1.5,2,'a') +SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a') AS m; +m 1 -SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b'); -(SELECT 1.5,2,'a') = ROW(1.5,2,'b') +SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b') AS m; +m 0 -SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b'); -(SELECT 1.5,2,'a') = ROW('1.5b',2,'b') +SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b') AS m; +m 0 Warnings: Warning 1292 Truncated incorrect DOUBLE value: '1.5b' -SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a'); -(SELECT 'b',2,'a') = ROW(1.5,2,'a') +SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a') AS m; +m 0 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'b' -SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a'); -(SELECT 1.5,2,'a') = ROW(1.5,'2','a') +SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a') AS m; +m 1 -SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a'); -(SELECT 1.5,'c','a') = ROW(1.5,2,'a') +SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a') AS m; +m 0 Warnings: Warning 1292 Truncated incorrect DECIMAL value: 'c' @@ -232,19 +232,26 @@ a 2 select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a < t1.a) order by 1 desc limit 1); a -select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4; -b (select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) +select +b, +(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m +from t4; +b m 8 7.5000 8 4.5000 9 7.5000 -explain extended select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4; +explain extended +select +b, +(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m +from t4; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t4 ALL NULL NULL NULL NULL 3 100.00 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,<`test`.`t4`.`a`>((/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4` +Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,<`test`.`t4`.`a`>((/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `m` from `test`.`t4` select * from t3 where exists (select * from t2 where t2.b=t3.a); a 7 @@ -311,21 +318,34 @@ select b,max(a) as ma from t4 group by b having b >= (select max(t2.a) from t2 w b ma 7 12 create table t5 (a int); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; -(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; +m a NULL 1 2 2 insert into t5 values (5); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; -(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; +m a NULL 1 2 2 insert into t5 values (2); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; -(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; +m a NULL 1 2 2 -explain extended select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; +explain extended +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00 @@ -334,7 +354,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select <`test`.`t2`.`a`>((/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` +Note 1003 /* select#1 */ select <`test`.`t2`.`a`>((/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `m`,`test`.`t2`.`a` AS `a` from `test`.`t2` select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; ERROR 21000: Subquery returns more than 1 row create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq)); @@ -490,8 +510,11 @@ SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING t mot topic date pseudo joce 40143 2002-10-22 joce joce 43506 2002-10-22 joce -SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) from t2; -mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) +SELECT +*, +topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) AS m +FROM t2; +mot topic date pseudo m joce 40143 2002-10-22 joce 1 joce 43506 2002-10-22 joce 1 SELECT * from t2 where topic = all (SELECT SUM(topic) FROM t2); @@ -509,8 +532,11 @@ joce 40143 2002-10-22 joce SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000); mot topic date pseudo joce 40143 2002-10-22 joce -SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) from t2; -mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) +SELECT +*, +topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) AS m +FROM t2; +mot topic date pseudo m joce 40143 2002-10-22 joce 1 joce 43506 2002-10-22 joce 0 drop table t1,t2; @@ -885,6 +911,25 @@ NULL select 1.5 > ANY (SELECT * from t1); 1.5 > ANY (SELECT * from t1) NULL +update t1 set a=NULL where a=2.5; +select 1.5 IN (SELECT * from t1); +1.5 IN (SELECT * from t1) +1 +select 3.5 IN (SELECT * from t1); +3.5 IN (SELECT * from t1) +1 +select 10.5 IN (SELECT * from t1); +10.5 IN (SELECT * from t1) +NULL +select 1.5 > ALL (SELECT * from t1); +1.5 > ALL (SELECT * from t1) +0 +select 10.5 > ALL (SELECT * from t1); +10.5 > ALL (SELECT * from t1) +NULL +select 1.5 > ANY (SELECT * from t1); +1.5 > ANY (SELECT * from t1) +NULL select 10.5 > ANY (SELECT * from t1); 10.5 > ANY (SELECT * from t1) 1 @@ -895,6 +940,20 @@ Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1249 Select 2 was reduced during optimization Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` +explain extended select (select a+1) from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1249 Select 2 was reduced during optimization +Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` +explain extended select (select a+1) from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1249 Select 2 was reduced during optimization +Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` select (select a+1) from t1; (select a+1) 2.5 @@ -1536,8 +1595,8 @@ create table t3 (a int, b int); insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), (2,-1), (3,10); insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1); insert into t3 values (3,3), (2,2), (1,1); -select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3; -a (select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) +select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) as m from t3; +a m 3 1 2 2 1 2 @@ -1732,8 +1791,8 @@ CREATE TABLE `t3` (`taskgenid` mediumint(9) NOT NULL auto_increment,`dbid` int(1 INSERT INTO `t3` (`taskgenid`, `dbid`, `taskid`, `mon`, `tues`,`wed`, `thur`, `fri`, `sat`, `sun`, `how_often`, `userid`, `active`) VALUES (1,-1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1); CREATE TABLE `t4` (`task_id` smallint(6) NOT NULL default '0',`description` varchar(200) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; INSERT INTO `t4` (`task_id`, `description`) VALUES (1, 'Daily Check List'),(2, 'Weekly Status'); -select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid; -dbid name (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') +select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') as m FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') as m from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid; +dbid name m -1 Valid 1 -1 Valid 2 1 -1 Should Not Return 0 @@ -3787,9 +3846,10 @@ SELECT (SELECT COUNT(DISTINCT t1.b) from t2) FROM t1 GROUP BY t1.a; 2 1 1 -SELECT (SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) +SELECT +(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) AS m FROM t1 GROUP BY t1.a; -(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) +m 2 1 1 @@ -3799,9 +3859,9 @@ COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b)) 1 1 1 1 SELECT COUNT(DISTINCT t1.b), -(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) +(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) AS m FROM t1 GROUP BY t1.a; -COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) +COUNT(DISTINCT t1.b) m 2 2 1 1 1 1 @@ -3825,16 +3885,10 @@ SELECT ( SELECT COUNT(DISTINCT t1.b) ) ) -FROM t1 GROUP BY t1.a LIMIT 1) +FROM t1 GROUP BY t1.a LIMIT 1) AS m FROM t1 t2 GROUP BY t2.a; -( -SELECT ( -SELECT ( -SELECT COUNT(DISTINCT t1.b) -) -) -FROM t1 GROUP BY t1.a LIMIT 1) +m 2 2 2 @@ -6425,11 +6479,10 @@ CREATE TABLE t3 (a int, b int); INSERT INTO t3 VALUES (10,7), (0,7); SELECT SUM(DISTINCT b), (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0 -WHERE t.a != 0 AND t2.a != 0) +WHERE t.a != 0 AND t2.a != 0) AS m FROM (SELECT * FROM t3) AS t GROUP BY 2; -SUM(DISTINCT b) (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0 -WHERE t.a != 0 AND t2.a != 0) +SUM(DISTINCT b) m 7 NULL SELECT SUM(DISTINCT b), (SELECT t2.a FROM t1,t2 WHERE t.a != 0 or 1=2 LIMIT 1) @@ -6562,66 +6615,93 @@ CREATE TABLE t3 (f3a int default 1, f3b int default 2); INSERT INTO t3 VALUES (1,1),(2,2); set @old_optimizer_switch = @@session.optimizer_switch; set @@optimizer_switch='materialization=on,partial_match_rowid_merge=on,partial_match_table_scan=off,subquery_cache=off,semijoin=off'; -SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2; -(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) +SELECT +(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m; +m NULL -SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2; -(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) +SELECT +(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m; +m NULL set @@session.optimizer_switch=@old_optimizer_switch; -SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2; -(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) +SELECT +(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m; +m NULL -SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2; +SELECT +(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2 AS m; (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m; +m NULL select (null, null) = (null, null); (null, null) = (null, null) @@ -6667,8 +6747,10 @@ INSERT INTO t2 VALUES (1); CREATE TABLE t3 ( c INT ); INSERT INTO t3 VALUES (4),(5); SET optimizer_switch='subquery_cache=off'; -SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; -( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) +SELECT +( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) AS m +FROM t1; +m 1 NULL SELECT ( SELECT b FROM t2 WHERE b = a OR b * 0) FROM t1; @@ -6885,7 +6967,9 @@ CREATE TABLE t3 (c INT); INSERT INTO t3 VALUES (8),(3); set @@expensive_subquery_limit= 0; EXPLAIN -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 @@ -6895,9 +6979,11 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) 3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +m NULL NULL NULL @@ -6923,7 +7009,9 @@ Handler_read_rnd_deleted 0 Handler_read_rnd_next 22 set @@expensive_subquery_limit= default; EXPLAIN -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 @@ -6933,9 +7021,11 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) 3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +m NULL NULL NULL diff --git a/mysql-test/main/subselect_no_mat.result b/mysql-test/main/subselect_no_mat.result index f0d788d6b4a..02cb92fde08 100644 --- a/mysql-test/main/subselect_no_mat.result +++ b/mysql-test/main/subselect_no_mat.result @@ -125,27 +125,27 @@ ROW(1,2,3) > (SELECT 1,2,1) SELECT ROW(1,2,3) = (SELECT 1,2,NULL); ROW(1,2,3) = (SELECT 1,2,NULL) NULL -SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a'); -(SELECT 1.5,2,'a') = ROW(1.5,2,'a') +SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a') AS m; +m 1 -SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b'); -(SELECT 1.5,2,'a') = ROW(1.5,2,'b') +SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b') AS m; +m 0 -SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b'); -(SELECT 1.5,2,'a') = ROW('1.5b',2,'b') +SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b') AS m; +m 0 Warnings: Warning 1292 Truncated incorrect DOUBLE value: '1.5b' -SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a'); -(SELECT 'b',2,'a') = ROW(1.5,2,'a') +SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a') AS m; +m 0 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'b' -SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a'); -(SELECT 1.5,2,'a') = ROW(1.5,'2','a') +SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a') AS m; +m 1 -SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a'); -(SELECT 1.5,'c','a') = ROW(1.5,2,'a') +SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a') AS m; +m 0 Warnings: Warning 1292 Truncated incorrect DECIMAL value: 'c' @@ -235,19 +235,26 @@ a 2 select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a < t1.a) order by 1 desc limit 1); a -select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4; -b (select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) +select +b, +(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m +from t4; +b m 8 7.5000 8 4.5000 9 7.5000 -explain extended select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4; +explain extended +select +b, +(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m +from t4; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t4 ALL NULL NULL NULL NULL 3 100.00 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,<`test`.`t4`.`a`>((/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4` +Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,<`test`.`t4`.`a`>((/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `m` from `test`.`t4` select * from t3 where exists (select * from t2 where t2.b=t3.a); a 7 @@ -314,21 +321,34 @@ select b,max(a) as ma from t4 group by b having b >= (select max(t2.a) from t2 w b ma 7 12 create table t5 (a int); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; -(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; +m a NULL 1 2 2 insert into t5 values (5); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; -(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; +m a NULL 1 2 2 insert into t5 values (2); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; -(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; +m a NULL 1 2 2 -explain extended select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; +explain extended +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00 @@ -337,7 +357,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select <`test`.`t2`.`a`>((/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` +Note 1003 /* select#1 */ select <`test`.`t2`.`a`>((/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `m`,`test`.`t2`.`a` AS `a` from `test`.`t2` select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; ERROR 21000: Subquery returns more than 1 row create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq)); @@ -493,8 +513,11 @@ SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING t mot topic date pseudo joce 40143 2002-10-22 joce joce 43506 2002-10-22 joce -SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) from t2; -mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) +SELECT +*, +topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) AS m +FROM t2; +mot topic date pseudo m joce 40143 2002-10-22 joce 1 joce 43506 2002-10-22 joce 1 SELECT * from t2 where topic = all (SELECT SUM(topic) FROM t2); @@ -512,8 +535,11 @@ joce 40143 2002-10-22 joce SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000); mot topic date pseudo joce 40143 2002-10-22 joce -SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) from t2; -mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) +SELECT +*, +topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) AS m +FROM t2; +mot topic date pseudo m joce 40143 2002-10-22 joce 1 joce 43506 2002-10-22 joce 0 drop table t1,t2; @@ -888,6 +914,25 @@ NULL select 1.5 > ANY (SELECT * from t1); 1.5 > ANY (SELECT * from t1) NULL +update t1 set a=NULL where a=2.5; +select 1.5 IN (SELECT * from t1); +1.5 IN (SELECT * from t1) +1 +select 3.5 IN (SELECT * from t1); +3.5 IN (SELECT * from t1) +1 +select 10.5 IN (SELECT * from t1); +10.5 IN (SELECT * from t1) +NULL +select 1.5 > ALL (SELECT * from t1); +1.5 > ALL (SELECT * from t1) +0 +select 10.5 > ALL (SELECT * from t1); +10.5 > ALL (SELECT * from t1) +NULL +select 1.5 > ANY (SELECT * from t1); +1.5 > ANY (SELECT * from t1) +NULL select 10.5 > ANY (SELECT * from t1); 10.5 > ANY (SELECT * from t1) 1 @@ -898,6 +943,20 @@ Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1249 Select 2 was reduced during optimization Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` +explain extended select (select a+1) from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1249 Select 2 was reduced during optimization +Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` +explain extended select (select a+1) from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1249 Select 2 was reduced during optimization +Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` select (select a+1) from t1; (select a+1) 2.5 @@ -1539,8 +1598,8 @@ create table t3 (a int, b int); insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), (2,-1), (3,10); insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1); insert into t3 values (3,3), (2,2), (1,1); -select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3; -a (select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) +select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) as m from t3; +a m 3 1 2 2 1 2 @@ -1735,8 +1794,8 @@ CREATE TABLE `t3` (`taskgenid` mediumint(9) NOT NULL auto_increment,`dbid` int(1 INSERT INTO `t3` (`taskgenid`, `dbid`, `taskid`, `mon`, `tues`,`wed`, `thur`, `fri`, `sat`, `sun`, `how_often`, `userid`, `active`) VALUES (1,-1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1); CREATE TABLE `t4` (`task_id` smallint(6) NOT NULL default '0',`description` varchar(200) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; INSERT INTO `t4` (`task_id`, `description`) VALUES (1, 'Daily Check List'),(2, 'Weekly Status'); -select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid; -dbid name (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') +select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') as m FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') as m from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid; +dbid name m -1 Valid 1 -1 Valid 2 1 -1 Should Not Return 0 @@ -3787,9 +3846,10 @@ SELECT (SELECT COUNT(DISTINCT t1.b) from t2) FROM t1 GROUP BY t1.a; 2 1 1 -SELECT (SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) +SELECT +(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) AS m FROM t1 GROUP BY t1.a; -(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) +m 2 1 1 @@ -3799,9 +3859,9 @@ COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b)) 1 1 1 1 SELECT COUNT(DISTINCT t1.b), -(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) +(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) AS m FROM t1 GROUP BY t1.a; -COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) +COUNT(DISTINCT t1.b) m 2 2 1 1 1 1 @@ -3825,16 +3885,10 @@ SELECT ( SELECT COUNT(DISTINCT t1.b) ) ) -FROM t1 GROUP BY t1.a LIMIT 1) +FROM t1 GROUP BY t1.a LIMIT 1) AS m FROM t1 t2 GROUP BY t2.a; -( -SELECT ( -SELECT ( -SELECT COUNT(DISTINCT t1.b) -) -) -FROM t1 GROUP BY t1.a LIMIT 1) +m 2 2 2 @@ -6420,11 +6474,10 @@ CREATE TABLE t3 (a int, b int); INSERT INTO t3 VALUES (10,7), (0,7); SELECT SUM(DISTINCT b), (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0 -WHERE t.a != 0 AND t2.a != 0) +WHERE t.a != 0 AND t2.a != 0) AS m FROM (SELECT * FROM t3) AS t GROUP BY 2; -SUM(DISTINCT b) (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0 -WHERE t.a != 0 AND t2.a != 0) +SUM(DISTINCT b) m 7 NULL SELECT SUM(DISTINCT b), (SELECT t2.a FROM t1,t2 WHERE t.a != 0 or 1=2 LIMIT 1) @@ -6557,66 +6610,93 @@ CREATE TABLE t3 (f3a int default 1, f3b int default 2); INSERT INTO t3 VALUES (1,1),(2,2); set @old_optimizer_switch = @@session.optimizer_switch; set @@optimizer_switch='materialization=on,partial_match_rowid_merge=on,partial_match_table_scan=off,subquery_cache=off,semijoin=off'; -SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2; -(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) +SELECT +(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m; +m NULL -SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2; -(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) +SELECT +(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m; +m NULL set @@session.optimizer_switch=@old_optimizer_switch; -SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2; -(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) +SELECT +(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m; +m NULL -SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2; +SELECT +(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2 AS m; (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m; +m NULL select (null, null) = (null, null); (null, null) = (null, null) @@ -6662,8 +6742,10 @@ INSERT INTO t2 VALUES (1); CREATE TABLE t3 ( c INT ); INSERT INTO t3 VALUES (4),(5); SET optimizer_switch='subquery_cache=off'; -SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; -( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) +SELECT +( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) AS m +FROM t1; +m 1 NULL SELECT ( SELECT b FROM t2 WHERE b = a OR b * 0) FROM t1; @@ -6879,7 +6961,9 @@ CREATE TABLE t3 (c INT); INSERT INTO t3 VALUES (8),(3); set @@expensive_subquery_limit= 0; EXPLAIN -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 @@ -6889,9 +6973,11 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) 3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +m NULL NULL NULL @@ -6917,7 +7003,9 @@ Handler_read_rnd_deleted 0 Handler_read_rnd_next 22 set @@expensive_subquery_limit= default; EXPLAIN -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 @@ -6927,9 +7015,11 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) 3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +m NULL NULL NULL diff --git a/mysql-test/main/subselect_no_opts.result b/mysql-test/main/subselect_no_opts.result index 91e82ca838f..72b148b59d4 100644 --- a/mysql-test/main/subselect_no_opts.result +++ b/mysql-test/main/subselect_no_opts.result @@ -121,27 +121,27 @@ ROW(1,2,3) > (SELECT 1,2,1) SELECT ROW(1,2,3) = (SELECT 1,2,NULL); ROW(1,2,3) = (SELECT 1,2,NULL) NULL -SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a'); -(SELECT 1.5,2,'a') = ROW(1.5,2,'a') +SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a') AS m; +m 1 -SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b'); -(SELECT 1.5,2,'a') = ROW(1.5,2,'b') +SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b') AS m; +m 0 -SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b'); -(SELECT 1.5,2,'a') = ROW('1.5b',2,'b') +SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b') AS m; +m 0 Warnings: Warning 1292 Truncated incorrect DOUBLE value: '1.5b' -SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a'); -(SELECT 'b',2,'a') = ROW(1.5,2,'a') +SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a') AS m; +m 0 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'b' -SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a'); -(SELECT 1.5,2,'a') = ROW(1.5,'2','a') +SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a') AS m; +m 1 -SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a'); -(SELECT 1.5,'c','a') = ROW(1.5,2,'a') +SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a') AS m; +m 0 Warnings: Warning 1292 Truncated incorrect DECIMAL value: 'c' @@ -231,19 +231,26 @@ a 2 select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a < t1.a) order by 1 desc limit 1); a -select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4; -b (select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) +select +b, +(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m +from t4; +b m 8 7.5000 8 4.5000 9 7.5000 -explain extended select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4; +explain extended +select +b, +(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m +from t4; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t4 ALL NULL NULL NULL NULL 3 100.00 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,(/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4` +Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,(/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`) AS `m` from `test`.`t4` select * from t3 where exists (select * from t2 where t2.b=t3.a); a 7 @@ -310,21 +317,34 @@ select b,max(a) as ma from t4 group by b having b >= (select max(t2.a) from t2 w b ma 7 12 create table t5 (a int); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; -(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; +m a NULL 1 2 2 insert into t5 values (5); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; -(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; +m a NULL 1 2 2 insert into t5 values (2); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; -(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; +m a NULL 1 2 2 -explain extended select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; +explain extended +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00 @@ -333,7 +353,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select (/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` +Note 1003 /* select#1 */ select (/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`) AS `m`,`test`.`t2`.`a` AS `a` from `test`.`t2` select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; ERROR 21000: Subquery returns more than 1 row create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq)); @@ -489,8 +509,11 @@ SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING t mot topic date pseudo joce 40143 2002-10-22 joce joce 43506 2002-10-22 joce -SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) from t2; -mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) +SELECT +*, +topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) AS m +FROM t2; +mot topic date pseudo m joce 40143 2002-10-22 joce 1 joce 43506 2002-10-22 joce 1 SELECT * from t2 where topic = all (SELECT SUM(topic) FROM t2); @@ -508,8 +531,11 @@ joce 40143 2002-10-22 joce SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000); mot topic date pseudo joce 40143 2002-10-22 joce -SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) from t2; -mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) +SELECT +*, +topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) AS m +FROM t2; +mot topic date pseudo m joce 40143 2002-10-22 joce 1 joce 43506 2002-10-22 joce 0 drop table t1,t2; @@ -884,6 +910,25 @@ NULL select 1.5 > ANY (SELECT * from t1); 1.5 > ANY (SELECT * from t1) NULL +update t1 set a=NULL where a=2.5; +select 1.5 IN (SELECT * from t1); +1.5 IN (SELECT * from t1) +1 +select 3.5 IN (SELECT * from t1); +3.5 IN (SELECT * from t1) +1 +select 10.5 IN (SELECT * from t1); +10.5 IN (SELECT * from t1) +NULL +select 1.5 > ALL (SELECT * from t1); +1.5 > ALL (SELECT * from t1) +0 +select 10.5 > ALL (SELECT * from t1); +10.5 > ALL (SELECT * from t1) +NULL +select 1.5 > ANY (SELECT * from t1); +1.5 > ANY (SELECT * from t1) +NULL select 10.5 > ANY (SELECT * from t1); 10.5 > ANY (SELECT * from t1) 1 @@ -894,6 +939,20 @@ Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1249 Select 2 was reduced during optimization Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` +explain extended select (select a+1) from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1249 Select 2 was reduced during optimization +Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` +explain extended select (select a+1) from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1249 Select 2 was reduced during optimization +Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` select (select a+1) from t1; (select a+1) 2.5 @@ -1535,8 +1594,8 @@ create table t3 (a int, b int); insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), (2,-1), (3,10); insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1); insert into t3 values (3,3), (2,2), (1,1); -select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3; -a (select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) +select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) as m from t3; +a m 3 1 2 2 1 2 @@ -1731,8 +1790,8 @@ CREATE TABLE `t3` (`taskgenid` mediumint(9) NOT NULL auto_increment,`dbid` int(1 INSERT INTO `t3` (`taskgenid`, `dbid`, `taskid`, `mon`, `tues`,`wed`, `thur`, `fri`, `sat`, `sun`, `how_often`, `userid`, `active`) VALUES (1,-1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1); CREATE TABLE `t4` (`task_id` smallint(6) NOT NULL default '0',`description` varchar(200) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; INSERT INTO `t4` (`task_id`, `description`) VALUES (1, 'Daily Check List'),(2, 'Weekly Status'); -select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid; -dbid name (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') +select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') as m FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') as m from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid; +dbid name m -1 Valid 1 -1 Valid 2 1 -1 Should Not Return 0 @@ -3783,9 +3842,10 @@ SELECT (SELECT COUNT(DISTINCT t1.b) from t2) FROM t1 GROUP BY t1.a; 2 1 1 -SELECT (SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) +SELECT +(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) AS m FROM t1 GROUP BY t1.a; -(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) +m 2 1 1 @@ -3795,9 +3855,9 @@ COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b)) 1 1 1 1 SELECT COUNT(DISTINCT t1.b), -(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) +(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) AS m FROM t1 GROUP BY t1.a; -COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) +COUNT(DISTINCT t1.b) m 2 2 1 1 1 1 @@ -3821,16 +3881,10 @@ SELECT ( SELECT COUNT(DISTINCT t1.b) ) ) -FROM t1 GROUP BY t1.a LIMIT 1) +FROM t1 GROUP BY t1.a LIMIT 1) AS m FROM t1 t2 GROUP BY t2.a; -( -SELECT ( -SELECT ( -SELECT COUNT(DISTINCT t1.b) -) -) -FROM t1 GROUP BY t1.a LIMIT 1) +m 2 2 2 @@ -6416,11 +6470,10 @@ CREATE TABLE t3 (a int, b int); INSERT INTO t3 VALUES (10,7), (0,7); SELECT SUM(DISTINCT b), (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0 -WHERE t.a != 0 AND t2.a != 0) +WHERE t.a != 0 AND t2.a != 0) AS m FROM (SELECT * FROM t3) AS t GROUP BY 2; -SUM(DISTINCT b) (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0 -WHERE t.a != 0 AND t2.a != 0) +SUM(DISTINCT b) m 7 NULL SELECT SUM(DISTINCT b), (SELECT t2.a FROM t1,t2 WHERE t.a != 0 or 1=2 LIMIT 1) @@ -6553,66 +6606,93 @@ CREATE TABLE t3 (f3a int default 1, f3b int default 2); INSERT INTO t3 VALUES (1,1),(2,2); set @old_optimizer_switch = @@session.optimizer_switch; set @@optimizer_switch='materialization=on,partial_match_rowid_merge=on,partial_match_table_scan=off,subquery_cache=off,semijoin=off'; -SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2; -(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) +SELECT +(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m; +m NULL -SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2; -(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) +SELECT +(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m; +m NULL set @@session.optimizer_switch=@old_optimizer_switch; -SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2; -(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) +SELECT +(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m; +m NULL -SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2; +SELECT +(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2 AS m; (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m; +m NULL select (null, null) = (null, null); (null, null) = (null, null) @@ -6658,8 +6738,10 @@ INSERT INTO t2 VALUES (1); CREATE TABLE t3 ( c INT ); INSERT INTO t3 VALUES (4),(5); SET optimizer_switch='subquery_cache=off'; -SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; -( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) +SELECT +( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) AS m +FROM t1; +m 1 NULL SELECT ( SELECT b FROM t2 WHERE b = a OR b * 0) FROM t1; @@ -6876,7 +6958,9 @@ CREATE TABLE t3 (c INT); INSERT INTO t3 VALUES (8),(3); set @@expensive_subquery_limit= 0; EXPLAIN -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 @@ -6886,9 +6970,11 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) 3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +m NULL NULL NULL @@ -6914,7 +7000,9 @@ Handler_read_rnd_deleted 0 Handler_read_rnd_next 22 set @@expensive_subquery_limit= default; EXPLAIN -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 @@ -6924,9 +7012,11 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) 3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +m NULL NULL NULL diff --git a/mysql-test/main/subselect_no_scache.result b/mysql-test/main/subselect_no_scache.result index 1cc69ef4e85..4717eb9bd15 100644 --- a/mysql-test/main/subselect_no_scache.result +++ b/mysql-test/main/subselect_no_scache.result @@ -124,27 +124,27 @@ ROW(1,2,3) > (SELECT 1,2,1) SELECT ROW(1,2,3) = (SELECT 1,2,NULL); ROW(1,2,3) = (SELECT 1,2,NULL) NULL -SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a'); -(SELECT 1.5,2,'a') = ROW(1.5,2,'a') +SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a') AS m; +m 1 -SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b'); -(SELECT 1.5,2,'a') = ROW(1.5,2,'b') +SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b') AS m; +m 0 -SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b'); -(SELECT 1.5,2,'a') = ROW('1.5b',2,'b') +SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b') AS m; +m 0 Warnings: Warning 1292 Truncated incorrect DOUBLE value: '1.5b' -SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a'); -(SELECT 'b',2,'a') = ROW(1.5,2,'a') +SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a') AS m; +m 0 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'b' -SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a'); -(SELECT 1.5,2,'a') = ROW(1.5,'2','a') +SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a') AS m; +m 1 -SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a'); -(SELECT 1.5,'c','a') = ROW(1.5,2,'a') +SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a') AS m; +m 0 Warnings: Warning 1292 Truncated incorrect DECIMAL value: 'c' @@ -234,19 +234,26 @@ a 2 select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a < t1.a) order by 1 desc limit 1); a -select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4; -b (select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) +select +b, +(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m +from t4; +b m 8 7.5000 8 4.5000 9 7.5000 -explain extended select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4; +explain extended +select +b, +(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m +from t4; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t4 ALL NULL NULL NULL NULL 3 100.00 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,(/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4` +Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,(/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`) AS `m` from `test`.`t4` select * from t3 where exists (select * from t2 where t2.b=t3.a); a 7 @@ -313,21 +320,34 @@ select b,max(a) as ma from t4 group by b having b >= (select max(t2.a) from t2 w b ma 7 12 create table t5 (a int); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; -(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; +m a NULL 1 2 2 insert into t5 values (5); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; -(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; +m a NULL 1 2 2 insert into t5 values (2); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; -(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; +m a NULL 1 2 2 -explain extended select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; +explain extended +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00 @@ -336,7 +356,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select (/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` +Note 1003 /* select#1 */ select (/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`) AS `m`,`test`.`t2`.`a` AS `a` from `test`.`t2` select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; ERROR 21000: Subquery returns more than 1 row create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq)); @@ -492,8 +512,11 @@ SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING t mot topic date pseudo joce 40143 2002-10-22 joce joce 43506 2002-10-22 joce -SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) from t2; -mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) +SELECT +*, +topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) AS m +FROM t2; +mot topic date pseudo m joce 40143 2002-10-22 joce 1 joce 43506 2002-10-22 joce 1 SELECT * from t2 where topic = all (SELECT SUM(topic) FROM t2); @@ -511,8 +534,11 @@ joce 40143 2002-10-22 joce SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000); mot topic date pseudo joce 40143 2002-10-22 joce -SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) from t2; -mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) +SELECT +*, +topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) AS m +FROM t2; +mot topic date pseudo m joce 40143 2002-10-22 joce 1 joce 43506 2002-10-22 joce 0 drop table t1,t2; @@ -887,6 +913,25 @@ NULL select 1.5 > ANY (SELECT * from t1); 1.5 > ANY (SELECT * from t1) NULL +update t1 set a=NULL where a=2.5; +select 1.5 IN (SELECT * from t1); +1.5 IN (SELECT * from t1) +1 +select 3.5 IN (SELECT * from t1); +3.5 IN (SELECT * from t1) +1 +select 10.5 IN (SELECT * from t1); +10.5 IN (SELECT * from t1) +NULL +select 1.5 > ALL (SELECT * from t1); +1.5 > ALL (SELECT * from t1) +0 +select 10.5 > ALL (SELECT * from t1); +10.5 > ALL (SELECT * from t1) +NULL +select 1.5 > ANY (SELECT * from t1); +1.5 > ANY (SELECT * from t1) +NULL select 10.5 > ANY (SELECT * from t1); 10.5 > ANY (SELECT * from t1) 1 @@ -897,6 +942,20 @@ Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1249 Select 2 was reduced during optimization Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` +explain extended select (select a+1) from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1249 Select 2 was reduced during optimization +Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` +explain extended select (select a+1) from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1249 Select 2 was reduced during optimization +Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` select (select a+1) from t1; (select a+1) 2.5 @@ -1538,8 +1597,8 @@ create table t3 (a int, b int); insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), (2,-1), (3,10); insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1); insert into t3 values (3,3), (2,2), (1,1); -select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3; -a (select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) +select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) as m from t3; +a m 3 1 2 2 1 2 @@ -1734,8 +1793,8 @@ CREATE TABLE `t3` (`taskgenid` mediumint(9) NOT NULL auto_increment,`dbid` int(1 INSERT INTO `t3` (`taskgenid`, `dbid`, `taskid`, `mon`, `tues`,`wed`, `thur`, `fri`, `sat`, `sun`, `how_often`, `userid`, `active`) VALUES (1,-1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1); CREATE TABLE `t4` (`task_id` smallint(6) NOT NULL default '0',`description` varchar(200) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; INSERT INTO `t4` (`task_id`, `description`) VALUES (1, 'Daily Check List'),(2, 'Weekly Status'); -select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid; -dbid name (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') +select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') as m FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') as m from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid; +dbid name m -1 Valid 1 -1 Valid 2 1 -1 Should Not Return 0 @@ -3790,9 +3849,10 @@ SELECT (SELECT COUNT(DISTINCT t1.b) from t2) FROM t1 GROUP BY t1.a; 2 1 1 -SELECT (SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) +SELECT +(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) AS m FROM t1 GROUP BY t1.a; -(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) +m 2 1 1 @@ -3802,9 +3862,9 @@ COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b)) 1 1 1 1 SELECT COUNT(DISTINCT t1.b), -(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) +(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) AS m FROM t1 GROUP BY t1.a; -COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) +COUNT(DISTINCT t1.b) m 2 2 1 1 1 1 @@ -3828,16 +3888,10 @@ SELECT ( SELECT COUNT(DISTINCT t1.b) ) ) -FROM t1 GROUP BY t1.a LIMIT 1) +FROM t1 GROUP BY t1.a LIMIT 1) AS m FROM t1 t2 GROUP BY t2.a; -( -SELECT ( -SELECT ( -SELECT COUNT(DISTINCT t1.b) -) -) -FROM t1 GROUP BY t1.a LIMIT 1) +m 2 2 2 @@ -6431,11 +6485,10 @@ CREATE TABLE t3 (a int, b int); INSERT INTO t3 VALUES (10,7), (0,7); SELECT SUM(DISTINCT b), (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0 -WHERE t.a != 0 AND t2.a != 0) +WHERE t.a != 0 AND t2.a != 0) AS m FROM (SELECT * FROM t3) AS t GROUP BY 2; -SUM(DISTINCT b) (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0 -WHERE t.a != 0 AND t2.a != 0) +SUM(DISTINCT b) m 7 NULL SELECT SUM(DISTINCT b), (SELECT t2.a FROM t1,t2 WHERE t.a != 0 or 1=2 LIMIT 1) @@ -6568,66 +6621,93 @@ CREATE TABLE t3 (f3a int default 1, f3b int default 2); INSERT INTO t3 VALUES (1,1),(2,2); set @old_optimizer_switch = @@session.optimizer_switch; set @@optimizer_switch='materialization=on,partial_match_rowid_merge=on,partial_match_table_scan=off,subquery_cache=off,semijoin=off'; -SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2; -(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) +SELECT +(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m; +m NULL -SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2; -(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) +SELECT +(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m; +m NULL set @@session.optimizer_switch=@old_optimizer_switch; -SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2; -(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) +SELECT +(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m; +m NULL -SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2; +SELECT +(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2 AS m; (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m; +m NULL select (null, null) = (null, null); (null, null) = (null, null) @@ -6673,8 +6753,10 @@ INSERT INTO t2 VALUES (1); CREATE TABLE t3 ( c INT ); INSERT INTO t3 VALUES (4),(5); SET optimizer_switch='subquery_cache=off'; -SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; -( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) +SELECT +( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) AS m +FROM t1; +m 1 NULL SELECT ( SELECT b FROM t2 WHERE b = a OR b * 0) FROM t1; @@ -6891,7 +6973,9 @@ CREATE TABLE t3 (c INT); INSERT INTO t3 VALUES (8),(3); set @@expensive_subquery_limit= 0; EXPLAIN -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 @@ -6901,9 +6985,11 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) 3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +m NULL NULL NULL @@ -6929,7 +7015,9 @@ Handler_read_rnd_deleted 0 Handler_read_rnd_next 58 set @@expensive_subquery_limit= default; EXPLAIN -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 @@ -6939,9 +7027,11 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) 3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +m NULL NULL NULL diff --git a/mysql-test/main/subselect_no_semijoin.result b/mysql-test/main/subselect_no_semijoin.result index 7dbee3ff882..9450cf4fe9c 100644 --- a/mysql-test/main/subselect_no_semijoin.result +++ b/mysql-test/main/subselect_no_semijoin.result @@ -121,27 +121,27 @@ ROW(1,2,3) > (SELECT 1,2,1) SELECT ROW(1,2,3) = (SELECT 1,2,NULL); ROW(1,2,3) = (SELECT 1,2,NULL) NULL -SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a'); -(SELECT 1.5,2,'a') = ROW(1.5,2,'a') +SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'a') AS m; +m 1 -SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b'); -(SELECT 1.5,2,'a') = ROW(1.5,2,'b') +SELECT (SELECT 1.5,2,'a') = ROW(1.5,2,'b') AS m; +m 0 -SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b'); -(SELECT 1.5,2,'a') = ROW('1.5b',2,'b') +SELECT (SELECT 1.5,2,'a') = ROW('1.5b',2,'b') AS m; +m 0 Warnings: Warning 1292 Truncated incorrect DOUBLE value: '1.5b' -SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a'); -(SELECT 'b',2,'a') = ROW(1.5,2,'a') +SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a') AS m; +m 0 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'b' -SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a'); -(SELECT 1.5,2,'a') = ROW(1.5,'2','a') +SELECT (SELECT 1.5,2,'a') = ROW(1.5,'2','a') AS m; +m 1 -SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a'); -(SELECT 1.5,'c','a') = ROW(1.5,2,'a') +SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a') AS m; +m 0 Warnings: Warning 1292 Truncated incorrect DECIMAL value: 'c' @@ -231,19 +231,26 @@ a 2 select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3 where t3.a < t1.a) order by 1 desc limit 1); a -select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4; -b (select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) +select +b, +(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m +from t4; +b m 8 7.5000 8 4.5000 9 7.5000 -explain extended select b,(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) from t4; +explain extended +select +b, +(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2) as m +from t4; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t4 ALL NULL NULL NULL NULL 3 100.00 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: Note 1276 Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,<`test`.`t4`.`a`>((/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4` +Note 1003 /* select#1 */ select `test`.`t4`.`b` AS `b`,<`test`.`t4`.`a`>((/* select#2 */ select avg(`test`.`t2`.`a` + (/* select#3 */ select min(`test`.`t3`.`a`) from `test`.`t3` where `test`.`t3`.`a` >= `test`.`t4`.`a`)) from `test`.`t2`)) AS `m` from `test`.`t4` select * from t3 where exists (select * from t2 where t2.b=t3.a); a 7 @@ -310,21 +317,34 @@ select b,max(a) as ma from t4 group by b having b >= (select max(t2.a) from t2 w b ma 7 12 create table t5 (a int); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; -(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; +m a NULL 1 2 2 insert into t5 values (5); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; -(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; +m a NULL 1 2 2 insert into t5 values (2); -select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; -(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) a +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; +m a NULL 1 2 2 -explain extended select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2; +explain extended +select +(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a) as m, +a +from t2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1 100.00 @@ -333,7 +353,7 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL Warnings: Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1 Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select <`test`.`t2`.`a`>((/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2` +Note 1003 /* select#1 */ select <`test`.`t2`.`a`>((/* select#2 */ select 2 from dual where 2 = `test`.`t2`.`a` union /* select#3 */ select `test`.`t5`.`a` from `test`.`t5` where `test`.`t5`.`a` = `test`.`t2`.`a`)) AS `m`,`test`.`t2`.`a` AS `a` from `test`.`t2` select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2; ERROR 21000: Subquery returns more than 1 row create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq)); @@ -489,8 +509,11 @@ SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING t mot topic date pseudo joce 40143 2002-10-22 joce joce 43506 2002-10-22 joce -SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) from t2; -mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) +SELECT +*, +topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 4100) AS m +FROM t2; +mot topic date pseudo m joce 40143 2002-10-22 joce 1 joce 43506 2002-10-22 joce 1 SELECT * from t2 where topic = all (SELECT SUM(topic) FROM t2); @@ -508,8 +531,11 @@ joce 40143 2002-10-22 joce SELECT * from t2 where topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000); mot topic date pseudo joce 40143 2002-10-22 joce -SELECT *, topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) from t2; -mot topic date pseudo topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) +SELECT +*, +topic = all (SELECT topic FROM t2 GROUP BY topic HAVING topic < 41000) AS m +FROM t2; +mot topic date pseudo m joce 40143 2002-10-22 joce 1 joce 43506 2002-10-22 joce 0 drop table t1,t2; @@ -884,6 +910,25 @@ NULL select 1.5 > ANY (SELECT * from t1); 1.5 > ANY (SELECT * from t1) NULL +update t1 set a=NULL where a=2.5; +select 1.5 IN (SELECT * from t1); +1.5 IN (SELECT * from t1) +1 +select 3.5 IN (SELECT * from t1); +3.5 IN (SELECT * from t1) +1 +select 10.5 IN (SELECT * from t1); +10.5 IN (SELECT * from t1) +NULL +select 1.5 > ALL (SELECT * from t1); +1.5 > ALL (SELECT * from t1) +0 +select 10.5 > ALL (SELECT * from t1); +10.5 > ALL (SELECT * from t1) +NULL +select 1.5 > ANY (SELECT * from t1); +1.5 > ANY (SELECT * from t1) +NULL select 10.5 > ANY (SELECT * from t1); 10.5 > ANY (SELECT * from t1) 1 @@ -894,6 +939,20 @@ Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 Note 1249 Select 2 was reduced during optimization Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` +explain extended select (select a+1) from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1249 Select 2 was reduced during optimization +Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` +explain extended select (select a+1) from t1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1249 Select 2 was reduced during optimization +Note 1003 select `test`.`t1`.`a` + 1 AS `(select a+1)` from `test`.`t1` select (select a+1) from t1; (select a+1) 2.5 @@ -1535,8 +1594,8 @@ create table t3 (a int, b int); insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), (2,-1), (3,10); insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1); insert into t3 values (3,3), (2,2), (1,1); -select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3; -a (select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) +select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) as m from t3; +a m 3 1 2 2 1 2 @@ -1731,8 +1790,8 @@ CREATE TABLE `t3` (`taskgenid` mediumint(9) NOT NULL auto_increment,`dbid` int(1 INSERT INTO `t3` (`taskgenid`, `dbid`, `taskid`, `mon`, `tues`,`wed`, `thur`, `fri`, `sat`, `sun`, `how_often`, `userid`, `active`) VALUES (1,-1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1); CREATE TABLE `t4` (`task_id` smallint(6) NOT NULL default '0',`description` varchar(200) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1; INSERT INTO `t4` (`task_id`, `description`) VALUES (1, 'Daily Check List'),(2, 'Weekly Status'); -select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid; -dbid name (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') +select dbid, name, (date_format(now() , '%Y-%m-%d') - INTERVAL how_often DAY) >= ifnull((SELECT date_format(max(create_date),'%Y-%m-%d') as m FROM t1 WHERE dbid = b.db_id AND taskid = a.taskgenid), '1950-01-01') as m from t3 a, t2 b, t4 WHERE dbid = - 1 AND primary_uid = '1' AND t4.task_id = taskid; +dbid name m -1 Valid 1 -1 Valid 2 1 -1 Should Not Return 0 @@ -3783,9 +3842,10 @@ SELECT (SELECT COUNT(DISTINCT t1.b) from t2) FROM t1 GROUP BY t1.a; 2 1 1 -SELECT (SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) +SELECT +(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) AS m FROM t1 GROUP BY t1.a; -(SELECT COUNT(DISTINCT t1.b) from t2 union select 1 from t2 where 12 < 3) +m 2 1 1 @@ -3795,9 +3855,9 @@ COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b)) 1 1 1 1 SELECT COUNT(DISTINCT t1.b), -(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) +(SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) AS m FROM t1 GROUP BY t1.a; -COUNT(DISTINCT t1.b) (SELECT COUNT(DISTINCT t1.b) union select 1 from DUAL where 12 < 3) +COUNT(DISTINCT t1.b) m 2 2 1 1 1 1 @@ -3821,16 +3881,10 @@ SELECT ( SELECT COUNT(DISTINCT t1.b) ) ) -FROM t1 GROUP BY t1.a LIMIT 1) +FROM t1 GROUP BY t1.a LIMIT 1) AS m FROM t1 t2 GROUP BY t2.a; -( -SELECT ( -SELECT ( -SELECT COUNT(DISTINCT t1.b) -) -) -FROM t1 GROUP BY t1.a LIMIT 1) +m 2 2 2 @@ -6416,11 +6470,10 @@ CREATE TABLE t3 (a int, b int); INSERT INTO t3 VALUES (10,7), (0,7); SELECT SUM(DISTINCT b), (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0 -WHERE t.a != 0 AND t2.a != 0) +WHERE t.a != 0 AND t2.a != 0) AS m FROM (SELECT * FROM t3) AS t GROUP BY 2; -SUM(DISTINCT b) (SELECT t2.a FROM t1 JOIN t2 ON t2.c != 0 -WHERE t.a != 0 AND t2.a != 0) +SUM(DISTINCT b) m 7 NULL SELECT SUM(DISTINCT b), (SELECT t2.a FROM t1,t2 WHERE t.a != 0 or 1=2 LIMIT 1) @@ -6553,66 +6606,93 @@ CREATE TABLE t3 (f3a int default 1, f3b int default 2); INSERT INTO t3 VALUES (1,1),(2,2); set @old_optimizer_switch = @@session.optimizer_switch; set @@optimizer_switch='materialization=on,partial_match_rowid_merge=on,partial_match_table_scan=off,subquery_cache=off,semijoin=off'; -SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2; -(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) +SELECT +(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m; +m NULL -SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2; -(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) +SELECT +(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m; +m NULL set @@session.optimizer_switch=@old_optimizer_switch; -SELECT (SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) FROM t2; -(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) +SELECT +(SELECT f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) NOT IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) NOT IN (SELECT f1a, f1b FROM t1) AS m; +m NULL -SELECT (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2; +SELECT +(SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) FROM t2 AS m; (SELECT f3a FROM t3 where f3a > 3) IN (SELECT f1a FROM t1) NULL NULL -SELECT (SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) FROM t2; -(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) +SELECT +(SELECT f3a,f3a FROM t3 where f3a > 3) IN (SELECT f1a,f1a FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) FROM t2; -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m +FROM t2; +m NULL NULL -SELECT (SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1); -(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) +SELECT +(SELECT f3a, f3b FROM t3 where f3a > 3) IN (SELECT f1a, f1b FROM t1) AS m; +m NULL select (null, null) = (null, null); (null, null) = (null, null) @@ -6658,8 +6738,10 @@ INSERT INTO t2 VALUES (1); CREATE TABLE t3 ( c INT ); INSERT INTO t3 VALUES (4),(5); SET optimizer_switch='subquery_cache=off'; -SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1; -( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) +SELECT +( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) AS m +FROM t1; +m 1 NULL SELECT ( SELECT b FROM t2 WHERE b = a OR b * 0) FROM t1; @@ -6876,7 +6958,9 @@ CREATE TABLE t3 (c INT); INSERT INTO t3 VALUES (8),(3); set @@expensive_subquery_limit= 0; EXPLAIN -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 @@ -6886,9 +6970,11 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) 3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +m NULL NULL NULL @@ -6914,7 +7000,9 @@ Handler_read_rnd_deleted 0 Handler_read_rnd_next 22 set @@expensive_subquery_limit= default; EXPLAIN -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY alias1 ALL NULL NULL NULL NULL 2 @@ -6924,9 +7012,11 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) 3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 flush status; -SELECT (SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +SELECT +(SELECT MIN(b) FROM t1, t2 +WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) AS m FROM t2 alias1, t1 alias2, t1 alias3; -(SELECT MIN(b) FROM t1, t2 WHERE b = a AND (b = alias1.b OR EXISTS (SELECT * FROM t3))) +m NULL NULL NULL diff --git a/sql/item.cc b/sql/item.cc index ca6697422cc..be7780cb015 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -5655,7 +5655,8 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference) max_arg_level for the function if it's needed. */ if (thd->lex->in_sum_func && - thd->lex == context->select_lex->parent_lex && + last_checked_context->select_lex->parent_lex == + context->select_lex->parent_lex && thd->lex->in_sum_func->nest_level >= select->nest_level) { Item::Type ref_type= (*reference)->type(); @@ -5681,7 +5682,8 @@ Item_field::fix_outer_field(THD *thd, Field **from_field, Item **reference) (Item_ident*) (*reference) : 0), false); if (thd->lex->in_sum_func && - thd->lex == context->select_lex->parent_lex && + last_checked_context->select_lex->parent_lex == + context->select_lex->parent_lex && thd->lex->in_sum_func->nest_level >= select->nest_level) { set_if_bigger(thd->lex->in_sum_func->max_arg_level, @@ -6017,7 +6019,6 @@ bool Item_field::fix_fields(THD *thd, Item **reference) if (!thd->lex->current_select->no_wrap_view_item && thd->lex->in_sum_func && - thd->lex == select->parent_lex && thd->lex->in_sum_func->nest_level == select->nest_level) set_if_bigger(thd->lex->in_sum_func->max_arg_level, @@ -8051,7 +8052,8 @@ bool Item_ref::fix_fields(THD *thd, Item **reference) max_arg_level for the function if it's needed. */ if (thd->lex->in_sum_func && - thd->lex == context->select_lex->parent_lex && + last_checked_context->select_lex->parent_lex == + context->select_lex->parent_lex && thd->lex->in_sum_func->nest_level >= last_checked_context->select_lex->nest_level) set_if_bigger(thd->lex->in_sum_func->max_arg_level, @@ -8075,7 +8077,8 @@ bool Item_ref::fix_fields(THD *thd, Item **reference) max_arg_level for the function if it's needed. */ if (thd->lex->in_sum_func && - thd->lex == context->select_lex->parent_lex && + last_checked_context->select_lex->parent_lex == + context->select_lex->parent_lex && thd->lex->in_sum_func->nest_level >= last_checked_context->select_lex->nest_level) set_if_bigger(thd->lex->in_sum_func->max_arg_level, @@ -8090,7 +8093,8 @@ bool Item_ref::fix_fields(THD *thd, Item **reference) 1. outer reference (will be fixed later by the fix_inner_refs function); 2. an unnamed reference inside an aggregate function. */ - if (!((*ref)->type() == REF_ITEM && + if (!set_properties_only && + !((*ref)->type() == REF_ITEM && ((Item_ref *)(*ref))->ref_type() == OUTER_REF) && (((*ref)->with_sum_func() && name.str && !(current_sel->get_linkage() != GLOBAL_OPTIONS_TYPE && diff --git a/sql/item_sum.cc b/sql/item_sum.cc index f80b89bc828..9a0f08e2a18 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -408,7 +408,8 @@ bool Item_sum::register_sum_func(THD *thd, Item **ref) sl= sl->master_unit()->outer_select() ) sl->master_unit()->item->get_with_sum_func_cache()->set_with_sum_func(); } - thd->lex->current_select->mark_as_dependent(thd, aggr_sel, NULL); + if (aggr_sel) + thd->lex->current_select->mark_as_dependent(thd, aggr_sel, NULL); if ((thd->lex->describe & DESCRIBE_EXTENDED) && aggr_sel) { diff --git a/sql/sql_base.cc b/sql/sql_base.cc index dd633f0bb92..37336a83bfb 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -8016,9 +8016,8 @@ bool setup_tables(THD *thd, Name_resolution_context *context, table_list; table_list= table_list->next_local) { - if (table_list->merge_underlying_list) + if (table_list->is_merged_derived() && table_list->merge_underlying_list) { - DBUG_ASSERT(table_list->is_merged_derived()); Query_arena *arena, backup; arena= thd->activate_stmt_arena_if_needed(&backup); bool res; diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 4dcc8a61985..2e232730799 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -351,24 +351,6 @@ bool mysql_derived_merge(THD *thd, LEX *lex, TABLE_LIST *derived) DBUG_RETURN(FALSE); } - if (dt_select->uncacheable & UNCACHEABLE_RAND) - { - /* There is random function => fall back to materialization. */ - cause= "Random function in the select"; - if (unlikely(thd->trace_started())) - { - OPT_TRACE_VIEWS_TRANSFORM(thd, trace_wrapper, trace_derived, - derived->is_derived() ? "derived" : "view", - derived->alias.str ? derived->alias.str : "", - derived->get_unit()->first_select()->select_number, - "materialized"); - trace_derived.add("cause", cause); - } - derived->change_refs_to_fields(); - derived->set_materialized_derived(); - DBUG_RETURN(FALSE); - } - if (derived->dt_handler) { derived->change_refs_to_fields(); diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 62c7556dcd6..e14d9f7a740 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -3284,40 +3284,45 @@ LEX::LEX() } +bool LEX::can_be_merged() +{ + return unit.can_be_merged(); +} + + /* - Check whether the merging algorithm can be used on this VIEW + Check whether the merging algorithm can be used for this unit SYNOPSIS - LEX::can_be_merged() + st_select_lex_unit::can_be_merged() DESCRIPTION - We can apply merge algorithm if it is single SELECT view with - subqueries only in WHERE clause (we do not count SELECTs of underlying - views, and second level subqueries) and we have not grpouping, ordering, - HAVING clause, aggregate functions, DISTINCT clause, LIMIT clause and - several underlying tables. + We can apply merge algorithm for a unit if it is single SELECT with + subqueries only in WHERE clauses or in ON conditions or in select list + (we do not count SELECTs of underlying views/derived tables/CTEs and + second level subqueries) and we have no grouping, ordering, HAVING + clause, aggregate functions, DISTINCT clause, LIMIT clause. RETURN FALSE - only temporary table algorithm can be used TRUE - merge algorithm can be used */ -bool LEX::can_be_merged() +bool st_select_lex_unit::can_be_merged() { // TODO: do not forget implement case when select_lex.table_list.elements==0 /* find non VIEW subqueries/unions */ - bool selects_allow_merge= (first_select_lex()->next_select() == 0 && - !(first_select_lex()->uncacheable & + bool selects_allow_merge= (first_select()->next_select() == 0 && + !(first_select()->uncacheable & UNCACHEABLE_RAND)); if (selects_allow_merge) { - for (SELECT_LEX_UNIT *tmp_unit= first_select_lex()->first_inner_unit(); + for (SELECT_LEX_UNIT *tmp_unit= first_select()->first_inner_unit(); tmp_unit; tmp_unit= tmp_unit->next_unit()) { - if (tmp_unit->first_select()->parent_lex == this && - (tmp_unit->item != 0 && + if ((tmp_unit->item != 0 && (tmp_unit->item->place() != IN_WHERE && tmp_unit->item->place() != IN_ON && tmp_unit->item->place() != SELECT_LIST))) @@ -3329,12 +3334,12 @@ bool LEX::can_be_merged() } return (selects_allow_merge && - first_select_lex()->group_list.elements == 0 && - first_select_lex()->having == 0 && - first_select_lex()->with_sum_func == 0 && - first_select_lex()->table_list.elements >= 1 && - !(first_select_lex()->options & SELECT_DISTINCT) && - first_select_lex()->select_limit == 0); + first_select()->group_list.elements == 0 && + first_select()->having == 0 && + first_select()->with_sum_func == 0 && + first_select()->table_list.elements >= 1 && + !(first_select()->options & SELECT_DISTINCT) && + first_select()->select_limit == 0); } diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 8f25426a09c..769b17508cf 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1003,6 +1003,8 @@ public: bool set_lock_to_the_last_select(Lex_select_lock l); + bool can_be_merged(); + friend class st_select_lex; }; diff --git a/sql/table.cc b/sql/table.cc index 20622d0e09f..d96e9248cd1 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -6454,6 +6454,9 @@ bool TABLE_LIST::prepare_security(THD *thd) #ifndef DBUG_OFF void TABLE_LIST::set_check_merged() { + if (is_view()) + return; + DBUG_ASSERT(derived); /* It is not simple to check all, but at least this should be checked: @@ -6781,9 +6784,8 @@ void Field_iterator_table_ref::set_field_iterator() table_ref->alias.str)); } /* This is a merge view, so use field_translation. */ - else if (table_ref->field_translation) + else if (table_ref->is_merged_derived() && table_ref->field_translation) { - DBUG_ASSERT(table_ref->is_merged_derived()); field_it= &view_field_it; DBUG_PRINT("info", ("field_it for '%s' is Field_iterator_view", table_ref->alias.str)); @@ -9233,15 +9235,15 @@ bool TABLE_LIST::init_derived(THD *thd, bool init_view) set_derived(); } - if (!is_view() && + if (is_view() || !derived_table_optimization_done(this)) { /* A subquery might be forced to be materialized due to a side-effect. */ - if (!is_materialized_derived() && first_select->is_mergeable() && - optimizer_flag(thd, OPTIMIZER_SWITCH_DERIVED_MERGE) && + if (!is_materialized_derived() && unit->can_be_merged() && + (optimizer_flag(thd, OPTIMIZER_SWITCH_DERIVED_MERGE) || is_view()) && !thd->lex->can_not_use_merged() && - !(thd->lex->sql_command == SQLCOM_UPDATE_MULTI || - thd->lex->sql_command == SQLCOM_DELETE_MULTI) && + !((thd->lex->sql_command == SQLCOM_UPDATE_MULTI || + thd->lex->sql_command == SQLCOM_DELETE_MULTI) && !is_view()) && !is_recursive_with_table()) set_merged_derived(); else diff --git a/sql/table.h b/sql/table.h index 3adcc887a2c..c4b0d78959d 100644 --- a/sql/table.h +++ b/sql/table.h @@ -2863,8 +2863,7 @@ struct TABLE_LIST DBUG_PRINT("enter", ("Alias: '%s' Unit: %p", (alias.str ? alias.str : ""), get_unit())); - derived_type= ((derived_type & DTYPE_MASK) | - DTYPE_TABLE | DTYPE_MERGE); + derived_type= (derived_type & DTYPE_MASK) | DTYPE_MERGE; set_check_merged(); DBUG_VOID_RETURN; } @@ -2878,9 +2877,7 @@ struct TABLE_LIST DBUG_PRINT("enter", ("Alias: '%s' Unit: %p", (alias.str ? alias.str : ""), get_unit())); - derived= get_unit(); - derived_type= ((derived_type & (derived ? DTYPE_MASK : DTYPE_VIEW)) | - DTYPE_TABLE | DTYPE_MATERIALIZE); + derived_type= (derived_type & DTYPE_MASK) | DTYPE_MATERIALIZE; set_check_materialized(); DBUG_VOID_RETURN; } From 99ee200b8bc8d76469249a828b642f3a1efee2de Mon Sep 17 00:00:00 2001 From: Debjyoti Date: Thu, 2 Mar 2023 23:37:17 +0530 Subject: [PATCH 037/260] MDEV-24005 Updated the --use-memory option usage message in Mariabackup help command --- extra/mariabackup/xtrabackup.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index f7a5d00b92c..c674b3e16e1 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -1088,7 +1088,8 @@ struct my_option xb_client_options[]= { (G_PTR *) &xtrabackup_print_param, (G_PTR *) &xtrabackup_print_param, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"use-memory", OPT_XTRA_USE_MEMORY, - "The value is used instead of buffer_pool_size", + "The value is used in place of innodb_buffer_pool_size. " + "This option is only relevant when the --prepare option is specified.", (G_PTR *) &xtrabackup_use_memory, (G_PTR *) &xtrabackup_use_memory, 0, GET_LL, REQUIRED_ARG, 100 * 1024 * 1024L, 1024 * 1024L, LONGLONG_MAX, 0, 1024 * 1024L, 0}, From 66b21ed5403aa4ef18a4c797af353ec3379b152d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 6 Mar 2023 15:32:25 +0200 Subject: [PATCH 038/260] MDEV-30567 rec_get_offsets() is not optimal rec_init_offsets_comp_ordinary(), rec_init_offsets(), rec_get_offsets_reverse(), rec_get_nth_field_offs_old(): Simplify some bitwise arithmetics to avoid conditional jumps, and add branch prediction hints with the assumption that most variable-length columns are short. Tested by: Matthias Leich --- storage/innobase/rem/rem0rec.cc | 135 ++++++++++++++------------------ 1 file changed, 59 insertions(+), 76 deletions(-) diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc index 08682304410..de300bf799a 100644 --- a/storage/innobase/rem/rem0rec.cc +++ b/storage/innobase/rem/rem0rec.cc @@ -217,14 +217,12 @@ rec_get_n_extern_new( stored in one byte for 0..127. The length will be encoded in two bytes when it is 128 or more, or when the field is stored externally. */ - if (DATA_BIG_COL(col)) { - if (len & 0x80) { - /* 1exxxxxxx xxxxxxxx */ - if (len & 0x40) { - n_extern++; - } - lens--; + if (UNIV_UNLIKELY(len & 0x80) && DATA_BIG_COL(col)) { + /* 1exxxxxxx xxxxxxxx */ + if (len & 0x40) { + n_extern++; } + lens--; } } } while (++i < n); @@ -432,24 +430,21 @@ start: stored in one byte for 0..127. The length will be encoded in two bytes when it is 128 or more, or when the field is stored externally. */ - if ((len & 0x80) && DATA_BIG_COL(col)) { + if (UNIV_UNLIKELY(len & 0x80) && DATA_BIG_COL(col)) { /* 1exxxxxxx xxxxxxxx */ len <<= 8; len |= *lens--; - + static_assert(STORED_OFFPAGE == 0x4000, ""); + static_assert(REC_OFFS_EXTERNAL == 0x4000, ""); + const rec_offs ext = len & REC_OFFS_EXTERNAL; offs += get_value(len); - if (UNIV_UNLIKELY(len & 0x4000)) { - ut_ad(dict_index_is_clust(index)); - any |= REC_OFFS_EXTERNAL; - len = combine(offs, STORED_OFFPAGE); - } else { - len = offs; - } - + len = offs | ext; + any |= ext; + ut_ad(!ext || index->is_primary()); continue; } - len = offs += len; + len = offs += static_cast(len); } else { len = offs += field->fixed_len; } @@ -714,23 +709,20 @@ rec_init_offsets( encoded in two bytes when it is 128 or more, or when the field is stored externally. */ - if (DATA_BIG_COL(col)) { - if (len & 0x80) { - /* 1exxxxxxx xxxxxxxx */ + if (UNIV_UNLIKELY(len & 0x80) + && DATA_BIG_COL(col)) { + /* 1exxxxxxx xxxxxxxx */ + len <<= 8; + len |= *lens--; - len <<= 8; - len |= *lens--; - - /* B-tree node pointers - must not contain externally - stored columns. Thus - the "e" flag must be 0. */ - ut_a(!(len & 0x4000)); - offs += get_value(len); - len = offs; - - goto resolved; - } + /* B-tree node pointers + must not contain externally + stored columns. Thus + the "e" flag must be 0. */ + ut_a(!(len & 0x4000)); + offs += len & 0x3fff; + len = offs; + goto resolved; } len = offs += len; @@ -758,26 +750,24 @@ resolved: do { offs = rec_1_get_field_end_info(rec, i); if (offs & REC_1BYTE_SQL_NULL_MASK) { - offs &= ~REC_1BYTE_SQL_NULL_MASK; - set_type(offs, SQL_NULL); + offs ^= REC_1BYTE_SQL_NULL_MASK + | SQL_NULL; } rec_offs_base(offsets)[1 + i] = offs; } while (++i < n); } else { - offs += 2 * static_cast(n_fields); + offs += static_cast(2 * n_fields); any = offs; /* Determine offsets to fields */ do { offs = rec_2_get_field_end_info(rec, i); - if (offs & REC_2BYTE_SQL_NULL_MASK) { - offs &= ~REC_2BYTE_SQL_NULL_MASK; - set_type(offs, SQL_NULL); - } - if (offs & REC_2BYTE_EXTERN_MASK) { - offs &= ~REC_2BYTE_EXTERN_MASK; - set_type(offs, STORED_OFFPAGE); - any |= REC_OFFS_EXTERNAL; - } + static_assert(REC_2BYTE_SQL_NULL_MASK + == SQL_NULL, ""); + static_assert(REC_2BYTE_EXTERN_MASK + == STORED_OFFPAGE, ""); + static_assert(REC_OFFS_EXTERNAL + == STORED_OFFPAGE, ""); + any |= (offs & REC_OFFS_EXTERNAL); rec_offs_base(offsets)[1 + i] = offs; } while (++i < n); } @@ -1028,23 +1018,18 @@ rec_get_offsets_reverse( stored in one byte for 0..127. The length will be encoded in two bytes when it is 128 or more, or when the field is stored externally. */ - if (DATA_BIG_COL(col)) { - if (len & 0x80) { - /* 1exxxxxxx xxxxxxxx */ - len <<= 8; - len |= *lens++; - - offs += get_value(len); - if (UNIV_UNLIKELY(len & 0x4000)) { - any_ext = REC_OFFS_EXTERNAL; - len = combine(offs, - STORED_OFFPAGE); - } else { - len = offs; - } - - goto resolved; - } + if (UNIV_UNLIKELY(len & 0x80) && DATA_BIG_COL(col)) { + /* 1exxxxxxx xxxxxxxx */ + len &= 0x7f; + len <<= 8; + len |= *lens++; + static_assert(STORED_OFFPAGE == 0x4000, ""); + static_assert(REC_OFFS_EXTERNAL == 0x4000, ""); + rec_offs ext = len & REC_OFFS_EXTERNAL; + offs += get_value(len); + len = offs | ext; + any_ext |= ext; + goto resolved; } len = offs += len; @@ -1089,7 +1074,7 @@ rec_get_nth_field_offs_old( return(os); } - next_os = next_os & ~REC_1BYTE_SQL_NULL_MASK; + next_os &= ~REC_1BYTE_SQL_NULL_MASK; } else { os = rec_2_get_field_start_offs(rec, n); @@ -1101,8 +1086,7 @@ rec_get_nth_field_offs_old( return(os); } - next_os = next_os & ~(REC_2BYTE_SQL_NULL_MASK - | REC_2BYTE_EXTERN_MASK); + next_os &= ~(REC_2BYTE_SQL_NULL_MASK | REC_2BYTE_EXTERN_MASK); } *len = next_os - os; @@ -1255,7 +1239,8 @@ rec_get_converted_size_comp_prefix_low( } else if (dfield_is_ext(dfield)) { ut_ad(DATA_BIG_COL(field->col)); extra_size += 2; - } else if (len < 128 || !DATA_BIG_COL(field->col)) { + } else if (UNIV_LIKELY(len < 128) + || !DATA_BIG_COL(field->col)) { extra_size++; } else { /* For variable-length columns, we look up the @@ -1652,7 +1637,7 @@ start: /* set the null flag if necessary */ if (dfield_is_null(field)) { - *nulls |= null_mask; + *nulls |= static_cast(null_mask); null_mask <<= 1; continue; } @@ -2122,14 +2107,12 @@ rec_copy_prefix_to_buf( stored in one byte for 0..127. The length will be encoded in two bytes when it is 128 or more, or when the column is stored externally. */ - if (DATA_BIG_COL(col)) { - if (len & 0x80) { - /* 1exxxxxx */ - len &= 0x3f; - len <<= 8; - len |= *lens--; - UNIV_PREFETCH_R(lens); - } + if (UNIV_UNLIKELY(len & 0x80) && DATA_BIG_COL(col)) { + /* 1exxxxxx */ + len &= 0x3f; + len <<= 8; + len |= *lens--; + UNIV_PREFETCH_R(lens); } prefix_len += len; } From 46a7e96339d166fee60f80f03a8cf9281b42aa32 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Thu, 2 Mar 2023 14:21:59 +0100 Subject: [PATCH 039/260] move alloca() definition from all *.h files to one new header file --- include/CMakeLists.txt | 2 + include/my_alloca.h | 45 +++++++++++++++++++ include/my_global.h | 8 +--- include/my_sys.h | 14 +----- include/mysql/service_encryption.h | 11 ++--- .../cracklib_password_check.c | 2 +- .../handlersocket/hstcpsvr_worker.cpp | 5 +-- .../handler_socket/libhsclient/allocator.hpp | 1 + 8 files changed, 56 insertions(+), 32 deletions(-) create mode 100644 include/my_alloca.h diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 9a3f820e62f..fe02098621e 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -37,6 +37,7 @@ SET(HEADERS ma_dyncol.h my_list.h my_alloc.h + my_alloca.h typelib.h my_dbug.h m_string.h @@ -105,6 +106,7 @@ ENDMACRO() INSTALL_COMPAT_HEADER(my_global.h "") INSTALL_COMPAT_HEADER(my_config.h "") +INSTALL_COMPAT_HEADER(my_alloca.h "") INSTALL_COMPAT_HEADER(my_sys.h "") INSTALL_COMPAT_HEADER(mysql_version.h " #include diff --git a/include/my_alloca.h b/include/my_alloca.h new file mode 100644 index 00000000000..761c2adb890 --- /dev/null +++ b/include/my_alloca.h @@ -0,0 +1,45 @@ +/* Copyright (c) 2023, MariaDB Corporation. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ + +#ifndef MY_ALLOCA_INCLUDED +#define MY_ALLOCA_INCLUDED + +#ifdef _WIN32 +#include /*for alloca*/ +/* + MSVC may define "alloca" when compiling in /Ze mode + (with extensions from Microsoft), but otherwise only + the _alloca function is defined: +*/ +#ifndef alloca +#define alloca _alloca +#endif +#else +#ifdef HAVE_ALLOCA_H +#include +#endif +#endif + +#if defined(HAVE_ALLOCA) +/* + If the GCC/LLVM compiler from the MinGW is used, + alloca may not be defined when using the MSVC CRT: +*/ +#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && !defined(alloca) +#define alloca __builtin_alloca +#endif /* GNUC */ +#endif + +#endif /* MY_ALLOCA_INCLUDED */ diff --git a/include/my_global.h b/include/my_global.h index 1e1821e2f25..8cf06ddcb1e 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -358,13 +358,6 @@ C_MODE_END #ifdef HAVE_UNISTD_H #include #endif -#if defined(__cplusplus) && defined(NO_CPLUSPLUS_ALLOCA) -#undef HAVE_ALLOCA -#undef HAVE_ALLOCA_H -#endif -#ifdef HAVE_ALLOCA_H -#include -#endif #include /* Recommended by debian */ /* We need the following to go around a problem with openssl on solaris */ @@ -521,6 +514,7 @@ typedef unsigned short ushort; #endif #include +#include /* Wen using the embedded library, users might run into link problems, diff --git a/include/my_sys.h b/include/my_sys.h index 91610f15a50..87df04c6087 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -36,9 +36,7 @@ typedef struct my_aio_result { #include /* for CHARSET_INFO */ #include #include -#ifdef _WIN32 -#include /*for alloca*/ -#endif +#include #include #include @@ -196,16 +194,6 @@ my_bool my_test_if_atomic_write(File handle, int pagesize); extern my_bool my_may_have_atomic_write; #if defined(HAVE_ALLOCA) && !defined(HAVE_valgrind) -#if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43) -#pragma alloca -#endif /* _AIX */ -#if defined(__MWERKS__) -#undef alloca -#define alloca _alloca -#endif /* __MWERKS__ */ -#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && ! defined(alloca) -#define alloca __builtin_alloca -#endif /* GNUC */ #define my_alloca(SZ) alloca((size_t) (SZ)) #define my_afree(PTR) ((void)0) #define MAX_ALLOCA_SZ 4096 diff --git a/include/mysql/service_encryption.h b/include/mysql/service_encryption.h index 69d205a27e8..280b9c69e35 100644 --- a/include/mysql/service_encryption.h +++ b/include/mysql/service_encryption.h @@ -24,22 +24,19 @@ *provider* (encryption plugin). */ -#ifdef __cplusplus -extern "C" { -#endif - #ifndef MYSQL_ABI_CHECK +#include #ifdef _WIN32 -#include #ifndef __cplusplus #define inline __inline #endif #else #include -#ifdef HAVE_ALLOCA_H -#include #endif #endif + +#ifdef __cplusplus +extern "C" { #endif /* returned from encryption_key_get_latest_version() */ diff --git a/plugin/cracklib_password_check/cracklib_password_check.c b/plugin/cracklib_password_check/cracklib_password_check.c index 470e6e5280f..5a7c7f3f234 100644 --- a/plugin/cracklib_password_check/cracklib_password_check.c +++ b/plugin/cracklib_password_check/cracklib_password_check.c @@ -13,7 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ -#include +#include #include #include #include diff --git a/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp b/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp index 9863602af7a..f6bbe9004c2 100644 --- a/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp +++ b/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp @@ -6,7 +6,7 @@ * See COPYRIGHT.txt for details. */ -#include +#include #include #include #include @@ -17,9 +17,6 @@ #if __linux__ #include #endif -#ifdef HAVE_ALLOCA_H -#include -#endif #include "hstcpsvr_worker.hpp" #include "string_buffer.hpp" diff --git a/plugin/handler_socket/libhsclient/allocator.hpp b/plugin/handler_socket/libhsclient/allocator.hpp index dd3a28ba7bd..9df6a1ab752 100644 --- a/plugin/handler_socket/libhsclient/allocator.hpp +++ b/plugin/handler_socket/libhsclient/allocator.hpp @@ -11,6 +11,7 @@ #include #include +#include #if 0 extern "C" { From e240e2749eeaadc594b05dc600440f316d50eaee Mon Sep 17 00:00:00 2001 From: kevincheng2 Date: Fri, 3 Mar 2023 17:33:07 -0800 Subject: [PATCH 040/260] MDEV-30758 mariabackup --help only lists server groups read in configuration --- extra/mariabackup/xtrabackup.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index c674b3e16e1..d2ce3395da8 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -1817,6 +1817,12 @@ static void print_version(void) my_progname, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE); } +static void concatenate_default_groups(std::vector &backup_load_groups, const char **default_groups) +{ + for ( ; *default_groups ; default_groups++) + backup_load_groups.push_back(*default_groups); +} + static void usage(void) { puts("Open source backup tool for InnoDB and XtraDB\n\ @@ -1837,7 +1843,11 @@ GNU General Public License for more details.\n\ You can download full text of the license on http://www.gnu.org/licenses/gpl-2.0.txt\n"); printf("Usage: %s [--defaults-file=#] [--backup | --prepare | --copy-back | --move-back] [OPTIONS]\n",my_progname); - print_defaults("my", load_default_groups); + std::vector backup_load_default_groups; + concatenate_default_groups(backup_load_default_groups, backup_default_groups); + concatenate_default_groups(backup_load_default_groups, load_default_groups); + backup_load_default_groups.push_back(nullptr); + print_defaults("my", &backup_load_default_groups[0]); my_print_help(xb_client_options); my_print_help(xb_server_options); my_print_variables(xb_server_options); From 8b0f766c6c65a4c4260876688090e2b390014a60 Mon Sep 17 00:00:00 2001 From: Christian Gonzalez Date: Thu, 23 Feb 2023 22:43:14 +0000 Subject: [PATCH 041/260] Minimize unsafe C functions usage Replace calls to `sprintf` and `strcpy` by the safer options `snprintf` and `safe_strcpy` in the following directories: - libmysqld - mysys - sql-common - strings All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc. --- libmysqld/libmysql.c | 10 +++++++--- mysys/my_atomic_writes.c | 16 ++++++++++------ mysys/my_conio.c | 2 +- mysys/my_likely.c | 2 +- mysys/my_thr_init.c | 2 +- sql-common/client.c | 2 +- strings/conf_to_src.c | 4 ++-- strings/uctypedump.c | 4 ++-- strings/xml.c | 16 ++++++++-------- 9 files changed, 33 insertions(+), 25 deletions(-) diff --git a/libmysqld/libmysql.c b/libmysqld/libmysql.c index 1ebcae0d8d5..b9293d84771 100644 --- a/libmysqld/libmysql.c +++ b/libmysqld/libmysql.c @@ -2914,7 +2914,8 @@ my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *my_bind) break; default: strmov(stmt->sqlstate, unknown_sqlstate); - sprintf(stmt->last_error, + snprintf(stmt->last_error, + sizeof(stmt->last_error), ER(stmt->last_errno= CR_UNSUPPORTED_PARAM_TYPE), param->buffer_type, count); DBUG_RETURN(1); @@ -3001,7 +3002,9 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, { /* Long data handling should be used only for string/binary types */ strmov(stmt->sqlstate, unknown_sqlstate); - sprintf(stmt->last_error, ER(stmt->last_errno= CR_INVALID_BUFFER_USE), + snprintf(stmt->last_error, + sizeof(stmt->last_error), + ER(stmt->last_errno= CR_INVALID_BUFFER_USE), param->param_number); DBUG_RETURN(1); } @@ -4130,7 +4133,8 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *my_bind) if (setup_one_fetch_function(param, field)) { strmov(stmt->sqlstate, unknown_sqlstate); - sprintf(stmt->last_error, + snprintf(stmt->last_error, + sizeof(stmt->last_error), ER(stmt->last_errno= CR_UNSUPPORTED_PARAM_TYPE), field->type, param_count); DBUG_RETURN(1); diff --git a/mysys/my_atomic_writes.c b/mysys/my_atomic_writes.c index b383af11ba8..357448d10d2 100644 --- a/mysys/my_atomic_writes.c +++ b/mysys/my_atomic_writes.c @@ -112,7 +112,7 @@ static my_bool test_if_shannon_card_exists() char path[32]; struct stat stat_buff; - sprintf(path, "/dev/df%c", dev_part); + snprintf(path, sizeof(path), "/dev/df%c", dev_part); #ifdef TEST_SHANNON if (lstat(path, &stat_buff) < 0) { @@ -121,8 +121,10 @@ static my_bool test_if_shannon_card_exists() } #endif shannon_devices[shannon_found_devices].st_dev= stat_buff.st_rdev; - sprintf(shannon_devices[shannon_found_devices].dev_name, "/dev/sct%c", - dev_part); + snprintf(shannon_devices[shannon_found_devices].dev_name, + sizeof(shannon_devices[shannon_found_devices].dev_name), + "/dev/sct%c", + dev_part); #ifdef TEST_SHANNON printf("%s(): i=%d, stat_buff.st_dev=0x%lx, stat_buff.st_rdev=0x%lx, st_rdev=0x%lx, dev_name=%s\n", @@ -145,13 +147,15 @@ static my_bool test_if_shannon_card_exists() for (dev_no= 1 ; dev_no < 9 ; dev_no++) { - sprintf(path, "/dev/df%c%d", dev_part, dev_no); + snprintf(path, sizeof(path), "/dev/df%c%d", dev_part, dev_no); if (lstat(path, &stat_buff) < 0) break; shannon_devices[shannon_found_devices].st_dev= stat_buff.st_rdev; - sprintf(shannon_devices[shannon_found_devices].dev_name, "/dev/sct%c%d", - dev_part, dev_no); + snprintf(shannon_devices[shannon_found_devices].dev_name, + sizeof(shannon_devices[shannon_found_devices].dev_name), + "/dev/sct%c%d", + dev_part, dev_no); #ifdef TEST_SHANNON printf("%s(): i=%d, st_dev=0x%lx, st_rdev=0x%lx, dev_name=%s\n", diff --git a/mysys/my_conio.c b/mysys/my_conio.c index 04750635dd3..ec30b9dc6c7 100644 --- a/mysys/my_conio.c +++ b/mysys/my_conio.c @@ -50,7 +50,7 @@ int my_pthread_auto_mutex_lock(HANDLE* ph, const char* name, int id, int time) DWORD res; char tname[FN_REFLEN]; - sprintf(tname, "%s-%08X", name, id); + snprintf(tname, sizeof(tname), "%s-%08X", name, id); *ph= CreateMutex(NULL, FALSE, tname); if (*ph == NULL) diff --git a/mysys/my_likely.c b/mysys/my_likely.c index c6fca5b7146..b63e5f4211e 100644 --- a/mysys/my_likely.c +++ b/mysys/my_likely.c @@ -77,7 +77,7 @@ void end_my_likely(FILE *out) if (!(likely_file= out)) { char name[80]; - sprintf(name, "/tmp/unlikely-%lu.out", (ulong) getpid()); + snprintf(name, sizeof(name), "/tmp/unlikely-%lu.out", (ulong) getpid()); if ((likely_file= my_fopen(name, O_TRUNC | O_WRONLY, MYF(MY_WME)))) do_close= 1; else diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c index 66c2543c51d..57ac2d228fb 100644 --- a/mysys/my_thr_init.c +++ b/mysys/my_thr_init.c @@ -426,7 +426,7 @@ const char *my_thread_name(void) if (!tmp->name[0]) { my_thread_id id= my_thread_dbug_id(); - sprintf(name_buff,"T@%lu", (ulong) id); + snprintf(name_buff, sizeof(name_buff), "T@%lu", (ulong) id); strmake_buf(tmp->name, name_buff); } return tmp->name; diff --git a/sql-common/client.c b/sql-common/client.c index 89de45cfcfc..a1bdbebf639 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -4164,7 +4164,7 @@ int STDCALL mysql_set_character_set(MYSQL *mysql, const char *cs_name) /* Skip execution of "SET NAMES" for pre-4.1 servers */ if (mysql_get_server_version(mysql) < 40100) return 0; - sprintf(buff, "SET NAMES %s", cs_name); + snprintf(buff, sizeof(buff), "SET NAMES %s", cs_name); if (!mysql_real_query(mysql, buff, (uint) strlen(buff))) { mysql->charset= cs; diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c index 4a3b035aa49..efb708db8f6 100644 --- a/strings/conf_to_src.c +++ b/strings/conf_to_src.c @@ -459,7 +459,7 @@ main(int argc, char **argv __attribute__((unused))) bzero((void*)&all_charsets,sizeof(all_charsets)); bzero((void*) refids, sizeof(refids)); - sprintf(filename,"%s/%s",argv[1],"Index.xml"); + snprintf(filename,sizeof(filename),"%s/%s",argv[1],"Index.xml"); my_read_charset_file(filename); for (cs= all_charsets; @@ -470,7 +470,7 @@ main(int argc, char **argv __attribute__((unused))) { if ( (!simple_cs_is_full(cs)) && (cs->csname)) { - sprintf(filename,"%s/%s.xml",argv[1],cs->csname); + snprintf(filename,sizeof(filename),"%s/%s.xml",argv[1],cs->csname); my_read_charset_file(filename); } cs->state|= MY_CS_LOADED; diff --git a/strings/uctypedump.c b/strings/uctypedump.c index 30ae33afee1..397b6e586f1 100644 --- a/strings/uctypedump.c +++ b/strings/uctypedump.c @@ -120,7 +120,7 @@ int main(int ac, char ** av) } else { - strcpy(tok,s); + safe_strcpy(tok, sizeof(tok), s); } end=tok+strlen(tok); @@ -225,7 +225,7 @@ int main(int ac, char ** av) { char plane_name[128]="NULL"; if(uctype[plane].ctype){ - sprintf(plane_name,"uctype_page%02X",(uint) plane); + snprintf(plane_name,sizeof(plane_name),"uctype_page%02X",(uint) plane); } printf("\t{%d,%s}%s\n",uctype[plane].pctype,plane_name,plane<255?",":""); } diff --git a/strings/xml.c b/strings/xml.c index 0178ea2574e..c9df9491aba 100644 --- a/strings/xml.c +++ b/strings/xml.c @@ -304,10 +304,10 @@ static int my_xml_leave(MY_XML_PARSER *p, const char *str, size_t slen) if (glen) { mstr(g, tag, sizeof(g)-1, glen); - sprintf(p->errstr,"'' unexpected ('' wanted)",s,g); + snprintf(p->errstr,sizeof(p->errstr),"'' unexpected ('' wanted)",s,g); } else - sprintf(p->errstr,"'' unexpected (END-OF-INPUT wanted)", s); + snprintf(p->errstr,sizeof(p->errstr),"'' unexpected (END-OF-INPUT wanted)", s); return MY_XML_ERROR; } @@ -362,7 +362,7 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, size_t len) { if (MY_XML_IDENT != (lex=my_xml_scan(p,&a))) { - sprintf(p->errstr,"%s unexpected (ident wanted)",lex2str(lex)); + snprintf(p->errstr,sizeof(p->errstr),"%s unexpected (ident wanted)",lex2str(lex)); return MY_XML_ERROR; } if (MY_XML_OK != my_xml_leave(p,a.beg,(size_t) (a.end-a.beg))) @@ -390,7 +390,7 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, size_t len) } else { - sprintf(p->errstr,"%s unexpected (ident or '/' wanted)", + snprintf(p->errstr,sizeof(p->errstr),"%s unexpected (ident or '/' wanted)", lex2str(lex)); return MY_XML_ERROR; } @@ -412,7 +412,7 @@ int my_xml_parse(MY_XML_PARSER *p,const char *str, size_t len) } else { - sprintf(p->errstr,"%s unexpected (ident or string wanted)", + snprintf(p->errstr,sizeof(p->errstr),"%s unexpected (ident or string wanted)", lex2str(lex)); return MY_XML_ERROR; } @@ -449,7 +449,7 @@ gt: { if (lex != MY_XML_QUESTION) { - sprintf(p->errstr,"%s unexpected ('?' wanted)",lex2str(lex)); + snprintf(p->errstr,sizeof(p->errstr),"%s unexpected ('?' wanted)",lex2str(lex)); return MY_XML_ERROR; } if (MY_XML_OK != my_xml_leave(p,NULL,0)) @@ -465,7 +465,7 @@ gt: if (lex != MY_XML_GT) { - sprintf(p->errstr,"%s unexpected ('>' wanted)",lex2str(lex)); + snprintf(p->errstr,sizeof(p->errstr),"%s unexpected ('>' wanted)",lex2str(lex)); return MY_XML_ERROR; } } @@ -486,7 +486,7 @@ gt: if (p->attr.start[0]) { - sprintf(p->errstr,"unexpected END-OF-INPUT"); + snprintf(p->errstr,sizeof(p->errstr),"unexpected END-OF-INPUT"); return MY_XML_ERROR; } return MY_XML_OK; From fb8c1762ad6100134c3ac00c1f47469d5bb42794 Mon Sep 17 00:00:00 2001 From: Monty Date: Sun, 7 Feb 2021 21:11:53 +0200 Subject: [PATCH 042/260] Ensure that mysqlbinlog frees all memory at exit --- client/mysqlbinlog.cc | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 28108922538..213fb29e2fd 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -89,6 +89,7 @@ static uint opt_protocol= 0; static FILE *result_file; static char *result_file_name= 0; static const char *output_prefix= ""; +static char **defaults_argv= 0; #ifndef DBUG_OFF static const char *default_dbug_option = "d:t:o,/tmp/mysqlbinlog.trace"; @@ -1881,13 +1882,26 @@ static void cleanup() delete glob_description_event; if (mysql) mysql_close(mysql); + free_defaults(defaults_argv); + free_annotate_event(); + my_free_open_file_info(); + load_processor.destroy(); + mysql_server_end(); DBUG_VOID_RETURN; } +static void die() +{ + cleanup(); + my_end(MY_DONT_FREE_DBUG); + exit(1); +} + + static void print_version() { - printf("%s Ver 3.4 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); + printf("%s Ver 3.5 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); } @@ -1918,7 +1932,7 @@ static my_time_t convert_str_to_timestamp(const char* str) l_time.time_type != MYSQL_TIMESTAMP_DATETIME || status.warnings) { error("Incorrect date and time argument: %s", str); - exit(1); + die(); } /* Note that Feb 30th, Apr 31st cause no error messages and are mapped to @@ -1977,7 +1991,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), opt->name)) <= 0) { sf_leaking_memory= 1; /* no memory leak reports here */ - exit(1); + die(); } break; #ifdef WHEN_FLASHBACK_REVIEW_READY @@ -2002,7 +2016,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), opt->name)) <= 0) { sf_leaking_memory= 1; /* no memory leak reports here */ - exit(1); + die(); } opt_base64_output_mode= (enum_base64_output_mode) (val - 1); } @@ -2087,7 +2101,9 @@ static int parse_args(int *argc, char*** argv) int ho_error; if ((ho_error=handle_options(argc, argv, my_options, get_one_option))) - exit(ho_error); + { + die(); + } if (debug_info_flag) my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO; else if (debug_check_flag) @@ -3007,7 +3023,6 @@ end: int main(int argc, char** argv) { - char **defaults_argv; Exit_status retval= OK_CONTINUE; ulonglong save_stop_position; MY_INIT(argv[0]); @@ -3058,7 +3073,7 @@ int main(int argc, char** argv) if (!remote_opt) { error("The --raw mode only works with --read-from-remote-server"); - exit(1); + die(); } if (one_database) warning("The --database option is ignored in raw mode"); @@ -3080,7 +3095,7 @@ int main(int argc, char** argv) O_WRONLY | O_BINARY, MYF(MY_WME)))) { error("Could not create log file '%s'", result_file_name); - exit(1); + die(); } } else @@ -3201,11 +3216,6 @@ int main(int argc, char** argv) if (result_file && result_file != stdout) my_fclose(result_file, MYF(0)); cleanup(); - free_annotate_event(); - free_defaults(defaults_argv); - my_free_open_file_info(); - load_processor.destroy(); - mysql_server_end(); /* We cannot free DBUG, it is used in global destructors after exit(). */ my_end(my_end_arg | MY_DONT_FREE_DBUG); @@ -3215,7 +3225,6 @@ int main(int argc, char** argv) err: cleanup(); - free_defaults(defaults_argv); my_end(my_end_arg); exit(retval == ERROR_STOP ? 1 : 0); DBUG_RETURN(retval == ERROR_STOP ? 1 : 0); From f0ab1a28c99f0ac1694f5abe433f958470f51031 Mon Sep 17 00:00:00 2001 From: Anel Husakovic Date: Mon, 20 Feb 2023 14:10:53 +0100 Subject: [PATCH 043/260] MDEV-30697: Memory leak detected when mariadb-binlog is used with option flashback --- client/mysqlbinlog.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 213fb29e2fd..fb70ff62d63 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -1887,6 +1887,11 @@ static void cleanup() my_free_open_file_info(); load_processor.destroy(); mysql_server_end(); + if (opt_flashback) + { + delete_dynamic(&binlog_events); + delete_dynamic(&events_in_stmt); + } DBUG_VOID_RETURN; } From 7300ab32cc7fe3865c059d3bce57dc63a32dff13 Mon Sep 17 00:00:00 2001 From: Anel Husakovic Date: Thu, 2 Mar 2023 12:05:36 +0100 Subject: [PATCH 044/260] Update handling of mysqlbinlog's `die()` function - Update per Monty's review for commit 5328dbdaa237d97e443120f2e08437fb274198c2 --- client/mysqlbinlog.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index fb70ff62d63..8770b3651cc 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -1896,11 +1896,11 @@ static void cleanup() } -static void die() +static void die(int err) { cleanup(); - my_end(MY_DONT_FREE_DBUG); - exit(1); + my_end(0); + exit(err); } @@ -1937,7 +1937,7 @@ static my_time_t convert_str_to_timestamp(const char* str) l_time.time_type != MYSQL_TIMESTAMP_DATETIME || status.warnings) { error("Incorrect date and time argument: %s", str); - die(); + die(1); } /* Note that Feb 30th, Apr 31st cause no error messages and are mapped to @@ -1996,7 +1996,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), opt->name)) <= 0) { sf_leaking_memory= 1; /* no memory leak reports here */ - die(); + die(1); } break; #ifdef WHEN_FLASHBACK_REVIEW_READY @@ -2021,7 +2021,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), opt->name)) <= 0) { sf_leaking_memory= 1; /* no memory leak reports here */ - die(); + die(1); } opt_base64_output_mode= (enum_base64_output_mode) (val - 1); } @@ -2107,7 +2107,7 @@ static int parse_args(int *argc, char*** argv) if ((ho_error=handle_options(argc, argv, my_options, get_one_option))) { - die(); + die(ho_error); } if (debug_info_flag) my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO; @@ -3078,7 +3078,7 @@ int main(int argc, char** argv) if (!remote_opt) { error("The --raw mode only works with --read-from-remote-server"); - die(); + die(1); } if (one_database) warning("The --database option is ignored in raw mode"); @@ -3100,7 +3100,7 @@ int main(int argc, char** argv) O_WRONLY | O_BINARY, MYF(MY_WME)))) { error("Could not create log file '%s'", result_file_name); - die(); + die(1); } } else From 2f6bb9cda57e2ddbfffc5bdad00dfb352dab1313 Mon Sep 17 00:00:00 2001 From: Anel Husakovic Date: Mon, 20 Feb 2023 14:11:13 +0100 Subject: [PATCH 045/260] MDEV-30698 Cover missing test cases for mariadb-binlog options --raw [and] --flashback - Adding test case for --raw without -R - Adding unsuported combination of --raw and --flashback parameters and covered with test case --- client/mysqlbinlog.cc | 6 ++++++ .../suite/binlog/r/binlog_mysqlbinlog_raw_flush.result | 4 ++++ mysql-test/suite/binlog/r/flashback.result | 4 ++++ .../suite/binlog/t/binlog_mysqlbinlog_raw_flush.test | 9 +++++++++ mysql-test/suite/binlog/t/flashback.test | 8 ++++++++ 5 files changed, 31 insertions(+) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 8770b3651cc..ec0cae5328c 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -3063,6 +3063,12 @@ int main(int argc, char** argv) my_set_max_open_files(open_files_limit); + if (opt_flashback && opt_raw_mode) + { + error("The --raw mode is not allowed with --flashback mode"); + die(1); + } + if (opt_flashback) { my_init_dynamic_array(&binlog_events, sizeof(LEX_STRING), 1024, 1024, diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_raw_flush.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_raw_flush.result index 9148f0e8c2b..294e96e5997 100644 --- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_raw_flush.result +++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_raw_flush.result @@ -1,3 +1,7 @@ +# +# MDEV-30698 Cover missing test cases for mariadb-binlog options +# --raw [and] --flashback +# CREATE TABLE t1 (a int); FLUSH LOGS; INSERT INTO t1 VALUES (1); diff --git a/mysql-test/suite/binlog/r/flashback.result b/mysql-test/suite/binlog/r/flashback.result index eaced02b7a9..12e47363fe2 100644 --- a/mysql-test/suite/binlog/r/flashback.result +++ b/mysql-test/suite/binlog/r/flashback.result @@ -702,6 +702,10 @@ include/assert.inc [Table t1 should have 0 rows.] # 6- Rows must be present upon restoring from flashback include/assert.inc [Table t1 should have six rows.] DROP TABLE t1; +# +# MDEV-30698 Cover missing test cases for mariadb-binlog options +# --raw [and] --flashback +# SET binlog_format=statement; Warnings: Warning 1105 MariaDB Galera and flashback do not support binlog format: STATEMENT diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_raw_flush.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_raw_flush.test index f95fc0137a2..252a8577b6c 100644 --- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_raw_flush.test +++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_raw_flush.test @@ -5,6 +5,7 @@ # respective log file specified by --result-file, and shown on-disk. This test # ensures that the log files on disk, created by mariadb-binlog, have the most # up-to-date events from the master. +# Option --raw works only with --read-from-remote-server, otherwise returns error. # # Methodology: # On the master, rotate to a newly active binlog file and write an event to @@ -20,6 +21,14 @@ --source include/linux.inc --source include/have_log_bin.inc +--echo # +--echo # MDEV-30698 Cover missing test cases for mariadb-binlog options +--echo # --raw [and] --flashback +--echo # +# Test --raw format without -R (--read-from-remote-server) +--error 1 # Error 1 operation not permitted +--exec $MYSQL_BINLOG --raw --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --stop-never --result-file=$MYSQLTEST_VARDIR/tmp/ master-bin.000001 + # Create newly active log CREATE TABLE t1 (a int); FLUSH LOGS; diff --git a/mysql-test/suite/binlog/t/flashback.test b/mysql-test/suite/binlog/t/flashback.test index abe054e4de0..50190da6dbe 100644 --- a/mysql-test/suite/binlog/t/flashback.test +++ b/mysql-test/suite/binlog/t/flashback.test @@ -364,6 +364,14 @@ FLUSH LOGS; DROP TABLE t1; +--echo # +--echo # MDEV-30698 Cover missing test cases for mariadb-binlog options +--echo # --raw [and] --flashback +--echo # + +--error 1 # --raw mode and --flashback mode are not allowed +--exec $MYSQL_BINLOG -vv -B --raw --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000003> $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_8.sql + ## Clear SET binlog_format=statement; --error ER_FLASHBACK_NOT_SUPPORTED From 94ed30e505f8a6d9dca8a2006f6dfced1bff9dec Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Fri, 10 Feb 2023 12:58:57 +1100 Subject: [PATCH 046/260] MDEV-30613 output_core_info crashes in my_read() and my_getwd(). The cause is my_errno define which depends on my_thread_var being a not null pointer otherwise it will be de-referenced and cause a SEGV already in the signal handler. Replace uses of these functions in the output_core_info using posix read/getcwd functions instead. The getwd fallback in my_getcwd isn't needed as its been obsolute for a very long time. Thanks Vladislav Vaintroub for diagnosis and posix recommendation. --- sql/signal_handler.cc | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc index 2ddda3cec9d..96c067b717e 100644 --- a/sql/signal_handler.cc +++ b/sql/signal_handler.cc @@ -27,6 +27,7 @@ #ifdef __WIN__ #include +#include #define SIGNAL_FMT "exception 0x%x" #else #define SIGNAL_FMT "signal %d" @@ -67,27 +68,27 @@ static inline void output_core_info() my_safe_printf_stderr("Writing a core file...\nWorking directory at %.*s\n", (int) len, buff); } - if ((fd= my_open("/proc/self/limits", O_RDONLY, MYF(0))) >= 0) + if ((fd= open("/proc/self/limits", O_RDONLY, MYF(0))) >= 0) { my_safe_printf_stderr("Resource Limits:\n"); - while ((len= my_read(fd, (uchar*)buff, sizeof(buff), MYF(0))) > 0) + while ((len= read(fd, (uchar*)buff, sizeof(buff))) > 0) { my_write_stderr(buff, len); } - my_close(fd, MYF(0)); + close(fd); } #ifdef __linux__ - if ((fd= my_open("/proc/sys/kernel/core_pattern", O_RDONLY, MYF(0))) >= 0) + if ((fd= open("/proc/sys/kernel/core_pattern", O_RDONLY, MYF(0))) >= 0) { - len= my_read(fd, (uchar*)buff, sizeof(buff), MYF(0)); + len= read(fd, (uchar*)buff, sizeof(buff)); my_safe_printf_stderr("Core pattern: %.*s\n", (int) len, buff); - my_close(fd, MYF(0)); + close(fd); } - if ((fd= my_open("/proc/version", O_RDONLY, MYF(0))) >= 0) + if ((fd= open("/proc/version", O_RDONLY)) >= 0) { - len= my_read(fd, (uchar*)buff, sizeof(buff), MYF(0)); + len= read(fd, (uchar*)buff, sizeof(buff)); my_safe_printf_stderr("Kernel version: %.*s\n", (int) len, buff); - my_close(fd, MYF(0)); + close(fd); } #endif #elif defined(__APPLE__) || defined(__FreeBSD__) @@ -101,11 +102,14 @@ static inline void output_core_info() { my_safe_printf_stderr("Kernel version: %.*s\n", (int) len, buff); } -#else +#elif defined(HAVE_GETCWD) char buff[80]; - my_getwd(buff, sizeof(buff), 0); - my_safe_printf_stderr("Writing a core file at %s\n", buff); - fflush(stderr); + + if (getcwd(buff, sizeof(buff))) + { + my_safe_printf_stderr("Writing a core file at %.*s\n", (int) sizeof(buff), buff); + fflush(stderr); + } #endif } From 2ac832838fd04e22645df6cf6fe8959b44c3853d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 7 Mar 2023 20:05:12 +0100 Subject: [PATCH 047/260] post fix for "move alloca() definition from all *.h files to one new header file" --- include/CMakeLists.txt | 1 - include/mysql/service_encryption.h | 2 -- 2 files changed, 3 deletions(-) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index fe02098621e..f6f8735bfdf 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -106,7 +106,6 @@ ENDMACRO() INSTALL_COMPAT_HEADER(my_global.h "") INSTALL_COMPAT_HEADER(my_config.h "") -INSTALL_COMPAT_HEADER(my_alloca.h "") INSTALL_COMPAT_HEADER(my_sys.h "") INSTALL_COMPAT_HEADER(mysql_version.h " #include diff --git a/include/mysql/service_encryption.h b/include/mysql/service_encryption.h index 280b9c69e35..4963940758c 100644 --- a/include/mysql/service_encryption.h +++ b/include/mysql/service_encryption.h @@ -30,8 +30,6 @@ #ifndef __cplusplus #define inline __inline #endif -#else -#include #endif #endif From e62947f38bb9c15f7fa8d3faa60b1852c4fecb80 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 9 Mar 2023 15:32:24 +0100 Subject: [PATCH 048/260] bump the VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 876e7c96e80..26166cc8151 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=10 MYSQL_VERSION_MINOR=3 -MYSQL_VERSION_PATCH=38 +MYSQL_VERSION_PATCH=39 SERVER_MATURITY=stable From fb7d5881535574c0e33fa8338eaed9ecc7bc65c6 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 9 Mar 2023 11:32:18 +0100 Subject: [PATCH 049/260] main.bootstrap test cleanup --- mysql-test/main/bootstrap.result | 42 ++++++++++++- mysql-test/main/bootstrap.test | 102 +++++++++++++++---------------- 2 files changed, 89 insertions(+), 55 deletions(-) diff --git a/mysql-test/main/bootstrap.result b/mysql-test/main/bootstrap.result index 0ba87be092e..7ea00923823 100644 --- a/mysql-test/main/bootstrap.result +++ b/mysql-test/main/bootstrap.result @@ -1,13 +1,26 @@ -drop table if exists t1; +# +# test mysqld in bootstrap mode +# +# +# Check that --bootstrap reads from stdin +# drop table t1; +# +# Check that --bootstrap of file with SQL error returns error +# drop table t1; ERROR 42S02: Unknown table 'test.t1' +# +# Bootstrap with a large thd->net.max_packet +# set @my_max_allowed_packet= @@max_allowed_packet; set @@global.max_allowed_packet= greatest(1073741824, @@max_allowed_packet); set @max_allowed_packed=@@global.max_allowed_packet; set global max_allowed_packet=@my_max_allowed_packet; drop table t1; -End of 5.1 tests +# +# End of 5.1 tests +# # # Bug #11766306: 59393: HAVE_INNODB=YES WHEN MYSQLD # STARTED WITH --SKIP-INNODB @@ -15,7 +28,21 @@ End of 5.1 tests SELECT 'bug' as '' FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb' and SUPPORT='YES'; -End of 5.5 tests +# +# MDEV-13063 Server crashes in intern_plugin_lock or assertion `plugin_ptr->ref_count == 1' fails in plugin_init +# +# +# MDEV-19349 mysql_install_db: segfault at tmp_file_prefix check +# +# +# End of 5.5 tests +# +# +# Check that --bootstrap can install and uninstall plugins +# +# +# Check that installed plugins are *not* automatically loaded in --bootstrap +# flush tables; show create table t1; Table Create Table @@ -27,3 +54,12 @@ select * from mysql.plugin; name dl EXAMPLE ha_example.so truncate table mysql.plugin; +# +# MDEV-9969 mysql_install_db error processing ignore_db_dirs. +# +# +# MDEV-13397 MariaDB upgrade fail when using default_time_zone +# +# +# End of 10.3 tests +# diff --git a/mysql-test/main/bootstrap.test b/mysql-test/main/bootstrap.test index 683033979fe..318842b550b 100644 --- a/mysql-test/main/bootstrap.test +++ b/mysql-test/main/bootstrap.test @@ -1,16 +1,20 @@ -# -# test mysqld in bootstrap mode -# ---disable_warnings -drop table if exists t1; ---enable_warnings +--echo # +--echo # test mysqld in bootstrap mode +--echo # +--source include/not_windows_embedded.inc +--source include/have_example_plugin.inc + +--let test_bootstrap=$MYSQLTEST_VARDIR/tmp/test_bootstrap.sql +--write_file $test_bootstrap +use test; +EOF # Add the datadir to the bootstrap command let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_BOOTSTRAP_CMD= $MYSQLD_BOOTSTRAP_CMD --datadir=$MYSQLD_DATADIR --tmpdir=$MYSQL_TMP_DIR --default-storage-engine=MyISAM --loose-skip-innodb --plugin-maturity=unknown; -# -# Check that --bootstrap reads from stdin -# +--echo # +--echo # Check that --bootstrap reads from stdin +--echo # --write_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql use test; CREATE TABLE t1(a int); @@ -18,9 +22,9 @@ EOF --exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 drop table t1; remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_test.sql; -# -# Check that --bootstrap of file with SQL error returns error -# +--echo # +--echo # Check that --bootstrap of file with SQL error returns error +--echo # --write_file $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql use test; CREATE TABLE t1; @@ -32,9 +36,9 @@ EOF drop table t1; remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_error.sql; -# -# Bootstrap with a large thd->net.max_packet -# +--echo # +--echo # Bootstrap with a large thd->net.max_packet +--echo # set @my_max_allowed_packet= @@max_allowed_packet; set @@global.max_allowed_packet= greatest(1073741824, @@max_allowed_packet); set @max_allowed_packed=@@global.max_allowed_packet; @@ -49,7 +53,9 @@ remove_file $MYSQLTEST_VARDIR/tmp/long_query.sql; set global max_allowed_packet=@my_max_allowed_packet; drop table t1; ---echo End of 5.1 tests +--echo # +--echo # End of 5.1 tests +--echo # --echo # --echo # Bug #11766306: 59393: HAVE_INNODB=YES WHEN MYSQLD @@ -60,28 +66,24 @@ drop table t1; SELECT 'bug' as '' FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb' and SUPPORT='YES'; -# -# MDEV-13063 Server crashes in intern_plugin_lock or assertion `plugin_ptr->ref_count == 1' fails in plugin_init -# +--echo # +--echo # MDEV-13063 Server crashes in intern_plugin_lock or assertion `plugin_ptr->ref_count == 1' fails in plugin_init +--echo # --error 1 --exec $MYSQLD_BOOTSTRAP_CMD --myisam_recover_options=NONE -# -# MDEV-19349 mysql_install_db: segfault at tmp_file_prefix check -# ---write_file $MYSQLTEST_VARDIR/tmp/1 -use test; -EOF ---exec $MYSQLD_BOOTSTRAP_CMD < $MYSQLTEST_VARDIR/tmp/1 >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 ---remove_file $MYSQLTEST_VARDIR/tmp/1 +--echo # +--echo # MDEV-19349 mysql_install_db: segfault at tmp_file_prefix check +--echo # +--exec $MYSQLD_BOOTSTRAP_CMD < $test_bootstrap >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 ---echo End of 5.5 tests +--echo # +--echo # End of 5.5 tests +--echo # ---source include/not_windows_embedded.inc ---source include/have_example_plugin.inc -# -# Check that --bootstrap can install and uninstall plugins -# +--echo # +--echo # Check that --bootstrap can install and uninstall plugins +--echo # let $PLUGIN_DIR=`select @@plugin_dir`; --write_file $MYSQLTEST_VARDIR/tmp/install_plugin.sql install soname 'ha_example'; @@ -90,9 +92,9 @@ EOF --exec $MYSQLD_BOOTSTRAP_CMD --plugin-dir=$PLUGIN_DIR < $MYSQLTEST_VARDIR/tmp/install_plugin.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 --remove_file $MYSQLTEST_VARDIR/tmp/install_plugin.sql -# -# Check that installed plugins are *not* automatically loaded in --bootstrap -# +--echo # +--echo # Check that installed plugins are *not* automatically loaded in --bootstrap +--echo # --write_file $MYSQLTEST_VARDIR/tmp/bootstrap_plugins.sql SET SQL_MODE=""; use test; @@ -107,21 +109,17 @@ drop table t1; select * from mysql.plugin; truncate table mysql.plugin; +--echo # +--echo # MDEV-9969 mysql_install_db error processing ignore_db_dirs. +--echo # +--exec $MYSQLD_BOOTSTRAP_CMD --ignore-db-dirs='some_dir' --ignore-db-dirs='some_dir' < $test_bootstrap >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 -# -# MDEV-9969 mysql_install_db error processing ignore_db_dirs. -# ---write_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql -use test; -EOF ---exec $MYSQLD_BOOTSTRAP_CMD --ignore-db-dirs='some_dir' --ignore-db-dirs='some_dir' < $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 ---remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql +--echo # +--echo # MDEV-13397 MariaDB upgrade fail when using default_time_zone +--echo # +--exec $MYSQLD_BOOTSTRAP_CMD --default-time-zone=Europe/Moscow < $test_bootstrap >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 -# -# MDEV-13397 MariaDB upgrade fail when using default_time_zone -# ---write_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql -use test; -EOF ---exec $MYSQLD_BOOTSTRAP_CMD --default-time-zone=Europe/Moscow < $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 ---remove_file $MYSQLTEST_VARDIR/tmp/bootstrap_9969.sql +--echo # +--echo # End of 10.3 tests +--echo # +--remove_file $test_bootstrap From 4c4939bbf619d7e516131c0b3e5691b1c2d2ff8f Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 9 Mar 2023 11:22:41 +0100 Subject: [PATCH 050/260] MDEV-30818 invalid ssl prevents bootstrap in bootstrap the server reads stdin and does not listen to network. it won't use ssl anyway --- mysql-test/main/bootstrap.result | 3 +++ mysql-test/main/bootstrap.test | 5 +++++ sql/mysqld.cc | 5 ++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/mysql-test/main/bootstrap.result b/mysql-test/main/bootstrap.result index 7ea00923823..0b256263a29 100644 --- a/mysql-test/main/bootstrap.result +++ b/mysql-test/main/bootstrap.result @@ -61,5 +61,8 @@ truncate table mysql.plugin; # MDEV-13397 MariaDB upgrade fail when using default_time_zone # # +# MDEV-30818 invalid ssl prevents bootstrap +# +# # End of 10.3 tests # diff --git a/mysql-test/main/bootstrap.test b/mysql-test/main/bootstrap.test index 318842b550b..e3c121f201f 100644 --- a/mysql-test/main/bootstrap.test +++ b/mysql-test/main/bootstrap.test @@ -119,6 +119,11 @@ truncate table mysql.plugin; --echo # --exec $MYSQLD_BOOTSTRAP_CMD --default-time-zone=Europe/Moscow < $test_bootstrap >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 +--echo # +--echo # MDEV-30818 invalid ssl prevents bootstrap +--echo # +--exec $MYSQLD_BOOTSTRAP_CMD --ssl-ca=/dev/nonexistent < $test_bootstrap >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 + --echo # --echo # End of 10.3 tests --echo # diff --git a/sql/mysqld.cc b/sql/mysqld.cc index ea3849ed9f9..68f66c37b6c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5026,7 +5026,10 @@ static void init_ssl() { sql_print_error("Failed to setup SSL"); sql_print_error("SSL error: %s", sslGetErrString(error)); - unireg_abort(1); + if (!opt_bootstrap) + unireg_abort(1); + opt_use_ssl = 0; + have_ssl= SHOW_OPTION_DISABLED; } if (global_system_variables.log_warnings > 0) { From 8145b308b02ee7ee657851c1faee49c7b7ebf511 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 10 Mar 2023 18:14:45 +0100 Subject: [PATCH 051/260] MDEV-30826 Invalid data on mysql.host segfaults the server after an upgrade to 10.4 convert empty host.db to "%", just as it's done for host.hostname (in update_hostname()) --- mysql-test/main/grant5.result | 9 +++++++++ mysql-test/main/grant5.test | 12 ++++++++++++ sql/sql_acl.cc | 7 ++++--- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/mysql-test/main/grant5.result b/mysql-test/main/grant5.result index 1038198bd02..c3a4baad259 100644 --- a/mysql-test/main/grant5.result +++ b/mysql-test/main/grant5.result @@ -453,4 +453,13 @@ insert mysql.host values (1); flush privileges; ERROR HY000: Fatal error: mysql.host table is damaged or in unsupported 3.20 format drop table mysql.host; +# +# MDEV-30826 Invalid data on mysql.host segfaults the server after an upgrade to 10.4 +# +create table mysql.host (host char(60) binary default '' not null, db char(64) binary default '' not null, select_priv enum('n','y') collate utf8_general_ci default 'n' not null, insert_priv enum('n','y') collate utf8_general_ci default 'n' not null, update_priv enum('n','y') collate utf8_general_ci default 'n' not null, delete_priv enum('n','y') collate utf8_general_ci default 'n' not null, create_priv enum('n','y') collate utf8_general_ci default 'n' not null, drop_priv enum('n','y') collate utf8_general_ci default 'n' not null, grant_priv enum('n','y') collate utf8_general_ci default 'n' not null, references_priv enum('n','y') collate utf8_general_ci default 'n' not null, index_priv enum('n','y') collate utf8_general_ci default 'n' not null, alter_priv enum('n','y') collate utf8_general_ci default 'n' not null, create_tmp_table_priv enum('n','y') collate utf8_general_ci default 'n' not null, lock_tables_priv enum('n','y') collate utf8_general_ci default 'n' not null, create_view_priv enum('n','y') collate utf8_general_ci default 'n' not null, show_view_priv enum('n','y') collate utf8_general_ci default 'n' not null, create_routine_priv enum('n','y') collate utf8_general_ci default 'n' not null, alter_routine_priv enum('n','y') collate utf8_general_ci default 'n' not null, execute_priv enum('n','y') collate utf8_general_ci default 'n' not null, trigger_priv enum('n','y') collate utf8_general_ci default 'n' not null, primary key /*host*/ (host,db)) engine=myisam character set utf8 collate utf8_bin comment='host privileges; merged with database privileges'; +insert mysql.host values('10.5.0.0/255.255.0.0','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','N'); +flush privileges; +drop table mysql.host; +# # End of 10.4 tests +# diff --git a/mysql-test/main/grant5.test b/mysql-test/main/grant5.test index c4a302fca86..49e0ab1abf1 100644 --- a/mysql-test/main/grant5.test +++ b/mysql-test/main/grant5.test @@ -408,4 +408,16 @@ insert mysql.host values (1); flush privileges; drop table mysql.host; +--echo # +--echo # MDEV-30826 Invalid data on mysql.host segfaults the server after an upgrade to 10.4 +--echo # + +# from mysql_system_tables.sql in 10.3: +create table mysql.host (host char(60) binary default '' not null, db char(64) binary default '' not null, select_priv enum('n','y') collate utf8_general_ci default 'n' not null, insert_priv enum('n','y') collate utf8_general_ci default 'n' not null, update_priv enum('n','y') collate utf8_general_ci default 'n' not null, delete_priv enum('n','y') collate utf8_general_ci default 'n' not null, create_priv enum('n','y') collate utf8_general_ci default 'n' not null, drop_priv enum('n','y') collate utf8_general_ci default 'n' not null, grant_priv enum('n','y') collate utf8_general_ci default 'n' not null, references_priv enum('n','y') collate utf8_general_ci default 'n' not null, index_priv enum('n','y') collate utf8_general_ci default 'n' not null, alter_priv enum('n','y') collate utf8_general_ci default 'n' not null, create_tmp_table_priv enum('n','y') collate utf8_general_ci default 'n' not null, lock_tables_priv enum('n','y') collate utf8_general_ci default 'n' not null, create_view_priv enum('n','y') collate utf8_general_ci default 'n' not null, show_view_priv enum('n','y') collate utf8_general_ci default 'n' not null, create_routine_priv enum('n','y') collate utf8_general_ci default 'n' not null, alter_routine_priv enum('n','y') collate utf8_general_ci default 'n' not null, execute_priv enum('n','y') collate utf8_general_ci default 'n' not null, trigger_priv enum('n','y') collate utf8_general_ci default 'n' not null, primary key /*host*/ (host,db)) engine=myisam character set utf8 collate utf8_bin comment='host privileges; merged with database privileges'; +insert mysql.host values('10.5.0.0/255.255.0.0','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','N'); +flush privileges; +drop table mysql.host; + +--echo # --echo # End of 10.4 tests +--echo # diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 54ad81f94ce..4bb16e3248d 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -2437,6 +2437,8 @@ static bool acl_load(THD *thd, const Grant_tables& tables) "possible to remove this privilege using REVOKE.", host.host.hostname, host.db); } + else if (!host.db) + host.db= const_cast(host_not_specified.str); host.access= host_table.get_access(); host.access= fix_rights_for_db(host.access); host.sort= get_magic_sort("hd", host.host.hostname, host.db); @@ -2445,8 +2447,7 @@ static bool acl_load(THD *thd, const Grant_tables& tables) { sql_print_warning("'host' entry '%s|%s' " "ignored in --skip-name-resolve mode.", - safe_str(host.host.hostname), - safe_str(host.db)); + host.host.hostname, host.db); continue; } #ifndef TO_BE_REMOVED @@ -3533,7 +3534,7 @@ ulong acl_get(const char *host, const char *ip, ACL_HOST *acl_host=dynamic_element(&acl_hosts,i,ACL_HOST*); if (compare_hostname(&acl_host->host,host,ip)) { - if (!acl_host->db || !wild_compare(db,acl_host->db,db_is_pattern)) + if (!wild_compare(db, acl_host->db, db_is_pattern)) { host_access=acl_host->access; // Fully specified. Take it break; From 8b37e79a393dcaef3e09fb72564545e4909cbfb0 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Mon, 13 Mar 2023 17:41:06 +0100 Subject: [PATCH 052/260] Post-MDEV-30700: moving alloca() definitions from all *.h files to new header file Included config file for proper compilation without --- include/my_alloca.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/my_alloca.h b/include/my_alloca.h index 761c2adb890..25fd8867e69 100644 --- a/include/my_alloca.h +++ b/include/my_alloca.h @@ -16,6 +16,8 @@ #ifndef MY_ALLOCA_INCLUDED #define MY_ALLOCA_INCLUDED +#include + #ifdef _WIN32 #include /*for alloca*/ /* From dfdcd7ffab17cfc52545090acb26cb324d9de610 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Mon, 13 Mar 2023 15:41:06 +0530 Subject: [PATCH 053/260] MDEV-26198 Assertion `0' failed in row_log_table_apply_op during redundant table rebuild - InnoDB alter fails to apply the online log during redundant table rebuild. Problem is that InnoDB wrongly reads the length flags of the record while applying the temporary log record. rec_init_offsets_comp_ordinary(): For finding the n_core_null_bytes, InnoDB should use the same logic as rec_convert_dtuple_to_rec_comp(). --- .../suite/innodb/r/instant_alter_crash.result | 24 +++++++++++++++++ .../suite/innodb/t/instant_alter_crash.test | 26 +++++++++++++++++++ storage/innobase/rem/rem0rec.cc | 4 ++- 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/innodb/r/instant_alter_crash.result b/mysql-test/suite/innodb/r/instant_alter_crash.result index d15c0337c37..c16d5951c07 100644 --- a/mysql-test/suite/innodb/r/instant_alter_crash.result +++ b/mysql-test/suite/innodb/r/instant_alter_crash.result @@ -181,3 +181,27 @@ t3 CREATE TABLE `t3` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci DROP TABLE t1,t2,t3; db.opt +# +# MDEV-26198 Assertion `0' failed in row_log_table_apply_op during +# ADD PRIMARY KEY or OPTIMIZE TABLE +# +CREATE TABLE t1(f1 year default null, f2 year default null, +f3 text, f4 year default null, f5 year default null, +f6 year default null, f7 year default null, +f8 year default null)ENGINE=InnoDB ROW_FORMAT=REDUNDANT; +INSERT INTO t1 VALUES(1, 1, 1, 1, 1, 1, 1, 1); +ALTER TABLE t1 ADD COLUMN f9 year default null, ALGORITHM=INPLACE; +set DEBUG_SYNC="row_log_table_apply1_before SIGNAL con1_insert WAIT_FOR con1_finish"; +ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ADD COLUMN f10 YEAR DEFAULT NULL, ALGORITHM=INPLACE; +connect con1,localhost,root,,,; +SET DEBUG_SYNC="now WAIT_FOR con1_insert"; +INSERT IGNORE INTO t1 (f3) VALUES ( 'b' ); +INSERT IGNORE INTO t1 (f3) VALUES ( 'l' ); +SET DEBUG_SYNC="now SIGNAL con1_finish"; +connection default; +disconnect con1; +SET DEBUG_SYNC=RESET; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/instant_alter_crash.test b/mysql-test/suite/innodb/t/instant_alter_crash.test index 43db8f619f3..292de8a802b 100644 --- a/mysql-test/suite/innodb/t/instant_alter_crash.test +++ b/mysql-test/suite/innodb/t/instant_alter_crash.test @@ -205,3 +205,29 @@ DROP TABLE t1,t2,t3; --remove_files_wildcard $MYSQLD_DATADIR/test #sql*.frm --list_files $MYSQLD_DATADIR/test + +--echo # +--echo # MDEV-26198 Assertion `0' failed in row_log_table_apply_op during +--echo # ADD PRIMARY KEY or OPTIMIZE TABLE +--echo # +CREATE TABLE t1(f1 year default null, f2 year default null, + f3 text, f4 year default null, f5 year default null, + f6 year default null, f7 year default null, + f8 year default null)ENGINE=InnoDB ROW_FORMAT=REDUNDANT; +INSERT INTO t1 VALUES(1, 1, 1, 1, 1, 1, 1, 1); +ALTER TABLE t1 ADD COLUMN f9 year default null, ALGORITHM=INPLACE; +set DEBUG_SYNC="row_log_table_apply1_before SIGNAL con1_insert WAIT_FOR con1_finish"; +send ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ADD COLUMN f10 YEAR DEFAULT NULL, ALGORITHM=INPLACE; + +connect(con1,localhost,root,,,); +SET DEBUG_SYNC="now WAIT_FOR con1_insert"; +INSERT IGNORE INTO t1 (f3) VALUES ( 'b' ); +INSERT IGNORE INTO t1 (f3) VALUES ( 'l' ); +SET DEBUG_SYNC="now SIGNAL con1_finish"; + +connection default; +reap; +disconnect con1; +SET DEBUG_SYNC=RESET; +CHECK TABLE t1; +DROP TABLE t1; diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc index de300bf799a..3bb417eedff 100644 --- a/storage/innobase/rem/rem0rec.cc +++ b/storage/innobase/rem/rem0rec.cc @@ -287,7 +287,9 @@ rec_init_offsets_comp_ordinary( != n_core) ? UT_BITS_IN_BYTES(unsigned(index->get_n_nullable(n_core))) : (redundant_temp - ? UT_BITS_IN_BYTES(index->n_nullable) + ? (index->is_instant() + ? UT_BITS_IN_BYTES(index->get_n_nullable(n_core)) + : UT_BITS_IN_BYTES(index->n_nullable)) : index->n_core_null_bytes); if (mblob) { From d4339620be44091127647eb5ec8f593c0d6fa882 Mon Sep 17 00:00:00 2001 From: Andrei Date: Sun, 5 Mar 2023 15:12:13 +0200 Subject: [PATCH 054/260] MDEV-30780 optimistic parallel slave hangs after hit an error The hang could be seen as show slave status displaying an error like Last_Error: Could not execute Write_rows_v1 along with Slave_SQL_Running: Yes accompanied with one of the replication threads in show-processlist characteristically having status like 2394 | system user | | NULL | Slave_worker | 50852| closing tables It turns out that closing tables worker got entrapped in endless looping in mark_start_commit_inner() across already garbage-collected gco items. The reclaimed gco links are explained with actually possible out-of-order groups of events termination due to the Last_Error. This patch reinforces the correct ordering to perform finish_event_group's cleanup actions, incl unlinking gco:s from the active list. --- .../rpl_parallel_optimistic_error_stop.result | 81 ++++++++ .../t/rpl_parallel_optimistic_error_stop.test | 180 ++++++++++++++++++ sql/rpl_parallel.cc | 38 +++- sql/rpl_parallel.h | 3 + sql/rpl_rli.cc | 5 + 5 files changed, 299 insertions(+), 8 deletions(-) create mode 100644 mysql-test/suite/rpl/r/rpl_parallel_optimistic_error_stop.result create mode 100644 mysql-test/suite/rpl/t/rpl_parallel_optimistic_error_stop.test diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic_error_stop.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_error_stop.result new file mode 100644 index 00000000000..48672651c36 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_error_stop.result @@ -0,0 +1,81 @@ +include/rpl_init.inc [topology=1->2] +call mtr.add_suppression("Slave: Commit failed due to failure of an earlier commit"); +call mtr.add_suppression("Slave: Duplicate entry '99'"); +connection server_1; +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES(1,1); +INSERT INTO t1 VALUES(2,1); +INSERT INTO t1 VALUES(3,1); +INSERT INTO t1 VALUES(4,1); +connection server_2; +SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; +include/stop_slave.inc +SET @old_debug_dbug = @@global.debug_dbug; +SET @@global.debug_dbug = "d,hold_worker2_favor_worker3"; +SET GLOBAL slave_parallel_threads=4; +CHANGE MASTER TO master_use_gtid=slave_pos; +SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode; +SET GLOBAL slave_parallel_mode='optimistic'; +connection server_1; +SET @@gtid_seq_no = 2001; +BEGIN; +UPDATE t1 SET b = 11 WHERE a = 4; +UPDATE t1 SET b = 11 WHERE a = 3; +UPDATE t1 SET a = 99 WHERE a = 1; +COMMIT; +UPDATE t1 SET b = 2 WHERE a = 2; +UPDATE t1 SET b = 3 WHERE a = 3; +DROP TABLE IF EXISTS phantom_1; +Warnings: +Note 1051 Unknown table 'test.phantom_1' +include/save_master_gtid.inc +connect slave_local_0, 127.0.0.1, root,, test, $SLAVE_MYPORT,; +begin; +UPDATE t1 set b = 11 where a = 4; +connect slave_local_1, 127.0.0.1, root,, test, $SLAVE_MYPORT,; +begin; +INSERT INTO t1 VALUES (99, 11); +connect slave_local_2, 127.0.0.1, root,, test, $SLAVE_MYPORT,; +begin; +UPDATE t1 SET b = 12 WHERE a = 2; +connect slave_local_3, 127.0.0.1, root,, test, $SLAVE_MYPORT,; +begin; +UPDATE t1 SET b = 13 WHERE a = 3; +connection server_2; +include/start_slave.inc +# W4 is waiting to start its DROP +connection slave_local_3; +rollback; +connection slave_local_0; +rollback; +SELECT count(*) = 0 as "W3 undid its commit state" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit%"; +W3 undid its commit state +1 +connection slave_local_2; +rollback; +connection slave_local_1; +commit; +SELECT COUNT(*) = 1 as "W4 remains with the same status" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to start commit%"; +W4 remains with the same status +1 +# Slave_SQL_Running YES = Yes +# while W2 is held back ... +SET DEBUG_SYNC = 'now SIGNAL cont_worker2'; +include/wait_for_slave_sql_error.inc [errno=1062] +DELETE FROM t1 WHERE a=99; +include/start_slave.inc +include/sync_with_master_gtid.inc +connection server_2; +include/stop_slave.inc +SET GLOBAL slave_parallel_mode=@old_parallel_mode; +SET GLOBAL slave_parallel_threads=@old_parallel_threads; +SET @@global.debug_dbug = @old_debug_dbug; +SET debug_sync = RESET; +include/start_slave.inc +connection server_1; +DROP TABLE t1; +include/save_master_gtid.inc +connection server_2; +include/sync_with_master_gtid.inc +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic_error_stop.test b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_error_stop.test new file mode 100644 index 00000000000..27f38d47bdb --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_error_stop.test @@ -0,0 +1,180 @@ +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc +--let $rpl_topology=1->2 +--source include/rpl_init.inc + +call mtr.add_suppression("Slave: Commit failed due to failure of an earlier commit"); +call mtr.add_suppression("Slave: Duplicate entry '99'"); + +--connection server_1 +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES(1,1); # hit a dup entry on slave +INSERT INTO t1 VALUES(2,1); # races to "win" the last exit +INSERT INTO t1 VALUES(3,1); +INSERT INTO t1 VALUES(4,1); # make W3 race over W1 +--save_master_pos + +--connection server_2 +--sync_with_master +SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; +--source include/stop_slave.inc +SET @old_debug_dbug = @@global.debug_dbug; +# In a group of W1,W2,W3 of the same batch W2 simulates slowness. +SET @@global.debug_dbug = "d,hold_worker2_favor_worker3"; +SET GLOBAL slave_parallel_threads=4; +CHANGE MASTER TO master_use_gtid=slave_pos; +SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode; +SET GLOBAL slave_parallel_mode='optimistic'; + +# MDEV-30780 optimistic parallel slave hangs after hit an error +# Test workers hang scenario to prove it's no more neither +# out-of-order access to the active gco list. +# +# The test provides how to reproduce on the OLD version, false by default. +# That branch approximates the original hang with an assert that +# confirms the OLD version indeed could access already reclaimed gco. +--let $old_version_regression=0 + + +--connection server_1 + +# Let W1,W2,W3,W4 parallel workers that are going to execute +# the following transaction. +# W1 holds on with the 1st statement +# then crashes W3 with the 2nd into retry, +# finally hits with the 3rd a dup entry, on slave. +SET @@gtid_seq_no = 2001; +BEGIN; + UPDATE t1 SET b = 11 WHERE a = 4; + UPDATE t1 SET b = 11 WHERE a = 3; + UPDATE t1 SET a = 99 WHERE a = 1; +COMMIT; +# In the buggy version W2 races to "win" the exit last (of W1..3) +# and by that to access last a gco struct, garbage-collected. +UPDATE t1 SET b = 2 WHERE a = 2; +# W3 garbage-collects the gco struct in the buggy version. +UPDATE t1 SET b = 3 WHERE a = 3; +# W4 resides in following "singleton" batch to a W2 replacement +# in the buggy version to allow W3 reclaim the batch's gco. +DROP TABLE IF EXISTS phantom_1; + +--source include/save_master_gtid.inc + +--connect (slave_local_0, 127.0.0.1, root,, test, $SLAVE_MYPORT,) +begin; + UPDATE t1 set b = 11 where a = 4; +--connect (slave_local_1, 127.0.0.1, root,, test, $SLAVE_MYPORT,) +begin; + INSERT INTO t1 VALUES (99, 11); + +--connect (slave_local_2, 127.0.0.1, root,, test, $SLAVE_MYPORT,) +begin; + UPDATE t1 SET b = 12 WHERE a = 2; + +--connect (slave_local_3, 127.0.0.1, root,, test, $SLAVE_MYPORT,) +begin; + UPDATE t1 SET b = 13 WHERE a = 3; + +--connection server_2 +--source include/start_slave.inc + +--echo # W4 is waiting to start its DROP + +--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to start commit%" +--source include/wait_condition.inc + +--connection slave_local_3 +# make W3 to set E.cc <- 1 + rollback; +--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit%" +--source include/wait_condition.inc + +--connection slave_local_0 +# make W3 into retry and delay it to let W1 hit a dupicate error first, +# see 'commit' by slave_local_1. + rollback; +--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "debug sync point: now" +--source include/wait_condition.inc +SELECT count(*) = 0 as "W3 undid its commit state" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit%"; + + +--connection slave_local_2 + rollback; +# wait for W2 to start committing E.cc <- 2 +--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state like "Waiting for prior transaction to commit" +--source include/wait_condition.inc + +--connection slave_local_1 + +# W1 errors out +# A. to alert W3 +# B. W3 will *not* wake up W4 in the fixed version, having to wait for W2 demise. +# C. W2 will notify W3 that releases W4 as it would do in normal cases. +commit; + +if (!$old_version_regression) +{ +# A. In the fixed version show-processlist W4 is still in the ordered waiting +SELECT COUNT(*) = 1 as "W4 remains with the same status" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to start commit%"; +--let $status= query_get_value("show slave status", Slave_SQL_Running, 1) +--echo # Slave_SQL_Running YES = $status + +# B. In the fixed version W3 is waiting for W2,... +--let $wait_condition= SELECT count(*) = 1 as "W4 is waiting" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit%" +--source include/wait_condition.inc +--echo # while W2 is held back ... +--let $wait_condition= SELECT count(*) = 1 as "W2 simulates slowness" FROM information_schema.processlist WHERE state LIKE "debug sync point: now" +--source include/wait_condition.inc + +# C. # ...until NOW. +SET DEBUG_SYNC = 'now SIGNAL cont_worker2'; + +} + +# To reproduce the hang on the OLD version ... +if ($old_version_regression) +{ + # replace the actual fixes block with checking W3,W4 have actually committed, + # followed by signaling to W2 like on behalf of W4 which would end up in the hang. + --let $wait_condition= SELECT COUNT(*) = 0 as "W4 has moved on" FROM information_schema.processlist WHERE state like "Waiting for prior transaction to start commit" + --source include/wait_condition.inc + --let $wait_condition= SELECT count(*) = 0 as "W3 does not wait on W2" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit%" +--source include/wait_condition.inc + + --let $wait_condition= SELECT count(*) = 1 as "W2 simulates slowness" FROM information_schema.processlist WHERE state LIKE "debug sync point: now" + --source include/wait_condition.inc + + # Like above, but signaling is done after W4 is done to violate the commit order + # that must fire a debug assert. + SET DEBUG_SYNC = 'now SIGNAL cont_worker2'; +} + +--let $slave_sql_errno= 1062 +--source include/wait_for_slave_sql_error.inc + +# Restore the slave data and resume with replication +DELETE FROM t1 WHERE a=99; +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + +# +# Clean up. +# +--connection server_2 +--source include/stop_slave.inc +SET GLOBAL slave_parallel_mode=@old_parallel_mode; +SET GLOBAL slave_parallel_threads=@old_parallel_threads; +SET @@global.debug_dbug = @old_debug_dbug; +SET debug_sync = RESET; +--source include/start_slave.inc + +--connection server_1 +DROP TABLE t1; +--source include/save_master_gtid.inc + +--connection server_2 +--source include/sync_with_master_gtid.inc + +--source include/rpl_end.inc diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index 8701fc19411..7e70e04b857 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -261,6 +261,12 @@ finish_event_group(rpl_parallel_thread *rpt, uint64 sub_id, STRING_WITH_LEN("now WAIT_FOR proceed_by_1000")); } }); + DBUG_EXECUTE_IF("hold_worker2_favor_worker3", { + if (rgi->current_gtid.seq_no == 2001) { + DBUG_ASSERT(!rgi->worker_error || entry->stop_on_error_sub_id == sub_id); + debug_sync_set_action(thd, STRING_WITH_LEN("now SIGNAL cont_worker3")); + } + }); #endif if (rgi->killed_for_retry == rpl_group_info::RETRY_KILL_PENDING) @@ -284,6 +290,11 @@ signal_error_to_sql_driver_thread(THD *thd, rpl_group_info *rgi, int err) In case we get an error during commit, inform following transactions that we aborted our commit. */ + DBUG_EXECUTE_IF("hold_worker2_favor_worker3", { + if (rgi->current_gtid.seq_no == 2002) { + debug_sync_set_action(thd, STRING_WITH_LEN("now WAIT_FOR cont_worker2")); + }}); + rgi->unmark_start_commit(); rgi->cleanup_context(thd, true); rgi->rli->abort_slave= true; @@ -788,7 +799,14 @@ do_retry: thd->reset_killed(); thd->clear_error(); rgi->killed_for_retry = rpl_group_info::RETRY_KILL_NONE; - +#ifdef ENABLED_DEBUG_SYNC + DBUG_EXECUTE_IF("hold_worker2_favor_worker3", { + if (rgi->current_gtid.seq_no == 2003) { + debug_sync_set_action(thd, + STRING_WITH_LEN("now WAIT_FOR cont_worker3")); + } + }); +#endif /* If we retry due to a deadlock kill that occurred during the commit step, we might have already updated (but not committed) an update of table @@ -806,15 +824,12 @@ do_retry: for (;;) { mysql_mutex_lock(&entry->LOCK_parallel_entry); - if (entry->stop_on_error_sub_id == (uint64) ULONGLONG_MAX || + register_wait_for_prior_event_group_commit(rgi, entry); + if (!(entry->stop_on_error_sub_id == (uint64) ULONGLONG_MAX || #ifndef DBUG_OFF - (DBUG_EVALUATE_IF("simulate_mdev_12746", 1, 0)) || + (DBUG_EVALUATE_IF("simulate_mdev_12746", 1, 0)) || #endif - rgi->gtid_sub_id < entry->stop_on_error_sub_id) - { - register_wait_for_prior_event_group_commit(rgi, entry); - } - else + rgi->gtid_sub_id < entry->stop_on_error_sub_id)) { /* A failure of a preceeding "parent" transaction may not be @@ -1991,6 +2006,9 @@ rpl_parallel_thread::get_gco(uint64 wait_count, group_commit_orderer *prev, gco->prior_sub_id= prior_sub_id; gco->installed= false; gco->flags= 0; +#ifndef DBUG_OFF + gco->gc_done= false; +#endif return gco; } @@ -1998,6 +2016,10 @@ rpl_parallel_thread::get_gco(uint64 wait_count, group_commit_orderer *prev, void rpl_parallel_thread::loc_free_gco(group_commit_orderer *gco) { +#ifndef DBUG_OFF + DBUG_ASSERT(!gco->gc_done); + gco->gc_done= true; +#endif if (!loc_gco_list) loc_gco_last_ptr_ptr= &gco->next_gco; else diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h index 0fa28e32291..650aa06e504 100644 --- a/sql/rpl_parallel.h +++ b/sql/rpl_parallel.h @@ -90,6 +90,9 @@ struct group_commit_orderer { FORCE_SWITCH= 2 }; uint8 flags; +#ifndef DBUG_OFF + bool gc_done; +#endif }; diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 58030db2a8c..04fddb3e74b 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -2417,8 +2417,13 @@ mark_start_commit_inner(rpl_parallel_entry *e, group_commit_orderer *gco, uint64 count= ++e->count_committing_event_groups; /* Signal any following GCO whose wait_count has been reached now. */ tmp= gco; + + DBUG_ASSERT(!tmp->gc_done); + while ((tmp= tmp->next_gco)) { + DBUG_ASSERT(!tmp->gc_done); + uint64 wait_count= tmp->wait_count; if (wait_count > count) break; From 26e4ba5eb551570444cc7a6033f24eb7c4a1a763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 20 Mar 2023 14:12:52 +0200 Subject: [PATCH 055/260] Fix cmake -DWITH_INNODB_EXTRA_DEBUG (UNIV_ZIP_DEBUG) --- storage/innobase/page/page0zip.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index ffe48c4012d..13c6f58a171 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -3366,7 +3366,7 @@ page_zip_validate_low( differed. Let us ignore it. */ page_zip_fail(("page_zip_validate:" " min_rec_flag" - " (%s" ULINTPF "," ULINTPF + " (%s" UINT32PF "," UINT32PF ",0x%02x)\n", sloppy ? "ignored, " : "", page_get_space_id(page), @@ -3411,7 +3411,8 @@ page_zip_validate_low( page + PAGE_NEW_INFIMUM, TRUE); trec = page_rec_get_next_low( temp_page + PAGE_NEW_INFIMUM, TRUE); - const ulint n_core = page_is_leaf(page) ? index->n_fields : 0; + const ulint n_core = (index && page_is_leaf(page)) + ? index->n_fields : 0; do { if (page_offset(rec) != page_offset(trec)) { From a2cb6d8760362dbbe874cae3067b20f88242aaf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Mon, 20 Mar 2023 16:47:53 +0200 Subject: [PATCH 056/260] Update feedback plugin URL to use feedback.mariadb.org subdomain --- mysql-test/suite/plugins/r/feedback_plugin_install.result | 2 +- mysql-test/suite/plugins/r/feedback_plugin_load.result | 2 +- mysql-test/suite/plugins/r/feedback_plugin_send.result | 4 ++-- plugin/feedback/feedback.cc | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mysql-test/suite/plugins/r/feedback_plugin_install.result b/mysql-test/suite/plugins/r/feedback_plugin_install.result index c7f7a5c79f3..d2291f20b4f 100644 --- a/mysql-test/suite/plugins/r/feedback_plugin_install.result +++ b/mysql-test/suite/plugins/r/feedback_plugin_install.result @@ -11,6 +11,6 @@ FEEDBACK version 1.1 FEEDBACK_HTTP_PROXY FEEDBACK_SEND_RETRY_WAIT 60 FEEDBACK_SEND_TIMEOUT 60 -FEEDBACK_URL http://mariadb.org/feedback_plugin/post +FEEDBACK_URL http://feedback.mariadb.org/rest/v1/post FEEDBACK_USER_INFO mysql-test uninstall plugin feedback; diff --git a/mysql-test/suite/plugins/r/feedback_plugin_load.result b/mysql-test/suite/plugins/r/feedback_plugin_load.result index 4323dcce0a6..9043f6bf4a1 100644 --- a/mysql-test/suite/plugins/r/feedback_plugin_load.result +++ b/mysql-test/suite/plugins/r/feedback_plugin_load.result @@ -13,7 +13,7 @@ FEEDBACK version 1.1 FEEDBACK_HTTP_PROXY FEEDBACK_SEND_RETRY_WAIT 60 FEEDBACK_SEND_TIMEOUT 60 -FEEDBACK_URL http://mariadb.org/feedback_plugin/post +FEEDBACK_URL http://feedback.mariadb.org/rest/v1/post FEEDBACK_USER_INFO mysql-test SELECT VARIABLE_VALUE>0, VARIABLE_NAME FROM INFORMATION_SCHEMA.FEEDBACK WHERE VARIABLE_NAME LIKE 'Collation used %' diff --git a/mysql-test/suite/plugins/r/feedback_plugin_send.result b/mysql-test/suite/plugins/r/feedback_plugin_send.result index 69046e16dd9..028c69c6f16 100644 --- a/mysql-test/suite/plugins/r/feedback_plugin_send.result +++ b/mysql-test/suite/plugins/r/feedback_plugin_send.result @@ -13,7 +13,7 @@ FEEDBACK version 1.1 FEEDBACK_HTTP_PROXY FEEDBACK_SEND_RETRY_WAIT 60 FEEDBACK_SEND_TIMEOUT 60 -FEEDBACK_URL http://mariadb.org/feedback_plugin/post +FEEDBACK_URL http://feedback.mariadb.org/rest/v1/post FEEDBACK_USER_INFO mysql-test SELECT VARIABLE_VALUE>0, VARIABLE_NAME FROM INFORMATION_SCHEMA.FEEDBACK WHERE VARIABLE_NAME LIKE 'Collation used %' @@ -42,5 +42,5 @@ VARIABLE_VALUE>0 VARIABLE_NAME deallocate prepare stmt; set global sql_mode=ONLY_FULL_GROUP_BY; # restart -feedback plugin: report to 'http://mariadb.org/feedback_plugin/post' was sent +feedback plugin: report to 'http://feedback.mariadb.org/rest/v1/post' was sent feedback plugin: server replied 'ok' diff --git a/plugin/feedback/feedback.cc b/plugin/feedback/feedback.cc index a7bc1d3d60e..7f76dc728d1 100644 --- a/plugin/feedback/feedback.cc +++ b/plugin/feedback/feedback.cc @@ -367,7 +367,7 @@ static MYSQL_SYSVAR_STR(user_info, user_info, NULL, NULL, ""); static MYSQL_SYSVAR_STR(url, url, PLUGIN_VAR_READONLY | PLUGIN_VAR_RQCMDARG, "Space separated URLs to send the feedback report to.", NULL, NULL, - DEFAULT_PROTO "mariadb.org/feedback_plugin/post"); + DEFAULT_PROTO "feedback.mariadb.org/rest/v1/post"); static MYSQL_SYSVAR_ULONG(send_timeout, send_timeout, PLUGIN_VAR_RQCMDARG, "Timeout (in seconds) for the sending the report.", NULL, NULL, 60, 1, 60*60*24, 1); From f8c3d4c2d503e2343303fe506826a5a2ecffbae2 Mon Sep 17 00:00:00 2001 From: Vlad Lesin Date: Fri, 17 Mar 2023 18:51:33 +0300 Subject: [PATCH 057/260] MDEV-28187 mariadb-backup doesn't utilise innodb-undo-log-directory (if specified as a relative path) during copy-back operation Make absolute destination path from relative one, basing on mysql data directory. Reviewed by Alexander Barkov. --- extra/mariabackup/backup_copy.cc | 27 ++++++++++---- .../include/restart_and_restore.inc | 2 +- .../suite/mariabackup/relative_path.opt | 1 + .../suite/mariabackup/relative_path.result | 20 +++++++++++ .../suite/mariabackup/relative_path.test | 35 +++++++++++++++++++ 5 files changed, 77 insertions(+), 8 deletions(-) create mode 100644 mysql-test/suite/mariabackup/relative_path.opt create mode 100644 mysql-test/suite/mariabackup/relative_path.result create mode 100644 mysql-test/suite/mariabackup/relative_path.test diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc index e7d69a25b76..608be7125bd 100644 --- a/extra/mariabackup/backup_copy.cc +++ b/extra/mariabackup/backup_copy.cc @@ -1816,13 +1816,28 @@ apply_log_finish() return(true); } +class Copy_back_dst_dir +{ + std::string buf; + +public: + const char *make(const char *path) + { + if (!path || !path[0]) + return mysql_data_home; + if (is_absolute_path(path)) + return path; + return buf.assign(mysql_data_home).append(path).c_str(); + } +}; + bool copy_back() { bool ret = false; datadir_iter_t *it = NULL; datadir_node_t node; - char *dst_dir; + const char *dst_dir; memset(&node, 0, sizeof(node)); @@ -1875,9 +1890,9 @@ copy_back() /* copy undo tablespaces */ + Copy_back_dst_dir dst_dir_buf; - dst_dir = (srv_undo_dir && *srv_undo_dir) - ? srv_undo_dir : mysql_data_home; + dst_dir = dst_dir_buf.make(srv_undo_dir); ds_data = ds_create(dst_dir, DS_TYPE_LOCAL); @@ -1898,8 +1913,7 @@ copy_back() /* copy redo logs */ - dst_dir = (srv_log_group_home_dir && *srv_log_group_home_dir) - ? srv_log_group_home_dir : mysql_data_home; + dst_dir = dst_dir_buf.make(srv_log_group_home_dir); /* --backup generates a single ib_logfile0, which we must copy if it exists. */ @@ -1926,8 +1940,7 @@ copy_back() /* copy innodb system tablespace(s) */ - dst_dir = (innobase_data_home_dir && *innobase_data_home_dir) - ? innobase_data_home_dir : mysql_data_home; + dst_dir = dst_dir_buf.make(innobase_data_home_dir); ds_data = ds_create(dst_dir, DS_TYPE_LOCAL); diff --git a/mysql-test/suite/mariabackup/include/restart_and_restore.inc b/mysql-test/suite/mariabackup/include/restart_and_restore.inc index 2d1e5493957..aa26d28efba 100644 --- a/mysql-test/suite/mariabackup/include/restart_and_restore.inc +++ b/mysql-test/suite/mariabackup/include/restart_and_restore.inc @@ -4,5 +4,5 @@ echo # shutdown server; echo # remove datadir; rmdir $_datadir; echo # xtrabackup move back; -exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$_datadir --target-dir=$targetdir --parallel=2 --throttle=1; +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$_datadir --target-dir=$targetdir --parallel=2 --throttle=1 $backup_opts; --source include/start_mysqld.inc diff --git a/mysql-test/suite/mariabackup/relative_path.opt b/mysql-test/suite/mariabackup/relative_path.opt new file mode 100644 index 00000000000..3e3c33e44f8 --- /dev/null +++ b/mysql-test/suite/mariabackup/relative_path.opt @@ -0,0 +1 @@ +--innodb-undo-tablespaces=2 diff --git a/mysql-test/suite/mariabackup/relative_path.result b/mysql-test/suite/mariabackup/relative_path.result new file mode 100644 index 00000000000..7aa0c6968f3 --- /dev/null +++ b/mysql-test/suite/mariabackup/relative_path.result @@ -0,0 +1,20 @@ +CREATE TABLE t(i INT) ENGINE INNODB; +INSERT INTO t VALUES(1); +# xtrabackup backup +# xtrabackup prepare +# shutdown server +# remove datadir +# xtrabackup move back +# restart +# shutdown server +# remove datadir +# xtrabackup move back +# restart +# shutdown server +# remove datadir +# xtrabackup move back +# restart +SELECT * FROM t; +i +1 +DROP TABLE t; diff --git a/mysql-test/suite/mariabackup/relative_path.test b/mysql-test/suite/mariabackup/relative_path.test new file mode 100644 index 00000000000..bd25a217e71 --- /dev/null +++ b/mysql-test/suite/mariabackup/relative_path.test @@ -0,0 +1,35 @@ +--source include/have_innodb.inc + +CREATE TABLE t(i INT) ENGINE INNODB; +INSERT INTO t VALUES(1); + +echo # xtrabackup backup; +let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; +--let $backup_log=$MYSQLTEST_VARDIR/tmp/backup.log + +--disable_result_log +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir > $backup_log 2>&1; +--enable_result_log + +echo # xtrabackup prepare; +--disable_result_log +exec $XTRABACKUP --prepare --target-dir=$targetdir; + +# If MDEV-28187 is not fixed, the following tries to copy backup to data +# directory will fail, because their destination path will be the same as +# their source path + +--let $backup_opts=--innodb_undo_directory=./ +--source include/restart_and_restore.inc + +--let $backup_opts=--innodb_log_group_home_dir=./ +--source include/restart_and_restore.inc + +--let $backup_opts=--innodb_data_home_dir=./ +--source include/restart_and_restore.inc + +--enable_result_log + +SELECT * FROM t; +DROP TABLE t; +rmdir $targetdir; From c73a65f55bb5af8e27c556fa0e9258b26671ed9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 21 Mar 2023 14:33:54 +0200 Subject: [PATCH 058/260] MDEV-29692 Assertion `(writeptr + (i * size)) != local_frame' failed upon IMPORT TABLESPACE fil_iterate(): Allocation bitmap pages are never encrypted. Reviewed by: Thirunarayanan Balathandayuthapani --- .../suite/encryption/r/import_4k.result | 10 ++++++++++ mysql-test/suite/encryption/t/import_4k.opt | 1 + mysql-test/suite/encryption/t/import_4k.test | 20 +++++++++++++++++++ storage/innobase/row/row0import.cc | 6 ++++-- 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 mysql-test/suite/encryption/r/import_4k.result create mode 100644 mysql-test/suite/encryption/t/import_4k.opt create mode 100644 mysql-test/suite/encryption/t/import_4k.test diff --git a/mysql-test/suite/encryption/r/import_4k.result b/mysql-test/suite/encryption/r/import_4k.result new file mode 100644 index 00000000000..959e2498e00 --- /dev/null +++ b/mysql-test/suite/encryption/r/import_4k.result @@ -0,0 +1,10 @@ +set @save_limit = @@GLOBAL.innodb_limit_optimistic_insert_debug; +set global innodb_limit_optimistic_insert_debug=3; +create table t1 (a INT PRIMARY KEY) engine=InnoDB ENCRYPTED=YES; +insert into t1 select * from seq_1_to_6000; +flush table t1 for export; +unlock tables; +alter table t1 discard tablespace; +alter table t1 import tablespace; +set global innodb_limit_optimistic_insert_debug=@save_limit; +drop table t1; diff --git a/mysql-test/suite/encryption/t/import_4k.opt b/mysql-test/suite/encryption/t/import_4k.opt new file mode 100644 index 00000000000..e5b58602036 --- /dev/null +++ b/mysql-test/suite/encryption/t/import_4k.opt @@ -0,0 +1 @@ +--innodb-page-size=4k diff --git a/mysql-test/suite/encryption/t/import_4k.test b/mysql-test/suite/encryption/t/import_4k.test new file mode 100644 index 00000000000..aef7c702d12 --- /dev/null +++ b/mysql-test/suite/encryption/t/import_4k.test @@ -0,0 +1,20 @@ +--source include/have_innodb.inc +--source include/have_sequence.inc +--source include/have_example_key_management_plugin.inc +--source include/have_debug.inc + +set @save_limit = @@GLOBAL.innodb_limit_optimistic_insert_debug; +set global innodb_limit_optimistic_insert_debug=3; +create table t1 (a INT PRIMARY KEY) engine=InnoDB ENCRYPTED=YES; +insert into t1 select * from seq_1_to_6000; +flush table t1 for export; +--let $datadir= `select @@datadir` +--copy_file $datadir/test/t1.ibd $datadir/t1.ibd +--copy_file $datadir/test/t1.cfg $datadir/t1.cfg +unlock tables; +alter table t1 discard tablespace; +--move_file $datadir/t1.ibd $datadir/test/t1.ibd +--move_file $datadir/t1.cfg $datadir/test/t1.cfg +alter table t1 import tablespace; +set global innodb_limit_optimistic_insert_debug=@save_limit; +drop table t1; diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc index 2afe7661e20..c4534938ad5 100644 --- a/storage/innobase/row/row0import.cc +++ b/storage/innobase/row/row0import.cc @@ -3971,14 +3971,15 @@ page_corrupted: src + FIL_PAGE_SPACE_ID); } + const uint16_t type = fil_page_get_type(src); page_compressed = (full_crc32 && fil_space_t::is_compressed( callback.get_space_flags()) && buf_page_is_compressed( src, callback.get_space_flags())) - || (fil_page_is_compressed_encrypted(src) - || fil_page_is_compressed(src)); + || type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED + || type == FIL_PAGE_PAGE_COMPRESSED; if (page_compressed && block->page.zip.data) { goto page_corrupted; @@ -3997,6 +3998,7 @@ page_corrupted: block->page.zip.data = src; frame_changed = true; } else if (!page_compressed + && type != FIL_PAGE_TYPE_XDES && !block->page.zip.data) { block->frame = src; frame_changed = true; From e0560fc4cfa7b40dd3083a1b78c873ec51689cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 21 Mar 2023 14:36:38 +0200 Subject: [PATCH 059/260] Remove a bogus UNIV_ZIP_DEBUG check buf_LRU_block_remove_hashed(): Ever since commit 2e814d4702d71a04388386a9f591d14a35980bfe we could get page_zip_validate() failures after an ALTER TABLE operation was aborted and BtrBulk::pageCommit() had never been executed on some blocks. --- storage/innobase/buf/buf0lru.cc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc index 20625620332..0043f2c4343 100644 --- a/storage/innobase/buf/buf0lru.cc +++ b/storage/innobase/buf/buf0lru.cc @@ -1762,14 +1762,8 @@ buf_LRU_block_remove_hashed( break; case FIL_PAGE_TYPE_ZBLOB: case FIL_PAGE_TYPE_ZBLOB2: - break; case FIL_PAGE_INDEX: case FIL_PAGE_RTREE: -#if defined UNIV_ZIP_DEBUG && defined BTR_CUR_HASH_ADAPT - ut_a(page_zip_validate( - &bpage->zip, page, - ((buf_block_t*) bpage)->index)); -#endif /* UNIV_ZIP_DEBUG && BTR_CUR_HASH_ADAPT */ break; default: ib::error() << "The compressed page to be" From 7c91082e393f1817401b334b3d3584b401d909d7 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Wed, 18 Jan 2023 11:51:28 +1100 Subject: [PATCH 060/260] MDEV-27912 Fixing inconsistency w.r.t. expect files in tests. mtr uses group suffix, but some existing inc and test files use server_id for expect files. This patch aims to fix that. For spider: With this change we will not have to maintain a separate version of restart_mysqld.inc for spider, that duplicates code, just because spider tests use different names for expect files, and shutdown_mysqld requires magical names for them. With this change spider tests will also be able to use other features provided by restart_mysqld.inc without code duplication, like the parameter $restart_parameters (see e.g. the testcase mdev_29904.test in commit ef1161e5d4f). Tests run after this change: default, spider, rocksdb, galera, using the following command mtr --parallel=auto --force --max-test-fail=0 --skip-core-file mtr --suite spider,spider/*,spider/*/* \ --skip-test="spider/oracle.*|.*/t\..*" --parallel=auto --big-test \ --force --max-test-fail=0 --skip-core-file mtr --suite galera --parallel=auto mtr --suite rocksdb --parallel=auto --- mysql-test/include/expect_crash.inc | 4 ++-- mysql-test/include/kill_galera.inc | 4 ++-- mysql-test/include/kill_mysqld.inc | 4 ++-- mysql-test/include/shutdown_mysqld.inc | 4 ++-- mysql-test/main/shutdown.test | 4 ++-- mysql-test/suite/galera/include/kill_galera.inc | 4 ++-- mysql-test/suite/galera/include/shutdown_mysqld.inc | 4 ++-- mysql-test/suite/galera/t/galera_ist_restart_joiner.test | 4 ++-- mysql-test/suite/galera_3nodes_sr/t/GCF-832.test | 4 ++-- mysql-test/suite/innodb/t/alter_crash.test | 4 ++-- mysql-test/suite/innodb/t/innodb-alter-tempfile.test | 4 ++-- .../suite/innodb/t/innodb-change-buffer-recovery.test | 4 ++-- mysql-test/suite/innodb/t/innodb-wl5522-debug.test | 4 ++-- mysql-test/suite/innodb/t/purge_thread_shutdown.test | 4 ++-- mysql-test/suite/innodb/t/redo_log_during_checkpoint.test | 4 ++-- mysql-test/suite/innodb/t/restart.test | 2 -- mysql-test/suite/innodb/t/temporary_table.test | 4 ++-- mysql-test/suite/innodb_fts/t/sync.test | 3 ++- .../rocksdb/include/restart_mysqld_with_option.inc | 4 ++-- .../rocksdb/t/allow_to_start_after_corruption.test | 1 + .../rocksdb/mysql-test/rocksdb/t/persistent_cache.test | 4 ++-- .../rocksdb/mysql-test/rocksdb/t/validate_datadic.test | 4 ++-- .../t/rocksdb_rate_limiter_bytes_per_sec_basic.test | 4 ++-- .../mysql-test/spider/bugfix/include/restart_spider.inc | 8 -------- .../spider/mysql-test/spider/bugfix/r/mdev_29352.result | 1 + storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test | 2 +- 26 files changed, 45 insertions(+), 52 deletions(-) delete mode 100644 storage/spider/mysql-test/spider/bugfix/include/restart_spider.inc diff --git a/mysql-test/include/expect_crash.inc b/mysql-test/include/expect_crash.inc index af8b0908104..b4bd9828a08 100644 --- a/mysql-test/include/expect_crash.inc +++ b/mysql-test/include/expect_crash.inc @@ -1,5 +1,5 @@ ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect # There should be a debug crash after using this .inc file --exec echo "wait" > $_expect_file_name diff --git a/mysql-test/include/kill_galera.inc b/mysql-test/include/kill_galera.inc index d7f665df6c7..aba672d8a89 100644 --- a/mysql-test/include/kill_galera.inc +++ b/mysql-test/include/kill_galera.inc @@ -1,8 +1,8 @@ --echo Killing server ... # Write file to make mysql-test-run.pl expect the crash, but don't start it ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo "wait" > $_expect_file_name # Kill the connected server diff --git a/mysql-test/include/kill_mysqld.inc b/mysql-test/include/kill_mysqld.inc index 86ee048a0f1..01ee7f82bdc 100644 --- a/mysql-test/include/kill_mysqld.inc +++ b/mysql-test/include/kill_mysqld.inc @@ -1,5 +1,5 @@ ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --echo # Kill the server --exec echo "wait" > $_expect_file_name diff --git a/mysql-test/include/shutdown_mysqld.inc b/mysql-test/include/shutdown_mysqld.inc index 74a3028946d..9518b880e89 100644 --- a/mysql-test/include/shutdown_mysqld.inc +++ b/mysql-test/include/shutdown_mysqld.inc @@ -22,8 +22,8 @@ if ($rpl_inited) } # Write file to make mysql-test-run.pl expect the "crash", but don't start it ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo "wait" > $_expect_file_name --let $server_shutdown_timeout= 60 diff --git a/mysql-test/main/shutdown.test b/mysql-test/main/shutdown.test index b670cfc2699..1e9d8e9ba92 100644 --- a/mysql-test/main/shutdown.test +++ b/mysql-test/main/shutdown.test @@ -18,8 +18,8 @@ disconnect c1; create procedure try_shutdown() shutdown; drop procedure try_shutdown; ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo "wait" > $_expect_file_name --send shutdown diff --git a/mysql-test/suite/galera/include/kill_galera.inc b/mysql-test/suite/galera/include/kill_galera.inc index 56118df84f9..28a1b0f368c 100644 --- a/mysql-test/suite/galera/include/kill_galera.inc +++ b/mysql-test/suite/galera/include/kill_galera.inc @@ -6,8 +6,8 @@ if (!$kill_signal) } # Write file to make mysql-test-run.pl expect the crash, but don't start it ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo "wait" > $_expect_file_name # Kill the connected server diff --git a/mysql-test/suite/galera/include/shutdown_mysqld.inc b/mysql-test/suite/galera/include/shutdown_mysqld.inc index 54bba1318e7..793be8d76ac 100644 --- a/mysql-test/suite/galera/include/shutdown_mysqld.inc +++ b/mysql-test/suite/galera/include/shutdown_mysqld.inc @@ -8,8 +8,8 @@ if ($rpl_inited) } # Write file to make mysql-test-run.pl expect the "crash", but don't start it ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo "wait" > $_expect_file_name # Send shutdown to the connected server diff --git a/mysql-test/suite/galera/t/galera_ist_restart_joiner.test b/mysql-test/suite/galera/t/galera_ist_restart_joiner.test index c535ac455b9..b36a0de57b6 100644 --- a/mysql-test/suite/galera/t/galera_ist_restart_joiner.test +++ b/mysql-test/suite/galera/t/galera_ist_restart_joiner.test @@ -35,8 +35,8 @@ UPDATE t1 SET f2 = 'c' WHERE f1 > 2; --connection node_2 # Write file to make mysql-test-run.pl expect the crash, but don't start it ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo "wait" > $_expect_file_name --let KILL_NODE_PIDFILE = `SELECT @@pid_file` diff --git a/mysql-test/suite/galera_3nodes_sr/t/GCF-832.test b/mysql-test/suite/galera_3nodes_sr/t/GCF-832.test index eb7f5603452..ab8b62b969a 100644 --- a/mysql-test/suite/galera_3nodes_sr/t/GCF-832.test +++ b/mysql-test/suite/galera_3nodes_sr/t/GCF-832.test @@ -15,8 +15,8 @@ --connection node_2 SET GLOBAL debug_dbug="d,crash_last_fragment_commit_after_fragment_removal"; ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo "wait" > $_expect_file_name CREATE TABLE t1 (f1 VARCHAR(30)) ENGINE=InnoDB; diff --git a/mysql-test/suite/innodb/t/alter_crash.test b/mysql-test/suite/innodb/t/alter_crash.test index 7a2f4452f4d..6f6a6dc5cbc 100644 --- a/mysql-test/suite/innodb/t/alter_crash.test +++ b/mysql-test/suite/innodb/t/alter_crash.test @@ -51,8 +51,8 @@ let $MYSQLD_DATADIR= `select @@datadir`; let datadir= `select @@datadir`; # These are from include/shutdown_mysqld.inc and allow to call start_mysqld.inc ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --echo # --echo # Bug #14669848 CRASH DURING ALTER MAKES ORIGINAL TABLE INACCESSIBLE diff --git a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test index dac176f3b77..26576129a16 100644 --- a/mysql-test/suite/innodb/t/innodb-alter-tempfile.test +++ b/mysql-test/suite/innodb/t/innodb-alter-tempfile.test @@ -29,8 +29,8 @@ call mtr.add_suppression("InnoDB could not find key no 1 with name f2 from dict let datadir= `select @@datadir`; ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name=$MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect CREATE TABLE t1 (f1 INT NOT NULL, f2 INT NOT NULL) ENGINE=innodb; SET debug_dbug='+d,innodb_alter_commit_crash_before_commit'; diff --git a/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test b/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test index 79d9cc814a0..2f0377ff80e 100644 --- a/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test +++ b/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test @@ -25,8 +25,8 @@ CREATE TABLE t1( INDEX(b)) ENGINE=InnoDB STATS_PERSISTENT=0; ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect # The flag innodb_change_buffering_debug is only available in debug builds. # It instructs InnoDB to try to evict pages from the buffer pool when diff --git a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test index 79ea4753904..272afc0a2ba 100644 --- a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test +++ b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test @@ -37,8 +37,8 @@ SET GLOBAL innodb_file_per_table = 1; CREATE TABLE t1 (c1 INT) ENGINE = InnoDB; INSERT INTO t1 VALUES(1),(2),(3); ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo wait > $_expect_file_name SET SESSION debug_dbug="+d,ib_discard_before_commit_crash"; diff --git a/mysql-test/suite/innodb/t/purge_thread_shutdown.test b/mysql-test/suite/innodb/t/purge_thread_shutdown.test index 5be29b7a6a3..762336cf0d1 100644 --- a/mysql-test/suite/innodb/t/purge_thread_shutdown.test +++ b/mysql-test/suite/innodb/t/purge_thread_shutdown.test @@ -12,8 +12,8 @@ select user,state from information_schema.processlist order by 2; set global debug_dbug='+d,only_kill_system_threads'; set global innodb_fast_shutdown=0; -let $_server_id= `SELECT @@server_id`; -let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect; +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect exec echo "wait" > $_expect_file_name; send shutdown; diff --git a/mysql-test/suite/innodb/t/redo_log_during_checkpoint.test b/mysql-test/suite/innodb/t/redo_log_during_checkpoint.test index 645ae8c7855..fcacd9a10d4 100644 --- a/mysql-test/suite/innodb/t/redo_log_during_checkpoint.test +++ b/mysql-test/suite/innodb/t/redo_log_during_checkpoint.test @@ -30,8 +30,8 @@ while ($i) } --enable_query_log ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo "wait" > $_expect_file_name SET debug_dbug = '+d,increase_mtr_checkpoint_size'; diff --git a/mysql-test/suite/innodb/t/restart.test b/mysql-test/suite/innodb/t/restart.test index 32058b3abf5..3e726c971ab 100644 --- a/mysql-test/suite/innodb/t/restart.test +++ b/mysql-test/suite/innodb/t/restart.test @@ -110,8 +110,6 @@ SET GLOBAL innodb_buffer_pool_size = @innodb_buffer_pool_size_orig; --echo # --let MYSQLD_DATADIR= `SELECT @@datadir` ---let SERVER_ID= `SELECT @@server_id` ---let EXPECT_FILE_NAME= $MYSQLTEST_VARDIR/tmp/mysqld.$SERVER_ID.expect --source include/shutdown_mysqld.inc diff --git a/mysql-test/suite/innodb/t/temporary_table.test b/mysql-test/suite/innodb/t/temporary_table.test index cc290b03c34..0549bab2779 100644 --- a/mysql-test/suite/innodb/t/temporary_table.test +++ b/mysql-test/suite/innodb/t/temporary_table.test @@ -11,7 +11,7 @@ --source include/no_valgrind_without_big.inc --disable_query_log -call mtr.add_suppression("Can't create/write to file '/dev/null/nonexistent/ib"); +call mtr.add_suppression("Can't create/write to file '/dev/null/.*/ib"); call mtr.add_suppression("InnoDB: Unable to create temporary file"); call mtr.add_suppression("last file in setting innodb_temp_data_file_path"); call mtr.add_suppression("The table 't1' is full"); @@ -134,7 +134,7 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED'); # We cannot use include/restart_mysqld.inc in this particular test, # because SHOW STATUS would fail due to unwritable (nonexistent) tmpdir. --source include/shutdown_mysqld.inc ---exec echo "restart: --tmpdir=/dev/null/nonexistent" > $_expect_file_name +--exec echo "restart: --tmpdir=/dev/null/$MYSQL_TMP_DIR" > $_expect_file_name --enable_reconnect --disable_result_log --disable_query_log diff --git a/mysql-test/suite/innodb_fts/t/sync.test b/mysql-test/suite/innodb_fts/t/sync.test index 3bd5b56a21b..e4f04ef4269 100644 --- a/mysql-test/suite/innodb_fts/t/sync.test +++ b/mysql-test/suite/innodb_fts/t/sync.test @@ -104,7 +104,8 @@ disconnect con1; DROP TABLE t1; --echo # Case 3: Test insert crash recovery ---let $_expect_file_name=$MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect CREATE TABLE t1 ( FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, diff --git a/storage/rocksdb/mysql-test/rocksdb/include/restart_mysqld_with_option.inc b/storage/rocksdb/mysql-test/rocksdb/include/restart_mysqld_with_option.inc index 81cd2200ae0..a87fe01b3a1 100644 --- a/storage/rocksdb/mysql-test/rocksdb/include/restart_mysqld_with_option.inc +++ b/storage/rocksdb/mysql-test/rocksdb/include/restart_mysqld_with_option.inc @@ -9,8 +9,8 @@ if ($rpl_inited) # Write file to make mysql-test-run.pl expect the "crash", but don't start # it until it's told to ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo "wait" > $_expect_file_name # Send shutdown to the connected server and give diff --git a/storage/rocksdb/mysql-test/rocksdb/t/allow_to_start_after_corruption.test b/storage/rocksdb/mysql-test/rocksdb/t/allow_to_start_after_corruption.test index e084b57fbda..88a02c469bb 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/allow_to_start_after_corruption.test +++ b/storage/rocksdb/mysql-test/rocksdb/t/allow_to_start_after_corruption.test @@ -16,6 +16,7 @@ # restart server to change error log and ignore corruptopn on startup --let $_mysqld_option=--log-error=$LOG --rocksdb_allow_to_start_after_corruption=1 --source include/restart_mysqld_with_option.inc +--let $_server_id= `SELECT @@server_id` --echo # --echo # Test server crashes on corrupted data and restarts diff --git a/storage/rocksdb/mysql-test/rocksdb/t/persistent_cache.test b/storage/rocksdb/mysql-test/rocksdb/t/persistent_cache.test index 49e5e5c1172..da9d8602c01 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/persistent_cache.test +++ b/storage/rocksdb/mysql-test/rocksdb/t/persistent_cache.test @@ -4,8 +4,8 @@ DROP TABLE IF EXISTS t1; --enable_warnings ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --let $_cache_file_name= $MYSQLTEST_VARDIR/tmp/persistent_cache --exec echo "wait" >$_expect_file_name diff --git a/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test b/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test index e7ab37d2658..b2647b38e08 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test +++ b/storage/rocksdb/mysql-test/rocksdb/t/validate_datadic.test @@ -17,8 +17,8 @@ CREATE TABLE t2 (pk int primary key) ENGINE=ROCKSDB PARTITION BY KEY(pk) PARTITI # Write file to make mysql-test-run.pl expect the "crash", but don't restart the # server until it is told to ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --let LOG=$MYSQLTEST_VARDIR/tmp/validate_datadic.err --exec echo "wait" >$_expect_file_name diff --git a/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_rate_limiter_bytes_per_sec_basic.test b/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_rate_limiter_bytes_per_sec_basic.test index 743f942af9c..1daa9898c1a 100644 --- a/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_rate_limiter_bytes_per_sec_basic.test +++ b/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_rate_limiter_bytes_per_sec_basic.test @@ -7,8 +7,8 @@ SET @@global.rocksdb_rate_limiter_bytes_per_sec = 10000; # Write file to make mysql-test-run.pl expect the "crash", but don't restart the # server until it is told to ---let $_server_id= `SELECT @@server_id` ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--let $_expect_file_name= `select regexp_replace(@@tmpdir, '^.*/','')` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/$_expect_file_name.expect --exec echo "wait" >$_expect_file_name # Send shutdown to the connected server and give it 10 seconds to die before diff --git a/storage/spider/mysql-test/spider/bugfix/include/restart_spider.inc b/storage/spider/mysql-test/spider/bugfix/include/restart_spider.inc deleted file mode 100644 index a5446a6188d..00000000000 --- a/storage/spider/mysql-test/spider/bugfix/include/restart_spider.inc +++ /dev/null @@ -1,8 +0,0 @@ ---let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.1.expect - ---exec echo "wait" > $_expect_file_name ---shutdown_server ---source include/wait_until_disconnected.inc ---exec echo "restart" > $_expect_file_name ---enable_reconnect ---source include/wait_until_connected_again.inc diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29352.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29352.result index 5715edf2bd6..975d3834d42 100644 --- a/storage/spider/mysql-test/spider/bugfix/r/mdev_29352.result +++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29352.result @@ -9,4 +9,5 @@ CREATE FUNCTION spider_bg_direct_sql RETURNS INT SONAME 'ha_spider.so'; ERROR HY000: Can't execute the query because you have a conflicting read lock SELECT * FROM t; c +# restart DROP TABLE t; diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test index 00d8ee73ebc..626364efb99 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29352.test @@ -6,6 +6,6 @@ FLUSH TABLES WITH READ LOCK; CREATE FUNCTION spider_bg_direct_sql RETURNS INT SONAME 'ha_spider.so'; SELECT * FROM t; ---source include/restart_spider.inc +--source include/restart_mysqld.inc DROP TABLE t; From ff3d4395d808b6421d2e0714e10d48c7aa2f3c3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 22 Mar 2023 14:31:00 +0200 Subject: [PATCH 061/260] MDEV-30882 Crash on ROLLBACK in a ROW_FORMAT=COMPRESSED table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit row_upd_rec_in_place(): Avoid calling page_zip_write_rec() if we are not modifying any fields that are stored in compressed format. btr_cur_update_in_place_zip_check(): New function to check if a ROW_FORMAT=COMPRESSED record can actually be updated in place. btr_cur_pessimistic_update(): If the BTR_KEEP_POS_FLAG is not set (we are in a ROLLBACK and cannot write any BLOBs), ignore the potential overflow and let page_zip_reorganize() or page_zip_compress() handle it. This avoids a failure when an attempted UPDATE of an NULL column to 0 is rolled back. During the ROLLBACK, we would try to move a non-updated long column to off-page storage in order to avoid a compression failure of the ROW_FORMAT=COMPRESSED page. page_zip_write_trx_id_and_roll_ptr(): Remove an assertion that would fail in row_upd_rec_in_place() because the uncompressed page would already have been modified there. Thanks to Jean-François Gagné for providing a copy of a page that triggered these bugs on the ROLLBACK of UPDATE and DELETE. A 10.6 version of this was tested by Matthias Leich using cmake -DWITH_INNODB_EXTRA_DEBUG=ON a.k.a. UNIV_ZIP_DEBUG. --- storage/innobase/btr/btr0cur.cc | 69 +++++++++++++++++++++++++------ storage/innobase/page/page0zip.cc | 3 -- storage/innobase/row/row0upd.cc | 37 ++++++++++++++++- 3 files changed, 92 insertions(+), 17 deletions(-) diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 3164352892e..d4e1497d9b3 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -4210,6 +4210,52 @@ out_of_space: return(false); } +/** Check if a ROW_FORMAT=COMPRESSED page can be updated in place +@param cur cursor pointing to ROW_FORMAT=COMPRESSED page +@param offsets rec_get_offsets(btr_cur_get_rec(cur)) +@param update index fields being updated +@param mtr mini-transaction +@return the record in the ROW_FORMAT=COMPRESSED page +@retval nullptr if the page cannot be updated in place */ +ATTRIBUTE_COLD static +rec_t *btr_cur_update_in_place_zip_check(btr_cur_t *cur, rec_offs *offsets, + const upd_t& update, mtr_t *mtr) +{ + dict_index_t *index= cur->index; + ut_ad(!index->table->is_temporary()); + + switch (update.n_fields) { + case 0: + /* We are only changing the delete-mark flag. */ + break; + case 1: + if (!index->is_clust() || + update.fields[0].field_no != index->db_roll_ptr()) + goto check_for_overflow; + /* We are only changing the delete-mark flag and DB_ROLL_PTR. */ + break; + case 2: + if (!index->is_clust() || + update.fields[0].field_no != index->db_trx_id() || + update.fields[1].field_no != index->db_roll_ptr()) + goto check_for_overflow; + /* We are only changing DB_TRX_ID, DB_ROLL_PTR, and the delete-mark. + They can be updated in place in the uncompressed part of the + ROW_FORMAT=COMPRESSED page. */ + break; + check_for_overflow: + default: + if (!btr_cur_update_alloc_zip(btr_cur_get_page_zip(cur), + btr_cur_get_page_cur(cur), + index, + offsets, rec_offs_size(offsets), + false, mtr)) + return nullptr; + } + + return btr_cur_get_rec(cur); +} + /*************************************************************//** Updates a record when the update causes no size changes in its fields. We assume here that the ordering fields of the record do not change. @@ -4271,17 +4317,10 @@ btr_cur_update_in_place( page_zip = buf_block_get_page_zip(block); /* Check that enough space is available on the compressed page. */ - if (page_zip) { - ut_ad(!index->table->is_temporary()); - - if (!btr_cur_update_alloc_zip( - page_zip, btr_cur_get_page_cur(cursor), - index, offsets, rec_offs_size(offsets), - false, mtr)) { - return(DB_ZIP_OVERFLOW); - } - - rec = btr_cur_get_rec(cursor); + if (UNIV_LIKELY_NULL(page_zip) + && !(rec = btr_cur_update_in_place_zip_check( + cursor, offsets, *update, mtr))) { + return DB_ZIP_OVERFLOW; } /* Do lock checking and undo logging */ @@ -5034,7 +5073,13 @@ btr_cur_pessimistic_update( ut_ad(page_is_leaf(page)); ut_ad(dict_index_is_clust(index)); - ut_ad(flags & BTR_KEEP_POS_FLAG); + if (UNIV_UNLIKELY(!(flags & BTR_KEEP_POS_FLAG))) { + ut_ad(page_zip != NULL); + dtuple_convert_back_big_rec(index, new_entry, + big_rec_vec); + big_rec_vec = NULL; + n_ext = dtuple_get_n_ext(new_entry); + } } /* Do lock checking and undo logging */ diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index 13c6f58a171..742c91606b2 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -4132,9 +4132,6 @@ page_zip_write_trx_id_and_roll_ptr( ut_ad(field + DATA_TRX_ID_LEN == rec_get_nth_field(rec, offsets, trx_id_col + 1, &len)); ut_ad(len == DATA_ROLL_PTR_LEN); -#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG - ut_a(!memcmp(storage, field, DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN)); -#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ compile_time_assert(DATA_TRX_ID_LEN == 6); mach_write_to_6(field, trx_id); compile_time_assert(DATA_ROLL_PTR_LEN == 7); diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc index c7087559f47..0ea7aea7fb1 100644 --- a/storage/innobase/row/row0upd.cc +++ b/storage/innobase/row/row0upd.cc @@ -692,9 +692,42 @@ row_upd_rec_in_place( dfield_get_len(new_val)); } - if (page_zip) { - page_zip_write_rec(page_zip, rec, index, offsets, 0); + if (UNIV_LIKELY(!page_zip)) { + return; } + + switch (update->n_fields) { + case 0: + /* We only changed the delete-mark flag. */ + update_del_mark: + page_zip_rec_set_deleted(page_zip, rec, + rec_get_deleted_flag(rec, true)); + return; + case 1: + if (!index->is_clust() + || update->fields[0].field_no != index->db_roll_ptr()) { + break; + } + goto update_sys; + case 2: + if (!index->is_clust() + || update->fields[0].field_no != index->db_trx_id() + || update->fields[1].field_no != index->db_roll_ptr()) { + break; + } + update_sys: + ulint len; + const byte* sys = rec_get_nth_field(rec, offsets, + index->db_trx_id(), &len); + ut_ad(len == DATA_TRX_ID_LEN); + page_zip_write_trx_id_and_roll_ptr( + page_zip, rec, offsets, index->db_trx_id(), + trx_read_trx_id(sys), + trx_read_roll_ptr(sys + DATA_TRX_ID_LEN)); + goto update_del_mark; + } + + page_zip_write_rec(page_zip, rec, index, offsets, 0); } /*********************************************************************//** From c596ad734daad090a766d71ef0446444fdc83904 Mon Sep 17 00:00:00 2001 From: Anel Husakovic Date: Wed, 8 Mar 2023 12:59:50 +0100 Subject: [PATCH 062/260] MDEV-30269: Remove rpl_semi_sync_[slave,master] usage in code - Description: - Before 10.3.8 semisync was a plugin that is built into the server with MDEV-13073,starting with commit cbc71485e24c31fc822277625512e55c2a8b650b. There are still some usage of `rpl_semi_sync_master` in mtr. Note: - To recognize the replica in the `dump_thread`, replica is creating local variable `rpl_semi_sync_slave` (the keyword of plugin) in function `request_transmit`, that is catched by primary in `is_semi_sync_slave()`. This is the user variable and as such not related to the obsolete plugin. - Found in `sys_vars.all_vars` and `rpl_semi_sync_wait_point` tests, usage of plugins `rpl_semi_sync_master`, `rpl_semi_sync_slave`. The former test is disabled by default (`sys_vars/disabled.def`) and marked as `obsolete`, however this patch will remove the queries. - Add cosmetic fixes to semisync codebase Reviewer: Closes PR #2528, PR #2380 --- mysql-test/suite/rpl/r/rpl_semi_sync_wait_point.result | 2 -- mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.test | 2 -- mysql-test/suite/sys_vars/t/all_vars.test | 2 -- sql/semisync_master.cc | 6 ++---- sql/sql_repl.cc | 2 +- 5 files changed, 3 insertions(+), 11 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_wait_point.result b/mysql-test/suite/rpl/r/rpl_semi_sync_wait_point.result index a0ea06afa89..c303abc672c 100644 --- a/mysql-test/suite/rpl/r/rpl_semi_sync_wait_point.result +++ b/mysql-test/suite/rpl/r/rpl_semi_sync_wait_point.result @@ -7,8 +7,6 @@ SET @@global.rpl_semi_sync_master_timeout = 60000; SET @@global.rpl_semi_sync_master_wait_no_slave = 1; # It's okay to see "Killed" but we should not see "Timeout" in the log. call mtr.add_suppression("Killed waiting for reply of binlog"); -call mtr.add_suppression("Run function 'after_commit' in plugin 'rpl_semi_sync_master' failed"); -call mtr.add_suppression("Run function 'after_sync' in plugin 'rpl_semi_sync_master' failed"); # # Test wait point = AFTER_COMMIT # diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.test b/mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.test index dcff4030fdb..5eae91a55f2 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_wait_point.test @@ -23,8 +23,6 @@ SET @@global.rpl_semi_sync_master_wait_no_slave = 1; --echo # It's okay to see "Killed" but we should not see "Timeout" in the log. call mtr.add_suppression("Killed waiting for reply of binlog"); -call mtr.add_suppression("Run function 'after_commit' in plugin 'rpl_semi_sync_master' failed"); -call mtr.add_suppression("Run function 'after_sync' in plugin 'rpl_semi_sync_master' failed"); --echo # --echo # Test wait point = AFTER_COMMIT diff --git a/mysql-test/suite/sys_vars/t/all_vars.test b/mysql-test/suite/sys_vars/t/all_vars.test index c0127e1ef12..570c0f140de 100644 --- a/mysql-test/suite/sys_vars/t/all_vars.test +++ b/mysql-test/suite/sys_vars/t/all_vars.test @@ -13,8 +13,6 @@ eval INSTALL PLUGIN federated SONAME "$HA_FEDERATEDX_SO"; eval INSTALL PLUGIN oqgraph SONAME "$HA_OQGRAPH_SO"; eval INSTALL PLUGIN sphinx SONAME "$HA_SPHINX_SO"; eval INSTALL PLUGIN innodb SONAME "$HA_INNODB_SO"; -eval INSTALL PLUGIN rpl_semi_sync_master SONAME "$SEMISYNC_MASTER_SO"; -eval INSTALL PLUGIN rpl_semi_sync_slave SONAME "$SEMISYNC_SLAVE_SO"; --enable_abort_on_error --enable_result_log --enable_query_log diff --git a/sql/semisync_master.cc b/sql/semisync_master.cc index ee4a0161085..63a50539e50 100644 --- a/sql/semisync_master.cc +++ b/sql/semisync_master.cc @@ -317,8 +317,8 @@ void Active_tranx::clear_active_tranx_nodes(const char *log_file_name, /******************************************************************************* * - * class: the basic code layer for syncsync master. - * class: the basic code layer for syncsync slave. + * class: the basic code layer for semisync master. + * class: the basic code layer for semisync slave. * * The most important functions during semi-syn replication listed: * @@ -809,8 +809,6 @@ void Repl_semi_sync_master::dump_end(THD* thd) remove_slave(); ack_receiver.remove_slave(thd); - - return; } int Repl_semi_sync_master::commit_trx(const char* trx_wait_binlog_name, diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 82663c3ca2c..d9b93742195 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -433,7 +433,7 @@ static int send_file(THD *thd) /** Internal to mysql_binlog_send() routine that recalculates checksum for - 1. FD event (asserted) that needs additional arranment prior sending to slave. + 1. FD event (asserted) that needs additional arrangement prior sending to slave. 2. Start_encryption_log_event whose Ignored flag is set TODO DBUG_ASSERT can be removed if this function is used for more general cases */ From bdf5580611f8a052b21227666f38107936f7f771 Mon Sep 17 00:00:00 2001 From: Aleksey Midenkov Date: Thu, 23 Mar 2023 21:07:32 +0300 Subject: [PATCH 063/260] MDEV-30421 rpl_parallel.test cleanup Moved rpl_parallel.inc to rpl_parallel.test --- .../suite/binlog_encryption/rpl_parallel.test | 2 +- mysql-test/suite/rpl/include/rpl_parallel.inc | 2218 ---------------- mysql-test/suite/rpl/t/rpl_parallel.test | 2219 ++++++++++++++++- 3 files changed, 2219 insertions(+), 2220 deletions(-) delete mode 100644 mysql-test/suite/rpl/include/rpl_parallel.inc diff --git a/mysql-test/suite/binlog_encryption/rpl_parallel.test b/mysql-test/suite/binlog_encryption/rpl_parallel.test index dba54e4fd7a..9985e237965 100644 --- a/mysql-test/suite/binlog_encryption/rpl_parallel.test +++ b/mysql-test/suite/binlog_encryption/rpl_parallel.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_parallel.inc +--source suite/rpl/t/rpl_parallel.test diff --git a/mysql-test/suite/rpl/include/rpl_parallel.inc b/mysql-test/suite/rpl/include/rpl_parallel.inc deleted file mode 100644 index 9ba7a30f2eb..00000000000 --- a/mysql-test/suite/rpl/include/rpl_parallel.inc +++ /dev/null @@ -1,2218 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - ---source include/have_innodb.inc ---source include/have_debug.inc ---source include/have_debug_sync.inc ---source include/master-slave.inc - -# Test various aspects of parallel replication. - ---connection server_2 -SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; ---error ER_SLAVE_MUST_STOP -SET GLOBAL slave_parallel_threads=10; ---source include/stop_slave.inc -SET GLOBAL slave_parallel_threads=10; - -# Check that we do not spawn any worker threads when no slave is running. -SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; - -CHANGE MASTER TO master_use_gtid=slave_pos; ---source include/start_slave.inc - -# Check that worker threads get spawned when slave starts. -SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; -# ... and that worker threads get removed when slave stops. ---source include/stop_slave.inc -SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; ---source include/start_slave.inc -SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; - ---echo *** Test long-running query in domain 1 can run in parallel with short queries in domain 0 *** - ---connection server_1 -ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; -CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM; -CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB; -INSERT INTO t1 VALUES (1); -INSERT INTO t2 VALUES (1); ---save_master_pos - ---connection server_2 ---sync_with_master - -# Block the table t1 to simulate a replicated query taking a long time. ---connect (con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_2,) -LOCK TABLE t1 WRITE; - ---connection server_1 -SET gtid_domain_id=1; -# This query will be blocked on the slave until UNLOCK TABLES. -INSERT INTO t1 VALUES (2); -SET gtid_domain_id=0; -# These t2 queries can be replicated in parallel with the prior t1 query, as -# they are in a separate replication domain. -INSERT INTO t2 VALUES (2); -INSERT INTO t2 VALUES (3); -BEGIN; -INSERT INTO t2 VALUES (4); -INSERT INTO t2 VALUES (5); -COMMIT; -INSERT INTO t2 VALUES (6); - ---connection server_2 ---let $wait_condition= SELECT COUNT(*) = 6 FROM t2 ---source include/wait_condition.inc - -SELECT * FROM t2 ORDER by a; - ---connection con_temp1 -SELECT * FROM t1; -UNLOCK TABLES; - ---connection server_2 ---let $wait_condition= SELECT COUNT(*) = 2 FROM t1 ---source include/wait_condition.inc - -SELECT * FROM t1 ORDER BY a; - - ---echo *** Test two transactions in different domains committed in opposite order on slave but in a single group commit. *** ---connection server_2 ---source include/stop_slave.inc - ---connection server_1 -# Use a stored function to inject a debug_sync into the appropriate THD. -# The function does nothing on the master, and on the slave it injects the -# desired debug_sync action(s). -SET sql_log_bin=0; ---delimiter || -CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) - RETURNS INT DETERMINISTIC - BEGIN - RETURN x; - END -|| ---delimiter ; -SET sql_log_bin=1; - -SET @old_format= @@SESSION.binlog_format; -SET binlog_format='statement'; -SET gtid_domain_id=1; -INSERT INTO t2 VALUES (foo(10, - 'commit_before_enqueue SIGNAL ready1 WAIT_FOR cont1', - 'commit_after_release_LOCK_prepare_ordered SIGNAL ready2')); - ---connection server_2 -FLUSH LOGS; ---source include/wait_for_binlog_checkpoint.inc -SET sql_log_bin=0; ---delimiter || -CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) - RETURNS INT DETERMINISTIC - BEGIN - IF d1 != '' THEN - SET debug_sync = d1; - END IF; - IF d2 != '' THEN - SET debug_sync = d2; - END IF; - RETURN x; - END -|| ---delimiter ; -SET sql_log_bin=1; -SET @old_format=@@GLOBAL.binlog_format; -SET GLOBAL binlog_format=statement; -# We need to restart all parallel threads for the new global setting to -# be copied to the session-level values. -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=10; ---source include/start_slave.inc - -# First make sure the first insert is ready to commit, but not queued yet. -SET debug_sync='now WAIT_FOR ready1'; - ---connection server_1 -SET gtid_domain_id=2; -INSERT INTO t2 VALUES (foo(11, - 'commit_before_enqueue SIGNAL ready3 WAIT_FOR cont3', - 'commit_after_release_LOCK_prepare_ordered SIGNAL ready4 WAIT_FOR cont4')); -SET gtid_domain_id=0; -SELECT * FROM t2 WHERE a >= 10 ORDER BY a; - ---connection server_2 -# Now wait for the second insert to queue itself as the leader, and then -# wait for more commits to queue up. -SET debug_sync='now WAIT_FOR ready3'; -SET debug_sync='now SIGNAL cont3'; -SET debug_sync='now WAIT_FOR ready4'; -# Now allow the first insert to queue up to participate in group commit. -SET debug_sync='now SIGNAL cont1'; -SET debug_sync='now WAIT_FOR ready2'; -# Finally allow the second insert to proceed and do the group commit. -SET debug_sync='now SIGNAL cont4'; - ---let $wait_condition= SELECT COUNT(*) = 2 FROM t2 WHERE a >= 10 ---source include/wait_condition.inc -SELECT * FROM t2 WHERE a >= 10 ORDER BY a; -# The two INSERT transactions should have been committed in opposite order, -# but in the same group commit (seen by precense of cid=# in the SHOW -# BINLOG output). ---let $binlog_file= slave-bin.000002 ---source include/show_binlog_events.inc -FLUSH LOGS; ---source include/wait_for_binlog_checkpoint.inc - -# Restart all the slave parallel worker threads, to clear all debug_sync actions. ---connection server_2 ---source include/stop_slave.inc -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=10; -SET debug_sync='RESET'; ---source include/start_slave.inc - - ---echo *** Test that group-committed transactions on the master can replicate in parallel on the slave. *** ---connection server_1 -SET debug_sync='RESET'; -FLUSH LOGS; ---source include/wait_for_binlog_checkpoint.inc -CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB; -# Create some sentinel rows so that the rows inserted in parallel fall into -# separate gaps and do not cause gap lock conflicts. -INSERT INTO t3 VALUES (1,1), (3,3), (5,5), (7,7); ---save_master_pos ---connection server_2 ---sync_with_master - -# We want to test that the transactions can execute out-of-order on -# the slave, but still end up committing in-order, and in a single -# group commit. -# -# The idea is to group-commit three transactions together on the master: -# A, B, and C. On the slave, C will execute the insert first, then A, -# and then B. But B manages to complete before A has time to commit, so -# all three end up committing together. -# -# So we start by setting up some row locks that will block transactions -# A and B from executing, allowing C to run first. - ---connection con_temp1 -BEGIN; -INSERT INTO t3 VALUES (2,102); ---connect (con_temp2,127.0.0.1,root,,test,$SERVER_MYPORT_2,) -BEGIN; -INSERT INTO t3 VALUES (4,104); - -# On the master, queue three INSERT transactions as a single group commit. ---connect (con_temp3,127.0.0.1,root,,test,$SERVER_MYPORT_1,) -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; -SET binlog_format=statement; -send INSERT INTO t3 VALUES (2, foo(12, - 'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued1 WAIT_FOR slave_cont1', - '')); - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued1'; - ---connect (con_temp4,127.0.0.1,root,,test,$SERVER_MYPORT_1,) -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; -SET binlog_format=statement; -send INSERT INTO t3 VALUES (4, foo(14, - 'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued2', - '')); - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued2'; - ---connect (con_temp5,127.0.0.1,root,,test,$SERVER_MYPORT_1,) -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3'; -SET binlog_format=statement; -send INSERT INTO t3 VALUES (6, foo(16, - 'group_commit_waiting_for_prior SIGNAL slave_queued3', - '')); - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued3'; -SET debug_sync='now SIGNAL master_cont1'; - ---connection con_temp3 -REAP; ---connection con_temp4 -REAP; ---connection con_temp5 -REAP; -SET debug_sync='RESET'; - ---connection server_1 -SELECT * FROM t3 ORDER BY a; ---let $binlog_file= master-bin.000002 ---source include/show_binlog_events.inc - -# First, wait until insert 3 is ready to queue up for group commit, but is -# waiting for insert 2 to commit before it can do so itself. ---connection server_2 -SET debug_sync='now WAIT_FOR slave_queued3'; - -# Next, let insert 1 proceed, and allow it to queue up as the group commit -# leader, but let it wait for insert 2 to also queue up before proceeding. ---connection con_temp1 -ROLLBACK; ---connection server_2 -SET debug_sync='now WAIT_FOR slave_queued1'; - -# Now let insert 2 proceed and queue up. ---connection con_temp2 -ROLLBACK; ---connection server_2 -SET debug_sync='now WAIT_FOR slave_queued2'; -# And finally, we can let insert 1 proceed and do the group commit with all -# three insert transactions together. -SET debug_sync='now SIGNAL slave_cont1'; - -# Wait for the commit to complete and check that all three transactions -# group-committed together (will be seen in the binlog as all three having -# cid=# on their GTID event). ---let $wait_condition= SELECT COUNT(*) = 3 FROM t3 WHERE a IN (2,4,6) ---source include/wait_condition.inc -SELECT * FROM t3 ORDER BY a; ---let $binlog_file= slave-bin.000003 ---source include/show_binlog_events.inc - - ---echo *** Test STOP SLAVE in parallel mode *** ---connection server_2 ---source include/stop_slave.inc -# Respawn all worker threads to clear any left-over debug_sync or other stuff. -SET debug_sync='RESET'; -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=10; - ---connection server_1 -# Set up a couple of transactions. The first will be blocked halfway -# through on a lock, and while it is blocked we initiate STOP SLAVE. -# We then test that the halfway-initiated transaction is allowed to -# complete, but no subsequent ones. -# We have to use statement-based mode and set -# binlog_direct_non_transactional_updates=0; otherwise the binlog will -# be split into two event groups, one for the MyISAM part and one for the -# InnoDB part. -SET binlog_direct_non_transactional_updates=0; -SET sql_log_bin=0; -CALL mtr.add_suppression("Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction"); -SET sql_log_bin=1; -BEGIN; -INSERT INTO t2 VALUES (20); ---disable_warnings -INSERT INTO t1 VALUES (20); ---enable_warnings -INSERT INTO t2 VALUES (21); -INSERT INTO t3 VALUES (20, 20); -COMMIT; -INSERT INTO t3 VALUES(21, 21); -INSERT INTO t3 VALUES(22, 22); -SET binlog_format=@old_format; ---save_master_pos - -# Start a connection that will block the replicated transaction halfway. ---connection con_temp1 -BEGIN; -INSERT INTO t2 VALUES (21); - ---connection server_2 -START SLAVE; -# Wait for the MyISAM change to be visible, after which replication will wait -# for con_temp1 to roll back. ---let $wait_condition= SELECT COUNT(*) = 1 FROM t1 WHERE a=20 ---source include/wait_condition.inc - ---connection con_temp2 -# Initiate slave stop. It will have to wait for the current event group -# to complete. -# The dbug injection causes debug_sync to signal 'wait_for_done_waiting' -# when the SQL driver thread is ready. -SET @old_dbug= @@GLOBAL.debug_dbug; -SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger"; -send STOP SLAVE; - ---connection con_temp1 -SET debug_sync='now WAIT_FOR wait_for_done_waiting'; -ROLLBACK; - ---connection con_temp2 -reap; -SET GLOBAL debug_dbug=@old_dbug; -SET debug_sync='RESET'; - ---connection server_2 ---source include/wait_for_slave_to_stop.inc -# We should see the first transaction applied, but not the two others. -SELECT * FROM t1 WHERE a >= 20 ORDER BY a; -SELECT * FROM t2 WHERE a >= 20 ORDER BY a; -SELECT * FROM t3 WHERE a >= 20 ORDER BY a; - ---source include/start_slave.inc ---sync_with_master -SELECT * FROM t1 WHERE a >= 20 ORDER BY a; -SELECT * FROM t2 WHERE a >= 20 ORDER BY a; -SELECT * FROM t3 WHERE a >= 20 ORDER BY a; - - ---connection server_2 -# Respawn all worker threads to clear any left-over debug_sync or other stuff. ---source include/stop_slave.inc -SET GLOBAL binlog_format=@old_format; -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=10; ---source include/start_slave.inc - - ---echo *** Test killing slave threads at various wait points *** ---echo *** 1. Test killing transaction waiting in commit for previous transaction to commit *** - -# Set up three transactions on the master that will be group-committed -# together so they can be replicated in parallel on the slave. ---connection con_temp3 -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; -SET binlog_format=statement; -send INSERT INTO t3 VALUES (31, foo(31, - 'commit_before_prepare_ordered WAIT_FOR t2_waiting', - 'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont')); - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued1'; - ---connection con_temp4 -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; -SET binlog_format=statement; -BEGIN; -# This insert is just so we can get T2 to wait while a query is running that we -# can see in SHOW PROCESSLIST so we can get its thread_id to kill later. -INSERT INTO t3 VALUES (32, foo(32, - 'ha_write_row_end SIGNAL t2_query WAIT_FOR t2_cont', - '')); -# This insert sets up debug_sync points so that T2 will tell when it is at its -# wait point where we want to kill it - and when it has been killed. -INSERT INTO t3 VALUES (33, foo(33, - 'group_commit_waiting_for_prior SIGNAL t2_waiting', - 'group_commit_waiting_for_prior_killed SIGNAL t2_killed')); -send COMMIT; - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued2'; - ---connection con_temp5 -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3'; -SET binlog_format=statement; -send INSERT INTO t3 VALUES (34, foo(34, - '', - '')); - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued3'; -SET debug_sync='now SIGNAL master_cont1'; - ---connection con_temp3 -REAP; ---connection con_temp4 -REAP; ---connection con_temp5 -REAP; - ---connection server_1 -SELECT * FROM t3 WHERE a >= 30 ORDER BY a; -SET debug_sync='RESET'; - ---connection server_2 -SET sql_log_bin=0; -CALL mtr.add_suppression("Query execution was interrupted"); -CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends"); -CALL mtr.add_suppression("Slave: Connection was killed"); -SET sql_log_bin=1; -# Wait until T2 is inside executing its insert of 32, then find it in SHOW -# PROCESSLIST to know its thread id for KILL later. -SET debug_sync='now WAIT_FOR t2_query'; ---let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(32%' AND INFO NOT LIKE '%LIKE%'` -SET debug_sync='now SIGNAL t2_cont'; - -# Wait until T2 has entered its wait for T1 to commit, and T1 has -# progressed into its commit phase. -SET debug_sync='now WAIT_FOR t1_ready'; - -# Now kill the transaction T2. ---replace_result $thd_id THD_ID -eval KILL $thd_id; - -# Wait until T2 has reacted on the kill. -SET debug_sync='now WAIT_FOR t2_killed'; - -# Now we can allow T1 to proceed. -SET debug_sync='now SIGNAL t1_cont'; - ---let $slave_sql_errno= 1317,1927,1964 ---source include/wait_for_slave_sql_error.inc -STOP SLAVE IO_THREAD; -SELECT * FROM t3 WHERE a >= 30 ORDER BY a; - -# Now we have to disable the debug_sync statements, so they do not trigger -# when the events are retried. -SET debug_sync='RESET'; -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=10; -SET sql_log_bin=0; -DROP FUNCTION foo; ---delimiter || -CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) - RETURNS INT DETERMINISTIC - BEGIN - RETURN x; - END -|| ---delimiter ; -SET sql_log_bin=1; - ---connection server_1 -INSERT INTO t3 VALUES (39,0); ---save_master_pos - ---connection server_2 ---source include/start_slave.inc ---sync_with_master -SELECT * FROM t3 WHERE a >= 30 ORDER BY a; -# Restore the foo() function. -SET sql_log_bin=0; -DROP FUNCTION foo; ---delimiter || -CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) - RETURNS INT DETERMINISTIC - BEGIN - IF d1 != '' THEN - SET debug_sync = d1; - END IF; - IF d2 != '' THEN - SET debug_sync = d2; - END IF; - RETURN x; - END -|| ---delimiter ; -SET sql_log_bin=1; - - ---connection server_2 -# Respawn all worker threads to clear any left-over debug_sync or other stuff. ---source include/stop_slave.inc -SET GLOBAL binlog_format=@old_format; -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=10; ---source include/start_slave.inc - - ---echo *** 2. Same as (1), but without restarting IO thread after kill of SQL threads *** - -# Set up three transactions on the master that will be group-committed -# together so they can be replicated in parallel on the slave. ---connection con_temp3 -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; -SET binlog_format=statement; -send INSERT INTO t3 VALUES (41, foo(41, - 'commit_before_prepare_ordered WAIT_FOR t2_waiting', - 'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont')); - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued1'; - ---connection con_temp4 -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; -SET binlog_format=statement; -BEGIN; -# This insert is just so we can get T2 to wait while a query is running that we -# can see in SHOW PROCESSLIST so we can get its thread_id to kill later. -INSERT INTO t3 VALUES (42, foo(42, - 'ha_write_row_end SIGNAL t2_query WAIT_FOR t2_cont', - '')); -# This insert sets up debug_sync points so that T2 will tell when it is at its -# wait point where we want to kill it - and when it has been killed. -INSERT INTO t3 VALUES (43, foo(43, - 'group_commit_waiting_for_prior SIGNAL t2_waiting', - 'group_commit_waiting_for_prior_killed SIGNAL t2_killed')); -send COMMIT; - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued2'; - ---connection con_temp5 -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3'; -SET binlog_format=statement; -send INSERT INTO t3 VALUES (44, foo(44, - '', - '')); - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued3'; -SET debug_sync='now SIGNAL master_cont1'; - ---connection con_temp3 -REAP; ---connection con_temp4 -REAP; ---connection con_temp5 -REAP; - ---connection server_1 -SELECT * FROM t3 WHERE a >= 40 ORDER BY a; -SET debug_sync='RESET'; - ---connection server_2 -# Wait until T2 is inside executing its insert of 42, then find it in SHOW -# PROCESSLIST to know its thread id for KILL later. -SET debug_sync='now WAIT_FOR t2_query'; ---let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(42%' AND INFO NOT LIKE '%LIKE%'` -SET debug_sync='now SIGNAL t2_cont'; - -# Wait until T2 has entered its wait for T1 to commit, and T1 has -# progressed into its commit phase. -SET debug_sync='now WAIT_FOR t1_ready'; - -# Now kill the transaction T2. ---replace_result $thd_id THD_ID -eval KILL $thd_id; - -# Wait until T2 has reacted on the kill. -SET debug_sync='now WAIT_FOR t2_killed'; - -# Now we can allow T1 to proceed. -SET debug_sync='now SIGNAL t1_cont'; - ---let $slave_sql_errno= 1317,1927,1964 ---source include/wait_for_slave_sql_error.inc - -# Now we have to disable the debug_sync statements, so they do not trigger -# when the events are retried. -SET debug_sync='RESET'; -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=10; -SET sql_log_bin=0; -DROP FUNCTION foo; ---delimiter || -CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) - RETURNS INT DETERMINISTIC - BEGIN - RETURN x; - END -|| ---delimiter ; -SET sql_log_bin=1; - ---connection server_1 -INSERT INTO t3 VALUES (49,0); ---save_master_pos - ---connection server_2 -START SLAVE SQL_THREAD; ---sync_with_master -SELECT * FROM t3 WHERE a >= 40 ORDER BY a; -# Restore the foo() function. -SET sql_log_bin=0; -DROP FUNCTION foo; ---delimiter || -CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) - RETURNS INT DETERMINISTIC - BEGIN - IF d1 != '' THEN - SET debug_sync = d1; - END IF; - IF d2 != '' THEN - SET debug_sync = d2; - END IF; - RETURN x; - END -|| ---delimiter ; -SET sql_log_bin=1; - - ---connection server_2 -# Respawn all worker threads to clear any left-over debug_sync or other stuff. ---source include/stop_slave.inc -SET GLOBAL binlog_format=@old_format; -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=10; ---source include/start_slave.inc - - ---echo *** 3. Same as (2), but not using gtid mode *** - ---connection server_2 ---source include/stop_slave.inc -CHANGE MASTER TO master_use_gtid=no; ---source include/start_slave.inc - ---connection server_1 -# Set up three transactions on the master that will be group-committed -# together so they can be replicated in parallel on the slave. ---connection con_temp3 -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; -SET binlog_format=statement; -send INSERT INTO t3 VALUES (51, foo(51, - 'commit_before_prepare_ordered WAIT_FOR t2_waiting', - 'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont')); - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued1'; - ---connection con_temp4 -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; -SET binlog_format=statement; -BEGIN; -# This insert is just so we can get T2 to wait while a query is running that we -# can see in SHOW PROCESSLIST so we can get its thread_id to kill later. -INSERT INTO t3 VALUES (52, foo(52, - 'ha_write_row_end SIGNAL t2_query WAIT_FOR t2_cont', - '')); -# This insert sets up debug_sync points so that T2 will tell when it is at its -# wait point where we want to kill it - and when it has been killed. -INSERT INTO t3 VALUES (53, foo(53, - 'group_commit_waiting_for_prior SIGNAL t2_waiting', - 'group_commit_waiting_for_prior_killed SIGNAL t2_killed')); -send COMMIT; - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued2'; - ---connection con_temp5 -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3'; -SET binlog_format=statement; -send INSERT INTO t3 VALUES (54, foo(54, - '', - '')); - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued3'; -SET debug_sync='now SIGNAL master_cont1'; - ---connection con_temp3 -REAP; ---connection con_temp4 -REAP; ---connection con_temp5 -REAP; - ---connection server_1 -SELECT * FROM t3 WHERE a >= 50 ORDER BY a; -SET debug_sync='RESET'; - ---connection server_2 -# Wait until T2 is inside executing its insert of 52, then find it in SHOW -# PROCESSLIST to know its thread id for KILL later. -SET debug_sync='now WAIT_FOR t2_query'; ---let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(52%' AND INFO NOT LIKE '%LIKE%'` -SET debug_sync='now SIGNAL t2_cont'; - -# Wait until T2 has entered its wait for T1 to commit, and T1 has -# progressed into its commit phase. -SET debug_sync='now WAIT_FOR t1_ready'; - -# Now kill the transaction T2. ---replace_result $thd_id THD_ID -eval KILL $thd_id; - -# Wait until T2 has reacted on the kill. -SET debug_sync='now WAIT_FOR t2_killed'; - -# Now we can allow T1 to proceed. -SET debug_sync='now SIGNAL t1_cont'; - ---let $slave_sql_errno= 1317,1927,1964 ---source include/wait_for_slave_sql_error.inc -SELECT * FROM t3 WHERE a >= 50 ORDER BY a; - -# Now we have to disable the debug_sync statements, so they do not trigger -# when the events are retried. -SET debug_sync='RESET'; -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=10; -SET sql_log_bin=0; -DROP FUNCTION foo; ---delimiter || -CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) - RETURNS INT DETERMINISTIC - BEGIN - RETURN x; - END -|| ---delimiter ; -SET sql_log_bin=1; - ---connection server_1 -INSERT INTO t3 VALUES (59,0); ---save_master_pos - ---connection server_2 -START SLAVE SQL_THREAD; ---sync_with_master -SELECT * FROM t3 WHERE a >= 50 ORDER BY a; -# Restore the foo() function. -SET sql_log_bin=0; -DROP FUNCTION foo; ---delimiter || -CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) - RETURNS INT DETERMINISTIC - BEGIN - IF d1 != '' THEN - SET debug_sync = d1; - END IF; - IF d2 != '' THEN - SET debug_sync = d2; - END IF; - RETURN x; - END -|| ---delimiter ; -SET sql_log_bin=1; - - ---source include/stop_slave.inc -CHANGE MASTER TO master_use_gtid=slave_pos; ---source include/start_slave.inc - ---connection server_2 -# Respawn all worker threads to clear any left-over debug_sync or other stuff. ---source include/stop_slave.inc -SET GLOBAL binlog_format=@old_format; -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=4; ---source include/start_slave.inc - - ---echo *** 4. Test killing thread that is waiting to start transaction until previous transaction commits *** - -# We set up four transactions T1, T2, T3, and T4 on the master. T2, T3, and T4 -# can run in parallel with each other (same group commit and commit id), -# but not in parallel with T1. -# -# We use four worker threads, each Ti will be queued on each their own -# worker thread. We will delay T1 commit, T3 will wait for T1 to begin -# commit before it can start. We will kill T3 during this wait, and -# check that everything works correctly. -# -# It is rather tricky to get the correct thread id of the worker to kill. -# We start by injecting four dummy transactions in a debug_sync-controlled -# manner to be able to get known thread ids for the workers in a pool with -# just 4 worker threads. Then we let in each of the real test transactions -# T1-T4 one at a time in a way which allows us to know which transaction -# ends up with which thread id. - ---connection server_1 -SET binlog_format=statement; -SET gtid_domain_id=2; -BEGIN; -# This debug_sync will linger on and be used to control T4 later. -INSERT INTO t3 VALUES (70, foo(70, - 'rpl_parallel_start_waiting_for_prior SIGNAL t4_waiting', '')); -INSERT INTO t3 VALUES (60, foo(60, - 'ha_write_row_end SIGNAL d2_query WAIT_FOR d2_cont2', - 'rpl_parallel_end_of_group SIGNAL d2_done WAIT_FOR d2_cont')); -COMMIT; -SET gtid_domain_id=0; - ---connection server_2 -SET debug_sync='now WAIT_FOR d2_query'; ---let $d2_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(60%' AND INFO NOT LIKE '%LIKE%'` - ---connection server_1 -SET gtid_domain_id=1; -BEGIN; -# These debug_sync's will linger on and be used to control T3 later. -INSERT INTO t3 VALUES (61, foo(61, - 'rpl_parallel_start_waiting_for_prior SIGNAL t3_waiting', - 'rpl_parallel_start_waiting_for_prior_killed SIGNAL t3_killed')); -INSERT INTO t3 VALUES (62, foo(62, - 'ha_write_row_end SIGNAL d1_query WAIT_FOR d1_cont2', - 'rpl_parallel_end_of_group SIGNAL d1_done WAIT_FOR d1_cont')); -COMMIT; -SET gtid_domain_id=0; - ---connection server_2 -SET debug_sync='now WAIT_FOR d1_query'; ---let $d1_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(62%' AND INFO NOT LIKE '%LIKE%'` - ---connection server_1 -SET gtid_domain_id=0; -INSERT INTO t3 VALUES (63, foo(63, - 'ha_write_row_end SIGNAL d0_query WAIT_FOR d0_cont2', - 'rpl_parallel_end_of_group SIGNAL d0_done WAIT_FOR d0_cont')); - ---connection server_2 -SET debug_sync='now WAIT_FOR d0_query'; ---let $d0_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(63%' AND INFO NOT LIKE '%LIKE%'` - ---connection server_1 -SET gtid_domain_id=3; -BEGIN; -# These debug_sync's will linger on and be used to control T2 later. -INSERT INTO t3 VALUES (68, foo(68, - 'rpl_parallel_start_waiting_for_prior SIGNAL t2_waiting', '')); -INSERT INTO t3 VALUES (69, foo(69, - 'ha_write_row_end SIGNAL d3_query WAIT_FOR d3_cont2', - 'rpl_parallel_end_of_group SIGNAL d3_done WAIT_FOR d3_cont')); -COMMIT; -SET gtid_domain_id=0; - ---connection server_2 -SET debug_sync='now WAIT_FOR d3_query'; ---let $d3_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(69%' AND INFO NOT LIKE '%LIKE%'` - -SET debug_sync='now SIGNAL d2_cont2'; -SET debug_sync='now WAIT_FOR d2_done'; -SET debug_sync='now SIGNAL d1_cont2'; -SET debug_sync='now WAIT_FOR d1_done'; -SET debug_sync='now SIGNAL d0_cont2'; -SET debug_sync='now WAIT_FOR d0_done'; -SET debug_sync='now SIGNAL d3_cont2'; -SET debug_sync='now WAIT_FOR d3_done'; - -# Now prepare the real transactions T1, T2, T3, T4 on the master. - ---connection con_temp3 -# Create transaction T1. -SET binlog_format=statement; -INSERT INTO t3 VALUES (64, foo(64, - 'rpl_parallel_before_mark_start_commit SIGNAL t1_waiting WAIT_FOR t1_cont', '')); - -# Create transaction T2, as a group commit leader on the master. -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2 WAIT_FOR master_cont2'; -send INSERT INTO t3 VALUES (65, foo(65, '', '')); - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued2'; - ---connection con_temp4 -# Create transaction T3, participating in T2's group commit. -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3'; -send INSERT INTO t3 VALUES (66, foo(66, '', '')); - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued3'; - ---connection con_temp5 -# Create transaction T4, participating in group commit with T2 and T3. -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued4'; -send INSERT INTO t3 VALUES (67, foo(67, '', '')); - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued4'; -SET debug_sync='now SIGNAL master_cont2'; - ---connection con_temp3 -REAP; ---connection con_temp4 -REAP; ---connection con_temp5 -REAP; - ---connection server_1 -SELECT * FROM t3 WHERE a >= 60 ORDER BY a; -SET debug_sync='RESET'; - ---connection server_2 -# Now we have the four transactions pending for replication on the slave. -# Let them be queued for our three worker threads in a controlled fashion. -# We put them at a stage where T1 is delayed and T3 is waiting for T1 to -# commit before T3 can start. Then we kill T3. - -# Make the worker D0 free, and wait for T1 to be queued in it. -SET debug_sync='now SIGNAL d0_cont'; -SET debug_sync='now WAIT_FOR t1_waiting'; - -# Make the worker D3 free, and wait for T2 to be queued in it. -SET debug_sync='now SIGNAL d3_cont'; -SET debug_sync='now WAIT_FOR t2_waiting'; - -# Now release worker D1, and wait for T3 to be queued in it. -# T3 will wait for T1 to commit before it can start. -SET debug_sync='now SIGNAL d1_cont'; -SET debug_sync='now WAIT_FOR t3_waiting'; - -# Release worker D2. Wait for T4 to be queued, so we are sure it has -# received the debug_sync signal (else we might overwrite it with the -# next debug_sync). -SET debug_sync='now SIGNAL d2_cont'; -SET debug_sync='now WAIT_FOR t4_waiting'; - -# Now we kill the waiting transaction T3 in worker D1. ---replace_result $d1_thd_id THD_ID -eval KILL $d1_thd_id; - -# Wait until T3 has reacted on the kill. -SET debug_sync='now WAIT_FOR t3_killed'; - -# Now we can allow T1 to proceed. -SET debug_sync='now SIGNAL t1_cont'; - ---let $slave_sql_errno= 1317,1927,1964 ---source include/wait_for_slave_sql_error.inc -STOP SLAVE IO_THREAD; -# Since T2, T3, and T4 run in parallel, we can not be sure if T2 will have time -# to commit or not before the stop. However, T1 should commit, and T3/T4 may -# not have committed. (After slave restart we check that all become committed -# eventually). -SELECT * FROM t3 WHERE a >= 60 AND a != 65 ORDER BY a; - -# Now we have to disable the debug_sync statements, so they do not trigger -# when the events are retried. -SET debug_sync='RESET'; -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=10; -SET sql_log_bin=0; -DROP FUNCTION foo; ---delimiter || -CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) - RETURNS INT DETERMINISTIC - BEGIN - RETURN x; - END -|| ---delimiter ; -SET sql_log_bin=1; - ---connection server_1 -UPDATE t3 SET b=b+1 WHERE a=60; ---save_master_pos - ---connection server_2 ---source include/start_slave.inc ---sync_with_master -SELECT * FROM t3 WHERE a >= 60 ORDER BY a; -# Restore the foo() function. -SET sql_log_bin=0; -DROP FUNCTION foo; ---delimiter || -CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) - RETURNS INT DETERMINISTIC - BEGIN - IF d1 != '' THEN - SET debug_sync = d1; - END IF; - IF d2 != '' THEN - SET debug_sync = d2; - END IF; - RETURN x; - END -|| ---delimiter ; -SET sql_log_bin=1; - ---connection server_2 -# Respawn all worker threads to clear any left-over debug_sync or other stuff. ---source include/stop_slave.inc -SET GLOBAL binlog_format=@old_format; -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=10; ---source include/start_slave.inc - - ---echo *** 5. Test killing thread that is waiting for queue of max length to shorten *** - -# Find the thread id of the driver SQL thread that we want to kill. ---let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Slave has read all relay log%' ---source include/wait_condition.inc ---let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Slave has read all relay log%'` -SET @old_max_queued= @@GLOBAL.slave_parallel_max_queued; -SET GLOBAL slave_parallel_max_queued=9000; - ---connection server_1 ---let bigstring= `SELECT REPEAT('x', 10000)` -SET binlog_format=statement; -# Create an event that will wait to be signalled. -INSERT INTO t3 VALUES (80, foo(0, - 'ha_write_row_end SIGNAL query_waiting WAIT_FOR query_cont', '')); - ---connection server_2 -SET debug_sync='now WAIT_FOR query_waiting'; -# Inject that the SQL driver thread will signal `wait_queue_ready' to debug_sync -# as it goes to wait for the event queue to become smaller than the value of -# @@slave_parallel_max_queued. -SET @old_dbug= @@GLOBAL.debug_dbug; -SET GLOBAL debug_dbug="+d,rpl_parallel_wait_queue_max"; - ---connection server_1 ---disable_query_log -# Create an event that will fill up the queue. -# The Xid event at the end of the event group will have to wait for the Query -# event with the INSERT to drain so the queue becomes shorter. However that in -# turn waits for the prior event group to continue. -eval INSERT INTO t3 VALUES (81, LENGTH('$bigstring')); ---enable_query_log -SELECT * FROM t3 WHERE a >= 80 ORDER BY a; - ---connection server_2 -SET debug_sync='now WAIT_FOR wait_queue_ready'; - ---replace_result $thd_id THD_ID -eval KILL $thd_id; - -SET debug_sync='now WAIT_FOR wait_queue_killed'; -SET debug_sync='now SIGNAL query_cont'; - ---let $slave_sql_errno= 1317,1927,1964 ---source include/wait_for_slave_sql_error.inc -STOP SLAVE IO_THREAD; - -SET GLOBAL debug_dbug=@old_dbug; -SET GLOBAL slave_parallel_max_queued= @old_max_queued; - ---connection server_1 -INSERT INTO t3 VALUES (82,0); -SET binlog_format=@old_format; ---save_master_pos - ---connection server_2 -SET debug_sync='RESET'; ---source include/start_slave.inc ---sync_with_master -SELECT * FROM t3 WHERE a >= 80 ORDER BY a; - - ---connection server_2 ---source include/stop_slave.inc -SET GLOBAL binlog_format=@old_format; -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=10; ---source include/start_slave.inc - ---echo *** MDEV-5788 Incorrect free of rgi->deferred_events in parallel replication *** - ---connection server_2 -# Use just two worker threads, so we are sure to get the rpl_group_info added -# to the free list, which is what triggered the bug. ---source include/stop_slave.inc -SET GLOBAL replicate_ignore_table="test.t3"; -SET GLOBAL slave_parallel_threads=2; ---source include/start_slave.inc - ---connection server_1 -INSERT INTO t3 VALUES (100, rand()); -INSERT INTO t3 VALUES (101, rand()); - ---save_master_pos - ---connection server_2 ---sync_with_master - ---connection server_1 -INSERT INTO t3 VALUES (102, rand()); -INSERT INTO t3 VALUES (103, rand()); -INSERT INTO t3 VALUES (104, rand()); -INSERT INTO t3 VALUES (105, rand()); - ---save_master_pos - ---connection server_2 ---sync_with_master ---source include/stop_slave.inc -SET GLOBAL replicate_ignore_table=""; ---source include/start_slave.inc - ---connection server_1 -INSERT INTO t3 VALUES (106, rand()); -INSERT INTO t3 VALUES (107, rand()); ---save_master_pos - ---connection server_2 ---sync_with_master ---replace_column 2 # -SELECT * FROM t3 WHERE a >= 100 ORDER BY a; - - ---echo *** MDEV-5921: In parallel replication, an error is not correctly signalled to the next transaction *** - ---connection server_2 ---source include/stop_slave.inc -SET GLOBAL slave_parallel_threads=10; ---source include/start_slave.inc - ---connection server_1 -INSERT INTO t3 VALUES (110, 1); ---save_master_pos - ---connection server_2 ---sync_with_master -SELECT * FROM t3 WHERE a >= 110 ORDER BY a; -# Inject a duplicate key error. -SET sql_log_bin=0; -INSERT INTO t3 VALUES (111, 666); -SET sql_log_bin=1; - ---connection server_1 - -# Create a group commit with two inserts, the first one conflicts with a row on the slave ---connect (con1,127.0.0.1,root,,test,$SERVER_MYPORT_1,) -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; -send INSERT INTO t3 VALUES (111, 2); ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued1'; - ---connect (con2,127.0.0.1,root,,test,$SERVER_MYPORT_1,) -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; -send INSERT INTO t3 VALUES (112, 3); - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued2'; -SET debug_sync='now SIGNAL master_cont1'; - ---connection con1 -REAP; ---connection con2 -REAP; -SET debug_sync='RESET'; ---save_master_pos - ---connection server_2 ---let $slave_sql_errno= 1062 ---source include/wait_for_slave_sql_error.inc ---source include/wait_for_slave_sql_to_stop.inc -# We should not see the row (112,3) here, it should be rolled back due to -# error signal from the prior transaction. -SELECT * FROM t3 WHERE a >= 110 ORDER BY a; -SET sql_log_bin=0; -DELETE FROM t3 WHERE a=111 AND b=666; -SET sql_log_bin=1; -START SLAVE SQL_THREAD; ---sync_with_master -SELECT * FROM t3 WHERE a >= 110 ORDER BY a; - - ---echo ***MDEV-5914: Parallel replication deadlock due to InnoDB lock conflicts *** ---connection server_2 ---source include/stop_slave.inc - ---connection server_1 -CREATE TABLE t4 (a INT PRIMARY KEY, b INT, KEY b_idx(b)) ENGINE=InnoDB; -INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6); - -# Create a group commit with UPDATE and DELETE, in that order. -# The bug was that while the UPDATE's row lock does not block the DELETE, the -# DELETE's gap lock _does_ block the UPDATE. This could cause a deadlock -# on the slave. ---connection con1 -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; -send UPDATE t4 SET b=NULL WHERE a=6; ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued1'; - ---connection con2 -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; -send DELETE FROM t4 WHERE b <= 3; - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued2'; -SET debug_sync='now SIGNAL master_cont1'; - ---connection con1 -REAP; ---connection con2 -REAP; -SET debug_sync='RESET'; ---save_master_pos - ---connection server_2 ---source include/start_slave.inc ---sync_with_master ---source include/stop_slave.inc - -SELECT * FROM t4 ORDER BY a; - - -# Another example, this one with INSERT vs. DELETE ---connection server_1 -DELETE FROM t4; -INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6); - -# Create a group commit with INSERT and DELETE, in that order. -# The bug was that while the INSERT's insert intention lock does not block -# the DELETE, the DELETE's gap lock _does_ block the INSERT. This could cause -# a deadlock on the slave. ---connection con1 -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; -send INSERT INTO t4 VALUES (7, NULL); ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued1'; - ---connection con2 -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; -send DELETE FROM t4 WHERE b <= 3; - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued2'; -SET debug_sync='now SIGNAL master_cont1'; - ---connection con1 -REAP; ---connection con2 -REAP; -SET debug_sync='RESET'; ---save_master_pos - ---connection server_2 ---source include/start_slave.inc ---sync_with_master ---source include/stop_slave.inc - -SELECT * FROM t4 ORDER BY a; - - -# MDEV-6549, failing to update gtid_slave_pos for a transaction that was retried. -# The problem was that when a transaction updates the mysql.gtid_slave_pos -# table, it clears the flag that marks that there is a GTID position that -# needs to be updated. Then, if the transaction got killed after that due -# to a deadlock, the subsequent retry would fail to notice that the GTID needs -# to be recorded in gtid_slave_pos. -# -# (In the original bug report, the symptom was an assertion; this was however -# just a side effect of the missing update of gtid_slave_pos, which also -# happened to cause a missing clear of OPTION_GTID_BEGIN). ---connection server_1 -DELETE FROM t4; -INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6); - -# Create two transactions that can run in parallel on the slave but cause -# a deadlock if the second runs before the first. ---connection con1 -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; -send UPDATE t4 SET b=NULL WHERE a=6; ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued1'; - ---connection con2 -# Must use statement-based binlogging. Otherwise the transaction will not be -# binlogged at all, as it modifies no rows. -SET @old_format= @@SESSION.binlog_format; -SET binlog_format='statement'; -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; -send DELETE FROM t4 WHERE b <= 1; - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued2'; -SET debug_sync='now SIGNAL master_cont1'; - ---connection con1 -REAP; ---connection con2 -REAP; -SET @old_format=@@GLOBAL.binlog_format; -SET debug_sync='RESET'; ---save_master_pos ---let $last_gtid= `SELECT @@last_gtid` - ---connection server_2 -# Disable the usual skip of gap locks for transactions that are run in -# parallel, using DBUG. This allows the deadlock to occur, and this in turn -# triggers a retry of the second transaction, and the code that was buggy and -# caused the gtid_slave_pos update to be skipped in the retry. -SET @old_dbug= @@GLOBAL.debug_dbug; -SET GLOBAL debug_dbug="+d,disable_thd_need_ordering_with"; ---source include/start_slave.inc ---sync_with_master -SET GLOBAL debug_dbug=@old_dbug; - -SELECT * FROM t4 ORDER BY a; -# Check that the GTID of the second transaction was correctly recorded in -# gtid_slave_pos, in the variable as well as in the table. ---replace_result $last_gtid GTID -eval SET @last_gtid= '$last_gtid'; -SELECT IF(@@gtid_slave_pos LIKE CONCAT('%',@last_gtid,'%'), "GTID found ok", - CONCAT("GTID ", @last_gtid, " not found in gtid_slave_pos=", @@gtid_slave_pos)) - AS result; -SELECT "ROW FOUND" AS `Is the row found?` - FROM mysql.gtid_slave_pos - WHERE CONCAT(domain_id, "-", server_id, "-", seq_no) = @last_gtid; - - ---echo *** MDEV-5938: Exec_master_log_pos not updated at log rotate in parallel replication *** ---connection server_2 ---source include/stop_slave.inc -SET GLOBAL slave_parallel_threads=1; -SET DEBUG_SYNC= 'RESET'; ---source include/start_slave.inc - ---connection server_1 -CREATE TABLE t5 (a INT PRIMARY KEY, b INT); -INSERT INTO t5 VALUES (1,1); -INSERT INTO t5 VALUES (2,2), (3,8); -INSERT INTO t5 VALUES (4,16); ---save_master_pos - ---connection server_2 ---sync_with_master -let $io_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1); -let $io_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1); -let $sql_file= query_get_value(SHOW SLAVE STATUS, Relay_Master_Log_File, 1); -let $sql_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1); ---disable_query_log -eval SELECT IF('$io_file' = '$sql_file', "OK", "Not ok, $io_file <> $sql_file") AS test_check; -eval SELECT IF('$io_pos' = '$sql_pos', "OK", "Not ok, $io_pos <> $sql_pos") AS test_check; ---enable_query_log - ---connection server_1 -FLUSH LOGS; ---source include/wait_for_binlog_checkpoint.inc ---save_master_pos - ---connection server_2 ---sync_with_master -let $io_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1); -let $io_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1); -let $sql_file= query_get_value(SHOW SLAVE STATUS, Relay_Master_Log_File, 1); -let $sql_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1); ---disable_query_log -eval SELECT IF('$io_file' = '$sql_file', "OK", "Not ok, $io_file <> $sql_file") AS test_check; -eval SELECT IF('$io_pos' = '$sql_pos', "OK", "Not ok, $io_pos <> $sql_pos") AS test_check; ---enable_query_log - - ---echo *** MDEV_6435: Incorrect error handling when query binlogged partially on master with "killed" error *** - ---connection server_1 -CREATE TABLE t6 (a INT) ENGINE=MyISAM; -CREATE TRIGGER tr AFTER INSERT ON t6 FOR EACH ROW SET @a = 1; - ---connection con1 -SET @old_format= @@binlog_format; -SET binlog_format= statement; ---let $conid = `SELECT CONNECTION_ID()` -SET debug_sync='sp_head_execute_before_loop SIGNAL ready WAIT_FOR cont'; -send INSERT INTO t6 VALUES (1), (2), (3); - ---connection server_1 -SET debug_sync='now WAIT_FOR ready'; ---replace_result $conid CONID -eval KILL QUERY $conid; -SET debug_sync='now SIGNAL cont'; - ---connection con1 ---error ER_QUERY_INTERRUPTED ---reap -SET binlog_format= @old_format; -SET debug_sync='RESET'; ---let $after_error_gtid_pos= `SELECT @@gtid_binlog_pos` - ---connection server_1 -SET debug_sync='RESET'; - - ---connection server_2 ---let $slave_sql_errno= 1317 ---source include/wait_for_slave_sql_error.inc -STOP SLAVE IO_THREAD; ---replace_result $after_error_gtid_pos AFTER_ERROR_GTID_POS -eval SET GLOBAL gtid_slave_pos= '$after_error_gtid_pos'; ---source include/start_slave.inc - ---connection server_1 -INSERT INTO t6 VALUES (4); -SELECT * FROM t6 ORDER BY a; ---save_master_pos - ---connection server_2 ---sync_with_master -SELECT * FROM t6 ORDER BY a; - - ---echo *** MDEV-6551: Some replication errors are ignored if slave_parallel_threads > 0 *** - ---connection server_1 -INSERT INTO t2 VALUES (31); ---let $gtid1= `SELECT @@LAST_GTID` ---source include/save_master_gtid.inc - ---connection server_2 ---source include/sync_with_master_gtid.inc ---source include/stop_slave.inc -SET GLOBAL slave_parallel_threads= 0; ---source include/start_slave.inc - -# Force a duplicate key error on the slave. -SET sql_log_bin= 0; -INSERT INTO t2 VALUES (32); -SET sql_log_bin= 1; - ---connection server_1 -INSERT INTO t2 VALUES (32); ---let $gtid2= `SELECT @@LAST_GTID` -# Rotate the binlog; the bug is triggered when the master binlog file changes -# after the event group that causes the duplicate key error. -FLUSH LOGS; -INSERT INTO t2 VALUES (33); -INSERT INTO t2 VALUES (34); -SELECT * FROM t2 WHERE a >= 30 ORDER BY a; ---source include/save_master_gtid.inc - ---connection server_2 ---let $slave_sql_errno= 1062 ---source include/wait_for_slave_sql_error.inc - ---connection server_2 ---source include/stop_slave_io.inc -SET GLOBAL slave_parallel_threads=10; -START SLAVE; - ---let $slave_sql_errno= 1062 ---source include/wait_for_slave_sql_error.inc - -# Note: IO thread is still running at this point. -# The bug seems to have been that restarting the SQL thread after an error with -# the IO thread still running, somehow picks up a later relay log position and -# thus ends up skipping the failing event, rather than re-executing. - -START SLAVE SQL_THREAD; ---let $slave_sql_errno= 1062 ---source include/wait_for_slave_sql_error.inc - -SELECT * FROM t2 WHERE a >= 30 ORDER BY a; - -# Skip the duplicate error, so we can proceed. ---error ER_SLAVE_SKIP_NOT_IN_GTID -SET sql_slave_skip_counter= 1; ---source include/stop_slave_io.inc ---disable_query_log -eval SET GLOBAL gtid_slave_pos = REPLACE(@@gtid_slave_pos, "$gtid1", "$gtid2"); ---enable_query_log ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc - -SELECT * FROM t2 WHERE a >= 30 ORDER BY a; - - ---echo *** MDEV-6775: Wrong binlog order in parallel replication *** ---connection server_1 -# A bit tricky bug to reproduce. On the master, we binlog in statement-mode -# two transactions, an UPDATE followed by a DELETE. On the slave, we replicate -# with binlog-mode set to ROW, which means the DELETE, which modifies no rows, -# is not binlogged. Then we inject a wait in the group commit code on the -# slave, shortly before the actual commit of the UPDATE. The bug was that the -# DELETE could wake up from wait_for_prior_commit() before the commit of the -# UPDATE. So the test could see the slave position updated to after DELETE, -# while the UPDATE was still not visible. -DELETE FROM t4; -INSERT INTO t4 VALUES (1,NULL), (3,NULL), (4,4), (5, NULL), (6, 6); ---source include/save_master_gtid.inc - ---connection server_2 ---source include/sync_with_master_gtid.inc ---source include/stop_slave.inc -SET @old_dbug= @@GLOBAL.debug_dbug; -SET GLOBAL debug_dbug="+d,inject_binlog_commit_before_get_LOCK_log"; -SET @old_format=@@GLOBAL.binlog_format; -SET GLOBAL binlog_format=ROW; -# Re-spawn the worker threads to be sure they pick up the new binlog format -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=10; - ---connection con1 -SET @old_format= @@binlog_format; -SET binlog_format= statement; -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; -send UPDATE t4 SET b=NULL WHERE a=6; ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued1'; - ---connection con2 -SET @old_format= @@binlog_format; -SET binlog_format= statement; -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; -send DELETE FROM t4 WHERE b <= 3; - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued2'; -SET debug_sync='now SIGNAL master_cont1'; - ---connection con1 -REAP; -SET binlog_format= @old_format; ---connection con2 -REAP; -SET binlog_format= @old_format; -SET debug_sync='RESET'; ---save_master_pos -SELECT * FROM t4 ORDER BY a; - ---connection server_2 ---source include/start_slave.inc -SET debug_sync= 'now WAIT_FOR waiting'; ---sync_with_master -SELECT * FROM t4 ORDER BY a; -SET debug_sync= 'now SIGNAL cont'; - -# Re-spawn the worker threads to remove any DBUG injections or DEBUG_SYNC. ---source include/stop_slave.inc -SET GLOBAL debug_dbug=@old_dbug; -SET GLOBAL binlog_format= @old_format; -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=10; ---source include/start_slave.inc - - ---echo *** MDEV-7237: Parallel replication: incorrect relaylog position after stop/start the slave *** ---connection server_1 -INSERT INTO t2 VALUES (40); ---save_master_pos - ---connection server_2 ---sync_with_master ---source include/stop_slave.inc -CHANGE MASTER TO master_use_gtid=no; -SET @old_dbug= @@GLOBAL.debug_dbug; -# This DBUG injection causes a DEBUG_SYNC signal "scheduled_gtid_0_x_100" when -# GTID 0-1-100 has been scheduled for and fetched by a worker thread. -SET GLOBAL debug_dbug="+d,rpl_parallel_scheduled_gtid_0_x_100"; -# This DBUG injection causes a DEBUG_SYNC signal "wait_for_done_waiting" when -# STOP SLAVE has signalled all worker threads to stop. -SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger"; -# Reset worker threads to make DBUG setting catch on. -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=10; - - ---connection server_1 -# Setup some transaction for the slave to replicate. -INSERT INTO t2 VALUES (41); -INSERT INTO t2 VALUES (42); -# Need to log the DELETE in statement format, so we can see it in processlist. -SET @old_format= @@binlog_format; -SET binlog_format= statement; -DELETE FROM t2 WHERE a=40; -SET binlog_format= @old_format; -INSERT INTO t2 VALUES (43); -INSERT INTO t2 VALUES (44); -# Force the slave to switch to a new relay log file. -FLUSH LOGS; -INSERT INTO t2 VALUES (45); -# Inject a GTID 0-1-100, which will trigger a DEBUG_SYNC signal when this -# transaction has been fetched by a worker thread. -SET gtid_seq_no=100; -INSERT INTO t2 VALUES (46); ---save_master_pos - ---connection con_temp2 -# Temporarily block the DELETE on a=40 from completing. -BEGIN; -SELECT * FROM t2 WHERE a=40 FOR UPDATE; - - ---connection server_2 ---source include/start_slave.inc - -# Wait for a worker thread to start on the DELETE that will be blocked -# temporarily by the SELECT FOR UPDATE. ---let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE state='updating' and info LIKE '%DELETE FROM t2 WHERE a=40%' ---source include/wait_condition.inc - -# The DBUG injection set above will make the worker thread signal the following -# debug_sync when the GTID 0-1-100 has been reached by a worker thread. -# Thus, at this point, the SQL driver thread has reached the next -# relay log file name, while a worker thread is still processing a -# transaction in the previous relay log file, blocked on the SELECT FOR -# UPDATE. -SET debug_sync= 'now WAIT_FOR scheduled_gtid_0_x_100'; -# At this point, the SQL driver thread is in the new relay log file, while -# the DELETE from the old relay log file is not yet complete. We will stop -# the slave at this point. The bug was that the DELETE statement would -# update the slave position to the _new_ relay log file name instead of -# its own old file name. Thus, by stoping and restarting the slave at this -# point, we would get an error at restart due to incorrect position. (If -# we would let the slave catch up before stopping, the incorrect position -# would be corrected by a later transaction). - -send STOP SLAVE; - ---connection con_temp2 -# Wait for STOP SLAVE to have proceeded sufficiently that it has signalled -# all worker threads to stop; this ensures that we will stop after the DELETE -# transaction (and not after a later transaction that might have been able -# to set a fixed position). -SET debug_sync= 'now WAIT_FOR wait_for_done_waiting'; -# Now release the row lock that was blocking the replication of DELETE. -ROLLBACK; - ---connection server_2 -reap; ---source include/wait_for_slave_sql_to_stop.inc -SELECT * FROM t2 WHERE a >= 40 ORDER BY a; -# Now restart the slave. With the bug present, this would start at an -# incorrect relay log position, causing relay log read error (or if unlucky, -# silently skip a number of events). ---source include/start_slave.inc ---sync_with_master -SELECT * FROM t2 WHERE a >= 40 ORDER BY a; ---source include/stop_slave.inc -SET GLOBAL debug_dbug=@old_dbug; -SET DEBUG_SYNC= 'RESET'; -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=10; -CHANGE MASTER TO master_use_gtid=slave_pos; ---source include/start_slave.inc - - ---echo *** MDEV-7326 Server deadlock in connection with parallel replication *** -# We use three transactions, each in a separate group commit. -# T1 does mark_start_commit(), then gets a deadlock error. -# T2 wakes up and starts running -# T1 does unmark_start_commit() -# T3 goes to wait for T2 to start its commit -# T2 does mark_start_commit() -# The bug was that at this point, T3 got deadlocked. Because T1 has unmarked(), -# T3 did not yet see the count_committing_event_groups reach its target value -# yet. But when T1 later re-did mark_start_commit(), it failed to send a wakeup -# to T3. - ---connection server_2 ---source include/stop_slave.inc -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=3; -SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid"; ---source include/start_slave.inc - ---connection server_1 -SET @old_format= @@SESSION.binlog_format; -SET binlog_format= STATEMENT; -# This debug_sync will linger on and be used to control T3 later. -INSERT INTO t1 VALUES (foo(50, - "rpl_parallel_start_waiting_for_prior SIGNAL t3_ready", - "rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont")); ---save_master_pos ---connection server_2 -# Wait for the debug_sync point for T3 to be set. But let the preparation -# transaction remain hanging, so that T1 and T2 will be scheduled for the -# remaining two worker threads. -SET DEBUG_SYNC= "now WAIT_FOR prep_ready"; - ---connection server_1 -INSERT INTO t2 VALUES (foo(50, - "rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1", - "rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2")); ---save_master_pos - ---connection server_2 -SET DEBUG_SYNC= "now WAIT_FOR t1_ready1"; -# T1 has now done mark_start_commit(). It will later do a rollback and retry. - ---connection server_1 -# Use a MyISAM table for T2 and T3, so they do not trigger the -# rpl_parallel_simulate_temp_err_xid DBUG insertion on XID event. -INSERT INTO t1 VALUES (foo(51, - "rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1", - "rpl_parallel_after_mark_start_commit SIGNAL t2_ready2")); - ---connection server_2 -SET DEBUG_SYNC= "now WAIT_FOR t2_ready1"; -# T2 has now started running, but has not yet done mark_start_commit() -SET DEBUG_SYNC= "now SIGNAL t1_cont1"; -SET DEBUG_SYNC= "now WAIT_FOR t1_ready2"; -# T1 has now done unmark_start_commit() in preparation for its retry. - ---connection server_1 -INSERT INTO t1 VALUES (52); -SET BINLOG_FORMAT= @old_format; -SELECT * FROM t2 WHERE a>=50 ORDER BY a; -SELECT * FROM t1 WHERE a>=50 ORDER BY a; - ---connection server_2 -# Let the preparation transaction complete, so that the same worker thread -# can continue with the transaction T3. -SET DEBUG_SYNC= "now SIGNAL prep_cont"; -SET DEBUG_SYNC= "now WAIT_FOR t3_ready"; -# T3 has now gone to wait for T2 to start committing -SET DEBUG_SYNC= "now SIGNAL t2_cont1"; -SET DEBUG_SYNC= "now WAIT_FOR t2_ready2"; -# T2 has now done mark_start_commit(). -# Let things run, and check that T3 does not get deadlocked. -SET DEBUG_SYNC= "now SIGNAL t1_cont2"; ---sync_with_master - ---connection server_1 ---save_master_pos ---connection server_2 ---sync_with_master -SELECT * FROM t2 WHERE a>=50 ORDER BY a; -SELECT * FROM t1 WHERE a>=50 ORDER BY a; -SET DEBUG_SYNC="reset"; - -# Re-spawn the worker threads to remove any DBUG injections or DEBUG_SYNC. ---source include/stop_slave.inc -SET GLOBAL debug_dbug=@old_dbug; -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=10; ---source include/start_slave.inc - - ---echo *** MDEV-7326 Server deadlock in connection with parallel replication *** -# Similar to the previous test, but with T2 and T3 in the same GCO. -# We use three transactions, T1 in one group commit and T2/T3 in another. -# T1 does mark_start_commit(), then gets a deadlock error. -# T2 wakes up and starts running -# T1 does unmark_start_commit() -# T3 goes to wait for T1 to start its commit -# T2 does mark_start_commit() -# The bug was that at this point, T3 got deadlocked. T2 increments the -# count_committing_event_groups but does not signal T3, as they are in -# the same GCO. Then later when T1 increments, it would also not signal -# T3, because now the count_committing_event_groups is not equal to the -# wait_count of T3 (it is one larger). - ---connection server_2 ---source include/stop_slave.inc -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=3; -SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid"; ---source include/start_slave.inc - ---connection server_1 -SET @old_format= @@SESSION.binlog_format; -SET binlog_format= STATEMENT; -# This debug_sync will linger on and be used to control T3 later. -INSERT INTO t1 VALUES (foo(60, - "rpl_parallel_start_waiting_for_prior SIGNAL t3_ready", - "rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont")); ---save_master_pos ---connection server_2 -# Wait for the debug_sync point for T3 to be set. But let the preparation -# transaction remain hanging, so that T1 and T2 will be scheduled for the -# remaining two worker threads. -SET DEBUG_SYNC= "now WAIT_FOR prep_ready"; - ---connection server_1 -INSERT INTO t2 VALUES (foo(60, - "rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1", - "rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2")); ---save_master_pos - ---connection server_2 -SET DEBUG_SYNC= "now WAIT_FOR t1_ready1"; -# T1 has now done mark_start_commit(). It will later do a rollback and retry. - -# Do T2 and T3 in a single group commit. -# Use a MyISAM table for T2 and T3, so they do not trigger the -# rpl_parallel_simulate_temp_err_xid DBUG insertion on XID event. ---connection con_temp3 -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; -SET binlog_format=statement; -send INSERT INTO t1 VALUES (foo(61, - "rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1", - "rpl_parallel_after_mark_start_commit SIGNAL t2_ready2")); - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued1'; - ---connection con_temp4 -SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; -send INSERT INTO t6 VALUES (62); - ---connection server_1 -SET debug_sync='now WAIT_FOR master_queued2'; -SET debug_sync='now SIGNAL master_cont1'; - ---connection con_temp3 -REAP; ---connection con_temp4 -REAP; - ---connection server_1 -SET debug_sync='RESET'; -SET BINLOG_FORMAT= @old_format; -SELECT * FROM t2 WHERE a>=60 ORDER BY a; -SELECT * FROM t1 WHERE a>=60 ORDER BY a; -SELECT * FROM t6 WHERE a>=60 ORDER BY a; - ---connection server_2 -SET DEBUG_SYNC= "now WAIT_FOR t2_ready1"; -# T2 has now started running, but has not yet done mark_start_commit() -SET DEBUG_SYNC= "now SIGNAL t1_cont1"; -SET DEBUG_SYNC= "now WAIT_FOR t1_ready2"; -# T1 has now done unmark_start_commit() in preparation for its retry. - ---connection server_2 -# Let the preparation transaction complete, so that the same worker thread -# can continue with the transaction T3. -SET DEBUG_SYNC= "now SIGNAL prep_cont"; -SET DEBUG_SYNC= "now WAIT_FOR t3_ready"; -# T3 has now gone to wait for T2 to start committing -SET DEBUG_SYNC= "now SIGNAL t2_cont1"; -SET DEBUG_SYNC= "now WAIT_FOR t2_ready2"; -# T2 has now done mark_start_commit(). -# Let things run, and check that T3 does not get deadlocked. -SET DEBUG_SYNC= "now SIGNAL t1_cont2"; ---sync_with_master - ---connection server_1 ---save_master_pos ---connection server_2 ---sync_with_master -SELECT * FROM t2 WHERE a>=60 ORDER BY a; -SELECT * FROM t1 WHERE a>=60 ORDER BY a; -SELECT * FROM t6 WHERE a>=60 ORDER BY a; -SET DEBUG_SYNC="reset"; - -# Re-spawn the worker threads to remove any DBUG injections or DEBUG_SYNC. ---source include/stop_slave.inc -SET GLOBAL debug_dbug=@old_dbug; -SET GLOBAL slave_parallel_threads=0; -SET GLOBAL slave_parallel_threads=10; ---source include/start_slave.inc - ---echo *** MDEV-7335: Potential parallel slave deadlock with specific binlog corruption *** - ---connection server_2 ---source include/stop_slave.inc -SET GLOBAL slave_parallel_threads=1; -SET @old_dbug= @@GLOBAL.debug_dbug; -SET GLOBAL debug_dbug="+d,slave_discard_xid_for_gtid_0_x_1000"; -CALL mtr.add_suppression("Unexpected break of being relay-logged GTID"); - ---connection server_1 -INSERT INTO t2 VALUES (101); -INSERT INTO t2 VALUES (102); -INSERT INTO t2 VALUES (103); -INSERT INTO t2 VALUES (104); -INSERT INTO t2 VALUES (105); -# Inject a partial event group (missing XID at the end). The bug was that such -# partial group was not handled appropriately, leading to server deadlock. -SET gtid_seq_no=1000; -INSERT INTO t2 VALUES (106); -INSERT INTO t2 VALUES (107); -INSERT INTO t2 VALUES (108); -INSERT INTO t2 VALUES (109); -INSERT INTO t2 VALUES (110); -INSERT INTO t2 VALUES (111); -INSERT INTO t2 VALUES (112); -INSERT INTO t2 VALUES (113); -INSERT INTO t2 VALUES (114); -INSERT INTO t2 VALUES (115); -INSERT INTO t2 VALUES (116); -INSERT INTO t2 VALUES (117); -INSERT INTO t2 VALUES (118); -INSERT INTO t2 VALUES (119); -INSERT INTO t2 VALUES (120); -INSERT INTO t2 VALUES (121); -INSERT INTO t2 VALUES (122); -INSERT INTO t2 VALUES (123); -INSERT INTO t2 VALUES (124); -INSERT INTO t2 VALUES (125); -INSERT INTO t2 VALUES (126); -INSERT INTO t2 VALUES (127); -INSERT INTO t2 VALUES (128); -INSERT INTO t2 VALUES (129); -INSERT INTO t2 VALUES (130); ---source include/save_master_gtid.inc - ---connection server_2 ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc -# The partial event group (a=106) should be rolled back and thus missing. -SELECT * FROM t2 WHERE a >= 100 ORDER BY a; - ---source include/stop_slave.inc -SET GLOBAL debug_dbug=@old_dbug; -SET GLOBAL slave_parallel_threads=10; ---source include/start_slave.inc - ---echo *** MDEV-6676 - test syntax of @@slave_parallel_mode *** ---connection server_2 - ---let $status_items= Parallel_Mode ---source include/show_slave_status.inc ---source include/stop_slave.inc -SET GLOBAL slave_parallel_mode='aggressive'; ---let $status_items= Parallel_Mode ---source include/show_slave_status.inc -SET GLOBAL slave_parallel_mode='conservative'; ---let $status_items= Parallel_Mode ---source include/show_slave_status.inc - - ---echo *** MDEV-6676 - test that empty parallel_mode does not replicate in parallel *** ---connection server_1 -INSERT INTO t2 VALUES (1040); ---source include/save_master_gtid.inc - ---connection server_2 -SET GLOBAL slave_parallel_mode='none'; -# Test that we do not use parallel apply, by injecting an unconditional -# crash in the parallel apply code. -SET @old_dbug= @@GLOBAL.debug_dbug; -SET GLOBAL debug_dbug="+d,slave_crash_if_parallel_apply"; ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc -SELECT * FROM t2 WHERE a >= 1040 ORDER BY a; ---source include/stop_slave.inc -SET GLOBAL debug_dbug=@old_dbug; - ---echo *** MDEV-6676 - test disabling domain-based parallel replication *** ---connection server_1 -# Let's do a bunch of transactions that will conflict if run out-of-order in -# domain-based parallel replication mode. -SET gtid_domain_id = 1; -INSERT INTO t2 VALUES (1041); -INSERT INTO t2 VALUES (1042); -INSERT INTO t2 VALUES (1043); -INSERT INTO t2 VALUES (1044); -INSERT INTO t2 VALUES (1045); -INSERT INTO t2 VALUES (1046); -DELETE FROM t2 WHERE a >= 1041; -SET gtid_domain_id = 2; -INSERT INTO t2 VALUES (1041); -INSERT INTO t2 VALUES (1042); -INSERT INTO t2 VALUES (1043); -INSERT INTO t2 VALUES (1044); -INSERT INTO t2 VALUES (1045); -INSERT INTO t2 VALUES (1046); -SET gtid_domain_id = 0; ---source include/save_master_gtid.inc ---connection server_2 -SET GLOBAL slave_parallel_mode=minimal; ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc -SELECT * FROM t2 WHERE a >= 1040 ORDER BY a; - ---echo *** MDEV-7888: ANALYZE TABLE does wakeup_subsequent_commits(), causing wrong binlog order and parallel replication hang *** - ---connection server_2 ---source include/stop_slave.inc -SET GLOBAL slave_parallel_mode='conservative'; -SET GLOBAL slave_parallel_threads=10; - -SET @old_dbug= @@GLOBAL.debug_dbug; -SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep'; - ---connection server_1 -# Inject two group commits. The bug was that ANALYZE TABLE would call -# wakeup_subsequent_commits() too early, allowing the following transaction -# in the same group to run ahead and binlog and free the GCO. Then we get -# wrong binlog order and later access freed GCO, which causes lost wakeup -# of following GCO and thus replication hang. -# We injected a small sleep in ANALYZE to make the race easier to hit (this -# can only cause false negatives in versions with the bug, not false positives, -# so sleep is ok here. And it's in general not possible to trigger reliably -# the race with debug_sync, since the bugfix makes the race impossible). - -SET @old_dbug_slave= @@SESSION.debug_dbug; -SET SESSION debug_dbug="+d,binlog_force_commit_id"; - -# Group commit with cid=10000, two event groups. -SET @commit_id= 10000; -ANALYZE TABLE t2; -INSERT INTO t3 VALUES (120, 0); - -# Group commit with cid=10001, one event group. -SET @commit_id= 10001; -INSERT INTO t3 VALUES (121, 0); - -SET SESSION debug_dbug=@old_dbug_slave; - -SELECT * FROM t3 WHERE a >= 120 ORDER BY a; ---source include/save_master_gtid.inc - ---connection server_2 ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc - -SELECT * FROM t3 WHERE a >= 120 ORDER BY a; - ---source include/stop_slave.inc -SET GLOBAL debug_dbug= @old_dbug; ---source include/start_slave.inc - - ---echo *** MDEV-7929: record_gtid() for non-transactional event group calls wakeup_subsequent_commits() too early, causing slave hang. *** - ---connection server_2 ---source include/stop_slave.inc -SET @old_dbug= @@GLOBAL.debug_dbug; -SET GLOBAL debug_dbug= '+d,inject_record_gtid_serverid_100_sleep'; - ---connection server_1 -# Inject two group commits. The bug was that record_gtid for a -# non-transactional event group would commit its own transaction, which would -# cause ha_commit_trans() to call wakeup_subsequent_commits() too early. This -# in turn lead to access to freed group_commit_orderer object, losing a wakeup -# and causing slave threads to hang. -# We inject a small sleep in the corresponding record_gtid() to make the race -# easier to hit. - -SET @old_dbug_slave= @@SESSION.debug_dbug; -SET SESSION debug_dbug="+d,binlog_force_commit_id"; - -# Group commit with cid=10010, two event groups. -SET @old_server_id= @@SESSION.server_id; -SET SESSION server_id= 100; -SET @commit_id= 10010; -ALTER TABLE t1 COMMENT "Hulubulu!"; -SET SESSION server_id= @old_server_id; -INSERT INTO t3 VALUES (130, 0); - -# Group commit with cid=10011, one event group. -SET @commit_id= 10011; -INSERT INTO t3 VALUES (131, 0); - -SET SESSION debug_dbug=@old_dbug_slave; -SELECT * FROM t3 WHERE a >= 130 ORDER BY a; ---source include/save_master_gtid.inc - ---connection server_2 ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc - -SELECT * FROM t3 WHERE a >= 130 ORDER BY a; - ---source include/stop_slave.inc -SET GLOBAL debug_dbug= @old_dbug; ---source include/start_slave.inc - - ---echo *** MDEV-8031: Parallel replication stops on "connection killed" error (probably incorrectly handled deadlock kill) *** - ---connection server_1 -INSERT INTO t3 VALUES (201,0), (202,0); ---source include/save_master_gtid.inc - ---connection server_2 ---source include/sync_with_master_gtid.inc ---source include/stop_slave.inc -SET @old_dbug= @@GLOBAL.debug_dbug; -SET GLOBAL debug_dbug= '+d,inject_mdev8031'; - ---connection server_1 -# We artificially create a situation that hopefully resembles the original -# bug which was only seen "in the wild", and only once. -# Setup a fake group commit with lots of conflicts that will lead to deadloc -# kill. The slave DBUG injection causes the slave to be deadlock killed at -# a particular point during the retry, and then later do a small sleep at -# another critical point where the prior transaction then has a chance to -# complete. Finally an extra KILL check catches an unhandled, lingering -# deadlock kill. So rather artificial, but at least it exercises the -# relevant code paths. -SET @old_dbug_slave= @@SESSION.debug_dbug; -SET SESSION debug_dbug="+d,binlog_force_commit_id"; - -SET @commit_id= 10200; -INSERT INTO t3 VALUES (203, 1); -INSERT INTO t3 VALUES (204, 1); -INSERT INTO t3 VALUES (205, 1); -UPDATE t3 SET b=b+1 WHERE a=201; -UPDATE t3 SET b=b+1 WHERE a=201; -UPDATE t3 SET b=b+1 WHERE a=201; -UPDATE t3 SET b=b+1 WHERE a=202; -UPDATE t3 SET b=b+1 WHERE a=202; -UPDATE t3 SET b=b+1 WHERE a=202; -UPDATE t3 SET b=b+1 WHERE a=202; -UPDATE t3 SET b=b+1 WHERE a=203; -UPDATE t3 SET b=b+1 WHERE a=203; -UPDATE t3 SET b=b+1 WHERE a=204; -UPDATE t3 SET b=b+1 WHERE a=204; -UPDATE t3 SET b=b+1 WHERE a=204; -UPDATE t3 SET b=b+1 WHERE a=203; -UPDATE t3 SET b=b+1 WHERE a=205; -UPDATE t3 SET b=b+1 WHERE a=205; -SET SESSION debug_dbug=@old_dbug_slave; - -SELECT * FROM t3 WHERE a>=200 ORDER BY a; ---source include/save_master_gtid.inc - ---connection server_2 ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc - -SELECT * FROM t3 WHERE a>=200 ORDER BY a; ---source include/stop_slave.inc -SET GLOBAL debug_dbug= @old_dbug; ---source include/start_slave.inc - - ---echo *** Check getting deadlock killed inside open_binlog() during retry. *** - ---connection server_2 ---source include/stop_slave.inc -SET @old_dbug= @@GLOBAL.debug_dbug; -SET GLOBAL debug_dbug= '+d,inject_retry_event_group_open_binlog_kill'; -SET @old_max= @@GLOBAL.max_relay_log_size; -SET GLOBAL max_relay_log_size= 4096; - ---connection server_1 -SET @old_dbug_slave= @@SESSION.debug_dbug; -SET SESSION debug_dbug="+d,binlog_force_commit_id"; - ---let $large= `SELECT REPEAT("*", 8192)` -SET @commit_id= 10210; ---echo Omit long queries that cause relaylog rotations and transaction retries... ---disable_query_log -eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */; -eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */; -eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */; -eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */; -eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */; -eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */; -eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */; -eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */; -eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */; -eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */; -eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */; -eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */; -eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */; -eval UPDATE t3 SET b=b+1 WHERE a=205 /* $large */; -eval UPDATE t3 SET b=b+1 WHERE a=205 /* $large */; ---enable_query_log -SET SESSION debug_dbug=@old_dbug_slave; - -SELECT * FROM t3 WHERE a>=200 ORDER BY a; ---source include/save_master_gtid.inc - ---connection server_2 ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc - -SELECT * FROM t3 WHERE a>=200 ORDER BY a; ---source include/stop_slave.inc -SET GLOBAL debug_dbug= @old_dbug; -SET GLOBAL max_relay_log_size= @old_max; ---source include/start_slave.inc - ---echo *** MDEV-8725: Assertion on ROLLBACK statement in the binary log *** ---connection server_1 -# Inject an event group terminated by ROLLBACK, by mixing MyISAM and InnoDB -# in a transaction. The bug was an assertion on the ROLLBACK due to -# mark_start_commit() being already called. ---disable_warnings -BEGIN; -INSERT INTO t2 VALUES (2000); -INSERT INTO t1 VALUES (2000); -INSERT INTO t2 VALUES (2001); -ROLLBACK; ---enable_warnings -SELECT * FROM t1 WHERE a>=2000 ORDER BY a; -SELECT * FROM t2 WHERE a>=2000 ORDER BY a; ---source include/save_master_gtid.inc - ---connection server_2 ---source include/sync_with_master_gtid.inc -SELECT * FROM t1 WHERE a>=2000 ORDER BY a; -SELECT * FROM t2 WHERE a>=2000 ORDER BY a; - - -# Clean up. ---connection server_2 ---source include/stop_slave.inc -SET GLOBAL slave_parallel_threads=@old_parallel_threads; ---source include/start_slave.inc -SET DEBUG_SYNC= 'RESET'; - ---connection server_1 -DROP function foo; -DROP TABLE t1,t2,t3,t4,t5,t6; -SET DEBUG_SYNC= 'RESET'; - ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_parallel.test b/mysql-test/suite/rpl/t/rpl_parallel.test index ee39bfa7a39..9ba7a30f2eb 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel.test +++ b/mysql-test/suite/rpl/t/rpl_parallel.test @@ -1 +1,2218 @@ ---source include/rpl_parallel.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc +--source include/master-slave.inc + +# Test various aspects of parallel replication. + +--connection server_2 +SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; +--error ER_SLAVE_MUST_STOP +SET GLOBAL slave_parallel_threads=10; +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads=10; + +# Check that we do not spawn any worker threads when no slave is running. +SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; + +CHANGE MASTER TO master_use_gtid=slave_pos; +--source include/start_slave.inc + +# Check that worker threads get spawned when slave starts. +SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; +# ... and that worker threads get removed when slave stops. +--source include/stop_slave.inc +SELECT IF(COUNT(*) < 10, "OK", CONCAT("Found too many system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; +--source include/start_slave.inc +SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*))) FROM information_schema.processlist WHERE user = "system user"; + +--echo *** Test long-running query in domain 1 can run in parallel with short queries in domain 0 *** + +--connection server_1 +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM; +CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (1); +--save_master_pos + +--connection server_2 +--sync_with_master + +# Block the table t1 to simulate a replicated query taking a long time. +--connect (con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_2,) +LOCK TABLE t1 WRITE; + +--connection server_1 +SET gtid_domain_id=1; +# This query will be blocked on the slave until UNLOCK TABLES. +INSERT INTO t1 VALUES (2); +SET gtid_domain_id=0; +# These t2 queries can be replicated in parallel with the prior t1 query, as +# they are in a separate replication domain. +INSERT INTO t2 VALUES (2); +INSERT INTO t2 VALUES (3); +BEGIN; +INSERT INTO t2 VALUES (4); +INSERT INTO t2 VALUES (5); +COMMIT; +INSERT INTO t2 VALUES (6); + +--connection server_2 +--let $wait_condition= SELECT COUNT(*) = 6 FROM t2 +--source include/wait_condition.inc + +SELECT * FROM t2 ORDER by a; + +--connection con_temp1 +SELECT * FROM t1; +UNLOCK TABLES; + +--connection server_2 +--let $wait_condition= SELECT COUNT(*) = 2 FROM t1 +--source include/wait_condition.inc + +SELECT * FROM t1 ORDER BY a; + + +--echo *** Test two transactions in different domains committed in opposite order on slave but in a single group commit. *** +--connection server_2 +--source include/stop_slave.inc + +--connection server_1 +# Use a stored function to inject a debug_sync into the appropriate THD. +# The function does nothing on the master, and on the slave it injects the +# desired debug_sync action(s). +SET sql_log_bin=0; +--delimiter || +CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) + RETURNS INT DETERMINISTIC + BEGIN + RETURN x; + END +|| +--delimiter ; +SET sql_log_bin=1; + +SET @old_format= @@SESSION.binlog_format; +SET binlog_format='statement'; +SET gtid_domain_id=1; +INSERT INTO t2 VALUES (foo(10, + 'commit_before_enqueue SIGNAL ready1 WAIT_FOR cont1', + 'commit_after_release_LOCK_prepare_ordered SIGNAL ready2')); + +--connection server_2 +FLUSH LOGS; +--source include/wait_for_binlog_checkpoint.inc +SET sql_log_bin=0; +--delimiter || +CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) + RETURNS INT DETERMINISTIC + BEGIN + IF d1 != '' THEN + SET debug_sync = d1; + END IF; + IF d2 != '' THEN + SET debug_sync = d2; + END IF; + RETURN x; + END +|| +--delimiter ; +SET sql_log_bin=1; +SET @old_format=@@GLOBAL.binlog_format; +SET GLOBAL binlog_format=statement; +# We need to restart all parallel threads for the new global setting to +# be copied to the session-level values. +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +--source include/start_slave.inc + +# First make sure the first insert is ready to commit, but not queued yet. +SET debug_sync='now WAIT_FOR ready1'; + +--connection server_1 +SET gtid_domain_id=2; +INSERT INTO t2 VALUES (foo(11, + 'commit_before_enqueue SIGNAL ready3 WAIT_FOR cont3', + 'commit_after_release_LOCK_prepare_ordered SIGNAL ready4 WAIT_FOR cont4')); +SET gtid_domain_id=0; +SELECT * FROM t2 WHERE a >= 10 ORDER BY a; + +--connection server_2 +# Now wait for the second insert to queue itself as the leader, and then +# wait for more commits to queue up. +SET debug_sync='now WAIT_FOR ready3'; +SET debug_sync='now SIGNAL cont3'; +SET debug_sync='now WAIT_FOR ready4'; +# Now allow the first insert to queue up to participate in group commit. +SET debug_sync='now SIGNAL cont1'; +SET debug_sync='now WAIT_FOR ready2'; +# Finally allow the second insert to proceed and do the group commit. +SET debug_sync='now SIGNAL cont4'; + +--let $wait_condition= SELECT COUNT(*) = 2 FROM t2 WHERE a >= 10 +--source include/wait_condition.inc +SELECT * FROM t2 WHERE a >= 10 ORDER BY a; +# The two INSERT transactions should have been committed in opposite order, +# but in the same group commit (seen by precense of cid=# in the SHOW +# BINLOG output). +--let $binlog_file= slave-bin.000002 +--source include/show_binlog_events.inc +FLUSH LOGS; +--source include/wait_for_binlog_checkpoint.inc + +# Restart all the slave parallel worker threads, to clear all debug_sync actions. +--connection server_2 +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +SET debug_sync='RESET'; +--source include/start_slave.inc + + +--echo *** Test that group-committed transactions on the master can replicate in parallel on the slave. *** +--connection server_1 +SET debug_sync='RESET'; +FLUSH LOGS; +--source include/wait_for_binlog_checkpoint.inc +CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB; +# Create some sentinel rows so that the rows inserted in parallel fall into +# separate gaps and do not cause gap lock conflicts. +INSERT INTO t3 VALUES (1,1), (3,3), (5,5), (7,7); +--save_master_pos +--connection server_2 +--sync_with_master + +# We want to test that the transactions can execute out-of-order on +# the slave, but still end up committing in-order, and in a single +# group commit. +# +# The idea is to group-commit three transactions together on the master: +# A, B, and C. On the slave, C will execute the insert first, then A, +# and then B. But B manages to complete before A has time to commit, so +# all three end up committing together. +# +# So we start by setting up some row locks that will block transactions +# A and B from executing, allowing C to run first. + +--connection con_temp1 +BEGIN; +INSERT INTO t3 VALUES (2,102); +--connect (con_temp2,127.0.0.1,root,,test,$SERVER_MYPORT_2,) +BEGIN; +INSERT INTO t3 VALUES (4,104); + +# On the master, queue three INSERT transactions as a single group commit. +--connect (con_temp3,127.0.0.1,root,,test,$SERVER_MYPORT_1,) +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; +SET binlog_format=statement; +send INSERT INTO t3 VALUES (2, foo(12, + 'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued1 WAIT_FOR slave_cont1', + '')); + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued1'; + +--connect (con_temp4,127.0.0.1,root,,test,$SERVER_MYPORT_1,) +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; +SET binlog_format=statement; +send INSERT INTO t3 VALUES (4, foo(14, + 'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued2', + '')); + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued2'; + +--connect (con_temp5,127.0.0.1,root,,test,$SERVER_MYPORT_1,) +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3'; +SET binlog_format=statement; +send INSERT INTO t3 VALUES (6, foo(16, + 'group_commit_waiting_for_prior SIGNAL slave_queued3', + '')); + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued3'; +SET debug_sync='now SIGNAL master_cont1'; + +--connection con_temp3 +REAP; +--connection con_temp4 +REAP; +--connection con_temp5 +REAP; +SET debug_sync='RESET'; + +--connection server_1 +SELECT * FROM t3 ORDER BY a; +--let $binlog_file= master-bin.000002 +--source include/show_binlog_events.inc + +# First, wait until insert 3 is ready to queue up for group commit, but is +# waiting for insert 2 to commit before it can do so itself. +--connection server_2 +SET debug_sync='now WAIT_FOR slave_queued3'; + +# Next, let insert 1 proceed, and allow it to queue up as the group commit +# leader, but let it wait for insert 2 to also queue up before proceeding. +--connection con_temp1 +ROLLBACK; +--connection server_2 +SET debug_sync='now WAIT_FOR slave_queued1'; + +# Now let insert 2 proceed and queue up. +--connection con_temp2 +ROLLBACK; +--connection server_2 +SET debug_sync='now WAIT_FOR slave_queued2'; +# And finally, we can let insert 1 proceed and do the group commit with all +# three insert transactions together. +SET debug_sync='now SIGNAL slave_cont1'; + +# Wait for the commit to complete and check that all three transactions +# group-committed together (will be seen in the binlog as all three having +# cid=# on their GTID event). +--let $wait_condition= SELECT COUNT(*) = 3 FROM t3 WHERE a IN (2,4,6) +--source include/wait_condition.inc +SELECT * FROM t3 ORDER BY a; +--let $binlog_file= slave-bin.000003 +--source include/show_binlog_events.inc + + +--echo *** Test STOP SLAVE in parallel mode *** +--connection server_2 +--source include/stop_slave.inc +# Respawn all worker threads to clear any left-over debug_sync or other stuff. +SET debug_sync='RESET'; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; + +--connection server_1 +# Set up a couple of transactions. The first will be blocked halfway +# through on a lock, and while it is blocked we initiate STOP SLAVE. +# We then test that the halfway-initiated transaction is allowed to +# complete, but no subsequent ones. +# We have to use statement-based mode and set +# binlog_direct_non_transactional_updates=0; otherwise the binlog will +# be split into two event groups, one for the MyISAM part and one for the +# InnoDB part. +SET binlog_direct_non_transactional_updates=0; +SET sql_log_bin=0; +CALL mtr.add_suppression("Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction"); +SET sql_log_bin=1; +BEGIN; +INSERT INTO t2 VALUES (20); +--disable_warnings +INSERT INTO t1 VALUES (20); +--enable_warnings +INSERT INTO t2 VALUES (21); +INSERT INTO t3 VALUES (20, 20); +COMMIT; +INSERT INTO t3 VALUES(21, 21); +INSERT INTO t3 VALUES(22, 22); +SET binlog_format=@old_format; +--save_master_pos + +# Start a connection that will block the replicated transaction halfway. +--connection con_temp1 +BEGIN; +INSERT INTO t2 VALUES (21); + +--connection server_2 +START SLAVE; +# Wait for the MyISAM change to be visible, after which replication will wait +# for con_temp1 to roll back. +--let $wait_condition= SELECT COUNT(*) = 1 FROM t1 WHERE a=20 +--source include/wait_condition.inc + +--connection con_temp2 +# Initiate slave stop. It will have to wait for the current event group +# to complete. +# The dbug injection causes debug_sync to signal 'wait_for_done_waiting' +# when the SQL driver thread is ready. +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger"; +send STOP SLAVE; + +--connection con_temp1 +SET debug_sync='now WAIT_FOR wait_for_done_waiting'; +ROLLBACK; + +--connection con_temp2 +reap; +SET GLOBAL debug_dbug=@old_dbug; +SET debug_sync='RESET'; + +--connection server_2 +--source include/wait_for_slave_to_stop.inc +# We should see the first transaction applied, but not the two others. +SELECT * FROM t1 WHERE a >= 20 ORDER BY a; +SELECT * FROM t2 WHERE a >= 20 ORDER BY a; +SELECT * FROM t3 WHERE a >= 20 ORDER BY a; + +--source include/start_slave.inc +--sync_with_master +SELECT * FROM t1 WHERE a >= 20 ORDER BY a; +SELECT * FROM t2 WHERE a >= 20 ORDER BY a; +SELECT * FROM t3 WHERE a >= 20 ORDER BY a; + + +--connection server_2 +# Respawn all worker threads to clear any left-over debug_sync or other stuff. +--source include/stop_slave.inc +SET GLOBAL binlog_format=@old_format; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +--source include/start_slave.inc + + +--echo *** Test killing slave threads at various wait points *** +--echo *** 1. Test killing transaction waiting in commit for previous transaction to commit *** + +# Set up three transactions on the master that will be group-committed +# together so they can be replicated in parallel on the slave. +--connection con_temp3 +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; +SET binlog_format=statement; +send INSERT INTO t3 VALUES (31, foo(31, + 'commit_before_prepare_ordered WAIT_FOR t2_waiting', + 'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont')); + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued1'; + +--connection con_temp4 +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; +SET binlog_format=statement; +BEGIN; +# This insert is just so we can get T2 to wait while a query is running that we +# can see in SHOW PROCESSLIST so we can get its thread_id to kill later. +INSERT INTO t3 VALUES (32, foo(32, + 'ha_write_row_end SIGNAL t2_query WAIT_FOR t2_cont', + '')); +# This insert sets up debug_sync points so that T2 will tell when it is at its +# wait point where we want to kill it - and when it has been killed. +INSERT INTO t3 VALUES (33, foo(33, + 'group_commit_waiting_for_prior SIGNAL t2_waiting', + 'group_commit_waiting_for_prior_killed SIGNAL t2_killed')); +send COMMIT; + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued2'; + +--connection con_temp5 +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3'; +SET binlog_format=statement; +send INSERT INTO t3 VALUES (34, foo(34, + '', + '')); + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued3'; +SET debug_sync='now SIGNAL master_cont1'; + +--connection con_temp3 +REAP; +--connection con_temp4 +REAP; +--connection con_temp5 +REAP; + +--connection server_1 +SELECT * FROM t3 WHERE a >= 30 ORDER BY a; +SET debug_sync='RESET'; + +--connection server_2 +SET sql_log_bin=0; +CALL mtr.add_suppression("Query execution was interrupted"); +CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends"); +CALL mtr.add_suppression("Slave: Connection was killed"); +SET sql_log_bin=1; +# Wait until T2 is inside executing its insert of 32, then find it in SHOW +# PROCESSLIST to know its thread id for KILL later. +SET debug_sync='now WAIT_FOR t2_query'; +--let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(32%' AND INFO NOT LIKE '%LIKE%'` +SET debug_sync='now SIGNAL t2_cont'; + +# Wait until T2 has entered its wait for T1 to commit, and T1 has +# progressed into its commit phase. +SET debug_sync='now WAIT_FOR t1_ready'; + +# Now kill the transaction T2. +--replace_result $thd_id THD_ID +eval KILL $thd_id; + +# Wait until T2 has reacted on the kill. +SET debug_sync='now WAIT_FOR t2_killed'; + +# Now we can allow T1 to proceed. +SET debug_sync='now SIGNAL t1_cont'; + +--let $slave_sql_errno= 1317,1927,1964 +--source include/wait_for_slave_sql_error.inc +STOP SLAVE IO_THREAD; +SELECT * FROM t3 WHERE a >= 30 ORDER BY a; + +# Now we have to disable the debug_sync statements, so they do not trigger +# when the events are retried. +SET debug_sync='RESET'; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +SET sql_log_bin=0; +DROP FUNCTION foo; +--delimiter || +CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) + RETURNS INT DETERMINISTIC + BEGIN + RETURN x; + END +|| +--delimiter ; +SET sql_log_bin=1; + +--connection server_1 +INSERT INTO t3 VALUES (39,0); +--save_master_pos + +--connection server_2 +--source include/start_slave.inc +--sync_with_master +SELECT * FROM t3 WHERE a >= 30 ORDER BY a; +# Restore the foo() function. +SET sql_log_bin=0; +DROP FUNCTION foo; +--delimiter || +CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) + RETURNS INT DETERMINISTIC + BEGIN + IF d1 != '' THEN + SET debug_sync = d1; + END IF; + IF d2 != '' THEN + SET debug_sync = d2; + END IF; + RETURN x; + END +|| +--delimiter ; +SET sql_log_bin=1; + + +--connection server_2 +# Respawn all worker threads to clear any left-over debug_sync or other stuff. +--source include/stop_slave.inc +SET GLOBAL binlog_format=@old_format; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +--source include/start_slave.inc + + +--echo *** 2. Same as (1), but without restarting IO thread after kill of SQL threads *** + +# Set up three transactions on the master that will be group-committed +# together so they can be replicated in parallel on the slave. +--connection con_temp3 +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; +SET binlog_format=statement; +send INSERT INTO t3 VALUES (41, foo(41, + 'commit_before_prepare_ordered WAIT_FOR t2_waiting', + 'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont')); + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued1'; + +--connection con_temp4 +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; +SET binlog_format=statement; +BEGIN; +# This insert is just so we can get T2 to wait while a query is running that we +# can see in SHOW PROCESSLIST so we can get its thread_id to kill later. +INSERT INTO t3 VALUES (42, foo(42, + 'ha_write_row_end SIGNAL t2_query WAIT_FOR t2_cont', + '')); +# This insert sets up debug_sync points so that T2 will tell when it is at its +# wait point where we want to kill it - and when it has been killed. +INSERT INTO t3 VALUES (43, foo(43, + 'group_commit_waiting_for_prior SIGNAL t2_waiting', + 'group_commit_waiting_for_prior_killed SIGNAL t2_killed')); +send COMMIT; + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued2'; + +--connection con_temp5 +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3'; +SET binlog_format=statement; +send INSERT INTO t3 VALUES (44, foo(44, + '', + '')); + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued3'; +SET debug_sync='now SIGNAL master_cont1'; + +--connection con_temp3 +REAP; +--connection con_temp4 +REAP; +--connection con_temp5 +REAP; + +--connection server_1 +SELECT * FROM t3 WHERE a >= 40 ORDER BY a; +SET debug_sync='RESET'; + +--connection server_2 +# Wait until T2 is inside executing its insert of 42, then find it in SHOW +# PROCESSLIST to know its thread id for KILL later. +SET debug_sync='now WAIT_FOR t2_query'; +--let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(42%' AND INFO NOT LIKE '%LIKE%'` +SET debug_sync='now SIGNAL t2_cont'; + +# Wait until T2 has entered its wait for T1 to commit, and T1 has +# progressed into its commit phase. +SET debug_sync='now WAIT_FOR t1_ready'; + +# Now kill the transaction T2. +--replace_result $thd_id THD_ID +eval KILL $thd_id; + +# Wait until T2 has reacted on the kill. +SET debug_sync='now WAIT_FOR t2_killed'; + +# Now we can allow T1 to proceed. +SET debug_sync='now SIGNAL t1_cont'; + +--let $slave_sql_errno= 1317,1927,1964 +--source include/wait_for_slave_sql_error.inc + +# Now we have to disable the debug_sync statements, so they do not trigger +# when the events are retried. +SET debug_sync='RESET'; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +SET sql_log_bin=0; +DROP FUNCTION foo; +--delimiter || +CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) + RETURNS INT DETERMINISTIC + BEGIN + RETURN x; + END +|| +--delimiter ; +SET sql_log_bin=1; + +--connection server_1 +INSERT INTO t3 VALUES (49,0); +--save_master_pos + +--connection server_2 +START SLAVE SQL_THREAD; +--sync_with_master +SELECT * FROM t3 WHERE a >= 40 ORDER BY a; +# Restore the foo() function. +SET sql_log_bin=0; +DROP FUNCTION foo; +--delimiter || +CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) + RETURNS INT DETERMINISTIC + BEGIN + IF d1 != '' THEN + SET debug_sync = d1; + END IF; + IF d2 != '' THEN + SET debug_sync = d2; + END IF; + RETURN x; + END +|| +--delimiter ; +SET sql_log_bin=1; + + +--connection server_2 +# Respawn all worker threads to clear any left-over debug_sync or other stuff. +--source include/stop_slave.inc +SET GLOBAL binlog_format=@old_format; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +--source include/start_slave.inc + + +--echo *** 3. Same as (2), but not using gtid mode *** + +--connection server_2 +--source include/stop_slave.inc +CHANGE MASTER TO master_use_gtid=no; +--source include/start_slave.inc + +--connection server_1 +# Set up three transactions on the master that will be group-committed +# together so they can be replicated in parallel on the slave. +--connection con_temp3 +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; +SET binlog_format=statement; +send INSERT INTO t3 VALUES (51, foo(51, + 'commit_before_prepare_ordered WAIT_FOR t2_waiting', + 'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont')); + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued1'; + +--connection con_temp4 +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; +SET binlog_format=statement; +BEGIN; +# This insert is just so we can get T2 to wait while a query is running that we +# can see in SHOW PROCESSLIST so we can get its thread_id to kill later. +INSERT INTO t3 VALUES (52, foo(52, + 'ha_write_row_end SIGNAL t2_query WAIT_FOR t2_cont', + '')); +# This insert sets up debug_sync points so that T2 will tell when it is at its +# wait point where we want to kill it - and when it has been killed. +INSERT INTO t3 VALUES (53, foo(53, + 'group_commit_waiting_for_prior SIGNAL t2_waiting', + 'group_commit_waiting_for_prior_killed SIGNAL t2_killed')); +send COMMIT; + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued2'; + +--connection con_temp5 +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3'; +SET binlog_format=statement; +send INSERT INTO t3 VALUES (54, foo(54, + '', + '')); + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued3'; +SET debug_sync='now SIGNAL master_cont1'; + +--connection con_temp3 +REAP; +--connection con_temp4 +REAP; +--connection con_temp5 +REAP; + +--connection server_1 +SELECT * FROM t3 WHERE a >= 50 ORDER BY a; +SET debug_sync='RESET'; + +--connection server_2 +# Wait until T2 is inside executing its insert of 52, then find it in SHOW +# PROCESSLIST to know its thread id for KILL later. +SET debug_sync='now WAIT_FOR t2_query'; +--let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(52%' AND INFO NOT LIKE '%LIKE%'` +SET debug_sync='now SIGNAL t2_cont'; + +# Wait until T2 has entered its wait for T1 to commit, and T1 has +# progressed into its commit phase. +SET debug_sync='now WAIT_FOR t1_ready'; + +# Now kill the transaction T2. +--replace_result $thd_id THD_ID +eval KILL $thd_id; + +# Wait until T2 has reacted on the kill. +SET debug_sync='now WAIT_FOR t2_killed'; + +# Now we can allow T1 to proceed. +SET debug_sync='now SIGNAL t1_cont'; + +--let $slave_sql_errno= 1317,1927,1964 +--source include/wait_for_slave_sql_error.inc +SELECT * FROM t3 WHERE a >= 50 ORDER BY a; + +# Now we have to disable the debug_sync statements, so they do not trigger +# when the events are retried. +SET debug_sync='RESET'; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +SET sql_log_bin=0; +DROP FUNCTION foo; +--delimiter || +CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) + RETURNS INT DETERMINISTIC + BEGIN + RETURN x; + END +|| +--delimiter ; +SET sql_log_bin=1; + +--connection server_1 +INSERT INTO t3 VALUES (59,0); +--save_master_pos + +--connection server_2 +START SLAVE SQL_THREAD; +--sync_with_master +SELECT * FROM t3 WHERE a >= 50 ORDER BY a; +# Restore the foo() function. +SET sql_log_bin=0; +DROP FUNCTION foo; +--delimiter || +CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) + RETURNS INT DETERMINISTIC + BEGIN + IF d1 != '' THEN + SET debug_sync = d1; + END IF; + IF d2 != '' THEN + SET debug_sync = d2; + END IF; + RETURN x; + END +|| +--delimiter ; +SET sql_log_bin=1; + + +--source include/stop_slave.inc +CHANGE MASTER TO master_use_gtid=slave_pos; +--source include/start_slave.inc + +--connection server_2 +# Respawn all worker threads to clear any left-over debug_sync or other stuff. +--source include/stop_slave.inc +SET GLOBAL binlog_format=@old_format; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=4; +--source include/start_slave.inc + + +--echo *** 4. Test killing thread that is waiting to start transaction until previous transaction commits *** + +# We set up four transactions T1, T2, T3, and T4 on the master. T2, T3, and T4 +# can run in parallel with each other (same group commit and commit id), +# but not in parallel with T1. +# +# We use four worker threads, each Ti will be queued on each their own +# worker thread. We will delay T1 commit, T3 will wait for T1 to begin +# commit before it can start. We will kill T3 during this wait, and +# check that everything works correctly. +# +# It is rather tricky to get the correct thread id of the worker to kill. +# We start by injecting four dummy transactions in a debug_sync-controlled +# manner to be able to get known thread ids for the workers in a pool with +# just 4 worker threads. Then we let in each of the real test transactions +# T1-T4 one at a time in a way which allows us to know which transaction +# ends up with which thread id. + +--connection server_1 +SET binlog_format=statement; +SET gtid_domain_id=2; +BEGIN; +# This debug_sync will linger on and be used to control T4 later. +INSERT INTO t3 VALUES (70, foo(70, + 'rpl_parallel_start_waiting_for_prior SIGNAL t4_waiting', '')); +INSERT INTO t3 VALUES (60, foo(60, + 'ha_write_row_end SIGNAL d2_query WAIT_FOR d2_cont2', + 'rpl_parallel_end_of_group SIGNAL d2_done WAIT_FOR d2_cont')); +COMMIT; +SET gtid_domain_id=0; + +--connection server_2 +SET debug_sync='now WAIT_FOR d2_query'; +--let $d2_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(60%' AND INFO NOT LIKE '%LIKE%'` + +--connection server_1 +SET gtid_domain_id=1; +BEGIN; +# These debug_sync's will linger on and be used to control T3 later. +INSERT INTO t3 VALUES (61, foo(61, + 'rpl_parallel_start_waiting_for_prior SIGNAL t3_waiting', + 'rpl_parallel_start_waiting_for_prior_killed SIGNAL t3_killed')); +INSERT INTO t3 VALUES (62, foo(62, + 'ha_write_row_end SIGNAL d1_query WAIT_FOR d1_cont2', + 'rpl_parallel_end_of_group SIGNAL d1_done WAIT_FOR d1_cont')); +COMMIT; +SET gtid_domain_id=0; + +--connection server_2 +SET debug_sync='now WAIT_FOR d1_query'; +--let $d1_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(62%' AND INFO NOT LIKE '%LIKE%'` + +--connection server_1 +SET gtid_domain_id=0; +INSERT INTO t3 VALUES (63, foo(63, + 'ha_write_row_end SIGNAL d0_query WAIT_FOR d0_cont2', + 'rpl_parallel_end_of_group SIGNAL d0_done WAIT_FOR d0_cont')); + +--connection server_2 +SET debug_sync='now WAIT_FOR d0_query'; +--let $d0_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(63%' AND INFO NOT LIKE '%LIKE%'` + +--connection server_1 +SET gtid_domain_id=3; +BEGIN; +# These debug_sync's will linger on and be used to control T2 later. +INSERT INTO t3 VALUES (68, foo(68, + 'rpl_parallel_start_waiting_for_prior SIGNAL t2_waiting', '')); +INSERT INTO t3 VALUES (69, foo(69, + 'ha_write_row_end SIGNAL d3_query WAIT_FOR d3_cont2', + 'rpl_parallel_end_of_group SIGNAL d3_done WAIT_FOR d3_cont')); +COMMIT; +SET gtid_domain_id=0; + +--connection server_2 +SET debug_sync='now WAIT_FOR d3_query'; +--let $d3_thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%foo(69%' AND INFO NOT LIKE '%LIKE%'` + +SET debug_sync='now SIGNAL d2_cont2'; +SET debug_sync='now WAIT_FOR d2_done'; +SET debug_sync='now SIGNAL d1_cont2'; +SET debug_sync='now WAIT_FOR d1_done'; +SET debug_sync='now SIGNAL d0_cont2'; +SET debug_sync='now WAIT_FOR d0_done'; +SET debug_sync='now SIGNAL d3_cont2'; +SET debug_sync='now WAIT_FOR d3_done'; + +# Now prepare the real transactions T1, T2, T3, T4 on the master. + +--connection con_temp3 +# Create transaction T1. +SET binlog_format=statement; +INSERT INTO t3 VALUES (64, foo(64, + 'rpl_parallel_before_mark_start_commit SIGNAL t1_waiting WAIT_FOR t1_cont', '')); + +# Create transaction T2, as a group commit leader on the master. +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2 WAIT_FOR master_cont2'; +send INSERT INTO t3 VALUES (65, foo(65, '', '')); + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued2'; + +--connection con_temp4 +# Create transaction T3, participating in T2's group commit. +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3'; +send INSERT INTO t3 VALUES (66, foo(66, '', '')); + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued3'; + +--connection con_temp5 +# Create transaction T4, participating in group commit with T2 and T3. +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued4'; +send INSERT INTO t3 VALUES (67, foo(67, '', '')); + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued4'; +SET debug_sync='now SIGNAL master_cont2'; + +--connection con_temp3 +REAP; +--connection con_temp4 +REAP; +--connection con_temp5 +REAP; + +--connection server_1 +SELECT * FROM t3 WHERE a >= 60 ORDER BY a; +SET debug_sync='RESET'; + +--connection server_2 +# Now we have the four transactions pending for replication on the slave. +# Let them be queued for our three worker threads in a controlled fashion. +# We put them at a stage where T1 is delayed and T3 is waiting for T1 to +# commit before T3 can start. Then we kill T3. + +# Make the worker D0 free, and wait for T1 to be queued in it. +SET debug_sync='now SIGNAL d0_cont'; +SET debug_sync='now WAIT_FOR t1_waiting'; + +# Make the worker D3 free, and wait for T2 to be queued in it. +SET debug_sync='now SIGNAL d3_cont'; +SET debug_sync='now WAIT_FOR t2_waiting'; + +# Now release worker D1, and wait for T3 to be queued in it. +# T3 will wait for T1 to commit before it can start. +SET debug_sync='now SIGNAL d1_cont'; +SET debug_sync='now WAIT_FOR t3_waiting'; + +# Release worker D2. Wait for T4 to be queued, so we are sure it has +# received the debug_sync signal (else we might overwrite it with the +# next debug_sync). +SET debug_sync='now SIGNAL d2_cont'; +SET debug_sync='now WAIT_FOR t4_waiting'; + +# Now we kill the waiting transaction T3 in worker D1. +--replace_result $d1_thd_id THD_ID +eval KILL $d1_thd_id; + +# Wait until T3 has reacted on the kill. +SET debug_sync='now WAIT_FOR t3_killed'; + +# Now we can allow T1 to proceed. +SET debug_sync='now SIGNAL t1_cont'; + +--let $slave_sql_errno= 1317,1927,1964 +--source include/wait_for_slave_sql_error.inc +STOP SLAVE IO_THREAD; +# Since T2, T3, and T4 run in parallel, we can not be sure if T2 will have time +# to commit or not before the stop. However, T1 should commit, and T3/T4 may +# not have committed. (After slave restart we check that all become committed +# eventually). +SELECT * FROM t3 WHERE a >= 60 AND a != 65 ORDER BY a; + +# Now we have to disable the debug_sync statements, so they do not trigger +# when the events are retried. +SET debug_sync='RESET'; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +SET sql_log_bin=0; +DROP FUNCTION foo; +--delimiter || +CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) + RETURNS INT DETERMINISTIC + BEGIN + RETURN x; + END +|| +--delimiter ; +SET sql_log_bin=1; + +--connection server_1 +UPDATE t3 SET b=b+1 WHERE a=60; +--save_master_pos + +--connection server_2 +--source include/start_slave.inc +--sync_with_master +SELECT * FROM t3 WHERE a >= 60 ORDER BY a; +# Restore the foo() function. +SET sql_log_bin=0; +DROP FUNCTION foo; +--delimiter || +CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500)) + RETURNS INT DETERMINISTIC + BEGIN + IF d1 != '' THEN + SET debug_sync = d1; + END IF; + IF d2 != '' THEN + SET debug_sync = d2; + END IF; + RETURN x; + END +|| +--delimiter ; +SET sql_log_bin=1; + +--connection server_2 +# Respawn all worker threads to clear any left-over debug_sync or other stuff. +--source include/stop_slave.inc +SET GLOBAL binlog_format=@old_format; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +--source include/start_slave.inc + + +--echo *** 5. Test killing thread that is waiting for queue of max length to shorten *** + +# Find the thread id of the driver SQL thread that we want to kill. +--let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Slave has read all relay log%' +--source include/wait_condition.inc +--let $thd_id= `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Slave has read all relay log%'` +SET @old_max_queued= @@GLOBAL.slave_parallel_max_queued; +SET GLOBAL slave_parallel_max_queued=9000; + +--connection server_1 +--let bigstring= `SELECT REPEAT('x', 10000)` +SET binlog_format=statement; +# Create an event that will wait to be signalled. +INSERT INTO t3 VALUES (80, foo(0, + 'ha_write_row_end SIGNAL query_waiting WAIT_FOR query_cont', '')); + +--connection server_2 +SET debug_sync='now WAIT_FOR query_waiting'; +# Inject that the SQL driver thread will signal `wait_queue_ready' to debug_sync +# as it goes to wait for the event queue to become smaller than the value of +# @@slave_parallel_max_queued. +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug="+d,rpl_parallel_wait_queue_max"; + +--connection server_1 +--disable_query_log +# Create an event that will fill up the queue. +# The Xid event at the end of the event group will have to wait for the Query +# event with the INSERT to drain so the queue becomes shorter. However that in +# turn waits for the prior event group to continue. +eval INSERT INTO t3 VALUES (81, LENGTH('$bigstring')); +--enable_query_log +SELECT * FROM t3 WHERE a >= 80 ORDER BY a; + +--connection server_2 +SET debug_sync='now WAIT_FOR wait_queue_ready'; + +--replace_result $thd_id THD_ID +eval KILL $thd_id; + +SET debug_sync='now WAIT_FOR wait_queue_killed'; +SET debug_sync='now SIGNAL query_cont'; + +--let $slave_sql_errno= 1317,1927,1964 +--source include/wait_for_slave_sql_error.inc +STOP SLAVE IO_THREAD; + +SET GLOBAL debug_dbug=@old_dbug; +SET GLOBAL slave_parallel_max_queued= @old_max_queued; + +--connection server_1 +INSERT INTO t3 VALUES (82,0); +SET binlog_format=@old_format; +--save_master_pos + +--connection server_2 +SET debug_sync='RESET'; +--source include/start_slave.inc +--sync_with_master +SELECT * FROM t3 WHERE a >= 80 ORDER BY a; + + +--connection server_2 +--source include/stop_slave.inc +SET GLOBAL binlog_format=@old_format; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +--source include/start_slave.inc + +--echo *** MDEV-5788 Incorrect free of rgi->deferred_events in parallel replication *** + +--connection server_2 +# Use just two worker threads, so we are sure to get the rpl_group_info added +# to the free list, which is what triggered the bug. +--source include/stop_slave.inc +SET GLOBAL replicate_ignore_table="test.t3"; +SET GLOBAL slave_parallel_threads=2; +--source include/start_slave.inc + +--connection server_1 +INSERT INTO t3 VALUES (100, rand()); +INSERT INTO t3 VALUES (101, rand()); + +--save_master_pos + +--connection server_2 +--sync_with_master + +--connection server_1 +INSERT INTO t3 VALUES (102, rand()); +INSERT INTO t3 VALUES (103, rand()); +INSERT INTO t3 VALUES (104, rand()); +INSERT INTO t3 VALUES (105, rand()); + +--save_master_pos + +--connection server_2 +--sync_with_master +--source include/stop_slave.inc +SET GLOBAL replicate_ignore_table=""; +--source include/start_slave.inc + +--connection server_1 +INSERT INTO t3 VALUES (106, rand()); +INSERT INTO t3 VALUES (107, rand()); +--save_master_pos + +--connection server_2 +--sync_with_master +--replace_column 2 # +SELECT * FROM t3 WHERE a >= 100 ORDER BY a; + + +--echo *** MDEV-5921: In parallel replication, an error is not correctly signalled to the next transaction *** + +--connection server_2 +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads=10; +--source include/start_slave.inc + +--connection server_1 +INSERT INTO t3 VALUES (110, 1); +--save_master_pos + +--connection server_2 +--sync_with_master +SELECT * FROM t3 WHERE a >= 110 ORDER BY a; +# Inject a duplicate key error. +SET sql_log_bin=0; +INSERT INTO t3 VALUES (111, 666); +SET sql_log_bin=1; + +--connection server_1 + +# Create a group commit with two inserts, the first one conflicts with a row on the slave +--connect (con1,127.0.0.1,root,,test,$SERVER_MYPORT_1,) +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; +send INSERT INTO t3 VALUES (111, 2); +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued1'; + +--connect (con2,127.0.0.1,root,,test,$SERVER_MYPORT_1,) +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; +send INSERT INTO t3 VALUES (112, 3); + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued2'; +SET debug_sync='now SIGNAL master_cont1'; + +--connection con1 +REAP; +--connection con2 +REAP; +SET debug_sync='RESET'; +--save_master_pos + +--connection server_2 +--let $slave_sql_errno= 1062 +--source include/wait_for_slave_sql_error.inc +--source include/wait_for_slave_sql_to_stop.inc +# We should not see the row (112,3) here, it should be rolled back due to +# error signal from the prior transaction. +SELECT * FROM t3 WHERE a >= 110 ORDER BY a; +SET sql_log_bin=0; +DELETE FROM t3 WHERE a=111 AND b=666; +SET sql_log_bin=1; +START SLAVE SQL_THREAD; +--sync_with_master +SELECT * FROM t3 WHERE a >= 110 ORDER BY a; + + +--echo ***MDEV-5914: Parallel replication deadlock due to InnoDB lock conflicts *** +--connection server_2 +--source include/stop_slave.inc + +--connection server_1 +CREATE TABLE t4 (a INT PRIMARY KEY, b INT, KEY b_idx(b)) ENGINE=InnoDB; +INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6); + +# Create a group commit with UPDATE and DELETE, in that order. +# The bug was that while the UPDATE's row lock does not block the DELETE, the +# DELETE's gap lock _does_ block the UPDATE. This could cause a deadlock +# on the slave. +--connection con1 +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; +send UPDATE t4 SET b=NULL WHERE a=6; +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued1'; + +--connection con2 +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; +send DELETE FROM t4 WHERE b <= 3; + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued2'; +SET debug_sync='now SIGNAL master_cont1'; + +--connection con1 +REAP; +--connection con2 +REAP; +SET debug_sync='RESET'; +--save_master_pos + +--connection server_2 +--source include/start_slave.inc +--sync_with_master +--source include/stop_slave.inc + +SELECT * FROM t4 ORDER BY a; + + +# Another example, this one with INSERT vs. DELETE +--connection server_1 +DELETE FROM t4; +INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6); + +# Create a group commit with INSERT and DELETE, in that order. +# The bug was that while the INSERT's insert intention lock does not block +# the DELETE, the DELETE's gap lock _does_ block the INSERT. This could cause +# a deadlock on the slave. +--connection con1 +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; +send INSERT INTO t4 VALUES (7, NULL); +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued1'; + +--connection con2 +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; +send DELETE FROM t4 WHERE b <= 3; + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued2'; +SET debug_sync='now SIGNAL master_cont1'; + +--connection con1 +REAP; +--connection con2 +REAP; +SET debug_sync='RESET'; +--save_master_pos + +--connection server_2 +--source include/start_slave.inc +--sync_with_master +--source include/stop_slave.inc + +SELECT * FROM t4 ORDER BY a; + + +# MDEV-6549, failing to update gtid_slave_pos for a transaction that was retried. +# The problem was that when a transaction updates the mysql.gtid_slave_pos +# table, it clears the flag that marks that there is a GTID position that +# needs to be updated. Then, if the transaction got killed after that due +# to a deadlock, the subsequent retry would fail to notice that the GTID needs +# to be recorded in gtid_slave_pos. +# +# (In the original bug report, the symptom was an assertion; this was however +# just a side effect of the missing update of gtid_slave_pos, which also +# happened to cause a missing clear of OPTION_GTID_BEGIN). +--connection server_1 +DELETE FROM t4; +INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6); + +# Create two transactions that can run in parallel on the slave but cause +# a deadlock if the second runs before the first. +--connection con1 +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; +send UPDATE t4 SET b=NULL WHERE a=6; +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued1'; + +--connection con2 +# Must use statement-based binlogging. Otherwise the transaction will not be +# binlogged at all, as it modifies no rows. +SET @old_format= @@SESSION.binlog_format; +SET binlog_format='statement'; +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; +send DELETE FROM t4 WHERE b <= 1; + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued2'; +SET debug_sync='now SIGNAL master_cont1'; + +--connection con1 +REAP; +--connection con2 +REAP; +SET @old_format=@@GLOBAL.binlog_format; +SET debug_sync='RESET'; +--save_master_pos +--let $last_gtid= `SELECT @@last_gtid` + +--connection server_2 +# Disable the usual skip of gap locks for transactions that are run in +# parallel, using DBUG. This allows the deadlock to occur, and this in turn +# triggers a retry of the second transaction, and the code that was buggy and +# caused the gtid_slave_pos update to be skipped in the retry. +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug="+d,disable_thd_need_ordering_with"; +--source include/start_slave.inc +--sync_with_master +SET GLOBAL debug_dbug=@old_dbug; + +SELECT * FROM t4 ORDER BY a; +# Check that the GTID of the second transaction was correctly recorded in +# gtid_slave_pos, in the variable as well as in the table. +--replace_result $last_gtid GTID +eval SET @last_gtid= '$last_gtid'; +SELECT IF(@@gtid_slave_pos LIKE CONCAT('%',@last_gtid,'%'), "GTID found ok", + CONCAT("GTID ", @last_gtid, " not found in gtid_slave_pos=", @@gtid_slave_pos)) + AS result; +SELECT "ROW FOUND" AS `Is the row found?` + FROM mysql.gtid_slave_pos + WHERE CONCAT(domain_id, "-", server_id, "-", seq_no) = @last_gtid; + + +--echo *** MDEV-5938: Exec_master_log_pos not updated at log rotate in parallel replication *** +--connection server_2 +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads=1; +SET DEBUG_SYNC= 'RESET'; +--source include/start_slave.inc + +--connection server_1 +CREATE TABLE t5 (a INT PRIMARY KEY, b INT); +INSERT INTO t5 VALUES (1,1); +INSERT INTO t5 VALUES (2,2), (3,8); +INSERT INTO t5 VALUES (4,16); +--save_master_pos + +--connection server_2 +--sync_with_master +let $io_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1); +let $io_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1); +let $sql_file= query_get_value(SHOW SLAVE STATUS, Relay_Master_Log_File, 1); +let $sql_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1); +--disable_query_log +eval SELECT IF('$io_file' = '$sql_file', "OK", "Not ok, $io_file <> $sql_file") AS test_check; +eval SELECT IF('$io_pos' = '$sql_pos', "OK", "Not ok, $io_pos <> $sql_pos") AS test_check; +--enable_query_log + +--connection server_1 +FLUSH LOGS; +--source include/wait_for_binlog_checkpoint.inc +--save_master_pos + +--connection server_2 +--sync_with_master +let $io_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1); +let $io_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1); +let $sql_file= query_get_value(SHOW SLAVE STATUS, Relay_Master_Log_File, 1); +let $sql_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1); +--disable_query_log +eval SELECT IF('$io_file' = '$sql_file', "OK", "Not ok, $io_file <> $sql_file") AS test_check; +eval SELECT IF('$io_pos' = '$sql_pos', "OK", "Not ok, $io_pos <> $sql_pos") AS test_check; +--enable_query_log + + +--echo *** MDEV_6435: Incorrect error handling when query binlogged partially on master with "killed" error *** + +--connection server_1 +CREATE TABLE t6 (a INT) ENGINE=MyISAM; +CREATE TRIGGER tr AFTER INSERT ON t6 FOR EACH ROW SET @a = 1; + +--connection con1 +SET @old_format= @@binlog_format; +SET binlog_format= statement; +--let $conid = `SELECT CONNECTION_ID()` +SET debug_sync='sp_head_execute_before_loop SIGNAL ready WAIT_FOR cont'; +send INSERT INTO t6 VALUES (1), (2), (3); + +--connection server_1 +SET debug_sync='now WAIT_FOR ready'; +--replace_result $conid CONID +eval KILL QUERY $conid; +SET debug_sync='now SIGNAL cont'; + +--connection con1 +--error ER_QUERY_INTERRUPTED +--reap +SET binlog_format= @old_format; +SET debug_sync='RESET'; +--let $after_error_gtid_pos= `SELECT @@gtid_binlog_pos` + +--connection server_1 +SET debug_sync='RESET'; + + +--connection server_2 +--let $slave_sql_errno= 1317 +--source include/wait_for_slave_sql_error.inc +STOP SLAVE IO_THREAD; +--replace_result $after_error_gtid_pos AFTER_ERROR_GTID_POS +eval SET GLOBAL gtid_slave_pos= '$after_error_gtid_pos'; +--source include/start_slave.inc + +--connection server_1 +INSERT INTO t6 VALUES (4); +SELECT * FROM t6 ORDER BY a; +--save_master_pos + +--connection server_2 +--sync_with_master +SELECT * FROM t6 ORDER BY a; + + +--echo *** MDEV-6551: Some replication errors are ignored if slave_parallel_threads > 0 *** + +--connection server_1 +INSERT INTO t2 VALUES (31); +--let $gtid1= `SELECT @@LAST_GTID` +--source include/save_master_gtid.inc + +--connection server_2 +--source include/sync_with_master_gtid.inc +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads= 0; +--source include/start_slave.inc + +# Force a duplicate key error on the slave. +SET sql_log_bin= 0; +INSERT INTO t2 VALUES (32); +SET sql_log_bin= 1; + +--connection server_1 +INSERT INTO t2 VALUES (32); +--let $gtid2= `SELECT @@LAST_GTID` +# Rotate the binlog; the bug is triggered when the master binlog file changes +# after the event group that causes the duplicate key error. +FLUSH LOGS; +INSERT INTO t2 VALUES (33); +INSERT INTO t2 VALUES (34); +SELECT * FROM t2 WHERE a >= 30 ORDER BY a; +--source include/save_master_gtid.inc + +--connection server_2 +--let $slave_sql_errno= 1062 +--source include/wait_for_slave_sql_error.inc + +--connection server_2 +--source include/stop_slave_io.inc +SET GLOBAL slave_parallel_threads=10; +START SLAVE; + +--let $slave_sql_errno= 1062 +--source include/wait_for_slave_sql_error.inc + +# Note: IO thread is still running at this point. +# The bug seems to have been that restarting the SQL thread after an error with +# the IO thread still running, somehow picks up a later relay log position and +# thus ends up skipping the failing event, rather than re-executing. + +START SLAVE SQL_THREAD; +--let $slave_sql_errno= 1062 +--source include/wait_for_slave_sql_error.inc + +SELECT * FROM t2 WHERE a >= 30 ORDER BY a; + +# Skip the duplicate error, so we can proceed. +--error ER_SLAVE_SKIP_NOT_IN_GTID +SET sql_slave_skip_counter= 1; +--source include/stop_slave_io.inc +--disable_query_log +eval SET GLOBAL gtid_slave_pos = REPLACE(@@gtid_slave_pos, "$gtid1", "$gtid2"); +--enable_query_log +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + +SELECT * FROM t2 WHERE a >= 30 ORDER BY a; + + +--echo *** MDEV-6775: Wrong binlog order in parallel replication *** +--connection server_1 +# A bit tricky bug to reproduce. On the master, we binlog in statement-mode +# two transactions, an UPDATE followed by a DELETE. On the slave, we replicate +# with binlog-mode set to ROW, which means the DELETE, which modifies no rows, +# is not binlogged. Then we inject a wait in the group commit code on the +# slave, shortly before the actual commit of the UPDATE. The bug was that the +# DELETE could wake up from wait_for_prior_commit() before the commit of the +# UPDATE. So the test could see the slave position updated to after DELETE, +# while the UPDATE was still not visible. +DELETE FROM t4; +INSERT INTO t4 VALUES (1,NULL), (3,NULL), (4,4), (5, NULL), (6, 6); +--source include/save_master_gtid.inc + +--connection server_2 +--source include/sync_with_master_gtid.inc +--source include/stop_slave.inc +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug="+d,inject_binlog_commit_before_get_LOCK_log"; +SET @old_format=@@GLOBAL.binlog_format; +SET GLOBAL binlog_format=ROW; +# Re-spawn the worker threads to be sure they pick up the new binlog format +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; + +--connection con1 +SET @old_format= @@binlog_format; +SET binlog_format= statement; +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; +send UPDATE t4 SET b=NULL WHERE a=6; +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued1'; + +--connection con2 +SET @old_format= @@binlog_format; +SET binlog_format= statement; +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; +send DELETE FROM t4 WHERE b <= 3; + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued2'; +SET debug_sync='now SIGNAL master_cont1'; + +--connection con1 +REAP; +SET binlog_format= @old_format; +--connection con2 +REAP; +SET binlog_format= @old_format; +SET debug_sync='RESET'; +--save_master_pos +SELECT * FROM t4 ORDER BY a; + +--connection server_2 +--source include/start_slave.inc +SET debug_sync= 'now WAIT_FOR waiting'; +--sync_with_master +SELECT * FROM t4 ORDER BY a; +SET debug_sync= 'now SIGNAL cont'; + +# Re-spawn the worker threads to remove any DBUG injections or DEBUG_SYNC. +--source include/stop_slave.inc +SET GLOBAL debug_dbug=@old_dbug; +SET GLOBAL binlog_format= @old_format; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +--source include/start_slave.inc + + +--echo *** MDEV-7237: Parallel replication: incorrect relaylog position after stop/start the slave *** +--connection server_1 +INSERT INTO t2 VALUES (40); +--save_master_pos + +--connection server_2 +--sync_with_master +--source include/stop_slave.inc +CHANGE MASTER TO master_use_gtid=no; +SET @old_dbug= @@GLOBAL.debug_dbug; +# This DBUG injection causes a DEBUG_SYNC signal "scheduled_gtid_0_x_100" when +# GTID 0-1-100 has been scheduled for and fetched by a worker thread. +SET GLOBAL debug_dbug="+d,rpl_parallel_scheduled_gtid_0_x_100"; +# This DBUG injection causes a DEBUG_SYNC signal "wait_for_done_waiting" when +# STOP SLAVE has signalled all worker threads to stop. +SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger"; +# Reset worker threads to make DBUG setting catch on. +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; + + +--connection server_1 +# Setup some transaction for the slave to replicate. +INSERT INTO t2 VALUES (41); +INSERT INTO t2 VALUES (42); +# Need to log the DELETE in statement format, so we can see it in processlist. +SET @old_format= @@binlog_format; +SET binlog_format= statement; +DELETE FROM t2 WHERE a=40; +SET binlog_format= @old_format; +INSERT INTO t2 VALUES (43); +INSERT INTO t2 VALUES (44); +# Force the slave to switch to a new relay log file. +FLUSH LOGS; +INSERT INTO t2 VALUES (45); +# Inject a GTID 0-1-100, which will trigger a DEBUG_SYNC signal when this +# transaction has been fetched by a worker thread. +SET gtid_seq_no=100; +INSERT INTO t2 VALUES (46); +--save_master_pos + +--connection con_temp2 +# Temporarily block the DELETE on a=40 from completing. +BEGIN; +SELECT * FROM t2 WHERE a=40 FOR UPDATE; + + +--connection server_2 +--source include/start_slave.inc + +# Wait for a worker thread to start on the DELETE that will be blocked +# temporarily by the SELECT FOR UPDATE. +--let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE state='updating' and info LIKE '%DELETE FROM t2 WHERE a=40%' +--source include/wait_condition.inc + +# The DBUG injection set above will make the worker thread signal the following +# debug_sync when the GTID 0-1-100 has been reached by a worker thread. +# Thus, at this point, the SQL driver thread has reached the next +# relay log file name, while a worker thread is still processing a +# transaction in the previous relay log file, blocked on the SELECT FOR +# UPDATE. +SET debug_sync= 'now WAIT_FOR scheduled_gtid_0_x_100'; +# At this point, the SQL driver thread is in the new relay log file, while +# the DELETE from the old relay log file is not yet complete. We will stop +# the slave at this point. The bug was that the DELETE statement would +# update the slave position to the _new_ relay log file name instead of +# its own old file name. Thus, by stoping and restarting the slave at this +# point, we would get an error at restart due to incorrect position. (If +# we would let the slave catch up before stopping, the incorrect position +# would be corrected by a later transaction). + +send STOP SLAVE; + +--connection con_temp2 +# Wait for STOP SLAVE to have proceeded sufficiently that it has signalled +# all worker threads to stop; this ensures that we will stop after the DELETE +# transaction (and not after a later transaction that might have been able +# to set a fixed position). +SET debug_sync= 'now WAIT_FOR wait_for_done_waiting'; +# Now release the row lock that was blocking the replication of DELETE. +ROLLBACK; + +--connection server_2 +reap; +--source include/wait_for_slave_sql_to_stop.inc +SELECT * FROM t2 WHERE a >= 40 ORDER BY a; +# Now restart the slave. With the bug present, this would start at an +# incorrect relay log position, causing relay log read error (or if unlucky, +# silently skip a number of events). +--source include/start_slave.inc +--sync_with_master +SELECT * FROM t2 WHERE a >= 40 ORDER BY a; +--source include/stop_slave.inc +SET GLOBAL debug_dbug=@old_dbug; +SET DEBUG_SYNC= 'RESET'; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +CHANGE MASTER TO master_use_gtid=slave_pos; +--source include/start_slave.inc + + +--echo *** MDEV-7326 Server deadlock in connection with parallel replication *** +# We use three transactions, each in a separate group commit. +# T1 does mark_start_commit(), then gets a deadlock error. +# T2 wakes up and starts running +# T1 does unmark_start_commit() +# T3 goes to wait for T2 to start its commit +# T2 does mark_start_commit() +# The bug was that at this point, T3 got deadlocked. Because T1 has unmarked(), +# T3 did not yet see the count_committing_event_groups reach its target value +# yet. But when T1 later re-did mark_start_commit(), it failed to send a wakeup +# to T3. + +--connection server_2 +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=3; +SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid"; +--source include/start_slave.inc + +--connection server_1 +SET @old_format= @@SESSION.binlog_format; +SET binlog_format= STATEMENT; +# This debug_sync will linger on and be used to control T3 later. +INSERT INTO t1 VALUES (foo(50, + "rpl_parallel_start_waiting_for_prior SIGNAL t3_ready", + "rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont")); +--save_master_pos +--connection server_2 +# Wait for the debug_sync point for T3 to be set. But let the preparation +# transaction remain hanging, so that T1 and T2 will be scheduled for the +# remaining two worker threads. +SET DEBUG_SYNC= "now WAIT_FOR prep_ready"; + +--connection server_1 +INSERT INTO t2 VALUES (foo(50, + "rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1", + "rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2")); +--save_master_pos + +--connection server_2 +SET DEBUG_SYNC= "now WAIT_FOR t1_ready1"; +# T1 has now done mark_start_commit(). It will later do a rollback and retry. + +--connection server_1 +# Use a MyISAM table for T2 and T3, so they do not trigger the +# rpl_parallel_simulate_temp_err_xid DBUG insertion on XID event. +INSERT INTO t1 VALUES (foo(51, + "rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1", + "rpl_parallel_after_mark_start_commit SIGNAL t2_ready2")); + +--connection server_2 +SET DEBUG_SYNC= "now WAIT_FOR t2_ready1"; +# T2 has now started running, but has not yet done mark_start_commit() +SET DEBUG_SYNC= "now SIGNAL t1_cont1"; +SET DEBUG_SYNC= "now WAIT_FOR t1_ready2"; +# T1 has now done unmark_start_commit() in preparation for its retry. + +--connection server_1 +INSERT INTO t1 VALUES (52); +SET BINLOG_FORMAT= @old_format; +SELECT * FROM t2 WHERE a>=50 ORDER BY a; +SELECT * FROM t1 WHERE a>=50 ORDER BY a; + +--connection server_2 +# Let the preparation transaction complete, so that the same worker thread +# can continue with the transaction T3. +SET DEBUG_SYNC= "now SIGNAL prep_cont"; +SET DEBUG_SYNC= "now WAIT_FOR t3_ready"; +# T3 has now gone to wait for T2 to start committing +SET DEBUG_SYNC= "now SIGNAL t2_cont1"; +SET DEBUG_SYNC= "now WAIT_FOR t2_ready2"; +# T2 has now done mark_start_commit(). +# Let things run, and check that T3 does not get deadlocked. +SET DEBUG_SYNC= "now SIGNAL t1_cont2"; +--sync_with_master + +--connection server_1 +--save_master_pos +--connection server_2 +--sync_with_master +SELECT * FROM t2 WHERE a>=50 ORDER BY a; +SELECT * FROM t1 WHERE a>=50 ORDER BY a; +SET DEBUG_SYNC="reset"; + +# Re-spawn the worker threads to remove any DBUG injections or DEBUG_SYNC. +--source include/stop_slave.inc +SET GLOBAL debug_dbug=@old_dbug; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +--source include/start_slave.inc + + +--echo *** MDEV-7326 Server deadlock in connection with parallel replication *** +# Similar to the previous test, but with T2 and T3 in the same GCO. +# We use three transactions, T1 in one group commit and T2/T3 in another. +# T1 does mark_start_commit(), then gets a deadlock error. +# T2 wakes up and starts running +# T1 does unmark_start_commit() +# T3 goes to wait for T1 to start its commit +# T2 does mark_start_commit() +# The bug was that at this point, T3 got deadlocked. T2 increments the +# count_committing_event_groups but does not signal T3, as they are in +# the same GCO. Then later when T1 increments, it would also not signal +# T3, because now the count_committing_event_groups is not equal to the +# wait_count of T3 (it is one larger). + +--connection server_2 +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=3; +SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid"; +--source include/start_slave.inc + +--connection server_1 +SET @old_format= @@SESSION.binlog_format; +SET binlog_format= STATEMENT; +# This debug_sync will linger on and be used to control T3 later. +INSERT INTO t1 VALUES (foo(60, + "rpl_parallel_start_waiting_for_prior SIGNAL t3_ready", + "rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont")); +--save_master_pos +--connection server_2 +# Wait for the debug_sync point for T3 to be set. But let the preparation +# transaction remain hanging, so that T1 and T2 will be scheduled for the +# remaining two worker threads. +SET DEBUG_SYNC= "now WAIT_FOR prep_ready"; + +--connection server_1 +INSERT INTO t2 VALUES (foo(60, + "rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1", + "rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2")); +--save_master_pos + +--connection server_2 +SET DEBUG_SYNC= "now WAIT_FOR t1_ready1"; +# T1 has now done mark_start_commit(). It will later do a rollback and retry. + +# Do T2 and T3 in a single group commit. +# Use a MyISAM table for T2 and T3, so they do not trigger the +# rpl_parallel_simulate_temp_err_xid DBUG insertion on XID event. +--connection con_temp3 +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1'; +SET binlog_format=statement; +send INSERT INTO t1 VALUES (foo(61, + "rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1", + "rpl_parallel_after_mark_start_commit SIGNAL t2_ready2")); + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued1'; + +--connection con_temp4 +SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2'; +send INSERT INTO t6 VALUES (62); + +--connection server_1 +SET debug_sync='now WAIT_FOR master_queued2'; +SET debug_sync='now SIGNAL master_cont1'; + +--connection con_temp3 +REAP; +--connection con_temp4 +REAP; + +--connection server_1 +SET debug_sync='RESET'; +SET BINLOG_FORMAT= @old_format; +SELECT * FROM t2 WHERE a>=60 ORDER BY a; +SELECT * FROM t1 WHERE a>=60 ORDER BY a; +SELECT * FROM t6 WHERE a>=60 ORDER BY a; + +--connection server_2 +SET DEBUG_SYNC= "now WAIT_FOR t2_ready1"; +# T2 has now started running, but has not yet done mark_start_commit() +SET DEBUG_SYNC= "now SIGNAL t1_cont1"; +SET DEBUG_SYNC= "now WAIT_FOR t1_ready2"; +# T1 has now done unmark_start_commit() in preparation for its retry. + +--connection server_2 +# Let the preparation transaction complete, so that the same worker thread +# can continue with the transaction T3. +SET DEBUG_SYNC= "now SIGNAL prep_cont"; +SET DEBUG_SYNC= "now WAIT_FOR t3_ready"; +# T3 has now gone to wait for T2 to start committing +SET DEBUG_SYNC= "now SIGNAL t2_cont1"; +SET DEBUG_SYNC= "now WAIT_FOR t2_ready2"; +# T2 has now done mark_start_commit(). +# Let things run, and check that T3 does not get deadlocked. +SET DEBUG_SYNC= "now SIGNAL t1_cont2"; +--sync_with_master + +--connection server_1 +--save_master_pos +--connection server_2 +--sync_with_master +SELECT * FROM t2 WHERE a>=60 ORDER BY a; +SELECT * FROM t1 WHERE a>=60 ORDER BY a; +SELECT * FROM t6 WHERE a>=60 ORDER BY a; +SET DEBUG_SYNC="reset"; + +# Re-spawn the worker threads to remove any DBUG injections or DEBUG_SYNC. +--source include/stop_slave.inc +SET GLOBAL debug_dbug=@old_dbug; +SET GLOBAL slave_parallel_threads=0; +SET GLOBAL slave_parallel_threads=10; +--source include/start_slave.inc + +--echo *** MDEV-7335: Potential parallel slave deadlock with specific binlog corruption *** + +--connection server_2 +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads=1; +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug="+d,slave_discard_xid_for_gtid_0_x_1000"; +CALL mtr.add_suppression("Unexpected break of being relay-logged GTID"); + +--connection server_1 +INSERT INTO t2 VALUES (101); +INSERT INTO t2 VALUES (102); +INSERT INTO t2 VALUES (103); +INSERT INTO t2 VALUES (104); +INSERT INTO t2 VALUES (105); +# Inject a partial event group (missing XID at the end). The bug was that such +# partial group was not handled appropriately, leading to server deadlock. +SET gtid_seq_no=1000; +INSERT INTO t2 VALUES (106); +INSERT INTO t2 VALUES (107); +INSERT INTO t2 VALUES (108); +INSERT INTO t2 VALUES (109); +INSERT INTO t2 VALUES (110); +INSERT INTO t2 VALUES (111); +INSERT INTO t2 VALUES (112); +INSERT INTO t2 VALUES (113); +INSERT INTO t2 VALUES (114); +INSERT INTO t2 VALUES (115); +INSERT INTO t2 VALUES (116); +INSERT INTO t2 VALUES (117); +INSERT INTO t2 VALUES (118); +INSERT INTO t2 VALUES (119); +INSERT INTO t2 VALUES (120); +INSERT INTO t2 VALUES (121); +INSERT INTO t2 VALUES (122); +INSERT INTO t2 VALUES (123); +INSERT INTO t2 VALUES (124); +INSERT INTO t2 VALUES (125); +INSERT INTO t2 VALUES (126); +INSERT INTO t2 VALUES (127); +INSERT INTO t2 VALUES (128); +INSERT INTO t2 VALUES (129); +INSERT INTO t2 VALUES (130); +--source include/save_master_gtid.inc + +--connection server_2 +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc +# The partial event group (a=106) should be rolled back and thus missing. +SELECT * FROM t2 WHERE a >= 100 ORDER BY a; + +--source include/stop_slave.inc +SET GLOBAL debug_dbug=@old_dbug; +SET GLOBAL slave_parallel_threads=10; +--source include/start_slave.inc + +--echo *** MDEV-6676 - test syntax of @@slave_parallel_mode *** +--connection server_2 + +--let $status_items= Parallel_Mode +--source include/show_slave_status.inc +--source include/stop_slave.inc +SET GLOBAL slave_parallel_mode='aggressive'; +--let $status_items= Parallel_Mode +--source include/show_slave_status.inc +SET GLOBAL slave_parallel_mode='conservative'; +--let $status_items= Parallel_Mode +--source include/show_slave_status.inc + + +--echo *** MDEV-6676 - test that empty parallel_mode does not replicate in parallel *** +--connection server_1 +INSERT INTO t2 VALUES (1040); +--source include/save_master_gtid.inc + +--connection server_2 +SET GLOBAL slave_parallel_mode='none'; +# Test that we do not use parallel apply, by injecting an unconditional +# crash in the parallel apply code. +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug="+d,slave_crash_if_parallel_apply"; +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc +SELECT * FROM t2 WHERE a >= 1040 ORDER BY a; +--source include/stop_slave.inc +SET GLOBAL debug_dbug=@old_dbug; + +--echo *** MDEV-6676 - test disabling domain-based parallel replication *** +--connection server_1 +# Let's do a bunch of transactions that will conflict if run out-of-order in +# domain-based parallel replication mode. +SET gtid_domain_id = 1; +INSERT INTO t2 VALUES (1041); +INSERT INTO t2 VALUES (1042); +INSERT INTO t2 VALUES (1043); +INSERT INTO t2 VALUES (1044); +INSERT INTO t2 VALUES (1045); +INSERT INTO t2 VALUES (1046); +DELETE FROM t2 WHERE a >= 1041; +SET gtid_domain_id = 2; +INSERT INTO t2 VALUES (1041); +INSERT INTO t2 VALUES (1042); +INSERT INTO t2 VALUES (1043); +INSERT INTO t2 VALUES (1044); +INSERT INTO t2 VALUES (1045); +INSERT INTO t2 VALUES (1046); +SET gtid_domain_id = 0; +--source include/save_master_gtid.inc +--connection server_2 +SET GLOBAL slave_parallel_mode=minimal; +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc +SELECT * FROM t2 WHERE a >= 1040 ORDER BY a; + +--echo *** MDEV-7888: ANALYZE TABLE does wakeup_subsequent_commits(), causing wrong binlog order and parallel replication hang *** + +--connection server_2 +--source include/stop_slave.inc +SET GLOBAL slave_parallel_mode='conservative'; +SET GLOBAL slave_parallel_threads=10; + +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep'; + +--connection server_1 +# Inject two group commits. The bug was that ANALYZE TABLE would call +# wakeup_subsequent_commits() too early, allowing the following transaction +# in the same group to run ahead and binlog and free the GCO. Then we get +# wrong binlog order and later access freed GCO, which causes lost wakeup +# of following GCO and thus replication hang. +# We injected a small sleep in ANALYZE to make the race easier to hit (this +# can only cause false negatives in versions with the bug, not false positives, +# so sleep is ok here. And it's in general not possible to trigger reliably +# the race with debug_sync, since the bugfix makes the race impossible). + +SET @old_dbug_slave= @@SESSION.debug_dbug; +SET SESSION debug_dbug="+d,binlog_force_commit_id"; + +# Group commit with cid=10000, two event groups. +SET @commit_id= 10000; +ANALYZE TABLE t2; +INSERT INTO t3 VALUES (120, 0); + +# Group commit with cid=10001, one event group. +SET @commit_id= 10001; +INSERT INTO t3 VALUES (121, 0); + +SET SESSION debug_dbug=@old_dbug_slave; + +SELECT * FROM t3 WHERE a >= 120 ORDER BY a; +--source include/save_master_gtid.inc + +--connection server_2 +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + +SELECT * FROM t3 WHERE a >= 120 ORDER BY a; + +--source include/stop_slave.inc +SET GLOBAL debug_dbug= @old_dbug; +--source include/start_slave.inc + + +--echo *** MDEV-7929: record_gtid() for non-transactional event group calls wakeup_subsequent_commits() too early, causing slave hang. *** + +--connection server_2 +--source include/stop_slave.inc +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug= '+d,inject_record_gtid_serverid_100_sleep'; + +--connection server_1 +# Inject two group commits. The bug was that record_gtid for a +# non-transactional event group would commit its own transaction, which would +# cause ha_commit_trans() to call wakeup_subsequent_commits() too early. This +# in turn lead to access to freed group_commit_orderer object, losing a wakeup +# and causing slave threads to hang. +# We inject a small sleep in the corresponding record_gtid() to make the race +# easier to hit. + +SET @old_dbug_slave= @@SESSION.debug_dbug; +SET SESSION debug_dbug="+d,binlog_force_commit_id"; + +# Group commit with cid=10010, two event groups. +SET @old_server_id= @@SESSION.server_id; +SET SESSION server_id= 100; +SET @commit_id= 10010; +ALTER TABLE t1 COMMENT "Hulubulu!"; +SET SESSION server_id= @old_server_id; +INSERT INTO t3 VALUES (130, 0); + +# Group commit with cid=10011, one event group. +SET @commit_id= 10011; +INSERT INTO t3 VALUES (131, 0); + +SET SESSION debug_dbug=@old_dbug_slave; +SELECT * FROM t3 WHERE a >= 130 ORDER BY a; +--source include/save_master_gtid.inc + +--connection server_2 +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + +SELECT * FROM t3 WHERE a >= 130 ORDER BY a; + +--source include/stop_slave.inc +SET GLOBAL debug_dbug= @old_dbug; +--source include/start_slave.inc + + +--echo *** MDEV-8031: Parallel replication stops on "connection killed" error (probably incorrectly handled deadlock kill) *** + +--connection server_1 +INSERT INTO t3 VALUES (201,0), (202,0); +--source include/save_master_gtid.inc + +--connection server_2 +--source include/sync_with_master_gtid.inc +--source include/stop_slave.inc +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug= '+d,inject_mdev8031'; + +--connection server_1 +# We artificially create a situation that hopefully resembles the original +# bug which was only seen "in the wild", and only once. +# Setup a fake group commit with lots of conflicts that will lead to deadloc +# kill. The slave DBUG injection causes the slave to be deadlock killed at +# a particular point during the retry, and then later do a small sleep at +# another critical point where the prior transaction then has a chance to +# complete. Finally an extra KILL check catches an unhandled, lingering +# deadlock kill. So rather artificial, but at least it exercises the +# relevant code paths. +SET @old_dbug_slave= @@SESSION.debug_dbug; +SET SESSION debug_dbug="+d,binlog_force_commit_id"; + +SET @commit_id= 10200; +INSERT INTO t3 VALUES (203, 1); +INSERT INTO t3 VALUES (204, 1); +INSERT INTO t3 VALUES (205, 1); +UPDATE t3 SET b=b+1 WHERE a=201; +UPDATE t3 SET b=b+1 WHERE a=201; +UPDATE t3 SET b=b+1 WHERE a=201; +UPDATE t3 SET b=b+1 WHERE a=202; +UPDATE t3 SET b=b+1 WHERE a=202; +UPDATE t3 SET b=b+1 WHERE a=202; +UPDATE t3 SET b=b+1 WHERE a=202; +UPDATE t3 SET b=b+1 WHERE a=203; +UPDATE t3 SET b=b+1 WHERE a=203; +UPDATE t3 SET b=b+1 WHERE a=204; +UPDATE t3 SET b=b+1 WHERE a=204; +UPDATE t3 SET b=b+1 WHERE a=204; +UPDATE t3 SET b=b+1 WHERE a=203; +UPDATE t3 SET b=b+1 WHERE a=205; +UPDATE t3 SET b=b+1 WHERE a=205; +SET SESSION debug_dbug=@old_dbug_slave; + +SELECT * FROM t3 WHERE a>=200 ORDER BY a; +--source include/save_master_gtid.inc + +--connection server_2 +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + +SELECT * FROM t3 WHERE a>=200 ORDER BY a; +--source include/stop_slave.inc +SET GLOBAL debug_dbug= @old_dbug; +--source include/start_slave.inc + + +--echo *** Check getting deadlock killed inside open_binlog() during retry. *** + +--connection server_2 +--source include/stop_slave.inc +SET @old_dbug= @@GLOBAL.debug_dbug; +SET GLOBAL debug_dbug= '+d,inject_retry_event_group_open_binlog_kill'; +SET @old_max= @@GLOBAL.max_relay_log_size; +SET GLOBAL max_relay_log_size= 4096; + +--connection server_1 +SET @old_dbug_slave= @@SESSION.debug_dbug; +SET SESSION debug_dbug="+d,binlog_force_commit_id"; + +--let $large= `SELECT REPEAT("*", 8192)` +SET @commit_id= 10210; +--echo Omit long queries that cause relaylog rotations and transaction retries... +--disable_query_log +eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=201 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=202 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=204 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=203 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=205 /* $large */; +eval UPDATE t3 SET b=b+1 WHERE a=205 /* $large */; +--enable_query_log +SET SESSION debug_dbug=@old_dbug_slave; + +SELECT * FROM t3 WHERE a>=200 ORDER BY a; +--source include/save_master_gtid.inc + +--connection server_2 +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + +SELECT * FROM t3 WHERE a>=200 ORDER BY a; +--source include/stop_slave.inc +SET GLOBAL debug_dbug= @old_dbug; +SET GLOBAL max_relay_log_size= @old_max; +--source include/start_slave.inc + +--echo *** MDEV-8725: Assertion on ROLLBACK statement in the binary log *** +--connection server_1 +# Inject an event group terminated by ROLLBACK, by mixing MyISAM and InnoDB +# in a transaction. The bug was an assertion on the ROLLBACK due to +# mark_start_commit() being already called. +--disable_warnings +BEGIN; +INSERT INTO t2 VALUES (2000); +INSERT INTO t1 VALUES (2000); +INSERT INTO t2 VALUES (2001); +ROLLBACK; +--enable_warnings +SELECT * FROM t1 WHERE a>=2000 ORDER BY a; +SELECT * FROM t2 WHERE a>=2000 ORDER BY a; +--source include/save_master_gtid.inc + +--connection server_2 +--source include/sync_with_master_gtid.inc +SELECT * FROM t1 WHERE a>=2000 ORDER BY a; +SELECT * FROM t2 WHERE a>=2000 ORDER BY a; + + +# Clean up. +--connection server_2 +--source include/stop_slave.inc +SET GLOBAL slave_parallel_threads=@old_parallel_threads; +--source include/start_slave.inc +SET DEBUG_SYNC= 'RESET'; + +--connection server_1 +DROP function foo; +DROP TABLE t1,t2,t3,t4,t5,t6; +SET DEBUG_SYNC= 'RESET'; + +--source include/rpl_end.inc From 91e5e47a50134a7375d832d75a1d3febfcfc9671 Mon Sep 17 00:00:00 2001 From: Aleksey Midenkov Date: Thu, 23 Mar 2023 21:07:32 +0300 Subject: [PATCH 064/260] MDEV-30421 more tests cleaned up All the .inc files that included from binlog_encryption are refactored. --- .../binlog_encryption/rpl_binlog_errors.test | 2 +- .../rpl_cant_read_event_incident.test | 2 +- .../suite/binlog_encryption/rpl_checksum.test | 2 +- .../binlog_encryption/rpl_checksum_cache.test | 2 +- .../binlog_encryption/rpl_corruption.test | 2 +- .../binlog_encryption/rpl_gtid_basic.result | 24 + .../binlog_encryption/rpl_gtid_basic.test | 2 +- .../suite/binlog_encryption/rpl_incident.test | 2 +- .../rpl_init_slave_errors.test | 2 +- .../binlog_encryption/rpl_loaddata_local.test | 2 +- .../suite/binlog_encryption/rpl_loadfile.test | 2 +- .../suite/binlog_encryption/rpl_packet.test | 2 +- .../rpl_parallel_ignored_errors.test | 2 +- ...arallel_show_binlog_events_purge_logs.test | 2 +- .../binlog_encryption/rpl_relayrotate.test | 2 +- .../binlog_encryption/rpl_semi_sync.test | 2 +- .../rpl_skip_replication.test | 2 +- .../rpl_special_charset.test | 2 +- .../rpl_sporadic_master.test | 2 +- .../suite/binlog_encryption/rpl_ssl.test | 2 +- .../rpl_stm_relay_ign_space.test | 2 +- .../rpl_switch_stm_row_mixed.test | 2 +- .../suite/binlog_encryption/rpl_sync.test | 2 +- ...pl_temporal_format_default_to_default.test | 2 +- ..._temporal_format_mariadb53_to_mysql56.test | 2 +- ..._temporal_format_mysql56_to_mariadb53.test | 2 +- .../suite/binlog_encryption/rpl_typeconv.test | 2 +- .../funcs/t/rpl_switch_stm_row_mixed.test | 2 +- .../suite/rpl/include/rpl_binlog_errors.inc | 438 ------------ .../include/rpl_cant_read_event_incident.inc | 83 --- mysql-test/suite/rpl/include/rpl_checksum.inc | 335 --------- .../suite/rpl/include/rpl_checksum_cache.inc | 261 ------- .../suite/rpl/include/rpl_corruption.inc | 175 ----- .../suite/rpl/include/rpl_gtid_basic.inc | 572 ---------------- mysql-test/suite/rpl/include/rpl_incident.inc | 61 -- .../rpl/include/rpl_init_slave_errors.inc | 96 --- mysql-test/suite/rpl/include/rpl_loadfile.inc | 120 ---- mysql-test/suite/rpl/include/rpl_packet.inc | 184 ----- .../include/rpl_parallel_ignored_errors.inc | 112 ---- ...parallel_show_binlog_events_purge_logs.inc | 38 -- .../suite/rpl/include/rpl_relayrotate.inc | 18 - .../suite/rpl/include/rpl_semi_sync.inc | 525 --------------- .../rpl/include/rpl_skip_replication.inc | 402 ----------- .../suite/rpl/include/rpl_special_charset.inc | 32 - .../suite/rpl/include/rpl_sporadic_master.inc | 32 - mysql-test/suite/rpl/include/rpl_ssl.inc | 116 ---- .../rpl/include/rpl_stm_relay_ign_space.inc | 107 --- .../rpl/include/rpl_switch_stm_row_mixed.inc | 633 ----------------- .../suite/rpl/include/rpl_sync_test.inc | 159 ----- ...rpl_temporal_format_default_to_default.inc | 82 --- mysql-test/suite/rpl/include/rpl_typeconv.inc | 78 --- mysql-test/suite/rpl/t/rpl_binlog_errors.test | 439 +++++++++++- .../rpl/t/rpl_cant_read_event_incident.test | 84 ++- mysql-test/suite/rpl/t/rpl_checksum.test | 336 +++++++++- .../suite/rpl/t/rpl_checksum_cache.test | 262 +++++++- mysql-test/suite/rpl/t/rpl_corruption.test | 176 ++++- mysql-test/suite/rpl/t/rpl_gtid_basic.test | 573 +++++++++++++++- mysql-test/suite/rpl/t/rpl_incident.test | 62 +- .../suite/rpl/t/rpl_init_slave_errors.test | 97 ++- .../rpl_loaddata_local.test} | 0 mysql-test/suite/rpl/t/rpl_loaddatalocal.test | 1 - mysql-test/suite/rpl/t/rpl_loadfile.test | 121 +++- mysql-test/suite/rpl/t/rpl_packet.test | 185 ++++- .../rpl/t/rpl_parallel_ignored_errors.test | 113 +++- ...arallel_show_binlog_events_purge_logs.test | 39 +- mysql-test/suite/rpl/t/rpl_relayrotate.test | 19 +- mysql-test/suite/rpl/t/rpl_semi_sync.test | 526 ++++++++++++++- .../suite/rpl/t/rpl_skip_replication.test | 403 ++++++++++- .../suite/rpl/t/rpl_special_charset.test | 33 +- .../suite/rpl/t/rpl_sporadic_master.test | 33 +- mysql-test/suite/rpl/t/rpl_ssl.test | 117 +++- .../suite/rpl/t/rpl_stm_relay_ign_space.test | 108 ++- .../suite/rpl/t/rpl_switch_stm_row_mixed.test | 634 +++++++++++++++++- mysql-test/suite/rpl/t/rpl_sync.test | 159 ++++- ...pl_temporal_format_default_to_default.test | 83 ++- mysql-test/suite/rpl/t/rpl_typeconv.test | 79 ++- 76 files changed, 4709 insertions(+), 4710 deletions(-) delete mode 100644 mysql-test/suite/rpl/include/rpl_binlog_errors.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_cant_read_event_incident.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_checksum.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_checksum_cache.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_corruption.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_gtid_basic.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_incident.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_init_slave_errors.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_loadfile.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_packet.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_parallel_ignored_errors.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_parallel_show_binlog_events_purge_logs.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_relayrotate.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_semi_sync.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_skip_replication.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_special_charset.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_sporadic_master.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_ssl.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_stm_relay_ign_space.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_sync_test.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_temporal_format_default_to_default.inc delete mode 100644 mysql-test/suite/rpl/include/rpl_typeconv.inc rename mysql-test/suite/rpl/{include/rpl_loaddata_local.inc => t/rpl_loaddata_local.test} (100%) delete mode 100644 mysql-test/suite/rpl/t/rpl_loaddatalocal.test diff --git a/mysql-test/suite/binlog_encryption/rpl_binlog_errors.test b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.test index c2a7ec9d27a..25849c111a7 100644 --- a/mysql-test/suite/binlog_encryption/rpl_binlog_errors.test +++ b/mysql-test/suite/binlog_encryption/rpl_binlog_errors.test @@ -1,2 +1,2 @@ --let $binlog_limit= 5,1 ---source suite/rpl/include/rpl_binlog_errors.inc +--source suite/rpl/t/rpl_binlog_errors.test diff --git a/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.test b/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.test index acbe0d59a5e..406af58c03b 100644 --- a/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.test +++ b/mysql-test/suite/binlog_encryption/rpl_cant_read_event_incident.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_cant_read_event_incident.inc +--source suite/rpl/t/rpl_cant_read_event_incident.test diff --git a/mysql-test/suite/binlog_encryption/rpl_checksum.test b/mysql-test/suite/binlog_encryption/rpl_checksum.test index ca8cdc06726..a2abd019e24 100644 --- a/mysql-test/suite/binlog_encryption/rpl_checksum.test +++ b/mysql-test/suite/binlog_encryption/rpl_checksum.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_checksum.inc +--source suite/rpl/t/rpl_checksum.test diff --git a/mysql-test/suite/binlog_encryption/rpl_checksum_cache.test b/mysql-test/suite/binlog_encryption/rpl_checksum_cache.test index 8fa44136fc2..56fb2be0ce3 100644 --- a/mysql-test/suite/binlog_encryption/rpl_checksum_cache.test +++ b/mysql-test/suite/binlog_encryption/rpl_checksum_cache.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_checksum_cache.inc +--source suite/rpl/t/rpl_checksum_cache.test diff --git a/mysql-test/suite/binlog_encryption/rpl_corruption.test b/mysql-test/suite/binlog_encryption/rpl_corruption.test index 1abf2c882ec..f6ba2944398 100644 --- a/mysql-test/suite/binlog_encryption/rpl_corruption.test +++ b/mysql-test/suite/binlog_encryption/rpl_corruption.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_corruption.inc +--source suite/rpl/t/rpl_corruption.test diff --git a/mysql-test/suite/binlog_encryption/rpl_gtid_basic.result b/mysql-test/suite/binlog_encryption/rpl_gtid_basic.result index 4e17669605f..0e066fc0418 100644 --- a/mysql-test/suite/binlog_encryption/rpl_gtid_basic.result +++ b/mysql-test/suite/binlog_encryption/rpl_gtid_basic.result @@ -558,3 +558,27 @@ a connection server_1; DROP TABLE t1; include/rpl_end.inc +# +# Start of 10.2 tests +# +# +# MDEV-10134 Add full support for DEFAULT +# +CREATE TABLE t1 (a VARCHAR(100) DEFAULT BINLOG_GTID_POS("master-bin.000001", 600)); +ERROR HY000: Function or expression 'binlog_gtid_pos()' cannot be used in the DEFAULT clause of `a` +# +# End of 10.2 tests +# +# +# Start of 10.3 tests +# +# +# MDEV-13967 Parameter data type control for Item_long_func +# +SELECT MASTER_GTID_WAIT(ROW(1,1),'str'); +ERROR HY000: Illegal parameter data type row for operation 'master_gtid_wait' +SELECT MASTER_GTID_WAIT('str',ROW(1,1)); +ERROR HY000: Illegal parameter data type row for operation 'master_gtid_wait' +# +# End of 10.3 tests +# diff --git a/mysql-test/suite/binlog_encryption/rpl_gtid_basic.test b/mysql-test/suite/binlog_encryption/rpl_gtid_basic.test index b9f5a18a588..b183c1d4b4e 100644 --- a/mysql-test/suite/binlog_encryption/rpl_gtid_basic.test +++ b/mysql-test/suite/binlog_encryption/rpl_gtid_basic.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_gtid_basic.inc +--source suite/rpl/t/rpl_gtid_basic.test diff --git a/mysql-test/suite/binlog_encryption/rpl_incident.test b/mysql-test/suite/binlog_encryption/rpl_incident.test index b6d2a24a71e..5a707774f3c 100644 --- a/mysql-test/suite/binlog_encryption/rpl_incident.test +++ b/mysql-test/suite/binlog_encryption/rpl_incident.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_incident.inc +--source suite/rpl/t/rpl_incident.test diff --git a/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.test b/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.test index 872b8cd3598..532db963e63 100644 --- a/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.test +++ b/mysql-test/suite/binlog_encryption/rpl_init_slave_errors.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_init_slave_errors.inc +--source suite/rpl/t/rpl_init_slave_errors.test diff --git a/mysql-test/suite/binlog_encryption/rpl_loaddata_local.test b/mysql-test/suite/binlog_encryption/rpl_loaddata_local.test index 9e0bb9598bf..35ad09647a6 100644 --- a/mysql-test/suite/binlog_encryption/rpl_loaddata_local.test +++ b/mysql-test/suite/binlog_encryption/rpl_loaddata_local.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_loaddata_local.inc +--source suite/rpl/t/rpl_loaddata_local.test diff --git a/mysql-test/suite/binlog_encryption/rpl_loadfile.test b/mysql-test/suite/binlog_encryption/rpl_loadfile.test index 84e6ecd7a0d..235c4a3d29e 100644 --- a/mysql-test/suite/binlog_encryption/rpl_loadfile.test +++ b/mysql-test/suite/binlog_encryption/rpl_loadfile.test @@ -1,4 +1,4 @@ ---source suite/rpl/include/rpl_loadfile.inc +--source suite/rpl/t/rpl_loadfile.test --let $datadir= `SELECT @@datadir` diff --git a/mysql-test/suite/binlog_encryption/rpl_packet.test b/mysql-test/suite/binlog_encryption/rpl_packet.test index 43637314236..28beae1a91c 100644 --- a/mysql-test/suite/binlog_encryption/rpl_packet.test +++ b/mysql-test/suite/binlog_encryption/rpl_packet.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_packet.inc +--source suite/rpl/t/rpl_packet.test diff --git a/mysql-test/suite/binlog_encryption/rpl_parallel_ignored_errors.test b/mysql-test/suite/binlog_encryption/rpl_parallel_ignored_errors.test index 8a26778c8f2..0c3e5386930 100644 --- a/mysql-test/suite/binlog_encryption/rpl_parallel_ignored_errors.test +++ b/mysql-test/suite/binlog_encryption/rpl_parallel_ignored_errors.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_parallel_ignored_errors.inc +--source suite/rpl/t/rpl_parallel_ignored_errors.test diff --git a/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.test b/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.test index 7bdfaaf9adb..e342e4d61ff 100644 --- a/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.test +++ b/mysql-test/suite/binlog_encryption/rpl_parallel_show_binlog_events_purge_logs.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_parallel_show_binlog_events_purge_logs.inc +--source suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test diff --git a/mysql-test/suite/binlog_encryption/rpl_relayrotate.test b/mysql-test/suite/binlog_encryption/rpl_relayrotate.test index e52f5159fcc..a8dabdc3e8d 100644 --- a/mysql-test/suite/binlog_encryption/rpl_relayrotate.test +++ b/mysql-test/suite/binlog_encryption/rpl_relayrotate.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_relayrotate.inc +--source suite/rpl/t/rpl_relayrotate.test diff --git a/mysql-test/suite/binlog_encryption/rpl_semi_sync.test b/mysql-test/suite/binlog_encryption/rpl_semi_sync.test index dfc68b699c0..2e0907cce30 100644 --- a/mysql-test/suite/binlog_encryption/rpl_semi_sync.test +++ b/mysql-test/suite/binlog_encryption/rpl_semi_sync.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_semi_sync.inc +--source suite/rpl/t/rpl_semi_sync.test diff --git a/mysql-test/suite/binlog_encryption/rpl_skip_replication.test b/mysql-test/suite/binlog_encryption/rpl_skip_replication.test index 40992586c7c..11c5b33b362 100644 --- a/mysql-test/suite/binlog_encryption/rpl_skip_replication.test +++ b/mysql-test/suite/binlog_encryption/rpl_skip_replication.test @@ -1,2 +1,2 @@ --let $use_remote_mysqlbinlog= 1 ---source suite/rpl/include/rpl_skip_replication.inc +--source suite/rpl/t/rpl_skip_replication.test diff --git a/mysql-test/suite/binlog_encryption/rpl_special_charset.test b/mysql-test/suite/binlog_encryption/rpl_special_charset.test index eb697204860..c74f8915798 100644 --- a/mysql-test/suite/binlog_encryption/rpl_special_charset.test +++ b/mysql-test/suite/binlog_encryption/rpl_special_charset.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_special_charset.inc +--source suite/rpl/t/rpl_special_charset.test diff --git a/mysql-test/suite/binlog_encryption/rpl_sporadic_master.test b/mysql-test/suite/binlog_encryption/rpl_sporadic_master.test index 0dab68a4b08..1e3992dc5d9 100644 --- a/mysql-test/suite/binlog_encryption/rpl_sporadic_master.test +++ b/mysql-test/suite/binlog_encryption/rpl_sporadic_master.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_sporadic_master.inc +--source suite/rpl/t/rpl_sporadic_master.test diff --git a/mysql-test/suite/binlog_encryption/rpl_ssl.test b/mysql-test/suite/binlog_encryption/rpl_ssl.test index 9a4788c1d2d..fb30d83ab5e 100644 --- a/mysql-test/suite/binlog_encryption/rpl_ssl.test +++ b/mysql-test/suite/binlog_encryption/rpl_ssl.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_ssl.inc +--source suite/rpl/t/rpl_ssl.test diff --git a/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.test b/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.test index 45d18a25410..d5a08bde969 100644 --- a/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.test +++ b/mysql-test/suite/binlog_encryption/rpl_stm_relay_ign_space.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_stm_relay_ign_space.inc +--source suite/rpl/t/rpl_stm_relay_ign_space.test diff --git a/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.test b/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.test index 2a16d90f9ad..c65cc202ba2 100644 --- a/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.test +++ b/mysql-test/suite/binlog_encryption/rpl_switch_stm_row_mixed.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_switch_stm_row_mixed.inc +--source suite/rpl/t/rpl_switch_stm_row_mixed.test diff --git a/mysql-test/suite/binlog_encryption/rpl_sync.test b/mysql-test/suite/binlog_encryption/rpl_sync.test index 8dbd6ff254b..1ff72228565 100644 --- a/mysql-test/suite/binlog_encryption/rpl_sync.test +++ b/mysql-test/suite/binlog_encryption/rpl_sync.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_sync_test.inc +--source suite/rpl/t/rpl_sync.test diff --git a/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.test b/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.test index 30f5f247c23..5a9a79bad42 100644 --- a/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.test +++ b/mysql-test/suite/binlog_encryption/rpl_temporal_format_default_to_default.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_temporal_format_default_to_default.inc +--source suite/rpl/t/rpl_temporal_format_default_to_default.test diff --git a/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.test b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.test index 68afb4148ef..b9576b30f92 100644 --- a/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.test +++ b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mariadb53_to_mysql56.test @@ -3,4 +3,4 @@ --let $force_master_mysql56_temporal_format=false; --let $force_slave_mysql56_temporal_format=true; ---source suite/rpl/include/rpl_temporal_format_default_to_default.inc +--source suite/rpl/t/rpl_temporal_format_default_to_default.test diff --git a/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.test b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.test index 96d928fcf08..7d09942814e 100644 --- a/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.test +++ b/mysql-test/suite/binlog_encryption/rpl_temporal_format_mysql56_to_mariadb53.test @@ -1,4 +1,4 @@ --let $force_master_mysql56_temporal_format=true; --let $force_slave_mysql56_temporal_format=false; ---source suite/rpl/include/rpl_temporal_format_default_to_default.inc +--source suite/rpl/t/rpl_temporal_format_default_to_default.test diff --git a/mysql-test/suite/binlog_encryption/rpl_typeconv.test b/mysql-test/suite/binlog_encryption/rpl_typeconv.test index fe56a148256..6761cddfb87 100644 --- a/mysql-test/suite/binlog_encryption/rpl_typeconv.test +++ b/mysql-test/suite/binlog_encryption/rpl_typeconv.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_typeconv.inc +--source suite/rpl/t/rpl_typeconv.test diff --git a/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test index 2a16d90f9ad..c65cc202ba2 100644 --- a/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test +++ b/mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test @@ -1 +1 @@ ---source suite/rpl/include/rpl_switch_stm_row_mixed.inc +--source suite/rpl/t/rpl_switch_stm_row_mixed.test diff --git a/mysql-test/suite/rpl/include/rpl_binlog_errors.inc b/mysql-test/suite/rpl/include/rpl_binlog_errors.inc deleted file mode 100644 index bf92736a2af..00000000000 --- a/mysql-test/suite/rpl/include/rpl_binlog_errors.inc +++ /dev/null @@ -1,438 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# -# Usage: -# --let $binlog_limit= X[,Y] # optional -# -# Semantics of the value is the same as in include/show_binlog_events.inc -# which the script calls as a part of the test flow. -# The goal is to print the event demonstrating the triggered error, -# so normally Y should be 1 (print the exact event only); -# however, depending on test-specific server options, the offset X -# can be different. -# - -# BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error -# when generating new name. -# -# WHY -# === -# -# We want to check whether error is reported or not when -# new_file_impl fails (this may happen when rotation is not -# possible because there is some problem finding an -# unique filename). -# -# HOW -# === -# -# Test cases are documented inline. - --- source include/have_innodb.inc --- source include/have_debug.inc --- source include/master-slave.inc - --- echo ####################################################################### --- echo ####################### PART 1: MASTER TESTS ########################## --- echo ####################################################################### - - -### ACTION: stopping slave as it is not needed for the first part of -### the test - --- connection slave --- source include/stop_slave.inc --- connection master - -call mtr.add_suppression("Can't generate a unique log-filename"); -call mtr.add_suppression("Writing one row to the row-based binary log failed.*"); -call mtr.add_suppression("Error writing file .*"); -call mtr.add_suppression("Could not use master-bin for logging"); - -SET @old_debug= @@global.debug_dbug; - -### ACTION: create a large file (> 4096 bytes) that will be later used -### in LOAD DATA INFILE to check binlog errors in its vacinity --- let $load_file= $MYSQLTEST_VARDIR/tmp/bug_46166.data --- let $MYSQLD_DATADIR= `select @@datadir` --- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --- eval SELECT repeat('x',8192) INTO OUTFILE '$load_file' - -### ACTION: create a small file (< 4096 bytes) that will be later used -### in LOAD DATA INFILE to check for absence of binlog errors -### when file loading this file does not force flushing and -### rotating the binary log --- let $load_file2= $MYSQLTEST_VARDIR/tmp/bug_46166-2.data --- let $MYSQLD_DATADIR= `select @@datadir` --- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --- eval SELECT repeat('x',10) INTO OUTFILE '$load_file2' - -RESET MASTER; - --- echo ###################### TEST #1 - -### ASSERTION: no problem flushing logs (should show two binlogs) -FLUSH LOGS; --- echo # assert: must show two binlogs --- source include/show_binary_logs.inc - --- echo ###################### TEST #2 - -### ASSERTION: check that FLUSH LOGS actually fails and reports -### failure back to the user if find_uniq_filename fails -### (should show just one binlog) - -RESET MASTER; -SET @@global.debug_dbug="d,error_unique_log_filename"; --- error ER_NO_UNIQUE_LOGFILE -FLUSH LOGS; --- echo # assert: must show one binlog --- source include/show_binary_logs.inc - -### ACTION: clean up and move to next test -SET @@global.debug_dbug=@old_debug; -RESET MASTER; - --- echo ###################### TEST #3 - -### ACTION: create some tables (t1, t2, t4) and insert some values in -### table t1 -CREATE TABLE t1 (a INT); -CREATE TABLE t2 (a VARCHAR(16384)) Engine=InnoDB; -CREATE TABLE t4 (a VARCHAR(16384)); -INSERT INTO t1 VALUES (1); -RESET MASTER; - -### ASSERTION: we force rotation of the binary log because it exceeds -### the max_binlog_size option (should show two binary -### logs) - --- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 - -# shows two binary logs --- echo # assert: must show two binlog --- source include/show_binary_logs.inc - -# clean up the table and the binlog to be used in next part of test -SET @@global.debug_dbug=@old_debug; -DELETE FROM t2; -RESET MASTER; - --- echo ###################### TEST #4 - -### ASSERTION: load the big file into a transactional table and check -### that it reports error. The table will contain the -### changes performed despite the fact that it reported an -### error. - -SET @@global.debug_dbug="d,error_unique_log_filename"; --- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --- error ER_NO_UNIQUE_LOGFILE --- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 - -# show table --- echo # assert: must show one entry -SELECT count(*) FROM t2; - -# clean up the table and the binlog to be used in next part of test -SET @@global.debug_dbug=@old_debug; -DELETE FROM t2; -RESET MASTER; - --- echo ###################### TEST #5 - -### ASSERTION: load the small file into a transactional table and -### check that it succeeds - -SET @@global.debug_dbug="d,error_unique_log_filename"; --- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --- eval LOAD DATA INFILE '$load_file2' INTO TABLE t2 - -# show table --- echo # assert: must show one entry -SELECT count(*) FROM t2; - -# clean up the table and the binlog to be used in next part of test -SET @@global.debug_dbug=@old_debug; -DELETE FROM t2; -RESET MASTER; - --- echo ###################### TEST #6 - -### ASSERTION: check that even if one is using a transactional table -### and explicit transactions (no autocommit) if rotation -### fails we get the error. Transaction is not rolledback -### because rotation happens after the commit. - -SET @@global.debug_dbug="d,error_unique_log_filename"; -SET AUTOCOMMIT=0; -INSERT INTO t2 VALUES ('muse'); --- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 -INSERT INTO t2 VALUES ('muse'); --- error ER_NO_UNIQUE_LOGFILE -COMMIT; - -### ACTION: Show the contents of the table after the test --- echo # assert: must show three entries -SELECT count(*) FROM t2; - -### ACTION: clean up and move to the next test -SET AUTOCOMMIT= 1; -SET @@global.debug_dbug=@old_debug; -DELETE FROM t2; -RESET MASTER; - --- echo ###################### TEST #7 - -### ASSERTION: check that on a non-transactional table, if rotation -### fails then an error is reported and an incident event -### is written to the current binary log. - -SET @@global.debug_dbug="d,error_unique_log_filename"; - -# Disable logging Annotate_rows events to preserve events count. -let $binlog_annotate_row_events_saved= `SELECT @@binlog_annotate_row_events`; -SET @@binlog_annotate_row_events= 0; - -SELECT count(*) FROM t4; --- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --- error ER_NO_UNIQUE_LOGFILE --- eval LOAD DATA INFILE '$load_file' INTO TABLE t4 - --- echo # assert: must show 1 entry -SELECT count(*) FROM t4; - --- echo ### check that the incident event is written to the current log -SET @@global.debug_dbug=@old_debug; -if (!$binlog_limit) -{ - -- let $binlog_limit= 4,1 -} --- source include/show_binlog_events.inc - -# clean up and move to next test -DELETE FROM t4; - ---disable_query_log -eval SET @@binlog_annotate_row_events= $binlog_annotate_row_events_saved; ---enable_query_log - -RESET MASTER; - --- echo ###################### TEST #8 - -### ASSERTION: check that statements end up in error but they succeed -### on changing the data. - -SET @@global.debug_dbug="d,error_unique_log_filename"; --- echo # must show 0 entries -SELECT count(*) FROM t4; -SELECT count(*) FROM t2; - --- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --- error ER_NO_UNIQUE_LOGFILE --- eval LOAD DATA INFILE '$load_file' INTO TABLE t4 --- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --- error ER_NO_UNIQUE_LOGFILE --- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 --- error ER_NO_UNIQUE_LOGFILE -INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'); - --- echo # INFO: Count(*) Before Offending DELETEs --- echo # assert: must show 1 entry -SELECT count(*) FROM t4; --- echo # assert: must show 4 entries -SELECT count(*) FROM t2; - --- error ER_NO_UNIQUE_LOGFILE -DELETE FROM t4; --- error ER_NO_UNIQUE_LOGFILE -DELETE FROM t2; - --- echo # INFO: Count(*) After Offending DELETEs --- echo # assert: must show zero entries -SELECT count(*) FROM t4; -SELECT count(*) FROM t2; - -# remove fault injection -SET @@global.debug_dbug=@old_debug; - --- echo ###################### TEST #9 - -### ASSERTION: check that if we disable binlogging, then statements -### succeed. -SET @@global.debug_dbug="d,error_unique_log_filename"; -SET SQL_LOG_BIN=0; -INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd'); -INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh'); --- echo # assert: must show four entries -SELECT count(*) FROM t2; -SELECT count(*) FROM t4; -DELETE FROM t2; -DELETE FROM t4; --- echo # assert: must show zero entries -SELECT count(*) FROM t2; -SELECT count(*) FROM t4; -SET SQL_LOG_BIN=1; -SET @@global.debug_dbug=@old_debug; - --- echo ###################### TEST #10 - -### ASSERTION: check that error is reported if there is a failure -### while registering the index file and the binary log -### file or failure to write the rotate event. - -call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file."); -call mtr.add_suppression("Could not use .*"); - -RESET MASTER; -SHOW WARNINGS; - -# +d,fault_injection_registering_index => injects fault on MYSQL_BIN_LOG::open -SET @@global.debug_dbug="d,fault_injection_registering_index"; --- replace_regex /\.[\\\/]master/master/ --- error ER_CANT_OPEN_FILE -FLUSH LOGS; -SET @@global.debug_dbug=@old_debug; - --- error ER_NO_BINARY_LOGGING -SHOW BINARY LOGS; - -# issue some statements and check that they don't fail -CREATE TABLE t5 (a INT); -INSERT INTO t4 VALUES ('bbbbb'); -INSERT INTO t2 VALUES ('aaaaa'); -DELETE FROM t4; -DELETE FROM t2; -DROP TABLE t5; -flush tables; - --- echo ###################### TEST #11 - -### ASSERTION: check that error is reported if there is a failure -### while opening the index file and the binary log file or -### failure to write the rotate event. - -# restart the server so that we have binlog again ---let $rpl_server_number= 1 ---source include/rpl_restart_server.inc - -# +d,fault_injection_openning_index => injects fault on MYSQL_BIN_LOG::open_index_file -SET @@global.debug_dbug="d,fault_injection_openning_index"; --- replace_regex /\.[\\\/]master/master/ --- error ER_CANT_OPEN_FILE -FLUSH LOGS; -SET @@global.debug_dbug=@old_debug; - --- error ER_FLUSH_MASTER_BINLOG_CLOSED -RESET MASTER; - -# issue some statements and check that they don't fail -CREATE TABLE t5 (a INT); -INSERT INTO t4 VALUES ('bbbbb'); -INSERT INTO t2 VALUES ('aaaaa'); -DELETE FROM t4; -DELETE FROM t2; -DROP TABLE t5; -flush tables; - -# restart the server so that we have binlog again ---let $rpl_server_number= 1 ---source include/rpl_restart_server.inc - --- echo ###################### TEST #12 - -### ASSERTION: check that error is reported if there is a failure -### while writing the rotate event when creating a new log -### file. - -# +d,fault_injection_new_file_rotate_event => injects fault on MYSQL_BIN_LOG::MYSQL_BIN_LOG::new_file_impl -SET @@global.debug_dbug="d,fault_injection_new_file_rotate_event"; --- error ER_ERROR_ON_WRITE -FLUSH LOGS; -SET @@global.debug_dbug=@old_debug; - --- error ER_FLUSH_MASTER_BINLOG_CLOSED -RESET MASTER; - -# issue some statements and check that they don't fail -CREATE TABLE t5 (a INT); -INSERT INTO t4 VALUES ('bbbbb'); -INSERT INTO t2 VALUES ('aaaaa'); -DELETE FROM t4; -DELETE FROM t2; -DROP TABLE t5; -flush tables; - -# restart the server so that we have binlog again ---let $rpl_server_number= 1 ---source include/rpl_restart_server.inc - -## clean up -DROP TABLE t1, t2, t4; -RESET MASTER; - -# restart slave again --- connection slave --- source include/start_slave.inc --- connection master - --- echo ####################################################################### --- echo ####################### PART 2: SLAVE TESTS ########################### --- echo ####################################################################### - -### setup ---source include/rpl_reset.inc --- connection slave - -# slave suppressions - -call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*"); -call mtr.add_suppression("Error writing file .*"); -call mtr.add_suppression("Could not use .*"); -call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file."); -call mtr.add_suppression("Can't generate a unique log-filename .*"); --- echo ###################### TEST #13 - -#### ASSERTION: check against unique log filename error --- let $io_thd_injection_fault_flag= error_unique_log_filename --- let $slave_io_errno= 1595 --- let $show_slave_io_error= 1 --- source include/io_thd_fault_injection.inc - --- echo ###################### TEST #14 - -#### ASSERTION: check against rotate failing --- let $io_thd_injection_fault_flag= fault_injection_new_file_rotate_event --- let $slave_io_errno= 1595 --- let $show_slave_io_error= 1 --- source include/io_thd_fault_injection.inc - --- echo ###################### TEST #15 - -#### ASSERTION: check against relay log open failure --- let $io_thd_injection_fault_flag= fault_injection_registering_index --- let $slave_io_errno= 1595 --- let $show_slave_io_error= 1 --- source include/io_thd_fault_injection.inc - --- echo ###################### TEST #16 - -#### ASSERTION: check against relay log index open failure --- let $io_thd_injection_fault_flag= fault_injection_openning_index --- let $slave_io_errno= 1595 --- let $show_slave_io_error= 1 --- source include/io_thd_fault_injection.inc - -### clean up --- source include/stop_slave_sql.inc -RESET SLAVE; -RESET MASTER; ---remove_file $load_file ---remove_file $load_file2 ---let $rpl_only_running_threads= 1 ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_cant_read_event_incident.inc b/mysql-test/suite/rpl/include/rpl_cant_read_event_incident.inc deleted file mode 100644 index 7dfef023947..00000000000 --- a/mysql-test/suite/rpl/include/rpl_cant_read_event_incident.inc +++ /dev/null @@ -1,83 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - -# -# Bug#11747416 : 32228 A disk full makes binary log corrupt. -# -# -# The test demonstrates reading from binlog error propagation to slave -# and reporting there. -# Conditions for the bug include a crash at time of the last event to -# the binlog was written partly. With the fixes the event is not sent out -# any longer, but rather the dump thread sends out a sound error message. -# -# Crash is not simulated. A binlog with partly written event in its end is installed -# and replication is started from it. -# - ---source include/have_binlog_format_mixed.inc ---source include/master-slave.inc - ---connection slave -# Make sure the slave is stopped while we are messing with master. -# Otherwise we get occasional failures as the slave manages to re-connect -# to the newly started master and we get extra events applied, causing -# conflicts. ---source include/stop_slave.inc - ---connection master -call mtr.add_suppression("Error in Log_event::read_log_event()"); ---let $datadir= `SELECT @@datadir` - ---let $rpl_server_number= 1 ---source include/rpl_stop_server.inc - ---remove_file $datadir/master-bin.000001 ---copy_file $MYSQL_TEST_DIR/std_data/bug11747416_32228_binlog.000001 $datadir/master-bin.000001 - ---let $rpl_server_number= 1 ---source include/rpl_start_server.inc - ---source include/wait_until_connected_again.inc - -# evidence of the partial binlog ---error ER_ERROR_WHEN_EXECUTING_COMMAND -show binlog events; - ---connection slave -call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log"); -reset slave; -start slave; - -# ER_MASTER_FATAL_ERROR_READING_BINLOG 1236 ---let $slave_param=Last_IO_Errno ---let $slave_param_value=1236 ---source include/wait_for_slave_param.inc - ---let $slave_field_result_replace= / at [0-9]*/ at XXX/ ---let $status_items= Last_IO_Errno, Last_IO_Error ---source include/show_slave_status.inc - -# -# Cleanup -# - ---connection master -reset master; - ---connection slave -stop slave; -reset slave; -# Table was created from binlog, it may not be created if SQL thread is running -# slowly and IO thread reaches incident before SQL thread applies it. ---disable_warnings -drop table if exists t; ---enable_warnings -reset master; - ---echo End of the tests ---let $rpl_only_running_threads= 1 ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_checksum.inc b/mysql-test/suite/rpl/include/rpl_checksum.inc deleted file mode 100644 index 17a986dc308..00000000000 --- a/mysql-test/suite/rpl/include/rpl_checksum.inc +++ /dev/null @@ -1,335 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - -# WL2540 replication events checksum -# Testing configuration parameters - ---source include/have_debug.inc ---source include/have_binlog_format_mixed.inc ---source include/master-slave.inc - -call mtr.add_suppression('Slave can not handle replication events with the checksum that master is configured to log'); -call mtr.add_suppression('Replication event checksum verification failed'); -# due to C failure simulation -call mtr.add_suppression('Relay log write failure: could not queue event from master'); -call mtr.add_suppression('Master is configured to log replication events with checksum, but will not send such events to slaves that cannot process them'); - -# A. read/write access to the global vars: -# binlog_checksum master_verify_checksum slave_sql_verify_checksum - -connection master; - -set @master_save_binlog_checksum= @@global.binlog_checksum; -set @save_master_verify_checksum = @@global.master_verify_checksum; - -select @@global.binlog_checksum as 'must be CRC32 because of the command line option'; ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -select @@session.binlog_checksum as 'no session var'; - -select @@global.master_verify_checksum as 'must be zero because of default'; ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -select @@session.master_verify_checksum as 'no session var'; - -connection slave; - -set @slave_save_binlog_checksum= @@global.binlog_checksum; -set @save_slave_sql_verify_checksum = @@global.slave_sql_verify_checksum; - -select @@global.slave_sql_verify_checksum as 'must be one because of default'; ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -select @@session.slave_sql_verify_checksum as 'no session var'; - -connection master; - -source include/show_binary_logs.inc; -set @@global.binlog_checksum = NONE; -select @@global.binlog_checksum; ---echo *** must be rotations seen *** -source include/show_binary_logs.inc; - -set @@global.binlog_checksum = default; -select @@global.binlog_checksum; - -# testing lack of side-effects in non-effective update of binlog_checksum: -set @@global.binlog_checksum = CRC32; -select @@global.binlog_checksum; -set @@global.binlog_checksum = CRC32; - -set @@global.master_verify_checksum = 0; -set @@global.master_verify_checksum = default; - ---error ER_WRONG_VALUE_FOR_VAR -set @@global.binlog_checksum = ADLER32; ---error ER_WRONG_VALUE_FOR_VAR -set @@global.master_verify_checksum = 2; # the var is of bool type - -connection slave; - -set @@global.slave_sql_verify_checksum = 0; -set @@global.slave_sql_verify_checksum = default; ---error ER_WRONG_VALUE_FOR_VAR -set @@global.slave_sql_verify_checksum = 2; # the var is of bool type - -# -# B. Old Slave to New master conditions -# -# while master does not send a checksum-ed binlog the Old Slave can -# work with the New Master - -connection master; - -set @@global.binlog_checksum = NONE; -create table t1 (a int); - -# testing that binlog rotation preserves opt_binlog_checksum value -flush logs; -flush logs; --- source include/wait_for_binlog_checkpoint.inc -flush logs; - -sync_slave_with_master; -#connection slave; -# checking that rotation on the slave side leaves slave stable -flush logs; -flush logs; -flush logs; -select count(*) as zero from t1; - -source include/stop_slave.inc; - -connection master; -set @@global.binlog_checksum = CRC32; --- source include/wait_for_binlog_checkpoint.inc -insert into t1 values (1) /* will not be applied on slave due to simulation */; - -# instruction to the dump thread - -connection slave; -set @saved_dbug = @@global.debug_dbug; -set @@global.debug_dbug='d,simulate_slave_unaware_checksum'; -start slave; ---let $slave_io_errno= 1236 ---let $show_slave_io_error= 1 -source include/wait_for_slave_io_error.inc; - -select count(*) as zero from t1; - -set @@global.debug_dbug = @saved_dbug; - -connection slave; -source include/start_slave.inc; - -# -# C. checksum failure simulations -# - -# C1. Failure by a client thread -connection master; -set @@global.master_verify_checksum = 1; -set @save_dbug = @@session.debug_dbug; -set @@session.debug_dbug='d,simulate_checksum_test_failure'; ---error ER_ERROR_WHEN_EXECUTING_COMMAND -show binlog events; -SET debug_dbug= @save_dbug; -set @@global.master_verify_checksum = default; - -#connection master; -sync_slave_with_master; - -connection slave; -source include/stop_slave.inc; - -connection master; -create table t2 (a int); -let $pos_master= query_get_value(SHOW MASTER STATUS, Position, 1); - -connection slave; - -# C2. Failure by IO thread -# instruction to io thread -set @saved_dbug = @@global.debug_dbug; -set @@global.debug_dbug='d,simulate_checksum_test_failure'; -start slave io_thread; -# When the checksum error is detected, the slave sets error code 1913 -# (ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE) in queue_event(), then immediately -# sets error 1595 (ER_SLAVE_RELAY_LOG_WRITE_FAILURE) in handle_slave_io(). -# So we usually get 1595, but it is occasionally possible to get 1913. ---let $slave_io_errno= 1595,1913 ---let $show_slave_io_error= 0 -source include/wait_for_slave_io_error.inc; -set @@global.debug_dbug = @saved_dbug; - -# to make IO thread re-read it again w/o the failure -start slave io_thread; -let $slave_param= Read_Master_Log_Pos; -let $slave_param_value= $pos_master; -source include/wait_for_slave_param.inc; - -# C3. Failure by SQL thread -# instruction to sql thread; -set @@global.slave_sql_verify_checksum = 1; - -set @@global.debug_dbug='d,simulate_checksum_test_failure'; - -start slave sql_thread; ---let $slave_sql_errno= 1593 ---let $show_slave_sql_error= 1 -source include/wait_for_slave_sql_error.inc; - -# resuming SQL thread to parse out the event w/o the failure - -set @@global.debug_dbug = @saved_dbug; -source include/start_slave.inc; - -connection master; -sync_slave_with_master; - -#connection slave; -select count(*) as 'must be zero' from t2; - -# -# D. Reset slave, Change-Master, Binlog & Relay-log rotations with -# random value on binlog_checksum on both master and slave -# -connection slave; -stop slave; -reset slave; - -# randomize slave server's own checksum policy -set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE"); -flush logs; - -connection master; -set @@global.binlog_checksum= CRC32; -reset master; -flush logs; -create table t3 (a int, b char(5)); - -connection slave; -source include/start_slave.inc; - -connection master; -sync_slave_with_master; - -#connection slave; -select count(*) as 'must be zero' from t3; -source include/stop_slave.inc; ---replace_result $MASTER_MYPORT MASTER_PORT -eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root'; - -connection master; -flush logs; -reset master; -insert into t3 value (1, @@global.binlog_checksum); - -connection slave; -source include/start_slave.inc; -flush logs; - -connection master; -sync_slave_with_master; - -#connection slave; -select count(*) as 'must be one' from t3; - -connection master; -set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE"); -insert into t3 value (1, @@global.binlog_checksum); -sync_slave_with_master; - -#connection slave; - -#clean-up - -connection master; -drop table t1, t2, t3; -set @@global.binlog_checksum = @master_save_binlog_checksum; -set @@global.master_verify_checksum = @save_master_verify_checksum; - -# -# BUG#58564: flush_read_lock fails in mysql-trunk-bugfixing after merging with WL#2540 -# -# Sanity check that verifies that no assertions are triggered because -# of old FD events (generated by versions prior to server released with -# checksums feature) -# -# There is no need for query log, if something wrong this should trigger -# an assertion - ---disable_query_log - -BINLOG ' -MfmqTA8BAAAAZwAAAGsAAAABAAQANS41LjctbTMtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAx+apMEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA== -'; - ---enable_query_log - -#connection slave; -sync_slave_with_master; - - ---echo *** Bug#59123 / MDEV-5799: INCIDENT_EVENT checksum written to error log as garbage characters *** - ---connection master - ---source include/wait_for_binlog_checkpoint.inc -CREATE TABLE t4 (a INT PRIMARY KEY); -INSERT INTO t4 VALUES (1); - -SET sql_log_bin=0; -CALL mtr.add_suppression("\\[ERROR\\] Can't generate a unique log-filename"); -SET sql_log_bin=1; -SET @old_dbug= @@GLOBAL.debug_dbug; -SET debug_dbug= '+d,binlog_inject_new_name_error'; ---error ER_NO_UNIQUE_LOGFILE -FLUSH LOGS; -SET debug_dbug= @old_dbug; - -INSERT INTO t4 VALUES (2); - ---connection slave ---let $slave_sql_errno= 1590 ---source include/wait_for_slave_sql_error.inc - -# Search the error log for the error message. -# The bug was that 4 garbage bytes were output in the middle of the error -# message; by searching for a pattern that spans that location, we can -# catch the error. -let $log_error_= `SELECT @@GLOBAL.log_error`; -if(!$log_error_) -{ - # MySQL Server on windows is started with --console and thus - # does not know the location of its .err log, use default location - let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err; -} ---let SEARCH_FILE= $log_error_ ---let SEARCH_PATTERN= Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590 ---source include/search_pattern_in_file.inc - -SELECT * FROM t4 ORDER BY a; -STOP SLAVE IO_THREAD; -SET sql_slave_skip_counter= 1; ---source include/start_slave.inc - ---connection master ---save_master_pos - ---connection slave ---sync_with_master -SELECT * FROM t4 ORDER BY a; - - ---connection slave -set @@global.binlog_checksum = @slave_save_binlog_checksum; -set @@global.slave_sql_verify_checksum = @save_slave_sql_verify_checksum; - ---echo End of tests - ---connection master -DROP TABLE t4; - ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_checksum_cache.inc b/mysql-test/suite/rpl/include/rpl_checksum_cache.inc deleted file mode 100644 index e04f618b81e..00000000000 --- a/mysql-test/suite/rpl/include/rpl_checksum_cache.inc +++ /dev/null @@ -1,261 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - --- source include/have_innodb.inc --- source include/master-slave.inc - ---disable_warnings -call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. .*Statement: insert into t2 set data=repeat.*'a', @act_size.*"); -call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. .*Statement: insert into t1 values.* NAME_CONST.*'n',.*, @data .*"); ---enable_warnings - -connection master; -set @save_binlog_cache_size = @@global.binlog_cache_size; -set @save_binlog_checksum = @@global.binlog_checksum; -set @save_master_verify_checksum = @@global.master_verify_checksum; -set @@global.binlog_cache_size = 4096; -set @@global.binlog_checksum = CRC32; -set @@global.master_verify_checksum = 1; - -# restart slave to force the dump thread to verify events (on master side) -connection slave; -source include/stop_slave.inc; -source include/start_slave.inc; - -connection master; - -# -# Testing a critical part of checksum handling dealing with transaction cache. -# The cache's buffer size is set to be less than the transaction's footprint -# in binlog. -# -# To verify combined buffer-by-buffer read out of the file and fixing crc per event -# there are the following parts: -# -# 1. the event size is much less than the cache's buffer -# 2. the event size is bigger than the cache's buffer -# 3. the event size if approximately the same as the cache's buffer -# 4. all in above - -# -# 1. the event size is much less than the cache's buffer -# - -flush status; -show status like "binlog_cache_use"; -show status like "binlog_cache_disk_use"; ---disable_warnings -drop table if exists t1; ---enable_warnings - -# -# parameter to ensure the test slightly varies binlog content -# between different invocations -# -let $deviation_size=32; -eval create table t1 (a int PRIMARY KEY, b CHAR($deviation_size)) engine=innodb; - -# Now we are going to create transaction which is long enough so its -# transaction binlog will be flushed to disk... - -delimiter |; -create procedure test.p_init (n int, size int) -begin - while n > 0 do - select round(RAND() * size) into @act_size; - set @data = repeat('a', @act_size); - insert into t1 values(n, @data ); - set n= n-1; - end while; -end| - -delimiter ;| - -let $1 = 4000; # PB2 can run it slow to time out on following sync_slave_with_master:s - -begin; ---disable_warnings -# todo: check if it is really so. -#+Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. -eval call test.p_init($1, $deviation_size); ---enable_warnings -commit; - -show status like "binlog_cache_use"; ---echo *** binlog_cache_disk_use must be non-zero *** -show status like "binlog_cache_disk_use"; - -sync_slave_with_master; - -let $diff_tables=master:test.t1, slave:test.t1; -source include/diff_tables.inc; - -# undoing changes with verifying the above once again -connection master; - -begin; -delete from t1; -commit; - -sync_slave_with_master; - - -# -# 2. the event size is bigger than the cache's buffer -# -connection master; - -flush status; -let $t2_data_size= `select 3 * @@global.binlog_cache_size`; -let $t2_aver_size= `select 2 * @@global.binlog_cache_size`; -let $t2_max_rand= `select 1 * @@global.binlog_cache_size`; - -eval create table t2(a int auto_increment primary key, data VARCHAR($t2_data_size)) ENGINE=Innodb; -let $1=100; ---disable_query_log -begin; -while ($1) -{ - eval select round($t2_aver_size + RAND() * $t2_max_rand) into @act_size; - set @data = repeat('a', @act_size); - insert into t2 set data = @data; - dec $1; -} -commit; ---enable_query_log -show status like "binlog_cache_use"; ---echo *** binlog_cache_disk_use must be non-zero *** -show status like "binlog_cache_disk_use"; - -sync_slave_with_master; - -let $diff_tables=master:test.t2, slave:test.t2; -source include/diff_tables.inc; - -# undoing changes with verifying the above once again -connection master; - -begin; -delete from t2; -commit; - -sync_slave_with_master; - -# -# 3. the event size if approximately the same as the cache's buffer -# - -connection master; - -flush status; -let $t3_data_size= `select 2 * @@global.binlog_cache_size`; -let $t3_aver_size= `select (9 * @@global.binlog_cache_size) / 10`; -let $t3_max_rand= `select (2 * @@global.binlog_cache_size) / 10`; - -eval create table t3(a int auto_increment primary key, data VARCHAR($t3_data_size)) engine=innodb; - -let $1= 300; ---disable_query_log -begin; -while ($1) -{ - eval select round($t3_aver_size + RAND() * $t3_max_rand) into @act_size; - insert into t3 set data= repeat('a', @act_size); - dec $1; -} -commit; ---enable_query_log -show status like "binlog_cache_use"; ---echo *** binlog_cache_disk_use must be non-zero *** -show status like "binlog_cache_disk_use"; - -sync_slave_with_master; - -let $diff_tables=master:test.t3, slave:test.t3; -source include/diff_tables.inc; - -# undoing changes with verifying the above once again -connection master; - -begin; -delete from t3; -commit; - -sync_slave_with_master; - - -# -# 4. all in above -# - -connection master; -flush status; - -delimiter |; -eval create procedure test.p1 (n int) -begin - while n > 0 do - case (select (round(rand()*100) % 3) + 1) - when 1 then - select round(RAND() * $deviation_size) into @act_size; - set @data = repeat('a', @act_size); - insert into t1 values(n, @data); - when 2 then - begin - select round($t2_aver_size + RAND() * $t2_max_rand) into @act_size; - insert into t2 set data=repeat('a', @act_size); - end; - when 3 then - begin - select round($t3_aver_size + RAND() * $t3_max_rand) into @act_size; - insert into t3 set data= repeat('a', @act_size); - end; - end case; - set n= n-1; - end while; -end| -delimiter ;| - -let $1= 1000; -set autocommit= 0; -begin; ---disable_warnings -eval call test.p1($1); ---enable_warnings -commit; - -show status like "binlog_cache_use"; ---echo *** binlog_cache_disk_use must be non-zero *** -show status like "binlog_cache_disk_use"; - -sync_slave_with_master; - -let $diff_tables=master:test.t1, slave:test.t1; -source include/diff_tables.inc; - -let $diff_tables=master:test.t2, slave:test.t2; -source include/diff_tables.inc; - -let $diff_tables=master:test.t3, slave:test.t3; -source include/diff_tables.inc; - - -connection master; - -begin; -delete from t1; -delete from t2; -delete from t3; -commit; - -drop table t1, t2, t3; -set @@global.binlog_cache_size = @save_binlog_cache_size; -set @@global.binlog_checksum = @save_binlog_checksum; -set @@global.master_verify_checksum = @save_master_verify_checksum; -drop procedure test.p_init; -drop procedure test.p1; - ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_corruption.inc b/mysql-test/suite/rpl/include/rpl_corruption.inc deleted file mode 100644 index c7a913af9d7..00000000000 --- a/mysql-test/suite/rpl/include/rpl_corruption.inc +++ /dev/null @@ -1,175 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - -############################################################ -# Purpose: WL#5064 Testing with corrupted events. -# The test emulates the corruption at the vary stages -# of replication: -# - in binlog file -# - in network -# - in relay log -############################################################ - -# -# The tests intensively utilize @@global.debug. Note, -# Bug#11765758 - 58754, -# @@global.debug is read by the slave threads through dbug-interface. -# Hence, before a client thread set @@global.debug we have to ensure that: -# (a) the slave threads are stopped, or (b) the slave threads are in -# sync and waiting. - ---source include/have_debug.inc ---source include/master-slave.inc - -# Block legal errors for MTR -call mtr.add_suppression('Found invalid event in binary log'); -call mtr.add_suppression('Slave I/O: Relay log write failure: could not queue event from master'); -call mtr.add_suppression('event read from binlog did not pass crc check'); -call mtr.add_suppression('Replication event checksum verification failed'); -call mtr.add_suppression('Event crc check failed! Most likely there is event corruption'); -call mtr.add_suppression('Slave SQL: Error initializing relay log position: I/O error reading event at position .*, error.* 1593'); - -SET @old_master_verify_checksum = @@master_verify_checksum; - -# Creating test table/data and set corruption position for testing ---echo # 1. Creating test table/data and set corruption position for testing ---connection master ---echo * insert/update/delete rows in table t1 * -# Corruption algorithm modifies only the first event and -# then will be reset. To avoid checking always the first event -# from binlog (usually it is FD) we randomly execute different -# statements and set position for corruption inside events. - -CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c VARCHAR(100)); ---disable_query_log -let $i=`SELECT 3+CEILING(10*RAND())`; -let $j=1; -let $pos=0; -while ($i) { - eval INSERT INTO t1 VALUES ($j, 'a', NULL); - if (`SELECT RAND() > 0.7`) - { - eval UPDATE t1 SET c = REPEAT('a', 20) WHERE a = $j; - } - if (`SELECT RAND() > 0.8`) - { - eval DELETE FROM t1 WHERE a = $j; - } - if (!$pos) { - let $pos= query_get_value(SHOW MASTER STATUS, Position, 1); - --sync_slave_with_master - --source include/stop_slave.inc - --disable_query_log - --connection master - } - dec $i; - inc $j; -} ---enable_query_log - - -# Emulate corruption in binlog file when SHOW BINLOG EVENTS is executing ---echo # 2. Corruption in master binlog and SHOW BINLOG EVENTS -SET @saved_dbug = @@global.debug_dbug; -SET @@global.debug_dbug="d,corrupt_read_log_event_char"; ---echo SHOW BINLOG EVENTS; ---disable_query_log -send_eval SHOW BINLOG EVENTS FROM $pos; ---enable_query_log ---error ER_ERROR_WHEN_EXECUTING_COMMAND -reap; - -SET @@global.debug_dbug=@saved_dbug; - -# Emulate corruption on master with crc checking on master ---echo # 3. Master read a corrupted event from binlog and send the error to slave - -# We have a rare but nasty potential race here: if the dump thread on -# the master for the _old_ slave connection has not yet discovered -# that the slave has disconnected, we will inject the corrupt event on -# the wrong connection, and the test will fail -# (+d,corrupt_read_log_event2 corrupts only one event). -# So kill any lingering dump thread (we need to kill; otherwise dump thread -# could manage to send all events down the socket before seeing it close, and -# hang forever waiting for new binlog events to be created). -let $id= `select id from information_schema.processlist where command = "Binlog Dump"`; -if ($id) -{ - --disable_query_log - --error 0,1094 - eval kill $id; - --enable_query_log -} -let $wait_condition= - SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE command = 'Binlog Dump'; ---source include/wait_condition.inc - -SET @@global.debug_dbug="d,corrupt_read_log_event2_set"; ---connection slave -START SLAVE IO_THREAD; -let $slave_io_errno= 1236; ---let $slave_timeout= 10 ---source include/wait_for_slave_io_error.inc ---connection master -SET @@global.debug_dbug=@saved_dbug; - -# Emulate corruption on master without crc checking on master ---echo # 4. Master read a corrupted event from binlog and send it to slave ---connection master -SET GLOBAL master_verify_checksum=0; -SET @@global.debug_dbug="d,corrupt_read_log_event2_set"; ---connection slave -START SLAVE IO_THREAD; -# When the checksum error is detected, the slave sets error code 1743 -# (ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE) in queue_event(), then immediately -# sets error 1595 (ER_SLAVE_RELAY_LOG_WRITE_FAILURE) in handle_slave_io(). -# So we usually get 1595, but it is occasionally possible to get 1743. -let $slave_io_errno= 1595,1743; # ER_SLAVE_RELAY_LOG_WRITE_FAILURE, ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE ---source include/wait_for_slave_io_error.inc ---connection master -SET @@global.debug_dbug=@saved_dbug; -SET GLOBAL master_verify_checksum=1; - -# Emulate corruption in network ---echo # 5. Slave. Corruption in network ---connection slave -SET @saved_dbug_slave = @@GLOBAL.debug_dbug; -SET @@global.debug_dbug="d,corrupt_queue_event"; -START SLAVE IO_THREAD; -let $slave_io_errno= 1595,1743; # ER_SLAVE_RELAY_LOG_WRITE_FAILURE, ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE ---source include/wait_for_slave_io_error.inc -SET @@global.debug_dbug=@saved_dbug_slave; - -# Emulate corruption in relay log ---echo # 6. Slave. Corruption in relay log - -SET @@global.debug_dbug="d,corrupt_read_log_event_char"; - -START SLAVE SQL_THREAD; -let $slave_sql_errno= 1593; ---source include/wait_for_slave_sql_error.inc - -SET @@global.debug_dbug=@saved_dbug_slave; - -# Start normal replication and compare same table on master -# and slave ---echo # 7. Seek diff for tables on master and slave ---connection slave ---source include/start_slave.inc ---connection master ---sync_slave_with_master -let $diff_tables= master:test.t1, slave:test.t1; ---source include/diff_tables.inc - -# Clean up ---echo # 8. Clean up ---connection master -set @@global.debug_dbug = @saved_dbug; -SET GLOBAL master_verify_checksum = @old_master_verify_checksum; -DROP TABLE t1; ---sync_slave_with_master - ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_gtid_basic.inc b/mysql-test/suite/rpl/include/rpl_gtid_basic.inc deleted file mode 100644 index 68a5d05ffe9..00000000000 --- a/mysql-test/suite/rpl/include/rpl_gtid_basic.inc +++ /dev/null @@ -1,572 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - ---source include/have_innodb.inc ---let $rpl_topology=1->2->3->4 ---source include/rpl_init.inc - -# Set up a 4-deep replication topology, then test various fail-overs -# using GTID. -# -# A -> B -> C -> D - -connection server_1; ---source include/wait_for_binlog_checkpoint.inc ---let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1) ---let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1) ---echo *** GTID position should be empty here *** ---replace_result $binlog_file $binlog_pos -eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos); - -CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM; -CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB; -INSERT INTO t1 VALUES (1, "m1"); -INSERT INTO t1 VALUES (2, "m2"), (3, "m3"), (4, "m4"); -INSERT INTO t2 VALUES (1, "i1"); -BEGIN; -INSERT INTO t2 VALUES (2, "i2"), (3, "i3"); -INSERT INTO t2 VALUES (4, "i4"); -COMMIT; -save_master_pos; -source include/wait_for_binlog_checkpoint.inc; ---let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1) ---let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1) ---let $gtid_pos_server_1 = `SELECT @@gtid_binlog_pos` ---echo *** GTID position should be non-empty here *** ---replace_result $binlog_file $binlog_pos $gtid_pos_server_1 -eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos); - -connection server_2; -sync_with_master; -source include/wait_for_binlog_checkpoint.inc; ---let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1) ---let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1) ---echo *** GTID position should be the same as on server_1 *** ---replace_result $binlog_file $binlog_pos $gtid_pos_server_1 -eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos); -SELECT * FROM t1 ORDER BY a; -SELECT * FROM t2 ORDER BY a; -save_master_pos; - -connection server_3; -sync_with_master; -SELECT * FROM t1 ORDER BY a; -SELECT * FROM t2 ORDER BY a; -save_master_pos; - -connection server_4; -sync_with_master; -SELECT * FROM t1 ORDER BY a; -SELECT * FROM t2 ORDER BY a; - - ---echo *** Now take out D, let it fall behind a bit, and then test re-attaching it to A *** -connection server_4; ---source include/stop_slave.inc - -connection server_1; -INSERT INTO t1 VALUES (5, "m1a"); -INSERT INTO t2 VALUES (5, "i1a"); -save_master_pos; - -connection server_4; ---replace_result $MASTER_MYPORT MASTER_PORT -eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT, - MASTER_USE_GTID=CURRENT_POS; ---source include/start_slave.inc -sync_with_master; -SELECT * FROM t1 ORDER BY a; -SELECT * FROM t2 ORDER BY a; - ---echo *** Now move B to D (C is still replicating from B) *** -connection server_2; ---source include/stop_slave.inc ---replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4 -eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4, - MASTER_USE_GTID=CURRENT_POS; ---source include/start_slave.inc - -connection server_4; -UPDATE t2 SET b="j1a" WHERE a=5; -save_master_pos; - -connection server_2; -sync_with_master; -SELECT * FROM t1 ORDER BY a; -SELECT * FROM t2 ORDER BY a; - ---echo *** Now move C to D, after letting it fall a little behind *** -connection server_3; ---source include/stop_slave.inc - -connection server_1; -INSERT INTO t2 VALUES (6, "i6b"); -INSERT INTO t2 VALUES (7, "i7b"); ---source include/save_master_gtid.inc - -connection server_3; ---replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4 -eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4, - MASTER_USE_GTID=CURRENT_POS; ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc -SELECT * FROM t2 ORDER BY a; - ---echo *** Now change everything back to what it was, to make rpl_end.inc happy -# Also check that MASTER_USE_GTID=CURRENT_POS is still enabled. -connection server_2; -# We need to sync up server_2 before switching. If it happened to have reached -# the point 'UPDATE t2 SET b="j1a" WHERE a=5' it will fail to connect to -# server_1, which is (deliberately) missing that transaction. ---source include/sync_with_master_gtid.inc ---source include/stop_slave.inc ---replace_result $MASTER_MYPORT MASTER_MYPORT -eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT; ---source include/start_slave.inc ---source include/wait_for_slave_to_start.inc - -connection server_3; ---source include/stop_slave.inc ---replace_result $SLAVE_MYPORT SLAVE_MYPORT -eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SLAVE_MYPORT; ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc - -connection server_4; ---source include/stop_slave.inc ---replace_result $SERVER_MYPORT_3 SERVER_MYPORT_3 -eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_3; ---source include/start_slave.inc - -connection server_1; -DROP TABLE t1,t2; ---source include/save_master_gtid.inc - ---echo *** A few more checks for BINLOG_GTID_POS function *** ---let $valid_binlog_name = query_get_value(SHOW BINARY LOGS,Log_name,1) ---error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -SELECT BINLOG_GTID_POS(); ---error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -SELECT BINLOG_GTID_POS('a'); ---error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT -SELECT BINLOG_GTID_POS('a',1,NULL); -SELECT BINLOG_GTID_POS(1,'a'); -SELECT BINLOG_GTID_POS(NULL,NULL); -SELECT BINLOG_GTID_POS('',1); -SELECT BINLOG_GTID_POS('a',1); -eval SELECT BINLOG_GTID_POS('$valid_binlog_name',-1); -eval SELECT BINLOG_GTID_POS('$valid_binlog_name',0); -eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551615); -eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551616); - - ---echo *** Some tests of @@GLOBAL.gtid_binlog_state *** ---connection server_2 ---source include/sync_with_master_gtid.inc ---source include/stop_slave.inc - ---connection server_1 -SET @old_state= @@GLOBAL.gtid_binlog_state; - ---error ER_BINLOG_MUST_BE_EMPTY -SET GLOBAL gtid_binlog_state = ''; -RESET MASTER; -SET GLOBAL gtid_binlog_state = ''; -FLUSH LOGS; ---source include/show_binary_logs.inc -SET GLOBAL gtid_binlog_state = '0-1-10,1-2-20,0-3-30'; ---source include/show_binary_logs.inc ---let $binlog_file= master-bin.000001 ---let $binlog_start= 4 ---source include/show_binlog_events.inc -#SELECT @@GLOBAL.gtid_binlog_pos; -#SELECT @@GLOBAL.gtid_binlog_state; ---error ER_BINLOG_MUST_BE_EMPTY -SET GLOBAL gtid_binlog_state = @old_state; -RESET MASTER; -SET GLOBAL gtid_binlog_state = @old_state; - -# Check that slave can reconnect again, despite the RESET MASTER, as we -# restored the state. - -CREATE TABLE t1 (a INT PRIMARY KEY); -SET gtid_seq_no=100; -INSERT INTO t1 VALUES (1); ---source include/save_master_gtid.inc - ---connection server_2 ---source include/start_slave.inc -# We cannot just use sync_with_master as we've done RESET MASTER, so -# slave old-style position is wrong. -# So sync on gtid position instead. ---source include/sync_with_master_gtid.inc - -SELECT * FROM t1; -# Check that the IO gtid position in SHOW SLAVE STATUS is also correct. ---let $status_items= Gtid_IO_Pos ---source include/show_slave_status.inc - ---echo *** Test @@LAST_GTID and MASTER_GTID_WAIT() *** - ---connection server_1 -DROP TABLE t1; -CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; ---save_master_pos - ---connection server_2 ---sync_with_master ---source include/stop_slave.inc - ---connect (m1,127.0.0.1,root,,test,$SERVER_MYPORT_1,) -SELECT @@last_gtid; -SET gtid_seq_no=110; -SELECT @@last_gtid; -BEGIN; -SELECT @@last_gtid; -INSERT INTO t1 VALUES (2); -SELECT @@last_gtid; -COMMIT; -SELECT @@last_gtid; ---let $pos= `SELECT @@gtid_binlog_pos` - ---connect (s1,127.0.0.1,root,,test,$SERVER_MYPORT_2,) -eval SET @pos= '$pos'; -# Check NULL argument. -SELECT master_gtid_wait(NULL); -# Check empty argument returns immediately. -SELECT master_gtid_wait('', NULL); -# Check this gets counted -SHOW STATUS LIKE 'Master_gtid_wait_count'; -SHOW STATUS LIKE 'Master_gtid_wait_timeouts'; -SHOW STATUS LIKE 'Master_gtid_wait_time'; -# Let's check that we get a timeout -SELECT master_gtid_wait(@pos, 0.5); -SELECT * FROM t1 ORDER BY a; -# Now actually wait until the slave reaches the position -send SELECT master_gtid_wait(@pos); - ---connection server_2 ---source include/start_slave.inc - ---connection s1 -reap; -SELECT * FROM t1 ORDER BY a; - -# Test waiting on a domain that does not exist yet. ---source include/stop_slave.inc - ---connection server_1 -SET gtid_domain_id= 1; -INSERT INTO t1 VALUES (3); ---let $pos= `SELECT @@gtid_binlog_pos` - ---connection s1 ---replace_result $pos POS -eval SET @pos= '$pos'; -SELECT master_gtid_wait(@pos, 0); -SELECT * FROM t1 WHERE a >= 3; -send SELECT master_gtid_wait(@pos, -1); - ---connection server_2 ---source include/start_slave.inc - ---connection s1 -reap; -SELECT * FROM t1 WHERE a >= 3; -# Waiting for only part of the position. -SELECT master_gtid_wait('1-1-1', 0); - -# Now test a lot of parallel master_gtid_wait() calls, completing in different -# order, and some of which time out or get killed on the way. - ---connection s1 -send SELECT master_gtid_wait('2-1-1,1-1-4,0-1-110'); - ---connect (s2,127.0.0.1,root,,test,$SERVER_MYPORT_2,) -# This will time out. No event 0-1-1000 exists -send SELECT master_gtid_wait('0-1-1000', 0.5); - ---connect (s3,127.0.0.1,root,,test,$SERVER_MYPORT_2,) -# This one we will kill ---let $kill1_id= `SELECT connection_id()` -send SELECT master_gtid_wait('0-1-2000'); - ---connect (s4,127.0.0.1,root,,test,$SERVER_MYPORT_2,) -send SELECT master_gtid_wait('2-1-10'); - ---connect (s5,127.0.0.1,root,,test,$SERVER_MYPORT_2,) -send SELECT master_gtid_wait('2-1-6', 1); - -# This one we will kill also. ---connect (s6,127.0.0.1,root,,test,$SERVER_MYPORT_2,) ---let $kill2_id= `SELECT connection_id()` -send SELECT master_gtid_wait('2-1-5'); - ---connect (s7,127.0.0.1,root,,test,$SERVER_MYPORT_2,) -send SELECT master_gtid_wait('2-1-10'); - ---connect (s8,127.0.0.1,root,,test,$SERVER_MYPORT_2,) -send SELECT master_gtid_wait('2-1-5,1-1-4,0-1-110'); - ---connect (s9,127.0.0.1,root,,test,$SERVER_MYPORT_2,) -send SELECT master_gtid_wait('2-1-2'); - ---connection server_2 -# This one completes immediately. -SHOW STATUS LIKE 'Master_gtid_wait_timeouts'; -SHOW STATUS LIKE 'Master_gtid_wait_count'; -SELECT master_gtid_wait('1-1-1'); -SHOW STATUS LIKE 'Master_gtid_wait_timeouts'; -SHOW STATUS LIKE 'Master_gtid_wait_count'; -let $wait_time = query_get_value(SHOW STATUS LIKE 'Master_gtid_wait_time', Value, 1); ---replace_result $wait_time MASTER_GTID_WAIT_TIME -eval SET @a= $wait_time; -SELECT IF(@a <= 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " is larger than expected")) - AS Master_gtid_wait_time_as_expected; - - ---connect (s10,127.0.0.1,root,,test,$SERVER_MYPORT_2,) -send SELECT master_gtid_wait('0-1-109'); - ---connection server_2 -# This one should time out. -SHOW STATUS LIKE 'Master_gtid_wait_timeouts'; -SHOW STATUS LIKE 'Master_gtid_wait_count'; -SELECT master_gtid_wait('2-1-2', 0.5); -SHOW STATUS LIKE 'Master_gtid_wait_timeouts'; -SHOW STATUS LIKE 'Master_gtid_wait_count'; -let $wait_time = query_get_value(SHOW STATUS LIKE 'Master_gtid_wait_time', Value, 1); ---replace_result $wait_time MASTER_GTID_WAIT_TIME -eval SET @a= $wait_time; -# We expect a wait time of just a bit over 0.5 seconds. But thread scheduling -# and timer inaccuracies could introduce significant jitter. So allow a -# generous interval. -SELECT IF(@a BETWEEN 0.4*1000*1000 AND 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " not as expected")) AS Master_gtid_wait_time_as_expected; - ---replace_result $kill1_id KILL_ID -eval KILL QUERY $kill1_id; ---connection s3 ---error ER_QUERY_INTERRUPTED -reap; - ---connection server_1 -SET gtid_domain_id=2; -SET gtid_seq_no=2; -INSERT INTO t1 VALUES (4); - ---connection s9 -reap; - ---connection server_2 ---replace_result $kill2_id KILL_ID -eval KILL CONNECTION $kill2_id; - ---connection s6 ---error 2013,ER_CONNECTION_KILLED -reap; - ---connection server_1 -SET gtid_domain_id=1; -SET gtid_seq_no=4; -INSERT INTO t1 VALUES (5); -SET gtid_domain_id=2; -SET gtid_seq_no=5; -INSERT INTO t1 VALUES (6); - ---connection s8 -reap; ---connection s1 -reap; ---connection s2 -reap; ---connection s5 -reap; ---connection s10 -reap; - ---connection server_1 -SET gtid_domain_id=2; -SET gtid_seq_no=10; -INSERT INTO t1 VALUES (7); - ---connection s4 -reap; ---connection s7 -reap; - - ---echo *** Test gtid_slave_pos when used with GTID *** - ---connection server_2 ---source include/stop_slave.inc - ---connection server_1 -SET gtid_domain_id=2; -SET gtid_seq_no=1000; -INSERT INTO t1 VALUES (10); -INSERT INTO t1 VALUES (11); ---save_master_pos - ---connection server_2 -SET sql_slave_skip_counter= 1; ---source include/start_slave.inc ---sync_with_master -SELECT * FROM t1 WHERE a >= 10 ORDER BY a; -SELECT IF(LOCATE("2-1-1001", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1001 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status; - ---source include/stop_slave.inc - ---connection server_1 -SET gtid_domain_id=2; -SET gtid_seq_no=1010; -INSERT INTO t1 VALUES (12); -INSERT INTO t1 VALUES (13); ---save_master_pos - ---connection server_2 -SET sql_slave_skip_counter= 2; ---source include/start_slave.inc ---sync_with_master -SELECT * FROM t1 WHERE a >= 10 ORDER BY a; -SELECT IF(LOCATE("2-1-1011", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1011 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status; - ---source include/stop_slave.inc - ---connection server_1 -SET gtid_domain_id=2; -SET gtid_seq_no=1020; -INSERT INTO t1 VALUES (14); -INSERT INTO t1 VALUES (15); -INSERT INTO t1 VALUES (16); ---save_master_pos - ---connection server_2 -SET sql_slave_skip_counter= 3; ---source include/start_slave.inc ---sync_with_master -SELECT * FROM t1 WHERE a >= 10 ORDER BY a; -SELECT IF(LOCATE("2-1-1022", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1022 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status; - ---source include/stop_slave.inc - ---connection server_1 -SET gtid_domain_id=2; -SET gtid_seq_no=1030; -# Disable logging Annotate_rows events to preserve events count. -let $binlog_annotate_row_events_saved= `SELECT @@binlog_annotate_row_events`; -SET @@binlog_annotate_row_events= 0; -INSERT INTO t1 VALUES (17); -INSERT INTO t1 VALUES (18); -INSERT INTO t1 VALUES (19); -eval SET @@binlog_annotate_row_events= $binlog_annotate_row_events_saved; ---save_master_pos - ---connection server_2 -SET sql_slave_skip_counter= 5; ---source include/start_slave.inc ---sync_with_master -SELECT * FROM t1 WHERE a >= 10 ORDER BY a; -SELECT IF(LOCATE("2-1-1032", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1032 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status; - - ---source include/stop_slave.inc - ---connection server_1 -SET gtid_domain_id=3; -SET gtid_seq_no=100; -CREATE TABLE t2 (a INT PRIMARY KEY); -DROP TABLE t2; -SET gtid_domain_id=2; -SET gtid_seq_no=1040; -INSERT INTO t1 VALUES (20); ---save_master_pos - ---connection server_2 -SET @saved_mode= @@GLOBAL.slave_ddl_exec_mode; -SET GLOBAL slave_ddl_exec_mode=STRICT; -SET sql_slave_skip_counter=1; -START SLAVE UNTIL master_gtid_pos="3-1-100"; ---let $master_pos=3-1-100 ---source include/sync_with_master_gtid.inc ---source include/wait_for_slave_to_stop.inc ---error ER_NO_SUCH_TABLE -SELECT * FROM t2; -SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status; - -# Start the slave again, it should fail on the DROP TABLE as the table is not there. -SET sql_log_bin=0; -CALL mtr.add_suppression("Slave: Unknown table 'test\\.t2' Error_code: 1051"); -SET sql_log_bin=1; -START SLAVE; ---let $slave_sql_errno=1051 ---source include/wait_for_slave_sql_error.inc -SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status; - -STOP SLAVE IO_THREAD; -SET sql_slave_skip_counter=2; ---source include/start_slave.inc ---sync_with_master - -SELECT * FROM t1 WHERE a >= 20 ORDER BY a; -SELECT IF(LOCATE("3-1-101", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-101 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status; -SELECT IF(LOCATE("2-1-1040", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1040 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status; - -SET GLOBAL slave_ddl_exec_mode= @saved_mode; - - ---echo *** Test GTID-connecting to a master with out-of-order sequence numbers in the binlog. *** - -# Create an out-of-order binlog on server 2. -# Let server 3 replicate to an out-of-order point, stop it, restart it, -# and check that it replicates correctly despite the out-of-order. - ---connection server_1 -SET gtid_domain_id= @@GLOBAL.gtid_domain_id; -INSERT INTO t1 VALUES (31); ---save_master_pos - ---connection server_2 ---sync_with_master -SET gtid_domain_id= @@GLOBAL.gtid_domain_id; -INSERT INTO t1 VALUES (32); - ---connection server_1 -INSERT INTO t1 VALUES (33); ---save_master_pos - ---connection server_2 ---sync_with_master ---save_master_pos - ---connection server_3 ---sync_with_master ---source include/stop_slave.inc - ---connection server_1 -INSERT INTO t1 VALUES (34); ---save_master_pos - ---connection server_2 ---sync_with_master ---save_master_pos - ---connection server_3 ---source include/start_slave.inc ---sync_with_master -SELECT * FROM t1 WHERE a >= 30 ORDER BY a; ---save_master_pos - ---connection server_4 ---sync_with_master -SELECT * FROM t1 WHERE a >= 30 ORDER BY a; - - -# Clean up. ---connection server_1 -DROP TABLE t1; - - ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_incident.inc b/mysql-test/suite/rpl/include/rpl_incident.inc deleted file mode 100644 index 75d28d6a6c6..00000000000 --- a/mysql-test/suite/rpl/include/rpl_incident.inc +++ /dev/null @@ -1,61 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - ---source include/have_debug.inc ---source include/master-slave.inc - -SET @old_binlog_checksum=@@binlog_checksum; -SET GLOBAL BINLOG_CHECKSUM=none; -connection slave; -SET @old_binlog_checksum=@@binlog_checksum; -SET GLOBAL BINLOG_CHECKSUM=none; -connection master; - ---echo **** On Master **** -CREATE TABLE t1 (a INT); - -INSERT INTO t1 VALUES (1),(2),(3); -SELECT * FROM t1; - -set @saved_dbug = @@global.debug_dbug; -SET GLOBAL debug_dbug= '+d,incident_database_resync_on_replace,*'; - -# This will generate an incident log event and store it in the binary -# log before the replace statement. -REPLACE INTO t1 VALUES (4); ---save_master_pos -SELECT * FROM t1; - -set @@global.debug_dbug = @saved_dbug; - -connection slave; -# Wait until SQL thread stops with error LOST_EVENT on master -call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master.* 1590"); -let $slave_sql_errno= 1590; -let $show_slave_sql_error= 1; -source include/wait_for_slave_sql_error.inc; - -# The 4 should not be inserted into the table, since the incident log -# event should have stop the slave. ---echo **** On Slave **** -SELECT * FROM t1; - -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; -START SLAVE; ---sync_with_master - -# Now, we should have inserted the row into the table and the slave -# should be running. We should also have rotated to a new binary log. - -SELECT * FROM t1; -source include/check_slave_is_running.inc; - -connection master; -SET GLOBAL BINLOG_CHECKSUM=@old_binlog_checksum; -DROP TABLE t1; ---sync_slave_with_master -SET GLOBAL BINLOG_CHECKSUM=@old_binlog_checksum; ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_init_slave_errors.inc b/mysql-test/suite/rpl/include/rpl_init_slave_errors.inc deleted file mode 100644 index 46673ea4764..00000000000 --- a/mysql-test/suite/rpl/include/rpl_init_slave_errors.inc +++ /dev/null @@ -1,96 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - -###################################################################### -# Some errors that cause the slave SQL thread to stop are not shown in -# the Slave_SQL_Error column of "SHOW SLAVE STATUS". Instead, the error -# is only in the server's error log. -# -# Two failures and their respective reporting are verified: -# -# 1 - Failures during slave thread initialization -# 2 - Failures while processing queries passed through the init_slave -# option. -# -# In order to check the first type of failure, we inject a fault in the -# SQL/IO Threads through SET GLOBAL debug. -# -# To check the second type, we set @@global.init_slave to an invalid -# command thus preventing the initialization of the SQL Thread. -# -# Obs: -# 1 - Note that testing failures while initializing the relay log position -# is hard as the same function is called before the code reaches the point -# that we want to test. -# -# 2 - This test does not target failures that are reported while applying -# events such as duplicate keys, errors while reading the relay-log.bin*, -# etc. Such errors are already checked on other tests. -###################################################################### - -###################################################################### -# Configuring the Environment -###################################################################### -source include/have_debug.inc; -source include/have_log_bin.inc; -source include/master-slave.inc; - -connection slave; - ---disable_warnings -stop slave; ---enable_warnings -reset slave; - -###################################################################### -# Injecting faults in the threads' initialization -###################################################################### -connection slave; - -# Set debug flags on slave to force errors to occur -set @saved_dbug = @@global.debug_dbug; -SET GLOBAL debug_dbug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init"; - -start slave; - -# -# slave is going to stop because of emulated failures -# but there won't be any crashes nor asserts hit. -# -# 1593 = ER_SLAVE_FATAL_ERROR ---let $slave_sql_errno= 1593 ---let $show_slave_sql_error= 1 ---source include/wait_for_slave_sql_error.inc - -call mtr.add_suppression("Failed during slave.* thread initialization"); - -set @@global.debug_dbug = @saved_dbug; - -###################################################################### -# Injecting faults in the init_slave option -###################################################################### -connection slave; - -reset slave; - -SET GLOBAL init_slave= "garbage"; - -start slave; -# 1064 = ER_PARSE_ERROR ---let $slave_sql_errno= 1064 ---let $show_slave_sql_error= 1 ---source include/wait_for_slave_sql_error.inc - -###################################################################### -# Clean up -###################################################################### -SET GLOBAL init_slave= ""; - -# Clean up Last_SQL_Error ---source include/stop_slave_io.inc -RESET SLAVE; ---let $rpl_only_running_threads= 1 ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_loadfile.inc b/mysql-test/suite/rpl/include/rpl_loadfile.inc deleted file mode 100644 index 9cd64530690..00000000000 --- a/mysql-test/suite/rpl/include/rpl_loadfile.inc +++ /dev/null @@ -1,120 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - -############################################################################# -# Original Author: JBM # -# Original Date: Aug/18/2005 # -############################################################################# -# TEST: To test the LOAD_FILE() in rbr # -############################################################################# -# Change Author: JBM -# Change Date: 2006-01-16 -########## - -# Includes --- source include/have_binlog_format_mixed_or_row.inc --- source include/master-slave.inc - --- source suite/rpl/include/rpl_loadfile.test - -# BUG#39701: Mixed binlog format does not switch to row mode on LOAD_FILE -# -# DESCRIPTION -# -# Problem: when using load_file string function and mixed binlogging format -# there was no switch to row based binlogging format. This leads -# to scenarios on which the slave replicates the statement and it -# will try to load the file from local file system, which in most -# likely it will not exist. -# -# Solution: -# Marking this function as unsafe for statement format, makes the -# statement using it to be logged in row based format. As such, data -# replicated from the master, becomes the content of the loaded file. -# Consequently, the slave receives the necessary data to complete -# the load_file instruction correctly. -# -# IMPLEMENTATION -# -# The test is implemented as follows: -# -# On Master, -# i) write to file the desired content. -# ii) create table and stored procedure with load_file -# iii) stop slave -# iii) execute load_file -# iv) remove file -# -# On Slave, -# v) start slave -# vi) sync it with master so that it gets the updates from binlog (which -# should have bin logged in row format). -# -# If the the binlog format does not change to row, then the assertion -# done in the following step fails. This happens because tables differ -# since the file does not exist anymore, meaning that when slave -# attempts to execute LOAD_FILE statement it inserts NULL on table -# instead of the same contents that the master loaded when it executed -# the procedure (which was executed when file existed). -# -# vii) assert that the contents of master and slave -# table are the same - ---source include/rpl_reset.inc - -connection master; -let $file= $MYSQLTEST_VARDIR/tmp/bug_39701.data; - ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---eval SELECT repeat('x',20) INTO OUTFILE '$file' - -disable_warnings; -DROP TABLE IF EXISTS t1; -enable_warnings; - -CREATE TABLE t1 (t text); -DELIMITER |; -CREATE PROCEDURE p(file varchar(4096)) - BEGIN - INSERT INTO t1 VALUES (LOAD_FILE(file)); - END| -DELIMITER ;| - -# stop slave before issuing the load_file on master -connection slave; -source include/stop_slave.inc; - -connection master; - -# test: check that logging falls back to rbr. ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---eval CALL p('$file') - -# test: remove the file from the filesystem and assert that slave still -# gets the loaded file -remove_file $file; - -# now that the file is removed it is safe (regarding what we want to test) -# to start slave -connection slave; -source include/start_slave.inc; - -connection master; -sync_slave_with_master; - -# assertion: assert that the slave got the updates even -# if the file was removed before the slave started, -# meaning that contents were indeed transfered -# through binlog (in row format) -let $diff_tables= master:t1, slave:t1; -source include/diff_tables.inc; - -# CLEAN UP ---connection master -DROP TABLE t1; -DROP PROCEDURE p; - ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_packet.inc b/mysql-test/suite/rpl/include/rpl_packet.inc deleted file mode 100644 index cbde486bcbb..00000000000 --- a/mysql-test/suite/rpl/include/rpl_packet.inc +++ /dev/null @@ -1,184 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - -# ==== Purpose ==== -# -# Check replication protocol packet size handling -# -# ==== Related bugs ==== -# Bug#19402 SQL close to the size of the max_allowed_packet fails on slave -# BUG#23755: Replicated event larger that max_allowed_packet infinitely re-transmits -# BUG#42914: No LAST_IO_ERROR for max_allowed_packet errors -# BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET - -# max-out size db name -source include/have_binlog_format_row.inc; -source include/master-slave.inc; - -call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, .*error.* 1153"); -call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet"); -let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; -disable_warnings; -eval drop database if exists $db; -enable_warnings; -eval create database $db; - -connection master; -let $old_max_allowed_packet= `SELECT @@global.max_allowed_packet`; -let $old_net_buffer_length= `SELECT @@global.net_buffer_length`; -let $old_slave_max_allowed_packet= `SELECT @@global.slave_max_allowed_packet`; -SET @@global.max_allowed_packet=1024; -SET @@global.net_buffer_length=1024; - -sync_slave_with_master; -# Restart slave for setting to take effect -source include/stop_slave.inc; -source include/start_slave.inc; - -# Reconnect to master for new setting to take effect -disconnect master; - -# alas, can't use eval here; if db name changed apply the change here -connect (master,localhost,root,,DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________); - -connection master; -select @@net_buffer_length, @@max_allowed_packet; - -create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM; - -INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1023'); -sync_slave_with_master; - -eval select count(*) from `$db`.`t1` /* must be 1 */; - -SHOW STATUS LIKE 'Slave_running'; -select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING'; -connection master; -eval drop database $db; -sync_slave_with_master; - -# -# Bug #23755: Replicated event larger that max_allowed_packet infinitely re-transmits -# -# Check that a situation when the size of event on the master is greater than -# max_allowed_packet on the slave does not lead to infinite re-transmits. - -connection master; - -# Change the max packet size on master - -SET @@global.max_allowed_packet=4096; -SET @@global.net_buffer_length=4096; - -# Restart slave for new setting to take effect -connection slave; -source include/stop_slave.inc; -source include/start_slave.inc; - -# Reconnect to master for new setting to take effect -disconnect master; -connect (master, localhost, root); -connection master; - -CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM; - -sync_slave_with_master; - -connection master; - -INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048'); - - -# -# Bug#42914: The slave I/O thread must stop after trying to read the above -# event, However there is no Last_IO_Error report. -# - -# The slave I/O thread must stop after trying to read the above event -connection slave; -# 1153 = ER_NET_PACKET_TOO_LARGE ---let $slave_io_errno= 1153 ---let $show_slave_io_error= 1 ---source include/wait_for_slave_io_error.inc - -# TODO: this is needed because of BUG#55790. Remove once that is fixed. ---source include/stop_slave_sql.inc - -# -# Bug#42914: On the master, if a binary log event is larger than -# max_allowed_packet, the error message ER_MASTER_FATAL_ERROR_READING_BINLOG -# is sent to a slave when it requests a dump from the master, thus leading the -# I/O thread to stop. However, there is no Last_IO_Error reported. -# - ---let $rpl_only_running_threads= 1 ---source include/rpl_reset.inc ---connection master -DROP TABLE t1; ---sync_slave_with_master - - -connection master; -CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM; -sync_slave_with_master; - -connection master; -INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet)); - -connection slave; -# The slave I/O thread must stop after receiving -# 1153 = ER_NET_PACKET_TOO_LARGE ---let $slave_io_errno= 1153 ---let $show_slave_io_error= 1 ---source include/wait_for_slave_io_error.inc - -# Remove the bad binlog and clear error status on slave. -STOP SLAVE; -RESET SLAVE; ---connection master -RESET MASTER; - - -# -# BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET -# -# In BUG#55322, @@session.max_allowed_packet increased each time SHOW -# BINLOG EVENTS was issued. To verify that this bug is fixed, we -# execute SHOW BINLOG EVENTS twice and check that max_allowed_packet -# never changes. We turn off the result log because we don't care -# about the contents of the binlog. - ---disable_result_log -SET @max_allowed_packet_0= @@session.max_allowed_packet; -SHOW BINLOG EVENTS; -SET @max_allowed_packet_1= @@session.max_allowed_packet; -SHOW BINLOG EVENTS; -SET @max_allowed_packet_2= @@session.max_allowed_packet; ---enable_result_log -if (`SELECT NOT(@max_allowed_packet_0 = @max_allowed_packet_1 AND @max_allowed_packet_1 = @max_allowed_packet_2)`) -{ - --echo ERROR: max_allowed_packet changed after executing SHOW BINLOG EVENTS - --source include/show_rpl_debug_info.inc - SELECT @max_allowed_packet_0, @max_allowed_packet_1, @max_allowed_packet_2; - --die @max_allowed_packet changed after executing SHOW BINLOG EVENTS -} - - ---echo ==== clean up ==== -connection master; -DROP TABLE t1; -eval SET @@global.max_allowed_packet= $old_max_allowed_packet; -eval SET @@global.net_buffer_length= $old_net_buffer_length; -eval SET @@global.slave_max_allowed_packet= $old_slave_max_allowed_packet; -# slave is stopped -connection slave; -DROP TABLE t1; - -# Clear Last_IO_Error -RESET SLAVE; - ---source include/rpl_end.inc -# End of tests diff --git a/mysql-test/suite/rpl/include/rpl_parallel_ignored_errors.inc b/mysql-test/suite/rpl/include/rpl_parallel_ignored_errors.inc deleted file mode 100644 index 7a6a758a508..00000000000 --- a/mysql-test/suite/rpl/include/rpl_parallel_ignored_errors.inc +++ /dev/null @@ -1,112 +0,0 @@ -# ==== Purpose ==== -# -# Test verifies that, in parallel replication, transaction failure notification -# is propagated to all the workers. Workers should abort the execution of -# transaction event groups, whose event positions are higher than the failing -# transaction group. -# -# ==== Implementation ==== -# -# Steps: -# 0 - Create a table t1 on master which has a primary key. Enable parallel -# replication on slave with slave_parallel_mode='optimistic' and -# slave_parallel_threads=3. -# 1 - On slave start a transaction and execute a local INSERT statement -# which will insert value 32. This is done to block the INSERT coming -# from master. -# 2 - On master execute an INSERT statement with value 32, so that it is -# blocked on slave. -# 3 - On slave enable a debug sync point such that it holds the worker thread -# execution as soon as work is scheduled to it. -# 4 - INSERT value 33 on master. It will be held on slave by other worker -# thread due to debug simulation. -# 5 - INSERT value 34 on master. -# 6 - On slave, enusre that INSERT 34 has reached a state where it waits for -# its prior transactions to commit. -# 7 - Commit the local INSERT 32 on slave server so that first worker will -# error out. -# 8 - Now send a continue signal to second worker processing 33. It should -# wakeup and propagate the error to INSERT 34. -# 9 - Upon slave stop due to error, check that no rows are found after the -# failed INSERT 32. -# -# ==== References ==== -# -# MDEV-20645: Replication consistency is broken as workers miss the error -# notification from an earlier failed group. -# - ---source include/have_innodb.inc ---source include/have_debug.inc ---source include/have_debug_sync.inc ---source include/have_binlog_format_statement.inc ---source include/master-slave.inc - ---enable_connect_log ---connection server_2 ---source include/stop_slave.inc -SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; -SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode; -SET @old_debug= @@GLOBAL.debug_dbug; -SET GLOBAL slave_parallel_mode='optimistic'; -SET GLOBAL slave_parallel_threads= 3; -CHANGE MASTER TO master_use_gtid=slave_pos; -CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends"); ---source include/start_slave.inc - ---connection server_1 -ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; -CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=InnoDB; ---source include/save_master_gtid.inc - ---connection server_2 ---source include/sync_with_master_gtid.inc - ---connect (con_temp2,127.0.0.1,root,,test,$SERVER_MYPORT_2,) -BEGIN; -INSERT INTO t1 VALUES (32); - ---connection server_1 -INSERT INTO t1 VALUES (32); - ---connection server_2 ---let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE info like "INSERT INTO t1 VALUES (32)" ---source include/wait_condition.inc -SET GLOBAL debug_dbug="+d,hold_worker_on_schedule"; -SET debug_sync="debug_sync_action SIGNAL reached_pause WAIT_FOR continue_worker"; - ---connection server_1 -SET gtid_seq_no=100; -INSERT INTO t1 VALUES (33); - ---connection server_2 -SET debug_sync='now WAIT_FOR reached_pause'; - ---connection server_1 -INSERT INTO t1 VALUES (34); - ---connection server_2 ---let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE state like "Waiting for prior transaction to commit" ---source include/wait_condition.inc ---connection con_temp2 -COMMIT; - -# Clean up. ---connection server_2 ---source include/stop_slave.inc ---let $assert_cond= COUNT(*) = 0 FROM t1 WHERE a>32 ---let $assert_text= table t1 should have zero rows where a>32 ---source include/assert.inc -SELECT * FROM t1 WHERE a>32; -DELETE FROM t1 WHERE a=32; - -SET GLOBAL slave_parallel_threads=@old_parallel_threads; -SET GLOBAL slave_parallel_mode=@old_parallel_mode; -SET GLOBAL debug_dbug=@old_debug; -SET DEBUG_SYNC= 'RESET'; ---source include/start_slave.inc - ---connection server_1 -DROP TABLE t1; ---disable_connect_log ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_parallel_show_binlog_events_purge_logs.inc b/mysql-test/suite/rpl/include/rpl_parallel_show_binlog_events_purge_logs.inc deleted file mode 100644 index cddc9286bd2..00000000000 --- a/mysql-test/suite/rpl/include/rpl_parallel_show_binlog_events_purge_logs.inc +++ /dev/null @@ -1,38 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - -# BUG#13979418: SHOW BINLOG EVENTS MAY CRASH THE SERVER -# -# The function mysql_show_binlog_events has a local stack variable -# 'LOG_INFO linfo;', which is assigned to thd->current_linfo, however -# this variable goes out of scope and is destroyed before clean -# thd->current_linfo. -# -# This test case runs SHOW BINLOG EVENTS and FLUSH LOGS to make sure -# that with the fix local variable linfo is valid along all -# mysql_show_binlog_events function scope. -# ---source include/have_debug.inc ---source include/have_debug_sync.inc ---source include/master-slave.inc - ---connection slave -SET DEBUG_SYNC= 'after_show_binlog_events SIGNAL on_show_binlog_events WAIT_FOR end'; ---send SHOW BINLOG EVENTS - ---connection slave1 -SET DEBUG_SYNC= 'now WAIT_FOR on_show_binlog_events'; -FLUSH LOGS; -SET DEBUG_SYNC= 'now SIGNAL end'; - ---connection slave ---disable_result_log ---reap ---enable_result_log -SET DEBUG_SYNC= 'RESET'; - ---connection master ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_relayrotate.inc b/mysql-test/suite/rpl/include/rpl_relayrotate.inc deleted file mode 100644 index 4de554d3143..00000000000 --- a/mysql-test/suite/rpl/include/rpl_relayrotate.inc +++ /dev/null @@ -1,18 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - -####################################################### -# Wrapper for rpl_relayrotate.test to allow multi # -# Engines to reuse test code. By JBM 2006-02-15 # -####################################################### --- source include/have_innodb.inc -# Slow test, don't run during staging part --- source include/not_staging.inc --- source include/master-slave.inc - -let $engine_type=innodb; --- source suite/rpl/include/rpl_relayrotate.test ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_semi_sync.inc b/mysql-test/suite/rpl/include/rpl_semi_sync.inc deleted file mode 100644 index c3cd918b5fc..00000000000 --- a/mysql-test/suite/rpl/include/rpl_semi_sync.inc +++ /dev/null @@ -1,525 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - -source include/not_embedded.inc; -source include/have_innodb.inc; -source include/master-slave.inc; - -let $engine_type= InnoDB; - -# Suppress warnings that might be generated during the test -connection master; -call mtr.add_suppression("Timeout waiting for reply of binlog"); -call mtr.add_suppression("Read semi-sync reply"); -call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); -call mtr.add_suppression("mysqld: Got an error reading communication packets"); -connection slave; -call mtr.add_suppression("Master server does not support semi-sync"); -call mtr.add_suppression("Semi-sync slave .* reply"); -call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); -connection master; - -# wait for dying connections (if any) to disappear -let $wait_condition= select count(*) = 0 from information_schema.processlist where command='killed'; ---source include/wait_condition.inc - -# After fix of BUG#45848, semi-sync slave should not create any extra -# connections on master, save the count of connections before start -# semi-sync slave for comparison below. -let $_connections_normal_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1); - ---echo # ---echo # Uninstall semi-sync plugins on master and slave ---echo # -connection slave; -source include/stop_slave.inc; -reset slave; -set global rpl_semi_sync_master_enabled= 0; -set global rpl_semi_sync_slave_enabled= 0; - -connection master; -reset master; -set global rpl_semi_sync_master_enabled= 0; -set global rpl_semi_sync_slave_enabled= 0; - ---echo # ---echo # Main test of semi-sync replication start here ---echo # - -connection master; - -set global rpl_semi_sync_master_timeout= 60000; # 60s - -echo [ default state of semi-sync on master should be OFF ]; -show variables like 'rpl_semi_sync_master_enabled'; - -echo [ enable semi-sync on master ]; -set global rpl_semi_sync_master_enabled = 1; -show variables like 'rpl_semi_sync_master_enabled'; - -echo [ status of semi-sync on master should be ON even without any semi-sync slaves ]; -show status like 'Rpl_semi_sync_master_clients'; -show status like 'Rpl_semi_sync_master_status'; -show status like 'Rpl_semi_sync_master_yes_tx'; - ---echo # ---echo # BUG#45672 Semisync repl: ActiveTranx:insert_tranx_node: transaction node allocation failed ---echo # BUG#45673 Semisynch reports correct operation even if no slave is connected ---echo # - -# BUG#45672 When semi-sync is enabled on master, it would allocate -# transaction node even without semi-sync slave connected, and would -# finally result in transaction node allocation error. -# -# Semi-sync master will pre-allocate 'max_connections' transaction -# nodes, so here we do more than that much transactions to check if it -# will fail or not. -# select @@global.max_connections + 1; -let $i= `select @@global.max_connections + 1`; -disable_query_log; -eval create table t1 (a int) engine=$engine_type; -while ($i) -{ - eval insert into t1 values ($i); - dec $i; -} -drop table t1; -enable_query_log; - -# BUG#45673 -echo [ status of semi-sync on master should be OFF ]; -show status like 'Rpl_semi_sync_master_clients'; -show status like 'Rpl_semi_sync_master_status'; -show status like 'Rpl_semi_sync_master_yes_tx'; - -# reset master to make sure the following test will start with a clean environment -reset master; - -connection slave; - -echo [ default state of semi-sync on slave should be OFF ]; -show variables like 'rpl_semi_sync_slave_enabled'; - -echo [ enable semi-sync on slave ]; -set global rpl_semi_sync_slave_enabled = 1; -show variables like 'rpl_semi_sync_slave_enabled'; -source include/start_slave.inc; - -connection master; - -# NOTE: Rpl_semi_sync_master_client will only be updated when -# semi-sync slave has started binlog dump request -let $status_var= Rpl_semi_sync_master_clients; -let $status_var_value= 1; -source include/wait_for_status_var.inc; - -echo [ initial master state after the semi-sync slave connected ]; -show status like 'Rpl_semi_sync_master_clients'; -show status like 'Rpl_semi_sync_master_status'; -show status like 'Rpl_semi_sync_master_no_tx'; -show status like 'Rpl_semi_sync_master_yes_tx'; - -replace_result $engine_type ENGINE_TYPE; -eval create table t1(a int) engine = $engine_type; - -echo [ master state after CREATE TABLE statement ]; -show status like 'Rpl_semi_sync_master_status'; -show status like 'Rpl_semi_sync_master_no_tx'; -show status like 'Rpl_semi_sync_master_yes_tx'; - -# After fix of BUG#45848, semi-sync slave should not create any extra -# connections on master. -let $_connections_semisync_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1); -replace_result $_connections_normal_slave CONNECTIONS_NORMAL_SLAVE $_connections_semisync_slave CONNECTIONS_SEMISYNC_SLAVE; -eval select $_connections_semisync_slave - $_connections_normal_slave as 'Should be 0'; - -echo [ insert records to table ]; -insert t1 values (10); -insert t1 values (9); -insert t1 values (8); -insert t1 values (7); -insert t1 values (6); -insert t1 values (5); -insert t1 values (4); -insert t1 values (3); -insert t1 values (2); -insert t1 values (1); - -echo [ master status after inserts ]; -show status like 'Rpl_semi_sync_master_status'; -show status like 'Rpl_semi_sync_master_no_tx'; -show status like 'Rpl_semi_sync_master_yes_tx'; - -sync_slave_with_master; - -echo [ slave status after replicated inserts ]; -show status like 'Rpl_semi_sync_slave_status'; - -select count(distinct a) from t1; -select min(a) from t1; -select max(a) from t1; - ---echo ---echo # BUG#50157 ---echo # semi-sync replication crashes when replicating a transaction which ---echo # include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ; - -connection master; -SET SESSION AUTOCOMMIT= 0; -CREATE TABLE t2(c1 INT) ENGINE=innodb; -sync_slave_with_master; - -connection master; -BEGIN; ---echo ---echo # Even though it is in a transaction, this statement is binlogged into binlog ---echo # file immediately. ---disable_warnings -CREATE TEMPORARY TABLE t3 SELECT c1 FROM t2 where 1=1; ---enable_warnings ---echo ---echo # These statements will not be binlogged until the transaction is committed -INSERT INTO t2 VALUES(11); -INSERT INTO t2 VALUES(22); -COMMIT; - -DROP TABLE t2, t3; -SET SESSION AUTOCOMMIT= 1; -sync_slave_with_master; - - ---echo # ---echo # Test semi-sync master will switch OFF after one transaction ---echo # timeout waiting for slave reply. ---echo # -connection slave; -source include/stop_slave.inc; - -connection master; ---source include/kill_binlog_dump_threads.inc -set global rpl_semi_sync_master_timeout= 5000; - -# The first semi-sync check should be on because after slave stop, -# there are no transactions on the master. -echo [ master status should be ON ]; - -let $status_var= Rpl_semi_sync_master_status; -let $status_var_value= ON; -source include/wait_for_status_var.inc; - -let $status_var= Rpl_semi_sync_master_clients; -let $status_var_value= 0; -source include/wait_for_status_var.inc; - -show status like 'Rpl_semi_sync_master_no_tx'; -show status like 'Rpl_semi_sync_master_yes_tx'; - -echo [ semi-sync replication of these transactions will fail ]; -insert into t1 values (500); - -# Wait for the semi-sync replication of this transaction to timeout -let $status_var= Rpl_semi_sync_master_status; -let $status_var_value= OFF; -source include/wait_for_status_var.inc; - -# The second semi-sync check should be off because one transaction -# times out during waiting. -echo [ master status should be OFF ]; -show status like 'Rpl_semi_sync_master_status'; -show status like 'Rpl_semi_sync_master_no_tx'; -show status like 'Rpl_semi_sync_master_yes_tx'; - -# Semi-sync status on master is now OFF, so all these transactions -# will be replicated asynchronously. -delete from t1 where a=10; -delete from t1 where a=9; -delete from t1 where a=8; -delete from t1 where a=7; -delete from t1 where a=6; -delete from t1 where a=5; -delete from t1 where a=4; -delete from t1 where a=3; -delete from t1 where a=2; -delete from t1 where a=1; - -insert into t1 values (100); - -echo [ master status should be OFF ]; -show status like 'Rpl_semi_sync_master_status'; -show status like 'Rpl_semi_sync_master_no_tx'; -show status like 'Rpl_semi_sync_master_yes_tx'; - ---echo # ---echo # Test semi-sync status on master will be ON again when slave catches up ---echo # - -# Save the master position for later use. -save_master_pos; - -connection slave; - -echo [ slave status should be OFF ]; -show status like 'Rpl_semi_sync_slave_status'; -source include/start_slave.inc; -sync_with_master; - -echo [ slave status should be ON ]; -show status like 'Rpl_semi_sync_slave_status'; - -select count(distinct a) from t1; -select min(a) from t1; -select max(a) from t1; - -connection master; - -# The master semi-sync status should be on again after slave catches up. -echo [ master status should be ON again after slave catches up ]; - -let $status_var= Rpl_semi_sync_master_status; -let $status_var_value= ON; -source include/wait_for_status_var.inc; -show status like 'Rpl_semi_sync_master_no_tx'; -show status like 'Rpl_semi_sync_master_yes_tx'; -show status like 'Rpl_semi_sync_master_clients'; - ---echo # ---echo # Test disable/enable master semi-sync on the fly. ---echo # - -drop table t1; -sync_slave_with_master; - -source include/stop_slave.inc; - ---echo # ---echo # Flush status ---echo # -connection master; -echo [ Semi-sync master status variables before FLUSH STATUS ]; -SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx'; -SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx'; -# Do not write the FLUSH STATUS to binlog, to make sure we'll get a -# clean status after this. -FLUSH NO_WRITE_TO_BINLOG STATUS; -echo [ Semi-sync master status variables after FLUSH STATUS ]; -SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx'; -SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx'; - -connection master; - -source include/show_master_logs.inc; -show variables like 'rpl_semi_sync_master_enabled'; - -echo [ disable semi-sync on the fly ]; -set global rpl_semi_sync_master_enabled=0; -show variables like 'rpl_semi_sync_master_enabled'; -show status like 'Rpl_semi_sync_master_status'; - -echo [ enable semi-sync on the fly ]; -set global rpl_semi_sync_master_enabled=1; -show variables like 'rpl_semi_sync_master_enabled'; -show status like 'Rpl_semi_sync_master_status'; - ---echo # ---echo # Test RESET MASTER/SLAVE ---echo # - -connection slave; - -source include/start_slave.inc; - -connection master; - -replace_result $engine_type ENGINE_TYPE; -eval create table t1 (a int) engine = $engine_type; -drop table t1; - -sync_slave_with_master; - -echo [ test reset master ]; -connection master; - -reset master; - -show status like 'Rpl_semi_sync_master_status'; -show status like 'Rpl_semi_sync_master_no_tx'; -show status like 'Rpl_semi_sync_master_yes_tx'; - -connection slave; - -source include/stop_slave.inc; -reset slave; - -# Kill the dump thread on master for previous slave connection and ---source include/kill_binlog_dump_threads.inc - -connection slave; -source include/start_slave.inc; - -connection master; - -# Wait for dump thread to start, Rpl_semi_sync_master_clients will be -# 1 after dump thread started. -let $status_var= Rpl_semi_sync_master_clients; -let $status_var_value= 1; -source include/wait_for_status_var.inc; - -replace_result $engine_type ENGINE_TYPE; -eval create table t1 (a int) engine = $engine_type; -insert into t1 values (1); -insert into t1 values (2), (3); - -sync_slave_with_master; - -select * from t1; - -connection master; - -echo [ master semi-sync status should be ON ]; -show status like 'Rpl_semi_sync_master_status'; -show status like 'Rpl_semi_sync_master_no_tx'; -show status like 'Rpl_semi_sync_master_yes_tx'; - ---echo # ---echo # Start semi-sync replication without SUPER privilege ---echo # -connection slave; -source include/stop_slave.inc; -reset slave; -connection master; -reset master; - -# Kill the dump thread on master for previous slave connection and wait for it to exit ---source include/kill_binlog_dump_threads.inc - -# Do not binlog the following statement because it will generate -# different events for ROW and STATEMENT format -set sql_log_bin=0; -grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password'; -flush privileges; -set sql_log_bin=1; -connection slave; -grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password'; -flush privileges; -change master to master_user='rpl',master_password='rpl_password'; -source include/start_slave.inc; -show status like 'Rpl_semi_sync_slave_status'; -connection master; - -# Wait for the semi-sync binlog dump thread to start -let $status_var= Rpl_semi_sync_master_clients; -let $status_var_value= 1; -source include/wait_for_status_var.inc; -echo [ master semi-sync should be ON ]; -show status like 'Rpl_semi_sync_master_clients'; -show status like 'Rpl_semi_sync_master_status'; -show status like 'Rpl_semi_sync_master_no_tx'; -show status like 'Rpl_semi_sync_master_yes_tx'; -insert into t1 values (4); -insert into t1 values (5); -echo [ master semi-sync should be ON ]; -show status like 'Rpl_semi_sync_master_clients'; -show status like 'Rpl_semi_sync_master_status'; -show status like 'Rpl_semi_sync_master_no_tx'; -show status like 'Rpl_semi_sync_master_yes_tx'; - ---echo # ---echo # Test semi-sync slave connect to non-semi-sync master ---echo # - -# Disable semi-sync on master -connection slave; -source include/stop_slave.inc; -SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; - -connection master; - -# Kill the dump thread on master for previous slave connection and wait for it to exit ---source include/kill_binlog_dump_threads.inc - -echo [ Semi-sync status on master should be ON ]; -let $status_var= Rpl_semi_sync_master_clients; -let $status_var_value= 0; -source include/wait_for_status_var.inc; -show status like 'Rpl_semi_sync_master_status'; -let $status_var= Rpl_semi_sync_master_status; -let $status_var_value= ON; -source include/wait_for_status_var.inc; -set global rpl_semi_sync_master_enabled= 0; - -connection slave; -SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled'; -source include/start_slave.inc; -connection master; -insert into t1 values (8); -let $status_var= Rpl_semi_sync_master_clients; -let $status_var_value= 1; -source include/wait_for_status_var.inc; -echo [ master semi-sync clients should be 1, status should be OFF ]; -show status like 'Rpl_semi_sync_master_clients'; -show status like 'Rpl_semi_sync_master_status'; -sync_slave_with_master; -show status like 'Rpl_semi_sync_slave_status'; - -# Uninstall semi-sync plugin on master -connection slave; -source include/stop_slave.inc; -connection master; -set global rpl_semi_sync_master_enabled= 0; - -connection slave; -SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled'; -source include/start_slave.inc; - -connection master; -insert into t1 values (10); -sync_slave_with_master; - ---echo # ---echo # Test non-semi-sync slave connect to semi-sync master ---echo # - -connection master; -set global rpl_semi_sync_master_timeout= 5000; # 5s -set global rpl_semi_sync_master_enabled= 1; - -connection slave; -source include/stop_slave.inc; -SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; - -echo [ uninstall semi-sync slave plugin ]; -set global rpl_semi_sync_slave_enabled= 0; - -echo [ reinstall semi-sync slave plugin and disable semi-sync ]; -SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled'; -SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; -source include/start_slave.inc; -SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; - ---echo # ---echo # Clean up ---echo # - -connection slave; -source include/stop_slave.inc; -set global rpl_semi_sync_slave_enabled= 0; - -connection master; -set global rpl_semi_sync_master_enabled= 0; - -connection slave; -change master to master_user='root',master_password=''; -source include/start_slave.inc; - -connection master; -drop table t1; -sync_slave_with_master; - -connection master; -drop user rpl@127.0.0.1; -flush privileges; -set global rpl_semi_sync_master_timeout= default; ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_skip_replication.inc b/mysql-test/suite/rpl/include/rpl_skip_replication.inc deleted file mode 100644 index 97fc961d438..00000000000 --- a/mysql-test/suite/rpl/include/rpl_skip_replication.inc +++ /dev/null @@ -1,402 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it. -# -# Usage: -# -# --let $use_remote_mysqlbinlog= 1 # optional -# --source suite/rpl/include/rpl_skip_replication.inc -# -# The script uses MYSQLBINLOG to verify certain results. -# By default, it uses binary logs directly. If it is undesirable, -# this behavior can be overridden by setting $use_remote_binlog -# as shown above. -# The value will be unset after every execution of the script, -# so if it is needed, it should be set explicitly before each call. -# - ---source include/have_innodb.inc ---source include/master-slave.inc - -connection slave; -# Test that SUPER is required to change @@replicate_events_marked_for_skip. -CREATE USER 'nonsuperuser'@'127.0.0.1'; -GRANT ALTER,CREATE,DELETE,DROP,EVENT,INSERT,PROCESS,REPLICATION SLAVE, - SELECT,UPDATE ON *.* TO 'nonsuperuser'@'127.0.0.1'; -connect(nonpriv, 127.0.0.1, nonsuperuser,, test, $SLAVE_MYPORT,); -connection nonpriv; ---error ER_SPECIFIC_ACCESS_DENIED_ERROR -SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER; -disconnect nonpriv; -connection slave; -DROP USER'nonsuperuser'@'127.0.0.1'; - -SELECT @@global.replicate_events_marked_for_skip; ---error ER_SLAVE_MUST_STOP -SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE; -SELECT @@global.replicate_events_marked_for_skip; -STOP SLAVE; ---error ER_GLOBAL_VARIABLE -SET SESSION replicate_events_marked_for_skip=FILTER_ON_MASTER; -SELECT @@global.replicate_events_marked_for_skip; -SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER; -SELECT @@global.replicate_events_marked_for_skip; -START SLAVE; - -connection master; -SELECT @@skip_replication; ---error ER_LOCAL_VARIABLE -SET GLOBAL skip_replication=1; -SELECT @@skip_replication; - -CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=myisam; -CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=innodb; -INSERT INTO t1(a) VALUES (1); -INSERT INTO t2(a) VALUES (1); - - -# Test that master-side filtering works. -SET skip_replication=1; - -CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam; -INSERT INTO t1(a) VALUES (2); -INSERT INTO t2(a) VALUES (2); - -# Inject a rotate event in the binlog stream sent to slave (otherwise we will -# fail sync_slave_with_master as the last event on the master is not present -# on the slave). -FLUSH NO_WRITE_TO_BINLOG LOGS; - -sync_slave_with_master; -connection slave; -SHOW TABLES; -SELECT * FROM t1; -SELECT * FROM t2; - -connection master; -DROP TABLE t3; - -FLUSH NO_WRITE_TO_BINLOG LOGS; -sync_slave_with_master; - - -# Test that slave-side filtering works. -connection slave; -STOP SLAVE; -SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE; -START SLAVE; - -connection master; -SET skip_replication=1; -CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam; -INSERT INTO t1(a) VALUES (3); -INSERT INTO t2(a) VALUES (3); - -# Inject a rotate event in the binlog stream sent to slave (otherwise we will -# fail sync_slave_with_master as the last event on the master is not present -# on the slave). -FLUSH NO_WRITE_TO_BINLOG LOGS; - -sync_slave_with_master; -connection slave; -SHOW TABLES; -SELECT * FROM t1; -SELECT * FROM t2; - -connection master; -DROP TABLE t3; - -FLUSH NO_WRITE_TO_BINLOG LOGS; -sync_slave_with_master; -connection slave; -STOP SLAVE; -SET GLOBAL replicate_events_marked_for_skip=REPLICATE; -START SLAVE; - - -# Test that events with @@skip_replication=1 are not filtered when filtering is -# not set on slave. -connection master; -SET skip_replication=1; -CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam; -INSERT INTO t3(a) VALUES(2); -sync_slave_with_master; -connection slave; -SELECT * FROM t3; -connection master; -DROP TABLE t3; - -# -# Test that the slave will preserve the @@skip_replication flag in its -# own binlog. -# - -TRUNCATE t1; -sync_slave_with_master; -connection slave; -RESET MASTER; - -connection master; -SET skip_replication=0; -INSERT INTO t1 VALUES (1,0); -SET skip_replication=1; -INSERT INTO t1 VALUES (2,0); -SET skip_replication=0; -INSERT INTO t1 VALUES (3,0); - -sync_slave_with_master; -connection slave; -# Since slave has @@replicate_events_marked_for_skip=REPLICATE, it should have -# applied all events. -SELECT * FROM t1 ORDER by a; - -STOP SLAVE; -SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER; -let $SLAVE_DATADIR= `select @@datadir`; - -connection master; -TRUNCATE t1; - -# Now apply the slave binlog to the master, to check that both the slave -# and mysqlbinlog will preserve the @@skip_replication flag. - ---let $mysqlbinlog_args= $SLAVE_DATADIR/slave-bin.000001 -if ($use_remote_mysqlbinlog) -{ - --let $mysqlbinlog_args= --read-from-remote-server --protocol=tcp --host=127.0.0.1 --port=$SLAVE_MYPORT -uroot slave-bin.000001 - --let $use_remote_mysqlbinlog= 0 -} ---exec $MYSQL_BINLOG $mysqlbinlog_args > $MYSQLTEST_VARDIR/tmp/rpl_skip_replication.binlog ---exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/rpl_skip_replication.binlog - -# The master should have all three events. -SELECT * FROM t1 ORDER by a; - -# The slave should be missing event 2, which is marked with the -# @@skip_replication flag. - -connection slave; -START SLAVE; - -connection master; -sync_slave_with_master; - -connection slave; -SELECT * FROM t1 ORDER by a; - -# -# Test that @@sql_slave_skip_counter does not count skipped @@skip_replication -# events. -# - -connection master; -TRUNCATE t1; - -sync_slave_with_master; -connection slave; -STOP SLAVE; -# We will skip two INSERTs (in addition to any skipped due to -# @@skip_replication). Since from 5.5 every statement is wrapped in -# BEGIN ... END, we need to skip 6 events for this. -SET GLOBAL sql_slave_skip_counter=6; -SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE; -START SLAVE; - -connection master; -# Need to fix @@binlog_format to get consistent event count. -SET @old_binlog_format= @@binlog_format; -SET binlog_format= statement; -SET skip_replication=0; -INSERT INTO t1 VALUES (1,5); -SET skip_replication=1; -INSERT INTO t1 VALUES (2,5); -SET skip_replication=0; -INSERT INTO t1 VALUES (3,5); -INSERT INTO t1 VALUES (4,5); -SET binlog_format= @old_binlog_format; - -sync_slave_with_master; -connection slave; - -# The slave should have skipped the first three inserts (number 1 and 3 due -# to @@sql_slave_skip_counter=2, number 2 due to -# @@replicate_events_marked_for_skip=FILTER_ON_SLAVE). So only number 4 -# should be left. -SELECT * FROM t1; - - -# -# Check that BINLOG statement preserves the @@skip_replication flag. -# -connection slave; -# Need row @@binlog_format for BINLOG statements containing row events. ---source include/stop_slave.inc -SET @old_slave_binlog_format= @@global.binlog_format; -SET GLOBAL binlog_format= row; ---source include/start_slave.inc - -connection master; -TRUNCATE t1; - -SET @old_binlog_format= @@binlog_format; -SET binlog_format= row; -# Format description log event. -BINLOG 'wlZOTw8BAAAA8QAAAPUAAAAAAAQANS41LjIxLU1hcmlhREItZGVidWctbG9nAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAA2QAEGggAAAAICAgCAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAA371saA=='; -# INSERT INTO t1 VALUES (1,8) # with @@skip_replication=1 -BINLOG 'wlZOTxMBAAAAKgAAAGMBAAAAgCkAAAAAAAEABHRlc3QAAnQxAAIDAwAC -wlZOTxcBAAAAJgAAAIkBAAAAgCkAAAAAAAEAAv/8AQAAAAgAAAA='; -# INSERT INTO t1 VALUES (2,8) # with @@skip_replication=0 -BINLOG 'wlZOTxMBAAAAKgAAADwCAAAAACkAAAAAAAEABHRlc3QAAnQxAAIDAwAC -wlZOTxcBAAAAJgAAAGICAAAAACkAAAAAAAEAAv/8AgAAAAgAAAA='; -SET binlog_format= @old_binlog_format; - -SELECT * FROM t1 ORDER BY a; -sync_slave_with_master; -connection slave; -# Slave should have only the second insert, the first should be ignored due to -# the @@skip_replication flag. -SELECT * FROM t1 ORDER by a; - ---source include/stop_slave.inc -SET GLOBAL binlog_format= @old_slave_binlog_format; ---source include/start_slave.inc - - -# Test that it is not possible to change @@skip_replication inside a -# transaction or statement, thereby replicating only parts of statements -# or transactions. -connection master; -SET skip_replication=0; - -BEGIN; ---error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION -SET skip_replication=0; ---error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION -SET skip_replication=1; -ROLLBACK; -SET skip_replication=1; -BEGIN; ---error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION -SET skip_replication=0; ---error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION -SET skip_replication=1; -COMMIT; -SET autocommit=0; -INSERT INTO t2(a) VALUES(100); ---error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION -SET skip_replication=1; -ROLLBACK; -SET autocommit=1; - -SET skip_replication=1; ---delimiter | -CREATE FUNCTION foo (x INT) RETURNS INT BEGIN SET SESSION skip_replication=x; RETURN x; END| -CREATE PROCEDURE bar(x INT) BEGIN SET SESSION skip_replication=x; END| -CREATE FUNCTION baz (x INT) RETURNS INT BEGIN CALL bar(x); RETURN x; END| ---delimiter ; ---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION -SELECT foo(0); ---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION -SELECT baz(0); ---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION -SET @a= foo(1); ---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION -SET @a= baz(1); ---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION -UPDATE t2 SET b=foo(0); ---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION -UPDATE t2 SET b=baz(0); ---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION -INSERT INTO t1 VALUES (101, foo(1)); ---error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION -INSERT INTO t1 VALUES (101, baz(0)); -SELECT @@skip_replication; -CALL bar(0); -SELECT @@skip_replication; -CALL bar(1); -SELECT @@skip_replication; -DROP FUNCTION foo; -DROP PROCEDURE bar; -DROP FUNCTION baz; - - -# Test that master-side filtering happens on the master side, and that -# slave-side filtering happens on the slave. - -# First test that events do not reach the slave when master-side filtering -# is configured. Do this by replicating first with only the IO thread running -# and master-side filtering; then change to no filtering and start the SQL -# thread. This should still skip the events, as master-side filtering -# means the events never reached the slave. -connection master; -SET skip_replication= 0; -TRUNCATE t1; -sync_slave_with_master; -connection slave; -STOP SLAVE; -SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER; -START SLAVE IO_THREAD; -connection master; -SET skip_replication= 1; -INSERT INTO t1(a) VALUES (1); -SET skip_replication= 0; -INSERT INTO t1(a) VALUES (2); ---source include/save_master_pos.inc -connection slave; ---source include/sync_io_with_master.inc -STOP SLAVE IO_THREAD; -SET GLOBAL replicate_events_marked_for_skip=REPLICATE; -START SLAVE; -connection master; -sync_slave_with_master; -connection slave; -# Now only the second insert of (2) should be visible, as the first was -# filtered on the master, so even though the SQL thread ran without skipping -# events, it will never see the event in the first place. -SELECT * FROM t1; - -# Now tests that when slave-side filtering is configured, events _do_ reach -# the slave. -connection master; -SET skip_replication= 0; -TRUNCATE t1; -sync_slave_with_master; -connection slave; -STOP SLAVE; -SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE; -START SLAVE IO_THREAD; -connection master; -SET skip_replication= 1; -INSERT INTO t1(a) VALUES (1); -SET skip_replication= 0; -INSERT INTO t1(a) VALUES (2); ---source include/save_master_pos.inc -connection slave; ---source include/sync_io_with_master.inc -STOP SLAVE IO_THREAD; -SET GLOBAL replicate_events_marked_for_skip=REPLICATE; -START SLAVE; -connection master; -sync_slave_with_master; -connection slave; -# Now both inserts should be visible. Since filtering was configured to be -# slave-side, the event is in the relay log, and when the SQL thread ran we -# had disabled filtering again. -SELECT * FROM t1 ORDER BY a; - - -# Clean up. -connection master; -SET skip_replication=0; -DROP TABLE t1,t2; -connection slave; -STOP SLAVE; -SET GLOBAL replicate_events_marked_for_skip=REPLICATE; -START SLAVE; - ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_special_charset.inc b/mysql-test/suite/rpl/include/rpl_special_charset.inc deleted file mode 100644 index 641aa483d32..00000000000 --- a/mysql-test/suite/rpl/include/rpl_special_charset.inc +++ /dev/null @@ -1,32 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - -################################################################################ -# Bug#19855907 IO THREAD AUTHENTICATION ISSUE WITH SOME CHARACTER SETS -# Problem: IO thread fails to connect to master if servers are configured with -# special character sets like utf16, utf32, ucs2. -# -# Analysis: MySQL server does not support few special character sets like -# utf16,utf32 and ucs2 as "client's character set"(eg: utf16,utf32, ucs2). -# When IO thread is trying to connect to Master, it sets server's character -# set as client's character set. When Slave server is started with these -# special character sets, IO thread (a connection to Master) fails because -# of the above said reason. -# -# Fix: If server's character set is not supported as client's character set, -# then set default's client character set(latin1) as client's character set. -############################################################################### ---source include/master-slave.inc -call mtr.add_suppression("'utf16' can not be used as client character set"); -CREATE TABLE t1(i VARCHAR(20)); -INSERT INTO t1 VALUES (0xFFFF); ---sync_slave_with_master ---let diff_tables=master:t1, slave:t1 ---source include/diff_tables.inc -# Cleanup ---connection master -DROP TABLE t1; ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_sporadic_master.inc b/mysql-test/suite/rpl/include/rpl_sporadic_master.inc deleted file mode 100644 index ad4c44cbf74..00000000000 --- a/mysql-test/suite/rpl/include/rpl_sporadic_master.inc +++ /dev/null @@ -1,32 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - -# test to see if replication can continue when master sporadically fails on -# COM_BINLOG_DUMP and additionally limits the number of events per dump - -source include/master-slave.inc; - -create table t2(n int); -create table t1(n int not null auto_increment primary key); -insert into t1 values (NULL),(NULL); -truncate table t1; -# We have to use 4 in the following to make this test work with all table types -insert into t1 values (4),(NULL); -sync_slave_with_master; ---source include/stop_slave.inc ---source include/start_slave.inc -connection master; -insert into t1 values (NULL),(NULL); -flush logs; -truncate table t1; -insert into t1 values (10),(NULL),(NULL),(NULL),(NULL),(NULL); -sync_slave_with_master; -select * from t1 ORDER BY n; -connection master; -drop table t1,t2; -sync_slave_with_master; - ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_ssl.inc b/mysql-test/suite/rpl/include/rpl_ssl.inc deleted file mode 100644 index 59a2af9f137..00000000000 --- a/mysql-test/suite/rpl/include/rpl_ssl.inc +++ /dev/null @@ -1,116 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - -source include/have_ssl_communication.inc; -source include/master-slave.inc; -source include/no_valgrind_without_big.inc; - -# create a user for replication that requires ssl encryption -connection master; -create user replssl@localhost; -grant replication slave on *.* to replssl@localhost require ssl; -create table t1 (t int auto_increment, KEY(t)); - -sync_slave_with_master; - -# Set slave to use SSL for connection to master -stop slave; ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR -eval change master to - master_user='replssl', - master_password='', - master_ssl=1, - master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem', - master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem', - master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem'; -start slave; - -# Switch to master and insert one record, then sync it to slave -connection master; -insert into t1 values(1); -sync_slave_with_master; - -# The record should now be on slave -select * from t1; - -# The slave is synced and waiting/reading from master -# SHOW SLAVE STATUS will show "Waiting for master to send event" -let $status_items= Master_SSL_Allowed, Master_SSL_CA_Path, Master_SSL_CA_File, Master_SSL_Crl, Master_SSL_Crlpath, Master_SSL_Cert, Master_SSL_Key; -source include/show_slave_status.inc; -source include/check_slave_is_running.inc; - -# Stop the slave, as reported in bug#21871 it would hang -STOP SLAVE; - -select * from t1; - -# Do the same thing a number of times -disable_query_log; -disable_result_log; -# 2007-11-27 mats Bug #32756 Starting and stopping the slave in a loop can lose rows -# After discussions with Engineering, I'm disabling this part of the test to avoid it causing -# red trees. -disable_parsing; -let $i= 100; -while ($i) -{ - start slave; - connection master; - insert into t1 values (NULL); - select * from t1; # Some variance - connection slave; - select * from t1; # Some variance - stop slave; - dec $i; -} -enable_parsing; -START SLAVE; -enable_query_log; -enable_result_log; -connection master; -# INSERT one more record to make sure -# the sync has something to do -insert into t1 values (NULL); -let $master_count= `select count(*) from t1`; - -sync_slave_with_master; ---source include/wait_for_slave_to_start.inc -source include/show_slave_status.inc; -source include/check_slave_is_running.inc; - -let $slave_count= `select count(*) from t1`; - -if ($slave_count != $master_count) -{ - echo master and slave differed in number of rows; - echo master: $master_count; - echo slave: $slave_count; - - connection master; - select count(*) t1; - select * from t1; - connection slave; - select count(*) t1; - select * from t1; - query_vertical show slave status; -} - -connection master; -drop user replssl@localhost; -drop table t1; -sync_slave_with_master; - ---source include/stop_slave.inc -CHANGE MASTER TO - master_user = 'root', - master_ssl = 0, - master_ssl_ca = '', - master_ssl_cert = '', - master_ssl_key = ''; - ---echo End of 5.0 tests ---let $rpl_only_running_threads= 1 ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_stm_relay_ign_space.inc b/mysql-test/suite/rpl/include/rpl_stm_relay_ign_space.inc deleted file mode 100644 index 41339f539f8..00000000000 --- a/mysql-test/suite/rpl/include/rpl_stm_relay_ign_space.inc +++ /dev/null @@ -1,107 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - -# -# BUG#12400313 / BUG#64503 test case -# -# -# Description -# ----------- -# -# This test case starts the slave server with: -# --relay-log-space-limit=8192 --relay-log-purge --max-relay-log-size=4096 -# -# Then it issues some queries that will cause the slave to reach -# relay-log-space-limit. We lock the table so that the SQL thread is -# not able to purge the log and then we issue some more statements. -# -# The purpose is to show that the IO thread will honor the limits -# while the SQL thread is not able to purge the relay logs, which did -# not happen before this patch. In addition we assert that while -# ignoring the limit (SQL thread needs to rotate before purging), the -# IO thread does not do it in an uncontrolled manner. - ---source include/have_binlog_format_statement.inc ---source include/have_innodb.inc ---source include/master-slave.inc - ---disable_query_log -CREATE TABLE t1 (c1 TEXT) engine=InnoDB; - -INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); -INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); -INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); -INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); - ---sync_slave_with_master - -# wait for the SQL thread to sleep ---let $show_statement= SHOW PROCESSLIST ---let $field= State ---let $condition= = 'Slave has read all relay log; waiting for the slave I/O thread to update it' ---source include/wait_show_condition.inc - -# now the io thread has set rli->ignore_space_limit -# lets lock the table so that once the SQL thread awakes -# it blocks there and does not set rli->ignore_space_limit -# back to zero -LOCK TABLE t1 WRITE; - -# now issue more statements that will overflow the -# rli->log_space_limit (in this case ~10K) ---connection master - -INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); -INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); -INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); -INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); -INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); -INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); -INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); -INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); -INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); -INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); - ---connection slave - -# ASSERT that the IO thread waits for the SQL thread to release some -# space before continuing ---let $show_statement= SHOW PROCESSLIST ---let $field= State ---let $condition= LIKE 'Waiting for %' -# before the patch (IO would have transfered everything) -#--let $condition= = 'Waiting for master to send event' -# after the patch (now it waits for space to be freed) -#--let $condition= = 'Waiting for the slave SQL thread to free enough relay log space' ---source include/wait_show_condition.inc - -# without the patch we can uncomment the following two lines and -# watch the IO thread synchronize with the master, thus writing -# relay logs way over the space limit -#--connection master -#--source include/sync_slave_io_with_master.inc - -## ASSERT that the IO thread has honored the limit+few bytes required to be able to purge ---let $relay_log_space_while_sql_is_executing = query_get_value(SHOW SLAVE STATUS, Relay_Log_Space, 1) ---let $relay_log_space_limit = query_get_value(SHOW VARIABLES LIKE "relay_log_space_limit", Value, 1) ---let $assert_text= Assert that relay log space is close to the limit ---let $assert_cond= $relay_log_space_while_sql_is_executing <= $relay_log_space_limit * 1.15 ---source include/assert.inc - -# unlock the table and let SQL thread continue applying events -UNLOCK TABLES; - ---connection master ---sync_slave_with_master ---let $diff_tables=master:test.t1,slave:test.t1 ---source include/diff_tables.inc - ---connection master -DROP TABLE t1; ---enable_query_log ---sync_slave_with_master - ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc b/mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc deleted file mode 100644 index 31b80732c60..00000000000 --- a/mysql-test/suite/rpl/include/rpl_switch_stm_row_mixed.inc +++ /dev/null @@ -1,633 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - -# -# rpl_switch_stm_row_mixed tests covers -# -# - Master is switching explicitly between STATEMENT, ROW, and MIXED -# binlog format showing when it is possible and when not. -# - Master switching from MIXED to RBR implicitly listing all use -# cases, e.g a query invokes UUID(), thereafter to serve as the -# definition of MIXED binlog format -# - correctness of execution - - --- source include/have_binlog_format_mixed_or_row.inc --- source include/master-slave.inc - -# Since this test generates row-based events in the binary log, the -# slave SQL thread cannot be in STATEMENT mode to execute this test, -# so we only execute it for MIXED and ROW as default value of -# BINLOG_FORMAT. - -connection slave; - -connection master; ---disable_warnings -drop database if exists mysqltest1; -create database mysqltest1; ---enable_warnings -use mysqltest1; - -# Save binlog format -set @my_binlog_format= @@global.binlog_format; - -# play with switching -set session binlog_format=mixed; -show session variables like "binlog_format%"; -set session binlog_format=statement; -show session variables like "binlog_format%"; -set session binlog_format=row; -show session variables like "binlog_format%"; - -set global binlog_format=DEFAULT; -show global variables like "binlog_format%"; -set global binlog_format=MIXED; -show global variables like "binlog_format%"; -set global binlog_format=STATEMENT; -show global variables like "binlog_format%"; -set global binlog_format=ROW; -show global variables like "binlog_format%"; -show session variables like "binlog_format%"; -select @@global.binlog_format, @@session.binlog_format; - -CREATE TABLE t1 (a varchar(100)); - -prepare stmt1 from 'insert into t1 select concat(UUID(),?)'; -set @string="emergency_1_"; -insert into t1 values("work_2_"); -execute stmt1 using @string; -deallocate prepare stmt1; - -prepare stmt1 from 'insert into t1 select ?'; -insert into t1 values(concat(UUID(),"work_3_")); -execute stmt1 using @string; -deallocate prepare stmt1; - -insert into t1 values(concat("for_4_",UUID())); -insert into t1 select "yesterday_5_"; - -# verify that temp tables prevent a switch to SBR -create temporary table tmp(a char(100)); -insert into tmp values("see_6_"); ---error ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR -set binlog_format=statement; -insert into t1 select * from tmp; -drop temporary table tmp; - -# Now we go to SBR -set binlog_format=statement; -show global variables like "binlog_format%"; -show session variables like "binlog_format%"; -select @@global.binlog_format, @@session.binlog_format; -set global binlog_format=statement; -show global variables like "binlog_format%"; -show session variables like "binlog_format%"; -select @@global.binlog_format, @@session.binlog_format; - -prepare stmt1 from 'insert into t1 select ?'; -set @string="emergency_7_"; -insert into t1 values("work_8_"); -execute stmt1 using @string; -deallocate prepare stmt1; - -prepare stmt1 from 'insert into t1 select ?'; -insert into t1 values("work_9_"); -execute stmt1 using @string; -deallocate prepare stmt1; - -insert into t1 values("for_10_"); -insert into t1 select "yesterday_11_"; - -# test statement (is not default after wl#3368) -set binlog_format=statement; -select @@global.binlog_format, @@session.binlog_format; -set global binlog_format=statement; -select @@global.binlog_format, @@session.binlog_format; - -prepare stmt1 from 'insert into t1 select ?'; -set @string="emergency_12_"; -insert into t1 values("work_13_"); -execute stmt1 using @string; -deallocate prepare stmt1; - -prepare stmt1 from 'insert into t1 select ?'; -insert into t1 values("work_14_"); -execute stmt1 using @string; -deallocate prepare stmt1; - -insert into t1 values("for_15_"); -insert into t1 select "yesterday_16_"; - -# and now the mixed mode - -set global binlog_format=mixed; -select @@global.binlog_format, @@session.binlog_format; -set binlog_format=default; -select @@global.binlog_format, @@session.binlog_format; - -prepare stmt1 from 'insert into t1 select concat(UUID(),?)'; -set @string="emergency_17_"; -insert into t1 values("work_18_"); -execute stmt1 using @string; -deallocate prepare stmt1; - -prepare stmt1 from 'insert into t1 select ?'; -insert into t1 values(concat(UUID(),"work_19_")); -execute stmt1 using @string; -deallocate prepare stmt1; - -insert into t1 values(concat("for_20_",UUID())); -insert into t1 select "yesterday_21_"; - -prepare stmt1 from 'insert into t1 select ?'; -insert into t1 values(concat(UUID(),"work_22_")); -execute stmt1 using @string; -deallocate prepare stmt1; - -insert into t1 values(concat("for_23_",UUID())); -insert into t1 select "yesterday_24_"; - -# Test of CREATE TABLE SELECT - -create table t2 ENGINE=MyISAM select rpad(UUID(),100,' '); -create table t3 select 1 union select UUID(); ---disable_warnings -SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR -create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3); ---enable_warnings -SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR -create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3); -# what if UUID() is first: ---disable_warnings -insert ignore into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4); ---enable_warnings - -# inside a stored procedure - -delimiter |; -create procedure foo() -begin -insert into t1 values("work_25_"); -insert into t1 values(concat("for_26_",UUID())); -insert into t1 select "yesterday_27_"; -end| -create procedure foo2() -begin -insert into t1 values(concat("emergency_28_",UUID())); -insert into t1 values("work_29_"); -insert into t1 values(concat("for_30_",UUID())); -set session binlog_format=row; # accepted for stored procs -insert into t1 values("more work_31_"); -set session binlog_format=mixed; -end| -create function foo3() returns bigint unsigned -begin - set session binlog_format=row; # rejected for stored funcs - insert into t1 values("alarm"); - return 100; -end| -create procedure foo4(x varchar(100)) -begin -insert into t1 values(concat("work_250_",x)); -insert into t1 select "yesterday_270_"; -end| -delimiter ;| -call foo(); -call foo2(); -call foo4("hello"); -call foo4(UUID()); -call foo4("world"); - -# test that can't SET in a stored function ---error ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT -select foo3(); -select * from t1 where a="alarm"; - -# Tests of stored functions/triggers/views for BUG#20930 "Mixed -# binlogging mode does not work with stored functions, triggers, -# views" - -# Function which calls procedure -drop function foo3; -delimiter |; -create function foo3() returns bigint unsigned -begin - insert into t1 values("foo3_32_"); - call foo(); - return 100; -end| -delimiter ;| -insert into t2 select foo3(); - -prepare stmt1 from 'insert into t2 select foo3()'; -execute stmt1; -execute stmt1; -deallocate prepare stmt1; - -# Test if stored function calls stored function which calls procedure -# which requires row-based. - -delimiter |; -create function foo4() returns bigint unsigned -begin - insert into t2 select foo3(); - return 100; -end| -delimiter ;| -select foo4(); - -prepare stmt1 from 'select foo4()'; -execute stmt1; -execute stmt1; -deallocate prepare stmt1; - -# A simple stored function -delimiter |; -create function foo5() returns bigint unsigned -begin - insert into t2 select UUID(); - return 100; -end| -delimiter ;| -select foo5(); - -prepare stmt1 from 'select foo5()'; -execute stmt1; -execute stmt1; -deallocate prepare stmt1; - -# A simple stored function where UUID() is in the argument -delimiter |; -create function foo6(x varchar(100)) returns bigint unsigned -begin - insert into t2 select x; - return 100; -end| -delimiter ;| -select foo6("foo6_1_"); -select foo6(concat("foo6_2_",UUID())); - -prepare stmt1 from 'select foo6(concat("foo6_3_",UUID()))'; -execute stmt1; -execute stmt1; -deallocate prepare stmt1; - - -# Test of views using UUID() - -create view v1 as select uuid(); -create table t11 (data varchar(255)); -insert into t11 select * from v1; -# Test of querying INFORMATION_SCHEMA which parses the view's body, -# to verify that it binlogs statement-based (is not polluted by -# the parsing of the view's body). -insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11'); -prepare stmt1 from "insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')"; -execute stmt1; -execute stmt1; -deallocate prepare stmt1; - -# Test of triggers with UUID() -delimiter |; -create trigger t11_bi before insert on t11 for each row -begin - set NEW.data = concat(NEW.data,UUID()); -end| -delimiter ;| -insert into t11 values("try_560_"); - -# Test that INSERT DELAYED works in mixed mode (BUG#20649) -insert delayed into t2 values("delay_1_"); -insert delayed into t2 values(concat("delay_2_",UUID())); -insert delayed into t2 values("delay_6_"); - -# Test for BUG#20633 (INSERT DELAYED RAND()/user_variable does not -# replicate fine in statement-based ; we test that in mixed mode it -# works). -insert delayed into t2 values(rand()); -set @a=2.345; -insert delayed into t2 values(@a); - -# With INSERT DELAYED, rows are written to the binlog after they are -# written to the table. Therefore, it is not enough to wait until the -# rows make it to t2 on the master (the rows may not be in the binlog -# at that time, and may still not be in the binlog when -# sync_slave_with_master is later called). Instead, we wait until the -# rows make it to t2 on the slave. We first call -# sync_slave_with_master, so that we are sure that t2 has been created -# on the slave. -sync_slave_with_master; -let $wait_condition= SELECT COUNT(*) = 19 FROM mysqltest1.t2; ---source include/wait_condition.inc -connection master; - -# If you want to do manual testing of the mixed mode regarding UDFs (not -# testable automatically as quite platform- and compiler-dependent), -# you just need to set the variable below to 1, and to -# "make udf_example.so" in sql/, and to copy sql/udf_example.so to -# MYSQL_TEST_DIR/lib/mysql. -let $you_want_to_test_UDF=0; -if ($you_want_to_test_UDF) -{ - CREATE FUNCTION metaphon RETURNS STRING SONAME 'udf_example.so'; - prepare stmt1 from 'insert into t1 select metaphon(?)'; - set @string="emergency_133_"; - insert into t1 values("work_134_"); - execute stmt1 using @string; - deallocate prepare stmt1; - prepare stmt1 from 'insert into t1 select ?'; - insert into t1 values(metaphon("work_135_")); - execute stmt1 using @string; - deallocate prepare stmt1; - insert into t1 values(metaphon("for_136_")); - insert into t1 select "yesterday_137_"; - create table t6 select metaphon("for_138_"); - create table t7 select 1 union select metaphon("for_139_"); - create table t8 select * from t1 where 3 in (select 1 union select 2 union select metaphon("for_140_") union select 3); - create table t9 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3); -} - -create table t20 select * from t1; # save for comparing later -create table t21 select * from t2; -create table t22 select * from t3; -drop table t1,t2,t3; - -# This tests the fix to -# BUG#19630 stored function inserting into two auto_increment breaks statement-based binlog -# We verify that under the mixed binlog mode, a stored function -# modifying at least two tables having an auto_increment column, -# is binlogged row-based. Indeed in statement-based binlogging, -# only the auto_increment value generated for the first table -# is recorded in the binlog, the value generated for the 2nd table -# lacking. - -create table t1 (a int primary key auto_increment, b varchar(100)); -create table t2 (a int primary key auto_increment, b varchar(100)); -create table t3 (b varchar(100)); -delimiter |; -create function f (x varchar(100)) returns int deterministic -begin - insert into t1 values(null,x); - insert into t2 values(null,x); - return 1; -end| -delimiter ;| -select f("try_41_"); -# Two operations which compensate each other except that their net -# effect is that they advance the auto_increment counter of t2 on slave: -sync_slave_with_master; -use mysqltest1; -insert into t2 values(2,null),(3,null),(4,null); -delete from t2 where a>=2; - -connection master; -# this is the call which didn't replicate well -select f("try_42_"); -sync_slave_with_master; - -# now use prepared statement and test again, just to see that the RBB -# mode isn't set at PREPARE but at EXECUTE. - -insert into t2 values(3,null),(4,null); -delete from t2 where a>=3; - -connection master; -prepare stmt1 from 'select f(?)'; -set @string="try_43_"; -insert into t1 values(null,"try_44_"); # should be SBB -execute stmt1 using @string; # should be RBB -deallocate prepare stmt1; -sync_slave_with_master; - -# verify that if only one table has auto_inc, it does not trigger RBB -# (we'll check in binlog further below) - -connection master; -create table t12 select * from t1; # save for comparing later -drop table t1; -create table t1 (a int, b varchar(100), key(a)); -select f("try_45_"); - -# restore table's key -create table t13 select * from t1; -drop table t1; -create table t1 (a int primary key auto_increment, b varchar(100)); - -# now test if it's two functions, each of them inserts in one table - -drop function f; -# we need a unique key to have sorting of rows by mysqldump -create table t14 (unique (a)) select * from t2; -truncate table t2; -delimiter |; -create function f1 (x varchar(100)) returns int deterministic -begin - insert into t1 values(null,x); - return 1; -end| -create function f2 (x varchar(100)) returns int deterministic -begin - insert into t2 values(null,x); - return 1; -end| -delimiter ;| -select f1("try_46_"),f2("try_47_"); - -sync_slave_with_master; -insert into t2 values(2,null),(3,null),(4,null); -delete from t2 where a>=2; - -connection master; -# Test with SELECT and INSERT -select f1("try_48_"),f2("try_49_"); -insert into t3 values(concat("try_50_",f1("try_51_"),f2("try_52_"))); -sync_slave_with_master; - -# verify that if f2 does only read on an auto_inc table, this does not -# switch to RBB -connection master; -drop function f2; -delimiter |; -create function f2 (x varchar(100)) returns int deterministic -begin - declare y int; - insert into t1 values(null,x); - set y = (select count(*) from t2); - return y; -end| -delimiter ;| -select f1("try_53_"),f2("try_54_"); -sync_slave_with_master; - -# And now, a normal statement with a trigger (no stored functions) - -connection master; -drop function f2; -delimiter |; -create trigger t1_bi before insert on t1 for each row -begin - insert into t2 values(null,"try_55_"); -end| -delimiter ;| -insert into t1 values(null,"try_56_"); -# and now remove one auto_increment and verify SBB -alter table t1 modify a int, drop primary key; -insert into t1 values(null,"try_57_"); -sync_slave_with_master; - -# Test for BUG#20499 "mixed mode with temporary table breaks binlog" -# Slave used to have only 2 rows instead of 3. -connection master; -CREATE TEMPORARY TABLE t15 SELECT UUID(); -create table t16 like t15; -INSERT INTO t16 SELECT * FROM t15; -# we'll verify that this one is done RBB -insert into t16 values("try_65_"); -drop table t15; -# we'll verify that this one is done SBB -insert into t16 values("try_66_"); -sync_slave_with_master; - -# and now compare: - -connection master; - -# first check that data on master is sensible -select count(*) from t1; -select count(*) from t2; -select count(*) from t3; -select count(*) from t4; -select count(*) from t5; -select count(*) from t11; -select count(*) from t20; -select count(*) from t21; -select count(*) from t22; -select count(*) from t12; -select count(*) from t13; -select count(*) from t14; -select count(*) from t16; -if ($you_want_to_test_UDF) -{ - select count(*) from t6; - select count(*) from t7; - select count(*) from t8; - select count(*) from t9; -} - -sync_slave_with_master; - -# -# Bug#20863 If binlog format is changed between update and unlock of -# tables, wrong binlog -# - -connection master; -DROP TABLE IF EXISTS t11; -SET SESSION BINLOG_FORMAT=STATEMENT; -CREATE TABLE t11 (song VARCHAR(255)); -LOCK TABLES t11 WRITE; -SET SESSION BINLOG_FORMAT=ROW; -INSERT INTO t11 VALUES('Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict'); -SET SESSION BINLOG_FORMAT=STATEMENT; -INSERT INTO t11 VALUES('Careful With That Axe, Eugene'); -UNLOCK TABLES; - ---query_vertical SELECT * FROM t11 -sync_slave_with_master; -USE mysqltest1; ---query_vertical SELECT * FROM t11 - -connection master; -DROP TABLE IF EXISTS t12; -SET SESSION BINLOG_FORMAT=MIXED; -CREATE TABLE t12 (data LONG); -LOCK TABLES t12 WRITE; -INSERT INTO t12 VALUES(UUID()); -UNLOCK TABLES; -sync_slave_with_master; - -# -# BUG#28086: SBR of USER() becomes corrupted on slave -# - -connection master; - -# Just to get something that is non-trivial, albeit still simple, we -# stuff the result of USER() and CURRENT_USER() into a variable. ---delimiter $$ -CREATE FUNCTION my_user() - RETURNS CHAR(64) -BEGIN - DECLARE user CHAR(64); - SELECT USER() INTO user; - RETURN user; -END $$ ---delimiter ; - ---delimiter $$ -CREATE FUNCTION my_current_user() - RETURNS CHAR(64) -BEGIN - DECLARE user CHAR(64); - SELECT CURRENT_USER() INTO user; - RETURN user; -END $$ ---delimiter ; - -DROP TABLE IF EXISTS t13; -CREATE TABLE t13 (data CHAR(64)); -INSERT INTO t13 VALUES (USER()); -INSERT INTO t13 VALUES (my_user()); -INSERT INTO t13 VALUES (CURRENT_USER()); -INSERT INTO t13 VALUES (my_current_user()); - -sync_slave_with_master; - -# as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID ---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql ---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql - -# Let's compare. Note: If they match test will pass, if they do not match -# the test will show that the diff statement failed and not reject file -# will be created. You will need to go to the mysql-test dir and diff -# the files your self to see what is not matching - -diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql; - -connection master; - -# Now test that mysqlbinlog works fine on a binlog generated by the -# mixed mode - -# BUG#11312 "DELIMITER is not written to the binary log that causes -# syntax error" makes that mysqlbinlog will fail if we pass it the -# text of queries; this forces us to use --base64-output here. - -# BUG#20929 "BINLOG command causes invalid free plus assertion -# failure" makes mysqld segfault when receiving --base64-output - -# So I can't enable this piece of test -# SIGH - -if ($enable_when_11312_or_20929_fixed) -{ ---exec $MYSQL_BINLOG --base64-output $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_mixed.sql -drop database mysqltest1; ---exec $MYSQL < $MYSQLTEST_VARDIR/tmp/mysqlbinlog_mixed.sql ---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql -# the old mysqldump output on slave is the same as what it was on -# master before restoring on master. -diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql; -} - -drop database mysqltest1; -sync_slave_with_master; - -connection master; -# Restore binlog format setting -set global binlog_format =@my_binlog_format; ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_sync_test.inc b/mysql-test/suite/rpl/include/rpl_sync_test.inc deleted file mode 100644 index 1e2ec2ca83b..00000000000 --- a/mysql-test/suite/rpl/include/rpl_sync_test.inc +++ /dev/null @@ -1,159 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - -######################################################################################## -# This test verifies the options --sync-relay-log-info and --relay-log-recovery by -# crashing the slave in two different situations: -# (case-1) - Corrupt the relay log with changes which were not processed by -# the SQL Thread and crashes it. -# (case-2) - Corrupt the master.info with wrong coordinates and crashes it. -# -# Case 1: -# 1 - Stops the SQL Thread -# 2 - Inserts new records into the master. -# 3 - Corrupts the relay-log.bin* which most likely has such changes. -# 4 - Crashes the slave -# 5 - Verifies if the slave is sync with the master which means that the information -# loss was circumvented by the recovery process. -# -# Case 2: -# 1 - Stops the SQL/IO Threads -# 2 - Inserts new records into the master. -# 3 - Corrupts the master.info with wrong coordinates. -# 4 - Crashes the slave -# 5 - Verifies if the slave is sync with the master which means that the information -# loss was circumvented by the recovery process. -######################################################################################## - -######################################################################################## -# Configuring the environment -######################################################################################## ---echo =====Configuring the enviroment=======; ---source include/not_embedded.inc ---source include/not_valgrind.inc ---source include/have_debug.inc ---source include/have_innodb.inc ---source include/not_crashrep.inc ---source include/master-slave.inc - -call mtr.add_suppression('Attempting backtrace'); -call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001"); -# Use innodb so we do not get "table should be repaired" issues. -ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; -flush tables; -CREATE TABLE t1(a INT, PRIMARY KEY(a)) engine=innodb; - -insert into t1(a) values(1); -insert into t1(a) values(2); -insert into t1(a) values(3); - -######################################################################################## -# Case 1: Corrupt a relay-log.bin* -######################################################################################## ---echo =====Inserting data on the master but without the SQL Thread being running=======; -sync_slave_with_master; - -connection slave; -let $MYSQLD_SLAVE_DATADIR= `select @@datadir`; ---replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR ---copy_file $MYSQLD_SLAVE_DATADIR/master.info $MYSQLD_SLAVE_DATADIR/master.backup ---source include/stop_slave_sql.inc - -connection master; -insert into t1(a) values(4); -insert into t1(a) values(5); -insert into t1(a) values(6); - ---echo =====Removing relay log files and crashing/recoverying the slave=======; -connection slave; ---source include/stop_slave_io.inc - -let $file= query_get_value("SHOW SLAVE STATUS", Relay_Log_File, 1); - ---let FILE_TO_CORRUPT= $MYSQLD_SLAVE_DATADIR/$file -perl; -$file= $ENV{'FILE_TO_CORRUPT'}; -open(FILE, ">$file") || die "Unable to open $file."; -truncate(FILE,0); -print FILE "failure"; -close ($file); -EOF - ---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect -SET SESSION debug_dbug="d,crash_before_rotate_relaylog"; ---error 2013 -FLUSH LOGS; - ---let $rpl_server_number= 2 ---source include/rpl_reconnect.inc - ---echo =====Dumping and comparing tables=======; ---source include/start_slave.inc - -connection master; -sync_slave_with_master; - -let $diff_tables=master:t1,slave:t1; -source include/diff_tables.inc; - -######################################################################################## -# Case 2: Corrupt a master.info -######################################################################################## ---echo =====Corrupting the master.info=======; -connection slave; ---source include/stop_slave.inc - -connection master; -FLUSH LOGS; - -insert into t1(a) values(7); -insert into t1(a) values(8); -insert into t1(a) values(9); - -connection slave; -let MYSQLD_SLAVE_DATADIR=`select @@datadir`; - ---perl -use strict; -use warnings; -my $src= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.backup"; -my $dst= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.info"; -open(FILE, "<", $src) or die; -my @content= ; -close FILE; -open(FILE, ">", $dst) or die; -binmode FILE; -print FILE @content; -close FILE; -EOF - ---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect -SET SESSION debug_dbug="d,crash_before_rotate_relaylog"; ---error 2013 -FLUSH LOGS; - ---let $rpl_server_number= 2 ---source include/rpl_reconnect.inc - ---echo =====Dumping and comparing tables=======; ---source include/start_slave.inc - -connection master; -sync_slave_with_master; - -let $diff_tables=master:t1,slave:t1; -source include/diff_tables.inc; - -######################################################################################## -# Clean up -######################################################################################## ---echo =====Clean up=======; -connection master; -drop table t1; - ---remove_file $MYSQLD_SLAVE_DATADIR/master.backup ---source include/rpl_end.inc - diff --git a/mysql-test/suite/rpl/include/rpl_temporal_format_default_to_default.inc b/mysql-test/suite/rpl/include/rpl_temporal_format_default_to_default.inc deleted file mode 100644 index 6728ff55d6f..00000000000 --- a/mysql-test/suite/rpl/include/rpl_temporal_format_default_to_default.inc +++ /dev/null @@ -1,82 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption). -# Please check all dependent tests after modifying it -# - ---source include/master-slave.inc - -if ($force_master_mysql56_temporal_format) -{ - connection master; - eval SET @@global.mysql56_temporal_format=$force_master_mysql56_temporal_format; -} - -if ($force_slave_mysql56_temporal_format) -{ - connection slave; - eval SET @@global.mysql56_temporal_format=$force_slave_mysql56_temporal_format; -} - -connection master; -SELECT @@global.mysql56_temporal_format AS on_master; -connection slave; -SELECT @@global.mysql56_temporal_format AS on_slave; -connection master; - -CREATE TABLE t1 -( - c0 TIME(0), - c1 TIME(1), - c2 TIME(2), - c3 TIME(3), - c4 TIME(4), - c5 TIME(5), - c6 TIME(6) -); -CREATE TABLE t2 -( - c0 TIMESTAMP(0), - c1 TIMESTAMP(1), - c2 TIMESTAMP(2), - c3 TIMESTAMP(3), - c4 TIMESTAMP(4), - c5 TIMESTAMP(5), - c6 TIMESTAMP(6) -); - -CREATE TABLE t3 -( - c0 DATETIME(0), - c1 DATETIME(1), - c2 DATETIME(2), - c3 DATETIME(3), - c4 DATETIME(4), - c5 DATETIME(5), - c6 DATETIME(6) -); -INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111'); -INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111'); -INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111'); -SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES -WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME; -sync_slave_with_master; - -connection slave; ---query_vertical SELECT * FROM t1; ---query_vertical SELECT * FROM t2; ---query_vertical SELECT * FROM t3; -SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES -WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME; - -connection master; -DROP TABLE t1; -DROP TABLE t2; -DROP TABLE t3; - -connection slave; -SET @@global.mysql56_temporal_format=DEFAULT; -connection master; -SET @@global.mysql56_temporal_format=DEFAULT; - ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_typeconv.inc b/mysql-test/suite/rpl/include/rpl_typeconv.inc deleted file mode 100644 index 9e566258882..00000000000 --- a/mysql-test/suite/rpl/include/rpl_typeconv.inc +++ /dev/null @@ -1,78 +0,0 @@ -# -# This include file is used by more than one test suite -# (currently rpl and binlog_encryption suite). -# Please check all dependent tests after modifying it -# - ---source include/have_binlog_format_row.inc ---source include/master-slave.inc - -connection slave; -set @saved_slave_type_conversions = @@global.slave_type_conversions; -CREATE TABLE type_conversions ( - TestNo INT AUTO_INCREMENT PRIMARY KEY, - Source TEXT, - Target TEXT, - Flags TEXT, - On_Master LONGTEXT, - On_Slave LONGTEXT, - Expected LONGTEXT, - Compare INT, - Error TEXT); - -SELECT @@global.slave_type_conversions; -SET GLOBAL SLAVE_TYPE_CONVERSIONS=''; -SELECT @@global.slave_type_conversions; -SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY'; -SELECT @@global.slave_type_conversions; -SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY'; -SELECT @@global.slave_type_conversions; -SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY'; -SELECT @@global.slave_type_conversions; ---error ER_WRONG_VALUE_FOR_VAR -SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY,NONEXISTING_BIT'; -SELECT @@global.slave_type_conversions; - -# Checking strict interpretation of type conversions -connection slave; -SET GLOBAL SLAVE_TYPE_CONVERSIONS=''; -source suite/rpl/include/type_conversions.test; - -# Checking lossy integer type conversions -connection slave; -SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY'; -source suite/rpl/include/type_conversions.test; - -# Checking non-lossy integer type conversions -connection slave; -SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY'; -source suite/rpl/include/type_conversions.test; - -# Checking all type conversions -connection slave; -SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY'; -source suite/rpl/include/type_conversions.test; - -connection slave; ---echo **** Result of conversions **** -disable_query_log; -SELECT RPAD(Source, 15, ' ') AS Source_Type, - RPAD(Target, 15, ' ') AS Target_Type, - RPAD(Flags, 25, ' ') AS All_Type_Conversion_Flags, - IF(Compare IS NULL AND Error IS NOT NULL, '', - IF(Compare, '', - CONCAT("'", On_Slave, "' != '", Expected, "'"))) - AS Value_On_Slave - FROM type_conversions; -enable_query_log; -DROP TABLE type_conversions; - -call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677"); - -connection master; -DROP TABLE t1; -sync_slave_with_master; - -set global slave_type_conversions = @saved_slave_type_conversions; - ---source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_binlog_errors.test b/mysql-test/suite/rpl/t/rpl_binlog_errors.test index 30faaf79613..bf92736a2af 100644 --- a/mysql-test/suite/rpl/t/rpl_binlog_errors.test +++ b/mysql-test/suite/rpl/t/rpl_binlog_errors.test @@ -1 +1,438 @@ ---source include/rpl_binlog_errors.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# +# Usage: +# --let $binlog_limit= X[,Y] # optional +# +# Semantics of the value is the same as in include/show_binlog_events.inc +# which the script calls as a part of the test flow. +# The goal is to print the event demonstrating the triggered error, +# so normally Y should be 1 (print the exact event only); +# however, depending on test-specific server options, the offset X +# can be different. +# + +# BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error +# when generating new name. +# +# WHY +# === +# +# We want to check whether error is reported or not when +# new_file_impl fails (this may happen when rotation is not +# possible because there is some problem finding an +# unique filename). +# +# HOW +# === +# +# Test cases are documented inline. + +-- source include/have_innodb.inc +-- source include/have_debug.inc +-- source include/master-slave.inc + +-- echo ####################################################################### +-- echo ####################### PART 1: MASTER TESTS ########################## +-- echo ####################################################################### + + +### ACTION: stopping slave as it is not needed for the first part of +### the test + +-- connection slave +-- source include/stop_slave.inc +-- connection master + +call mtr.add_suppression("Can't generate a unique log-filename"); +call mtr.add_suppression("Writing one row to the row-based binary log failed.*"); +call mtr.add_suppression("Error writing file .*"); +call mtr.add_suppression("Could not use master-bin for logging"); + +SET @old_debug= @@global.debug_dbug; + +### ACTION: create a large file (> 4096 bytes) that will be later used +### in LOAD DATA INFILE to check binlog errors in its vacinity +-- let $load_file= $MYSQLTEST_VARDIR/tmp/bug_46166.data +-- let $MYSQLD_DATADIR= `select @@datadir` +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- eval SELECT repeat('x',8192) INTO OUTFILE '$load_file' + +### ACTION: create a small file (< 4096 bytes) that will be later used +### in LOAD DATA INFILE to check for absence of binlog errors +### when file loading this file does not force flushing and +### rotating the binary log +-- let $load_file2= $MYSQLTEST_VARDIR/tmp/bug_46166-2.data +-- let $MYSQLD_DATADIR= `select @@datadir` +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- eval SELECT repeat('x',10) INTO OUTFILE '$load_file2' + +RESET MASTER; + +-- echo ###################### TEST #1 + +### ASSERTION: no problem flushing logs (should show two binlogs) +FLUSH LOGS; +-- echo # assert: must show two binlogs +-- source include/show_binary_logs.inc + +-- echo ###################### TEST #2 + +### ASSERTION: check that FLUSH LOGS actually fails and reports +### failure back to the user if find_uniq_filename fails +### (should show just one binlog) + +RESET MASTER; +SET @@global.debug_dbug="d,error_unique_log_filename"; +-- error ER_NO_UNIQUE_LOGFILE +FLUSH LOGS; +-- echo # assert: must show one binlog +-- source include/show_binary_logs.inc + +### ACTION: clean up and move to next test +SET @@global.debug_dbug=@old_debug; +RESET MASTER; + +-- echo ###################### TEST #3 + +### ACTION: create some tables (t1, t2, t4) and insert some values in +### table t1 +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a VARCHAR(16384)) Engine=InnoDB; +CREATE TABLE t4 (a VARCHAR(16384)); +INSERT INTO t1 VALUES (1); +RESET MASTER; + +### ASSERTION: we force rotation of the binary log because it exceeds +### the max_binlog_size option (should show two binary +### logs) + +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 + +# shows two binary logs +-- echo # assert: must show two binlog +-- source include/show_binary_logs.inc + +# clean up the table and the binlog to be used in next part of test +SET @@global.debug_dbug=@old_debug; +DELETE FROM t2; +RESET MASTER; + +-- echo ###################### TEST #4 + +### ASSERTION: load the big file into a transactional table and check +### that it reports error. The table will contain the +### changes performed despite the fact that it reported an +### error. + +SET @@global.debug_dbug="d,error_unique_log_filename"; +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- error ER_NO_UNIQUE_LOGFILE +-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 + +# show table +-- echo # assert: must show one entry +SELECT count(*) FROM t2; + +# clean up the table and the binlog to be used in next part of test +SET @@global.debug_dbug=@old_debug; +DELETE FROM t2; +RESET MASTER; + +-- echo ###################### TEST #5 + +### ASSERTION: load the small file into a transactional table and +### check that it succeeds + +SET @@global.debug_dbug="d,error_unique_log_filename"; +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- eval LOAD DATA INFILE '$load_file2' INTO TABLE t2 + +# show table +-- echo # assert: must show one entry +SELECT count(*) FROM t2; + +# clean up the table and the binlog to be used in next part of test +SET @@global.debug_dbug=@old_debug; +DELETE FROM t2; +RESET MASTER; + +-- echo ###################### TEST #6 + +### ASSERTION: check that even if one is using a transactional table +### and explicit transactions (no autocommit) if rotation +### fails we get the error. Transaction is not rolledback +### because rotation happens after the commit. + +SET @@global.debug_dbug="d,error_unique_log_filename"; +SET AUTOCOMMIT=0; +INSERT INTO t2 VALUES ('muse'); +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 +INSERT INTO t2 VALUES ('muse'); +-- error ER_NO_UNIQUE_LOGFILE +COMMIT; + +### ACTION: Show the contents of the table after the test +-- echo # assert: must show three entries +SELECT count(*) FROM t2; + +### ACTION: clean up and move to the next test +SET AUTOCOMMIT= 1; +SET @@global.debug_dbug=@old_debug; +DELETE FROM t2; +RESET MASTER; + +-- echo ###################### TEST #7 + +### ASSERTION: check that on a non-transactional table, if rotation +### fails then an error is reported and an incident event +### is written to the current binary log. + +SET @@global.debug_dbug="d,error_unique_log_filename"; + +# Disable logging Annotate_rows events to preserve events count. +let $binlog_annotate_row_events_saved= `SELECT @@binlog_annotate_row_events`; +SET @@binlog_annotate_row_events= 0; + +SELECT count(*) FROM t4; +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- error ER_NO_UNIQUE_LOGFILE +-- eval LOAD DATA INFILE '$load_file' INTO TABLE t4 + +-- echo # assert: must show 1 entry +SELECT count(*) FROM t4; + +-- echo ### check that the incident event is written to the current log +SET @@global.debug_dbug=@old_debug; +if (!$binlog_limit) +{ + -- let $binlog_limit= 4,1 +} +-- source include/show_binlog_events.inc + +# clean up and move to next test +DELETE FROM t4; + +--disable_query_log +eval SET @@binlog_annotate_row_events= $binlog_annotate_row_events_saved; +--enable_query_log + +RESET MASTER; + +-- echo ###################### TEST #8 + +### ASSERTION: check that statements end up in error but they succeed +### on changing the data. + +SET @@global.debug_dbug="d,error_unique_log_filename"; +-- echo # must show 0 entries +SELECT count(*) FROM t4; +SELECT count(*) FROM t2; + +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- error ER_NO_UNIQUE_LOGFILE +-- eval LOAD DATA INFILE '$load_file' INTO TABLE t4 +-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +-- error ER_NO_UNIQUE_LOGFILE +-- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 +-- error ER_NO_UNIQUE_LOGFILE +INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'); + +-- echo # INFO: Count(*) Before Offending DELETEs +-- echo # assert: must show 1 entry +SELECT count(*) FROM t4; +-- echo # assert: must show 4 entries +SELECT count(*) FROM t2; + +-- error ER_NO_UNIQUE_LOGFILE +DELETE FROM t4; +-- error ER_NO_UNIQUE_LOGFILE +DELETE FROM t2; + +-- echo # INFO: Count(*) After Offending DELETEs +-- echo # assert: must show zero entries +SELECT count(*) FROM t4; +SELECT count(*) FROM t2; + +# remove fault injection +SET @@global.debug_dbug=@old_debug; + +-- echo ###################### TEST #9 + +### ASSERTION: check that if we disable binlogging, then statements +### succeed. +SET @@global.debug_dbug="d,error_unique_log_filename"; +SET SQL_LOG_BIN=0; +INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd'); +INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh'); +-- echo # assert: must show four entries +SELECT count(*) FROM t2; +SELECT count(*) FROM t4; +DELETE FROM t2; +DELETE FROM t4; +-- echo # assert: must show zero entries +SELECT count(*) FROM t2; +SELECT count(*) FROM t4; +SET SQL_LOG_BIN=1; +SET @@global.debug_dbug=@old_debug; + +-- echo ###################### TEST #10 + +### ASSERTION: check that error is reported if there is a failure +### while registering the index file and the binary log +### file or failure to write the rotate event. + +call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file."); +call mtr.add_suppression("Could not use .*"); + +RESET MASTER; +SHOW WARNINGS; + +# +d,fault_injection_registering_index => injects fault on MYSQL_BIN_LOG::open +SET @@global.debug_dbug="d,fault_injection_registering_index"; +-- replace_regex /\.[\\\/]master/master/ +-- error ER_CANT_OPEN_FILE +FLUSH LOGS; +SET @@global.debug_dbug=@old_debug; + +-- error ER_NO_BINARY_LOGGING +SHOW BINARY LOGS; + +# issue some statements and check that they don't fail +CREATE TABLE t5 (a INT); +INSERT INTO t4 VALUES ('bbbbb'); +INSERT INTO t2 VALUES ('aaaaa'); +DELETE FROM t4; +DELETE FROM t2; +DROP TABLE t5; +flush tables; + +-- echo ###################### TEST #11 + +### ASSERTION: check that error is reported if there is a failure +### while opening the index file and the binary log file or +### failure to write the rotate event. + +# restart the server so that we have binlog again +--let $rpl_server_number= 1 +--source include/rpl_restart_server.inc + +# +d,fault_injection_openning_index => injects fault on MYSQL_BIN_LOG::open_index_file +SET @@global.debug_dbug="d,fault_injection_openning_index"; +-- replace_regex /\.[\\\/]master/master/ +-- error ER_CANT_OPEN_FILE +FLUSH LOGS; +SET @@global.debug_dbug=@old_debug; + +-- error ER_FLUSH_MASTER_BINLOG_CLOSED +RESET MASTER; + +# issue some statements and check that they don't fail +CREATE TABLE t5 (a INT); +INSERT INTO t4 VALUES ('bbbbb'); +INSERT INTO t2 VALUES ('aaaaa'); +DELETE FROM t4; +DELETE FROM t2; +DROP TABLE t5; +flush tables; + +# restart the server so that we have binlog again +--let $rpl_server_number= 1 +--source include/rpl_restart_server.inc + +-- echo ###################### TEST #12 + +### ASSERTION: check that error is reported if there is a failure +### while writing the rotate event when creating a new log +### file. + +# +d,fault_injection_new_file_rotate_event => injects fault on MYSQL_BIN_LOG::MYSQL_BIN_LOG::new_file_impl +SET @@global.debug_dbug="d,fault_injection_new_file_rotate_event"; +-- error ER_ERROR_ON_WRITE +FLUSH LOGS; +SET @@global.debug_dbug=@old_debug; + +-- error ER_FLUSH_MASTER_BINLOG_CLOSED +RESET MASTER; + +# issue some statements and check that they don't fail +CREATE TABLE t5 (a INT); +INSERT INTO t4 VALUES ('bbbbb'); +INSERT INTO t2 VALUES ('aaaaa'); +DELETE FROM t4; +DELETE FROM t2; +DROP TABLE t5; +flush tables; + +# restart the server so that we have binlog again +--let $rpl_server_number= 1 +--source include/rpl_restart_server.inc + +## clean up +DROP TABLE t1, t2, t4; +RESET MASTER; + +# restart slave again +-- connection slave +-- source include/start_slave.inc +-- connection master + +-- echo ####################################################################### +-- echo ####################### PART 2: SLAVE TESTS ########################### +-- echo ####################################################################### + +### setup +--source include/rpl_reset.inc +-- connection slave + +# slave suppressions + +call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*"); +call mtr.add_suppression("Error writing file .*"); +call mtr.add_suppression("Could not use .*"); +call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file."); +call mtr.add_suppression("Can't generate a unique log-filename .*"); +-- echo ###################### TEST #13 + +#### ASSERTION: check against unique log filename error +-- let $io_thd_injection_fault_flag= error_unique_log_filename +-- let $slave_io_errno= 1595 +-- let $show_slave_io_error= 1 +-- source include/io_thd_fault_injection.inc + +-- echo ###################### TEST #14 + +#### ASSERTION: check against rotate failing +-- let $io_thd_injection_fault_flag= fault_injection_new_file_rotate_event +-- let $slave_io_errno= 1595 +-- let $show_slave_io_error= 1 +-- source include/io_thd_fault_injection.inc + +-- echo ###################### TEST #15 + +#### ASSERTION: check against relay log open failure +-- let $io_thd_injection_fault_flag= fault_injection_registering_index +-- let $slave_io_errno= 1595 +-- let $show_slave_io_error= 1 +-- source include/io_thd_fault_injection.inc + +-- echo ###################### TEST #16 + +#### ASSERTION: check against relay log index open failure +-- let $io_thd_injection_fault_flag= fault_injection_openning_index +-- let $slave_io_errno= 1595 +-- let $show_slave_io_error= 1 +-- source include/io_thd_fault_injection.inc + +### clean up +-- source include/stop_slave_sql.inc +RESET SLAVE; +RESET MASTER; +--remove_file $load_file +--remove_file $load_file2 +--let $rpl_only_running_threads= 1 +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test index 573c1d111fc..7dfef023947 100644 --- a/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test +++ b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test @@ -1 +1,83 @@ ---source include/rpl_cant_read_event_incident.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +# +# Bug#11747416 : 32228 A disk full makes binary log corrupt. +# +# +# The test demonstrates reading from binlog error propagation to slave +# and reporting there. +# Conditions for the bug include a crash at time of the last event to +# the binlog was written partly. With the fixes the event is not sent out +# any longer, but rather the dump thread sends out a sound error message. +# +# Crash is not simulated. A binlog with partly written event in its end is installed +# and replication is started from it. +# + +--source include/have_binlog_format_mixed.inc +--source include/master-slave.inc + +--connection slave +# Make sure the slave is stopped while we are messing with master. +# Otherwise we get occasional failures as the slave manages to re-connect +# to the newly started master and we get extra events applied, causing +# conflicts. +--source include/stop_slave.inc + +--connection master +call mtr.add_suppression("Error in Log_event::read_log_event()"); +--let $datadir= `SELECT @@datadir` + +--let $rpl_server_number= 1 +--source include/rpl_stop_server.inc + +--remove_file $datadir/master-bin.000001 +--copy_file $MYSQL_TEST_DIR/std_data/bug11747416_32228_binlog.000001 $datadir/master-bin.000001 + +--let $rpl_server_number= 1 +--source include/rpl_start_server.inc + +--source include/wait_until_connected_again.inc + +# evidence of the partial binlog +--error ER_ERROR_WHEN_EXECUTING_COMMAND +show binlog events; + +--connection slave +call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log"); +reset slave; +start slave; + +# ER_MASTER_FATAL_ERROR_READING_BINLOG 1236 +--let $slave_param=Last_IO_Errno +--let $slave_param_value=1236 +--source include/wait_for_slave_param.inc + +--let $slave_field_result_replace= / at [0-9]*/ at XXX/ +--let $status_items= Last_IO_Errno, Last_IO_Error +--source include/show_slave_status.inc + +# +# Cleanup +# + +--connection master +reset master; + +--connection slave +stop slave; +reset slave; +# Table was created from binlog, it may not be created if SQL thread is running +# slowly and IO thread reaches incident before SQL thread applies it. +--disable_warnings +drop table if exists t; +--enable_warnings +reset master; + +--echo End of the tests +--let $rpl_only_running_threads= 1 +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_checksum.test b/mysql-test/suite/rpl/t/rpl_checksum.test index 0edf8fda7f3..17a986dc308 100644 --- a/mysql-test/suite/rpl/t/rpl_checksum.test +++ b/mysql-test/suite/rpl/t/rpl_checksum.test @@ -1 +1,335 @@ ---source include/rpl_checksum.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +# WL2540 replication events checksum +# Testing configuration parameters + +--source include/have_debug.inc +--source include/have_binlog_format_mixed.inc +--source include/master-slave.inc + +call mtr.add_suppression('Slave can not handle replication events with the checksum that master is configured to log'); +call mtr.add_suppression('Replication event checksum verification failed'); +# due to C failure simulation +call mtr.add_suppression('Relay log write failure: could not queue event from master'); +call mtr.add_suppression('Master is configured to log replication events with checksum, but will not send such events to slaves that cannot process them'); + +# A. read/write access to the global vars: +# binlog_checksum master_verify_checksum slave_sql_verify_checksum + +connection master; + +set @master_save_binlog_checksum= @@global.binlog_checksum; +set @save_master_verify_checksum = @@global.master_verify_checksum; + +select @@global.binlog_checksum as 'must be CRC32 because of the command line option'; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.binlog_checksum as 'no session var'; + +select @@global.master_verify_checksum as 'must be zero because of default'; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.master_verify_checksum as 'no session var'; + +connection slave; + +set @slave_save_binlog_checksum= @@global.binlog_checksum; +set @save_slave_sql_verify_checksum = @@global.slave_sql_verify_checksum; + +select @@global.slave_sql_verify_checksum as 'must be one because of default'; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.slave_sql_verify_checksum as 'no session var'; + +connection master; + +source include/show_binary_logs.inc; +set @@global.binlog_checksum = NONE; +select @@global.binlog_checksum; +--echo *** must be rotations seen *** +source include/show_binary_logs.inc; + +set @@global.binlog_checksum = default; +select @@global.binlog_checksum; + +# testing lack of side-effects in non-effective update of binlog_checksum: +set @@global.binlog_checksum = CRC32; +select @@global.binlog_checksum; +set @@global.binlog_checksum = CRC32; + +set @@global.master_verify_checksum = 0; +set @@global.master_verify_checksum = default; + +--error ER_WRONG_VALUE_FOR_VAR +set @@global.binlog_checksum = ADLER32; +--error ER_WRONG_VALUE_FOR_VAR +set @@global.master_verify_checksum = 2; # the var is of bool type + +connection slave; + +set @@global.slave_sql_verify_checksum = 0; +set @@global.slave_sql_verify_checksum = default; +--error ER_WRONG_VALUE_FOR_VAR +set @@global.slave_sql_verify_checksum = 2; # the var is of bool type + +# +# B. Old Slave to New master conditions +# +# while master does not send a checksum-ed binlog the Old Slave can +# work with the New Master + +connection master; + +set @@global.binlog_checksum = NONE; +create table t1 (a int); + +# testing that binlog rotation preserves opt_binlog_checksum value +flush logs; +flush logs; +-- source include/wait_for_binlog_checkpoint.inc +flush logs; + +sync_slave_with_master; +#connection slave; +# checking that rotation on the slave side leaves slave stable +flush logs; +flush logs; +flush logs; +select count(*) as zero from t1; + +source include/stop_slave.inc; + +connection master; +set @@global.binlog_checksum = CRC32; +-- source include/wait_for_binlog_checkpoint.inc +insert into t1 values (1) /* will not be applied on slave due to simulation */; + +# instruction to the dump thread + +connection slave; +set @saved_dbug = @@global.debug_dbug; +set @@global.debug_dbug='d,simulate_slave_unaware_checksum'; +start slave; +--let $slave_io_errno= 1236 +--let $show_slave_io_error= 1 +source include/wait_for_slave_io_error.inc; + +select count(*) as zero from t1; + +set @@global.debug_dbug = @saved_dbug; + +connection slave; +source include/start_slave.inc; + +# +# C. checksum failure simulations +# + +# C1. Failure by a client thread +connection master; +set @@global.master_verify_checksum = 1; +set @save_dbug = @@session.debug_dbug; +set @@session.debug_dbug='d,simulate_checksum_test_failure'; +--error ER_ERROR_WHEN_EXECUTING_COMMAND +show binlog events; +SET debug_dbug= @save_dbug; +set @@global.master_verify_checksum = default; + +#connection master; +sync_slave_with_master; + +connection slave; +source include/stop_slave.inc; + +connection master; +create table t2 (a int); +let $pos_master= query_get_value(SHOW MASTER STATUS, Position, 1); + +connection slave; + +# C2. Failure by IO thread +# instruction to io thread +set @saved_dbug = @@global.debug_dbug; +set @@global.debug_dbug='d,simulate_checksum_test_failure'; +start slave io_thread; +# When the checksum error is detected, the slave sets error code 1913 +# (ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE) in queue_event(), then immediately +# sets error 1595 (ER_SLAVE_RELAY_LOG_WRITE_FAILURE) in handle_slave_io(). +# So we usually get 1595, but it is occasionally possible to get 1913. +--let $slave_io_errno= 1595,1913 +--let $show_slave_io_error= 0 +source include/wait_for_slave_io_error.inc; +set @@global.debug_dbug = @saved_dbug; + +# to make IO thread re-read it again w/o the failure +start slave io_thread; +let $slave_param= Read_Master_Log_Pos; +let $slave_param_value= $pos_master; +source include/wait_for_slave_param.inc; + +# C3. Failure by SQL thread +# instruction to sql thread; +set @@global.slave_sql_verify_checksum = 1; + +set @@global.debug_dbug='d,simulate_checksum_test_failure'; + +start slave sql_thread; +--let $slave_sql_errno= 1593 +--let $show_slave_sql_error= 1 +source include/wait_for_slave_sql_error.inc; + +# resuming SQL thread to parse out the event w/o the failure + +set @@global.debug_dbug = @saved_dbug; +source include/start_slave.inc; + +connection master; +sync_slave_with_master; + +#connection slave; +select count(*) as 'must be zero' from t2; + +# +# D. Reset slave, Change-Master, Binlog & Relay-log rotations with +# random value on binlog_checksum on both master and slave +# +connection slave; +stop slave; +reset slave; + +# randomize slave server's own checksum policy +set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE"); +flush logs; + +connection master; +set @@global.binlog_checksum= CRC32; +reset master; +flush logs; +create table t3 (a int, b char(5)); + +connection slave; +source include/start_slave.inc; + +connection master; +sync_slave_with_master; + +#connection slave; +select count(*) as 'must be zero' from t3; +source include/stop_slave.inc; +--replace_result $MASTER_MYPORT MASTER_PORT +eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root'; + +connection master; +flush logs; +reset master; +insert into t3 value (1, @@global.binlog_checksum); + +connection slave; +source include/start_slave.inc; +flush logs; + +connection master; +sync_slave_with_master; + +#connection slave; +select count(*) as 'must be one' from t3; + +connection master; +set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE"); +insert into t3 value (1, @@global.binlog_checksum); +sync_slave_with_master; + +#connection slave; + +#clean-up + +connection master; +drop table t1, t2, t3; +set @@global.binlog_checksum = @master_save_binlog_checksum; +set @@global.master_verify_checksum = @save_master_verify_checksum; + +# +# BUG#58564: flush_read_lock fails in mysql-trunk-bugfixing after merging with WL#2540 +# +# Sanity check that verifies that no assertions are triggered because +# of old FD events (generated by versions prior to server released with +# checksums feature) +# +# There is no need for query log, if something wrong this should trigger +# an assertion + +--disable_query_log + +BINLOG ' +MfmqTA8BAAAAZwAAAGsAAAABAAQANS41LjctbTMtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAx+apMEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA== +'; + +--enable_query_log + +#connection slave; +sync_slave_with_master; + + +--echo *** Bug#59123 / MDEV-5799: INCIDENT_EVENT checksum written to error log as garbage characters *** + +--connection master + +--source include/wait_for_binlog_checkpoint.inc +CREATE TABLE t4 (a INT PRIMARY KEY); +INSERT INTO t4 VALUES (1); + +SET sql_log_bin=0; +CALL mtr.add_suppression("\\[ERROR\\] Can't generate a unique log-filename"); +SET sql_log_bin=1; +SET @old_dbug= @@GLOBAL.debug_dbug; +SET debug_dbug= '+d,binlog_inject_new_name_error'; +--error ER_NO_UNIQUE_LOGFILE +FLUSH LOGS; +SET debug_dbug= @old_dbug; + +INSERT INTO t4 VALUES (2); + +--connection slave +--let $slave_sql_errno= 1590 +--source include/wait_for_slave_sql_error.inc + +# Search the error log for the error message. +# The bug was that 4 garbage bytes were output in the middle of the error +# message; by searching for a pattern that spans that location, we can +# catch the error. +let $log_error_= `SELECT @@GLOBAL.log_error`; +if(!$log_error_) +{ + # MySQL Server on windows is started with --console and thus + # does not know the location of its .err log, use default location + let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err; +} +--let SEARCH_FILE= $log_error_ +--let SEARCH_PATTERN= Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590 +--source include/search_pattern_in_file.inc + +SELECT * FROM t4 ORDER BY a; +STOP SLAVE IO_THREAD; +SET sql_slave_skip_counter= 1; +--source include/start_slave.inc + +--connection master +--save_master_pos + +--connection slave +--sync_with_master +SELECT * FROM t4 ORDER BY a; + + +--connection slave +set @@global.binlog_checksum = @slave_save_binlog_checksum; +set @@global.slave_sql_verify_checksum = @save_slave_sql_verify_checksum; + +--echo End of tests + +--connection master +DROP TABLE t4; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_checksum_cache.test b/mysql-test/suite/rpl/t/rpl_checksum_cache.test index 59b338d2556..e04f618b81e 100644 --- a/mysql-test/suite/rpl/t/rpl_checksum_cache.test +++ b/mysql-test/suite/rpl/t/rpl_checksum_cache.test @@ -1 +1,261 @@ ---source include/rpl_checksum_cache.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +-- source include/have_innodb.inc +-- source include/master-slave.inc + +--disable_warnings +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. .*Statement: insert into t2 set data=repeat.*'a', @act_size.*"); +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. .*Statement: insert into t1 values.* NAME_CONST.*'n',.*, @data .*"); +--enable_warnings + +connection master; +set @save_binlog_cache_size = @@global.binlog_cache_size; +set @save_binlog_checksum = @@global.binlog_checksum; +set @save_master_verify_checksum = @@global.master_verify_checksum; +set @@global.binlog_cache_size = 4096; +set @@global.binlog_checksum = CRC32; +set @@global.master_verify_checksum = 1; + +# restart slave to force the dump thread to verify events (on master side) +connection slave; +source include/stop_slave.inc; +source include/start_slave.inc; + +connection master; + +# +# Testing a critical part of checksum handling dealing with transaction cache. +# The cache's buffer size is set to be less than the transaction's footprint +# in binlog. +# +# To verify combined buffer-by-buffer read out of the file and fixing crc per event +# there are the following parts: +# +# 1. the event size is much less than the cache's buffer +# 2. the event size is bigger than the cache's buffer +# 3. the event size if approximately the same as the cache's buffer +# 4. all in above + +# +# 1. the event size is much less than the cache's buffer +# + +flush status; +show status like "binlog_cache_use"; +show status like "binlog_cache_disk_use"; +--disable_warnings +drop table if exists t1; +--enable_warnings + +# +# parameter to ensure the test slightly varies binlog content +# between different invocations +# +let $deviation_size=32; +eval create table t1 (a int PRIMARY KEY, b CHAR($deviation_size)) engine=innodb; + +# Now we are going to create transaction which is long enough so its +# transaction binlog will be flushed to disk... + +delimiter |; +create procedure test.p_init (n int, size int) +begin + while n > 0 do + select round(RAND() * size) into @act_size; + set @data = repeat('a', @act_size); + insert into t1 values(n, @data ); + set n= n-1; + end while; +end| + +delimiter ;| + +let $1 = 4000; # PB2 can run it slow to time out on following sync_slave_with_master:s + +begin; +--disable_warnings +# todo: check if it is really so. +#+Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +eval call test.p_init($1, $deviation_size); +--enable_warnings +commit; + +show status like "binlog_cache_use"; +--echo *** binlog_cache_disk_use must be non-zero *** +show status like "binlog_cache_disk_use"; + +sync_slave_with_master; + +let $diff_tables=master:test.t1, slave:test.t1; +source include/diff_tables.inc; + +# undoing changes with verifying the above once again +connection master; + +begin; +delete from t1; +commit; + +sync_slave_with_master; + + +# +# 2. the event size is bigger than the cache's buffer +# +connection master; + +flush status; +let $t2_data_size= `select 3 * @@global.binlog_cache_size`; +let $t2_aver_size= `select 2 * @@global.binlog_cache_size`; +let $t2_max_rand= `select 1 * @@global.binlog_cache_size`; + +eval create table t2(a int auto_increment primary key, data VARCHAR($t2_data_size)) ENGINE=Innodb; +let $1=100; +--disable_query_log +begin; +while ($1) +{ + eval select round($t2_aver_size + RAND() * $t2_max_rand) into @act_size; + set @data = repeat('a', @act_size); + insert into t2 set data = @data; + dec $1; +} +commit; +--enable_query_log +show status like "binlog_cache_use"; +--echo *** binlog_cache_disk_use must be non-zero *** +show status like "binlog_cache_disk_use"; + +sync_slave_with_master; + +let $diff_tables=master:test.t2, slave:test.t2; +source include/diff_tables.inc; + +# undoing changes with verifying the above once again +connection master; + +begin; +delete from t2; +commit; + +sync_slave_with_master; + +# +# 3. the event size if approximately the same as the cache's buffer +# + +connection master; + +flush status; +let $t3_data_size= `select 2 * @@global.binlog_cache_size`; +let $t3_aver_size= `select (9 * @@global.binlog_cache_size) / 10`; +let $t3_max_rand= `select (2 * @@global.binlog_cache_size) / 10`; + +eval create table t3(a int auto_increment primary key, data VARCHAR($t3_data_size)) engine=innodb; + +let $1= 300; +--disable_query_log +begin; +while ($1) +{ + eval select round($t3_aver_size + RAND() * $t3_max_rand) into @act_size; + insert into t3 set data= repeat('a', @act_size); + dec $1; +} +commit; +--enable_query_log +show status like "binlog_cache_use"; +--echo *** binlog_cache_disk_use must be non-zero *** +show status like "binlog_cache_disk_use"; + +sync_slave_with_master; + +let $diff_tables=master:test.t3, slave:test.t3; +source include/diff_tables.inc; + +# undoing changes with verifying the above once again +connection master; + +begin; +delete from t3; +commit; + +sync_slave_with_master; + + +# +# 4. all in above +# + +connection master; +flush status; + +delimiter |; +eval create procedure test.p1 (n int) +begin + while n > 0 do + case (select (round(rand()*100) % 3) + 1) + when 1 then + select round(RAND() * $deviation_size) into @act_size; + set @data = repeat('a', @act_size); + insert into t1 values(n, @data); + when 2 then + begin + select round($t2_aver_size + RAND() * $t2_max_rand) into @act_size; + insert into t2 set data=repeat('a', @act_size); + end; + when 3 then + begin + select round($t3_aver_size + RAND() * $t3_max_rand) into @act_size; + insert into t3 set data= repeat('a', @act_size); + end; + end case; + set n= n-1; + end while; +end| +delimiter ;| + +let $1= 1000; +set autocommit= 0; +begin; +--disable_warnings +eval call test.p1($1); +--enable_warnings +commit; + +show status like "binlog_cache_use"; +--echo *** binlog_cache_disk_use must be non-zero *** +show status like "binlog_cache_disk_use"; + +sync_slave_with_master; + +let $diff_tables=master:test.t1, slave:test.t1; +source include/diff_tables.inc; + +let $diff_tables=master:test.t2, slave:test.t2; +source include/diff_tables.inc; + +let $diff_tables=master:test.t3, slave:test.t3; +source include/diff_tables.inc; + + +connection master; + +begin; +delete from t1; +delete from t2; +delete from t3; +commit; + +drop table t1, t2, t3; +set @@global.binlog_cache_size = @save_binlog_cache_size; +set @@global.binlog_checksum = @save_binlog_checksum; +set @@global.master_verify_checksum = @save_master_verify_checksum; +drop procedure test.p_init; +drop procedure test.p1; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_corruption.test b/mysql-test/suite/rpl/t/rpl_corruption.test index e51d1c65e95..c7a913af9d7 100644 --- a/mysql-test/suite/rpl/t/rpl_corruption.test +++ b/mysql-test/suite/rpl/t/rpl_corruption.test @@ -1 +1,175 @@ ---source include/rpl_corruption.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +############################################################ +# Purpose: WL#5064 Testing with corrupted events. +# The test emulates the corruption at the vary stages +# of replication: +# - in binlog file +# - in network +# - in relay log +############################################################ + +# +# The tests intensively utilize @@global.debug. Note, +# Bug#11765758 - 58754, +# @@global.debug is read by the slave threads through dbug-interface. +# Hence, before a client thread set @@global.debug we have to ensure that: +# (a) the slave threads are stopped, or (b) the slave threads are in +# sync and waiting. + +--source include/have_debug.inc +--source include/master-slave.inc + +# Block legal errors for MTR +call mtr.add_suppression('Found invalid event in binary log'); +call mtr.add_suppression('Slave I/O: Relay log write failure: could not queue event from master'); +call mtr.add_suppression('event read from binlog did not pass crc check'); +call mtr.add_suppression('Replication event checksum verification failed'); +call mtr.add_suppression('Event crc check failed! Most likely there is event corruption'); +call mtr.add_suppression('Slave SQL: Error initializing relay log position: I/O error reading event at position .*, error.* 1593'); + +SET @old_master_verify_checksum = @@master_verify_checksum; + +# Creating test table/data and set corruption position for testing +--echo # 1. Creating test table/data and set corruption position for testing +--connection master +--echo * insert/update/delete rows in table t1 * +# Corruption algorithm modifies only the first event and +# then will be reset. To avoid checking always the first event +# from binlog (usually it is FD) we randomly execute different +# statements and set position for corruption inside events. + +CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c VARCHAR(100)); +--disable_query_log +let $i=`SELECT 3+CEILING(10*RAND())`; +let $j=1; +let $pos=0; +while ($i) { + eval INSERT INTO t1 VALUES ($j, 'a', NULL); + if (`SELECT RAND() > 0.7`) + { + eval UPDATE t1 SET c = REPEAT('a', 20) WHERE a = $j; + } + if (`SELECT RAND() > 0.8`) + { + eval DELETE FROM t1 WHERE a = $j; + } + if (!$pos) { + let $pos= query_get_value(SHOW MASTER STATUS, Position, 1); + --sync_slave_with_master + --source include/stop_slave.inc + --disable_query_log + --connection master + } + dec $i; + inc $j; +} +--enable_query_log + + +# Emulate corruption in binlog file when SHOW BINLOG EVENTS is executing +--echo # 2. Corruption in master binlog and SHOW BINLOG EVENTS +SET @saved_dbug = @@global.debug_dbug; +SET @@global.debug_dbug="d,corrupt_read_log_event_char"; +--echo SHOW BINLOG EVENTS; +--disable_query_log +send_eval SHOW BINLOG EVENTS FROM $pos; +--enable_query_log +--error ER_ERROR_WHEN_EXECUTING_COMMAND +reap; + +SET @@global.debug_dbug=@saved_dbug; + +# Emulate corruption on master with crc checking on master +--echo # 3. Master read a corrupted event from binlog and send the error to slave + +# We have a rare but nasty potential race here: if the dump thread on +# the master for the _old_ slave connection has not yet discovered +# that the slave has disconnected, we will inject the corrupt event on +# the wrong connection, and the test will fail +# (+d,corrupt_read_log_event2 corrupts only one event). +# So kill any lingering dump thread (we need to kill; otherwise dump thread +# could manage to send all events down the socket before seeing it close, and +# hang forever waiting for new binlog events to be created). +let $id= `select id from information_schema.processlist where command = "Binlog Dump"`; +if ($id) +{ + --disable_query_log + --error 0,1094 + eval kill $id; + --enable_query_log +} +let $wait_condition= + SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE command = 'Binlog Dump'; +--source include/wait_condition.inc + +SET @@global.debug_dbug="d,corrupt_read_log_event2_set"; +--connection slave +START SLAVE IO_THREAD; +let $slave_io_errno= 1236; +--let $slave_timeout= 10 +--source include/wait_for_slave_io_error.inc +--connection master +SET @@global.debug_dbug=@saved_dbug; + +# Emulate corruption on master without crc checking on master +--echo # 4. Master read a corrupted event from binlog and send it to slave +--connection master +SET GLOBAL master_verify_checksum=0; +SET @@global.debug_dbug="d,corrupt_read_log_event2_set"; +--connection slave +START SLAVE IO_THREAD; +# When the checksum error is detected, the slave sets error code 1743 +# (ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE) in queue_event(), then immediately +# sets error 1595 (ER_SLAVE_RELAY_LOG_WRITE_FAILURE) in handle_slave_io(). +# So we usually get 1595, but it is occasionally possible to get 1743. +let $slave_io_errno= 1595,1743; # ER_SLAVE_RELAY_LOG_WRITE_FAILURE, ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE +--source include/wait_for_slave_io_error.inc +--connection master +SET @@global.debug_dbug=@saved_dbug; +SET GLOBAL master_verify_checksum=1; + +# Emulate corruption in network +--echo # 5. Slave. Corruption in network +--connection slave +SET @saved_dbug_slave = @@GLOBAL.debug_dbug; +SET @@global.debug_dbug="d,corrupt_queue_event"; +START SLAVE IO_THREAD; +let $slave_io_errno= 1595,1743; # ER_SLAVE_RELAY_LOG_WRITE_FAILURE, ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE +--source include/wait_for_slave_io_error.inc +SET @@global.debug_dbug=@saved_dbug_slave; + +# Emulate corruption in relay log +--echo # 6. Slave. Corruption in relay log + +SET @@global.debug_dbug="d,corrupt_read_log_event_char"; + +START SLAVE SQL_THREAD; +let $slave_sql_errno= 1593; +--source include/wait_for_slave_sql_error.inc + +SET @@global.debug_dbug=@saved_dbug_slave; + +# Start normal replication and compare same table on master +# and slave +--echo # 7. Seek diff for tables on master and slave +--connection slave +--source include/start_slave.inc +--connection master +--sync_slave_with_master +let $diff_tables= master:test.t1, slave:test.t1; +--source include/diff_tables.inc + +# Clean up +--echo # 8. Clean up +--connection master +set @@global.debug_dbug = @saved_dbug; +SET GLOBAL master_verify_checksum = @old_master_verify_checksum; +DROP TABLE t1; +--sync_slave_with_master + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_gtid_basic.test b/mysql-test/suite/rpl/t/rpl_gtid_basic.test index 004003ea524..5975c6f03c3 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_basic.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_basic.test @@ -1,4 +1,575 @@ ---source include/rpl_gtid_basic.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +--source include/have_innodb.inc +--let $rpl_topology=1->2->3->4 +--source include/rpl_init.inc + +# Set up a 4-deep replication topology, then test various fail-overs +# using GTID. +# +# A -> B -> C -> D + +connection server_1; +--source include/wait_for_binlog_checkpoint.inc +--let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1) +--let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1) +--echo *** GTID position should be empty here *** +--replace_result $binlog_file $binlog_pos +eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos); + +CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=MyISAM; +CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, "m1"); +INSERT INTO t1 VALUES (2, "m2"), (3, "m3"), (4, "m4"); +INSERT INTO t2 VALUES (1, "i1"); +BEGIN; +INSERT INTO t2 VALUES (2, "i2"), (3, "i3"); +INSERT INTO t2 VALUES (4, "i4"); +COMMIT; +save_master_pos; +source include/wait_for_binlog_checkpoint.inc; +--let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1) +--let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1) +--let $gtid_pos_server_1 = `SELECT @@gtid_binlog_pos` +--echo *** GTID position should be non-empty here *** +--replace_result $binlog_file $binlog_pos $gtid_pos_server_1 +eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos); + +connection server_2; +sync_with_master; +source include/wait_for_binlog_checkpoint.inc; +--let $binlog_file = query_get_value(SHOW MASTER STATUS,File,1) +--let $binlog_pos = query_get_value(SHOW MASTER STATUS,Position,1) +--echo *** GTID position should be the same as on server_1 *** +--replace_result $binlog_file $binlog_pos $gtid_pos_server_1 +eval SELECT BINLOG_GTID_POS('$binlog_file',$binlog_pos); +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; +save_master_pos; + +connection server_3; +sync_with_master; +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; +save_master_pos; + +connection server_4; +sync_with_master; +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; + + +--echo *** Now take out D, let it fall behind a bit, and then test re-attaching it to A *** +connection server_4; +--source include/stop_slave.inc + +connection server_1; +INSERT INTO t1 VALUES (5, "m1a"); +INSERT INTO t2 VALUES (5, "i1a"); +save_master_pos; + +connection server_4; +--replace_result $MASTER_MYPORT MASTER_PORT +eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT, + MASTER_USE_GTID=CURRENT_POS; +--source include/start_slave.inc +sync_with_master; +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; + +--echo *** Now move B to D (C is still replicating from B) *** +connection server_2; +--source include/stop_slave.inc +--replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4 +eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4, + MASTER_USE_GTID=CURRENT_POS; +--source include/start_slave.inc + +connection server_4; +UPDATE t2 SET b="j1a" WHERE a=5; +save_master_pos; + +connection server_2; +sync_with_master; +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; + +--echo *** Now move C to D, after letting it fall a little behind *** +connection server_3; +--source include/stop_slave.inc + +connection server_1; +INSERT INTO t2 VALUES (6, "i6b"); +INSERT INTO t2 VALUES (7, "i7b"); +--source include/save_master_gtid.inc + +connection server_3; +--replace_result $SERVER_MYPORT_4 SERVER_MYPORT_4 +eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_4, + MASTER_USE_GTID=CURRENT_POS; +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc +SELECT * FROM t2 ORDER BY a; + +--echo *** Now change everything back to what it was, to make rpl_end.inc happy +# Also check that MASTER_USE_GTID=CURRENT_POS is still enabled. +connection server_2; +# We need to sync up server_2 before switching. If it happened to have reached +# the point 'UPDATE t2 SET b="j1a" WHERE a=5' it will fail to connect to +# server_1, which is (deliberately) missing that transaction. +--source include/sync_with_master_gtid.inc +--source include/stop_slave.inc +--replace_result $MASTER_MYPORT MASTER_MYPORT +eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT; +--source include/start_slave.inc +--source include/wait_for_slave_to_start.inc + +connection server_3; +--source include/stop_slave.inc +--replace_result $SLAVE_MYPORT SLAVE_MYPORT +eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SLAVE_MYPORT; +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + +connection server_4; +--source include/stop_slave.inc +--replace_result $SERVER_MYPORT_3 SERVER_MYPORT_3 +eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_3; +--source include/start_slave.inc + +connection server_1; +DROP TABLE t1,t2; +--source include/save_master_gtid.inc + +--echo *** A few more checks for BINLOG_GTID_POS function *** +--let $valid_binlog_name = query_get_value(SHOW BINARY LOGS,Log_name,1) +--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +SELECT BINLOG_GTID_POS(); +--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +SELECT BINLOG_GTID_POS('a'); +--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT +SELECT BINLOG_GTID_POS('a',1,NULL); +SELECT BINLOG_GTID_POS(1,'a'); +SELECT BINLOG_GTID_POS(NULL,NULL); +SELECT BINLOG_GTID_POS('',1); +SELECT BINLOG_GTID_POS('a',1); +eval SELECT BINLOG_GTID_POS('$valid_binlog_name',-1); +eval SELECT BINLOG_GTID_POS('$valid_binlog_name',0); +eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551615); +eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551616); + + +--echo *** Some tests of @@GLOBAL.gtid_binlog_state *** +--connection server_2 +--source include/sync_with_master_gtid.inc +--source include/stop_slave.inc + +--connection server_1 +SET @old_state= @@GLOBAL.gtid_binlog_state; + +--error ER_BINLOG_MUST_BE_EMPTY +SET GLOBAL gtid_binlog_state = ''; +RESET MASTER; +SET GLOBAL gtid_binlog_state = ''; +FLUSH LOGS; +--source include/show_binary_logs.inc +SET GLOBAL gtid_binlog_state = '0-1-10,1-2-20,0-3-30'; +--source include/show_binary_logs.inc +--let $binlog_file= master-bin.000001 +--let $binlog_start= 4 +--source include/show_binlog_events.inc +#SELECT @@GLOBAL.gtid_binlog_pos; +#SELECT @@GLOBAL.gtid_binlog_state; +--error ER_BINLOG_MUST_BE_EMPTY +SET GLOBAL gtid_binlog_state = @old_state; +RESET MASTER; +SET GLOBAL gtid_binlog_state = @old_state; + +# Check that slave can reconnect again, despite the RESET MASTER, as we +# restored the state. + +CREATE TABLE t1 (a INT PRIMARY KEY); +SET gtid_seq_no=100; +INSERT INTO t1 VALUES (1); +--source include/save_master_gtid.inc + +--connection server_2 +--source include/start_slave.inc +# We cannot just use sync_with_master as we've done RESET MASTER, so +# slave old-style position is wrong. +# So sync on gtid position instead. +--source include/sync_with_master_gtid.inc + +SELECT * FROM t1; +# Check that the IO gtid position in SHOW SLAVE STATUS is also correct. +--let $status_items= Gtid_IO_Pos +--source include/show_slave_status.inc + +--echo *** Test @@LAST_GTID and MASTER_GTID_WAIT() *** + +--connection server_1 +DROP TABLE t1; +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +--save_master_pos + +--connection server_2 +--sync_with_master +--source include/stop_slave.inc + +--connect (m1,127.0.0.1,root,,test,$SERVER_MYPORT_1,) +SELECT @@last_gtid; +SET gtid_seq_no=110; +SELECT @@last_gtid; +BEGIN; +SELECT @@last_gtid; +INSERT INTO t1 VALUES (2); +SELECT @@last_gtid; +COMMIT; +SELECT @@last_gtid; +--let $pos= `SELECT @@gtid_binlog_pos` + +--connect (s1,127.0.0.1,root,,test,$SERVER_MYPORT_2,) +eval SET @pos= '$pos'; +# Check NULL argument. +SELECT master_gtid_wait(NULL); +# Check empty argument returns immediately. +SELECT master_gtid_wait('', NULL); +# Check this gets counted +SHOW STATUS LIKE 'Master_gtid_wait_count'; +SHOW STATUS LIKE 'Master_gtid_wait_timeouts'; +SHOW STATUS LIKE 'Master_gtid_wait_time'; +# Let's check that we get a timeout +SELECT master_gtid_wait(@pos, 0.5); +SELECT * FROM t1 ORDER BY a; +# Now actually wait until the slave reaches the position +send SELECT master_gtid_wait(@pos); + +--connection server_2 +--source include/start_slave.inc + +--connection s1 +reap; +SELECT * FROM t1 ORDER BY a; + +# Test waiting on a domain that does not exist yet. +--source include/stop_slave.inc + +--connection server_1 +SET gtid_domain_id= 1; +INSERT INTO t1 VALUES (3); +--let $pos= `SELECT @@gtid_binlog_pos` + +--connection s1 +--replace_result $pos POS +eval SET @pos= '$pos'; +SELECT master_gtid_wait(@pos, 0); +SELECT * FROM t1 WHERE a >= 3; +send SELECT master_gtid_wait(@pos, -1); + +--connection server_2 +--source include/start_slave.inc + +--connection s1 +reap; +SELECT * FROM t1 WHERE a >= 3; +# Waiting for only part of the position. +SELECT master_gtid_wait('1-1-1', 0); + +# Now test a lot of parallel master_gtid_wait() calls, completing in different +# order, and some of which time out or get killed on the way. + +--connection s1 +send SELECT master_gtid_wait('2-1-1,1-1-4,0-1-110'); + +--connect (s2,127.0.0.1,root,,test,$SERVER_MYPORT_2,) +# This will time out. No event 0-1-1000 exists +send SELECT master_gtid_wait('0-1-1000', 0.5); + +--connect (s3,127.0.0.1,root,,test,$SERVER_MYPORT_2,) +# This one we will kill +--let $kill1_id= `SELECT connection_id()` +send SELECT master_gtid_wait('0-1-2000'); + +--connect (s4,127.0.0.1,root,,test,$SERVER_MYPORT_2,) +send SELECT master_gtid_wait('2-1-10'); + +--connect (s5,127.0.0.1,root,,test,$SERVER_MYPORT_2,) +send SELECT master_gtid_wait('2-1-6', 1); + +# This one we will kill also. +--connect (s6,127.0.0.1,root,,test,$SERVER_MYPORT_2,) +--let $kill2_id= `SELECT connection_id()` +send SELECT master_gtid_wait('2-1-5'); + +--connect (s7,127.0.0.1,root,,test,$SERVER_MYPORT_2,) +send SELECT master_gtid_wait('2-1-10'); + +--connect (s8,127.0.0.1,root,,test,$SERVER_MYPORT_2,) +send SELECT master_gtid_wait('2-1-5,1-1-4,0-1-110'); + +--connect (s9,127.0.0.1,root,,test,$SERVER_MYPORT_2,) +send SELECT master_gtid_wait('2-1-2'); + +--connection server_2 +# This one completes immediately. +SHOW STATUS LIKE 'Master_gtid_wait_timeouts'; +SHOW STATUS LIKE 'Master_gtid_wait_count'; +SELECT master_gtid_wait('1-1-1'); +SHOW STATUS LIKE 'Master_gtid_wait_timeouts'; +SHOW STATUS LIKE 'Master_gtid_wait_count'; +let $wait_time = query_get_value(SHOW STATUS LIKE 'Master_gtid_wait_time', Value, 1); +--replace_result $wait_time MASTER_GTID_WAIT_TIME +eval SET @a= $wait_time; +SELECT IF(@a <= 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " is larger than expected")) + AS Master_gtid_wait_time_as_expected; + + +--connect (s10,127.0.0.1,root,,test,$SERVER_MYPORT_2,) +send SELECT master_gtid_wait('0-1-109'); + +--connection server_2 +# This one should time out. +SHOW STATUS LIKE 'Master_gtid_wait_timeouts'; +SHOW STATUS LIKE 'Master_gtid_wait_count'; +SELECT master_gtid_wait('2-1-2', 0.5); +SHOW STATUS LIKE 'Master_gtid_wait_timeouts'; +SHOW STATUS LIKE 'Master_gtid_wait_count'; +let $wait_time = query_get_value(SHOW STATUS LIKE 'Master_gtid_wait_time', Value, 1); +--replace_result $wait_time MASTER_GTID_WAIT_TIME +eval SET @a= $wait_time; +# We expect a wait time of just a bit over 0.5 seconds. But thread scheduling +# and timer inaccuracies could introduce significant jitter. So allow a +# generous interval. +SELECT IF(@a BETWEEN 0.4*1000*1000 AND 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " not as expected")) AS Master_gtid_wait_time_as_expected; + +--replace_result $kill1_id KILL_ID +eval KILL QUERY $kill1_id; +--connection s3 +--error ER_QUERY_INTERRUPTED +reap; + +--connection server_1 +SET gtid_domain_id=2; +SET gtid_seq_no=2; +INSERT INTO t1 VALUES (4); + +--connection s9 +reap; + +--connection server_2 +--replace_result $kill2_id KILL_ID +eval KILL CONNECTION $kill2_id; + +--connection s6 +--error 2013,ER_CONNECTION_KILLED +reap; + +--connection server_1 +SET gtid_domain_id=1; +SET gtid_seq_no=4; +INSERT INTO t1 VALUES (5); +SET gtid_domain_id=2; +SET gtid_seq_no=5; +INSERT INTO t1 VALUES (6); + +--connection s8 +reap; +--connection s1 +reap; +--connection s2 +reap; +--connection s5 +reap; +--connection s10 +reap; + +--connection server_1 +SET gtid_domain_id=2; +SET gtid_seq_no=10; +INSERT INTO t1 VALUES (7); + +--connection s4 +reap; +--connection s7 +reap; + + +--echo *** Test gtid_slave_pos when used with GTID *** + +--connection server_2 +--source include/stop_slave.inc + +--connection server_1 +SET gtid_domain_id=2; +SET gtid_seq_no=1000; +INSERT INTO t1 VALUES (10); +INSERT INTO t1 VALUES (11); +--save_master_pos + +--connection server_2 +SET sql_slave_skip_counter= 1; +--source include/start_slave.inc +--sync_with_master +SELECT * FROM t1 WHERE a >= 10 ORDER BY a; +SELECT IF(LOCATE("2-1-1001", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1001 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status; + +--source include/stop_slave.inc + +--connection server_1 +SET gtid_domain_id=2; +SET gtid_seq_no=1010; +INSERT INTO t1 VALUES (12); +INSERT INTO t1 VALUES (13); +--save_master_pos + +--connection server_2 +SET sql_slave_skip_counter= 2; +--source include/start_slave.inc +--sync_with_master +SELECT * FROM t1 WHERE a >= 10 ORDER BY a; +SELECT IF(LOCATE("2-1-1011", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1011 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status; + +--source include/stop_slave.inc + +--connection server_1 +SET gtid_domain_id=2; +SET gtid_seq_no=1020; +INSERT INTO t1 VALUES (14); +INSERT INTO t1 VALUES (15); +INSERT INTO t1 VALUES (16); +--save_master_pos + +--connection server_2 +SET sql_slave_skip_counter= 3; +--source include/start_slave.inc +--sync_with_master +SELECT * FROM t1 WHERE a >= 10 ORDER BY a; +SELECT IF(LOCATE("2-1-1022", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1022 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status; + +--source include/stop_slave.inc + +--connection server_1 +SET gtid_domain_id=2; +SET gtid_seq_no=1030; +# Disable logging Annotate_rows events to preserve events count. +let $binlog_annotate_row_events_saved= `SELECT @@binlog_annotate_row_events`; +SET @@binlog_annotate_row_events= 0; +INSERT INTO t1 VALUES (17); +INSERT INTO t1 VALUES (18); +INSERT INTO t1 VALUES (19); +eval SET @@binlog_annotate_row_events= $binlog_annotate_row_events_saved; +--save_master_pos + +--connection server_2 +SET sql_slave_skip_counter= 5; +--source include/start_slave.inc +--sync_with_master +SELECT * FROM t1 WHERE a >= 10 ORDER BY a; +SELECT IF(LOCATE("2-1-1032", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1032 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status; + + +--source include/stop_slave.inc + +--connection server_1 +SET gtid_domain_id=3; +SET gtid_seq_no=100; +CREATE TABLE t2 (a INT PRIMARY KEY); +DROP TABLE t2; +SET gtid_domain_id=2; +SET gtid_seq_no=1040; +INSERT INTO t1 VALUES (20); +--save_master_pos + +--connection server_2 +SET @saved_mode= @@GLOBAL.slave_ddl_exec_mode; +SET GLOBAL slave_ddl_exec_mode=STRICT; +SET sql_slave_skip_counter=1; +START SLAVE UNTIL master_gtid_pos="3-1-100"; +--let $master_pos=3-1-100 +--source include/sync_with_master_gtid.inc +--source include/wait_for_slave_to_stop.inc +--error ER_NO_SUCH_TABLE +SELECT * FROM t2; +SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status; + +# Start the slave again, it should fail on the DROP TABLE as the table is not there. +SET sql_log_bin=0; +CALL mtr.add_suppression("Slave: Unknown table 'test\\.t2' Error_code: 1051"); +SET sql_log_bin=1; +START SLAVE; +--let $slave_sql_errno=1051 +--source include/wait_for_slave_sql_error.inc +SELECT IF(LOCATE("3-1-100", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-100 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status; + +STOP SLAVE IO_THREAD; +SET sql_slave_skip_counter=2; +--source include/start_slave.inc +--sync_with_master + +SELECT * FROM t1 WHERE a >= 20 ORDER BY a; +SELECT IF(LOCATE("3-1-101", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 3-1-101 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status; +SELECT IF(LOCATE("2-1-1040", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! expected GTID 2-1-1040 not found in gtid_slave_pos: ", @@GLOBAL.gtid_slave_pos)) AS status; + +SET GLOBAL slave_ddl_exec_mode= @saved_mode; + + +--echo *** Test GTID-connecting to a master with out-of-order sequence numbers in the binlog. *** + +# Create an out-of-order binlog on server 2. +# Let server 3 replicate to an out-of-order point, stop it, restart it, +# and check that it replicates correctly despite the out-of-order. + +--connection server_1 +SET gtid_domain_id= @@GLOBAL.gtid_domain_id; +INSERT INTO t1 VALUES (31); +--save_master_pos + +--connection server_2 +--sync_with_master +SET gtid_domain_id= @@GLOBAL.gtid_domain_id; +INSERT INTO t1 VALUES (32); + +--connection server_1 +INSERT INTO t1 VALUES (33); +--save_master_pos + +--connection server_2 +--sync_with_master +--save_master_pos + +--connection server_3 +--sync_with_master +--source include/stop_slave.inc + +--connection server_1 +INSERT INTO t1 VALUES (34); +--save_master_pos + +--connection server_2 +--sync_with_master +--save_master_pos + +--connection server_3 +--source include/start_slave.inc +--sync_with_master +SELECT * FROM t1 WHERE a >= 30 ORDER BY a; +--save_master_pos + +--connection server_4 +--sync_with_master +SELECT * FROM t1 WHERE a >= 30 ORDER BY a; + + +# Clean up. +--connection server_1 +DROP TABLE t1; + + +--source include/rpl_end.inc --echo # --echo # Start of 10.2 tests diff --git a/mysql-test/suite/rpl/t/rpl_incident.test b/mysql-test/suite/rpl/t/rpl_incident.test index 4bb6477ca98..75d28d6a6c6 100644 --- a/mysql-test/suite/rpl/t/rpl_incident.test +++ b/mysql-test/suite/rpl/t/rpl_incident.test @@ -1 +1,61 @@ ---source include/rpl_incident.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +--source include/have_debug.inc +--source include/master-slave.inc + +SET @old_binlog_checksum=@@binlog_checksum; +SET GLOBAL BINLOG_CHECKSUM=none; +connection slave; +SET @old_binlog_checksum=@@binlog_checksum; +SET GLOBAL BINLOG_CHECKSUM=none; +connection master; + +--echo **** On Master **** +CREATE TABLE t1 (a INT); + +INSERT INTO t1 VALUES (1),(2),(3); +SELECT * FROM t1; + +set @saved_dbug = @@global.debug_dbug; +SET GLOBAL debug_dbug= '+d,incident_database_resync_on_replace,*'; + +# This will generate an incident log event and store it in the binary +# log before the replace statement. +REPLACE INTO t1 VALUES (4); +--save_master_pos +SELECT * FROM t1; + +set @@global.debug_dbug = @saved_dbug; + +connection slave; +# Wait until SQL thread stops with error LOST_EVENT on master +call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master.* 1590"); +let $slave_sql_errno= 1590; +let $show_slave_sql_error= 1; +source include/wait_for_slave_sql_error.inc; + +# The 4 should not be inserted into the table, since the incident log +# event should have stop the slave. +--echo **** On Slave **** +SELECT * FROM t1; + +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; +START SLAVE; +--sync_with_master + +# Now, we should have inserted the row into the table and the slave +# should be running. We should also have rotated to a new binary log. + +SELECT * FROM t1; +source include/check_slave_is_running.inc; + +connection master; +SET GLOBAL BINLOG_CHECKSUM=@old_binlog_checksum; +DROP TABLE t1; +--sync_slave_with_master +SET GLOBAL BINLOG_CHECKSUM=@old_binlog_checksum; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_init_slave_errors.test b/mysql-test/suite/rpl/t/rpl_init_slave_errors.test index 6f6ab7e8d7c..46673ea4764 100644 --- a/mysql-test/suite/rpl/t/rpl_init_slave_errors.test +++ b/mysql-test/suite/rpl/t/rpl_init_slave_errors.test @@ -1 +1,96 @@ ---source include/rpl_init_slave_errors.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +###################################################################### +# Some errors that cause the slave SQL thread to stop are not shown in +# the Slave_SQL_Error column of "SHOW SLAVE STATUS". Instead, the error +# is only in the server's error log. +# +# Two failures and their respective reporting are verified: +# +# 1 - Failures during slave thread initialization +# 2 - Failures while processing queries passed through the init_slave +# option. +# +# In order to check the first type of failure, we inject a fault in the +# SQL/IO Threads through SET GLOBAL debug. +# +# To check the second type, we set @@global.init_slave to an invalid +# command thus preventing the initialization of the SQL Thread. +# +# Obs: +# 1 - Note that testing failures while initializing the relay log position +# is hard as the same function is called before the code reaches the point +# that we want to test. +# +# 2 - This test does not target failures that are reported while applying +# events such as duplicate keys, errors while reading the relay-log.bin*, +# etc. Such errors are already checked on other tests. +###################################################################### + +###################################################################### +# Configuring the Environment +###################################################################### +source include/have_debug.inc; +source include/have_log_bin.inc; +source include/master-slave.inc; + +connection slave; + +--disable_warnings +stop slave; +--enable_warnings +reset slave; + +###################################################################### +# Injecting faults in the threads' initialization +###################################################################### +connection slave; + +# Set debug flags on slave to force errors to occur +set @saved_dbug = @@global.debug_dbug; +SET GLOBAL debug_dbug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init"; + +start slave; + +# +# slave is going to stop because of emulated failures +# but there won't be any crashes nor asserts hit. +# +# 1593 = ER_SLAVE_FATAL_ERROR +--let $slave_sql_errno= 1593 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error.inc + +call mtr.add_suppression("Failed during slave.* thread initialization"); + +set @@global.debug_dbug = @saved_dbug; + +###################################################################### +# Injecting faults in the init_slave option +###################################################################### +connection slave; + +reset slave; + +SET GLOBAL init_slave= "garbage"; + +start slave; +# 1064 = ER_PARSE_ERROR +--let $slave_sql_errno= 1064 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error.inc + +###################################################################### +# Clean up +###################################################################### +SET GLOBAL init_slave= ""; + +# Clean up Last_SQL_Error +--source include/stop_slave_io.inc +RESET SLAVE; +--let $rpl_only_running_threads= 1 +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/include/rpl_loaddata_local.inc b/mysql-test/suite/rpl/t/rpl_loaddata_local.test similarity index 100% rename from mysql-test/suite/rpl/include/rpl_loaddata_local.inc rename to mysql-test/suite/rpl/t/rpl_loaddata_local.test diff --git a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test deleted file mode 100644 index 712041467ab..00000000000 --- a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test +++ /dev/null @@ -1 +0,0 @@ ---source include/rpl_loaddata_local.inc diff --git a/mysql-test/suite/rpl/t/rpl_loadfile.test b/mysql-test/suite/rpl/t/rpl_loadfile.test index 10fecf1f653..9cd64530690 100644 --- a/mysql-test/suite/rpl/t/rpl_loadfile.test +++ b/mysql-test/suite/rpl/t/rpl_loadfile.test @@ -1 +1,120 @@ ---source include/rpl_loadfile.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +############################################################################# +# Original Author: JBM # +# Original Date: Aug/18/2005 # +############################################################################# +# TEST: To test the LOAD_FILE() in rbr # +############################################################################# +# Change Author: JBM +# Change Date: 2006-01-16 +########## + +# Includes +-- source include/have_binlog_format_mixed_or_row.inc +-- source include/master-slave.inc + +-- source suite/rpl/include/rpl_loadfile.test + +# BUG#39701: Mixed binlog format does not switch to row mode on LOAD_FILE +# +# DESCRIPTION +# +# Problem: when using load_file string function and mixed binlogging format +# there was no switch to row based binlogging format. This leads +# to scenarios on which the slave replicates the statement and it +# will try to load the file from local file system, which in most +# likely it will not exist. +# +# Solution: +# Marking this function as unsafe for statement format, makes the +# statement using it to be logged in row based format. As such, data +# replicated from the master, becomes the content of the loaded file. +# Consequently, the slave receives the necessary data to complete +# the load_file instruction correctly. +# +# IMPLEMENTATION +# +# The test is implemented as follows: +# +# On Master, +# i) write to file the desired content. +# ii) create table and stored procedure with load_file +# iii) stop slave +# iii) execute load_file +# iv) remove file +# +# On Slave, +# v) start slave +# vi) sync it with master so that it gets the updates from binlog (which +# should have bin logged in row format). +# +# If the the binlog format does not change to row, then the assertion +# done in the following step fails. This happens because tables differ +# since the file does not exist anymore, meaning that when slave +# attempts to execute LOAD_FILE statement it inserts NULL on table +# instead of the same contents that the master loaded when it executed +# the procedure (which was executed when file existed). +# +# vii) assert that the contents of master and slave +# table are the same + +--source include/rpl_reset.inc + +connection master; +let $file= $MYSQLTEST_VARDIR/tmp/bug_39701.data; + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--eval SELECT repeat('x',20) INTO OUTFILE '$file' + +disable_warnings; +DROP TABLE IF EXISTS t1; +enable_warnings; + +CREATE TABLE t1 (t text); +DELIMITER |; +CREATE PROCEDURE p(file varchar(4096)) + BEGIN + INSERT INTO t1 VALUES (LOAD_FILE(file)); + END| +DELIMITER ;| + +# stop slave before issuing the load_file on master +connection slave; +source include/stop_slave.inc; + +connection master; + +# test: check that logging falls back to rbr. +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--eval CALL p('$file') + +# test: remove the file from the filesystem and assert that slave still +# gets the loaded file +remove_file $file; + +# now that the file is removed it is safe (regarding what we want to test) +# to start slave +connection slave; +source include/start_slave.inc; + +connection master; +sync_slave_with_master; + +# assertion: assert that the slave got the updates even +# if the file was removed before the slave started, +# meaning that contents were indeed transfered +# through binlog (in row format) +let $diff_tables= master:t1, slave:t1; +source include/diff_tables.inc; + +# CLEAN UP +--connection master +DROP TABLE t1; +DROP PROCEDURE p; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test index 1bf99c2366b..cbde486bcbb 100644 --- a/mysql-test/suite/rpl/t/rpl_packet.test +++ b/mysql-test/suite/rpl/t/rpl_packet.test @@ -1 +1,184 @@ ---source include/rpl_packet.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +# ==== Purpose ==== +# +# Check replication protocol packet size handling +# +# ==== Related bugs ==== +# Bug#19402 SQL close to the size of the max_allowed_packet fails on slave +# BUG#23755: Replicated event larger that max_allowed_packet infinitely re-transmits +# BUG#42914: No LAST_IO_ERROR for max_allowed_packet errors +# BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET + +# max-out size db name +source include/have_binlog_format_row.inc; +source include/master-slave.inc; + +call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, .*error.* 1153"); +call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet"); +let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; +disable_warnings; +eval drop database if exists $db; +enable_warnings; +eval create database $db; + +connection master; +let $old_max_allowed_packet= `SELECT @@global.max_allowed_packet`; +let $old_net_buffer_length= `SELECT @@global.net_buffer_length`; +let $old_slave_max_allowed_packet= `SELECT @@global.slave_max_allowed_packet`; +SET @@global.max_allowed_packet=1024; +SET @@global.net_buffer_length=1024; + +sync_slave_with_master; +# Restart slave for setting to take effect +source include/stop_slave.inc; +source include/start_slave.inc; + +# Reconnect to master for new setting to take effect +disconnect master; + +# alas, can't use eval here; if db name changed apply the change here +connect (master,localhost,root,,DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________); + +connection master; +select @@net_buffer_length, @@max_allowed_packet; + +create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM; + +INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1023'); +sync_slave_with_master; + +eval select count(*) from `$db`.`t1` /* must be 1 */; + +SHOW STATUS LIKE 'Slave_running'; +select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING'; +connection master; +eval drop database $db; +sync_slave_with_master; + +# +# Bug #23755: Replicated event larger that max_allowed_packet infinitely re-transmits +# +# Check that a situation when the size of event on the master is greater than +# max_allowed_packet on the slave does not lead to infinite re-transmits. + +connection master; + +# Change the max packet size on master + +SET @@global.max_allowed_packet=4096; +SET @@global.net_buffer_length=4096; + +# Restart slave for new setting to take effect +connection slave; +source include/stop_slave.inc; +source include/start_slave.inc; + +# Reconnect to master for new setting to take effect +disconnect master; +connect (master, localhost, root); +connection master; + +CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM; + +sync_slave_with_master; + +connection master; + +INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048'); + + +# +# Bug#42914: The slave I/O thread must stop after trying to read the above +# event, However there is no Last_IO_Error report. +# + +# The slave I/O thread must stop after trying to read the above event +connection slave; +# 1153 = ER_NET_PACKET_TOO_LARGE +--let $slave_io_errno= 1153 +--let $show_slave_io_error= 1 +--source include/wait_for_slave_io_error.inc + +# TODO: this is needed because of BUG#55790. Remove once that is fixed. +--source include/stop_slave_sql.inc + +# +# Bug#42914: On the master, if a binary log event is larger than +# max_allowed_packet, the error message ER_MASTER_FATAL_ERROR_READING_BINLOG +# is sent to a slave when it requests a dump from the master, thus leading the +# I/O thread to stop. However, there is no Last_IO_Error reported. +# + +--let $rpl_only_running_threads= 1 +--source include/rpl_reset.inc +--connection master +DROP TABLE t1; +--sync_slave_with_master + + +connection master; +CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM; +sync_slave_with_master; + +connection master; +INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet)); + +connection slave; +# The slave I/O thread must stop after receiving +# 1153 = ER_NET_PACKET_TOO_LARGE +--let $slave_io_errno= 1153 +--let $show_slave_io_error= 1 +--source include/wait_for_slave_io_error.inc + +# Remove the bad binlog and clear error status on slave. +STOP SLAVE; +RESET SLAVE; +--connection master +RESET MASTER; + + +# +# BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET +# +# In BUG#55322, @@session.max_allowed_packet increased each time SHOW +# BINLOG EVENTS was issued. To verify that this bug is fixed, we +# execute SHOW BINLOG EVENTS twice and check that max_allowed_packet +# never changes. We turn off the result log because we don't care +# about the contents of the binlog. + +--disable_result_log +SET @max_allowed_packet_0= @@session.max_allowed_packet; +SHOW BINLOG EVENTS; +SET @max_allowed_packet_1= @@session.max_allowed_packet; +SHOW BINLOG EVENTS; +SET @max_allowed_packet_2= @@session.max_allowed_packet; +--enable_result_log +if (`SELECT NOT(@max_allowed_packet_0 = @max_allowed_packet_1 AND @max_allowed_packet_1 = @max_allowed_packet_2)`) +{ + --echo ERROR: max_allowed_packet changed after executing SHOW BINLOG EVENTS + --source include/show_rpl_debug_info.inc + SELECT @max_allowed_packet_0, @max_allowed_packet_1, @max_allowed_packet_2; + --die @max_allowed_packet changed after executing SHOW BINLOG EVENTS +} + + +--echo ==== clean up ==== +connection master; +DROP TABLE t1; +eval SET @@global.max_allowed_packet= $old_max_allowed_packet; +eval SET @@global.net_buffer_length= $old_net_buffer_length; +eval SET @@global.slave_max_allowed_packet= $old_slave_max_allowed_packet; +# slave is stopped +connection slave; +DROP TABLE t1; + +# Clear Last_IO_Error +RESET SLAVE; + +--source include/rpl_end.inc +# End of tests diff --git a/mysql-test/suite/rpl/t/rpl_parallel_ignored_errors.test b/mysql-test/suite/rpl/t/rpl_parallel_ignored_errors.test index 90f09a76546..7a6a758a508 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel_ignored_errors.test +++ b/mysql-test/suite/rpl/t/rpl_parallel_ignored_errors.test @@ -1 +1,112 @@ ---source include/rpl_parallel_ignored_errors.inc +# ==== Purpose ==== +# +# Test verifies that, in parallel replication, transaction failure notification +# is propagated to all the workers. Workers should abort the execution of +# transaction event groups, whose event positions are higher than the failing +# transaction group. +# +# ==== Implementation ==== +# +# Steps: +# 0 - Create a table t1 on master which has a primary key. Enable parallel +# replication on slave with slave_parallel_mode='optimistic' and +# slave_parallel_threads=3. +# 1 - On slave start a transaction and execute a local INSERT statement +# which will insert value 32. This is done to block the INSERT coming +# from master. +# 2 - On master execute an INSERT statement with value 32, so that it is +# blocked on slave. +# 3 - On slave enable a debug sync point such that it holds the worker thread +# execution as soon as work is scheduled to it. +# 4 - INSERT value 33 on master. It will be held on slave by other worker +# thread due to debug simulation. +# 5 - INSERT value 34 on master. +# 6 - On slave, enusre that INSERT 34 has reached a state where it waits for +# its prior transactions to commit. +# 7 - Commit the local INSERT 32 on slave server so that first worker will +# error out. +# 8 - Now send a continue signal to second worker processing 33. It should +# wakeup and propagate the error to INSERT 34. +# 9 - Upon slave stop due to error, check that no rows are found after the +# failed INSERT 32. +# +# ==== References ==== +# +# MDEV-20645: Replication consistency is broken as workers miss the error +# notification from an earlier failed group. +# + +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc +--source include/have_binlog_format_statement.inc +--source include/master-slave.inc + +--enable_connect_log +--connection server_2 +--source include/stop_slave.inc +SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; +SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode; +SET @old_debug= @@GLOBAL.debug_dbug; +SET GLOBAL slave_parallel_mode='optimistic'; +SET GLOBAL slave_parallel_threads= 3; +CHANGE MASTER TO master_use_gtid=slave_pos; +CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends"); +--source include/start_slave.inc + +--connection server_1 +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=InnoDB; +--source include/save_master_gtid.inc + +--connection server_2 +--source include/sync_with_master_gtid.inc + +--connect (con_temp2,127.0.0.1,root,,test,$SERVER_MYPORT_2,) +BEGIN; +INSERT INTO t1 VALUES (32); + +--connection server_1 +INSERT INTO t1 VALUES (32); + +--connection server_2 +--let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE info like "INSERT INTO t1 VALUES (32)" +--source include/wait_condition.inc +SET GLOBAL debug_dbug="+d,hold_worker_on_schedule"; +SET debug_sync="debug_sync_action SIGNAL reached_pause WAIT_FOR continue_worker"; + +--connection server_1 +SET gtid_seq_no=100; +INSERT INTO t1 VALUES (33); + +--connection server_2 +SET debug_sync='now WAIT_FOR reached_pause'; + +--connection server_1 +INSERT INTO t1 VALUES (34); + +--connection server_2 +--let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE state like "Waiting for prior transaction to commit" +--source include/wait_condition.inc +--connection con_temp2 +COMMIT; + +# Clean up. +--connection server_2 +--source include/stop_slave.inc +--let $assert_cond= COUNT(*) = 0 FROM t1 WHERE a>32 +--let $assert_text= table t1 should have zero rows where a>32 +--source include/assert.inc +SELECT * FROM t1 WHERE a>32; +DELETE FROM t1 WHERE a=32; + +SET GLOBAL slave_parallel_threads=@old_parallel_threads; +SET GLOBAL slave_parallel_mode=@old_parallel_mode; +SET GLOBAL debug_dbug=@old_debug; +SET DEBUG_SYNC= 'RESET'; +--source include/start_slave.inc + +--connection server_1 +DROP TABLE t1; +--disable_connect_log +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test b/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test index 8c8892d5370..cddc9286bd2 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test +++ b/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test @@ -1 +1,38 @@ ---source include/rpl_parallel_show_binlog_events_purge_logs.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +# BUG#13979418: SHOW BINLOG EVENTS MAY CRASH THE SERVER +# +# The function mysql_show_binlog_events has a local stack variable +# 'LOG_INFO linfo;', which is assigned to thd->current_linfo, however +# this variable goes out of scope and is destroyed before clean +# thd->current_linfo. +# +# This test case runs SHOW BINLOG EVENTS and FLUSH LOGS to make sure +# that with the fix local variable linfo is valid along all +# mysql_show_binlog_events function scope. +# +--source include/have_debug.inc +--source include/have_debug_sync.inc +--source include/master-slave.inc + +--connection slave +SET DEBUG_SYNC= 'after_show_binlog_events SIGNAL on_show_binlog_events WAIT_FOR end'; +--send SHOW BINLOG EVENTS + +--connection slave1 +SET DEBUG_SYNC= 'now WAIT_FOR on_show_binlog_events'; +FLUSH LOGS; +SET DEBUG_SYNC= 'now SIGNAL end'; + +--connection slave +--disable_result_log +--reap +--enable_result_log +SET DEBUG_SYNC= 'RESET'; + +--connection master +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_relayrotate.test b/mysql-test/suite/rpl/t/rpl_relayrotate.test index 720739e14c0..4de554d3143 100644 --- a/mysql-test/suite/rpl/t/rpl_relayrotate.test +++ b/mysql-test/suite/rpl/t/rpl_relayrotate.test @@ -1 +1,18 @@ ---source include/rpl_relayrotate.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +####################################################### +# Wrapper for rpl_relayrotate.test to allow multi # +# Engines to reuse test code. By JBM 2006-02-15 # +####################################################### +-- source include/have_innodb.inc +# Slow test, don't run during staging part +-- source include/not_staging.inc +-- source include/master-slave.inc + +let $engine_type=innodb; +-- source suite/rpl/include/rpl_relayrotate.test +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test index 5c17bcb2344..c3cd918b5fc 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test @@ -1 +1,525 @@ ---source include/rpl_semi_sync.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +source include/not_embedded.inc; +source include/have_innodb.inc; +source include/master-slave.inc; + +let $engine_type= InnoDB; + +# Suppress warnings that might be generated during the test +connection master; +call mtr.add_suppression("Timeout waiting for reply of binlog"); +call mtr.add_suppression("Read semi-sync reply"); +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); +call mtr.add_suppression("mysqld: Got an error reading communication packets"); +connection slave; +call mtr.add_suppression("Master server does not support semi-sync"); +call mtr.add_suppression("Semi-sync slave .* reply"); +call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); +connection master; + +# wait for dying connections (if any) to disappear +let $wait_condition= select count(*) = 0 from information_schema.processlist where command='killed'; +--source include/wait_condition.inc + +# After fix of BUG#45848, semi-sync slave should not create any extra +# connections on master, save the count of connections before start +# semi-sync slave for comparison below. +let $_connections_normal_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1); + +--echo # +--echo # Uninstall semi-sync plugins on master and slave +--echo # +connection slave; +source include/stop_slave.inc; +reset slave; +set global rpl_semi_sync_master_enabled= 0; +set global rpl_semi_sync_slave_enabled= 0; + +connection master; +reset master; +set global rpl_semi_sync_master_enabled= 0; +set global rpl_semi_sync_slave_enabled= 0; + +--echo # +--echo # Main test of semi-sync replication start here +--echo # + +connection master; + +set global rpl_semi_sync_master_timeout= 60000; # 60s + +echo [ default state of semi-sync on master should be OFF ]; +show variables like 'rpl_semi_sync_master_enabled'; + +echo [ enable semi-sync on master ]; +set global rpl_semi_sync_master_enabled = 1; +show variables like 'rpl_semi_sync_master_enabled'; + +echo [ status of semi-sync on master should be ON even without any semi-sync slaves ]; +show status like 'Rpl_semi_sync_master_clients'; +show status like 'Rpl_semi_sync_master_status'; +show status like 'Rpl_semi_sync_master_yes_tx'; + +--echo # +--echo # BUG#45672 Semisync repl: ActiveTranx:insert_tranx_node: transaction node allocation failed +--echo # BUG#45673 Semisynch reports correct operation even if no slave is connected +--echo # + +# BUG#45672 When semi-sync is enabled on master, it would allocate +# transaction node even without semi-sync slave connected, and would +# finally result in transaction node allocation error. +# +# Semi-sync master will pre-allocate 'max_connections' transaction +# nodes, so here we do more than that much transactions to check if it +# will fail or not. +# select @@global.max_connections + 1; +let $i= `select @@global.max_connections + 1`; +disable_query_log; +eval create table t1 (a int) engine=$engine_type; +while ($i) +{ + eval insert into t1 values ($i); + dec $i; +} +drop table t1; +enable_query_log; + +# BUG#45673 +echo [ status of semi-sync on master should be OFF ]; +show status like 'Rpl_semi_sync_master_clients'; +show status like 'Rpl_semi_sync_master_status'; +show status like 'Rpl_semi_sync_master_yes_tx'; + +# reset master to make sure the following test will start with a clean environment +reset master; + +connection slave; + +echo [ default state of semi-sync on slave should be OFF ]; +show variables like 'rpl_semi_sync_slave_enabled'; + +echo [ enable semi-sync on slave ]; +set global rpl_semi_sync_slave_enabled = 1; +show variables like 'rpl_semi_sync_slave_enabled'; +source include/start_slave.inc; + +connection master; + +# NOTE: Rpl_semi_sync_master_client will only be updated when +# semi-sync slave has started binlog dump request +let $status_var= Rpl_semi_sync_master_clients; +let $status_var_value= 1; +source include/wait_for_status_var.inc; + +echo [ initial master state after the semi-sync slave connected ]; +show status like 'Rpl_semi_sync_master_clients'; +show status like 'Rpl_semi_sync_master_status'; +show status like 'Rpl_semi_sync_master_no_tx'; +show status like 'Rpl_semi_sync_master_yes_tx'; + +replace_result $engine_type ENGINE_TYPE; +eval create table t1(a int) engine = $engine_type; + +echo [ master state after CREATE TABLE statement ]; +show status like 'Rpl_semi_sync_master_status'; +show status like 'Rpl_semi_sync_master_no_tx'; +show status like 'Rpl_semi_sync_master_yes_tx'; + +# After fix of BUG#45848, semi-sync slave should not create any extra +# connections on master. +let $_connections_semisync_slave= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1); +replace_result $_connections_normal_slave CONNECTIONS_NORMAL_SLAVE $_connections_semisync_slave CONNECTIONS_SEMISYNC_SLAVE; +eval select $_connections_semisync_slave - $_connections_normal_slave as 'Should be 0'; + +echo [ insert records to table ]; +insert t1 values (10); +insert t1 values (9); +insert t1 values (8); +insert t1 values (7); +insert t1 values (6); +insert t1 values (5); +insert t1 values (4); +insert t1 values (3); +insert t1 values (2); +insert t1 values (1); + +echo [ master status after inserts ]; +show status like 'Rpl_semi_sync_master_status'; +show status like 'Rpl_semi_sync_master_no_tx'; +show status like 'Rpl_semi_sync_master_yes_tx'; + +sync_slave_with_master; + +echo [ slave status after replicated inserts ]; +show status like 'Rpl_semi_sync_slave_status'; + +select count(distinct a) from t1; +select min(a) from t1; +select max(a) from t1; + +--echo +--echo # BUG#50157 +--echo # semi-sync replication crashes when replicating a transaction which +--echo # include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ; + +connection master; +SET SESSION AUTOCOMMIT= 0; +CREATE TABLE t2(c1 INT) ENGINE=innodb; +sync_slave_with_master; + +connection master; +BEGIN; +--echo +--echo # Even though it is in a transaction, this statement is binlogged into binlog +--echo # file immediately. +--disable_warnings +CREATE TEMPORARY TABLE t3 SELECT c1 FROM t2 where 1=1; +--enable_warnings +--echo +--echo # These statements will not be binlogged until the transaction is committed +INSERT INTO t2 VALUES(11); +INSERT INTO t2 VALUES(22); +COMMIT; + +DROP TABLE t2, t3; +SET SESSION AUTOCOMMIT= 1; +sync_slave_with_master; + + +--echo # +--echo # Test semi-sync master will switch OFF after one transaction +--echo # timeout waiting for slave reply. +--echo # +connection slave; +source include/stop_slave.inc; + +connection master; +--source include/kill_binlog_dump_threads.inc +set global rpl_semi_sync_master_timeout= 5000; + +# The first semi-sync check should be on because after slave stop, +# there are no transactions on the master. +echo [ master status should be ON ]; + +let $status_var= Rpl_semi_sync_master_status; +let $status_var_value= ON; +source include/wait_for_status_var.inc; + +let $status_var= Rpl_semi_sync_master_clients; +let $status_var_value= 0; +source include/wait_for_status_var.inc; + +show status like 'Rpl_semi_sync_master_no_tx'; +show status like 'Rpl_semi_sync_master_yes_tx'; + +echo [ semi-sync replication of these transactions will fail ]; +insert into t1 values (500); + +# Wait for the semi-sync replication of this transaction to timeout +let $status_var= Rpl_semi_sync_master_status; +let $status_var_value= OFF; +source include/wait_for_status_var.inc; + +# The second semi-sync check should be off because one transaction +# times out during waiting. +echo [ master status should be OFF ]; +show status like 'Rpl_semi_sync_master_status'; +show status like 'Rpl_semi_sync_master_no_tx'; +show status like 'Rpl_semi_sync_master_yes_tx'; + +# Semi-sync status on master is now OFF, so all these transactions +# will be replicated asynchronously. +delete from t1 where a=10; +delete from t1 where a=9; +delete from t1 where a=8; +delete from t1 where a=7; +delete from t1 where a=6; +delete from t1 where a=5; +delete from t1 where a=4; +delete from t1 where a=3; +delete from t1 where a=2; +delete from t1 where a=1; + +insert into t1 values (100); + +echo [ master status should be OFF ]; +show status like 'Rpl_semi_sync_master_status'; +show status like 'Rpl_semi_sync_master_no_tx'; +show status like 'Rpl_semi_sync_master_yes_tx'; + +--echo # +--echo # Test semi-sync status on master will be ON again when slave catches up +--echo # + +# Save the master position for later use. +save_master_pos; + +connection slave; + +echo [ slave status should be OFF ]; +show status like 'Rpl_semi_sync_slave_status'; +source include/start_slave.inc; +sync_with_master; + +echo [ slave status should be ON ]; +show status like 'Rpl_semi_sync_slave_status'; + +select count(distinct a) from t1; +select min(a) from t1; +select max(a) from t1; + +connection master; + +# The master semi-sync status should be on again after slave catches up. +echo [ master status should be ON again after slave catches up ]; + +let $status_var= Rpl_semi_sync_master_status; +let $status_var_value= ON; +source include/wait_for_status_var.inc; +show status like 'Rpl_semi_sync_master_no_tx'; +show status like 'Rpl_semi_sync_master_yes_tx'; +show status like 'Rpl_semi_sync_master_clients'; + +--echo # +--echo # Test disable/enable master semi-sync on the fly. +--echo # + +drop table t1; +sync_slave_with_master; + +source include/stop_slave.inc; + +--echo # +--echo # Flush status +--echo # +connection master; +echo [ Semi-sync master status variables before FLUSH STATUS ]; +SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx'; +SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx'; +# Do not write the FLUSH STATUS to binlog, to make sure we'll get a +# clean status after this. +FLUSH NO_WRITE_TO_BINLOG STATUS; +echo [ Semi-sync master status variables after FLUSH STATUS ]; +SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx'; +SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx'; + +connection master; + +source include/show_master_logs.inc; +show variables like 'rpl_semi_sync_master_enabled'; + +echo [ disable semi-sync on the fly ]; +set global rpl_semi_sync_master_enabled=0; +show variables like 'rpl_semi_sync_master_enabled'; +show status like 'Rpl_semi_sync_master_status'; + +echo [ enable semi-sync on the fly ]; +set global rpl_semi_sync_master_enabled=1; +show variables like 'rpl_semi_sync_master_enabled'; +show status like 'Rpl_semi_sync_master_status'; + +--echo # +--echo # Test RESET MASTER/SLAVE +--echo # + +connection slave; + +source include/start_slave.inc; + +connection master; + +replace_result $engine_type ENGINE_TYPE; +eval create table t1 (a int) engine = $engine_type; +drop table t1; + +sync_slave_with_master; + +echo [ test reset master ]; +connection master; + +reset master; + +show status like 'Rpl_semi_sync_master_status'; +show status like 'Rpl_semi_sync_master_no_tx'; +show status like 'Rpl_semi_sync_master_yes_tx'; + +connection slave; + +source include/stop_slave.inc; +reset slave; + +# Kill the dump thread on master for previous slave connection and +--source include/kill_binlog_dump_threads.inc + +connection slave; +source include/start_slave.inc; + +connection master; + +# Wait for dump thread to start, Rpl_semi_sync_master_clients will be +# 1 after dump thread started. +let $status_var= Rpl_semi_sync_master_clients; +let $status_var_value= 1; +source include/wait_for_status_var.inc; + +replace_result $engine_type ENGINE_TYPE; +eval create table t1 (a int) engine = $engine_type; +insert into t1 values (1); +insert into t1 values (2), (3); + +sync_slave_with_master; + +select * from t1; + +connection master; + +echo [ master semi-sync status should be ON ]; +show status like 'Rpl_semi_sync_master_status'; +show status like 'Rpl_semi_sync_master_no_tx'; +show status like 'Rpl_semi_sync_master_yes_tx'; + +--echo # +--echo # Start semi-sync replication without SUPER privilege +--echo # +connection slave; +source include/stop_slave.inc; +reset slave; +connection master; +reset master; + +# Kill the dump thread on master for previous slave connection and wait for it to exit +--source include/kill_binlog_dump_threads.inc + +# Do not binlog the following statement because it will generate +# different events for ROW and STATEMENT format +set sql_log_bin=0; +grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password'; +flush privileges; +set sql_log_bin=1; +connection slave; +grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password'; +flush privileges; +change master to master_user='rpl',master_password='rpl_password'; +source include/start_slave.inc; +show status like 'Rpl_semi_sync_slave_status'; +connection master; + +# Wait for the semi-sync binlog dump thread to start +let $status_var= Rpl_semi_sync_master_clients; +let $status_var_value= 1; +source include/wait_for_status_var.inc; +echo [ master semi-sync should be ON ]; +show status like 'Rpl_semi_sync_master_clients'; +show status like 'Rpl_semi_sync_master_status'; +show status like 'Rpl_semi_sync_master_no_tx'; +show status like 'Rpl_semi_sync_master_yes_tx'; +insert into t1 values (4); +insert into t1 values (5); +echo [ master semi-sync should be ON ]; +show status like 'Rpl_semi_sync_master_clients'; +show status like 'Rpl_semi_sync_master_status'; +show status like 'Rpl_semi_sync_master_no_tx'; +show status like 'Rpl_semi_sync_master_yes_tx'; + +--echo # +--echo # Test semi-sync slave connect to non-semi-sync master +--echo # + +# Disable semi-sync on master +connection slave; +source include/stop_slave.inc; +SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; + +connection master; + +# Kill the dump thread on master for previous slave connection and wait for it to exit +--source include/kill_binlog_dump_threads.inc + +echo [ Semi-sync status on master should be ON ]; +let $status_var= Rpl_semi_sync_master_clients; +let $status_var_value= 0; +source include/wait_for_status_var.inc; +show status like 'Rpl_semi_sync_master_status'; +let $status_var= Rpl_semi_sync_master_status; +let $status_var_value= ON; +source include/wait_for_status_var.inc; +set global rpl_semi_sync_master_enabled= 0; + +connection slave; +SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled'; +source include/start_slave.inc; +connection master; +insert into t1 values (8); +let $status_var= Rpl_semi_sync_master_clients; +let $status_var_value= 1; +source include/wait_for_status_var.inc; +echo [ master semi-sync clients should be 1, status should be OFF ]; +show status like 'Rpl_semi_sync_master_clients'; +show status like 'Rpl_semi_sync_master_status'; +sync_slave_with_master; +show status like 'Rpl_semi_sync_slave_status'; + +# Uninstall semi-sync plugin on master +connection slave; +source include/stop_slave.inc; +connection master; +set global rpl_semi_sync_master_enabled= 0; + +connection slave; +SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled'; +source include/start_slave.inc; + +connection master; +insert into t1 values (10); +sync_slave_with_master; + +--echo # +--echo # Test non-semi-sync slave connect to semi-sync master +--echo # + +connection master; +set global rpl_semi_sync_master_timeout= 5000; # 5s +set global rpl_semi_sync_master_enabled= 1; + +connection slave; +source include/stop_slave.inc; +SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; + +echo [ uninstall semi-sync slave plugin ]; +set global rpl_semi_sync_slave_enabled= 0; + +echo [ reinstall semi-sync slave plugin and disable semi-sync ]; +SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled'; +SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; +source include/start_slave.inc; +SHOW STATUS LIKE 'Rpl_semi_sync_slave_status'; + +--echo # +--echo # Clean up +--echo # + +connection slave; +source include/stop_slave.inc; +set global rpl_semi_sync_slave_enabled= 0; + +connection master; +set global rpl_semi_sync_master_enabled= 0; + +connection slave; +change master to master_user='root',master_password=''; +source include/start_slave.inc; + +connection master; +drop table t1; +sync_slave_with_master; + +connection master; +drop user rpl@127.0.0.1; +flush privileges; +set global rpl_semi_sync_master_timeout= default; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_skip_replication.test b/mysql-test/suite/rpl/t/rpl_skip_replication.test index 66fdbb8915a..97fc961d438 100644 --- a/mysql-test/suite/rpl/t/rpl_skip_replication.test +++ b/mysql-test/suite/rpl/t/rpl_skip_replication.test @@ -1 +1,402 @@ ---source include/rpl_skip_replication.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it. +# +# Usage: +# +# --let $use_remote_mysqlbinlog= 1 # optional +# --source suite/rpl/include/rpl_skip_replication.inc +# +# The script uses MYSQLBINLOG to verify certain results. +# By default, it uses binary logs directly. If it is undesirable, +# this behavior can be overridden by setting $use_remote_binlog +# as shown above. +# The value will be unset after every execution of the script, +# so if it is needed, it should be set explicitly before each call. +# + +--source include/have_innodb.inc +--source include/master-slave.inc + +connection slave; +# Test that SUPER is required to change @@replicate_events_marked_for_skip. +CREATE USER 'nonsuperuser'@'127.0.0.1'; +GRANT ALTER,CREATE,DELETE,DROP,EVENT,INSERT,PROCESS,REPLICATION SLAVE, + SELECT,UPDATE ON *.* TO 'nonsuperuser'@'127.0.0.1'; +connect(nonpriv, 127.0.0.1, nonsuperuser,, test, $SLAVE_MYPORT,); +connection nonpriv; +--error ER_SPECIFIC_ACCESS_DENIED_ERROR +SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER; +disconnect nonpriv; +connection slave; +DROP USER'nonsuperuser'@'127.0.0.1'; + +SELECT @@global.replicate_events_marked_for_skip; +--error ER_SLAVE_MUST_STOP +SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE; +SELECT @@global.replicate_events_marked_for_skip; +STOP SLAVE; +--error ER_GLOBAL_VARIABLE +SET SESSION replicate_events_marked_for_skip=FILTER_ON_MASTER; +SELECT @@global.replicate_events_marked_for_skip; +SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER; +SELECT @@global.replicate_events_marked_for_skip; +START SLAVE; + +connection master; +SELECT @@skip_replication; +--error ER_LOCAL_VARIABLE +SET GLOBAL skip_replication=1; +SELECT @@skip_replication; + +CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=myisam; +CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=innodb; +INSERT INTO t1(a) VALUES (1); +INSERT INTO t2(a) VALUES (1); + + +# Test that master-side filtering works. +SET skip_replication=1; + +CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam; +INSERT INTO t1(a) VALUES (2); +INSERT INTO t2(a) VALUES (2); + +# Inject a rotate event in the binlog stream sent to slave (otherwise we will +# fail sync_slave_with_master as the last event on the master is not present +# on the slave). +FLUSH NO_WRITE_TO_BINLOG LOGS; + +sync_slave_with_master; +connection slave; +SHOW TABLES; +SELECT * FROM t1; +SELECT * FROM t2; + +connection master; +DROP TABLE t3; + +FLUSH NO_WRITE_TO_BINLOG LOGS; +sync_slave_with_master; + + +# Test that slave-side filtering works. +connection slave; +STOP SLAVE; +SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE; +START SLAVE; + +connection master; +SET skip_replication=1; +CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam; +INSERT INTO t1(a) VALUES (3); +INSERT INTO t2(a) VALUES (3); + +# Inject a rotate event in the binlog stream sent to slave (otherwise we will +# fail sync_slave_with_master as the last event on the master is not present +# on the slave). +FLUSH NO_WRITE_TO_BINLOG LOGS; + +sync_slave_with_master; +connection slave; +SHOW TABLES; +SELECT * FROM t1; +SELECT * FROM t2; + +connection master; +DROP TABLE t3; + +FLUSH NO_WRITE_TO_BINLOG LOGS; +sync_slave_with_master; +connection slave; +STOP SLAVE; +SET GLOBAL replicate_events_marked_for_skip=REPLICATE; +START SLAVE; + + +# Test that events with @@skip_replication=1 are not filtered when filtering is +# not set on slave. +connection master; +SET skip_replication=1; +CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam; +INSERT INTO t3(a) VALUES(2); +sync_slave_with_master; +connection slave; +SELECT * FROM t3; +connection master; +DROP TABLE t3; + +# +# Test that the slave will preserve the @@skip_replication flag in its +# own binlog. +# + +TRUNCATE t1; +sync_slave_with_master; +connection slave; +RESET MASTER; + +connection master; +SET skip_replication=0; +INSERT INTO t1 VALUES (1,0); +SET skip_replication=1; +INSERT INTO t1 VALUES (2,0); +SET skip_replication=0; +INSERT INTO t1 VALUES (3,0); + +sync_slave_with_master; +connection slave; +# Since slave has @@replicate_events_marked_for_skip=REPLICATE, it should have +# applied all events. +SELECT * FROM t1 ORDER by a; + +STOP SLAVE; +SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER; +let $SLAVE_DATADIR= `select @@datadir`; + +connection master; +TRUNCATE t1; + +# Now apply the slave binlog to the master, to check that both the slave +# and mysqlbinlog will preserve the @@skip_replication flag. + +--let $mysqlbinlog_args= $SLAVE_DATADIR/slave-bin.000001 +if ($use_remote_mysqlbinlog) +{ + --let $mysqlbinlog_args= --read-from-remote-server --protocol=tcp --host=127.0.0.1 --port=$SLAVE_MYPORT -uroot slave-bin.000001 + --let $use_remote_mysqlbinlog= 0 +} +--exec $MYSQL_BINLOG $mysqlbinlog_args > $MYSQLTEST_VARDIR/tmp/rpl_skip_replication.binlog +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/rpl_skip_replication.binlog + +# The master should have all three events. +SELECT * FROM t1 ORDER by a; + +# The slave should be missing event 2, which is marked with the +# @@skip_replication flag. + +connection slave; +START SLAVE; + +connection master; +sync_slave_with_master; + +connection slave; +SELECT * FROM t1 ORDER by a; + +# +# Test that @@sql_slave_skip_counter does not count skipped @@skip_replication +# events. +# + +connection master; +TRUNCATE t1; + +sync_slave_with_master; +connection slave; +STOP SLAVE; +# We will skip two INSERTs (in addition to any skipped due to +# @@skip_replication). Since from 5.5 every statement is wrapped in +# BEGIN ... END, we need to skip 6 events for this. +SET GLOBAL sql_slave_skip_counter=6; +SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE; +START SLAVE; + +connection master; +# Need to fix @@binlog_format to get consistent event count. +SET @old_binlog_format= @@binlog_format; +SET binlog_format= statement; +SET skip_replication=0; +INSERT INTO t1 VALUES (1,5); +SET skip_replication=1; +INSERT INTO t1 VALUES (2,5); +SET skip_replication=0; +INSERT INTO t1 VALUES (3,5); +INSERT INTO t1 VALUES (4,5); +SET binlog_format= @old_binlog_format; + +sync_slave_with_master; +connection slave; + +# The slave should have skipped the first three inserts (number 1 and 3 due +# to @@sql_slave_skip_counter=2, number 2 due to +# @@replicate_events_marked_for_skip=FILTER_ON_SLAVE). So only number 4 +# should be left. +SELECT * FROM t1; + + +# +# Check that BINLOG statement preserves the @@skip_replication flag. +# +connection slave; +# Need row @@binlog_format for BINLOG statements containing row events. +--source include/stop_slave.inc +SET @old_slave_binlog_format= @@global.binlog_format; +SET GLOBAL binlog_format= row; +--source include/start_slave.inc + +connection master; +TRUNCATE t1; + +SET @old_binlog_format= @@binlog_format; +SET binlog_format= row; +# Format description log event. +BINLOG 'wlZOTw8BAAAA8QAAAPUAAAAAAAQANS41LjIxLU1hcmlhREItZGVidWctbG9nAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAA2QAEGggAAAAICAgCAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAA371saA=='; +# INSERT INTO t1 VALUES (1,8) # with @@skip_replication=1 +BINLOG 'wlZOTxMBAAAAKgAAAGMBAAAAgCkAAAAAAAEABHRlc3QAAnQxAAIDAwAC +wlZOTxcBAAAAJgAAAIkBAAAAgCkAAAAAAAEAAv/8AQAAAAgAAAA='; +# INSERT INTO t1 VALUES (2,8) # with @@skip_replication=0 +BINLOG 'wlZOTxMBAAAAKgAAADwCAAAAACkAAAAAAAEABHRlc3QAAnQxAAIDAwAC +wlZOTxcBAAAAJgAAAGICAAAAACkAAAAAAAEAAv/8AgAAAAgAAAA='; +SET binlog_format= @old_binlog_format; + +SELECT * FROM t1 ORDER BY a; +sync_slave_with_master; +connection slave; +# Slave should have only the second insert, the first should be ignored due to +# the @@skip_replication flag. +SELECT * FROM t1 ORDER by a; + +--source include/stop_slave.inc +SET GLOBAL binlog_format= @old_slave_binlog_format; +--source include/start_slave.inc + + +# Test that it is not possible to change @@skip_replication inside a +# transaction or statement, thereby replicating only parts of statements +# or transactions. +connection master; +SET skip_replication=0; + +BEGIN; +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION +SET skip_replication=0; +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION +SET skip_replication=1; +ROLLBACK; +SET skip_replication=1; +BEGIN; +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION +SET skip_replication=0; +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION +SET skip_replication=1; +COMMIT; +SET autocommit=0; +INSERT INTO t2(a) VALUES(100); +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION +SET skip_replication=1; +ROLLBACK; +SET autocommit=1; + +SET skip_replication=1; +--delimiter | +CREATE FUNCTION foo (x INT) RETURNS INT BEGIN SET SESSION skip_replication=x; RETURN x; END| +CREATE PROCEDURE bar(x INT) BEGIN SET SESSION skip_replication=x; END| +CREATE FUNCTION baz (x INT) RETURNS INT BEGIN CALL bar(x); RETURN x; END| +--delimiter ; +--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION +SELECT foo(0); +--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION +SELECT baz(0); +--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION +SET @a= foo(1); +--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION +SET @a= baz(1); +--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION +UPDATE t2 SET b=foo(0); +--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION +UPDATE t2 SET b=baz(0); +--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION +INSERT INTO t1 VALUES (101, foo(1)); +--error ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION +INSERT INTO t1 VALUES (101, baz(0)); +SELECT @@skip_replication; +CALL bar(0); +SELECT @@skip_replication; +CALL bar(1); +SELECT @@skip_replication; +DROP FUNCTION foo; +DROP PROCEDURE bar; +DROP FUNCTION baz; + + +# Test that master-side filtering happens on the master side, and that +# slave-side filtering happens on the slave. + +# First test that events do not reach the slave when master-side filtering +# is configured. Do this by replicating first with only the IO thread running +# and master-side filtering; then change to no filtering and start the SQL +# thread. This should still skip the events, as master-side filtering +# means the events never reached the slave. +connection master; +SET skip_replication= 0; +TRUNCATE t1; +sync_slave_with_master; +connection slave; +STOP SLAVE; +SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER; +START SLAVE IO_THREAD; +connection master; +SET skip_replication= 1; +INSERT INTO t1(a) VALUES (1); +SET skip_replication= 0; +INSERT INTO t1(a) VALUES (2); +--source include/save_master_pos.inc +connection slave; +--source include/sync_io_with_master.inc +STOP SLAVE IO_THREAD; +SET GLOBAL replicate_events_marked_for_skip=REPLICATE; +START SLAVE; +connection master; +sync_slave_with_master; +connection slave; +# Now only the second insert of (2) should be visible, as the first was +# filtered on the master, so even though the SQL thread ran without skipping +# events, it will never see the event in the first place. +SELECT * FROM t1; + +# Now tests that when slave-side filtering is configured, events _do_ reach +# the slave. +connection master; +SET skip_replication= 0; +TRUNCATE t1; +sync_slave_with_master; +connection slave; +STOP SLAVE; +SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE; +START SLAVE IO_THREAD; +connection master; +SET skip_replication= 1; +INSERT INTO t1(a) VALUES (1); +SET skip_replication= 0; +INSERT INTO t1(a) VALUES (2); +--source include/save_master_pos.inc +connection slave; +--source include/sync_io_with_master.inc +STOP SLAVE IO_THREAD; +SET GLOBAL replicate_events_marked_for_skip=REPLICATE; +START SLAVE; +connection master; +sync_slave_with_master; +connection slave; +# Now both inserts should be visible. Since filtering was configured to be +# slave-side, the event is in the relay log, and when the SQL thread ran we +# had disabled filtering again. +SELECT * FROM t1 ORDER BY a; + + +# Clean up. +connection master; +SET skip_replication=0; +DROP TABLE t1,t2; +connection slave; +STOP SLAVE; +SET GLOBAL replicate_events_marked_for_skip=REPLICATE; +START SLAVE; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_special_charset.test b/mysql-test/suite/rpl/t/rpl_special_charset.test index fa19a17b1e4..641aa483d32 100644 --- a/mysql-test/suite/rpl/t/rpl_special_charset.test +++ b/mysql-test/suite/rpl/t/rpl_special_charset.test @@ -1 +1,32 @@ ---source include/rpl_special_charset.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +################################################################################ +# Bug#19855907 IO THREAD AUTHENTICATION ISSUE WITH SOME CHARACTER SETS +# Problem: IO thread fails to connect to master if servers are configured with +# special character sets like utf16, utf32, ucs2. +# +# Analysis: MySQL server does not support few special character sets like +# utf16,utf32 and ucs2 as "client's character set"(eg: utf16,utf32, ucs2). +# When IO thread is trying to connect to Master, it sets server's character +# set as client's character set. When Slave server is started with these +# special character sets, IO thread (a connection to Master) fails because +# of the above said reason. +# +# Fix: If server's character set is not supported as client's character set, +# then set default's client character set(latin1) as client's character set. +############################################################################### +--source include/master-slave.inc +call mtr.add_suppression("'utf16' can not be used as client character set"); +CREATE TABLE t1(i VARCHAR(20)); +INSERT INTO t1 VALUES (0xFFFF); +--sync_slave_with_master +--let diff_tables=master:t1, slave:t1 +--source include/diff_tables.inc +# Cleanup +--connection master +DROP TABLE t1; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_sporadic_master.test b/mysql-test/suite/rpl/t/rpl_sporadic_master.test index 397756af396..ad4c44cbf74 100644 --- a/mysql-test/suite/rpl/t/rpl_sporadic_master.test +++ b/mysql-test/suite/rpl/t/rpl_sporadic_master.test @@ -1 +1,32 @@ ---source include/rpl_sporadic_master.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +# test to see if replication can continue when master sporadically fails on +# COM_BINLOG_DUMP and additionally limits the number of events per dump + +source include/master-slave.inc; + +create table t2(n int); +create table t1(n int not null auto_increment primary key); +insert into t1 values (NULL),(NULL); +truncate table t1; +# We have to use 4 in the following to make this test work with all table types +insert into t1 values (4),(NULL); +sync_slave_with_master; +--source include/stop_slave.inc +--source include/start_slave.inc +connection master; +insert into t1 values (NULL),(NULL); +flush logs; +truncate table t1; +insert into t1 values (10),(NULL),(NULL),(NULL),(NULL),(NULL); +sync_slave_with_master; +select * from t1 ORDER BY n; +connection master; +drop table t1,t2; +sync_slave_with_master; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test index c4a534b9294..59a2af9f137 100644 --- a/mysql-test/suite/rpl/t/rpl_ssl.test +++ b/mysql-test/suite/rpl/t/rpl_ssl.test @@ -1 +1,116 @@ ---source include/rpl_ssl.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +source include/have_ssl_communication.inc; +source include/master-slave.inc; +source include/no_valgrind_without_big.inc; + +# create a user for replication that requires ssl encryption +connection master; +create user replssl@localhost; +grant replication slave on *.* to replssl@localhost require ssl; +create table t1 (t int auto_increment, KEY(t)); + +sync_slave_with_master; + +# Set slave to use SSL for connection to master +stop slave; +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +eval change master to + master_user='replssl', + master_password='', + master_ssl=1, + master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem', + master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem', + master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem'; +start slave; + +# Switch to master and insert one record, then sync it to slave +connection master; +insert into t1 values(1); +sync_slave_with_master; + +# The record should now be on slave +select * from t1; + +# The slave is synced and waiting/reading from master +# SHOW SLAVE STATUS will show "Waiting for master to send event" +let $status_items= Master_SSL_Allowed, Master_SSL_CA_Path, Master_SSL_CA_File, Master_SSL_Crl, Master_SSL_Crlpath, Master_SSL_Cert, Master_SSL_Key; +source include/show_slave_status.inc; +source include/check_slave_is_running.inc; + +# Stop the slave, as reported in bug#21871 it would hang +STOP SLAVE; + +select * from t1; + +# Do the same thing a number of times +disable_query_log; +disable_result_log; +# 2007-11-27 mats Bug #32756 Starting and stopping the slave in a loop can lose rows +# After discussions with Engineering, I'm disabling this part of the test to avoid it causing +# red trees. +disable_parsing; +let $i= 100; +while ($i) +{ + start slave; + connection master; + insert into t1 values (NULL); + select * from t1; # Some variance + connection slave; + select * from t1; # Some variance + stop slave; + dec $i; +} +enable_parsing; +START SLAVE; +enable_query_log; +enable_result_log; +connection master; +# INSERT one more record to make sure +# the sync has something to do +insert into t1 values (NULL); +let $master_count= `select count(*) from t1`; + +sync_slave_with_master; +--source include/wait_for_slave_to_start.inc +source include/show_slave_status.inc; +source include/check_slave_is_running.inc; + +let $slave_count= `select count(*) from t1`; + +if ($slave_count != $master_count) +{ + echo master and slave differed in number of rows; + echo master: $master_count; + echo slave: $slave_count; + + connection master; + select count(*) t1; + select * from t1; + connection slave; + select count(*) t1; + select * from t1; + query_vertical show slave status; +} + +connection master; +drop user replssl@localhost; +drop table t1; +sync_slave_with_master; + +--source include/stop_slave.inc +CHANGE MASTER TO + master_user = 'root', + master_ssl = 0, + master_ssl_ca = '', + master_ssl_cert = '', + master_ssl_key = ''; + +--echo End of 5.0 tests +--let $rpl_only_running_threads= 1 +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test b/mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test index b4e53358712..41339f539f8 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test +++ b/mysql-test/suite/rpl/t/rpl_stm_relay_ign_space.test @@ -1 +1,107 @@ ---source include/rpl_stm_relay_ign_space.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +# +# BUG#12400313 / BUG#64503 test case +# +# +# Description +# ----------- +# +# This test case starts the slave server with: +# --relay-log-space-limit=8192 --relay-log-purge --max-relay-log-size=4096 +# +# Then it issues some queries that will cause the slave to reach +# relay-log-space-limit. We lock the table so that the SQL thread is +# not able to purge the log and then we issue some more statements. +# +# The purpose is to show that the IO thread will honor the limits +# while the SQL thread is not able to purge the relay logs, which did +# not happen before this patch. In addition we assert that while +# ignoring the limit (SQL thread needs to rotate before purging), the +# IO thread does not do it in an uncontrolled manner. + +--source include/have_binlog_format_statement.inc +--source include/have_innodb.inc +--source include/master-slave.inc + +--disable_query_log +CREATE TABLE t1 (c1 TEXT) engine=InnoDB; + +INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); +INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); +INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); +INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); + +--sync_slave_with_master + +# wait for the SQL thread to sleep +--let $show_statement= SHOW PROCESSLIST +--let $field= State +--let $condition= = 'Slave has read all relay log; waiting for the slave I/O thread to update it' +--source include/wait_show_condition.inc + +# now the io thread has set rli->ignore_space_limit +# lets lock the table so that once the SQL thread awakes +# it blocks there and does not set rli->ignore_space_limit +# back to zero +LOCK TABLE t1 WRITE; + +# now issue more statements that will overflow the +# rli->log_space_limit (in this case ~10K) +--connection master + +INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); +INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); +INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); +INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); +INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); +INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); +INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); +INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); +INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); +INSERT INTO t1 VALUES ('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); + +--connection slave + +# ASSERT that the IO thread waits for the SQL thread to release some +# space before continuing +--let $show_statement= SHOW PROCESSLIST +--let $field= State +--let $condition= LIKE 'Waiting for %' +# before the patch (IO would have transfered everything) +#--let $condition= = 'Waiting for master to send event' +# after the patch (now it waits for space to be freed) +#--let $condition= = 'Waiting for the slave SQL thread to free enough relay log space' +--source include/wait_show_condition.inc + +# without the patch we can uncomment the following two lines and +# watch the IO thread synchronize with the master, thus writing +# relay logs way over the space limit +#--connection master +#--source include/sync_slave_io_with_master.inc + +## ASSERT that the IO thread has honored the limit+few bytes required to be able to purge +--let $relay_log_space_while_sql_is_executing = query_get_value(SHOW SLAVE STATUS, Relay_Log_Space, 1) +--let $relay_log_space_limit = query_get_value(SHOW VARIABLES LIKE "relay_log_space_limit", Value, 1) +--let $assert_text= Assert that relay log space is close to the limit +--let $assert_cond= $relay_log_space_while_sql_is_executing <= $relay_log_space_limit * 1.15 +--source include/assert.inc + +# unlock the table and let SQL thread continue applying events +UNLOCK TABLES; + +--connection master +--sync_slave_with_master +--let $diff_tables=master:test.t1,slave:test.t1 +--source include/diff_tables.inc + +--connection master +DROP TABLE t1; +--enable_query_log +--sync_slave_with_master + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test index 2625508515b..31b80732c60 100644 --- a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test +++ b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test @@ -1 +1,633 @@ ---source include/rpl_switch_stm_row_mixed.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +# +# rpl_switch_stm_row_mixed tests covers +# +# - Master is switching explicitly between STATEMENT, ROW, and MIXED +# binlog format showing when it is possible and when not. +# - Master switching from MIXED to RBR implicitly listing all use +# cases, e.g a query invokes UUID(), thereafter to serve as the +# definition of MIXED binlog format +# - correctness of execution + + +-- source include/have_binlog_format_mixed_or_row.inc +-- source include/master-slave.inc + +# Since this test generates row-based events in the binary log, the +# slave SQL thread cannot be in STATEMENT mode to execute this test, +# so we only execute it for MIXED and ROW as default value of +# BINLOG_FORMAT. + +connection slave; + +connection master; +--disable_warnings +drop database if exists mysqltest1; +create database mysqltest1; +--enable_warnings +use mysqltest1; + +# Save binlog format +set @my_binlog_format= @@global.binlog_format; + +# play with switching +set session binlog_format=mixed; +show session variables like "binlog_format%"; +set session binlog_format=statement; +show session variables like "binlog_format%"; +set session binlog_format=row; +show session variables like "binlog_format%"; + +set global binlog_format=DEFAULT; +show global variables like "binlog_format%"; +set global binlog_format=MIXED; +show global variables like "binlog_format%"; +set global binlog_format=STATEMENT; +show global variables like "binlog_format%"; +set global binlog_format=ROW; +show global variables like "binlog_format%"; +show session variables like "binlog_format%"; +select @@global.binlog_format, @@session.binlog_format; + +CREATE TABLE t1 (a varchar(100)); + +prepare stmt1 from 'insert into t1 select concat(UUID(),?)'; +set @string="emergency_1_"; +insert into t1 values("work_2_"); +execute stmt1 using @string; +deallocate prepare stmt1; + +prepare stmt1 from 'insert into t1 select ?'; +insert into t1 values(concat(UUID(),"work_3_")); +execute stmt1 using @string; +deallocate prepare stmt1; + +insert into t1 values(concat("for_4_",UUID())); +insert into t1 select "yesterday_5_"; + +# verify that temp tables prevent a switch to SBR +create temporary table tmp(a char(100)); +insert into tmp values("see_6_"); +--error ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR +set binlog_format=statement; +insert into t1 select * from tmp; +drop temporary table tmp; + +# Now we go to SBR +set binlog_format=statement; +show global variables like "binlog_format%"; +show session variables like "binlog_format%"; +select @@global.binlog_format, @@session.binlog_format; +set global binlog_format=statement; +show global variables like "binlog_format%"; +show session variables like "binlog_format%"; +select @@global.binlog_format, @@session.binlog_format; + +prepare stmt1 from 'insert into t1 select ?'; +set @string="emergency_7_"; +insert into t1 values("work_8_"); +execute stmt1 using @string; +deallocate prepare stmt1; + +prepare stmt1 from 'insert into t1 select ?'; +insert into t1 values("work_9_"); +execute stmt1 using @string; +deallocate prepare stmt1; + +insert into t1 values("for_10_"); +insert into t1 select "yesterday_11_"; + +# test statement (is not default after wl#3368) +set binlog_format=statement; +select @@global.binlog_format, @@session.binlog_format; +set global binlog_format=statement; +select @@global.binlog_format, @@session.binlog_format; + +prepare stmt1 from 'insert into t1 select ?'; +set @string="emergency_12_"; +insert into t1 values("work_13_"); +execute stmt1 using @string; +deallocate prepare stmt1; + +prepare stmt1 from 'insert into t1 select ?'; +insert into t1 values("work_14_"); +execute stmt1 using @string; +deallocate prepare stmt1; + +insert into t1 values("for_15_"); +insert into t1 select "yesterday_16_"; + +# and now the mixed mode + +set global binlog_format=mixed; +select @@global.binlog_format, @@session.binlog_format; +set binlog_format=default; +select @@global.binlog_format, @@session.binlog_format; + +prepare stmt1 from 'insert into t1 select concat(UUID(),?)'; +set @string="emergency_17_"; +insert into t1 values("work_18_"); +execute stmt1 using @string; +deallocate prepare stmt1; + +prepare stmt1 from 'insert into t1 select ?'; +insert into t1 values(concat(UUID(),"work_19_")); +execute stmt1 using @string; +deallocate prepare stmt1; + +insert into t1 values(concat("for_20_",UUID())); +insert into t1 select "yesterday_21_"; + +prepare stmt1 from 'insert into t1 select ?'; +insert into t1 values(concat(UUID(),"work_22_")); +execute stmt1 using @string; +deallocate prepare stmt1; + +insert into t1 values(concat("for_23_",UUID())); +insert into t1 select "yesterday_24_"; + +# Test of CREATE TABLE SELECT + +create table t2 ENGINE=MyISAM select rpad(UUID(),100,' '); +create table t3 select 1 union select UUID(); +--disable_warnings +SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR +create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3); +--enable_warnings +SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR +create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3); +# what if UUID() is first: +--disable_warnings +insert ignore into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4); +--enable_warnings + +# inside a stored procedure + +delimiter |; +create procedure foo() +begin +insert into t1 values("work_25_"); +insert into t1 values(concat("for_26_",UUID())); +insert into t1 select "yesterday_27_"; +end| +create procedure foo2() +begin +insert into t1 values(concat("emergency_28_",UUID())); +insert into t1 values("work_29_"); +insert into t1 values(concat("for_30_",UUID())); +set session binlog_format=row; # accepted for stored procs +insert into t1 values("more work_31_"); +set session binlog_format=mixed; +end| +create function foo3() returns bigint unsigned +begin + set session binlog_format=row; # rejected for stored funcs + insert into t1 values("alarm"); + return 100; +end| +create procedure foo4(x varchar(100)) +begin +insert into t1 values(concat("work_250_",x)); +insert into t1 select "yesterday_270_"; +end| +delimiter ;| +call foo(); +call foo2(); +call foo4("hello"); +call foo4(UUID()); +call foo4("world"); + +# test that can't SET in a stored function +--error ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT +select foo3(); +select * from t1 where a="alarm"; + +# Tests of stored functions/triggers/views for BUG#20930 "Mixed +# binlogging mode does not work with stored functions, triggers, +# views" + +# Function which calls procedure +drop function foo3; +delimiter |; +create function foo3() returns bigint unsigned +begin + insert into t1 values("foo3_32_"); + call foo(); + return 100; +end| +delimiter ;| +insert into t2 select foo3(); + +prepare stmt1 from 'insert into t2 select foo3()'; +execute stmt1; +execute stmt1; +deallocate prepare stmt1; + +# Test if stored function calls stored function which calls procedure +# which requires row-based. + +delimiter |; +create function foo4() returns bigint unsigned +begin + insert into t2 select foo3(); + return 100; +end| +delimiter ;| +select foo4(); + +prepare stmt1 from 'select foo4()'; +execute stmt1; +execute stmt1; +deallocate prepare stmt1; + +# A simple stored function +delimiter |; +create function foo5() returns bigint unsigned +begin + insert into t2 select UUID(); + return 100; +end| +delimiter ;| +select foo5(); + +prepare stmt1 from 'select foo5()'; +execute stmt1; +execute stmt1; +deallocate prepare stmt1; + +# A simple stored function where UUID() is in the argument +delimiter |; +create function foo6(x varchar(100)) returns bigint unsigned +begin + insert into t2 select x; + return 100; +end| +delimiter ;| +select foo6("foo6_1_"); +select foo6(concat("foo6_2_",UUID())); + +prepare stmt1 from 'select foo6(concat("foo6_3_",UUID()))'; +execute stmt1; +execute stmt1; +deallocate prepare stmt1; + + +# Test of views using UUID() + +create view v1 as select uuid(); +create table t11 (data varchar(255)); +insert into t11 select * from v1; +# Test of querying INFORMATION_SCHEMA which parses the view's body, +# to verify that it binlogs statement-based (is not polluted by +# the parsing of the view's body). +insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11'); +prepare stmt1 from "insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')"; +execute stmt1; +execute stmt1; +deallocate prepare stmt1; + +# Test of triggers with UUID() +delimiter |; +create trigger t11_bi before insert on t11 for each row +begin + set NEW.data = concat(NEW.data,UUID()); +end| +delimiter ;| +insert into t11 values("try_560_"); + +# Test that INSERT DELAYED works in mixed mode (BUG#20649) +insert delayed into t2 values("delay_1_"); +insert delayed into t2 values(concat("delay_2_",UUID())); +insert delayed into t2 values("delay_6_"); + +# Test for BUG#20633 (INSERT DELAYED RAND()/user_variable does not +# replicate fine in statement-based ; we test that in mixed mode it +# works). +insert delayed into t2 values(rand()); +set @a=2.345; +insert delayed into t2 values(@a); + +# With INSERT DELAYED, rows are written to the binlog after they are +# written to the table. Therefore, it is not enough to wait until the +# rows make it to t2 on the master (the rows may not be in the binlog +# at that time, and may still not be in the binlog when +# sync_slave_with_master is later called). Instead, we wait until the +# rows make it to t2 on the slave. We first call +# sync_slave_with_master, so that we are sure that t2 has been created +# on the slave. +sync_slave_with_master; +let $wait_condition= SELECT COUNT(*) = 19 FROM mysqltest1.t2; +--source include/wait_condition.inc +connection master; + +# If you want to do manual testing of the mixed mode regarding UDFs (not +# testable automatically as quite platform- and compiler-dependent), +# you just need to set the variable below to 1, and to +# "make udf_example.so" in sql/, and to copy sql/udf_example.so to +# MYSQL_TEST_DIR/lib/mysql. +let $you_want_to_test_UDF=0; +if ($you_want_to_test_UDF) +{ + CREATE FUNCTION metaphon RETURNS STRING SONAME 'udf_example.so'; + prepare stmt1 from 'insert into t1 select metaphon(?)'; + set @string="emergency_133_"; + insert into t1 values("work_134_"); + execute stmt1 using @string; + deallocate prepare stmt1; + prepare stmt1 from 'insert into t1 select ?'; + insert into t1 values(metaphon("work_135_")); + execute stmt1 using @string; + deallocate prepare stmt1; + insert into t1 values(metaphon("for_136_")); + insert into t1 select "yesterday_137_"; + create table t6 select metaphon("for_138_"); + create table t7 select 1 union select metaphon("for_139_"); + create table t8 select * from t1 where 3 in (select 1 union select 2 union select metaphon("for_140_") union select 3); + create table t9 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3); +} + +create table t20 select * from t1; # save for comparing later +create table t21 select * from t2; +create table t22 select * from t3; +drop table t1,t2,t3; + +# This tests the fix to +# BUG#19630 stored function inserting into two auto_increment breaks statement-based binlog +# We verify that under the mixed binlog mode, a stored function +# modifying at least two tables having an auto_increment column, +# is binlogged row-based. Indeed in statement-based binlogging, +# only the auto_increment value generated for the first table +# is recorded in the binlog, the value generated for the 2nd table +# lacking. + +create table t1 (a int primary key auto_increment, b varchar(100)); +create table t2 (a int primary key auto_increment, b varchar(100)); +create table t3 (b varchar(100)); +delimiter |; +create function f (x varchar(100)) returns int deterministic +begin + insert into t1 values(null,x); + insert into t2 values(null,x); + return 1; +end| +delimiter ;| +select f("try_41_"); +# Two operations which compensate each other except that their net +# effect is that they advance the auto_increment counter of t2 on slave: +sync_slave_with_master; +use mysqltest1; +insert into t2 values(2,null),(3,null),(4,null); +delete from t2 where a>=2; + +connection master; +# this is the call which didn't replicate well +select f("try_42_"); +sync_slave_with_master; + +# now use prepared statement and test again, just to see that the RBB +# mode isn't set at PREPARE but at EXECUTE. + +insert into t2 values(3,null),(4,null); +delete from t2 where a>=3; + +connection master; +prepare stmt1 from 'select f(?)'; +set @string="try_43_"; +insert into t1 values(null,"try_44_"); # should be SBB +execute stmt1 using @string; # should be RBB +deallocate prepare stmt1; +sync_slave_with_master; + +# verify that if only one table has auto_inc, it does not trigger RBB +# (we'll check in binlog further below) + +connection master; +create table t12 select * from t1; # save for comparing later +drop table t1; +create table t1 (a int, b varchar(100), key(a)); +select f("try_45_"); + +# restore table's key +create table t13 select * from t1; +drop table t1; +create table t1 (a int primary key auto_increment, b varchar(100)); + +# now test if it's two functions, each of them inserts in one table + +drop function f; +# we need a unique key to have sorting of rows by mysqldump +create table t14 (unique (a)) select * from t2; +truncate table t2; +delimiter |; +create function f1 (x varchar(100)) returns int deterministic +begin + insert into t1 values(null,x); + return 1; +end| +create function f2 (x varchar(100)) returns int deterministic +begin + insert into t2 values(null,x); + return 1; +end| +delimiter ;| +select f1("try_46_"),f2("try_47_"); + +sync_slave_with_master; +insert into t2 values(2,null),(3,null),(4,null); +delete from t2 where a>=2; + +connection master; +# Test with SELECT and INSERT +select f1("try_48_"),f2("try_49_"); +insert into t3 values(concat("try_50_",f1("try_51_"),f2("try_52_"))); +sync_slave_with_master; + +# verify that if f2 does only read on an auto_inc table, this does not +# switch to RBB +connection master; +drop function f2; +delimiter |; +create function f2 (x varchar(100)) returns int deterministic +begin + declare y int; + insert into t1 values(null,x); + set y = (select count(*) from t2); + return y; +end| +delimiter ;| +select f1("try_53_"),f2("try_54_"); +sync_slave_with_master; + +# And now, a normal statement with a trigger (no stored functions) + +connection master; +drop function f2; +delimiter |; +create trigger t1_bi before insert on t1 for each row +begin + insert into t2 values(null,"try_55_"); +end| +delimiter ;| +insert into t1 values(null,"try_56_"); +# and now remove one auto_increment and verify SBB +alter table t1 modify a int, drop primary key; +insert into t1 values(null,"try_57_"); +sync_slave_with_master; + +# Test for BUG#20499 "mixed mode with temporary table breaks binlog" +# Slave used to have only 2 rows instead of 3. +connection master; +CREATE TEMPORARY TABLE t15 SELECT UUID(); +create table t16 like t15; +INSERT INTO t16 SELECT * FROM t15; +# we'll verify that this one is done RBB +insert into t16 values("try_65_"); +drop table t15; +# we'll verify that this one is done SBB +insert into t16 values("try_66_"); +sync_slave_with_master; + +# and now compare: + +connection master; + +# first check that data on master is sensible +select count(*) from t1; +select count(*) from t2; +select count(*) from t3; +select count(*) from t4; +select count(*) from t5; +select count(*) from t11; +select count(*) from t20; +select count(*) from t21; +select count(*) from t22; +select count(*) from t12; +select count(*) from t13; +select count(*) from t14; +select count(*) from t16; +if ($you_want_to_test_UDF) +{ + select count(*) from t6; + select count(*) from t7; + select count(*) from t8; + select count(*) from t9; +} + +sync_slave_with_master; + +# +# Bug#20863 If binlog format is changed between update and unlock of +# tables, wrong binlog +# + +connection master; +DROP TABLE IF EXISTS t11; +SET SESSION BINLOG_FORMAT=STATEMENT; +CREATE TABLE t11 (song VARCHAR(255)); +LOCK TABLES t11 WRITE; +SET SESSION BINLOG_FORMAT=ROW; +INSERT INTO t11 VALUES('Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict'); +SET SESSION BINLOG_FORMAT=STATEMENT; +INSERT INTO t11 VALUES('Careful With That Axe, Eugene'); +UNLOCK TABLES; + +--query_vertical SELECT * FROM t11 +sync_slave_with_master; +USE mysqltest1; +--query_vertical SELECT * FROM t11 + +connection master; +DROP TABLE IF EXISTS t12; +SET SESSION BINLOG_FORMAT=MIXED; +CREATE TABLE t12 (data LONG); +LOCK TABLES t12 WRITE; +INSERT INTO t12 VALUES(UUID()); +UNLOCK TABLES; +sync_slave_with_master; + +# +# BUG#28086: SBR of USER() becomes corrupted on slave +# + +connection master; + +# Just to get something that is non-trivial, albeit still simple, we +# stuff the result of USER() and CURRENT_USER() into a variable. +--delimiter $$ +CREATE FUNCTION my_user() + RETURNS CHAR(64) +BEGIN + DECLARE user CHAR(64); + SELECT USER() INTO user; + RETURN user; +END $$ +--delimiter ; + +--delimiter $$ +CREATE FUNCTION my_current_user() + RETURNS CHAR(64) +BEGIN + DECLARE user CHAR(64); + SELECT CURRENT_USER() INTO user; + RETURN user; +END $$ +--delimiter ; + +DROP TABLE IF EXISTS t13; +CREATE TABLE t13 (data CHAR(64)); +INSERT INTO t13 VALUES (USER()); +INSERT INTO t13 VALUES (my_user()); +INSERT INTO t13 VALUES (CURRENT_USER()); +INSERT INTO t13 VALUES (my_current_user()); + +sync_slave_with_master; + +# as we're using UUID we don't SELECT but use "diff" like in rpl_row_UUID +--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql +--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql + +# Let's compare. Note: If they match test will pass, if they do not match +# the test will show that the diff statement failed and not reject file +# will be created. You will need to go to the mysql-test dir and diff +# the files your self to see what is not matching + +diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql; + +connection master; + +# Now test that mysqlbinlog works fine on a binlog generated by the +# mixed mode + +# BUG#11312 "DELIMITER is not written to the binary log that causes +# syntax error" makes that mysqlbinlog will fail if we pass it the +# text of queries; this forces us to use --base64-output here. + +# BUG#20929 "BINLOG command causes invalid free plus assertion +# failure" makes mysqld segfault when receiving --base64-output + +# So I can't enable this piece of test +# SIGH + +if ($enable_when_11312_or_20929_fixed) +{ +--exec $MYSQL_BINLOG --base64-output $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_mixed.sql +drop database mysqltest1; +--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/mysqlbinlog_mixed.sql +--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql +# the old mysqldump output on slave is the same as what it was on +# master before restoring on master. +diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql; +} + +drop database mysqltest1; +sync_slave_with_master; + +connection master; +# Restore binlog format setting +set global binlog_format =@my_binlog_format; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_sync.test b/mysql-test/suite/rpl/t/rpl_sync.test index bdb0d8ec4cc..1e2ec2ca83b 100644 --- a/mysql-test/suite/rpl/t/rpl_sync.test +++ b/mysql-test/suite/rpl/t/rpl_sync.test @@ -1,2 +1,159 @@ ---source include/rpl_sync_test.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +######################################################################################## +# This test verifies the options --sync-relay-log-info and --relay-log-recovery by +# crashing the slave in two different situations: +# (case-1) - Corrupt the relay log with changes which were not processed by +# the SQL Thread and crashes it. +# (case-2) - Corrupt the master.info with wrong coordinates and crashes it. +# +# Case 1: +# 1 - Stops the SQL Thread +# 2 - Inserts new records into the master. +# 3 - Corrupts the relay-log.bin* which most likely has such changes. +# 4 - Crashes the slave +# 5 - Verifies if the slave is sync with the master which means that the information +# loss was circumvented by the recovery process. +# +# Case 2: +# 1 - Stops the SQL/IO Threads +# 2 - Inserts new records into the master. +# 3 - Corrupts the master.info with wrong coordinates. +# 4 - Crashes the slave +# 5 - Verifies if the slave is sync with the master which means that the information +# loss was circumvented by the recovery process. +######################################################################################## + +######################################################################################## +# Configuring the environment +######################################################################################## +--echo =====Configuring the enviroment=======; +--source include/not_embedded.inc +--source include/not_valgrind.inc +--source include/have_debug.inc +--source include/have_innodb.inc +--source include/not_crashrep.inc +--source include/master-slave.inc + +call mtr.add_suppression('Attempting backtrace'); +call mtr.add_suppression("Recovery from master pos .* and file master-bin.000001"); +# Use innodb so we do not get "table should be repaired" issues. +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +flush tables; +CREATE TABLE t1(a INT, PRIMARY KEY(a)) engine=innodb; + +insert into t1(a) values(1); +insert into t1(a) values(2); +insert into t1(a) values(3); + +######################################################################################## +# Case 1: Corrupt a relay-log.bin* +######################################################################################## +--echo =====Inserting data on the master but without the SQL Thread being running=======; +sync_slave_with_master; + +connection slave; +let $MYSQLD_SLAVE_DATADIR= `select @@datadir`; +--replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR +--copy_file $MYSQLD_SLAVE_DATADIR/master.info $MYSQLD_SLAVE_DATADIR/master.backup +--source include/stop_slave_sql.inc + +connection master; +insert into t1(a) values(4); +insert into t1(a) values(5); +insert into t1(a) values(6); + +--echo =====Removing relay log files and crashing/recoverying the slave=======; +connection slave; +--source include/stop_slave_io.inc + +let $file= query_get_value("SHOW SLAVE STATUS", Relay_Log_File, 1); + +--let FILE_TO_CORRUPT= $MYSQLD_SLAVE_DATADIR/$file +perl; +$file= $ENV{'FILE_TO_CORRUPT'}; +open(FILE, ">$file") || die "Unable to open $file."; +truncate(FILE,0); +print FILE "failure"; +close ($file); +EOF + +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect +SET SESSION debug_dbug="d,crash_before_rotate_relaylog"; +--error 2013 +FLUSH LOGS; + +--let $rpl_server_number= 2 +--source include/rpl_reconnect.inc + +--echo =====Dumping and comparing tables=======; +--source include/start_slave.inc + +connection master; +sync_slave_with_master; + +let $diff_tables=master:t1,slave:t1; +source include/diff_tables.inc; + +######################################################################################## +# Case 2: Corrupt a master.info +######################################################################################## +--echo =====Corrupting the master.info=======; +connection slave; +--source include/stop_slave.inc + +connection master; +FLUSH LOGS; + +insert into t1(a) values(7); +insert into t1(a) values(8); +insert into t1(a) values(9); + +connection slave; +let MYSQLD_SLAVE_DATADIR=`select @@datadir`; + +--perl +use strict; +use warnings; +my $src= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.backup"; +my $dst= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.info"; +open(FILE, "<", $src) or die; +my @content= ; +close FILE; +open(FILE, ">", $dst) or die; +binmode FILE; +print FILE @content; +close FILE; +EOF + +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect +SET SESSION debug_dbug="d,crash_before_rotate_relaylog"; +--error 2013 +FLUSH LOGS; + +--let $rpl_server_number= 2 +--source include/rpl_reconnect.inc + +--echo =====Dumping and comparing tables=======; +--source include/start_slave.inc + +connection master; +sync_slave_with_master; + +let $diff_tables=master:t1,slave:t1; +source include/diff_tables.inc; + +######################################################################################## +# Clean up +######################################################################################## +--echo =====Clean up=======; +connection master; +drop table t1; + +--remove_file $MYSQLD_SLAVE_DATADIR/master.backup +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_temporal_format_default_to_default.test b/mysql-test/suite/rpl/t/rpl_temporal_format_default_to_default.test index d976ae3757b..6728ff55d6f 100644 --- a/mysql-test/suite/rpl/t/rpl_temporal_format_default_to_default.test +++ b/mysql-test/suite/rpl/t/rpl_temporal_format_default_to_default.test @@ -1 +1,82 @@ ---source include/rpl_temporal_format_default_to_default.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption). +# Please check all dependent tests after modifying it +# + +--source include/master-slave.inc + +if ($force_master_mysql56_temporal_format) +{ + connection master; + eval SET @@global.mysql56_temporal_format=$force_master_mysql56_temporal_format; +} + +if ($force_slave_mysql56_temporal_format) +{ + connection slave; + eval SET @@global.mysql56_temporal_format=$force_slave_mysql56_temporal_format; +} + +connection master; +SELECT @@global.mysql56_temporal_format AS on_master; +connection slave; +SELECT @@global.mysql56_temporal_format AS on_slave; +connection master; + +CREATE TABLE t1 +( + c0 TIME(0), + c1 TIME(1), + c2 TIME(2), + c3 TIME(3), + c4 TIME(4), + c5 TIME(5), + c6 TIME(6) +); +CREATE TABLE t2 +( + c0 TIMESTAMP(0), + c1 TIMESTAMP(1), + c2 TIMESTAMP(2), + c3 TIMESTAMP(3), + c4 TIMESTAMP(4), + c5 TIMESTAMP(5), + c6 TIMESTAMP(6) +); + +CREATE TABLE t3 +( + c0 DATETIME(0), + c1 DATETIME(1), + c2 DATETIME(2), + c3 DATETIME(3), + c4 DATETIME(4), + c5 DATETIME(5), + c6 DATETIME(6) +); +INSERT INTO t1 VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111'); +INSERT INTO t2 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111'); +INSERT INTO t3 VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111'); +SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES +WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME; +sync_slave_with_master; + +connection slave; +--query_vertical SELECT * FROM t1; +--query_vertical SELECT * FROM t2; +--query_vertical SELECT * FROM t3; +SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH,DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES +WHERE TABLE_NAME RLIKE 't[1-3]' ORDER BY TABLE_NAME; + +connection master; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; + +connection slave; +SET @@global.mysql56_temporal_format=DEFAULT; +connection master; +SET @@global.mysql56_temporal_format=DEFAULT; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_typeconv.test b/mysql-test/suite/rpl/t/rpl_typeconv.test index c2517086258..9e566258882 100644 --- a/mysql-test/suite/rpl/t/rpl_typeconv.test +++ b/mysql-test/suite/rpl/t/rpl_typeconv.test @@ -1 +1,78 @@ ---source include/rpl_typeconv.inc +# +# This include file is used by more than one test suite +# (currently rpl and binlog_encryption suite). +# Please check all dependent tests after modifying it +# + +--source include/have_binlog_format_row.inc +--source include/master-slave.inc + +connection slave; +set @saved_slave_type_conversions = @@global.slave_type_conversions; +CREATE TABLE type_conversions ( + TestNo INT AUTO_INCREMENT PRIMARY KEY, + Source TEXT, + Target TEXT, + Flags TEXT, + On_Master LONGTEXT, + On_Slave LONGTEXT, + Expected LONGTEXT, + Compare INT, + Error TEXT); + +SELECT @@global.slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS=''; +SELECT @@global.slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY'; +SELECT @@global.slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY'; +SELECT @@global.slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY'; +SELECT @@global.slave_type_conversions; +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY,NONEXISTING_BIT'; +SELECT @@global.slave_type_conversions; + +# Checking strict interpretation of type conversions +connection slave; +SET GLOBAL SLAVE_TYPE_CONVERSIONS=''; +source suite/rpl/include/type_conversions.test; + +# Checking lossy integer type conversions +connection slave; +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY'; +source suite/rpl/include/type_conversions.test; + +# Checking non-lossy integer type conversions +connection slave; +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY'; +source suite/rpl/include/type_conversions.test; + +# Checking all type conversions +connection slave; +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY'; +source suite/rpl/include/type_conversions.test; + +connection slave; +--echo **** Result of conversions **** +disable_query_log; +SELECT RPAD(Source, 15, ' ') AS Source_Type, + RPAD(Target, 15, ' ') AS Target_Type, + RPAD(Flags, 25, ' ') AS All_Type_Conversion_Flags, + IF(Compare IS NULL AND Error IS NOT NULL, '', + IF(Compare, '', + CONCAT("'", On_Slave, "' != '", Expected, "'"))) + AS Value_On_Slave + FROM type_conversions; +enable_query_log; +DROP TABLE type_conversions; + +call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677"); + +connection master; +DROP TABLE t1; +sync_slave_with_master; + +set global slave_type_conversions = @saved_slave_type_conversions; + +--source include/rpl_end.inc From 011261f4e95890b63bac83d7842ff93ced6d3ec8 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Fri, 24 Mar 2023 08:52:28 +1100 Subject: [PATCH 065/260] sql_class: sprintf -> snprintf This was failing to compile with AppleClang 14.0.0.14000029. Thanks to Arunesh Choudhary for noticing. --- sql/sql_class.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sql_class.h b/sql/sql_class.h index 6fa8d696b53..d0c3e0244e7 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1749,7 +1749,7 @@ show_system_thread(enum_thread_type thread) RETURN_NAME_AS_STRING(SYSTEM_THREAD_SLAVE_BACKGROUND); RETURN_NAME_AS_STRING(SYSTEM_THREAD_SEMISYNC_MASTER_BACKGROUND); default: - sprintf(buf, "", thread); + snprintf(buf, sizeof(buf), "", thread); return buf; } #undef RETURN_NAME_AS_STRING @@ -6996,7 +6996,7 @@ public: if (unlikely(!(dst->str= tmp= (char*) alloc_root(mem_root, dst->length + 1)))) return true; - sprintf(tmp, "%.*s%.*s%.*s", + snprintf(tmp, dst->length + 1, "%.*s%.*s%.*s", (int) m_db.length, (m_db.length ? m_db.str : ""), dot, ".", (int) m_name.length, m_name.str); From f33fc2fae5c3f3e80c4d24348609f3ce5246ca9c Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Wed, 22 Mar 2023 21:59:18 -0700 Subject: [PATCH 066/260] MDEV-30539 EXPLAIN EXTENDED: no message with queries for DML statements EXPLAIN EXTENDED for an UPDATE/DELETE/INSERT/REPLACE statement did not produce the warning containing the text representation of the query obtained after the optimization phase. Such warning was produced for SELECT statements, but not for DML statements. The patch fixes this defect of EXPLAIN EXTENDED for DML statements. --- mysql-test/include/explain_non_select.inc | 16 + mysql-test/main/explain_non_select.result | 4 + mysql-test/main/multi_update.result | 2 +- mysql-test/main/multi_update.test | 2 +- .../main/myisam_explain_non_select_all.result | 193 ++++++++++ mysql-test/main/opt_trace.result | 2 +- mysql-test/main/ps.result | 4 + .../suite/versioning/r/delete_history.result | 2 + sql/sql_delete.cc | 2 + sql/sql_explain.cc | 19 +- sql/sql_explain.h | 2 +- sql/sql_insert.cc | 6 +- sql/sql_lex.cc | 2 + sql/sql_lex.h | 6 + sql/sql_parse.cc | 20 +- sql/sql_select.cc | 330 +++++++++++++++--- sql/sql_update.cc | 10 +- sql/table.h | 2 + 18 files changed, 565 insertions(+), 59 deletions(-) diff --git a/mysql-test/include/explain_non_select.inc b/mysql-test/include/explain_non_select.inc index d22310c9813..bd0962d3876 100644 --- a/mysql-test/include/explain_non_select.inc +++ b/mysql-test/include/explain_non_select.inc @@ -788,6 +788,22 @@ INSERT INTO t1 VALUES (1), (2), (3), (4), (5); DROP TABLE t1; +--echo #75 + +CREATE TABLE t1 (id INT PRIMARY KEY, i INT); +--let $query = INSERT INTO t1 VALUES (3,10), (7,11), (3,11) ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); +--source include/explain_utils.inc +DROP TABLE t1; + +--echo #76 + +CREATE TABLE t1 (id INT PRIMARY KEY, i INT); +CREATE TABLE t2 (a INT, b INT); +INSERT INTO t2 VALUES (1,10), (3,10), (7,11), (3,11); +--let $query = INSERT INTO t1 SELECT * FROM t2 ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); +--source include/explain_utils.inc +DROP TABLE t1,t2; + --echo # --echo # Bug #12949629: CLIENT LOSES CONNECTION AFTER EXECUTING A PROCEDURE WITH --echo # EXPLAIN UPDATE/DEL/INS diff --git a/mysql-test/main/explain_non_select.result b/mysql-test/main/explain_non_select.result index 111b4c8ae50..d60f10f85c8 100644 --- a/mysql-test/main/explain_non_select.result +++ b/mysql-test/main/explain_non_select.result @@ -157,9 +157,13 @@ id select_type table partitions type possible_keys key key_len ref rows Extra explain extended update t2 set b=3 where a in (3,4); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 update `test`.`t2` set `test`.`t2`.`b` = 3 where `test`.`t2`.`a` in (3,4) explain extended delete from t2 where a in (3,4); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 delete from `test`.`t2` where `test`.`t2`.`a` in (3,4) drop table t1,t2; # # Check the special case where partition pruning removed all partitions diff --git a/mysql-test/main/multi_update.result b/mysql-test/main/multi_update.result index d6cf9ba685f..222c592cbce 100644 --- a/mysql-test/main/multi_update.result +++ b/mysql-test/main/multi_update.result @@ -1253,7 +1253,7 @@ EXPLAIN DROP TABLES t1, t2; # End of 10.3 tests # -# MDEV-28538: multi-table UPDATE/DELETE with possible exists-to-in +# MDEV-30538: multi-table UPDATE/DELETE with possible exists-to-in # create table t1 (c1 int, c2 int, c3 int, index idx(c2)); insert into t1 values diff --git a/mysql-test/main/multi_update.test b/mysql-test/main/multi_update.test index 48e6250393b..329394e8468 100644 --- a/mysql-test/main/multi_update.test +++ b/mysql-test/main/multi_update.test @@ -1134,7 +1134,7 @@ DROP TABLES t1, t2; --echo # End of 10.3 tests --echo # ---echo # MDEV-28538: multi-table UPDATE/DELETE with possible exists-to-in +--echo # MDEV-30538: multi-table UPDATE/DELETE with possible exists-to-in --echo # create table t1 (c1 int, c2 int, c3 int, index idx(c2)); diff --git a/mysql-test/main/myisam_explain_non_select_all.result b/mysql-test/main/myisam_explain_non_select_all.result index 7f24cb4896d..3ca9629d027 100644 --- a/mysql-test/main/myisam_explain_non_select_all.result +++ b/mysql-test/main/myisam_explain_non_select_all.result @@ -17,6 +17,8 @@ FLUSH TABLES; EXPLAIN EXTENDED UPDATE t1 SET a = 10 WHERE a < 10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where +Warnings: +Note 1003 update `test`.`t1` set `test`.`t1`.`a` = 10 where `test`.`t1`.`a` < 10 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 2 @@ -60,6 +62,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t1 WHERE a < 10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where +Warnings: +Note 1003 delete from `test`.`t1` where `test`.`t1`.`a` < 10 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 2 @@ -103,6 +107,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t1 USING t1 WHERE a = 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where +Warnings: +Note 1003 delete from `test`.`t1` using `test`.`t1` where `test`.`t1`.`a` = 1 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 2 @@ -150,6 +156,8 @@ EXPLAIN EXTENDED UPDATE t1, t2 SET t1.a = 10 WHERE t1.a = 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1003 update `test`.`t1` join `test`.`t2` set `test`.`t1`.`a` = 10 where `test`.`t1`.`a` = 1 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -200,6 +208,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t11 ALL NULL NULL NULL NULL 3 100.00 Using where 1 PRIMARY ALL NULL NULL NULL NULL 3 100.00 2 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1003 /* select#1 */ update `test`.`t1` `t11` join (/* select#2 */ select `test`.`t2`.`b` AS `b` from `test`.`t2`) `t12` set `test`.`t11`.`a` = 10 where `test`.`t11`.`a` = 1 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -248,6 +258,8 @@ EXPLAIN EXTENDED UPDATE t1 SET a = 10 WHERE 1 IN (SELECT 1 FROM t2 WHERE id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where +Warnings: +Note 1003 /* select#1 */ update `test`.`t1` set `test`.`t1`.`a` = 10 where (1,(/* select#2 */ select 1 from `test`.`t2` where `test`.`t2`.`b` < 3 and 1)) # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -300,6 +312,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 +Note 1003 /* select#1 */ update `test`.`t1` set `test`.`t1`.`a` = 10 where (`test`.`t1`.`a`,(/* select#2 */ select `test`.`t2`.`b` from `test`.`t2` where `test`.`t1`.`a` < 3 and (`test`.`t1`.`a`) = `test`.`t2`.`b`)) # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -353,6 +366,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Using where +Warnings: +Note 1003 update `test`.`t1` semi join (`test`.`t2`) join `test`.`t2` set `test`.`t1`.`a` = 10 where `test`.`t2`.`b` < 3 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -405,6 +420,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t11 ALL NULL NULL NULL NULL 3 100.00 1 PRIMARY ALL NULL NULL NULL NULL 3 100.00 2 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1003 /* select#1 */ update `test`.`t1` `t11` join (/* select#2 */ select `test`.`t2`.`b` AS `b` from `test`.`t2`) `t12` set `test`.`t11`.`a` = `test`.`t11`.`a` + 10 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -457,6 +474,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY system NULL NULL NULL NULL 1 100.00 1 PRIMARY t11 ALL NULL NULL NULL NULL 3 100.00 2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 /* select#1 */ update `test`.`t1` `t11` set `test`.`t11`.`a` = `test`.`t11`.`a` + 10 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 2 @@ -511,6 +530,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t11 ALL NULL NULL NULL NULL 3 100.00 Using where 1 PRIMARY ALL NULL NULL NULL NULL 3 100.00 2 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1003 /* select#1 */ update `test`.`t1` `t11` join (/* select#2 */ select `test`.`t2`.`b` AS `b` from `test`.`t2`) `t12` set `test`.`t11`.`a` = 10 where `test`.`t11`.`a` > 1 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -555,6 +576,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t1 WHERE a > 1 LIMIT 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where +Warnings: +Note 1003 delete from `test`.`t1` where `test`.`t1`.`a` > 1 limit 1 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 2 @@ -598,6 +621,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t1 WHERE 0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 delete from `test`.`t1` where 0 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 2 @@ -638,6 +663,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t1 USING t1 WHERE 0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 delete from `test`.`t1` using `test`.`t1` where 0 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 2 @@ -678,6 +705,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t1 WHERE a = 3; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range a a 5 NULL 1 100.00 Using where +Warnings: +Note 1003 delete from `test`.`t1` where `test`.`t1`.`a` = 3 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 5 @@ -719,6 +748,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t1 WHERE a < 3; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range a a 5 NULL 1 100.00 Using where +Warnings: +Note 1003 delete from `test`.`t1` where `test`.`t1`.`a` < 3 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 5 @@ -758,6 +789,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +Warnings: +Note 1003 delete from `test`.`t1` where `test`.`t1`.`a` > 0 order by `test`.`t1`.`a` # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 3 @@ -797,6 +830,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 100.00 Using where +Warnings: +Note 1003 delete from `test`.`t1` where `test`.`t1`.`a` > 0 order by `test`.`t1`.`a` # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 3 @@ -840,6 +875,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t1 WHERE (@a:= a) ORDER BY a LIMIT 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 index NULL PRIMARY 4 NULL 1 100.00 Using where +Warnings: +Note 1003 delete from `test`.`t1` where @a:=`test`.`t1`.`a` order by `test`.`t1`.`a` limit 1 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 3 @@ -884,6 +921,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t1 ORDER BY a ASC, b ASC LIMIT 1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using filesort +Warnings: +Note 1003 delete from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b` limit 1 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 7 @@ -941,6 +980,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a1 1 100.00 1 SIMPLE t3 eq_ref PRIMARY PRIMARY 8 test.t2.b2,test.t1.b1 1 100.00 +Warnings: +Note 1003 delete from `test`.`t1`,`test`.`t2`,`test`.`t3` using `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t2`.`a2` = `test`.`t1`.`a1` and `test`.`t3`.`a3` = `test`.`t2`.`b2` and `test`.`t3`.`b3` = `test`.`t1`.`b1` # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 13 @@ -993,6 +1034,8 @@ EXPLAIN EXTENDED UPDATE t1 SET a = 10 WHERE a IN (SELECT a FROM t2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where +Warnings: +Note 1003 /* select#1 */ update `test`.`t1` set `test`.`t1`.`a` = 10 where (`test`.`t1`.`a`,(/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` where (`test`.`t1`.`a`) = `test`.`t2`.`a`)) # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -1043,6 +1086,8 @@ EXPLAIN EXTENDED DELETE FROM t1 WHERE a1 IN (SELECT a2 FROM t2 WHERE a2 > 2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where +Warnings: +Note 1003 /* select#1 */ delete from `test`.`t1` where (`test`.`t1`.`a1`,(/* select#2 */ select `test`.`t2`.`a2` from `test`.`t2` where `test`.`t2`.`a2` > 2 and (`test`.`t1`.`a1`) = `test`.`t2`.`a2`)) # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -1088,6 +1133,8 @@ EXPLAIN EXTENDED DELETE FROM t1 WHERE a1 IN (SELECT a2 FROM t2 WHERE a2 > 2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where +Warnings: +Note 1003 /* select#1 */ delete from `test`.`t1` where (`test`.`t1`.`a1`,(/* select#2 */ select `test`.`t2`.`a2` from `test`.`t2` where `test`.`t2`.`a2` > 2 and (`test`.`t1`.`a1`) = `test`.`t2`.`a2`)) # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -1132,6 +1179,8 @@ FLUSH TABLES; EXPLAIN EXTENDED UPDATE t1 SET i = 10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 +Warnings: +Note 1003 update `test`.`t1` set `test`.`t1`.`i` = 10 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 3 @@ -1175,6 +1224,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL 5 NULL Deleting all rows +Warnings: +Note 1003 delete from `test`.`t1` # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 3 @@ -1221,6 +1272,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index NULL a 15 NULL 5 100.00 Using where +Warnings: +Note 1003 delete from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 8 @@ -1267,6 +1320,8 @@ FLUSH TABLES; EXPLAIN EXTENDED INSERT INTO t2 SELECT * FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1003 insert into `test`.`t2` select `test`.`t1`.`i` AS `i` from `test`.`t1` # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -1311,6 +1366,8 @@ FLUSH TABLES; EXPLAIN EXTENDED REPLACE INTO t2 SELECT * FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1003 replace into `test`.`t2` select `test`.`t1`.`i` AS `i` from `test`.`t1` # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -1351,6 +1408,8 @@ FLUSH TABLES; EXPLAIN EXTENDED INSERT INTO t1 SET i = 10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 INSERT t1 ALL NULL NULL NULL NULL NULL 100.00 NULL +Warnings: +Note 1003 insert into `test`.`t1`(i) values (10) # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 2 @@ -1374,6 +1433,8 @@ FLUSH TABLES; EXPLAIN EXTENDED REPLACE INTO t1 SET i = 10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 INSERT t1 ALL NULL NULL NULL NULL NULL 100.00 NULL +Warnings: +Note 1003 replace into `test`.`t1`(i) values (10) # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 2 @@ -1402,6 +1463,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t1 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 5 100.00 Using where +Warnings: +Note 1003 delete from `test`.`t1` where `test`.`t1`.`i` > 10 and `test`.`t1`.`i` <= 18 order by `test`.`t1`.`i` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -1447,6 +1510,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t1 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort +Warnings: +Note 1003 delete from `test`.`t1` where `test`.`t1`.`i` > 10 and `test`.`t1`.`i` <= 18 order by `test`.`t1`.`i` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -1500,6 +1565,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort +Warnings: +Note 1003 delete from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 8 @@ -1554,6 +1621,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index NULL a 15 NULL 5 100.00 Using where +Warnings: +Note 1003 delete from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 8 @@ -1603,6 +1672,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort +Warnings: +Note 1003 delete from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 8 @@ -1657,6 +1728,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort +Warnings: +Note 1003 delete from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 8 @@ -1712,6 +1785,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index_merge key1,key2 key1,key2 5,5 NULL 7 100.00 Using sort_union(key1,key2); Using where; Using filesort +Warnings: +Note 1003 delete from `test`.`t2` where `test`.`t2`.`key1` < 13 or `test`.`t2`.`key2` < 14 order by `test`.`t2`.`key1` # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 6 @@ -1765,6 +1840,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i DESC LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 5 100.00 Using where +Warnings: +Note 1003 delete from `test`.`t2` where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` desc limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -1812,6 +1889,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t2 ORDER BY a, b DESC LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using filesort +Warnings: +Note 1003 delete from `test`.`t2` order by `test`.`t2`.`a`,`test`.`t2`.`b` desc limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 6 @@ -1866,6 +1945,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t2 ORDER BY a DESC, b DESC LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index NULL a 6 NULL 5 100.00 +Warnings: +Note 1003 delete from `test`.`t2` order by `test`.`t2`.`a` desc,`test`.`t2`.`b` desc limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 6 @@ -1915,6 +1996,8 @@ FLUSH TABLES; EXPLAIN EXTENDED UPDATE t2 SET a = 10 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 5 100.00 Using where; Using buffer +Warnings: +Note 1003 update `test`.`t2` set `test`.`t2`.`a` = 10 where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -1963,6 +2046,8 @@ FLUSH TABLES; EXPLAIN EXTENDED UPDATE t2 SET a = 10 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort +Warnings: +Note 1003 update `test`.`t2` set `test`.`t2`.`a` = 10 where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -2017,6 +2102,8 @@ FLUSH TABLES; EXPLAIN EXTENDED UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort +Warnings: +Note 1003 update `test`.`t2` set `test`.`t2`.`d` = 10 where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 8 @@ -2072,6 +2159,8 @@ FLUSH TABLES; EXPLAIN EXTENDED UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index NULL a 15 NULL 5 100.00 Using where; Using buffer +Warnings: +Note 1003 update `test`.`t2` set `test`.`t2`.`d` = 10 where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 8 @@ -2122,6 +2211,8 @@ FLUSH TABLES; EXPLAIN EXTENDED UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort +Warnings: +Note 1003 update `test`.`t2` set `test`.`t2`.`d` = 10 where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 8 @@ -2176,6 +2267,8 @@ FLUSH TABLES; EXPLAIN EXTENDED UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort +Warnings: +Note 1003 update `test`.`t2` set `test`.`t2`.`d` = 10 where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 8 @@ -2231,6 +2324,8 @@ FLUSH TABLES; EXPLAIN EXTENDED UPDATE t2 SET i = 123 WHERE key1 < 13 or key2 < 14 ORDER BY key1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index_merge key1,key2 key1,key2 5,5 NULL 7 100.00 Using sort_union(key1,key2); Using where; Using filesort +Warnings: +Note 1003 update `test`.`t2` set `test`.`t2`.`i` = 123 where `test`.`t2`.`key1` < 13 or `test`.`t2`.`key2` < 14 order by `test`.`t2`.`key1` # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 6 @@ -2284,6 +2379,8 @@ FLUSH TABLES; EXPLAIN EXTENDED UPDATE t2 SET a = 10 WHERE i > 10 AND i <= 18 ORDER BY i DESC LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 5 100.00 Using where; Using buffer +Warnings: +Note 1003 update `test`.`t2` set `test`.`t2`.`a` = 10 where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` desc limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -2332,6 +2429,8 @@ FLUSH TABLES; EXPLAIN EXTENDED UPDATE t2 SET c = 10 ORDER BY a, b DESC LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using filesort +Warnings: +Note 1003 update `test`.`t2` set `test`.`t2`.`c` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`b` desc limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 6 @@ -2387,6 +2486,8 @@ FLUSH TABLES; EXPLAIN EXTENDED UPDATE t2 SET c = 10 ORDER BY a DESC, b DESC LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 index NULL a 6 NULL 5 100.00 Using buffer +Warnings: +Note 1003 update `test`.`t2` set `test`.`t2`.`c` = 10 order by `test`.`t2`.`a` desc,`test`.`t2`.`b` desc limit 5 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 6 @@ -2439,6 +2540,8 @@ FLUSH TABLES; EXPLAIN EXTENDED UPDATE t1 SET c2 = 0 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range c1_idx c1_idx 2 NULL 2 100.00 Using where; Using filesort +Warnings: +Note 1003 update `test`.`t1` set `test`.`t1`.`c2` = 0 where `test`.`t1`.`c1_idx` = 'y' order by `test`.`t1`.`pk` desc limit 2 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 6 @@ -2485,6 +2588,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range c1_idx c1_idx 2 NULL 2 100.00 Using where; Using filesort +Warnings: +Note 1003 delete from `test`.`t1` where `test`.`t1`.`c1_idx` = 'y' order by `test`.`t1`.`pk` desc limit 2 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 6 @@ -2534,6 +2639,8 @@ FLUSH TABLES; EXPLAIN EXTENDED UPDATE t1 SET a=a+10 WHERE a > 34; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using buffer +Warnings: +Note 1003 update `test`.`t1` set `test`.`t1`.`a` = `test`.`t1`.`a` + 10 where `test`.`t1`.`a` > 34 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 3 @@ -2581,6 +2688,8 @@ EXPLAIN EXTENDED UPDATE t1 LEFT JOIN t2 ON t1.c1 = t2.c1 SET t2.c2 = 10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 system NULL NULL NULL NULL 0 0.00 Const row not found 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 +Warnings: +Note 1003 update `test`.`t1` set NULL = 10 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 7 @@ -2624,6 +2733,8 @@ EXPLAIN EXTENDED UPDATE t1 LEFT JOIN t2 ON t1.c1 = t2.c1 SET t2.c2 = 10 W id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 system NULL NULL NULL NULL 0 0.00 Const row not found 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 update `test`.`t1` set NULL = 10 where `test`.`t1`.`c3` = 10 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 7 @@ -2676,6 +2787,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 DEPENDENT SUBQUERY t2 ALL IDX NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.f1' of SELECT #2 was resolved in SELECT #1 +Note 1003 /* select#1 */ update `test`.`t1` set `test`.`t1`.`f2` = (/* select#2 */ select max(`test`.`t2`.`f4`) from `test`.`t2` where `test`.`t2`.`f3` = `test`.`t1`.`f1`) # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 7 @@ -2747,6 +2859,8 @@ EXPLAIN EXTENDED UPDATE v1 SET a = 1 WHERE a > 0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t11 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t12 ALL NULL NULL NULL NULL 2 100.00 +Warnings: +Note 1003 update `test`.`t1` `t11` join `test`.`t1` `t12` set `test`.`t11`.`a` = 1 where `test`.`t11`.`a` > 0 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 2 @@ -2792,6 +2906,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 1 SIMPLE t11 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t12 ALL NULL NULL NULL NULL 2 100.00 +Warnings: +Note 1003 update `test`.`t1` join `test`.`t1` `t11` join `test`.`t1` `t12` set `test`.`t11`.`a` = 1 where `test`.`t11`.`a` = `test`.`t1`.`a` # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 2 @@ -2841,6 +2957,8 @@ FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM v1 WHERE a < 4; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 100.00 Using where +Warnings: +Note 1003 /* select#1 */ delete from `test`.`t1` where `test`.`t1`.`a` < 4 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 3 @@ -2892,6 +3010,8 @@ EXPLAIN EXTENDED DELETE v1 FROM t2, v1 WHERE t2.x = v1.a; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 4 100.00 Using where 1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.x 1 100.00 +Warnings: +Note 1003 delete from `test`.`t1` using `test`.`t2` join `test`.`t1` where `test`.`t1`.`a` = `test`.`t2`.`x` # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 6 @@ -2943,6 +3063,8 @@ EXPLAIN EXTENDED DELETE v1 FROM t2, v1 WHERE t2.x = v1.a; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 4 100.00 Using where 1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.x 1 100.00 +Warnings: +Note 1003 delete from `test`.`t1` using `test`.`t2` join `test`.`t1` where `test`.`t1`.`a` = `test`.`t2`.`x` # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 6 @@ -2987,6 +3109,8 @@ FLUSH TABLES; EXPLAIN EXTENDED INSERT INTO v1 VALUES (10); id select_type table type possible_keys key key_len ref rows filtered Extra 1 INSERT t1 ALL NULL NULL NULL NULL NULL 100.00 NULL +Warnings: +Note 1003 insert into `test`.`t1`(x) values (10) # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 2 @@ -3027,6 +3151,8 @@ FLUSH TABLES; EXPLAIN EXTENDED INSERT INTO v1 SELECT * FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 system NULL NULL NULL NULL 0 0.00 Const row not found +Warnings: +Note 1003 insert into `test`.`t2`(x) /* select#1 */ select NULL AS `a` from `test`.`t1` # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -3084,6 +3210,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where 2 DEPENDENT SUBQUERY index_subquery key0 key0 5 func 2 100.00 3 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ update `test`.`t1` set `test`.`t1`.`a` = 10 where (`test`.`t1`.`a`,(((`test`.`t1`.`a`) in (temporary) on key0))) # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -3140,6 +3268,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 2 MATERIALIZED ALL NULL NULL NULL NULL 3 100.00 3 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00 Using filesort +Warnings: +Note 1003 /* select#1 */ update `test`.`t1` semi join ((/* select#3 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x`) join `test`.`t2` set `test`.`t1`.`a` = 10 where 1 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -3198,6 +3328,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 3 MATERIALIZED ALL NULL NULL NULL NULL 3 100.00 4 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00 Using filesort 2 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00 +Warnings: +Note 1003 /* select#1 */ update `test`.`t1` semi join ((/* select#4 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x`) join (/* select#2 */ select `test`.`t2`.`b` AS `b` from `test`.`t2`) `y` set `test`.`t1`.`a` = 10 where 1 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 4 @@ -3248,6 +3380,8 @@ JOIN t1 AS a12 ON a12.c1 = a11.c1 id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 0 100.00 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Note 1003 /* select#1 */ update `test`.`t3` set `test`.`t3`.`c3` = (/* select#2 */ select count(NULL) from `test`.`t1` `a11` straight_join `test`.`t2` `a21` join `test`.`t1` `a12` where 0) DROP TABLE t1, t2, t3; #73 CREATE TABLE t1 (id INT); @@ -3276,6 +3410,8 @@ FLUSH TABLES; EXPLAIN EXTENDED UPDATE t1 SET a=a+1 WHERE a>10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 1 100.00 Using where; Using buffer +Warnings: +Note 1003 update `test`.`t1` set `test`.`t1`.`a` = `test`.`t1`.`a` + 1 where `test`.`t1`.`a` > 10 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 3 @@ -3315,6 +3451,8 @@ FLUSH TABLES; EXPLAIN EXTENDED UPDATE t1 SET a=a+1 WHERE a>10 ORDER BY a+20; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 1 100.00 Using where; Using filesort +Warnings: +Note 1003 update `test`.`t1` set `test`.`t1`.`a` = `test`.`t1`.`a` + 1 where `test`.`t1`.`a` > 10 order by `test`.`t1`.`a` + 20 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 3 @@ -3341,6 +3479,61 @@ Handler_read_key 4 Sort_range 1 DROP TABLE t1; +#75 +CREATE TABLE t1 (id INT PRIMARY KEY, i INT); +# +# query: INSERT INTO t1 VALUES (3,10), (7,11), (3,11) ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); +# select: +# +EXPLAIN INSERT INTO t1 VALUES (3,10), (7,11), (3,11) ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);; +id select_type table type possible_keys key key_len ref rows Extra +1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL +FLUSH STATUS; +FLUSH TABLES; +EXPLAIN EXTENDED INSERT INTO t1 VALUES (3,10), (7,11), (3,11) ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 INSERT t1 ALL NULL NULL NULL NULL NULL 100.00 NULL +Warnings: +Note 1003 insert into `test`.`t1` values (3,10),(7,11),(3,11) on duplicate key update `test`.`t1`.`id` = last_insert_id(`test`.`t1`.`id`) +# Status of EXPLAIN EXTENDED query +Variable_name Value +Handler_read_key 4 +# Status of testing query execution: +Variable_name Value +Handler_read_key 4 +Handler_read_rnd 1 +Handler_write 3 + +DROP TABLE t1; +#76 +CREATE TABLE t1 (id INT PRIMARY KEY, i INT); +CREATE TABLE t2 (a INT, b INT); +INSERT INTO t2 VALUES (1,10), (3,10), (7,11), (3,11); +# +# query: INSERT INTO t1 SELECT * FROM t2 ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id); +# select: +# +EXPLAIN INSERT INTO t1 SELECT * FROM t2 ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 4 +FLUSH STATUS; +FLUSH TABLES; +EXPLAIN EXTENDED INSERT INTO t1 SELECT * FROM t2 ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id);; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 4 100.00 +Warnings: +Note 1003 insert into `test`.`t1` select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` on duplicate key update `test`.`t1`.`id` = last_insert_id(`test`.`t1`.`id`) +# Status of EXPLAIN EXTENDED query +Variable_name Value +Handler_read_key 7 +# Status of testing query execution: +Variable_name Value +Handler_read_key 7 +Handler_read_rnd 1 +Handler_read_rnd_next 5 +Handler_write 4 + +DROP TABLE t1,t2; # # Bug #12949629: CLIENT LOSES CONNECTION AFTER EXECUTING A PROCEDURE WITH # EXPLAIN UPDATE/DEL/INS diff --git a/mysql-test/main/opt_trace.result b/mysql-test/main/opt_trace.result index a343d5941f1..a8b391ffbe8 100644 --- a/mysql-test/main/opt_trace.result +++ b/mysql-test/main/opt_trace.result @@ -3766,7 +3766,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "select_id": 1, "steps": [ { - "expanded_query": "select NULL AS `NULL` from t0 join t1 where t0.a = t1.a and t1.a < 3" + "expanded_query": "delete from t0,t1 using t0 join t1 where t0.a = t1.a and t1.a < 3" } ] } diff --git a/mysql-test/main/ps.result b/mysql-test/main/ps.result index 673b18cb3b0..408b1ec2666 100644 --- a/mysql-test/main/ps.result +++ b/mysql-test/main/ps.result @@ -5566,11 +5566,15 @@ EXPLAIN EXTENDED UPDATE t3 SET c3 = ( SELECT COUNT(d1.c1) FROM ( SELECT a11.c1 F id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 0 100.00 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Note 1003 /* select#1 */ update `test`.`t3` set `test`.`t3`.`c3` = (/* select#2 */ select count(NULL) from `test`.`t1` `a11` straight_join `test`.`t2` `a21` join `test`.`t1` `a12` where 0) PREPARE stmt FROM "EXPLAIN EXTENDED UPDATE t3 SET c3 = ( SELECT COUNT(d1.c1) FROM ( SELECT a11.c1 FROM t1 AS a11 STRAIGHT_JOIN t2 AS a21 ON a21.c2 = a11.c1 JOIN t1 AS a12 ON a12.c1 = a11.c1 ) d1 )"; EXECUTE stmt; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 0 100.00 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Note 1003 /* select#1 */ update `test`.`t3` set `test`.`t3`.`c3` = (/* select#2 */ select count(NULL) from `test`.`t1` `a11` straight_join `test`.`t2` `a21` join `test`.`t1` `a12` where 0) DEALLOCATE PREPARE stmt; DROP TABLE t1, t2, t3; # diff --git a/mysql-test/suite/versioning/r/delete_history.result b/mysql-test/suite/versioning/r/delete_history.result index 8efe75a1ffd..7bb81111aa8 100644 --- a/mysql-test/suite/versioning/r/delete_history.result +++ b/mysql-test/suite/versioning/r/delete_history.result @@ -171,6 +171,8 @@ x explain extended delete history from t1 before system_time '2039-01-01 23:00'; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00 Using where +Warnings: +Note 1003 delete from `test`.`t1` FOR SYSTEM_TIME BEFORE TIMESTAMP '2039-01-01 23:00' where `test`.`t1`.`row_end` < '2039-01-01 23:00' and is_history(`test`.`t1`.`row_end`) create or replace procedure p() delete history from t1 before system_time '2039-01-01 23:00'; call p; select * from t1; diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 1b3fa3087e7..776dfffe113 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -1084,6 +1084,8 @@ int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, DBUG_RETURN(TRUE); select_lex->fix_prepare_information(thd, conds, &fake_conds); + if (!thd->lex->upd_del_where) + thd->lex->upd_del_where= *conds; DBUG_RETURN(FALSE); } diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc index 70e300997f9..6b76db8139e 100644 --- a/sql/sql_explain.cc +++ b/sql/sql_explain.cc @@ -161,7 +161,7 @@ void Explain_query::query_plan_ready() Send EXPLAIN output to the client. */ -int Explain_query::send_explain(THD *thd) +int Explain_query::send_explain(THD *thd, bool extended) { select_result *result; LEX *lex= thd->lex; @@ -174,8 +174,22 @@ int Explain_query::send_explain(THD *thd) if (thd->lex->explain_json) print_explain_json(result, thd->lex->analyze_stmt); else + { res= print_explain(result, lex->describe, thd->lex->analyze_stmt); - + if (extended) + { + char buff[1024]; + String str(buff,(uint32) sizeof(buff), system_charset_info); + str.length(0); + /* + The warnings system requires input in utf8, @see + mysqld_show_warnings(). + */ + lex->unit.print(&str, QT_EXPLAIN_EXTENDED); + push_warning(thd, Sql_condition::WARN_LEVEL_NOTE, + ER_YES, str.c_ptr_safe()); + } + } if (res) result->abort_result_set(); else @@ -185,6 +199,7 @@ int Explain_query::send_explain(THD *thd) } + /* The main entry point to print EXPLAIN of the entire query */ diff --git a/sql/sql_explain.h b/sql/sql_explain.h index 7b5042b9ccf..3add40419cf 100644 --- a/sql/sql_explain.h +++ b/sql/sql_explain.h @@ -474,7 +474,7 @@ public: bool is_analyze); /* Send tabular EXPLAIN to the client */ - int send_explain(THD *thd); + int send_explain(THD *thd, bool extended); /* Return tabular EXPLAIN output as a text string */ bool print_explain_str(THD *thd, String *out_str, bool is_analyze); diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index f31c9eab428..9a760614f6a 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -827,7 +827,8 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, save_insert_query_plan(thd, table_list); if (thd->lex->describe) { - retval= thd->lex->explain->send_explain(thd); + bool extended= thd->lex->describe & DESCRIBE_EXTENDED; + retval= thd->lex->explain->send_explain(thd, extended); goto abort; } @@ -1250,7 +1251,8 @@ values_loop_end: goto abort; if (thd->lex->analyze_stmt) { - retval= thd->lex->explain->send_explain(thd); + bool extended= thd->lex->describe & DESCRIBE_EXTENDED; + retval= thd->lex->explain->send_explain(thd, extended); goto abort; } DBUG_PRINT("info", ("touched: %llu copied: %llu updated: %llu deleted: %llu", diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index e14d9f7a740..e7689a99c22 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -780,6 +780,8 @@ void LEX::start(THD *thd_arg) frame_bottom_bound= NULL; win_spec= NULL; + upd_del_where= NULL; + vers_conditions.empty(); period_conditions.empty(); diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 769b17508cf..6170637ad77 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1417,6 +1417,10 @@ public: } bool setup_ref_array(THD *thd, uint order_group_num); void print(THD *thd, String *str, enum_query_type query_type); + void print_item_list(THD *thd, String *str, enum_query_type query_type); + void print_set_clause(THD *thd, String *str, enum_query_type query_type); + void print_on_duplicate_key_clause(THD *thd, String *str, + enum_query_type query_type); static void print_order(String *str, ORDER *order, enum_query_type query_type); @@ -3493,6 +3497,8 @@ public: Window_frame_bound *frame_bottom_bound; Window_spec *win_spec; + Item *upd_del_where; + /* System Versioning */ vers_select_conds_t vers_conditions; vers_select_conds_t period_conditions; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 1f1962a5d44..c495ae2d6c4 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4744,7 +4744,10 @@ mysql_execute_command(THD *thd) } if (!res && (explain || lex->analyze_stmt)) - res= thd->lex->explain->send_explain(thd); + { + bool extended= thd->lex->describe & DESCRIBE_EXTENDED; + res= thd->lex->explain->send_explain(thd, extended); + } /* revert changes for SP */ MYSQL_INSERT_SELECT_DONE(res, (ulong) thd->get_row_count_func()); @@ -4813,7 +4816,10 @@ mysql_execute_command(THD *thd) if (thd->lex->analyze_stmt || thd->lex->describe) { if (!res) - res= thd->lex->explain->send_explain(thd); + { + bool extended= thd->lex->describe & DESCRIBE_EXTENDED; + res= thd->lex->explain->send_explain(thd, extended); + } } delete sel_result; @@ -4875,7 +4881,10 @@ mysql_execute_command(THD *thd) else { if (lex->describe || lex->analyze_stmt) - res= thd->lex->explain->send_explain(thd); + { + bool extended= thd->lex->describe & DESCRIBE_EXTENDED; + res= thd->lex->explain->send_explain(thd, extended); + } } multi_delete_error: delete result; @@ -6463,7 +6472,10 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables) thd->protocol= save_protocol; } if (!res) - res= thd->lex->explain->send_explain(thd); + { + bool extended= thd->lex->describe & DESCRIBE_EXTENDED; + res= thd->lex->explain->send_explain(thd, extended); + } } } } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2c12d1c4c65..c4fc2d19156 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -305,6 +305,9 @@ static Item **get_sargable_cond(JOIN *join, TABLE *table); bool is_eq_cond_injected_for_split_opt(Item_func_eq *eq_item); +void print_list_item(String *str, List_item *list, + enum_query_type query_type); + #ifndef DBUG_OFF /* @@ -27981,6 +27984,162 @@ void TABLE_LIST::print(THD *thd, table_map eliminated_tables, String *str, } } +enum explainable_cmd_type +{ + SELECT_CMD, INSERT_CMD, REPLACE_CMD, UPDATE_CMD, DELETE_CMD, NO_CMD +}; + +static +const char * const explainable_cmd_name []= +{ + "select ", + "insert ", + "replace ", + "update ", + "delete ", +}; + +static +char const *get_explainable_cmd_name(enum explainable_cmd_type cmd) +{ + return explainable_cmd_name[cmd]; +} + +static +enum explainable_cmd_type get_explainable_cmd_type(THD *thd) +{ + switch (thd->lex->sql_command) { + case SQLCOM_SELECT: + return SELECT_CMD; + case SQLCOM_INSERT: + case SQLCOM_INSERT_SELECT: + return INSERT_CMD; + case SQLCOM_REPLACE: + case SQLCOM_REPLACE_SELECT: + return REPLACE_CMD; + case SQLCOM_UPDATE: + case SQLCOM_UPDATE_MULTI: + return UPDATE_CMD; + case SQLCOM_DELETE: + case SQLCOM_DELETE_MULTI: + return DELETE_CMD; + default: + return SELECT_CMD; + } +} + + +void TABLE_LIST::print_leaf_tables(THD *thd, String *str, + enum_query_type query_type) +{ + if (merge_underlying_list) + { + for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local) + tbl->print_leaf_tables(thd, str, query_type); + } + else + print(thd, 0, str, query_type); +} + + +void st_select_lex::print_item_list(THD *thd, String *str, + enum_query_type query_type) +{ + bool first= 1; + /* + outer_select() can not be used here because it is for name resolution + and will return NULL at any end of name resolution chain (view/derived) + */ + bool top_level= (get_master()->get_master() == 0); + List_iterator_fast it(item_list); + Item *item; + while ((item= it++)) + { + if (first) + first= 0; + else + str->append(','); + + if ((is_subquery_function() && item->is_autogenerated_name) || + !item->name.str) + { + /* + Do not print auto-generated aliases in subqueries. It has no purpose + in a view definition or other contexts where the query is printed. + */ + item->print(str, query_type); + } + else + { + /* + Do not print illegal names (if it is not top level SELECT). + Top level view checked (and correct name are assigned), + other cases of top level SELECT are not important, because + it is not "table field". + */ + if (top_level || + !item->is_autogenerated_name || + !check_column_name(item->name.str)) + item->print_item_w_name(str, query_type); + else + item->print(str, query_type); + } + } +} + + +void st_select_lex::print_set_clause(THD *thd, String *str, + enum_query_type query_type) +{ + bool first= 1; + /* + outer_select() can not be used here because it is for name resolution + and will return NULL at any end of name resolution chain (view/derived) + */ + List_iterator_fast it(item_list); + List_iterator_fast vt(thd->lex->value_list); + Item *item; + Item *val; + while ((item= it++, val= vt++ )) + { + if (first) + { + str->append(STRING_WITH_LEN(" set ")); + first= 0; + } + else + str->append(','); + + item->print(str, query_type); + str->append(STRING_WITH_LEN(" = ")); + val->print(str, query_type); + } +} + + +void st_select_lex::print_on_duplicate_key_clause(THD *thd, String *str, + enum_query_type query_type) +{ + bool first= 1; + List_iterator_fast it(thd->lex->update_list); + List_iterator_fast vt(thd->lex->value_list); + Item *item; + Item *val; + while ((item= it++, val= vt++ )) + { + if (first) + { + str->append(STRING_WITH_LEN(" on duplicate key update ")); + first= 0; + } + else + str->append(','); + + item->print(str, query_type); + str->append(STRING_WITH_LEN(" = ")); + val->print(str, query_type); + } +} void st_select_lex::print(THD *thd, String *str, enum_query_type query_type) { @@ -27998,6 +28157,61 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type) return; } + bool top_level= (get_master()->get_master() == 0); + enum explainable_cmd_type sel_type= SELECT_CMD; + if (top_level) + sel_type= get_explainable_cmd_type(thd); + + if (sel_type == INSERT_CMD || sel_type == REPLACE_CMD) + { + str->append(get_explainable_cmd_name(sel_type)); + str->append(STRING_WITH_LEN("into ")); + TABLE_LIST *tbl= thd->lex->query_tables; + while (tbl->merge_underlying_list) + tbl= tbl->merge_underlying_list; + tbl->print(thd, 0, str, query_type); + if (thd->lex->field_list.elements) + { + str->append ('('); + List_iterator_fast it(thd->lex->field_list); + Item *item; + bool first= true; + while ((item= it++)) + { + if (first) + first= false; + else + str->append(','); + str->append(item->name); + } + str->append(')'); + } + + str->append(' '); + + if (thd->lex->sql_command == SQLCOM_INSERT || + thd->lex->sql_command == SQLCOM_REPLACE) + { + str->append(STRING_WITH_LEN("values ")); + bool is_first_elem= true; + List_iterator_fast li(thd->lex->many_values); + List_item *list; + + while ((list= li++)) + { + if (is_first_elem) + is_first_elem= false; + else + str->append(','); + + print_list_item(str, list, query_type); + } + if (thd->lex->update_list.elements) + print_on_duplicate_key_clause(thd, str, query_type); + return; + } + } + if ((query_type & QT_SHOW_SELECT_NUMBER) && thd->lex->all_selects_list && thd->lex->all_selects_list->link_next && @@ -28021,7 +28235,10 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type) str->append(" */ "); } - str->append(STRING_WITH_LEN("select ")); + if (sel_type == SELECT_CMD || + sel_type == INSERT_CMD || + sel_type == REPLACE_CMD) + str->append(STRING_WITH_LEN("select ")); if (join && join->cleaned) { @@ -28067,56 +28284,65 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type) } //Item List - bool first= 1; - /* - outer_select() can not be used here because it is for name resolution - and will return NULL at any end of name resolution chain (view/derived) - */ - bool top_level= (get_master()->get_master() == 0); - List_iterator_fast it(item_list); - Item *item; - while ((item= it++)) - { - if (first) - first= 0; - else - str->append(','); - - if ((is_subquery_function() && item->is_autogenerated_name) || - !item->name.str) - { - /* - Do not print auto-generated aliases in subqueries. It has no purpose - in a view definition or other contexts where the query is printed. - */ - item->print(str, query_type); - } - else - { - /* - Do not print illegal names (if it is not top level SELECT). - Top level view checked (and correct name are assigned), - other cases of top level SELECT are not important, because - it is not "table field". - */ - if (top_level || - !item->is_autogenerated_name || - !check_column_name(item->name.str)) - item->print_item_w_name(str, query_type); - else - item->print(str, query_type); - } - } - + if (sel_type == SELECT_CMD || + sel_type == INSERT_CMD || + sel_type == REPLACE_CMD) + print_item_list(thd, str, query_type); /* from clause TODO: support USING/FORCE/IGNORE index */ if (table_list.elements) { - str->append(STRING_WITH_LEN(" from ")); - /* go through join tree */ - print_join(thd, join? join->eliminated_tables: 0, str, &top_join_list, query_type); + if (sel_type == SELECT_CMD || + sel_type == INSERT_CMD || + sel_type == REPLACE_CMD) + { + str->append(STRING_WITH_LEN(" from ")); + /* go through join tree */ + print_join(thd, join? join->eliminated_tables: 0, str, &top_join_list, + query_type); + } + if (sel_type == UPDATE_CMD || sel_type == DELETE_CMD) + str->append(STRING_WITH_LEN(get_explainable_cmd_name(sel_type))); + if (sel_type == DELETE_CMD) + { + str->append(STRING_WITH_LEN(" from ")); + bool first= true; + for (TABLE_LIST *target_tbl= thd->lex->auxiliary_table_list.first; + target_tbl; + target_tbl= target_tbl->next_local) + { + if (first) + first= false; + else + str->append(','); + target_tbl->correspondent_table->print_leaf_tables(thd, str, + query_type); + } + + if (!first) + str->append(STRING_WITH_LEN(" using ")); + } + if (sel_type == UPDATE_CMD || sel_type == DELETE_CMD) + { + if (join) + print_join(thd, 0, str, &top_join_list, query_type); + else + { + bool first= true; + List_iterator_fast li(leaf_tables); + TABLE_LIST *tbl; + while ((tbl= li++)) + { + if (first) + first= false; + else + str->append(','); + tbl->print(thd, 0, str, query_type); + } + } + } } else if (where) { @@ -28127,10 +28353,15 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type) str->append(STRING_WITH_LEN(" from DUAL ")); } + if (sel_type == UPDATE_CMD) + print_set_clause(thd, str, query_type); + // Where Item *cur_where= where; if (join) cur_where= join->conds; + else if (sel_type == UPDATE_CMD || sel_type == DELETE_CMD) + cur_where= thd->lex->upd_del_where; if (cur_where || cond_value != Item::COND_UNDEF) { str->append(STRING_WITH_LEN(" where ")); @@ -28187,6 +28418,15 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type) else if (lock_type == TL_WRITE) str->append(" for update"); + if ((sel_type == INSERT_CMD || sel_type == REPLACE_CMD) && + thd->lex->update_list.elements) + print_on_duplicate_key_clause(thd, str, query_type); + + // returning clause + if (sel_type == DELETE_CMD && !item_list.elements) + { + print_item_list(thd, str, query_type); + } // PROCEDURE unsupported here } diff --git a/sql/sql_update.cc b/sql/sql_update.cc index a2980717018..834fa6111e5 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -1371,7 +1371,8 @@ produce_explain_and_leave: goto err; emit_explain_and_leave: - int err2= thd->lex->explain->send_explain(thd); + bool extended= thd->lex->describe & DESCRIBE_EXTENDED; + int err2= thd->lex->explain->send_explain(thd, extended); delete select; free_underlaid_joins(thd, select_lex); @@ -1445,6 +1446,8 @@ bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list, select_lex->fix_prepare_information(thd, conds, &fake_conds); + if (!thd->lex->upd_del_where) + thd->lex->upd_del_where= *conds; DBUG_RETURN(FALSE); } @@ -1974,7 +1977,10 @@ bool mysql_multi_update(THD *thd, TABLE_LIST *table_list, List *fields, else { if (thd->lex->describe || thd->lex->analyze_stmt) - res= thd->lex->explain->send_explain(thd); + { + bool extended= thd->lex->describe & DESCRIBE_EXTENDED; + res= thd->lex->explain->send_explain(thd, extended); + } } thd->abort_on_warning= 0; DBUG_RETURN(res); diff --git a/sql/table.h b/sql/table.h index c4b0d78959d..6f7f4e63473 100644 --- a/sql/table.h +++ b/sql/table.h @@ -2708,6 +2708,8 @@ struct TABLE_LIST } void print(THD *thd, table_map eliminated_tables, String *str, enum_query_type query_type); + void print_leaf_tables(THD *thd, String *str, + enum_query_type query_type); bool check_single_table(TABLE_LIST **table, table_map map, TABLE_LIST *view); bool set_insert_values(MEM_ROOT *mem_root); From d575b07c862daf68ddb124486ca8e829cd23cdd9 Mon Sep 17 00:00:00 2001 From: Debjyoti Date: Mon, 6 Mar 2023 23:02:03 +0530 Subject: [PATCH 067/260] MDEV-24453 Added support for a 5th --verbose parameter in mariadb-upgrade to show mysql results for mysql_fix_privilege_tables --- client/mysql_upgrade.c | 14 ++++++++++---- man/mysql_upgrade.1 | 3 ++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 99c9e7415a7..78297320b6e 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -75,6 +75,8 @@ char upgrade_from_version[sizeof("10.20.456-MariaDB")+30]; static my_bool opt_write_binlog; +static void print_conn_args(const char *tool_name); + #define OPT_SILENT OPT_MAX_CLIENT_OPTION static struct my_option my_long_options[]= @@ -154,7 +156,10 @@ static struct my_option my_long_options[]= GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"user", 'u', "User for login.", &opt_user, &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"verbose", 'v', "Display more output about the process; Using it twice will print connection argument; Using it 3 times will print out all CHECK, RENAME and ALTER TABLE during the check phase.", + {"verbose", 'v', "Display more output about the process; Using it twice will print connection argument;" + "Using it 3 times will print out all CHECK, RENAME and ALTER TABLE during the check phase;" + "Using it 4 times (added in MariaDB 10.0.14) will also write out all mariadb-check commands used;" + "Using it 5 times will print all the mariadb commands used and their results while running mysql_fix_privilege_tables script.", &opt_not_used, &opt_not_used, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -208,6 +213,7 @@ static void die(const char *fmt, ...) DBUG_ENTER("die"); /* Print the error message */ + print_conn_args("mariadb-check"); fflush(stdout); va_start(args, fmt); if (fmt) @@ -622,6 +628,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res, "--database=mysql", "--batch", /* Turns off pager etc. */ force ? "--force": "--skip-force", + opt_verbose >= 5 ? "--verbose" : "", ds_res || opt_silent ? "--silent": "", "<", query_file_path, @@ -1243,9 +1250,7 @@ static int run_sql_fix_privilege_tables(void) dynstr_append(&ds_script, *query_ptr); } - run_query(ds_script.str, - &ds_result, /* Collect result */ - TRUE); + run_query(ds_script.str, (opt_verbose >= 5) ? NULL : &ds_result, TRUE); { /* @@ -1413,6 +1418,7 @@ int main(int argc, char **argv) DBUG_ASSERT(phase == phases_total); end: + print_conn_args("mariadb-check"); free_used_memory(); my_end(my_end_arg); exit(0); diff --git a/man/mysql_upgrade.1 b/man/mysql_upgrade.1 index 62f13ae2e52..09ade95b942 100644 --- a/man/mysql_upgrade.1 +++ b/man/mysql_upgrade.1 @@ -656,7 +656,8 @@ The MariaDB user name to use when connecting to the server and not using the cur Display more output about the process\&. Using it twice will print connection arguments; using it 3 times will print out all CHECK, RENAME and ALTER TABLE commands used during the check phase; using it 4 times (added in MariaDB 10.0.14) -will also write out all mysqlcheck commands used\&. +will also write out all mariadb-check commands used; using it 5 times will print all +the mariadb commands used and their results while running mysql_fix_privilege_tables script\&. .RE .sp .RS 4 From 4c226c185015faa40fbd9b5e70bca5d819f2c3d5 Mon Sep 17 00:00:00 2001 From: Vlad Lesin Date: Thu, 23 Mar 2023 16:26:17 +0300 Subject: [PATCH 068/260] MDEV-29050 mariabackup issues error messages during InnoDB tablespaces export on partial backup preparing The solution is to suppress error messages for missing tablespaces if mariabackup is launched with "--prepare --export" options. "mariabackup --prepare --export" invokes itself with --mysqld parameter. If the parameter is set, then it starts server to feed "FLUSH TABLES ... FOR EXPORT;" queries for exported tablespaces. This is "normal" server start, that's why new srv_operation value is introduced. Reviewed by Marko Makela. --- extra/mariabackup/xtrabackup.cc | 1 + .../suite/mariabackup/partial_exclude.result | 7 ++++ .../suite/mariabackup/partial_exclude.test | 20 ++++++++++ storage/innobase/fil/fil0fil.cc | 16 ++++++-- storage/innobase/fsp/fsp0file.cc | 2 +- storage/innobase/fsp/fsp0sysspace.cc | 2 +- storage/innobase/include/os0file.h | 15 ++++---- storage/innobase/include/srv0srv.h | 3 ++ storage/innobase/log/log0recv.cc | 11 +++--- storage/innobase/os/os0file.cc | 38 ++++--------------- storage/innobase/srv/srv0start.cc | 13 +++++-- 11 files changed, 76 insertions(+), 52 deletions(-) diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index d2ce3395da8..5e01e64f490 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -6830,6 +6830,7 @@ int main(int argc, char **argv) */ if (strcmp(argv[1], "--mysqld") == 0) { + srv_operation= SRV_OPERATION_EXPORT_RESTORED; extern int mysqld_main(int argc, char **argv); argc--; argv++; diff --git a/mysql-test/suite/mariabackup/partial_exclude.result b/mysql-test/suite/mariabackup/partial_exclude.result index 628613040e0..9f4c1042d93 100644 --- a/mysql-test/suite/mariabackup/partial_exclude.result +++ b/mysql-test/suite/mariabackup/partial_exclude.result @@ -8,8 +8,15 @@ CREATE DATABASE db2; USE db2; CREATE TABLE t1(i INT) ENGINE INNODB; USE test; +BEGIN; +INSERT INTO db2.t1 VALUES(20); +INSERT INTO test.t1 VALUES(20); +INSERT INTO test.t2 VALUES(20); # xtrabackup backup +COMMIT; t1.ibd DROP TABLE t1; DROP TABLE t2; DROP DATABASE db2; +NOT FOUND /Operating system error number/ in backup.log +NOT FOUND /Could not find a valid tablespace file for/ in backup.log diff --git a/mysql-test/suite/mariabackup/partial_exclude.test b/mysql-test/suite/mariabackup/partial_exclude.test index 99d14e58231..beff778e7bc 100644 --- a/mysql-test/suite/mariabackup/partial_exclude.test +++ b/mysql-test/suite/mariabackup/partial_exclude.test @@ -19,6 +19,11 @@ CREATE TABLE t1(i INT) ENGINE INNODB; USE test; +BEGIN; +INSERT INTO db2.t1 VALUES(20); +INSERT INTO test.t1 VALUES(20); +INSERT INTO test.t2 VALUES(20); + echo # xtrabackup backup; let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; @@ -26,6 +31,8 @@ let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup "--tables-exclude=test.*2" "--databases-exclude=db2" --target-dir=$targetdir; --enable_result_log +COMMIT; + # check that only t1 table is in backup (t2 is excluded) list_files $targetdir/test *.ibd; # check that db2 database is not in the backup (excluded) @@ -46,4 +53,17 @@ DROP DATABASE db2; rmdir $MYSQLD_DATADIR/db3; rmdir $MYSQLD_DATADIR/db4; rmdir $MYSQLD_DATADIR/db5; + +--let $backup_log=$MYSQLTEST_VARDIR/tmp/backup.log +--disable_result_log +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --export --prepare --target-dir="$targetdir" > $backup_log; +--enable_result_log + +--let SEARCH_FILE=$backup_log +--let SEARCH_PATTERN=Operating system error number +--source include/search_pattern_in_file.inc +--let SEARCH_PATTERN=Could not find a valid tablespace file for +--source include/search_pattern_in_file.inc +--remove_file $backup_log + rmdir $targetdir; diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 53387657ebc..ebeb1f66101 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -3235,10 +3235,15 @@ corrupted: } } + const bool operation_not_for_export = + srv_operation != SRV_OPERATION_RESTORE_EXPORT + && srv_operation != SRV_OPERATION_EXPORT_RESTORED; + /* Always look for a file at the default location. But don't log an error if the tablespace is already open in remote or dict. */ ut_a(df_default.filepath()); - const bool strict = (tablespaces_found == 0); + const bool strict = operation_not_for_export + && (tablespaces_found == 0); if (df_default.open_read_only(strict) == DB_SUCCESS) { ut_ad(df_default.is_open()); ++tablespaces_found; @@ -3284,9 +3289,11 @@ corrupted: /* Make sense of these three possible locations. First, bail out if no tablespace files were found. */ if (valid_tablespaces_found == 0) { - os_file_get_last_error(true); - ib::error() << "Could not find a valid tablespace file for `" - << tablename << "`. " << TROUBLESHOOT_DATADICT_MSG; + os_file_get_last_error( + operation_not_for_export, !operation_not_for_export); + if (operation_not_for_export) + ib::error() << "Could not find a valid tablespace file for `" + << tablename << "`. " << TROUBLESHOOT_DATADICT_MSG; goto corrupted; } if (!validate) { @@ -3617,6 +3624,7 @@ fil_ibd_discover( case SRV_OPERATION_RESTORE: break; case SRV_OPERATION_NORMAL: + case SRV_OPERATION_EXPORT_RESTORED: df_rem_per.set_name(db); if (df_rem_per.open_link_file() != DB_SUCCESS) { break; diff --git a/storage/innobase/fsp/fsp0file.cc b/storage/innobase/fsp/fsp0file.cc index 5f6d70bb3b5..8d89c98e383 100644 --- a/storage/innobase/fsp/fsp0file.cc +++ b/storage/innobase/fsp/fsp0file.cc @@ -787,7 +787,7 @@ the double write buffer. bool Datafile::restore_from_doublewrite() { - if (srv_operation != SRV_OPERATION_NORMAL) { + if (srv_operation > SRV_OPERATION_EXPORT_RESTORED) { return true; } diff --git a/storage/innobase/fsp/fsp0sysspace.cc b/storage/innobase/fsp/fsp0sysspace.cc index 5fcf8ea4e51..dcab09e5eec 100644 --- a/storage/innobase/fsp/fsp0sysspace.cc +++ b/storage/innobase/fsp/fsp0sysspace.cc @@ -580,7 +580,7 @@ SysTablespace::read_lsn_and_check_flags(lsn_t* flushed_lsn) ut_a(it->order() == 0); - if (srv_operation == SRV_OPERATION_NORMAL) { + if (srv_operation <= SRV_OPERATION_EXPORT_RESTORED) { buf_dblwr_init_or_load_pages(it->handle(), it->filepath()); } diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index be363b8eea5..20fcc0b64b8 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -1210,13 +1210,14 @@ os_file_flush_func( /** Retrieves the last error number if an error occurs in a file io function. The number should be retrieved before any other OS calls (because they may overwrite the error number). If the number is not known to this program, -the OS error number + 100 is returned. -@param[in] report true if we want an error message printed - for all errors -@return error number, or OS error number + 100 */ -ulint -os_file_get_last_error( - bool report); +the OS error number + OS_FILE_ERROR_MAX is returned. +@param[in] report_all_errors true if we want an error message + printed of all errors +@param[in] on_error_silent true then don't print any diagnostic + to the log +@return error number, or OS error number + OS_FILE_ERROR_MAX */ +ulint os_file_get_last_error(bool report_all_errors, + bool on_error_silent= false); /** NOTE! Use the corresponding macro os_file_read(), not directly this function! diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 6d9d162e78e..1624619e897 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -469,6 +469,9 @@ extern my_bool innodb_encrypt_temporary_tables; enum srv_operation_mode { /** Normal mode (MariaDB Server) */ SRV_OPERATION_NORMAL, + /** Mariabackup is executing server to export already restored + tablespaces */ + SRV_OPERATION_EXPORT_RESTORED, /** Mariabackup taking a backup */ SRV_OPERATION_BACKUP, /** Mariabackup restoring a backup for subsequent --copy-back */ diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 3ecbcb180c9..eb4cb910679 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -406,7 +406,7 @@ fil_name_process( return; } - ut_ad(srv_operation == SRV_OPERATION_NORMAL + ut_ad(srv_operation <= SRV_OPERATION_EXPORT_RESTORED || is_mariabackup_restore_or_export()); /* We will also insert space=NULL into the map, so that @@ -2286,7 +2286,7 @@ buf_block_t* recv_recovery_create_page_low(const page_id_t page_id) performed as part of the operation */ void recv_apply_hashed_log_recs(bool last_batch) { - ut_ad(srv_operation == SRV_OPERATION_NORMAL + ut_ad(srv_operation <= SRV_OPERATION_EXPORT_RESTORED || is_mariabackup_restore_or_export()); mutex_enter(&recv_sys.mutex); @@ -3603,7 +3603,7 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn) byte* buf; dberr_t err = DB_SUCCESS; - ut_ad(srv_operation == SRV_OPERATION_NORMAL + ut_ad(srv_operation <= SRV_OPERATION_EXPORT_RESTORED || is_mariabackup_restore_or_export()); /* Initialize red-black tree for fast insertions into the @@ -3797,7 +3797,7 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn) recv_sys.parse_start_lsn = checkpoint_lsn; - if (srv_operation == SRV_OPERATION_NORMAL) { + if (srv_operation <= SRV_OPERATION_EXPORT_RESTORED) { buf_dblwr_process(); } @@ -3862,7 +3862,8 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn) log_sys.last_checkpoint_lsn = checkpoint_lsn; - if (!srv_read_only_mode && srv_operation == SRV_OPERATION_NORMAL) { + if (!srv_read_only_mode + && srv_operation <= SRV_OPERATION_EXPORT_RESTORED) { /* Write a MLOG_CHECKPOINT marker as the first thing, before generating any other redo log. This ensures that subsequent crash recovery will be possible even diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index b40e41cbab9..832f5e05658 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -2287,15 +2287,11 @@ The number should be retrieved before any other OS calls (because they may overwrite the error number). If the number is not known to this program, the OS error number + OS_FILE_ERROR_MAX is returned. @param[in] report_all_errors true if we want an error message - printed of all errors + printed of all errors @param[in] on_error_silent true then don't print any diagnostic - to the log + to the log @return error number, or OS error number + OS_FILE_ERROR_MAX */ -static -ulint -os_file_get_last_error_low( - bool report_all_errors, - bool on_error_silent) +ulint os_file_get_last_error(bool report_all_errors, bool on_error_silent) { int err = errno; @@ -3407,16 +3403,12 @@ os_file_flush_func( The number should be retrieved before any other OS calls (because they may overwrite the error number). If the number is not known to this program, the OS error number + 100 is returned. -@param[in] report_all_errors true if we want an error message printed - of all errors +@param[in] report_all_errors true if we want an error message +printed of all errors @param[in] on_error_silent true then don't print any diagnostic - to the log + to the log @return error number, or OS error number + 100 */ -static -ulint -os_file_get_last_error_low( - bool report_all_errors, - bool on_error_silent) +ulint os_file_get_last_error(bool report_all_errors, bool on_error_silent) { ulint err = (ulint) GetLastError(); @@ -4700,20 +4692,6 @@ os_file_read_page( return err; } -/** Retrieves the last error number if an error occurs in a file io function. -The number should be retrieved before any other OS calls (because they may -overwrite the error number). If the number is not known to this program, -the OS error number + 100 is returned. -@param[in] report_all_errors true if we want an error printed - for all errors -@return error number, or OS error number + 100 */ -ulint -os_file_get_last_error( - bool report_all_errors) -{ - return(os_file_get_last_error_low(report_all_errors, false)); -} - /** Handle errors for file operations. @param[in] name name of a file or NULL @param[in] operation operation @@ -4730,7 +4708,7 @@ os_file_handle_error_cond_exit( { ulint err; - err = os_file_get_last_error_low(false, on_error_silent); + err = os_file_get_last_error(false, on_error_silent); switch (err) { case OS_FILE_DISK_FULL: diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 30e2d7c6fbb..b8b74263eba 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -810,7 +810,7 @@ srv_undo_tablespaces_init(bool create_new_db) srv_undo_tablespaces_open = 0; ut_a(srv_undo_tablespaces <= TRX_SYS_N_RSEGS); - ut_a(!create_new_db || srv_operation == SRV_OPERATION_NORMAL); + ut_a(!create_new_db || srv_operation <= SRV_OPERATION_EXPORT_RESTORED); if (srv_undo_tablespaces == 1) { /* 1 is not allowed, make it 0 */ srv_undo_tablespaces = 0; @@ -876,6 +876,7 @@ srv_undo_tablespaces_init(bool create_new_db) prev_space_id = srv_undo_space_id_start - 1; break; case SRV_OPERATION_NORMAL: + case SRV_OPERATION_EXPORT_RESTORED: case SRV_OPERATION_RESTORE_ROLLBACK_XA: case SRV_OPERATION_RESTORE: case SRV_OPERATION_RESTORE_EXPORT: @@ -1132,6 +1133,7 @@ srv_shutdown_all_bg_threads() case SRV_OPERATION_RESTORE_DELTA: break; case SRV_OPERATION_NORMAL: + case SRV_OPERATION_EXPORT_RESTORED: case SRV_OPERATION_RESTORE_ROLLBACK_XA: case SRV_OPERATION_RESTORE: case SRV_OPERATION_RESTORE_EXPORT: @@ -1310,7 +1312,7 @@ dberr_t srv_start(bool create_new_db) size_t dirnamelen; unsigned i = 0; - ut_ad(srv_operation == SRV_OPERATION_NORMAL + ut_ad(srv_operation <= SRV_OPERATION_EXPORT_RESTORED || is_mariabackup_restore_or_export()); @@ -1894,6 +1896,7 @@ files_checked: switch (srv_operation) { case SRV_OPERATION_NORMAL: + case SRV_OPERATION_EXPORT_RESTORED: case SRV_OPERATION_RESTORE_ROLLBACK_XA: case SRV_OPERATION_RESTORE_EXPORT: /* Initialize the change buffer. */ @@ -2304,7 +2307,8 @@ skip_monitors: return(srv_init_abort(err)); } - if (!srv_read_only_mode && srv_operation == SRV_OPERATION_NORMAL) { + if (!srv_read_only_mode + && srv_operation <= SRV_OPERATION_EXPORT_RESTORED) { /* Initialize the innodb_temporary tablespace and keep it open until shutdown. */ err = srv_open_tmp_tablespace(create_new_db); @@ -2326,7 +2330,7 @@ skip_monitors: } if (!srv_read_only_mode - && (srv_operation == SRV_OPERATION_NORMAL + && (srv_operation <= SRV_OPERATION_EXPORT_RESTORED || srv_operation == SRV_OPERATION_RESTORE_ROLLBACK_XA) && srv_force_recovery < SRV_FORCE_NO_BACKGROUND) { @@ -2465,6 +2469,7 @@ void innodb_shutdown() fil_close_all_files(); break; case SRV_OPERATION_NORMAL: + case SRV_OPERATION_EXPORT_RESTORED: /* Shut down the persistent files. */ logs_empty_and_mark_files_at_shutdown(); From 113bef50e33a838c5cb637ef4a042cbcad79e7a2 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 23 Mar 2023 09:41:45 +1100 Subject: [PATCH 069/260] MDEV-30581 Add a testcase for MDEV-29904 --- storage/spider/mysql-test/spider/bugfix/r/mdev_29904.result | 4 ++++ storage/spider/mysql-test/spider/bugfix/t/mdev_29904.test | 6 ++++++ 2 files changed, 10 insertions(+) create mode 100644 storage/spider/mysql-test/spider/bugfix/r/mdev_29904.result create mode 100644 storage/spider/mysql-test/spider/bugfix/t/mdev_29904.test diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29904.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29904.result new file mode 100644 index 00000000000..c89309a514d --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29904.result @@ -0,0 +1,4 @@ +# +# MDEV-29904 SPIDER plugin initialization fails upon startup +# +# restart: --plugin-load-add=ha_spider diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29904.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29904.test new file mode 100644 index 00000000000..d3dcb363890 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29904.test @@ -0,0 +1,6 @@ +--echo # +--echo # MDEV-29904 SPIDER plugin initialization fails upon startup +--echo # + +--let $restart_parameters=--plugin-load-add=ha_spider +--source include/restart_mysqld.inc From e093e5abbed1a7883b8a78935c11505bd0bcb0d6 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 15 Dec 2022 12:38:27 +1100 Subject: [PATCH 070/260] MDEV-30276 - wsrep_sst_mariabackup to use mariadb-backup rather than mariabackup internally, and change and messages accordingly. --- scripts/wsrep_sst_mariabackup.sh | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh index 7e26af83701..6ec975f5a59 100644 --- a/scripts/wsrep_sst_mariabackup.sh +++ b/scripts/wsrep_sst_mariabackup.sh @@ -95,9 +95,9 @@ sst_ver=1 declare -a RC -BACKUP_BIN=$(commandex 'mariabackup') +BACKUP_BIN=$(commandex 'mariadb-backup') if [ -z "$BACKUP_BIN" ]; then - wsrep_log_error 'mariabackup binary not found in path' + wsrep_log_error 'mariadb-backup binary not found in path' exit 42 fi @@ -685,7 +685,7 @@ cleanup_at_exit() if [ -n "$BACKUP_PID" ]; then if check_pid "$BACKUP_PID" 1; then wsrep_log_error \ - "mariabackup process is still running. Killing..." + "mariadb-backup process is still running. Killing..." cleanup_pid $CHECK_PID "$BACKUP_PID" fi fi @@ -761,7 +761,7 @@ check_extra() if [ "$thread_handling" = 'pool-of-threads' ]; then local eport=$(parse_cnf '--mysqld' 'extra-port') if [ -n "$eport" ]; then - # mariabackup works only locally. + # mariadb-backup works only locally. # Hence, setting host to 127.0.0.1 unconditionally: wsrep_log_info "SST through extra_port $eport" INNOEXTRA="$INNOEXTRA --host=127.0.0.1 --port=$eport" @@ -930,7 +930,7 @@ cd "$OLD_PWD" if [ $ssyslog -eq 1 ]; then if [ -n "$(commandex logger)" ]; then - wsrep_log_info "Logging all stderr of SST/mariabackup to syslog" + wsrep_log_info "Logging all stderr of SST/mariadb-backup to syslog" exec 2> >(logger -p daemon.err -t ${ssystag}wsrep-sst-$WSREP_SST_OPT_ROLE) @@ -1053,11 +1053,11 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then xtmpdir=$(TMPDIR="$tmpdir"; mktemp '-d') fi - wsrep_log_info "Using '$xtmpdir' as mariabackup temporary directory" + wsrep_log_info "Using '$xtmpdir' as mariadb-backup temporary directory" tmpopts=" --tmpdir='$xtmpdir'" itmpdir="$(mktemp -d)" - wsrep_log_info "Using '$itmpdir' as mariabackup working directory" + wsrep_log_info "Using '$itmpdir' as mariadb-abackup working directory" usrst=0 if [ -n "$WSREP_SST_OPT_USER" ]; then @@ -1148,7 +1148,7 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then fi # if compression is enabled for backup files, then add the - # appropriate options to the mariabackup command line: + # appropriate options to the mariadb-backup command line: if [ "$compress" != 'none' ]; then iopts="--compress${compress:+=$compress}${iopts:+ }$iopts" if [ -n "$compress_threads" ]; then @@ -1170,7 +1170,7 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then set -e if [ ${RC[0]} -ne 0 ]; then - wsrep_log_error "mariabackup finished with error: ${RC[0]}." \ + wsrep_log_error "mariadb-backup finished with error: ${RC[0]}." \ "Check syslog or '$INNOBACKUPLOG' for details" exit 22 elif [ ${RC[$(( ${#RC[@]}-1 ))]} -eq 1 ]; then @@ -1178,7 +1178,7 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then exit 22 fi - # mariabackup implicitly writes PID to fixed location in $xtmpdir + # mariadb-backup implicitly writes PID to fixed location in $xtmpdir BACKUP_PID="$xtmpdir/xtrabackup_pid" else # BYPASS FOR IST @@ -1450,14 +1450,14 @@ else # joiner if [ ! -s "$DATA/xtrabackup_checkpoints" ]; then wsrep_log_error "xtrabackup_checkpoints missing," \ - "failed mariabackup/SST on donor" + "failed mariadb-backup/SST on donor" exit 2 fi - # Compact backups are not supported by mariabackup + # Compact backups are not supported by mariadb-backup if grep -qw -F 'compact = 1' "$DATA/xtrabackup_checkpoints"; then wsrep_log_info "Index compaction detected" - wsrel_log_error "Compact backups are not supported by mariabackup" + wsrel_log_error "Compact backups are not supported by mariadb-backup" exit 2 fi @@ -1509,9 +1509,9 @@ else # joiner wsrep_log_info "Preparing the backup at $DATA" setup_commands - timeit 'mariabackup prepare stage' "$INNOAPPLY" + timeit 'mariadb-backup prepare stage' "$INNOAPPLY" if [ $? -ne 0 ]; then - wsrep_log_error "mariabackup apply finished with errors." \ + wsrep_log_error "mariadb-backup apply finished with errors." \ "Check syslog or '$INNOAPPLYLOG' for details." exit 22 fi @@ -1556,7 +1556,7 @@ else # joiner MAGIC_FILE="$TDATA/$INFO_FILE" wsrep_log_info "Moving the backup to $TDATA" - timeit 'mariabackup move stage' "$INNOMOVE" + timeit 'mariadb-backup move stage' "$INNOMOVE" if [ $? -eq 0 ]; then wsrep_log_info "Move successful, removing $DATA" rm -rf "$DATA" From 03b4a2d6e5b3d6e4bd88c3451cbff8ba4df7bd71 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 29 Mar 2023 11:56:44 +0400 Subject: [PATCH 071/260] MDEV-26765 UNIX_TIMESTAMP(CURRENT_TIME()) return null ?!? Problem: UNIX_TIMESTAMP() called for a expression of the TIME data type returned NULL. Inside Type_handler_timestamp_common::Item_val_native_with_conversion the call for item->get_date() did not convert TIME to DATETIME automatically (because it does not have to, by design). As a result, Type_handler_timestamp_common::TIME_to_native() received a MYSQL_TIME value with zero date 0000-00-00 and therefore returned "true" (indicating SQL NULL value). Fix: Removing the call for item->get_date(). Instantiating Datetime(item) instead. This forces automatic TIME to DATETIME conversion (unless @@old_mode is zero_date_time_cast). --- mysql-test/main/old-mode.result | 36 ++++++++++++++++++++++++++++++++ mysql-test/main/old-mode.test | 20 ++++++++++++++++++ mysql-test/main/type_time.result | 26 +++++++++++++++++++++++ mysql-test/main/type_time.test | 19 +++++++++++++++++ sql/sql_type.cc | 6 +++--- 5 files changed, 104 insertions(+), 3 deletions(-) diff --git a/mysql-test/main/old-mode.result b/mysql-test/main/old-mode.result index e0a3412bbdf..bb65acd54ce 100644 --- a/mysql-test/main/old-mode.result +++ b/mysql-test/main/old-mode.result @@ -221,3 +221,39 @@ a UNIX_TIMESTAMP(t1.a) a UNIX_TIMESTAMP(t2.a) DROP TABLE t1; SET time_zone=DEFAULT; SET global mysql56_temporal_format=true; +# +# MDEV-26765 UNIX_TIMESTAMP(CURRENT_TIME()) return null ?!? +# +SET old_mode=zero_date_time_cast; +SET @@time_zone='+00:00'; +SET timestamp=1234567; +SELECT CURRENT_TIMESTAMP; +CURRENT_TIMESTAMP +1970-01-15 06:56:07 +SELECT UNIX_TIMESTAMP(CURRENT_TIME()); +UNIX_TIMESTAMP(CURRENT_TIME()) +NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '06:56:07' +SELECT UNIX_TIMESTAMP(TIME'06:56:07'); +UNIX_TIMESTAMP(TIME'06:56:07') +NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '06:56:07' +SELECT UNIX_TIMESTAMP(TIME'10:20:30'); +UNIX_TIMESTAMP(TIME'10:20:30') +NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '10:20:30' +CREATE OR REPLACE TABLE t1 (a TIME); +INSERT INTO t1 VALUES (TIME'06:56:07'),('10:20:30'); +SELECT UNIX_TIMESTAMP(a) FROM t1 ORDER BY a; +UNIX_TIMESTAMP(a) +NULL +NULL +Warnings: +Warning 1264 Out of range value for column 'a' at row 1 +Warning 1264 Out of range value for column 'a' at row 2 +DROP TABLE t1; +SET @@time_zone=DEFAULT; +SET TIMESTAMP=DEFAULT; diff --git a/mysql-test/main/old-mode.test b/mysql-test/main/old-mode.test index a09de1cf87d..d3fc254110d 100644 --- a/mysql-test/main/old-mode.test +++ b/mysql-test/main/old-mode.test @@ -149,3 +149,23 @@ SELECT t1.a, UNIX_TIMESTAMP(t1.a), t2.a, UNIX_TIMESTAMP(t2.a) FROM t1 t1, t1 t2 DROP TABLE t1; SET time_zone=DEFAULT; SET global mysql56_temporal_format=true; + + +--echo # +--echo # MDEV-26765 UNIX_TIMESTAMP(CURRENT_TIME()) return null ?!? +--echo # + +SET old_mode=zero_date_time_cast; +SET @@time_zone='+00:00'; +SET timestamp=1234567; +SELECT CURRENT_TIMESTAMP; +SELECT UNIX_TIMESTAMP(CURRENT_TIME()); +SELECT UNIX_TIMESTAMP(TIME'06:56:07'); +SELECT UNIX_TIMESTAMP(TIME'10:20:30'); +CREATE OR REPLACE TABLE t1 (a TIME); +INSERT INTO t1 VALUES (TIME'06:56:07'),('10:20:30'); +SELECT UNIX_TIMESTAMP(a) FROM t1 ORDER BY a; +DROP TABLE t1; + +SET @@time_zone=DEFAULT; +SET TIMESTAMP=DEFAULT; diff --git a/mysql-test/main/type_time.result b/mysql-test/main/type_time.result index e383704fdb8..7b40328892d 100644 --- a/mysql-test/main/type_time.result +++ b/mysql-test/main/type_time.result @@ -2420,5 +2420,31 @@ SET @@global.mysql56_temporal_format=default; DROP PROCEDURE p1; SET timestamp=DEFAULT; # +# MDEV-26765 UNIX_TIMESTAMP(CURRENT_TIME()) return null ?!? +# +SET @@time_zone='+00:00'; +SET timestamp=1234567; +SELECT CURRENT_TIMESTAMP; +CURRENT_TIMESTAMP +1970-01-15 06:56:07 +SELECT UNIX_TIMESTAMP(CURRENT_TIME()); +UNIX_TIMESTAMP(CURRENT_TIME()) +1234567 +SELECT UNIX_TIMESTAMP(TIME'06:56:07'); +UNIX_TIMESTAMP(TIME'06:56:07') +1234567 +SELECT UNIX_TIMESTAMP(TIME'10:20:30'); +UNIX_TIMESTAMP(TIME'10:20:30') +1246830 +CREATE OR REPLACE TABLE t1 (a TIME); +INSERT INTO t1 VALUES (TIME'06:56:07'),('10:20:30'); +SELECT UNIX_TIMESTAMP(a) FROM t1 ORDER BY a; +UNIX_TIMESTAMP(a) +1234567 +1246830 +DROP TABLE t1; +SET @@time_zone=DEFAULT; +SET TIMESTAMP=DEFAULT; +# # End of 10.4 tests # diff --git a/mysql-test/main/type_time.test b/mysql-test/main/type_time.test index 0f67223238c..9ed5c3a73dc 100644 --- a/mysql-test/main/type_time.test +++ b/mysql-test/main/type_time.test @@ -1566,6 +1566,25 @@ SET @@global.mysql56_temporal_format=default; DROP PROCEDURE p1; SET timestamp=DEFAULT; +--echo # +--echo # MDEV-26765 UNIX_TIMESTAMP(CURRENT_TIME()) return null ?!? +--echo # + +SET @@time_zone='+00:00'; +SET timestamp=1234567; +SELECT CURRENT_TIMESTAMP; +SELECT UNIX_TIMESTAMP(CURRENT_TIME()); +SELECT UNIX_TIMESTAMP(TIME'06:56:07'); +SELECT UNIX_TIMESTAMP(TIME'10:20:30'); +CREATE OR REPLACE TABLE t1 (a TIME); +INSERT INTO t1 VALUES (TIME'06:56:07'),('10:20:30'); +SELECT UNIX_TIMESTAMP(a) FROM t1 ORDER BY a; +DROP TABLE t1; + +SET @@time_zone=DEFAULT; +SET TIMESTAMP=DEFAULT; + + --echo # --echo # End of 10.4 tests --echo # diff --git a/sql/sql_type.cc b/sql/sql_type.cc index a9610195e65..92bf2b39f90 100644 --- a/sql/sql_type.cc +++ b/sql/sql_type.cc @@ -8619,13 +8619,13 @@ Type_handler_timestamp_common::Item_val_native_with_conversion(THD *thd, Item *item, Native *to) const { - MYSQL_TIME ltime; if (item->type_handler()->type_handler_for_native_format() == &type_handler_timestamp2) return item->val_native(thd, to); + Datetime dt(thd, item, Datetime::Options(TIME_NO_ZERO_IN_DATE, thd)); return - item->get_date(thd, <ime, Datetime::Options(TIME_NO_ZERO_IN_DATE, thd)) || - TIME_to_native(thd, <ime, to, item->datetime_precision(thd)); + !dt.is_valid_datetime() || + TIME_to_native(thd, dt.get_mysql_time(), to, item->datetime_precision(thd)); } bool Type_handler_null::union_element_finalize(Item_type_holder *item) const From a6780df49b443b172124e7e881ed0bea54d75907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 29 Mar 2023 16:49:10 +0300 Subject: [PATCH 072/260] MDEV-30453 Setting innodb_buffer_pool_filename to an empty string attempts to delete the data directory on shutdown Let us make innodb_buffer_pool_filename a read-only variable so that a malicious user cannot cause an important file to be deleted on InnoDB shutdown. An attempt to delete a directory will fail because it is not a regular file, but what if the variable pointed to (say) ibdata1, ib_logfile0 or some *.ibd file? It does not seem to make much sense for this parameter to be configurable in the first place, but we will not change that in order to avoid breaking compatibility. --- .../r/innodb_buffer_pool_dump_pct.result | 3 -- .../innodb/r/innodb_sys_var_valgrind.result | 21 ---------- .../innodb/t/innodb_buffer_pool_dump_pct.test | 10 ++--- .../innodb/t/innodb_sys_var_valgrind.test | 18 -------- .../suite/sys_vars/r/sysvars_innodb.result | 2 +- storage/innobase/handler/ha_innodb.cc | 42 +------------------ 6 files changed, 6 insertions(+), 90 deletions(-) diff --git a/mysql-test/suite/innodb/r/innodb_buffer_pool_dump_pct.result b/mysql-test/suite/innodb/r/innodb_buffer_pool_dump_pct.result index d9f5e4dfeed..fa17487df97 100644 --- a/mysql-test/suite/innodb/r/innodb_buffer_pool_dump_pct.result +++ b/mysql-test/suite/innodb/r/innodb_buffer_pool_dump_pct.result @@ -2,13 +2,11 @@ CREATE TABLE tab5 (col1 int auto_increment primary key, col2 VARCHAR(25), col3 varchar(25)) ENGINE=InnoDB; CREATE INDEX idx1 ON tab5(col2(10)); CREATE INDEX idx2 ON tab5(col3(10)); -SET GLOBAL innodb_buffer_pool_filename=ib_buffer_pool100; SET GLOBAL innodb_buffer_pool_dump_pct=100; SELECT variable_value INTO @IBPDS FROM information_schema.global_status WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS'; SET GLOBAL innodb_buffer_pool_dump_now=ON; -SET GLOBAL innodb_buffer_pool_filename=ib_buffer_pool1; SET GLOBAL innodb_buffer_pool_dump_pct=1; SELECT @@global.innodb_buffer_pool_dump_pct; @@global.innodb_buffer_pool_dump_pct @@ -18,5 +16,4 @@ FROM information_schema.global_status WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS'; SET GLOBAL innodb_buffer_pool_dump_now=ON; SET GLOBAL innodb_buffer_pool_dump_pct=DEFAULT; -SET GLOBAL innodb_buffer_pool_filename=DEFAULT; DROP TABLE tab5; diff --git a/mysql-test/suite/innodb/r/innodb_sys_var_valgrind.result b/mysql-test/suite/innodb/r/innodb_sys_var_valgrind.result index 32d87b4668a..6932b8f2292 100644 --- a/mysql-test/suite/innodb/r/innodb_sys_var_valgrind.result +++ b/mysql-test/suite/innodb/r/innodb_sys_var_valgrind.result @@ -25,27 +25,6 @@ select @@innodb_ft_server_stopword_table; @@innodb_ft_server_stopword_table NULL drop table user_stopword_1, user_stopword_2; -select @@innodb_buffer_pool_filename; -@@innodb_buffer_pool_filename -ib_buffer_pool -set @blah='hello'; -set global innodb_buffer_pool_filename = @blah; -select @@innodb_buffer_pool_filename; -@@innodb_buffer_pool_filename -hello -set global innodb_buffer_pool_filename="bye"; -select @@innodb_buffer_pool_filename; -@@innodb_buffer_pool_filename -bye -set global innodb_buffer_pool_filename=NULL; -ERROR 42000: Variable 'innodb_buffer_pool_filename' can't be set to the value of 'NULL' -select @@innodb_buffer_pool_filename; -@@innodb_buffer_pool_filename -bye -set global innodb_buffer_pool_filename=default; -select @@innodb_buffer_pool_filename; -@@innodb_buffer_pool_filename -ib_buffer_pool CREATE TABLE t1 ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, opening_line TEXT(500), author VARCHAR(200), title VARCHAR(200), FULLTEXT idx (opening_line)) ENGINE=InnoDB; diff --git a/mysql-test/suite/innodb/t/innodb_buffer_pool_dump_pct.test b/mysql-test/suite/innodb/t/innodb_buffer_pool_dump_pct.test index a7a414d61da..381091165ef 100644 --- a/mysql-test/suite/innodb/t/innodb_buffer_pool_dump_pct.test +++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_dump_pct.test @@ -15,7 +15,6 @@ col2 VARCHAR(25), col3 varchar(25)) ENGINE=InnoDB; CREATE INDEX idx1 ON tab5(col2(10)); CREATE INDEX idx2 ON tab5(col3(10)); -SET GLOBAL innodb_buffer_pool_filename=ib_buffer_pool100; SET GLOBAL innodb_buffer_pool_dump_pct=100; #*********************************************************** @@ -58,8 +57,7 @@ AND variable_value != @IBPDS AND variable_value like 'Buffer pool(s) dump completed at%'; --source include/wait_condition.inc ---file_exists $MYSQLD_DATADIR/ib_buffer_pool100 -SET GLOBAL innodb_buffer_pool_filename=ib_buffer_pool1; +--move_file $MYSQLD_DATADIR/ib_buffer_pool $MYSQLD_DATADIR/ib_buffer_pool100 SET GLOBAL innodb_buffer_pool_dump_pct=1; SELECT @@global.innodb_buffer_pool_dump_pct; @@ -83,17 +81,15 @@ AND variable_value != @IBPDS AND variable_value like 'Buffer pool(s) dump completed at%'; --source include/wait_condition.inc ---file_exists $MYSQLD_DATADIR/ib_buffer_pool1 +--file_exists $MYSQLD_DATADIR/ib_buffer_pool perl; -my $size1 = -s "$ENV{MYSQLD_DATADIR}/ib_buffer_pool1"; +my $size1 = -s "$ENV{MYSQLD_DATADIR}/ib_buffer_pool"; my $size100 = -s "$ENV{MYSQLD_DATADIR}/ib_buffer_pool100"; die "$size100<=$size1\n" unless $size100 > $size1; EOF SET GLOBAL innodb_buffer_pool_dump_pct=DEFAULT; -SET GLOBAL innodb_buffer_pool_filename=DEFAULT; --remove_file $MYSQLD_DATADIR/ib_buffer_pool100 ---remove_file $MYSQLD_DATADIR/ib_buffer_pool1 DROP TABLE tab5; diff --git a/mysql-test/suite/innodb/t/innodb_sys_var_valgrind.test b/mysql-test/suite/innodb/t/innodb_sys_var_valgrind.test index 2e1391355b9..4383e26877d 100644 --- a/mysql-test/suite/innodb/t/innodb_sys_var_valgrind.test +++ b/mysql-test/suite/innodb/t/innodb_sys_var_valgrind.test @@ -25,24 +25,6 @@ select @@innodb_ft_server_stopword_table; drop table user_stopword_1, user_stopword_2; -#Test innodb_buffer_pool_filename (global variable) - -select @@innodb_buffer_pool_filename; - -set @blah='hello'; -set global innodb_buffer_pool_filename = @blah; -select @@innodb_buffer_pool_filename; - -set global innodb_buffer_pool_filename="bye"; -select @@innodb_buffer_pool_filename; - ---error ER_WRONG_VALUE_FOR_VAR -set global innodb_buffer_pool_filename=NULL; -select @@innodb_buffer_pool_filename; - -set global innodb_buffer_pool_filename=default; -select @@innodb_buffer_pool_filename; - #Test innodb_ft_aux_table (global variable) CREATE TABLE t1 ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, opening_line TEXT(500), author VARCHAR(200), title VARCHAR(200), FULLTEXT idx diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index 6a23651b9dc..7b8982dca1c 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -221,7 +221,7 @@ NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL ENUM_VALUE_LIST NULL -READ_ONLY NO +READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME INNODB_BUFFER_POOL_INSTANCES SESSION_VALUE NULL diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 485e525aed8..c4a23a95d85 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -18020,44 +18020,6 @@ exit: return; } -/** Validate SET GLOBAL innodb_buffer_pool_filename. -On Windows, file names with colon (:) are not allowed. -@param thd connection -@param save &srv_buf_dump_filename -@param value new value to be validated -@return 0 for valid name */ -static int innodb_srv_buf_dump_filename_validate(THD *thd, st_mysql_sys_var*, - void *save, - st_mysql_value *value) -{ - char buff[OS_FILE_MAX_PATH]; - int len= sizeof buff; - - if (const char *buf_name= value->val_str(value, buff, &len)) - { -#ifdef _WIN32 - if (!is_filename_allowed(buf_name, len, FALSE)) - { - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_WRONG_ARGUMENTS, - "InnoDB: innodb_buffer_pool_filename " - "cannot have colon (:) in the file name."); - return 1; - } -#endif /* _WIN32 */ - if (buf_name == buff) - { - ut_ad(static_cast(len) < sizeof buff); - buf_name= thd_strmake(thd, buf_name, len); - } - - *static_cast(save)= buf_name; - return 0; - } - - return 1; -} - #ifdef UNIV_DEBUG static char* srv_buffer_pool_evict; @@ -19363,9 +19325,9 @@ static MYSQL_SYSVAR_ULONG(buffer_pool_instances, srv_buf_pool_instances, NULL, NULL, srv_buf_pool_instances_default, 0, MAX_BUFFER_POOLS, 0); static MYSQL_SYSVAR_STR(buffer_pool_filename, srv_buf_dump_filename, - PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, "Filename to/from which to dump/load the InnoDB buffer pool", - innodb_srv_buf_dump_filename_validate, NULL, SRV_BUF_DUMP_FILENAME_DEFAULT); + NULL, NULL, SRV_BUF_DUMP_FILENAME_DEFAULT); static MYSQL_SYSVAR_BOOL(buffer_pool_dump_now, innodb_buffer_pool_dump_now, PLUGIN_VAR_RQCMDARG, From c4d6d6fd81662269a36a1699fedee00b03949f71 Mon Sep 17 00:00:00 2001 From: Ahmed Ibrahim Date: Fri, 24 Mar 2023 14:10:57 +0200 Subject: [PATCH 073/260] CODING_STANDARDS: Add variable initializations and functions spacing --- CODING_STANDARDS.md | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/CODING_STANDARDS.md b/CODING_STANDARDS.md index a35ce57d45c..3ecf73768e3 100644 --- a/CODING_STANDARDS.md +++ b/CODING_STANDARDS.md @@ -118,6 +118,23 @@ if (!condition) return success; ``` +#### Functions + +Consecutive functions should be separated with 2 empty lines in between + +```cpp +void my_function_1() +{ + +} + + +void my_function_2() +{ + +} +``` + ### File names File names should be lower case with underscore word separators. @@ -218,11 +235,28 @@ Variables should be declared at the start of it's context (start of function, in The benefits of this: - Code lines gets shorter - It is easier to see the stack space used by a function. -- It is easer to find the declaration of the variable. +- It is easier to find the declaration of the variable. - If one has to add an 'if (error) goto end' construct, one can do that without having to move variable declarations around. +### Variable initializations +Variables can be initialized using assignment operator or initializer and expression list. +For Example: + +```cpp +int milliseconds= 1000; +char type= 't'; +``` + +Or + +```cpp +int milliseconds{1000}; +char type{'t'}; +``` + + ### Constant integers Constant integers that are used to define elements such as buffer sizes should be defined rather than used directly. From ada39879482816896e771e94d5e20ed4aaad6c6f Mon Sep 17 00:00:00 2001 From: Mikhail Chalov Date: Thu, 2 Mar 2023 16:14:33 -0800 Subject: [PATCH 074/260] [MDEV-30543] New status variable: max_used_connections_time Add variable max_used_connections_time to show the time at which max_used_connections reached its current value. This is useful for troubleshooting high connection counts. MySQL 8 has this already. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services. --- mysql-test/main/status.result | 19 +++++++++++++++++++ mysql-test/main/status.test | 31 +++++++++++++++++++++++++++++++ sql/mysqld.cc | 20 +++++++++++++++++++- 3 files changed, 69 insertions(+), 1 deletion(-) diff --git a/mysql-test/main/status.result b/mysql-test/main/status.result index 0669bdf3b34..9a4dd7c9302 100644 --- a/mysql-test/main/status.result +++ b/mysql-test/main/status.result @@ -447,3 +447,22 @@ Feature_json 2 connection default; set @@global.concurrent_insert= @old_concurrent_insert; SET GLOBAL log_output = @old_log_output; +# +# MDEV-30543 New status variable: Max_used_connections_time +# +FLUSH STATUS; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connection con1; +disconnect con2; +SELECT 'DTVALUE' = 'DTVALUE' AS expect_1; +expect_1 +1 +connect con3,localhost,root,,; +connect con4,localhost,root,,; +SELECT 'DTVALUE' < 'DTVALUE' as expect_1; +expect_1 +1 +disconnect con4; +disconnect con3; +disconnect con1; diff --git a/mysql-test/main/status.test b/mysql-test/main/status.test index 78626615d45..e0f72d68884 100644 --- a/mysql-test/main/status.test +++ b/mysql-test/main/status.test @@ -447,3 +447,34 @@ SET GLOBAL log_output = @old_log_output; # Wait till we reached the initial number of concurrent sessions --source include/wait_until_count_sessions.inc +--echo # +--echo # MDEV-30543 New status variable: Max_used_connections_time +--echo # + +FLUSH STATUS; + +connect (con1,localhost,root,,); +--sleep 1 +connect (con2,localhost,root,,); +--sleep 1 +let $time_1=`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections_time'`; +--sleep 1 +connection con1; +disconnect con2; +--sleep 1 +let $time_2=`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections_time'`; +--replace_regex /[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*/DTVALUE/ +eval SELECT '$time_1' = '$time_2' AS expect_1; +--sleep 1 +connect (con3,localhost,root,,); +--sleep 1 +connect (con4,localhost,root,,); +--sleep 1 +let $time_3=`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections_time'`; +--replace_regex /[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*/DTVALUE/ +eval SELECT '$time_1' < '$time_3' as expect_1; + +disconnect con4; +disconnect con3; +disconnect con1; + diff --git a/sql/mysqld.cc b/sql/mysqld.cc index ee368def9be..12dd3639365 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -331,6 +331,7 @@ static my_bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0; static my_bool opt_short_log_format= 0, opt_silent_startup= 0; ulong max_used_connections; +time_t max_used_connections_time; static const char *mysqld_user, *mysqld_chroot; static char *default_character_set_name; static char *character_set_filesystem_name; @@ -6173,7 +6174,10 @@ void create_new_thread(CONNECT *connect) uint sum= connection_count + extra_connection_count; if (sum > max_used_connections) + { max_used_connections= sum; + max_used_connections_time= time(nullptr); + } /* The initialization of thread_id is done in create_embedded_thd() for @@ -7006,9 +7010,20 @@ static int show_heartbeat_period(THD *thd, SHOW_VAR *var, char *buff, return 0; } - #endif /* HAVE_REPLICATION */ + +static int show_max_used_connections_time(THD *thd, SHOW_VAR *var, char *buff, + enum enum_var_type scope) +{ + var->type= SHOW_CHAR; + var->value= buff; + + get_date(buff, GETDATE_DATE_TIME | GETDATE_FIXEDLENGTH, max_used_connections_time); + return 0; +} + + static int show_open_tables(THD *thd, SHOW_VAR *var, char *buff, enum enum_var_type scope) { @@ -7484,6 +7499,7 @@ SHOW_VAR status_vars[]= { {"Master_gtid_wait_timeouts", (char*) offsetof(STATUS_VAR, master_gtid_wait_timeouts), SHOW_LONG_STATUS}, {"Master_gtid_wait_time", (char*) offsetof(STATUS_VAR, master_gtid_wait_time), SHOW_LONG_STATUS}, {"Max_used_connections", (char*) &max_used_connections, SHOW_LONG}, + {"Max_used_connections_time",(char*) &show_max_used_connections_time, SHOW_SIMPLE_FUNC}, {"Memory_used", (char*) &show_memory_used, SHOW_SIMPLE_FUNC}, {"Memory_used_initial", (char*) &start_memory_used, SHOW_LONGLONG}, {"Resultset_metadata_skipped", (char *) offsetof(STATUS_VAR, skip_metadata_count),SHOW_LONG_STATUS}, @@ -7822,6 +7838,7 @@ static int mysql_init_variables(void) specialflag= 0; binlog_cache_use= binlog_cache_disk_use= 0; max_used_connections= slow_launch_threads = 0; + max_used_connections_time= 0; mysqld_user= mysqld_chroot= opt_init_file= opt_bin_logname = 0; prepared_stmt_count= 0; mysqld_unix_port= opt_mysql_tmpdir= my_bind_addr_str= NullS; @@ -9200,6 +9217,7 @@ void refresh_status(THD *thd) connections. This is not perfect, but status data is not exact anyway. */ max_used_connections= connection_count + extra_connection_count; + max_used_connections_time= time(nullptr); } #ifdef HAVE_PSI_INTERFACE From b844a376ec1fb6ef0f981a07ce897970aa2422da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Tue, 28 Mar 2023 09:01:23 +0300 Subject: [PATCH 075/260] Update pull request template to suggest making PRs editable by maintainers Often there are small "nitpicky" changes that need to be done to a PR in order to get it merged. To speed up the merge process, we will ask contributors if they are ok with the reviewer making those changes. Other fixups: Improve PR template rendering in browser's textarea field. Line wrapping at 80 characters provides a bad user experience within the browser, which handles word wrapping separately. Thus, prefer long lines in this markdown file. Remove the "backwards compatibility section". While the contributor should ideally care about the impact of their patch on the server's backwards compatibility, this is an advanced topic that is better presented in a separate document. --- .github/pull_request_template.md | 52 ++++++++++++-------------------- 1 file changed, 19 insertions(+), 33 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index fbba6e12f12..c97f9827e59 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,61 +1,47 @@ -- [x] *The Jira issue number for this PR is: MDEV-_____* +- [x] *The Jira issue number for this PR is: MDEV-______* ## Description TODO: fill description here ## How can this PR be tested? -TODO: modify the automated test suite to verify that the PR causes MariaDB to -behave as intended. Consult the documentation on -["Writing good test cases"](https://mariadb.org/get-involved/getting-started-for-developers/writing-good-test-cases-mariadb-server). -In many cases, this will be as simple as modifying one `.test` and one `.result` -file in the `mysql-test/` subdirectory. Without _automated_ tests, future regressions -in the expected behavior can't be automatically detected and verified. +TODO: modify the automated test suite to verify that the PR causes MariaDB to behave as intended. +Consult the documentation on ["Writing good test cases"](https://mariadb.org/get-involved/getting-started-for-developers/writing-good-test-cases-mariadb-server). + -If the changes are not amenable to automated testing, please explain why not and -carefully describe how to test manually. +If the changes are not amenable to automated testing, please explain why not and carefully describe how to test manually. ## Basing the PR against the correct MariaDB version -- [ ] *This is a new feature and the PR is based against the latest MariaDB development branch* -- [ ] *This is a bug fix and the PR is based against the earliest maintained branch in which the bug can be reproduced* +- [ ] *This is a new feature and the PR is based against the latest MariaDB development branch.* +- [ ] *This is a bug fix and the PR is based against the earliest maintained branch in which the bug can be reproduced.* -## Backward compatibility -TODO: fill details here, if applicable, or remove the section - ## PR quality check - [ ] I checked the [CODING_STANDARDS.md](https://github.com/MariaDB/server/blob/11.0/CODING_STANDARDS.md) file and my PR conforms to this where appropriate. +- [ ] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves. From 169def14f64492466a305114b0ca13b2b5775164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 30 Mar 2023 13:32:44 +0200 Subject: [PATCH 076/260] MDEV-30413 : run sequence nextval got [Note] WSREP: MDL BF-BF conflict and [ERROR] Aborting Sequence objects are implemented using special tables. These tables do not have primary key and only one row. NEXTVAL is basically update from existing value to new value. In Galera this could mean that two write-sets from different nodes do not conflict and this could lead situation where write-sets are executed concurrently and possibly in wrong seqno order. This is fixed by using table-level exclusive key for SEQUENCE updates. Note that this naturally works correctly only if InnoDB storage engine is used for sequence. This fix does not contain a test case because while it is possible to syncronize appliers using dbug_sync it was too hard to syncronize MDL-lock requests to exact objects. Testing done for this fix is documented on MDEV. Signed-off-by: Julius Goryavsky --- storage/innobase/handler/ha_innodb.cc | 46 ++++++++++++++++++++--- storage/innobase/include/ha_prototypes.h | 10 +++++ storage/innobase/row/row0ins.cc | 48 ++++-------------------- 3 files changed, 59 insertions(+), 45 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index c6a515b21d3..3f62a09045d 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -8543,6 +8543,37 @@ wsrep_calc_row_hash( return(0); } + +/** Append table-level exclusive key. +@param thd MySQL thread handle +@param table table +@retval false on success +@retval true on failure */ +ATTRIBUTE_COLD bool wsrep_append_table_key(MYSQL_THD thd, const dict_table_t &table) +{ + char db_buf[NAME_LEN + 1]; + char tbl_buf[NAME_LEN + 1]; + ulint db_buf_len, tbl_buf_len; + + if (!table.parse_name(db_buf, tbl_buf, &db_buf_len, &tbl_buf_len)) + { + WSREP_ERROR("Parse_name for table key append failed: %s", + wsrep_thd_query(thd)); + return true; + } + + /* Append table-level exclusive key */ + const int rcode = wsrep_thd_append_table_key(thd, db_buf, + tbl_buf, WSREP_SERVICE_KEY_EXCLUSIVE); + if (rcode) + { + WSREP_ERROR("Appending table key failed: %s, %d", + wsrep_thd_query(thd), rcode); + return true; + } + + return false; +} #endif /* WITH_WSREP */ /** @@ -8713,11 +8744,16 @@ func_exit: && !wsrep_thd_ignore_table(m_user_thd)) { DBUG_PRINT("wsrep", ("update row key")); - if (wsrep_append_keys(m_user_thd, - wsrep_protocol_version >= 4 - ? WSREP_SERVICE_KEY_UPDATE - : WSREP_SERVICE_KEY_EXCLUSIVE, - old_row, new_row)){ + /* We use table-level exclusive key for SEQUENCES + and normal key append for others. */ + if (table->s->table_type == TABLE_TYPE_SEQUENCE) { + if (wsrep_append_table_key(m_user_thd, *m_prebuilt->table)) + DBUG_RETURN(HA_ERR_INTERNAL_ERROR); + } else if (wsrep_append_keys(m_user_thd, + wsrep_protocol_version >= 4 + ? WSREP_SERVICE_KEY_UPDATE + : WSREP_SERVICE_KEY_EXCLUSIVE, + old_row, new_row)) { WSREP_DEBUG("WSREP: UPDATE_ROW_KEY FAILED"); DBUG_PRINT("wsrep", ("row key failed")); DBUG_RETURN(HA_ERR_INTERNAL_ERROR); diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h index da9dec05827..d5239ec3f9a 100644 --- a/storage/innobase/include/ha_prototypes.h +++ b/storage/innobase/include/ha_prototypes.h @@ -462,5 +462,15 @@ void destroy_background_thd(MYSQL_THD thd); void innobase_reset_background_thd(MYSQL_THD); +#ifdef WITH_WSREP +/** Append table-level exclusive key. +@param thd MySQL thread handle +@param table table +@retval false on success +@retval true on failure */ +struct dict_table_t; +bool wsrep_append_table_key(MYSQL_THD thd, const dict_table_t &table); +#endif /* WITH_WSREP */ + #endif /* !UNIV_INNOCHECKSUM */ #endif /* HA_INNODB_PROTOTYPES_H */ diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index a4471104543..bd998094f42 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -49,6 +49,7 @@ Created 4/20/1996 Heikki Tuuri #ifdef WITH_WSREP #include #include +#include "ha_prototypes.h" #endif /* WITH_WSREP */ /************************************************************************* @@ -2574,42 +2575,6 @@ but GCC 4.8.5 does not support pop_options. */ # pragma GCC optimize ("O0") #endif -#ifdef WITH_WSREP -/** Start bulk insert operation for Galera by appending -table-level exclusive key for bulk insert. -@param trx transaction -@param index index -@retval false on success -@retval true on failure */ -ATTRIBUTE_COLD static bool row_ins_wsrep_start_bulk(trx_t *trx, const dict_index_t &index) -{ - char db_buf[NAME_LEN + 1]; - char tbl_buf[NAME_LEN + 1]; - ulint db_buf_len, tbl_buf_len; - - if (!index.table->parse_name(db_buf, tbl_buf, &db_buf_len, &tbl_buf_len)) - { - WSREP_ERROR("Parse_name for bulk insert failed: %s", - wsrep_thd_query(trx->mysql_thd)); - trx->error_state = DB_ROLLBACK; - return true; - } - - /* Append table-level exclusive key for bulk insert. */ - const int rcode = wsrep_thd_append_table_key(trx->mysql_thd, db_buf, - tbl_buf, WSREP_SERVICE_KEY_EXCLUSIVE); - if (rcode) - { - WSREP_ERROR("Appending table key for bulk insert failed: %s, %d", - wsrep_thd_query(trx->mysql_thd), rcode); - trx->error_state = DB_ROLLBACK; - return true; - } - - return false; -} -#endif - /***************************************************************//** Tries to insert an entry into a clustered index, ignoring foreign key constraints. If a record with the same unique key is found, the other @@ -2770,10 +2735,13 @@ err_exit: #ifdef WITH_WSREP if (trx->is_wsrep()) { - if (!wsrep_thd_is_local_transaction(trx->mysql_thd)) - goto skip_bulk_insert; - if (row_ins_wsrep_start_bulk(trx, *index)) - goto err_exit; + if (!wsrep_thd_is_local_transaction(trx->mysql_thd)) + goto skip_bulk_insert; + if (wsrep_append_table_key(trx->mysql_thd, *index->table)) + { + trx->error_state = DB_ROLLBACK; + goto err_exit; + } } #endif /* WITH_WSREP */ From 9c287c0a90fcb6637417bd118f62c78de78f75ee Mon Sep 17 00:00:00 2001 From: Robin Newhouse Date: Sat, 18 Mar 2023 01:03:14 +0000 Subject: [PATCH 077/260] All-green GitLab CI in 11.0 branch Include cppcheck and FlawFinder for SAST scanning. Ignorelists are present for both, so only new problems will trigger a CI failure. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc. --- .gitlab-ci.yml | 67 +- tests/code_quality/cppcheck_ignorelist.txt | 252 +++++++ tests/code_quality/flawfinder_ignorelist.json | 706 ++++++++++++++++++ 3 files changed, 1024 insertions(+), 1 deletion(-) create mode 100644 tests/code_quality/cppcheck_ignorelist.txt create mode 100644 tests/code_quality/flawfinder_ignorelist.json diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8c2b4ae363d..6c5381428fd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,6 +27,7 @@ stages: - build - test - Salsa-CI + - sast default: # Base image for builds and tests unless otherwise defined @@ -42,7 +43,7 @@ variables: CMAKE_FLAGS: "-DWITH_SSL=system -DPLUGIN_COLUMNSTORE=NO -DPLUGIN_ROCKSDB=NO -DPLUGIN_S3=NO -DPLUGIN_MROONGA=NO -DPLUGIN_CONNECT=NO -DPLUGIN_MROONGA=NO -DPLUGIN_TOKUDB=NO -DPLUGIN_PERFSCHEMA=NO -DWITH_WSREP=OFF" # Major version dictates which branches share the same ccache. E.g. 10.6-abc # and 10.6-xyz will have the same cache. - MARIADB_MAJOR_VERSION: "10.8" + MARIADB_MAJOR_VERSION: "11.0" # NOTE! Currently ccache is only used on the Centos8 build. As each job has # sufficiently different environments they are unable to benefit from each # other's ccaches. As each build generates about 1 GB of ccache, having @@ -517,6 +518,70 @@ mini-benchmark: metrics: - metrics.txt +cppcheck: + stage: sast + needs: [] + variables: + GIT_STRATEGY: fetch + GIT_SUBMODULE_STRATEGY: normal + script: + - yum install -y cppcheck diffutils + # --template: use a single-line template + # --force: check large directories without warning + # -i: ignore this directory when scanning + # -j: run multiple cppcheck threads + # Use newline to escape colon in yaml + - > + cppcheck --template="{file}:{line}: {severity}: {message}" --force + client dbug extra include libmariadb libmysqld libservices mysql-test mysys mysys_ssl pcre plugin + strings tests unittest vio wsrep-lib sql sql-common storage + -istorage/mroonga -istorage/tokudb -istorage/spider -istorage/rocksdb -iextra/ -ilibmariadb/ -istorage/columnstore + --output-file=cppcheck.txt -j $(nproc) + # Parallel jobs may output findings in an nondeterministic order. Sort to match ignorelist. + - cat cppcheck.txt | sort > cppcheck_sorted.txt + # Remove line numbers for diff + - sed 's/:[^:]*:/:/' cppcheck_sorted.txt > cppcheck_sorted_no_line_numbers.txt + # Only print new issues not found in ignore list + - echo "Problems found in ignore list that were not discovered by cppcheck (may have been fixed)." + - diff --changed-group-format='%>' --unchanged-group-format='' cppcheck_sorted_no_line_numbers.txt tests/code_quality/cppcheck_ignorelist.txt || true + - echo "Problems found by cppcheck that were not in ignore list." + - diff --changed-group-format='%<' --unchanged-group-format='' cppcheck_sorted_no_line_numbers.txt tests/code_quality/cppcheck_ignorelist.txt > lines_not_ignored.txt || true + - cat lines_not_ignored.txt && test ! -s lines_not_ignored.txt + artifacts: + when: always + paths: + - cppcheck_sorted.txt + +flawfinder: + stage: sast + needs: [] + variables: + GIT_STRATEGY: fetch + GIT_SUBMODULE_STRATEGY: normal + script: + - yum install -y python3 python3-pip jq diffutils git + - pip install flawfinder + - flawfinder --falsepositive --quiet --html . > flawfinder-all-vulnerabilities.html + - cat flawfinder-all-vulnerabilities.html | grep "Hits =" + - flawfinder --falsepositive --quiet --minlevel=5 --sarif . > flawfinder-output.json + # FlawFinder's --sarif output will display all vulnerabilities despite having --minlevel=5 specified. + # Therefore, we postprocess the results with jq and filter out findings where the vulnerability level is less than 5. + # Also in the SARIF output format, the vulnerabilities are ranked as 0.2/0.4/0.6/0.8/1.0 which correspond to the --minlevel=1/2/3/4/5 of FlawFinder. + # Additionally, we sort the results because individual findings are consistent across different runs, but their ordering may not be. + # Vulnerabilities can also be ignored in-line (/* Flawfinder: ignore */), but this option was chosen as to not clutter the codebase. + - jq 'del(.runs[] | .tool | .driver | .rules) | del(.runs[] | .results[] | select(.rank < 1)) | del(.runs[] | .results[] | .locations[] | .physicalLocation | .region | .startLine) | .runs[0].results|=sort_by(.fingerprints)' flawfinder-output.json > flawfinder-min-level5.json + # Diff against known vulnerabilities, but ignore the line number. + - echo "Problems found in ignore list that were not discovered by flawfinder (may have been fixed)." + - diff --changed-group-format='%>' --unchanged-group-format='' flawfinder-min-level5.json tests/code_quality/flawfinder_ignorelist.json || true + - echo "Problems found by flawfinder that were not in ignore list." + - diff --changed-group-format='%<' --unchanged-group-format='' flawfinder-min-level5.json tests/code_quality/flawfinder_ignorelist.json > lines_not_ignored.txt || true + - cat lines_not_ignored.txt && test ! -s lines_not_ignored.txt + artifacts: + when: always + paths: + - flawfinder-all-vulnerabilities.html + - flawfinder-min-level5.json + # Once all RPM builds and tests have passed, also run the DEB builds and tests # @NOTE: This is likely to work well only on salsa.debian.org as the Gitlab.com # runners are too small for everything this stage does. diff --git a/tests/code_quality/cppcheck_ignorelist.txt b/tests/code_quality/cppcheck_ignorelist.txt new file mode 100644 index 00000000000..23cad81d419 --- /dev/null +++ b/tests/code_quality/cppcheck_ignorelist.txt @@ -0,0 +1,252 @@ +client/mysql.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +client/mysql_plugin.c: error: snprintf format string requires 6 parameters but only 5 are given. +client/mysql_upgrade.c: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +client/mysqladmin.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +client/mysqlbinlog.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +client/mysqlcheck.c: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +client/mysqlimport.c: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +client/mysqlshow.c: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +client/mysqltest.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +dbug/tests.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +lexyy.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +mysql-test/lib/My/SafeProcess/safe_process_win.cc: error: Uninitialized variable: message_text +mysys/crc32/crc32_arm64.c: error: Unmatched '('. Configuration: 'HAVE_ARMV8_CRC;__FreeBSD__'. +mysys/mf_keycache.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +mysys/my_delete.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +mysys/my_fopen.c: error: Return value of allocation function 'freopen' is not stored. +mysys/my_getsystime.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +mysys/my_largepage.c: error: syntax error: 0 = +mysys/my_pread.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +mysys/my_rename.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +mysys/my_winfile.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +mysys/my_write.c: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +mysys/thr_lock.c: error: There is an unknown macro here somewhere. Configuration is required. If MYSQL_TABLE_WAIT_VARIABLES is a macro then please configure it. +mysys/tree.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +plugin/audit_null/audit_null.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_ed25519/server_ed25519.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_examples/auth_0x0100.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_examples/dialog_examples.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_examples/qa_auth_interface.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_examples/qa_auth_server.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_examples/test_plugin.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_gssapi/server_plugin.cc: error: syntax error +plugin/auth_gssapi/sspi.h: error: #include nested too deeply +plugin/auth_pam/auth_pam.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_pam/auth_pam_v1.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_pam/testing/pam_mariadb_mtr.c: error: Memory pointed to by 'resp' is freed twice. +plugin/auth_pipe/auth_pipe.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_socket/auth_socket.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/aws_key_management/aws_key_management_plugin.cc: error: syntax error +plugin/cracklib_password_check/cracklib_password_check.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/daemon_example/daemon_example.cc: error: syntax error +plugin/debug_key_management/debug_key_management_plugin.cc: error: syntax error +plugin/disks/information_schema_disks.cc: error: syntax error +plugin/example_key_management/example_key_management_plugin.cc: error: syntax error +plugin/feedback/feedback.cc: error: syntax error +plugin/file_key_management/file_key_management_plugin.cc: error: syntax error +plugin/fulltext/plugin_example.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/func_test/plugin.cc: error: syntax error +plugin/handler_socket/handlersocket/handlersocket.cpp: error: syntax error +plugin/hashicorp_key_management/hashicorp_key_management_plugin.cc: error: syntax error +plugin/locale_info/locale_info.cc: error: syntax error +plugin/metadata_lock_info/metadata_lock_info.cc: error: syntax error +plugin/password_reuse_check/password_reuse_check.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/provider_bzip2/plugin.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/provider_lz4/plugin.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/provider_lzma/plugin.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/provider_lzo/plugin.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/provider_snappy/plugin.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/qc_info/qc_info.cc: error: syntax error +plugin/query_response_time/plugin.cc: error: syntax error +plugin/query_response_time/query_response_time.cc: error: Array 'm_count[41]' accessed at index 43, which is out of bounds. +plugin/query_response_time/query_response_time.cc: error: Array 'm_total[41]' accessed at index 43, which is out of bounds. +plugin/server_audit/server_audit.c: error: Uninitialized variable: &tm_time +plugin/server_audit/server_audit.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/server_audit/server_audit.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/server_audit/server_audit.c: error: Uninitialized variable: &tm_time +plugin/simple_password_check/simple_password_check.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/sql_errlog/sql_errlog.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/sql_errlog/sql_errlog.c: error: Uninitialized variable: &t +plugin/test_sql_service/test_sql_service.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/type_geom/plugin.cc: error: syntax error +plugin/type_inet/plugin.cc: error: syntax error +plugin/type_mysql_json/type.cc: error: syntax error +plugin/type_test/plugin.cc: error: syntax error +plugin/type_uuid/plugin.cc: error: syntax error +plugin/user_variables/user_variables.cc: error: syntax error +plugin/userstat/userstat.cc: error: syntax error +plugin/versioning/versioning.cc: error: syntax error +plugin/wsrep_info/plugin.cc: error: syntax error +sql-common/client.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +sql-common/client_plugin.c: error: va_list 'unused' used before va_start() was called. +sql-common/client_plugin.c: error: va_list 'unused' used before va_start() was called. +sql-common/client_plugin.c: error: va_list 'unused' used before va_start() was called. +sql-common/client_plugin.c: error: va_list 'unused' used before va_start() was called. +sql/debug.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +sql/debug_sync.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE is a macro then please configure it. +sql/gcalc_slicescan.cc: warning: Possible null pointer dereference: first_bottom_point +sql/gen_lex_hash.cc: error: Common realloc mistake: 'hash_map' nulled but not freed upon failure +sql/handler.h: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +sql/log.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +sql/log_event.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +sql/net_serv.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +sql/opt_range.cc: error: Unmatched ')'. Configuration: 'OLD_SWEEP_COST'. +sql/protocol.h: error: syntax error +sql/rpl_gtid.h: error: va_list 'args' was opened but not closed by va_end(). +sql/rpl_gtid.h: error: va_list 'args' was opened but not closed by va_end(). +sql/rpl_utility.h: error: There is an unknown macro here somewhere. Configuration is required. If CPP_UNNAMED_NS_START is a macro then please configure it. +sql/semisync_slave.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +sql/sql_base.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +sql/sql_select.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +sql/sql_string.cc: warning: Iterators to containers from different expressions 'to' and 'from' are used together. +sql/sql_type.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +sql/table.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +sql/threadpool.h: error: syntax error +sql/winservice.c: error: Resource leak: mariadb_upgrade_info +sql/wsrep_thd.h: error: failed to expand 'wsrep_create_appliers', Wrong number of parameters for macro 'wsrep_create_appliers'. +storage/archive/azio.c: error: Syntax Error: AST broken, 'if' doesn't have two operands. +storage/archive/ha_archive.cc: error: syntax error +storage/blackhole/ha_blackhole.cc: error: syntax error +storage/connect/connect.cc: error: Uninitialized variable: lg +storage/connect/domdoc.cpp: error: syntax error +storage/connect/ha_connect.cc: error: syntax error +storage/connect/myconn.cpp: error: Unmatched '{'. Configuration: 'ALPHA;MYSQL_PREPARED_STATEMENTS'. +storage/connect/myconn.cpp: error: Unmatched '{'. Configuration: 'MYSQL_PREPARED_STATEMENTS'. +storage/connect/odbconn.cpp: warning: Uninitialized variable: b +storage/connect/odbconn.cpp: warning: Uninitialized variable: b +storage/connect/odbconn.cpp: warning: Uninitialized variable: b +storage/connect/plugutil.cpp: error: Width 255 given in format string (no. 2) is larger than destination buffer 'stmsg[200]', use %199[^\"] to prevent overflowing it. +storage/connect/plugutil.cpp: error: Width 255 given in format string (no. 1) is larger than destination buffer 'stmsg[200]', use %199[^\"] to prevent overflowing it. +storage/connect/tabjson.cpp: warning: Possible null pointer dereference: Val +storage/connect/tabmul.cpp: error: Uninitialized variable: buf +storage/connect/tabmul.cpp: error: Uninitialized variable: buf +storage/connect/tabmul.cpp: error: Uninitialized variable: buf +storage/connect/taboccur.cpp: warning: Uninitialized variable: *pcrp +storage/connect/unzip.c: warning: Uninitialized variable: *pzlib_filefunc64_32_def.zopen32_file +storage/connect/value.cpp: error: Signed integer overflow for expression 'n*126230400'. +storage/connect/zip.c: warning: Uninitialized variable: *pzlib_filefunc64_32_def.zopen32_file +storage/csv/ha_tina.cc: error: syntax error +storage/example/ha_example.cc: error: syntax error +storage/federated/ha_federated.cc: error: syntax error +storage/heap/ha_heap.cc: error: syntax error +storage/innobase/btr/btr0btr.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/btr/btr0cur.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/btr/btr0defragment.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/btr/btr0pcur.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/btr/btr0sea.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/buf/buf0buf.cc: error: There is an unknown macro here somewhere. Configuration is required. If ut_d is a macro then please configure it. +storage/innobase/buf/buf0flu.cc: error: syntax error +storage/innobase/buf/buf0lru.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/innobase/buf/buf0rea.cc: error: There is an unknown macro here somewhere. Configuration is required. If ut_d is a macro then please configure it. +storage/innobase/dict/dict0crea.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/dict/dict0load.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/fil/fil0fil.cc: error: There is an unknown macro here somewhere. Configuration is required. If IF_WIN is a macro then please configure it. +storage/innobase/fsp/fsp0file.cc: error: Resource leak: file +storage/innobase/fsp/fsp0fsp.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/fts/fts0fts.cc: error: There is an unknown macro here somewhere. Configuration is required. If IF_WIN is a macro then please configure it. +storage/innobase/fts/fts0opt.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/fts/fts0que.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/gis/gis0rtree.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/innobase/gis/gis0sea.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/handler/ha_innodb.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/innobase/handler/handler0alter.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/innobase/handler/i_s.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/ibuf/ibuf0ibuf.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/lock/lock0lock.cc: error: There is an unknown macro here somewhere. Configuration is required. If IF_WSREP is a macro then please configure it. +storage/innobase/lock/lock0prdt.cc: error: Syntax Error: AST broken, 'g' doesn't have a parent. +storage/innobase/log/log0log.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/log/log0log.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/log/log0recv.cc: error: There is an unknown macro here somewhere. Configuration is required. If ut_d is a macro then please configure it. +storage/innobase/mtr/mtr0mtr.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/os/os0file.cc: error: syntax error +storage/innobase/page/page0page.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/page/page0zip.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/pars/pars0pars.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/row/row0ftsort.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/row/row0import.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/row/row0ins.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/row/row0log.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/innobase/row/row0merge.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/innobase/row/row0mysql.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/row/row0purge.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/row/row0quiesce.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/row/row0sel.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/row/row0upd.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/row/row0vers.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/srv/srv0srv.cc: error: There is an unknown macro here somewhere. Configuration is required. If ut_d is a macro then please configure it. +storage/innobase/srv/srv0start.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/trx/trx0i_s.cc: error: Array 'table_cache->chunks[39]' accessed at index 39, which is out of bounds. +storage/innobase/trx/trx0i_s.cc: error: Array 'table_cache->chunks[39]' accessed at index 39, which is out of bounds. +storage/innobase/trx/trx0purge.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/trx/trx0rec.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/trx/trx0trx.cc: error: There is an unknown macro here somewhere. Configuration is required. If ut_d is a macro then please configure it. +storage/innobase/trx/trx0undo.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/aria_pack.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ha_maria.cc: error: syntax error +storage/maria/ha_maria.cc: error: syntax error +storage/maria/ha_s3.cc: error: syntax error +storage/maria/ha_s3.cc: error: Unmatched '{'. Configuration: 'MOVE_FILES_TO_S3_ON_CREATE'. +storage/maria/ma_bitmap.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_blockrec.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_check.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_checkpoint.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_delete.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_ft_parser.c: error: Address of local auto-variable assigned to a function parameter. +storage/maria/ma_key.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_loghandler.c: warning: Uninitialized variable: data->current_offset +storage/maria/ma_open.c: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/maria/ma_pagecache.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_pagecache.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_range.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_recovery_util.c: error: va_start() or va_copy() called subsequently on 'args' without va_end() in between. +storage/maria/ma_rkey.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_rt_index.c: error: failed to expand 'rt_PAGE_END', Wrong number of parameters for macro 'rt_PAGE_END'. +storage/maria/ma_search.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_sp_key.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_update.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_write.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/ft_parser.c: error: Address of local auto-variable assigned to a function parameter. +storage/myisam/ha_myisam.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/mi_check.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/mi_close.c: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/myisam/mi_delete.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/mi_key.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/mi_locking.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/mi_open.c: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/myisam/mi_range.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/mi_rkey.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/mi_search.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/mi_update.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/mi_write.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/myisampack.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisammrg/ha_myisammrg.cc: error: syntax error +storage/oqgraph/ha_oqgraph.cc: error: syntax error +storage/perfschema/ha_perfschema.cc: error: syntax error +storage/perfschema/table_esgs_by_host_by_event_name.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +storage/perfschema/table_esms_by_host_by_event_name.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +storage/perfschema/table_events_waits.cc: error: Uninitialized struct member: wait.m_wait_class +storage/perfschema/table_events_waits.cc: error: Uninitialized variable: wait +storage/perfschema/table_events_waits.cc: error: Uninitialized struct member: wait.m_wait_class +storage/perfschema/table_events_waits.cc: error: Uninitialized variable: wait->m_wait_class +storage/perfschema/table_ews_by_host_by_event_name.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +storage/perfschema/table_hosts.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +storage/sequence/sequence.cc: error: syntax error +storage/test_sql_discovery/test_sql_discovery.cc: error: syntax error +strings/decimal.c: warning: Possible null pointer dereference: to +strings/dump_map.c: error: Array 'fromstat[256]' accessed at index 256, which is out of bounds. +tests/mysql_client_fw.c: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +tests/thread_test.c: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +unittest/mysys/dynstring-t.c: error: syntax error +unittest/mysys/queues-t.c: error: Uninitialized variable: i +unittest/mysys/waiting_threads-t.c: error: Uninitialized variable: m +unittest/mytap/tap.c: error: va_list 'ap' used before va_start() was called. +unittest/mytap/tap.c: error: va_list 'ap' used before va_start() was called. +unittest/mytap/tap.c: error: va_list 'ap' used before va_start() was called. +unittest/mytap/tap.c: error: va_list 'ap' used before va_start() was called. +vio/viosocket.c: error: There is an unknown macro here somewhere. Configuration is required. If MYSQL_SOCKET_WAIT_VARIABLES is a macro then please configure it. +vio/viosocket.c: error: There is an unknown macro here somewhere. Configuration is required. If MYSQL_SOCKET_WAIT_VARIABLES is a macro then please configure it. +vio/viosslfactories.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +vio/viotest-sslconnect.cc: error: Memory pointed to by 'vio' is freed twice. +vio/viotest-sslconnect.cc: error: Memory pointed to by 'ssl_connector' is freed twice. +wsrep-lib/src/server_state.cpp: error: syntax error: keyword 'try' is not allowed in global scope +wsrep-lib/src/thread_service_v1.cpp: error: Rethrowing current exception with 'throw;', it seems there is no current exception to rethrow. If there is no current exception this calls std::terminate(). More: https://isocpp.org/wiki/faq/exceptions#throw-without-an-object diff --git a/tests/code_quality/flawfinder_ignorelist.json b/tests/code_quality/flawfinder_ignorelist.json new file mode 100644 index 00000000000..11acda1a29a --- /dev/null +++ b/tests/code_quality/flawfinder_ignorelist.json @@ -0,0 +1,706 @@ +{ + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "version": "2.1.0", + "runs": [ + { + "tool": { + "driver": { + "name": "Flawfinder", + "version": "2.0.19", + "informationUri": "https://dwheeler.com/flawfinder/", + "supportedTaxonomies": [ + { + "name": "CWE", + "guid": "FFC64C90-42B6-44CE-8BEB-F6B7DAE649E5" + } + ] + } + }, + "columnKind": "utf16CodeUnits", + "results": [ + { + "ruleId": "FF1035", + "level": "error", + "message": { + "text": "race/readlink:This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./extra/mariabackup/xtrabackup.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 17, + "endColumn": 57, + "snippet": { + "text": " ssize_t ret = readlink(\"/proc/self/exe\", buf, size-1);" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "11523490c7f8cba115bce125bbce94de5cd5e7f66d4dd07a391aac70fbbdd353" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1033", + "level": "error", + "message": { + "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./client/mysqltest.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 13, + "endColumn": 38, + "snippet": { + "text": " err_code= chmod(ds_file.str, mode);" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "12a7fa6bbd4c81be975838bae2b7b26fe841acaf9804e6d0299188683e230908" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1031", + "level": "error", + "message": { + "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./storage/columnstore/columnstore/writeengine/shared/we_typeext.h", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 12, + "endColumn": 63, + "snippet": { + "text": " if (fs.chown(fileName.c_str(), uid, gid, funcErrno) == -1)" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "16bbd2ed7b8f86182e8f66980ee23b9e0dfe63a9330b7c16a2c2b81a3e8a9377" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1031", + "level": "error", + "message": { + "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.cpp", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 16, + "endColumn": 49, + "snippet": { + "text": " if ((ret = ::chown(objectName, p_uid, p_gid)))" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "1882617c363794bedb3e70a4a3be704a3ee928778709b75f971e91ffc7a224b6" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1031", + "level": "error", + "message": { + "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./libmariadb/external/zlib/examples/gun.c", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 11, + "endColumn": 45, + "snippet": { + "text": " (void)chown(to, was.st_uid, was.st_gid);" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "29cdc74512c56c56c73604ac5fd1c08bf2b38845b3aa91f4129ef9424bdb7f7f" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1014", + "level": "error", + "message": { + "text": "buffer/gets:Does not check for buffer overflows (CWE-120, CWE-20)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./extra/readline/tilde.c", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 12, + "endColumn": 24, + "snippet": { + "text": " if (!gets (line))" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "34a940ccc6e0248a2cf725e8a0c3f808d1f36d47fc814bd9daadb17f5563d357" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1033", + "level": "error", + "message": { + "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./sql/sql_class.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 10, + "endColumn": 28, + "snippet": { + "text": " (void) chmod(path, 0644);" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "3f97fd0452062ab69db87a04222a17c37c216c4e28e2ae3622730da8dd070d2e" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1033", + "level": "error", + "message": { + "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./mysys/my_chmod.c", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 7, + "endColumn": 25, + "snippet": { + "text": " if (chmod(name, mode))" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "46805eec1d288b072d4edb3214822220d394307195be79a33ec3bce455d14750" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1035", + "level": "error", + "message": { + "text": "race/readlink:This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./sql/signal_handler.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 13, + "endColumn": 68, + "snippet": { + "text": " if ((len= readlink(\"/proc/self/cwd\", buff, sizeof(buff)-1)) >= 0)" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "4c4d621e451a67f86c3e999e9dd3ceb2639bf4f63b0a946b7836b01d752ca557" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1035", + "level": "error", + "message": { + "text": "race/readlink:This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./storage/columnstore/columnstore/primitives/blockcache/fsutils.cpp", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 25, + "endColumn": 77, + "snippet": { + "text": " ssize_t realnamelen = readlink(path.string().c_str(), realname, PATH_MAX);" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "52b685022ce9db6c7c332217d74745fc48b65e3e00f2cfdbde8f858d28b8aa9f" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1031", + "level": "error", + "message": { + "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./storage/columnstore/columnstore/utils/idbdatafile/IDBFileSystem.h", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 15, + "endColumn": 104, + "snippet": { + "text": " virtual int chown(const char* objectName, const uid_t p_uid, const gid_t p_pid, int& funcErrno) const" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "5eb02dbd4395b5c1a30be2665e0db914b8a6fcc6997ae18f8cc8651ec2e788cb" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1033", + "level": "error", + "message": { + "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./libmariadb/external/zlib/examples/gun.c", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 11, + "endColumn": 42, + "snippet": { + "text": " (void)chmod(to, was.st_mode & 07777);" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "6044966208b061aada8a837a2be969922745fc7d445f7429417ab77f19c40fa5" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1033", + "level": "error", + "message": { + "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./storage/columnstore/columnstore/tools/passwd/secrets.cpp", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 9, + "endColumn": 40, + "snippet": { + "text": " if (chmod(filepathc, S_IRUSR) == 0)" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "6f7b5195eb8526770ad61729bd310387d05d0407d1be5dc902f7116e365f4232" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1031", + "level": "error", + "message": { + "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./storage/columnstore/columnstore/tools/passwd/secrets.cpp", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 13, + "endColumn": 71, + "snippet": { + "text": " if (chown(filepathc, userinfo->pw_uid, userinfo->pw_gid) == 0)" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "745b105be1b6a7c1e78f52a190edb9aaa848acd9c284c18f40e8a613520ae3df" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1033", + "level": "error", + "message": { + "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./storage/columnstore/columnstore/versioning/BRM/oidserver.cpp", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 7, + "endColumn": 86, + "snippet": { + "text": " chmod(fFilename.c_str(), 0664); // XXXPAT: override umask at least for testing" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "7ccf3c7811cbce45e635a9fd32003a9477eeee78679105dd973ad921fb72672a" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1035", + "level": "error", + "message": { + "text": "race/readlink:This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./mysys/my_symlink.c", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 15, + "endColumn": 56, + "snippet": { + "text": " if ((length=readlink(filename, to, FN_REFLEN-1)) < 0)" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "7da5207ac0f5baba73c026472a2d3805eed92931852575db64f513702977dd70" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1031", + "level": "error", + "message": { + "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.h", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 7, + "endColumn": 106, + "snippet": { + "text": " int chown(const char* objectName, const uid_t p_uid, const gid_t p_pid, int& funcErrno) const override;" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "837ef3ca85cb450e25a7db58e83d60ce5268b46e9130f6e47d781aff97b9a832" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1031", + "level": "error", + "message": { + "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./storage/columnstore/columnstore/utils/idbdatafile/PosixFileSystem.cpp", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 22, + "endColumn": 111, + "snippet": { + "text": "int PosixFileSystem::chown(const char* objectName, const uid_t p_uid, const gid_t p_gid, int& funcErrno) const" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "92873ab0b24cc9dc2ab7ec959968b3d3568e0d9e92b1659c4f823c322397f33a" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1031", + "level": "error", + "message": { + "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./mysys/my_redel.c", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 7, + "endColumn": 49, + "snippet": { + "text": " if (chown(to, statbuf.st_uid, statbuf.st_gid))" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "97d2cfe4cb9428e812b796eb39c27f28dc8b198ab9655c2aff8c442de39bdcfe" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1035", + "level": "error", + "message": { + "text": "race/readlink:This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./storage/rocksdb/rocksdb/port/stack_trace.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 15, + "endColumn": 54, + "snippet": { + "text": " auto read = readlink(link, name, sizeof(name) - 1);" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "acb399f2a4a15ef8da36c47631bc4ee4bcc1bb0577dfbda141d2eb5d7723af40" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1033", + "level": "error", + "message": { + "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./mysys/my_copy.c", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 9, + "endColumn": 46, + "snippet": { + "text": " if (chmod(to, stat_buff.st_mode & 07777))" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "bddb795a7efbd73a4387bbd33fd4f9e505b4f759d784e5d51f60cc43011ee610" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1031", + "level": "error", + "message": { + "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./mysys/my_copy.c", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 9, + "endColumn": 55, + "snippet": { + "text": " if (chown(to, stat_buff.st_uid, stat_buff.st_gid))" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "c63a81105d753de4762cbcab48d9700f7069da3cd9d57bf4329a6d20fad288aa" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1033", + "level": "error", + "message": { + "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./sql/mysqld.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 12, + "endColumn": 71, + "snippet": { + "text": " (void) chmod(mysqld_unix_port,S_IFSOCK);\t/* Fix solaris 2.6 bug */" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "d0c4f1302290e2367e246ef7c8d3ea69589cbc4bc148e0efdd4c283fa03cbe01" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1033", + "level": "error", + "message": { + "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./mysys/my_redel.c", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 7, + "endColumn": 42, + "snippet": { + "text": " if (chmod(to, statbuf.st_mode & 07777))" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "e11b8df9cbb9e459e4d67a0af5e627b6b1285c78fe23f5a1c823285da96495a8" + }, + "rank": 1.0 + } + ], + "externalPropertyFileReferences": { + "taxonomies": [ + { + "location": { + "uri": "https://raw.githubusercontent.com/sarif-standard/taxonomies/main/CWE_v4.4.sarif" + }, + "guid": "FFC64C90-42B6-44CE-8BEB-F6B7DAE649E5" + } + ] + } + } + ] +} From f70de1451ba24e0459edcdbe2e67e3df5f348050 Mon Sep 17 00:00:00 2001 From: Weijun Huang Date: Sat, 11 Mar 2023 11:06:03 +0100 Subject: [PATCH 078/260] MDEV-30351 crash in Item_func_left::val_str When using LEFT() function with a string that is without a charset, the function crashes. This is because the function assumes that the string has a charset, and tries to use it to calculate the length of the string. Two functions, UNHEX and WEIGHT_STRING, returned a string without the charset being set to a not null value. The fix is to set charset when calling val_str on these two functions. Reviewed-by: Alexander Barkov Reviewed-by: Daniel Black --- mysql-test/main/func_str.result | 9 +++++++++ mysql-test/main/func_str.test | 10 ++++++++-- sql/item_strfunc.cc | 2 ++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/mysql-test/main/func_str.result b/mysql-test/main/func_str.result index 2f692f9135e..4e36acd25ca 100644 --- a/mysql-test/main/func_str.result +++ b/mysql-test/main/func_str.result @@ -5240,6 +5240,15 @@ DROP TABLE crash_test_2; # Start of 10.4 tests # # +# MDEV-30351 crash in Item_func_left::val_str +# +SELECT WEIGHT_STRING('aa') IN (LEFT(WEIGHT_STRING('aaa'),4),'bbb') as expect_1; +expect_1 +1 +SELECT UNHEX('0032') in (LEFT(UNHEX('003200'), 2),'dog') as expect_1; +expect_1 +1 +# # MDEV-21841 CONV() function truncates the result type to 21 symbol. # CREATE TABLE t1(i BIGINT); diff --git a/mysql-test/main/func_str.test b/mysql-test/main/func_str.test index 910214901e5..da3483dd08a 100644 --- a/mysql-test/main/func_str.test +++ b/mysql-test/main/func_str.test @@ -2256,16 +2256,22 @@ CREATE TABLE crash_test_2 ( DROP TABLE t1; DROP TABLE crash_test_2; - --echo # --echo # End of 10.3 tests --echo # - --echo # --echo # Start of 10.4 tests --echo # +--echo # +--echo # MDEV-30351 crash in Item_func_left::val_str +--echo # + +SELECT WEIGHT_STRING('aa') IN (LEFT(WEIGHT_STRING('aaa'),4),'bbb') as expect_1; + +SELECT UNHEX('0032') in (LEFT(UNHEX('003200'), 2),'dog') as expect_1; + --echo # --echo # MDEV-21841 CONV() function truncates the result type to 21 symbol. --echo # diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index a57fbd7bebc..f95f4795820 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -3729,6 +3729,7 @@ String *Item_func_weight_string::val_str(String *str) flags); DBUG_ASSERT(frm_length <= tmp_length); + str->set_charset(&my_charset_bin); str->length(frm_length); null_value= 0; return str; @@ -3808,6 +3809,7 @@ String *Item_func_unhex::val_str(String *str) from= res->ptr(); null_value= 0; + str->set_charset(&my_charset_bin); str->length(length); to= (char*) str->ptr(); if (res->length() % 2) From 8e55d7ea4a2f94ae3f38fdd8785778612d4b1203 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Fri, 31 Mar 2023 16:41:22 +1100 Subject: [PATCH 079/260] Revert "Added mysql-log-rotate to .gitignore" This reverts commit 158a58245813b1959d6ee912d77734620c7cf3ba. In 10.11 the generation of mysql-log-rotate was removed in commit fd0dcad676e7b8665f5363d97849a20cbb712933 There's no need to ignore files that aren't generated. --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index f86d7676413..887e45e6a6a 100644 --- a/.gitignore +++ b/.gitignore @@ -267,7 +267,6 @@ support-files/mysql.10.0.11.spec support-files/mysql.server support-files/mysql.service support-files/mysql.spec -support-files/mysql-log-rotate support-files/mysqld.service support-files/mysqld_multi.server support-files/policy/selinux/mysqld-safe.pp From cadc3efcddb078fe8fe19a6121cc2a95be9a97de Mon Sep 17 00:00:00 2001 From: Teemu Ollakka Date: Mon, 13 Feb 2023 18:14:50 +0200 Subject: [PATCH 080/260] MDEV-27317 wsrep_checkpoint order violation due to certification failure With binlogs enabled, debug assertion ut_ad(xid_seqno > wsrep_seqno) fired in trx_rseg_update_wsrep_checkpoint() when an applier thread synced the seqno out of order for write set which had failed certification. This was caused by releasing commit order too early when binlogs were on, allowing group commit to run in parallel and commit following transactions too early. Fixed by extending the commit order critical section to cover call to wsrep_set_SE_checkpoint() also when binlogs are on. Signed-off-by: Julius Goryavsky --- sql/wsrep_high_priority_service.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sql/wsrep_high_priority_service.cc b/sql/wsrep_high_priority_service.cc index c396a9eeae5..96269481559 100644 --- a/sql/wsrep_high_priority_service.cc +++ b/sql/wsrep_high_priority_service.cc @@ -472,7 +472,13 @@ int Wsrep_high_priority_service::log_dummy_write_set(const wsrep::ws_handle& ws_ if (!WSREP_EMULATE_BINLOG(m_thd)) { wsrep_register_for_group_commit(m_thd); - ret = ret || cs.provider().commit_order_leave(ws_handle, ws_meta, err); + /* wait_for_prior_commit() ensures that all preceding transactions + have been committed and seqno has been synced into + storage engine. We don't release commit order here yet to + avoid following transactions to sync seqno before + wsrep_set_SE_checkpoint() below returns. This effectively pauses + group commit for the checkpoint operation, but is the only way to + ensure proper ordering. */ m_thd->wait_for_prior_commit(); } @@ -482,10 +488,7 @@ int Wsrep_high_priority_service::log_dummy_write_set(const wsrep::ws_handle& ws_ { wsrep_unregister_from_group_commit(m_thd); } - else - { - ret= ret || cs.provider().commit_order_leave(ws_handle, ws_meta, err); - } + ret= ret || cs.provider().commit_order_leave(ws_handle, ws_meta, err); cs.after_applying(); } DBUG_RETURN(ret); From eaebe8b5600b144c51a9405de42a70bd4b710987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Fri, 31 Mar 2023 12:48:13 +0200 Subject: [PATCH 081/260] MDEV-25045 : Assertion `client_state_.mode() != wsrep::client_state::m_toi' failed in int wsrep::transaction::before_commit() CREATE [TEMPORARY] SEQUENCE is internally CREATE+INSERT (initial value) and it is replicated using statement based replication. In Galera we use either TOI or RSU so we should skip commit time hooks for it. Signed-off-by: Julius Goryavsky --- .../suite/galera/r/galera_sequences.result | 61 ++++++++++++++++++- .../suite/galera/t/galera_sequences.cnf | 9 +++ .../suite/galera/t/galera_sequences.test | 53 +++++++++++++++- .../suite/galera_3nodes/galera_2x3nodes.cnf | 2 +- sql/wsrep_trans_observer.h | 15 ++++- 5 files changed, 133 insertions(+), 7 deletions(-) create mode 100644 mysql-test/suite/galera/t/galera_sequences.cnf diff --git a/mysql-test/suite/galera/r/galera_sequences.result b/mysql-test/suite/galera/r/galera_sequences.result index 7276cb8dbde..da669e6774e 100644 --- a/mysql-test/suite/galera/r/galera_sequences.result +++ b/mysql-test/suite/galera/r/galera_sequences.result @@ -1,6 +1,11 @@ connection node_2; connection node_1; connection node_1; +CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); +CALL mtr.add_suppression("WSREP: CREATE TABLE isolation failure"); +connection node_2; +CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); +connection node_1; CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 1000000 increment by 0 cache 1000 nocycle ENGINE=InnoDB; SHOW CREATE SEQUENCE seq; Table Create Table @@ -47,6 +52,58 @@ NEXT VALUE FOR Seq1_1 3001 connection node_1; DROP SEQUENCE Seq1_1; -CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); +connection node_1; +CREATE TABLE t2 (d CHAR(1)KEY); +SET SESSION autocommit=0; +INSERT INTO t2 VALUES(1); +CREATE TEMPORARY SEQUENCE seq1 NOCACHE ENGINE=INNODB; +CREATE SEQUENCE seq2 NOCACHE ENGINE=INNODB; +COMMIT; +SET SESSION AUTOCOMMIT=1; +SHOW CREATE TABLE seq1; +Table Create Table +seq1 CREATE TEMPORARY TABLE `seq1` ( + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used', + `increment` bigint(21) NOT NULL COMMENT 'increment value', + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed', + `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' +) ENGINE=InnoDB SEQUENCE=1 connection node_2; -CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); +SHOW CREATE SEQUENCE seq1; +ERROR 42S02: Table 'test.seq1' doesn't exist +SHOW CREATE SEQUENCE seq2; +Table Create Table +seq2 CREATE SEQUENCE `seq2` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=InnoDB +connection node_1; +SET SESSION autocommit=1; +DROP SEQUENCE seq1; +DROP SEQUENCE seq2; +DROP TABLE t2; +SET SESSION AUTOCOMMIT=0; +SET SESSION wsrep_OSU_method='RSU'; +CREATE TABLE t1(c1 VARCHAR(10)); +INSERT INTO t1 (c1) VALUES(''); +create temporary sequence sq1 NOCACHE engine=innodb; +create sequence sq2 NOCACHE engine=innodb; +COMMIT; +SHOW CREATE SEQUENCE sq1; +Table Create Table +sq1 CREATE SEQUENCE `sq1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=InnoDB +SHOW CREATE SEQUENCE sq2; +Table Create Table +sq2 CREATE SEQUENCE `sq2` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=InnoDB +connection node_2; +SHOW CREATE SEQUENCE sq1; +ERROR 42S02: Table 'test.sq1' doesn't exist +SHOW CREATE SEQUENCE sq2; +ERROR 42S02: Table 'test.sq2' doesn't exist +connection node_1; +SET SESSION AUTOCOMMIT=1; +DROP TABLE t1; +DROP SEQUENCE sq1; +DROP SEQUENCE sq2; +SET SESSION wsrep_OSU_method='TOI'; diff --git a/mysql-test/suite/galera/t/galera_sequences.cnf b/mysql-test/suite/galera/t/galera_sequences.cnf new file mode 100644 index 00000000000..98e724fb2d0 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_sequences.cnf @@ -0,0 +1,9 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +log-bin +log-slave-updates + +[mysqld.2] +log-bin +log-slave-updates diff --git a/mysql-test/suite/galera/t/galera_sequences.test b/mysql-test/suite/galera/t/galera_sequences.test index d469cc73516..faa3b46d2a7 100644 --- a/mysql-test/suite/galera/t/galera_sequences.test +++ b/mysql-test/suite/galera/t/galera_sequences.test @@ -4,6 +4,13 @@ # MDEV-19353 : Alter Sequence do not replicate to another nodes with in Galera Cluster # +--connection node_1 +CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); +CALL mtr.add_suppression("WSREP: CREATE TABLE isolation failure"); +--connection node_2 + +CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); + --connection node_1 CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 1000000 increment by 0 cache 1000 nocycle ENGINE=InnoDB; SHOW CREATE SEQUENCE seq; @@ -45,8 +52,48 @@ select NEXT VALUE FOR Seq1_1; --connection node_1 DROP SEQUENCE Seq1_1; -CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); +# +# MDEV-24045 : Assertion client_state_.mode() != wsrep::client_state::m_toi failed in int wsrep::transaction::before_commit() +# +--connection node_1 +CREATE TABLE t2 (d CHAR(1)KEY); +SET SESSION autocommit=0; +INSERT INTO t2 VALUES(1); +CREATE TEMPORARY SEQUENCE seq1 NOCACHE ENGINE=INNODB; +CREATE SEQUENCE seq2 NOCACHE ENGINE=INNODB; +COMMIT; +SET SESSION AUTOCOMMIT=1; +SHOW CREATE TABLE seq1; --connection node_2 - -CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); +--error ER_NO_SUCH_TABLE +SHOW CREATE SEQUENCE seq1; +SHOW CREATE SEQUENCE seq2; +--connection node_1 +SET SESSION autocommit=1; +DROP SEQUENCE seq1; +DROP SEQUENCE seq2; +DROP TABLE t2; +# +# Case2 +# +SET SESSION AUTOCOMMIT=0; +SET SESSION wsrep_OSU_method='RSU'; +CREATE TABLE t1(c1 VARCHAR(10)); +INSERT INTO t1 (c1) VALUES(''); +create temporary sequence sq1 NOCACHE engine=innodb; +create sequence sq2 NOCACHE engine=innodb; +COMMIT; +SHOW CREATE SEQUENCE sq1; +SHOW CREATE SEQUENCE sq2; +--connection node_2 +--error ER_NO_SUCH_TABLE +SHOW CREATE SEQUENCE sq1; +--error ER_NO_SUCH_TABLE +SHOW CREATE SEQUENCE sq2; +--connection node_1 +SET SESSION AUTOCOMMIT=1; +DROP TABLE t1; +DROP SEQUENCE sq1; +DROP SEQUENCE sq2; +SET SESSION wsrep_OSU_method='TOI'; diff --git a/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf b/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf index 9f99adbd711..cd7a892f4c9 100644 --- a/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf +++ b/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf @@ -55,7 +55,7 @@ wsrep-on=1 #galera_port=@OPT.port #ist_port=@OPT.port #sst_port=@OPT.port -wsrep_cluster_address='gcomm:// +wsrep_cluster_address=gcomm:// wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.4.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' wsrep_node_address='127.0.0.1:@mysqld.4.#galera_port' wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port diff --git a/sql/wsrep_trans_observer.h b/sql/wsrep_trans_observer.h index f1d0eebf6dd..5f799d56c05 100644 --- a/sql/wsrep_trans_observer.h +++ b/sql/wsrep_trans_observer.h @@ -1,4 +1,4 @@ -/* Copyright 2016-2022 Codership Oy +/* Copyright 2016-2023 Codership Oy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -214,6 +214,19 @@ static inline bool wsrep_run_commit_hook(THD* thd, bool all) } mysql_mutex_unlock(&thd->LOCK_thd_data); } + + mysql_mutex_lock(&thd->LOCK_thd_data); + /* Transaction creating sequence is TOI or RSU, + CREATE [TEMPORARY] SEQUENCE = CREATE + INSERT (initial value) + and replicated using statement based replication, thus + the commit hooks will be skipped */ + if (ret && + (thd->wsrep_cs().mode() == wsrep::client_state::m_toi || + thd->wsrep_cs().mode() == wsrep::client_state::m_rsu) && + thd->lex->sql_command == SQLCOM_CREATE_SEQUENCE) + ret= false; + mysql_mutex_unlock(&thd->LOCK_thd_data); + DBUG_PRINT("wsrep", ("return: %d", ret)); DBUG_RETURN(ret); } From dc1d6213f9a5ad4a53d35a886f52adf4ee0a2b5c Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Tue, 7 Mar 2023 19:49:57 +0300 Subject: [PATCH 082/260] MDEV-30806: ANALYZE FORMAT=JSON: better support for BNL and BNL-H joins In block-nl-join, add: - r_loops - this shows how many incoming record combinations this query plan node had. - r_effective_rows - this shows the average number of matching rows that this table had for each incoming record combination. This is comparable with r_rows in non-blocked access methods. For BNL-joins, it is always equal to $.table.r_rows * $.table.r_filtered For BNL-H joins the value cannot be computed from other values Reviewed by: Monty --- mysql-test/main/analyze_format_json.result | 140 +++++++++++++++++++- mysql-test/main/analyze_format_json.test | 42 ++++++ mysql-test/main/analyze_stmt_orderby.result | 8 +- mysql-test/main/except.result | 16 ++- mysql-test/main/except_all.result | 16 ++- mysql-test/main/explain_json.result | 4 +- mysql-test/main/intersect.result | 8 +- mysql-test/main/intersect_all.result | 8 +- mysql-test/main/rowid_filter_innodb.result | 8 +- sql/sql_analyze_stmt.h | 32 ++++- sql/sql_explain.cc | 19 ++- sql/sql_explain.h | 4 + sql/sql_select.cc | 3 + sql/sql_select.h | 1 + 14 files changed, 279 insertions(+), 30 deletions(-) diff --git a/mysql-test/main/analyze_format_json.result b/mysql-test/main/analyze_format_json.result index fc643d1a8af..abe3fab4643 100644 --- a/mysql-test/main/analyze_format_json.result +++ b/mysql-test/main/analyze_format_json.result @@ -151,7 +151,9 @@ ANALYZE "buffer_type": "flat", "buffer_size": "1Kb", "join_type": "BNL", - "r_filtered": 100 + "r_loops": 20, + "r_filtered": 100, + "r_effective_rows": 60 } } } @@ -192,7 +194,9 @@ ANALYZE "buffer_size": "1Kb", "join_type": "BNL", "attached_condition": "tbl1.c > tbl2.c", - "r_filtered": 15.83333333 + "r_loops": 20, + "r_filtered": 15.83333333, + "r_effective_rows": 60 } } } @@ -652,7 +656,9 @@ ANALYZE "buffer_size": "65", "join_type": "BNL", "attached_condition": "(t2.b,t2.b in (subquery#2))", - "r_filtered": null + "r_loops": 2, + "r_filtered": null, + "r_effective_rows": 0 }, "subqueries": [ { @@ -742,7 +748,9 @@ ANALYZE "buffer_type": "flat", "buffer_size": "1", "join_type": "BNL", - "r_filtered": null + "r_loops": 2, + "r_filtered": null, + "r_effective_rows": 0 }, "subqueries": [ { @@ -774,7 +782,9 @@ ANALYZE "buffer_size": "65", "join_type": "BNL", "attached_condition": "t2.f2 = t3.f3", - "r_filtered": null + "r_loops": 0, + "r_filtered": null, + "r_effective_rows": null } } } @@ -849,3 +859,123 @@ ANALYZE } } drop table t0,t1,t2; +# +# MDEV-30806: ANALYZE FORMAT=JSON: better support for BNL and BNL-H joins +# +create table t10 ( +a int, +b int +); +insert into t10 select seq, seq/3 from seq_0_to_999; +create table t11 ( +a int, +b int +); +insert into t11 select seq, seq/5 from seq_0_to_999; +analyze table t10,t11 persistent for all; +Table Op Msg_type Msg_text +test.t10 analyze status Engine-independent statistics collected +test.t10 analyze status OK +test.t11 analyze status Engine-independent statistics collected +test.t11 analyze status OK +analyze format=json +select * from t10, t11 +where +t10.a < 700 and +t11.a < 100 +and t10.b=t11.b; +ANALYZE +{ + "query_block": { + "select_id": 1, + "r_loops": 1, + "r_total_time_ms": "REPLACED", + "table": { + "table_name": "t11", + "access_type": "ALL", + "r_loops": 1, + "rows": 1000, + "r_rows": 1000, + "r_table_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", + "filtered": 10.15625, + "r_filtered": 10, + "attached_condition": "t11.a < 100" + }, + "block-nl-join": { + "table": { + "table_name": "t10", + "access_type": "ALL", + "r_loops": 1, + "rows": 1000, + "r_rows": 1000, + "r_table_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", + "filtered": 70.3125, + "r_filtered": 70, + "attached_condition": "t10.a < 700" + }, + "buffer_type": "flat", + "buffer_size": "1Kb", + "join_type": "BNL", + "attached_condition": "t10.b = t11.b", + "r_loops": 100, + "r_filtered": 0.424285714, + "r_effective_rows": 700 + } + } +} +set @tmp=@@join_cache_level, join_cache_level=6; +analyze format=json +select * from t10, t11 +where +t10.a < 700 and +t11.a < 100 +and t10.b=t11.b; +ANALYZE +{ + "query_block": { + "select_id": 1, + "r_loops": 1, + "r_total_time_ms": "REPLACED", + "table": { + "table_name": "t11", + "access_type": "ALL", + "r_loops": 1, + "rows": 1000, + "r_rows": 1000, + "r_table_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", + "filtered": 10.15625, + "r_filtered": 10, + "attached_condition": "t11.a < 100 and t11.b is not null" + }, + "block-nl-join": { + "table": { + "table_name": "t10", + "access_type": "hash_ALL", + "key": "#hash#$hj", + "key_length": "5", + "used_key_parts": ["b"], + "ref": ["test.t11.b"], + "r_loops": 1, + "rows": 1000, + "r_rows": 1000, + "r_table_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", + "filtered": 70.3125, + "r_filtered": 70, + "attached_condition": "t10.a < 700" + }, + "buffer_type": "flat", + "buffer_size": "3Kb", + "join_type": "BNLH", + "attached_condition": "t10.b = t11.b", + "r_loops": 100, + "r_filtered": 100, + "r_effective_rows": 2.97 + } + } +} +set join_cache_level=@tmp; +drop table t10, t11; diff --git a/mysql-test/main/analyze_format_json.test b/mysql-test/main/analyze_format_json.test index 3f3324e9eec..84f44869afe 100644 --- a/mysql-test/main/analyze_format_json.test +++ b/mysql-test/main/analyze_format_json.test @@ -226,3 +226,45 @@ create table t2 as select * from t1; --source include/analyze-format.inc analyze format=json select a, (select t2.b from t2 where t2.atimed)) \ { (tracker)->stop_tracking(thd); } + +/* + Just a counter to increment one value. Wrapped in a class to be uniform + with other counters used by ANALYZE. +*/ + +class Counter_tracker +{ +public: + Counter_tracker() : r_scans(0) {} + ha_rows r_scans; + + inline void on_scan_init() { r_scans++; } + + bool has_scans() const { return (r_scans != 0); } + ha_rows get_loops() const { return r_scans; } +}; + + /* A class for collecting read statistics. @@ -168,20 +187,16 @@ public: It can be used to track reading from files, buffers, etc). */ -class Table_access_tracker +class Table_access_tracker { public: - Table_access_tracker() : - r_scans(0), r_rows(0), /*r_rows_after_table_cond(0),*/ - r_rows_after_where(0) + Table_access_tracker() : r_scans(0), r_rows(0), r_rows_after_where(0) {} - ha_rows r_scans; /* How many scans were ran on this join_tab */ + ha_rows r_scans; /* how many scans were ran on this join_tab */ ha_rows r_rows; /* How many rows we've got after that */ ha_rows r_rows_after_where; /* Rows after applying attached part of WHERE */ - bool has_scans() const { return (r_scans != 0); } - ha_rows get_loops() const { return r_scans; } double get_avg_rows() const { return r_scans @@ -200,6 +215,9 @@ public: inline void on_scan_init() { r_scans++; } inline void on_record_read() { r_rows++; } inline void on_record_after_where() { r_rows_after_where++; } + + bool has_scans() const { return (r_scans != 0); } + ha_rows get_loops() const { return r_scans; } }; diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc index 480a1259ba8..caec818d130 100644 --- a/sql/sql_explain.cc +++ b/sql/sql_explain.cc @@ -1891,12 +1891,29 @@ void Explain_table_access::print_explain_json(Explain_query *query, if (is_analyze) { - //writer->add_member("r_loops").add_ll(jbuf_tracker.get_loops()); + writer->add_member("r_loops").add_ll(jbuf_loops_tracker.get_loops()); + writer->add_member("r_filtered"); if (jbuf_tracker.has_scans()) writer->add_double(jbuf_tracker.get_filtered_after_where()*100.0); else writer->add_null(); + /* + effective_rows is average number of matches we got for an incoming + row. The row is stored in the join buffer and then is read + from there, possibly multiple times. We can't count this number + directly. Infer it as: + total_number_of_row_combinations_considered / r_loops. + */ + writer->add_member("r_effective_rows"); + if (jbuf_loops_tracker.has_scans()) + { + double loops= (double)jbuf_loops_tracker.get_loops(); + double row_combinations= (double)jbuf_tracker.r_rows; + writer->add_double(row_combinations / loops); + } + else + writer->add_null(); } } diff --git a/sql/sql_explain.h b/sql/sql_explain.h index 31143ca9f77..746e1db1abd 100644 --- a/sql/sql_explain.h +++ b/sql/sql_explain.h @@ -842,8 +842,12 @@ public: Exec_time_tracker op_tracker; Gap_time_tracker extra_time_tracker; + /* When using join buffer: Track the reads from join buffer */ Table_access_tracker jbuf_tracker; + /* When using join buffer: Track the number of incoming record combinations */ + Counter_tracker jbuf_loops_tracker; + Explain_rowid_filter *rowid_filter; int print_explain(select_result_sink *output, uint8 explain_flags, diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 14766302298..2889d757e20 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -21231,6 +21231,8 @@ sub_select_cache(JOIN *join, JOIN_TAB *join_tab, bool end_of_records) /* The user has aborted the execution of the query */ DBUG_RETURN(NESTED_LOOP_KILLED); } + join_tab->jbuf_loops_tracker->on_scan_init(); + if (!test_if_use_dynamic_range_scan(join_tab)) { if (!cache->put_record()) @@ -27393,6 +27395,7 @@ bool JOIN_TAB::save_explain_data(Explain_table_access *eta, // psergey-todo: data for filtering! tracker= &eta->tracker; jbuf_tracker= &eta->jbuf_tracker; + jbuf_loops_tracker= &eta->jbuf_loops_tracker; /* Enable the table access time tracker only for "ANALYZE stmt" */ if (thd->lex->analyze_stmt) diff --git a/sql/sql_select.h b/sql/sql_select.h index 4ff95b31f3f..178573413af 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -309,6 +309,7 @@ typedef struct st_join_table { Table_access_tracker *tracker; Table_access_tracker *jbuf_tracker; + Counter_tracker *jbuf_loops_tracker; /* Bitmap of TAB_INFO_* bits that encodes special line for EXPLAIN 'Extra' column, or 0 if there is no info. From 3b6424407025aad39b00e60bd0d711b67272513f Mon Sep 17 00:00:00 2001 From: Hugo Wen Date: Fri, 24 Mar 2023 16:06:11 +0000 Subject: [PATCH 083/260] Handle meaningless addr2line results and increase timeout MariaDB server prints the stack information if a crash happens. It traverses the stack frames in function `print_with_addr_resolve`. For *EACH* frame, it tries to parse the file name and line number of the frame using `addr2line`, or prints `backtrace_symbols_fd` if `addr2line` fails. 1. Logic in `addr_resolve` function uses addr2line to get the file name and line numbers. It has a timeout of 500ms to wait for the response from addr2line. However, that's not enough on small instances especially if the debug information is in a separate file or compressed. Increase the timeout to 5 seconds to support some edge cases, as experiments showed addr2line may take 2-3 seconds on some frames. 2. While parsing a frame inside of a shared library using `addr2line`, the file name and line numbers could be `??`, empty or `0` if the debug info is not loaded. It's easy to reproduce when glibc-debuginfo is not installed. Instead of printing a meaningless frame like: :0(__GI___poll)[0x1505e9197639] ... ??:0(__libc_start_main)[0x7ffff6c8913a] We want to print the frame information using `backtrace_symbols_fd`, with the shared library name and a hexadecimal offset. Stacktrace example on a real instance with this commit: /lib64/libc.so.6(__poll+0x49)[0x145cbf71a639] ... /lib64/libc.so.6(__libc_start_main+0xea)[0x7f4d0034d13a] `addr_resolve` has considered the case of meaningless combination of file name and line number returned by `addr2line`. e.g. `??:?` However, conditions like `:0` and `??:0` are not handled. So now the function will rollback to `backtrace_symbols_fd` in above cases. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc. --- mysys/my_addr_resolve.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mysys/my_addr_resolve.c b/mysys/my_addr_resolve.c index ac1bdae187c..52fcaaf67bb 100644 --- a/mysys/my_addr_resolve.c +++ b/mysys/my_addr_resolve.c @@ -252,10 +252,10 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc) return 3; - /* 500 ms should be plenty of time for addr2line to issue a response. */ + /* 5000 ms should be plenty of time for addr2line to issue a response. */ /* Read in a loop till all the output from addr2line is complete. */ while (parsed == total_bytes_read && - (ret= poll(&poll_fds, 1, 500))) + (ret= poll(&poll_fds, 1, 5000))) { /* error during poll */ if (ret < 0) @@ -299,7 +299,8 @@ int my_addr_resolve(void *ptr, my_addr_loc *loc) loc->line= atoi(output + line_number_start); /* Addr2line was unable to extract any meaningful information. */ - if (strcmp(loc->file, "??") == 0) + if ((strcmp(loc->file, "??") == 0 || strcmp(loc->file, "") == 0) && + (loc->func[0] == '?' || loc->line == 0)) return 6; loc->file= strip_path(loc->file); From 1767390be4239c031ecbe999fa09bbc6c99c1c65 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Sat, 1 Apr 2023 14:42:05 +0200 Subject: [PATCH 084/260] Fix passing correct length of string in command print. --- sql/sql_select.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index c4fc2d19156..0651c1d58bd 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -27990,19 +27990,19 @@ enum explainable_cmd_type }; static -const char * const explainable_cmd_name []= +const LEX_CSTRING explainable_cmd_name []= { - "select ", - "insert ", - "replace ", - "update ", - "delete ", + {STRING_WITH_LEN("select ")}, + {STRING_WITH_LEN("insert ")}, + {STRING_WITH_LEN("replace ")}, + {STRING_WITH_LEN("update ")}, + {STRING_WITH_LEN("delete ")}, }; static -char const *get_explainable_cmd_name(enum explainable_cmd_type cmd) +const LEX_CSTRING* get_explainable_cmd_name(enum explainable_cmd_type cmd) { - return explainable_cmd_name[cmd]; + return explainable_cmd_name + cmd; } static @@ -28304,7 +28304,7 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type) query_type); } if (sel_type == UPDATE_CMD || sel_type == DELETE_CMD) - str->append(STRING_WITH_LEN(get_explainable_cmd_name(sel_type))); + str->append(get_explainable_cmd_name(sel_type)); if (sel_type == DELETE_CMD) { str->append(STRING_WITH_LEN(" from ")); From 6a10468ed35167cbc5dc57c1091f8d8dcb572f0a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 15 Mar 2023 22:03:51 +0100 Subject: [PATCH 085/260] MDEV-13255 main.status failed in buildbot Test fails sporadically and very rarely on this: ``` let $org_queries= `SHOW STATUS LIKE 'Queries'`; SELECT f1(); CALL p1(); let $new_queries= `SHOW STATUS LIKE 'Queries'`; let $diff= `SELECT SUBSTRING('$new_queries',9)-SUBSTRING('$org_queries',9)`; ``` if COM_QUIT from one of the earlier (in the test) disconnect's happens between the two SHOW STATUS commands. Because COM_QUIT increments "Queries". The directly previous test uses wait_condition to wait for its disconnects to complete. But there are more disconnects earlier in the test file and nothing waits for them. Let's change wait_condition to wait for *all* disconnect to complete. --- mysql-test/main/status.test | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/mysql-test/main/status.test b/mysql-test/main/status.test index 221a24aedf4..ae1b90f9f7f 100644 --- a/mysql-test/main/status.test +++ b/mysql-test/main/status.test @@ -280,7 +280,6 @@ show status like 'Com%function'; # connect (root, localhost, root,,test); connection root; -let $root_connection_id= `select connection_id()`; --disable_warnings create database db37908; --enable_warnings @@ -296,7 +295,6 @@ delimiter ;| connect (user1,localhost,mysqltest_1,,test); connection user1; -let $user1_connection_id= `select connection_id()`; --error ER_TABLEACCESS_DENIED_ERROR select * from db37908.t1; @@ -315,11 +313,8 @@ drop procedure proc37908; drop function func37908; REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost; DROP USER mysqltest_1@localhost; -# Wait till the sessions user1 and root are disconnected -let $wait_condition = - SELECT COUNT(*) = 0 - FROM information_schema.processlist - WHERE id in ('$root_connection_id','$user1_connection_id'); +# Wait until all non-default sessions are disconnected +let $wait_condition = SELECT COUNT(*) = 1 FROM information_schema.processlist; --source include/wait_condition.inc # From 0a6343909fcf8b193a1b517b3a16eabd4ae89a83 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 1 Apr 2023 15:58:14 +0200 Subject: [PATCH 086/260] ensure that STRING_WITH_LEN is only used with string literals This is allowed: STRING_WITH_LEN("string literal") This is not: char *str = "pointer to string"; ... STRING_WITH_LEN(str) .. In C++ this is also allowed: const char str[] = "string literal"; ... STRING_WITH_LEN(str) ... --- include/m_string.h | 19 ++++++++++++++++--- sql/debug_sync.cc | 2 +- .../PerconaFT/portability/toku_debug_sync.h | 9 ++++++--- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/include/m_string.h b/include/m_string.h index 4a06b90c1aa..0133d81f6df 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -198,9 +198,22 @@ extern ulonglong strtoull(const char *str, char **ptr, int base); #include -#define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1)) -#define USTRING_WITH_LEN(X) ((uchar*) X), ((size_t) (sizeof(X) - 1)) -#define C_STRING_WITH_LEN(X) ((char *) (X)), ((size_t) (sizeof(X) - 1)) +#ifdef __cplusplus +#include +template inline const char *_swl_check(T s) +{ + static_assert(std::is_same::value + || std::is_same::value, + "Wrong argument for STRING_WITH_LEN()"); + return s; +} +#define STRING_WITH_LEN(X) _swl_check(X), ((size_t) (sizeof(X) - 1)) +#else +#define STRING_WITH_LEN(X) (X ""), ((size_t) (sizeof(X) - 1)) +#endif + +#define USTRING_WITH_LEN(X) (uchar*) STRING_WITH_LEN(X) +#define C_STRING_WITH_LEN(X) (char *) STRING_WITH_LEN(X) #define LEX_STRING_WITH_LEN(X) (X).str, (X).length typedef struct st_mysql_const_lex_string LEX_CSTRING; diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc index 16ff4abafe1..5cb8fb715bf 100644 --- a/sql/debug_sync.cc +++ b/sql/debug_sync.cc @@ -1292,7 +1292,7 @@ uchar *debug_sync_value_ptr(THD *thd) if (opt_debug_sync_timeout) { - static char on[]= "ON - current signal: '"; + static const char on[]= "ON - current signal: '"; // Ensure exclusive access to debug_sync_global.ds_signal mysql_mutex_lock(&debug_sync_global.ds_mutex); diff --git a/storage/tokudb/PerconaFT/portability/toku_debug_sync.h b/storage/tokudb/PerconaFT/portability/toku_debug_sync.h index affe3054214..ff99c99d81e 100644 --- a/storage/tokudb/PerconaFT/portability/toku_debug_sync.h +++ b/storage/tokudb/PerconaFT/portability/toku_debug_sync.h @@ -64,9 +64,12 @@ inline void toku_debug_sync(struct tokutxn *txn, const char *sync_point_name) { void *client_extra; THD *thd; - toku_txn_get_client_id(txn, &client_id, &client_extra); - thd = reinterpret_cast(client_extra); - DEBUG_SYNC(thd, sync_point_name); + if (debug_sync_service) + { + toku_txn_get_client_id(txn, &client_id, &client_extra); + thd = reinterpret_cast(client_extra); + debug_sync_service(thd, sync_point_name, strlen(sync_point_name)); + } } #else // defined(ENABLED_DEBUG_SYNC) From 2a5763224e6424f9249b0ae97a819922a5fe0265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Thu, 5 Jan 2023 21:56:14 -0800 Subject: [PATCH 087/260] Deb: Sync Salsa-CI from Debian MariaDB 10.6 Compare to Debian packaging of MariaDB 1:10.6.11-2 release at commit https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/2934e8a795cbd1eba79e33b8d6c82ed2b0897128 and sync upstream everything that is relevant for upstream and safe to import on a stable 10.6 release. * Use OpenSSL 1.1 from Debian Snapshots https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/0040c272bf8a9a253fcd393b235b18cd5cdc9289 Related: https://jira.mariadb.org/browse/MDEV-30322 * Prefer using bullseye-backports in mosts tests over buster-bpo https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/daa827ecded9dc1f096ecb05242116173298d602 * Add new upgrade test for MySQL Community Cluster 8.0 https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/3c71bec9b7626d25a55e23b2e570b4e125d5d5df * Enable automatic datadir move also on upgrades from MySQL.com packages https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/4cbbcb7e56d9604a67230d11a68543d5a83960e3 * Update Breaks/Replaces https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/2cab13d05959fe8f6ea56b866df51f3bfe17dd3f * Normalize apt-get and curl commands https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/8754ea2578bd214d75a2a9e6a0f7b4b74c062b41 * Standardize on using capitalized 'ON' in CMake build options https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/938757a85aee44c727f3f6996677ef1126c2f5aa * Apply wrap-and-sort -av and other minor tweaks and inline documentation NOTE TO MERGERS: This commit is made on 10.6 branch and can be merged to all later branches (10.7, 10.8, ..., 11.0). --- debian/control | 42 +++- debian/libmariadb-dev.install | 2 +- debian/libmariadb-dev.lintian-overrides | 1 + debian/mariadb-server-10.6.preinst | 16 +- debian/mariadb-server-core-10.6.install | 2 +- debian/mariadb-test.install | 2 +- debian/mariadb-test.links | 6 +- debian/rules | 18 +- debian/salsa-ci.yml | 308 +++++++++++++++++++----- 9 files changed, 309 insertions(+), 88 deletions(-) diff --git a/debian/control b/debian/control index 7f0d88e991c..70da8ba296e 100644 --- a/debian/control +++ b/debian/control @@ -305,13 +305,17 @@ Breaks: mariadb-server-10.0, mariadb-server-core-10.4, mariadb-server-core-10.5, mariadb-server-core-10.6 (<< ${source:Version}), + mysql-cluster-community-client-plugins, mysql-server-core-5.5, mysql-server-core-5.6, mysql-server-core-5.7, mysql-server-core-8.0, percona-server-server-5.6, + percona-server-server-5.7, + percona-server-server-8.0, percona-xtradb-cluster-server-5.6, - percona-xtradb-cluster-server-5.7 + percona-xtradb-cluster-server-5.7, + percona-xtradb-cluster-server-8.0 Replaces: mariadb-client-10.0, mariadb-client-10.1, mariadb-client-10.2, @@ -351,13 +355,17 @@ Replaces: mariadb-client-10.0, mysql-client-core-5.6, mysql-client-core-5.7, mysql-client-core-8.0, + mysql-cluster-community-client-plugins, mysql-server-core-5.5, mysql-server-core-5.6, mysql-server-core-5.7, mysql-server-core-8.0, percona-server-server-5.6, + percona-server-server-5.7, + percona-server-server-8.0, percona-xtradb-cluster-server-5.6, percona-xtradb-cluster-server-5.7, + percona-xtradb-cluster-server-8.0, virtual-mysql-client-core Provides: default-mysql-client-core, virtual-mysql-client-core @@ -540,6 +548,7 @@ Breaks: mariadb-client-10.0, mariadb-client-10.6 (<< ${source:Version}), mariadb-server-10.0, mariadb-server-10.1, + mariadb-server-10.2, mariadb-server-10.3, mariadb-server-10.4, mariadb-server-10.5, @@ -561,6 +570,7 @@ Replaces: mariadb-client-10.0, mariadb-client-10.6 (<< ${source:Version}), mariadb-server-10.0, mariadb-server-10.1, + mariadb-server-10.2, mariadb-server-10.3, mariadb-server-10.4, mariadb-server-10.5, @@ -733,9 +743,11 @@ Package: mariadb-backup Architecture: any Breaks: mariadb-backup-10.1, mariadb-backup-10.2, + mariadb-backup-10.3, mariadb-client-10.1 Replaces: mariadb-backup-10.1, mariadb-backup-10.2, + mariadb-backup-10.3, mariadb-client-10.1 Depends: mariadb-client-core-10.6 (= ${binary:Version}), ${misc:Depends}, @@ -758,12 +770,16 @@ Breaks: mariadb-connect-engine-10.0, mariadb-connect-engine-10.1, mariadb-connect-engine-10.2, mariadb-connect-engine-10.3, - mariadb-connect-engine-10.4 + mariadb-connect-engine-10.4, + mariadb-server-10.0, + mariadb-server-10.1 Replaces: mariadb-connect-engine-10.0, mariadb-connect-engine-10.1, mariadb-connect-engine-10.2, mariadb-connect-engine-10.3, - mariadb-connect-engine-10.4 + mariadb-connect-engine-10.4, + mariadb-server-10.0, + mariadb-server-10.1 Description: Connect storage engine for MariaDB Connect engine supports a number of file formats (dbf, xml, txt, bin, etc), connections to ODBC tables and remote MySQL tables, as well as a number of @@ -784,7 +800,7 @@ Description: Amazon S3 archival storage engine for MariaDB Package: mariadb-plugin-rocksdb Architecture: amd64 arm64 mips64el ppc64el Depends: mariadb-server-10.6 (= ${server:Version}), - python3, + python3:any, rocksdb-tools, ${misc:Depends}, ${shlibs:Depends} @@ -810,12 +826,16 @@ Breaks: mariadb-oqgraph-engine-10.0, mariadb-oqgraph-engine-10.1, mariadb-oqgraph-engine-10.2, mariadb-oqgraph-engine-10.3, - mariadb-oqgraph-engine-10.4 + mariadb-oqgraph-engine-10.4, + mariadb-server-10.0, + mariadb-server-10.1 Replaces: mariadb-oqgraph-engine-10.0, mariadb-oqgraph-engine-10.1, mariadb-oqgraph-engine-10.2, mariadb-oqgraph-engine-10.3, - mariadb-oqgraph-engine-10.4 + mariadb-oqgraph-engine-10.4, + mariadb-server-10.0, + mariadb-server-10.1 Description: OQGraph storage engine for MariaDB The OQGraph engine is a computation engine plugin for handling hierarchies (trees) and graphs (friend-of-a-friend, etc) cleanly through standard SQL. @@ -871,11 +891,15 @@ Depends: libgssapi-krb5-2, Breaks: mariadb-gssapi-server-10.1, mariadb-gssapi-server-10.2, mariadb-gssapi-server-10.3, - mariadb-gssapi-server-10.4 + mariadb-gssapi-server-10.4, + mariadb-server-10.0, + mariadb-server-10.1 Replaces: mariadb-gssapi-server-10.1, mariadb-gssapi-server-10.2, mariadb-gssapi-server-10.3, - mariadb-gssapi-server-10.4 + mariadb-gssapi-server-10.4, + mariadb-server-10.0, + mariadb-server-10.1 Description: GSSAPI authentication plugin for MariaDB server This plugin includes support for Kerberos on Unix, but can also be used for Windows authentication with or without domain environment. @@ -954,6 +978,8 @@ Replaces: mariadb-test-10.0, mariadb-test-5.5, mysql-client-5.5, mysql-server-5.5, + mysql-server-5.7, + mysql-server-core-8.0, mysql-testsuite, mysql-testsuite-5.5, mysql-testsuite-5.6, diff --git a/debian/libmariadb-dev.install b/debian/libmariadb-dev.install index a0737fee00c..08be370ca6d 100644 --- a/debian/libmariadb-dev.install +++ b/debian/libmariadb-dev.install @@ -11,10 +11,10 @@ usr/include/mariadb/mariadb_dyncol.h usr/include/mariadb/mariadb_rpl.h usr/include/mariadb/mariadb_stmt.h usr/include/mariadb/mariadb_version.h +usr/include/mariadb/my_alloca.h usr/include/mariadb/my_config.h usr/include/mariadb/my_global.h usr/include/mariadb/my_sys.h -usr/include/mariadb/my_alloca.h usr/include/mariadb/mysql.h usr/include/mariadb/mysql/ usr/include/mariadb/mysql/client_plugin.h diff --git a/debian/libmariadb-dev.lintian-overrides b/debian/libmariadb-dev.lintian-overrides index 345b537a521..6a162120f24 100644 --- a/debian/libmariadb-dev.lintian-overrides +++ b/debian/libmariadb-dev.lintian-overrides @@ -1 +1,2 @@ +# This is how upstream does it, wont' fix arch-dependent-file-not-in-arch-specific-directory usr/bin/mariadb_config diff --git a/debian/mariadb-server-10.6.preinst b/debian/mariadb-server-10.6.preinst index 79c6ccc8500..b79f20a9803 100644 --- a/debian/mariadb-server-10.6.preinst +++ b/debian/mariadb-server-10.6.preinst @@ -119,6 +119,18 @@ then fi +# If there is no debian-*.flag, and no version was detected, but a file that +# indicated MySQL 8.0 is found (undo_001 is created by default in MySQL 8.0+ +# installs), then that file is enough of additional indication to trigger the +# move of the data directory. +if [ -z "$found_version" ] && + [ -z "$(find $mysql_datadir/debian-*.flag 2> /dev/null)" ] && + [ -f "$mysql_datadir/undo_001" ] +then + echo "$mysql_datadir: no server version flag found, assuming MySQL 8.0 data encountered" + downgrade_detected=true + found_version="previous" # Just use dummy name as we don't know real version +fi # Don't abort dpkg if downgrade is detected (as was done previously). # Instead simply move the old datadir and create a new for this_version. @@ -133,8 +145,8 @@ then echo "Please manually export/import your data (e.g. with mysqldump) if needed." 1>&2 mv -f "$mysql_datadir" "$mysql_datadir-$found_version" # Also move away the old debian.cnf file that included credentials that are - # no longer valid - mv -f /etc/mysql/debian.cnf "/etc/mysql/debian.cnf-$found_version" + # no longer valid. If none existed, ignore error and let dpkg continue. + mv -f /etc/mysql/debian.cnf "/etc/mysql/debian.cnf-$found_version" || true fi # to be sure diff --git a/debian/mariadb-server-core-10.6.install b/debian/mariadb-server-core-10.6.install index def95268512..6d159ba4c6a 100644 --- a/debian/mariadb-server-core-10.6.install +++ b/debian/mariadb-server-core-10.6.install @@ -12,8 +12,8 @@ usr/share/man/man1/resolveip.1 usr/share/man/man8/mariadbd.8 usr/share/man/man8/mysqld.8 usr/share/mysql/bulgarian -usr/share/mysql/chinese usr/share/mysql/charsets +usr/share/mysql/chinese usr/share/mysql/czech usr/share/mysql/danish usr/share/mysql/dutch diff --git a/debian/mariadb-test.install b/debian/mariadb-test.install index 36b49bdab97..e587a3bf73d 100644 --- a/debian/mariadb-test.install +++ b/debian/mariadb-test.install @@ -37,8 +37,8 @@ usr/share/mysql/mysql-test/README.stress usr/share/mysql/mysql-test/dgcov.pl usr/share/mysql/mysql-test/lib usr/share/mysql/mysql-test/mariadb-stress-test.pl -usr/share/mysql/mysql-test/mysql-test-run.pl usr/share/mysql/mysql-test/mariadb-test-run.pl +usr/share/mysql/mysql-test/mysql-test-run.pl usr/share/mysql/mysql-test/purify.supp usr/share/mysql/mysql-test/suite.pm usr/share/mysql/mysql-test/valgrind.supp diff --git a/debian/mariadb-test.links b/debian/mariadb-test.links index 3c45bb955c4..c7e4ae10063 100644 --- a/debian/mariadb-test.links +++ b/debian/mariadb-test.links @@ -2,7 +2,7 @@ usr/bin/mariadb-client-test usr/bin/mysql_client_test usr/bin/mariadb-client-test-embedded usr/bin/mysql_client_test_embedded usr/bin/mariadb-test usr/bin/mysqltest usr/bin/mariadb-test-embedded usr/bin/mysqltest_embedded -usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mysql-test-run.pl -usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mysql-test-run -usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mtr usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mariadb-test-run +usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mtr +usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mysql-test-run +usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mysql-test-run.pl diff --git a/debian/rules b/debian/rules index 7dcc9a2ba3c..062ff03e822 100755 --- a/debian/rules +++ b/debian/rules @@ -1,10 +1,7 @@ #!/usr/bin/make -f -export DH_VERBOSE=1 -export DEB_BUILD_HARDENING=1 - -# enable Debian Hardening -# see: https://wiki.debian.org/Hardening +# Enable Debian Hardening +# https://wiki.debian.org/Hardening export DEB_BUILD_MAINT_OPTIONS = hardening=+all # Disable LTO on Ubuntu, see LP: #1970634 and https://jira.mariadb.org/browse/MDEV-25633 @@ -64,8 +61,8 @@ endif # Only attempt to build with PMEM on archs that have package libpmem-dev available # See https://packages.debian.org/search?searchon=names&keywords=libpmem-dev -ifneq (,$(filter $(DEB_HOST_ARCH_CPU),amd64 arm64 ppc64el riscv64)) - CMAKEFLAGS += -DWITH_PMEM=YES +ifneq (,$(filter $(DEB_HOST_ARCH),amd64 arm64 ppc64el riscv64)) + CMAKEFLAGS += -DWITH_PMEM=ON endif # Add support for verbose builds @@ -93,6 +90,9 @@ endif # quality standards in Debian. Also building it requires an extra 4 GB of disk # space which makes native Debian builds fail as the total disk space needed # for MariaDB becomes over 10 GB. Only build CS via autobake-deb.sh. + # + # Note: Don't use '-DWITH_URING=ON' as some Buildbot builders are missing it + # and would fail permanently. PATH=$${MYSQL_BUILD_PATH:-"/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin"} \ NO_UPDATE_BUILD_VERSION=1 \ dh_auto_configure --builddirectory=$(BUILDDIR) -- \ @@ -107,8 +107,7 @@ endif -DCONC_DEFAULT_CHARSET=utf8mb4 \ -DPLUGIN_AWS_KEY_MANAGEMENT=NO \ -DPLUGIN_COLUMNSTORE=NO \ - -DIGNORE_AIO_CHECK=YES \ - -DWITH_URING=YES \ + -DIGNORE_AIO_CHECK=ON \ -DDEB=$(DEB_VENDOR) # This is needed, otherwise 'make test' will run before binaries have been built @@ -123,6 +122,7 @@ override_dh_auto_test: dh_testdir # Ensure at least an empty file exists touch mysql-test/unstable-tests + # Skip unstable tests if such are defined for arch [ ! -f debian/unstable-tests.$(DEB_HOST_ARCH) ] || cat debian/unstable-tests.$(DEB_HOST_ARCH) >> mysql-test/unstable-tests # Run testsuite ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml index 436756a5e6c..d8a6b939250 100644 --- a/debian/salsa-ci.yml +++ b/debian/salsa-ci.yml @@ -26,7 +26,7 @@ stages: - build - test - upgrade in Sid - - upgrade from Bullseye + - upgrade from Buster/Bullseye - upgrade extras - test extras - publish # Stage referenced by Salsa-CI template aptly stanza, so must exist even though not used @@ -115,13 +115,20 @@ blhc: # Avoid the warnings of "debconf: unable to initialize frontend: Dialog" echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections # Prime the apt cache so later apt commands can run - apt-get update + apt-get update -qq # Readline was removed from Debian Sid (and Bullseye) in Feb 2021. To be able to install older # versions of MariaDB that depend on it, fetch and install it from Buster. .test-install-readline-in-sid-for-backwards-compat: &test-install-readline-in-sid-for-backwards-compat | - curl -O http://ftp.de.debian.org/debian/pool/main/r/readline5/libreadline5_5.2+dfsg-3+b13_amd64.deb - apt install -y ./libreadline5_5.2+dfsg-3+b13_amd64.deb + curl -sS -O http://ftp.de.debian.org/debian/pool/main/r/readline5/libreadline5_5.2+dfsg-3+b13_amd64.deb + apt-get -qq install --no-install-recommends --yes ./libreadline5_5.2+dfsg-3+b13_amd64.deb + +# OpenSSL 1.1 was Debian Sid in Dec 2022 (as Bookworm will ship with OpenSSL 3.0 +# only). To be able to install versions of MariaDB that depend on OpenSSL 1.1, +# fetch and install it manually. +.test-install-openssl1-in-sid-for-backwards-compat: &test-install-openssl1-in-sid-for-backwards-compat | + curl -sS -O https://snapshot.debian.org/archive/debian/20220507T034236Z/pool/main/o/openssl/libssl1.1_1.1.1o-1_amd64.deb + apt-get -qq install --no-install-recommends --yes ./libssl1.1_1.1.1o-1_amd64.deb .test-verify-initial: &test-verify-initial | dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed @@ -132,12 +139,37 @@ blhc: mysql --table -e "SELECT * FROM plugin;" mysql mysql --table -e "SHOW PLUGINS;" mysql -.test-enable-sid-repos: &test-enable-sid-repos | +.test-enable-sid-repos: &test-enable-sid-repos # Replace any old repos with just Sid - echo 'deb http://deb.debian.org/debian sid main' > /etc/apt/sources.list + - echo 'deb http://deb.debian.org/debian sid main' > /etc/apt/sources.list # Upgrade minimal stack first - apt-get update - apt-get install -y apt + - apt-get update -qq + # Next step will fail on https://bugs.debian.org/993755 + # /usr/bin/perl: error while loading shared libraries: libcrypt.so.1: cannot + # open shared object file: No such file or directory + # dpkg: error processing package libc6:amd64 (--configure): + - apt-get install -y apt || true + # Apply workaround + - cd $(mktemp -d) # Use temp dir where apt can download and unpack files + - apt-get -y download libcrypt1 + - dpkg-deb -x libcrypt1_*.deb . + - cp -ra lib/* /lib/ + - cd - # Back to /builds/$USER/mariadb-server/debian/output + - find /lib/*/libcrypt.* -ls # Show that new libcrypt is there + - apt-get -y --fix-broken install + # Complete upgrade of minimal stack + - apt-get install -y apt + +.test-enable-bullseye-backports-repos: &test-enable-bullseye-backports-repos | + # Enable bullseye-backports (assumes environment already Debian Bullseye) + echo 'deb http://deb.debian.org/debian bullseye-backports main' > /etc/apt/sources.list.d/bullseye-backports.list + # Increase default backports priority policy from '100' to '500' so it can actually be used + cat << EOF > /etc/apt/preferences.d/enable-backports-to-satisfy-dependencies + Package: * + Pin: release n=bullseye-* + Pin-Priority: 500 + EOF + apt-get update -qq .test-enable-buster-backports-repos: &test-enable-buster-backports-repos | # Enable buster-backports (assumes environment already Debian Buster) @@ -148,7 +180,7 @@ blhc: Pin: release n=buster-* Pin-Priority: 500 EOF - apt-get update + apt-get update -qq .test-install: &test-install | # Install MariaDB built in this commit @@ -249,6 +281,7 @@ mariadb-10.6 Sid upgrade: - ${WORKING_DIR}/debug script: - *test-prepare-container + - apt-get install -y 'default-mysql*' 'mariadb-*' 'libmariadb*' - *test-install - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ - *test-verify-final @@ -258,10 +291,10 @@ mariadb-10.6 Sid upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -mariadb-10.5 Bullseye to mariadb-10.6 upgrade: - stage: upgrade from Bullseye +mariadb-10.5 with Bullseye backports upgrade: + stage: upgrade extras needs: - - job: build + - job: build bullseye-backports image: debian:bullseye artifacts: when: always @@ -270,13 +303,13 @@ mariadb-10.5 Bullseye to mariadb-10.6 upgrade: - ${WORKING_DIR}/debug script: - *test-prepare-container - # Install everything MariaDB currently in Debian Bullseye + # Install everything MariaDB currently in Debian Buster - apt-get install -y 'default-mysql*' 'mariadb-*' 'libmariadb*' - # Verify installation of MariaDB from Bullseye + # Verify installation of MariaDB from Buster - *test-verify-initial - - *test-enable-sid-repos + - *test-enable-bullseye-backports-repos - *test-install - - service mariadb status + - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ - *test-verify-final variables: GIT_STRATEGY: none @@ -284,9 +317,7 @@ mariadb-10.5 Bullseye to mariadb-10.6 upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -# Upgrade of libcrypt.so.1 no longer possible from Buster to Sid, -# so test upgrade only inside Buster (https://bugs.debian.org/993755) -mariadb-10.3 to mariadb-10.6 upgrade in Buster: +mariadb-10.3 with Buster backports upgrade: stage: upgrade extras needs: - job: build buster-backports @@ -304,7 +335,63 @@ mariadb-10.3 to mariadb-10.6 upgrade in Buster: - *test-verify-initial - *test-enable-buster-backports-repos - *test-install + # mariadb-10.3 in Buster ships a /etc/init.d/mysql so it should continue to work - service mysql status + - service mariadb status + - *test-verify-final + variables: + GIT_STRATEGY: none + except: + variables: + - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ + +mariadb-10.5 Bullseye to mariadb-10.6 upgrade: + stage: upgrade from Buster/Bullseye + needs: + - job: build + image: debian:bullseye + artifacts: + when: always + name: "$CI_BUILD_NAME" + paths: + - ${WORKING_DIR}/debug + script: + - *test-prepare-container + # Install everything MariaDB currently in Debian Bullseye + - apt-get install -y 'default-mysql*' 'mariadb-*' 'libmariadb*' + # Verify installation of MariaDB from Bullseye + - *test-verify-initial + - *test-enable-sid-repos + - *test-install + - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ + - *test-verify-final + variables: + GIT_STRATEGY: none + except: + variables: + - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ + +mariadb-10.3 Buster to mariadb-10.6 upgrade: + stage: upgrade from Buster/Bullseye + needs: + - job: build + image: debian:buster + artifacts: + when: always + name: "$CI_BUILD_NAME" + paths: + - ${WORKING_DIR}/debug + script: + - *test-prepare-container + # Install everything MariaDB currently in Debian Buster + - apt-get install -y 'default-mysql*' 'mariadb-*' 'libmariadb*' + # Verify installation of MariaDB from Buster + - *test-verify-initial + - *test-enable-sid-repos + - *test-install + # mariadb-10.3 in Buster ships a /etc/init.d/mysql so it should continue to work + - service mysql status + - service mariadb status - *test-verify-final variables: GIT_STRATEGY: none @@ -470,7 +557,7 @@ default-libmysqlclient-dev Sid upgrade: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ default-libmysqlclient-dev Bullseye upgrade: - stage: upgrade from Bullseye + stage: upgrade from Buster/Bullseye needs: - job: build image: debian:bullseye @@ -490,9 +577,49 @@ default-libmysqlclient-dev Bullseye upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -# Upgrade of libcrypt.so.1 no longer possible from Buster to Sid, -# so test upgrade only inside Buster (https://bugs.debian.org/993755) -default-libmysqlclient-dev upgrade in Buster: +default-libmysqlclient-dev Buster upgrade: + stage: upgrade from Buster/Bullseye + needs: + - job: build + image: debian:buster + artifacts: + when: always + name: "$CI_BUILD_NAME" + paths: + - ${WORKING_DIR}/debug + script: + - *test-prepare-container + - apt-get install -y pkg-config default-libmysqlclient-dev + - pkg-config --list-all + - *test-enable-sid-repos + - *test-install-all-libs + - *test-verify-libs + except: + variables: + - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ + +default-libmysqlclient-dev with Bullseye backports upgrade: + stage: upgrade extras + needs: + - job: build bullseye-backports + image: debian:bullseye + artifacts: + when: always + name: "$CI_BUILD_NAME" + paths: + - ${WORKING_DIR}/debug + script: + - *test-prepare-container + - apt-get install -y pkg-config default-libmysqlclient-dev + - pkg-config --list-all + - *test-enable-bullseye-backports-repos + - *test-install-all-libs + - *test-verify-libs + except: + variables: + - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ + +default-libmysqlclient-dev with Buster backports upgrade: stage: upgrade extras needs: - job: build buster-backports @@ -531,18 +658,14 @@ mysql-8.0 Sid to mariadb-10.6 upgrade: - apt-get install -y procps mysql-server 'libmysqlc*' - *test-verify-initial - *test-install - # The Debian version of MariaDB 10.6 still maintains compatibility and there - # running 'service mysql status' in Salsa-CI job 'mysql-8.0 Sid to - # mariadb-10.6 upgrade' still works. - # - # However, due to debian/control changes, the upstream MariaDB 10.6 when - # installed on a system with a previous installation of MySQL 8.0 will first - # fully remove MySQL, including the /etc/init.d/mysql file, so previous - # techniques in mariadb-server-10.6.postinst to maintain backwards - # compatibility with 'service mysql status' after installing MariaDB on top - # MySQL no longer works, and thus the step to test it now intentionally has - # a fallback to use the service name 'mariadb' instead, and the fallback is - # always used. + # Due to some (currently unknown) changes in MySQL 8.0 packaging or apt + # behaviour changes, a system with a previous installation of MySQL 8.0 will + # on upgrades to MariaDB first fully remove MySQL, including the + # /etc/init.d/mysql file, so previous techniques in + # mariadb-server-10.6.postinst to maintain backwards compatibility with + # 'service mysql status' after installing MariaDB on top MySQL no longer + # works. Thus the step to test it now intentionally has a fallback to use + # the service name 'mariadb' instead, and the fallback is always used. - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server - service mysql status || service mariadb status - *test-verify-final @@ -554,11 +677,14 @@ mysql-8.0 Sid to mariadb-10.6 upgrade: # Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump. # The Debian maintainer scripts detect this situation and simply moves old datadir aside and start fresh. -mysql-8.0 Focal to mariadb-10.6 upgrade in Buster: +# +# Testing on Focal binaries on Buster works. Using Jammy binaries on Bullseye +# does not work as libc in Jammy is too new. +mysql-8.0 from Ubuntu 22.04 with Bullseye backports upgrade: stage: upgrade extras needs: - - job: build buster-backports - image: debian:buster + - job: build bullseye-backports + image: debian:bullseye artifacts: when: always name: "$CI_BUILD_NAME" @@ -570,13 +696,13 @@ mysql-8.0 Focal to mariadb-10.6 upgrade in Buster: - apt-get install --no-install-recommends --yes gpg gpg-agent dirmngr ca-certificates # Bare minimal (<4MB) for apt-key to work - apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com:443 871920D1991BC93C 3B4FE6ACC0B21F32 - echo "deb http://archive.ubuntu.com/ubuntu/ focal main restricted" > /etc/apt/sources.list.d/ubuntu.list - - apt-get update + - apt-get update -qq # First install often fail due to bug in mysql-8.0 - apt-get install -y mysql-server 'libmysqlc*' || true - sleep 10 && apt-get install -f - *test-verify-initial # Enable backports to make galera-4 available - - echo "deb http://deb.debian.org/debian buster-backports main" > /etc/apt/sources.list.d/backports.list && apt-get update + - echo "deb http://deb.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/backports.list && apt-get update -qq - *test-install - service mysql status - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server @@ -587,6 +713,45 @@ mysql-8.0 Focal to mariadb-10.6 upgrade in Buster: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ +# Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump. +# The Debian maintainer scripts detect this situation and simply moves old datadir aside and start fresh. +mysql-community-cluster-8.0 from MySQL.com with Bullseye backports upgrade: + stage: upgrade extras + needs: + - job: build bullseye-backports + image: debian:bullseye + artifacts: + when: always + name: "$CI_BUILD_NAME" + paths: + - ${WORKING_DIR}/debug + script: + - *test-prepare-container + - apt-get install --no-install-recommends --yes ca-certificates curl systemctl + - curl -sS "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x859be8d7c586f538430b19c2467b942d3a79bd29" -o /etc/apt/trusted.gpg.d/mysql.asc + - echo "deb https://repo.mysql.com/apt/debian/ bullseye mysql-cluster-8.0" > /etc/apt/sources.list.d/mysql.list + - apt-get update -qq + - apt-get install -y mysql-cluster-community-server + - sed 's/ExecStartPre=+/ExecStartPre=/' -i /lib/systemd/system/mysql.service # Hack to make file compatible with systemctl shim + - systemctl start mysql + - dpkg -l | grep -iE 'maria|mysql|galera' + - systemctl status mysql; mysql -e 'SELECT VERSION()' + - systemctl stop mysql # Stop manually as maintainer scripts don't handle this with systemctl shim + # Enable backports to make galera-4 available + - echo "deb http://deb.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/backports.list && apt-get update -qq + - *test-install + # Ignore systemctl shim result as MariaDB systemd file is incompatible with it and yields: + # ERROR:systemctl:the ExecStartPre control process exited with error code + - systemctl status mysql || true + - mysql -e 'SELECT VERSION()' || true + - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server + - *test-verify-final + variables: + GIT_STRATEGY: none + except: + variables: + - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ + mariadb.org-10.6 to mariadb-10.6 upgrade: stage: upgrade extras needs: @@ -599,10 +764,10 @@ mariadb.org-10.6 to mariadb-10.6 upgrade: - ${WORKING_DIR}/debug script: - *test-prepare-container - - apt install -y curl + - apt-get -qq install --no-install-recommends --yes ca-certificates curl - curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc - echo "deb https://deb.mariadb.org/10.6/debian ${RELEASE} main" > /etc/apt/sources.list.d/mariadb.list - - apt-get update + - apt-get update -qq # Package libmariadbclient-dev from mariadb.org conflicts with libmariadb-dev in Sid, so cannot use wildcard that would include it # Enable this line when there is a way to install them only from the mariadb.org repo # - apt-get install -y 'mariadb*' libmariadb3 'libmariadb-*' 'libmariadbd*' @@ -622,6 +787,7 @@ mariadb.org-10.6 to mariadb-10.6 upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ +# archive.mariadb.org for Debian Sid latest is 10.5.13 mariadb.org-10.5 to mariadb-10.6 upgrade: stage: upgrade extras needs: @@ -634,10 +800,11 @@ mariadb.org-10.5 to mariadb-10.6 upgrade: - ${WORKING_DIR}/debug script: - *test-prepare-container - - apt install -y curl + - apt-get -qq install --no-install-recommends --yes ca-certificates curl - curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc - echo "deb https://archive.mariadb.org/mariadb-10.5/repo/debian ${RELEASE} main" > /etc/apt/sources.list.d/mariadb.list - - apt-get update + - apt-get update -qq + - *test-install-openssl1-in-sid-for-backwards-compat - apt-get install -y mariadb-server-10.5 - *test-verify-initial # Install MariaDB built in this commit @@ -652,6 +819,7 @@ mariadb.org-10.5 to mariadb-10.6 upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ +# archive.mariadb.org for Debian Sid latest is 10.4.17 mariadb.org-10.4 to mariadb-10.6 upgrade: stage: upgrade extras needs: @@ -664,11 +832,12 @@ mariadb.org-10.4 to mariadb-10.6 upgrade: - ${WORKING_DIR}/debug script: - *test-prepare-container - - apt install -y curl systemctl # systemctl shim needed on platforms that don't have systemd + - apt-get -qq install --no-install-recommends --yes ca-certificates curl systemctl # systemctl shim needed on platforms that don't have systemd - curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc - echo "deb https://archive.mariadb.org/mariadb-10.4/repo/debian ${RELEASE} main" > /etc/apt/sources.list.d/mariadb.list - - apt-get update + - apt-get update -qq - *test-install-readline-in-sid-for-backwards-compat + - *test-install-openssl1-in-sid-for-backwards-compat - apt-get install -y mariadb-server-10.4 # MariaDB.org version of 10.4 and early 10.5 do not install an init file, so # it must be installed here manually @@ -685,6 +854,7 @@ mariadb.org-10.4 to mariadb-10.6 upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ +# archive.mariadb.org for Debian Sid latest is 10.3.27 mariadb.org-10.3 to mariadb-10.6 upgrade: stage: upgrade extras needs: @@ -697,11 +867,12 @@ mariadb.org-10.3 to mariadb-10.6 upgrade: - ${WORKING_DIR}/debug script: - *test-prepare-container - - apt install -y curl + - apt-get -qq install --no-install-recommends --yes ca-certificates curl - curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc - echo "deb https://archive.mariadb.org/mariadb-10.3/repo/debian ${RELEASE} main" > /etc/apt/sources.list.d/mariadb.list - - apt-get update + - apt-get update -qq - *test-install-readline-in-sid-for-backwards-compat + - *test-install-openssl1-in-sid-for-backwards-compat - apt-get install -y mariadb-server-10.3 - *test-verify-initial - *test-install @@ -716,6 +887,7 @@ mariadb.org-10.3 to mariadb-10.6 upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ +# archive.mariadb.org for Debian Sid latest is 10.2.21 mariadb.org-10.2 to mariadb-10.6 upgrade: stage: upgrade extras needs: @@ -728,11 +900,12 @@ mariadb.org-10.2 to mariadb-10.6 upgrade: - ${WORKING_DIR}/debug script: - *test-prepare-container - - apt install -y curl + - apt-get -qq install --no-install-recommends --yes ca-certificates curl - curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc - echo "deb https://archive.mariadb.org/mariadb-10.2/repo/debian ${RELEASE} main" > /etc/apt/sources.list.d/mariadb.list - - apt-get update + - apt-get update -qq - *test-install-readline-in-sid-for-backwards-compat + - *test-install-openssl1-in-sid-for-backwards-compat - apt-get install -y mariadb-server-10.2 # Verify initial state before upgrade - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed @@ -755,11 +928,11 @@ mariadb.org-10.2 to mariadb-10.6 upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -mysql.com-5.7 to mariadb-10.6 upgrade in Buster: +mysql.com-5.7 with Bullseye backports upgrade: stage: upgrade extras needs: - - job: build buster-backports - image: debian:buster + - job: build bullseye-backports + image: debian:bullseye artifacts: when: always name: "$CI_BUILD_NAME" @@ -770,14 +943,23 @@ mysql.com-5.7 to mariadb-10.6 upgrade in Buster: - | apt-get install --no-install-recommends --yes gpg gpg-agent dirmngr ca-certificates # Bare minimal (<4MB) for apt-key to work apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com:443 467B942D3A79BD29 - echo "deb https://repo.mysql.com/apt/debian/ buster mysql-5.7" > /etc/apt/sources.list.d/mysql.list - apt-get update + echo "deb https://repo.mysql.com/apt/debian/ bullseye mysql-5.7" > /etc/apt/sources.list.d/mysql.list + apt-get update -qq apt-get install -y 'mysql*' 'libmysqlc*' - *test-verify-initial # Enable backports to make galera-4 available - - echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list.d/backports.list && apt-get update + - echo "deb http://deb.debian.org/debian bullseye-backports main" >> /etc/apt/sources.list.d/backports.list && apt-get update -qq - *test-install - - service mysql status + # Due to some (currently unknown) changes in MySQL 5.7 packaging or apt + # behaviour changes, a system with a previous installation of MySQL will + # on upgrades to MariaDB first fully remove MySQL, including the + # /etc/init.d/mysql file, so previous techniques in + # mariadb-server-10.6.postinst to maintain backwards compatibility with + # 'service mysql status' after installing MariaDB on top MySQL no longer + # works. Thus the step to test it now intentionally has a fallback to use + # the service name 'mariadb' instead, and the fallback is always used. + - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server + - service mysql status || service mariadb status - sleep 15 # Give the mysql_upgrade a bit of extra time to complete with MySQL 5.7 before querying the server - *test-verify-final variables: @@ -786,11 +968,11 @@ mysql.com-5.7 to mariadb-10.6 upgrade in Buster: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -percona-xtradb-5.7 to mariadb-10.6 upgrade in Buster (MDEV-22679): +percona-xtradb-5.7 with bullseye backports upgrade: stage: upgrade extras needs: - - job: build buster-backports - image: debian:buster + - job: build bullseye-backports + image: debian:bullseye artifacts: when: always name: "$CI_BUILD_NAME" @@ -801,13 +983,13 @@ percona-xtradb-5.7 to mariadb-10.6 upgrade in Buster (MDEV-22679): - | apt-get install --no-install-recommends --yes gpg gpg-agent dirmngr ca-certificates # Bare minimal (<4MB) for apt-key to work apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com:443 9334A25F8507EFA5 - echo "deb https://repo.percona.com/apt/ buster main" > /etc/apt/sources.list.d/mysql.list - apt-get update + echo "deb https://repo.percona.com/apt/ bullseye main" > /etc/apt/sources.list.d/mysql.list + apt-get update -qq apt-get install -y percona-xtradb-cluster-full-57 percona-xtrabackup-24 percona-toolkit pmm2-client - service mysql status - *test-verify-initial # Enable backports to make galera-4 available - - echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list.d/backports.list && apt-get update + - echo "deb http://deb.debian.org/debian bullseye-backports main" >> /etc/apt/sources.list.d/backports.list && apt-get update -qq - *test-install - service mysql status - sleep 15 # Give the mysql_upgrade a bit of extra time to complete with MySQL 5.7 before querying the server From ee68fe3272904e720f37542120590b7c815d99cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sat, 18 Mar 2023 20:12:13 -0700 Subject: [PATCH 088/260] Deb: Update Salsa-CI to use Bullseye instead of Sid Tests that try to upgrade MariaDB 10.6 in Debian Sid can no longer work properly on versions < 10.11 as MariaDB 10.11 in now Debian Sid. Change RELEASE to use Bullseye and refactor builds and upgrade tests to use primarily Bullseye, as it has MariaDB 10.5 and thus testing upgrades to MariaDB 10.6 and higher can work. Add on new 'build sid' job to continue at least on build on Sid as well, even though it is not tested in other jobs. Due to this many Sid specific workarounds are can also be dropped, and since Bullseye is now used for everything, the old bullseye-backports jobs are obsolete and removed. Tests that upgrade MySQL in Sid to MariaDB are also removed, as no test in Debian Sid with MariaDB < 10.11 can reliably work anymore. Also disable reprotest as unnecessary on old branches, refactor the naming of autobake-deb.sh and native Debian build jobs to be more clear. NOTE TO MERGERS: This commit is made on 10.6 branch and can be merged to all later branches (10.7, 10.8, ..., 11.0). If/when some jobs break, they will be fixed per branch on follow-up commits. --- debian/salsa-ci.yml | 354 ++++++++------------------------------------ 1 file changed, 59 insertions(+), 295 deletions(-) diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml index d8a6b939250..c7ca3613fd3 100644 --- a/debian/salsa-ci.yml +++ b/debian/salsa-ci.yml @@ -7,7 +7,7 @@ include: # Override Salsa-CI with MariaDB specific variations variables: DEB_BUILD_OPTIONS: "nocheck noautodbgsym" - RELEASE: sid + RELEASE: bullseye SALSA_CI_DISABLE_REPROTEST: 1 SALSA_CI_DISABLE_MISSING_BREAKS: 0 SALSA_CI_DISABLE_RC_BUGS: 1 @@ -25,8 +25,8 @@ stages: - provisioning - build - test - - upgrade in Sid - - upgrade from Buster/Bullseye + - upgrade in Bullseye + - upgrade from Buster - upgrade extras - test extras - publish # Stage referenced by Salsa-CI template aptly stanza, so must exist even though not used @@ -51,10 +51,17 @@ build: - ccache -s # Show ccache stats to validate it worked - mv ${CCACHE_TMP_DIR} ${CCACHE_WORK_DIR} -build bullseye-backports: +build i386: + extends: .build-package-i386 + script: + - *autobake-deb-steps + +build sid: extends: .build-package + script: + - *autobake-deb-steps variables: - RELEASE: bullseye-backports + RELEASE: sid build buster-backports: extends: .build-package @@ -70,21 +77,14 @@ build buster-backports: variables: RELEASE: buster-backports -# base image missing git -build i386: - extends: .build-package - script: - - apt-get update && apt-get install -y --no-install-recommends git - - *autobake-deb-steps - image: $SALSA_CI_IMAGES_BASE_I386 - variables: - ARCH: 'i386' - # Build native deb without using autobake-deb.sh. This way we will detect # if the debian/control file and other packaging is correct as-is for Debian Sid. -build native deb: +build native deb amd64: extends: .build-package +build native deb i386: + extends: .build-package-i386 + autopkgtest: extends: .test-autopkgtest artifacts: @@ -100,7 +100,7 @@ blhc: stage: test extras # Build log checker needs a .build file and thus only works on native build needs: - - job: build native deb + - job: build native deb amd64 # In addition to Salsa-CI, also run these fully MariaDB specific build jobs @@ -117,19 +117,6 @@ blhc: # Prime the apt cache so later apt commands can run apt-get update -qq -# Readline was removed from Debian Sid (and Bullseye) in Feb 2021. To be able to install older -# versions of MariaDB that depend on it, fetch and install it from Buster. -.test-install-readline-in-sid-for-backwards-compat: &test-install-readline-in-sid-for-backwards-compat | - curl -sS -O http://ftp.de.debian.org/debian/pool/main/r/readline5/libreadline5_5.2+dfsg-3+b13_amd64.deb - apt-get -qq install --no-install-recommends --yes ./libreadline5_5.2+dfsg-3+b13_amd64.deb - -# OpenSSL 1.1 was Debian Sid in Dec 2022 (as Bookworm will ship with OpenSSL 3.0 -# only). To be able to install versions of MariaDB that depend on OpenSSL 1.1, -# fetch and install it manually. -.test-install-openssl1-in-sid-for-backwards-compat: &test-install-openssl1-in-sid-for-backwards-compat | - curl -sS -O https://snapshot.debian.org/archive/debian/20220507T034236Z/pool/main/o/openssl/libssl1.1_1.1.1o-1_amd64.deb - apt-get -qq install --no-install-recommends --yes ./libssl1.1_1.1.1o-1_amd64.deb - .test-verify-initial: &test-verify-initial | dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed service mysql status || service mariadb status # Early MariaDB 10.5 only had 'mariadb' @@ -139,25 +126,11 @@ blhc: mysql --table -e "SELECT * FROM plugin;" mysql mysql --table -e "SHOW PLUGINS;" mysql -.test-enable-sid-repos: &test-enable-sid-repos +.test-enable-bullseye-repos: &test-enable-bullseye-repos # Replace any old repos with just Sid - - echo 'deb http://deb.debian.org/debian sid main' > /etc/apt/sources.list + - echo 'deb http://deb.debian.org/debian bullseye main' > /etc/apt/sources.list # Upgrade minimal stack first - apt-get update -qq - # Next step will fail on https://bugs.debian.org/993755 - # /usr/bin/perl: error while loading shared libraries: libcrypt.so.1: cannot - # open shared object file: No such file or directory - # dpkg: error processing package libc6:amd64 (--configure): - - apt-get install -y apt || true - # Apply workaround - - cd $(mktemp -d) # Use temp dir where apt can download and unpack files - - apt-get -y download libcrypt1 - - dpkg-deb -x libcrypt1_*.deb . - - cp -ra lib/* /lib/ - - cd - # Back to /builds/$USER/mariadb-server/debian/output - - find /lib/*/libcrypt.* -ls # Show that new libcrypt is there - - apt-get -y --fix-broken install - # Complete upgrade of minimal stack - apt-get install -y apt .test-enable-bullseye-backports-repos: &test-enable-bullseye-backports-repos | @@ -269,8 +242,8 @@ fresh install: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -mariadb-10.6 Sid upgrade: - stage: upgrade in Sid +mariadb-10.5 Bullseye upgrade: + stage: upgrade in Bullseye needs: - job: build image: debian:${RELEASE} @@ -281,33 +254,9 @@ mariadb-10.6 Sid upgrade: - ${WORKING_DIR}/debug script: - *test-prepare-container + # Install everything MariaDB 10.5 currently in Debian Bullseye - apt-get install -y 'default-mysql*' 'mariadb-*' 'libmariadb*' - - *test-install - - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ - - *test-verify-final - variables: - GIT_STRATEGY: none - except: - variables: - - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ - -mariadb-10.5 with Bullseye backports upgrade: - stage: upgrade extras - needs: - - job: build bullseye-backports - image: debian:bullseye - artifacts: - when: always - name: "$CI_BUILD_NAME" - paths: - - ${WORKING_DIR}/debug - script: - - *test-prepare-container - # Install everything MariaDB currently in Debian Buster - - apt-get install -y 'default-mysql*' 'mariadb-*' 'libmariadb*' - # Verify installation of MariaDB from Buster - *test-verify-initial - - *test-enable-bullseye-backports-repos - *test-install - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ - *test-verify-final @@ -329,10 +278,11 @@ mariadb-10.3 with Buster backports upgrade: - ${WORKING_DIR}/debug script: - *test-prepare-container - # Install everything MariaDB currently in Debian Buster + # Install everything MariaDB 10.3 currently in Debian Buster - apt-get install -y 'default-mysql*' 'mariadb-*' 'libmariadb*' # Verify installation of MariaDB from Buster - *test-verify-initial + # Buster backports is needed for liburing1 (>= 0.7) and galera-4 (>= 26.4) - *test-enable-buster-backports-repos - *test-install # mariadb-10.3 in Buster ships a /etc/init.d/mysql so it should continue to work @@ -345,34 +295,8 @@ mariadb-10.3 with Buster backports upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -mariadb-10.5 Bullseye to mariadb-10.6 upgrade: - stage: upgrade from Buster/Bullseye - needs: - - job: build - image: debian:bullseye - artifacts: - when: always - name: "$CI_BUILD_NAME" - paths: - - ${WORKING_DIR}/debug - script: - - *test-prepare-container - # Install everything MariaDB currently in Debian Bullseye - - apt-get install -y 'default-mysql*' 'mariadb-*' 'libmariadb*' - # Verify installation of MariaDB from Bullseye - - *test-verify-initial - - *test-enable-sid-repos - - *test-install - - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ - - *test-verify-final - variables: - GIT_STRATEGY: none - except: - variables: - - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ - -mariadb-10.3 Buster to mariadb-10.6 upgrade: - stage: upgrade from Buster/Bullseye +mariadb-10.3 Buster upgrade: + stage: upgrade from Buster needs: - job: build image: debian:buster @@ -383,11 +307,11 @@ mariadb-10.3 Buster to mariadb-10.6 upgrade: - ${WORKING_DIR}/debug script: - *test-prepare-container - # Install everything MariaDB currently in Debian Buster + # Install everything MariaDB 10.3 currently in Debian Buster - apt-get install -y 'default-mysql*' 'mariadb-*' 'libmariadb*' # Verify installation of MariaDB from Buster - *test-verify-initial - - *test-enable-sid-repos + - *test-enable-bullseye-repos - *test-install # mariadb-10.3 in Buster ships a /etc/init.d/mysql so it should continue to work - service mysql status @@ -503,41 +427,8 @@ build mariadbclient consumer Python-MySQLdb: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -libmysql* to libmariadb* upgrade: - stage: upgrade in Sid - needs: - - job: build - image: debian:${RELEASE} - artifacts: - when: always - name: "$CI_BUILD_NAME" - paths: - - ${WORKING_DIR}/debug - script: - - *test-prepare-container - # Install all libmysql* available in Debian unstable - - apt-get install -y pkg-config libmysqlclient-dev - - pkg-config --list-all - - pkg-config --cflags mysqlclient # mysqlclient.pc from original package - - apt-get install -y ./libmariadb3_*.deb ./mariadb-common_*.deb - - pkg-config --list-all - - apt-get install -y ./libmariadb-dev_*.deb - - pkg-config --list-all - - apt-get install -y ./libmariadb-dev-compat_*.deb - - pkg-config --cflags mysqlclient # mysqlclient.pc from compat package - - pkg-config --list-all - - apt-get install -y ./libmariadbd19_*.deb - - pkg-config --list-all - - apt-get install -y ./libmariadbd-dev_*.deb - - pkg-config --list-all - - apt-get install -y default-libmysqlclient-dev default-libmysqld-dev - - *test-verify-libs - except: - variables: - - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ - -default-libmysqlclient-dev Sid upgrade: - stage: upgrade in Sid +default-libmysqlclient-dev Bullseye upgrade: + stage: upgrade in Bullseye needs: - job: build image: debian:${RELEASE} @@ -556,29 +447,8 @@ default-libmysqlclient-dev Sid upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -default-libmysqlclient-dev Bullseye upgrade: - stage: upgrade from Buster/Bullseye - needs: - - job: build - image: debian:bullseye - artifacts: - when: always - name: "$CI_BUILD_NAME" - paths: - - ${WORKING_DIR}/debug - script: - - *test-prepare-container - - apt-get install -y pkg-config default-libmysqlclient-dev - - pkg-config --list-all - - *test-enable-sid-repos - - *test-install-all-libs - - *test-verify-libs - except: - variables: - - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ - default-libmysqlclient-dev Buster upgrade: - stage: upgrade from Buster/Bullseye + stage: upgrade from Buster needs: - job: build image: debian:buster @@ -591,28 +461,7 @@ default-libmysqlclient-dev Buster upgrade: - *test-prepare-container - apt-get install -y pkg-config default-libmysqlclient-dev - pkg-config --list-all - - *test-enable-sid-repos - - *test-install-all-libs - - *test-verify-libs - except: - variables: - - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ - -default-libmysqlclient-dev with Bullseye backports upgrade: - stage: upgrade extras - needs: - - job: build bullseye-backports - image: debian:bullseye - artifacts: - when: always - name: "$CI_BUILD_NAME" - paths: - - ${WORKING_DIR}/debug - script: - - *test-prepare-container - - apt-get install -y pkg-config default-libmysqlclient-dev - - pkg-config --list-all - - *test-enable-bullseye-backports-repos + - *test-enable-bullseye-repos - *test-install-all-libs - *test-verify-libs except: @@ -640,51 +489,16 @@ default-libmysqlclient-dev with Buster backports upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -# Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump. -# The Debian maintainer scripts detect this situation and simply moves old datadir aside and start fresh. -mysql-8.0 Sid to mariadb-10.6 upgrade: - stage: upgrade in Sid - needs: - - job: build - image: debian:sid - artifacts: - when: always - name: "$CI_BUILD_NAME" - paths: - - ${WORKING_DIR}/debug - script: - - *test-prepare-container - # The postinst fails often if 'ps' is missing from system, so install procps - - apt-get install -y procps mysql-server 'libmysqlc*' - - *test-verify-initial - - *test-install - # Due to some (currently unknown) changes in MySQL 8.0 packaging or apt - # behaviour changes, a system with a previous installation of MySQL 8.0 will - # on upgrades to MariaDB first fully remove MySQL, including the - # /etc/init.d/mysql file, so previous techniques in - # mariadb-server-10.6.postinst to maintain backwards compatibility with - # 'service mysql status' after installing MariaDB on top MySQL no longer - # works. Thus the step to test it now intentionally has a fallback to use - # the service name 'mariadb' instead, and the fallback is always used. - - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server - - service mysql status || service mariadb status - - *test-verify-final - variables: - GIT_STRATEGY: none - except: - variables: - - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ - # Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump. # The Debian maintainer scripts detect this situation and simply moves old datadir aside and start fresh. # # Testing on Focal binaries on Buster works. Using Jammy binaries on Bullseye # does not work as libc in Jammy is too new. -mysql-8.0 from Ubuntu 22.04 with Bullseye backports upgrade: +mysql-8.0 from Ubuntu 22.04 upgrade: stage: upgrade extras needs: - - job: build bullseye-backports - image: debian:bullseye + - job: build + image: debian:${RELEASE} artifacts: when: always name: "$CI_BUILD_NAME" @@ -701,8 +515,6 @@ mysql-8.0 from Ubuntu 22.04 with Bullseye backports upgrade: - apt-get install -y mysql-server 'libmysqlc*' || true - sleep 10 && apt-get install -f - *test-verify-initial - # Enable backports to make galera-4 available - - echo "deb http://deb.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/backports.list && apt-get update -qq - *test-install - service mysql status - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server @@ -715,11 +527,11 @@ mysql-8.0 from Ubuntu 22.04 with Bullseye backports upgrade: # Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump. # The Debian maintainer scripts detect this situation and simply moves old datadir aside and start fresh. -mysql-community-cluster-8.0 from MySQL.com with Bullseye backports upgrade: +mysql-community-cluster-8.0 from MySQL.com upgrade: stage: upgrade extras needs: - - job: build bullseye-backports - image: debian:bullseye + - job: build + image: debian:${RELEASE} artifacts: when: always name: "$CI_BUILD_NAME" @@ -737,8 +549,6 @@ mysql-community-cluster-8.0 from MySQL.com with Bullseye backports upgrade: - dpkg -l | grep -iE 'maria|mysql|galera' - systemctl status mysql; mysql -e 'SELECT VERSION()' - systemctl stop mysql # Stop manually as maintainer scripts don't handle this with systemctl shim - # Enable backports to make galera-4 available - - echo "deb http://deb.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/backports.list && apt-get update -qq - *test-install # Ignore systemctl shim result as MariaDB systemd file is incompatible with it and yields: # ERROR:systemctl:the ExecStartPre control process exited with error code @@ -787,7 +597,6 @@ mariadb.org-10.6 to mariadb-10.6 upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -# archive.mariadb.org for Debian Sid latest is 10.5.13 mariadb.org-10.5 to mariadb-10.6 upgrade: stage: upgrade extras needs: @@ -804,7 +613,6 @@ mariadb.org-10.5 to mariadb-10.6 upgrade: - curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc - echo "deb https://archive.mariadb.org/mariadb-10.5/repo/debian ${RELEASE} main" > /etc/apt/sources.list.d/mariadb.list - apt-get update -qq - - *test-install-openssl1-in-sid-for-backwards-compat - apt-get install -y mariadb-server-10.5 - *test-verify-initial # Install MariaDB built in this commit @@ -819,12 +627,11 @@ mariadb.org-10.5 to mariadb-10.6 upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -# archive.mariadb.org for Debian Sid latest is 10.4.17 -mariadb.org-10.4 to mariadb-10.6 upgrade: +mariadb.org-10.4 to mariadb-10.6 with Buster backports upgrade: stage: upgrade extras needs: - - job: build - image: debian:${RELEASE} + - job: build buster-backports + image: debian:buster artifacts: when: always name: "$CI_BUILD_NAME" @@ -832,17 +639,17 @@ mariadb.org-10.4 to mariadb-10.6 upgrade: - ${WORKING_DIR}/debug script: - *test-prepare-container - - apt-get -qq install --no-install-recommends --yes ca-certificates curl systemctl # systemctl shim needed on platforms that don't have systemd + - apt-get -qq install --no-install-recommends --yes ca-certificates curl - curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc - - echo "deb https://archive.mariadb.org/mariadb-10.4/repo/debian ${RELEASE} main" > /etc/apt/sources.list.d/mariadb.list + - echo "deb https://archive.mariadb.org/mariadb-10.4/repo/debian buster main" > /etc/apt/sources.list.d/mariadb.list - apt-get update -qq - - *test-install-readline-in-sid-for-backwards-compat - - *test-install-openssl1-in-sid-for-backwards-compat - apt-get install -y mariadb-server-10.4 # MariaDB.org version of 10.4 and early 10.5 do not install an init file, so # it must be installed here manually - cp /usr/share/mysql/mysql.init /etc/init.d/mysql; chmod +x /etc/init.d/mysql; service mysql start; sleep 5 - *test-verify-initial + # Buster backports is needed for liburing1 (>= 0.7) and galera-4 (>= 26.4) + - *test-enable-buster-backports-repos - *test-install - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server - service mysql status @@ -854,12 +661,11 @@ mariadb.org-10.4 to mariadb-10.6 upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -# archive.mariadb.org for Debian Sid latest is 10.3.27 -mariadb.org-10.3 to mariadb-10.6 upgrade: +mariadb.org-10.3 to mariadb-10.6 with Buster backports upgrade: stage: upgrade extras needs: - - job: build - image: debian:${RELEASE} + - job: build buster-backports + image: debian:buster artifacts: when: always name: "$CI_BUILD_NAME" @@ -869,12 +675,12 @@ mariadb.org-10.3 to mariadb-10.6 upgrade: - *test-prepare-container - apt-get -qq install --no-install-recommends --yes ca-certificates curl - curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc - - echo "deb https://archive.mariadb.org/mariadb-10.3/repo/debian ${RELEASE} main" > /etc/apt/sources.list.d/mariadb.list + - echo "deb https://archive.mariadb.org/mariadb-10.3/repo/debian buster main" > /etc/apt/sources.list.d/mariadb.list - apt-get update -qq - - *test-install-readline-in-sid-for-backwards-compat - - *test-install-openssl1-in-sid-for-backwards-compat - apt-get install -y mariadb-server-10.3 - *test-verify-initial + # Buster backports is needed for liburing1 (>= 0.7) and galera-4 (>= 26.4) + - *test-enable-buster-backports-repos - *test-install - service mysql status # Give the mariadb-upgrade plenty of time to complete, otherwise next commands @@ -887,52 +693,14 @@ mariadb.org-10.3 to mariadb-10.6 upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -# archive.mariadb.org for Debian Sid latest is 10.2.21 -mariadb.org-10.2 to mariadb-10.6 upgrade: +# archive.mariadb.org has for 10.2 only Stretch, so we can't test upgrades to +# 10.6 with only Buster and Bullseye builds + +mysql.com-5.7 upgrade: stage: upgrade extras needs: - job: build image: debian:${RELEASE} - artifacts: - when: always - name: "$CI_BUILD_NAME" - paths: - - ${WORKING_DIR}/debug - script: - - *test-prepare-container - - apt-get -qq install --no-install-recommends --yes ca-certificates curl - - curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc - - echo "deb https://archive.mariadb.org/mariadb-10.2/repo/debian ${RELEASE} main" > /etc/apt/sources.list.d/mariadb.list - - apt-get update -qq - - *test-install-readline-in-sid-for-backwards-compat - - *test-install-openssl1-in-sid-for-backwards-compat - - apt-get install -y mariadb-server-10.2 - # Verify initial state before upgrade - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - - service mysql status - # prepending with --defaults-file=/etc/mysql/debian.cnf is needed in upstream 5.5–10.3 - - | - mysql --defaults-file=/etc/mysql/debian.cnf --skip-column-names -e "SELECT @@version, @@version_comment" - mysql --defaults-file=/etc/mysql/debian.cnf --table -e "SHOW DATABASES;" - mysql --defaults-file=/etc/mysql/debian.cnf --table -e "SELECT * FROM mysql.user; SHOW CREATE USER root@localhost;" - mysql --defaults-file=/etc/mysql/debian.cnf --table -e "SELECT * FROM mysql.plugin; SHOW PLUGINS;" - - *test-install - - service mysql status - # Give the mariadb-upgrade plenty of time to complete, otherwise next commands - # fail on non-existing mariadb.sys user - - sleep 15 - - *test-verify-final - variables: - GIT_STRATEGY: none - except: - variables: - - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ - -mysql.com-5.7 with Bullseye backports upgrade: - stage: upgrade extras - needs: - - job: build bullseye-backports - image: debian:bullseye artifacts: when: always name: "$CI_BUILD_NAME" @@ -947,8 +715,6 @@ mysql.com-5.7 with Bullseye backports upgrade: apt-get update -qq apt-get install -y 'mysql*' 'libmysqlc*' - *test-verify-initial - # Enable backports to make galera-4 available - - echo "deb http://deb.debian.org/debian bullseye-backports main" >> /etc/apt/sources.list.d/backports.list && apt-get update -qq - *test-install # Due to some (currently unknown) changes in MySQL 5.7 packaging or apt # behaviour changes, a system with a previous installation of MySQL will @@ -968,11 +734,11 @@ mysql.com-5.7 with Bullseye backports upgrade: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -percona-xtradb-5.7 with bullseye backports upgrade: +percona-xtradb-5.7 upgrade: stage: upgrade extras needs: - - job: build bullseye-backports - image: debian:bullseye + - job: build + image: debian:${RELEASE} artifacts: when: always name: "$CI_BUILD_NAME" @@ -983,13 +749,11 @@ percona-xtradb-5.7 with bullseye backports upgrade: - | apt-get install --no-install-recommends --yes gpg gpg-agent dirmngr ca-certificates # Bare minimal (<4MB) for apt-key to work apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com:443 9334A25F8507EFA5 - echo "deb https://repo.percona.com/apt/ bullseye main" > /etc/apt/sources.list.d/mysql.list + echo "deb https://repo.percona.com/apt/ ${RELEASE} main" > /etc/apt/sources.list.d/mysql.list apt-get update -qq apt-get install -y percona-xtradb-cluster-full-57 percona-xtrabackup-24 percona-toolkit pmm2-client - service mysql status - *test-verify-initial - # Enable backports to make galera-4 available - - echo "deb http://deb.debian.org/debian bullseye-backports main" >> /etc/apt/sources.list.d/backports.list && apt-get update -qq - *test-install - service mysql status - sleep 15 # Give the mysql_upgrade a bit of extra time to complete with MySQL 5.7 before querying the server From 18342cd5e1ba4bd8a9547844e0309f288dc939a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sat, 25 Mar 2023 14:06:20 -0700 Subject: [PATCH 089/260] Deb: Add missing installation step to Salsa-CI job for 10.5 upgrades Add vital missing step to MariaDB 10.5 upgrade job to actually install the new binary being built. Without this the test was happily passing all the time but actually not testing the upgrade. Also stop using oneliner syntax for the install step to make the debugging of failing installs/upgrades from build logs easier. NOTE TO MERGERS: This commit is made on 10.6 branch and can be merged to all later branches (10.7, 10.8, ..., 11.0). If/when some jobs break, they will be fixed per branch on follow-up commits. --- debian/salsa-ci.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml index c7ca3613fd3..918d5e0711d 100644 --- a/debian/salsa-ci.yml +++ b/debian/salsa-ci.yml @@ -155,12 +155,12 @@ blhc: EOF apt-get update -qq -.test-install: &test-install | +.test-install: &test-install # Install MariaDB built in this commit - apt-get install -y ./*.deb + - apt-get install -y ./*.deb # Verify installation of MariaDB built in this commit - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - mariadb --version # Client version + - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed + - mariadb --version # Client version .test-verify-final: &test-verify-final | mkdir -p debug # Ensure dir exists before using it @@ -615,10 +615,7 @@ mariadb.org-10.5 to mariadb-10.6 upgrade: - apt-get update -qq - apt-get install -y mariadb-server-10.5 - *test-verify-initial - # Install MariaDB built in this commit - # Verify installation of MariaDB built in this commit - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - - mariadb --version # Client version + - *test-install - service mariadb status # There is no init.d/mysql in MariaDB 10.5+ - *test-verify-final variables: From e68f0f098665337d516033b2e2f82e7c3cc39bad Mon Sep 17 00:00:00 2001 From: Tuukka Pasanen Date: Mon, 20 Feb 2023 09:03:28 +0200 Subject: [PATCH 090/260] MDEV-30502: Change lsb-base to sysvinit-utils Scripts of lsb-base package are moved to sysvinit-utils in Debian 12. Commit removes deprecated lsb-base as dependency. It also make change autobake-debs.sh to be sure that there is backward compatibility with distro version that still use lsb-base: * Debian 10 and 11 * Ubuntu 18.04, 20.04, 22.04 and 22.10 --- debian/autobake-deb.sh | 18 ++++++++++++++++++ debian/control | 1 - 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index fde6cba4532..d6516430bcc 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -55,6 +55,15 @@ remove_rocksdb_tools() fi } +add_lsb_base_depends() +{ + # Make sure one can run this multiple times remove + # lines 'sysvinit-utils' and 'lsb-base'. + sed -e '/sysvinit-utils/d' -e '/lsb-base/d' -i debian/control + # Add back lsb-base before lsof + sed -e 's#lsof #lsb-base (>= 3.0-10),\n lsof #' -i debian/control +} + replace_uring_with_aio() { sed 's/liburing-dev/libaio-dev/g' -i debian/control @@ -105,6 +114,7 @@ case "${LSBNAME}" in # Debian buster) + add_lsb_base_depends disable_libfmt replace_uring_with_aio if [ ! "$architecture" = amd64 ] @@ -113,6 +123,11 @@ in fi ;& bullseye|bookworm) + if [[ "${LSBNAME}" == "bullseye" ]] + then + add_lsb_base_depends + fi + # mariadb-plugin-rocksdb in control is 4 arches covered by the distro rocksdb-tools # so no removal is necessary. if [[ ! "$architecture" =~ amd64|arm64|ppc64el ]] @@ -130,14 +145,17 @@ in ;; # Ubuntu bionic) + add_lsb_base_depends remove_rocksdb_tools [ "$architecture" != amd64 ] && disable_pmem ;& focal) + add_lsb_base_depends replace_uring_with_aio disable_libfmt ;& impish|jammy|kinetic) + add_lsb_base_depends # mariadb-plugin-rocksdb s390x not supported by us (yet) # ubuntu doesn't support mips64el yet, so keep this just # in case something changes. diff --git a/debian/control b/debian/control index 8886da40fdf..6d5bceffc17 100644 --- a/debian/control +++ b/debian/control @@ -682,7 +682,6 @@ Depends: galera-4 (>= 26.4), gawk, iproute2 [linux-any], libdbi-perl, - lsb-base (>= 3.0-10), lsof [linux-any], mariadb-client (>= ${source:Version}), mariadb-server-core (>= ${source:Version}), From da73db2382d6cfaaa74fe5c37e7df18aa2d44238 Mon Sep 17 00:00:00 2001 From: Lorna Luo Date: Mon, 13 Mar 2023 17:27:28 -0400 Subject: [PATCH 091/260] Make 'move_file' command more reliable in mysqltest The tests innodb.import_tablespace_race, innodn.restart, and innodb.innodb-wl5522 move the tablespace file between the data directory and the tmp directory specified by global environment variables. However this is risky because it's not unusual that the set tmp directory (often under /tmp) is mounted on another disk partition or device, and 'move_file' command may fail with "Errcode: 18 'Invalid cross-device link.'" To stabilize mysqltest in the described scenario, and prevent such behavior in the future, let make_file() check both from file path and to file path and make sure they are either both under MYSQLTEST_VARDIR or MYSQL_TMP_DIR. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc. --- client/mysqltest.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 214b7542374..6330d4f881d 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -3814,9 +3814,21 @@ void do_move_file(struct st_command *command) sizeof(move_file_args)/sizeof(struct command_arg), ' '); - if (bad_path(ds_to_file.str)) - DBUG_VOID_RETURN; + size_t from_plen = strlen(ds_from_file.str); + size_t to_plen = strlen(ds_to_file.str); + const char *vardir= getenv("MYSQLTEST_VARDIR"); + const char *tmpdir= getenv("MYSQL_TMP_DIR"); + if (!((is_sub_path(ds_from_file.str, from_plen, vardir) && + is_sub_path(ds_to_file.str, to_plen, vardir)) || + (is_sub_path(ds_from_file.str, from_plen, tmpdir) && + is_sub_path(ds_to_file.str, to_plen, tmpdir)))) { + report_or_die("Paths '%s' and '%s' are not both under MYSQLTEST_VARDIR '%s'" + "or both under MYSQL_TMP_DIR '%s'", + ds_from_file, ds_to_file, vardir, tmpdir); + DBUG_VOID_RETURN; + } + DBUG_PRINT("info", ("Move %s to %s", ds_from_file.str, ds_to_file.str)); error= (my_rename(ds_from_file.str, ds_to_file.str, MYF(disable_warnings ? 0 : MY_WME)) != 0); From 0cc1694e9c7481b59d372af7f759bb0bcf552bfa Mon Sep 17 00:00:00 2001 From: Lorna Luo Date: Fri, 31 Mar 2023 19:17:56 +0000 Subject: [PATCH 092/260] Make 'move_file' command more reliable in 3 innodb tests The tests innodb.import_tablespace_race, innodn.restart, and innodb.innodb-wl5522 move the tablespace file between the data directory and the tmp directory specified by global environment variables. However this is risky because it's not unusual that the set tmp directory (often under /tmp) is mounted on another disk partition or device, and 'move_file' command may fail with "Errcode: 18 'Invalid cross-device link.'" For innodb.import_tablespace_race and innodb.innodb-wl5522, moving files across directories is not necessary. Modify the tests so they rename files under the same directory. For innodb.restart, instead of moving between datadir and MYSQL_TMPDIR, move the files under MYSQLTEST_VARDIR. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc. --- .../suite/innodb/r/innodb-wl5522.result | 14 +++++++++++ .../innodb/t/import_tablespace_race.test | 8 +++---- mysql-test/suite/innodb/t/innodb-wl5522.test | 21 ++++++++--------- mysql-test/suite/innodb/t/restart.test | 23 ++++++++++--------- 4 files changed, 40 insertions(+), 26 deletions(-) diff --git a/mysql-test/suite/innodb/r/innodb-wl5522.result b/mysql-test/suite/innodb/r/innodb-wl5522.result index b3bc42ee3d8..c44443a35af 100644 --- a/mysql-test/suite/innodb/r/innodb-wl5522.result +++ b/mysql-test/suite/innodb/r/innodb-wl5522.result @@ -63,16 +63,24 @@ a b c # Done restarting server # List before t1 DISCARD db.opt +t1.cfg.sav t1.frm t1.ibd +t1.ibd.sav +t2.cfg.sav t2.frm t2.ibd +t2.ibd.sav ALTER TABLE t1 DISCARD TABLESPACE; # List after t1 DISCARD db.opt +t1.cfg.sav t1.frm +t1.ibd.sav +t2.cfg.sav t2.frm t2.ibd +t2.ibd.sav ALTER TABLE t1 IMPORT TABLESPACE; ALTER TABLE t1 ENGINE InnoDB; SELECT COUNT(*) FROM t1; @@ -90,10 +98,14 @@ a b c 638 Cavalry ..asdasdfaeraf db.opt t1.cfg +t1.cfg.sav t1.frm t1.ibd +t1.ibd.sav +t2.cfg.sav t2.frm t2.ibd +t2.ibd.sav SELECT COUNT(*) FROM t1; COUNT(*) 640 @@ -112,7 +124,9 @@ ALTER TABLE t2 ROW_FORMAT=DYNAMIC; ALTER TABLE t2 DISCARD TABLESPACE; # List after t2 DISCARD db.opt +t2.cfg.sav t2.frm +t2.ibd.sav ALTER TABLE t2 IMPORT TABLESPACE; ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x21 and the meta-data file has 0x1; .cfg file uses ROW_FORMAT=COMPACT) ALTER TABLE t2 IMPORT TABLESPACE; diff --git a/mysql-test/suite/innodb/t/import_tablespace_race.test b/mysql-test/suite/innodb/t/import_tablespace_race.test index 532c2684dde..4540834cf75 100644 --- a/mysql-test/suite/innodb/t/import_tablespace_race.test +++ b/mysql-test/suite/innodb/t/import_tablespace_race.test @@ -36,8 +36,8 @@ ALTER TABLE t NOWAIT ADD INDEX (c); FLUSH TABLE t FOR EXPORT; --let $create= query_get_value(SHOW CREATE TABLE t, Create Table, 1) ---copy_file $datadir/test/t.cfg $MYSQL_TMP_DIR/t.cfg ---copy_file $datadir/test/t.ibd $MYSQL_TMP_DIR/t.ibd +--copy_file $datadir/test/t.cfg $datadir/test/t.cfg.sav +--copy_file $datadir/test/t.ibd $datadir/test/t.ibd.sav UNLOCK TABLES; DROP TABLE t; @@ -46,8 +46,8 @@ eval $create; --enable_query_log ALTER TABLE t DISCARD TABLESPACE; ---move_file $MYSQL_TMP_DIR/t.cfg $datadir/test/t.cfg ---move_file $MYSQL_TMP_DIR/t.ibd $datadir/test/t.ibd +--move_file $datadir/test/t.cfg.sav $datadir/test/t.cfg +--move_file $datadir/test/t.ibd.sav $datadir/test/t.ibd ALTER TABLE t IMPORT TABLESPACE; # Cleanup diff --git a/mysql-test/suite/innodb/t/innodb-wl5522.test b/mysql-test/suite/innodb/t/innodb-wl5522.test index 47ea4325403..1a55d9d2da0 100644 --- a/mysql-test/suite/innodb/t/innodb-wl5522.test +++ b/mysql-test/suite/innodb/t/innodb-wl5522.test @@ -9,7 +9,6 @@ call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it alre call mtr.add_suppression("Index for table 't2' is corrupt; try to repair it"); FLUSH TABLES; -let $MYSQLD_TMPDIR = `SELECT @@tmpdir`; let $MYSQLD_DATADIR = `SELECT @@datadir`; let $checksum_algorithm = `SELECT @@innodb_checksum_algorithm`; @@ -39,10 +38,10 @@ CREATE TABLE t2(a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPACT; FLUSH TABLE t1, t2 FOR EXPORT; --echo # List before copying files --list_files $MYSQLD_DATADIR/test ---copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_TMPDIR/t1.cfg ---copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_TMPDIR/t1.ibd ---move_file $MYSQLD_DATADIR/test/t2.cfg $MYSQLD_TMPDIR/t2.cfg ---copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_TMPDIR/t2.ibd +--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t1.cfg.sav +--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t1.ibd.sav +--move_file $MYSQLD_DATADIR/test/t2.cfg $MYSQLD_DATADIR/test/t2.cfg.sav +--copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_DATADIR/test/t2.ibd.sav UNLOCK TABLES; INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a; SELECT COUNT(*) FROM t1; @@ -56,8 +55,8 @@ SELECT * FROM t1 ORDER BY a DESC LIMIT 3; ALTER TABLE t1 DISCARD TABLESPACE; --echo # List after t1 DISCARD --list_files $MYSQLD_DATADIR/test ---copy_file $MYSQLD_TMPDIR/t1.cfg $MYSQLD_DATADIR/test/t1.cfg ---copy_file $MYSQLD_TMPDIR/t1.ibd $MYSQLD_DATADIR/test/t1.ibd +--copy_file $MYSQLD_DATADIR/test/t1.cfg.sav $MYSQLD_DATADIR/test/t1.cfg +--copy_file $MYSQLD_DATADIR/test/t1.ibd.sav $MYSQLD_DATADIR/test/t1.ibd ALTER TABLE t1 IMPORT TABLESPACE; ALTER TABLE t1 ENGINE InnoDB; SELECT COUNT(*) FROM t1; @@ -68,15 +67,15 @@ SELECT COUNT(*) FROM t1; SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; SELECT * FROM t1 ORDER BY a DESC LIMIT 3; DROP TABLE t1; ---remove_file $MYSQLD_TMPDIR/t1.cfg ---remove_file $MYSQLD_TMPDIR/t1.ibd +--remove_file $MYSQLD_DATADIR/test/t1.cfg.sav +--remove_file $MYSQLD_DATADIR/test/t1.ibd.sav ALTER TABLE t2 ROW_FORMAT=DYNAMIC; ALTER TABLE t2 DISCARD TABLESPACE; --echo # List after t2 DISCARD --list_files $MYSQLD_DATADIR/test ---move_file $MYSQLD_TMPDIR/t2.ibd $MYSQLD_DATADIR/test/t2.ibd ---move_file $MYSQLD_TMPDIR/t2.cfg $MYSQLD_DATADIR/test/t2.cfg +--move_file $MYSQLD_DATADIR/test/t2.ibd.sav $MYSQLD_DATADIR/test/t2.ibd +--move_file $MYSQLD_DATADIR/test/t2.cfg.sav $MYSQLD_DATADIR/test/t2.cfg --error ER_TABLE_SCHEMA_MISMATCH ALTER TABLE t2 IMPORT TABLESPACE; --remove_file $MYSQLD_DATADIR/test/t2.cfg diff --git a/mysql-test/suite/innodb/t/restart.test b/mysql-test/suite/innodb/t/restart.test index 3e726c971ab..859d9325985 100644 --- a/mysql-test/suite/innodb/t/restart.test +++ b/mysql-test/suite/innodb/t/restart.test @@ -4,6 +4,7 @@ let datadir= `select @@datadir`; let page_size= `select @@innodb_page_size`; +let tmp_in_vardir=$MYSQLTEST_VARDIR/tmp; --echo # --echo # MDEV-15333 MariaDB (still) slow start @@ -28,19 +29,19 @@ call mtr.add_suppression("\\[Warning\\] InnoDB: Ignoring tablespace for `test`\\ CREATE TABLE tr(a INT)ENGINE=InnoDB ROW_FORMAT=REDUNDANT; CREATE TABLE tc(a INT)ENGINE=InnoDB ROW_FORMAT=COMPACT PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9; ---replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR +--replace_result $tmp_in_vardir MYSQL_TMP_DIR eval CREATE TABLE td(a INT)ENGINE=InnoDB ROW_FORMAT=DYNAMIC -STATS_PERSISTENT=0 DATA DIRECTORY='$MYSQL_TMP_DIR'; +STATS_PERSISTENT=0 DATA DIRECTORY='$tmp_in_vardir'; --source include/shutdown_mysqld.inc --move_file $datadir/test/tr.ibd $datadir/test/tr0.ibd --move_file $datadir/test/tc.ibd $datadir/test/tc0.ibd ---move_file $MYSQL_TMP_DIR/test/td.ibd $datadir/test/td0.ibd +--move_file $tmp_in_vardir/test/td.ibd $datadir/test/td0.ibd # TODO: test that MariaDB does not even attempt to open the files #--mkdir $datadir/test/tr.ibd #--mkdir $datadir/test/tc.ibd -#--mkdir $MYSQL_TMP_DIR/test/td.ibd +#--mkdir $tmp_in_vardir/test/td.ibd perl; die unless open OUT, ">", "$ENV{datadir}/test/tr.ibd"; @@ -49,7 +50,7 @@ close OUT or die; die unless open OUT, ">", "$ENV{datadir}/test/tc.ibd"; print OUT "bar " x $ENV{page_size}; close OUT or die; -die unless open OUT, ">", "$ENV{MYSQL_TMP_DIR}/test/td.ibd"; +die unless open OUT, ">", "$ENV{tmp_in_vardir}/test/td.ibd"; print OUT "Xyz " x $ENV{page_size}; close OUT or die; EOF @@ -67,14 +68,14 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED'); # TODO: test that MariaDB does not even attempt to open the files #--rmdir $datadir/test/tr.ibd #--rmdir $datadir/test/tc.ibd -#--rmdir $MYSQL_TMP_DIR/test/td.ibd +#--rmdir $tmp_in_vardir/test/td.ibd --remove_file $datadir/test/tr.ibd --remove_file $datadir/test/tc.ibd ---remove_file $MYSQL_TMP_DIR/test/td.ibd +--remove_file $tmp_in_vardir/test/td.ibd --move_file $datadir/test/tr0.ibd $datadir/test/tr.ibd --move_file $datadir/test/tc0.ibd $datadir/test/tc.ibd ---move_file $datadir/test/td0.ibd $MYSQL_TMP_DIR/test/td.ibd +--move_file $datadir/test/td0.ibd $tmp_in_vardir/test/td.ibd --source include/start_mysqld.inc SELECT * FROM tr; @@ -144,13 +145,13 @@ if ($MTR_COMBINATION_64K) } --error 1 -exec $MYSQLD --no-defaults --skip-networking --innodb_data_file_path=ibdata1:$ibdata_size --innodb-page-size=$page_size --datadir=$MYSQLD_DATADIR --log-error=$MYSQL_TMP_DIR/attempted_start.err; +exec $MYSQLD --no-defaults --skip-networking --innodb_data_file_path=ibdata1:$ibdata_size --innodb-page-size=$page_size --datadir=$MYSQLD_DATADIR --log-error=$tmp_in_vardir/attempted_start.err; -let SEARCH_FILE= $MYSQL_TMP_DIR/attempted_start.err; +let SEARCH_FILE= $tmp_in_vardir/attempted_start.err; let SEARCH_PATTERN= InnoDB: MySQL-8\.0 tablespace in \./ibdata1; source include/search_pattern_in_file.inc; ---remove_file $MYSQL_TMP_DIR/attempted_start.err +--remove_file $tmp_in_vardir/attempted_start.err --remove_file $MYSQLD_DATADIR/ibdata1 --move_file $MYSQLD_DATADIR/ibdata1.bak $MYSQLD_DATADIR/ibdata1 From 8020b1bd735c686818f1563e2c2317e263d5bd3a Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 31 Mar 2023 17:20:03 +0400 Subject: [PATCH 093/260] MDEV-30034 UNIQUE USING HASH accepts duplicate entries for tricky collations - Adding a new argument "flag" to MY_COLLATION_HANDLER::strnncollsp_nchars() and a flag MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES. The flag defines if strnncollsp_nchars() should emulate trailing spaces which were possibly trimmed earlier (e.g. in InnoDB CHAR compression). This is important for NOPAD collations. For example, with this input: - str1= 'a ' (Latin letter a followed by one space) - str2= 'a ' (Latin letter a followed by two spaces) - nchars= 3 if the flag is given, strnncollsp_nchars() will virtually restore one trailing space to str1 up to nchars (3) characters and compare two strings as equal: - str1= 'a ' (one extra trailing space emulated) - str2= 'a ' (as is) If the flag is not given, strnncollsp_nchars() does not add trailing virtual spaces, so in case of a NOPAD collation, str1 will be compared as less than str2 because it is shorter. - Field_string::cmp_prefix() now passes the new flag. Field_varstring::cmp_prefix() and Field_blob::cmp_prefix() do not pass the new flag. - The branch in cmp_whole_field() in storage/innobase/rem/rem0cmp.cc (which handles the CHAR data type) now also passed the new flag. - Fixing UCA collations to respect the new flag. Other collations are possibly also affected, however I had no success in making an SQL script demonstrating the problem. Other collations will be extended to respect this flags in a separate patch later. - Changing the meaning of the last parameter of Field::cmp_prefix() from "number of bytes" (internal length) to "number of characters" (user visible length). The code calling cmp_prefix() from handler.cc was wrong. After this change, the call in handler.cc became correct. The code calling cmp_prefix() from key_rec_cmp() in key.cc was adjusted according to this change. - Old strnncollsp_nchar() related tests in unittest/strings/strings-t.c now pass the new flag. A few new tests also were added, without the flag. --- include/m_ctype.h | 25 +- .../include/ctype_nopad_prefix_unique.inc | 85 ++++ mysql-test/main/ctype_utf8_uca.result | 148 +++++++ mysql-test/main/ctype_utf8_uca.test | 18 + .../suite/innodb/r/innodb_ctype_utf8.result | 98 +++++ .../suite/innodb/t/innodb_ctype_utf8.test | 12 + sql/field.cc | 21 +- sql/field.h | 9 +- sql/key.cc | 3 +- storage/innobase/rem/rem0cmp.cc | 3 +- strings/ctype-bin.c | 6 +- strings/ctype-simple.c | 3 +- strings/ctype-tis620.c | 3 +- strings/ctype-uca.inl | 27 +- strings/ctype.c | 6 +- strings/strcoll.inl | 3 +- strings/strings_def.h | 6 +- unittest/strings/strings-t.c | 364 +++++++++--------- 18 files changed, 631 insertions(+), 209 deletions(-) create mode 100644 mysql-test/include/ctype_nopad_prefix_unique.inc diff --git a/include/m_ctype.h b/include/m_ctype.h index 484cd0a657e..96eea74d5ba 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -248,6 +248,28 @@ extern MY_UNI_CTYPE my_uni_ctype[256]; #define MY_STRXFRM_REVERSE_LEVEL6 0x00200000 /* if reverse order for level6 */ #define MY_STRXFRM_REVERSE_SHIFT 16 +/* Flags to strnncollsp_nchars */ +/* + MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES - + defines if inside strnncollsp_nchars() + short strings should be virtually extended to "nchars" + characters by emulating trimmed trailing spaces. + + This flag is needed when comparing packed strings of the CHAR + data type, when trailing spaces are trimmed on storage (like in InnoDB), + however the actual values (after unpacking) will have those trailing + spaces. + + If this flag is passed, strnncollsp_nchars() performs both + truncating longer strings and extending shorter strings + to exactly "nchars". + + If this flag is not passed, strnncollsp_nchars() only truncates longer + strings to "nchars", but does not extend shorter strings to "nchars". +*/ +#define MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES 1 + + /* Collation IDs for MariaDB that should not conflict with MySQL. We reserve 256..511, because MySQL will most likely use this range @@ -383,7 +405,8 @@ struct my_collation_handler_st int (*strnncollsp_nchars)(CHARSET_INFO *, const uchar *str1, size_t len1, const uchar *str2, size_t len2, - size_t nchars); + size_t nchars, + uint flags); size_t (*strnxfrm)(CHARSET_INFO *, uchar *dst, size_t dstlen, uint nweights, const uchar *src, size_t srclen, uint flags); diff --git a/mysql-test/include/ctype_nopad_prefix_unique.inc b/mysql-test/include/ctype_nopad_prefix_unique.inc new file mode 100644 index 00000000000..b25128e9fef --- /dev/null +++ b/mysql-test/include/ctype_nopad_prefix_unique.inc @@ -0,0 +1,85 @@ +--echo # +--echo # MDEV-30034 UNIQUE USING HASH accepts duplicate entries for tricky collations +--echo # + +# TEXT + +if (`SELECT UPPER(@@storage_engine) != 'MEMORY'`) +{ +EXECUTE IMMEDIATE REPLACE( + 'CREATE TABLE t1 ( ' + ' a TEXT COLLATE ,' + 'UNIQUE(a(3)))', + '', @@collation_connection); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('ss '); +--error ER_DUP_ENTRY +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +DROP TABLE t1; + + +EXECUTE IMMEDIATE REPLACE( + 'CREATE TABLE t1 ( ' + ' a TEXT COLLATE ,' + 'UNIQUE(a(3)) USING HASH)', + '', @@collation_connection); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('ss '); +--error ER_DUP_ENTRY +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +DROP TABLE t1; +} + + +# VARCHAR + +EXECUTE IMMEDIATE REPLACE( + 'CREATE TABLE t1 ( ' + ' a VARCHAR(2000) COLLATE ,' + 'UNIQUE(a(3)))', + '', @@collation_connection); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('ss '); +--error ER_DUP_ENTRY +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +DROP TABLE t1; + + +EXECUTE IMMEDIATE REPLACE( + 'CREATE TABLE t1 ( ' + ' a VARCHAR(2000) COLLATE ,' + 'UNIQUE(a(3)) USING HASH)', + '', @@collation_connection); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('ss '); +--error ER_DUP_ENTRY +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +DROP TABLE t1; + +# CHAR + +# MyISAM is buggy on CHAR+BTREE+UNIQUE+PREFIX (see MDEV-30048), disable for now +# Other engines work fine + +if (`SELECT UPPER(@@storage_engine) != 'MYISAM'`) +{ +EXECUTE IMMEDIATE REPLACE( + 'CREATE TABLE t1 ( ' + ' a CHAR(20) COLLATE ,' + 'UNIQUE(a(3)))', + '', @@collation_connection); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +DROP TABLE t1; +} + +EXECUTE IMMEDIATE REPLACE( + 'CREATE TABLE t1 ( ' + ' a CHAR(20) COLLATE ,' + 'UNIQUE(a(3)) USING HASH)', + '', @@collation_connection); +SHOW CREATE TABLE t1; +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +DROP TABLE t1; diff --git a/mysql-test/main/ctype_utf8_uca.result b/mysql-test/main/ctype_utf8_uca.result index bf4e5ed2fd8..2e22097e6ac 100644 --- a/mysql-test/main/ctype_utf8_uca.result +++ b/mysql-test/main/ctype_utf8_uca.result @@ -761,3 +761,151 @@ DROP TABLE case_folding; # # End of 10.3 tests # +# +# Start of 10.4 tests +# +SET STORAGE_ENGINE=MyISAM; +SET NAMES utf8mb3 COLLATE utf8mb3_unicode_nopad_ci; +# +# MDEV-30034 UNIQUE USING HASH accepts duplicate entries for tricky collations +# +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a TEXT COLLATE ,' + 'UNIQUE(a(3)))', +'', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +ERROR 23000: Duplicate entry 'ß ' for key 'a' +DROP TABLE t1; +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a TEXT COLLATE ,' + 'UNIQUE(a(3)) USING HASH)', +'', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) USING HASH +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +ERROR 23000: Duplicate entry 'ß ' for key 'a' +DROP TABLE t1; +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a VARCHAR(2000) COLLATE ,' + 'UNIQUE(a(3)))', +'', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(2000) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +ERROR 23000: Duplicate entry 'ß ' for key 'a' +DROP TABLE t1; +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a VARCHAR(2000) COLLATE ,' + 'UNIQUE(a(3)) USING HASH)', +'', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(2000) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) USING HASH +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +ERROR 23000: Duplicate entry 'ß ' for key 'a' +DROP TABLE t1; +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a CHAR(20) COLLATE ,' + 'UNIQUE(a(3)) USING HASH)', +'', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(20) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) USING HASH +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +DROP TABLE t1; +SET STORAGE_ENGINE=HEAP; +# +# MDEV-30034 UNIQUE USING HASH accepts duplicate entries for tricky collations +# +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a VARCHAR(2000) COLLATE ,' + 'UNIQUE(a(3)))', +'', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(2000) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +ERROR 23000: Duplicate entry 'ß ' for key 'a' +DROP TABLE t1; +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a VARCHAR(2000) COLLATE ,' + 'UNIQUE(a(3)) USING HASH)', +'', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(2000) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) USING HASH +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +ERROR 23000: Duplicate entry 'ß ' for key 'a' +DROP TABLE t1; +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a CHAR(20) COLLATE ,' + 'UNIQUE(a(3)))', +'', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(20) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +DROP TABLE t1; +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a CHAR(20) COLLATE ,' + 'UNIQUE(a(3)) USING HASH)', +'', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(20) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) USING HASH +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +DROP TABLE t1; +SET STORAGE_ENGINE=DEFAULT; +# +# End of 10.4 tests +# diff --git a/mysql-test/main/ctype_utf8_uca.test b/mysql-test/main/ctype_utf8_uca.test index 38bcce8f4ba..255390b5ce5 100644 --- a/mysql-test/main/ctype_utf8_uca.test +++ b/mysql-test/main/ctype_utf8_uca.test @@ -50,3 +50,21 @@ SET NAMES utf8mb3 COLLATE utf8mb3_thai_520_w2; --echo # --echo # End of 10.3 tests --echo # + + +--echo # +--echo # Start of 10.4 tests +--echo # + +SET STORAGE_ENGINE=MyISAM; +SET NAMES utf8mb3 COLLATE utf8mb3_unicode_nopad_ci; +--source include/ctype_nopad_prefix_unique.inc + +SET STORAGE_ENGINE=HEAP; +--source include/ctype_nopad_prefix_unique.inc + +SET STORAGE_ENGINE=DEFAULT; + +--echo # +--echo # End of 10.4 tests +--echo # diff --git a/mysql-test/suite/innodb/r/innodb_ctype_utf8.result b/mysql-test/suite/innodb/r/innodb_ctype_utf8.result index 3b0fb415056..ab193db6e75 100644 --- a/mysql-test/suite/innodb/r/innodb_ctype_utf8.result +++ b/mysql-test/suite/innodb/r/innodb_ctype_utf8.result @@ -283,3 +283,101 @@ DROP TABLE t1; # # End of 10.2 tests # +# +# Start of 10.4 tests +# +SET NAMES utf8mb3 COLLATE utf8mb3_unicode_nopad_ci; +# +# MDEV-30034 UNIQUE USING HASH accepts duplicate entries for tricky collations +# +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a TEXT COLLATE ,' + 'UNIQUE(a(3)))', +'', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +ERROR 23000: Duplicate entry 'ß ' for key 'a' +DROP TABLE t1; +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a TEXT COLLATE ,' + 'UNIQUE(a(3)) USING HASH)', +'', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) USING HASH +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +ERROR 23000: Duplicate entry 'ß ' for key 'a' +DROP TABLE t1; +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a VARCHAR(2000) COLLATE ,' + 'UNIQUE(a(3)))', +'', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(2000) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +ERROR 23000: Duplicate entry 'ß ' for key 'a' +DROP TABLE t1; +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a VARCHAR(2000) COLLATE ,' + 'UNIQUE(a(3)) USING HASH)', +'', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(2000) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) USING HASH +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +ERROR 23000: Duplicate entry 'ß ' for key 'a' +DROP TABLE t1; +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a CHAR(20) COLLATE ,' + 'UNIQUE(a(3)))', +'', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(20) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +DROP TABLE t1; +EXECUTE IMMEDIATE REPLACE( +'CREATE TABLE t1 ( ' + ' a CHAR(20) COLLATE ,' + 'UNIQUE(a(3)) USING HASH)', +'', @@collation_connection); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(20) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL, + UNIQUE KEY `a` (`a`(3)) USING HASH +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t1 VALUES ('ss '); +INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/; +DROP TABLE t1; +# +# End 10.4 tests +# diff --git a/mysql-test/suite/innodb/t/innodb_ctype_utf8.test b/mysql-test/suite/innodb/t/innodb_ctype_utf8.test index 105f771d8b3..9bc6408e0e0 100644 --- a/mysql-test/suite/innodb/t/innodb_ctype_utf8.test +++ b/mysql-test/suite/innodb/t/innodb_ctype_utf8.test @@ -23,3 +23,15 @@ let $coll_pad='utf8_bin'; --echo # --echo # End of 10.2 tests --echo # + + +--echo # +--echo # Start of 10.4 tests +--echo # + +SET NAMES utf8mb3 COLLATE utf8mb3_unicode_nopad_ci; +--source include/ctype_nopad_prefix_unique.inc + +--echo # +--echo # End 10.4 tests +--echo # diff --git a/sql/field.cc b/sql/field.cc index 2006f0e3096..14252033a01 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7435,7 +7435,8 @@ int Field_string::cmp(const uchar *a_ptr, const uchar *b_ptr) return field_charset->coll->strnncollsp_nchars(field_charset, a_ptr, field_length, b_ptr, field_length, - Field_string::char_length()); + Field_string::char_length(), + MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES); } @@ -7835,10 +7836,11 @@ int Field_varstring::cmp(const uchar *a_ptr, const uchar *b_ptr) int Field_varstring::cmp_prefix(const uchar *a_ptr, const uchar *b_ptr, - size_t prefix_len) + size_t prefix_char_len) { - /* avoid expensive well_formed_char_length if possible */ - if (prefix_len == table->field[field_index]->field_length) + /* avoid more expensive strnncollsp_nchars() if possible */ + if (prefix_char_len * field_charset->mbmaxlen == + table->field[field_index]->field_length) return Field_varstring::cmp(a_ptr, b_ptr); size_t a_length, b_length; @@ -7858,7 +7860,8 @@ int Field_varstring::cmp_prefix(const uchar *a_ptr, const uchar *b_ptr, a_length, b_ptr + length_bytes, b_length, - prefix_len / field_charset->mbmaxlen); + prefix_char_len, + 0); } @@ -8635,7 +8638,7 @@ int Field_blob::cmp(const uchar *a_ptr, const uchar *b_ptr) int Field_blob::cmp_prefix(const uchar *a_ptr, const uchar *b_ptr, - size_t prefix_len) + size_t prefix_char_len) { uchar *blob1,*blob2; memcpy(&blob1, a_ptr+packlength, sizeof(char*)); @@ -8644,7 +8647,8 @@ int Field_blob::cmp_prefix(const uchar *a_ptr, const uchar *b_ptr, return field_charset->coll->strnncollsp_nchars(field_charset, blob1, a_len, blob2, b_len, - prefix_len / field_charset->mbmaxlen); + prefix_char_len, + 0); } @@ -10114,7 +10118,8 @@ my_decimal *Field_bit::val_decimal(my_decimal *deciaml_value) The a and b pointer must be pointers to the field in a record (not the table->record[0] necessarily) */ -int Field_bit::cmp_prefix(const uchar *a, const uchar *b, size_t prefix_len) +int Field_bit::cmp_prefix(const uchar *a, const uchar *b, + size_t prefix_char_len) { my_ptrdiff_t a_diff= a - ptr; my_ptrdiff_t b_diff= b - ptr; diff --git a/sql/field.h b/sql/field.h index 23bb00e68cb..a8bb9e2c9cb 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1109,7 +1109,8 @@ public: The following method is used for comparing prefix keys. Currently it's only used in partitioning. */ - virtual int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_len) + virtual int cmp_prefix(const uchar *a, const uchar *b, + size_t prefix_char_len) { return cmp(a, b); } virtual int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0U) { return memcmp(a,b,pack_length()); } @@ -3728,7 +3729,7 @@ public: String *val_str(String*,String *); my_decimal *val_decimal(my_decimal *); int cmp(const uchar *a,const uchar *b); - int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_len); + int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_char_len); void sort_string(uchar *buff,uint length); uint get_key_image(uchar *buff,uint length, imagetype type); void set_key_image(const uchar *buff,uint length); @@ -3964,7 +3965,7 @@ public: String *val_str(String*,String *); my_decimal *val_decimal(my_decimal *); int cmp(const uchar *a,const uchar *b); - int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_len); + int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_char_len); int cmp(const uchar *a, uint32 a_length, const uchar *b, uint32 b_length); int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0U); int key_cmp(const uchar *,const uchar*); @@ -4501,7 +4502,7 @@ public: } int cmp_binary_offset(uint row_offset) { return cmp_offset(row_offset); } - int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_len); + int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_char_len); int key_cmp(const uchar *a, const uchar *b) { return cmp_binary((uchar *) a, (uchar *) b); } int key_cmp(const uchar *str, uint length); diff --git a/sql/key.cc b/sql/key.cc index 72f4e603023..2485e33af18 100644 --- a/sql/key.cc +++ b/sql/key.cc @@ -612,7 +612,8 @@ int key_rec_cmp(void *key_p, uchar *first_rec, uchar *second_rec) that take the max length into account. */ if ((result= field->cmp_prefix(field->ptr+first_diff, field->ptr+sec_diff, - key_part->length))) + key_part->length / + field->charset()->mbmaxlen))) DBUG_RETURN(result); next_loop: key_part++; diff --git a/storage/innobase/rem/rem0cmp.cc b/storage/innobase/rem/rem0cmp.cc index e4248ed4ca4..539d4279a6b 100644 --- a/storage/innobase/rem/rem0cmp.cc +++ b/storage/innobase/rem/rem0cmp.cc @@ -327,7 +327,8 @@ static int cmp_whole_field(ulint mtype, ulint prtype, if (CHARSET_INFO *cs= get_charset(dtype_get_charset_coll(prtype), MYF(MY_WME))) return cs->coll->strnncollsp_nchars(cs, a, a_length, b, b_length, - std::max(a_length, b_length)); + std::max(a_length, b_length), + MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES); } ib::fatal() << "Unable to find charset-collation for " << prtype; diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index 2893aadd99f..1a2d52c5109 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -128,7 +128,8 @@ static int my_strnncollsp_binary(CHARSET_INFO * cs __attribute__((unused)), static int my_strnncollsp_nchars_binary(CHARSET_INFO * cs __attribute__((unused)), const uchar *s, size_t slen, const uchar *t, size_t tlen, - size_t nchars) + size_t nchars, + uint flags) { set_if_smaller(slen, nchars); set_if_smaller(tlen, nchars); @@ -213,7 +214,8 @@ static int my_strnncollsp_8bit_bin(CHARSET_INFO * cs __attribute__((unused)), static int my_strnncollsp_nchars_8bit_bin(CHARSET_INFO * cs, const uchar *a, size_t a_length, const uchar *b, size_t b_length, - size_t nchars) + size_t nchars, + uint flags) { set_if_smaller(a_length, nchars); set_if_smaller(b_length, nchars); diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index d150e457673..51f140a6620 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -212,7 +212,8 @@ static int my_strnncollsp_nchars_simple(CHARSET_INFO * cs, const uchar *a, size_t a_length, const uchar *b, size_t b_length, - size_t nchars) + size_t nchars, + uint flags) { set_if_smaller(a_length, nchars); set_if_smaller(b_length, nchars); diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index b19832cc792..66dc3e1d54b 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -589,7 +589,8 @@ static int my_strnncollsp_nchars_tis620(CHARSET_INFO * cs, const uchar *a, size_t a_length, const uchar *b, size_t b_length, - size_t nchars) + size_t nchars, + uint flags) { set_if_smaller(a_length, nchars); set_if_smaller(b_length, nchars); diff --git a/strings/ctype-uca.inl b/strings/ctype-uca.inl index 7c9d34d217e..55b2c1ef7ce 100644 --- a/strings/ctype-uca.inl +++ b/strings/ctype-uca.inl @@ -317,6 +317,7 @@ MY_FUNCTION_NAME(strnncollsp_nopad_multilevel)(CHARSET_INFO *cs, static inline weight_and_nchars_t MY_FUNCTION_NAME(scanner_next_pad_trim)(my_uca_scanner *scanner, size_t nchars, + uint flags, uint *generated) { weight_and_nchars_t res; @@ -330,7 +331,10 @@ MY_FUNCTION_NAME(scanner_next_pad_trim)(my_uca_scanner *scanner, We reached the end of the string, but the caller wants more weights. Perform space padding. */ - res.weight= my_space_weight(scanner->level); + res.weight= + flags & MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES ? + my_space_weight(scanner->level) : 0; + res.nchars= 1; (*generated)++; } @@ -367,7 +371,8 @@ MY_FUNCTION_NAME(strnncollsp_nchars_onelevel)(CHARSET_INFO *cs, const MY_UCA_WEIGHT_LEVEL *level, const uchar *s, size_t slen, const uchar *t, size_t tlen, - size_t nchars) + size_t nchars, + uint flags) { my_uca_scanner sscanner; my_uca_scanner tscanner; @@ -385,15 +390,17 @@ MY_FUNCTION_NAME(strnncollsp_nchars_onelevel)(CHARSET_INFO *cs, int diff; s_res= MY_FUNCTION_NAME(scanner_next_pad_trim)(&sscanner, s_nchars_left, - &generated); + flags, &generated); t_res= MY_FUNCTION_NAME(scanner_next_pad_trim)(&tscanner, t_nchars_left, - &generated); + flags, &generated); + if ((diff= (s_res.weight - t_res.weight))) return diff; if (generated == 2) { - if (cs->state & MY_CS_NOPAD) + if ((cs->state & MY_CS_NOPAD) && + (flags & MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES)) { /* Both values are auto-generated. There's no real data any more. @@ -445,11 +452,12 @@ static int MY_FUNCTION_NAME(strnncollsp_nchars)(CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, - size_t nchars) + size_t nchars, + uint flags) { return MY_FUNCTION_NAME(strnncollsp_nchars_onelevel)(cs, &cs->uca->level[0], s, slen, t, tlen, - nchars); + nchars, flags); } @@ -460,7 +468,8 @@ static int MY_FUNCTION_NAME(strnncollsp_nchars_multilevel)(CHARSET_INFO *cs, const uchar *s, size_t slen, const uchar *t, size_t tlen, - size_t nchars) + size_t nchars, + uint flags) { uint num_level= cs->levels_for_order; uint i; @@ -470,7 +479,7 @@ MY_FUNCTION_NAME(strnncollsp_nchars_multilevel)(CHARSET_INFO *cs, &cs->uca->level[i], s, slen, t, tlen, - nchars); + nchars, flags); if (ret) return ret; } diff --git a/strings/ctype.c b/strings/ctype.c index 0cf1131ab57..07e2ecd0349 100644 --- a/strings/ctype.c +++ b/strings/ctype.c @@ -1215,7 +1215,8 @@ outp: int my_strnncollsp_nchars_generic(CHARSET_INFO *cs, const uchar *str1, size_t len1, const uchar *str2, size_t len2, - size_t nchars) + size_t nchars, + uint flags) { int error; len1= my_well_formed_length(cs, (const char *) str1, @@ -1232,7 +1233,8 @@ int my_strnncollsp_nchars_generic(CHARSET_INFO *cs, int my_strnncollsp_nchars_generic_8bit(CHARSET_INFO *cs, const uchar *str1, size_t len1, const uchar *str2, size_t len2, - size_t nchars) + size_t nchars, + uint flags) { set_if_smaller(len1, nchars); set_if_smaller(len2, nchars); diff --git a/strings/strcoll.inl b/strings/strcoll.inl index 392a5dac589..13385d29f9a 100644 --- a/strings/strcoll.inl +++ b/strings/strcoll.inl @@ -304,7 +304,8 @@ static int MY_FUNCTION_NAME(strnncollsp_nchars)(CHARSET_INFO *cs __attribute__((unused)), const uchar *a, size_t a_length, const uchar *b, size_t b_length, - size_t nchars) + size_t nchars, + uint flags) { const uchar *a_end= a + a_length; const uchar *b_end= b + b_length; diff --git a/strings/strings_def.h b/strings/strings_def.h index 8bf089ec695..b5d0a4f4229 100644 --- a/strings/strings_def.h +++ b/strings/strings_def.h @@ -108,12 +108,14 @@ static inline const uchar *skip_trailing_space(const uchar *ptr,size_t len) int my_strnncollsp_nchars_generic(CHARSET_INFO *cs, const uchar *str1, size_t len1, const uchar *str2, size_t len2, - size_t nchars); + size_t nchars, + uint flags); int my_strnncollsp_nchars_generic_8bit(CHARSET_INFO *cs, const uchar *str1, size_t len1, const uchar *str2, size_t len2, - size_t nchars); + size_t nchars, + uint flags); uint my_8bit_charset_flags_from_data(CHARSET_INFO *cs); uint my_8bit_collation_flags_from_data(CHARSET_INFO *cs); diff --git a/unittest/strings/strings-t.c b/unittest/strings/strings-t.c index 338d2f53b05..f5563247f17 100644 --- a/unittest/strings/strings-t.c +++ b/unittest/strings/strings-t.c @@ -787,9 +787,14 @@ typedef struct LEX_CSTRING a; LEX_CSTRING b; size_t nchars; + uint flags; int res; } STRNNCOLLSP_CHAR_PARAM; +#undef TCHAR +#define TCHAR MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES + +#define TVCHAR 0 /* Some lines in the below test data are marked as follows: @@ -811,266 +816,273 @@ typedef struct */ static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_mbminlen1_xpad_common[]= { - {{CSTR("a")}, {CSTR("a")}, 0, 0}, - {{CSTR("a")}, {CSTR("a")}, 1, 0}, - {{CSTR("a")}, {CSTR("a")}, 2, 0}, - {{CSTR("a")}, {CSTR("a")}, 3, 0}, - {{CSTR("a")}, {CSTR("a")}, 100, 0}, + {{CSTR("a")}, {CSTR("a")}, 0, TCHAR, 0}, + {{CSTR("a")}, {CSTR("a")}, 1, TCHAR, 0}, + {{CSTR("a")}, {CSTR("a")}, 2, TCHAR, 0}, + {{CSTR("a")}, {CSTR("a")}, 3, TCHAR, 0}, + {{CSTR("a")}, {CSTR("a")}, 100, TCHAR, 0}, - {{CSTR("a")}, {CSTR("ab")}, 0, 0}, - {{CSTR("a")}, {CSTR("ab")}, 1, 0}, - {{CSTR("a")}, {CSTR("ab")}, 2, -1}, - {{CSTR("a")}, {CSTR("ab")}, 3, -1}, - {{CSTR("a")}, {CSTR("ab")}, 100, -1}, + {{CSTR("a")}, {CSTR("ab")}, 0, TCHAR, 0}, + {{CSTR("a")}, {CSTR("ab")}, 1, TCHAR, 0}, + {{CSTR("a")}, {CSTR("ab")}, 2, TCHAR, -1}, + {{CSTR("a")}, {CSTR("ab")}, 3, TCHAR, -1}, + {{CSTR("a")}, {CSTR("ab")}, 100, TCHAR, -1}, - {{CSTR("a")}, {CSTR("a ")}, 0, 0}, - {{CSTR("a")}, {CSTR("a ")}, 1, 0}, - {{CSTR("a")}, {CSTR("a ")}, 2, 0}, - {{CSTR("a")}, {CSTR("a ")}, 3, 0}, - {{CSTR("a")}, {CSTR("a ")}, 100, 0}, + {{CSTR("a")}, {CSTR("a ")}, 0, TCHAR, 0}, + {{CSTR("a")}, {CSTR("a ")}, 1, TCHAR, 0}, + {{CSTR("a")}, {CSTR("a ")}, 2, TCHAR, 0}, + {{CSTR("a")}, {CSTR("a ")}, 3, TCHAR, 0}, + {{CSTR("a")}, {CSTR("a ")}, 100, TCHAR, 0}, - {{CSTR("a")}, {CSTR("a ")}, 0, 0}, - {{CSTR("a")}, {CSTR("a ")}, 1, 0}, - {{CSTR("a")}, {CSTR("a ")}, 2, 0}, - {{CSTR("a")}, {CSTR("a ")}, 3, 0}, - {{CSTR("a")}, {CSTR("a ")}, 100, 0}, + {{CSTR("a")}, {CSTR("a ")}, 0, TCHAR, 0}, + {{CSTR("a")}, {CSTR("a ")}, 1, TCHAR, 0}, + {{CSTR("a")}, {CSTR("a ")}, 2, TCHAR, 0}, + {{CSTR("a")}, {CSTR("a ")}, 3, TCHAR, 0}, + {{CSTR("a")}, {CSTR("a ")}, 100, TCHAR, 0}, - {{CSTR("ss")}, {CSTR("ss")}, 0, 0}, - {{CSTR("ss")}, {CSTR("ss")}, 1, 0}, - {{CSTR("ss")}, {CSTR("ss")}, 2, 0}, - {{CSTR("ss")}, {CSTR("ss")}, 3, 0}, - {{CSTR("ss")}, {CSTR("ss")}, 100, 0}, + {{CSTR("ss")}, {CSTR("ss")}, 0, TCHAR, 0}, + {{CSTR("ss")}, {CSTR("ss")}, 1, TCHAR, 0}, + {{CSTR("ss")}, {CSTR("ss")}, 2, TCHAR, 0}, + {{CSTR("ss")}, {CSTR("ss")}, 3, TCHAR, 0}, + {{CSTR("ss")}, {CSTR("ss")}, 100, TCHAR, 0}, - {{NULL, 0}, {NULL, 0}, 0, 0} + {{NULL, 0}, {NULL, 0}, 0, 0, 0} }; /* Tests for utf8, for both PAD SPACE and NOPAD collations */ static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mbx_xpad_common[]= { - {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 0, 0}, - {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 1, 0}, - {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 2, 0}, - {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 3, 0}, - {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 100, 0}, + {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 0, TCHAR, 0}, + {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 1, TCHAR, 0}, + {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 2, TCHAR, 0}, + {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 3, TCHAR, 0}, + {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 100, TCHAR, 0}, - {{NULL, 0}, {NULL, 0}, 0, 0} + {{NULL, 0}, {NULL, 0}, 0, 0, 0} }; /* Tests for latin1, for both PAD and NOPAD collations */ static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_latin1_xpad_common[]= { - {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 0, 0}, - {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 1, 0}, - {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 2, 0}, - {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 3, 0}, - {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 100, 0}, + {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 0, TCHAR, 0}, + {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 1, TCHAR, 0}, + {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 2, TCHAR, 0}, + {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 3, TCHAR, 0}, + {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 100, TCHAR, 0}, - {{NULL, 0}, {NULL, 0}, 0, 0} + {{NULL, 0}, {NULL, 0}, 0, 0, 0} }; /* Tests for utf8 collations that sort "A WITH DIAERESIS" equal to "A" */ static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mbx_xpad_a_eq_auml[]= { - {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 0, 0}, - {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 1, 0}, - {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 2, 0}, - {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 3, 0}, - {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 100, 0}, + {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 0, TCHAR, 0}, + {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 1, TCHAR, 0}, + {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 2, TCHAR, 0}, + {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 3, TCHAR, 0}, + {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 100, TCHAR, 0}, - {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 0, 0}, - {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 1, 0}, - {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 2, 0}, - {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 3, 0}, - {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 100, 0}, + {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 0, TCHAR, 0}, + {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 1, TCHAR, 0}, + {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 2, TCHAR, 0}, + {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 3, TCHAR, 0}, + {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 100, TCHAR, 0}, - {{NULL, 0}, {NULL, 0}, 0, 0} + {{NULL, 0}, {NULL, 0}, 0, 0, 0} }; static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mb3_unicode_ci[]= { - {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 0, 0}, - {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 1, 0}, - {{CSTR("ss")}, {CSTR("s" "\x00" "s")}/*IF*/, 2, 1}, - {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 3, 0}, - {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 4, 0}, - {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 100, 0}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 0, TCHAR, 0}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 1, TCHAR, 0}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}/*IF*/, 2, TCHAR, 1}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 3, TCHAR, 0}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 4, TCHAR, 0}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 100, TCHAR, 0}, - {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, 0}, - {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, -1}, - {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, 0}, - {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, 0}, - {{CSTR("ss")}, {CSTR(UTF8_sz)}, 4, 0}, - {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, TCHAR, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, TCHAR, -1}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, TCHAR, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, TCHAR, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 4, TCHAR, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, TCHAR, 0}, - {{NULL, 0}, {NULL, 0}, 0, 0} + {{NULL, 0}, {NULL, 0}, 0, 0, 0} }; static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mb3_unicode_nopad_ci[]= { - {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 0, 0}, - {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 1, 0}, - {{CSTR("ss")}, {CSTR("s" "\x00" "s")}/*IF*/, 2, 1}, - {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 3, 1}, - {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 4, 1}, - {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 100, 1}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 0, TCHAR, 0}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 1, TCHAR, 0}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}/*IF*/, 2, TCHAR, 1}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 3, TCHAR, 1}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 4, TCHAR, 1}, + {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 100, TCHAR, 1}, - {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, 0}, - {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, -1}, - {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, -1}, - {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, -1}, - {{CSTR("ss")}, {CSTR(UTF8_sz)}, 4, -1}, - {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, -1}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, TCHAR, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, TCHAR, -1}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, TCHAR, -1}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, TCHAR, -1}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 4, TCHAR, -1}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, TCHAR, -1}, - {{NULL, 0}, {NULL, 0}, 0, 0} + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, TVCHAR, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, TVCHAR, -1}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, TVCHAR, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, TVCHAR, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 4, TVCHAR, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, TVCHAR, 0}, + + {{NULL, 0}, {NULL, 0}, 0, 0, 0} }; static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mb3_danish_ci[]= { - {{CSTR("aa")}, {CSTR("")}, 0, 0}, - {{CSTR("aa")}/*CF*/, {CSTR("")}, 1, 1}, - {{CSTR("aa")}, {CSTR("")}, 2, 1}, - {{CSTR("aa")}, {CSTR("")}, 3, 1}, - {{CSTR("aa")}, {CSTR("")}, 100, 1}, + {{CSTR("aa")}, {CSTR("")}, 0, TCHAR, 0}, + {{CSTR("aa")}/*CF*/, {CSTR("")}, 1, TCHAR, 1}, + {{CSTR("aa")}, {CSTR("")}, 2, TCHAR, 1}, + {{CSTR("aa")}, {CSTR("")}, 3, TCHAR, 1}, + {{CSTR("aa")}, {CSTR("")}, 100, TCHAR, 1}, - {{CSTR("aa")}, {CSTR("a")}, 0, 0}, - {{CSTR("aa")}/*CF*/, {CSTR("a")}, 1, 0}, - {{CSTR("aa")}, {CSTR("a")}, 2, 1}, - {{CSTR("aa")}, {CSTR("a")}, 3, 1}, - {{CSTR("aa")}, {CSTR("a")}, 100, 1}, + {{CSTR("aa")}, {CSTR("a")}, 0, TCHAR, 0}, + {{CSTR("aa")}/*CF*/, {CSTR("a")}, 1, TCHAR, 0}, + {{CSTR("aa")}, {CSTR("a")}, 2, TCHAR, 1}, + {{CSTR("aa")}, {CSTR("a")}, 3, TCHAR, 1}, + {{CSTR("aa")}, {CSTR("a")}, 100, TCHAR, 1}, - {{CSTR("aa")}, {CSTR("aa")}, 0, 0}, - {{CSTR("aa")}/*CF*/, {CSTR("aa")}/*CF*/, 1, 0}, - {{CSTR("aa")}, {CSTR("aa")}, 2, 0}, - {{CSTR("aa")}, {CSTR("aa")}, 3, 0}, - {{CSTR("aa")}, {CSTR("aa")}, 100, 0}, + {{CSTR("aa")}, {CSTR("aa")}, 0, TCHAR, 0}, + {{CSTR("aa")}/*CF*/, {CSTR("aa")}/*CF*/, 1, TCHAR, 0}, + {{CSTR("aa")}, {CSTR("aa")}, 2, TCHAR, 0}, + {{CSTR("aa")}, {CSTR("aa")}, 3, TCHAR, 0}, + {{CSTR("aa")}, {CSTR("aa")}, 100, TCHAR, 0}, - {{CSTR("aa")}, {CSTR("\x00" "a")}, 0, 0}, - {{CSTR("aa")}/*CF*/, {CSTR("\x00" "a")}/*IF*/, 1, 1}, - {{CSTR("aa")}, {CSTR("\x00" "a")}, 2, 1}, - {{CSTR("aa")}, {CSTR("\x00" "a")}, 3, 1}, - {{CSTR("aa")}, {CSTR("\x00" "a")}, 100, 1}, + {{CSTR("aa")}, {CSTR("\x00" "a")}, 0, TCHAR, 0}, + {{CSTR("aa")}/*CF*/, {CSTR("\x00" "a")}/*IF*/, 1, TCHAR, 1}, + {{CSTR("aa")}, {CSTR("\x00" "a")}, 2, TCHAR, 1}, + {{CSTR("aa")}, {CSTR("\x00" "a")}, 3, TCHAR, 1}, + {{CSTR("aa")}, {CSTR("\x00" "a")}, 100, TCHAR, 1}, - {{CSTR("aa")}, {CSTR("\x00" "aa")}, 0, 0}, - {{CSTR("aa")}/*CF*/, {CSTR("\x00" "aa")}/*IF*/, 1, 1}, - {{CSTR("aa")}, {CSTR("\x00" "aa")}/*IF*/, 2, 1}, - {{CSTR("aa")}, {CSTR("\x00" "aa")}, 3, 0}, - {{CSTR("aa")}, {CSTR("\x00" "aa")}, 100, 0}, + {{CSTR("aa")}, {CSTR("\x00" "aa")}, 0, TCHAR, 0}, + {{CSTR("aa")}/*CF*/, {CSTR("\x00" "aa")}/*IF*/, 1, TCHAR, 1}, + {{CSTR("aa")}, {CSTR("\x00" "aa")}/*IF*/, 2, TCHAR, 1}, + {{CSTR("aa")}, {CSTR("\x00" "aa")}, 3, TCHAR, 0}, + {{CSTR("aa")}, {CSTR("\x00" "aa")}, 100, TCHAR, 0}, - {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 0, 0}, - {{CSTR("aa")}/*CF*/, {CSTR("a" "\x00" "a")}, 1, 0}, - {{CSTR("aa")}, {CSTR("a" "\x00" "a")}/*IF*/, 2, 1}, - {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 3, 1}, - {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 100, 1}, + {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 0, TCHAR, 0}, + {{CSTR("aa")}/*CF*/, {CSTR("a" "\x00" "a")}, 1, TCHAR, 0}, + {{CSTR("aa")}, {CSTR("a" "\x00" "a")}/*IF*/, 2, TCHAR, 1}, + {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 3, TCHAR, 1}, + {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 100, TCHAR, 1}, - {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 0, 0}, - {{CSTR("aa")}/*CF*/, {CSTR(UTF8_ARING)}, 1, -1}, - {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 2, 0}, - {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 3, 0}, - {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 100, 0}, + {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 0, TCHAR, 0}, + {{CSTR("aa")}/*CF*/, {CSTR(UTF8_ARING)}, 1, TCHAR, -1}, + {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 2, TCHAR, 0}, + {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 3, TCHAR, 0}, + {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 100, TCHAR, 0}, - {{NULL, 0}, {NULL, 0}, 0, 0} + {{NULL, 0}, {NULL, 0}, 0, 0, 0} }; static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_latin1_german2_ci[]= { - {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 0, 0}, - {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 1, -1}, - {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 2, 0}, - {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 3, 0}, - {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 100, 0}, + {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 0, TCHAR, 0}, + {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 1, TCHAR, -1}, + {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 2, TCHAR, 0}, + {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 3, TCHAR, 0}, + {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 100, TCHAR, 0}, - {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 0, 0}, - {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 1, -1}, - {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 2, 0}, - {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 3, 0}, - {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 100, 0}, + {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 0, TCHAR, 0}, + {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 1, TCHAR, -1}, + {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 2, TCHAR, 0}, + {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 3, TCHAR, 0}, + {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 100, TCHAR, 0}, - {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 0, 0}, - {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 1, -1}, - {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 2, 0}, - {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 3, 0}, - {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 100, 0}, + {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 0, TCHAR, 0}, + {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 1, TCHAR, -1}, + {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 2, TCHAR, 0}, + {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 3, TCHAR, 0}, + {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 100, TCHAR, 0}, - {{NULL, 0}, {NULL, 0}, 0, 0} + {{NULL, 0}, {NULL, 0}, 0, 0, 0} }; static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mbx_german2_ci[]= { - {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, 0}, - {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, -1}, - {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, 0}, - {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, 0}, - {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, TCHAR, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, TCHAR, -1}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, TCHAR, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, TCHAR, 0}, + {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, TCHAR, 0}, - {{CSTR("ae")}, {CSTR(UTF8_auml)}, 0, 0}, - {{CSTR("ae")}, {CSTR(UTF8_auml)}, 1, -1}, - {{CSTR("ae")}, {CSTR(UTF8_auml)}, 2, 0}, - {{CSTR("ae")}, {CSTR(UTF8_auml)}, 3, 0}, - {{CSTR("ae")}, {CSTR(UTF8_auml)}, 100, 0}, + {{CSTR("ae")}, {CSTR(UTF8_auml)}, 0, TCHAR, 0}, + {{CSTR("ae")}, {CSTR(UTF8_auml)}, 1, TCHAR, -1}, + {{CSTR("ae")}, {CSTR(UTF8_auml)}, 2, TCHAR, 0}, + {{CSTR("ae")}, {CSTR(UTF8_auml)}, 3, TCHAR, 0}, + {{CSTR("ae")}, {CSTR(UTF8_auml)}, 100, TCHAR, 0}, - {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 0, 0}, - {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 1, -1}, - {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 2, 0}, - {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 3, 0}, - {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 100, 0}, + {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 0, TCHAR, 0}, + {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 1, TCHAR, -1}, + {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 2, TCHAR, 0}, + {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 3, TCHAR, 0}, + {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 100, TCHAR, 0}, - {{NULL, 0}, {NULL, 0}, 0, 0} + {{NULL, 0}, {NULL, 0}, 0, 0, 0} }; static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_mbminlen1_xpad_czech[]= { - {{CSTR("c")}, {CSTR("ch")}, 0, 0}, - {{CSTR("c")}, {CSTR("ch")}, 1, 0}, - {{CSTR("c")}, {CSTR("ch")}, 2, -1}, + {{CSTR("c")}, {CSTR("ch")}, 0, TCHAR, 0}, + {{CSTR("c")}, {CSTR("ch")}, 1, TCHAR, 0}, + {{CSTR("c")}, {CSTR("ch")}, 2, TCHAR, -1}, - {{CSTR("h")}, {CSTR("ch")}, 0, 0}, - {{CSTR("h")}, {CSTR("ch")}, 1, 1}, - {{CSTR("h")}, {CSTR("ch")}, 2, -1}, + {{CSTR("h")}, {CSTR("ch")}, 0, TCHAR, 0}, + {{CSTR("h")}, {CSTR("ch")}, 1, TCHAR, 1}, + {{CSTR("h")}, {CSTR("ch")}, 2, TCHAR, -1}, - {{CSTR("i")}, {CSTR("ch")}, 0, 0}, - {{CSTR("i")}, {CSTR("ch")}, 1, 1}, - {{CSTR("i")}, {CSTR("ch")}, 2, 1}, + {{CSTR("i")}, {CSTR("ch")}, 0, TCHAR, 0}, + {{CSTR("i")}, {CSTR("ch")}, 1, TCHAR, 1}, + {{CSTR("i")}, {CSTR("ch")}, 2, TCHAR, 1}, - {{NULL, 0}, {NULL, 0}, 0, 0} + {{NULL, 0}, {NULL, 0}, 0, 0, 0} }; static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_mbminlen2_xpad_common[]= { - {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 0, 0}, - {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 1, 0}, - {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 2, 0}, - {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 3, 0}, - {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 100, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 0, TCHAR, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 1, TCHAR, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 2, TCHAR, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 3, TCHAR, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 100, TCHAR, 0}, - {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 0, 0}, - {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 1, 0}, - {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 2, 0}, - {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 3, 0}, - {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 100, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 0, TCHAR, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 1, TCHAR, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 2, TCHAR, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 3, TCHAR, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 100, TCHAR, 0}, - {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 0, 0}, - {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 1, 0}, - {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 2, 0}, - {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 3, 0}, - {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 100, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 0, TCHAR, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 1, TCHAR, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 2, TCHAR, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 3, TCHAR, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 100, TCHAR, 0}, - {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 0, 0}, - {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 1, 0}, - {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 2, -1}, - {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 3, -1}, - {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 100, -1}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 0, TCHAR, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 1, TCHAR, 0}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 2, TCHAR, -1}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 3, TCHAR, -1}, + {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 100, TCHAR, -1}, - {{NULL, 0}, {NULL, 0}, 0, 0} + {{NULL, 0}, {NULL, 0}, 0, 0, 0} }; @@ -1082,7 +1094,7 @@ strnncollsp_char_one(CHARSET_INFO *cs, const STRNNCOLLSP_CHAR_PARAM *p) int res= cs->coll->strnncollsp_nchars(cs, (uchar *) p->a.str, p->a.length, (uchar *) p->b.str, p->b.length, - p->nchars); + p->nchars, p->flags); str2hex(ahex, sizeof(ahex), p->a.str, p->a.length); str2hex(bhex, sizeof(bhex), p->b.str, p->b.length); diag("%-25s %-12s %-12s %3d %7d %7d%s", @@ -1098,7 +1110,7 @@ strnncollsp_char_one(CHARSET_INFO *cs, const STRNNCOLLSP_CHAR_PARAM *p) res= cs->coll->strnncollsp_nchars(cs, (uchar *) p->b.str, p->b.length, (uchar *) p->a.str, p->a.length, - p->nchars); + p->nchars, p->flags); if (!eqres(res, -p->res)) { diag("Comparison in reverse order failed. Expected %d, got %d", From 0269d82d5309c4dc2022ac8dd4d6945699e0ea69 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Fri, 10 Mar 2023 18:02:14 +0300 Subject: [PATCH 094/260] ANALYZE FORMAT=JSON: Backport block-nl-join.r_unpack_time_ms from 11.0 +fix MDEV-30830. Also fix it to work with hashed join (MDEV-30830). Reviewed by: Monty --- mysql-test/include/analyze-format.inc | 2 +- mysql-test/main/analyze_format_json.result | 7 ++ .../main/analyze_format_json_timings.result | 89 +++++++++++++++++++ .../main/analyze_format_json_timings.test | 77 ++++++++++++++++ mysql-test/main/analyze_stmt_orderby.result | 2 + mysql-test/main/except.result | 4 + mysql-test/main/except_all.result | 4 + mysql-test/main/explain_json.result | 1 + mysql-test/main/intersect.result | 2 + mysql-test/main/intersect_all.result | 2 + mysql-test/main/rowid_filter_innodb.result | 2 + sql/sql_explain.cc | 3 + sql/sql_explain.h | 10 ++- sql/sql_join_cache.cc | 6 +- sql/sql_select.cc | 4 +- sql/sql_select.h | 1 + 16 files changed, 210 insertions(+), 6 deletions(-) create mode 100644 mysql-test/main/analyze_format_json_timings.result create mode 100644 mysql-test/main/analyze_format_json_timings.test diff --git a/mysql-test/include/analyze-format.inc b/mysql-test/include/analyze-format.inc index 7e18524e44e..330be82ef96 100644 --- a/mysql-test/include/analyze-format.inc +++ b/mysql-test/include/analyze-format.inc @@ -1,3 +1,3 @@ # The time on ANALYSE FORMAT=JSON is rather variable ---replace_regex /("(r_total_time_ms|r_table_time_ms|r_other_time_ms|r_buffer_size|r_filling_time_ms)": )[^, \n]*/\1"REPLACED"/ +--replace_regex /("(r_[a-z_]*_time_ms|r_buffer_size)": )[^, \n]*/\1"REPLACED"/ diff --git a/mysql-test/main/analyze_format_json.result b/mysql-test/main/analyze_format_json.result index abe3fab4643..2329ef2ce60 100644 --- a/mysql-test/main/analyze_format_json.result +++ b/mysql-test/main/analyze_format_json.result @@ -153,6 +153,7 @@ ANALYZE "join_type": "BNL", "r_loops": 20, "r_filtered": 100, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 60 } } @@ -196,6 +197,7 @@ ANALYZE "attached_condition": "tbl1.c > tbl2.c", "r_loops": 20, "r_filtered": 15.83333333, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 60 } } @@ -658,6 +660,7 @@ ANALYZE "attached_condition": "(t2.b,t2.b in (subquery#2))", "r_loops": 2, "r_filtered": null, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 0 }, "subqueries": [ @@ -750,6 +753,7 @@ ANALYZE "join_type": "BNL", "r_loops": 2, "r_filtered": null, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 0 }, "subqueries": [ @@ -784,6 +788,7 @@ ANALYZE "attached_condition": "t2.f2 = t3.f3", "r_loops": 0, "r_filtered": null, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": null } } @@ -921,6 +926,7 @@ ANALYZE "attached_condition": "t10.b = t11.b", "r_loops": 100, "r_filtered": 0.424285714, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 700 } } @@ -973,6 +979,7 @@ ANALYZE "attached_condition": "t10.b = t11.b", "r_loops": 100, "r_filtered": 100, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 2.97 } } diff --git a/mysql-test/main/analyze_format_json_timings.result b/mysql-test/main/analyze_format_json_timings.result new file mode 100644 index 00000000000..4d8a65ae0e7 --- /dev/null +++ b/mysql-test/main/analyze_format_json_timings.result @@ -0,0 +1,89 @@ +# +# MDEV-30830: ANALYZE FORMAT=JSON: r_unpack_time_ms is empty for the hashed joins +# +# +# First, check a regular BNL-join +# +create table t1 ( +a int, +b int +); +insert into t1 select seq, seq/3 from seq_0_to_99; +create table t2 ( +a int, +b int +); +insert into t2 select seq, seq/5 from seq_0_to_99; +set @js='$out'; +set @out=(select json_extract(@js,'$**.block-nl-join.r_unpack_time_ms')); +select cast(json_extract(@out,'$[0]') as DOUBLE) > 0; +cast(json_extract(@out,'$[0]') as DOUBLE) > 0 +1 +drop table t1,t2; +# +# Now, check the hashed, BNL-H join +# +create table t1 ( +a int, +b int +); +insert into t1 select seq, seq/3 from seq_0_to_499; +create table t2 ( +a int, +b int +); +insert into t2 select seq, seq/5 from seq_0_to_499; +set @tmp=@@join_cache_level, join_cache_level=6; +select '$out' as X; +X +{ + "query_block": { + "select_id": 1, + "r_loops": 1, + "r_total_time_ms": "REPLACED", + "table": { + "table_name": "t1", + "access_type": "ALL", + "r_loops": 1, + "rows": 500, + "r_rows": 500, + "r_table_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 100, + "attached_condition": "t1.a < 700 and t1.b is not null" + }, + "block-nl-join": { + "table": { + "table_name": "t2", + "access_type": "hash_ALL", + "key": "#hash#$hj", + "key_length": "5", + "used_key_parts": ["b"], + "ref": ["test.t1.b"], + "r_loops": 1, + "rows": 500, + "r_rows": 500, + "r_table_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 20, + "attached_condition": "t2.a < 100" + }, + "buffer_type": "flat", + "buffer_size": "18Kb", + "join_type": "BNLH", + "attached_condition": "t2.b = t1.b", + "r_loops": 500, + "r_filtered": 100, + "r_unpack_time_ms": "REPLACED", + "r_effective_rows": 0.594 + } + } +} +set @out=(select json_extract(@js,'$**.block-nl-join.r_unpack_time_ms')); +select cast(json_extract(@out,'$[0]') as DOUBLE) > 0; +cast(json_extract(@out,'$[0]') as DOUBLE) > 0 +1 +set join_cache_level=@tmp; +drop table t1, t2; diff --git a/mysql-test/main/analyze_format_json_timings.test b/mysql-test/main/analyze_format_json_timings.test new file mode 100644 index 00000000000..fdb4c8d5989 --- /dev/null +++ b/mysql-test/main/analyze_format_json_timings.test @@ -0,0 +1,77 @@ +# +# Tests to check that r_something_time_ms is non-zero in +# ANALYZE FORMAT=JSON +# +--source include/default_optimizer_switch.inc +--source include/have_sequence.inc + +# The tests here are large so that we get non-zero timings +--source include/big_test.inc + +--echo # +--echo # MDEV-30830: ANALYZE FORMAT=JSON: r_unpack_time_ms is empty for the hashed joins +--echo # + +--echo # +--echo # First, check a regular BNL-join +--echo # +create table t1 ( + a int, + b int +); +insert into t1 select seq, seq/3 from seq_0_to_99; + +create table t2 ( + a int, + b int +); +insert into t2 select seq, seq/5 from seq_0_to_99; + +let $out=` +analyze format=json +select * from t1, t2 +where + t1.a < 700 and + t2.a < 100 + and t1.b=t2.b +`; + +evalp set @js='$out'; +set @out=(select json_extract(@js,'$**.block-nl-join.r_unpack_time_ms')); +select cast(json_extract(@out,'$[0]') as DOUBLE) > 0; +drop table t1,t2; + +--echo # +--echo # Now, check the hashed, BNL-H join +--echo # +create table t1 ( + a int, + b int +); +insert into t1 select seq, seq/3 from seq_0_to_499; + +create table t2 ( + a int, + b int +); +insert into t2 select seq, seq/5 from seq_0_to_499; +set @tmp=@@join_cache_level, join_cache_level=6; + +let $out=` +analyze format=json +select * from t1, t2 +where + t1.a < 700 and + t2.a < 100 + and t1.b=t2.b +`; + +--source include/analyze-format.inc +evalp select '$out' as X; + +set @out=(select json_extract(@js,'$**.block-nl-join.r_unpack_time_ms')); +select cast(json_extract(@out,'$[0]') as DOUBLE) > 0; + +set join_cache_level=@tmp; +drop table t1, t2; + diff --git a/mysql-test/main/analyze_stmt_orderby.result b/mysql-test/main/analyze_stmt_orderby.result index d6aeeafeb73..c615d1e7d5f 100644 --- a/mysql-test/main/analyze_stmt_orderby.result +++ b/mysql-test/main/analyze_stmt_orderby.result @@ -443,6 +443,7 @@ ANALYZE "attached_condition": "t3.a = t0.a", "r_loops": 10, "r_filtered": 10, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 10 } } @@ -520,6 +521,7 @@ ANALYZE "attached_condition": "t5.a = t6.a", "r_loops": 4, "r_filtered": 21.42857143, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 7 } } diff --git a/mysql-test/main/except.result b/mysql-test/main/except.result index bf92ceaafea..67fee0bcabf 100644 --- a/mysql-test/main/except.result +++ b/mysql-test/main/except.result @@ -336,6 +336,7 @@ ANALYZE "join_type": "BNL", "r_loops": 2, "r_filtered": 100, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 2 } } @@ -374,6 +375,7 @@ ANALYZE "join_type": "BNL", "r_loops": 2, "r_filtered": 100, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 2 } } @@ -441,6 +443,7 @@ ANALYZE "join_type": "BNL", "r_loops": 2, "r_filtered": 100, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 2 } } @@ -479,6 +482,7 @@ ANALYZE "join_type": "BNL", "r_loops": 2, "r_filtered": 100, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 2 } } diff --git a/mysql-test/main/except_all.result b/mysql-test/main/except_all.result index 6224be8021a..70b52f13161 100644 --- a/mysql-test/main/except_all.result +++ b/mysql-test/main/except_all.result @@ -455,6 +455,7 @@ ANALYZE "join_type": "BNL", "r_loops": 3, "r_filtered": 100, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 3 } } @@ -493,6 +494,7 @@ ANALYZE "join_type": "BNL", "r_loops": 2, "r_filtered": 100, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 3 } } @@ -559,6 +561,7 @@ ANALYZE "join_type": "BNL", "r_loops": 3, "r_filtered": 100, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 3 } } @@ -597,6 +600,7 @@ ANALYZE "join_type": "BNL", "r_loops": 2, "r_filtered": 100, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 3 } } diff --git a/mysql-test/main/explain_json.result b/mysql-test/main/explain_json.result index 3c3ee55e59e..3976d14913b 100644 --- a/mysql-test/main/explain_json.result +++ b/mysql-test/main/explain_json.result @@ -1546,6 +1546,7 @@ ANALYZE "mrr_type": "Rowid-ordered scan", "r_loops": 10, "r_filtered": 100, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 1 } } diff --git a/mysql-test/main/intersect.result b/mysql-test/main/intersect.result index 149e67850e0..d491aab03ff 100644 --- a/mysql-test/main/intersect.result +++ b/mysql-test/main/intersect.result @@ -397,6 +397,7 @@ ANALYZE "join_type": "BNL", "r_loops": 3, "r_filtered": 100, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 3 } } @@ -482,6 +483,7 @@ ANALYZE "join_type": "BNL", "r_loops": 3, "r_filtered": 100, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 3 } } diff --git a/mysql-test/main/intersect_all.result b/mysql-test/main/intersect_all.result index d046a5ea881..89420280133 100644 --- a/mysql-test/main/intersect_all.result +++ b/mysql-test/main/intersect_all.result @@ -428,6 +428,7 @@ ANALYZE "join_type": "BNL", "r_loops": 5, "r_filtered": 100, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 7 } } @@ -513,6 +514,7 @@ ANALYZE "join_type": "BNL", "r_loops": 5, "r_filtered": 100, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 7 } } diff --git a/mysql-test/main/rowid_filter_innodb.result b/mysql-test/main/rowid_filter_innodb.result index 113d4d0cb22..e20d5aacfea 100644 --- a/mysql-test/main/rowid_filter_innodb.result +++ b/mysql-test/main/rowid_filter_innodb.result @@ -3687,6 +3687,7 @@ ANALYZE "attached_condition": "a.atp = 1", "r_loops": 3, "r_filtered": 100, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 1 }, "block-nl-join": { @@ -3713,6 +3714,7 @@ ANALYZE "attached_condition": "fi.fh in (6311439873746261694,-397087483897438286,8518228073041491534,-5420422472375069774)", "r_loops": 3, "r_filtered": 40, + "r_unpack_time_ms": "REPLACED", "r_effective_rows": 26.66666667 } } diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc index caec818d130..e8f77317c84 100644 --- a/sql/sql_explain.cc +++ b/sql/sql_explain.cc @@ -1898,6 +1898,9 @@ void Explain_table_access::print_explain_json(Explain_query *query, writer->add_double(jbuf_tracker.get_filtered_after_where()*100.0); else writer->add_null(); + + writer->add_member("r_unpack_time_ms"); + writer->add_double(jbuf_unpack_tracker.get_time_ms()); /* effective_rows is average number of matches we got for an incoming row. The row is stored in the join buffer and then is read diff --git a/sql/sql_explain.h b/sql/sql_explain.h index 746e1db1abd..a80d4049e4c 100644 --- a/sql/sql_explain.h +++ b/sql/sql_explain.h @@ -722,7 +722,7 @@ public: class Explain_table_access : public Sql_alloc { public: - Explain_table_access(MEM_ROOT *root) : + Explain_table_access(MEM_ROOT *root, bool timed) : derived_select_number(0), non_merged_sjm_number(0), extra_tags(root), @@ -735,6 +735,7 @@ public: pushed_index_cond(NULL), sjm_nest(NULL), pre_join_sort(NULL), + jbuf_unpack_tracker(timed), rowid_filter(NULL) {} ~Explain_table_access() { delete sjm_nest; } @@ -844,7 +845,12 @@ public: /* When using join buffer: Track the reads from join buffer */ Table_access_tracker jbuf_tracker; - + + /* + Track the time to unpack rows from the join buffer. + */ + Time_and_counter_tracker jbuf_unpack_tracker; + /* When using join buffer: Track the number of incoming record combinations */ Counter_tracker jbuf_loops_tracker; diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index c7b6a0bf6e4..36eae30de16 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -1614,7 +1614,7 @@ bool JOIN_CACHE::get_record() pos+= referenced_fields*size_of_fld_ofs; if (prev_cache) prev_cache->get_record_by_pos(prev_rec_ptr); - } + } return res; } @@ -2389,7 +2389,9 @@ enum_nested_loop_state JOIN_CACHE::join_matching_records(bool skip_last) (join_tab->first_inner && !not_exists_opt_is_applicable) || !skip_next_candidate_for_match(rec_ptr)) { - read_next_candidate_for_match(rec_ptr); + ANALYZE_START_TRACKING(join->thd, join_tab->jbuf_unpack_tracker); + read_next_candidate_for_match(rec_ptr); + ANALYZE_STOP_TRACKING(join->thd, join_tab->jbuf_unpack_tracker); rc= generate_full_extensions(rec_ptr); if (rc != NESTED_LOOP_OK && rc != NESTED_LOOP_NO_MORE_ROWS) goto finish; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2889d757e20..4abf9f2fad6 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -27396,6 +27396,7 @@ bool JOIN_TAB::save_explain_data(Explain_table_access *eta, tracker= &eta->tracker; jbuf_tracker= &eta->jbuf_tracker; jbuf_loops_tracker= &eta->jbuf_loops_tracker; + jbuf_unpack_tracker= &eta->jbuf_unpack_tracker; /* Enable the table access time tracker only for "ANALYZE stmt" */ if (thd->lex->analyze_stmt) @@ -28029,7 +28030,8 @@ int JOIN::save_explain_data_intern(Explain_query *output, Explain_table_access *eta= (new (output->mem_root) - Explain_table_access(output->mem_root)); + Explain_table_access(output->mem_root, + thd->lex->analyze_stmt)); if (!eta) DBUG_RETURN(1); diff --git a/sql/sql_select.h b/sql/sql_select.h index 178573413af..043c414d016 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -309,6 +309,7 @@ typedef struct st_join_table { Table_access_tracker *tracker; Table_access_tracker *jbuf_tracker; + Time_and_counter_tracker *jbuf_unpack_tracker; Counter_tracker *jbuf_loops_tracker; /* Bitmap of TAB_INFO_* bits that encodes special line for EXPLAIN 'Extra' From 31536b2477a744ea99f012b6d42adc6591565341 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Fri, 31 Mar 2023 16:16:53 +0300 Subject: [PATCH 095/260] MDEV-30972: ANALYZE FORMAT=JSON: some time is unaccounted-for in BNL-H join After MDEV-30830 has added block-nl-join.r_unpack_time_ms, it became apparent that there is some unaccounted-for time in BNL join operation, namely the time that is spent after unpacking the join buffer record. Fix this by adding a Gap_time_tracker to track the time that is spent after unpacking the join buffer record and before any next time tracking. The collected time is printed in block-nl-join.r_other_time_ms. Reviewed by: Monty --- mysql-test/main/analyze_format_json.result | 7 ++ .../main/analyze_format_json_timings.result | 82 +++++++++++++++++++ .../main/analyze_format_json_timings.test | 50 +++++++++++ mysql-test/main/analyze_stmt_orderby.result | 2 + mysql-test/main/except.result | 4 + mysql-test/main/except_all.result | 4 + mysql-test/main/explain_json.result | 1 + mysql-test/main/intersect.result | 2 + mysql-test/main/intersect_all.result | 2 + mysql-test/main/rowid_filter_innodb.result | 2 + sql/sql_analyze_stmt.h | 15 ++-- sql/sql_explain.cc | 3 + sql/sql_explain.h | 11 ++- sql/sql_select.cc | 4 +- 14 files changed, 180 insertions(+), 9 deletions(-) diff --git a/mysql-test/main/analyze_format_json.result b/mysql-test/main/analyze_format_json.result index 2329ef2ce60..b9f275af742 100644 --- a/mysql-test/main/analyze_format_json.result +++ b/mysql-test/main/analyze_format_json.result @@ -154,6 +154,7 @@ ANALYZE "r_loops": 20, "r_filtered": 100, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 60 } } @@ -198,6 +199,7 @@ ANALYZE "r_loops": 20, "r_filtered": 15.83333333, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 60 } } @@ -661,6 +663,7 @@ ANALYZE "r_loops": 2, "r_filtered": null, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 0 }, "subqueries": [ @@ -754,6 +757,7 @@ ANALYZE "r_loops": 2, "r_filtered": null, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 0 }, "subqueries": [ @@ -789,6 +793,7 @@ ANALYZE "r_loops": 0, "r_filtered": null, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": null } } @@ -927,6 +932,7 @@ ANALYZE "r_loops": 100, "r_filtered": 0.424285714, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 700 } } @@ -980,6 +986,7 @@ ANALYZE "r_loops": 100, "r_filtered": 100, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 2.97 } } diff --git a/mysql-test/main/analyze_format_json_timings.result b/mysql-test/main/analyze_format_json_timings.result index 4d8a65ae0e7..6cced9ec6b1 100644 --- a/mysql-test/main/analyze_format_json_timings.result +++ b/mysql-test/main/analyze_format_json_timings.result @@ -77,6 +77,7 @@ X "r_loops": 500, "r_filtered": 100, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 0.594 } } @@ -87,3 +88,84 @@ cast(json_extract(@out,'$[0]') as DOUBLE) > 0 1 set join_cache_level=@tmp; drop table t1, t2; +# +# MDEV-30972: ANALYZE FORMAT=JSON: some time is unaccounted-for in BNL-H join +# +create table t1 ( +a int, +col1 varchar(100), +col2 varchar(100), +col3 varchar(100) +); +insert into t1 select +seq/100, +concat('col1-', seq), +concat('col1-', seq), +concat('col1-', seq) +from seq_1_to_1000; +create table t2 ( +a int, +col1 varchar(100), +col2 varchar(100), +col3 varchar(100) +); +insert into t2 select +seq/100, +concat('col1-', seq), +concat('col1-', seq), +concat('col1-', seq) +from seq_1_to_2000; +set @tmp=@@join_cache_level, join_cache_level=6; +select '$out' as X; +X +{ + "query_block": { + "select_id": 1, + "r_loops": 1, + "r_total_time_ms": "REPLACED", + "table": { + "table_name": "t1", + "access_type": "ALL", + "r_loops": 1, + "rows": 1000, + "r_rows": 1000, + "r_table_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 100, + "attached_condition": "t1.a is not null" + }, + "block-nl-join": { + "table": { + "table_name": "t2", + "access_type": "hash_ALL", + "key": "#hash#$hj", + "key_length": "5", + "used_key_parts": ["a"], + "ref": ["test.t1.a"], + "r_loops": 1, + "rows": 2000, + "r_rows": 2000, + "r_table_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 100 + }, + "buffer_type": "flat", + "buffer_size": "256Kb", + "join_type": "BNLH", + "attached_condition": "t2.a = t1.a and concat(t1.col1,t1.col2,t1.col3) = concat(t2.col1,t2.col2,t2.col3)", + "r_loops": 1000, + "r_filtered": 1.025630506, + "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", + "r_effective_rows": 97.501 + } + } +} +set @out=(select json_extract(@js,'$**.block-nl-join.r_other_time_ms')); +select cast(json_extract(@out,'$[0]') as DOUBLE) > 0; +cast(json_extract(@out,'$[0]') as DOUBLE) > 0 +1 +set join_cache_level=@tmp; +drop table t1, t2; diff --git a/mysql-test/main/analyze_format_json_timings.test b/mysql-test/main/analyze_format_json_timings.test index fdb4c8d5989..fe02c318388 100644 --- a/mysql-test/main/analyze_format_json_timings.test +++ b/mysql-test/main/analyze_format_json_timings.test @@ -75,3 +75,53 @@ select cast(json_extract(@out,'$[0]') as DOUBLE) > 0; set join_cache_level=@tmp; drop table t1, t2; +--echo # +--echo # MDEV-30972: ANALYZE FORMAT=JSON: some time is unaccounted-for in BNL-H join +--echo # + +create table t1 ( + a int, + col1 varchar(100), + col2 varchar(100), + col3 varchar(100) +); + +insert into t1 select + seq/100, + concat('col1-', seq), + concat('col1-', seq), + concat('col1-', seq) +from seq_1_to_1000; + +create table t2 ( + a int, + col1 varchar(100), + col2 varchar(100), + col3 varchar(100) +); + +insert into t2 select + seq/100, + concat('col1-', seq), + concat('col1-', seq), + concat('col1-', seq) +from seq_1_to_2000; + +set @tmp=@@join_cache_level, join_cache_level=6; + +let $out=` +analyze format=json +select * from t1, t2 +where + t1.a=t2.a + and concat(t1.col1, t1.col2, t1.col3)= concat(t2.col1, t2.col2, t2.col3) +`; +--source include/analyze-format.inc +evalp select '$out' as X; + +set @out=(select json_extract(@js,'$**.block-nl-join.r_other_time_ms')); +select cast(json_extract(@out,'$[0]') as DOUBLE) > 0; + +set join_cache_level=@tmp; +drop table t1, t2; + diff --git a/mysql-test/main/analyze_stmt_orderby.result b/mysql-test/main/analyze_stmt_orderby.result index c615d1e7d5f..7f03e2b2673 100644 --- a/mysql-test/main/analyze_stmt_orderby.result +++ b/mysql-test/main/analyze_stmt_orderby.result @@ -444,6 +444,7 @@ ANALYZE "r_loops": 10, "r_filtered": 10, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 10 } } @@ -522,6 +523,7 @@ ANALYZE "r_loops": 4, "r_filtered": 21.42857143, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 7 } } diff --git a/mysql-test/main/except.result b/mysql-test/main/except.result index 67fee0bcabf..5614ab18bf0 100644 --- a/mysql-test/main/except.result +++ b/mysql-test/main/except.result @@ -337,6 +337,7 @@ ANALYZE "r_loops": 2, "r_filtered": 100, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 2 } } @@ -376,6 +377,7 @@ ANALYZE "r_loops": 2, "r_filtered": 100, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 2 } } @@ -444,6 +446,7 @@ ANALYZE "r_loops": 2, "r_filtered": 100, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 2 } } @@ -483,6 +486,7 @@ ANALYZE "r_loops": 2, "r_filtered": 100, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 2 } } diff --git a/mysql-test/main/except_all.result b/mysql-test/main/except_all.result index 70b52f13161..113c161a98b 100644 --- a/mysql-test/main/except_all.result +++ b/mysql-test/main/except_all.result @@ -456,6 +456,7 @@ ANALYZE "r_loops": 3, "r_filtered": 100, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 3 } } @@ -495,6 +496,7 @@ ANALYZE "r_loops": 2, "r_filtered": 100, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 3 } } @@ -562,6 +564,7 @@ ANALYZE "r_loops": 3, "r_filtered": 100, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 3 } } @@ -601,6 +604,7 @@ ANALYZE "r_loops": 2, "r_filtered": 100, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 3 } } diff --git a/mysql-test/main/explain_json.result b/mysql-test/main/explain_json.result index 3976d14913b..c3cff36626d 100644 --- a/mysql-test/main/explain_json.result +++ b/mysql-test/main/explain_json.result @@ -1547,6 +1547,7 @@ ANALYZE "r_loops": 10, "r_filtered": 100, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 1 } } diff --git a/mysql-test/main/intersect.result b/mysql-test/main/intersect.result index d491aab03ff..25d81a7fc34 100644 --- a/mysql-test/main/intersect.result +++ b/mysql-test/main/intersect.result @@ -398,6 +398,7 @@ ANALYZE "r_loops": 3, "r_filtered": 100, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 3 } } @@ -484,6 +485,7 @@ ANALYZE "r_loops": 3, "r_filtered": 100, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 3 } } diff --git a/mysql-test/main/intersect_all.result b/mysql-test/main/intersect_all.result index 89420280133..da5d778daab 100644 --- a/mysql-test/main/intersect_all.result +++ b/mysql-test/main/intersect_all.result @@ -429,6 +429,7 @@ ANALYZE "r_loops": 5, "r_filtered": 100, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 7 } } @@ -515,6 +516,7 @@ ANALYZE "r_loops": 5, "r_filtered": 100, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 7 } } diff --git a/mysql-test/main/rowid_filter_innodb.result b/mysql-test/main/rowid_filter_innodb.result index e20d5aacfea..c5a27f8b60e 100644 --- a/mysql-test/main/rowid_filter_innodb.result +++ b/mysql-test/main/rowid_filter_innodb.result @@ -3688,6 +3688,7 @@ ANALYZE "r_loops": 3, "r_filtered": 100, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 1 }, "block-nl-join": { @@ -3715,6 +3716,7 @@ ANALYZE "r_loops": 3, "r_filtered": 40, "r_unpack_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", "r_effective_rows": 26.66666667 } } diff --git a/sql/sql_analyze_stmt.h b/sql/sql_analyze_stmt.h index fdbd5955f33..e2037279a7a 100644 --- a/sql/sql_analyze_stmt.h +++ b/sql/sql_analyze_stmt.h @@ -63,14 +63,19 @@ protected: if (my_gap_tracker) attach_gap_time_tracker(thd, my_gap_tracker, end); } + + /* + The time spent after stop_tracking() call on this object and any + subsequent time tracking call will be billed to this tracker. + */ + Gap_time_tracker *my_gap_tracker; public: Exec_time_tracker() : count(0), cycles(0), my_gap_tracker(NULL) {} - /* - The time spent between stop_tracking() call on this object and any - other time measurement will be billed to this tracker. - */ - Gap_time_tracker *my_gap_tracker; + void set_gap_tracker(Gap_time_tracker *gap_tracker) + { + my_gap_tracker= gap_tracker; + } // interface for collecting time void start_tracking(THD *thd) diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc index e8f77317c84..2874417d8df 100644 --- a/sql/sql_explain.cc +++ b/sql/sql_explain.cc @@ -1901,6 +1901,9 @@ void Explain_table_access::print_explain_json(Explain_query *query, writer->add_member("r_unpack_time_ms"); writer->add_double(jbuf_unpack_tracker.get_time_ms()); + + writer->add_member("r_other_time_ms"). + add_double(jbuf_extra_time_tracker.get_time_ms()); /* effective_rows is average number of matches we got for an incoming row. The row is stored in the join buffer and then is read diff --git a/sql/sql_explain.h b/sql/sql_explain.h index a80d4049e4c..84e2b1db89a 100644 --- a/sql/sql_explain.h +++ b/sql/sql_explain.h @@ -846,11 +846,16 @@ public: /* When using join buffer: Track the reads from join buffer */ Table_access_tracker jbuf_tracker; - /* - Track the time to unpack rows from the join buffer. - */ + /* When using join buffer: time spent unpacking rows from the join buffer */ Time_and_counter_tracker jbuf_unpack_tracker; + /* + When using join buffer: time spent after unpacking rows from the join + buffer. This will capture the time spent checking the Join Condition: + the condition that depends on this table and preceding tables. + */ + Gap_time_tracker jbuf_extra_time_tracker; + /* When using join buffer: Track the number of incoming record combinations */ Counter_tracker jbuf_loops_tracker; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 4abf9f2fad6..8769a03404d 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -27402,7 +27402,9 @@ bool JOIN_TAB::save_explain_data(Explain_table_access *eta, if (thd->lex->analyze_stmt) { table->file->set_time_tracker(&eta->op_tracker); - eta->op_tracker.my_gap_tracker = &eta->extra_time_tracker; + eta->op_tracker.set_gap_tracker(&eta->extra_time_tracker); + + eta->jbuf_unpack_tracker.set_gap_tracker(&eta->jbuf_extra_time_tracker); } /* No need to save id and select_type here, they are kept in Explain_select */ From afdf19cf3303bf3797fe47e5cef398227134cc32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 4 Apr 2023 03:11:41 +0200 Subject: [PATCH 096/260] MDEV-28641 : Query cache entries not invalidated on slave of a Galera cluster Query cache should be invalidated if we are not in applier. For some reason this condition was incorrect starting from 10.5 but it is correct in 10.4. Signed-off-by: Julius Goryavsky --- mysql-test/suite/galera/galera_2x2nodes.cnf | 77 +++++++++++ .../r/galera_query_cache_invalidate.result | 119 +++++++++++++++++ .../t/galera_query_cache_invalidate.cnf | 25 ++++ .../t/galera_query_cache_invalidate.test | 120 ++++++++++++++++++ sql/log_event_server.cc | 3 +- 5 files changed, 343 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/galera/galera_2x2nodes.cnf create mode 100644 mysql-test/suite/galera/r/galera_query_cache_invalidate.result create mode 100644 mysql-test/suite/galera/t/galera_query_cache_invalidate.cnf create mode 100644 mysql-test/suite/galera/t/galera_query_cache_invalidate.test diff --git a/mysql-test/suite/galera/galera_2x2nodes.cnf b/mysql-test/suite/galera/galera_2x2nodes.cnf new file mode 100644 index 00000000000..922906eac6f --- /dev/null +++ b/mysql-test/suite/galera/galera_2x2nodes.cnf @@ -0,0 +1,77 @@ +# Use default setting for mysqld processes +!include include/default_mysqld.cnf + +[mysqld] +loose-innodb +log-bin=mysqld-bin +log-slave-updates +binlog-format=row +innodb-autoinc-lock-mode=2 +default-storage-engine=innodb +wsrep_gtid_mode=1 +gtid_ignore_duplicates +auto_increment_increment=3 + +wsrep-provider=@ENV.WSREP_PROVIDER +# enforce read-committed characteristics across the cluster +# wsrep-causal-reads=ON +wsrep-sync-wait=15 + +[mysqld.1] +wsrep-on=1 +#galera_port=@OPT.port +#ist_port=@OPT.port +#sst_port=@OPT.port +wsrep_cluster_address=gcomm:// +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' +wsrep_node_address='127.0.0.1:@mysqld.1.#galera_port' +wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port +wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' + +[mysqld.2] +wsrep-on=1 +#galera_port=@OPT.port +#ist_port=@OPT.port +#sst_port=@OPT.port +wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' +wsrep_node_address='127.0.0.1:@mysqld.2.#galera_port' +wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port +wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port' + +[mysqld.3] +wsrep-on=1 +#galera_port=@OPT.port +#ist_port=@OPT.port +#sst_port=@OPT.port +wsrep_cluster_address=gcomm:// +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' +wsrep_node_address='127.0.0.1:@mysqld.3.#galera_port' +wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port +wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port' + +[mysqld.4] +wsrep-on=1 +#galera_port=@OPT.port +#ist_port=@OPT.port +#sst_port=@OPT.port +wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.3.#galera_port' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.4.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' +wsrep_node_address='127.0.0.1:@mysqld.4.#galera_port' +wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port +wsrep_sst_receive_address='127.0.0.1:@mysqld.4.#sst_port' + +[ENV] +NODE_MYPORT_1= @mysqld.1.port +NODE_MYSOCK_1= @mysqld.1.socket + +NODE_MYPORT_2= @mysqld.2.port +NODE_MYSOCK_2= @mysqld.2.socket + +NODE_MYPORT_3= @mysqld.3.port +NODE_MYSOCK_3= @mysqld.3.socket + +NODE_MYPORT_4= @mysqld.4.port +NODE_MYSOCK_4= @mysqld.4.socket + + diff --git a/mysql-test/suite/galera/r/galera_query_cache_invalidate.result b/mysql-test/suite/galera/r/galera_query_cache_invalidate.result new file mode 100644 index 00000000000..98438b3b527 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_query_cache_invalidate.result @@ -0,0 +1,119 @@ +connection node_2; +connection node_1; +connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; +connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4; +connection node_2; +call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node."); +connection node_4; +call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node."); +connection node_3; +CHANGE MASTER TO master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_1, master_use_gtid=current_pos;; +START SLAVE; +include/wait_for_slave_to_start.inc +connection node_1; +CREATE TABLE t1 (id bigint primary key, msg varchar(100)) engine=innodb; +SET AUTOCOMMIT=1; +INSERT INTO t1 VALUES (4000000, 'foobar'); +SELECT COUNT(*) FROM t1; +COUNT(*) +50001 +connection node_3; +connection node_1; +# node_1 +SELECT * FROM t1 WHERE msg='foobar'; +id msg +4000000 foobar +SELECT * FROM t1 WHERE msg='foobar'; +id msg +4000000 foobar +connection node_2; +# node_2 +SELECT * FROM t1 WHERE msg='foobar'; +id msg +4000000 foobar +SELECT * FROM t1 WHERE msg='foobar'; +id msg +4000000 foobar +connection node_3; +# node_3 +SELECT * FROM t1 WHERE msg='foobar'; +id msg +4000000 foobar +SELECT * FROM t1 WHERE msg='foobar'; +id msg +4000000 foobar +connection node_4; +# node_4 +SELECT * FROM t1 WHERE msg='foobar'; +id msg +4000000 foobar +SELECT * FROM t1 WHERE msg='foobar'; +id msg +4000000 foobar +connection node_1; +# node_1 insert new +INSERT INTO t1 values (5000000, 'foobar'); +connection node_3; +SELECT * FROM t1 WHERE msg='foobar'; +id msg +4000000 foobar +5000000 foobar +SELECT * FROM t1 WHERE msg='foobar'; +id msg +4000000 foobar +5000000 foobar +connection node_2; +# node_2 +SELECT * FROM t1 WHERE msg='foobar'; +id msg +4000000 foobar +5000000 foobar +SELECT * FROM t1 WHERE msg='foobar'; +id msg +4000000 foobar +5000000 foobar +connection node_3; +# node_3 +SELECT * FROM t1 WHERE msg='foobar'; +id msg +4000000 foobar +5000000 foobar +SELECT * FROM t1 WHERE msg='foobar'; +id msg +4000000 foobar +5000000 foobar +connection node_4; +# node_4 +SELECT * FROM t1 WHERE msg='foobar'; +id msg +4000000 foobar +5000000 foobar +SELECT * FROM t1 WHERE msg='foobar'; +id msg +4000000 foobar +5000000 foobar +connection node_2; +# node_3 different query same table +SELECT id, msg FROM t1 WHERE msg='foobar'; +id msg +4000000 foobar +5000000 foobar +connection node_4; +# node_6 different query same table +SELECT id, msg FROM t1 WHERE msg='foobar'; +id msg +4000000 foobar +5000000 foobar +connection node_1; +drop table t1; +connection node_3; +connection node_3; +STOP SLAVE; +RESET SLAVE ALL; +connection node_1; +SET SESSION WSREP_ON=OFF; +RESET MASTER; +SET SESSION WSREP_ON=ON; +disconnect node_2; +disconnect node_1; +# End of test diff --git a/mysql-test/suite/galera/t/galera_query_cache_invalidate.cnf b/mysql-test/suite/galera/t/galera_query_cache_invalidate.cnf new file mode 100644 index 00000000000..49269422a35 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_query_cache_invalidate.cnf @@ -0,0 +1,25 @@ +!include ../galera_2x2nodes.cnf + +[mysqld.1] +wsrep_gtid_domain_id=1 +server-id=11 +query_cache_type=1 +query_cache_size=15M + +[mysqld.2] +wsrep_gtid_domain_id=1 +server-id=12 +query_cache_type=1 +query_cache_size=15M + +[mysqld.3] +wsrep_gtid_domain_id=2 +server-id=13 +query_cache_type=1 +query_cache_size=15M + +[mysqld.4] +wsrep_gtid_domain_id=2 +server-id=21 +query_cache_type=1 +query_cache_size=15M diff --git a/mysql-test/suite/galera/t/galera_query_cache_invalidate.test b/mysql-test/suite/galera/t/galera_query_cache_invalidate.test new file mode 100644 index 00000000000..d72d8a9ba40 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_query_cache_invalidate.test @@ -0,0 +1,120 @@ +--source include/big_test.inc +--source include/force_restart.inc +--source include/galera_cluster.inc +--source include/have_sequence.inc + +# +# MDEV-28641 : Query cache entries not invalidated on slave of a Galera cluster +# +# We use two 2-node galera clusters as follows +# +# A(1) <-> B(2) {Galera cluster 1} +# | {Async replication} +# D(3) <-> E(4) {Galera cluster 2} +# +# Normal asyncronous replication is used between nodes 1 and 3 +# so that node_1 is master and node_3 a slave. +# +# In this test we can't test is some query fast or slow but we can +# test does all nodes see all rows (this is not true before fix) +# +--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 +--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4 + +--connection node_2 +call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node."); +--connection node_4 +call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node."); + +--connection node_3 + +--replace_result $NODE_MYPORT_1 NODE_MYPORT_1 +--eval CHANGE MASTER TO master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_1, master_use_gtid=current_pos; +START SLAVE; +--source include/wait_for_slave_to_start.inc + +--connection node_1 + +CREATE TABLE t1 (id bigint primary key, msg varchar(100)) engine=innodb; +--disable_query_log +INSERT INTO t1 SELECT seq, md5(rand()) from seq_1_to_50000; +COMMIT; +--enable_query_log +SET AUTOCOMMIT=1; +INSERT INTO t1 VALUES (4000000, 'foobar'); +SELECT COUNT(*) FROM t1; +--sync_slave_with_master node_3 + +# +# All nodes should see one row and first query is slow and second fast +# +--connection node_1 +--echo # node_1 +SELECT * FROM t1 WHERE msg='foobar'; +SELECT * FROM t1 WHERE msg='foobar'; +--connection node_2 +--echo # node_2 +SELECT * FROM t1 WHERE msg='foobar'; +SELECT * FROM t1 WHERE msg='foobar'; +--connection node_3 +--echo # node_3 +SELECT * FROM t1 WHERE msg='foobar'; +SELECT * FROM t1 WHERE msg='foobar'; +--connection node_4 +--echo # node_4 +SELECT * FROM t1 WHERE msg='foobar'; +SELECT * FROM t1 WHERE msg='foobar'; +# +# Insert a new row in master, this should cause query cache +# invalidation +# +--connection node_1 +--echo # node_1 insert new +INSERT INTO t1 values (5000000, 'foobar'); +--sync_slave_with_master node_3 + +# +# All nodes should see 2 rows +# +SELECT * FROM t1 WHERE msg='foobar'; +SELECT * FROM t1 WHERE msg='foobar'; + +--connection node_2 +--echo # node_2 +SELECT * FROM t1 WHERE msg='foobar'; +SELECT * FROM t1 WHERE msg='foobar'; +--connection node_3 +--echo # node_3 +SELECT * FROM t1 WHERE msg='foobar'; +SELECT * FROM t1 WHERE msg='foobar'; +--connection node_4 +--echo # node_4 +SELECT * FROM t1 WHERE msg='foobar'; +SELECT * FROM t1 WHERE msg='foobar'; + +--connection node_2 +--echo # node_3 different query same table +SELECT id, msg FROM t1 WHERE msg='foobar'; + +--connection node_4 +--echo # node_6 different query same table +SELECT id, msg FROM t1 WHERE msg='foobar'; + +# +# Cleanup +# +--connection node_1 +drop table t1; +--sync_slave_with_master node_3 + +--connection node_3 +STOP SLAVE; +RESET SLAVE ALL; + +--connection node_1 +SET SESSION WSREP_ON=OFF; +RESET MASTER; +SET SESSION WSREP_ON=ON; + +--source include/galera_end.inc +--echo # End of test diff --git a/sql/log_event_server.cc b/sql/log_event_server.cc index 56d1c978ac4..c5fb637a000 100644 --- a/sql/log_event_server.cc +++ b/sql/log_event_server.cc @@ -5586,7 +5586,8 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi) to avoid query cache being polluted with stale entries, */ # ifdef WITH_WSREP - if (!WSREP(thd) && !wsrep_thd_is_applying(thd)) + /* Query cache is not invalidated on wsrep applier here */ + if (!(WSREP(thd) && wsrep_thd_is_applying(thd))) # endif /* WITH_WSREP */ query_cache.invalidate_locked_for_write(thd, rgi->tables_to_lock); #endif /* HAVE_QUERY_CACHE */ From 8f9bb82640578054feeb67a775410989d28626a3 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 31 Mar 2023 05:41:00 +0400 Subject: [PATCH 097/260] MDEV-30971 Add a new system variable aria_data_home_dir --- .../suite/maria/aria_log_dir_path.result | 29 +++++++++ mysql-test/suite/maria/aria_log_dir_path.test | 65 +++++++++++++++++++ mysql-test/suite/maria/maria3.result | 1 + .../sys_vars/r/aria_log_dir_path_basic.result | 36 ++++++++++ .../suite/sys_vars/r/sysvars_aria.result | 12 ++++ .../sys_vars/r/sysvars_server_embedded.result | 10 +++ .../r/sysvars_server_notembedded.result | 10 +++ .../sys_vars/t/aria_log_dir_path_basic.test | 35 ++++++++++ mysql-test/suite/sys_vars/t/sysvars_aria.test | 4 ++ storage/maria/ha_maria.cc | 2 +- 10 files changed, 203 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/maria/aria_log_dir_path.result create mode 100644 mysql-test/suite/maria/aria_log_dir_path.test create mode 100644 mysql-test/suite/sys_vars/r/aria_log_dir_path_basic.result create mode 100644 mysql-test/suite/sys_vars/t/aria_log_dir_path_basic.test diff --git a/mysql-test/suite/maria/aria_log_dir_path.result b/mysql-test/suite/maria/aria_log_dir_path.result new file mode 100644 index 00000000000..0a4201544a5 --- /dev/null +++ b/mysql-test/suite/maria/aria_log_dir_path.result @@ -0,0 +1,29 @@ +# +# MDEV-30971 Add a new system variable aria_data_home_dir +# +# restart: --loose-aria-log-file-size=8388608 --loose-aria-log-dir-path=MYSQLTEST_VARDIR/tmp/aria_log_dir_path_1 +SET @@global.aria_log_purge_type=external; +SHOW VARIABLES LIKE 'aria_log_file_size'; +Variable_name Value +aria_log_file_size 8388608 +SELECT @@aria_log_dir_path; +@@aria_log_dir_path +MYSQLTEST_VARDIR/tmp/aria_log_dir_path_1 +SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/; +SHOW ENGINE aria logs; +Type Name Status +Aria aria_log.00000001 in use +CREATE TABLE t1 (id INT, txt LONGTEXT) ENGINE=Aria; +BEGIN NOT ATOMIC +FOR id IN 0..9 DO +INSERT INTO test.t1 (id, txt) VALUES (id, REPEAT(id,1024*1024)); +END FOR; +END; +$$ +SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/; +SHOW ENGINE aria logs; +Type Name Status +Aria aria_log.00000001 free +Aria aria_log.00000002 in use +DROP TABLE t1; +# restart diff --git a/mysql-test/suite/maria/aria_log_dir_path.test b/mysql-test/suite/maria/aria_log_dir_path.test new file mode 100644 index 00000000000..bc0a31a76b9 --- /dev/null +++ b/mysql-test/suite/maria/aria_log_dir_path.test @@ -0,0 +1,65 @@ +--source include/have_maria.inc +--let $datadir= `SELECT @@datadir` + +--echo # +--echo # MDEV-30971 Add a new system variable aria_data_home_dir +--echo # + +--let $ARIA_LOGDIR=$MYSQLTEST_VARDIR/tmp/aria_log_dir_path_1 +--mkdir $ARIA_LOGDIR +--let $restart_parameters=--loose-aria-log-file-size=8388608 --loose-aria-log-dir-path=$ARIA_LOGDIR +--source include/restart_mysqld.inc + +# +# Test that: +# - aria_log_dir_path is set to a non-default directory. +# - New Aria log files are created in the non-default directory. +# - The contents of the log directory (according to "file_exists" commands) +# is in sync with the "SHOW ENGINE aria logs" ouput. +# + +# Prevent automatic purge +SET @@global.aria_log_purge_type=external; + +SHOW VARIABLES LIKE 'aria_log_file_size'; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +SELECT @@aria_log_dir_path; + + +SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/; +--file_exists $ARIA_LOGDIR/aria_log_control +--file_exists $ARIA_LOGDIR/aria_log.00000001 +--error 1 +--file_exists $ARIA_LOGDIR/aria_log.00000002 +--replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/ +SHOW ENGINE aria logs; + + +CREATE TABLE t1 (id INT, txt LONGTEXT) ENGINE=Aria; +DELIMITER $$; +BEGIN NOT ATOMIC + FOR id IN 0..9 DO + INSERT INTO test.t1 (id, txt) VALUES (id, REPEAT(id,1024*1024)); + END FOR; +END; +$$ +DELIMITER ;$$ + + +SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/; +--file_exists $ARIA_LOGDIR/aria_log_control +--file_exists $ARIA_LOGDIR/aria_log.00000001 +--file_exists $ARIA_LOGDIR/aria_log.00000002 +--error 1 +--file_exists $ARIA_LOGDIR/aria_log.00000003 +--replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/ +SHOW ENGINE aria logs; + +DROP TABLE t1; + +--let $restart_parameters= +--source include/restart_mysqld.inc +--remove_file $ARIA_LOGDIR/aria_log_control +--remove_file $ARIA_LOGDIR/aria_log.00000001 +--remove_file $ARIA_LOGDIR/aria_log.00000002 +--rmdir $ARIA_LOGDIR diff --git a/mysql-test/suite/maria/maria3.result b/mysql-test/suite/maria/maria3.result index 47a6ecaf4bb..4d64033a9c9 100644 --- a/mysql-test/suite/maria/maria3.result +++ b/mysql-test/suite/maria/maria3.result @@ -311,6 +311,7 @@ aria_encrypt_tables # aria_force_start_after_recovery_failures # aria_group_commit # aria_group_commit_interval # +aria_log_dir_path # aria_log_file_size # aria_log_purge_type # aria_max_sort_file_size # diff --git a/mysql-test/suite/sys_vars/r/aria_log_dir_path_basic.result b/mysql-test/suite/sys_vars/r/aria_log_dir_path_basic.result new file mode 100644 index 00000000000..8563b024a75 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/aria_log_dir_path_basic.result @@ -0,0 +1,36 @@ +SELECT COUNT(@@GLOBAL.aria_log_dir_path); +COUNT(@@GLOBAL.aria_log_dir_path) +1 +SET @@GLOBAL.aria_log_dir_path=1; +ERROR HY000: Variable 'aria_log_dir_path' is a read only variable +SELECT COUNT(@@GLOBAL.aria_log_dir_path); +COUNT(@@GLOBAL.aria_log_dir_path) +1 +SELECT @@GLOBAL.aria_log_dir_path = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='aria_log_dir_path'; +@@GLOBAL.aria_log_dir_path = VARIABLE_VALUE +1 +SELECT COUNT(@@GLOBAL.aria_log_dir_path); +COUNT(@@GLOBAL.aria_log_dir_path) +1 +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='aria_log_dir_path'; +COUNT(VARIABLE_VALUE) +1 +SELECT @@aria_log_dir_path = @@GLOBAL.aria_log_dir_path; +@@aria_log_dir_path = @@GLOBAL.aria_log_dir_path +1 +SELECT COUNT(@@aria_log_dir_path); +COUNT(@@aria_log_dir_path) +1 +SELECT COUNT(@@local.aria_log_dir_path); +ERROR HY000: Variable 'aria_log_dir_path' is a GLOBAL variable +SELECT COUNT(@@SESSION.aria_log_dir_path); +ERROR HY000: Variable 'aria_log_dir_path' is a GLOBAL variable +SELECT COUNT(@@GLOBAL.aria_log_dir_path); +COUNT(@@GLOBAL.aria_log_dir_path) +1 +SELECT aria_log_dir_path = @@SESSION.aria_log_dir_path; +ERROR 42S22: Unknown column 'aria_log_dir_path' in 'field list' diff --git a/mysql-test/suite/sys_vars/r/sysvars_aria.result b/mysql-test/suite/sys_vars/r/sysvars_aria.result index 7b74c85b6da..9f5585668b6 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_aria.result +++ b/mysql-test/suite/sys_vars/r/sysvars_aria.result @@ -85,6 +85,18 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED +VARIABLE_NAME ARIA_LOG_DIR_PATH +SESSION_VALUE NULL +DEFAULT_VALUE DATADIR +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE VARCHAR +VARIABLE_COMMENT Path to the directory where to store transactional log +NUMERIC_MIN_VALUE NULL +NUMERIC_MAX_VALUE NULL +NUMERIC_BLOCK_SIZE NULL +ENUM_VALUE_LIST NULL +READ_ONLY YES +COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME ARIA_LOG_FILE_SIZE SESSION_VALUE NULL DEFAULT_VALUE 1073741824 diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result index 9e562426291..9454f1b9d96 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result @@ -102,6 +102,16 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED +VARIABLE_NAME ARIA_LOG_DIR_PATH +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE VARCHAR +VARIABLE_COMMENT Path to the directory where to store transactional log +NUMERIC_MIN_VALUE NULL +NUMERIC_MAX_VALUE NULL +NUMERIC_BLOCK_SIZE NULL +ENUM_VALUE_LIST NULL +READ_ONLY YES +COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME ARIA_LOG_FILE_SIZE VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index b9e4aac3288..27e5daf7615 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -102,6 +102,16 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED +VARIABLE_NAME ARIA_LOG_DIR_PATH +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE VARCHAR +VARIABLE_COMMENT Path to the directory where to store transactional log +NUMERIC_MIN_VALUE NULL +NUMERIC_MAX_VALUE NULL +NUMERIC_BLOCK_SIZE NULL +ENUM_VALUE_LIST NULL +READ_ONLY YES +COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME ARIA_LOG_FILE_SIZE VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED diff --git a/mysql-test/suite/sys_vars/t/aria_log_dir_path_basic.test b/mysql-test/suite/sys_vars/t/aria_log_dir_path_basic.test new file mode 100644 index 00000000000..f09705e6f0d --- /dev/null +++ b/mysql-test/suite/sys_vars/t/aria_log_dir_path_basic.test @@ -0,0 +1,35 @@ +--source include/have_maria.inc + +SELECT COUNT(@@GLOBAL.aria_log_dir_path); +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +SET @@GLOBAL.aria_log_dir_path=1; + +SELECT COUNT(@@GLOBAL.aria_log_dir_path); + + +SELECT @@GLOBAL.aria_log_dir_path = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='aria_log_dir_path'; + +SELECT COUNT(@@GLOBAL.aria_log_dir_path); + +SELECT COUNT(VARIABLE_VALUE) +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='aria_log_dir_path'; + + +SELECT @@aria_log_dir_path = @@GLOBAL.aria_log_dir_path; + + +SELECT COUNT(@@aria_log_dir_path); + +--Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT COUNT(@@local.aria_log_dir_path); + +--Error ER_INCORRECT_GLOBAL_LOCAL_VAR +SELECT COUNT(@@SESSION.aria_log_dir_path); + +SELECT COUNT(@@GLOBAL.aria_log_dir_path); + +--Error ER_BAD_FIELD_ERROR +SELECT aria_log_dir_path = @@SESSION.aria_log_dir_path; diff --git a/mysql-test/suite/sys_vars/t/sysvars_aria.test b/mysql-test/suite/sys_vars/t/sysvars_aria.test index b01e39eebf5..b042f1010f4 100644 --- a/mysql-test/suite/sys_vars/t/sysvars_aria.test +++ b/mysql-test/suite/sys_vars/t/sysvars_aria.test @@ -2,7 +2,11 @@ --source include/have_aria_used_for_temp_tables.inc --source include/word_size.inc +let datadir=`select @@datadir`; + --vertical_results + +--replace_result $datadir DATADIR select VARIABLE_NAME, SESSION_VALUE, DEFAULT_VALUE, VARIABLE_SCOPE, VARIABLE_TYPE, VARIABLE_COMMENT, NUMERIC_MIN_VALUE, NUMERIC_MAX_VALUE, NUMERIC_BLOCK_SIZE, ENUM_VALUE_LIST, READ_ONLY, COMMAND_LINE_ARGUMENT from information_schema.system_variables where variable_name like 'aria%' order by variable_name; diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 0c9db691ca5..2d6c8f85fe4 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -188,7 +188,7 @@ static MYSQL_SYSVAR_BOOL(page_checksum, maria_page_checksums, 0, /* It is only command line argument */ static MYSQL_SYSVAR_STR(log_dir_path, maria_data_root, - PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, "Path to the directory where to store transactional log", NULL, NULL, mysql_real_data_home); From 06393cd8f81e6c9a01e9ae1c8783a7f6dac21fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 4 Apr 2023 20:12:36 +0200 Subject: [PATCH 098/260] MDEV-29602 : Galera debug build crashes when the spider plugin is enabled Spider system tables should be created so that wsrep_on=OFF. Signed-off-by: Julius Goryavsky --- storage/spider/spd_table.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index 3dbc391b918..2ff97ce3577 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -10058,6 +10058,8 @@ void *spider_table_bg_sts_action( thd->mysys_var->current_cond = &thread->cond; thd->mysys_var->current_mutex = &thread->mutex; } + bool spd_wsrep_on = thd->variables.wsrep_on; + thd->variables.wsrep_on = false; while (spider_init_queries[i].length && !thd->killed && !thread->killed && thread->init_command) { @@ -10071,6 +10073,7 @@ void *spider_table_bg_sts_action( } ++i; } + thd->variables.wsrep_on = spd_wsrep_on; thd->mysys_var->current_cond = &thread->cond; thd->mysys_var->current_mutex = &thread->mutex; thd->client_capabilities -= CLIENT_MULTI_RESULTS; From 17caff92b51af08928911feb5c4ae23e4448575d Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 5 Apr 2023 10:47:32 +0400 Subject: [PATCH 099/260] MDEV-30997 SIGSEGV in __strlen_avx2 | make_date_time | Item_func_date_format::val_str my_locale_month_names_ka_GE[] has definitions for 11 months only. August was missing in a mistake. Fix: - Adding a definition for August - Adding tests for all abbreviated and full month and weekday names --- mysql-test/main/locale.result | 42 +++++++++++++++++++++++++++++++++++ mysql-test/main/locale.test | 26 ++++++++++++++++++++++ sql/sql_locale.cc | 16 ++++++++++++- 3 files changed, 83 insertions(+), 1 deletion(-) diff --git a/mysql-test/main/locale.result b/mysql-test/main/locale.result index 39f11053df6..b7f29439916 100644 --- a/mysql-test/main/locale.result +++ b/mysql-test/main/locale.result @@ -314,5 +314,47 @@ SELECT x; ERROR 42S22: უცნობი სვეტი 'x' 'field list'-ში SET lc_messages=DEFAULT; # +# MDEV-30997 SIGSEGV in __strlen_avx2 | make_date_time | Item_func_date_format::val_str +# +SET lc_messages=en_US; +SET lc_time_names=111; +SELECT DATE_FORMAT('1-12-01','%c %b %M'); +DATE_FORMAT('1-12-01','%c %b %M') +12 დეკ დეკემბერი +CREATE TABLE t1 (i INT); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12); +SELECT d, DATE_FORMAT(d, '%b') AS MONTH_ABBR, MONTHNAME(d) FROM +( +SELECT CAST(CONCAT('2001-', i, '-01') AS DATE) AS d FROM t1 +) d1 ORDER BY d; +d MONTH_ABBR MONTHNAME(d) +2001-01-01 იან იანვარი +2001-02-01 თებ თებერვალი +2001-03-01 მარ მარტი +2001-04-01 აპრ აპრილი +2001-05-01 მაი მაისი +2001-06-01 ივნ ივნისი +2001-07-01 ივლ ივლისი +2001-08-01 აგვ აგვისტო +2001-09-01 სექტ სექტემბერი +2001-10-01 ოქტ ოქტომბერი +2001-11-01 ნოე ნოემბერი +2001-12-01 დეკ დეკემბერი +SELECT d, WEEKDAY(d), DATE_FORMAT(d, '%a') AS DAY_ABBR, DAYNAME(d) FROM +( +SELECT CAST(CONCAT('2001-01-', i) AS DATE) AS d FROM t1 WHERE i BETWEEN 1 AND 7 +) d1 ORDER BY d; +d WEEKDAY(d) DAY_ABBR DAYNAME(d) +2001-01-01 0 ორშ ორშაბათი +2001-01-02 1 სამშ სამშაბათი +2001-01-03 2 ოთხშ ოთხშაბათი +2001-01-04 3 ხუთშ ხუთშაბათი +2001-01-05 4 პარ პარასკევი +2001-01-06 5 შაბ შაბათი +2001-01-07 6 კვ კვირა +DROP TABLE t1; +SET lc_time_names=DEFAULT; +SET lc_messages=DEFAULT; +# # End of 10.11 tests # diff --git a/mysql-test/main/locale.test b/mysql-test/main/locale.test index 9f4ceb270d9..251cae484f1 100644 --- a/mysql-test/main/locale.test +++ b/mysql-test/main/locale.test @@ -193,6 +193,32 @@ SELECT x; SET lc_messages=DEFAULT; + +--echo # +--echo # MDEV-30997 SIGSEGV in __strlen_avx2 | make_date_time | Item_func_date_format::val_str +--echo # + +SET lc_messages=en_US; +SET lc_time_names=111; +SELECT DATE_FORMAT('1-12-01','%c %b %M'); +CREATE TABLE t1 (i INT); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12); +SELECT d, DATE_FORMAT(d, '%b') AS MONTH_ABBR, MONTHNAME(d) FROM +( + SELECT CAST(CONCAT('2001-', i, '-01') AS DATE) AS d FROM t1 +) d1 ORDER BY d; + +SELECT d, WEEKDAY(d), DATE_FORMAT(d, '%a') AS DAY_ABBR, DAYNAME(d) FROM +( + SELECT CAST(CONCAT('2001-01-', i) AS DATE) AS d FROM t1 WHERE i BETWEEN 1 AND 7 +) d1 ORDER BY d; + + +DROP TABLE t1; +SET lc_time_names=DEFAULT; +SET lc_messages=DEFAULT; + + --echo # --echo # End of 10.11 tests --echo # diff --git a/sql/sql_locale.cc b/sql/sql_locale.cc index eb5e3fbbc5a..f2ca8c2da96 100644 --- a/sql/sql_locale.cc +++ b/sql/sql_locale.cc @@ -3320,7 +3320,21 @@ MY_LOCALE my_locale_rm_CH /***** LOCALE BEGIN ka_GE: Georgian - Georgia *****/ static const char *my_locale_month_names_ka_GE[13] = - {"იანვარი","თებერვალი","მარტი","აპრილი","მაისი","ივნისი","ივლისი","სექტემბერი","ოქტომბერი","ნოემბერი","დეკემბერი", NullS }; +{ + "იანვარი", // January + "თებერვალი", // February + "მარტი", // March + "აპრილი", // April + "მაისი", // May + "ივნისი", // June + "ივლისი", // July + "აგვისტო", // August + "სექტემბერი", // September + "ოქტომბერი", // October + "ნოემბერი", // November + "დეკემბერი", // December + NullS +}; static const char *my_locale_ab_month_names_ka_GE[13] = {"იან","თებ","მარ","აპრ","მაი","ივნ","ივლ","აგვ","სექტ","ოქტ","ნოე","დეკ", NullS }; From 79e27a6bf9e05eb2296e59a4ea4cd1334195faca Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 5 Apr 2023 23:34:03 +0200 Subject: [PATCH 100/260] MDEV-25887 "Got notification message from PID xxxx, but reception only permitted for main PID yyyy" in systemd during SST server has systemd support and calls sd_notify() to communicate the status to systemd. mariabackup links the whole server in, but it should not notify systemd, because it's not started or managed by systemd. --- extra/mariabackup/xtrabackup.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index 5e01e64f490..ad35749d0ff 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -113,6 +113,12 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA #define MB_CORRUPTED_PAGES_FILE "innodb_corrupted_pages" +// disable server's systemd notification code +extern "C" { +int sd_notify() { return 0; } +int sd_notifyf() { return 0; } +} + int sys_var_init(); /* === xtrabackup specific options === */ From fb72dfbf7fb52a4be12bad7f173baa71942fd558 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 6 Apr 2023 09:45:05 +0400 Subject: [PATCH 101/260] MDEV-30415 MDEV-30415 PERIOD false positive overlap wtih utf8mb4_unicode_nopad_ci The problem was earlier fixed by the patch for MDEV-30034. Adding MTR tests only. --- mysql-test/suite/period/r/overlaps.result | 98 +++++++++++++++++++ mysql-test/suite/period/t/overlaps.test | 110 ++++++++++++++++++++++ 2 files changed, 208 insertions(+) diff --git a/mysql-test/suite/period/r/overlaps.result b/mysql-test/suite/period/r/overlaps.result index 3ed8e1a0014..78b1ac18b8d 100644 --- a/mysql-test/suite/period/r/overlaps.result +++ b/mysql-test/suite/period/r/overlaps.result @@ -351,3 +351,101 @@ primary key(id, p without overlaps) ) engine=heap partition by hash(id); update t set id = 1; drop table t, t1; +# +# MDEV-30415 PERIOD false positive overlap wtih utf8mb4_unicode_nopad_ci +# +CREATE TABLE t1 ( +datetime_column_name_1 DATETIME(6) NOT NULL, +datetime_column_name_2 DATETIME(6) NOT NULL, +text_column_name TEXT COLLATE utf8mb4_unicode_nopad_ci NOT NULL, +PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2), +UNIQUE KEY index_name (text_column_name(191),period_name WITHOUT OVERLAPS) +) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, text_column_name) +VALUES +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'), +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '); +TRUNCATE TABLE t1; +INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, text_column_name) +VALUES +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '), +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'); +DROP TABLE t1; +CREATE TABLE `t1` ( +datetime_column_name_1 DATETIME(6) NOT NULL, +datetime_column_name_2 DATETIME(6) NOT NULL, +text_column_name TEXT COLLATE utf8mb4_unicode_nopad_ci NOT NULL, +PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2), +UNIQUE KEY index_name (text_column_name(191),period_name WITHOUT OVERLAPS) +) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +INSERT INTO t1 VALUES +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def '), +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def'); +TRUNCATE TABLE t1; +INSERT INTO t1 VALUES +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def'), +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def '), +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def '); +SELECT *, LENGTH(text_column_name) FROM t1; +datetime_column_name_1 datetime_column_name_2 text_column_name LENGTH(text_column_name) +2000-01-01 00:00:00.000000 2001-01-01 00:00:00.000000 def 3 +2000-01-01 00:00:00.000000 2001-01-01 00:00:00.000000 def 4 +2000-01-01 00:00:00.000000 2001-01-01 00:00:00.000000 def 5 +DROP TABLE t1; +CREATE TABLE t1 ( +datetime_column_name_1 DATETIME(6) NOT NULL, +datetime_column_name_2 DATETIME(6) NOT NULL, +text_column_name TEXT COLLATE utf8mb4_unicode_nopad_ci NOT NULL, +PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2), +UNIQUE KEY index_name (text_column_name(3),period_name WITHOUT OVERLAPS) +) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, text_column_name) +VALUES +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'), +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '); +ERROR 23000: Duplicate entry 'abc-2001-01-01 00:00:00.000000-2000-01-01 00:00:00.000000' for key 'index_name' +TRUNCATE TABLE t1; +INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, text_column_name) +VALUES +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '), +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'); +ERROR 23000: Duplicate entry 'abc-2001-01-01 00:00:00.000000-2000-01-01 00:00:00.000000' for key 'index_name' +DROP TABLE t1; +CREATE TABLE t1 ( +datetime_column_name_1 DATETIME(6) NOT NULL, +datetime_column_name_2 DATETIME(6) NOT NULL, +char_column_name CHAR(255) COLLATE utf8mb4_unicode_nopad_ci NOT NULL, +PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2), +UNIQUE KEY index_name (char_column_name(191),period_name WITHOUT OVERLAPS) +) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, char_column_name) +VALUES +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'), +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '); +ERROR 23000: Duplicate entry 'abc-2001-01-01 00:00:00.000000-2000-01-01 00:00:00.000000' for key 'index_name' +TRUNCATE TABLE t1; +INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, char_column_name) +VALUES +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '), +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'); +ERROR 23000: Duplicate entry 'abc-2001-01-01 00:00:00.000000-2000-01-01 00:00:00.000000' for key 'index_name' +DROP TABLE t1; +CREATE TABLE t1 ( +datetime_column_name_1 DATETIME(6) NOT NULL, +datetime_column_name_2 DATETIME(6) NOT NULL, +char_column_name CHAR(255) COLLATE utf8mb4_unicode_nopad_ci NOT NULL, +PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2), +UNIQUE KEY index_name (char_column_name(3),period_name WITHOUT OVERLAPS) +) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, char_column_name) +VALUES +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'), +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '); +ERROR 23000: Duplicate entry 'abc-2001-01-01 00:00:00.000000-2000-01-01 00:00:00.000000' for key 'index_name' +TRUNCATE TABLE t1; +INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, char_column_name) +VALUES +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '), +('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'); +ERROR 23000: Duplicate entry 'abc-2001-01-01 00:00:00.000000-2000-01-01 00:00:00.000000' for key 'index_name' +DROP TABLE t1; diff --git a/mysql-test/suite/period/t/overlaps.test b/mysql-test/suite/period/t/overlaps.test index 6cd78769d4a..4611aa15ddd 100644 --- a/mysql-test/suite/period/t/overlaps.test +++ b/mysql-test/suite/period/t/overlaps.test @@ -344,3 +344,113 @@ create or replace table t (id int, s date, e date, period for p(s,e), update t set id = 1; drop table t, t1; + +--echo # +--echo # MDEV-30415 PERIOD false positive overlap wtih utf8mb4_unicode_nopad_ci +--echo # + +# The originally reported script with a TEXT column (slightly modified) +CREATE TABLE t1 ( + datetime_column_name_1 DATETIME(6) NOT NULL, + datetime_column_name_2 DATETIME(6) NOT NULL, + text_column_name TEXT COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2), + UNIQUE KEY index_name (text_column_name(191),period_name WITHOUT OVERLAPS) +) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, text_column_name) +VALUES + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'), + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '); +TRUNCATE TABLE t1; +INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, text_column_name) +VALUES + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '), + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'); +DROP TABLE t1; + + +# The script reported by Alice with a TEXT column +CREATE TABLE `t1` ( + datetime_column_name_1 DATETIME(6) NOT NULL, + datetime_column_name_2 DATETIME(6) NOT NULL, + text_column_name TEXT COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2), + UNIQUE KEY index_name (text_column_name(191),period_name WITHOUT OVERLAPS) +) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +INSERT INTO t1 VALUES + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def '), + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def'); +TRUNCATE TABLE t1; +INSERT INTO t1 VALUES + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def'), + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def '), + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def '); +--sorted_result +SELECT *, LENGTH(text_column_name) FROM t1; +DROP TABLE t1; + + +# A TEXT column with a short prefix +CREATE TABLE t1 ( + datetime_column_name_1 DATETIME(6) NOT NULL, + datetime_column_name_2 DATETIME(6) NOT NULL, + text_column_name TEXT COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2), + UNIQUE KEY index_name (text_column_name(3),period_name WITHOUT OVERLAPS) +) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +--error ER_DUP_ENTRY +INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, text_column_name) +VALUES + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'), + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '); +TRUNCATE TABLE t1; +--error ER_DUP_ENTRY +INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, text_column_name) +VALUES + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '), + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'); +DROP TABLE t1; + + +# A CHAR with a long prefix +CREATE TABLE t1 ( + datetime_column_name_1 DATETIME(6) NOT NULL, + datetime_column_name_2 DATETIME(6) NOT NULL, + char_column_name CHAR(255) COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2), + UNIQUE KEY index_name (char_column_name(191),period_name WITHOUT OVERLAPS) +) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +--error ER_DUP_ENTRY +INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, char_column_name) +VALUES + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'), + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '); +TRUNCATE TABLE t1; +--error ER_DUP_ENTRY +INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, char_column_name) +VALUES + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '), + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'); +DROP TABLE t1; + + +# A CHAR column with a short prefix +CREATE TABLE t1 ( + datetime_column_name_1 DATETIME(6) NOT NULL, + datetime_column_name_2 DATETIME(6) NOT NULL, + char_column_name CHAR(255) COLLATE utf8mb4_unicode_nopad_ci NOT NULL, + PERIOD FOR period_name (datetime_column_name_1, datetime_column_name_2), + UNIQUE KEY index_name (char_column_name(3),period_name WITHOUT OVERLAPS) +) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci; +--error ER_DUP_ENTRY +INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, char_column_name) +VALUES + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'), + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '); +TRUNCATE TABLE t1; +--error ER_DUP_ENTRY +INSERT INTO t1 (datetime_column_name_1, datetime_column_name_2, char_column_name) +VALUES + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc '), + ('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'); +DROP TABLE t1; From 54715a1074a0c9fc12a5d52152df73826a484df7 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 6 Apr 2023 09:57:58 +0400 Subject: [PATCH 102/260] MDEV-30072 Wrong ORDER BY for a partitioned prefix key + NOPAD This problem was earlier fixed by MDEV-30034. Adding MTR tests only. --- mysql-test/main/ctype_uca_partitions.result | 40 +++++++++++++++++++++ mysql-test/main/ctype_uca_partitions.test | 32 +++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/mysql-test/main/ctype_uca_partitions.result b/mysql-test/main/ctype_uca_partitions.result index d7b79046b34..373fe914527 100644 --- a/mysql-test/main/ctype_uca_partitions.result +++ b/mysql-test/main/ctype_uca_partitions.result @@ -84,3 +84,43 @@ O P Y DROP TABLE t1; +# +# Start of 10.4 tests +# +# +# MDEV-30072 Wrong ORDER BY for a partitioned prefix key + NOPAD +# +SET NAMES utf8mb4; +CREATE TABLE t1 +( +id INT, +data VARCHAR(20), +KEY data_id (data,id) +) COLLATE utf8mb3_unicode_nopad_ci ENGINE=MyISAM +PARTITION BY RANGE COLUMNS (id) +( +PARTITION p10 VALUES LESS THAN (20), +PARTITION p20 VALUES LESS THAN MAXVALUE +); +INSERT INTO t1 VALUES (30, 'ss '), (10, 'ß '); +SELECT id FROM t1 WHERE data='ss ' ORDER BY id; +id +10 +30 +SELECT id FROM t1 WHERE data='ss ' ORDER BY id DESC; +id +30 +10 +ALTER TABLE t1 DROP KEY data_id, ADD KEY data_id2(data(10),id); +SELECT id FROM t1 WHERE data='ss ' ORDER BY id; +id +10 +30 +SELECT id FROM t1 WHERE data='ss ' ORDER BY id DESC; +id +30 +10 +DROP TABLE t1; +# +# End of 10.4 tests +# diff --git a/mysql-test/main/ctype_uca_partitions.test b/mysql-test/main/ctype_uca_partitions.test index 5734bb52008..81f1a091574 100644 --- a/mysql-test/main/ctype_uca_partitions.test +++ b/mysql-test/main/ctype_uca_partitions.test @@ -36,3 +36,35 @@ SELECT * FROM t1 PARTITION (p0) ORDER BY c1; SELECT * FROM t1 PARTITION (p1) ORDER BY c1; SELECT * FROM t1 PARTITION (p2) ORDER BY c1; DROP TABLE t1; + +--echo # +--echo # Start of 10.4 tests +--echo # + +--echo # +--echo # MDEV-30072 Wrong ORDER BY for a partitioned prefix key + NOPAD +--echo # + +SET NAMES utf8mb4; +CREATE TABLE t1 +( + id INT, + data VARCHAR(20), + KEY data_id (data,id) +) COLLATE utf8mb3_unicode_nopad_ci ENGINE=MyISAM +PARTITION BY RANGE COLUMNS (id) +( + PARTITION p10 VALUES LESS THAN (20), + PARTITION p20 VALUES LESS THAN MAXVALUE +); +INSERT INTO t1 VALUES (30, 'ss '), (10, 'ß '); +SELECT id FROM t1 WHERE data='ss ' ORDER BY id; +SELECT id FROM t1 WHERE data='ss ' ORDER BY id DESC; +ALTER TABLE t1 DROP KEY data_id, ADD KEY data_id2(data(10),id); +SELECT id FROM t1 WHERE data='ss ' ORDER BY id; +SELECT id FROM t1 WHERE data='ss ' ORDER BY id DESC; +DROP TABLE t1; + +--echo # +--echo # End of 10.4 tests +--echo # From ed2adc8c6f986f7e9c81d7a99f85cad0e2d46d80 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 6 Apr 2023 14:50:26 +0400 Subject: [PATCH 103/260] MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic This problem was fixed earlier by MDEV-27653. Adding MTR tests only. --- .../sql_mode_pad_char_to_full_length.inc | 31 ++++++ .../sql_mode_pad_char_to_full_length.result | 94 +++++++++++++++++++ .../sql_mode_pad_char_to_full_length.test | 19 ++++ .../r/sql_mode_pad_char_to_full_length.result | 51 ++++++++++ .../t/sql_mode_pad_char_to_full_length.test | 18 ++++ 5 files changed, 213 insertions(+) create mode 100644 mysql-test/include/sql_mode_pad_char_to_full_length.inc create mode 100644 mysql-test/main/sql_mode_pad_char_to_full_length.result create mode 100644 mysql-test/main/sql_mode_pad_char_to_full_length.test create mode 100644 mysql-test/suite/innodb/r/sql_mode_pad_char_to_full_length.result create mode 100644 mysql-test/suite/innodb/t/sql_mode_pad_char_to_full_length.test diff --git a/mysql-test/include/sql_mode_pad_char_to_full_length.inc b/mysql-test/include/sql_mode_pad_char_to_full_length.inc new file mode 100644 index 00000000000..df03c4dbc28 --- /dev/null +++ b/mysql-test/include/sql_mode_pad_char_to_full_length.inc @@ -0,0 +1,31 @@ +--echo # +--echo # MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic +--echo # + +CREATE TABLE t1 (a INT,b CHAR(20)); +SHOW CREATE TABLE t1; +CREATE UNIQUE INDEX bi USING HASH ON t1 (b); +INSERT INTO t1 VALUES (0,0); +SET sql_mode='pad_char_to_full_length'; +DELETE FROM t1; +DROP TABLE t1; + + +SET sql_mode=''; +CREATE TABLE t1 (a INT,b CHAR(20)); +SHOW CREATE TABLE t1; +CREATE UNIQUE INDEX bi USING HASH ON t1 (b); +SET sql_mode='pad_char_to_full_length'; +INSERT INTO t1 VALUES (0,0); +DELETE FROM t1; +DROP TABLE t1; + + +SET sql_mode=''; +CREATE OR REPLACE TABLE t1 (a CHAR(20),b CHAR(20)); +SHOW CREATE TABLE t1; +CREATE UNIQUE INDEX bi USING HASH ON t1 (b); +INSERT INTO t1 VALUES (0,0); +SET sql_mode='pad_char_to_full_length'; +DELETE FROM t1; +DROP TABLE t1; diff --git a/mysql-test/main/sql_mode_pad_char_to_full_length.result b/mysql-test/main/sql_mode_pad_char_to_full_length.result new file mode 100644 index 00000000000..6f68aade613 --- /dev/null +++ b/mysql-test/main/sql_mode_pad_char_to_full_length.result @@ -0,0 +1,94 @@ +# +# Start of 10.4 tests +# +# +# MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic +# +SET default_storage_engine=MyISAM; +# +# MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic +# +CREATE TABLE t1 (a INT,b CHAR(20)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +CREATE UNIQUE INDEX bi USING HASH ON t1 (b); +INSERT INTO t1 VALUES (0,0); +SET sql_mode='pad_char_to_full_length'; +DELETE FROM t1; +DROP TABLE t1; +SET sql_mode=''; +CREATE TABLE t1 (a INT,b CHAR(20)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +CREATE UNIQUE INDEX bi USING HASH ON t1 (b); +SET sql_mode='pad_char_to_full_length'; +INSERT INTO t1 VALUES (0,0); +DELETE FROM t1; +DROP TABLE t1; +SET sql_mode=''; +CREATE OR REPLACE TABLE t1 (a CHAR(20),b CHAR(20)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(20) DEFAULT NULL, + `b` char(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +CREATE UNIQUE INDEX bi USING HASH ON t1 (b); +INSERT INTO t1 VALUES (0,0); +SET sql_mode='pad_char_to_full_length'; +DELETE FROM t1; +DROP TABLE t1; +SET default_storage_engine=MEMORY; +# +# MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic +# +CREATE TABLE t1 (a INT,b CHAR(20)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(20) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +CREATE UNIQUE INDEX bi USING HASH ON t1 (b); +INSERT INTO t1 VALUES (0,0); +SET sql_mode='pad_char_to_full_length'; +DELETE FROM t1; +DROP TABLE t1; +SET sql_mode=''; +CREATE TABLE t1 (a INT,b CHAR(20)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(20) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +CREATE UNIQUE INDEX bi USING HASH ON t1 (b); +SET sql_mode='pad_char_to_full_length'; +INSERT INTO t1 VALUES (0,0); +DELETE FROM t1; +DROP TABLE t1; +SET sql_mode=''; +CREATE OR REPLACE TABLE t1 (a CHAR(20),b CHAR(20)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(20) DEFAULT NULL, + `b` char(20) DEFAULT NULL +) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +CREATE UNIQUE INDEX bi USING HASH ON t1 (b); +INSERT INTO t1 VALUES (0,0); +SET sql_mode='pad_char_to_full_length'; +DELETE FROM t1; +DROP TABLE t1; +SET default_storage_engine=DEFAULT; +# +# End of 10.4 tests +# diff --git a/mysql-test/main/sql_mode_pad_char_to_full_length.test b/mysql-test/main/sql_mode_pad_char_to_full_length.test new file mode 100644 index 00000000000..4d492bc1b70 --- /dev/null +++ b/mysql-test/main/sql_mode_pad_char_to_full_length.test @@ -0,0 +1,19 @@ +--echo # +--echo # Start of 10.4 tests +--echo # + +--echo # +--echo # MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic +--echo # + +SET default_storage_engine=MyISAM; +--source include/sql_mode_pad_char_to_full_length.inc + +SET default_storage_engine=MEMORY; +--source include/sql_mode_pad_char_to_full_length.inc + +SET default_storage_engine=DEFAULT; + +--echo # +--echo # End of 10.4 tests +--echo # diff --git a/mysql-test/suite/innodb/r/sql_mode_pad_char_to_full_length.result b/mysql-test/suite/innodb/r/sql_mode_pad_char_to_full_length.result new file mode 100644 index 00000000000..09c1cf57497 --- /dev/null +++ b/mysql-test/suite/innodb/r/sql_mode_pad_char_to_full_length.result @@ -0,0 +1,51 @@ +SET default_storage_engine=InnoDB; +# +# Start of 10.4 tests +# +# +# MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic +# +# +# MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic +# +CREATE TABLE t1 (a INT,b CHAR(20)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(20) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +CREATE UNIQUE INDEX bi USING HASH ON t1 (b); +INSERT INTO t1 VALUES (0,0); +SET sql_mode='pad_char_to_full_length'; +DELETE FROM t1; +DROP TABLE t1; +SET sql_mode=''; +CREATE TABLE t1 (a INT,b CHAR(20)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` char(20) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +CREATE UNIQUE INDEX bi USING HASH ON t1 (b); +SET sql_mode='pad_char_to_full_length'; +INSERT INTO t1 VALUES (0,0); +DELETE FROM t1; +DROP TABLE t1; +SET sql_mode=''; +CREATE OR REPLACE TABLE t1 (a CHAR(20),b CHAR(20)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(20) DEFAULT NULL, + `b` char(20) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +CREATE UNIQUE INDEX bi USING HASH ON t1 (b); +INSERT INTO t1 VALUES (0,0); +SET sql_mode='pad_char_to_full_length'; +DELETE FROM t1; +DROP TABLE t1; +# +# End of 10.4 tests +# diff --git a/mysql-test/suite/innodb/t/sql_mode_pad_char_to_full_length.test b/mysql-test/suite/innodb/t/sql_mode_pad_char_to_full_length.test new file mode 100644 index 00000000000..ba286c744d9 --- /dev/null +++ b/mysql-test/suite/innodb/t/sql_mode_pad_char_to_full_length.test @@ -0,0 +1,18 @@ +--source include/have_innodb.inc + +SET default_storage_engine=InnoDB; + +--echo # +--echo # Start of 10.4 tests +--echo # + +--echo # +--echo # MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic +--echo # + +--source include/sql_mode_pad_char_to_full_length.inc + + +--echo # +--echo # End of 10.4 tests +--echo # From 4daea2f8b69417881b4f123a252954f22b499df1 Mon Sep 17 00:00:00 2001 From: lilinjie <1136268146@qq.com> Date: Fri, 31 Mar 2023 14:11:04 +0800 Subject: [PATCH 104/260] fix typo Signed-off-by: lilinjie <1136268146@qq.com> --- sql/log.cc | 2 +- sql/log_event.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/log.cc b/sql/log.cc index d2cbb49e280..8c75ae847b3 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -408,7 +408,7 @@ private: Rows_log_event *m_pending; /* - Bit flags for what has been writting to cache. Used to + Bit flags for what has been writing to cache. Used to discard logs without any data changes. see enum_logged_status; */ diff --git a/sql/log_event.h b/sql/log_event.h index b12ee07b0e2..5cd303e288c 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -726,7 +726,7 @@ enum Log_event_type /* - Bit flags for what has been writting to cache. Used to + Bit flags for what has been writing to cache. Used to discard logs with table map events but not row events and nothing else important. This is stored by cache. */ From f83b7ae13d9619af29d74a27dd253b67aa0ee4fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 6 Apr 2023 07:50:23 +0300 Subject: [PATCH 105/260] MDEV-26175 : Assertion `! thd->in_sub_stmt' failed in bool trans_rollback_stmt(THD*) If we are inside stored function or trigger we should not commit or rollback current statement transaction. Signed-off-by: Julius Goryavsky --- mysql-test/suite/galera/r/mdev-26175.result | 24 +++++++++++++++++ .../suite/galera/t/galera_sequences.test | 1 + mysql-test/suite/galera/t/mdev-26175.test | 27 +++++++++++++++++++ sql/handler.cc | 8 +++++- 4 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/galera/r/mdev-26175.result create mode 100644 mysql-test/suite/galera/t/mdev-26175.test diff --git a/mysql-test/suite/galera/r/mdev-26175.result b/mysql-test/suite/galera/r/mdev-26175.result new file mode 100644 index 00000000000..f84244fe916 --- /dev/null +++ b/mysql-test/suite/galera/r/mdev-26175.result @@ -0,0 +1,24 @@ +connection node_2; +connection node_1; +connection node_1; +SET sql_mode="no_zero_date"; +SET GLOBAL wsrep_max_ws_rows=1; +CREATE TABLE t2 (a INT); +CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; +CREATE TRIGGER tgr BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (0); +INSERT INTO t1 VALUES (0),(1); +ERROR HY000: wsrep_max_ws_rows exceeded +SELECT * FROM t1; +a +SELECT * FROM t2; +a +connection node_2; +SELECT * FROM t1; +a +SELECT * FROM t2; +a +connection node_1; +SET sql_mode=DEFAULT; +SET GLOBAL wsrep_max_ws_rows=DEFAULT; +DROP TRIGGER tgr; +DROP TABLE t1, t2; diff --git a/mysql-test/suite/galera/t/galera_sequences.test b/mysql-test/suite/galera/t/galera_sequences.test index faa3b46d2a7..613823d83e9 100644 --- a/mysql-test/suite/galera/t/galera_sequences.test +++ b/mysql-test/suite/galera/t/galera_sequences.test @@ -1,4 +1,5 @@ --source include/galera_cluster.inc +--source include/have_innodb.inc # # MDEV-19353 : Alter Sequence do not replicate to another nodes with in Galera Cluster diff --git a/mysql-test/suite/galera/t/mdev-26175.test b/mysql-test/suite/galera/t/mdev-26175.test new file mode 100644 index 00000000000..1a3f1153e03 --- /dev/null +++ b/mysql-test/suite/galera/t/mdev-26175.test @@ -0,0 +1,27 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc + +# +# MDEV-26175 : Assertion `! thd->in_sub_stmt' failed in bool trans_rollback_stmt(THD*) +# +--connection node_1 +SET sql_mode="no_zero_date"; +SET GLOBAL wsrep_max_ws_rows=1; +CREATE TABLE t2 (a INT); +CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; +CREATE TRIGGER tgr BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (0); + +--error ER_ERROR_DURING_COMMIT +INSERT INTO t1 VALUES (0),(1); +SELECT * FROM t1; +SELECT * FROM t2; + +--connection node_2 +SELECT * FROM t1; +SELECT * FROM t2; + +--connection node_1 +SET sql_mode=DEFAULT; +SET GLOBAL wsrep_max_ws_rows=DEFAULT; +DROP TRIGGER tgr; +DROP TABLE t1, t2; diff --git a/sql/handler.cc b/sql/handler.cc index 8ed8ee64880..7eaaaf63f00 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -6618,7 +6618,13 @@ static int wsrep_after_row(THD *thd) wsrep_thd_is_local(thd) && thd->wsrep_affected_rows > wsrep_max_ws_rows) { - trans_rollback_stmt(thd) || trans_rollback(thd); + /* + If we are inside stored function or trigger we should not commit or + rollback current statement transaction. See comment in ha_commit_trans() + call for more information. + */ + if (!thd->in_sub_stmt) + trans_rollback_stmt(thd) || trans_rollback(thd); my_message(ER_ERROR_DURING_COMMIT, "wsrep_max_ws_rows exceeded", MYF(0)); DBUG_RETURN(ER_ERROR_DURING_COMMIT); } From 375991a531f8885634e7a2af224bf396ee7e1f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 11 Apr 2023 14:42:08 +0300 Subject: [PATCH 106/260] MDEV-26827 fixup for DDL race condition buf_flush_try_neighbors(): Tolerate count<2 in case the tablespace is being dropped. --- storage/innobase/buf/buf0flu.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 484f6a3abb7..031055d7cfd 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -1122,13 +1122,11 @@ static ulint buf_flush_try_neighbors(fil_space_t *space, mysql_mutex_unlock(&buf_pool.mutex); } - ut_ad(!bpage); - - if (auto n= count - 1) + if (count > 1) { MONITOR_INC_VALUE_CUMULATIVE(MONITOR_FLUSH_NEIGHBOR_TOTAL_PAGE, MONITOR_FLUSH_NEIGHBOR_COUNT, - MONITOR_FLUSH_NEIGHBOR_PAGES, n); + MONITOR_FLUSH_NEIGHBOR_PAGES, count - 1); } return count; From a1ba06f2a795a63fd2e61aa671daf24730b5f66a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 12 Apr 2023 13:05:48 +0300 Subject: [PATCH 107/260] MDEV-27774 fixup: Remove an unused function --- storage/innobase/include/log0log.h | 1 - 1 file changed, 1 deletion(-) diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h index 7f5eb482e97..0bf8b03bf87 100644 --- a/storage/innobase/include/log0log.h +++ b/storage/innobase/include/log0log.h @@ -324,7 +324,6 @@ public: lsn_t get_lsn(std::memory_order order= std::memory_order_relaxed) const { return lsn.load(order); } - void set_lsn(lsn_t lsn) { this->lsn.store(lsn, std::memory_order_release); } lsn_t get_flushed_lsn(std::memory_order order= std::memory_order_acquire) const noexcept From a091d6ac4e7d2d7873749e685943b3032ccfda57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 12 Apr 2023 13:49:57 +0300 Subject: [PATCH 108/260] MDEV-26827 fixup: Do not duplicate io_slots::pending_io_count() os_aio_pending_reads_approx(), os_aio_pending_reads(): Replaces buf_pool.n_pend_reads. os_aio_pending_writes(): Replaces buf_dblwr.pending_writes(). buf_dblwr_t::write_cond, buf_dblwr_t::writes_pending: Remove. --- storage/innobase/btr/btr0cur.cc | 4 +-- storage/innobase/buf/buf0buf.cc | 10 ++----- storage/innobase/buf/buf0dblwr.cc | 42 ++++++++++---------------- storage/innobase/buf/buf0flu.cc | 44 ++++++++++------------------ storage/innobase/buf/buf0rea.cc | 27 +++++------------ storage/innobase/include/buf0buf.h | 16 +--------- storage/innobase/include/buf0dblwr.h | 40 +------------------------ storage/innobase/include/os0file.h | 7 +++++ storage/innobase/log/log0recv.cc | 3 +- storage/innobase/os/os0file.cc | 25 ++++++++++++++++ storage/innobase/srv/srv0start.cc | 24 ++++++++++++--- tpool/tpool_structs.h | 9 ++++-- 12 files changed, 104 insertions(+), 147 deletions(-) diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index b9681040092..70b0ae4c32c 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -1058,7 +1058,7 @@ dberr_t btr_cur_t::search_leaf(const dtuple_t *tuple, page_cur_mode_t mode, if (lock_intention == BTR_INTENTION_DELETE) { compress_limit= BTR_CUR_PAGE_COMPRESS_LIMIT(index()); - if (buf_pool.n_pend_reads && + if (os_aio_pending_reads_approx() && trx_sys.history_size_approx() > BTR_CUR_FINE_HISTORY_LENGTH) { /* Most delete-intended operations are due to the purge of history. @@ -1843,7 +1843,7 @@ dberr_t btr_cur_t::open_leaf(bool first, dict_index_t *index, { compress_limit= BTR_CUR_PAGE_COMPRESS_LIMIT(index); - if (buf_pool.n_pend_reads && + if (os_aio_pending_reads_approx() && trx_sys.history_size_approx() > BTR_CUR_FINE_HISTORY_LENGTH) { mtr_x_lock_index(index, mtr); diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 106569f74b2..462b1eb634a 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -3539,9 +3539,6 @@ dberr_t buf_page_t::read_complete(const fil_node_t &node) ut_ad(zip_size() == node.space->zip_size()); ut_ad(!!zip.ssize == !!zip.data); - ut_d(auto n=) buf_pool.n_pend_reads--; - ut_ad(n > 0); - const byte *read_frame= zip.data ? zip.data : frame; ut_ad(read_frame); @@ -3841,9 +3838,8 @@ void buf_pool_t::print() << ", modified database pages=" << UT_LIST_GET_LEN(flush_list) << ", n pending decompressions=" << n_pend_unzip - << ", n pending reads=" << n_pend_reads << ", n pending flush LRU=" << n_flush() - << " list=" << buf_dblwr.pending_writes() + << " list=" << os_aio_pending_writes() << ", pages made young=" << stat.n_pages_made_young << ", not young=" << stat.n_pages_not_made_young << ", pages read=" << stat.n_pages_read @@ -3956,11 +3952,11 @@ void buf_stats_get_pool_info(buf_pool_info_t *pool_info) pool_info->n_pend_unzip = UT_LIST_GET_LEN(buf_pool.unzip_LRU); - pool_info->n_pend_reads = buf_pool.n_pend_reads; + pool_info->n_pend_reads = os_aio_pending_reads_approx(); pool_info->n_pending_flush_lru = buf_pool.n_flush(); - pool_info->n_pending_flush_list = buf_dblwr.pending_writes(); + pool_info->n_pending_flush_list = os_aio_pending_writes(); mysql_mutex_unlock(&buf_pool.flush_list_mutex); current_time = time(NULL); diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc index c3f221c6f61..c28a9a3337a 100644 --- a/storage/innobase/buf/buf0dblwr.cc +++ b/storage/innobase/buf/buf0dblwr.cc @@ -53,7 +53,6 @@ void buf_dblwr_t::init() active_slot= &slots[0]; mysql_mutex_init(buf_dblwr_mutex_key, &mutex, nullptr); pthread_cond_init(&cond, nullptr); - pthread_cond_init(&write_cond, nullptr); } } @@ -469,7 +468,6 @@ void buf_dblwr_t::close() ut_ad(!batch_running); pthread_cond_destroy(&cond); - pthread_cond_destroy(&write_cond); for (int i= 0; i < 2; i++) { aligned_free(slots[i].write_buf); @@ -481,38 +479,31 @@ void buf_dblwr_t::close() } /** Update the doublewrite buffer on write completion. */ -void buf_dblwr_t::write_completed(bool with_doublewrite) +void buf_dblwr_t::write_completed() { ut_ad(this == &buf_dblwr); ut_ad(!srv_read_only_mode); mysql_mutex_lock(&mutex); - ut_ad(writes_pending); - if (!--writes_pending) - pthread_cond_broadcast(&write_cond); + ut_ad(is_created()); + ut_ad(srv_use_doublewrite_buf); + ut_ad(batch_running); + slot *flush_slot= active_slot == &slots[0] ? &slots[1] : &slots[0]; + ut_ad(flush_slot->reserved); + ut_ad(flush_slot->reserved <= flush_slot->first_free); - if (with_doublewrite) + if (!--flush_slot->reserved) { - ut_ad(is_created()); - ut_ad(srv_use_doublewrite_buf); - ut_ad(batch_running); - slot *flush_slot= active_slot == &slots[0] ? &slots[1] : &slots[0]; - ut_ad(flush_slot->reserved); - ut_ad(flush_slot->reserved <= flush_slot->first_free); + mysql_mutex_unlock(&mutex); + /* This will finish the batch. Sync data files to the disk. */ + fil_flush_file_spaces(); + mysql_mutex_lock(&mutex); - if (!--flush_slot->reserved) - { - mysql_mutex_unlock(&mutex); - /* This will finish the batch. Sync data files to the disk. */ - fil_flush_file_spaces(); - mysql_mutex_lock(&mutex); - - /* We can now reuse the doublewrite memory buffer: */ - flush_slot->first_free= 0; - batch_running= false; - pthread_cond_broadcast(&cond); - } + /* We can now reuse the doublewrite memory buffer: */ + flush_slot->first_free= 0; + batch_running= false; + pthread_cond_broadcast(&cond); } mysql_mutex_unlock(&mutex); @@ -756,7 +747,6 @@ void buf_dblwr_t::add_to_batch(const IORequest &request, size_t size) const ulint buf_size= 2 * block_size(); mysql_mutex_lock(&mutex); - writes_pending++; for (;;) { diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 32f39ea08de..5a9e3cbb34e 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -246,7 +246,7 @@ void buf_flush_remove_pages(ulint id) if (!deferred) break; - buf_dblwr.wait_for_page_writes(); + os_aio_wait_until_no_pending_writes(); } } @@ -376,9 +376,9 @@ void buf_page_write_complete(const IORequest &request) if (request.is_LRU()) { const bool temp= bpage->oldest_modification() == 2; - if (!temp) - buf_dblwr.write_completed(state < buf_page_t::WRITE_FIX_REINIT && - request.node->space->use_doublewrite()); + if (!temp && state < buf_page_t::WRITE_FIX_REINIT && + request.node->space->use_doublewrite()) + buf_dblwr.write_completed(); /* We must hold buf_pool.mutex while releasing the block, so that no other thread can access it before we have freed it. */ mysql_mutex_lock(&buf_pool.mutex); @@ -390,8 +390,9 @@ void buf_page_write_complete(const IORequest &request) } else { - buf_dblwr.write_completed(state < buf_page_t::WRITE_FIX_REINIT && - request.node->space->use_doublewrite()); + if (state < buf_page_t::WRITE_FIX_REINIT && + request.node->space->use_doublewrite()) + buf_dblwr.write_completed(); bpage->write_complete(false); } } @@ -886,8 +887,6 @@ bool buf_page_t::flush(bool evict, fil_space_t *space) if (lsn > log_sys.get_flushed_lsn()) log_write_up_to(lsn, true); } - if (UNIV_LIKELY(space->purpose != FIL_TYPE_TEMPORARY)) - buf_dblwr.add_unbuffered(); space->io(IORequest{type, this, slot}, physical_offset(), size, write_frame, this); } @@ -1853,7 +1852,7 @@ static void buf_flush_wait(lsn_t lsn) break; } mysql_mutex_unlock(&buf_pool.flush_list_mutex); - buf_dblwr.wait_for_page_writes(); + os_aio_wait_until_no_pending_writes(); mysql_mutex_lock(&buf_pool.flush_list_mutex); } } @@ -1875,8 +1874,6 @@ ATTRIBUTE_COLD void buf_flush_wait_flushed(lsn_t sync_lsn) if (buf_pool.get_oldest_modification(sync_lsn) < sync_lsn) { MONITOR_INC(MONITOR_FLUSH_SYNC_WAITS); - thd_wait_begin(nullptr, THD_WAIT_DISKIO); - tpool::tpool_wait_begin(); #if 1 /* FIXME: remove this, and guarantee that the page cleaner serves us */ if (UNIV_UNLIKELY(!buf_page_cleaner_is_active)) @@ -1891,7 +1888,7 @@ ATTRIBUTE_COLD void buf_flush_wait_flushed(lsn_t sync_lsn) MONITOR_FLUSH_SYNC_COUNT, MONITOR_FLUSH_SYNC_PAGES, n_pages); } - buf_dblwr.wait_for_page_writes(); + os_aio_wait_until_no_pending_writes(); mysql_mutex_lock(&buf_pool.flush_list_mutex); } while (buf_pool.get_oldest_modification(sync_lsn) < sync_lsn); @@ -1900,7 +1897,6 @@ ATTRIBUTE_COLD void buf_flush_wait_flushed(lsn_t sync_lsn) #endif buf_flush_wait(sync_lsn); - tpool::tpool_wait_end(); thd_wait_end(nullptr); } @@ -2335,7 +2331,7 @@ static void buf_flush_page_cleaner() last_activity_count= activity_count; goto maybe_unemployed; } - else if (buf_pool.page_cleaner_idle() && buf_pool.n_pend_reads == 0) + else if (buf_pool.page_cleaner_idle() && !os_aio_pending_reads()) { /* reaching here means 3 things: - last_activity_count == activity_count: suggesting server is idle @@ -2411,7 +2407,7 @@ static void buf_flush_page_cleaner() mysql_mutex_lock(&buf_pool.flush_list_mutex); buf_flush_wait_LRU_batch_end(); mysql_mutex_unlock(&buf_pool.flush_list_mutex); - buf_dblwr.wait_for_page_writes(); + os_aio_wait_until_no_pending_writes(); } mysql_mutex_lock(&buf_pool.flush_list_mutex); @@ -2461,15 +2457,7 @@ ATTRIBUTE_COLD void buf_flush_buffer_pool() { mysql_mutex_unlock(&buf_pool.flush_list_mutex); buf_flush_list(srv_max_io_capacity); - if (const size_t pending= buf_dblwr.pending_writes()) - { - timespec abstime; - service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL, - "Waiting to write %zu pages", pending); - set_timespec(abstime, INNODB_EXTEND_TIMEOUT_INTERVAL / 2); - buf_dblwr.wait_for_page_writes(abstime); - } - + os_aio_wait_until_no_pending_writes(); mysql_mutex_lock(&buf_pool.flush_list_mutex); service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL, "Waiting to flush " ULINTPF " pages", @@ -2477,20 +2465,18 @@ ATTRIBUTE_COLD void buf_flush_buffer_pool() } mysql_mutex_unlock(&buf_pool.flush_list_mutex); - ut_ad(!buf_pool.any_io_pending()); + ut_ad(!os_aio_pending_writes()); + ut_ad(!os_aio_pending_reads()); } /** Synchronously flush dirty blocks during recv_sys_t::apply(). NOTE: The calling thread is not allowed to hold any buffer page latches! */ void buf_flush_sync_batch(lsn_t lsn) { - thd_wait_begin(nullptr, THD_WAIT_DISKIO); - tpool::tpool_wait_begin(); + lsn= std::max(lsn, log_sys.get_lsn()); mysql_mutex_lock(&buf_pool.flush_list_mutex); buf_flush_wait(lsn); mysql_mutex_unlock(&buf_pool.flush_list_mutex); - tpool::tpool_wait_end(); - thd_wait_end(nullptr); } /** Synchronously flush dirty blocks. diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc index b39a8f49133..b8fa3055adf 100644 --- a/storage/innobase/buf/buf0rea.cc +++ b/storage/innobase/buf/buf0rea.cc @@ -227,12 +227,9 @@ static buf_page_t* buf_page_init_for_read(ulint mode, const page_id_t page_id, } buf_pool.stat.n_pages_read++; - mysql_mutex_unlock(&buf_pool.mutex); - buf_pool.n_pend_reads++; - goto func_exit_no_mutex; func_exit: mysql_mutex_unlock(&buf_pool.mutex); -func_exit_no_mutex: + if (mode == BUF_READ_IBUF_PAGES_ONLY) ibuf_mtr_commit(&mtr); @@ -319,8 +316,6 @@ buf_read_page_low( page_id.page_no() * len, len, dst, bpage); if (UNIV_UNLIKELY(fio.err != DB_SUCCESS)) { - ut_d(auto n=) buf_pool.n_pend_reads--; - ut_ad(n > 0); buf_pool.corrupted_evict(bpage, buf_page_t::READ_FIX); } else if (sync) { thd_wait_end(NULL); @@ -367,7 +362,8 @@ buf_read_ahead_random(const page_id_t page_id, ulint zip_size, bool ibuf) read-ahead, as that could break the ibuf page access order */ return 0; - if (buf_pool.n_pend_reads > buf_pool.curr_size / BUF_READ_AHEAD_PEND_LIMIT) + if (os_aio_pending_reads_approx() > + buf_pool.curr_size / BUF_READ_AHEAD_PEND_LIMIT) return 0; fil_space_t* space= fil_space_t::get(page_id.space()); @@ -519,7 +515,8 @@ buf_read_ahead_linear(const page_id_t page_id, ulint zip_size, bool ibuf) /* No read-ahead to avoid thread deadlocks */ return 0; - if (buf_pool.n_pend_reads > buf_pool.curr_size / BUF_READ_AHEAD_PEND_LIMIT) + if (os_aio_pending_reads_approx() > + buf_pool.curr_size / BUF_READ_AHEAD_PEND_LIMIT) return 0; const uint32_t buf_read_ahead_area= buf_pool.read_ahead_area; @@ -689,18 +686,8 @@ void buf_read_recv_pages(ulint space_id, const uint32_t* page_nos, ulint n) limit += buf_pool.chunks[j].size / 2; } - for (ulint count = 0; buf_pool.n_pend_reads >= limit; ) { - std::this_thread::sleep_for( - std::chrono::milliseconds(10)); - - if (!(++count % 1000)) { - - ib::error() - << "Waited for " << count / 100 - << " seconds for " - << buf_pool.n_pend_reads - << " pending reads"; - } + if (os_aio_pending_reads() >= limit) { + os_aio_wait_until_no_pending_reads(); } space->reacquire(); diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h index 94f8dc2badb..2b4732a64a0 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -1693,8 +1693,6 @@ public: /** map of block->frame to buf_block_t blocks that belong to buf_buddy_alloc(); protected by buf_pool.mutex */ hash_table_t zip_hash; - /** number of pending read operations */ - Atomic_counter n_pend_reads; Atomic_counter n_pend_unzip; /*!< number of pending decompressions */ @@ -1721,7 +1719,7 @@ public: /** flush_list size in bytes; protected by flush_list_mutex */ ulint flush_list_bytes; /** possibly modified persistent pages (a subset of LRU); - buf_dblwr.pending_writes() is approximately COUNT(is_write_fixed()) */ + os_aio_pending_writes() is approximately COUNT(is_write_fixed()) */ UT_LIST_BASE_NODE_T(buf_page_t) flush_list; private: static constexpr unsigned PAGE_CLEANER_IDLE= 1; @@ -1874,18 +1872,6 @@ public: /** Reserve a buffer. */ buf_tmp_buffer_t *io_buf_reserve() { return io_buf.reserve(); } - /** @return whether any I/O is pending */ - bool any_io_pending() - { - if (n_pend_reads) - return true; - mysql_mutex_lock(&flush_list_mutex); - const bool any_pending= page_cleaner_status > PAGE_CLEANER_IDLE || - buf_dblwr.pending_writes(); - mysql_mutex_unlock(&flush_list_mutex); - return any_pending; - } - private: /** Remove a block from the flush list. */ inline void delete_from_flush_list_low(buf_page_t *bpage); diff --git a/storage/innobase/include/buf0dblwr.h b/storage/innobase/include/buf0dblwr.h index d9c9239c0b4..92b840d2f4c 100644 --- a/storage/innobase/include/buf0dblwr.h +++ b/storage/innobase/include/buf0dblwr.h @@ -72,10 +72,6 @@ class buf_dblwr_t ulint writes_completed; /** number of pages written by flush_buffered_writes_completed() */ ulint pages_written; - /** condition variable for !writes_pending */ - pthread_cond_t write_cond; - /** number of pending page writes */ - size_t writes_pending; slot slots[2]; slot *active_slot; @@ -124,7 +120,7 @@ public: void recover(); /** Update the doublewrite buffer on data page write completion. */ - void write_completed(bool with_doublewrite); + void write_completed(); /** Flush possible buffered writes to persistent storage. It is very important to call this function after a batch of writes has been posted, and also when we may have to wait for a page latch! @@ -167,40 +163,6 @@ public: my_cond_wait(&cond, &mutex.m_mutex); mysql_mutex_unlock(&mutex); } - - /** Register an unbuffered page write */ - void add_unbuffered() - { - mysql_mutex_lock(&mutex); - writes_pending++; - mysql_mutex_unlock(&mutex); - } - - size_t pending_writes() - { - mysql_mutex_lock(&mutex); - const size_t pending{writes_pending}; - mysql_mutex_unlock(&mutex); - return pending; - } - - /** Wait for writes_pending to reach 0 */ - void wait_for_page_writes() - { - mysql_mutex_lock(&mutex); - while (writes_pending) - my_cond_wait(&write_cond, &mutex.m_mutex); - mysql_mutex_unlock(&mutex); - } - - /** Wait for writes_pending to reach 0 */ - void wait_for_page_writes(const timespec &abstime) - { - mysql_mutex_lock(&mutex); - while (writes_pending) - my_cond_timedwait(&write_cond, &mutex.m_mutex, &abstime); - mysql_mutex_unlock(&mutex); - } }; /** The doublewrite buffer */ diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index 934b30d9515..f8ae0f51557 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -1059,6 +1059,13 @@ void os_aio_free(); @retval DB_IO_ERROR on I/O error */ dberr_t os_aio(const IORequest &type, void *buf, os_offset_t offset, size_t n); +/** @return number of pending reads */ +size_t os_aio_pending_reads(); +/** @return approximate number of pending reads */ +size_t os_aio_pending_reads_approx(); +/** @return number of pending writes */ +size_t os_aio_pending_writes(); + /** Wait until there are no pending asynchronous writes. */ void os_aio_wait_until_no_pending_writes(); diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 44b7e5b2a92..8d05d6a5f14 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -3384,7 +3384,7 @@ next_free_block: for (;;) { const bool empty= pages.empty(); - if (empty && !buf_pool.n_pend_reads) + if (empty && !os_aio_pending_reads()) break; if (!is_corrupt_fs() && !is_corrupt_log()) @@ -3398,7 +3398,6 @@ next_free_block: { mysql_mutex_unlock(&mutex); os_aio_wait_until_no_pending_reads(); - ut_ad(!buf_pool.n_pend_reads); mysql_mutex_lock(&mutex); ut_ad(pages.empty()); } diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index e3de49f4432..12561877c0c 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -131,6 +131,11 @@ public: { wait(); } + + std::mutex& mutex() + { + return m_cache.mutex(); + } }; static io_slots *read_slots; @@ -3660,6 +3665,26 @@ void os_aio_wait_until_no_pending_writes() buf_dblwr.wait_flush_buffered_writes(); } +/** @return number of pending reads */ +size_t os_aio_pending_reads() +{ + std::unique_lock lk(read_slots->mutex()); + return read_slots->pending_io_count(); +} + +/** @return approximate number of pending reads */ +size_t os_aio_pending_reads_approx() +{ + return read_slots->pending_io_count(); +} + +/** @return number of pending writes */ +size_t os_aio_pending_writes() +{ + std::unique_lock lk(write_slots->mutex()); + return write_slots->pending_io_count(); +} + /** Wait until all pending asynchronous reads have completed. */ void os_aio_wait_until_no_pending_reads() { diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 872f1fc7e9c..a1368c5146c 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -249,7 +249,11 @@ static dberr_t create_log_file(bool create_new_db, lsn_t lsn, } DBUG_PRINT("ib_log", ("After innodb_log_abort_6")); - DBUG_ASSERT(!buf_pool.any_io_pending()); + ut_ad(!os_aio_pending_reads()); + ut_ad(!os_aio_pending_writes()); + ut_d(mysql_mutex_lock(&buf_pool.flush_list_mutex)); + ut_ad(!buf_pool.get_oldest_modification(0)); + ut_d(mysql_mutex_unlock(&buf_pool.flush_list_mutex)); DBUG_EXECUTE_IF("innodb_log_abort_7", return DB_ERROR;); DBUG_PRINT("ib_log", ("After innodb_log_abort_7")); @@ -967,7 +971,11 @@ same_size: } ut_ad(flushed_lsn == log_sys.get_lsn()); - ut_ad(!buf_pool.any_io_pending()); + ut_ad(!os_aio_pending_reads()); + ut_ad(!os_aio_pending_writes()); + ut_d(mysql_mutex_lock(&buf_pool.flush_list_mutex)); + ut_ad(!buf_pool.get_oldest_modification(0)); + ut_d(mysql_mutex_unlock(&buf_pool.flush_list_mutex)); DBUG_RETURN(flushed_lsn); } @@ -1601,7 +1609,11 @@ file_checked: ut_ad(srv_force_recovery <= SRV_FORCE_IGNORE_CORRUPT); ut_ad(recv_no_log_write); err = fil_write_flushed_lsn(log_sys.get_lsn()); - DBUG_ASSERT(!buf_pool.any_io_pending()); + ut_ad(!os_aio_pending_reads()); + ut_ad(!os_aio_pending_writes()); + ut_d(mysql_mutex_lock(&buf_pool.flush_list_mutex)); + ut_ad(!buf_pool.get_oldest_modification(0)); + ut_d(mysql_mutex_unlock(&buf_pool.flush_list_mutex)); log_sys.log.close_file(); if (err == DB_SUCCESS) { bool trunc = srv_operation @@ -1645,7 +1657,11 @@ file_checked: threads until creating a log checkpoint at the end of create_log_file(). */ ut_d(recv_no_log_write = true); - DBUG_ASSERT(!buf_pool.any_io_pending()); + ut_ad(!os_aio_pending_reads()); + ut_ad(!os_aio_pending_writes()); + ut_d(mysql_mutex_lock(&buf_pool.flush_list_mutex)); + ut_ad(!buf_pool.get_oldest_modification(0)); + ut_d(mysql_mutex_unlock(&buf_pool.flush_list_mutex)); DBUG_EXECUTE_IF("innodb_log_abort_3", return(srv_init_abort(DB_ERROR));); diff --git a/tpool/tpool_structs.h b/tpool/tpool_structs.h index b49204f2d75..b6ca3f54016 100644 --- a/tpool/tpool_structs.h +++ b/tpool/tpool_structs.h @@ -130,9 +130,12 @@ public: return m_cache[m_pos++]; } - /** - Put back an item to cache. - @param item - item to put back + + std::mutex &mutex() { return m_mtx; } + + /** + Put back an element to cache. + @param ele element to put back */ void put(T *ele) { From 7bcfa00a6a19ae74afe985213e09fc1f0c0540db Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 12 Apr 2023 11:40:46 +0400 Subject: [PATCH 109/260] MDEV-31039 mariadb-backup: remove global variables ds_data and ds_meta This is a non-functional change. simplifying the code logic: - removing global variables ds_data and ds_meta - passing these variables as parameters to functions instead - adding helper classes: Datasink_free_list and Backup_datasinks - moving some function accepting a ds_ctxt parameter as methods to ds_ctxt. --- extra/mariabackup/backup_copy.cc | 169 +++++++++++------------ extra/mariabackup/backup_copy.h | 19 +-- extra/mariabackup/backup_mysql.cc | 32 +++-- extra/mariabackup/backup_mysql.h | 15 +- extra/mariabackup/datasink.h | 29 ++++ extra/mariabackup/write_filt.cc | 14 +- extra/mariabackup/write_filt.h | 3 +- extra/mariabackup/xtrabackup.cc | 219 ++++++++++++++++++------------ extra/mariabackup/xtrabackup.h | 10 +- 9 files changed, 289 insertions(+), 221 deletions(-) diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc index 608be7125bd..ffaf6dc98e4 100644 --- a/extra/mariabackup/backup_copy.cc +++ b/extra/mariabackup/backup_copy.cc @@ -73,9 +73,8 @@ bool binlog_locked; static void rocksdb_create_checkpoint(); static bool has_rocksdb_plugin(); -static void copy_or_move_dir(const char *from, const char *to, bool copy, bool allow_hardlinks); -static void rocksdb_backup_checkpoint(); -static void rocksdb_copy_back(); +static void rocksdb_backup_checkpoint(ds_ctxt *ds_data); +static void rocksdb_copy_back(ds_ctxt *ds_data); static bool is_abs_path(const char *path) { @@ -131,7 +130,7 @@ struct datadir_thread_ctxt_t { bool ret; }; -static bool backup_files_from_datadir(const char *dir_path); +static bool backup_files_from_datadir(ds_ctxt *ds_data, const char *dir_path); /************************************************************************ Retirn true if character if file separator */ @@ -804,7 +803,7 @@ if passes the rules for partial backup. @return true if file backed up or skipped successfully. */ static bool -datafile_copy_backup(const char *filepath, uint thread_n) +datafile_copy_backup(ds_ctxt *ds_data, const char *filepath, uint thread_n) { const char *ext_list[] = {"frm", "isl", "MYD", "MYI", "MAD", "MAI", "MRG", "TRG", "TRN", "ARM", "ARZ", "CSM", "CSV", "opt", "par", @@ -825,7 +824,7 @@ datafile_copy_backup(const char *filepath, uint thread_n) } if (filename_matches(filepath, ext_list)) { - return copy_file(ds_data, filepath, filepath, thread_n); + return ds_data->copy_file(filepath, filepath, thread_n); } return(true); @@ -866,7 +865,8 @@ datafile_rsync_backup(const char *filepath, bool save_to_list, FILE *f) return(true); } -bool backup_file_print_buf(const char *filename, const char *buf, int buf_len) +bool ds_ctxt_t::backup_file_print_buf(const char *filename, + const char *buf, int buf_len) { ds_file_t *dstfile = NULL; MY_STAT stat; /* unused for now */ @@ -877,7 +877,7 @@ bool backup_file_print_buf(const char *filename, const char *buf, int buf_len) stat.st_size = buf_len; stat.st_mtime = my_time(0); - dstfile = ds_open(ds_data, filename, &stat); + dstfile = ds_open(this, filename, &stat); if (dstfile == NULL) { msg("error: Can't open the destination stream for %s", filename); @@ -916,9 +916,9 @@ error_close: return true; }; -static bool -backup_file_vprintf(const char *filename, const char *fmt, va_list ap) +ds_ctxt_t::backup_file_vprintf(const char *filename, + const char *fmt, va_list ap) { char *buf = 0; int buf_len; @@ -929,7 +929,7 @@ backup_file_vprintf(const char *filename, const char *fmt, va_list ap) } bool -backup_file_printf(const char *filename, const char *fmt, ...) +ds_ctxt_t::backup_file_printf(const char *filename, const char *fmt, ...) { bool result; va_list ap; @@ -1055,16 +1055,15 @@ static int fix_win_file_permissions(const char *file) Copy file for backup/restore. @return true in case of success. */ bool -copy_file(ds_ctxt_t *datasink, - const char *src_file_path, - const char *dst_file_path, - uint thread_n) +ds_ctxt_t::copy_file(const char *src_file_path, + const char *dst_file_path, + uint thread_n) { char dst_name[FN_REFLEN]; ds_file_t *dstfile = NULL; datafile_cur_t cursor; xb_fil_cur_result_t res; - DBUG_ASSERT(datasink->datasink->remove); + DBUG_ASSERT(datasink->remove); const char *dst_path = (xtrabackup_copy_back || xtrabackup_move_back)? dst_file_path : trim_dotslash(dst_file_path); @@ -1075,7 +1074,7 @@ copy_file(ds_ctxt_t *datasink, strncpy(dst_name, cursor.rel_path, sizeof(dst_name)); - dstfile = ds_open(datasink, dst_path, &cursor.statinfo); + dstfile = ds_open(this, dst_path, &cursor.statinfo); if (dstfile == NULL) { msg(thread_n,"error: " "cannot open the destination stream for %s", dst_name); @@ -1112,7 +1111,7 @@ copy_file(ds_ctxt_t *datasink, error: datafile_close(&cursor); if (dstfile != NULL) { - datasink->datasink->remove(dstfile->path); + datasink->remove(dstfile->path); ds_close(dstfile); } @@ -1126,12 +1125,10 @@ error_close: Try to move file by renaming it. If source and destination are on different devices fall back to copy and unlink. @return true in case of success. */ -static bool -move_file(ds_ctxt_t *datasink, - const char *src_file_path, - const char *dst_file_path, - const char *dst_dir, uint thread_n) +ds_ctxt_t::move_file(const char *src_file_path, + const char *dst_file_path, + const char *dst_dir, uint thread_n) { char errbuf[MYSYS_STRERROR_SIZE]; char dst_file_path_abs[FN_REFLEN]; @@ -1158,7 +1155,7 @@ move_file(ds_ctxt_t *datasink, if (my_rename(src_file_path, dst_file_path_abs, MYF(0)) != 0) { if (my_errno == EXDEV) { /* Fallback to copy/unlink */ - if(!copy_file(datasink, src_file_path, + if(!copy_file(src_file_path, dst_file_path, thread_n)) return false; msg(thread_n,"Removing %s", src_file_path); @@ -1242,13 +1239,13 @@ Copy or move file depending on current mode. @return true in case of success. */ static bool -copy_or_move_file(const char *src_file_path, +copy_or_move_file(ds_ctxt *datasink0, const char *src_file_path, const char *dst_file_path, const char *dst_dir, uint thread_n, bool copy = xtrabackup_copy_back) { - ds_ctxt_t *datasink = ds_data; /* copy to datadir by default */ + ds_ctxt_t *datasink = datasink0; /* copy to datadir by default */ char filedir[FN_REFLEN]; size_t filedir_len; bool ret; @@ -1296,13 +1293,13 @@ copy_or_move_file(const char *src_file_path, } ret = (copy ? - copy_file(datasink, src_file_path, dst_file_path, thread_n) : - move_file(datasink, src_file_path, dst_file_path, + datasink->copy_file(src_file_path, dst_file_path, thread_n) : + datasink->move_file(src_file_path, dst_file_path, dst_dir, thread_n)); cleanup: - if (datasink != ds_data) { + if (datasink != datasink0) { ds_destroy(datasink); } @@ -1314,7 +1311,7 @@ cleanup: static bool -backup_files(const char *from, bool prep_mode) +backup_files(ds_ctxt *ds_data, const char *from, bool prep_mode) { char rsync_tmpfile_name[FN_REFLEN]; FILE *rsync_tmpfile = NULL; @@ -1352,7 +1349,7 @@ backup_files(const char *from, bool prep_mode) ret = datafile_rsync_backup(node.filepath, !prep_mode, rsync_tmpfile); } else { - ret = datafile_copy_backup(node.filepath, 1); + ret = datafile_copy_backup(ds_data, node.filepath, 1); } if (!ret) { msg("Failed to copy file %s", node.filepath); @@ -1363,7 +1360,7 @@ backup_files(const char *from, bool prep_mode) char path[FN_REFLEN]; snprintf(path, sizeof(path), "%s/db.opt", node.filepath); - if (!(ret = backup_file_printf( + if (!(ret = ds_data->backup_file_printf( trim_dotslash(path), "%s", ""))) { msg("Failed to create file %s", path); goto out; @@ -1452,7 +1449,6 @@ out: return(ret); } -void backup_fix_ddl(CorruptedPages &); lsn_t get_current_lsn(MYSQL *connection) { @@ -1477,7 +1473,8 @@ lsn_t get_current_lsn(MYSQL *connection) lsn_t server_lsn_after_lock; extern void backup_wait_for_lsn(lsn_t lsn); /** Start --backup */ -bool backup_start(CorruptedPages &corrupted_pages) +bool backup_start(ds_ctxt *ds_data, ds_ctxt *ds_meta, + CorruptedPages &corrupted_pages) { if (!opt_no_lock) { if (opt_safe_slave_backup) { @@ -1486,7 +1483,7 @@ bool backup_start(CorruptedPages &corrupted_pages) } } - if (!backup_files(fil_path_to_mysql_datadir, true)) { + if (!backup_files(ds_data, fil_path_to_mysql_datadir, true)) { return(false); } @@ -1498,11 +1495,11 @@ bool backup_start(CorruptedPages &corrupted_pages) server_lsn_after_lock = get_current_lsn(mysql_connection); } - if (!backup_files(fil_path_to_mysql_datadir, false)) { + if (!backup_files(ds_data, fil_path_to_mysql_datadir, false)) { return(false); } - if (!backup_files_from_datadir(fil_path_to_mysql_datadir)) { + if (!backup_files_from_datadir(ds_data, fil_path_to_mysql_datadir)) { return false; } @@ -1512,7 +1509,7 @@ bool backup_start(CorruptedPages &corrupted_pages) msg("Waiting for log copy thread to read lsn %llu", (ulonglong)server_lsn_after_lock); backup_wait_for_lsn(server_lsn_after_lock); - backup_fix_ddl(corrupted_pages); + corrupted_pages.backup_fix_ddl(ds_data, ds_meta); // There is no need to stop slave thread before coping non-Innodb data when // --no-lock option is used because --no-lock option requires that no DDL or @@ -1528,7 +1525,7 @@ bool backup_start(CorruptedPages &corrupted_pages) if (opt_slave_info) { lock_binlog_maybe(mysql_connection); - if (!write_slave_info(mysql_connection)) { + if (!write_slave_info(ds_data, mysql_connection)) { return(false); } } @@ -1540,7 +1537,7 @@ bool backup_start(CorruptedPages &corrupted_pages) avoid that is to have a single process, i.e. merge innobackupex and xtrabackup. */ if (opt_galera_info) { - if (!write_galera_info(mysql_connection)) { + if (!write_galera_info(ds_data, mysql_connection)) { return(false); } } @@ -1548,7 +1545,7 @@ bool backup_start(CorruptedPages &corrupted_pages) if (opt_binlog_info == BINLOG_INFO_ON) { lock_binlog_maybe(mysql_connection); - write_binlog_info(mysql_connection); + write_binlog_info(ds_data, mysql_connection); } if (have_flush_engine_logs && !opt_no_lock) { @@ -1585,20 +1582,20 @@ void backup_release() static const char *default_buffer_pool_file = "ib_buffer_pool"; /** Finish after backup_start() and backup_release() */ -bool backup_finish() +bool backup_finish(ds_ctxt *ds_data) { /* Copy buffer pool dump or LRU dump */ if (!opt_rsync && opt_galera_info) { if (buffer_pool_filename && file_exists(buffer_pool_filename)) { - copy_file(ds_data, buffer_pool_filename, default_buffer_pool_file, 0); + ds_data->copy_file(buffer_pool_filename, default_buffer_pool_file, 0); } if (file_exists("ib_lru_dump")) { - copy_file(ds_data, "ib_lru_dump", "ib_lru_dump", 0); + ds_data->copy_file("ib_lru_dump", "ib_lru_dump", 0); } } if (has_rocksdb_plugin()) { - rocksdb_backup_checkpoint(); + rocksdb_backup_checkpoint(ds_data); } msg("Backup created in directory '%s'", xtrabackup_target_dir); @@ -1610,11 +1607,11 @@ bool backup_finish() mysql_slave_position); } - if (!write_backup_config_file()) { + if (!write_backup_config_file(ds_data)) { return(false); } - if (!write_xtrabackup_info(mysql_connection, XTRABACKUP_INFO, + if (!write_xtrabackup_info(ds_data, mysql_connection, XTRABACKUP_INFO, opt_history != 0, true)) { return(false); } @@ -1681,6 +1678,7 @@ ibx_copy_incremental_over_full() bool ret = true; char path[FN_REFLEN]; int i; + ds_ctxt *ds_data= NULL; DBUG_ASSERT(!opt_galera_info); datadir_node_init(&node); @@ -1708,15 +1706,15 @@ ibx_copy_incremental_over_full() unlink(node.filepath_rel); } - if (!(ret = copy_file(ds_data, node.filepath, - node.filepath_rel, 1))) { + if (!(ret = ds_data->copy_file(node.filepath, + node.filepath_rel, 1))) { msg("Failed to copy file %s", node.filepath); goto cleanup; } } - if (!(ret = backup_files_from_datadir(xtrabackup_incremental_dir))) + if (!(ret = backup_files_from_datadir(ds_data, xtrabackup_incremental_dir))) goto cleanup; /* copy supplementary files */ @@ -1731,7 +1729,7 @@ ibx_copy_incremental_over_full() if (file_exists(sup_files[i])) { unlink(sup_files[i]); } - copy_file(ds_data, path, sup_files[i], 0); + ds_data->copy_file(path, sup_files[i], 0); } } @@ -1745,7 +1743,7 @@ ibx_copy_incremental_over_full() if (my_mkdir(ROCKSDB_BACKUP_DIR, 0777, MYF(0))) { die("my_mkdir failed for " ROCKSDB_BACKUP_DIR); } - copy_or_move_dir(path, ROCKSDB_BACKUP_DIR, true, true); + ds_data->copy_or_move_dir(path, ROCKSDB_BACKUP_DIR, true, true); } ibx_incremental_drop_databases(xtrabackup_target_dir, xtrabackup_incremental_dir); @@ -1894,7 +1892,7 @@ copy_back() dst_dir = dst_dir_buf.make(srv_undo_dir); - ds_data = ds_create(dst_dir, DS_TYPE_LOCAL); + ds_ctxt *ds_tmp = ds_create(dst_dir, DS_TYPE_LOCAL); for (uint i = 1; i <= TRX_SYS_MAX_UNDO_SPACES; i++) { char filename[20]; @@ -1902,14 +1900,14 @@ copy_back() if (!file_exists(filename)) { break; } - if (!(ret = copy_or_move_file(filename, filename, + if (!(ret = copy_or_move_file(ds_tmp, filename, filename, dst_dir, 1))) { goto cleanup; } } - ds_destroy(ds_data); - ds_data = NULL; + ds_destroy(ds_tmp); + ds_tmp = NULL; /* copy redo logs */ @@ -1918,7 +1916,7 @@ copy_back() /* --backup generates a single ib_logfile0, which we must copy if it exists. */ - ds_data = ds_create(dst_dir, DS_TYPE_LOCAL); + ds_tmp = ds_create(dst_dir, DS_TYPE_LOCAL); MY_STAT stat_arg; if (!my_stat("ib_logfile0", &stat_arg, MYF(0)) || !stat_arg.st_size) { /* After completed --prepare, redo log files are redundant. @@ -1932,17 +1930,17 @@ copy_back() dst_dir, i); unlink(filename); } - } else if (!(ret = copy_or_move_file("ib_logfile0", "ib_logfile0", + } else if (!(ret = copy_or_move_file(ds_tmp, "ib_logfile0", "ib_logfile0", dst_dir, 1))) { goto cleanup; } - ds_destroy(ds_data); + ds_destroy(ds_tmp); /* copy innodb system tablespace(s) */ dst_dir = dst_dir_buf.make(innobase_data_home_dir); - ds_data = ds_create(dst_dir, DS_TYPE_LOCAL); + ds_tmp = ds_create(dst_dir, DS_TYPE_LOCAL); for (Tablespace::const_iterator iter(srv_sys_space.begin()), end(srv_sys_space.end()); @@ -1950,16 +1948,16 @@ copy_back() ++iter) { const char *filename = base_name(iter->name()); - if (!(ret = copy_or_move_file(filename, iter->name(), + if (!(ret = copy_or_move_file(ds_tmp, filename, iter->name(), dst_dir, 1))) { goto cleanup; } } - ds_destroy(ds_data); + ds_destroy(ds_tmp); /* copy the rest of tablespaces */ - ds_data = ds_create(mysql_data_home, DS_TYPE_LOCAL); + ds_tmp = ds_create(mysql_data_home, DS_TYPE_LOCAL); it = datadir_iter_new(".", false); @@ -2046,7 +2044,7 @@ copy_back() continue; } - if (!(ret = copy_or_move_file(node.filepath, node.filepath_rel, + if (!(ret = copy_or_move_file(ds_tmp, node.filepath, node.filepath_rel, mysql_data_home, 1))) { goto cleanup; } @@ -2056,12 +2054,12 @@ copy_back() if (file_exists(default_buffer_pool_file) && innobase_buffer_pool_filename) { - copy_or_move_file(default_buffer_pool_file, + copy_or_move_file(ds_tmp, default_buffer_pool_file, innobase_buffer_pool_filename, mysql_data_home, 0); } - rocksdb_copy_back(); + rocksdb_copy_back(ds_tmp); cleanup: if (it != NULL) { @@ -2070,11 +2068,11 @@ cleanup: datadir_node_free(&node); - if (ds_data != NULL) { - ds_destroy(ds_data); + if (ds_tmp != NULL) { + ds_destroy(ds_tmp); } - ds_data = NULL; + ds_tmp = NULL; sync_check_close(); return(ret); @@ -2182,7 +2180,7 @@ decrypt_decompress() } /* copy the rest of tablespaces */ - ds_data = ds_create(".", DS_TYPE_LOCAL); + ds_ctxt *ds_tmp = ds_create(".", DS_TYPE_LOCAL); it = datadir_iter_new(".", false); @@ -2195,11 +2193,11 @@ decrypt_decompress() datadir_iter_free(it); } - if (ds_data != NULL) { - ds_destroy(ds_data); + if (ds_tmp != NULL) { + ds_destroy(ds_tmp); } - ds_data = NULL; + ds_tmp = NULL; sync_check_close(); @@ -2211,7 +2209,7 @@ decrypt_decompress() Do not copy the Innodb files (ibdata1, redo log files), as this is done in a separate step. */ -static bool backup_files_from_datadir(const char *dir_path) +static bool backup_files_from_datadir(ds_ctxt *ds_data, const char *dir_path) { os_file_dir_t dir = os_file_opendir(dir_path); if (dir == IF_WIN(INVALID_HANDLE_VALUE, nullptr)) return false; @@ -2241,7 +2239,7 @@ static bool backup_files_from_datadir(const char *dir_path) std::string full_path(dir_path); full_path.append(1, OS_PATH_SEPARATOR).append(info.name); - if (!(ret = copy_file(ds_data, full_path.c_str() , info.name, 1))) + if (!(ret = ds_data->copy_file(full_path.c_str() , info.name, 1))) break; } os_file_closedir(dir); @@ -2291,13 +2289,14 @@ static char *trim_trailing_dir_sep(char *path) Create a file hardlink. @return true on success, false on error. */ -static bool make_hardlink(const char *from_path, const char *to_path) +bool +ds_ctxt_t::make_hardlink(const char *from_path, const char *to_path) { DBUG_EXECUTE_IF("no_hardlinks", return false;); char to_path_full[FN_REFLEN]; if (!is_abs_path(to_path)) { - fn_format(to_path_full, to_path, ds_data->root, "", MYF(MY_RELATIVE_PATH)); + fn_format(to_path_full, to_path, root, "", MYF(MY_RELATIVE_PATH)); } else { @@ -2318,7 +2317,9 @@ static bool make_hardlink(const char *from_path, const char *to_path) Has optimization that allows to use hardlinks when possible (source and destination are directories on the same device) */ -static void copy_or_move_dir(const char *from, const char *to, bool do_copy, bool allow_hardlinks) +void +ds_ctxt_t::copy_or_move_dir(const char *from, const char *to, + bool do_copy, bool allow_hardlinks) { datadir_node_t node; datadir_node_init(&node); @@ -2346,8 +2347,8 @@ static void copy_or_move_dir(const char *from, const char *to, bool do_copy, boo if (!rc) { rc = (do_copy ? - copy_file(ds_data, from_path, to_path, 1) : - move_file(ds_data, from_path, node.filepath_rel, + copy_file(from_path, to_path, 1) : + move_file(from_path, node.filepath_rel, to, 1)); } if (!rc) @@ -2444,7 +2445,7 @@ static void rocksdb_create_checkpoint() remove temp.checkpoint directory (in server's datadir) and release user level lock acquired inside rocksdb_create_checkpoint(). */ -static void rocksdb_backup_checkpoint() +static void rocksdb_backup_checkpoint(ds_ctxt *ds_data) { msg("Backing up rocksdb files."); char rocksdb_backup_dir[FN_REFLEN]; @@ -2456,7 +2457,7 @@ static void rocksdb_backup_checkpoint() die("Can't create rocksdb backup directory %s", rocksdb_backup_dir); } } - copy_or_move_dir(rocksdb_checkpoint_dir, ROCKSDB_BACKUP_DIR, true, backup_to_directory); + ds_data->copy_or_move_dir(rocksdb_checkpoint_dir, ROCKSDB_BACKUP_DIR, true, backup_to_directory); rocksdb_remove_checkpoint_directory(); rocksdb_unlock_checkpoint(); } @@ -2464,7 +2465,7 @@ static void rocksdb_backup_checkpoint() /* Copies #rocksdb directory to the $rockdb_data_dir, on copy-back */ -static void rocksdb_copy_back() { +static void rocksdb_copy_back(ds_ctxt *ds_data) { if (access(ROCKSDB_BACKUP_DIR, 0)) return; char rocksdb_home_dir[FN_REFLEN]; @@ -2476,5 +2477,5 @@ static void rocksdb_copy_back() { xb_rocksdb_datadir?trim_dotslash(xb_rocksdb_datadir): ROCKSDB_BACKUP_DIR); } mkdirp(rocksdb_home_dir, 0777, MYF(0)); - copy_or_move_dir(ROCKSDB_BACKUP_DIR, rocksdb_home_dir, xtrabackup_copy_back, xtrabackup_copy_back); + ds_data->copy_or_move_dir(ROCKSDB_BACKUP_DIR, rocksdb_home_dir, xtrabackup_copy_back, xtrabackup_copy_back); } diff --git a/extra/mariabackup/backup_copy.h b/extra/mariabackup/backup_copy.h index 62b2b1bc232..b4a323f2e89 100644 --- a/extra/mariabackup/backup_copy.h +++ b/extra/mariabackup/backup_copy.h @@ -14,30 +14,18 @@ extern bool binlog_locked; -bool -backup_file_printf(const char *filename, const char *fmt, ...) - ATTRIBUTE_FORMAT(printf, 2, 0); - /************************************************************************ Return true if first and second arguments are the same path. */ bool equal_paths(const char *first, const char *second); -/************************************************************************ -Copy file for backup/restore. -@return true in case of success. */ -bool -copy_file(ds_ctxt_t *datasink, - const char *src_file_path, - const char *dst_file_path, - uint thread_n); - /** Start --backup */ -bool backup_start(CorruptedPages &corrupted_pages); +bool backup_start(ds_ctxt *ds_data, ds_ctxt *ds_meta, + CorruptedPages &corrupted_pages); /** Release resources after backup_start() */ void backup_release(); /** Finish after backup_start() and backup_release() */ -bool backup_finish(); +bool backup_finish(ds_ctxt *ds_data); bool apply_log_finish(); bool @@ -51,6 +39,5 @@ directory_exists(const char *dir, bool create); lsn_t get_current_lsn(MYSQL *connection); -bool backup_file_print_buf(const char *filename, const char *buf, int buf_len); #endif diff --git a/extra/mariabackup/backup_mysql.cc b/extra/mariabackup/backup_mysql.cc index b895f8c4561..6003bfb36c4 100644 --- a/extra/mariabackup/backup_mysql.cc +++ b/extra/mariabackup/backup_mysql.cc @@ -1383,7 +1383,7 @@ variable. @returns true on success */ bool -write_slave_info(MYSQL *connection) +write_slave_info(ds_ctxt *datasink, MYSQL *connection) { String sql, comment; bool show_all_slaves_status= false; @@ -1413,7 +1413,8 @@ write_slave_info(MYSQL *connection) } mysql_slave_position= strdup(comment.c_ptr()); - return backup_file_print_buf(XTRABACKUP_SLAVE_INFO, sql.ptr(), sql.length()); + return datasink->backup_file_print_buf(XTRABACKUP_SLAVE_INFO, + sql.ptr(), sql.length()); } @@ -1421,7 +1422,7 @@ write_slave_info(MYSQL *connection) Retrieves MySQL Galera and saves it in a file. It also prints it to stdout. */ bool -write_galera_info(MYSQL *connection) +write_galera_info(ds_ctxt *datasink, MYSQL *connection) { char *state_uuid = NULL, *state_uuid55 = NULL; char *last_committed = NULL, *last_committed55 = NULL; @@ -1453,12 +1454,12 @@ write_galera_info(MYSQL *connection) goto cleanup; } - result = backup_file_printf(XTRABACKUP_GALERA_INFO, + result = datasink->backup_file_printf(XTRABACKUP_GALERA_INFO, "%s:%s\n", state_uuid ? state_uuid : state_uuid55, last_committed ? last_committed : last_committed55); if (result) { - write_current_binlog_file(connection); + write_current_binlog_file(datasink, connection); } cleanup: @@ -1472,7 +1473,7 @@ cleanup: Flush and copy the current binary log file into the backup, if GTID is enabled */ bool -write_current_binlog_file(MYSQL *connection) +write_current_binlog_file(ds_ctxt *datasink, MYSQL *connection) { char *executed_gtid_set = NULL; char *gtid_binlog_state = NULL; @@ -1542,7 +1543,7 @@ write_current_binlog_file(MYSQL *connection) snprintf(filepath, sizeof(filepath), "%s%c%s", log_bin_dir, FN_LIBCHAR, log_bin_file); - result = copy_file(ds_data, filepath, log_bin_file, 0); + result = datasink->copy_file(filepath, log_bin_file, 0); } cleanup: @@ -1558,7 +1559,7 @@ cleanup: Retrieves MySQL binlog position and saves it in a file. It also prints it to stdout. */ bool -write_binlog_info(MYSQL *connection) +write_binlog_info(ds_ctxt *datasink, MYSQL *connection) { char *filename = NULL; char *position = NULL; @@ -1603,14 +1604,14 @@ write_binlog_info(MYSQL *connection) "filename '%s', position '%s', " "GTID of the last change '%s'", filename, position, gtid) != -1); - result = backup_file_printf(XTRABACKUP_BINLOG_INFO, + result = datasink->backup_file_printf(XTRABACKUP_BINLOG_INFO, "%s\t%s\t%s\n", filename, position, gtid); } else { ut_a(asprintf(&mysql_binlog_position, "filename '%s', position '%s'", filename, position) != -1); - result = backup_file_printf(XTRABACKUP_BINLOG_INFO, + result = datasink->backup_file_printf(XTRABACKUP_BINLOG_INFO, "%s\t%s\n", filename, position); } @@ -1650,8 +1651,9 @@ PERCONA_SCHEMA.xtrabackup_history and writes a new history record to the table containing all the history info particular to the just completed backup. */ bool -write_xtrabackup_info(MYSQL *connection, const char * filename, bool history, - bool stream) +write_xtrabackup_info(ds_ctxt *datasink, + MYSQL *connection, const char * filename, bool history, + bool stream) { bool result = true; @@ -1727,7 +1729,7 @@ write_xtrabackup_info(MYSQL *connection, const char * filename, bool history, } if (stream) { - backup_file_printf(filename, "%s", buf); + datasink->backup_file_printf(filename, "%s", buf); } else { fp = fopen(filename, "w"); if (!fp) { @@ -1848,9 +1850,9 @@ static std::string make_local_paths(const char *data_file_path) return buf.str(); } -bool write_backup_config_file() +bool write_backup_config_file(ds_ctxt *datasink) { - int rc= backup_file_printf("backup-my.cnf", + int rc= datasink->backup_file_printf("backup-my.cnf", "# This MySQL options file was generated by innobackupex.\n\n" "# The MySQL server\n" "[mysqld]\n" diff --git a/extra/mariabackup/backup_mysql.h b/extra/mariabackup/backup_mysql.h index b61fa2362c6..d80f3bb7bc1 100644 --- a/extra/mariabackup/backup_mysql.h +++ b/extra/mariabackup/backup_mysql.h @@ -62,17 +62,18 @@ void unlock_all(MYSQL *connection); bool -write_current_binlog_file(MYSQL *connection); +write_current_binlog_file(ds_ctxt *datasink, MYSQL *connection); bool -write_binlog_info(MYSQL *connection); +write_binlog_info(ds_ctxt *datasink, MYSQL *connection); bool -write_xtrabackup_info(MYSQL *connection, const char * filename, bool history, - bool stream); +write_xtrabackup_info(ds_ctxt *datasink, + MYSQL *connection, const char * filename, bool history, + bool stream); bool -write_backup_config_file(); +write_backup_config_file(ds_ctxt *datasink); bool lock_binlog_maybe(MYSQL *connection); @@ -84,10 +85,10 @@ bool wait_for_safe_slave(MYSQL *connection); bool -write_galera_info(MYSQL *connection); +write_galera_info(ds_ctxt *datasink, MYSQL *connection); bool -write_slave_info(MYSQL *connection); +write_slave_info(ds_ctxt *datasink, MYSQL *connection); #endif diff --git a/extra/mariabackup/datasink.h b/extra/mariabackup/datasink.h index 4bede4ec9e7..57468e0c9c7 100644 --- a/extra/mariabackup/datasink.h +++ b/extra/mariabackup/datasink.h @@ -37,6 +37,35 @@ typedef struct ds_ctxt { char *root; void *ptr; struct ds_ctxt *pipe_ctxt; + /* + Copy file for backup/restore. + @return true in case of success. + */ + bool copy_file(const char *src_file_path, + const char *dst_file_path, + uint thread_n); + + bool move_file(const char *src_file_path, + const char *dst_file_path, + const char *dst_dir, + uint thread_n); + + bool make_hardlink(const char *from_path, const char *to_path); + + void copy_or_move_dir(const char *from, const char *to, + bool do_copy, bool allow_hardlinks); + + bool backup_file_vprintf(const char *filename, + const char *fmt, va_list ap); + + bool backup_file_print_buf(const char *filename, + const char *buf, + int buf_len); + + bool backup_file_printf(const char *filename, + const char *fmt, ...) + ATTRIBUTE_FORMAT(printf, 2, 0); + } ds_ctxt_t; typedef struct { diff --git a/extra/mariabackup/write_filt.cc b/extra/mariabackup/write_filt.cc index c144a60e378..dd77a9bb953 100644 --- a/extra/mariabackup/write_filt.cc +++ b/extra/mariabackup/write_filt.cc @@ -31,7 +31,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA /************************************************************************ Write-through page write filter. */ -static my_bool wf_wt_init(xb_write_filt_ctxt_t *ctxt, char *dst_name, +static my_bool wf_wt_init(ds_ctxt *ds_meta, + xb_write_filt_ctxt_t *ctxt, char *dst_name, xb_fil_cur_t *cursor, CorruptedPages *corrupted_pages); static my_bool wf_wt_process(xb_write_filt_ctxt_t *ctxt, ds_file_t *dstfile); @@ -44,7 +45,8 @@ xb_write_filt_t wf_write_through = { /************************************************************************ Incremental page write filter. */ -static my_bool wf_incremental_init(xb_write_filt_ctxt_t *ctxt, char *dst_name, +static my_bool wf_incremental_init(ds_ctxt *ds_meta, + xb_write_filt_ctxt_t *ctxt, char *dst_name, xb_fil_cur_t *cursor, CorruptedPages *corrupted_pages); static my_bool wf_incremental_process(xb_write_filt_ctxt_t *ctxt, ds_file_t *dstfile); @@ -64,7 +66,8 @@ Initialize incremental page write filter. @return TRUE on success, FALSE on error. */ static my_bool -wf_incremental_init(xb_write_filt_ctxt_t *ctxt, char *dst_name, +wf_incremental_init(ds_ctxt *ds_meta, + xb_write_filt_ctxt_t *ctxt, char *dst_name, xb_fil_cur_t *cursor, CorruptedPages *corrupted_pages) { char meta_name[FN_REFLEN]; @@ -88,7 +91,7 @@ wf_incremental_init(xb_write_filt_ctxt_t *ctxt, char *dst_name, XB_DELTA_INFO_SUFFIX); const xb_delta_info_t info(cursor->page_size, cursor->zip_size, cursor->space_id); - if (!xb_write_delta_metadata(meta_name, &info)) { + if (!xb_write_delta_metadata(ds_meta, meta_name, &info)) { msg(cursor->thread_n,"Error: " "failed to write meta info for %s", cursor->rel_path); @@ -195,7 +198,8 @@ Initialize the write-through page write filter. @return TRUE on success, FALSE on error. */ static my_bool -wf_wt_init(xb_write_filt_ctxt_t *ctxt, char *dst_name __attribute__((unused)), +wf_wt_init(ds_ctxt *ds_meta __attribute__((unused)), + xb_write_filt_ctxt_t *ctxt, char *dst_name __attribute__((unused)), xb_fil_cur_t *cursor, CorruptedPages *) { ctxt->cursor = cursor; diff --git a/extra/mariabackup/write_filt.h b/extra/mariabackup/write_filt.h index 6c3ef24291f..a0ce0778a7f 100644 --- a/extra/mariabackup/write_filt.h +++ b/extra/mariabackup/write_filt.h @@ -45,7 +45,8 @@ typedef struct { typedef struct { - my_bool (*init)(xb_write_filt_ctxt_t *ctxt, char *dst_name, + my_bool (*init)(ds_ctxt *ds_meta, + xb_write_filt_ctxt_t *ctxt, char *dst_name, xb_fil_cur_t *cursor, CorruptedPages *corrupted_pages); my_bool (*process)(xb_write_filt_ctxt_t *ctxt, ds_file_t *dstfile); my_bool (*finalize)(xb_write_filt_ctxt_t *, ds_file_t *dstfile); diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index ad35749d0ff..ee12034c910 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -291,10 +291,66 @@ char *xb_plugin_dir; char *xb_plugin_load; my_bool xb_close_files; -/* Datasinks */ -ds_ctxt_t *ds_data = NULL; -ds_ctxt_t *ds_meta = NULL; -ds_ctxt_t *ds_redo = NULL; + +class Datasink_free_list +{ +protected: + /* + Simple datasink creation tracking... + add datasinks in the reverse order you want them destroyed. + */ +#define XTRABACKUP_MAX_DATASINKS 10 + ds_ctxt_t *m_datasinks_to_destroy[XTRABACKUP_MAX_DATASINKS]; + uint m_actual_datasinks_to_destroy; +public: + Datasink_free_list() + :m_actual_datasinks_to_destroy(0) + { } + + void add_datasink_to_destroy(ds_ctxt_t *ds) + { + xb_ad(m_actual_datasinks_to_destroy < XTRABACKUP_MAX_DATASINKS); + m_datasinks_to_destroy[m_actual_datasinks_to_destroy] = ds; + m_actual_datasinks_to_destroy++; + } + + /* + Destroy datasinks. + Destruction is done in the specific order to not violate their order in the + pipeline so that each datasink is able to flush data down the pipeline. + */ + void destroy() + { + for (uint i= m_actual_datasinks_to_destroy; i > 0; i--) + { + ds_destroy(m_datasinks_to_destroy[i - 1]); + m_datasinks_to_destroy[i - 1] = NULL; + } + } +}; + + +class Backup_datasinks: public Datasink_free_list +{ +public: + ds_ctxt_t *m_data; + ds_ctxt_t *m_meta; + ds_ctxt_t *m_redo; + + Backup_datasinks() + :m_data(NULL), + m_meta(NULL), + m_redo(NULL) + { } + void init(); + void destroy() + { + Datasink_free_list::destroy(); + *this= Backup_datasinks(); + } + bool backup_low(); +}; + static bool innobackupex_mode = false; @@ -440,7 +496,8 @@ void CorruptedPages::rename_space(ulint space_id, const std::string &new_name) ut_a(!pthread_mutex_unlock(&m_mutex)); } -bool CorruptedPages::print_to_file(const char *filename) const +bool CorruptedPages::print_to_file(ds_ctxt *ds_data, + const char *filename) const { std::ostringstream out; ut_a(!pthread_mutex_lock(&m_mutex)); @@ -468,8 +525,8 @@ bool CorruptedPages::print_to_file(const char *filename) const out << "\n"; } ut_a(!pthread_mutex_unlock(&m_mutex)); - if (xtrabackup_backup) - return backup_file_print_buf(filename, out.str().c_str(), + if (ds_data) + return ds_data->backup_file_print_buf(filename, out.str().c_str(), static_cast(out.str().size())); std::ofstream outfile; outfile.open(filename); @@ -587,19 +644,6 @@ void CorruptedPages::zero_out_free_pages() ut_free(buf); } -/* Simple datasink creation tracking...add datasinks in the reverse order you -want them destroyed. */ -#define XTRABACKUP_MAX_DATASINKS 10 -static ds_ctxt_t *datasinks[XTRABACKUP_MAX_DATASINKS]; -static uint actual_datasinks = 0; -static inline -void -xtrabackup_add_datasink(ds_ctxt_t *ds) -{ - xb_ad(actual_datasinks < XTRABACKUP_MAX_DATASINKS); - datasinks[actual_datasinks] = ds; actual_datasinks++; -} - typedef void (*process_single_tablespace_func_t)(const char *dirname, const char *filname, bool is_remote, @@ -955,6 +999,7 @@ typedef struct { pthread_mutex_t* count_mutex; os_thread_id_t id; CorruptedPages *corrupted_pages; + Backup_datasinks *datasinks; } data_thread_ctxt_t; /* ======== for option and variables ======== */ @@ -2456,7 +2501,8 @@ xb_read_delta_metadata(const char *filepath, xb_delta_info_t *info) Write meta info for an incremental delta. @return TRUE on success, FALSE on failure. */ my_bool -xb_write_delta_metadata(const char *filename, const xb_delta_info_t *info) +xb_write_delta_metadata(ds_ctxt *ds_meta, + const char *filename, const xb_delta_info_t *info) { ds_file_t *f; char buf[64]; @@ -2771,7 +2817,9 @@ xb_get_copy_action(const char *dflt) for full backup, pages filter for incremental backup, etc. @return FALSE on success and TRUE on error */ -static my_bool xtrabackup_copy_datafile(fil_node_t *node, uint thread_n, +static my_bool xtrabackup_copy_datafile(ds_ctxt *ds_data, + ds_ctxt *ds_meta, + fil_node_t *node, uint thread_n, const char *dest_name, const xb_write_filt_t &write_filter, CorruptedPages &corrupted_pages) @@ -2839,7 +2887,7 @@ static my_bool xtrabackup_copy_datafile(fil_node_t *node, uint thread_n, ut_a(write_filter.process != NULL); if (write_filter.init != NULL && - !write_filter.init(&write_filt_ctxt, dst_name, &cursor, + !write_filter.init(ds_meta, &write_filt_ctxt, dst_name, &cursor, opt_log_innodb_page_corruption ? &corrupted_pages : NULL)) { msg (thread_n, "mariabackup: error: failed to initialize page write filter."); goto error; @@ -3204,7 +3252,8 @@ DECLARE_THREAD(data_copy_thread_func)( DBUG_EXECUTE_FOR_KEY("wait_innodb_redo_before_copy", node->space->name, backup_wait_for_lsn(get_current_lsn(mysql_connection));); /* copy the datafile */ - if (xtrabackup_copy_datafile(node, num, NULL, + if (xtrabackup_copy_datafile(ctxt->datasinks->m_data, + ctxt->datasinks->m_meta, node, num, NULL, xtrabackup_incremental ? wf_incremental : wf_write_through, *ctxt->corrupted_pages)) die("failed to copy datafile."); @@ -3230,22 +3279,21 @@ Otherwise (i.e. when streaming in the 'tar' format) we need 2 separate datasinks for the data stream (and don't allow parallel data copying) and for metainfo files (including ib_logfile0). The second datasink writes to temporary files first, and then streams them in a serialized way when closed. */ -static void -xtrabackup_init_datasinks(void) +void Backup_datasinks::init() { /* Start building out the pipelines from the terminus back */ if (xtrabackup_stream) { /* All streaming goes to stdout */ - ds_data = ds_meta = ds_redo = ds_create(xtrabackup_target_dir, - DS_TYPE_STDOUT); + m_data = m_meta = m_redo = ds_create(xtrabackup_target_dir, + DS_TYPE_STDOUT); } else { /* Local filesystem */ - ds_data = ds_meta = ds_redo = ds_create(xtrabackup_target_dir, - DS_TYPE_LOCAL); + m_data = m_meta = m_redo = ds_create(xtrabackup_target_dir, + DS_TYPE_LOCAL); } /* Track it for destruction */ - xtrabackup_add_datasink(ds_data); + add_datasink_to_destroy(m_data); /* Stream formatting */ if (xtrabackup_stream) { @@ -3254,66 +3302,50 @@ xtrabackup_init_datasinks(void) ut_a(xtrabackup_stream_fmt == XB_STREAM_FMT_XBSTREAM); ds = ds_create(xtrabackup_target_dir, DS_TYPE_XBSTREAM); - xtrabackup_add_datasink(ds); + add_datasink_to_destroy(ds); - ds_set_pipe(ds, ds_data); - ds_data = ds; + ds_set_pipe(ds, m_data); + m_data = ds; - ds_redo = ds_meta = ds_data; + m_redo = m_meta = m_data; } - /* Compression for ds_data and ds_redo */ + /* Compression for m_data and m_redo */ if (xtrabackup_compress) { ds_ctxt_t *ds; /* Use a 1 MB buffer for compressed output stream */ ds = ds_create(xtrabackup_target_dir, DS_TYPE_BUFFER); ds_buffer_set_size(ds, 1024 * 1024); - xtrabackup_add_datasink(ds); - ds_set_pipe(ds, ds_data); - if (ds_data != ds_redo) { - ds_data = ds; + add_datasink_to_destroy(ds); + ds_set_pipe(ds, m_data); + if (m_data != m_redo) { + m_data = ds; ds = ds_create(xtrabackup_target_dir, DS_TYPE_BUFFER); ds_buffer_set_size(ds, 1024 * 1024); - xtrabackup_add_datasink(ds); - ds_set_pipe(ds, ds_redo); - ds_redo = ds; + add_datasink_to_destroy(ds); + ds_set_pipe(ds, m_redo); + m_redo = ds; } else { - ds_redo = ds_data = ds; + m_redo = m_data = ds; } ds = ds_create(xtrabackup_target_dir, DS_TYPE_COMPRESS); - xtrabackup_add_datasink(ds); - ds_set_pipe(ds, ds_data); - if (ds_data != ds_redo) { - ds_data = ds; + add_datasink_to_destroy(ds); + ds_set_pipe(ds, m_data); + if (m_data != m_redo) { + m_data = ds; ds = ds_create(xtrabackup_target_dir, DS_TYPE_COMPRESS); - xtrabackup_add_datasink(ds); - ds_set_pipe(ds, ds_redo); - ds_redo = ds; + add_datasink_to_destroy(ds); + ds_set_pipe(ds, m_redo); + m_redo = ds; } else { - ds_redo = ds_data = ds; + m_redo = m_data = ds; } } } -/************************************************************************ -Destroy datasinks. - -Destruction is done in the specific order to not violate their order in the -pipeline so that each datasink is able to flush data down the pipeline. */ -static void xtrabackup_destroy_datasinks(void) -{ - for (uint i = actual_datasinks; i > 0; i--) { - ds_destroy(datasinks[i-1]); - datasinks[i-1] = NULL; - } - ds_data = NULL; - ds_meta = NULL; - ds_redo = NULL; -} - #define SRV_MAX_N_PENDING_SYNC_IOS 100 /** Initialize the tablespace cache subsystem. */ @@ -4447,7 +4479,7 @@ static void stop_backup_threads() /** Implement the core of --backup @return whether the operation succeeded */ -static bool xtrabackup_backup_low() +bool Backup_datasinks::backup_low() { ut_ad(!metadata_to_lsn); @@ -4499,7 +4531,7 @@ static bool xtrabackup_backup_low() } metadata_last_lsn = log_copy_scanned_lsn; - if (!xtrabackup_stream_metadata(ds_meta)) { + if (!xtrabackup_stream_metadata(m_meta)) { msg("Error: failed to stream metadata."); return false; } @@ -4515,7 +4547,8 @@ static bool xtrabackup_backup_low() } sprintf(filename, "%s/%s", xtrabackup_extra_lsndir, XTRABACKUP_INFO); - if (!write_xtrabackup_info(mysql_connection, filename, false, false)) { + if (!write_xtrabackup_info(m_data, + mysql_connection, filename, false, false)) { msg("Error: failed to write info " "to '%s'.", filename); return false; @@ -4535,6 +4568,7 @@ static bool xtrabackup_backup_func() pthread_mutex_t count_mutex; CorruptedPages corrupted_pages; data_thread_ctxt_t *data_threads; + Backup_datasinks backup_datasinks; pthread_mutex_init(&backup_mutex, NULL); pthread_cond_init(&scanned_lsn_cond, NULL); @@ -4686,7 +4720,7 @@ reread_log_header: log_mutex_exit(); - xtrabackup_init_datasinks(); + backup_datasinks.init(); if (!select_history()) { goto fail; @@ -4694,7 +4728,7 @@ reread_log_header: /* open the log file */ memset(&stat_info, 0, sizeof(MY_STAT)); - dst_log_file = ds_open(ds_redo, "ib_logfile0", &stat_info); + dst_log_file = ds_open(backup_datasinks.m_redo, "ib_logfile0", &stat_info); if (dst_log_file == NULL) { msg("Error: failed to open the target stream for " "'ib_logfile0'."); @@ -4812,6 +4846,7 @@ fail_before_log_copying_thread_start: data_threads[i].count = &count; data_threads[i].count_mutex = &count_mutex; data_threads[i].corrupted_pages = &corrupted_pages; + data_threads[i].datasinks= &backup_datasinks; os_thread_create(data_copy_thread_func, data_threads + i, &data_threads[i].id); } @@ -4832,10 +4867,13 @@ fail_before_log_copying_thread_start: datafiles_iter_free(it); } - bool ok = backup_start(corrupted_pages); + DBUG_ASSERT(backup_datasinks.m_data); + DBUG_ASSERT(backup_datasinks.m_meta); + bool ok = backup_start(backup_datasinks.m_data, + backup_datasinks.m_meta, corrupted_pages); if (ok) { - ok = xtrabackup_backup_low(); + ok = backup_datasinks.backup_low(); backup_release(); @@ -4845,12 +4883,13 @@ fail_before_log_copying_thread_start: ); if (ok) { - backup_finish(); + backup_finish(backup_datasinks.m_data); } } if (opt_log_innodb_page_corruption) - ok = corrupted_pages.print_to_file(MB_CORRUPTED_PAGES_FILE); + ok = corrupted_pages.print_to_file(backup_datasinks.m_data, + MB_CORRUPTED_PAGES_FILE); if (!ok) { goto fail; @@ -4859,7 +4898,7 @@ fail_before_log_copying_thread_start: if (changed_page_bitmap) { xb_page_bitmap_deinit(changed_page_bitmap); } - xtrabackup_destroy_datasinks(); + backup_datasinks.destroy(); msg("Redo log (from LSN " LSN_PF " to " LSN_PF ") was copied.", checkpoint_lsn_start, log_copy_scanned_lsn); @@ -4906,7 +4945,7 @@ FTWRL. This ensures consistent backup in presence of DDL. It is the responsibility of the prepare phase to deal with .new, .ren, and .del files. */ -void backup_fix_ddl(CorruptedPages &corrupted_pages) +void CorruptedPages::backup_fix_ddl(ds_ctxt *ds_data, ds_ctxt *ds_meta) { std::set new_tables; std::set dropped_tables; @@ -4929,7 +4968,7 @@ void backup_fix_ddl(CorruptedPages &corrupted_pages) if (ddl_tracker.drops.find(id) != ddl_tracker.drops.end()) { dropped_tables.insert(name); - corrupted_pages.drop_space(id); + drop_space(id); continue; } @@ -4951,20 +4990,20 @@ void backup_fix_ddl(CorruptedPages &corrupted_pages) of it because of optimized DDL. We emulate a drop/create.*/ dropped_tables.insert(name); if (opt_log_innodb_page_corruption) - corrupted_pages.drop_space(id); + drop_space(id); new_tables.insert(new_name); } else { /* Renamed, and no optimized DDL*/ renamed_tables[name] = new_name; if (opt_log_innodb_page_corruption) - corrupted_pages.rename_space(id, new_name); + rename_space(id, new_name); } } else if (has_optimized_ddl) { /* Table was recreated, or optimized DDL ran. In both cases we need a full copy in the backup.*/ new_tables.insert(name); if (opt_log_innodb_page_corruption) - corrupted_pages.drop_space(id); + drop_space(id); } } @@ -4985,7 +5024,7 @@ void backup_fix_ddl(CorruptedPages &corrupted_pages) dropped_tables.erase(name); new_tables.insert(name); if (opt_log_innodb_page_corruption) - corrupted_pages.drop_space(id); + drop_space(id); } } @@ -4994,7 +5033,8 @@ void backup_fix_ddl(CorruptedPages &corrupted_pages) iter != renamed_tables.end(); ++iter) { const std::string old_name = iter->first; std::string new_name = iter->second; - backup_file_printf((old_name + ".ren").c_str(), "%s", new_name.c_str()); + DBUG_ASSERT(ds_data); + ds_data->backup_file_printf((old_name + ".ren").c_str(), "%s", new_name.c_str()); } // Mark tablespaces for drop @@ -5002,7 +5042,7 @@ void backup_fix_ddl(CorruptedPages &corrupted_pages) iter != dropped_tables.end(); iter++) { const std::string name(*iter); - backup_file_printf((name + ".del").c_str(), "%s", ""); + ds_data->backup_file_printf((name + ".del").c_str(), "%s", ""); } // Load and copy new tables. @@ -5046,8 +5086,9 @@ void backup_fix_ddl(CorruptedPages &corrupted_pages) continue; std::string dest_name(node->space->name); dest_name.append(".new"); - xtrabackup_copy_datafile(node, 0, dest_name.c_str(), wf_write_through, - corrupted_pages); + xtrabackup_copy_datafile(ds_data, ds_meta, + node, 0, dest_name.c_str(), + wf_write_through, *this); } datafiles_iter_free(it); @@ -6163,7 +6204,7 @@ static bool xtrabackup_prepare_func(char** argv) } } else - corrupted_pages.print_to_file(MB_CORRUPTED_PAGES_FILE); + corrupted_pages.print_to_file(NULL, MB_CORRUPTED_PAGES_FILE); if (xtrabackup_rollback_xa) { diff --git a/extra/mariabackup/xtrabackup.h b/extra/mariabackup/xtrabackup.h index 854456c3afd..de3a96443a3 100644 --- a/extra/mariabackup/xtrabackup.h +++ b/extra/mariabackup/xtrabackup.h @@ -46,11 +46,13 @@ public: bool contains(ulint space_id, ulint page_no) const; void drop_space(ulint space_id); void rename_space(ulint space_id, const std::string &new_name); - bool print_to_file(const char *file_name) const; + bool print_to_file(ds_ctxt *ds_data, const char *file_name) const; void read_from_file(const char *file_name); bool empty() const; void zero_out_free_pages(); + void backup_fix_ddl(ds_ctxt *ds_data, ds_ctxt *ds_meta); + private: void add_page_no_lock(const char *space_name, ulint space_id, ulint page_no, bool convert_space_name); @@ -63,6 +65,7 @@ private: container_t m_spaces; }; + /* value of the --incremental option */ extern lsn_t incremental_lsn; @@ -76,8 +79,6 @@ extern char *xb_rocksdb_datadir; extern my_bool xb_backup_rocksdb; extern uint opt_protocol; -extern ds_ctxt_t *ds_meta; -extern ds_ctxt_t *ds_data; /* The last checkpoint LSN at the backup startup time */ extern lsn_t checkpoint_lsn_start; @@ -177,7 +178,8 @@ extern ulong opt_binlog_info; extern ulong xtrabackup_innodb_force_recovery; void xtrabackup_io_throttling(void); -my_bool xb_write_delta_metadata(const char *filename, +my_bool xb_write_delta_metadata(ds_ctxt *ds_meta, + const char *filename, const xb_delta_info_t *info); /************************************************************************ From 2ddfb838078cb0f81b48ef878d97b966c8d9c494 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Wed, 5 Apr 2023 16:55:07 +0530 Subject: [PATCH 110/260] MDEV-29273 Race condition between drop table and closing of table - This issue caused by race condition between drop thread and fil_encrypt_thread. fil_encrypt_thread closes the tablespace if the number of opened files exceeds innodb_open_files. fil_node_open_file() closes the tablespace which are open and it doesn't have pending operations. At that time, InnoDB drop tries to write the redo log for the file delete operation. It throws the bad file descriptor error. - When trying to close the file, InnoDB should check whether the table is going to be dropped. --- storage/innobase/fil/fil0fil.cc | 13 +++++++++++-- storage/innobase/include/fil0fil.h | 3 +-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index eee4bd3eb58..7e2b04eaa73 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -100,7 +100,13 @@ bool fil_space_t::try_to_close(bool print_info) if (!node->is_open()) continue; - if (const auto n= space.set_closing()) + /* Other thread is trying to do fil_delete_tablespace() + concurrently for the same tablespace. So ignore this + tablespace and try to close the other one */ + const auto n= space.set_closing(); + if (n & STOPPING) + continue; + if (n & (PENDING | NEEDS_FSYNC)) { if (!print_info) continue; @@ -1372,7 +1378,10 @@ void fil_space_t::close_all() for (ulint count= 10000; count--;) { - if (!space.set_closing()) + const auto n= space.set_closing(); + if (n & STOPPING) + goto next; + if (!(n & (PENDING | NEEDS_FSYNC))) { node->close(); goto next; diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index ff6ece8a360..12ac86dc9be 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -628,8 +628,7 @@ private: @return number of pending operations, possibly with NEEDS_FSYNC flag */ uint32_t set_closing() { - return n_pending.fetch_or(CLOSING, std::memory_order_acquire) & - (PENDING | NEEDS_FSYNC); + return n_pending.fetch_or(CLOSING, std::memory_order_acquire); } public: From ef4d09948d5ff38f5dff8974005ba222a4b18462 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Tue, 11 Apr 2023 21:21:45 -0700 Subject: [PATCH 111/260] MDEV-20773 Error from UPDATE when estimating selectivity of a range This bug could affect multi-update statements as well as single-table update statements processed as multi-updates when the where condition contained a range condition over a non-indexed varchar column. The optimizer calculates selectivity of such range conditions using histograms. For each range the buckets containing endpoints of the the range are determined with a procedure that stores the values of the endpoints in the space of the record buffer where values of the columns are usually stored. For a range over a varchar column the value of a endpoint may exceed the size of the buffer and in such case the value is stored with truncation. This truncations cannot affect the result of the calculation of the range selectivity as the calculation employes only the beginning of the value string. However it can trigger generation of an unexpected error on this truncation if an update statement is processed. This patch prohibits truncation messages when selectivity of a range condition is calculated for a non-indexed column. Approved by Oleksandr Byelkin --- mysql-test/main/update.result | 29 +++++++++++++++++++++++++++++ mysql-test/main/update.test | 23 +++++++++++++++++++++++ sql/opt_range.cc | 3 +++ 3 files changed, 55 insertions(+) diff --git a/mysql-test/main/update.result b/mysql-test/main/update.result index f5edf1c6be3..7b6426d2ec5 100644 --- a/mysql-test/main/update.result +++ b/mysql-test/main/update.result @@ -734,3 +734,32 @@ UPDATE t1,t2 SET t1.i1 = -39 WHERE t2.d1 <> t1.i1 AND t2.d1 = t1.d2; ERROR 22007: Incorrect datetime value: '19' for column `test`.`t1`.`i1` at row 1 DROP TABLE t1,t2; # End of MariaDB 10.2 tests +# +# MDEV-20773: UPDATE with LIKE predicate over non-indexed column +# of VARCHAR type +# +create table t1 (a1 varchar(30), a2 varchar(30) collate utf8_bin); +insert into t1 values +('aa','zzz'), ('b','xxaa'), ('ccc','yyy'), ('ddd','xxb'); +analyze table t1 persistent for all; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +explain extended +update t1 set a1 = 'u' + where a2 like 'xx%' and exists(select 1 from t1 where t1.a1 < 'c'); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 49.22 Using where +2 SUBQUERY t1 ALL NULL NULL NULL NULL 4 50.00 Using where +Warnings: +Note 1003 /* select#1 */ update `test`.`t1` set `test`.`t1`.`a1` = 'u' where `test`.`t1`.`a2` like 'xx%' +update t1 set a1 = 'u' + where a2 like 'xx%' and exists(select 1 from t1 where t1.a1 < 'c'); +select * from t1; +a1 a2 +aa zzz +u xxaa +ccc yyy +u xxb +drop table t1; +# End of MariaDB 10.4 tests diff --git a/mysql-test/main/update.test b/mysql-test/main/update.test index 8a6949447ee..147d69d50c9 100644 --- a/mysql-test/main/update.test +++ b/mysql-test/main/update.test @@ -676,3 +676,26 @@ UPDATE t1,t2 SET t1.i1 = -39 WHERE t2.d1 <> t1.i1 AND t2.d1 = t1.d2; DROP TABLE t1,t2; --echo # End of MariaDB 10.2 tests + +--echo # +--echo # MDEV-20773: UPDATE with LIKE predicate over non-indexed column +--echo # of VARCHAR type +--echo # + +create table t1 (a1 varchar(30), a2 varchar(30) collate utf8_bin); +insert into t1 values + ('aa','zzz'), ('b','xxaa'), ('ccc','yyy'), ('ddd','xxb'); +analyze table t1 persistent for all; + +explain extended +update t1 set a1 = 'u' + where a2 like 'xx%' and exists(select 1 from t1 where t1.a1 < 'c'); + +update t1 set a1 = 'u' + where a2 like 'xx%' and exists(select 1 from t1 where t1.a1 < 'c'); + +select * from t1; + +drop table t1; + +--echo # End of MariaDB 10.4 tests diff --git a/sql/opt_range.cc b/sql/opt_range.cc index c34420181a2..69a95f8da44 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -3518,7 +3518,10 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond) } else { + enum_check_fields save_count_cuted_fields= thd->count_cuted_fields; + thd->count_cuted_fields= CHECK_FIELD_IGNORE; rows= records_in_column_ranges(¶m, idx, key); + thd->count_cuted_fields= save_count_cuted_fields; if (rows != DBL_MAX) { key->field->cond_selectivity= rows/table_records; From d1a4315f4cb096c2fd81c96bc4afc6bb618bae49 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Thu, 13 Apr 2023 07:49:35 +0200 Subject: [PATCH 112/260] MDEV-30402: Encrypted mariabackup SST breaks on distributions with newer socat This commit adds a new 'no-sni' option to socat which is required to properly authenticate with newer socat versions (after version 1.7.4+). This option is needed to disable the automatic use of the SNI feature (Server Name Indication) since the SST script directly specifies the commonname if necessary and automatic activation of the SNI feature is unnecessary in such scenarios. --- scripts/wsrep_sst_mariabackup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh index 7e26af83701..b46e64a9e8b 100644 --- a/scripts/wsrep_sst_mariabackup.sh +++ b/scripts/wsrep_sst_mariabackup.sh @@ -340,6 +340,9 @@ get_transfer() "Use workaround for socat $SOCAT_VERSION bug" fi fi + if check_for_version "$SOCAT_VERSION" '1.7.4'; then + tcmd="$tcmd,no-sni=1" + fi fi if [ "${sockopt#*,dhparam=}" = "$sockopt" ]; then From c0eeb72526bb4c6656d84b89ced33880ca1639d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 13 Apr 2023 12:25:41 +0300 Subject: [PATCH 113/260] MDEV-28974 fixup: Fix error and warning messages fil_name_process(): Starting with commit 212994f704496d01881f377e34e04bd007e5e298 the name is not guaranteed to be NUL terminated. --- storage/innobase/log/log0recv.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 8d05d6a5f14..3b6e3008a95 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -1307,7 +1307,8 @@ same_space: } else { ib::error() << "Tablespace " << space_id << " has been found in two places: '" - << f.name << "' and '" << name << "'." + << f.name << "' and '" + << fname.name << "'." " You must delete one of them."; recv_sys.set_corrupt_fs(); } @@ -1333,7 +1334,8 @@ same_space: ib::info() << "At LSN: " << recv_sys.recovered_lsn - << ": unable to open file " << name + << ": unable to open file " + << fname.name << " for tablespace " << space_id; } break; @@ -1350,8 +1352,9 @@ same_space: ut_ad(space == NULL); if (srv_force_recovery == 0) { sql_print_error("InnoDB: Recovery cannot access" - " file %s (tablespace " - UINT32PF ")", name, space_id); + " file %.*s (tablespace " + UINT32PF ")", int(len), name, + space_id); sql_print_information("InnoDB: You may set " "innodb_force_recovery=1" " to ignore this and" @@ -1362,9 +1365,10 @@ same_space: } sql_print_warning("InnoDB: Ignoring changes to" - " file %s (tablespace " UINT32PF ")" + " file %.*s (tablespace " + UINT32PF ")" " due to innodb_force_recovery", - name, space_id); + int(len), name, space_id); } } } From f50abab195168e497f36715b2f0dbdad8183ed4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 13 Apr 2023 15:18:26 +0300 Subject: [PATCH 114/260] MDEV-31048 PERFORMANCE_SCHEMA lakcs InnoDB read_slots and write_slots tpool::cache::m_mtx: Add PERFORMANCE_SCHEMA instrumentation (wait/synch/mutex/innodb/tpool_cache_mutex). This covers the InnoDB read_slots and write_slots for asynchronous data page I/O. --- storage/innobase/handler/ha_innodb.cc | 2 + storage/innobase/os/os0file.cc | 14 +++--- tpool/tpool_structs.h | 64 ++++++++++++++++++--------- 3 files changed, 55 insertions(+), 25 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 04a857ecd0c..f102789d7ab 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -542,6 +542,7 @@ mysql_pfs_key_t trx_pool_manager_mutex_key; mysql_pfs_key_t lock_wait_mutex_key; mysql_pfs_key_t trx_sys_mutex_key; mysql_pfs_key_t srv_threads_mutex_key; +mysql_pfs_key_t tpool_cache_mutex_key; /* all_innodb_mutexes array contains mutexes that are performance schema instrumented if "UNIV_PFS_MUTEX" @@ -577,6 +578,7 @@ static PSI_mutex_info all_innodb_mutexes[] = { PSI_KEY(rtr_match_mutex), PSI_KEY(rtr_path_mutex), PSI_KEY(trx_sys_mutex), + PSI_KEY(tpool_cache_mutex), }; # endif /* UNIV_PFS_MUTEX */ diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 12561877c0c..d366c784b96 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -132,7 +132,7 @@ public: wait(); } - std::mutex& mutex() + mysql_mutex_t& mutex() { return m_cache.mutex(); } @@ -3668,8 +3668,10 @@ void os_aio_wait_until_no_pending_writes() /** @return number of pending reads */ size_t os_aio_pending_reads() { - std::unique_lock lk(read_slots->mutex()); - return read_slots->pending_io_count(); + mysql_mutex_lock(&read_slots->mutex()); + size_t pending= read_slots->pending_io_count(); + mysql_mutex_unlock(&read_slots->mutex()); + return pending; } /** @return approximate number of pending reads */ @@ -3681,8 +3683,10 @@ size_t os_aio_pending_reads_approx() /** @return number of pending writes */ size_t os_aio_pending_writes() { - std::unique_lock lk(write_slots->mutex()); - return write_slots->pending_io_count(); + mysql_mutex_lock(&write_slots->mutex()); + size_t pending= write_slots->pending_io_count(); + mysql_mutex_unlock(&write_slots->mutex()); + return pending; } /** Wait until all pending asynchronous reads have completed. */ diff --git a/tpool/tpool_structs.h b/tpool/tpool_structs.h index b6ca3f54016..550a92d6e58 100644 --- a/tpool/tpool_structs.h +++ b/tpool/tpool_structs.h @@ -14,14 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/ #pragma once +#include +#include #include #include -#include -#include #include #include - /* Suppress TSAN warnings, that we believe are not critical. */ #if defined(__has_feature) #define TPOOL_HAS_FEATURE(...) __has_feature(__VA_ARGS__) @@ -37,6 +36,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 - 1301 USA*/ #define TPOOL_SUPPRESS_TSAN #endif +#ifdef HAVE_PSI_INTERFACE +typedef unsigned int mysql_pfs_key_t; +extern mysql_pfs_key_t tpool_cache_mutex_key; +#endif + namespace tpool { @@ -55,13 +59,13 @@ namespace tpool template class cache { /** Protects updates of m_pos and m_cache members */ - std::mutex m_mtx; + mysql_mutex_t m_mtx; /** Notify waiting threads about "cache full" or "cache not empty" conditions @see get() and wait() */ - std::condition_variable m_cv; + pthread_cond_t m_cv; /** Cached items vector.Does not change after construction */ std::vector m_base; @@ -108,13 +112,22 @@ public: Constructor @param size - maximum number of items in cache */ - cache(size_t size) : m_mtx(), m_cv(), m_base(size), m_cache(size), + cache(size_t size) : m_base(size), m_cache(size), m_waiters(), m_pos(0) { + mysql_mutex_init(tpool_cache_mutex_key, &m_mtx, nullptr); + pthread_cond_init(&m_cv, nullptr); + for(size_t i= 0 ; i < size; i++) m_cache[i]= &m_base[i]; } + ~cache() + { + mysql_mutex_destroy(&m_mtx); + pthread_cond_destroy(&m_cv); + } + /** Retrieve an item from cache. Waits for free item, if cache is currently empty. @@ -122,16 +135,17 @@ public: */ T* get() { - std::unique_lock lk(m_mtx); - while(is_empty()) - m_cv.wait(lk); + mysql_mutex_lock(&m_mtx); + while (is_empty()) + my_cond_wait(&m_cv, &m_mtx.m_mutex); assert(m_pos < capacity()); // return last element - return m_cache[m_pos++]; + T *t= m_cache[m_pos++]; + mysql_mutex_unlock(&m_mtx); + return t; } - - std::mutex &mutex() { return m_mtx; } + mysql_mutex_t &mutex() { return m_mtx; } /** Put back an element to cache. @@ -139,7 +153,7 @@ public: */ void put(T *ele) { - std::unique_lock lk(m_mtx); + mysql_mutex_lock(&m_mtx); assert(!is_full()); // put element to the logical end of the array m_cache[--m_pos] = ele; @@ -147,7 +161,8 @@ public: /* Notify waiters when the cache becomes not empty, or when it becomes full */ if (m_pos == 1 || (m_waiters && is_full())) - m_cv.notify_all(); + pthread_cond_broadcast(&m_cv); + mysql_mutex_unlock(&m_mtx); } /** Check if pointer represents cached element */ @@ -157,14 +172,23 @@ public: return ele >= &m_base[0] && ele <= &m_base[capacity() - 1]; } - /** Wait until cache is full.*/ + /** Wait until cache is full + @param m cache mutex (locked) */ + void wait(mysql_mutex_t &m) + { + mysql_mutex_assert_owner(&m); + m_waiters++; + while (!is_full()) + my_cond_wait(&m_cv, &m.m_mutex); + m_waiters--; + } + + /* Wait until cache is full.*/ void wait() { - std::unique_lock lk(m_mtx); - m_waiters++; - while(!is_full()) - m_cv.wait(lk); - m_waiters--; + mysql_mutex_lock(&m_mtx); + wait(m_mtx); + mysql_mutex_unlock(&m_mtx); } /** From 2e1c532bd2d9f9a35559e54f66d33c81e33009b1 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Fri, 24 Mar 2023 13:04:05 +1100 Subject: [PATCH 115/260] alloca() fix Corrections from 1e58b8afc086da755cf9209ed17fc36351da5563. * Re-add #pragma alloca for AIX - now in my_alloca.h --- include/my_alloca.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/my_alloca.h b/include/my_alloca.h index 25fd8867e69..de5f32bb886 100644 --- a/include/my_alloca.h +++ b/include/my_alloca.h @@ -34,7 +34,10 @@ #endif #endif -#if defined(HAVE_ALLOCA) +#if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43) +#pragma alloca +#endif /* _AIX */ + /* If the GCC/LLVM compiler from the MinGW is used, alloca may not be defined when using the MSVC CRT: @@ -42,6 +45,5 @@ #if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && !defined(alloca) #define alloca __builtin_alloca #endif /* GNUC */ -#endif #endif /* MY_ALLOCA_INCLUDED */ From 1e4eef5c17167f0740182fe69bff30f9416acfc3 Mon Sep 17 00:00:00 2001 From: Tuukka Pasanen Date: Thu, 13 Apr 2023 10:42:34 +0300 Subject: [PATCH 116/260] MDEV-31045: Fix regression building on Ubuntu 18.04 Github PR #2424 regressed Ubuntu 18.04 building other than x86_64 machines. Architecture that are impacted are PPC64 and ARM64. This was because of changes in debian/rules file which caused removing dependency to package 'libpmem-dev' and CMake which '-DWITH_PMEM' removing not working correctly. Package libpmem-dev was removed but it still required to have PMEM with CMake which. Commit make change that -DWITH_PMEM is correctly removed if it's not wanted. --- debian/autobake-deb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index bad6e6eecf0..e5c5600daf7 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -64,7 +64,7 @@ replace_uring_with_aio() disable_pmem() { sed '/libpmem-dev/d' -i debian/control - sed '/-DWITH_PMEM=YES/d' -i debian/rules + sed '/-DWITH_PMEM=ON/d' -i debian/rules } architecture=$(dpkg-architecture -q DEB_BUILD_ARCH) From 6c196090c8c265bfd93df1e2ee6b18cda2b1d2d8 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Thu, 13 Apr 2023 20:13:13 +0300 Subject: [PATCH 117/260] Fix compilation on gcc 11.2.0 It is used in the out-of date Ubuntu 21.10 Impish. --- storage/innobase/rem/rem0rec.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc index ae8c3c4513e..d202afa9e20 100644 --- a/storage/innobase/rem/rem0rec.cc +++ b/storage/innobase/rem/rem0rec.cc @@ -242,9 +242,9 @@ enum rec_leaf_format { REC_LEAF_INSTANT }; -#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 11 +#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 12 # pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wconversion" /* GCC 5 to 10 need this */ +# pragma GCC diagnostic ignored "-Wconversion" /* GCC 5 to 11 need this */ #endif /** Determine the offset to each field in a leaf-page record in ROW_FORMAT=COMPACT,DYNAMIC,COMPRESSED. From f2fde3f6675dff56e7f46c19c9f041cc7e259d43 Mon Sep 17 00:00:00 2001 From: Tuukka Pasanen Date: Mon, 20 Feb 2023 10:10:09 +0200 Subject: [PATCH 118/260] MDEV-30687: Make small facelifting to autobake-debs.sh Currently autobake-debs.sh does not pass shellcheck it fails making errors: * SC1091 when using shellcheck -x it needs to know where to find ./VERSION. As this is not needed we just specify it as /dev/null as mentioned in shellcheck documentation: https://www.shellcheck.net/wiki/SC1091 * SC2086 make sure that there is no globbing or word splitting in dpkg-buidpackage string. This not big problem or about to happen but now extra parameter parsing is more Bash compliant with using array. Change BUILDPACKAGE_PREPEND to BUILDPACKAGE_DPKGCMD which holds 'eatmydata' if it's available and needed 'dpkg-buildpackage' https://www.shellcheck.net/wiki/SC2086 Fix small script indentation problem. --- debian/autobake-deb.sh | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index e5c5600daf7..cf14eb701b5 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -16,6 +16,7 @@ set -e # Buildbot, running the test suite from installed .debs on a clean VM. export DEB_BUILD_OPTIONS="nocheck $DEB_BUILD_OPTIONS" +# shellcheck source=/dev/null source ./VERSION # General CI optimizations to keep build output smaller if [[ $GITLAB_CI ]] @@ -91,20 +92,20 @@ fi # If not known, use 'unknown' in .deb version identifier if [ -z "${LSBID}" ] then - LSBID="unknown" + LSBID="unknown" fi case "${LSBNAME}" in # Debian - buster) + "buster") replace_uring_with_aio if [ ! "$architecture" = amd64 ] then disable_pmem fi ;& - bullseye|bookworm) + "bullseye"|"bookworm") # mariadb-plugin-rocksdb in control is 4 arches covered by the distro rocksdb-tools # so no removal is necessary. if [[ ! "$architecture" =~ amd64|arm64|ppc64el ]] @@ -116,19 +117,19 @@ in replace_uring_with_aio fi ;& - sid) + "sid") # The default packaging should always target Debian Sid, so in this case # there is intentionally no customizations whatsoever. ;; # Ubuntu - bionic) + "bionic") remove_rocksdb_tools [ "$architecture" != amd64 ] && disable_pmem ;& - focal) + "focal") replace_uring_with_aio ;& - impish|jammy|kinetic) + "impish"|"jammy"|"kinetic") # mariadb-plugin-rocksdb s390x not supported by us (yet) # ubuntu doesn't support mips64el yet, so keep this just # in case something changes. @@ -169,17 +170,34 @@ dch -b -D "${LSBNAME}" -v "${VERSION}" "Automatic build with ${LOGSTRING}." --co echo "Creating package version ${VERSION} ... " +BUILDPACKAGE_DPKGCMD="" + # Use eatmydata is available to build faster with less I/O, skipping fsync() # during the entire build process (safe because a build can always be restarted) if which eatmydata > /dev/null then - BUILDPACKAGE_PREPEND=eatmydata + BUILDPACKAGE_DPKGCMD="eatmydata" +fi + +BUILDPACKAGE_DPKGCMD+="dpkg-buildpackage" + +# Using dpkg-buildpackage args +# -us Allow unsigned sources +# -uc Allow unsigned changes +# -I Tar ignore +BUILDPACKAGE_DPKG_ARGS=(-us -uc -I) + +# There can be also extra flags that are appended to args +if [ -n "$BUILDPACKAGE_FLAGS" ] +then + read -ra BUILDPACKAGE_TMP_ARGS <<< "$BUILDPACKAGE_FLAGS" + BUILDPACKAGE_DPKG_ARGS=("${BUILDPACKAGE_DPKG_ARGS[@]} ${BUILDPACKAGE_TMP_ARGS[@]}") fi # Build the package # Pass -I so that .git and other unnecessary temporary and source control files # will be ignored by dpkg-source when creating the tar.gz source package. -fakeroot $BUILDPACKAGE_PREPEND dpkg-buildpackage -us -uc -I $BUILDPACKAGE_FLAGS +fakeroot -- "${BUILDPACKAGE_DPKGCMD}" "${BUILDPACKAGE_DPKG_ARGS[@]}" # If the step above fails due to missing dependencies, you can manually run # sudo mk-build-deps debian/control -r -i From 0cca8166f3111901019dcd33747a1a1dfd9e66d1 Mon Sep 17 00:00:00 2001 From: Vlad Lesin Date: Fri, 7 Apr 2023 00:16:16 +0300 Subject: [PATCH 119/260] MDEV-30775 Performance regression in fil_space_t::try_to_close() introduced in MDEV-23855 Post-push fix. 10.5 MDEV-30775 fix inserts just opened tablespace just after the element which fil_system.space_list_last_opened points to. In MDEV-25223 fil_system_t::space_list was changed from UT_LIST to ilist. ilist<...>::insert(iterator pos, reference value) inserts element to list before pos. But it was not taken into account during 10.5->10.6 merge in 85cbfaefee694cdd490b357444f24ff16b8042e8, and the fix does not work properly, i.e. it inserted just opened tablespace to the position preceding fil_system.space_list_last_opened. --- storage/innobase/fil/fil0fil.cc | 17 +++++++++++++---- storage/innobase/include/fil0fil.h | 1 + 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 7e2b04eaa73..00ded1ab27e 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -803,8 +803,17 @@ pfs_os_file_t fil_system_t::detach(fil_space_t *space, bool detach_handle) space_list_t::iterator s= space_list_t::iterator(space); if (space_list_last_opened == space) { - space_list_t::iterator prev= s; - space_list_last_opened= &*--prev; + if (s == space_list.begin()) + { + ut_ad(srv_operation > SRV_OPERATION_EXPORT_RESTORED || + srv_shutdown_state > SRV_SHUTDOWN_NONE); + space_list_last_opened= nullptr; + } + else + { + space_list_t::iterator prev= s; + space_list_last_opened= &*--prev; + } } space_list.erase(s); } @@ -1317,9 +1326,9 @@ void fil_system_t::close() void fil_system_t::add_opened_last_to_space_list(fil_space_t *space) { if (UNIV_LIKELY(space_list_last_opened != nullptr)) - space_list.insert(space_list_t::iterator(space_list_last_opened), *space); + space_list.insert(++space_list_t::iterator(space_list_last_opened), *space); else - space_list.push_back(*space); + space_list.push_front(*space); space_list_last_opened= space; } diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index 12ac86dc9be..165994eef35 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -1552,6 +1552,7 @@ public: if (space_list_last_opened == space) { + ut_ad(s != space_list.begin()); space_list_t::iterator prev= s; space_list_last_opened= &*--prev; } From 71f16c836f5f91e2983c28d6a14bf3687bea78bb Mon Sep 17 00:00:00 2001 From: Vlad Lesin Date: Thu, 13 Apr 2023 17:56:38 +0300 Subject: [PATCH 120/260] MDEV-31049 fil_delete_tablespace() returns wrong file handle if tablespace was closed by parallel thread fil_delete_tablespace() stores file handle in local variable and calls mtr_t::commit_file()=>fil_system_t::detach(..., detach_handle=true), which sets space->chain.start->handle = OS_FILE_CLOSED. fil_system_t::detach() is invoked under fil_system.mutex. But before the mutex is acquired some parallel thread can change space->chain.start->handle. fil_delete_tablespace() returns value, stored in local variable, i.e. wrong value. File handle can be closed, for example, from buf_flush_space() when the limit of innodb_open_files exceded and fil_space_t::get() causes fil_space_t::try_to_close() call. fil_space_t::try_to_close() is executed under fil_system.mutex. And mtr_t::commit_file() locks it for fil_system_t::detach() call. fil_system_t::detach() returns detached file handle if its argument detach_handle is true. The fix is to let mtr_t::commit_file() to pass that detached file handle to fil_delete_tablespace(). --- storage/innobase/fil/fil0fil.cc | 4 +--- storage/innobase/include/mtr0mtr.h | 12 +++++++++--- storage/innobase/mtr/mtr0mtr.cc | 12 ++++++++++-- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 00ded1ab27e..19ebdc8d67e 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -1687,9 +1687,7 @@ pfs_os_file_t fil_delete_tablespace(ulint id) mtr_t mtr; mtr.start(); mtr.log_file_op(FILE_DELETE, id, space->chain.start->name); - handle= space->chain.start->handle; - mtr.commit_file(*space, nullptr); - + mtr.commit_file(*space, nullptr, &handle); fil_space_free_low(space); } diff --git a/storage/innobase/include/mtr0mtr.h b/storage/innobase/include/mtr0mtr.h index 60e01abe18d..1c044319ca0 100644 --- a/storage/innobase/include/mtr0mtr.h +++ b/storage/innobase/include/mtr0mtr.h @@ -93,10 +93,16 @@ struct mtr_t { ATTRIBUTE_COLD void commit_shrink(fil_space_t &space); /** Commit a mini-transaction that is deleting or renaming a file. - @param space tablespace that is being renamed or deleted - @param name new file name (nullptr=the file will be deleted) + @param space tablespace that is being renamed or deleted + @param name new file name (nullptr=the file will be deleted) + @param detached_handle if detached_handle != nullptr and if space is detached + during the function execution the file handle if its + node will be set to OS_FILE_CLOSED, and the previous + value of the file handle will be assigned to the + address, pointed by detached_handle. @return whether the operation succeeded */ - ATTRIBUTE_COLD bool commit_file(fil_space_t &space, const char *name); + ATTRIBUTE_COLD bool commit_file(fil_space_t &space, const char *name, + pfs_os_file_t *detached_handle= nullptr); /** Commit a mini-transaction that did not modify any pages, but generated some redo log on a higher level, such as diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc index 2c004cb0aa6..8817c77a6f4 100644 --- a/storage/innobase/mtr/mtr0mtr.cc +++ b/storage/innobase/mtr/mtr0mtr.cc @@ -333,8 +333,14 @@ void mtr_t::commit_shrink(fil_space_t &space) /** Commit a mini-transaction that is deleting or renaming a file. @param space tablespace that is being renamed or deleted @param name new file name (nullptr=the file will be deleted) +@param detached_handle if detached_handle != nullptr and if space is detached + during the function execution the file handle if its + node will be set to OS_FILE_CLOSED, and the previous + value of the file handle will be assigned to the + address, pointed by detached_handle. @return whether the operation succeeded */ -bool mtr_t::commit_file(fil_space_t &space, const char *name) +bool mtr_t::commit_file(fil_space_t &space, const char *name, + pfs_os_file_t *detached_handle) { ut_ad(is_active()); ut_ad(!is_inside_ibuf()); @@ -402,7 +408,9 @@ bool mtr_t::commit_file(fil_space_t &space, const char *name) ut_ad(!space.referenced()); ut_ad(space.is_stopping()); - fil_system.detach(&space, true); + pfs_os_file_t handle = fil_system.detach(&space, true); + if (detached_handle) + *detached_handle = handle; mysql_mutex_unlock(&fil_system.mutex); success= true; From 2230c2e7aa47326da22bfee72da8022f8247e92a Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Mon, 17 Apr 2023 10:14:21 +1000 Subject: [PATCH 121/260] MDEV-27009: Add UCA-14.0.0 collations - License Update UCA license based on: https://www.unicode.org/license.txt and https://www.unicode.org/copyright.html. --- THIRDPARTY | 340 ++++++++++++++++++++++++++++------------------------- 1 file changed, 181 insertions(+), 159 deletions(-) diff --git a/THIRDPARTY b/THIRDPARTY index 35bb238ed1e..87f9bb7a3b5 100644 --- a/THIRDPARTY +++ b/THIRDPARTY @@ -930,180 +930,202 @@ archived older versions of code and data; there is also a smaller HTTP mirror. *************************************************************************** %%The following software may be included in this product: -UnicodeData.txt +http://www.unicode.org/copyright.html -Use of any of this software is governed by the terms of the license below: + Unicode® Copyright and Terms of Use -Unicode Terms of Use + For the general privacy policy governing access to this site, see the Unicode Privacy Policy. - For the general privacy policy governing access to this site, see the - Unicode Privacy Policy. For trademark usage, see the Unicode - Consortium (R) Trademarks and Logo Policy. - Notice to End User: Terms of Use - Carefully read the following legal agreement ("Agreement"). Use or - copying of the software and/or codes provided with this agreement (The - "Software") constitutes your acceptance of these terms + Unicode Copyright + Copyright © 1991-2023 Unicode, Inc. All rights reserved. + Definitions - 1. Unicode Copyright. - 1. Copyright (c) 1991-2008 Unicode, Inc. All rights reserved. - 2. Certain documents and files on this website contain a - legend indicating that "Modification is permitted." Any person - is hereby authorized, without fee, to modify such documents - and files to create derivative works conforming to the - Unicode (R) Standard, subject to Terms and Conditions herein. - 3. Any person is hereby authorized, without fee, to view, use, - reproduce, and distribute all documents and files solely for - informational purposes in the creation of products supporting - the Unicode Standard, subject to the Terms and Conditions - herein. - 4. Further specifications of rights and restrictions - pertaining to the use of the particular set of data files - known as the "Unicode Character Database" can be found in - Exhibit 1. - 5. Each version of the Unicode Standard has further - specifications of rights and restrictions of use. For the book - editions, these are found on the back of the title page. For - the online edition, certain files (such as the PDF files for - book chapters and code charts) carry specific restrictions. - All other files are covered under these general Terms of Use. - To request a permission to reproduce any part of the Unicode - Standard, please contact the Unicode Consortium. - 6. No license is granted to "mirror" the Unicode website where - a fee is charged for access to the "mirror" site. - 7. Modification is not permitted with respect to this - document. All copies of this document must be verbatim. - 2. Restricted Rights Legend. Any technical data or software which is - licensed to the United States of America, its agencies and/or - instrumentalities under this Agreement is commercial technical data - or commercial computer software developed exclusively at private - expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995), - as applicable. For technical data, use, duplication, or disclosure - by the Government is subject to restrictions as set forth in DFARS - 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and - this Agreement. For Software, in accordance with FAR 12-212 or DFARS - 227-7202, as applicable, use, duplication or disclosure by the - Government is subject to the restrictions set forth in this - Agreement. - 3. Warranties and Disclaimers. - 1. This publication and/or website may include technical or - typographical errors or other inaccuracies . Changes are - periodically added to the information herein; these changes - will be incorporated in new editions of the publication and/or - website. Unicode may make improvements and/or changes in the - product(s) and/or program(s) described in this publication - and/or website at any time. - 2. If this file has been purchased on magnetic or optical - media from Unicode, Inc. the sole and exclusive remedy for any - claim will be exchange of the defective media within ninety - (90) days of original purchase. - 3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR - SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND - EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT - LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A - PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE AND ITS - LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN - THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE - REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE - WEBSITE. - 4. Waiver of Damages. In no event shall Unicode or its licensors be - liable for any special, incidental, indirect or consequential - damages of any kind, or any damages whatsoever, whether or not - Unicode was advised of the possibility of the damage, including, - without limitation, those resulting from the following: loss of use, - data or profits, in connection with the use, modification or - distribution of this information or its derivatives. - 5. Trademarks. - 1. Unicode and the Unicode logo are registered trademarks of - Unicode, Inc. - 2. This site contains product names and corporate names of - other companies. All product names and company names and logos - mentioned herein are the trademarks or registered trademarks - of their respective owners. Other products and corporate names - mentioned herein which are trademarks of a third party are - used only for explanation and for the owners' benefit and with - no intent to infringe. - 3. Use of third party products or information referred to - herein is at the user's risk. - 6. Miscellaneous. - 1. Jurisdiction and Venue. This server is operated from a - location in the State of California, United States of America. - Unicode makes no representation that the materials are - appropriate for use in other locations. If you access this - server from other locations, you are responsible for - compliance with local laws. This Agreement, all use of this - site and any claims and damages resulting from use of this - site are governed solely by the laws of the State of - California without regard to any principles which would apply - the laws of a different jurisdiction. The user agrees that any - disputes regarding this site shall be resolved solely in the - courts located in Santa Clara County, California. The user - agrees said courts have personal jurisdiction and agree to - waive any right to transfer the dispute to any other forum. - 2. Modification by Unicode Unicode shall have the right to - modify this Agreement at any time by posting it to this site. - The user may not assign any part of this Agreement without - Unicode's prior written consent. - 3. Taxes. The user agrees to pay any taxes arising from access - to this website or use of the information herein, except for - those based on Unicode's net income. - 4. Severability. If any provision of this Agreement is - declared invalid or unenforceable, the remaining provisions of - this Agreement shall remain in effect. - 5. Entire Agreement. This Agreement constitutes the entire - agreement between the parties. + Unicode Data Files ("DATA FILES") include all data files under the directories: + https://www.unicode.org/Public/ + https://www.unicode.org/reports/ + https://www.unicode.org/ivd/data/ + + Unicode Data Files do not include PDF online code charts under the directory: + https://www.unicode.org/Public/ + + Unicode Software ("SOFTWARE") includes any source code published in the Unicode Standard + or any source code or compiled code under the directories: + https://www.unicode.org/Public/PROGRAMS/ + https://www.unicode.org/Public/cldr/ + http://site.icu-project.org/download/ + + Terms of Use + Certain documents and files on this website contain a legend + indicating that "Modification is permitted." Any person is hereby + authorized, without fee, to modify such documents and files to + create derivative works conforming to the Unicode® Standard, subject + to Terms and Conditions herein. + + Any person is hereby authorized, without fee, to view, use, + reproduce, and distribute all documents and files, subject to the + Terms and Conditions herein. + + Further specifications of rights and restrictions pertaining to the + use of the Unicode DATA FILES and SOFTWARE can be found in the + Unicode Data Files and Software License. + + Each version of the Unicode Standard has further specifications of + rights and restrictions of use. For the book editions (Unicode 5.0 + and earlier), these are found on the back of the title page. + + The Unicode PDF online code charts carry specific restrictions. + Those restrictions are incorporated as the first page of each PDF + code chart. + + All other files, including online documentation of the core + specification for Unicode 6.0 and later, are covered under these + general Terms of Use. + + No license is granted to "mirror" the Unicode website where a fee is + charged for access to the "mirror" site. + + Modification is not permitted with respect to this document. All + copies of this document must be verbatim. + + Restricted Rights Legend + + Any technical data or software which is licensed to the United + States of America, its agencies and/or instrumentalities under this + Agreement is commercial technical data or commercial computer + software developed exclusively at private expense as defined in FAR + 2.101, or DFARS 252.227-7014 (June 1995), as applicable. For + technical data, use, duplication, or disclosure by the Government is + subject to restrictions as set forth in DFARS 202.227-7015 Technical + Data, Commercial and Items (Nov 1995) and this Agreement. For + Software, in accordance with FAR 12-212 or DFARS 227-7202, as + applicable, use, duplication or disclosure by the Government is + subject to the restrictions set forth in this Agreement. + + Warranties and Disclaimers + This publication and/or website may include technical or + typographical errors or other inaccuracies. Changes are periodically + added to the information herein; these changes will be incorporated + in new editions of the publication and/or website. Unicode, Inc. may + make improvements and/or changes in the product(s) and/or program(s) + described in this publication and/or website at any time. + + If this file has been purchased on magnetic or optical media from + Unicode, Inc. the sole and exclusive remedy for any claim will be + exchange of the defective media within ninety (90) days of original + purchase. + + EXCEPT AS PROVIDED IN SECTION E.2, THIS PUBLICATION AND/OR SOFTWARE + IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, + IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR + NON-INFRINGEMENT. UNICODE, INC. AND ITS LICENSORS ASSUME NO + RESPONSIBILITY FOR ERRORS OR OMISSIONS IN THIS PUBLICATION AND/OR + SOFTWARE OR OTHER DOCUMENTS WHICH ARE REFERENCED BY OR LINKED TO + THIS PUBLICATION OR THE UNICODE WEBSITE. + + Waiver of Damages + In no event shall Unicode, Inc. or its licensors be liable for any + special, incidental, indirect or consequential damages of any kind, + or any damages whatsoever, whether or not Unicode, Inc. was advised + of the possibility of the damage, including, without limitation, + those resulting from the following: loss of use, data or profits, in + connection with the use, modification or distribution of this + information or its derivatives. + + Trademarks & Logos + The Unicode Word Mark and the Unicode Logo are trademarks of + Unicode, Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade + names of Unicode, Inc. Use of the information and materials found on + this website indicates your acknowledgement of Unicode, Inc.’s + exclusive worldwide rights in the Unicode Word Mark, the Unicode + Logo, and the Unicode trade names. + + The Unicode Consortium Name and Trademark Usage Policy (“Trademark + Policy”) are incorporated herein by reference and you agree to abide + by the provisions of the Trademark Policy, which may be changed from + time to time in the sole discretion of Unicode, Inc. + + All third party trademarks referenced herein are the property of + their respective owners. + + Miscellaneous + Jurisdiction and Venue. This website is operated from a location in + the State of California, United States of America. Unicode, Inc. + makes no representation that the materials are appropriate for use + in other locations. If you access this website from other locations, + you are responsible for compliance with local laws. This Agreement, + all use of this website and any claims and damages resulting from + use of this website are governed solely by the laws of the State of + California without regard to any principles which would apply the + laws of a different jurisdiction. The user agrees that any disputes + regarding this website shall be resolved solely in the courts + located in Santa Clara County, California. The user agrees said + courts have personal jurisdiction and agree to waive any right to + transfer the dispute to any other forum. + + Modification by Unicode, Inc. Unicode, Inc. shall have the right to + modify this Agreement at any time by posting it to this website. The + user may not assign any part of this Agreement without Unicode, + Inc.’s prior written consent. + + Taxes. The user agrees to pay any taxes arising from access to this + website or use of the information herein, except for those based on + Unicode’s net income. + + Severability. If any provision of this Agreement is declared + invalid or unenforceable, the remaining provisions of this Agreement + shall remain in effect. + + Entire Agreement. This Agreement constitutes the entire agreement + between the parties. EXHIBIT 1 UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE - Unicode Data Files include all data files under the directories -http://www.unicode.org/Public/, http://www.unicode.org/reports/, and -http://www.unicode.org/cldr/data/ . Unicode Software includes any source code -published in the Unicode Standard or under the directories -http://www.unicode.org/Public/, http://www.unicode.org/reports/, and -http://www.unicode.org/cldr/data/. +See Terms of Use +for definitions of Unicode Inc.’s Data Files and Software. - NOTICE TO USER: Carefully read the following legal agreement. BY -DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES -("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND -AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU -DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES -OR SOFTWARE. +NOTICE TO USER: Carefully read the following legal agreement. +BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. +IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +THE DATA FILES OR SOFTWARE. - COPYRIGHT AND PERMISSION NOTICE +COPYRIGHT AND PERMISSION NOTICE - Copyright (c) 1991-2008 Unicode, Inc. All rights reserved. Distributed under -the Terms of Use in http://www.unicode.org/copyright.html. +Copyright © 1991-2023 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in https://www.unicode.org/copyright.html. - Permission is hereby granted, free of charge, to any person obtaining a copy -of the Unicode data files and any associated documentation (the "Data Files") or -Unicode software and any associated documentation (the "Software") to deal in -the Data Files or Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files or -Software are furnished to do so, provided that (a) the above copyright notice(s) -and this permission notice appear with all copies of the Data Files or Software, -(b) both the above copyright notice(s) and this permission notice appear in -associated documentation, and (c) there is clear notice in each modified Data -File or in the Software as well as in the documentation associated with the Data -File(s) or Software that the data or software has been modified. +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. - THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD -PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL -DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING -OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE. +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. - Except as contained in this notice, the name of a copyright holder shall not -be used in advertising or otherwise to promote the sale, use or other dealings -in these Data Files or Software without prior written authorization of the -copyright holder. - - Unicode and the Unicode logo are trademarks of Unicode, Inc., and may be -registered in some jurisdictions. All other trademarks and registered trademarks -mentioned herein are the property of their respective owners. +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. *************************************************************************** From f575de39afacb24cd43c40bf43c27bfcf97a670b Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Tue, 11 Apr 2023 09:39:40 +0200 Subject: [PATCH 122/260] rocksdb: Define _GNU_SOURCE during fallocate CMake probe The glibc headers declare fallocate only if _GNU_SOURCE is defined. Without this change, the probe fails with C compilers which do not support implicit function declarations even if the system does in fact support the fallocate function. Upstream rocksdb does not need this because the probe is run with the C++ compiler, and current g++ versions define _GNU_SOURCE automatically. --- storage/rocksdb/build_rocksdb.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake index 647e51e2f90..ba894d83d75 100644 --- a/storage/rocksdb/build_rocksdb.cmake +++ b/storage/rocksdb/build_rocksdb.cmake @@ -134,8 +134,8 @@ option(WITH_FALLOCATE "build with fallocate" ON) if(WITH_FALLOCATE AND UNIX) include(CheckCSourceCompiles) CHECK_C_SOURCE_COMPILES(" +#define _GNU_SOURCE #include -#include int main() { int fd = open(\"/dev/null\", 0); fallocate(fd, FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE, 0, 1024); From 3b85e3dcc11e9638c9670a299eccdb77a51c1a19 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Sat, 15 Apr 2023 07:52:17 +0800 Subject: [PATCH 123/260] MDEV-30687: Make small facelifting to autobake-debs.sh (fix) Appending to 'eatmydata' will obviously cause an executable that doesn't exist. Use an array to create the entire executable. Also while we are at it, check the fakeroot actually works before using it. --- debian/autobake-deb.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index cf14eb701b5..eed1f65fef6 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -170,34 +170,39 @@ dch -b -D "${LSBNAME}" -v "${VERSION}" "Automatic build with ${LOGSTRING}." --co echo "Creating package version ${VERSION} ... " -BUILDPACKAGE_DPKGCMD="" +BUILDPACKAGE_DPKGCMD=() + +# Fakeroot test +if fakeroot true; then + BUILDPACKAGE_DPKGCMD+=( "fakeroot" "--" ) +fi # Use eatmydata is available to build faster with less I/O, skipping fsync() # during the entire build process (safe because a build can always be restarted) if which eatmydata > /dev/null then - BUILDPACKAGE_DPKGCMD="eatmydata" + BUILDPACKAGE_DPKGCMD+=("eatmydata") fi -BUILDPACKAGE_DPKGCMD+="dpkg-buildpackage" +BUILDPACKAGE_DPKGCMD+=("dpkg-buildpackage") # Using dpkg-buildpackage args # -us Allow unsigned sources # -uc Allow unsigned changes # -I Tar ignore -BUILDPACKAGE_DPKG_ARGS=(-us -uc -I) +BUILDPACKAGE_DPKGCMD+=(-us -uc -I) # There can be also extra flags that are appended to args if [ -n "$BUILDPACKAGE_FLAGS" ] then read -ra BUILDPACKAGE_TMP_ARGS <<< "$BUILDPACKAGE_FLAGS" - BUILDPACKAGE_DPKG_ARGS=("${BUILDPACKAGE_DPKG_ARGS[@]} ${BUILDPACKAGE_TMP_ARGS[@]}") + BUILDPACKAGE_DPKGCMD+=( "${BUILDPACKAGE_TMP_ARGS[@]}" ) fi # Build the package # Pass -I so that .git and other unnecessary temporary and source control files # will be ignored by dpkg-source when creating the tar.gz source package. -fakeroot -- "${BUILDPACKAGE_DPKGCMD}" "${BUILDPACKAGE_DPKG_ARGS[@]}" +"${BUILDPACKAGE_DPKGCMD[@]}" # If the step above fails due to missing dependencies, you can manually run # sudo mk-build-deps debian/control -r -i From d6c8696724c3a803d85f0b4738237bbce8e90f64 Mon Sep 17 00:00:00 2001 From: Monty Date: Mon, 17 Apr 2023 16:46:52 +0300 Subject: [PATCH 124/260] Update BUILD scripts - align compile-am64-debug-max and compile-amd64-debug-all with the 'pentium' versions. - Use system SSL by default - Use "--with-plugin-auth_gssapi=DYNAMIC" as default for max and all builds - all and max builds are now the same (we should probably remove 'all' at some point. --- BUILD/SETUP.sh | 14 +++++++------- BUILD/compile-amd64-debug-all | 5 ++++- BUILD/compile-amd64-debug-max | 7 ++++--- BUILD/compile-pentium64-debug-all | 2 -- BUILD/compile-pentium64-debug-max | 1 - 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index d990608f14e..e51f9df6a6d 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -127,7 +127,7 @@ get_make_parallel_flag # implementation of SSL. --with-ssl=yes will first try system library # then the bundled one --with-ssl=system will use the system library. # We use bundled by default as this is guaranteed to work with Galera -SSL_LIBRARY=--with-ssl +SSL_LIBRARY=--with-ssl=system if [ "x$warning_mode" = "xpedantic" ]; then warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE" @@ -202,6 +202,7 @@ base_configs="$base_configs --with-extra-charsets=complex " base_configs="$base_configs --enable-thread-safe-client " base_configs="$base_configs --with-big-tables $maintainer_mode" base_configs="$base_configs --with-plugin-aria --with-aria-tmp-tables --with-plugin-s3=STATIC" +base_configs="$base_configs $SSL_LIBRARY" if test -d "$path/../cmd-line-utils/readline" then @@ -212,18 +213,17 @@ then fi max_plugins="--with-plugins=max" -max_no_embedded_configs="$SSL_LIBRARY $max_plugins" -max_no_qc_configs="$SSL_LIBRARY $max_plugins --without-query-cache" -max_configs="$SSL_LIBRARY $max_plugins --with-embedded-server --with-libevent --with-plugin-rocksdb=dynamic --with-plugin-test_sql_discovery=DYNAMIC --with-plugin-file_key_management=DYNAMIC --with-plugin-hashicorp_key_management=DYNAMIC" -all_configs="$SSL_LIBRARY $max_plugins --with-embedded-server --with-innodb_plugin --with-libevent" +max_no_embedded_configs="$max_plugins" +max_no_qc_configs="$max_plugins --without-query-cache" +max_configs="$max_plugins --with-embedded-server --with-libevent --with-plugin-rocksdb=dynamic --with-plugin-test_sql_discovery=DYNAMIC --with-plugin-file_key_management=DYNAMIC --with-plugin-hashicorp_key_management=DYNAMIC --with-plugin-auth_gssapi=DYNAMIC" +all_configs="$max_configs" # # CPU and platform specific compilation flags. # alpha_cflags="$check_cpu_cflags -Wa,-m$cpu_flag" -amd64_cflags="$check_cpu_cflags" -amd64_cxxflags="" # If dropping '--with-big-tables', add here "-DBIG_TABLES" pentium_cflags="$check_cpu_cflags -m32" +amd64_cflags="$check_cpu_cflags -m64" pentium64_cflags="$check_cpu_cflags -m64" ppc_cflags="$check_cpu_cflags" sparc_cflags="" diff --git a/BUILD/compile-amd64-debug-all b/BUILD/compile-amd64-debug-all index b8b2ed05402..66f6f3309e2 100755 --- a/BUILD/compile-amd64-debug-all +++ b/BUILD/compile-amd64-debug-all @@ -1,7 +1,10 @@ #! /bin/sh + path=`dirname $0` +set -- "$@" --with-debug=full . "$path/SETUP.sh" + extra_flags="$amd64_cflags $debug_cflags" extra_configs="$amd64_configs $debug_configs $all_configs" - +CC="$CC --pipe" . "$path/FINISH.sh" diff --git a/BUILD/compile-amd64-debug-max b/BUILD/compile-amd64-debug-max index 281f2775cb1..0af32f5decd 100755 --- a/BUILD/compile-amd64-debug-max +++ b/BUILD/compile-amd64-debug-max @@ -1,7 +1,6 @@ #! /bin/sh -# Copyright (c) 2005, 2006 MySQL AB -# Use is subject to license terms +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,11 +13,13 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA path=`dirname $0` . "$path/SETUP.sh" + extra_flags="$amd64_cflags $debug_cflags" extra_configs="$amd64_configs $debug_configs $max_configs" +CC="$CC --pipe" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium64-debug-all b/BUILD/compile-pentium64-debug-all index 7824f7ad47f..8733ad00c02 100755 --- a/BUILD/compile-pentium64-debug-all +++ b/BUILD/compile-pentium64-debug-all @@ -6,7 +6,5 @@ set -- "$@" --with-debug=full extra_flags="$pentium64_cflags $debug_cflags" extra_configs="$pentium_configs $debug_configs $all_configs" - -extra_configs="$extra_configs " CC="$CC --pipe" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium64-debug-max b/BUILD/compile-pentium64-debug-max index 09061de6891..c68a6326e7f 100755 --- a/BUILD/compile-pentium64-debug-max +++ b/BUILD/compile-pentium64-debug-max @@ -21,6 +21,5 @@ path=`dirname $0` extra_flags="$pentium64_cflags $debug_cflags" extra_configs="$pentium_configs $debug_configs $max_configs" -extra_configs="$extra_configs " CC="$CC --pipe" . "$path/FINISH.sh" From 8f87023d3f3fbaad4e33991713db884cbe052fbc Mon Sep 17 00:00:00 2001 From: Andrei Date: Fri, 14 Apr 2023 13:13:03 +0300 Subject: [PATCH 125/260] MDEV-28777 binlog.binlog_truncate_multi_engine failed in bb with Lost connection The 2013 error was right to catch the case B of the test unprepared for an expected simulated crash. The test gets refined to SELECT a (type of) bool value before the crash is invoked. --- .../suite/binlog/t/binlog_truncate_multi_engine.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/binlog/t/binlog_truncate_multi_engine.inc b/mysql-test/suite/binlog/t/binlog_truncate_multi_engine.inc index 52ce4741eaa..f3801070851 100644 --- a/mysql-test/suite/binlog/t/binlog_truncate_multi_engine.inc +++ b/mysql-test/suite/binlog/t/binlog_truncate_multi_engine.inc @@ -20,7 +20,9 @@ connect(con1,localhost,root,,); --source include/show_binary_logs.inc INSERT INTO t1 VALUES (1, REPEAT("x", 1)); INSERT INTO t2 VALUES (1, REPEAT("x", 1)); -if (`SELECT $case = "B"`) +--let $is_case_B=`SELECT $case = "B"` + +if ($is_case_B) { --write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect wait-binlog_truncate_multi_engine.test @@ -39,12 +41,12 @@ if (`SELECT $debug_sync_action != ""`) send COMMIT; --connection default -if (`SELECT $case = "B"`) +if ($is_case_B) { --source include/wait_until_disconnected.inc --source include/start_mysqld.inc } -if (`SELECT $case != "B"`) +if (!$is_case_B) { SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; --echo List of binary logs after rotation From 30b4bb4204cb7d259eaff595c46e69d16b55adc7 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 18 Apr 2023 06:44:03 +0400 Subject: [PATCH 126/260] MDEV-31068 Reuse duplicate case conversion code in ctype-utf8.c and ctype-ucs2.c --- strings/ctype-ucs2.c | 66 ++++-------------------------------- strings/ctype-unidata.h | 56 +++++++++++++++++++++++++++++++ strings/ctype-utf8.c | 74 +++++++++-------------------------------- 3 files changed, 78 insertions(+), 118 deletions(-) diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index 4b29d656731..6b52ade4431 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1284,24 +1284,6 @@ my_uni_utf16(CHARSET_INFO *cs __attribute__((unused)), const char charset_name_utf16le[]= "utf16le"; #define charset_name_utf16le_length (sizeof(charset_name_utf16le)-1) -static inline void -my_tolower_utf16(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) -{ - MY_UNICASE_CHARACTER *page; - if ((*wc <= uni_plane->maxchar) && (page= uni_plane->page[*wc >> 8])) - *wc= page[*wc & 0xFF].tolower; -} - - -static inline void -my_toupper_utf16(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) -{ - MY_UNICASE_CHARACTER *page; - if ((*wc <= uni_plane->maxchar) && (page= uni_plane->page[*wc >> 8])) - *wc= page[*wc & 0xFF].toupper; -} - - static inline void my_tosort_utf16(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) { @@ -1335,7 +1317,7 @@ my_caseup_utf16(CHARSET_INFO *cs, const char *src, size_t srclen, while ((src < srcend) && (res= mb_wc(cs, &wc, (uchar *) src, (uchar *) srcend)) > 0) { - my_toupper_utf16(uni_plane, &wc); + my_toupper_unicode(uni_plane, &wc); if (res != wc_mb(cs, wc, (uchar *) dst, (uchar *) dstend)) break; src+= res; @@ -1393,7 +1375,7 @@ my_casedn_utf16(CHARSET_INFO *cs, const char *src, size_t srclen, while ((src < srcend) && (res= mb_wc(cs, &wc, (uchar *) src, (uchar *) srcend)) > 0) { - my_tolower_utf16(uni_plane, &wc); + my_tolower_unicode(uni_plane, &wc); if (res != wc_mb(cs, wc, (uchar *) dst, (uchar *) dstend)) break; src+= res; @@ -2196,24 +2178,6 @@ my_uni_utf32(CHARSET_INFO *cs __attribute__((unused)), } -static inline void -my_tolower_utf32(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) -{ - MY_UNICASE_CHARACTER *page; - if ((*wc <= uni_plane->maxchar) && (page= uni_plane->page[*wc >> 8])) - *wc= page[*wc & 0xFF].tolower; -} - - -static inline void -my_toupper_utf32(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) -{ - MY_UNICASE_CHARACTER *page; - if ((*wc <= uni_plane->maxchar) && (page= uni_plane->page[*wc >> 8])) - *wc= page[*wc & 0xFF].toupper; -} - - static inline void my_tosort_utf32(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) { @@ -2256,7 +2220,7 @@ my_caseup_utf32(CHARSET_INFO *cs, const char *src, size_t srclen, while ((src < srcend) && (res= my_utf32_uni(cs, &wc, (uchar *)src, (uchar*) srcend)) > 0) { - my_toupper_utf32(uni_plane, &wc); + my_toupper_unicode(uni_plane, &wc); if (res != my_uni_utf32(cs, wc, (uchar*) dst, (uchar*) dstend)) break; src+= res; @@ -2312,7 +2276,7 @@ my_casedn_utf32(CHARSET_INFO *cs, const char *src, size_t srclen, while ((res= my_utf32_uni(cs, &wc, (uchar*) src, (uchar*) srcend)) > 0) { - my_tolower_utf32(uni_plane,&wc); + my_tolower_unicode(uni_plane,&wc); if (res != my_uni_utf32(cs, wc, (uchar*) dst, (uchar*) dstend)) break; src+= res; @@ -3118,24 +3082,6 @@ static int my_uni_ucs2(CHARSET_INFO *cs __attribute__((unused)) , } -static inline void -my_tolower_ucs2(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) -{ - MY_UNICASE_CHARACTER *page; - if ((page= uni_plane->page[(*wc >> 8) & 0xFF])) - *wc= page[*wc & 0xFF].tolower; -} - - -static inline void -my_toupper_ucs2(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) -{ - MY_UNICASE_CHARACTER *page; - if ((page= uni_plane->page[(*wc >> 8) & 0xFF])) - *wc= page[*wc & 0xFF].toupper; -} - - static inline void my_tosort_ucs2(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) { @@ -3157,7 +3103,7 @@ static size_t my_caseup_ucs2(CHARSET_INFO *cs, const char *src, size_t srclen, while ((src < srcend) && (res= my_ucs2_uni(cs, &wc, (uchar *)src, (uchar*) srcend)) > 0) { - my_toupper_ucs2(uni_plane, &wc); + my_toupper_unicode_bmp(uni_plane, &wc); if (res != my_uni_ucs2(cs, wc, (uchar*) dst, (uchar*) dstend)) break; src+= res; @@ -3208,7 +3154,7 @@ static size_t my_casedn_ucs2(CHARSET_INFO *cs, const char *src, size_t srclen, while ((src < srcend) && (res= my_ucs2_uni(cs, &wc, (uchar*) src, (uchar*) srcend)) > 0) { - my_tolower_ucs2(uni_plane, &wc); + my_tolower_unicode_bmp(uni_plane, &wc); if (res != my_uni_ucs2(cs, wc, (uchar*) dst, (uchar*) dstend)) break; src+= res; diff --git a/strings/ctype-unidata.h b/strings/ctype-unidata.h index 9900fd0cedd..df591b6cf83 100644 --- a/strings/ctype-unidata.h +++ b/strings/ctype-unidata.h @@ -24,6 +24,62 @@ extern MY_UNICASE_CHARACTER *my_unicase_default_pages[256]; extern MY_UNICASE_CHARACTER my_unicase_mysql500_page00[256]; extern MY_UNICASE_CHARACTER *my_unicase_mysql500_pages[256]; + +static inline my_wc_t my_u300_tolower_7bit(uchar ch) +{ + return my_unicase_default_page00[ch].tolower; +} + +static inline my_wc_t my_u300_toupper_7bit(uchar ch) +{ + return my_unicase_default_page00[ch].toupper; +} + + +static inline void +my_tolower_unicode_bmp(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) +{ + const MY_UNICASE_CHARACTER *page; + DBUG_ASSERT(*wc <= uni_plane->maxchar); + if ((page= uni_plane->page[*wc >> 8])) + *wc= page[*wc & 0xFF].tolower; +} + + +static inline void +my_toupper_unicode_bmp(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) +{ + const MY_UNICASE_CHARACTER *page; + DBUG_ASSERT(*wc <= uni_plane->maxchar); + if ((page= uni_plane->page[*wc >> 8])) + *wc= page[*wc & 0xFF].toupper; +} + + +static inline void +my_tolower_unicode(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) +{ + if (*wc <= uni_plane->maxchar) + { + const MY_UNICASE_CHARACTER *page; + if ((page= uni_plane->page[(*wc >> 8)])) + *wc= page[*wc & 0xFF].tolower; + } +} + + +static inline void +my_toupper_unicode(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) +{ + if (*wc <= uni_plane->maxchar) + { + const MY_UNICASE_CHARACTER *page; + if ((page= uni_plane->page[(*wc >> 8)])) + *wc= page[*wc & 0xFF].toupper; + } +} + + size_t my_strxfrm_pad_nweights_unicode(uchar *str, uchar *strend, size_t nweights); size_t my_strxfrm_pad_unicode(uchar *str, uchar *strend); diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 06a10034a33..75c12e6354b 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -5207,24 +5207,6 @@ static int my_uni_utf8mb3_no_range(CHARSET_INFO *cs __attribute__((unused)), } -static inline void -my_tolower_utf8mb3(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) -{ - MY_UNICASE_CHARACTER *page; - if ((page= uni_plane->page[(*wc >> 8) & 0xFF])) - *wc= page[*wc & 0xFF].tolower; -} - - -static inline void -my_toupper_utf8mb3(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) -{ - MY_UNICASE_CHARACTER *page; - if ((page= uni_plane->page[(*wc >> 8) & 0xFF])) - *wc= page[*wc & 0xFF].toupper; -} - - static size_t my_caseup_utf8mb3(CHARSET_INFO *cs, const char *src, size_t srclen, char *dst, size_t dstlen) @@ -5239,7 +5221,7 @@ static size_t my_caseup_utf8mb3(CHARSET_INFO *cs, while ((src < srcend) && (srcres= my_utf8mb3_uni(cs, &wc, (uchar *) src, (uchar*) srcend)) > 0) { - my_toupper_utf8mb3(uni_plane, &wc); + my_toupper_unicode_bmp(uni_plane, &wc); if ((dstres= my_uni_utf8mb3(cs, wc, (uchar*) dst, (uchar*) dstend)) <= 0) break; src+= srcres; @@ -5292,7 +5274,7 @@ static size_t my_caseup_str_utf8mb3(CHARSET_INFO *cs, char *src) while (*src && (srcres= my_utf8mb3_uni_no_range(cs, &wc, (uchar *) src)) > 0) { - my_toupper_utf8mb3(uni_plane, &wc); + my_toupper_unicode_bmp(uni_plane, &wc); if ((dstres= my_uni_utf8mb3_no_range(cs, wc, (uchar*) dst)) <= 0) break; src+= srcres; @@ -5317,7 +5299,7 @@ static size_t my_casedn_utf8mb3(CHARSET_INFO *cs, while ((src < srcend) && (srcres= my_utf8mb3_uni(cs, &wc, (uchar*) src, (uchar*)srcend)) > 0) { - my_tolower_utf8mb3(uni_plane, &wc); + my_tolower_unicode_bmp(uni_plane, &wc); if ((dstres= my_uni_utf8mb3(cs, wc, (uchar*) dst, (uchar*) dstend)) <= 0) break; src+= srcres; @@ -5338,7 +5320,7 @@ static size_t my_casedn_str_utf8mb3(CHARSET_INFO *cs, char *src) while (*src && (srcres= my_utf8mb3_uni_no_range(cs, &wc, (uchar *) src)) > 0) { - my_tolower_utf8mb3(uni_plane, &wc); + my_tolower_unicode_bmp(uni_plane, &wc); if ((dstres= my_uni_utf8mb3_no_range(cs, wc, (uchar*) dst)) <= 0) break; src+= srcres; @@ -5397,7 +5379,7 @@ int my_strcasecmp_utf8mb3(CHARSET_INFO *cs, const char *s, const char *t) It represents a single byte character. Convert it into weight according to collation. */ - s_wc= my_unicase_default_page00[(uchar) s[0]].tolower; + s_wc= my_u300_tolower_7bit((uchar) s[0]); s++; } else @@ -5430,7 +5412,7 @@ int my_strcasecmp_utf8mb3(CHARSET_INFO *cs, const char *s, const char *t) s+= res; /* Convert Unicode code into weight according to collation */ - my_tolower_utf8mb3(uni_plane, &s_wc); + my_tolower_unicode_bmp(uni_plane, &s_wc); } @@ -5439,7 +5421,7 @@ int my_strcasecmp_utf8mb3(CHARSET_INFO *cs, const char *s, const char *t) if ((uchar) t[0] < 128) { /* Convert single byte character into weight */ - t_wc= my_unicase_default_page00[(uchar) t[0]].tolower; + t_wc= my_u300_tolower_7bit((uchar) t[0]); t++; } else @@ -5450,7 +5432,7 @@ int my_strcasecmp_utf8mb3(CHARSET_INFO *cs, const char *s, const char *t) t+= res; /* Convert code into weight */ - my_tolower_utf8mb3(uni_plane, &t_wc); + my_tolower_unicode_bmp(uni_plane, &t_wc); } /* Now we have two weights, let's compare them */ @@ -7678,30 +7660,6 @@ my_wc_mb_utf8mb4_no_range(CHARSET_INFO *cs __attribute__((unused)), } -static inline void -my_tolower_utf8mb4(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) -{ - if (*wc <= uni_plane->maxchar) - { - MY_UNICASE_CHARACTER *page; - if ((page= uni_plane->page[(*wc >> 8)])) - *wc= page[*wc & 0xFF].tolower; - } -} - - -static inline void -my_toupper_utf8mb4(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) -{ - if (*wc <= uni_plane->maxchar) - { - MY_UNICASE_CHARACTER *page; - if ((page= uni_plane->page[(*wc >> 8)])) - *wc= page[*wc & 0xFF].toupper; - } -} - - static size_t my_caseup_utf8mb4(CHARSET_INFO *cs, const char *src, size_t srclen, char *dst, size_t dstlen) @@ -7717,7 +7675,7 @@ my_caseup_utf8mb4(CHARSET_INFO *cs, const char *src, size_t srclen, (srcres= my_mb_wc_utf8mb4(cs, &wc, (uchar *) src, (uchar*) srcend)) > 0) { - my_toupper_utf8mb4(uni_plane, &wc); + my_toupper_unicode(uni_plane, &wc); if ((dstres= my_wc_mb_utf8mb4(cs, wc, (uchar*) dst, (uchar*) dstend)) <= 0) break; src+= srcres; @@ -7784,7 +7742,7 @@ my_caseup_str_utf8mb4(CHARSET_INFO *cs, char *src) while (*src && (srcres= my_mb_wc_utf8mb4_no_range(cs, &wc, (uchar *) src)) > 0) { - my_toupper_utf8mb4(uni_plane, &wc); + my_toupper_unicode(uni_plane, &wc); if ((dstres= my_wc_mb_utf8mb4_no_range(cs, wc, (uchar*) dst)) <= 0) break; src+= srcres; @@ -7811,7 +7769,7 @@ my_casedn_utf8mb4(CHARSET_INFO *cs, (srcres= my_mb_wc_utf8mb4(cs, &wc, (uchar*) src, (uchar*) srcend)) > 0) { - my_tolower_utf8mb4(uni_plane, &wc); + my_tolower_unicode(uni_plane, &wc); if ((dstres= my_wc_mb_utf8mb4(cs, wc, (uchar*) dst, (uchar*) dstend)) <= 0) break; src+= srcres; @@ -7833,7 +7791,7 @@ my_casedn_str_utf8mb4(CHARSET_INFO *cs, char *src) while (*src && (srcres= my_mb_wc_utf8mb4_no_range(cs, &wc, (uchar *) src)) > 0) { - my_tolower_utf8mb4(uni_plane, &wc); + my_tolower_unicode(uni_plane, &wc); if ((dstres= my_wc_mb_utf8mb4_no_range(cs, wc, (uchar*) dst)) <= 0) break; src+= srcres; @@ -7888,7 +7846,7 @@ my_strcasecmp_utf8mb4(CHARSET_INFO *cs, const char *s, const char *t) It represents a single byte character. Convert it into weight according to collation. */ - s_wc= my_unicase_default_page00[(uchar) s[0]].tolower; + s_wc= my_u300_tolower_7bit((uchar) s[0]); s++; } else @@ -7903,7 +7861,7 @@ my_strcasecmp_utf8mb4(CHARSET_INFO *cs, const char *s, const char *t) return strcmp(s, t); s+= res; - my_tolower_utf8mb4(uni_plane, &s_wc); + my_tolower_unicode(uni_plane, &s_wc); } @@ -7912,7 +7870,7 @@ my_strcasecmp_utf8mb4(CHARSET_INFO *cs, const char *s, const char *t) if ((uchar) t[0] < 128) { /* Convert single byte character into weight */ - t_wc= my_unicase_default_page00[(uchar) t[0]].tolower; + t_wc= my_u300_tolower_7bit((uchar) t[0]); t++; } else @@ -7922,7 +7880,7 @@ my_strcasecmp_utf8mb4(CHARSET_INFO *cs, const char *s, const char *t) return strcmp(s, t); t+= res; - my_tolower_utf8mb4(uni_plane, &t_wc); + my_tolower_unicode(uni_plane, &t_wc); } /* Now we have two weights, let's compare them */ From 2ad287caad59f7dd9f403cea16885e862a839564 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 18 Apr 2023 09:40:41 +0400 Subject: [PATCH 127/260] MDEV-31069 Reuse duplicate char-to-weight conversion code in ctype-utf8.c and ctype-ucs2.c Removing similar functions from ctype-utf8.c and ctype-ucs2.c - my_tosort_utf16() - my_tosort_utf32() - my_tosort_ucs2() - my_tosort_unicode() Adding new shared functions into ctype-unidata.h: - my_tosort_unicode_bmp() - reused for utf8mb3, ucs2 - my_tosort_unicode() - reused for utf8mb4, utf16, utf32 For simplicity, the new version of my_tosort_unicode*() does not include the code handling the MY_CS_LOWER_SORT flag because: - it affects performance negatively - we don't have any collations with this flag yet anyway (This code was most likely earlier erroneously merged from MySQL's utf8_tolower_ci at some point.) --- strings/ctype-ucs2.c | 46 +++-------------------------------------- strings/ctype-unidata.h | 26 +++++++++++++++++++++++ strings/ctype-utf8.c | 37 +++++++++------------------------ 3 files changed, 39 insertions(+), 70 deletions(-) diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index 6b52ade4431..c4ac54e4462 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1284,22 +1284,6 @@ my_uni_utf16(CHARSET_INFO *cs __attribute__((unused)), const char charset_name_utf16le[]= "utf16le"; #define charset_name_utf16le_length (sizeof(charset_name_utf16le)-1) -static inline void -my_tosort_utf16(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) -{ - if (*wc <= uni_plane->maxchar) - { - MY_UNICASE_CHARACTER *page; - if ((page= uni_plane->page[*wc >> 8])) - *wc= page[*wc & 0xFF].sort; - } - else - { - *wc= MY_CS_REPLACEMENT_CHARACTER; - } -} - - static size_t my_caseup_utf16(CHARSET_INFO *cs, const char *src, size_t srclen, @@ -1341,7 +1325,7 @@ my_hash_sort_utf16_nopad(CHARSET_INFO *cs, while ((s < e) && (res= mb_wc(cs, &wc, (uchar *) s, (uchar *) e)) > 0) { - my_tosort_utf16(uni_plane, &wc); + my_tosort_unicode(uni_plane, &wc); MY_HASH_ADD_16(m1, m2, wc); s+= res; } @@ -2178,22 +2162,6 @@ my_uni_utf32(CHARSET_INFO *cs __attribute__((unused)), } -static inline void -my_tosort_utf32(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) -{ - if (*wc <= uni_plane->maxchar) - { - MY_UNICASE_CHARACTER *page; - if ((page= uni_plane->page[*wc >> 8])) - *wc= page[*wc & 0xFF].sort; - } - else - { - *wc= MY_CS_REPLACEMENT_CHARACTER; - } -} - - static size_t my_lengthsp_utf32(CHARSET_INFO *cs __attribute__((unused)), const char *ptr, size_t length) @@ -2242,7 +2210,7 @@ my_hash_sort_utf32_nopad(CHARSET_INFO *cs, const uchar *s, size_t slen, while ((res= my_utf32_uni(cs, &wc, (uchar*) s, (uchar*) e)) > 0) { - my_tosort_utf32(uni_plane, &wc); + my_tosort_unicode(uni_plane, &wc); MY_HASH_ADD(m1, m2, (uint) (wc >> 24)); MY_HASH_ADD(m1, m2, (uint) (wc >> 16) & 0xFF); MY_HASH_ADD(m1, m2, (uint) (wc >> 8) & 0xFF); @@ -3082,14 +3050,6 @@ static int my_uni_ucs2(CHARSET_INFO *cs __attribute__((unused)) , } -static inline void -my_tosort_ucs2(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) -{ - MY_UNICASE_CHARACTER *page; - if ((page= uni_plane->page[(*wc >> 8) & 0xFF])) - *wc= page[*wc & 0xFF].sort; -} - static size_t my_caseup_ucs2(CHARSET_INFO *cs, const char *src, size_t srclen, char *dst, size_t dstlen) { @@ -3125,7 +3085,7 @@ my_hash_sort_ucs2_nopad(CHARSET_INFO *cs, const uchar *s, size_t slen, while ((s < e) && (res=my_ucs2_uni(cs,&wc, (uchar *)s, (uchar*)e)) >0) { - my_tosort_ucs2(uni_plane, &wc); + my_tosort_unicode_bmp(uni_plane, &wc); MY_HASH_ADD_16(m1, m2, wc); s+=res; } diff --git a/strings/ctype-unidata.h b/strings/ctype-unidata.h index df591b6cf83..24cf3e3ea05 100644 --- a/strings/ctype-unidata.h +++ b/strings/ctype-unidata.h @@ -36,6 +36,32 @@ static inline my_wc_t my_u300_toupper_7bit(uchar ch) } +static inline void my_tosort_unicode_bmp(MY_UNICASE_INFO *uni_plane, + my_wc_t *wc) +{ + const MY_UNICASE_CHARACTER *page; + DBUG_ASSERT(*wc <= uni_plane->maxchar); + if ((page= uni_plane->page[*wc >> 8])) + *wc= page[*wc & 0xFF].sort; +} + + +static inline void my_tosort_unicode(MY_UNICASE_INFO *uni_plane, + my_wc_t *wc) +{ + if (*wc <= uni_plane->maxchar) + { + const MY_UNICASE_CHARACTER *page; + if ((page= uni_plane->page[*wc >> 8])) + *wc= page[*wc & 0xFF].sort; + } + else + { + *wc= MY_CS_REPLACEMENT_CHARACTER; + } +} + + static inline void my_tolower_unicode_bmp(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) { diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 75c12e6354b..01beb8c9f19 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -4638,23 +4638,6 @@ MY_UNICASE_INFO my_unicase_unicode520= }; -static inline void -my_tosort_unicode(MY_UNICASE_INFO *uni_plane, my_wc_t *wc, uint flags) -{ - if (*wc <= uni_plane->maxchar) - { - MY_UNICASE_CHARACTER *page; - if ((page= uni_plane->page[*wc >> 8])) - *wc= (flags & MY_CS_LOWER_SORT) ? - page[*wc & 0xFF].tolower : - page[*wc & 0xFF].sort; - } - else - { - *wc= MY_CS_REPLACEMENT_CHARACTER; - } -} - static uint my_casefold_multiply_utf8mbx(CHARSET_INFO *cs) @@ -4734,8 +4717,8 @@ int my_wildcmp_unicode_impl(CHARSET_INFO *cs, { if (weights) { - my_tosort_unicode(weights, &s_wc, cs->state); - my_tosort_unicode(weights, &w_wc, cs->state); + my_tosort_unicode(weights, &s_wc); + my_tosort_unicode(weights, &w_wc); } if (s_wc != w_wc) return 1; /* No match */ @@ -4803,8 +4786,8 @@ int my_wildcmp_unicode_impl(CHARSET_INFO *cs, return 1; if (weights) { - my_tosort_unicode(weights, &s_wc, cs->state); - my_tosort_unicode(weights, &w_wc, cs->state); + my_tosort_unicode(weights, &s_wc); + my_tosort_unicode(weights, &w_wc); } if (s_wc == w_wc) @@ -5242,7 +5225,7 @@ static void my_hash_sort_utf8mb3_nopad(CHARSET_INFO *cs, const uchar *s, size_t while ((s < e) && (res=my_utf8mb3_uni(cs,&wc, (uchar *)s, (uchar*)e))>0 ) { - my_tosort_unicode(uni_plane, &wc, cs->state); + my_tosort_unicode(uni_plane, &wc); MY_HASH_ADD_16(m1, m2, wc); s+= res; } @@ -5976,8 +5959,8 @@ static int my_strnncoll_utf8mb3_cs(CHARSET_INFO *cs, save_diff = ((int)s_wc) - ((int)t_wc); } - my_tosort_unicode(uni_plane, &s_wc, cs->state); - my_tosort_unicode(uni_plane, &t_wc, cs->state); + my_tosort_unicode(uni_plane, &s_wc); + my_tosort_unicode(uni_plane, &t_wc); if ( s_wc != t_wc ) { @@ -6018,8 +6001,8 @@ static int my_strnncollsp_utf8mb3_cs(CHARSET_INFO *cs, save_diff = ((int)s_wc) - ((int)t_wc); } - my_tosort_unicode(uni_plane, &s_wc, cs->state); - my_tosort_unicode(uni_plane, &t_wc, cs->state); + my_tosort_unicode(uni_plane, &s_wc); + my_tosort_unicode(uni_plane, &t_wc); if ( s_wc != t_wc ) { @@ -7697,7 +7680,7 @@ my_hash_sort_utf8mb4_nopad(CHARSET_INFO *cs, const uchar *s, size_t slen, while ((res= my_mb_wc_utf8mb4(cs, &wc, (uchar*) s, (uchar*) e)) > 0) { - my_tosort_unicode(uni_plane, &wc, cs->state); + my_tosort_unicode(uni_plane, &wc); MY_HASH_ADD_16(m1, m2, (uint) (wc & 0xFFFF)); if (wc > 0xFFFF) { From 1995c626a563aa3b2760704fdc6502f69aa35dbf Mon Sep 17 00:00:00 2001 From: Daniel Lenski Date: Fri, 14 Apr 2023 12:38:16 -0700 Subject: [PATCH 128/260] [MDEV-30854] Do not use " as string delimiter in mariadb-tzinfo-to-sql If SQL_MODE contains ANSI_QUOTES (https://mariadb.com/kb/en/sql-mode/), then the double-quote character (") is not a legal string delimiter. In https://github.com/MariaDB/server/commit/13e77930e615f05cc74d408110e887b00e1abcc9#diff-a333d4ebb2d73b6361ef7dfebc86d883f7e19853b4a9eb85984b039058fae47cR2431-R2435, Daniel Black introduced a case where the double-quote character would be used as a string delimiter in the SQL queries generated by mariadb-tzinfo-to-sql. This tool tool generates SQL queries which should be able to run on any MariaDB server of the matching version. Therefore, it should be extremely conservative in the SQL that it outputs, in order to maximize the chance that it can run regardless of the build or execution environment of the server. See MDEV-18778, MDEV-28263, and MDEV-28782 for previous cases where MariaDB has FAILED TO ENSURE that the generated timezone.sql actually works in different build and execution environments. More test coverage is clearly needed here. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc. --- .../main/mysql_tzinfo_to_sql_symlink.result | 42 +++++++++---------- sql/tztime.cc | 4 +- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/mysql-test/main/mysql_tzinfo_to_sql_symlink.result b/mysql-test/main/mysql_tzinfo_to_sql_symlink.result index b6b35e44988..97548768a2d 100644 --- a/mysql-test/main/mysql_tzinfo_to_sql_symlink.result +++ b/mysql-test/main/mysql_tzinfo_to_sql_symlink.result @@ -10,13 +10,13 @@ CREATE TABLE time_zone_leap_second LIKE mysql.time_zone_leap_second; set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on'); SET STATEMENT SQL_MODE='' FOR SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC; set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_name''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_name ENGINE=InnoDB', 'do 0'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition_type'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition_type''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0'); TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; @@ -59,13 +59,13 @@ execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_t set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on'); SET STATEMENT SQL_MODE='' FOR SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC; set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_name''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_name ENGINE=InnoDB', 'do 0'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition_type'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition_type''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0'); TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; @@ -191,13 +191,13 @@ TRUNCATE TABLE time_zone_leap_second; set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on'); SET STATEMENT SQL_MODE='' FOR SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC; set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_name''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_name ENGINE=InnoDB', 'do 0'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition_type'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition_type''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0'); /*M!100602 execute immediate if(@wsrep_cannot_replicate_tz, 'start transaction', 'LOCK TABLES time_zone WRITE, time_zone_leap_second WRITE, @@ -313,20 +313,20 @@ TRUNCATE TABLE time_zone_leap_second; set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on'); SET STATEMENT SQL_MODE='' FOR SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC; set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_name''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_name ENGINE=InnoDB', 'do 0'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition_type'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition_type''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0'); /*M!100602 execute immediate if(@wsrep_cannot_replicate_tz, 'start transaction', 'LOCK TABLES time_zone WRITE, time_zone_leap_second WRITE, time_zone_name WRITE, time_zone_transition WRITE, time_zone_transition_type WRITE')*/; -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_leap_second_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_leap_second'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_leap_second_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_leap_second''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_leap_second ENGINE=InnoDB', 'do 0'); TRUNCATE TABLE time_zone_leap_second; execute immediate if(@wsrep_cannot_replicate_tz, concat('ALTER TABLE time_zone_leap_second ENGINE=', @time_zone_leap_second_engine), 'do 0'); @@ -497,13 +497,13 @@ set sql_mode=default; set @wsrep_is_on=(select coalesce(sum(SESSION_VALUE='ON'), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_on'); SET STATEMENT SQL_MODE='' FOR SELECT concat('%', GROUP_CONCAT(OPTION), '%') INTO @replicate_opt FROM (SELECT DISTINCT concat('REPLICATE_', UPPER(ENGINE)) AS OPTION FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME IN ('time_zone', 'time_zone_name', 'time_zone_transition', 'time_zone_transition_type', 'time_zone_leap_second') AND ENGINE in ('MyISAM', 'Aria')) AS o ORDER BY OPTION DESC; set @wsrep_cannot_replicate_tz=@wsrep_is_on AND (select coalesce(sum(GLOBAL_VALUE NOT LIKE @replicate_opt), 0) from information_schema.SYSTEM_VARIABLES WHERE VARIABLE_NAME='wsrep_mode'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone ENGINE=InnoDB', 'do 0'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_name'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_name_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_name''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_name ENGINE=InnoDB', 'do 0'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition ENGINE=InnoDB', 'do 0'); -execute immediate if(@wsrep_cannot_replicate_tz, "select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME='time_zone_transition_type'", 'do 0'); +execute immediate if(@wsrep_cannot_replicate_tz, 'select ENGINE into @time_zone_transition_type_engine from information_schema.TABLES where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''time_zone_transition_type''', 'do 0'); execute immediate if(@wsrep_cannot_replicate_tz, 'ALTER TABLE time_zone_transition_type ENGINE=InnoDB', 'do 0'); TRUNCATE TABLE time_zone; TRUNCATE TABLE time_zone_name; diff --git a/sql/tztime.cc b/sql/tztime.cc index 8286744e192..1c482718cc8 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -2429,9 +2429,9 @@ print_tz_as_sql(const char* tz_name, const TIME_ZONE_INFO *sp) #define SAVE_ENGINE(e) \ - "\"select ENGINE into @" e "_engine" \ + "'select ENGINE into @" e "_engine" \ " from information_schema.TABLES" \ - " where TABLE_SCHEMA=DATABASE() and TABLE_NAME='" e "'\"" + " where TABLE_SCHEMA=DATABASE() and TABLE_NAME=''" e "'''" /* Print info about leap seconds in time zone as SQL statements From 6075f12c657b103446d230e0d308778d3852b0db Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 24 Feb 2023 19:22:32 +0400 Subject: [PATCH 129/260] MDEV-31071 Refactor case folding data types in Unicode collations This is a non-functional change. It changes the way how case folding data and weight data (for simple Unicode collations) are stored: - Removing data types MY_UNICASE_CHARACTER, MY_UNICASE_INFO - Using data types MY_CASEFOLD_CHARACTER, MY_CASEFOLD_INFO instead. This patch changes simple Unicode collations in a similar way how MDEV-30695 previously changed Asian collations. No new MTR tests are needed. The underlying code is thoroughly covered by a number of ctype_*_ws.test and ctype_*_casefold.test files, which were added recently as a preparation for this change. Old and new Unicode data layout ------------------------------- Case folding data is now stored in separate tables consisting of MY_CASEFOLD_CHARACTER elements with two members: typedef struct casefold_info_char_t { uint32 toupper; uint32 tolower; } MY_CASEFOLD_CHARACTER; while weight data (for simple non-UCA collations xxx_general_ci and xxx_general_mysql500_ci) is stored in separate arrays of uint16 elements. Before this change case folding data and simple weight data were stored together, in tables of the following elements with three members: typedef struct unicase_info_char_st { uint32 toupper; uint32 tolower; uint32 sort; /* weights for simple collations */ } MY_UNICASE_CHARACTER; This data format was redundant, because weights (the "sort" member) were needed only for these two simple Unicode collations: - xxx_general_ci - xxx_general_mysql500_ci Adding case folding information for Unicode-14.0.0 using the old format would waste memory without purpose. Detailed changes ---------------- - Changing the underlying data types as described above - Including unidata-dump.c into the sources. This program was earlier used to dump UnicodeData.txt (e.g. https://www.unicode.org/Public/14.0.0/ucd/UnicodeData.txt) into MySQL / MariaDB source files. It was originally written in 2002, but has not been distributed yet together with MySQL / MariaDB sources. - Removing the old format Unicode data earlier dumped from UnicodeData.txt (versions 3.0.0 and 5.2.0) from ctype-utf8.c. Adding Unicode data in the new format into separate header files, to maintain the code easier: - ctype-unicode300-casefold.h - ctype-unicode300-casefold-tr.h - ctype-unicode300-general_ci.h - ctype-unicode300-general_mysql500_ci.h - ctype-unicode520-casefold.h - Adding a new file ctype-unidata.c as an aggregator for the header files listed above. --- include/m_ctype.h | 25 +- strings/CMakeLists.txt | 1 + strings/conf_to_src.c | 1 - strings/ctype-big5.c | 7 +- strings/ctype-bin.c | 1 - strings/ctype-cp932.c | 7 +- strings/ctype-czech.c | 1 - strings/ctype-euc_kr.c | 7 +- strings/ctype-eucjpms.c | 7 +- strings/ctype-extra.c | 108 - strings/ctype-gb2312.c | 7 +- strings/ctype-gbk.c | 7 +- strings/ctype-latin1.c | 5 - strings/ctype-sjis.c | 7 +- strings/ctype-tis620.c | 4 - strings/ctype-uca.c | 454 +- strings/ctype-ucs2.c | 112 +- strings/ctype-ujis.c | 7 +- strings/ctype-unicode300-casefold-tr.h | 193 + strings/ctype-unicode300-casefold.h | 1764 +++++++ strings/ctype-unicode300-general_ci.h | 610 +++ .../ctype-unicode300-general_mysql500_ci.h | 190 + strings/ctype-unicode520-casefold.h | 3192 +++++++++++ strings/ctype-unidata.c | 79 + strings/ctype-unidata.h | 80 +- strings/ctype-utf8.c | 4651 +---------------- strings/ctype-win1250ch.c | 1 - strings/strcoll.inl | 28 +- strings/unidata-dump.c | 1110 ++++ 29 files changed, 7471 insertions(+), 5195 deletions(-) create mode 100644 strings/ctype-unicode300-casefold-tr.h create mode 100644 strings/ctype-unicode300-casefold.h create mode 100644 strings/ctype-unicode300-general_ci.h create mode 100644 strings/ctype-unicode300-general_mysql500_ci.h create mode 100644 strings/ctype-unicode520-casefold.h create mode 100644 strings/ctype-unidata.c create mode 100644 strings/unidata-dump.c diff --git a/include/m_ctype.h b/include/m_ctype.h index 2f1767433ad..6812445c6d5 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -79,7 +79,6 @@ extern "C" { typedef const struct my_charset_handler_st MY_CHARSET_HANDLER; typedef const struct my_collation_handler_st MY_COLLATION_HANDLER; -typedef const struct unicase_info_st MY_UNICASE_INFO; typedef const struct casefold_info_st MY_CASEFOLD_INFO; typedef const struct uni_ctype_st MY_UNI_CTYPE; typedef const struct my_uni_idx_st MY_UNI_IDX; @@ -97,29 +96,10 @@ struct casefold_info_st { my_wc_t maxchar; const MY_CASEFOLD_CHARACTER * const *page; + const uint16 * const *simple_weight; /* For general_ci-alike collations */ }; -typedef struct unicase_info_char_st -{ - uint32 toupper; - uint32 tolower; - uint32 sort; -} MY_UNICASE_CHARACTER; - - -struct unicase_info_st -{ - my_wc_t maxchar; - MY_UNICASE_CHARACTER **page; -}; - - -extern MY_UNICASE_INFO my_unicase_default; -extern MY_UNICASE_INFO my_unicase_turkish; -extern MY_UNICASE_INFO my_unicase_mysql500; -extern MY_UNICASE_INFO my_unicase_unicode520; - #define MY_UCA_MAX_CONTRACTION 6 /* The DUCET tables in ctype-uca.c are dumped with a limit of 8 weights @@ -795,7 +775,6 @@ struct charset_info_st const uint16 *tab_to_uni; MY_UNI_IDX *tab_from_uni; MY_CASEFOLD_INFO *casefold; - MY_UNICASE_INFO *caseinfo; const uchar *state_map; const uchar *ident_map; uint strxfrm_multiply; @@ -1691,7 +1670,7 @@ int my_wildcmp_unicode(CHARSET_INFO *cs, const char *str, const char *str_end, const char *wildstr, const char *wildend, int escape, int w_one, int w_many, - MY_UNICASE_INFO *weights); + MY_CASEFOLD_INFO *weights); extern my_bool my_parse_charset_xml(MY_CHARSET_LOADER *loader, const char *buf, size_t buflen); diff --git a/strings/CMakeLists.txt b/strings/CMakeLists.txt index 85e8cd05816..099f3c67660 100644 --- a/strings/CMakeLists.txt +++ b/strings/CMakeLists.txt @@ -22,6 +22,7 @@ SET(STRINGS_SOURCES bchange.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c ctype-czech.c ctype-euc_kr.c ctype-eucjpms.c ctype-extra.c ctype-gb2312.c ctype-gbk.c ctype-latin1.c ctype-mb.c ctype-simple.c ctype-sjis.c ctype-tis620.c ctype-uca.c ctype-ucs2.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype.c decimal.c dtoa.c int2str.c + ctype-unidata.c is_prefix.c llstr.c longlong2str.c my_strtoll10.c my_vsnprintf.c str2int.c strcend.c strend.c strfill.c strmake.c strmov.c strnmov.c strxmov.c strxnmov.c xml.c diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c index 692effbd3f4..fce763b4fc7 100644 --- a/strings/conf_to_src.c +++ b/strings/conf_to_src.c @@ -409,7 +409,6 @@ void dispcset(FILE *f,CHARSET_INFO *cs) fprintf(f," NULL, /* from_uni */\n"); fprintf(f," NULL, /* casefold */\n"); - fprintf(f," &my_unicase_default, /* caseinfo */\n"); fprintf(f," NULL, /* state map */\n"); fprintf(f," NULL, /* ident map */\n"); fprintf(f," 1, /* strxfrm_multiply*/\n"); diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index ef01b45aec0..aaf6769989b 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -806,7 +806,8 @@ static const MY_CASEFOLD_CHARACTER *my_casefold_pages_big5[256]= static MY_CASEFOLD_INFO my_casefold_big5= { 0xFFFF, - my_casefold_pages_big5 + my_casefold_pages_big5, + NULL /* ws */ }; @@ -6847,7 +6848,6 @@ struct charset_info_st my_charset_big5_chinese_ci= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_big5, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -6879,7 +6879,6 @@ struct charset_info_st my_charset_big5_bin= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_big5, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -6911,7 +6910,6 @@ struct charset_info_st my_charset_big5_chinese_nopad_ci= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_big5, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -6943,7 +6941,6 @@ struct charset_info_st my_charset_big5_nopad_bin= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_big5, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index a6c3fb6d0ea..f11fe611482 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -625,7 +625,6 @@ struct charset_info_st my_charset_bin = NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c index 0f1e8457072..f01909d4f65 100644 --- a/strings/ctype-cp932.c +++ b/strings/ctype-cp932.c @@ -1706,7 +1706,8 @@ static const MY_CASEFOLD_CHARACTER *my_casefold_pages_cp932[256]= MY_CASEFOLD_INFO my_casefold_cp932= { 0xFFFF, - my_casefold_pages_cp932 + my_casefold_pages_cp932, + NULL /* ws */ }; @@ -34805,7 +34806,6 @@ struct charset_info_st my_charset_cp932_japanese_ci= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_cp932, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -34836,7 +34836,6 @@ struct charset_info_st my_charset_cp932_bin= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_cp932, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -34868,7 +34867,6 @@ struct charset_info_st my_charset_cp932_japanese_nopad_ci= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_cp932, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -34899,7 +34897,6 @@ struct charset_info_st my_charset_cp932_nopad_bin= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_cp932, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c index 109731abaaf..64aff2e7be0 100644 --- a/strings/ctype-czech.c +++ b/strings/ctype-czech.c @@ -618,7 +618,6 @@ struct charset_info_st my_charset_latin2_czech_cs = tab_8859_2_uni, /* tab_to_uni */ idx_uni_8859_2, /* tab_from_uni */ NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 4, /* strxfrm_multiply */ diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c index ab27074f20d..dd6ab60bd3a 100644 --- a/strings/ctype-euc_kr.c +++ b/strings/ctype-euc_kr.c @@ -1483,7 +1483,8 @@ static const MY_CASEFOLD_CHARACTER *my_casefold_pages_euckr[256]= static MY_CASEFOLD_INFO my_casefold_euckr= { 0xFFFF, - my_casefold_pages_euckr + my_casefold_pages_euckr, + NULL /* ws */ }; @@ -10095,7 +10096,6 @@ struct charset_info_st my_charset_euckr_korean_ci= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_euckr, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -10127,7 +10127,6 @@ struct charset_info_st my_charset_euckr_bin= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_euckr, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -10159,7 +10158,6 @@ struct charset_info_st my_charset_euckr_korean_nopad_ci= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_euckr, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -10191,7 +10189,6 @@ struct charset_info_st my_charset_euckr_nopad_bin= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_euckr, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ diff --git a/strings/ctype-eucjpms.c b/strings/ctype-eucjpms.c index 1812c74d465..a5f727551aa 100644 --- a/strings/ctype-eucjpms.c +++ b/strings/ctype-eucjpms.c @@ -1779,7 +1779,8 @@ static const MY_CASEFOLD_CHARACTER *my_casefold_pages_eucjpms[512]= static MY_CASEFOLD_INFO my_casefold_eucjpms= { 0x0FFFF, - my_casefold_pages_eucjpms + my_casefold_pages_eucjpms, + NULL /* ws */ }; @@ -67634,7 +67635,6 @@ struct charset_info_st my_charset_eucjpms_japanese_ci= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_eucjpms,/* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -67666,7 +67666,6 @@ struct charset_info_st my_charset_eucjpms_bin= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_eucjpms,/* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -67698,7 +67697,6 @@ struct charset_info_st my_charset_eucjpms_japanese_nopad_ci= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_eucjpms,/* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -67730,7 +67728,6 @@ struct charset_info_st my_charset_eucjpms_nopad_bin= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_eucjpms,/* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c index 82df1088a62..8a25a9c6a61 100644 --- a/strings/ctype-extra.c +++ b/strings/ctype-extra.c @@ -3690,7 +3690,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_dec8_swedish_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -3722,7 +3721,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp850_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -3754,7 +3752,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin1_german1_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -3786,7 +3783,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_hp8_english_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -3818,7 +3814,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_koi8r_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -3850,7 +3845,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin2_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -3882,7 +3876,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_swe7_swedish_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -3914,7 +3907,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_ascii_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -3946,7 +3938,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1251_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -3978,7 +3969,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin1_danish_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4010,7 +4000,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_hebrew_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4042,7 +4031,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin7_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4074,7 +4062,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin2_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4106,7 +4093,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_koi8u_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4138,7 +4124,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1251_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4170,7 +4155,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_greek_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4202,7 +4186,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1250_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4234,7 +4217,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin2_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4266,7 +4248,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1257_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4298,7 +4279,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin5_turkish_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4330,7 +4310,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_armscii8_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4362,7 +4341,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp866_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4394,7 +4372,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_keybcs2_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4426,7 +4403,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_macce_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4458,7 +4434,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_macroman_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4490,7 +4465,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp852_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4522,7 +4496,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin7_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4554,7 +4527,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin7_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4586,7 +4558,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_macce_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4618,7 +4589,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1250_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4650,7 +4620,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin1_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4682,7 +4651,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin1_general_cs, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4714,7 +4682,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1251_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4746,7 +4713,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1251_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4778,7 +4744,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1251_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4810,7 +4775,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_macroman_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4842,7 +4806,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1256_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4874,7 +4837,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1257_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4906,7 +4868,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1257_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4938,7 +4899,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_armscii8_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -4970,7 +4930,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_ascii_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5002,7 +4961,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1250_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5034,7 +4992,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1256_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5066,7 +5023,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp866_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5098,7 +5054,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_dec8_swedish_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5130,7 +5085,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_greek_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5162,7 +5116,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_hebrew_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5194,7 +5147,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_hp8_english_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5226,7 +5178,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_keybcs2_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5258,7 +5209,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_koi8r_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5290,7 +5240,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_koi8u_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5322,7 +5271,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin2_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5354,7 +5302,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin5_turkish_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5386,7 +5333,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin7_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5418,7 +5364,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp850_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5450,7 +5395,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp852_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5482,7 +5426,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_swe7_swedish_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5514,7 +5457,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_geostd8_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5546,7 +5488,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_geostd8_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5578,7 +5519,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin1_spanish_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5610,7 +5550,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1250_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5642,7 +5581,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_dec8_swedish_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5674,7 +5612,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp850_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5706,7 +5643,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_hp8_english_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5738,7 +5674,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_koi8r_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5770,7 +5705,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin2_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5802,7 +5736,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_swe7_swedish_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5834,7 +5767,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_ascii_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5866,7 +5798,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_hebrew_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5898,7 +5829,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_koi8u_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5930,7 +5860,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_greek_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5962,7 +5891,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1250_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -5994,7 +5922,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin5_turkish_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6026,7 +5953,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_armscii8_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6058,7 +5984,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp866_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6090,7 +6015,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_keybcs2_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6122,7 +6046,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_macce_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6154,7 +6077,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_macroman_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6186,7 +6108,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp852_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6218,7 +6139,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin7_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6250,7 +6170,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_macce_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6282,7 +6201,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1251_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6314,7 +6232,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1251_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6346,7 +6263,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_macroman_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6378,7 +6294,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1256_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6410,7 +6325,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1257_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6442,7 +6356,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1257_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6474,7 +6387,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_armscii8_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6506,7 +6418,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_ascii_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6538,7 +6449,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1250_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6570,7 +6480,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp1256_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6602,7 +6511,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp866_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6634,7 +6542,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_dec8_swedish_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6666,7 +6573,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_greek_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6698,7 +6604,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_hebrew_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6730,7 +6635,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_hp8_english_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6762,7 +6666,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_keybcs2_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6794,7 +6697,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_koi8r_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6826,7 +6728,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_koi8u_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6858,7 +6759,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin2_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6890,7 +6790,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin5_turkish_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6922,7 +6821,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_latin7_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6954,7 +6852,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp850_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -6986,7 +6883,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_cp852_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -7018,7 +6914,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_swe7_swedish_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -7050,7 +6945,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_geostd8_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -7082,7 +6976,6 @@ struct charset_info_st compiled_charsets[] = { to_uni_geostd8_general_ci, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ @@ -7113,7 +7006,6 @@ struct charset_info_st compiled_charsets[] = { NULL, /* to_uni */ NULL, /* from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state map */ NULL, /* ident map */ 1, /* strxfrm_multiply*/ diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c index 9e6ed3cfabe..f3e9c902389 100644 --- a/strings/ctype-gb2312.c +++ b/strings/ctype-gb2312.c @@ -822,7 +822,8 @@ static const MY_CASEFOLD_CHARACTER *my_casefold_pages_gb2312[256]= static MY_CASEFOLD_INFO my_casefold_gb2312= { 0xFFFF, - my_casefold_pages_gb2312 + my_casefold_pages_gb2312, + NULL /* ws */ }; @@ -6499,7 +6500,6 @@ struct charset_info_st my_charset_gb2312_chinese_ci= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_gb2312,/* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -6531,7 +6531,6 @@ struct charset_info_st my_charset_gb2312_bin= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_gb2312,/* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -6563,7 +6562,6 @@ struct charset_info_st my_charset_gb2312_chinese_nopad_ci= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_gb2312,/* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -6595,7 +6593,6 @@ struct charset_info_st my_charset_gb2312_nopad_bin= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_gb2312,/* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c index a81e2465157..a22e6aa8d84 100644 --- a/strings/ctype-gbk.c +++ b/strings/ctype-gbk.c @@ -1006,7 +1006,8 @@ static const MY_CASEFOLD_CHARACTER *my_casefold_pages_gbk[256]= static MY_CASEFOLD_INFO my_casefold_gbk= { 0xFFFF, - my_casefold_pages_gbk + my_casefold_pages_gbk, + NULL /* ws */ }; @@ -10780,7 +10781,6 @@ struct charset_info_st my_charset_gbk_chinese_ci= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_gbk, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -10811,7 +10811,6 @@ struct charset_info_st my_charset_gbk_bin= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_gbk, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -10843,7 +10842,6 @@ struct charset_info_st my_charset_gbk_chinese_nopad_ci= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_gbk, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -10874,7 +10872,6 @@ struct charset_info_st my_charset_gbk_nopad_bin= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_gbk, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index a0bee911af5..5d763c6a561 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -449,7 +449,6 @@ struct charset_info_st my_charset_latin1= cs_to_uni, /* tab_to_uni */ NULL, /* tab_from_uni */ NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -481,7 +480,6 @@ struct charset_info_st my_charset_latin1_nopad= cs_to_uni, /* tab_to_uni */ NULL, /* tab_from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -763,7 +761,6 @@ struct charset_info_st my_charset_latin1_german2_ci= cs_to_uni, /* tab_to_uni */ NULL, /* tab_from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 2, /* strxfrm_multiply */ @@ -795,7 +792,6 @@ struct charset_info_st my_charset_latin1_bin= cs_to_uni, /* tab_to_uni */ NULL, /* tab_from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -827,7 +823,6 @@ struct charset_info_st my_charset_latin1_nopad_bin= cs_to_uni, /* tab_to_uni */ NULL, /* tab_from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index 1e3ef16bdb5..a5fed41b964 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -1076,7 +1076,8 @@ static const MY_CASEFOLD_CHARACTER *my_casefold_pages_sjis[256]= static MY_CASEFOLD_INFO my_casefold_sjis= { 0xFFFF, - my_casefold_pages_sjis + my_casefold_pages_sjis, + NULL /* ws */ }; @@ -34193,7 +34194,6 @@ struct charset_info_st my_charset_sjis_japanese_ci= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_sjis, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -34224,7 +34224,6 @@ struct charset_info_st my_charset_sjis_bin= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_sjis, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -34256,7 +34255,6 @@ struct charset_info_st my_charset_sjis_japanese_nopad_ci= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_sjis, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -34287,7 +34285,6 @@ struct charset_info_st my_charset_sjis_nopad_bin= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_sjis, /* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index 7ca33807fe4..0b728346f6a 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -957,7 +957,6 @@ struct charset_info_st my_charset_tis620_thai_ci= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 4, /* strxfrm_multiply */ @@ -988,7 +987,6 @@ struct charset_info_st my_charset_tis620_bin= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -1020,7 +1018,6 @@ struct charset_info_st my_charset_tis620_thai_nopad_ci= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 4, /* strxfrm_multiply */ @@ -1052,7 +1049,6 @@ struct charset_info_st my_charset_tis620_nopad_bin= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 8e94a18a478..1e8661bef54 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -35,6 +35,7 @@ #include "strings_def.h" #include #include "ctype-uca.h" +#include "ctype-unidata.h" #include "my_bit.h" typedef struct @@ -34611,8 +34612,8 @@ my_coll_init_uca(struct charset_info_st *cs, MY_CHARSET_LOADER *loader) { cs->pad_char= ' '; cs->m_ctype= my_charset_utf8mb3_unicode_ci.m_ctype; - if (!cs->caseinfo) - cs->caseinfo= &my_unicase_default; + if (!cs->casefold) + cs->casefold= &my_casefold_default; return create_tailoring(cs, loader); } @@ -34762,23 +34763,23 @@ create_tailoring(struct charset_info_st *cs, if (rules.version == 520) /* Unicode-5.2.0 requested */ { src_uca= &my_uca_v520; - cs->caseinfo= &my_unicase_unicode520; + cs->casefold= &my_casefold_unicode520; } else if (rules.version == 1400) /* Unicode-14.0.0 */ { src_uca= &my_uca_v1400; - cs->caseinfo= &my_unicase_unicode520; + cs->casefold= &my_casefold_unicode520; } else if (rules.version == 400) /* Unicode-4.0.0 requested */ { src_uca= &my_uca_v400; - cs->caseinfo= &my_unicase_default; + cs->casefold= &my_casefold_default; } else /* No Unicode version specified */ { src_uca= cs->uca ? cs->uca : &my_uca_v400; - if (!cs->caseinfo) - cs->caseinfo= &my_unicase_default; + if (!cs->casefold) + cs->casefold= &my_casefold_default; } if (rules.strength) my_ci_set_strength(cs, rules.strength); @@ -34855,8 +34856,7 @@ struct charset_info_st my_charset_ucs2_unicode_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -34886,8 +34886,7 @@ struct charset_info_st my_charset_ucs2_icelandic_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -34917,8 +34916,7 @@ struct charset_info_st my_charset_ucs2_latvian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -34948,8 +34946,7 @@ struct charset_info_st my_charset_ucs2_romanian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -34979,8 +34976,7 @@ struct charset_info_st my_charset_ucs2_slovenian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35010,8 +35006,7 @@ struct charset_info_st my_charset_ucs2_polish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35041,8 +35036,7 @@ struct charset_info_st my_charset_ucs2_estonian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35072,8 +35066,7 @@ struct charset_info_st my_charset_ucs2_spanish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35103,8 +35096,7 @@ struct charset_info_st my_charset_ucs2_swedish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35134,8 +35126,7 @@ struct charset_info_st my_charset_ucs2_turkish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_turkish,/* caseinfo */ + &my_casefold_turkish,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35165,8 +35156,7 @@ struct charset_info_st my_charset_ucs2_czech_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35197,8 +35187,7 @@ struct charset_info_st my_charset_ucs2_danish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35228,8 +35217,7 @@ struct charset_info_st my_charset_ucs2_lithuanian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35259,8 +35247,7 @@ struct charset_info_st my_charset_ucs2_slovak_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35290,8 +35277,7 @@ struct charset_info_st my_charset_ucs2_spanish2_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35322,8 +35308,7 @@ struct charset_info_st my_charset_ucs2_roman_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35354,8 +35339,7 @@ struct charset_info_st my_charset_ucs2_persian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35386,8 +35370,7 @@ struct charset_info_st my_charset_ucs2_esperanto_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35418,8 +35401,7 @@ struct charset_info_st my_charset_ucs2_hungarian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35449,8 +35431,7 @@ struct charset_info_st my_charset_ucs2_sinhala_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35482,8 +35463,7 @@ struct charset_info_st my_charset_ucs2_german2_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35513,8 +35493,7 @@ struct charset_info_st my_charset_ucs2_croatian_mysql561_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35545,8 +35524,7 @@ struct charset_info_st my_charset_ucs2_croatian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35577,8 +35555,7 @@ struct charset_info_st my_charset_ucs2_myanmar_uca_ci= &my_uca_v520, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520,/* caseinfo */ + &my_casefold_unicode520,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35609,8 +35586,7 @@ struct charset_info_st my_charset_ucs2_thai_520_w2= &my_uca_v520_th, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520,/* caseinfo */ + &my_casefold_unicode520,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 4, /* strxfrm_multiply */ @@ -35640,8 +35616,7 @@ struct charset_info_st my_charset_ucs2_unicode_520_ci= &my_uca_v520, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520,/* caseinfo */ + &my_casefold_unicode520,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35672,8 +35647,7 @@ struct charset_info_st my_charset_ucs2_vietnamese_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35704,8 +35678,7 @@ struct charset_info_st my_charset_ucs2_unicode_nopad_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default, /* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35736,8 +35709,7 @@ struct charset_info_st my_charset_ucs2_unicode_520_nopad_ci= &my_uca_v520, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520, /* caseinfo */ + &my_casefold_unicode520, /* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35837,8 +35809,7 @@ struct charset_info_st my_charset_utf8mb3_unicode_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35869,8 +35840,7 @@ struct charset_info_st my_charset_utf8mb3_icelandic_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35900,8 +35870,7 @@ struct charset_info_st my_charset_utf8mb3_latvian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35931,8 +35900,7 @@ struct charset_info_st my_charset_utf8mb3_romanian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35962,8 +35930,7 @@ struct charset_info_st my_charset_utf8mb3_slovenian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -35993,8 +35960,7 @@ struct charset_info_st my_charset_utf8mb3_polish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36024,8 +35990,7 @@ struct charset_info_st my_charset_utf8mb3_estonian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36055,8 +36020,7 @@ struct charset_info_st my_charset_utf8mb3_spanish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36086,8 +36050,7 @@ struct charset_info_st my_charset_utf8mb3_swedish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36117,8 +36080,7 @@ struct charset_info_st my_charset_utf8mb3_turkish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_turkish,/* caseinfo */ + &my_casefold_turkish,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36148,8 +36110,7 @@ struct charset_info_st my_charset_utf8mb3_czech_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36180,8 +36141,7 @@ struct charset_info_st my_charset_utf8mb3_danish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36211,8 +36171,7 @@ struct charset_info_st my_charset_utf8mb3_lithuanian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36242,8 +36201,7 @@ struct charset_info_st my_charset_utf8mb3_slovak_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36273,8 +36231,7 @@ struct charset_info_st my_charset_utf8mb3_spanish2_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36304,8 +36261,7 @@ struct charset_info_st my_charset_utf8mb3_roman_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36335,8 +36291,7 @@ struct charset_info_st my_charset_utf8mb3_persian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36366,8 +36321,7 @@ struct charset_info_st my_charset_utf8mb3_esperanto_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36397,8 +36351,7 @@ struct charset_info_st my_charset_utf8mb3_hungarian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36428,8 +36381,7 @@ struct charset_info_st my_charset_utf8mb3_sinhala_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36460,8 +36412,7 @@ struct charset_info_st my_charset_utf8mb3_german2_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36491,8 +36442,7 @@ struct charset_info_st my_charset_utf8mb3_croatian_mysql561_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36523,8 +36473,7 @@ struct charset_info_st my_charset_utf8mb3_croatian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36555,8 +36504,7 @@ struct charset_info_st my_charset_utf8mb3_myanmar_uca_ci= &my_uca_v520, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520,/* caseinfo */ + &my_casefold_unicode520,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36587,8 +36535,7 @@ struct charset_info_st my_charset_utf8mb3_unicode_520_ci= &my_uca_v520, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520,/* caseinfo */ + &my_casefold_unicode520,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36618,8 +36565,7 @@ struct charset_info_st my_charset_utf8mb3_thai_520_w2= &my_uca_v520_th, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520,/* caseinfo */ + &my_casefold_unicode520,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 4, /* strxfrm_multiply */ @@ -36649,8 +36595,7 @@ struct charset_info_st my_charset_utf8mb3_vietnamese_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36681,8 +36626,7 @@ struct charset_info_st my_charset_utf8mb3_unicode_nopad_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default, /* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36713,8 +36657,7 @@ struct charset_info_st my_charset_utf8mb3_unicode_520_nopad_ci= &my_uca_v520, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520, /* caseinfo */ + &my_casefold_unicode520, /* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36787,8 +36730,7 @@ struct charset_info_st my_charset_utf8mb4_unicode_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36819,8 +36761,7 @@ struct charset_info_st my_charset_utf8mb4_icelandic_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36850,8 +36791,7 @@ struct charset_info_st my_charset_utf8mb4_latvian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36881,8 +36821,7 @@ struct charset_info_st my_charset_utf8mb4_romanian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36912,8 +36851,7 @@ struct charset_info_st my_charset_utf8mb4_slovenian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36943,8 +36881,7 @@ struct charset_info_st my_charset_utf8mb4_polish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -36974,8 +36911,7 @@ struct charset_info_st my_charset_utf8mb4_estonian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37005,8 +36941,7 @@ struct charset_info_st my_charset_utf8mb4_spanish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37036,8 +36971,7 @@ struct charset_info_st my_charset_utf8mb4_swedish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37067,8 +37001,7 @@ struct charset_info_st my_charset_utf8mb4_turkish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_turkish, /* caseinfo */ + &my_casefold_turkish,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37098,8 +37031,7 @@ struct charset_info_st my_charset_utf8mb4_czech_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37130,8 +37062,7 @@ struct charset_info_st my_charset_utf8mb4_danish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37161,8 +37092,7 @@ struct charset_info_st my_charset_utf8mb4_lithuanian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37192,8 +37122,7 @@ struct charset_info_st my_charset_utf8mb4_slovak_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37223,8 +37152,7 @@ struct charset_info_st my_charset_utf8mb4_spanish2_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37254,8 +37182,7 @@ struct charset_info_st my_charset_utf8mb4_roman_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37285,8 +37212,7 @@ struct charset_info_st my_charset_utf8mb4_persian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37316,8 +37242,7 @@ struct charset_info_st my_charset_utf8mb4_esperanto_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37347,8 +37272,7 @@ struct charset_info_st my_charset_utf8mb4_hungarian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37378,8 +37302,7 @@ struct charset_info_st my_charset_utf8mb4_sinhala_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37409,8 +37332,7 @@ struct charset_info_st my_charset_utf8mb4_german2_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37440,8 +37362,7 @@ struct charset_info_st my_charset_utf8mb4_croatian_mysql561_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37472,8 +37393,7 @@ struct charset_info_st my_charset_utf8mb4_croatian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37504,8 +37424,7 @@ struct charset_info_st my_charset_utf8mb4_myanmar_uca_ci= &my_uca_v520, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520,/* caseinfo */ + &my_casefold_unicode520,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37535,8 +37454,7 @@ struct charset_info_st my_charset_utf8mb4_thai_520_w2= &my_uca_v520_th, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520,/* caseinfo */ + &my_casefold_unicode520,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 4, /* strxfrm_multiply */ @@ -37566,8 +37484,7 @@ struct charset_info_st my_charset_utf8mb4_unicode_520_ci= &my_uca_v520, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520,/* caseinfo */ + &my_casefold_unicode520,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37598,8 +37515,7 @@ struct charset_info_st my_charset_utf8mb4_vietnamese_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37630,8 +37546,7 @@ struct charset_info_st my_charset_utf8mb4_unicode_nopad_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default, /* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37662,8 +37577,7 @@ struct charset_info_st my_charset_utf8mb4_unicode_520_nopad_ci= &my_uca_v520, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520, /* caseinfo */ + &my_casefold_unicode520, /* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37713,8 +37627,7 @@ struct charset_info_st my_charset_utf32_unicode_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37745,8 +37658,7 @@ struct charset_info_st my_charset_utf32_icelandic_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37776,8 +37688,7 @@ struct charset_info_st my_charset_utf32_latvian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37807,8 +37718,7 @@ struct charset_info_st my_charset_utf32_romanian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37838,8 +37748,7 @@ struct charset_info_st my_charset_utf32_slovenian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37869,8 +37778,7 @@ struct charset_info_st my_charset_utf32_polish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37900,8 +37808,7 @@ struct charset_info_st my_charset_utf32_estonian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37931,8 +37838,7 @@ struct charset_info_st my_charset_utf32_spanish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37962,8 +37868,7 @@ struct charset_info_st my_charset_utf32_swedish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -37993,8 +37898,7 @@ struct charset_info_st my_charset_utf32_turkish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_turkish, /* caseinfo */ + &my_casefold_turkish,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38024,8 +37928,7 @@ struct charset_info_st my_charset_utf32_czech_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38056,8 +37959,7 @@ struct charset_info_st my_charset_utf32_danish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38087,8 +37989,7 @@ struct charset_info_st my_charset_utf32_lithuanian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38118,8 +38019,7 @@ struct charset_info_st my_charset_utf32_slovak_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38149,8 +38049,7 @@ struct charset_info_st my_charset_utf32_spanish2_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38180,8 +38079,7 @@ struct charset_info_st my_charset_utf32_roman_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38211,8 +38109,7 @@ struct charset_info_st my_charset_utf32_persian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38242,8 +38139,7 @@ struct charset_info_st my_charset_utf32_esperanto_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38273,8 +38169,7 @@ struct charset_info_st my_charset_utf32_hungarian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38304,8 +38199,7 @@ struct charset_info_st my_charset_utf32_sinhala_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38335,8 +38229,7 @@ struct charset_info_st my_charset_utf32_german2_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38366,8 +38259,7 @@ struct charset_info_st my_charset_utf32_croatian_mysql561_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38397,8 +38289,7 @@ struct charset_info_st my_charset_utf32_croatian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38429,8 +38320,7 @@ struct charset_info_st my_charset_utf32_myanmar_uca_ci= &my_uca_v520, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520,/* caseinfo */ + &my_casefold_unicode520,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38461,8 +38351,7 @@ struct charset_info_st my_charset_utf32_thai_520_w2= &my_uca_v520_th, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520,/* caseinfo */ + &my_casefold_unicode520,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 4, /* strxfrm_multiply */ @@ -38493,8 +38382,7 @@ struct charset_info_st my_charset_utf32_unicode_520_ci= &my_uca_v520, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520,/* caseinfo */ + &my_casefold_unicode520,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38525,8 +38413,7 @@ struct charset_info_st my_charset_utf32_vietnamese_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38557,8 +38444,7 @@ struct charset_info_st my_charset_utf32_unicode_nopad_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default, /* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38589,8 +38475,7 @@ struct charset_info_st my_charset_utf32_unicode_520_nopad_ci= &my_uca_v520, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520, /* caseinfo */ + &my_casefold_unicode520, /* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38641,8 +38526,7 @@ struct charset_info_st my_charset_utf16_unicode_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38673,8 +38557,7 @@ struct charset_info_st my_charset_utf16_icelandic_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38704,8 +38587,7 @@ struct charset_info_st my_charset_utf16_latvian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38735,8 +38617,7 @@ struct charset_info_st my_charset_utf16_romanian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38766,8 +38647,7 @@ struct charset_info_st my_charset_utf16_slovenian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38797,8 +38677,7 @@ struct charset_info_st my_charset_utf16_polish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38828,8 +38707,7 @@ struct charset_info_st my_charset_utf16_estonian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38859,8 +38737,7 @@ struct charset_info_st my_charset_utf16_spanish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38890,8 +38767,7 @@ struct charset_info_st my_charset_utf16_swedish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38921,8 +38797,7 @@ struct charset_info_st my_charset_utf16_turkish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_turkish, /* caseinfo */ + &my_casefold_turkish,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38952,8 +38827,7 @@ struct charset_info_st my_charset_utf16_czech_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -38984,8 +38858,7 @@ struct charset_info_st my_charset_utf16_danish_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -39015,8 +38888,7 @@ struct charset_info_st my_charset_utf16_lithuanian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -39046,8 +38918,7 @@ struct charset_info_st my_charset_utf16_slovak_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -39077,8 +38948,7 @@ struct charset_info_st my_charset_utf16_spanish2_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -39108,8 +38978,7 @@ struct charset_info_st my_charset_utf16_roman_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -39139,8 +39008,7 @@ struct charset_info_st my_charset_utf16_persian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -39170,8 +39038,7 @@ struct charset_info_st my_charset_utf16_esperanto_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -39201,8 +39068,7 @@ struct charset_info_st my_charset_utf16_hungarian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -39232,8 +39098,7 @@ struct charset_info_st my_charset_utf16_sinhala_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -39263,8 +39128,7 @@ struct charset_info_st my_charset_utf16_german2_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -39295,8 +39159,7 @@ struct charset_info_st my_charset_utf16_croatian_mysql561_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -39327,8 +39190,7 @@ struct charset_info_st my_charset_utf16_croatian_uca_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -39359,8 +39221,7 @@ struct charset_info_st my_charset_utf16_myanmar_uca_ci= &my_uca_v520, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520,/* caseinfo */ + &my_casefold_unicode520,/* casefold*/ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -39391,8 +39252,7 @@ struct charset_info_st my_charset_utf16_thai_520_w2= &my_uca_v520_th, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520,/* caseinfo */ + &my_casefold_unicode520,/* casefold*/ NULL, /* state_map */ NULL, /* ident_map */ 4, /* strxfrm_multiply */ @@ -39423,8 +39283,7 @@ struct charset_info_st my_charset_utf16_unicode_520_ci= &my_uca_v520, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520,/* caseinfo */ + &my_casefold_unicode520,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -39455,8 +39314,7 @@ struct charset_info_st my_charset_utf16_vietnamese_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -39487,8 +39345,7 @@ struct charset_info_st my_charset_utf16_unicode_nopad_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default, /* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -39519,8 +39376,7 @@ struct charset_info_st my_charset_utf16_unicode_520_nopad_ci= &my_uca_v520, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_unicode520, /* caseinfo */ + &my_casefold_unicode520, /* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 8, /* strxfrm_multiply */ @@ -39599,9 +39455,9 @@ my_uca1400_collation_definition_init(MY_CHARSET_LOADER *loader, dst->uca= &my_uca_v1400; dst->tailoring= def->tailoring; if (def->tailoring == turkish) - dst->caseinfo= &my_unicase_turkish; /*TODO: unicase_1400_turkish */ + dst->casefold= &my_casefold_turkish; /*TODO: casefold_1400_turkish */ else - dst->caseinfo= &my_unicase_unicode520; /*TODO: unicase_1400*/ + dst->casefold= &my_casefold_unicode520; /*TODO: casefold_1400*/ if (nopad) dst->state|= MY_CS_NOPAD; my_ci_set_level_flags(dst, (1 << MY_CS_LEVEL_BIT_PRIMARY) | diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index c4ac54e4462..5d67762ac2f 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1197,17 +1197,14 @@ my_lengthsp_mb2(CHARSET_INFO *cs __attribute__((unused)), static inline int my_weight_mb2_utf16mb2_general_ci(uchar b0, uchar b1) { my_wc_t wc= MY_UTF16_WC2(b0, b1); - MY_UNICASE_CHARACTER *page= my_unicase_default_pages[wc >> 8]; - return (int) (page ? page[wc & 0xFF].sort : wc); + return my_general_ci_bmp_char_to_weight((uint16) wc); } #define MY_FUNCTION_NAME(x) my_ ## x ## _utf16_general_ci #define DEFINE_STRNXFRM_UNICODE #define DEFINE_STRNXFRM_UNICODE_NOPAD #define MY_MB_WC(cs, pwc, s, e) my_mb_wc_utf16_quick(pwc, s, e) #define OPTIMIZE_ASCII 0 -#define UNICASE_MAXCHAR MY_UNICASE_INFO_DEFAULT_MAXCHAR -#define UNICASE_PAGE0 my_unicase_default_page00 -#define UNICASE_PAGES my_unicase_default_pages +#define MY_WC_WEIGHT(x) my_general_ci_char_to_weight(x) #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB2(b0,b1) my_weight_mb2_utf16mb2_general_ci(b0,b1) #define WEIGHT_MB4(b0,b1,b2,b3) MY_CS_REPLACEMENT_CHARACTER @@ -1295,7 +1292,7 @@ my_caseup_utf16(CHARSET_INFO *cs, const char *src, size_t srclen, int res; const char *srcend= src + srclen; char *dstend= dst + dstlen; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; DBUG_ASSERT(srclen <= dstlen); while ((src < srcend) && @@ -1320,7 +1317,7 @@ my_hash_sort_utf16_nopad(CHARSET_INFO *cs, my_charset_conv_mb_wc mb_wc= cs->cset->mb_wc; int res; const uchar *e= s + slen; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; register ulong m1= *nr1, m2= *nr2; while ((s < e) && (res= mb_wc(cs, &wc, (uchar *) s, (uchar *) e)) > 0) @@ -1353,7 +1350,7 @@ my_casedn_utf16(CHARSET_INFO *cs, const char *src, size_t srclen, int res; const char *srcend= src + srclen; char *dstend= dst + dstlen; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; DBUG_ASSERT(srclen <= dstlen); while ((src < srcend) && @@ -1425,7 +1422,7 @@ my_wildcmp_utf16_ci(CHARSET_INFO *cs, const char *wildstr,const char *wildend, int escape, int w_one, int w_many) { - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; return my_wildcmp_unicode(cs, str, str_end, wildstr, wildend, escape, w_one, w_many, uni_plane); } @@ -1603,8 +1600,7 @@ struct charset_info_st my_charset_utf16_general_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -1635,8 +1631,7 @@ struct charset_info_st my_charset_utf16_bin= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -1667,8 +1662,7 @@ struct charset_info_st my_charset_utf16_general_nopad_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -1700,8 +1694,7 @@ struct charset_info_st my_charset_utf16_nopad_bin= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -1725,9 +1718,7 @@ struct charset_info_st my_charset_utf16_nopad_bin= #define DEFINE_STRNXFRM_UNICODE_NOPAD #define MY_MB_WC(cs, pwc, s, e) (my_ci_mb_wc(cs, pwc, s, e)) #define OPTIMIZE_ASCII 0 -#define UNICASE_MAXCHAR MY_UNICASE_INFO_DEFAULT_MAXCHAR -#define UNICASE_PAGE0 my_unicase_default_page00 -#define UNICASE_PAGES my_unicase_default_pages +#define MY_WC_WEIGHT(x) my_general_ci_char_to_weight(x) #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB2(b0,b1) my_weight_mb2_utf16mb2_general_ci(b1,b0) #define WEIGHT_MB4(b0,b1,b2,b3) MY_CS_REPLACEMENT_CHARACTER @@ -1962,8 +1953,7 @@ struct charset_info_st my_charset_utf16le_general_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -1994,8 +1984,7 @@ struct charset_info_st my_charset_utf16le_bin= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -2026,8 +2015,7 @@ struct charset_info_st my_charset_utf16le_general_nopad_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -2059,8 +2047,7 @@ struct charset_info_st my_charset_utf16le_nopad_bin= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -2096,21 +2083,14 @@ static inline int my_weight_utf32_general_ci(uchar b0, uchar b1, uchar b2, uchar b3) { my_wc_t wc= MY_UTF32_WC4(b0, b1, b2, b3); - if (wc <= 0xFFFF) - { - MY_UNICASE_CHARACTER *page= my_unicase_default_pages[wc >> 8]; - return (int) (page ? page[wc & 0xFF].sort : wc); - } - return MY_CS_REPLACEMENT_CHARACTER; + return my_general_ci_char_to_weight(wc); } #define MY_FUNCTION_NAME(x) my_ ## x ## _utf32_general_ci #define DEFINE_STRNXFRM_UNICODE #define DEFINE_STRNXFRM_UNICODE_NOPAD #define MY_MB_WC(cs, pwc, s, e) my_mb_wc_utf32_quick(pwc, s, e) #define OPTIMIZE_ASCII 0 -#define UNICASE_MAXCHAR MY_UNICASE_INFO_DEFAULT_MAXCHAR -#define UNICASE_PAGE0 my_unicase_default_page00 -#define UNICASE_PAGES my_unicase_default_pages +#define MY_WC_WEIGHT(x) my_general_ci_char_to_weight(x) #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB4(b0,b1,b2,b3) my_weight_utf32_general_ci(b0, b1, b2, b3) #include "strcoll.inl" @@ -2182,7 +2162,7 @@ my_caseup_utf32(CHARSET_INFO *cs, const char *src, size_t srclen, int res; const char *srcend= src + srclen; char *dstend= dst + dstlen; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; DBUG_ASSERT(srclen <= dstlen); while ((src < srcend) && @@ -2205,7 +2185,7 @@ my_hash_sort_utf32_nopad(CHARSET_INFO *cs, const uchar *s, size_t slen, my_wc_t wc; int res; const uchar *e= s + slen; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; register ulong m1= *nr1, m2= *nr2; while ((res= my_utf32_uni(cs, &wc, (uchar*) s, (uchar*) e)) > 0) @@ -2239,7 +2219,7 @@ my_casedn_utf32(CHARSET_INFO *cs, const char *src, size_t srclen, int res; const char *srcend= src + srclen; char *dstend= dst + dstlen; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; DBUG_ASSERT(srclen <= dstlen); while ((res= my_utf32_uni(cs, &wc, (uchar*) src, (uchar*) srcend)) > 0) @@ -2593,7 +2573,7 @@ my_wildcmp_utf32_ci(CHARSET_INFO *cs, const char *wildstr, const char *wildend, int escape, int w_one, int w_many) { - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; return my_wildcmp_unicode(cs, str, str_end, wildstr, wildend, escape, w_one, w_many, uni_plane); } @@ -2772,8 +2752,7 @@ struct charset_info_st my_charset_utf32_general_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -2804,8 +2783,7 @@ struct charset_info_st my_charset_utf32_bin= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -2836,8 +2814,7 @@ struct charset_info_st my_charset_utf32_general_nopad_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -2869,8 +2846,7 @@ struct charset_info_st my_charset_utf32_nopad_bin= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -2960,16 +2936,14 @@ static const uchar to_upper_ucs2[] = { static inline int my_weight_mb2_ucs2_general_ci(uchar b0, uchar b1) { my_wc_t wc= UCS2_CODE(b0, b1); - MY_UNICASE_CHARACTER *page= my_unicase_default_pages[wc >> 8]; - return (int) (page ? page[wc & 0xFF].sort : wc); + return my_general_ci_bmp_char_to_weight((uint16) wc); } static inline int my_weight_mb2_ucs2_general_mysql500_ci(uchar b0, uchar b1) { my_wc_t wc= UCS2_CODE(b0, b1); - MY_UNICASE_CHARACTER *page= my_unicase_mysql500_pages[wc >> 8]; - return (int) (page ? page[wc & 0xFF].sort : wc); + return my_general_mysql500_ci_bmp_char_to_weight((uint16) wc); } @@ -2978,21 +2952,18 @@ static inline int my_weight_mb2_ucs2_general_mysql500_ci(uchar b0, uchar b1) #define DEFINE_STRNXFRM_UNICODE_NOPAD #define MY_MB_WC(cs, pwc, s, e) my_mb_wc_ucs2_quick(pwc, s, e) #define OPTIMIZE_ASCII 0 -#define UNICASE_MAXCHAR MY_UNICASE_INFO_DEFAULT_MAXCHAR -#define UNICASE_PAGE0 my_unicase_default_page00 -#define UNICASE_PAGES my_unicase_default_pages +#define MY_WC_WEIGHT(x) my_general_ci_bmp_char_to_weight(x) #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB2(b0,b1) my_weight_mb2_ucs2_general_ci(b0,b1) #include "strcoll.inl" + #define MY_FUNCTION_NAME(x) my_ ## x ## _ucs2_general_mysql500_ci #define DEFINE_STRNXFRM_UNICODE #define MY_MB_WC(cs, pwc, s, e) my_mb_wc_ucs2_quick(pwc, s, e) #define OPTIMIZE_ASCII 0 -#define UNICASE_MAXCHAR MY_UNICASE_INFO_DEFAULT_MAXCHAR -#define UNICASE_PAGE0 my_unicase_mysql500_page00 -#define UNICASE_PAGES my_unicase_mysql500_pages +#define MY_WC_WEIGHT(x) my_general_mysql500_ci_bmp_char_to_weight(x) #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB2(b0,b1) my_weight_mb2_ucs2_general_mysql500_ci(b0,b1) #include "strcoll.inl" @@ -3057,7 +3028,7 @@ static size_t my_caseup_ucs2(CHARSET_INFO *cs, const char *src, size_t srclen, int res; const char *srcend= src + srclen; char *dstend= dst + dstlen; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; DBUG_ASSERT(srclen <= dstlen); while ((src < srcend) && @@ -3080,7 +3051,7 @@ my_hash_sort_ucs2_nopad(CHARSET_INFO *cs, const uchar *s, size_t slen, my_wc_t wc; int res; const uchar *e=s+slen; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; register ulong m1= *nr1, m2= *nr2; while ((s < e) && (res=my_ucs2_uni(cs,&wc, (uchar *)s, (uchar*)e)) >0) @@ -3108,7 +3079,7 @@ static size_t my_casedn_ucs2(CHARSET_INFO *cs, const char *src, size_t srclen, int res; const char *srcend= src + srclen; char *dstend= dst + dstlen; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; DBUG_ASSERT(srclen <= dstlen); while ((src < srcend) && @@ -3198,7 +3169,7 @@ int my_wildcmp_ucs2_ci(CHARSET_INFO *cs, const char *wildstr,const char *wildend, int escape, int w_one, int w_many) { - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; return my_wildcmp_unicode(cs,str,str_end,wildstr,wildend, escape,w_one,w_many,uni_plane); } @@ -3396,8 +3367,7 @@ struct charset_info_st my_charset_ucs2_general_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -3428,8 +3398,7 @@ struct charset_info_st my_charset_ucs2_general_mysql500_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_mysql500, /* caseinfo */ + &my_casefold_mysql500, /* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -3460,8 +3429,7 @@ struct charset_info_st my_charset_ucs2_bin= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -3492,8 +3460,7 @@ struct charset_info_st my_charset_ucs2_general_nopad_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default, /* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -3524,8 +3491,7 @@ struct charset_info_st my_charset_ucs2_nopad_bin= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default, /* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c index 76f000e9ed6..a5624a8c341 100644 --- a/strings/ctype-ujis.c +++ b/strings/ctype-ujis.c @@ -67140,7 +67140,8 @@ static const MY_CASEFOLD_CHARACTER *my_casefold_pages_ujis[512]= static MY_CASEFOLD_INFO my_casefold_info_ujis= { 0x0FFFF, - my_casefold_pages_ujis + my_casefold_pages_ujis, + NULL /* ws */ }; @@ -67378,7 +67379,6 @@ struct charset_info_st my_charset_ujis_japanese_ci= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_info_ujis,/* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -67410,7 +67410,6 @@ struct charset_info_st my_charset_ujis_bin= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_info_ujis,/* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -67442,7 +67441,6 @@ struct charset_info_st my_charset_ujis_japanese_nopad_ci= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_info_ujis,/* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -67474,7 +67472,6 @@ struct charset_info_st my_charset_ujis_nopad_bin= NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ &my_casefold_info_ujis,/* casefold */ - NULL, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ diff --git a/strings/ctype-unicode300-casefold-tr.h b/strings/ctype-unicode300-casefold-tr.h new file mode 100644 index 00000000000..ff428112382 --- /dev/null +++ b/strings/ctype-unicode300-casefold-tr.h @@ -0,0 +1,193 @@ +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. + Copyright (c) 2009, 2023, MariaDB Corporation. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA +*/ + +/* + Generated by: + ./unidata-dump \ + --mode=casefold-tr \ + --page-name=u300tr_casefold_page \ + --page-name-derived=u300_casefold_page \ + --index-name=my_u300tr_casefold_index \ + --max-char=0xFFFF \ + UnicodeData-3.0.0.txt + +*/ +const MY_CASEFOLD_CHARACTER u300tr_casefold_page00[256]={ + {0x0000,0x0000},{0x0001,0x0001}, /* 0000 */ + {0x0002,0x0002},{0x0003,0x0003}, /* 0002 */ + {0x0004,0x0004},{0x0005,0x0005}, /* 0004 */ + {0x0006,0x0006},{0x0007,0x0007}, /* 0006 */ + {0x0008,0x0008},{0x0009,0x0009}, /* 0008 */ + {0x000A,0x000A},{0x000B,0x000B}, /* 000A */ + {0x000C,0x000C},{0x000D,0x000D}, /* 000C */ + {0x000E,0x000E},{0x000F,0x000F}, /* 000E */ + {0x0010,0x0010},{0x0011,0x0011}, /* 0010 */ + {0x0012,0x0012},{0x0013,0x0013}, /* 0012 */ + {0x0014,0x0014},{0x0015,0x0015}, /* 0014 */ + {0x0016,0x0016},{0x0017,0x0017}, /* 0016 */ + {0x0018,0x0018},{0x0019,0x0019}, /* 0018 */ + {0x001A,0x001A},{0x001B,0x001B}, /* 001A */ + {0x001C,0x001C},{0x001D,0x001D}, /* 001C */ + {0x001E,0x001E},{0x001F,0x001F}, /* 001E */ + {0x0020,0x0020},{0x0021,0x0021}, /* 0020 */ + {0x0022,0x0022},{0x0023,0x0023}, /* 0022 */ + {0x0024,0x0024},{0x0025,0x0025}, /* 0024 */ + {0x0026,0x0026},{0x0027,0x0027}, /* 0026 */ + {0x0028,0x0028},{0x0029,0x0029}, /* 0028 */ + {0x002A,0x002A},{0x002B,0x002B}, /* 002A */ + {0x002C,0x002C},{0x002D,0x002D}, /* 002C */ + {0x002E,0x002E},{0x002F,0x002F}, /* 002E */ + {0x0030,0x0030},{0x0031,0x0031}, /* 0030 */ + {0x0032,0x0032},{0x0033,0x0033}, /* 0032 */ + {0x0034,0x0034},{0x0035,0x0035}, /* 0034 */ + {0x0036,0x0036},{0x0037,0x0037}, /* 0036 */ + {0x0038,0x0038},{0x0039,0x0039}, /* 0038 */ + {0x003A,0x003A},{0x003B,0x003B}, /* 003A */ + {0x003C,0x003C},{0x003D,0x003D}, /* 003C */ + {0x003E,0x003E},{0x003F,0x003F}, /* 003E */ + {0x0040,0x0040},{0x0041,0x0061}, /* 0040 */ + {0x0042,0x0062},{0x0043,0x0063}, /* 0042 */ + {0x0044,0x0064},{0x0045,0x0065}, /* 0044 */ + {0x0046,0x0066},{0x0047,0x0067}, /* 0046 */ + {0x0048,0x0068},{0x0049,0x0131}, /* 0048 */ + {0x004A,0x006A},{0x004B,0x006B}, /* 004A */ + {0x004C,0x006C},{0x004D,0x006D}, /* 004C */ + {0x004E,0x006E},{0x004F,0x006F}, /* 004E */ + {0x0050,0x0070},{0x0051,0x0071}, /* 0050 */ + {0x0052,0x0072},{0x0053,0x0073}, /* 0052 */ + {0x0054,0x0074},{0x0055,0x0075}, /* 0054 */ + {0x0056,0x0076},{0x0057,0x0077}, /* 0056 */ + {0x0058,0x0078},{0x0059,0x0079}, /* 0058 */ + {0x005A,0x007A},{0x005B,0x005B}, /* 005A */ + {0x005C,0x005C},{0x005D,0x005D}, /* 005C */ + {0x005E,0x005E},{0x005F,0x005F}, /* 005E */ + {0x0060,0x0060},{0x0041,0x0061}, /* 0060 */ + {0x0042,0x0062},{0x0043,0x0063}, /* 0062 */ + {0x0044,0x0064},{0x0045,0x0065}, /* 0064 */ + {0x0046,0x0066},{0x0047,0x0067}, /* 0066 */ + {0x0048,0x0068},{0x0130,0x0069}, /* 0068 */ + {0x004A,0x006A},{0x004B,0x006B}, /* 006A */ + {0x004C,0x006C},{0x004D,0x006D}, /* 006C */ + {0x004E,0x006E},{0x004F,0x006F}, /* 006E */ + {0x0050,0x0070},{0x0051,0x0071}, /* 0070 */ + {0x0052,0x0072},{0x0053,0x0073}, /* 0072 */ + {0x0054,0x0074},{0x0055,0x0075}, /* 0074 */ + {0x0056,0x0076},{0x0057,0x0077}, /* 0076 */ + {0x0058,0x0078},{0x0059,0x0079}, /* 0078 */ + {0x005A,0x007A},{0x007B,0x007B}, /* 007A */ + {0x007C,0x007C},{0x007D,0x007D}, /* 007C */ + {0x007E,0x007E},{0x007F,0x007F}, /* 007E */ + {0x0080,0x0080},{0x0081,0x0081}, /* 0080 */ + {0x0082,0x0082},{0x0083,0x0083}, /* 0082 */ + {0x0084,0x0084},{0x0085,0x0085}, /* 0084 */ + {0x0086,0x0086},{0x0087,0x0087}, /* 0086 */ + {0x0088,0x0088},{0x0089,0x0089}, /* 0088 */ + {0x008A,0x008A},{0x008B,0x008B}, /* 008A */ + {0x008C,0x008C},{0x008D,0x008D}, /* 008C */ + {0x008E,0x008E},{0x008F,0x008F}, /* 008E */ + {0x0090,0x0090},{0x0091,0x0091}, /* 0090 */ + {0x0092,0x0092},{0x0093,0x0093}, /* 0092 */ + {0x0094,0x0094},{0x0095,0x0095}, /* 0094 */ + {0x0096,0x0096},{0x0097,0x0097}, /* 0096 */ + {0x0098,0x0098},{0x0099,0x0099}, /* 0098 */ + {0x009A,0x009A},{0x009B,0x009B}, /* 009A */ + {0x009C,0x009C},{0x009D,0x009D}, /* 009C */ + {0x009E,0x009E},{0x009F,0x009F}, /* 009E */ + {0x00A0,0x00A0},{0x00A1,0x00A1}, /* 00A0 */ + {0x00A2,0x00A2},{0x00A3,0x00A3}, /* 00A2 */ + {0x00A4,0x00A4},{0x00A5,0x00A5}, /* 00A4 */ + {0x00A6,0x00A6},{0x00A7,0x00A7}, /* 00A6 */ + {0x00A8,0x00A8},{0x00A9,0x00A9}, /* 00A8 */ + {0x00AA,0x00AA},{0x00AB,0x00AB}, /* 00AA */ + {0x00AC,0x00AC},{0x00AD,0x00AD}, /* 00AC */ + {0x00AE,0x00AE},{0x00AF,0x00AF}, /* 00AE */ + {0x00B0,0x00B0},{0x00B1,0x00B1}, /* 00B0 */ + {0x00B2,0x00B2},{0x00B3,0x00B3}, /* 00B2 */ + {0x00B4,0x00B4},{0x039C,0x00B5}, /* 00B4 */ + {0x00B6,0x00B6},{0x00B7,0x00B7}, /* 00B6 */ + {0x00B8,0x00B8},{0x00B9,0x00B9}, /* 00B8 */ + {0x00BA,0x00BA},{0x00BB,0x00BB}, /* 00BA */ + {0x00BC,0x00BC},{0x00BD,0x00BD}, /* 00BC */ + {0x00BE,0x00BE},{0x00BF,0x00BF}, /* 00BE */ + {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00C0 */ + {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00C2 */ + {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00C4 */ + {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00C6 */ + {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00C8 */ + {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00CA */ + {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00CC */ + {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00CE */ + {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00D0 */ + {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00D2 */ + {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00D4 */ + {0x00D6,0x00F6},{0x00D7,0x00D7}, /* 00D6 */ + {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00D8 */ + {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00DA */ + {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00DC */ + {0x00DE,0x00FE},{0x00DF,0x00DF}, /* 00DE */ + {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00E0 */ + {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00E2 */ + {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00E4 */ + {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00E6 */ + {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00E8 */ + {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00EA */ + {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00EC */ + {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00EE */ + {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00F0 */ + {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00F2 */ + {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00F4 */ + {0x00D6,0x00F6},{0x00F7,0x00F7}, /* 00F6 */ + {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00F8 */ + {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00FA */ + {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00FC */ + {0x00DE,0x00FE},{0x0178,0x00FF} /* 00FE */ +}; + +const MY_CASEFOLD_CHARACTER * my_u300tr_casefold_index[256]={ + u300tr_casefold_page00, u300_casefold_page01, u300_casefold_page02, u300_casefold_page03, u300_casefold_page04, u300_casefold_page05, u300_casefold_page06, u300_casefold_page07, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, u300_casefold_page1E, u300_casefold_page1F, + NULL, u300_casefold_page21, NULL, NULL, u300_casefold_page24, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, u300_casefold_pageFF +}; diff --git a/strings/ctype-unicode300-casefold.h b/strings/ctype-unicode300-casefold.h new file mode 100644 index 00000000000..353cba0846a --- /dev/null +++ b/strings/ctype-unicode300-casefold.h @@ -0,0 +1,1764 @@ +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. + Copyright (c) 2009, 2023, MariaDB Corporation. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA +*/ + +/* + Generated by: + ./unidata-dump \ + --mode=casefold \ + --page-name=u300_casefold_page \ + --index-name=my_u300_casefold_index \ + --max-char=0xFFFF \ + UnicodeData-3.0.0.txt + +*/ +const MY_CASEFOLD_CHARACTER u300_casefold_page00[256]={ + {0x0000,0x0000},{0x0001,0x0001}, /* 0000 */ + {0x0002,0x0002},{0x0003,0x0003}, /* 0002 */ + {0x0004,0x0004},{0x0005,0x0005}, /* 0004 */ + {0x0006,0x0006},{0x0007,0x0007}, /* 0006 */ + {0x0008,0x0008},{0x0009,0x0009}, /* 0008 */ + {0x000A,0x000A},{0x000B,0x000B}, /* 000A */ + {0x000C,0x000C},{0x000D,0x000D}, /* 000C */ + {0x000E,0x000E},{0x000F,0x000F}, /* 000E */ + {0x0010,0x0010},{0x0011,0x0011}, /* 0010 */ + {0x0012,0x0012},{0x0013,0x0013}, /* 0012 */ + {0x0014,0x0014},{0x0015,0x0015}, /* 0014 */ + {0x0016,0x0016},{0x0017,0x0017}, /* 0016 */ + {0x0018,0x0018},{0x0019,0x0019}, /* 0018 */ + {0x001A,0x001A},{0x001B,0x001B}, /* 001A */ + {0x001C,0x001C},{0x001D,0x001D}, /* 001C */ + {0x001E,0x001E},{0x001F,0x001F}, /* 001E */ + {0x0020,0x0020},{0x0021,0x0021}, /* 0020 */ + {0x0022,0x0022},{0x0023,0x0023}, /* 0022 */ + {0x0024,0x0024},{0x0025,0x0025}, /* 0024 */ + {0x0026,0x0026},{0x0027,0x0027}, /* 0026 */ + {0x0028,0x0028},{0x0029,0x0029}, /* 0028 */ + {0x002A,0x002A},{0x002B,0x002B}, /* 002A */ + {0x002C,0x002C},{0x002D,0x002D}, /* 002C */ + {0x002E,0x002E},{0x002F,0x002F}, /* 002E */ + {0x0030,0x0030},{0x0031,0x0031}, /* 0030 */ + {0x0032,0x0032},{0x0033,0x0033}, /* 0032 */ + {0x0034,0x0034},{0x0035,0x0035}, /* 0034 */ + {0x0036,0x0036},{0x0037,0x0037}, /* 0036 */ + {0x0038,0x0038},{0x0039,0x0039}, /* 0038 */ + {0x003A,0x003A},{0x003B,0x003B}, /* 003A */ + {0x003C,0x003C},{0x003D,0x003D}, /* 003C */ + {0x003E,0x003E},{0x003F,0x003F}, /* 003E */ + {0x0040,0x0040},{0x0041,0x0061}, /* 0040 */ + {0x0042,0x0062},{0x0043,0x0063}, /* 0042 */ + {0x0044,0x0064},{0x0045,0x0065}, /* 0044 */ + {0x0046,0x0066},{0x0047,0x0067}, /* 0046 */ + {0x0048,0x0068},{0x0049,0x0069}, /* 0048 */ + {0x004A,0x006A},{0x004B,0x006B}, /* 004A */ + {0x004C,0x006C},{0x004D,0x006D}, /* 004C */ + {0x004E,0x006E},{0x004F,0x006F}, /* 004E */ + {0x0050,0x0070},{0x0051,0x0071}, /* 0050 */ + {0x0052,0x0072},{0x0053,0x0073}, /* 0052 */ + {0x0054,0x0074},{0x0055,0x0075}, /* 0054 */ + {0x0056,0x0076},{0x0057,0x0077}, /* 0056 */ + {0x0058,0x0078},{0x0059,0x0079}, /* 0058 */ + {0x005A,0x007A},{0x005B,0x005B}, /* 005A */ + {0x005C,0x005C},{0x005D,0x005D}, /* 005C */ + {0x005E,0x005E},{0x005F,0x005F}, /* 005E */ + {0x0060,0x0060},{0x0041,0x0061}, /* 0060 */ + {0x0042,0x0062},{0x0043,0x0063}, /* 0062 */ + {0x0044,0x0064},{0x0045,0x0065}, /* 0064 */ + {0x0046,0x0066},{0x0047,0x0067}, /* 0066 */ + {0x0048,0x0068},{0x0049,0x0069}, /* 0068 */ + {0x004A,0x006A},{0x004B,0x006B}, /* 006A */ + {0x004C,0x006C},{0x004D,0x006D}, /* 006C */ + {0x004E,0x006E},{0x004F,0x006F}, /* 006E */ + {0x0050,0x0070},{0x0051,0x0071}, /* 0070 */ + {0x0052,0x0072},{0x0053,0x0073}, /* 0072 */ + {0x0054,0x0074},{0x0055,0x0075}, /* 0074 */ + {0x0056,0x0076},{0x0057,0x0077}, /* 0076 */ + {0x0058,0x0078},{0x0059,0x0079}, /* 0078 */ + {0x005A,0x007A},{0x007B,0x007B}, /* 007A */ + {0x007C,0x007C},{0x007D,0x007D}, /* 007C */ + {0x007E,0x007E},{0x007F,0x007F}, /* 007E */ + {0x0080,0x0080},{0x0081,0x0081}, /* 0080 */ + {0x0082,0x0082},{0x0083,0x0083}, /* 0082 */ + {0x0084,0x0084},{0x0085,0x0085}, /* 0084 */ + {0x0086,0x0086},{0x0087,0x0087}, /* 0086 */ + {0x0088,0x0088},{0x0089,0x0089}, /* 0088 */ + {0x008A,0x008A},{0x008B,0x008B}, /* 008A */ + {0x008C,0x008C},{0x008D,0x008D}, /* 008C */ + {0x008E,0x008E},{0x008F,0x008F}, /* 008E */ + {0x0090,0x0090},{0x0091,0x0091}, /* 0090 */ + {0x0092,0x0092},{0x0093,0x0093}, /* 0092 */ + {0x0094,0x0094},{0x0095,0x0095}, /* 0094 */ + {0x0096,0x0096},{0x0097,0x0097}, /* 0096 */ + {0x0098,0x0098},{0x0099,0x0099}, /* 0098 */ + {0x009A,0x009A},{0x009B,0x009B}, /* 009A */ + {0x009C,0x009C},{0x009D,0x009D}, /* 009C */ + {0x009E,0x009E},{0x009F,0x009F}, /* 009E */ + {0x00A0,0x00A0},{0x00A1,0x00A1}, /* 00A0 */ + {0x00A2,0x00A2},{0x00A3,0x00A3}, /* 00A2 */ + {0x00A4,0x00A4},{0x00A5,0x00A5}, /* 00A4 */ + {0x00A6,0x00A6},{0x00A7,0x00A7}, /* 00A6 */ + {0x00A8,0x00A8},{0x00A9,0x00A9}, /* 00A8 */ + {0x00AA,0x00AA},{0x00AB,0x00AB}, /* 00AA */ + {0x00AC,0x00AC},{0x00AD,0x00AD}, /* 00AC */ + {0x00AE,0x00AE},{0x00AF,0x00AF}, /* 00AE */ + {0x00B0,0x00B0},{0x00B1,0x00B1}, /* 00B0 */ + {0x00B2,0x00B2},{0x00B3,0x00B3}, /* 00B2 */ + {0x00B4,0x00B4},{0x039C,0x00B5}, /* 00B4 */ + {0x00B6,0x00B6},{0x00B7,0x00B7}, /* 00B6 */ + {0x00B8,0x00B8},{0x00B9,0x00B9}, /* 00B8 */ + {0x00BA,0x00BA},{0x00BB,0x00BB}, /* 00BA */ + {0x00BC,0x00BC},{0x00BD,0x00BD}, /* 00BC */ + {0x00BE,0x00BE},{0x00BF,0x00BF}, /* 00BE */ + {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00C0 */ + {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00C2 */ + {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00C4 */ + {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00C6 */ + {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00C8 */ + {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00CA */ + {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00CC */ + {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00CE */ + {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00D0 */ + {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00D2 */ + {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00D4 */ + {0x00D6,0x00F6},{0x00D7,0x00D7}, /* 00D6 */ + {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00D8 */ + {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00DA */ + {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00DC */ + {0x00DE,0x00FE},{0x00DF,0x00DF}, /* 00DE */ + {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00E0 */ + {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00E2 */ + {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00E4 */ + {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00E6 */ + {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00E8 */ + {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00EA */ + {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00EC */ + {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00EE */ + {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00F0 */ + {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00F2 */ + {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00F4 */ + {0x00D6,0x00F6},{0x00F7,0x00F7}, /* 00F6 */ + {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00F8 */ + {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00FA */ + {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00FC */ + {0x00DE,0x00FE},{0x0178,0x00FF} /* 00FE */ +}; + +static const MY_CASEFOLD_CHARACTER u300_casefold_page01[256]={ + {0x0100,0x0101},{0x0100,0x0101}, /* 0100 */ + {0x0102,0x0103},{0x0102,0x0103}, /* 0102 */ + {0x0104,0x0105},{0x0104,0x0105}, /* 0104 */ + {0x0106,0x0107},{0x0106,0x0107}, /* 0106 */ + {0x0108,0x0109},{0x0108,0x0109}, /* 0108 */ + {0x010A,0x010B},{0x010A,0x010B}, /* 010A */ + {0x010C,0x010D},{0x010C,0x010D}, /* 010C */ + {0x010E,0x010F},{0x010E,0x010F}, /* 010E */ + {0x0110,0x0111},{0x0110,0x0111}, /* 0110 */ + {0x0112,0x0113},{0x0112,0x0113}, /* 0112 */ + {0x0114,0x0115},{0x0114,0x0115}, /* 0114 */ + {0x0116,0x0117},{0x0116,0x0117}, /* 0116 */ + {0x0118,0x0119},{0x0118,0x0119}, /* 0118 */ + {0x011A,0x011B},{0x011A,0x011B}, /* 011A */ + {0x011C,0x011D},{0x011C,0x011D}, /* 011C */ + {0x011E,0x011F},{0x011E,0x011F}, /* 011E */ + {0x0120,0x0121},{0x0120,0x0121}, /* 0120 */ + {0x0122,0x0123},{0x0122,0x0123}, /* 0122 */ + {0x0124,0x0125},{0x0124,0x0125}, /* 0124 */ + {0x0126,0x0127},{0x0126,0x0127}, /* 0126 */ + {0x0128,0x0129},{0x0128,0x0129}, /* 0128 */ + {0x012A,0x012B},{0x012A,0x012B}, /* 012A */ + {0x012C,0x012D},{0x012C,0x012D}, /* 012C */ + {0x012E,0x012F},{0x012E,0x012F}, /* 012E */ + {0x0130,0x0069},{0x0049,0x0131}, /* 0130 */ + {0x0132,0x0133},{0x0132,0x0133}, /* 0132 */ + {0x0134,0x0135},{0x0134,0x0135}, /* 0134 */ + {0x0136,0x0137},{0x0136,0x0137}, /* 0136 */ + {0x0138,0x0138},{0x0139,0x013A}, /* 0138 */ + {0x0139,0x013A},{0x013B,0x013C}, /* 013A */ + {0x013B,0x013C},{0x013D,0x013E}, /* 013C */ + {0x013D,0x013E},{0x013F,0x0140}, /* 013E */ + {0x013F,0x0140},{0x0141,0x0142}, /* 0140 */ + {0x0141,0x0142},{0x0143,0x0144}, /* 0142 */ + {0x0143,0x0144},{0x0145,0x0146}, /* 0144 */ + {0x0145,0x0146},{0x0147,0x0148}, /* 0146 */ + {0x0147,0x0148},{0x0149,0x0149}, /* 0148 */ + {0x014A,0x014B},{0x014A,0x014B}, /* 014A */ + {0x014C,0x014D},{0x014C,0x014D}, /* 014C */ + {0x014E,0x014F},{0x014E,0x014F}, /* 014E */ + {0x0150,0x0151},{0x0150,0x0151}, /* 0150 */ + {0x0152,0x0153},{0x0152,0x0153}, /* 0152 */ + {0x0154,0x0155},{0x0154,0x0155}, /* 0154 */ + {0x0156,0x0157},{0x0156,0x0157}, /* 0156 */ + {0x0158,0x0159},{0x0158,0x0159}, /* 0158 */ + {0x015A,0x015B},{0x015A,0x015B}, /* 015A */ + {0x015C,0x015D},{0x015C,0x015D}, /* 015C */ + {0x015E,0x015F},{0x015E,0x015F}, /* 015E */ + {0x0160,0x0161},{0x0160,0x0161}, /* 0160 */ + {0x0162,0x0163},{0x0162,0x0163}, /* 0162 */ + {0x0164,0x0165},{0x0164,0x0165}, /* 0164 */ + {0x0166,0x0167},{0x0166,0x0167}, /* 0166 */ + {0x0168,0x0169},{0x0168,0x0169}, /* 0168 */ + {0x016A,0x016B},{0x016A,0x016B}, /* 016A */ + {0x016C,0x016D},{0x016C,0x016D}, /* 016C */ + {0x016E,0x016F},{0x016E,0x016F}, /* 016E */ + {0x0170,0x0171},{0x0170,0x0171}, /* 0170 */ + {0x0172,0x0173},{0x0172,0x0173}, /* 0172 */ + {0x0174,0x0175},{0x0174,0x0175}, /* 0174 */ + {0x0176,0x0177},{0x0176,0x0177}, /* 0176 */ + {0x0178,0x00FF},{0x0179,0x017A}, /* 0178 */ + {0x0179,0x017A},{0x017B,0x017C}, /* 017A */ + {0x017B,0x017C},{0x017D,0x017E}, /* 017C */ + {0x017D,0x017E},{0x0053,0x017F}, /* 017E */ + {0x0180,0x0180},{0x0181,0x0253}, /* 0180 */ + {0x0182,0x0183},{0x0182,0x0183}, /* 0182 */ + {0x0184,0x0185},{0x0184,0x0185}, /* 0184 */ + {0x0186,0x0254},{0x0187,0x0188}, /* 0186 */ + {0x0187,0x0188},{0x0189,0x0256}, /* 0188 */ + {0x018A,0x0257},{0x018B,0x018C}, /* 018A */ + {0x018B,0x018C},{0x018D,0x018D}, /* 018C */ + {0x018E,0x01DD},{0x018F,0x0259}, /* 018E */ + {0x0190,0x025B},{0x0191,0x0192}, /* 0190 */ + {0x0191,0x0192},{0x0193,0x0260}, /* 0192 */ + {0x0194,0x0263},{0x01F6,0x0195}, /* 0194 */ + {0x0196,0x0269},{0x0197,0x0268}, /* 0196 */ + {0x0198,0x0199},{0x0198,0x0199}, /* 0198 */ + {0x019A,0x019A},{0x019B,0x019B}, /* 019A */ + {0x019C,0x026F},{0x019D,0x0272}, /* 019C */ + {0x019E,0x019E},{0x019F,0x0275}, /* 019E */ + {0x01A0,0x01A1},{0x01A0,0x01A1}, /* 01A0 */ + {0x01A2,0x01A3},{0x01A2,0x01A3}, /* 01A2 */ + {0x01A4,0x01A5},{0x01A4,0x01A5}, /* 01A4 */ + {0x01A6,0x0280},{0x01A7,0x01A8}, /* 01A6 */ + {0x01A7,0x01A8},{0x01A9,0x0283}, /* 01A8 */ + {0x01AA,0x01AA},{0x01AB,0x01AB}, /* 01AA */ + {0x01AC,0x01AD},{0x01AC,0x01AD}, /* 01AC */ + {0x01AE,0x0288},{0x01AF,0x01B0}, /* 01AE */ + {0x01AF,0x01B0},{0x01B1,0x028A}, /* 01B0 */ + {0x01B2,0x028B},{0x01B3,0x01B4}, /* 01B2 */ + {0x01B3,0x01B4},{0x01B5,0x01B6}, /* 01B4 */ + {0x01B5,0x01B6},{0x01B7,0x0292}, /* 01B6 */ + {0x01B8,0x01B9},{0x01B8,0x01B9}, /* 01B8 */ + {0x01BA,0x01BA},{0x01BB,0x01BB}, /* 01BA */ + {0x01BC,0x01BD},{0x01BC,0x01BD}, /* 01BC */ + {0x01BE,0x01BE},{0x01F7,0x01BF}, /* 01BE */ + {0x01C0,0x01C0},{0x01C1,0x01C1}, /* 01C0 */ + {0x01C2,0x01C2},{0x01C3,0x01C3}, /* 01C2 */ + {0x01C4,0x01C6},{0x01C4,0x01C6}, /* 01C4 */ + {0x01C4,0x01C6},{0x01C7,0x01C9}, /* 01C6 */ + {0x01C7,0x01C9},{0x01C7,0x01C9}, /* 01C8 */ + {0x01CA,0x01CC},{0x01CA,0x01CC}, /* 01CA */ + {0x01CA,0x01CC},{0x01CD,0x01CE}, /* 01CC */ + {0x01CD,0x01CE},{0x01CF,0x01D0}, /* 01CE */ + {0x01CF,0x01D0},{0x01D1,0x01D2}, /* 01D0 */ + {0x01D1,0x01D2},{0x01D3,0x01D4}, /* 01D2 */ + {0x01D3,0x01D4},{0x01D5,0x01D6}, /* 01D4 */ + {0x01D5,0x01D6},{0x01D7,0x01D8}, /* 01D6 */ + {0x01D7,0x01D8},{0x01D9,0x01DA}, /* 01D8 */ + {0x01D9,0x01DA},{0x01DB,0x01DC}, /* 01DA */ + {0x01DB,0x01DC},{0x018E,0x01DD}, /* 01DC */ + {0x01DE,0x01DF},{0x01DE,0x01DF}, /* 01DE */ + {0x01E0,0x01E1},{0x01E0,0x01E1}, /* 01E0 */ + {0x01E2,0x01E3},{0x01E2,0x01E3}, /* 01E2 */ + {0x01E4,0x01E5},{0x01E4,0x01E5}, /* 01E4 */ + {0x01E6,0x01E7},{0x01E6,0x01E7}, /* 01E6 */ + {0x01E8,0x01E9},{0x01E8,0x01E9}, /* 01E8 */ + {0x01EA,0x01EB},{0x01EA,0x01EB}, /* 01EA */ + {0x01EC,0x01ED},{0x01EC,0x01ED}, /* 01EC */ + {0x01EE,0x01EF},{0x01EE,0x01EF}, /* 01EE */ + {0x01F0,0x01F0},{0x01F1,0x01F3}, /* 01F0 */ + {0x01F1,0x01F3},{0x01F1,0x01F3}, /* 01F2 */ + {0x01F4,0x01F5},{0x01F4,0x01F5}, /* 01F4 */ + {0x01F6,0x0195},{0x01F7,0x01BF}, /* 01F6 */ + {0x01F8,0x01F9},{0x01F8,0x01F9}, /* 01F8 */ + {0x01FA,0x01FB},{0x01FA,0x01FB}, /* 01FA */ + {0x01FC,0x01FD},{0x01FC,0x01FD}, /* 01FC */ + {0x01FE,0x01FF},{0x01FE,0x01FF} /* 01FE */ +}; + +static const MY_CASEFOLD_CHARACTER u300_casefold_page02[256]={ + {0x0200,0x0201},{0x0200,0x0201}, /* 0200 */ + {0x0202,0x0203},{0x0202,0x0203}, /* 0202 */ + {0x0204,0x0205},{0x0204,0x0205}, /* 0204 */ + {0x0206,0x0207},{0x0206,0x0207}, /* 0206 */ + {0x0208,0x0209},{0x0208,0x0209}, /* 0208 */ + {0x020A,0x020B},{0x020A,0x020B}, /* 020A */ + {0x020C,0x020D},{0x020C,0x020D}, /* 020C */ + {0x020E,0x020F},{0x020E,0x020F}, /* 020E */ + {0x0210,0x0211},{0x0210,0x0211}, /* 0210 */ + {0x0212,0x0213},{0x0212,0x0213}, /* 0212 */ + {0x0214,0x0215},{0x0214,0x0215}, /* 0214 */ + {0x0216,0x0217},{0x0216,0x0217}, /* 0216 */ + {0x0218,0x0219},{0x0218,0x0219}, /* 0218 */ + {0x021A,0x021B},{0x021A,0x021B}, /* 021A */ + {0x021C,0x021D},{0x021C,0x021D}, /* 021C */ + {0x021E,0x021F},{0x021E,0x021F}, /* 021E */ + {0x0220,0x0220},{0x0221,0x0221}, /* 0220 */ + {0x0222,0x0223},{0x0222,0x0223}, /* 0222 */ + {0x0224,0x0225},{0x0224,0x0225}, /* 0224 */ + {0x0226,0x0227},{0x0226,0x0227}, /* 0226 */ + {0x0228,0x0229},{0x0228,0x0229}, /* 0228 */ + {0x022A,0x022B},{0x022A,0x022B}, /* 022A */ + {0x022C,0x022D},{0x022C,0x022D}, /* 022C */ + {0x022E,0x022F},{0x022E,0x022F}, /* 022E */ + {0x0230,0x0231},{0x0230,0x0231}, /* 0230 */ + {0x0232,0x0233},{0x0232,0x0233}, /* 0232 */ + {0x0234,0x0234},{0x0235,0x0235}, /* 0234 */ + {0x0236,0x0236},{0x0237,0x0237}, /* 0236 */ + {0x0238,0x0238},{0x0239,0x0239}, /* 0238 */ + {0x023A,0x023A},{0x023B,0x023B}, /* 023A */ + {0x023C,0x023C},{0x023D,0x023D}, /* 023C */ + {0x023E,0x023E},{0x023F,0x023F}, /* 023E */ + {0x0240,0x0240},{0x0241,0x0241}, /* 0240 */ + {0x0242,0x0242},{0x0243,0x0243}, /* 0242 */ + {0x0244,0x0244},{0x0245,0x0245}, /* 0244 */ + {0x0246,0x0246},{0x0247,0x0247}, /* 0246 */ + {0x0248,0x0248},{0x0249,0x0249}, /* 0248 */ + {0x024A,0x024A},{0x024B,0x024B}, /* 024A */ + {0x024C,0x024C},{0x024D,0x024D}, /* 024C */ + {0x024E,0x024E},{0x024F,0x024F}, /* 024E */ + {0x0250,0x0250},{0x0251,0x0251}, /* 0250 */ + {0x0252,0x0252},{0x0181,0x0253}, /* 0252 */ + {0x0186,0x0254},{0x0255,0x0255}, /* 0254 */ + {0x0189,0x0256},{0x018A,0x0257}, /* 0256 */ + {0x0258,0x0258},{0x018F,0x0259}, /* 0258 */ + {0x025A,0x025A},{0x0190,0x025B}, /* 025A */ + {0x025C,0x025C},{0x025D,0x025D}, /* 025C */ + {0x025E,0x025E},{0x025F,0x025F}, /* 025E */ + {0x0193,0x0260},{0x0261,0x0261}, /* 0260 */ + {0x0262,0x0262},{0x0194,0x0263}, /* 0262 */ + {0x0264,0x0264},{0x0265,0x0265}, /* 0264 */ + {0x0266,0x0266},{0x0267,0x0267}, /* 0266 */ + {0x0197,0x0268},{0x0196,0x0269}, /* 0268 */ + {0x026A,0x026A},{0x026B,0x026B}, /* 026A */ + {0x026C,0x026C},{0x026D,0x026D}, /* 026C */ + {0x026E,0x026E},{0x019C,0x026F}, /* 026E */ + {0x0270,0x0270},{0x0271,0x0271}, /* 0270 */ + {0x019D,0x0272},{0x0273,0x0273}, /* 0272 */ + {0x0274,0x0274},{0x019F,0x0275}, /* 0274 */ + {0x0276,0x0276},{0x0277,0x0277}, /* 0276 */ + {0x0278,0x0278},{0x0279,0x0279}, /* 0278 */ + {0x027A,0x027A},{0x027B,0x027B}, /* 027A */ + {0x027C,0x027C},{0x027D,0x027D}, /* 027C */ + {0x027E,0x027E},{0x027F,0x027F}, /* 027E */ + {0x01A6,0x0280},{0x0281,0x0281}, /* 0280 */ + {0x0282,0x0282},{0x01A9,0x0283}, /* 0282 */ + {0x0284,0x0284},{0x0285,0x0285}, /* 0284 */ + {0x0286,0x0286},{0x0287,0x0287}, /* 0286 */ + {0x01AE,0x0288},{0x0289,0x0289}, /* 0288 */ + {0x01B1,0x028A},{0x01B2,0x028B}, /* 028A */ + {0x028C,0x028C},{0x028D,0x028D}, /* 028C */ + {0x028E,0x028E},{0x028F,0x028F}, /* 028E */ + {0x0290,0x0290},{0x0291,0x0291}, /* 0290 */ + {0x01B7,0x0292},{0x0293,0x0293}, /* 0292 */ + {0x0294,0x0294},{0x0295,0x0295}, /* 0294 */ + {0x0296,0x0296},{0x0297,0x0297}, /* 0296 */ + {0x0298,0x0298},{0x0299,0x0299}, /* 0298 */ + {0x029A,0x029A},{0x029B,0x029B}, /* 029A */ + {0x029C,0x029C},{0x029D,0x029D}, /* 029C */ + {0x029E,0x029E},{0x029F,0x029F}, /* 029E */ + {0x02A0,0x02A0},{0x02A1,0x02A1}, /* 02A0 */ + {0x02A2,0x02A2},{0x02A3,0x02A3}, /* 02A2 */ + {0x02A4,0x02A4},{0x02A5,0x02A5}, /* 02A4 */ + {0x02A6,0x02A6},{0x02A7,0x02A7}, /* 02A6 */ + {0x02A8,0x02A8},{0x02A9,0x02A9}, /* 02A8 */ + {0x02AA,0x02AA},{0x02AB,0x02AB}, /* 02AA */ + {0x02AC,0x02AC},{0x02AD,0x02AD}, /* 02AC */ + {0x02AE,0x02AE},{0x02AF,0x02AF}, /* 02AE */ + {0x02B0,0x02B0},{0x02B1,0x02B1}, /* 02B0 */ + {0x02B2,0x02B2},{0x02B3,0x02B3}, /* 02B2 */ + {0x02B4,0x02B4},{0x02B5,0x02B5}, /* 02B4 */ + {0x02B6,0x02B6},{0x02B7,0x02B7}, /* 02B6 */ + {0x02B8,0x02B8},{0x02B9,0x02B9}, /* 02B8 */ + {0x02BA,0x02BA},{0x02BB,0x02BB}, /* 02BA */ + {0x02BC,0x02BC},{0x02BD,0x02BD}, /* 02BC */ + {0x02BE,0x02BE},{0x02BF,0x02BF}, /* 02BE */ + {0x02C0,0x02C0},{0x02C1,0x02C1}, /* 02C0 */ + {0x02C2,0x02C2},{0x02C3,0x02C3}, /* 02C2 */ + {0x02C4,0x02C4},{0x02C5,0x02C5}, /* 02C4 */ + {0x02C6,0x02C6},{0x02C7,0x02C7}, /* 02C6 */ + {0x02C8,0x02C8},{0x02C9,0x02C9}, /* 02C8 */ + {0x02CA,0x02CA},{0x02CB,0x02CB}, /* 02CA */ + {0x02CC,0x02CC},{0x02CD,0x02CD}, /* 02CC */ + {0x02CE,0x02CE},{0x02CF,0x02CF}, /* 02CE */ + {0x02D0,0x02D0},{0x02D1,0x02D1}, /* 02D0 */ + {0x02D2,0x02D2},{0x02D3,0x02D3}, /* 02D2 */ + {0x02D4,0x02D4},{0x02D5,0x02D5}, /* 02D4 */ + {0x02D6,0x02D6},{0x02D7,0x02D7}, /* 02D6 */ + {0x02D8,0x02D8},{0x02D9,0x02D9}, /* 02D8 */ + {0x02DA,0x02DA},{0x02DB,0x02DB}, /* 02DA */ + {0x02DC,0x02DC},{0x02DD,0x02DD}, /* 02DC */ + {0x02DE,0x02DE},{0x02DF,0x02DF}, /* 02DE */ + {0x02E0,0x02E0},{0x02E1,0x02E1}, /* 02E0 */ + {0x02E2,0x02E2},{0x02E3,0x02E3}, /* 02E2 */ + {0x02E4,0x02E4},{0x02E5,0x02E5}, /* 02E4 */ + {0x02E6,0x02E6},{0x02E7,0x02E7}, /* 02E6 */ + {0x02E8,0x02E8},{0x02E9,0x02E9}, /* 02E8 */ + {0x02EA,0x02EA},{0x02EB,0x02EB}, /* 02EA */ + {0x02EC,0x02EC},{0x02ED,0x02ED}, /* 02EC */ + {0x02EE,0x02EE},{0x02EF,0x02EF}, /* 02EE */ + {0x02F0,0x02F0},{0x02F1,0x02F1}, /* 02F0 */ + {0x02F2,0x02F2},{0x02F3,0x02F3}, /* 02F2 */ + {0x02F4,0x02F4},{0x02F5,0x02F5}, /* 02F4 */ + {0x02F6,0x02F6},{0x02F7,0x02F7}, /* 02F6 */ + {0x02F8,0x02F8},{0x02F9,0x02F9}, /* 02F8 */ + {0x02FA,0x02FA},{0x02FB,0x02FB}, /* 02FA */ + {0x02FC,0x02FC},{0x02FD,0x02FD}, /* 02FC */ + {0x02FE,0x02FE},{0x02FF,0x02FF} /* 02FE */ +}; + +static const MY_CASEFOLD_CHARACTER u300_casefold_page03[256]={ + {0x0300,0x0300},{0x0301,0x0301}, /* 0300 */ + {0x0302,0x0302},{0x0303,0x0303}, /* 0302 */ + {0x0304,0x0304},{0x0305,0x0305}, /* 0304 */ + {0x0306,0x0306},{0x0307,0x0307}, /* 0306 */ + {0x0308,0x0308},{0x0309,0x0309}, /* 0308 */ + {0x030A,0x030A},{0x030B,0x030B}, /* 030A */ + {0x030C,0x030C},{0x030D,0x030D}, /* 030C */ + {0x030E,0x030E},{0x030F,0x030F}, /* 030E */ + {0x0310,0x0310},{0x0311,0x0311}, /* 0310 */ + {0x0312,0x0312},{0x0313,0x0313}, /* 0312 */ + {0x0314,0x0314},{0x0315,0x0315}, /* 0314 */ + {0x0316,0x0316},{0x0317,0x0317}, /* 0316 */ + {0x0318,0x0318},{0x0319,0x0319}, /* 0318 */ + {0x031A,0x031A},{0x031B,0x031B}, /* 031A */ + {0x031C,0x031C},{0x031D,0x031D}, /* 031C */ + {0x031E,0x031E},{0x031F,0x031F}, /* 031E */ + {0x0320,0x0320},{0x0321,0x0321}, /* 0320 */ + {0x0322,0x0322},{0x0323,0x0323}, /* 0322 */ + {0x0324,0x0324},{0x0325,0x0325}, /* 0324 */ + {0x0326,0x0326},{0x0327,0x0327}, /* 0326 */ + {0x0328,0x0328},{0x0329,0x0329}, /* 0328 */ + {0x032A,0x032A},{0x032B,0x032B}, /* 032A */ + {0x032C,0x032C},{0x032D,0x032D}, /* 032C */ + {0x032E,0x032E},{0x032F,0x032F}, /* 032E */ + {0x0330,0x0330},{0x0331,0x0331}, /* 0330 */ + {0x0332,0x0332},{0x0333,0x0333}, /* 0332 */ + {0x0334,0x0334},{0x0335,0x0335}, /* 0334 */ + {0x0336,0x0336},{0x0337,0x0337}, /* 0336 */ + {0x0338,0x0338},{0x0339,0x0339}, /* 0338 */ + {0x033A,0x033A},{0x033B,0x033B}, /* 033A */ + {0x033C,0x033C},{0x033D,0x033D}, /* 033C */ + {0x033E,0x033E},{0x033F,0x033F}, /* 033E */ + {0x0340,0x0340},{0x0341,0x0341}, /* 0340 */ + {0x0342,0x0342},{0x0343,0x0343}, /* 0342 */ + {0x0344,0x0344},{0x0399,0x0345}, /* 0344 */ + {0x0346,0x0346},{0x0347,0x0347}, /* 0346 */ + {0x0348,0x0348},{0x0349,0x0349}, /* 0348 */ + {0x034A,0x034A},{0x034B,0x034B}, /* 034A */ + {0x034C,0x034C},{0x034D,0x034D}, /* 034C */ + {0x034E,0x034E},{0x034F,0x034F}, /* 034E */ + {0x0350,0x0350},{0x0351,0x0351}, /* 0350 */ + {0x0352,0x0352},{0x0353,0x0353}, /* 0352 */ + {0x0354,0x0354},{0x0355,0x0355}, /* 0354 */ + {0x0356,0x0356},{0x0357,0x0357}, /* 0356 */ + {0x0358,0x0358},{0x0359,0x0359}, /* 0358 */ + {0x035A,0x035A},{0x035B,0x035B}, /* 035A */ + {0x035C,0x035C},{0x035D,0x035D}, /* 035C */ + {0x035E,0x035E},{0x035F,0x035F}, /* 035E */ + {0x0360,0x0360},{0x0361,0x0361}, /* 0360 */ + {0x0362,0x0362},{0x0363,0x0363}, /* 0362 */ + {0x0364,0x0364},{0x0365,0x0365}, /* 0364 */ + {0x0366,0x0366},{0x0367,0x0367}, /* 0366 */ + {0x0368,0x0368},{0x0369,0x0369}, /* 0368 */ + {0x036A,0x036A},{0x036B,0x036B}, /* 036A */ + {0x036C,0x036C},{0x036D,0x036D}, /* 036C */ + {0x036E,0x036E},{0x036F,0x036F}, /* 036E */ + {0x0370,0x0370},{0x0371,0x0371}, /* 0370 */ + {0x0372,0x0372},{0x0373,0x0373}, /* 0372 */ + {0x0374,0x0374},{0x0375,0x0375}, /* 0374 */ + {0x0376,0x0376},{0x0377,0x0377}, /* 0376 */ + {0x0378,0x0378},{0x0379,0x0379}, /* 0378 */ + {0x037A,0x037A},{0x037B,0x037B}, /* 037A */ + {0x037C,0x037C},{0x037D,0x037D}, /* 037C */ + {0x037E,0x037E},{0x037F,0x037F}, /* 037E */ + {0x0380,0x0380},{0x0381,0x0381}, /* 0380 */ + {0x0382,0x0382},{0x0383,0x0383}, /* 0382 */ + {0x0384,0x0384},{0x0385,0x0385}, /* 0384 */ + {0x0386,0x03AC},{0x0387,0x0387}, /* 0386 */ + {0x0388,0x03AD},{0x0389,0x03AE}, /* 0388 */ + {0x038A,0x03AF},{0x038B,0x038B}, /* 038A */ + {0x038C,0x03CC},{0x038D,0x038D}, /* 038C */ + {0x038E,0x03CD},{0x038F,0x03CE}, /* 038E */ + {0x0390,0x0390},{0x0391,0x03B1}, /* 0390 */ + {0x0392,0x03B2},{0x0393,0x03B3}, /* 0392 */ + {0x0394,0x03B4},{0x0395,0x03B5}, /* 0394 */ + {0x0396,0x03B6},{0x0397,0x03B7}, /* 0396 */ + {0x0398,0x03B8},{0x0399,0x03B9}, /* 0398 */ + {0x039A,0x03BA},{0x039B,0x03BB}, /* 039A */ + {0x039C,0x03BC},{0x039D,0x03BD}, /* 039C */ + {0x039E,0x03BE},{0x039F,0x03BF}, /* 039E */ + {0x03A0,0x03C0},{0x03A1,0x03C1}, /* 03A0 */ + {0x03A2,0x03A2},{0x03A3,0x03C3}, /* 03A2 */ + {0x03A4,0x03C4},{0x03A5,0x03C5}, /* 03A4 */ + {0x03A6,0x03C6},{0x03A7,0x03C7}, /* 03A6 */ + {0x03A8,0x03C8},{0x03A9,0x03C9}, /* 03A8 */ + {0x03AA,0x03CA},{0x03AB,0x03CB}, /* 03AA */ + {0x0386,0x03AC},{0x0388,0x03AD}, /* 03AC */ + {0x0389,0x03AE},{0x038A,0x03AF}, /* 03AE */ + {0x03B0,0x03B0},{0x0391,0x03B1}, /* 03B0 */ + {0x0392,0x03B2},{0x0393,0x03B3}, /* 03B2 */ + {0x0394,0x03B4},{0x0395,0x03B5}, /* 03B4 */ + {0x0396,0x03B6},{0x0397,0x03B7}, /* 03B6 */ + {0x0398,0x03B8},{0x0399,0x03B9}, /* 03B8 */ + {0x039A,0x03BA},{0x039B,0x03BB}, /* 03BA */ + {0x039C,0x03BC},{0x039D,0x03BD}, /* 03BC */ + {0x039E,0x03BE},{0x039F,0x03BF}, /* 03BE */ + {0x03A0,0x03C0},{0x03A1,0x03C1}, /* 03C0 */ + {0x03A3,0x03C2},{0x03A3,0x03C3}, /* 03C2 */ + {0x03A4,0x03C4},{0x03A5,0x03C5}, /* 03C4 */ + {0x03A6,0x03C6},{0x03A7,0x03C7}, /* 03C6 */ + {0x03A8,0x03C8},{0x03A9,0x03C9}, /* 03C8 */ + {0x03AA,0x03CA},{0x03AB,0x03CB}, /* 03CA */ + {0x038C,0x03CC},{0x038E,0x03CD}, /* 03CC */ + {0x038F,0x03CE},{0x03CF,0x03CF}, /* 03CE */ + {0x0392,0x03D0},{0x0398,0x03D1}, /* 03D0 */ + {0x03D2,0x03D2},{0x03D3,0x03D3}, /* 03D2 */ + {0x03D4,0x03D4},{0x03A6,0x03D5}, /* 03D4 */ + {0x03A0,0x03D6},{0x03D7,0x03D7}, /* 03D6 */ + {0x03D8,0x03D8},{0x03D9,0x03D9}, /* 03D8 */ + {0x03DA,0x03DB},{0x03DA,0x03DB}, /* 03DA */ + {0x03DC,0x03DD},{0x03DC,0x03DD}, /* 03DC */ + {0x03DE,0x03DF},{0x03DE,0x03DF}, /* 03DE */ + {0x03E0,0x03E1},{0x03E0,0x03E1}, /* 03E0 */ + {0x03E2,0x03E3},{0x03E2,0x03E3}, /* 03E2 */ + {0x03E4,0x03E5},{0x03E4,0x03E5}, /* 03E4 */ + {0x03E6,0x03E7},{0x03E6,0x03E7}, /* 03E6 */ + {0x03E8,0x03E9},{0x03E8,0x03E9}, /* 03E8 */ + {0x03EA,0x03EB},{0x03EA,0x03EB}, /* 03EA */ + {0x03EC,0x03ED},{0x03EC,0x03ED}, /* 03EC */ + {0x03EE,0x03EF},{0x03EE,0x03EF}, /* 03EE */ + {0x039A,0x03F0},{0x03A1,0x03F1}, /* 03F0 */ + {0x03A3,0x03F2},{0x03F3,0x03F3}, /* 03F2 */ + {0x03F4,0x03F4},{0x03F5,0x03F5}, /* 03F4 */ + {0x03F6,0x03F6},{0x03F7,0x03F7}, /* 03F6 */ + {0x03F8,0x03F8},{0x03F9,0x03F9}, /* 03F8 */ + {0x03FA,0x03FA},{0x03FB,0x03FB}, /* 03FA */ + {0x03FC,0x03FC},{0x03FD,0x03FD}, /* 03FC */ + {0x03FE,0x03FE},{0x03FF,0x03FF} /* 03FE */ +}; + +static const MY_CASEFOLD_CHARACTER u300_casefold_page04[256]={ + {0x0400,0x0450},{0x0401,0x0451}, /* 0400 */ + {0x0402,0x0452},{0x0403,0x0453}, /* 0402 */ + {0x0404,0x0454},{0x0405,0x0455}, /* 0404 */ + {0x0406,0x0456},{0x0407,0x0457}, /* 0406 */ + {0x0408,0x0458},{0x0409,0x0459}, /* 0408 */ + {0x040A,0x045A},{0x040B,0x045B}, /* 040A */ + {0x040C,0x045C},{0x040D,0x045D}, /* 040C */ + {0x040E,0x045E},{0x040F,0x045F}, /* 040E */ + {0x0410,0x0430},{0x0411,0x0431}, /* 0410 */ + {0x0412,0x0432},{0x0413,0x0433}, /* 0412 */ + {0x0414,0x0434},{0x0415,0x0435}, /* 0414 */ + {0x0416,0x0436},{0x0417,0x0437}, /* 0416 */ + {0x0418,0x0438},{0x0419,0x0439}, /* 0418 */ + {0x041A,0x043A},{0x041B,0x043B}, /* 041A */ + {0x041C,0x043C},{0x041D,0x043D}, /* 041C */ + {0x041E,0x043E},{0x041F,0x043F}, /* 041E */ + {0x0420,0x0440},{0x0421,0x0441}, /* 0420 */ + {0x0422,0x0442},{0x0423,0x0443}, /* 0422 */ + {0x0424,0x0444},{0x0425,0x0445}, /* 0424 */ + {0x0426,0x0446},{0x0427,0x0447}, /* 0426 */ + {0x0428,0x0448},{0x0429,0x0449}, /* 0428 */ + {0x042A,0x044A},{0x042B,0x044B}, /* 042A */ + {0x042C,0x044C},{0x042D,0x044D}, /* 042C */ + {0x042E,0x044E},{0x042F,0x044F}, /* 042E */ + {0x0410,0x0430},{0x0411,0x0431}, /* 0430 */ + {0x0412,0x0432},{0x0413,0x0433}, /* 0432 */ + {0x0414,0x0434},{0x0415,0x0435}, /* 0434 */ + {0x0416,0x0436},{0x0417,0x0437}, /* 0436 */ + {0x0418,0x0438},{0x0419,0x0439}, /* 0438 */ + {0x041A,0x043A},{0x041B,0x043B}, /* 043A */ + {0x041C,0x043C},{0x041D,0x043D}, /* 043C */ + {0x041E,0x043E},{0x041F,0x043F}, /* 043E */ + {0x0420,0x0440},{0x0421,0x0441}, /* 0440 */ + {0x0422,0x0442},{0x0423,0x0443}, /* 0442 */ + {0x0424,0x0444},{0x0425,0x0445}, /* 0444 */ + {0x0426,0x0446},{0x0427,0x0447}, /* 0446 */ + {0x0428,0x0448},{0x0429,0x0449}, /* 0448 */ + {0x042A,0x044A},{0x042B,0x044B}, /* 044A */ + {0x042C,0x044C},{0x042D,0x044D}, /* 044C */ + {0x042E,0x044E},{0x042F,0x044F}, /* 044E */ + {0x0400,0x0450},{0x0401,0x0451}, /* 0450 */ + {0x0402,0x0452},{0x0403,0x0453}, /* 0452 */ + {0x0404,0x0454},{0x0405,0x0455}, /* 0454 */ + {0x0406,0x0456},{0x0407,0x0457}, /* 0456 */ + {0x0408,0x0458},{0x0409,0x0459}, /* 0458 */ + {0x040A,0x045A},{0x040B,0x045B}, /* 045A */ + {0x040C,0x045C},{0x040D,0x045D}, /* 045C */ + {0x040E,0x045E},{0x040F,0x045F}, /* 045E */ + {0x0460,0x0461},{0x0460,0x0461}, /* 0460 */ + {0x0462,0x0463},{0x0462,0x0463}, /* 0462 */ + {0x0464,0x0465},{0x0464,0x0465}, /* 0464 */ + {0x0466,0x0467},{0x0466,0x0467}, /* 0466 */ + {0x0468,0x0469},{0x0468,0x0469}, /* 0468 */ + {0x046A,0x046B},{0x046A,0x046B}, /* 046A */ + {0x046C,0x046D},{0x046C,0x046D}, /* 046C */ + {0x046E,0x046F},{0x046E,0x046F}, /* 046E */ + {0x0470,0x0471},{0x0470,0x0471}, /* 0470 */ + {0x0472,0x0473},{0x0472,0x0473}, /* 0472 */ + {0x0474,0x0475},{0x0474,0x0475}, /* 0474 */ + {0x0476,0x0477},{0x0476,0x0477}, /* 0476 */ + {0x0478,0x0479},{0x0478,0x0479}, /* 0478 */ + {0x047A,0x047B},{0x047A,0x047B}, /* 047A */ + {0x047C,0x047D},{0x047C,0x047D}, /* 047C */ + {0x047E,0x047F},{0x047E,0x047F}, /* 047E */ + {0x0480,0x0481},{0x0480,0x0481}, /* 0480 */ + {0x0482,0x0482},{0x0483,0x0483}, /* 0482 */ + {0x0484,0x0484},{0x0485,0x0485}, /* 0484 */ + {0x0486,0x0486},{0x0487,0x0487}, /* 0486 */ + {0x0488,0x0488},{0x0489,0x0489}, /* 0488 */ + {0x048A,0x048A},{0x048B,0x048B}, /* 048A */ + {0x048C,0x048D},{0x048C,0x048D}, /* 048C */ + {0x048E,0x048F},{0x048E,0x048F}, /* 048E */ + {0x0490,0x0491},{0x0490,0x0491}, /* 0490 */ + {0x0492,0x0493},{0x0492,0x0493}, /* 0492 */ + {0x0494,0x0495},{0x0494,0x0495}, /* 0494 */ + {0x0496,0x0497},{0x0496,0x0497}, /* 0496 */ + {0x0498,0x0499},{0x0498,0x0499}, /* 0498 */ + {0x049A,0x049B},{0x049A,0x049B}, /* 049A */ + {0x049C,0x049D},{0x049C,0x049D}, /* 049C */ + {0x049E,0x049F},{0x049E,0x049F}, /* 049E */ + {0x04A0,0x04A1},{0x04A0,0x04A1}, /* 04A0 */ + {0x04A2,0x04A3},{0x04A2,0x04A3}, /* 04A2 */ + {0x04A4,0x04A5},{0x04A4,0x04A5}, /* 04A4 */ + {0x04A6,0x04A7},{0x04A6,0x04A7}, /* 04A6 */ + {0x04A8,0x04A9},{0x04A8,0x04A9}, /* 04A8 */ + {0x04AA,0x04AB},{0x04AA,0x04AB}, /* 04AA */ + {0x04AC,0x04AD},{0x04AC,0x04AD}, /* 04AC */ + {0x04AE,0x04AF},{0x04AE,0x04AF}, /* 04AE */ + {0x04B0,0x04B1},{0x04B0,0x04B1}, /* 04B0 */ + {0x04B2,0x04B3},{0x04B2,0x04B3}, /* 04B2 */ + {0x04B4,0x04B5},{0x04B4,0x04B5}, /* 04B4 */ + {0x04B6,0x04B7},{0x04B6,0x04B7}, /* 04B6 */ + {0x04B8,0x04B9},{0x04B8,0x04B9}, /* 04B8 */ + {0x04BA,0x04BB},{0x04BA,0x04BB}, /* 04BA */ + {0x04BC,0x04BD},{0x04BC,0x04BD}, /* 04BC */ + {0x04BE,0x04BF},{0x04BE,0x04BF}, /* 04BE */ + {0x04C0,0x04C0},{0x04C1,0x04C2}, /* 04C0 */ + {0x04C1,0x04C2},{0x04C3,0x04C4}, /* 04C2 */ + {0x04C3,0x04C4},{0x04C5,0x04C5}, /* 04C4 */ + {0x04C6,0x04C6},{0x04C7,0x04C8}, /* 04C6 */ + {0x04C7,0x04C8},{0x04C9,0x04C9}, /* 04C8 */ + {0x04CA,0x04CA},{0x04CB,0x04CC}, /* 04CA */ + {0x04CB,0x04CC},{0x04CD,0x04CD}, /* 04CC */ + {0x04CE,0x04CE},{0x04CF,0x04CF}, /* 04CE */ + {0x04D0,0x04D1},{0x04D0,0x04D1}, /* 04D0 */ + {0x04D2,0x04D3},{0x04D2,0x04D3}, /* 04D2 */ + {0x04D4,0x04D5},{0x04D4,0x04D5}, /* 04D4 */ + {0x04D6,0x04D7},{0x04D6,0x04D7}, /* 04D6 */ + {0x04D8,0x04D9},{0x04D8,0x04D9}, /* 04D8 */ + {0x04DA,0x04DB},{0x04DA,0x04DB}, /* 04DA */ + {0x04DC,0x04DD},{0x04DC,0x04DD}, /* 04DC */ + {0x04DE,0x04DF},{0x04DE,0x04DF}, /* 04DE */ + {0x04E0,0x04E1},{0x04E0,0x04E1}, /* 04E0 */ + {0x04E2,0x04E3},{0x04E2,0x04E3}, /* 04E2 */ + {0x04E4,0x04E5},{0x04E4,0x04E5}, /* 04E4 */ + {0x04E6,0x04E7},{0x04E6,0x04E7}, /* 04E6 */ + {0x04E8,0x04E9},{0x04E8,0x04E9}, /* 04E8 */ + {0x04EA,0x04EB},{0x04EA,0x04EB}, /* 04EA */ + {0x04EC,0x04ED},{0x04EC,0x04ED}, /* 04EC */ + {0x04EE,0x04EF},{0x04EE,0x04EF}, /* 04EE */ + {0x04F0,0x04F1},{0x04F0,0x04F1}, /* 04F0 */ + {0x04F2,0x04F3},{0x04F2,0x04F3}, /* 04F2 */ + {0x04F4,0x04F5},{0x04F4,0x04F5}, /* 04F4 */ + {0x04F6,0x04F6},{0x04F7,0x04F7}, /* 04F6 */ + {0x04F8,0x04F9},{0x04F8,0x04F9}, /* 04F8 */ + {0x04FA,0x04FA},{0x04FB,0x04FB}, /* 04FA */ + {0x04FC,0x04FC},{0x04FD,0x04FD}, /* 04FC */ + {0x04FE,0x04FE},{0x04FF,0x04FF} /* 04FE */ +}; + +static const MY_CASEFOLD_CHARACTER u300_casefold_page05[256]={ + {0x0500,0x0500},{0x0501,0x0501}, /* 0500 */ + {0x0502,0x0502},{0x0503,0x0503}, /* 0502 */ + {0x0504,0x0504},{0x0505,0x0505}, /* 0504 */ + {0x0506,0x0506},{0x0507,0x0507}, /* 0506 */ + {0x0508,0x0508},{0x0509,0x0509}, /* 0508 */ + {0x050A,0x050A},{0x050B,0x050B}, /* 050A */ + {0x050C,0x050C},{0x050D,0x050D}, /* 050C */ + {0x050E,0x050E},{0x050F,0x050F}, /* 050E */ + {0x0510,0x0510},{0x0511,0x0511}, /* 0510 */ + {0x0512,0x0512},{0x0513,0x0513}, /* 0512 */ + {0x0514,0x0514},{0x0515,0x0515}, /* 0514 */ + {0x0516,0x0516},{0x0517,0x0517}, /* 0516 */ + {0x0518,0x0518},{0x0519,0x0519}, /* 0518 */ + {0x051A,0x051A},{0x051B,0x051B}, /* 051A */ + {0x051C,0x051C},{0x051D,0x051D}, /* 051C */ + {0x051E,0x051E},{0x051F,0x051F}, /* 051E */ + {0x0520,0x0520},{0x0521,0x0521}, /* 0520 */ + {0x0522,0x0522},{0x0523,0x0523}, /* 0522 */ + {0x0524,0x0524},{0x0525,0x0525}, /* 0524 */ + {0x0526,0x0526},{0x0527,0x0527}, /* 0526 */ + {0x0528,0x0528},{0x0529,0x0529}, /* 0528 */ + {0x052A,0x052A},{0x052B,0x052B}, /* 052A */ + {0x052C,0x052C},{0x052D,0x052D}, /* 052C */ + {0x052E,0x052E},{0x052F,0x052F}, /* 052E */ + {0x0530,0x0530},{0x0531,0x0561}, /* 0530 */ + {0x0532,0x0562},{0x0533,0x0563}, /* 0532 */ + {0x0534,0x0564},{0x0535,0x0565}, /* 0534 */ + {0x0536,0x0566},{0x0537,0x0567}, /* 0536 */ + {0x0538,0x0568},{0x0539,0x0569}, /* 0538 */ + {0x053A,0x056A},{0x053B,0x056B}, /* 053A */ + {0x053C,0x056C},{0x053D,0x056D}, /* 053C */ + {0x053E,0x056E},{0x053F,0x056F}, /* 053E */ + {0x0540,0x0570},{0x0541,0x0571}, /* 0540 */ + {0x0542,0x0572},{0x0543,0x0573}, /* 0542 */ + {0x0544,0x0574},{0x0545,0x0575}, /* 0544 */ + {0x0546,0x0576},{0x0547,0x0577}, /* 0546 */ + {0x0548,0x0578},{0x0549,0x0579}, /* 0548 */ + {0x054A,0x057A},{0x054B,0x057B}, /* 054A */ + {0x054C,0x057C},{0x054D,0x057D}, /* 054C */ + {0x054E,0x057E},{0x054F,0x057F}, /* 054E */ + {0x0550,0x0580},{0x0551,0x0581}, /* 0550 */ + {0x0552,0x0582},{0x0553,0x0583}, /* 0552 */ + {0x0554,0x0584},{0x0555,0x0585}, /* 0554 */ + {0x0556,0x0586},{0x0557,0x0557}, /* 0556 */ + {0x0558,0x0558},{0x0559,0x0559}, /* 0558 */ + {0x055A,0x055A},{0x055B,0x055B}, /* 055A */ + {0x055C,0x055C},{0x055D,0x055D}, /* 055C */ + {0x055E,0x055E},{0x055F,0x055F}, /* 055E */ + {0x0560,0x0560},{0x0531,0x0561}, /* 0560 */ + {0x0532,0x0562},{0x0533,0x0563}, /* 0562 */ + {0x0534,0x0564},{0x0535,0x0565}, /* 0564 */ + {0x0536,0x0566},{0x0537,0x0567}, /* 0566 */ + {0x0538,0x0568},{0x0539,0x0569}, /* 0568 */ + {0x053A,0x056A},{0x053B,0x056B}, /* 056A */ + {0x053C,0x056C},{0x053D,0x056D}, /* 056C */ + {0x053E,0x056E},{0x053F,0x056F}, /* 056E */ + {0x0540,0x0570},{0x0541,0x0571}, /* 0570 */ + {0x0542,0x0572},{0x0543,0x0573}, /* 0572 */ + {0x0544,0x0574},{0x0545,0x0575}, /* 0574 */ + {0x0546,0x0576},{0x0547,0x0577}, /* 0576 */ + {0x0548,0x0578},{0x0549,0x0579}, /* 0578 */ + {0x054A,0x057A},{0x054B,0x057B}, /* 057A */ + {0x054C,0x057C},{0x054D,0x057D}, /* 057C */ + {0x054E,0x057E},{0x054F,0x057F}, /* 057E */ + {0x0550,0x0580},{0x0551,0x0581}, /* 0580 */ + {0x0552,0x0582},{0x0553,0x0583}, /* 0582 */ + {0x0554,0x0584},{0x0555,0x0585}, /* 0584 */ + {0x0556,0x0586},{0x0587,0x0587}, /* 0586 */ + {0x0588,0x0588},{0x0589,0x0589}, /* 0588 */ + {0x058A,0x058A},{0x058B,0x058B}, /* 058A */ + {0x058C,0x058C},{0x058D,0x058D}, /* 058C */ + {0x058E,0x058E},{0x058F,0x058F}, /* 058E */ + {0x0590,0x0590},{0x0591,0x0591}, /* 0590 */ + {0x0592,0x0592},{0x0593,0x0593}, /* 0592 */ + {0x0594,0x0594},{0x0595,0x0595}, /* 0594 */ + {0x0596,0x0596},{0x0597,0x0597}, /* 0596 */ + {0x0598,0x0598},{0x0599,0x0599}, /* 0598 */ + {0x059A,0x059A},{0x059B,0x059B}, /* 059A */ + {0x059C,0x059C},{0x059D,0x059D}, /* 059C */ + {0x059E,0x059E},{0x059F,0x059F}, /* 059E */ + {0x05A0,0x05A0},{0x05A1,0x05A1}, /* 05A0 */ + {0x05A2,0x05A2},{0x05A3,0x05A3}, /* 05A2 */ + {0x05A4,0x05A4},{0x05A5,0x05A5}, /* 05A4 */ + {0x05A6,0x05A6},{0x05A7,0x05A7}, /* 05A6 */ + {0x05A8,0x05A8},{0x05A9,0x05A9}, /* 05A8 */ + {0x05AA,0x05AA},{0x05AB,0x05AB}, /* 05AA */ + {0x05AC,0x05AC},{0x05AD,0x05AD}, /* 05AC */ + {0x05AE,0x05AE},{0x05AF,0x05AF}, /* 05AE */ + {0x05B0,0x05B0},{0x05B1,0x05B1}, /* 05B0 */ + {0x05B2,0x05B2},{0x05B3,0x05B3}, /* 05B2 */ + {0x05B4,0x05B4},{0x05B5,0x05B5}, /* 05B4 */ + {0x05B6,0x05B6},{0x05B7,0x05B7}, /* 05B6 */ + {0x05B8,0x05B8},{0x05B9,0x05B9}, /* 05B8 */ + {0x05BA,0x05BA},{0x05BB,0x05BB}, /* 05BA */ + {0x05BC,0x05BC},{0x05BD,0x05BD}, /* 05BC */ + {0x05BE,0x05BE},{0x05BF,0x05BF}, /* 05BE */ + {0x05C0,0x05C0},{0x05C1,0x05C1}, /* 05C0 */ + {0x05C2,0x05C2},{0x05C3,0x05C3}, /* 05C2 */ + {0x05C4,0x05C4},{0x05C5,0x05C5}, /* 05C4 */ + {0x05C6,0x05C6},{0x05C7,0x05C7}, /* 05C6 */ + {0x05C8,0x05C8},{0x05C9,0x05C9}, /* 05C8 */ + {0x05CA,0x05CA},{0x05CB,0x05CB}, /* 05CA */ + {0x05CC,0x05CC},{0x05CD,0x05CD}, /* 05CC */ + {0x05CE,0x05CE},{0x05CF,0x05CF}, /* 05CE */ + {0x05D0,0x05D0},{0x05D1,0x05D1}, /* 05D0 */ + {0x05D2,0x05D2},{0x05D3,0x05D3}, /* 05D2 */ + {0x05D4,0x05D4},{0x05D5,0x05D5}, /* 05D4 */ + {0x05D6,0x05D6},{0x05D7,0x05D7}, /* 05D6 */ + {0x05D8,0x05D8},{0x05D9,0x05D9}, /* 05D8 */ + {0x05DA,0x05DA},{0x05DB,0x05DB}, /* 05DA */ + {0x05DC,0x05DC},{0x05DD,0x05DD}, /* 05DC */ + {0x05DE,0x05DE},{0x05DF,0x05DF}, /* 05DE */ + {0x05E0,0x05E0},{0x05E1,0x05E1}, /* 05E0 */ + {0x05E2,0x05E2},{0x05E3,0x05E3}, /* 05E2 */ + {0x05E4,0x05E4},{0x05E5,0x05E5}, /* 05E4 */ + {0x05E6,0x05E6},{0x05E7,0x05E7}, /* 05E6 */ + {0x05E8,0x05E8},{0x05E9,0x05E9}, /* 05E8 */ + {0x05EA,0x05EA},{0x05EB,0x05EB}, /* 05EA */ + {0x05EC,0x05EC},{0x05ED,0x05ED}, /* 05EC */ + {0x05EE,0x05EE},{0x05EF,0x05EF}, /* 05EE */ + {0x05F0,0x05F0},{0x05F1,0x05F1}, /* 05F0 */ + {0x05F2,0x05F2},{0x05F3,0x05F3}, /* 05F2 */ + {0x05F4,0x05F4},{0x05F5,0x05F5}, /* 05F4 */ + {0x05F6,0x05F6},{0x05F7,0x05F7}, /* 05F6 */ + {0x05F8,0x05F8},{0x05F9,0x05F9}, /* 05F8 */ + {0x05FA,0x05FA},{0x05FB,0x05FB}, /* 05FA */ + {0x05FC,0x05FC},{0x05FD,0x05FD}, /* 05FC */ + {0x05FE,0x05FE},{0x05FF,0x05FF} /* 05FE */ +}; + +static const MY_CASEFOLD_CHARACTER u300_casefold_page06[256]={ /* This page is dummy */ + {0x0600,0x0600},{0x0601,0x0601}, /* 0600 */ + {0x0602,0x0602},{0x0603,0x0603}, /* 0602 */ + {0x0604,0x0604},{0x0605,0x0605}, /* 0604 */ + {0x0606,0x0606},{0x0607,0x0607}, /* 0606 */ + {0x0608,0x0608},{0x0609,0x0609}, /* 0608 */ + {0x060A,0x060A},{0x060B,0x060B}, /* 060A */ + {0x060C,0x060C},{0x060D,0x060D}, /* 060C */ + {0x060E,0x060E},{0x060F,0x060F}, /* 060E */ + {0x0610,0x0610},{0x0611,0x0611}, /* 0610 */ + {0x0612,0x0612},{0x0613,0x0613}, /* 0612 */ + {0x0614,0x0614},{0x0615,0x0615}, /* 0614 */ + {0x0616,0x0616},{0x0617,0x0617}, /* 0616 */ + {0x0618,0x0618},{0x0619,0x0619}, /* 0618 */ + {0x061A,0x061A},{0x061B,0x061B}, /* 061A */ + {0x061C,0x061C},{0x061D,0x061D}, /* 061C */ + {0x061E,0x061E},{0x061F,0x061F}, /* 061E */ + {0x0620,0x0620},{0x0621,0x0621}, /* 0620 */ + {0x0622,0x0622},{0x0623,0x0623}, /* 0622 */ + {0x0624,0x0624},{0x0625,0x0625}, /* 0624 */ + {0x0626,0x0626},{0x0627,0x0627}, /* 0626 */ + {0x0628,0x0628},{0x0629,0x0629}, /* 0628 */ + {0x062A,0x062A},{0x062B,0x062B}, /* 062A */ + {0x062C,0x062C},{0x062D,0x062D}, /* 062C */ + {0x062E,0x062E},{0x062F,0x062F}, /* 062E */ + {0x0630,0x0630},{0x0631,0x0631}, /* 0630 */ + {0x0632,0x0632},{0x0633,0x0633}, /* 0632 */ + {0x0634,0x0634},{0x0635,0x0635}, /* 0634 */ + {0x0636,0x0636},{0x0637,0x0637}, /* 0636 */ + {0x0638,0x0638},{0x0639,0x0639}, /* 0638 */ + {0x063A,0x063A},{0x063B,0x063B}, /* 063A */ + {0x063C,0x063C},{0x063D,0x063D}, /* 063C */ + {0x063E,0x063E},{0x063F,0x063F}, /* 063E */ + {0x0640,0x0640},{0x0641,0x0641}, /* 0640 */ + {0x0642,0x0642},{0x0643,0x0643}, /* 0642 */ + {0x0644,0x0644},{0x0645,0x0645}, /* 0644 */ + {0x0646,0x0646},{0x0647,0x0647}, /* 0646 */ + {0x0648,0x0648},{0x0649,0x0649}, /* 0648 */ + {0x064A,0x064A},{0x064B,0x064B}, /* 064A */ + {0x064C,0x064C},{0x064D,0x064D}, /* 064C */ + {0x064E,0x064E},{0x064F,0x064F}, /* 064E */ + {0x0650,0x0650},{0x0651,0x0651}, /* 0650 */ + {0x0652,0x0652},{0x0653,0x0653}, /* 0652 */ + {0x0654,0x0654},{0x0655,0x0655}, /* 0654 */ + {0x0656,0x0656},{0x0657,0x0657}, /* 0656 */ + {0x0658,0x0658},{0x0659,0x0659}, /* 0658 */ + {0x065A,0x065A},{0x065B,0x065B}, /* 065A */ + {0x065C,0x065C},{0x065D,0x065D}, /* 065C */ + {0x065E,0x065E},{0x065F,0x065F}, /* 065E */ + {0x0660,0x0660},{0x0661,0x0661}, /* 0660 */ + {0x0662,0x0662},{0x0663,0x0663}, /* 0662 */ + {0x0664,0x0664},{0x0665,0x0665}, /* 0664 */ + {0x0666,0x0666},{0x0667,0x0667}, /* 0666 */ + {0x0668,0x0668},{0x0669,0x0669}, /* 0668 */ + {0x066A,0x066A},{0x066B,0x066B}, /* 066A */ + {0x066C,0x066C},{0x066D,0x066D}, /* 066C */ + {0x066E,0x066E},{0x066F,0x066F}, /* 066E */ + {0x0670,0x0670},{0x0671,0x0671}, /* 0670 */ + {0x0672,0x0672},{0x0673,0x0673}, /* 0672 */ + {0x0674,0x0674},{0x0675,0x0675}, /* 0674 */ + {0x0676,0x0676},{0x0677,0x0677}, /* 0676 */ + {0x0678,0x0678},{0x0679,0x0679}, /* 0678 */ + {0x067A,0x067A},{0x067B,0x067B}, /* 067A */ + {0x067C,0x067C},{0x067D,0x067D}, /* 067C */ + {0x067E,0x067E},{0x067F,0x067F}, /* 067E */ + {0x0680,0x0680},{0x0681,0x0681}, /* 0680 */ + {0x0682,0x0682},{0x0683,0x0683}, /* 0682 */ + {0x0684,0x0684},{0x0685,0x0685}, /* 0684 */ + {0x0686,0x0686},{0x0687,0x0687}, /* 0686 */ + {0x0688,0x0688},{0x0689,0x0689}, /* 0688 */ + {0x068A,0x068A},{0x068B,0x068B}, /* 068A */ + {0x068C,0x068C},{0x068D,0x068D}, /* 068C */ + {0x068E,0x068E},{0x068F,0x068F}, /* 068E */ + {0x0690,0x0690},{0x0691,0x0691}, /* 0690 */ + {0x0692,0x0692},{0x0693,0x0693}, /* 0692 */ + {0x0694,0x0694},{0x0695,0x0695}, /* 0694 */ + {0x0696,0x0696},{0x0697,0x0697}, /* 0696 */ + {0x0698,0x0698},{0x0699,0x0699}, /* 0698 */ + {0x069A,0x069A},{0x069B,0x069B}, /* 069A */ + {0x069C,0x069C},{0x069D,0x069D}, /* 069C */ + {0x069E,0x069E},{0x069F,0x069F}, /* 069E */ + {0x06A0,0x06A0},{0x06A1,0x06A1}, /* 06A0 */ + {0x06A2,0x06A2},{0x06A3,0x06A3}, /* 06A2 */ + {0x06A4,0x06A4},{0x06A5,0x06A5}, /* 06A4 */ + {0x06A6,0x06A6},{0x06A7,0x06A7}, /* 06A6 */ + {0x06A8,0x06A8},{0x06A9,0x06A9}, /* 06A8 */ + {0x06AA,0x06AA},{0x06AB,0x06AB}, /* 06AA */ + {0x06AC,0x06AC},{0x06AD,0x06AD}, /* 06AC */ + {0x06AE,0x06AE},{0x06AF,0x06AF}, /* 06AE */ + {0x06B0,0x06B0},{0x06B1,0x06B1}, /* 06B0 */ + {0x06B2,0x06B2},{0x06B3,0x06B3}, /* 06B2 */ + {0x06B4,0x06B4},{0x06B5,0x06B5}, /* 06B4 */ + {0x06B6,0x06B6},{0x06B7,0x06B7}, /* 06B6 */ + {0x06B8,0x06B8},{0x06B9,0x06B9}, /* 06B8 */ + {0x06BA,0x06BA},{0x06BB,0x06BB}, /* 06BA */ + {0x06BC,0x06BC},{0x06BD,0x06BD}, /* 06BC */ + {0x06BE,0x06BE},{0x06BF,0x06BF}, /* 06BE */ + {0x06C0,0x06C0},{0x06C1,0x06C1}, /* 06C0 */ + {0x06C2,0x06C2},{0x06C3,0x06C3}, /* 06C2 */ + {0x06C4,0x06C4},{0x06C5,0x06C5}, /* 06C4 */ + {0x06C6,0x06C6},{0x06C7,0x06C7}, /* 06C6 */ + {0x06C8,0x06C8},{0x06C9,0x06C9}, /* 06C8 */ + {0x06CA,0x06CA},{0x06CB,0x06CB}, /* 06CA */ + {0x06CC,0x06CC},{0x06CD,0x06CD}, /* 06CC */ + {0x06CE,0x06CE},{0x06CF,0x06CF}, /* 06CE */ + {0x06D0,0x06D0},{0x06D1,0x06D1}, /* 06D0 */ + {0x06D2,0x06D2},{0x06D3,0x06D3}, /* 06D2 */ + {0x06D4,0x06D4},{0x06D5,0x06D5}, /* 06D4 */ + {0x06D6,0x06D6},{0x06D7,0x06D7}, /* 06D6 */ + {0x06D8,0x06D8},{0x06D9,0x06D9}, /* 06D8 */ + {0x06DA,0x06DA},{0x06DB,0x06DB}, /* 06DA */ + {0x06DC,0x06DC},{0x06DD,0x06DD}, /* 06DC */ + {0x06DE,0x06DE},{0x06DF,0x06DF}, /* 06DE */ + {0x06E0,0x06E0},{0x06E1,0x06E1}, /* 06E0 */ + {0x06E2,0x06E2},{0x06E3,0x06E3}, /* 06E2 */ + {0x06E4,0x06E4},{0x06E5,0x06E5}, /* 06E4 */ + {0x06E6,0x06E6},{0x06E7,0x06E7}, /* 06E6 */ + {0x06E8,0x06E8},{0x06E9,0x06E9}, /* 06E8 */ + {0x06EA,0x06EA},{0x06EB,0x06EB}, /* 06EA */ + {0x06EC,0x06EC},{0x06ED,0x06ED}, /* 06EC */ + {0x06EE,0x06EE},{0x06EF,0x06EF}, /* 06EE */ + {0x06F0,0x06F0},{0x06F1,0x06F1}, /* 06F0 */ + {0x06F2,0x06F2},{0x06F3,0x06F3}, /* 06F2 */ + {0x06F4,0x06F4},{0x06F5,0x06F5}, /* 06F4 */ + {0x06F6,0x06F6},{0x06F7,0x06F7}, /* 06F6 */ + {0x06F8,0x06F8},{0x06F9,0x06F9}, /* 06F8 */ + {0x06FA,0x06FA},{0x06FB,0x06FB}, /* 06FA */ + {0x06FC,0x06FC},{0x06FD,0x06FD}, /* 06FC */ + {0x06FE,0x06FE},{0x06FF,0x06FF} /* 06FE */ +}; + +static const MY_CASEFOLD_CHARACTER u300_casefold_page07[256]={ /* This page is dummy */ + {0x0700,0x0700},{0x0701,0x0701}, /* 0700 */ + {0x0702,0x0702},{0x0703,0x0703}, /* 0702 */ + {0x0704,0x0704},{0x0705,0x0705}, /* 0704 */ + {0x0706,0x0706},{0x0707,0x0707}, /* 0706 */ + {0x0708,0x0708},{0x0709,0x0709}, /* 0708 */ + {0x070A,0x070A},{0x070B,0x070B}, /* 070A */ + {0x070C,0x070C},{0x070D,0x070D}, /* 070C */ + {0x070E,0x070E},{0x070F,0x070F}, /* 070E */ + {0x0710,0x0710},{0x0711,0x0711}, /* 0710 */ + {0x0712,0x0712},{0x0713,0x0713}, /* 0712 */ + {0x0714,0x0714},{0x0715,0x0715}, /* 0714 */ + {0x0716,0x0716},{0x0717,0x0717}, /* 0716 */ + {0x0718,0x0718},{0x0719,0x0719}, /* 0718 */ + {0x071A,0x071A},{0x071B,0x071B}, /* 071A */ + {0x071C,0x071C},{0x071D,0x071D}, /* 071C */ + {0x071E,0x071E},{0x071F,0x071F}, /* 071E */ + {0x0720,0x0720},{0x0721,0x0721}, /* 0720 */ + {0x0722,0x0722},{0x0723,0x0723}, /* 0722 */ + {0x0724,0x0724},{0x0725,0x0725}, /* 0724 */ + {0x0726,0x0726},{0x0727,0x0727}, /* 0726 */ + {0x0728,0x0728},{0x0729,0x0729}, /* 0728 */ + {0x072A,0x072A},{0x072B,0x072B}, /* 072A */ + {0x072C,0x072C},{0x072D,0x072D}, /* 072C */ + {0x072E,0x072E},{0x072F,0x072F}, /* 072E */ + {0x0730,0x0730},{0x0731,0x0731}, /* 0730 */ + {0x0732,0x0732},{0x0733,0x0733}, /* 0732 */ + {0x0734,0x0734},{0x0735,0x0735}, /* 0734 */ + {0x0736,0x0736},{0x0737,0x0737}, /* 0736 */ + {0x0738,0x0738},{0x0739,0x0739}, /* 0738 */ + {0x073A,0x073A},{0x073B,0x073B}, /* 073A */ + {0x073C,0x073C},{0x073D,0x073D}, /* 073C */ + {0x073E,0x073E},{0x073F,0x073F}, /* 073E */ + {0x0740,0x0740},{0x0741,0x0741}, /* 0740 */ + {0x0742,0x0742},{0x0743,0x0743}, /* 0742 */ + {0x0744,0x0744},{0x0745,0x0745}, /* 0744 */ + {0x0746,0x0746},{0x0747,0x0747}, /* 0746 */ + {0x0748,0x0748},{0x0749,0x0749}, /* 0748 */ + {0x074A,0x074A},{0x074B,0x074B}, /* 074A */ + {0x074C,0x074C},{0x074D,0x074D}, /* 074C */ + {0x074E,0x074E},{0x074F,0x074F}, /* 074E */ + {0x0750,0x0750},{0x0751,0x0751}, /* 0750 */ + {0x0752,0x0752},{0x0753,0x0753}, /* 0752 */ + {0x0754,0x0754},{0x0755,0x0755}, /* 0754 */ + {0x0756,0x0756},{0x0757,0x0757}, /* 0756 */ + {0x0758,0x0758},{0x0759,0x0759}, /* 0758 */ + {0x075A,0x075A},{0x075B,0x075B}, /* 075A */ + {0x075C,0x075C},{0x075D,0x075D}, /* 075C */ + {0x075E,0x075E},{0x075F,0x075F}, /* 075E */ + {0x0760,0x0760},{0x0761,0x0761}, /* 0760 */ + {0x0762,0x0762},{0x0763,0x0763}, /* 0762 */ + {0x0764,0x0764},{0x0765,0x0765}, /* 0764 */ + {0x0766,0x0766},{0x0767,0x0767}, /* 0766 */ + {0x0768,0x0768},{0x0769,0x0769}, /* 0768 */ + {0x076A,0x076A},{0x076B,0x076B}, /* 076A */ + {0x076C,0x076C},{0x076D,0x076D}, /* 076C */ + {0x076E,0x076E},{0x076F,0x076F}, /* 076E */ + {0x0770,0x0770},{0x0771,0x0771}, /* 0770 */ + {0x0772,0x0772},{0x0773,0x0773}, /* 0772 */ + {0x0774,0x0774},{0x0775,0x0775}, /* 0774 */ + {0x0776,0x0776},{0x0777,0x0777}, /* 0776 */ + {0x0778,0x0778},{0x0779,0x0779}, /* 0778 */ + {0x077A,0x077A},{0x077B,0x077B}, /* 077A */ + {0x077C,0x077C},{0x077D,0x077D}, /* 077C */ + {0x077E,0x077E},{0x077F,0x077F}, /* 077E */ + {0x0780,0x0780},{0x0781,0x0781}, /* 0780 */ + {0x0782,0x0782},{0x0783,0x0783}, /* 0782 */ + {0x0784,0x0784},{0x0785,0x0785}, /* 0784 */ + {0x0786,0x0786},{0x0787,0x0787}, /* 0786 */ + {0x0788,0x0788},{0x0789,0x0789}, /* 0788 */ + {0x078A,0x078A},{0x078B,0x078B}, /* 078A */ + {0x078C,0x078C},{0x078D,0x078D}, /* 078C */ + {0x078E,0x078E},{0x078F,0x078F}, /* 078E */ + {0x0790,0x0790},{0x0791,0x0791}, /* 0790 */ + {0x0792,0x0792},{0x0793,0x0793}, /* 0792 */ + {0x0794,0x0794},{0x0795,0x0795}, /* 0794 */ + {0x0796,0x0796},{0x0797,0x0797}, /* 0796 */ + {0x0798,0x0798},{0x0799,0x0799}, /* 0798 */ + {0x079A,0x079A},{0x079B,0x079B}, /* 079A */ + {0x079C,0x079C},{0x079D,0x079D}, /* 079C */ + {0x079E,0x079E},{0x079F,0x079F}, /* 079E */ + {0x07A0,0x07A0},{0x07A1,0x07A1}, /* 07A0 */ + {0x07A2,0x07A2},{0x07A3,0x07A3}, /* 07A2 */ + {0x07A4,0x07A4},{0x07A5,0x07A5}, /* 07A4 */ + {0x07A6,0x07A6},{0x07A7,0x07A7}, /* 07A6 */ + {0x07A8,0x07A8},{0x07A9,0x07A9}, /* 07A8 */ + {0x07AA,0x07AA},{0x07AB,0x07AB}, /* 07AA */ + {0x07AC,0x07AC},{0x07AD,0x07AD}, /* 07AC */ + {0x07AE,0x07AE},{0x07AF,0x07AF}, /* 07AE */ + {0x07B0,0x07B0},{0x07B1,0x07B1}, /* 07B0 */ + {0x07B2,0x07B2},{0x07B3,0x07B3}, /* 07B2 */ + {0x07B4,0x07B4},{0x07B5,0x07B5}, /* 07B4 */ + {0x07B6,0x07B6},{0x07B7,0x07B7}, /* 07B6 */ + {0x07B8,0x07B8},{0x07B9,0x07B9}, /* 07B8 */ + {0x07BA,0x07BA},{0x07BB,0x07BB}, /* 07BA */ + {0x07BC,0x07BC},{0x07BD,0x07BD}, /* 07BC */ + {0x07BE,0x07BE},{0x07BF,0x07BF}, /* 07BE */ + {0x07C0,0x07C0},{0x07C1,0x07C1}, /* 07C0 */ + {0x07C2,0x07C2},{0x07C3,0x07C3}, /* 07C2 */ + {0x07C4,0x07C4},{0x07C5,0x07C5}, /* 07C4 */ + {0x07C6,0x07C6},{0x07C7,0x07C7}, /* 07C6 */ + {0x07C8,0x07C8},{0x07C9,0x07C9}, /* 07C8 */ + {0x07CA,0x07CA},{0x07CB,0x07CB}, /* 07CA */ + {0x07CC,0x07CC},{0x07CD,0x07CD}, /* 07CC */ + {0x07CE,0x07CE},{0x07CF,0x07CF}, /* 07CE */ + {0x07D0,0x07D0},{0x07D1,0x07D1}, /* 07D0 */ + {0x07D2,0x07D2},{0x07D3,0x07D3}, /* 07D2 */ + {0x07D4,0x07D4},{0x07D5,0x07D5}, /* 07D4 */ + {0x07D6,0x07D6},{0x07D7,0x07D7}, /* 07D6 */ + {0x07D8,0x07D8},{0x07D9,0x07D9}, /* 07D8 */ + {0x07DA,0x07DA},{0x07DB,0x07DB}, /* 07DA */ + {0x07DC,0x07DC},{0x07DD,0x07DD}, /* 07DC */ + {0x07DE,0x07DE},{0x07DF,0x07DF}, /* 07DE */ + {0x07E0,0x07E0},{0x07E1,0x07E1}, /* 07E0 */ + {0x07E2,0x07E2},{0x07E3,0x07E3}, /* 07E2 */ + {0x07E4,0x07E4},{0x07E5,0x07E5}, /* 07E4 */ + {0x07E6,0x07E6},{0x07E7,0x07E7}, /* 07E6 */ + {0x07E8,0x07E8},{0x07E9,0x07E9}, /* 07E8 */ + {0x07EA,0x07EA},{0x07EB,0x07EB}, /* 07EA */ + {0x07EC,0x07EC},{0x07ED,0x07ED}, /* 07EC */ + {0x07EE,0x07EE},{0x07EF,0x07EF}, /* 07EE */ + {0x07F0,0x07F0},{0x07F1,0x07F1}, /* 07F0 */ + {0x07F2,0x07F2},{0x07F3,0x07F3}, /* 07F2 */ + {0x07F4,0x07F4},{0x07F5,0x07F5}, /* 07F4 */ + {0x07F6,0x07F6},{0x07F7,0x07F7}, /* 07F6 */ + {0x07F8,0x07F8},{0x07F9,0x07F9}, /* 07F8 */ + {0x07FA,0x07FA},{0x07FB,0x07FB}, /* 07FA */ + {0x07FC,0x07FC},{0x07FD,0x07FD}, /* 07FC */ + {0x07FE,0x07FE},{0x07FF,0x07FF} /* 07FE */ +}; + +static const MY_CASEFOLD_CHARACTER u300_casefold_page1E[256]={ + {0x1E00,0x1E01},{0x1E00,0x1E01}, /* 1E00 */ + {0x1E02,0x1E03},{0x1E02,0x1E03}, /* 1E02 */ + {0x1E04,0x1E05},{0x1E04,0x1E05}, /* 1E04 */ + {0x1E06,0x1E07},{0x1E06,0x1E07}, /* 1E06 */ + {0x1E08,0x1E09},{0x1E08,0x1E09}, /* 1E08 */ + {0x1E0A,0x1E0B},{0x1E0A,0x1E0B}, /* 1E0A */ + {0x1E0C,0x1E0D},{0x1E0C,0x1E0D}, /* 1E0C */ + {0x1E0E,0x1E0F},{0x1E0E,0x1E0F}, /* 1E0E */ + {0x1E10,0x1E11},{0x1E10,0x1E11}, /* 1E10 */ + {0x1E12,0x1E13},{0x1E12,0x1E13}, /* 1E12 */ + {0x1E14,0x1E15},{0x1E14,0x1E15}, /* 1E14 */ + {0x1E16,0x1E17},{0x1E16,0x1E17}, /* 1E16 */ + {0x1E18,0x1E19},{0x1E18,0x1E19}, /* 1E18 */ + {0x1E1A,0x1E1B},{0x1E1A,0x1E1B}, /* 1E1A */ + {0x1E1C,0x1E1D},{0x1E1C,0x1E1D}, /* 1E1C */ + {0x1E1E,0x1E1F},{0x1E1E,0x1E1F}, /* 1E1E */ + {0x1E20,0x1E21},{0x1E20,0x1E21}, /* 1E20 */ + {0x1E22,0x1E23},{0x1E22,0x1E23}, /* 1E22 */ + {0x1E24,0x1E25},{0x1E24,0x1E25}, /* 1E24 */ + {0x1E26,0x1E27},{0x1E26,0x1E27}, /* 1E26 */ + {0x1E28,0x1E29},{0x1E28,0x1E29}, /* 1E28 */ + {0x1E2A,0x1E2B},{0x1E2A,0x1E2B}, /* 1E2A */ + {0x1E2C,0x1E2D},{0x1E2C,0x1E2D}, /* 1E2C */ + {0x1E2E,0x1E2F},{0x1E2E,0x1E2F}, /* 1E2E */ + {0x1E30,0x1E31},{0x1E30,0x1E31}, /* 1E30 */ + {0x1E32,0x1E33},{0x1E32,0x1E33}, /* 1E32 */ + {0x1E34,0x1E35},{0x1E34,0x1E35}, /* 1E34 */ + {0x1E36,0x1E37},{0x1E36,0x1E37}, /* 1E36 */ + {0x1E38,0x1E39},{0x1E38,0x1E39}, /* 1E38 */ + {0x1E3A,0x1E3B},{0x1E3A,0x1E3B}, /* 1E3A */ + {0x1E3C,0x1E3D},{0x1E3C,0x1E3D}, /* 1E3C */ + {0x1E3E,0x1E3F},{0x1E3E,0x1E3F}, /* 1E3E */ + {0x1E40,0x1E41},{0x1E40,0x1E41}, /* 1E40 */ + {0x1E42,0x1E43},{0x1E42,0x1E43}, /* 1E42 */ + {0x1E44,0x1E45},{0x1E44,0x1E45}, /* 1E44 */ + {0x1E46,0x1E47},{0x1E46,0x1E47}, /* 1E46 */ + {0x1E48,0x1E49},{0x1E48,0x1E49}, /* 1E48 */ + {0x1E4A,0x1E4B},{0x1E4A,0x1E4B}, /* 1E4A */ + {0x1E4C,0x1E4D},{0x1E4C,0x1E4D}, /* 1E4C */ + {0x1E4E,0x1E4F},{0x1E4E,0x1E4F}, /* 1E4E */ + {0x1E50,0x1E51},{0x1E50,0x1E51}, /* 1E50 */ + {0x1E52,0x1E53},{0x1E52,0x1E53}, /* 1E52 */ + {0x1E54,0x1E55},{0x1E54,0x1E55}, /* 1E54 */ + {0x1E56,0x1E57},{0x1E56,0x1E57}, /* 1E56 */ + {0x1E58,0x1E59},{0x1E58,0x1E59}, /* 1E58 */ + {0x1E5A,0x1E5B},{0x1E5A,0x1E5B}, /* 1E5A */ + {0x1E5C,0x1E5D},{0x1E5C,0x1E5D}, /* 1E5C */ + {0x1E5E,0x1E5F},{0x1E5E,0x1E5F}, /* 1E5E */ + {0x1E60,0x1E61},{0x1E60,0x1E61}, /* 1E60 */ + {0x1E62,0x1E63},{0x1E62,0x1E63}, /* 1E62 */ + {0x1E64,0x1E65},{0x1E64,0x1E65}, /* 1E64 */ + {0x1E66,0x1E67},{0x1E66,0x1E67}, /* 1E66 */ + {0x1E68,0x1E69},{0x1E68,0x1E69}, /* 1E68 */ + {0x1E6A,0x1E6B},{0x1E6A,0x1E6B}, /* 1E6A */ + {0x1E6C,0x1E6D},{0x1E6C,0x1E6D}, /* 1E6C */ + {0x1E6E,0x1E6F},{0x1E6E,0x1E6F}, /* 1E6E */ + {0x1E70,0x1E71},{0x1E70,0x1E71}, /* 1E70 */ + {0x1E72,0x1E73},{0x1E72,0x1E73}, /* 1E72 */ + {0x1E74,0x1E75},{0x1E74,0x1E75}, /* 1E74 */ + {0x1E76,0x1E77},{0x1E76,0x1E77}, /* 1E76 */ + {0x1E78,0x1E79},{0x1E78,0x1E79}, /* 1E78 */ + {0x1E7A,0x1E7B},{0x1E7A,0x1E7B}, /* 1E7A */ + {0x1E7C,0x1E7D},{0x1E7C,0x1E7D}, /* 1E7C */ + {0x1E7E,0x1E7F},{0x1E7E,0x1E7F}, /* 1E7E */ + {0x1E80,0x1E81},{0x1E80,0x1E81}, /* 1E80 */ + {0x1E82,0x1E83},{0x1E82,0x1E83}, /* 1E82 */ + {0x1E84,0x1E85},{0x1E84,0x1E85}, /* 1E84 */ + {0x1E86,0x1E87},{0x1E86,0x1E87}, /* 1E86 */ + {0x1E88,0x1E89},{0x1E88,0x1E89}, /* 1E88 */ + {0x1E8A,0x1E8B},{0x1E8A,0x1E8B}, /* 1E8A */ + {0x1E8C,0x1E8D},{0x1E8C,0x1E8D}, /* 1E8C */ + {0x1E8E,0x1E8F},{0x1E8E,0x1E8F}, /* 1E8E */ + {0x1E90,0x1E91},{0x1E90,0x1E91}, /* 1E90 */ + {0x1E92,0x1E93},{0x1E92,0x1E93}, /* 1E92 */ + {0x1E94,0x1E95},{0x1E94,0x1E95}, /* 1E94 */ + {0x1E96,0x1E96},{0x1E97,0x1E97}, /* 1E96 */ + {0x1E98,0x1E98},{0x1E99,0x1E99}, /* 1E98 */ + {0x1E9A,0x1E9A},{0x1E60,0x1E9B}, /* 1E9A */ + {0x1E9C,0x1E9C},{0x1E9D,0x1E9D}, /* 1E9C */ + {0x1E9E,0x1E9E},{0x1E9F,0x1E9F}, /* 1E9E */ + {0x1EA0,0x1EA1},{0x1EA0,0x1EA1}, /* 1EA0 */ + {0x1EA2,0x1EA3},{0x1EA2,0x1EA3}, /* 1EA2 */ + {0x1EA4,0x1EA5},{0x1EA4,0x1EA5}, /* 1EA4 */ + {0x1EA6,0x1EA7},{0x1EA6,0x1EA7}, /* 1EA6 */ + {0x1EA8,0x1EA9},{0x1EA8,0x1EA9}, /* 1EA8 */ + {0x1EAA,0x1EAB},{0x1EAA,0x1EAB}, /* 1EAA */ + {0x1EAC,0x1EAD},{0x1EAC,0x1EAD}, /* 1EAC */ + {0x1EAE,0x1EAF},{0x1EAE,0x1EAF}, /* 1EAE */ + {0x1EB0,0x1EB1},{0x1EB0,0x1EB1}, /* 1EB0 */ + {0x1EB2,0x1EB3},{0x1EB2,0x1EB3}, /* 1EB2 */ + {0x1EB4,0x1EB5},{0x1EB4,0x1EB5}, /* 1EB4 */ + {0x1EB6,0x1EB7},{0x1EB6,0x1EB7}, /* 1EB6 */ + {0x1EB8,0x1EB9},{0x1EB8,0x1EB9}, /* 1EB8 */ + {0x1EBA,0x1EBB},{0x1EBA,0x1EBB}, /* 1EBA */ + {0x1EBC,0x1EBD},{0x1EBC,0x1EBD}, /* 1EBC */ + {0x1EBE,0x1EBF},{0x1EBE,0x1EBF}, /* 1EBE */ + {0x1EC0,0x1EC1},{0x1EC0,0x1EC1}, /* 1EC0 */ + {0x1EC2,0x1EC3},{0x1EC2,0x1EC3}, /* 1EC2 */ + {0x1EC4,0x1EC5},{0x1EC4,0x1EC5}, /* 1EC4 */ + {0x1EC6,0x1EC7},{0x1EC6,0x1EC7}, /* 1EC6 */ + {0x1EC8,0x1EC9},{0x1EC8,0x1EC9}, /* 1EC8 */ + {0x1ECA,0x1ECB},{0x1ECA,0x1ECB}, /* 1ECA */ + {0x1ECC,0x1ECD},{0x1ECC,0x1ECD}, /* 1ECC */ + {0x1ECE,0x1ECF},{0x1ECE,0x1ECF}, /* 1ECE */ + {0x1ED0,0x1ED1},{0x1ED0,0x1ED1}, /* 1ED0 */ + {0x1ED2,0x1ED3},{0x1ED2,0x1ED3}, /* 1ED2 */ + {0x1ED4,0x1ED5},{0x1ED4,0x1ED5}, /* 1ED4 */ + {0x1ED6,0x1ED7},{0x1ED6,0x1ED7}, /* 1ED6 */ + {0x1ED8,0x1ED9},{0x1ED8,0x1ED9}, /* 1ED8 */ + {0x1EDA,0x1EDB},{0x1EDA,0x1EDB}, /* 1EDA */ + {0x1EDC,0x1EDD},{0x1EDC,0x1EDD}, /* 1EDC */ + {0x1EDE,0x1EDF},{0x1EDE,0x1EDF}, /* 1EDE */ + {0x1EE0,0x1EE1},{0x1EE0,0x1EE1}, /* 1EE0 */ + {0x1EE2,0x1EE3},{0x1EE2,0x1EE3}, /* 1EE2 */ + {0x1EE4,0x1EE5},{0x1EE4,0x1EE5}, /* 1EE4 */ + {0x1EE6,0x1EE7},{0x1EE6,0x1EE7}, /* 1EE6 */ + {0x1EE8,0x1EE9},{0x1EE8,0x1EE9}, /* 1EE8 */ + {0x1EEA,0x1EEB},{0x1EEA,0x1EEB}, /* 1EEA */ + {0x1EEC,0x1EED},{0x1EEC,0x1EED}, /* 1EEC */ + {0x1EEE,0x1EEF},{0x1EEE,0x1EEF}, /* 1EEE */ + {0x1EF0,0x1EF1},{0x1EF0,0x1EF1}, /* 1EF0 */ + {0x1EF2,0x1EF3},{0x1EF2,0x1EF3}, /* 1EF2 */ + {0x1EF4,0x1EF5},{0x1EF4,0x1EF5}, /* 1EF4 */ + {0x1EF6,0x1EF7},{0x1EF6,0x1EF7}, /* 1EF6 */ + {0x1EF8,0x1EF9},{0x1EF8,0x1EF9}, /* 1EF8 */ + {0x1EFA,0x1EFA},{0x1EFB,0x1EFB}, /* 1EFA */ + {0x1EFC,0x1EFC},{0x1EFD,0x1EFD}, /* 1EFC */ + {0x1EFE,0x1EFE},{0x1EFF,0x1EFF} /* 1EFE */ +}; + +static const MY_CASEFOLD_CHARACTER u300_casefold_page1F[256]={ + {0x1F08,0x1F00},{0x1F09,0x1F01}, /* 1F00 */ + {0x1F0A,0x1F02},{0x1F0B,0x1F03}, /* 1F02 */ + {0x1F0C,0x1F04},{0x1F0D,0x1F05}, /* 1F04 */ + {0x1F0E,0x1F06},{0x1F0F,0x1F07}, /* 1F06 */ + {0x1F08,0x1F00},{0x1F09,0x1F01}, /* 1F08 */ + {0x1F0A,0x1F02},{0x1F0B,0x1F03}, /* 1F0A */ + {0x1F0C,0x1F04},{0x1F0D,0x1F05}, /* 1F0C */ + {0x1F0E,0x1F06},{0x1F0F,0x1F07}, /* 1F0E */ + {0x1F18,0x1F10},{0x1F19,0x1F11}, /* 1F10 */ + {0x1F1A,0x1F12},{0x1F1B,0x1F13}, /* 1F12 */ + {0x1F1C,0x1F14},{0x1F1D,0x1F15}, /* 1F14 */ + {0x1F16,0x1F16},{0x1F17,0x1F17}, /* 1F16 */ + {0x1F18,0x1F10},{0x1F19,0x1F11}, /* 1F18 */ + {0x1F1A,0x1F12},{0x1F1B,0x1F13}, /* 1F1A */ + {0x1F1C,0x1F14},{0x1F1D,0x1F15}, /* 1F1C */ + {0x1F1E,0x1F1E},{0x1F1F,0x1F1F}, /* 1F1E */ + {0x1F28,0x1F20},{0x1F29,0x1F21}, /* 1F20 */ + {0x1F2A,0x1F22},{0x1F2B,0x1F23}, /* 1F22 */ + {0x1F2C,0x1F24},{0x1F2D,0x1F25}, /* 1F24 */ + {0x1F2E,0x1F26},{0x1F2F,0x1F27}, /* 1F26 */ + {0x1F28,0x1F20},{0x1F29,0x1F21}, /* 1F28 */ + {0x1F2A,0x1F22},{0x1F2B,0x1F23}, /* 1F2A */ + {0x1F2C,0x1F24},{0x1F2D,0x1F25}, /* 1F2C */ + {0x1F2E,0x1F26},{0x1F2F,0x1F27}, /* 1F2E */ + {0x1F38,0x1F30},{0x1F39,0x1F31}, /* 1F30 */ + {0x1F3A,0x1F32},{0x1F3B,0x1F33}, /* 1F32 */ + {0x1F3C,0x1F34},{0x1F3D,0x1F35}, /* 1F34 */ + {0x1F3E,0x1F36},{0x1F3F,0x1F37}, /* 1F36 */ + {0x1F38,0x1F30},{0x1F39,0x1F31}, /* 1F38 */ + {0x1F3A,0x1F32},{0x1F3B,0x1F33}, /* 1F3A */ + {0x1F3C,0x1F34},{0x1F3D,0x1F35}, /* 1F3C */ + {0x1F3E,0x1F36},{0x1F3F,0x1F37}, /* 1F3E */ + {0x1F48,0x1F40},{0x1F49,0x1F41}, /* 1F40 */ + {0x1F4A,0x1F42},{0x1F4B,0x1F43}, /* 1F42 */ + {0x1F4C,0x1F44},{0x1F4D,0x1F45}, /* 1F44 */ + {0x1F46,0x1F46},{0x1F47,0x1F47}, /* 1F46 */ + {0x1F48,0x1F40},{0x1F49,0x1F41}, /* 1F48 */ + {0x1F4A,0x1F42},{0x1F4B,0x1F43}, /* 1F4A */ + {0x1F4C,0x1F44},{0x1F4D,0x1F45}, /* 1F4C */ + {0x1F4E,0x1F4E},{0x1F4F,0x1F4F}, /* 1F4E */ + {0x1F50,0x1F50},{0x1F59,0x1F51}, /* 1F50 */ + {0x1F52,0x1F52},{0x1F5B,0x1F53}, /* 1F52 */ + {0x1F54,0x1F54},{0x1F5D,0x1F55}, /* 1F54 */ + {0x1F56,0x1F56},{0x1F5F,0x1F57}, /* 1F56 */ + {0x1F58,0x1F58},{0x1F59,0x1F51}, /* 1F58 */ + {0x1F5A,0x1F5A},{0x1F5B,0x1F53}, /* 1F5A */ + {0x1F5C,0x1F5C},{0x1F5D,0x1F55}, /* 1F5C */ + {0x1F5E,0x1F5E},{0x1F5F,0x1F57}, /* 1F5E */ + {0x1F68,0x1F60},{0x1F69,0x1F61}, /* 1F60 */ + {0x1F6A,0x1F62},{0x1F6B,0x1F63}, /* 1F62 */ + {0x1F6C,0x1F64},{0x1F6D,0x1F65}, /* 1F64 */ + {0x1F6E,0x1F66},{0x1F6F,0x1F67}, /* 1F66 */ + {0x1F68,0x1F60},{0x1F69,0x1F61}, /* 1F68 */ + {0x1F6A,0x1F62},{0x1F6B,0x1F63}, /* 1F6A */ + {0x1F6C,0x1F64},{0x1F6D,0x1F65}, /* 1F6C */ + {0x1F6E,0x1F66},{0x1F6F,0x1F67}, /* 1F6E */ + {0x1FBA,0x1F70},{0x1FBB,0x1F71}, /* 1F70 */ + {0x1FC8,0x1F72},{0x1FC9,0x1F73}, /* 1F72 */ + {0x1FCA,0x1F74},{0x1FCB,0x1F75}, /* 1F74 */ + {0x1FDA,0x1F76},{0x1FDB,0x1F77}, /* 1F76 */ + {0x1FF8,0x1F78},{0x1FF9,0x1F79}, /* 1F78 */ + {0x1FEA,0x1F7A},{0x1FEB,0x1F7B}, /* 1F7A */ + {0x1FFA,0x1F7C},{0x1FFB,0x1F7D}, /* 1F7C */ + {0x1F7E,0x1F7E},{0x1F7F,0x1F7F}, /* 1F7E */ + {0x1F88,0x1F80},{0x1F89,0x1F81}, /* 1F80 */ + {0x1F8A,0x1F82},{0x1F8B,0x1F83}, /* 1F82 */ + {0x1F8C,0x1F84},{0x1F8D,0x1F85}, /* 1F84 */ + {0x1F8E,0x1F86},{0x1F8F,0x1F87}, /* 1F86 */ + {0x1F88,0x1F80},{0x1F89,0x1F81}, /* 1F88 */ + {0x1F8A,0x1F82},{0x1F8B,0x1F83}, /* 1F8A */ + {0x1F8C,0x1F84},{0x1F8D,0x1F85}, /* 1F8C */ + {0x1F8E,0x1F86},{0x1F8F,0x1F87}, /* 1F8E */ + {0x1F98,0x1F90},{0x1F99,0x1F91}, /* 1F90 */ + {0x1F9A,0x1F92},{0x1F9B,0x1F93}, /* 1F92 */ + {0x1F9C,0x1F94},{0x1F9D,0x1F95}, /* 1F94 */ + {0x1F9E,0x1F96},{0x1F9F,0x1F97}, /* 1F96 */ + {0x1F98,0x1F90},{0x1F99,0x1F91}, /* 1F98 */ + {0x1F9A,0x1F92},{0x1F9B,0x1F93}, /* 1F9A */ + {0x1F9C,0x1F94},{0x1F9D,0x1F95}, /* 1F9C */ + {0x1F9E,0x1F96},{0x1F9F,0x1F97}, /* 1F9E */ + {0x1FA8,0x1FA0},{0x1FA9,0x1FA1}, /* 1FA0 */ + {0x1FAA,0x1FA2},{0x1FAB,0x1FA3}, /* 1FA2 */ + {0x1FAC,0x1FA4},{0x1FAD,0x1FA5}, /* 1FA4 */ + {0x1FAE,0x1FA6},{0x1FAF,0x1FA7}, /* 1FA6 */ + {0x1FA8,0x1FA0},{0x1FA9,0x1FA1}, /* 1FA8 */ + {0x1FAA,0x1FA2},{0x1FAB,0x1FA3}, /* 1FAA */ + {0x1FAC,0x1FA4},{0x1FAD,0x1FA5}, /* 1FAC */ + {0x1FAE,0x1FA6},{0x1FAF,0x1FA7}, /* 1FAE */ + {0x1FB8,0x1FB0},{0x1FB9,0x1FB1}, /* 1FB0 */ + {0x1FB2,0x1FB2},{0x1FBC,0x1FB3}, /* 1FB2 */ + {0x1FB4,0x1FB4},{0x1FB5,0x1FB5}, /* 1FB4 */ + {0x1FB6,0x1FB6},{0x1FB7,0x1FB7}, /* 1FB6 */ + {0x1FB8,0x1FB0},{0x1FB9,0x1FB1}, /* 1FB8 */ + {0x1FBA,0x1F70},{0x1FBB,0x1F71}, /* 1FBA */ + {0x1FBC,0x1FB3},{0x1FBD,0x1FBD}, /* 1FBC */ + {0x0399,0x1FBE},{0x1FBF,0x1FBF}, /* 1FBE */ + {0x1FC0,0x1FC0},{0x1FC1,0x1FC1}, /* 1FC0 */ + {0x1FC2,0x1FC2},{0x1FCC,0x1FC3}, /* 1FC2 */ + {0x1FC4,0x1FC4},{0x1FC5,0x1FC5}, /* 1FC4 */ + {0x1FC6,0x1FC6},{0x1FC7,0x1FC7}, /* 1FC6 */ + {0x1FC8,0x1F72},{0x1FC9,0x1F73}, /* 1FC8 */ + {0x1FCA,0x1F74},{0x1FCB,0x1F75}, /* 1FCA */ + {0x1FCC,0x1FC3},{0x1FCD,0x1FCD}, /* 1FCC */ + {0x1FCE,0x1FCE},{0x1FCF,0x1FCF}, /* 1FCE */ + {0x1FD8,0x1FD0},{0x1FD9,0x1FD1}, /* 1FD0 */ + {0x1FD2,0x1FD2},{0x1FD3,0x1FD3}, /* 1FD2 */ + {0x1FD4,0x1FD4},{0x1FD5,0x1FD5}, /* 1FD4 */ + {0x1FD6,0x1FD6},{0x1FD7,0x1FD7}, /* 1FD6 */ + {0x1FD8,0x1FD0},{0x1FD9,0x1FD1}, /* 1FD8 */ + {0x1FDA,0x1F76},{0x1FDB,0x1F77}, /* 1FDA */ + {0x1FDC,0x1FDC},{0x1FDD,0x1FDD}, /* 1FDC */ + {0x1FDE,0x1FDE},{0x1FDF,0x1FDF}, /* 1FDE */ + {0x1FE8,0x1FE0},{0x1FE9,0x1FE1}, /* 1FE0 */ + {0x1FE2,0x1FE2},{0x1FE3,0x1FE3}, /* 1FE2 */ + {0x1FE4,0x1FE4},{0x1FEC,0x1FE5}, /* 1FE4 */ + {0x1FE6,0x1FE6},{0x1FE7,0x1FE7}, /* 1FE6 */ + {0x1FE8,0x1FE0},{0x1FE9,0x1FE1}, /* 1FE8 */ + {0x1FEA,0x1F7A},{0x1FEB,0x1F7B}, /* 1FEA */ + {0x1FEC,0x1FE5},{0x1FED,0x1FED}, /* 1FEC */ + {0x1FEE,0x1FEE},{0x1FEF,0x1FEF}, /* 1FEE */ + {0x1FF0,0x1FF0},{0x1FF1,0x1FF1}, /* 1FF0 */ + {0x1FF2,0x1FF2},{0x1FFC,0x1FF3}, /* 1FF2 */ + {0x1FF4,0x1FF4},{0x1FF5,0x1FF5}, /* 1FF4 */ + {0x1FF6,0x1FF6},{0x1FF7,0x1FF7}, /* 1FF6 */ + {0x1FF8,0x1F78},{0x1FF9,0x1F79}, /* 1FF8 */ + {0x1FFA,0x1F7C},{0x1FFB,0x1F7D}, /* 1FFA */ + {0x1FFC,0x1FF3},{0x1FFD,0x1FFD}, /* 1FFC */ + {0x1FFE,0x1FFE},{0x1FFF,0x1FFF} /* 1FFE */ +}; + +static const MY_CASEFOLD_CHARACTER u300_casefold_page21[256]={ + {0x2100,0x2100},{0x2101,0x2101}, /* 2100 */ + {0x2102,0x2102},{0x2103,0x2103}, /* 2102 */ + {0x2104,0x2104},{0x2105,0x2105}, /* 2104 */ + {0x2106,0x2106},{0x2107,0x2107}, /* 2106 */ + {0x2108,0x2108},{0x2109,0x2109}, /* 2108 */ + {0x210A,0x210A},{0x210B,0x210B}, /* 210A */ + {0x210C,0x210C},{0x210D,0x210D}, /* 210C */ + {0x210E,0x210E},{0x210F,0x210F}, /* 210E */ + {0x2110,0x2110},{0x2111,0x2111}, /* 2110 */ + {0x2112,0x2112},{0x2113,0x2113}, /* 2112 */ + {0x2114,0x2114},{0x2115,0x2115}, /* 2114 */ + {0x2116,0x2116},{0x2117,0x2117}, /* 2116 */ + {0x2118,0x2118},{0x2119,0x2119}, /* 2118 */ + {0x211A,0x211A},{0x211B,0x211B}, /* 211A */ + {0x211C,0x211C},{0x211D,0x211D}, /* 211C */ + {0x211E,0x211E},{0x211F,0x211F}, /* 211E */ + {0x2120,0x2120},{0x2121,0x2121}, /* 2120 */ + {0x2122,0x2122},{0x2123,0x2123}, /* 2122 */ + {0x2124,0x2124},{0x2125,0x2125}, /* 2124 */ + {0x2126,0x03C9},{0x2127,0x2127}, /* 2126 */ + {0x2128,0x2128},{0x2129,0x2129}, /* 2128 */ + {0x212A,0x006B},{0x212B,0x00E5}, /* 212A */ + {0x212C,0x212C},{0x212D,0x212D}, /* 212C */ + {0x212E,0x212E},{0x212F,0x212F}, /* 212E */ + {0x2130,0x2130},{0x2131,0x2131}, /* 2130 */ + {0x2132,0x2132},{0x2133,0x2133}, /* 2132 */ + {0x2134,0x2134},{0x2135,0x2135}, /* 2134 */ + {0x2136,0x2136},{0x2137,0x2137}, /* 2136 */ + {0x2138,0x2138},{0x2139,0x2139}, /* 2138 */ + {0x213A,0x213A},{0x213B,0x213B}, /* 213A */ + {0x213C,0x213C},{0x213D,0x213D}, /* 213C */ + {0x213E,0x213E},{0x213F,0x213F}, /* 213E */ + {0x2140,0x2140},{0x2141,0x2141}, /* 2140 */ + {0x2142,0x2142},{0x2143,0x2143}, /* 2142 */ + {0x2144,0x2144},{0x2145,0x2145}, /* 2144 */ + {0x2146,0x2146},{0x2147,0x2147}, /* 2146 */ + {0x2148,0x2148},{0x2149,0x2149}, /* 2148 */ + {0x214A,0x214A},{0x214B,0x214B}, /* 214A */ + {0x214C,0x214C},{0x214D,0x214D}, /* 214C */ + {0x214E,0x214E},{0x214F,0x214F}, /* 214E */ + {0x2150,0x2150},{0x2151,0x2151}, /* 2150 */ + {0x2152,0x2152},{0x2153,0x2153}, /* 2152 */ + {0x2154,0x2154},{0x2155,0x2155}, /* 2154 */ + {0x2156,0x2156},{0x2157,0x2157}, /* 2156 */ + {0x2158,0x2158},{0x2159,0x2159}, /* 2158 */ + {0x215A,0x215A},{0x215B,0x215B}, /* 215A */ + {0x215C,0x215C},{0x215D,0x215D}, /* 215C */ + {0x215E,0x215E},{0x215F,0x215F}, /* 215E */ + {0x2160,0x2170},{0x2161,0x2171}, /* 2160 */ + {0x2162,0x2172},{0x2163,0x2173}, /* 2162 */ + {0x2164,0x2174},{0x2165,0x2175}, /* 2164 */ + {0x2166,0x2176},{0x2167,0x2177}, /* 2166 */ + {0x2168,0x2178},{0x2169,0x2179}, /* 2168 */ + {0x216A,0x217A},{0x216B,0x217B}, /* 216A */ + {0x216C,0x217C},{0x216D,0x217D}, /* 216C */ + {0x216E,0x217E},{0x216F,0x217F}, /* 216E */ + {0x2160,0x2170},{0x2161,0x2171}, /* 2170 */ + {0x2162,0x2172},{0x2163,0x2173}, /* 2172 */ + {0x2164,0x2174},{0x2165,0x2175}, /* 2174 */ + {0x2166,0x2176},{0x2167,0x2177}, /* 2176 */ + {0x2168,0x2178},{0x2169,0x2179}, /* 2178 */ + {0x216A,0x217A},{0x216B,0x217B}, /* 217A */ + {0x216C,0x217C},{0x216D,0x217D}, /* 217C */ + {0x216E,0x217E},{0x216F,0x217F}, /* 217E */ + {0x2180,0x2180},{0x2181,0x2181}, /* 2180 */ + {0x2182,0x2182},{0x2183,0x2183}, /* 2182 */ + {0x2184,0x2184},{0x2185,0x2185}, /* 2184 */ + {0x2186,0x2186},{0x2187,0x2187}, /* 2186 */ + {0x2188,0x2188},{0x2189,0x2189}, /* 2188 */ + {0x218A,0x218A},{0x218B,0x218B}, /* 218A */ + {0x218C,0x218C},{0x218D,0x218D}, /* 218C */ + {0x218E,0x218E},{0x218F,0x218F}, /* 218E */ + {0x2190,0x2190},{0x2191,0x2191}, /* 2190 */ + {0x2192,0x2192},{0x2193,0x2193}, /* 2192 */ + {0x2194,0x2194},{0x2195,0x2195}, /* 2194 */ + {0x2196,0x2196},{0x2197,0x2197}, /* 2196 */ + {0x2198,0x2198},{0x2199,0x2199}, /* 2198 */ + {0x219A,0x219A},{0x219B,0x219B}, /* 219A */ + {0x219C,0x219C},{0x219D,0x219D}, /* 219C */ + {0x219E,0x219E},{0x219F,0x219F}, /* 219E */ + {0x21A0,0x21A0},{0x21A1,0x21A1}, /* 21A0 */ + {0x21A2,0x21A2},{0x21A3,0x21A3}, /* 21A2 */ + {0x21A4,0x21A4},{0x21A5,0x21A5}, /* 21A4 */ + {0x21A6,0x21A6},{0x21A7,0x21A7}, /* 21A6 */ + {0x21A8,0x21A8},{0x21A9,0x21A9}, /* 21A8 */ + {0x21AA,0x21AA},{0x21AB,0x21AB}, /* 21AA */ + {0x21AC,0x21AC},{0x21AD,0x21AD}, /* 21AC */ + {0x21AE,0x21AE},{0x21AF,0x21AF}, /* 21AE */ + {0x21B0,0x21B0},{0x21B1,0x21B1}, /* 21B0 */ + {0x21B2,0x21B2},{0x21B3,0x21B3}, /* 21B2 */ + {0x21B4,0x21B4},{0x21B5,0x21B5}, /* 21B4 */ + {0x21B6,0x21B6},{0x21B7,0x21B7}, /* 21B6 */ + {0x21B8,0x21B8},{0x21B9,0x21B9}, /* 21B8 */ + {0x21BA,0x21BA},{0x21BB,0x21BB}, /* 21BA */ + {0x21BC,0x21BC},{0x21BD,0x21BD}, /* 21BC */ + {0x21BE,0x21BE},{0x21BF,0x21BF}, /* 21BE */ + {0x21C0,0x21C0},{0x21C1,0x21C1}, /* 21C0 */ + {0x21C2,0x21C2},{0x21C3,0x21C3}, /* 21C2 */ + {0x21C4,0x21C4},{0x21C5,0x21C5}, /* 21C4 */ + {0x21C6,0x21C6},{0x21C7,0x21C7}, /* 21C6 */ + {0x21C8,0x21C8},{0x21C9,0x21C9}, /* 21C8 */ + {0x21CA,0x21CA},{0x21CB,0x21CB}, /* 21CA */ + {0x21CC,0x21CC},{0x21CD,0x21CD}, /* 21CC */ + {0x21CE,0x21CE},{0x21CF,0x21CF}, /* 21CE */ + {0x21D0,0x21D0},{0x21D1,0x21D1}, /* 21D0 */ + {0x21D2,0x21D2},{0x21D3,0x21D3}, /* 21D2 */ + {0x21D4,0x21D4},{0x21D5,0x21D5}, /* 21D4 */ + {0x21D6,0x21D6},{0x21D7,0x21D7}, /* 21D6 */ + {0x21D8,0x21D8},{0x21D9,0x21D9}, /* 21D8 */ + {0x21DA,0x21DA},{0x21DB,0x21DB}, /* 21DA */ + {0x21DC,0x21DC},{0x21DD,0x21DD}, /* 21DC */ + {0x21DE,0x21DE},{0x21DF,0x21DF}, /* 21DE */ + {0x21E0,0x21E0},{0x21E1,0x21E1}, /* 21E0 */ + {0x21E2,0x21E2},{0x21E3,0x21E3}, /* 21E2 */ + {0x21E4,0x21E4},{0x21E5,0x21E5}, /* 21E4 */ + {0x21E6,0x21E6},{0x21E7,0x21E7}, /* 21E6 */ + {0x21E8,0x21E8},{0x21E9,0x21E9}, /* 21E8 */ + {0x21EA,0x21EA},{0x21EB,0x21EB}, /* 21EA */ + {0x21EC,0x21EC},{0x21ED,0x21ED}, /* 21EC */ + {0x21EE,0x21EE},{0x21EF,0x21EF}, /* 21EE */ + {0x21F0,0x21F0},{0x21F1,0x21F1}, /* 21F0 */ + {0x21F2,0x21F2},{0x21F3,0x21F3}, /* 21F2 */ + {0x21F4,0x21F4},{0x21F5,0x21F5}, /* 21F4 */ + {0x21F6,0x21F6},{0x21F7,0x21F7}, /* 21F6 */ + {0x21F8,0x21F8},{0x21F9,0x21F9}, /* 21F8 */ + {0x21FA,0x21FA},{0x21FB,0x21FB}, /* 21FA */ + {0x21FC,0x21FC},{0x21FD,0x21FD}, /* 21FC */ + {0x21FE,0x21FE},{0x21FF,0x21FF} /* 21FE */ +}; + +static const MY_CASEFOLD_CHARACTER u300_casefold_page24[256]={ + {0x2400,0x2400},{0x2401,0x2401}, /* 2400 */ + {0x2402,0x2402},{0x2403,0x2403}, /* 2402 */ + {0x2404,0x2404},{0x2405,0x2405}, /* 2404 */ + {0x2406,0x2406},{0x2407,0x2407}, /* 2406 */ + {0x2408,0x2408},{0x2409,0x2409}, /* 2408 */ + {0x240A,0x240A},{0x240B,0x240B}, /* 240A */ + {0x240C,0x240C},{0x240D,0x240D}, /* 240C */ + {0x240E,0x240E},{0x240F,0x240F}, /* 240E */ + {0x2410,0x2410},{0x2411,0x2411}, /* 2410 */ + {0x2412,0x2412},{0x2413,0x2413}, /* 2412 */ + {0x2414,0x2414},{0x2415,0x2415}, /* 2414 */ + {0x2416,0x2416},{0x2417,0x2417}, /* 2416 */ + {0x2418,0x2418},{0x2419,0x2419}, /* 2418 */ + {0x241A,0x241A},{0x241B,0x241B}, /* 241A */ + {0x241C,0x241C},{0x241D,0x241D}, /* 241C */ + {0x241E,0x241E},{0x241F,0x241F}, /* 241E */ + {0x2420,0x2420},{0x2421,0x2421}, /* 2420 */ + {0x2422,0x2422},{0x2423,0x2423}, /* 2422 */ + {0x2424,0x2424},{0x2425,0x2425}, /* 2424 */ + {0x2426,0x2426},{0x2427,0x2427}, /* 2426 */ + {0x2428,0x2428},{0x2429,0x2429}, /* 2428 */ + {0x242A,0x242A},{0x242B,0x242B}, /* 242A */ + {0x242C,0x242C},{0x242D,0x242D}, /* 242C */ + {0x242E,0x242E},{0x242F,0x242F}, /* 242E */ + {0x2430,0x2430},{0x2431,0x2431}, /* 2430 */ + {0x2432,0x2432},{0x2433,0x2433}, /* 2432 */ + {0x2434,0x2434},{0x2435,0x2435}, /* 2434 */ + {0x2436,0x2436},{0x2437,0x2437}, /* 2436 */ + {0x2438,0x2438},{0x2439,0x2439}, /* 2438 */ + {0x243A,0x243A},{0x243B,0x243B}, /* 243A */ + {0x243C,0x243C},{0x243D,0x243D}, /* 243C */ + {0x243E,0x243E},{0x243F,0x243F}, /* 243E */ + {0x2440,0x2440},{0x2441,0x2441}, /* 2440 */ + {0x2442,0x2442},{0x2443,0x2443}, /* 2442 */ + {0x2444,0x2444},{0x2445,0x2445}, /* 2444 */ + {0x2446,0x2446},{0x2447,0x2447}, /* 2446 */ + {0x2448,0x2448},{0x2449,0x2449}, /* 2448 */ + {0x244A,0x244A},{0x244B,0x244B}, /* 244A */ + {0x244C,0x244C},{0x244D,0x244D}, /* 244C */ + {0x244E,0x244E},{0x244F,0x244F}, /* 244E */ + {0x2450,0x2450},{0x2451,0x2451}, /* 2450 */ + {0x2452,0x2452},{0x2453,0x2453}, /* 2452 */ + {0x2454,0x2454},{0x2455,0x2455}, /* 2454 */ + {0x2456,0x2456},{0x2457,0x2457}, /* 2456 */ + {0x2458,0x2458},{0x2459,0x2459}, /* 2458 */ + {0x245A,0x245A},{0x245B,0x245B}, /* 245A */ + {0x245C,0x245C},{0x245D,0x245D}, /* 245C */ + {0x245E,0x245E},{0x245F,0x245F}, /* 245E */ + {0x2460,0x2460},{0x2461,0x2461}, /* 2460 */ + {0x2462,0x2462},{0x2463,0x2463}, /* 2462 */ + {0x2464,0x2464},{0x2465,0x2465}, /* 2464 */ + {0x2466,0x2466},{0x2467,0x2467}, /* 2466 */ + {0x2468,0x2468},{0x2469,0x2469}, /* 2468 */ + {0x246A,0x246A},{0x246B,0x246B}, /* 246A */ + {0x246C,0x246C},{0x246D,0x246D}, /* 246C */ + {0x246E,0x246E},{0x246F,0x246F}, /* 246E */ + {0x2470,0x2470},{0x2471,0x2471}, /* 2470 */ + {0x2472,0x2472},{0x2473,0x2473}, /* 2472 */ + {0x2474,0x2474},{0x2475,0x2475}, /* 2474 */ + {0x2476,0x2476},{0x2477,0x2477}, /* 2476 */ + {0x2478,0x2478},{0x2479,0x2479}, /* 2478 */ + {0x247A,0x247A},{0x247B,0x247B}, /* 247A */ + {0x247C,0x247C},{0x247D,0x247D}, /* 247C */ + {0x247E,0x247E},{0x247F,0x247F}, /* 247E */ + {0x2480,0x2480},{0x2481,0x2481}, /* 2480 */ + {0x2482,0x2482},{0x2483,0x2483}, /* 2482 */ + {0x2484,0x2484},{0x2485,0x2485}, /* 2484 */ + {0x2486,0x2486},{0x2487,0x2487}, /* 2486 */ + {0x2488,0x2488},{0x2489,0x2489}, /* 2488 */ + {0x248A,0x248A},{0x248B,0x248B}, /* 248A */ + {0x248C,0x248C},{0x248D,0x248D}, /* 248C */ + {0x248E,0x248E},{0x248F,0x248F}, /* 248E */ + {0x2490,0x2490},{0x2491,0x2491}, /* 2490 */ + {0x2492,0x2492},{0x2493,0x2493}, /* 2492 */ + {0x2494,0x2494},{0x2495,0x2495}, /* 2494 */ + {0x2496,0x2496},{0x2497,0x2497}, /* 2496 */ + {0x2498,0x2498},{0x2499,0x2499}, /* 2498 */ + {0x249A,0x249A},{0x249B,0x249B}, /* 249A */ + {0x249C,0x249C},{0x249D,0x249D}, /* 249C */ + {0x249E,0x249E},{0x249F,0x249F}, /* 249E */ + {0x24A0,0x24A0},{0x24A1,0x24A1}, /* 24A0 */ + {0x24A2,0x24A2},{0x24A3,0x24A3}, /* 24A2 */ + {0x24A4,0x24A4},{0x24A5,0x24A5}, /* 24A4 */ + {0x24A6,0x24A6},{0x24A7,0x24A7}, /* 24A6 */ + {0x24A8,0x24A8},{0x24A9,0x24A9}, /* 24A8 */ + {0x24AA,0x24AA},{0x24AB,0x24AB}, /* 24AA */ + {0x24AC,0x24AC},{0x24AD,0x24AD}, /* 24AC */ + {0x24AE,0x24AE},{0x24AF,0x24AF}, /* 24AE */ + {0x24B0,0x24B0},{0x24B1,0x24B1}, /* 24B0 */ + {0x24B2,0x24B2},{0x24B3,0x24B3}, /* 24B2 */ + {0x24B4,0x24B4},{0x24B5,0x24B5}, /* 24B4 */ + {0x24B6,0x24D0},{0x24B7,0x24D1}, /* 24B6 */ + {0x24B8,0x24D2},{0x24B9,0x24D3}, /* 24B8 */ + {0x24BA,0x24D4},{0x24BB,0x24D5}, /* 24BA */ + {0x24BC,0x24D6},{0x24BD,0x24D7}, /* 24BC */ + {0x24BE,0x24D8},{0x24BF,0x24D9}, /* 24BE */ + {0x24C0,0x24DA},{0x24C1,0x24DB}, /* 24C0 */ + {0x24C2,0x24DC},{0x24C3,0x24DD}, /* 24C2 */ + {0x24C4,0x24DE},{0x24C5,0x24DF}, /* 24C4 */ + {0x24C6,0x24E0},{0x24C7,0x24E1}, /* 24C6 */ + {0x24C8,0x24E2},{0x24C9,0x24E3}, /* 24C8 */ + {0x24CA,0x24E4},{0x24CB,0x24E5}, /* 24CA */ + {0x24CC,0x24E6},{0x24CD,0x24E7}, /* 24CC */ + {0x24CE,0x24E8},{0x24CF,0x24E9}, /* 24CE */ + {0x24B6,0x24D0},{0x24B7,0x24D1}, /* 24D0 */ + {0x24B8,0x24D2},{0x24B9,0x24D3}, /* 24D2 */ + {0x24BA,0x24D4},{0x24BB,0x24D5}, /* 24D4 */ + {0x24BC,0x24D6},{0x24BD,0x24D7}, /* 24D6 */ + {0x24BE,0x24D8},{0x24BF,0x24D9}, /* 24D8 */ + {0x24C0,0x24DA},{0x24C1,0x24DB}, /* 24DA */ + {0x24C2,0x24DC},{0x24C3,0x24DD}, /* 24DC */ + {0x24C4,0x24DE},{0x24C5,0x24DF}, /* 24DE */ + {0x24C6,0x24E0},{0x24C7,0x24E1}, /* 24E0 */ + {0x24C8,0x24E2},{0x24C9,0x24E3}, /* 24E2 */ + {0x24CA,0x24E4},{0x24CB,0x24E5}, /* 24E4 */ + {0x24CC,0x24E6},{0x24CD,0x24E7}, /* 24E6 */ + {0x24CE,0x24E8},{0x24CF,0x24E9}, /* 24E8 */ + {0x24EA,0x24EA},{0x24EB,0x24EB}, /* 24EA */ + {0x24EC,0x24EC},{0x24ED,0x24ED}, /* 24EC */ + {0x24EE,0x24EE},{0x24EF,0x24EF}, /* 24EE */ + {0x24F0,0x24F0},{0x24F1,0x24F1}, /* 24F0 */ + {0x24F2,0x24F2},{0x24F3,0x24F3}, /* 24F2 */ + {0x24F4,0x24F4},{0x24F5,0x24F5}, /* 24F4 */ + {0x24F6,0x24F6},{0x24F7,0x24F7}, /* 24F6 */ + {0x24F8,0x24F8},{0x24F9,0x24F9}, /* 24F8 */ + {0x24FA,0x24FA},{0x24FB,0x24FB}, /* 24FA */ + {0x24FC,0x24FC},{0x24FD,0x24FD}, /* 24FC */ + {0x24FE,0x24FE},{0x24FF,0x24FF} /* 24FE */ +}; + +static const MY_CASEFOLD_CHARACTER u300_casefold_pageFF[256]={ + {0xFF00,0xFF00},{0xFF01,0xFF01}, /* FF00 */ + {0xFF02,0xFF02},{0xFF03,0xFF03}, /* FF02 */ + {0xFF04,0xFF04},{0xFF05,0xFF05}, /* FF04 */ + {0xFF06,0xFF06},{0xFF07,0xFF07}, /* FF06 */ + {0xFF08,0xFF08},{0xFF09,0xFF09}, /* FF08 */ + {0xFF0A,0xFF0A},{0xFF0B,0xFF0B}, /* FF0A */ + {0xFF0C,0xFF0C},{0xFF0D,0xFF0D}, /* FF0C */ + {0xFF0E,0xFF0E},{0xFF0F,0xFF0F}, /* FF0E */ + {0xFF10,0xFF10},{0xFF11,0xFF11}, /* FF10 */ + {0xFF12,0xFF12},{0xFF13,0xFF13}, /* FF12 */ + {0xFF14,0xFF14},{0xFF15,0xFF15}, /* FF14 */ + {0xFF16,0xFF16},{0xFF17,0xFF17}, /* FF16 */ + {0xFF18,0xFF18},{0xFF19,0xFF19}, /* FF18 */ + {0xFF1A,0xFF1A},{0xFF1B,0xFF1B}, /* FF1A */ + {0xFF1C,0xFF1C},{0xFF1D,0xFF1D}, /* FF1C */ + {0xFF1E,0xFF1E},{0xFF1F,0xFF1F}, /* FF1E */ + {0xFF20,0xFF20},{0xFF21,0xFF41}, /* FF20 */ + {0xFF22,0xFF42},{0xFF23,0xFF43}, /* FF22 */ + {0xFF24,0xFF44},{0xFF25,0xFF45}, /* FF24 */ + {0xFF26,0xFF46},{0xFF27,0xFF47}, /* FF26 */ + {0xFF28,0xFF48},{0xFF29,0xFF49}, /* FF28 */ + {0xFF2A,0xFF4A},{0xFF2B,0xFF4B}, /* FF2A */ + {0xFF2C,0xFF4C},{0xFF2D,0xFF4D}, /* FF2C */ + {0xFF2E,0xFF4E},{0xFF2F,0xFF4F}, /* FF2E */ + {0xFF30,0xFF50},{0xFF31,0xFF51}, /* FF30 */ + {0xFF32,0xFF52},{0xFF33,0xFF53}, /* FF32 */ + {0xFF34,0xFF54},{0xFF35,0xFF55}, /* FF34 */ + {0xFF36,0xFF56},{0xFF37,0xFF57}, /* FF36 */ + {0xFF38,0xFF58},{0xFF39,0xFF59}, /* FF38 */ + {0xFF3A,0xFF5A},{0xFF3B,0xFF3B}, /* FF3A */ + {0xFF3C,0xFF3C},{0xFF3D,0xFF3D}, /* FF3C */ + {0xFF3E,0xFF3E},{0xFF3F,0xFF3F}, /* FF3E */ + {0xFF40,0xFF40},{0xFF21,0xFF41}, /* FF40 */ + {0xFF22,0xFF42},{0xFF23,0xFF43}, /* FF42 */ + {0xFF24,0xFF44},{0xFF25,0xFF45}, /* FF44 */ + {0xFF26,0xFF46},{0xFF27,0xFF47}, /* FF46 */ + {0xFF28,0xFF48},{0xFF29,0xFF49}, /* FF48 */ + {0xFF2A,0xFF4A},{0xFF2B,0xFF4B}, /* FF4A */ + {0xFF2C,0xFF4C},{0xFF2D,0xFF4D}, /* FF4C */ + {0xFF2E,0xFF4E},{0xFF2F,0xFF4F}, /* FF4E */ + {0xFF30,0xFF50},{0xFF31,0xFF51}, /* FF50 */ + {0xFF32,0xFF52},{0xFF33,0xFF53}, /* FF52 */ + {0xFF34,0xFF54},{0xFF35,0xFF55}, /* FF54 */ + {0xFF36,0xFF56},{0xFF37,0xFF57}, /* FF56 */ + {0xFF38,0xFF58},{0xFF39,0xFF59}, /* FF58 */ + {0xFF3A,0xFF5A},{0xFF5B,0xFF5B}, /* FF5A */ + {0xFF5C,0xFF5C},{0xFF5D,0xFF5D}, /* FF5C */ + {0xFF5E,0xFF5E},{0xFF5F,0xFF5F}, /* FF5E */ + {0xFF60,0xFF60},{0xFF61,0xFF61}, /* FF60 */ + {0xFF62,0xFF62},{0xFF63,0xFF63}, /* FF62 */ + {0xFF64,0xFF64},{0xFF65,0xFF65}, /* FF64 */ + {0xFF66,0xFF66},{0xFF67,0xFF67}, /* FF66 */ + {0xFF68,0xFF68},{0xFF69,0xFF69}, /* FF68 */ + {0xFF6A,0xFF6A},{0xFF6B,0xFF6B}, /* FF6A */ + {0xFF6C,0xFF6C},{0xFF6D,0xFF6D}, /* FF6C */ + {0xFF6E,0xFF6E},{0xFF6F,0xFF6F}, /* FF6E */ + {0xFF70,0xFF70},{0xFF71,0xFF71}, /* FF70 */ + {0xFF72,0xFF72},{0xFF73,0xFF73}, /* FF72 */ + {0xFF74,0xFF74},{0xFF75,0xFF75}, /* FF74 */ + {0xFF76,0xFF76},{0xFF77,0xFF77}, /* FF76 */ + {0xFF78,0xFF78},{0xFF79,0xFF79}, /* FF78 */ + {0xFF7A,0xFF7A},{0xFF7B,0xFF7B}, /* FF7A */ + {0xFF7C,0xFF7C},{0xFF7D,0xFF7D}, /* FF7C */ + {0xFF7E,0xFF7E},{0xFF7F,0xFF7F}, /* FF7E */ + {0xFF80,0xFF80},{0xFF81,0xFF81}, /* FF80 */ + {0xFF82,0xFF82},{0xFF83,0xFF83}, /* FF82 */ + {0xFF84,0xFF84},{0xFF85,0xFF85}, /* FF84 */ + {0xFF86,0xFF86},{0xFF87,0xFF87}, /* FF86 */ + {0xFF88,0xFF88},{0xFF89,0xFF89}, /* FF88 */ + {0xFF8A,0xFF8A},{0xFF8B,0xFF8B}, /* FF8A */ + {0xFF8C,0xFF8C},{0xFF8D,0xFF8D}, /* FF8C */ + {0xFF8E,0xFF8E},{0xFF8F,0xFF8F}, /* FF8E */ + {0xFF90,0xFF90},{0xFF91,0xFF91}, /* FF90 */ + {0xFF92,0xFF92},{0xFF93,0xFF93}, /* FF92 */ + {0xFF94,0xFF94},{0xFF95,0xFF95}, /* FF94 */ + {0xFF96,0xFF96},{0xFF97,0xFF97}, /* FF96 */ + {0xFF98,0xFF98},{0xFF99,0xFF99}, /* FF98 */ + {0xFF9A,0xFF9A},{0xFF9B,0xFF9B}, /* FF9A */ + {0xFF9C,0xFF9C},{0xFF9D,0xFF9D}, /* FF9C */ + {0xFF9E,0xFF9E},{0xFF9F,0xFF9F}, /* FF9E */ + {0xFFA0,0xFFA0},{0xFFA1,0xFFA1}, /* FFA0 */ + {0xFFA2,0xFFA2},{0xFFA3,0xFFA3}, /* FFA2 */ + {0xFFA4,0xFFA4},{0xFFA5,0xFFA5}, /* FFA4 */ + {0xFFA6,0xFFA6},{0xFFA7,0xFFA7}, /* FFA6 */ + {0xFFA8,0xFFA8},{0xFFA9,0xFFA9}, /* FFA8 */ + {0xFFAA,0xFFAA},{0xFFAB,0xFFAB}, /* FFAA */ + {0xFFAC,0xFFAC},{0xFFAD,0xFFAD}, /* FFAC */ + {0xFFAE,0xFFAE},{0xFFAF,0xFFAF}, /* FFAE */ + {0xFFB0,0xFFB0},{0xFFB1,0xFFB1}, /* FFB0 */ + {0xFFB2,0xFFB2},{0xFFB3,0xFFB3}, /* FFB2 */ + {0xFFB4,0xFFB4},{0xFFB5,0xFFB5}, /* FFB4 */ + {0xFFB6,0xFFB6},{0xFFB7,0xFFB7}, /* FFB6 */ + {0xFFB8,0xFFB8},{0xFFB9,0xFFB9}, /* FFB8 */ + {0xFFBA,0xFFBA},{0xFFBB,0xFFBB}, /* FFBA */ + {0xFFBC,0xFFBC},{0xFFBD,0xFFBD}, /* FFBC */ + {0xFFBE,0xFFBE},{0xFFBF,0xFFBF}, /* FFBE */ + {0xFFC0,0xFFC0},{0xFFC1,0xFFC1}, /* FFC0 */ + {0xFFC2,0xFFC2},{0xFFC3,0xFFC3}, /* FFC2 */ + {0xFFC4,0xFFC4},{0xFFC5,0xFFC5}, /* FFC4 */ + {0xFFC6,0xFFC6},{0xFFC7,0xFFC7}, /* FFC6 */ + {0xFFC8,0xFFC8},{0xFFC9,0xFFC9}, /* FFC8 */ + {0xFFCA,0xFFCA},{0xFFCB,0xFFCB}, /* FFCA */ + {0xFFCC,0xFFCC},{0xFFCD,0xFFCD}, /* FFCC */ + {0xFFCE,0xFFCE},{0xFFCF,0xFFCF}, /* FFCE */ + {0xFFD0,0xFFD0},{0xFFD1,0xFFD1}, /* FFD0 */ + {0xFFD2,0xFFD2},{0xFFD3,0xFFD3}, /* FFD2 */ + {0xFFD4,0xFFD4},{0xFFD5,0xFFD5}, /* FFD4 */ + {0xFFD6,0xFFD6},{0xFFD7,0xFFD7}, /* FFD6 */ + {0xFFD8,0xFFD8},{0xFFD9,0xFFD9}, /* FFD8 */ + {0xFFDA,0xFFDA},{0xFFDB,0xFFDB}, /* FFDA */ + {0xFFDC,0xFFDC},{0xFFDD,0xFFDD}, /* FFDC */ + {0xFFDE,0xFFDE},{0xFFDF,0xFFDF}, /* FFDE */ + {0xFFE0,0xFFE0},{0xFFE1,0xFFE1}, /* FFE0 */ + {0xFFE2,0xFFE2},{0xFFE3,0xFFE3}, /* FFE2 */ + {0xFFE4,0xFFE4},{0xFFE5,0xFFE5}, /* FFE4 */ + {0xFFE6,0xFFE6},{0xFFE7,0xFFE7}, /* FFE6 */ + {0xFFE8,0xFFE8},{0xFFE9,0xFFE9}, /* FFE8 */ + {0xFFEA,0xFFEA},{0xFFEB,0xFFEB}, /* FFEA */ + {0xFFEC,0xFFEC},{0xFFED,0xFFED}, /* FFEC */ + {0xFFEE,0xFFEE},{0xFFEF,0xFFEF}, /* FFEE */ + {0xFFF0,0xFFF0},{0xFFF1,0xFFF1}, /* FFF0 */ + {0xFFF2,0xFFF2},{0xFFF3,0xFFF3}, /* FFF2 */ + {0xFFF4,0xFFF4},{0xFFF5,0xFFF5}, /* FFF4 */ + {0xFFF6,0xFFF6},{0xFFF7,0xFFF7}, /* FFF6 */ + {0xFFF8,0xFFF8},{0xFFF9,0xFFF9}, /* FFF8 */ + {0xFFFA,0xFFFA},{0xFFFB,0xFFFB}, /* FFFA */ + {0xFFFC,0xFFFC},{0xFFFD,0xFFFD}, /* FFFC */ + {0xFFFE,0xFFFE},{0xFFFF,0xFFFF} /* FFFE */ +}; + +const MY_CASEFOLD_CHARACTER * my_u300_casefold_index[256]={ + u300_casefold_page00, u300_casefold_page01, u300_casefold_page02, u300_casefold_page03, u300_casefold_page04, u300_casefold_page05, u300_casefold_page06, u300_casefold_page07, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, u300_casefold_page1E, u300_casefold_page1F, + NULL, u300_casefold_page21, NULL, NULL, u300_casefold_page24, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, u300_casefold_pageFF +}; diff --git a/strings/ctype-unicode300-general_ci.h b/strings/ctype-unicode300-general_ci.h new file mode 100644 index 00000000000..fd8cd71bf1a --- /dev/null +++ b/strings/ctype-unicode300-general_ci.h @@ -0,0 +1,610 @@ +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. + Copyright (c) 2009, 2023, MariaDB Corporation. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA +*/ + +/* + Generated by: + ./unidata-dump \ + --mode=weight_general_ci \ + --max-char=0xFFFF \ + UnicodeData-3.0.0.txt + +*/ +const uint16 weight_general_ci_page00[256]={ + 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, /* 0000 */ + 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, /* 0008 */ + 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, /* 0010 */ + 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, /* 0018 */ + 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, /* 0020 */ + 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, /* 0028 */ + 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, /* 0030 */ + 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, /* 0038 */ + 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, /* 0040 */ + 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, /* 0048 */ + 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, /* 0050 */ + 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, /* 0058 */ + 0x0060,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, /* 0060 */ + 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, /* 0068 */ + 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, /* 0070 */ + 0x0058,0x0059,0x005A,0x007B,0x007C,0x007D,0x007E,0x007F, /* 0078 */ + 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, /* 0080 */ + 0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, /* 0088 */ + 0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, /* 0090 */ + 0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, /* 0098 */ + 0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, /* 00A0 */ + 0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, /* 00A8 */ + 0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x039C,0x00B6,0x00B7, /* 00B0 */ + 0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, /* 00B8 */ + 0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x00C6,0x0043, /* 00C0 */ + 0x0045,0x0045,0x0045,0x0045,0x0049,0x0049,0x0049,0x0049, /* 00C8 */ + 0x00D0,0x004E,0x004F,0x004F,0x004F,0x004F,0x004F,0x00D7, /* 00D0 */ + 0x00D8,0x0055,0x0055,0x0055,0x0055,0x0059,0x00DE,0x0053, /* 00D8 */ + 0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x00C6,0x0043, /* 00E0 */ + 0x0045,0x0045,0x0045,0x0045,0x0049,0x0049,0x0049,0x0049, /* 00E8 */ + 0x00D0,0x004E,0x004F,0x004F,0x004F,0x004F,0x004F,0x00F7, /* 00F0 */ + 0x00D8,0x0055,0x0055,0x0055,0x0055,0x0059,0x00DE,0x0059 /* 00F8 */ +}; + +static const uint16 weight_general_ci_page01[256]={ + 0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x0043,0x0043, /* 0100 */ + 0x0043,0x0043,0x0043,0x0043,0x0043,0x0043,0x0044,0x0044, /* 0108 */ + 0x0110,0x0110,0x0045,0x0045,0x0045,0x0045,0x0045,0x0045, /* 0110 */ + 0x0045,0x0045,0x0045,0x0045,0x0047,0x0047,0x0047,0x0047, /* 0118 */ + 0x0047,0x0047,0x0047,0x0047,0x0048,0x0048,0x0126,0x0126, /* 0120 */ + 0x0049,0x0049,0x0049,0x0049,0x0049,0x0049,0x0049,0x0049, /* 0128 */ + 0x0049,0x0049,0x0132,0x0132,0x004A,0x004A,0x004B,0x004B, /* 0130 */ + 0x0138,0x004C,0x004C,0x004C,0x004C,0x004C,0x004C,0x013F, /* 0138 */ + 0x013F,0x0141,0x0141,0x004E,0x004E,0x004E,0x004E,0x004E, /* 0140 */ + 0x004E,0x0149,0x014A,0x014A,0x004F,0x004F,0x004F,0x004F, /* 0148 */ + 0x004F,0x004F,0x0152,0x0152,0x0052,0x0052,0x0052,0x0052, /* 0150 */ + 0x0052,0x0052,0x0053,0x0053,0x0053,0x0053,0x0053,0x0053, /* 0158 */ + 0x0053,0x0053,0x0054,0x0054,0x0054,0x0054,0x0166,0x0166, /* 0160 */ + 0x0055,0x0055,0x0055,0x0055,0x0055,0x0055,0x0055,0x0055, /* 0168 */ + 0x0055,0x0055,0x0055,0x0055,0x0057,0x0057,0x0059,0x0059, /* 0170 */ + 0x0059,0x005A,0x005A,0x005A,0x005A,0x005A,0x005A,0x0053, /* 0178 */ + 0x0180,0x0181,0x0182,0x0182,0x0184,0x0184,0x0186,0x0187, /* 0180 */ + 0x0187,0x0189,0x018A,0x018B,0x018B,0x018D,0x018E,0x018F, /* 0188 */ + 0x0190,0x0191,0x0191,0x0193,0x0194,0x01F6,0x0196,0x0197, /* 0190 */ + 0x0198,0x0198,0x019A,0x019B,0x019C,0x019D,0x019E,0x019F, /* 0198 */ + 0x004F,0x004F,0x01A2,0x01A2,0x01A4,0x01A4,0x01A6,0x01A7, /* 01A0 */ + 0x01A7,0x01A9,0x01AA,0x01AB,0x01AC,0x01AC,0x01AE,0x0055, /* 01A8 */ + 0x0055,0x01B1,0x01B2,0x01B3,0x01B3,0x01B5,0x01B5,0x01B7, /* 01B0 */ + 0x01B8,0x01B8,0x01BA,0x01BB,0x01BC,0x01BC,0x01BE,0x01F7, /* 01B8 */ + 0x01C0,0x01C1,0x01C2,0x01C3,0x01C4,0x01C4,0x01C4,0x01C7, /* 01C0 */ + 0x01C7,0x01C7,0x01CA,0x01CA,0x01CA,0x0041,0x0041,0x0049, /* 01C8 */ + 0x0049,0x004F,0x004F,0x0055,0x0055,0x0055,0x0055,0x0055, /* 01D0 */ + 0x0055,0x0055,0x0055,0x0055,0x0055,0x018E,0x0041,0x0041, /* 01D8 */ + 0x0041,0x0041,0x00C6,0x00C6,0x01E4,0x01E4,0x0047,0x0047, /* 01E0 */ + 0x004B,0x004B,0x004F,0x004F,0x004F,0x004F,0x01B7,0x01B7, /* 01E8 */ + 0x004A,0x01F1,0x01F1,0x01F1,0x0047,0x0047,0x01F6,0x01F7, /* 01F0 */ + 0x004E,0x004E,0x0041,0x0041,0x00C6,0x00C6,0x00D8,0x00D8 /* 01F8 */ +}; + +static const uint16 weight_general_ci_page02[256]={ + 0x0041,0x0041,0x0041,0x0041,0x0045,0x0045,0x0045,0x0045, /* 0200 */ + 0x0049,0x0049,0x0049,0x0049,0x004F,0x004F,0x004F,0x004F, /* 0208 */ + 0x0052,0x0052,0x0052,0x0052,0x0055,0x0055,0x0055,0x0055, /* 0210 */ + 0x0053,0x0053,0x0054,0x0054,0x021C,0x021C,0x0048,0x0048, /* 0218 */ + 0x0220,0x0221,0x0222,0x0222,0x0224,0x0224,0x0041,0x0041, /* 0220 */ + 0x0045,0x0045,0x004F,0x004F,0x004F,0x004F,0x004F,0x004F, /* 0228 */ + 0x004F,0x004F,0x0059,0x0059,0x0234,0x0235,0x0236,0x0237, /* 0230 */ + 0x0238,0x0239,0x023A,0x023B,0x023C,0x023D,0x023E,0x023F, /* 0238 */ + 0x0240,0x0241,0x0242,0x0243,0x0244,0x0245,0x0246,0x0247, /* 0240 */ + 0x0248,0x0249,0x024A,0x024B,0x024C,0x024D,0x024E,0x024F, /* 0248 */ + 0x0250,0x0251,0x0252,0x0181,0x0186,0x0255,0x0189,0x018A, /* 0250 */ + 0x0258,0x018F,0x025A,0x0190,0x025C,0x025D,0x025E,0x025F, /* 0258 */ + 0x0193,0x0261,0x0262,0x0194,0x0264,0x0265,0x0266,0x0267, /* 0260 */ + 0x0197,0x0196,0x026A,0x026B,0x026C,0x026D,0x026E,0x019C, /* 0268 */ + 0x0270,0x0271,0x019D,0x0273,0x0274,0x019F,0x0276,0x0277, /* 0270 */ + 0x0278,0x0279,0x027A,0x027B,0x027C,0x027D,0x027E,0x027F, /* 0278 */ + 0x01A6,0x0281,0x0282,0x01A9,0x0284,0x0285,0x0286,0x0287, /* 0280 */ + 0x01AE,0x0289,0x01B1,0x01B2,0x028C,0x028D,0x028E,0x028F, /* 0288 */ + 0x0290,0x0291,0x01B7,0x0293,0x0294,0x0295,0x0296,0x0297, /* 0290 */ + 0x0298,0x0299,0x029A,0x029B,0x029C,0x029D,0x029E,0x029F, /* 0298 */ + 0x02A0,0x02A1,0x02A2,0x02A3,0x02A4,0x02A5,0x02A6,0x02A7, /* 02A0 */ + 0x02A8,0x02A9,0x02AA,0x02AB,0x02AC,0x02AD,0x02AE,0x02AF, /* 02A8 */ + 0x02B0,0x02B1,0x02B2,0x02B3,0x02B4,0x02B5,0x02B6,0x02B7, /* 02B0 */ + 0x02B8,0x02B9,0x02BA,0x02BB,0x02BC,0x02BD,0x02BE,0x02BF, /* 02B8 */ + 0x02C0,0x02C1,0x02C2,0x02C3,0x02C4,0x02C5,0x02C6,0x02C7, /* 02C0 */ + 0x02C8,0x02C9,0x02CA,0x02CB,0x02CC,0x02CD,0x02CE,0x02CF, /* 02C8 */ + 0x02D0,0x02D1,0x02D2,0x02D3,0x02D4,0x02D5,0x02D6,0x02D7, /* 02D0 */ + 0x02D8,0x02D9,0x02DA,0x02DB,0x02DC,0x02DD,0x02DE,0x02DF, /* 02D8 */ + 0x02E0,0x02E1,0x02E2,0x02E3,0x02E4,0x02E5,0x02E6,0x02E7, /* 02E0 */ + 0x02E8,0x02E9,0x02EA,0x02EB,0x02EC,0x02ED,0x02EE,0x02EF, /* 02E8 */ + 0x02F0,0x02F1,0x02F2,0x02F3,0x02F4,0x02F5,0x02F6,0x02F7, /* 02F0 */ + 0x02F8,0x02F9,0x02FA,0x02FB,0x02FC,0x02FD,0x02FE,0x02FF /* 02F8 */ +}; + +static const uint16 weight_general_ci_page03[256]={ + 0x0300,0x0301,0x0302,0x0303,0x0304,0x0305,0x0306,0x0307, /* 0300 */ + 0x0308,0x0309,0x030A,0x030B,0x030C,0x030D,0x030E,0x030F, /* 0308 */ + 0x0310,0x0311,0x0312,0x0313,0x0314,0x0315,0x0316,0x0317, /* 0310 */ + 0x0318,0x0319,0x031A,0x031B,0x031C,0x031D,0x031E,0x031F, /* 0318 */ + 0x0320,0x0321,0x0322,0x0323,0x0324,0x0325,0x0326,0x0327, /* 0320 */ + 0x0328,0x0329,0x032A,0x032B,0x032C,0x032D,0x032E,0x032F, /* 0328 */ + 0x0330,0x0331,0x0332,0x0333,0x0334,0x0335,0x0336,0x0337, /* 0330 */ + 0x0338,0x0339,0x033A,0x033B,0x033C,0x033D,0x033E,0x033F, /* 0338 */ + 0x0340,0x0341,0x0342,0x0343,0x0344,0x0399,0x0346,0x0347, /* 0340 */ + 0x0348,0x0349,0x034A,0x034B,0x034C,0x034D,0x034E,0x034F, /* 0348 */ + 0x0350,0x0351,0x0352,0x0353,0x0354,0x0355,0x0356,0x0357, /* 0350 */ + 0x0358,0x0359,0x035A,0x035B,0x035C,0x035D,0x035E,0x035F, /* 0358 */ + 0x0360,0x0361,0x0362,0x0363,0x0364,0x0365,0x0366,0x0367, /* 0360 */ + 0x0368,0x0369,0x036A,0x036B,0x036C,0x036D,0x036E,0x036F, /* 0368 */ + 0x0370,0x0371,0x0372,0x0373,0x0374,0x0375,0x0376,0x0377, /* 0370 */ + 0x0378,0x0379,0x037A,0x037B,0x037C,0x037D,0x037E,0x037F, /* 0378 */ + 0x0380,0x0381,0x0382,0x0383,0x0384,0x0385,0x0391,0x0387, /* 0380 */ + 0x0395,0x0397,0x0399,0x038B,0x039F,0x038D,0x03A5,0x03A9, /* 0388 */ + 0x0399,0x0391,0x0392,0x0393,0x0394,0x0395,0x0396,0x0397, /* 0390 */ + 0x0398,0x0399,0x039A,0x039B,0x039C,0x039D,0x039E,0x039F, /* 0398 */ + 0x03A0,0x03A1,0x03A2,0x03A3,0x03A4,0x03A5,0x03A6,0x03A7, /* 03A0 */ + 0x03A8,0x03A9,0x0399,0x03A5,0x0391,0x0395,0x0397,0x0399, /* 03A8 */ + 0x03A5,0x0391,0x0392,0x0393,0x0394,0x0395,0x0396,0x0397, /* 03B0 */ + 0x0398,0x0399,0x039A,0x039B,0x039C,0x039D,0x039E,0x039F, /* 03B8 */ + 0x03A0,0x03A1,0x03A3,0x03A3,0x03A4,0x03A5,0x03A6,0x03A7, /* 03C0 */ + 0x03A8,0x03A9,0x0399,0x03A5,0x039F,0x03A5,0x03A9,0x03CF, /* 03C8 */ + 0x0392,0x0398,0x03D2,0x03D2,0x03D2,0x03A6,0x03A0,0x03D7, /* 03D0 */ + 0x03D8,0x03D9,0x03DA,0x03DA,0x03DC,0x03DC,0x03DE,0x03DE, /* 03D8 */ + 0x03E0,0x03E0,0x03E2,0x03E2,0x03E4,0x03E4,0x03E6,0x03E6, /* 03E0 */ + 0x03E8,0x03E8,0x03EA,0x03EA,0x03EC,0x03EC,0x03EE,0x03EE, /* 03E8 */ + 0x039A,0x03A1,0x03A3,0x03F3,0x03F4,0x03F5,0x03F6,0x03F7, /* 03F0 */ + 0x03F8,0x03F9,0x03FA,0x03FB,0x03FC,0x03FD,0x03FE,0x03FF /* 03F8 */ +}; + +static const uint16 weight_general_ci_page04[256]={ + 0x0415,0x0415,0x0402,0x0413,0x0404,0x0405,0x0406,0x0406, /* 0400 */ + 0x0408,0x0409,0x040A,0x040B,0x041A,0x0418,0x0423,0x040F, /* 0408 */ + 0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417, /* 0410 */ + 0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F, /* 0418 */ + 0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427, /* 0420 */ + 0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F, /* 0428 */ + 0x0410,0x0411,0x0412,0x0413,0x0414,0x0415,0x0416,0x0417, /* 0430 */ + 0x0418,0x0419,0x041A,0x041B,0x041C,0x041D,0x041E,0x041F, /* 0438 */ + 0x0420,0x0421,0x0422,0x0423,0x0424,0x0425,0x0426,0x0427, /* 0440 */ + 0x0428,0x0429,0x042A,0x042B,0x042C,0x042D,0x042E,0x042F, /* 0448 */ + 0x0415,0x0415,0x0402,0x0413,0x0404,0x0405,0x0406,0x0406, /* 0450 */ + 0x0408,0x0409,0x040A,0x040B,0x041A,0x0418,0x0423,0x040F, /* 0458 */ + 0x0460,0x0460,0x0462,0x0462,0x0464,0x0464,0x0466,0x0466, /* 0460 */ + 0x0468,0x0468,0x046A,0x046A,0x046C,0x046C,0x046E,0x046E, /* 0468 */ + 0x0470,0x0470,0x0472,0x0472,0x0474,0x0474,0x0474,0x0474, /* 0470 */ + 0x0478,0x0478,0x047A,0x047A,0x047C,0x047C,0x047E,0x047E, /* 0478 */ + 0x0480,0x0480,0x0482,0x0483,0x0484,0x0485,0x0486,0x0487, /* 0480 */ + 0x0488,0x0489,0x048A,0x048B,0x048C,0x048C,0x048E,0x048E, /* 0488 */ + 0x0490,0x0490,0x0492,0x0492,0x0494,0x0494,0x0496,0x0496, /* 0490 */ + 0x0498,0x0498,0x049A,0x049A,0x049C,0x049C,0x049E,0x049E, /* 0498 */ + 0x04A0,0x04A0,0x04A2,0x04A2,0x04A4,0x04A4,0x04A6,0x04A6, /* 04A0 */ + 0x04A8,0x04A8,0x04AA,0x04AA,0x04AC,0x04AC,0x04AE,0x04AE, /* 04A8 */ + 0x04B0,0x04B0,0x04B2,0x04B2,0x04B4,0x04B4,0x04B6,0x04B6, /* 04B0 */ + 0x04B8,0x04B8,0x04BA,0x04BA,0x04BC,0x04BC,0x04BE,0x04BE, /* 04B8 */ + 0x04C0,0x0416,0x0416,0x04C3,0x04C3,0x04C5,0x04C6,0x04C7, /* 04C0 */ + 0x04C7,0x04C9,0x04CA,0x04CB,0x04CB,0x04CD,0x04CE,0x04CF, /* 04C8 */ + 0x0410,0x0410,0x0410,0x0410,0x04D4,0x04D4,0x0415,0x0415, /* 04D0 */ + 0x04D8,0x04D8,0x04D8,0x04D8,0x0416,0x0416,0x0417,0x0417, /* 04D8 */ + 0x04E0,0x04E0,0x0418,0x0418,0x0418,0x0418,0x041E,0x041E, /* 04E0 */ + 0x04E8,0x04E8,0x04E8,0x04E8,0x042D,0x042D,0x0423,0x0423, /* 04E8 */ + 0x0423,0x0423,0x0423,0x0423,0x0427,0x0427,0x04F6,0x04F7, /* 04F0 */ + 0x042B,0x042B,0x04FA,0x04FB,0x04FC,0x04FD,0x04FE,0x04FF /* 04F8 */ +}; + +static const uint16 weight_general_ci_page05[256]={ + 0x0500,0x0501,0x0502,0x0503,0x0504,0x0505,0x0506,0x0507, /* 0500 */ + 0x0508,0x0509,0x050A,0x050B,0x050C,0x050D,0x050E,0x050F, /* 0508 */ + 0x0510,0x0511,0x0512,0x0513,0x0514,0x0515,0x0516,0x0517, /* 0510 */ + 0x0518,0x0519,0x051A,0x051B,0x051C,0x051D,0x051E,0x051F, /* 0518 */ + 0x0520,0x0521,0x0522,0x0523,0x0524,0x0525,0x0526,0x0527, /* 0520 */ + 0x0528,0x0529,0x052A,0x052B,0x052C,0x052D,0x052E,0x052F, /* 0528 */ + 0x0530,0x0531,0x0532,0x0533,0x0534,0x0535,0x0536,0x0537, /* 0530 */ + 0x0538,0x0539,0x053A,0x053B,0x053C,0x053D,0x053E,0x053F, /* 0538 */ + 0x0540,0x0541,0x0542,0x0543,0x0544,0x0545,0x0546,0x0547, /* 0540 */ + 0x0548,0x0549,0x054A,0x054B,0x054C,0x054D,0x054E,0x054F, /* 0548 */ + 0x0550,0x0551,0x0552,0x0553,0x0554,0x0555,0x0556,0x0557, /* 0550 */ + 0x0558,0x0559,0x055A,0x055B,0x055C,0x055D,0x055E,0x055F, /* 0558 */ + 0x0560,0x0531,0x0532,0x0533,0x0534,0x0535,0x0536,0x0537, /* 0560 */ + 0x0538,0x0539,0x053A,0x053B,0x053C,0x053D,0x053E,0x053F, /* 0568 */ + 0x0540,0x0541,0x0542,0x0543,0x0544,0x0545,0x0546,0x0547, /* 0570 */ + 0x0548,0x0549,0x054A,0x054B,0x054C,0x054D,0x054E,0x054F, /* 0578 */ + 0x0550,0x0551,0x0552,0x0553,0x0554,0x0555,0x0556,0x0587, /* 0580 */ + 0x0588,0x0589,0x058A,0x058B,0x058C,0x058D,0x058E,0x058F, /* 0588 */ + 0x0590,0x0591,0x0592,0x0593,0x0594,0x0595,0x0596,0x0597, /* 0590 */ + 0x0598,0x0599,0x059A,0x059B,0x059C,0x059D,0x059E,0x059F, /* 0598 */ + 0x05A0,0x05A1,0x05A2,0x05A3,0x05A4,0x05A5,0x05A6,0x05A7, /* 05A0 */ + 0x05A8,0x05A9,0x05AA,0x05AB,0x05AC,0x05AD,0x05AE,0x05AF, /* 05A8 */ + 0x05B0,0x05B1,0x05B2,0x05B3,0x05B4,0x05B5,0x05B6,0x05B7, /* 05B0 */ + 0x05B8,0x05B9,0x05BA,0x05BB,0x05BC,0x05BD,0x05BE,0x05BF, /* 05B8 */ + 0x05C0,0x05C1,0x05C2,0x05C3,0x05C4,0x05C5,0x05C6,0x05C7, /* 05C0 */ + 0x05C8,0x05C9,0x05CA,0x05CB,0x05CC,0x05CD,0x05CE,0x05CF, /* 05C8 */ + 0x05D0,0x05D1,0x05D2,0x05D3,0x05D4,0x05D5,0x05D6,0x05D7, /* 05D0 */ + 0x05D8,0x05D9,0x05DA,0x05DB,0x05DC,0x05DD,0x05DE,0x05DF, /* 05D8 */ + 0x05E0,0x05E1,0x05E2,0x05E3,0x05E4,0x05E5,0x05E6,0x05E7, /* 05E0 */ + 0x05E8,0x05E9,0x05EA,0x05EB,0x05EC,0x05ED,0x05EE,0x05EF, /* 05E8 */ + 0x05F0,0x05F1,0x05F2,0x05F3,0x05F4,0x05F5,0x05F6,0x05F7, /* 05F0 */ + 0x05F8,0x05F9,0x05FA,0x05FB,0x05FC,0x05FD,0x05FE,0x05FF /* 05F8 */ +}; + +static const uint16 weight_general_ci_page06[256]={ /* This page is dummy */ + 0x0600,0x0601,0x0602,0x0603,0x0604,0x0605,0x0606,0x0607, /* 0600 */ + 0x0608,0x0609,0x060A,0x060B,0x060C,0x060D,0x060E,0x060F, /* 0608 */ + 0x0610,0x0611,0x0612,0x0613,0x0614,0x0615,0x0616,0x0617, /* 0610 */ + 0x0618,0x0619,0x061A,0x061B,0x061C,0x061D,0x061E,0x061F, /* 0618 */ + 0x0620,0x0621,0x0622,0x0623,0x0624,0x0625,0x0626,0x0627, /* 0620 */ + 0x0628,0x0629,0x062A,0x062B,0x062C,0x062D,0x062E,0x062F, /* 0628 */ + 0x0630,0x0631,0x0632,0x0633,0x0634,0x0635,0x0636,0x0637, /* 0630 */ + 0x0638,0x0639,0x063A,0x063B,0x063C,0x063D,0x063E,0x063F, /* 0638 */ + 0x0640,0x0641,0x0642,0x0643,0x0644,0x0645,0x0646,0x0647, /* 0640 */ + 0x0648,0x0649,0x064A,0x064B,0x064C,0x064D,0x064E,0x064F, /* 0648 */ + 0x0650,0x0651,0x0652,0x0653,0x0654,0x0655,0x0656,0x0657, /* 0650 */ + 0x0658,0x0659,0x065A,0x065B,0x065C,0x065D,0x065E,0x065F, /* 0658 */ + 0x0660,0x0661,0x0662,0x0663,0x0664,0x0665,0x0666,0x0667, /* 0660 */ + 0x0668,0x0669,0x066A,0x066B,0x066C,0x066D,0x066E,0x066F, /* 0668 */ + 0x0670,0x0671,0x0672,0x0673,0x0674,0x0675,0x0676,0x0677, /* 0670 */ + 0x0678,0x0679,0x067A,0x067B,0x067C,0x067D,0x067E,0x067F, /* 0678 */ + 0x0680,0x0681,0x0682,0x0683,0x0684,0x0685,0x0686,0x0687, /* 0680 */ + 0x0688,0x0689,0x068A,0x068B,0x068C,0x068D,0x068E,0x068F, /* 0688 */ + 0x0690,0x0691,0x0692,0x0693,0x0694,0x0695,0x0696,0x0697, /* 0690 */ + 0x0698,0x0699,0x069A,0x069B,0x069C,0x069D,0x069E,0x069F, /* 0698 */ + 0x06A0,0x06A1,0x06A2,0x06A3,0x06A4,0x06A5,0x06A6,0x06A7, /* 06A0 */ + 0x06A8,0x06A9,0x06AA,0x06AB,0x06AC,0x06AD,0x06AE,0x06AF, /* 06A8 */ + 0x06B0,0x06B1,0x06B2,0x06B3,0x06B4,0x06B5,0x06B6,0x06B7, /* 06B0 */ + 0x06B8,0x06B9,0x06BA,0x06BB,0x06BC,0x06BD,0x06BE,0x06BF, /* 06B8 */ + 0x06C0,0x06C1,0x06C2,0x06C3,0x06C4,0x06C5,0x06C6,0x06C7, /* 06C0 */ + 0x06C8,0x06C9,0x06CA,0x06CB,0x06CC,0x06CD,0x06CE,0x06CF, /* 06C8 */ + 0x06D0,0x06D1,0x06D2,0x06D3,0x06D4,0x06D5,0x06D6,0x06D7, /* 06D0 */ + 0x06D8,0x06D9,0x06DA,0x06DB,0x06DC,0x06DD,0x06DE,0x06DF, /* 06D8 */ + 0x06E0,0x06E1,0x06E2,0x06E3,0x06E4,0x06E5,0x06E6,0x06E7, /* 06E0 */ + 0x06E8,0x06E9,0x06EA,0x06EB,0x06EC,0x06ED,0x06EE,0x06EF, /* 06E8 */ + 0x06F0,0x06F1,0x06F2,0x06F3,0x06F4,0x06F5,0x06F6,0x06F7, /* 06F0 */ + 0x06F8,0x06F9,0x06FA,0x06FB,0x06FC,0x06FD,0x06FE,0x06FF /* 06F8 */ +}; + +static const uint16 weight_general_ci_page07[256]={ /* This page is dummy */ + 0x0700,0x0701,0x0702,0x0703,0x0704,0x0705,0x0706,0x0707, /* 0700 */ + 0x0708,0x0709,0x070A,0x070B,0x070C,0x070D,0x070E,0x070F, /* 0708 */ + 0x0710,0x0711,0x0712,0x0713,0x0714,0x0715,0x0716,0x0717, /* 0710 */ + 0x0718,0x0719,0x071A,0x071B,0x071C,0x071D,0x071E,0x071F, /* 0718 */ + 0x0720,0x0721,0x0722,0x0723,0x0724,0x0725,0x0726,0x0727, /* 0720 */ + 0x0728,0x0729,0x072A,0x072B,0x072C,0x072D,0x072E,0x072F, /* 0728 */ + 0x0730,0x0731,0x0732,0x0733,0x0734,0x0735,0x0736,0x0737, /* 0730 */ + 0x0738,0x0739,0x073A,0x073B,0x073C,0x073D,0x073E,0x073F, /* 0738 */ + 0x0740,0x0741,0x0742,0x0743,0x0744,0x0745,0x0746,0x0747, /* 0740 */ + 0x0748,0x0749,0x074A,0x074B,0x074C,0x074D,0x074E,0x074F, /* 0748 */ + 0x0750,0x0751,0x0752,0x0753,0x0754,0x0755,0x0756,0x0757, /* 0750 */ + 0x0758,0x0759,0x075A,0x075B,0x075C,0x075D,0x075E,0x075F, /* 0758 */ + 0x0760,0x0761,0x0762,0x0763,0x0764,0x0765,0x0766,0x0767, /* 0760 */ + 0x0768,0x0769,0x076A,0x076B,0x076C,0x076D,0x076E,0x076F, /* 0768 */ + 0x0770,0x0771,0x0772,0x0773,0x0774,0x0775,0x0776,0x0777, /* 0770 */ + 0x0778,0x0779,0x077A,0x077B,0x077C,0x077D,0x077E,0x077F, /* 0778 */ + 0x0780,0x0781,0x0782,0x0783,0x0784,0x0785,0x0786,0x0787, /* 0780 */ + 0x0788,0x0789,0x078A,0x078B,0x078C,0x078D,0x078E,0x078F, /* 0788 */ + 0x0790,0x0791,0x0792,0x0793,0x0794,0x0795,0x0796,0x0797, /* 0790 */ + 0x0798,0x0799,0x079A,0x079B,0x079C,0x079D,0x079E,0x079F, /* 0798 */ + 0x07A0,0x07A1,0x07A2,0x07A3,0x07A4,0x07A5,0x07A6,0x07A7, /* 07A0 */ + 0x07A8,0x07A9,0x07AA,0x07AB,0x07AC,0x07AD,0x07AE,0x07AF, /* 07A8 */ + 0x07B0,0x07B1,0x07B2,0x07B3,0x07B4,0x07B5,0x07B6,0x07B7, /* 07B0 */ + 0x07B8,0x07B9,0x07BA,0x07BB,0x07BC,0x07BD,0x07BE,0x07BF, /* 07B8 */ + 0x07C0,0x07C1,0x07C2,0x07C3,0x07C4,0x07C5,0x07C6,0x07C7, /* 07C0 */ + 0x07C8,0x07C9,0x07CA,0x07CB,0x07CC,0x07CD,0x07CE,0x07CF, /* 07C8 */ + 0x07D0,0x07D1,0x07D2,0x07D3,0x07D4,0x07D5,0x07D6,0x07D7, /* 07D0 */ + 0x07D8,0x07D9,0x07DA,0x07DB,0x07DC,0x07DD,0x07DE,0x07DF, /* 07D8 */ + 0x07E0,0x07E1,0x07E2,0x07E3,0x07E4,0x07E5,0x07E6,0x07E7, /* 07E0 */ + 0x07E8,0x07E9,0x07EA,0x07EB,0x07EC,0x07ED,0x07EE,0x07EF, /* 07E8 */ + 0x07F0,0x07F1,0x07F2,0x07F3,0x07F4,0x07F5,0x07F6,0x07F7, /* 07F0 */ + 0x07F8,0x07F9,0x07FA,0x07FB,0x07FC,0x07FD,0x07FE,0x07FF /* 07F8 */ +}; + +static const uint16 weight_general_ci_page1E[256]={ + 0x0041,0x0041,0x0042,0x0042,0x0042,0x0042,0x0042,0x0042, /* 1E00 */ + 0x0043,0x0043,0x0044,0x0044,0x0044,0x0044,0x0044,0x0044, /* 1E08 */ + 0x0044,0x0044,0x0044,0x0044,0x0045,0x0045,0x0045,0x0045, /* 1E10 */ + 0x0045,0x0045,0x0045,0x0045,0x0045,0x0045,0x0046,0x0046, /* 1E18 */ + 0x0047,0x0047,0x0048,0x0048,0x0048,0x0048,0x0048,0x0048, /* 1E20 */ + 0x0048,0x0048,0x0048,0x0048,0x0049,0x0049,0x0049,0x0049, /* 1E28 */ + 0x004B,0x004B,0x004B,0x004B,0x004B,0x004B,0x004C,0x004C, /* 1E30 */ + 0x004C,0x004C,0x004C,0x004C,0x004C,0x004C,0x004D,0x004D, /* 1E38 */ + 0x004D,0x004D,0x004D,0x004D,0x004E,0x004E,0x004E,0x004E, /* 1E40 */ + 0x004E,0x004E,0x004E,0x004E,0x004F,0x004F,0x004F,0x004F, /* 1E48 */ + 0x004F,0x004F,0x004F,0x004F,0x0050,0x0050,0x0050,0x0050, /* 1E50 */ + 0x0052,0x0052,0x0052,0x0052,0x0052,0x0052,0x0052,0x0052, /* 1E58 */ + 0x0053,0x0053,0x0053,0x0053,0x0053,0x0053,0x0053,0x0053, /* 1E60 */ + 0x0053,0x0053,0x0054,0x0054,0x0054,0x0054,0x0054,0x0054, /* 1E68 */ + 0x0054,0x0054,0x0055,0x0055,0x0055,0x0055,0x0055,0x0055, /* 1E70 */ + 0x0055,0x0055,0x0055,0x0055,0x0056,0x0056,0x0056,0x0056, /* 1E78 */ + 0x0057,0x0057,0x0057,0x0057,0x0057,0x0057,0x0057,0x0057, /* 1E80 */ + 0x0057,0x0057,0x0058,0x0058,0x0058,0x0058,0x0059,0x0059, /* 1E88 */ + 0x005A,0x005A,0x005A,0x005A,0x005A,0x005A,0x0048,0x0054, /* 1E90 */ + 0x0057,0x0059,0x1E9A,0x0053,0x1E9C,0x1E9D,0x1E9E,0x1E9F, /* 1E98 */ + 0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x0041, /* 1EA0 */ + 0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x0041, /* 1EA8 */ + 0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x0041, /* 1EB0 */ + 0x0045,0x0045,0x0045,0x0045,0x0045,0x0045,0x0045,0x0045, /* 1EB8 */ + 0x0045,0x0045,0x0045,0x0045,0x0045,0x0045,0x0045,0x0045, /* 1EC0 */ + 0x0049,0x0049,0x0049,0x0049,0x004F,0x004F,0x004F,0x004F, /* 1EC8 */ + 0x004F,0x004F,0x004F,0x004F,0x004F,0x004F,0x004F,0x004F, /* 1ED0 */ + 0x004F,0x004F,0x004F,0x004F,0x004F,0x004F,0x004F,0x004F, /* 1ED8 */ + 0x004F,0x004F,0x004F,0x004F,0x0055,0x0055,0x0055,0x0055, /* 1EE0 */ + 0x0055,0x0055,0x0055,0x0055,0x0055,0x0055,0x0055,0x0055, /* 1EE8 */ + 0x0055,0x0055,0x0059,0x0059,0x0059,0x0059,0x0059,0x0059, /* 1EF0 */ + 0x0059,0x0059,0x1EFA,0x1EFB,0x1EFC,0x1EFD,0x1EFE,0x1EFF /* 1EF8 */ +}; + +static const uint16 weight_general_ci_page1F[256]={ + 0x0391,0x0391,0x0391,0x0391,0x0391,0x0391,0x0391,0x0391, /* 1F00 */ + 0x0391,0x0391,0x0391,0x0391,0x0391,0x0391,0x0391,0x0391, /* 1F08 */ + 0x0395,0x0395,0x0395,0x0395,0x0395,0x0395,0x1F16,0x1F17, /* 1F10 */ + 0x0395,0x0395,0x0395,0x0395,0x0395,0x0395,0x1F1E,0x1F1F, /* 1F18 */ + 0x0397,0x0397,0x0397,0x0397,0x0397,0x0397,0x0397,0x0397, /* 1F20 */ + 0x0397,0x0397,0x0397,0x0397,0x0397,0x0397,0x0397,0x0397, /* 1F28 */ + 0x0399,0x0399,0x0399,0x0399,0x0399,0x0399,0x0399,0x0399, /* 1F30 */ + 0x0399,0x0399,0x0399,0x0399,0x0399,0x0399,0x0399,0x0399, /* 1F38 */ + 0x039F,0x039F,0x039F,0x039F,0x039F,0x039F,0x1F46,0x1F47, /* 1F40 */ + 0x039F,0x039F,0x039F,0x039F,0x039F,0x039F,0x1F4E,0x1F4F, /* 1F48 */ + 0x03A5,0x03A5,0x03A5,0x03A5,0x03A5,0x03A5,0x03A5,0x03A5, /* 1F50 */ + 0x1F58,0x03A5,0x1F5A,0x03A5,0x1F5C,0x03A5,0x1F5E,0x03A5, /* 1F58 */ + 0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9, /* 1F60 */ + 0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9, /* 1F68 */ + 0x0391,0x1FBB,0x0395,0x1FC9,0x0397,0x1FCB,0x0399,0x1FDB, /* 1F70 */ + 0x039F,0x1FF9,0x03A5,0x1FEB,0x03A9,0x1FFB,0x1F7E,0x1F7F, /* 1F78 */ + 0x0391,0x0391,0x0391,0x0391,0x0391,0x0391,0x0391,0x0391, /* 1F80 */ + 0x0391,0x0391,0x0391,0x0391,0x0391,0x0391,0x0391,0x0391, /* 1F88 */ + 0x0397,0x0397,0x0397,0x0397,0x0397,0x0397,0x0397,0x0397, /* 1F90 */ + 0x0397,0x0397,0x0397,0x0397,0x0397,0x0397,0x0397,0x0397, /* 1F98 */ + 0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9, /* 1FA0 */ + 0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9,0x03A9, /* 1FA8 */ + 0x0391,0x0391,0x0391,0x0391,0x0391,0x1FB5,0x0391,0x0391, /* 1FB0 */ + 0x0391,0x0391,0x0391,0x1FBB,0x0391,0x1FBD,0x0399,0x1FBF, /* 1FB8 */ + 0x1FC0,0x1FC1,0x0397,0x0397,0x0397,0x1FC5,0x0397,0x0397, /* 1FC0 */ + 0x0395,0x1FC9,0x0397,0x1FCB,0x0397,0x1FCD,0x1FCE,0x1FCF, /* 1FC8 */ + 0x0399,0x0399,0x0399,0x1FD3,0x1FD4,0x1FD5,0x0399,0x0399, /* 1FD0 */ + 0x0399,0x0399,0x0399,0x1FDB,0x1FDC,0x1FDD,0x1FDE,0x1FDF, /* 1FD8 */ + 0x03A5,0x03A5,0x03A5,0x1FE3,0x03A1,0x03A1,0x03A5,0x03A5, /* 1FE0 */ + 0x03A5,0x03A5,0x03A5,0x1FEB,0x03A1,0x1FED,0x1FEE,0x1FEF, /* 1FE8 */ + 0x1FF0,0x1FF1,0x03A9,0x03A9,0x03A9,0x1FF5,0x03A9,0x03A9, /* 1FF0 */ + 0x039F,0x1FF9,0x03A9,0x1FFB,0x03A9,0x1FFD,0x1FFE,0x1FFF /* 1FF8 */ +}; + +static const uint16 weight_general_ci_page21[256]={ + 0x2100,0x2101,0x2102,0x2103,0x2104,0x2105,0x2106,0x2107, /* 2100 */ + 0x2108,0x2109,0x210A,0x210B,0x210C,0x210D,0x210E,0x210F, /* 2108 */ + 0x2110,0x2111,0x2112,0x2113,0x2114,0x2115,0x2116,0x2117, /* 2110 */ + 0x2118,0x2119,0x211A,0x211B,0x211C,0x211D,0x211E,0x211F, /* 2118 */ + 0x2120,0x2121,0x2122,0x2123,0x2124,0x2125,0x2126,0x2127, /* 2120 */ + 0x2128,0x2129,0x212A,0x212B,0x212C,0x212D,0x212E,0x212F, /* 2128 */ + 0x2130,0x2131,0x2132,0x2133,0x2134,0x2135,0x2136,0x2137, /* 2130 */ + 0x2138,0x2139,0x213A,0x213B,0x213C,0x213D,0x213E,0x213F, /* 2138 */ + 0x2140,0x2141,0x2142,0x2143,0x2144,0x2145,0x2146,0x2147, /* 2140 */ + 0x2148,0x2149,0x214A,0x214B,0x214C,0x214D,0x214E,0x214F, /* 2148 */ + 0x2150,0x2151,0x2152,0x2153,0x2154,0x2155,0x2156,0x2157, /* 2150 */ + 0x2158,0x2159,0x215A,0x215B,0x215C,0x215D,0x215E,0x215F, /* 2158 */ + 0x2160,0x2161,0x2162,0x2163,0x2164,0x2165,0x2166,0x2167, /* 2160 */ + 0x2168,0x2169,0x216A,0x216B,0x216C,0x216D,0x216E,0x216F, /* 2168 */ + 0x2160,0x2161,0x2162,0x2163,0x2164,0x2165,0x2166,0x2167, /* 2170 */ + 0x2168,0x2169,0x216A,0x216B,0x216C,0x216D,0x216E,0x216F, /* 2178 */ + 0x2180,0x2181,0x2182,0x2183,0x2184,0x2185,0x2186,0x2187, /* 2180 */ + 0x2188,0x2189,0x218A,0x218B,0x218C,0x218D,0x218E,0x218F, /* 2188 */ + 0x2190,0x2191,0x2192,0x2193,0x2194,0x2195,0x2196,0x2197, /* 2190 */ + 0x2198,0x2199,0x219A,0x219B,0x219C,0x219D,0x219E,0x219F, /* 2198 */ + 0x21A0,0x21A1,0x21A2,0x21A3,0x21A4,0x21A5,0x21A6,0x21A7, /* 21A0 */ + 0x21A8,0x21A9,0x21AA,0x21AB,0x21AC,0x21AD,0x21AE,0x21AF, /* 21A8 */ + 0x21B0,0x21B1,0x21B2,0x21B3,0x21B4,0x21B5,0x21B6,0x21B7, /* 21B0 */ + 0x21B8,0x21B9,0x21BA,0x21BB,0x21BC,0x21BD,0x21BE,0x21BF, /* 21B8 */ + 0x21C0,0x21C1,0x21C2,0x21C3,0x21C4,0x21C5,0x21C6,0x21C7, /* 21C0 */ + 0x21C8,0x21C9,0x21CA,0x21CB,0x21CC,0x21CD,0x21CE,0x21CF, /* 21C8 */ + 0x21D0,0x21D1,0x21D2,0x21D3,0x21D4,0x21D5,0x21D6,0x21D7, /* 21D0 */ + 0x21D8,0x21D9,0x21DA,0x21DB,0x21DC,0x21DD,0x21DE,0x21DF, /* 21D8 */ + 0x21E0,0x21E1,0x21E2,0x21E3,0x21E4,0x21E5,0x21E6,0x21E7, /* 21E0 */ + 0x21E8,0x21E9,0x21EA,0x21EB,0x21EC,0x21ED,0x21EE,0x21EF, /* 21E8 */ + 0x21F0,0x21F1,0x21F2,0x21F3,0x21F4,0x21F5,0x21F6,0x21F7, /* 21F0 */ + 0x21F8,0x21F9,0x21FA,0x21FB,0x21FC,0x21FD,0x21FE,0x21FF /* 21F8 */ +}; + +static const uint16 weight_general_ci_page24[256]={ + 0x2400,0x2401,0x2402,0x2403,0x2404,0x2405,0x2406,0x2407, /* 2400 */ + 0x2408,0x2409,0x240A,0x240B,0x240C,0x240D,0x240E,0x240F, /* 2408 */ + 0x2410,0x2411,0x2412,0x2413,0x2414,0x2415,0x2416,0x2417, /* 2410 */ + 0x2418,0x2419,0x241A,0x241B,0x241C,0x241D,0x241E,0x241F, /* 2418 */ + 0x2420,0x2421,0x2422,0x2423,0x2424,0x2425,0x2426,0x2427, /* 2420 */ + 0x2428,0x2429,0x242A,0x242B,0x242C,0x242D,0x242E,0x242F, /* 2428 */ + 0x2430,0x2431,0x2432,0x2433,0x2434,0x2435,0x2436,0x2437, /* 2430 */ + 0x2438,0x2439,0x243A,0x243B,0x243C,0x243D,0x243E,0x243F, /* 2438 */ + 0x2440,0x2441,0x2442,0x2443,0x2444,0x2445,0x2446,0x2447, /* 2440 */ + 0x2448,0x2449,0x244A,0x244B,0x244C,0x244D,0x244E,0x244F, /* 2448 */ + 0x2450,0x2451,0x2452,0x2453,0x2454,0x2455,0x2456,0x2457, /* 2450 */ + 0x2458,0x2459,0x245A,0x245B,0x245C,0x245D,0x245E,0x245F, /* 2458 */ + 0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467, /* 2460 */ + 0x2468,0x2469,0x246A,0x246B,0x246C,0x246D,0x246E,0x246F, /* 2468 */ + 0x2470,0x2471,0x2472,0x2473,0x2474,0x2475,0x2476,0x2477, /* 2470 */ + 0x2478,0x2479,0x247A,0x247B,0x247C,0x247D,0x247E,0x247F, /* 2478 */ + 0x2480,0x2481,0x2482,0x2483,0x2484,0x2485,0x2486,0x2487, /* 2480 */ + 0x2488,0x2489,0x248A,0x248B,0x248C,0x248D,0x248E,0x248F, /* 2488 */ + 0x2490,0x2491,0x2492,0x2493,0x2494,0x2495,0x2496,0x2497, /* 2490 */ + 0x2498,0x2499,0x249A,0x249B,0x249C,0x249D,0x249E,0x249F, /* 2498 */ + 0x24A0,0x24A1,0x24A2,0x24A3,0x24A4,0x24A5,0x24A6,0x24A7, /* 24A0 */ + 0x24A8,0x24A9,0x24AA,0x24AB,0x24AC,0x24AD,0x24AE,0x24AF, /* 24A8 */ + 0x24B0,0x24B1,0x24B2,0x24B3,0x24B4,0x24B5,0x24B6,0x24B7, /* 24B0 */ + 0x24B8,0x24B9,0x24BA,0x24BB,0x24BC,0x24BD,0x24BE,0x24BF, /* 24B8 */ + 0x24C0,0x24C1,0x24C2,0x24C3,0x24C4,0x24C5,0x24C6,0x24C7, /* 24C0 */ + 0x24C8,0x24C9,0x24CA,0x24CB,0x24CC,0x24CD,0x24CE,0x24CF, /* 24C8 */ + 0x24B6,0x24B7,0x24B8,0x24B9,0x24BA,0x24BB,0x24BC,0x24BD, /* 24D0 */ + 0x24BE,0x24BF,0x24C0,0x24C1,0x24C2,0x24C3,0x24C4,0x24C5, /* 24D8 */ + 0x24C6,0x24C7,0x24C8,0x24C9,0x24CA,0x24CB,0x24CC,0x24CD, /* 24E0 */ + 0x24CE,0x24CF,0x24EA,0x24EB,0x24EC,0x24ED,0x24EE,0x24EF, /* 24E8 */ + 0x24F0,0x24F1,0x24F2,0x24F3,0x24F4,0x24F5,0x24F6,0x24F7, /* 24F0 */ + 0x24F8,0x24F9,0x24FA,0x24FB,0x24FC,0x24FD,0x24FE,0x24FF /* 24F8 */ +}; + +static const uint16 weight_general_ci_pageFF[256]={ + 0xFF00,0xFF01,0xFF02,0xFF03,0xFF04,0xFF05,0xFF06,0xFF07, /* FF00 */ + 0xFF08,0xFF09,0xFF0A,0xFF0B,0xFF0C,0xFF0D,0xFF0E,0xFF0F, /* FF08 */ + 0xFF10,0xFF11,0xFF12,0xFF13,0xFF14,0xFF15,0xFF16,0xFF17, /* FF10 */ + 0xFF18,0xFF19,0xFF1A,0xFF1B,0xFF1C,0xFF1D,0xFF1E,0xFF1F, /* FF18 */ + 0xFF20,0xFF21,0xFF22,0xFF23,0xFF24,0xFF25,0xFF26,0xFF27, /* FF20 */ + 0xFF28,0xFF29,0xFF2A,0xFF2B,0xFF2C,0xFF2D,0xFF2E,0xFF2F, /* FF28 */ + 0xFF30,0xFF31,0xFF32,0xFF33,0xFF34,0xFF35,0xFF36,0xFF37, /* FF30 */ + 0xFF38,0xFF39,0xFF3A,0xFF3B,0xFF3C,0xFF3D,0xFF3E,0xFF3F, /* FF38 */ + 0xFF40,0xFF21,0xFF22,0xFF23,0xFF24,0xFF25,0xFF26,0xFF27, /* FF40 */ + 0xFF28,0xFF29,0xFF2A,0xFF2B,0xFF2C,0xFF2D,0xFF2E,0xFF2F, /* FF48 */ + 0xFF30,0xFF31,0xFF32,0xFF33,0xFF34,0xFF35,0xFF36,0xFF37, /* FF50 */ + 0xFF38,0xFF39,0xFF3A,0xFF5B,0xFF5C,0xFF5D,0xFF5E,0xFF5F, /* FF58 */ + 0xFF60,0xFF61,0xFF62,0xFF63,0xFF64,0xFF65,0xFF66,0xFF67, /* FF60 */ + 0xFF68,0xFF69,0xFF6A,0xFF6B,0xFF6C,0xFF6D,0xFF6E,0xFF6F, /* FF68 */ + 0xFF70,0xFF71,0xFF72,0xFF73,0xFF74,0xFF75,0xFF76,0xFF77, /* FF70 */ + 0xFF78,0xFF79,0xFF7A,0xFF7B,0xFF7C,0xFF7D,0xFF7E,0xFF7F, /* FF78 */ + 0xFF80,0xFF81,0xFF82,0xFF83,0xFF84,0xFF85,0xFF86,0xFF87, /* FF80 */ + 0xFF88,0xFF89,0xFF8A,0xFF8B,0xFF8C,0xFF8D,0xFF8E,0xFF8F, /* FF88 */ + 0xFF90,0xFF91,0xFF92,0xFF93,0xFF94,0xFF95,0xFF96,0xFF97, /* FF90 */ + 0xFF98,0xFF99,0xFF9A,0xFF9B,0xFF9C,0xFF9D,0xFF9E,0xFF9F, /* FF98 */ + 0xFFA0,0xFFA1,0xFFA2,0xFFA3,0xFFA4,0xFFA5,0xFFA6,0xFFA7, /* FFA0 */ + 0xFFA8,0xFFA9,0xFFAA,0xFFAB,0xFFAC,0xFFAD,0xFFAE,0xFFAF, /* FFA8 */ + 0xFFB0,0xFFB1,0xFFB2,0xFFB3,0xFFB4,0xFFB5,0xFFB6,0xFFB7, /* FFB0 */ + 0xFFB8,0xFFB9,0xFFBA,0xFFBB,0xFFBC,0xFFBD,0xFFBE,0xFFBF, /* FFB8 */ + 0xFFC0,0xFFC1,0xFFC2,0xFFC3,0xFFC4,0xFFC5,0xFFC6,0xFFC7, /* FFC0 */ + 0xFFC8,0xFFC9,0xFFCA,0xFFCB,0xFFCC,0xFFCD,0xFFCE,0xFFCF, /* FFC8 */ + 0xFFD0,0xFFD1,0xFFD2,0xFFD3,0xFFD4,0xFFD5,0xFFD6,0xFFD7, /* FFD0 */ + 0xFFD8,0xFFD9,0xFFDA,0xFFDB,0xFFDC,0xFFDD,0xFFDE,0xFFDF, /* FFD8 */ + 0xFFE0,0xFFE1,0xFFE2,0xFFE3,0xFFE4,0xFFE5,0xFFE6,0xFFE7, /* FFE0 */ + 0xFFE8,0xFFE9,0xFFEA,0xFFEB,0xFFEC,0xFFED,0xFFEE,0xFFEF, /* FFE8 */ + 0xFFF0,0xFFF1,0xFFF2,0xFFF3,0xFFF4,0xFFF5,0xFFF6,0xFFF7, /* FFF0 */ + 0xFFF8,0xFFF9,0xFFFA,0xFFFB,0xFFFC,0xFFFD,0xFFFE,0xFFFF /* FFF8 */ +}; + +const uint16 * weight_general_ci_index[256]={ + weight_general_ci_page00, weight_general_ci_page01, + weight_general_ci_page02, weight_general_ci_page03, + weight_general_ci_page04, weight_general_ci_page05, + weight_general_ci_page06, weight_general_ci_page07, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + weight_general_ci_page1E, weight_general_ci_page1F, + NULL, weight_general_ci_page21, + NULL, NULL, + weight_general_ci_page24, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, weight_general_ci_pageFF +}; diff --git a/strings/ctype-unicode300-general_mysql500_ci.h b/strings/ctype-unicode300-general_mysql500_ci.h new file mode 100644 index 00000000000..3366c391380 --- /dev/null +++ b/strings/ctype-unicode300-general_mysql500_ci.h @@ -0,0 +1,190 @@ +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. + Copyright (c) 2009, 2023, MariaDB Corporation. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA +*/ + +/* + Generated by: + ./unidata-dump \ + --mode=weight_general_mysql500_ci \ + --max-char=0xFFFF \ + UnicodeData-3.0.0.txt + +*/ +const uint16 weight_general_mysql500_ci_page00[256]={ + 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, /* 0000 */ + 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, /* 0008 */ + 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, /* 0010 */ + 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, /* 0018 */ + 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, /* 0020 */ + 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, /* 0028 */ + 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, /* 0030 */ + 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, /* 0038 */ + 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, /* 0040 */ + 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, /* 0048 */ + 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, /* 0050 */ + 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, /* 0058 */ + 0x0060,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, /* 0060 */ + 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, /* 0068 */ + 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, /* 0070 */ + 0x0058,0x0059,0x005A,0x007B,0x007C,0x007D,0x007E,0x007F, /* 0078 */ + 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, /* 0080 */ + 0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, /* 0088 */ + 0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, /* 0090 */ + 0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, /* 0098 */ + 0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, /* 00A0 */ + 0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, /* 00A8 */ + 0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x039C,0x00B6,0x00B7, /* 00B0 */ + 0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, /* 00B8 */ + 0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x00C6,0x0043, /* 00C0 */ + 0x0045,0x0045,0x0045,0x0045,0x0049,0x0049,0x0049,0x0049, /* 00C8 */ + 0x00D0,0x004E,0x004F,0x004F,0x004F,0x004F,0x004F,0x00D7, /* 00D0 */ + 0x00D8,0x0055,0x0055,0x0055,0x0055,0x0059,0x00DE,0x00DF, /* 00D8 */ + 0x0041,0x0041,0x0041,0x0041,0x0041,0x0041,0x00C6,0x0043, /* 00E0 */ + 0x0045,0x0045,0x0045,0x0045,0x0049,0x0049,0x0049,0x0049, /* 00E8 */ + 0x00D0,0x004E,0x004F,0x004F,0x004F,0x004F,0x004F,0x00F7, /* 00F0 */ + 0x00D8,0x0055,0x0055,0x0055,0x0055,0x0059,0x00DE,0x0059 /* 00F8 */ +}; + +const uint16 * weight_general_mysql500_ci_index[256]={ + weight_general_mysql500_ci_page00, weight_general_ci_page01, + weight_general_ci_page02, weight_general_ci_page03, + weight_general_ci_page04, weight_general_ci_page05, + weight_general_ci_page06, weight_general_ci_page07, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + weight_general_ci_page1E, weight_general_ci_page1F, + NULL, weight_general_ci_page21, + NULL, NULL, + weight_general_ci_page24, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, NULL, + NULL, weight_general_ci_pageFF +}; diff --git a/strings/ctype-unicode520-casefold.h b/strings/ctype-unicode520-casefold.h new file mode 100644 index 00000000000..bcd0ff355be --- /dev/null +++ b/strings/ctype-unicode520-casefold.h @@ -0,0 +1,3192 @@ +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. + Copyright (c) 2009, 2023, MariaDB Corporation. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA +*/ + +/* + Generated by: + ./unidata-dump \ + --mode=casefold \ + --page-name=u520_casefold_page \ + --index-name=my_u520_casefold_index \ + UnicodeData-5.2.0.txt + +*/ +const MY_CASEFOLD_CHARACTER u520_casefold_page00[256]={ + {0x0000,0x0000},{0x0001,0x0001}, /* 0000 */ + {0x0002,0x0002},{0x0003,0x0003}, /* 0002 */ + {0x0004,0x0004},{0x0005,0x0005}, /* 0004 */ + {0x0006,0x0006},{0x0007,0x0007}, /* 0006 */ + {0x0008,0x0008},{0x0009,0x0009}, /* 0008 */ + {0x000A,0x000A},{0x000B,0x000B}, /* 000A */ + {0x000C,0x000C},{0x000D,0x000D}, /* 000C */ + {0x000E,0x000E},{0x000F,0x000F}, /* 000E */ + {0x0010,0x0010},{0x0011,0x0011}, /* 0010 */ + {0x0012,0x0012},{0x0013,0x0013}, /* 0012 */ + {0x0014,0x0014},{0x0015,0x0015}, /* 0014 */ + {0x0016,0x0016},{0x0017,0x0017}, /* 0016 */ + {0x0018,0x0018},{0x0019,0x0019}, /* 0018 */ + {0x001A,0x001A},{0x001B,0x001B}, /* 001A */ + {0x001C,0x001C},{0x001D,0x001D}, /* 001C */ + {0x001E,0x001E},{0x001F,0x001F}, /* 001E */ + {0x0020,0x0020},{0x0021,0x0021}, /* 0020 */ + {0x0022,0x0022},{0x0023,0x0023}, /* 0022 */ + {0x0024,0x0024},{0x0025,0x0025}, /* 0024 */ + {0x0026,0x0026},{0x0027,0x0027}, /* 0026 */ + {0x0028,0x0028},{0x0029,0x0029}, /* 0028 */ + {0x002A,0x002A},{0x002B,0x002B}, /* 002A */ + {0x002C,0x002C},{0x002D,0x002D}, /* 002C */ + {0x002E,0x002E},{0x002F,0x002F}, /* 002E */ + {0x0030,0x0030},{0x0031,0x0031}, /* 0030 */ + {0x0032,0x0032},{0x0033,0x0033}, /* 0032 */ + {0x0034,0x0034},{0x0035,0x0035}, /* 0034 */ + {0x0036,0x0036},{0x0037,0x0037}, /* 0036 */ + {0x0038,0x0038},{0x0039,0x0039}, /* 0038 */ + {0x003A,0x003A},{0x003B,0x003B}, /* 003A */ + {0x003C,0x003C},{0x003D,0x003D}, /* 003C */ + {0x003E,0x003E},{0x003F,0x003F}, /* 003E */ + {0x0040,0x0040},{0x0041,0x0061}, /* 0040 */ + {0x0042,0x0062},{0x0043,0x0063}, /* 0042 */ + {0x0044,0x0064},{0x0045,0x0065}, /* 0044 */ + {0x0046,0x0066},{0x0047,0x0067}, /* 0046 */ + {0x0048,0x0068},{0x0049,0x0069}, /* 0048 */ + {0x004A,0x006A},{0x004B,0x006B}, /* 004A */ + {0x004C,0x006C},{0x004D,0x006D}, /* 004C */ + {0x004E,0x006E},{0x004F,0x006F}, /* 004E */ + {0x0050,0x0070},{0x0051,0x0071}, /* 0050 */ + {0x0052,0x0072},{0x0053,0x0073}, /* 0052 */ + {0x0054,0x0074},{0x0055,0x0075}, /* 0054 */ + {0x0056,0x0076},{0x0057,0x0077}, /* 0056 */ + {0x0058,0x0078},{0x0059,0x0079}, /* 0058 */ + {0x005A,0x007A},{0x005B,0x005B}, /* 005A */ + {0x005C,0x005C},{0x005D,0x005D}, /* 005C */ + {0x005E,0x005E},{0x005F,0x005F}, /* 005E */ + {0x0060,0x0060},{0x0041,0x0061}, /* 0060 */ + {0x0042,0x0062},{0x0043,0x0063}, /* 0062 */ + {0x0044,0x0064},{0x0045,0x0065}, /* 0064 */ + {0x0046,0x0066},{0x0047,0x0067}, /* 0066 */ + {0x0048,0x0068},{0x0049,0x0069}, /* 0068 */ + {0x004A,0x006A},{0x004B,0x006B}, /* 006A */ + {0x004C,0x006C},{0x004D,0x006D}, /* 006C */ + {0x004E,0x006E},{0x004F,0x006F}, /* 006E */ + {0x0050,0x0070},{0x0051,0x0071}, /* 0070 */ + {0x0052,0x0072},{0x0053,0x0073}, /* 0072 */ + {0x0054,0x0074},{0x0055,0x0075}, /* 0074 */ + {0x0056,0x0076},{0x0057,0x0077}, /* 0076 */ + {0x0058,0x0078},{0x0059,0x0079}, /* 0078 */ + {0x005A,0x007A},{0x007B,0x007B}, /* 007A */ + {0x007C,0x007C},{0x007D,0x007D}, /* 007C */ + {0x007E,0x007E},{0x007F,0x007F}, /* 007E */ + {0x0080,0x0080},{0x0081,0x0081}, /* 0080 */ + {0x0082,0x0082},{0x0083,0x0083}, /* 0082 */ + {0x0084,0x0084},{0x0085,0x0085}, /* 0084 */ + {0x0086,0x0086},{0x0087,0x0087}, /* 0086 */ + {0x0088,0x0088},{0x0089,0x0089}, /* 0088 */ + {0x008A,0x008A},{0x008B,0x008B}, /* 008A */ + {0x008C,0x008C},{0x008D,0x008D}, /* 008C */ + {0x008E,0x008E},{0x008F,0x008F}, /* 008E */ + {0x0090,0x0090},{0x0091,0x0091}, /* 0090 */ + {0x0092,0x0092},{0x0093,0x0093}, /* 0092 */ + {0x0094,0x0094},{0x0095,0x0095}, /* 0094 */ + {0x0096,0x0096},{0x0097,0x0097}, /* 0096 */ + {0x0098,0x0098},{0x0099,0x0099}, /* 0098 */ + {0x009A,0x009A},{0x009B,0x009B}, /* 009A */ + {0x009C,0x009C},{0x009D,0x009D}, /* 009C */ + {0x009E,0x009E},{0x009F,0x009F}, /* 009E */ + {0x00A0,0x00A0},{0x00A1,0x00A1}, /* 00A0 */ + {0x00A2,0x00A2},{0x00A3,0x00A3}, /* 00A2 */ + {0x00A4,0x00A4},{0x00A5,0x00A5}, /* 00A4 */ + {0x00A6,0x00A6},{0x00A7,0x00A7}, /* 00A6 */ + {0x00A8,0x00A8},{0x00A9,0x00A9}, /* 00A8 */ + {0x00AA,0x00AA},{0x00AB,0x00AB}, /* 00AA */ + {0x00AC,0x00AC},{0x00AD,0x00AD}, /* 00AC */ + {0x00AE,0x00AE},{0x00AF,0x00AF}, /* 00AE */ + {0x00B0,0x00B0},{0x00B1,0x00B1}, /* 00B0 */ + {0x00B2,0x00B2},{0x00B3,0x00B3}, /* 00B2 */ + {0x00B4,0x00B4},{0x039C,0x00B5}, /* 00B4 */ + {0x00B6,0x00B6},{0x00B7,0x00B7}, /* 00B6 */ + {0x00B8,0x00B8},{0x00B9,0x00B9}, /* 00B8 */ + {0x00BA,0x00BA},{0x00BB,0x00BB}, /* 00BA */ + {0x00BC,0x00BC},{0x00BD,0x00BD}, /* 00BC */ + {0x00BE,0x00BE},{0x00BF,0x00BF}, /* 00BE */ + {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00C0 */ + {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00C2 */ + {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00C4 */ + {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00C6 */ + {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00C8 */ + {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00CA */ + {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00CC */ + {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00CE */ + {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00D0 */ + {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00D2 */ + {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00D4 */ + {0x00D6,0x00F6},{0x00D7,0x00D7}, /* 00D6 */ + {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00D8 */ + {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00DA */ + {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00DC */ + {0x00DE,0x00FE},{0x00DF,0x00DF}, /* 00DE */ + {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00E0 */ + {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00E2 */ + {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00E4 */ + {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00E6 */ + {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00E8 */ + {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00EA */ + {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00EC */ + {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00EE */ + {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00F0 */ + {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00F2 */ + {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00F4 */ + {0x00D6,0x00F6},{0x00F7,0x00F7}, /* 00F6 */ + {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00F8 */ + {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00FA */ + {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00FC */ + {0x00DE,0x00FE},{0x0178,0x00FF} /* 00FE */ +}; + +static const MY_CASEFOLD_CHARACTER u520_casefold_page01[256]={ + {0x0100,0x0101},{0x0100,0x0101}, /* 0100 */ + {0x0102,0x0103},{0x0102,0x0103}, /* 0102 */ + {0x0104,0x0105},{0x0104,0x0105}, /* 0104 */ + {0x0106,0x0107},{0x0106,0x0107}, /* 0106 */ + {0x0108,0x0109},{0x0108,0x0109}, /* 0108 */ + {0x010A,0x010B},{0x010A,0x010B}, /* 010A */ + {0x010C,0x010D},{0x010C,0x010D}, /* 010C */ + {0x010E,0x010F},{0x010E,0x010F}, /* 010E */ + {0x0110,0x0111},{0x0110,0x0111}, /* 0110 */ + {0x0112,0x0113},{0x0112,0x0113}, /* 0112 */ + {0x0114,0x0115},{0x0114,0x0115}, /* 0114 */ + {0x0116,0x0117},{0x0116,0x0117}, /* 0116 */ + {0x0118,0x0119},{0x0118,0x0119}, /* 0118 */ + {0x011A,0x011B},{0x011A,0x011B}, /* 011A */ + {0x011C,0x011D},{0x011C,0x011D}, /* 011C */ + {0x011E,0x011F},{0x011E,0x011F}, /* 011E */ + {0x0120,0x0121},{0x0120,0x0121}, /* 0120 */ + {0x0122,0x0123},{0x0122,0x0123}, /* 0122 */ + {0x0124,0x0125},{0x0124,0x0125}, /* 0124 */ + {0x0126,0x0127},{0x0126,0x0127}, /* 0126 */ + {0x0128,0x0129},{0x0128,0x0129}, /* 0128 */ + {0x012A,0x012B},{0x012A,0x012B}, /* 012A */ + {0x012C,0x012D},{0x012C,0x012D}, /* 012C */ + {0x012E,0x012F},{0x012E,0x012F}, /* 012E */ + {0x0130,0x0069},{0x0049,0x0131}, /* 0130 */ + {0x0132,0x0133},{0x0132,0x0133}, /* 0132 */ + {0x0134,0x0135},{0x0134,0x0135}, /* 0134 */ + {0x0136,0x0137},{0x0136,0x0137}, /* 0136 */ + {0x0138,0x0138},{0x0139,0x013A}, /* 0138 */ + {0x0139,0x013A},{0x013B,0x013C}, /* 013A */ + {0x013B,0x013C},{0x013D,0x013E}, /* 013C */ + {0x013D,0x013E},{0x013F,0x0140}, /* 013E */ + {0x013F,0x0140},{0x0141,0x0142}, /* 0140 */ + {0x0141,0x0142},{0x0143,0x0144}, /* 0142 */ + {0x0143,0x0144},{0x0145,0x0146}, /* 0144 */ + {0x0145,0x0146},{0x0147,0x0148}, /* 0146 */ + {0x0147,0x0148},{0x0149,0x0149}, /* 0148 */ + {0x014A,0x014B},{0x014A,0x014B}, /* 014A */ + {0x014C,0x014D},{0x014C,0x014D}, /* 014C */ + {0x014E,0x014F},{0x014E,0x014F}, /* 014E */ + {0x0150,0x0151},{0x0150,0x0151}, /* 0150 */ + {0x0152,0x0153},{0x0152,0x0153}, /* 0152 */ + {0x0154,0x0155},{0x0154,0x0155}, /* 0154 */ + {0x0156,0x0157},{0x0156,0x0157}, /* 0156 */ + {0x0158,0x0159},{0x0158,0x0159}, /* 0158 */ + {0x015A,0x015B},{0x015A,0x015B}, /* 015A */ + {0x015C,0x015D},{0x015C,0x015D}, /* 015C */ + {0x015E,0x015F},{0x015E,0x015F}, /* 015E */ + {0x0160,0x0161},{0x0160,0x0161}, /* 0160 */ + {0x0162,0x0163},{0x0162,0x0163}, /* 0162 */ + {0x0164,0x0165},{0x0164,0x0165}, /* 0164 */ + {0x0166,0x0167},{0x0166,0x0167}, /* 0166 */ + {0x0168,0x0169},{0x0168,0x0169}, /* 0168 */ + {0x016A,0x016B},{0x016A,0x016B}, /* 016A */ + {0x016C,0x016D},{0x016C,0x016D}, /* 016C */ + {0x016E,0x016F},{0x016E,0x016F}, /* 016E */ + {0x0170,0x0171},{0x0170,0x0171}, /* 0170 */ + {0x0172,0x0173},{0x0172,0x0173}, /* 0172 */ + {0x0174,0x0175},{0x0174,0x0175}, /* 0174 */ + {0x0176,0x0177},{0x0176,0x0177}, /* 0176 */ + {0x0178,0x00FF},{0x0179,0x017A}, /* 0178 */ + {0x0179,0x017A},{0x017B,0x017C}, /* 017A */ + {0x017B,0x017C},{0x017D,0x017E}, /* 017C */ + {0x017D,0x017E},{0x0053,0x017F}, /* 017E */ + {0x0243,0x0180},{0x0181,0x0253}, /* 0180 */ + {0x0182,0x0183},{0x0182,0x0183}, /* 0182 */ + {0x0184,0x0185},{0x0184,0x0185}, /* 0184 */ + {0x0186,0x0254},{0x0187,0x0188}, /* 0186 */ + {0x0187,0x0188},{0x0189,0x0256}, /* 0188 */ + {0x018A,0x0257},{0x018B,0x018C}, /* 018A */ + {0x018B,0x018C},{0x018D,0x018D}, /* 018C */ + {0x018E,0x01DD},{0x018F,0x0259}, /* 018E */ + {0x0190,0x025B},{0x0191,0x0192}, /* 0190 */ + {0x0191,0x0192},{0x0193,0x0260}, /* 0192 */ + {0x0194,0x0263},{0x01F6,0x0195}, /* 0194 */ + {0x0196,0x0269},{0x0197,0x0268}, /* 0196 */ + {0x0198,0x0199},{0x0198,0x0199}, /* 0198 */ + {0x023D,0x019A},{0x019B,0x019B}, /* 019A */ + {0x019C,0x026F},{0x019D,0x0272}, /* 019C */ + {0x0220,0x019E},{0x019F,0x0275}, /* 019E */ + {0x01A0,0x01A1},{0x01A0,0x01A1}, /* 01A0 */ + {0x01A2,0x01A3},{0x01A2,0x01A3}, /* 01A2 */ + {0x01A4,0x01A5},{0x01A4,0x01A5}, /* 01A4 */ + {0x01A6,0x0280},{0x01A7,0x01A8}, /* 01A6 */ + {0x01A7,0x01A8},{0x01A9,0x0283}, /* 01A8 */ + {0x01AA,0x01AA},{0x01AB,0x01AB}, /* 01AA */ + {0x01AC,0x01AD},{0x01AC,0x01AD}, /* 01AC */ + {0x01AE,0x0288},{0x01AF,0x01B0}, /* 01AE */ + {0x01AF,0x01B0},{0x01B1,0x028A}, /* 01B0 */ + {0x01B2,0x028B},{0x01B3,0x01B4}, /* 01B2 */ + {0x01B3,0x01B4},{0x01B5,0x01B6}, /* 01B4 */ + {0x01B5,0x01B6},{0x01B7,0x0292}, /* 01B6 */ + {0x01B8,0x01B9},{0x01B8,0x01B9}, /* 01B8 */ + {0x01BA,0x01BA},{0x01BB,0x01BB}, /* 01BA */ + {0x01BC,0x01BD},{0x01BC,0x01BD}, /* 01BC */ + {0x01BE,0x01BE},{0x01F7,0x01BF}, /* 01BE */ + {0x01C0,0x01C0},{0x01C1,0x01C1}, /* 01C0 */ + {0x01C2,0x01C2},{0x01C3,0x01C3}, /* 01C2 */ + {0x01C4,0x01C6},{0x01C4,0x01C6}, /* 01C4 */ + {0x01C4,0x01C6},{0x01C7,0x01C9}, /* 01C6 */ + {0x01C7,0x01C9},{0x01C7,0x01C9}, /* 01C8 */ + {0x01CA,0x01CC},{0x01CA,0x01CC}, /* 01CA */ + {0x01CA,0x01CC},{0x01CD,0x01CE}, /* 01CC */ + {0x01CD,0x01CE},{0x01CF,0x01D0}, /* 01CE */ + {0x01CF,0x01D0},{0x01D1,0x01D2}, /* 01D0 */ + {0x01D1,0x01D2},{0x01D3,0x01D4}, /* 01D2 */ + {0x01D3,0x01D4},{0x01D5,0x01D6}, /* 01D4 */ + {0x01D5,0x01D6},{0x01D7,0x01D8}, /* 01D6 */ + {0x01D7,0x01D8},{0x01D9,0x01DA}, /* 01D8 */ + {0x01D9,0x01DA},{0x01DB,0x01DC}, /* 01DA */ + {0x01DB,0x01DC},{0x018E,0x01DD}, /* 01DC */ + {0x01DE,0x01DF},{0x01DE,0x01DF}, /* 01DE */ + {0x01E0,0x01E1},{0x01E0,0x01E1}, /* 01E0 */ + {0x01E2,0x01E3},{0x01E2,0x01E3}, /* 01E2 */ + {0x01E4,0x01E5},{0x01E4,0x01E5}, /* 01E4 */ + {0x01E6,0x01E7},{0x01E6,0x01E7}, /* 01E6 */ + {0x01E8,0x01E9},{0x01E8,0x01E9}, /* 01E8 */ + {0x01EA,0x01EB},{0x01EA,0x01EB}, /* 01EA */ + {0x01EC,0x01ED},{0x01EC,0x01ED}, /* 01EC */ + {0x01EE,0x01EF},{0x01EE,0x01EF}, /* 01EE */ + {0x01F0,0x01F0},{0x01F1,0x01F3}, /* 01F0 */ + {0x01F1,0x01F3},{0x01F1,0x01F3}, /* 01F2 */ + {0x01F4,0x01F5},{0x01F4,0x01F5}, /* 01F4 */ + {0x01F6,0x0195},{0x01F7,0x01BF}, /* 01F6 */ + {0x01F8,0x01F9},{0x01F8,0x01F9}, /* 01F8 */ + {0x01FA,0x01FB},{0x01FA,0x01FB}, /* 01FA */ + {0x01FC,0x01FD},{0x01FC,0x01FD}, /* 01FC */ + {0x01FE,0x01FF},{0x01FE,0x01FF} /* 01FE */ +}; + +static const MY_CASEFOLD_CHARACTER u520_casefold_page02[256]={ + {0x0200,0x0201},{0x0200,0x0201}, /* 0200 */ + {0x0202,0x0203},{0x0202,0x0203}, /* 0202 */ + {0x0204,0x0205},{0x0204,0x0205}, /* 0204 */ + {0x0206,0x0207},{0x0206,0x0207}, /* 0206 */ + {0x0208,0x0209},{0x0208,0x0209}, /* 0208 */ + {0x020A,0x020B},{0x020A,0x020B}, /* 020A */ + {0x020C,0x020D},{0x020C,0x020D}, /* 020C */ + {0x020E,0x020F},{0x020E,0x020F}, /* 020E */ + {0x0210,0x0211},{0x0210,0x0211}, /* 0210 */ + {0x0212,0x0213},{0x0212,0x0213}, /* 0212 */ + {0x0214,0x0215},{0x0214,0x0215}, /* 0214 */ + {0x0216,0x0217},{0x0216,0x0217}, /* 0216 */ + {0x0218,0x0219},{0x0218,0x0219}, /* 0218 */ + {0x021A,0x021B},{0x021A,0x021B}, /* 021A */ + {0x021C,0x021D},{0x021C,0x021D}, /* 021C */ + {0x021E,0x021F},{0x021E,0x021F}, /* 021E */ + {0x0220,0x019E},{0x0221,0x0221}, /* 0220 */ + {0x0222,0x0223},{0x0222,0x0223}, /* 0222 */ + {0x0224,0x0225},{0x0224,0x0225}, /* 0224 */ + {0x0226,0x0227},{0x0226,0x0227}, /* 0226 */ + {0x0228,0x0229},{0x0228,0x0229}, /* 0228 */ + {0x022A,0x022B},{0x022A,0x022B}, /* 022A */ + {0x022C,0x022D},{0x022C,0x022D}, /* 022C */ + {0x022E,0x022F},{0x022E,0x022F}, /* 022E */ + {0x0230,0x0231},{0x0230,0x0231}, /* 0230 */ + {0x0232,0x0233},{0x0232,0x0233}, /* 0232 */ + {0x0234,0x0234},{0x0235,0x0235}, /* 0234 */ + {0x0236,0x0236},{0x0237,0x0237}, /* 0236 */ + {0x0238,0x0238},{0x0239,0x0239}, /* 0238 */ + {0x023A,0x2C65},{0x023B,0x023C}, /* 023A */ + {0x023B,0x023C},{0x023D,0x019A}, /* 023C */ + {0x023E,0x2C66},{0x2C7E,0x023F}, /* 023E */ + {0x2C7F,0x0240},{0x0241,0x0242}, /* 0240 */ + {0x0241,0x0242},{0x0243,0x0180}, /* 0242 */ + {0x0244,0x0289},{0x0245,0x028C}, /* 0244 */ + {0x0246,0x0247},{0x0246,0x0247}, /* 0246 */ + {0x0248,0x0249},{0x0248,0x0249}, /* 0248 */ + {0x024A,0x024B},{0x024A,0x024B}, /* 024A */ + {0x024C,0x024D},{0x024C,0x024D}, /* 024C */ + {0x024E,0x024F},{0x024E,0x024F}, /* 024E */ + {0x2C6F,0x0250},{0x2C6D,0x0251}, /* 0250 */ + {0x2C70,0x0252},{0x0181,0x0253}, /* 0252 */ + {0x0186,0x0254},{0x0255,0x0255}, /* 0254 */ + {0x0189,0x0256},{0x018A,0x0257}, /* 0256 */ + {0x0258,0x0258},{0x018F,0x0259}, /* 0258 */ + {0x025A,0x025A},{0x0190,0x025B}, /* 025A */ + {0x025C,0x025C},{0x025D,0x025D}, /* 025C */ + {0x025E,0x025E},{0x025F,0x025F}, /* 025E */ + {0x0193,0x0260},{0x0261,0x0261}, /* 0260 */ + {0x0262,0x0262},{0x0194,0x0263}, /* 0262 */ + {0x0264,0x0264},{0x0265,0x0265}, /* 0264 */ + {0x0266,0x0266},{0x0267,0x0267}, /* 0266 */ + {0x0197,0x0268},{0x0196,0x0269}, /* 0268 */ + {0x026A,0x026A},{0x2C62,0x026B}, /* 026A */ + {0x026C,0x026C},{0x026D,0x026D}, /* 026C */ + {0x026E,0x026E},{0x019C,0x026F}, /* 026E */ + {0x0270,0x0270},{0x2C6E,0x0271}, /* 0270 */ + {0x019D,0x0272},{0x0273,0x0273}, /* 0272 */ + {0x0274,0x0274},{0x019F,0x0275}, /* 0274 */ + {0x0276,0x0276},{0x0277,0x0277}, /* 0276 */ + {0x0278,0x0278},{0x0279,0x0279}, /* 0278 */ + {0x027A,0x027A},{0x027B,0x027B}, /* 027A */ + {0x027C,0x027C},{0x2C64,0x027D}, /* 027C */ + {0x027E,0x027E},{0x027F,0x027F}, /* 027E */ + {0x01A6,0x0280},{0x0281,0x0281}, /* 0280 */ + {0x0282,0x0282},{0x01A9,0x0283}, /* 0282 */ + {0x0284,0x0284},{0x0285,0x0285}, /* 0284 */ + {0x0286,0x0286},{0x0287,0x0287}, /* 0286 */ + {0x01AE,0x0288},{0x0244,0x0289}, /* 0288 */ + {0x01B1,0x028A},{0x01B2,0x028B}, /* 028A */ + {0x0245,0x028C},{0x028D,0x028D}, /* 028C */ + {0x028E,0x028E},{0x028F,0x028F}, /* 028E */ + {0x0290,0x0290},{0x0291,0x0291}, /* 0290 */ + {0x01B7,0x0292},{0x0293,0x0293}, /* 0292 */ + {0x0294,0x0294},{0x0295,0x0295}, /* 0294 */ + {0x0296,0x0296},{0x0297,0x0297}, /* 0296 */ + {0x0298,0x0298},{0x0299,0x0299}, /* 0298 */ + {0x029A,0x029A},{0x029B,0x029B}, /* 029A */ + {0x029C,0x029C},{0x029D,0x029D}, /* 029C */ + {0x029E,0x029E},{0x029F,0x029F}, /* 029E */ + {0x02A0,0x02A0},{0x02A1,0x02A1}, /* 02A0 */ + {0x02A2,0x02A2},{0x02A3,0x02A3}, /* 02A2 */ + {0x02A4,0x02A4},{0x02A5,0x02A5}, /* 02A4 */ + {0x02A6,0x02A6},{0x02A7,0x02A7}, /* 02A6 */ + {0x02A8,0x02A8},{0x02A9,0x02A9}, /* 02A8 */ + {0x02AA,0x02AA},{0x02AB,0x02AB}, /* 02AA */ + {0x02AC,0x02AC},{0x02AD,0x02AD}, /* 02AC */ + {0x02AE,0x02AE},{0x02AF,0x02AF}, /* 02AE */ + {0x02B0,0x02B0},{0x02B1,0x02B1}, /* 02B0 */ + {0x02B2,0x02B2},{0x02B3,0x02B3}, /* 02B2 */ + {0x02B4,0x02B4},{0x02B5,0x02B5}, /* 02B4 */ + {0x02B6,0x02B6},{0x02B7,0x02B7}, /* 02B6 */ + {0x02B8,0x02B8},{0x02B9,0x02B9}, /* 02B8 */ + {0x02BA,0x02BA},{0x02BB,0x02BB}, /* 02BA */ + {0x02BC,0x02BC},{0x02BD,0x02BD}, /* 02BC */ + {0x02BE,0x02BE},{0x02BF,0x02BF}, /* 02BE */ + {0x02C0,0x02C0},{0x02C1,0x02C1}, /* 02C0 */ + {0x02C2,0x02C2},{0x02C3,0x02C3}, /* 02C2 */ + {0x02C4,0x02C4},{0x02C5,0x02C5}, /* 02C4 */ + {0x02C6,0x02C6},{0x02C7,0x02C7}, /* 02C6 */ + {0x02C8,0x02C8},{0x02C9,0x02C9}, /* 02C8 */ + {0x02CA,0x02CA},{0x02CB,0x02CB}, /* 02CA */ + {0x02CC,0x02CC},{0x02CD,0x02CD}, /* 02CC */ + {0x02CE,0x02CE},{0x02CF,0x02CF}, /* 02CE */ + {0x02D0,0x02D0},{0x02D1,0x02D1}, /* 02D0 */ + {0x02D2,0x02D2},{0x02D3,0x02D3}, /* 02D2 */ + {0x02D4,0x02D4},{0x02D5,0x02D5}, /* 02D4 */ + {0x02D6,0x02D6},{0x02D7,0x02D7}, /* 02D6 */ + {0x02D8,0x02D8},{0x02D9,0x02D9}, /* 02D8 */ + {0x02DA,0x02DA},{0x02DB,0x02DB}, /* 02DA */ + {0x02DC,0x02DC},{0x02DD,0x02DD}, /* 02DC */ + {0x02DE,0x02DE},{0x02DF,0x02DF}, /* 02DE */ + {0x02E0,0x02E0},{0x02E1,0x02E1}, /* 02E0 */ + {0x02E2,0x02E2},{0x02E3,0x02E3}, /* 02E2 */ + {0x02E4,0x02E4},{0x02E5,0x02E5}, /* 02E4 */ + {0x02E6,0x02E6},{0x02E7,0x02E7}, /* 02E6 */ + {0x02E8,0x02E8},{0x02E9,0x02E9}, /* 02E8 */ + {0x02EA,0x02EA},{0x02EB,0x02EB}, /* 02EA */ + {0x02EC,0x02EC},{0x02ED,0x02ED}, /* 02EC */ + {0x02EE,0x02EE},{0x02EF,0x02EF}, /* 02EE */ + {0x02F0,0x02F0},{0x02F1,0x02F1}, /* 02F0 */ + {0x02F2,0x02F2},{0x02F3,0x02F3}, /* 02F2 */ + {0x02F4,0x02F4},{0x02F5,0x02F5}, /* 02F4 */ + {0x02F6,0x02F6},{0x02F7,0x02F7}, /* 02F6 */ + {0x02F8,0x02F8},{0x02F9,0x02F9}, /* 02F8 */ + {0x02FA,0x02FA},{0x02FB,0x02FB}, /* 02FA */ + {0x02FC,0x02FC},{0x02FD,0x02FD}, /* 02FC */ + {0x02FE,0x02FE},{0x02FF,0x02FF} /* 02FE */ +}; + +static const MY_CASEFOLD_CHARACTER u520_casefold_page03[256]={ + {0x0300,0x0300},{0x0301,0x0301}, /* 0300 */ + {0x0302,0x0302},{0x0303,0x0303}, /* 0302 */ + {0x0304,0x0304},{0x0305,0x0305}, /* 0304 */ + {0x0306,0x0306},{0x0307,0x0307}, /* 0306 */ + {0x0308,0x0308},{0x0309,0x0309}, /* 0308 */ + {0x030A,0x030A},{0x030B,0x030B}, /* 030A */ + {0x030C,0x030C},{0x030D,0x030D}, /* 030C */ + {0x030E,0x030E},{0x030F,0x030F}, /* 030E */ + {0x0310,0x0310},{0x0311,0x0311}, /* 0310 */ + {0x0312,0x0312},{0x0313,0x0313}, /* 0312 */ + {0x0314,0x0314},{0x0315,0x0315}, /* 0314 */ + {0x0316,0x0316},{0x0317,0x0317}, /* 0316 */ + {0x0318,0x0318},{0x0319,0x0319}, /* 0318 */ + {0x031A,0x031A},{0x031B,0x031B}, /* 031A */ + {0x031C,0x031C},{0x031D,0x031D}, /* 031C */ + {0x031E,0x031E},{0x031F,0x031F}, /* 031E */ + {0x0320,0x0320},{0x0321,0x0321}, /* 0320 */ + {0x0322,0x0322},{0x0323,0x0323}, /* 0322 */ + {0x0324,0x0324},{0x0325,0x0325}, /* 0324 */ + {0x0326,0x0326},{0x0327,0x0327}, /* 0326 */ + {0x0328,0x0328},{0x0329,0x0329}, /* 0328 */ + {0x032A,0x032A},{0x032B,0x032B}, /* 032A */ + {0x032C,0x032C},{0x032D,0x032D}, /* 032C */ + {0x032E,0x032E},{0x032F,0x032F}, /* 032E */ + {0x0330,0x0330},{0x0331,0x0331}, /* 0330 */ + {0x0332,0x0332},{0x0333,0x0333}, /* 0332 */ + {0x0334,0x0334},{0x0335,0x0335}, /* 0334 */ + {0x0336,0x0336},{0x0337,0x0337}, /* 0336 */ + {0x0338,0x0338},{0x0339,0x0339}, /* 0338 */ + {0x033A,0x033A},{0x033B,0x033B}, /* 033A */ + {0x033C,0x033C},{0x033D,0x033D}, /* 033C */ + {0x033E,0x033E},{0x033F,0x033F}, /* 033E */ + {0x0340,0x0340},{0x0341,0x0341}, /* 0340 */ + {0x0342,0x0342},{0x0343,0x0343}, /* 0342 */ + {0x0344,0x0344},{0x0399,0x0345}, /* 0344 */ + {0x0346,0x0346},{0x0347,0x0347}, /* 0346 */ + {0x0348,0x0348},{0x0349,0x0349}, /* 0348 */ + {0x034A,0x034A},{0x034B,0x034B}, /* 034A */ + {0x034C,0x034C},{0x034D,0x034D}, /* 034C */ + {0x034E,0x034E},{0x034F,0x034F}, /* 034E */ + {0x0350,0x0350},{0x0351,0x0351}, /* 0350 */ + {0x0352,0x0352},{0x0353,0x0353}, /* 0352 */ + {0x0354,0x0354},{0x0355,0x0355}, /* 0354 */ + {0x0356,0x0356},{0x0357,0x0357}, /* 0356 */ + {0x0358,0x0358},{0x0359,0x0359}, /* 0358 */ + {0x035A,0x035A},{0x035B,0x035B}, /* 035A */ + {0x035C,0x035C},{0x035D,0x035D}, /* 035C */ + {0x035E,0x035E},{0x035F,0x035F}, /* 035E */ + {0x0360,0x0360},{0x0361,0x0361}, /* 0360 */ + {0x0362,0x0362},{0x0363,0x0363}, /* 0362 */ + {0x0364,0x0364},{0x0365,0x0365}, /* 0364 */ + {0x0366,0x0366},{0x0367,0x0367}, /* 0366 */ + {0x0368,0x0368},{0x0369,0x0369}, /* 0368 */ + {0x036A,0x036A},{0x036B,0x036B}, /* 036A */ + {0x036C,0x036C},{0x036D,0x036D}, /* 036C */ + {0x036E,0x036E},{0x036F,0x036F}, /* 036E */ + {0x0370,0x0371},{0x0370,0x0371}, /* 0370 */ + {0x0372,0x0373},{0x0372,0x0373}, /* 0372 */ + {0x0374,0x0374},{0x0375,0x0375}, /* 0374 */ + {0x0376,0x0377},{0x0376,0x0377}, /* 0376 */ + {0x0378,0x0378},{0x0379,0x0379}, /* 0378 */ + {0x037A,0x037A},{0x03FD,0x037B}, /* 037A */ + {0x03FE,0x037C},{0x03FF,0x037D}, /* 037C */ + {0x037E,0x037E},{0x037F,0x037F}, /* 037E */ + {0x0380,0x0380},{0x0381,0x0381}, /* 0380 */ + {0x0382,0x0382},{0x0383,0x0383}, /* 0382 */ + {0x0384,0x0384},{0x0385,0x0385}, /* 0384 */ + {0x0386,0x03AC},{0x0387,0x0387}, /* 0386 */ + {0x0388,0x03AD},{0x0389,0x03AE}, /* 0388 */ + {0x038A,0x03AF},{0x038B,0x038B}, /* 038A */ + {0x038C,0x03CC},{0x038D,0x038D}, /* 038C */ + {0x038E,0x03CD},{0x038F,0x03CE}, /* 038E */ + {0x0390,0x0390},{0x0391,0x03B1}, /* 0390 */ + {0x0392,0x03B2},{0x0393,0x03B3}, /* 0392 */ + {0x0394,0x03B4},{0x0395,0x03B5}, /* 0394 */ + {0x0396,0x03B6},{0x0397,0x03B7}, /* 0396 */ + {0x0398,0x03B8},{0x0399,0x03B9}, /* 0398 */ + {0x039A,0x03BA},{0x039B,0x03BB}, /* 039A */ + {0x039C,0x03BC},{0x039D,0x03BD}, /* 039C */ + {0x039E,0x03BE},{0x039F,0x03BF}, /* 039E */ + {0x03A0,0x03C0},{0x03A1,0x03C1}, /* 03A0 */ + {0x03A2,0x03A2},{0x03A3,0x03C3}, /* 03A2 */ + {0x03A4,0x03C4},{0x03A5,0x03C5}, /* 03A4 */ + {0x03A6,0x03C6},{0x03A7,0x03C7}, /* 03A6 */ + {0x03A8,0x03C8},{0x03A9,0x03C9}, /* 03A8 */ + {0x03AA,0x03CA},{0x03AB,0x03CB}, /* 03AA */ + {0x0386,0x03AC},{0x0388,0x03AD}, /* 03AC */ + {0x0389,0x03AE},{0x038A,0x03AF}, /* 03AE */ + {0x03B0,0x03B0},{0x0391,0x03B1}, /* 03B0 */ + {0x0392,0x03B2},{0x0393,0x03B3}, /* 03B2 */ + {0x0394,0x03B4},{0x0395,0x03B5}, /* 03B4 */ + {0x0396,0x03B6},{0x0397,0x03B7}, /* 03B6 */ + {0x0398,0x03B8},{0x0399,0x03B9}, /* 03B8 */ + {0x039A,0x03BA},{0x039B,0x03BB}, /* 03BA */ + {0x039C,0x03BC},{0x039D,0x03BD}, /* 03BC */ + {0x039E,0x03BE},{0x039F,0x03BF}, /* 03BE */ + {0x03A0,0x03C0},{0x03A1,0x03C1}, /* 03C0 */ + {0x03A3,0x03C2},{0x03A3,0x03C3}, /* 03C2 */ + {0x03A4,0x03C4},{0x03A5,0x03C5}, /* 03C4 */ + {0x03A6,0x03C6},{0x03A7,0x03C7}, /* 03C6 */ + {0x03A8,0x03C8},{0x03A9,0x03C9}, /* 03C8 */ + {0x03AA,0x03CA},{0x03AB,0x03CB}, /* 03CA */ + {0x038C,0x03CC},{0x038E,0x03CD}, /* 03CC */ + {0x038F,0x03CE},{0x03CF,0x03D7}, /* 03CE */ + {0x0392,0x03D0},{0x0398,0x03D1}, /* 03D0 */ + {0x03D2,0x03D2},{0x03D3,0x03D3}, /* 03D2 */ + {0x03D4,0x03D4},{0x03A6,0x03D5}, /* 03D4 */ + {0x03A0,0x03D6},{0x03CF,0x03D7}, /* 03D6 */ + {0x03D8,0x03D9},{0x03D8,0x03D9}, /* 03D8 */ + {0x03DA,0x03DB},{0x03DA,0x03DB}, /* 03DA */ + {0x03DC,0x03DD},{0x03DC,0x03DD}, /* 03DC */ + {0x03DE,0x03DF},{0x03DE,0x03DF}, /* 03DE */ + {0x03E0,0x03E1},{0x03E0,0x03E1}, /* 03E0 */ + {0x03E2,0x03E3},{0x03E2,0x03E3}, /* 03E2 */ + {0x03E4,0x03E5},{0x03E4,0x03E5}, /* 03E4 */ + {0x03E6,0x03E7},{0x03E6,0x03E7}, /* 03E6 */ + {0x03E8,0x03E9},{0x03E8,0x03E9}, /* 03E8 */ + {0x03EA,0x03EB},{0x03EA,0x03EB}, /* 03EA */ + {0x03EC,0x03ED},{0x03EC,0x03ED}, /* 03EC */ + {0x03EE,0x03EF},{0x03EE,0x03EF}, /* 03EE */ + {0x039A,0x03F0},{0x03A1,0x03F1}, /* 03F0 */ + {0x03F9,0x03F2},{0x03F3,0x03F3}, /* 03F2 */ + {0x03F4,0x03B8},{0x0395,0x03F5}, /* 03F4 */ + {0x03F6,0x03F6},{0x03F7,0x03F8}, /* 03F6 */ + {0x03F7,0x03F8},{0x03F9,0x03F2}, /* 03F8 */ + {0x03FA,0x03FB},{0x03FA,0x03FB}, /* 03FA */ + {0x03FC,0x03FC},{0x03FD,0x037B}, /* 03FC */ + {0x03FE,0x037C},{0x03FF,0x037D} /* 03FE */ +}; + +static const MY_CASEFOLD_CHARACTER u520_casefold_page04[256]={ + {0x0400,0x0450},{0x0401,0x0451}, /* 0400 */ + {0x0402,0x0452},{0x0403,0x0453}, /* 0402 */ + {0x0404,0x0454},{0x0405,0x0455}, /* 0404 */ + {0x0406,0x0456},{0x0407,0x0457}, /* 0406 */ + {0x0408,0x0458},{0x0409,0x0459}, /* 0408 */ + {0x040A,0x045A},{0x040B,0x045B}, /* 040A */ + {0x040C,0x045C},{0x040D,0x045D}, /* 040C */ + {0x040E,0x045E},{0x040F,0x045F}, /* 040E */ + {0x0410,0x0430},{0x0411,0x0431}, /* 0410 */ + {0x0412,0x0432},{0x0413,0x0433}, /* 0412 */ + {0x0414,0x0434},{0x0415,0x0435}, /* 0414 */ + {0x0416,0x0436},{0x0417,0x0437}, /* 0416 */ + {0x0418,0x0438},{0x0419,0x0439}, /* 0418 */ + {0x041A,0x043A},{0x041B,0x043B}, /* 041A */ + {0x041C,0x043C},{0x041D,0x043D}, /* 041C */ + {0x041E,0x043E},{0x041F,0x043F}, /* 041E */ + {0x0420,0x0440},{0x0421,0x0441}, /* 0420 */ + {0x0422,0x0442},{0x0423,0x0443}, /* 0422 */ + {0x0424,0x0444},{0x0425,0x0445}, /* 0424 */ + {0x0426,0x0446},{0x0427,0x0447}, /* 0426 */ + {0x0428,0x0448},{0x0429,0x0449}, /* 0428 */ + {0x042A,0x044A},{0x042B,0x044B}, /* 042A */ + {0x042C,0x044C},{0x042D,0x044D}, /* 042C */ + {0x042E,0x044E},{0x042F,0x044F}, /* 042E */ + {0x0410,0x0430},{0x0411,0x0431}, /* 0430 */ + {0x0412,0x0432},{0x0413,0x0433}, /* 0432 */ + {0x0414,0x0434},{0x0415,0x0435}, /* 0434 */ + {0x0416,0x0436},{0x0417,0x0437}, /* 0436 */ + {0x0418,0x0438},{0x0419,0x0439}, /* 0438 */ + {0x041A,0x043A},{0x041B,0x043B}, /* 043A */ + {0x041C,0x043C},{0x041D,0x043D}, /* 043C */ + {0x041E,0x043E},{0x041F,0x043F}, /* 043E */ + {0x0420,0x0440},{0x0421,0x0441}, /* 0440 */ + {0x0422,0x0442},{0x0423,0x0443}, /* 0442 */ + {0x0424,0x0444},{0x0425,0x0445}, /* 0444 */ + {0x0426,0x0446},{0x0427,0x0447}, /* 0446 */ + {0x0428,0x0448},{0x0429,0x0449}, /* 0448 */ + {0x042A,0x044A},{0x042B,0x044B}, /* 044A */ + {0x042C,0x044C},{0x042D,0x044D}, /* 044C */ + {0x042E,0x044E},{0x042F,0x044F}, /* 044E */ + {0x0400,0x0450},{0x0401,0x0451}, /* 0450 */ + {0x0402,0x0452},{0x0403,0x0453}, /* 0452 */ + {0x0404,0x0454},{0x0405,0x0455}, /* 0454 */ + {0x0406,0x0456},{0x0407,0x0457}, /* 0456 */ + {0x0408,0x0458},{0x0409,0x0459}, /* 0458 */ + {0x040A,0x045A},{0x040B,0x045B}, /* 045A */ + {0x040C,0x045C},{0x040D,0x045D}, /* 045C */ + {0x040E,0x045E},{0x040F,0x045F}, /* 045E */ + {0x0460,0x0461},{0x0460,0x0461}, /* 0460 */ + {0x0462,0x0463},{0x0462,0x0463}, /* 0462 */ + {0x0464,0x0465},{0x0464,0x0465}, /* 0464 */ + {0x0466,0x0467},{0x0466,0x0467}, /* 0466 */ + {0x0468,0x0469},{0x0468,0x0469}, /* 0468 */ + {0x046A,0x046B},{0x046A,0x046B}, /* 046A */ + {0x046C,0x046D},{0x046C,0x046D}, /* 046C */ + {0x046E,0x046F},{0x046E,0x046F}, /* 046E */ + {0x0470,0x0471},{0x0470,0x0471}, /* 0470 */ + {0x0472,0x0473},{0x0472,0x0473}, /* 0472 */ + {0x0474,0x0475},{0x0474,0x0475}, /* 0474 */ + {0x0476,0x0477},{0x0476,0x0477}, /* 0476 */ + {0x0478,0x0479},{0x0478,0x0479}, /* 0478 */ + {0x047A,0x047B},{0x047A,0x047B}, /* 047A */ + {0x047C,0x047D},{0x047C,0x047D}, /* 047C */ + {0x047E,0x047F},{0x047E,0x047F}, /* 047E */ + {0x0480,0x0481},{0x0480,0x0481}, /* 0480 */ + {0x0482,0x0482},{0x0483,0x0483}, /* 0482 */ + {0x0484,0x0484},{0x0485,0x0485}, /* 0484 */ + {0x0486,0x0486},{0x0487,0x0487}, /* 0486 */ + {0x0488,0x0488},{0x0489,0x0489}, /* 0488 */ + {0x048A,0x048B},{0x048A,0x048B}, /* 048A */ + {0x048C,0x048D},{0x048C,0x048D}, /* 048C */ + {0x048E,0x048F},{0x048E,0x048F}, /* 048E */ + {0x0490,0x0491},{0x0490,0x0491}, /* 0490 */ + {0x0492,0x0493},{0x0492,0x0493}, /* 0492 */ + {0x0494,0x0495},{0x0494,0x0495}, /* 0494 */ + {0x0496,0x0497},{0x0496,0x0497}, /* 0496 */ + {0x0498,0x0499},{0x0498,0x0499}, /* 0498 */ + {0x049A,0x049B},{0x049A,0x049B}, /* 049A */ + {0x049C,0x049D},{0x049C,0x049D}, /* 049C */ + {0x049E,0x049F},{0x049E,0x049F}, /* 049E */ + {0x04A0,0x04A1},{0x04A0,0x04A1}, /* 04A0 */ + {0x04A2,0x04A3},{0x04A2,0x04A3}, /* 04A2 */ + {0x04A4,0x04A5},{0x04A4,0x04A5}, /* 04A4 */ + {0x04A6,0x04A7},{0x04A6,0x04A7}, /* 04A6 */ + {0x04A8,0x04A9},{0x04A8,0x04A9}, /* 04A8 */ + {0x04AA,0x04AB},{0x04AA,0x04AB}, /* 04AA */ + {0x04AC,0x04AD},{0x04AC,0x04AD}, /* 04AC */ + {0x04AE,0x04AF},{0x04AE,0x04AF}, /* 04AE */ + {0x04B0,0x04B1},{0x04B0,0x04B1}, /* 04B0 */ + {0x04B2,0x04B3},{0x04B2,0x04B3}, /* 04B2 */ + {0x04B4,0x04B5},{0x04B4,0x04B5}, /* 04B4 */ + {0x04B6,0x04B7},{0x04B6,0x04B7}, /* 04B6 */ + {0x04B8,0x04B9},{0x04B8,0x04B9}, /* 04B8 */ + {0x04BA,0x04BB},{0x04BA,0x04BB}, /* 04BA */ + {0x04BC,0x04BD},{0x04BC,0x04BD}, /* 04BC */ + {0x04BE,0x04BF},{0x04BE,0x04BF}, /* 04BE */ + {0x04C0,0x04CF},{0x04C1,0x04C2}, /* 04C0 */ + {0x04C1,0x04C2},{0x04C3,0x04C4}, /* 04C2 */ + {0x04C3,0x04C4},{0x04C5,0x04C6}, /* 04C4 */ + {0x04C5,0x04C6},{0x04C7,0x04C8}, /* 04C6 */ + {0x04C7,0x04C8},{0x04C9,0x04CA}, /* 04C8 */ + {0x04C9,0x04CA},{0x04CB,0x04CC}, /* 04CA */ + {0x04CB,0x04CC},{0x04CD,0x04CE}, /* 04CC */ + {0x04CD,0x04CE},{0x04C0,0x04CF}, /* 04CE */ + {0x04D0,0x04D1},{0x04D0,0x04D1}, /* 04D0 */ + {0x04D2,0x04D3},{0x04D2,0x04D3}, /* 04D2 */ + {0x04D4,0x04D5},{0x04D4,0x04D5}, /* 04D4 */ + {0x04D6,0x04D7},{0x04D6,0x04D7}, /* 04D6 */ + {0x04D8,0x04D9},{0x04D8,0x04D9}, /* 04D8 */ + {0x04DA,0x04DB},{0x04DA,0x04DB}, /* 04DA */ + {0x04DC,0x04DD},{0x04DC,0x04DD}, /* 04DC */ + {0x04DE,0x04DF},{0x04DE,0x04DF}, /* 04DE */ + {0x04E0,0x04E1},{0x04E0,0x04E1}, /* 04E0 */ + {0x04E2,0x04E3},{0x04E2,0x04E3}, /* 04E2 */ + {0x04E4,0x04E5},{0x04E4,0x04E5}, /* 04E4 */ + {0x04E6,0x04E7},{0x04E6,0x04E7}, /* 04E6 */ + {0x04E8,0x04E9},{0x04E8,0x04E9}, /* 04E8 */ + {0x04EA,0x04EB},{0x04EA,0x04EB}, /* 04EA */ + {0x04EC,0x04ED},{0x04EC,0x04ED}, /* 04EC */ + {0x04EE,0x04EF},{0x04EE,0x04EF}, /* 04EE */ + {0x04F0,0x04F1},{0x04F0,0x04F1}, /* 04F0 */ + {0x04F2,0x04F3},{0x04F2,0x04F3}, /* 04F2 */ + {0x04F4,0x04F5},{0x04F4,0x04F5}, /* 04F4 */ + {0x04F6,0x04F7},{0x04F6,0x04F7}, /* 04F6 */ + {0x04F8,0x04F9},{0x04F8,0x04F9}, /* 04F8 */ + {0x04FA,0x04FB},{0x04FA,0x04FB}, /* 04FA */ + {0x04FC,0x04FD},{0x04FC,0x04FD}, /* 04FC */ + {0x04FE,0x04FF},{0x04FE,0x04FF} /* 04FE */ +}; + +static const MY_CASEFOLD_CHARACTER u520_casefold_page05[256]={ + {0x0500,0x0501},{0x0500,0x0501}, /* 0500 */ + {0x0502,0x0503},{0x0502,0x0503}, /* 0502 */ + {0x0504,0x0505},{0x0504,0x0505}, /* 0504 */ + {0x0506,0x0507},{0x0506,0x0507}, /* 0506 */ + {0x0508,0x0509},{0x0508,0x0509}, /* 0508 */ + {0x050A,0x050B},{0x050A,0x050B}, /* 050A */ + {0x050C,0x050D},{0x050C,0x050D}, /* 050C */ + {0x050E,0x050F},{0x050E,0x050F}, /* 050E */ + {0x0510,0x0511},{0x0510,0x0511}, /* 0510 */ + {0x0512,0x0513},{0x0512,0x0513}, /* 0512 */ + {0x0514,0x0515},{0x0514,0x0515}, /* 0514 */ + {0x0516,0x0517},{0x0516,0x0517}, /* 0516 */ + {0x0518,0x0519},{0x0518,0x0519}, /* 0518 */ + {0x051A,0x051B},{0x051A,0x051B}, /* 051A */ + {0x051C,0x051D},{0x051C,0x051D}, /* 051C */ + {0x051E,0x051F},{0x051E,0x051F}, /* 051E */ + {0x0520,0x0521},{0x0520,0x0521}, /* 0520 */ + {0x0522,0x0523},{0x0522,0x0523}, /* 0522 */ + {0x0524,0x0525},{0x0524,0x0525}, /* 0524 */ + {0x0526,0x0526},{0x0527,0x0527}, /* 0526 */ + {0x0528,0x0528},{0x0529,0x0529}, /* 0528 */ + {0x052A,0x052A},{0x052B,0x052B}, /* 052A */ + {0x052C,0x052C},{0x052D,0x052D}, /* 052C */ + {0x052E,0x052E},{0x052F,0x052F}, /* 052E */ + {0x0530,0x0530},{0x0531,0x0561}, /* 0530 */ + {0x0532,0x0562},{0x0533,0x0563}, /* 0532 */ + {0x0534,0x0564},{0x0535,0x0565}, /* 0534 */ + {0x0536,0x0566},{0x0537,0x0567}, /* 0536 */ + {0x0538,0x0568},{0x0539,0x0569}, /* 0538 */ + {0x053A,0x056A},{0x053B,0x056B}, /* 053A */ + {0x053C,0x056C},{0x053D,0x056D}, /* 053C */ + {0x053E,0x056E},{0x053F,0x056F}, /* 053E */ + {0x0540,0x0570},{0x0541,0x0571}, /* 0540 */ + {0x0542,0x0572},{0x0543,0x0573}, /* 0542 */ + {0x0544,0x0574},{0x0545,0x0575}, /* 0544 */ + {0x0546,0x0576},{0x0547,0x0577}, /* 0546 */ + {0x0548,0x0578},{0x0549,0x0579}, /* 0548 */ + {0x054A,0x057A},{0x054B,0x057B}, /* 054A */ + {0x054C,0x057C},{0x054D,0x057D}, /* 054C */ + {0x054E,0x057E},{0x054F,0x057F}, /* 054E */ + {0x0550,0x0580},{0x0551,0x0581}, /* 0550 */ + {0x0552,0x0582},{0x0553,0x0583}, /* 0552 */ + {0x0554,0x0584},{0x0555,0x0585}, /* 0554 */ + {0x0556,0x0586},{0x0557,0x0557}, /* 0556 */ + {0x0558,0x0558},{0x0559,0x0559}, /* 0558 */ + {0x055A,0x055A},{0x055B,0x055B}, /* 055A */ + {0x055C,0x055C},{0x055D,0x055D}, /* 055C */ + {0x055E,0x055E},{0x055F,0x055F}, /* 055E */ + {0x0560,0x0560},{0x0531,0x0561}, /* 0560 */ + {0x0532,0x0562},{0x0533,0x0563}, /* 0562 */ + {0x0534,0x0564},{0x0535,0x0565}, /* 0564 */ + {0x0536,0x0566},{0x0537,0x0567}, /* 0566 */ + {0x0538,0x0568},{0x0539,0x0569}, /* 0568 */ + {0x053A,0x056A},{0x053B,0x056B}, /* 056A */ + {0x053C,0x056C},{0x053D,0x056D}, /* 056C */ + {0x053E,0x056E},{0x053F,0x056F}, /* 056E */ + {0x0540,0x0570},{0x0541,0x0571}, /* 0570 */ + {0x0542,0x0572},{0x0543,0x0573}, /* 0572 */ + {0x0544,0x0574},{0x0545,0x0575}, /* 0574 */ + {0x0546,0x0576},{0x0547,0x0577}, /* 0576 */ + {0x0548,0x0578},{0x0549,0x0579}, /* 0578 */ + {0x054A,0x057A},{0x054B,0x057B}, /* 057A */ + {0x054C,0x057C},{0x054D,0x057D}, /* 057C */ + {0x054E,0x057E},{0x054F,0x057F}, /* 057E */ + {0x0550,0x0580},{0x0551,0x0581}, /* 0580 */ + {0x0552,0x0582},{0x0553,0x0583}, /* 0582 */ + {0x0554,0x0584},{0x0555,0x0585}, /* 0584 */ + {0x0556,0x0586},{0x0587,0x0587}, /* 0586 */ + {0x0588,0x0588},{0x0589,0x0589}, /* 0588 */ + {0x058A,0x058A},{0x058B,0x058B}, /* 058A */ + {0x058C,0x058C},{0x058D,0x058D}, /* 058C */ + {0x058E,0x058E},{0x058F,0x058F}, /* 058E */ + {0x0590,0x0590},{0x0591,0x0591}, /* 0590 */ + {0x0592,0x0592},{0x0593,0x0593}, /* 0592 */ + {0x0594,0x0594},{0x0595,0x0595}, /* 0594 */ + {0x0596,0x0596},{0x0597,0x0597}, /* 0596 */ + {0x0598,0x0598},{0x0599,0x0599}, /* 0598 */ + {0x059A,0x059A},{0x059B,0x059B}, /* 059A */ + {0x059C,0x059C},{0x059D,0x059D}, /* 059C */ + {0x059E,0x059E},{0x059F,0x059F}, /* 059E */ + {0x05A0,0x05A0},{0x05A1,0x05A1}, /* 05A0 */ + {0x05A2,0x05A2},{0x05A3,0x05A3}, /* 05A2 */ + {0x05A4,0x05A4},{0x05A5,0x05A5}, /* 05A4 */ + {0x05A6,0x05A6},{0x05A7,0x05A7}, /* 05A6 */ + {0x05A8,0x05A8},{0x05A9,0x05A9}, /* 05A8 */ + {0x05AA,0x05AA},{0x05AB,0x05AB}, /* 05AA */ + {0x05AC,0x05AC},{0x05AD,0x05AD}, /* 05AC */ + {0x05AE,0x05AE},{0x05AF,0x05AF}, /* 05AE */ + {0x05B0,0x05B0},{0x05B1,0x05B1}, /* 05B0 */ + {0x05B2,0x05B2},{0x05B3,0x05B3}, /* 05B2 */ + {0x05B4,0x05B4},{0x05B5,0x05B5}, /* 05B4 */ + {0x05B6,0x05B6},{0x05B7,0x05B7}, /* 05B6 */ + {0x05B8,0x05B8},{0x05B9,0x05B9}, /* 05B8 */ + {0x05BA,0x05BA},{0x05BB,0x05BB}, /* 05BA */ + {0x05BC,0x05BC},{0x05BD,0x05BD}, /* 05BC */ + {0x05BE,0x05BE},{0x05BF,0x05BF}, /* 05BE */ + {0x05C0,0x05C0},{0x05C1,0x05C1}, /* 05C0 */ + {0x05C2,0x05C2},{0x05C3,0x05C3}, /* 05C2 */ + {0x05C4,0x05C4},{0x05C5,0x05C5}, /* 05C4 */ + {0x05C6,0x05C6},{0x05C7,0x05C7}, /* 05C6 */ + {0x05C8,0x05C8},{0x05C9,0x05C9}, /* 05C8 */ + {0x05CA,0x05CA},{0x05CB,0x05CB}, /* 05CA */ + {0x05CC,0x05CC},{0x05CD,0x05CD}, /* 05CC */ + {0x05CE,0x05CE},{0x05CF,0x05CF}, /* 05CE */ + {0x05D0,0x05D0},{0x05D1,0x05D1}, /* 05D0 */ + {0x05D2,0x05D2},{0x05D3,0x05D3}, /* 05D2 */ + {0x05D4,0x05D4},{0x05D5,0x05D5}, /* 05D4 */ + {0x05D6,0x05D6},{0x05D7,0x05D7}, /* 05D6 */ + {0x05D8,0x05D8},{0x05D9,0x05D9}, /* 05D8 */ + {0x05DA,0x05DA},{0x05DB,0x05DB}, /* 05DA */ + {0x05DC,0x05DC},{0x05DD,0x05DD}, /* 05DC */ + {0x05DE,0x05DE},{0x05DF,0x05DF}, /* 05DE */ + {0x05E0,0x05E0},{0x05E1,0x05E1}, /* 05E0 */ + {0x05E2,0x05E2},{0x05E3,0x05E3}, /* 05E2 */ + {0x05E4,0x05E4},{0x05E5,0x05E5}, /* 05E4 */ + {0x05E6,0x05E6},{0x05E7,0x05E7}, /* 05E6 */ + {0x05E8,0x05E8},{0x05E9,0x05E9}, /* 05E8 */ + {0x05EA,0x05EA},{0x05EB,0x05EB}, /* 05EA */ + {0x05EC,0x05EC},{0x05ED,0x05ED}, /* 05EC */ + {0x05EE,0x05EE},{0x05EF,0x05EF}, /* 05EE */ + {0x05F0,0x05F0},{0x05F1,0x05F1}, /* 05F0 */ + {0x05F2,0x05F2},{0x05F3,0x05F3}, /* 05F2 */ + {0x05F4,0x05F4},{0x05F5,0x05F5}, /* 05F4 */ + {0x05F6,0x05F6},{0x05F7,0x05F7}, /* 05F6 */ + {0x05F8,0x05F8},{0x05F9,0x05F9}, /* 05F8 */ + {0x05FA,0x05FA},{0x05FB,0x05FB}, /* 05FA */ + {0x05FC,0x05FC},{0x05FD,0x05FD}, /* 05FC */ + {0x05FE,0x05FE},{0x05FF,0x05FF} /* 05FE */ +}; + +static const MY_CASEFOLD_CHARACTER u520_casefold_page06[256]={ /* This page is dummy */ + {0x0600,0x0600},{0x0601,0x0601}, /* 0600 */ + {0x0602,0x0602},{0x0603,0x0603}, /* 0602 */ + {0x0604,0x0604},{0x0605,0x0605}, /* 0604 */ + {0x0606,0x0606},{0x0607,0x0607}, /* 0606 */ + {0x0608,0x0608},{0x0609,0x0609}, /* 0608 */ + {0x060A,0x060A},{0x060B,0x060B}, /* 060A */ + {0x060C,0x060C},{0x060D,0x060D}, /* 060C */ + {0x060E,0x060E},{0x060F,0x060F}, /* 060E */ + {0x0610,0x0610},{0x0611,0x0611}, /* 0610 */ + {0x0612,0x0612},{0x0613,0x0613}, /* 0612 */ + {0x0614,0x0614},{0x0615,0x0615}, /* 0614 */ + {0x0616,0x0616},{0x0617,0x0617}, /* 0616 */ + {0x0618,0x0618},{0x0619,0x0619}, /* 0618 */ + {0x061A,0x061A},{0x061B,0x061B}, /* 061A */ + {0x061C,0x061C},{0x061D,0x061D}, /* 061C */ + {0x061E,0x061E},{0x061F,0x061F}, /* 061E */ + {0x0620,0x0620},{0x0621,0x0621}, /* 0620 */ + {0x0622,0x0622},{0x0623,0x0623}, /* 0622 */ + {0x0624,0x0624},{0x0625,0x0625}, /* 0624 */ + {0x0626,0x0626},{0x0627,0x0627}, /* 0626 */ + {0x0628,0x0628},{0x0629,0x0629}, /* 0628 */ + {0x062A,0x062A},{0x062B,0x062B}, /* 062A */ + {0x062C,0x062C},{0x062D,0x062D}, /* 062C */ + {0x062E,0x062E},{0x062F,0x062F}, /* 062E */ + {0x0630,0x0630},{0x0631,0x0631}, /* 0630 */ + {0x0632,0x0632},{0x0633,0x0633}, /* 0632 */ + {0x0634,0x0634},{0x0635,0x0635}, /* 0634 */ + {0x0636,0x0636},{0x0637,0x0637}, /* 0636 */ + {0x0638,0x0638},{0x0639,0x0639}, /* 0638 */ + {0x063A,0x063A},{0x063B,0x063B}, /* 063A */ + {0x063C,0x063C},{0x063D,0x063D}, /* 063C */ + {0x063E,0x063E},{0x063F,0x063F}, /* 063E */ + {0x0640,0x0640},{0x0641,0x0641}, /* 0640 */ + {0x0642,0x0642},{0x0643,0x0643}, /* 0642 */ + {0x0644,0x0644},{0x0645,0x0645}, /* 0644 */ + {0x0646,0x0646},{0x0647,0x0647}, /* 0646 */ + {0x0648,0x0648},{0x0649,0x0649}, /* 0648 */ + {0x064A,0x064A},{0x064B,0x064B}, /* 064A */ + {0x064C,0x064C},{0x064D,0x064D}, /* 064C */ + {0x064E,0x064E},{0x064F,0x064F}, /* 064E */ + {0x0650,0x0650},{0x0651,0x0651}, /* 0650 */ + {0x0652,0x0652},{0x0653,0x0653}, /* 0652 */ + {0x0654,0x0654},{0x0655,0x0655}, /* 0654 */ + {0x0656,0x0656},{0x0657,0x0657}, /* 0656 */ + {0x0658,0x0658},{0x0659,0x0659}, /* 0658 */ + {0x065A,0x065A},{0x065B,0x065B}, /* 065A */ + {0x065C,0x065C},{0x065D,0x065D}, /* 065C */ + {0x065E,0x065E},{0x065F,0x065F}, /* 065E */ + {0x0660,0x0660},{0x0661,0x0661}, /* 0660 */ + {0x0662,0x0662},{0x0663,0x0663}, /* 0662 */ + {0x0664,0x0664},{0x0665,0x0665}, /* 0664 */ + {0x0666,0x0666},{0x0667,0x0667}, /* 0666 */ + {0x0668,0x0668},{0x0669,0x0669}, /* 0668 */ + {0x066A,0x066A},{0x066B,0x066B}, /* 066A */ + {0x066C,0x066C},{0x066D,0x066D}, /* 066C */ + {0x066E,0x066E},{0x066F,0x066F}, /* 066E */ + {0x0670,0x0670},{0x0671,0x0671}, /* 0670 */ + {0x0672,0x0672},{0x0673,0x0673}, /* 0672 */ + {0x0674,0x0674},{0x0675,0x0675}, /* 0674 */ + {0x0676,0x0676},{0x0677,0x0677}, /* 0676 */ + {0x0678,0x0678},{0x0679,0x0679}, /* 0678 */ + {0x067A,0x067A},{0x067B,0x067B}, /* 067A */ + {0x067C,0x067C},{0x067D,0x067D}, /* 067C */ + {0x067E,0x067E},{0x067F,0x067F}, /* 067E */ + {0x0680,0x0680},{0x0681,0x0681}, /* 0680 */ + {0x0682,0x0682},{0x0683,0x0683}, /* 0682 */ + {0x0684,0x0684},{0x0685,0x0685}, /* 0684 */ + {0x0686,0x0686},{0x0687,0x0687}, /* 0686 */ + {0x0688,0x0688},{0x0689,0x0689}, /* 0688 */ + {0x068A,0x068A},{0x068B,0x068B}, /* 068A */ + {0x068C,0x068C},{0x068D,0x068D}, /* 068C */ + {0x068E,0x068E},{0x068F,0x068F}, /* 068E */ + {0x0690,0x0690},{0x0691,0x0691}, /* 0690 */ + {0x0692,0x0692},{0x0693,0x0693}, /* 0692 */ + {0x0694,0x0694},{0x0695,0x0695}, /* 0694 */ + {0x0696,0x0696},{0x0697,0x0697}, /* 0696 */ + {0x0698,0x0698},{0x0699,0x0699}, /* 0698 */ + {0x069A,0x069A},{0x069B,0x069B}, /* 069A */ + {0x069C,0x069C},{0x069D,0x069D}, /* 069C */ + {0x069E,0x069E},{0x069F,0x069F}, /* 069E */ + {0x06A0,0x06A0},{0x06A1,0x06A1}, /* 06A0 */ + {0x06A2,0x06A2},{0x06A3,0x06A3}, /* 06A2 */ + {0x06A4,0x06A4},{0x06A5,0x06A5}, /* 06A4 */ + {0x06A6,0x06A6},{0x06A7,0x06A7}, /* 06A6 */ + {0x06A8,0x06A8},{0x06A9,0x06A9}, /* 06A8 */ + {0x06AA,0x06AA},{0x06AB,0x06AB}, /* 06AA */ + {0x06AC,0x06AC},{0x06AD,0x06AD}, /* 06AC */ + {0x06AE,0x06AE},{0x06AF,0x06AF}, /* 06AE */ + {0x06B0,0x06B0},{0x06B1,0x06B1}, /* 06B0 */ + {0x06B2,0x06B2},{0x06B3,0x06B3}, /* 06B2 */ + {0x06B4,0x06B4},{0x06B5,0x06B5}, /* 06B4 */ + {0x06B6,0x06B6},{0x06B7,0x06B7}, /* 06B6 */ + {0x06B8,0x06B8},{0x06B9,0x06B9}, /* 06B8 */ + {0x06BA,0x06BA},{0x06BB,0x06BB}, /* 06BA */ + {0x06BC,0x06BC},{0x06BD,0x06BD}, /* 06BC */ + {0x06BE,0x06BE},{0x06BF,0x06BF}, /* 06BE */ + {0x06C0,0x06C0},{0x06C1,0x06C1}, /* 06C0 */ + {0x06C2,0x06C2},{0x06C3,0x06C3}, /* 06C2 */ + {0x06C4,0x06C4},{0x06C5,0x06C5}, /* 06C4 */ + {0x06C6,0x06C6},{0x06C7,0x06C7}, /* 06C6 */ + {0x06C8,0x06C8},{0x06C9,0x06C9}, /* 06C8 */ + {0x06CA,0x06CA},{0x06CB,0x06CB}, /* 06CA */ + {0x06CC,0x06CC},{0x06CD,0x06CD}, /* 06CC */ + {0x06CE,0x06CE},{0x06CF,0x06CF}, /* 06CE */ + {0x06D0,0x06D0},{0x06D1,0x06D1}, /* 06D0 */ + {0x06D2,0x06D2},{0x06D3,0x06D3}, /* 06D2 */ + {0x06D4,0x06D4},{0x06D5,0x06D5}, /* 06D4 */ + {0x06D6,0x06D6},{0x06D7,0x06D7}, /* 06D6 */ + {0x06D8,0x06D8},{0x06D9,0x06D9}, /* 06D8 */ + {0x06DA,0x06DA},{0x06DB,0x06DB}, /* 06DA */ + {0x06DC,0x06DC},{0x06DD,0x06DD}, /* 06DC */ + {0x06DE,0x06DE},{0x06DF,0x06DF}, /* 06DE */ + {0x06E0,0x06E0},{0x06E1,0x06E1}, /* 06E0 */ + {0x06E2,0x06E2},{0x06E3,0x06E3}, /* 06E2 */ + {0x06E4,0x06E4},{0x06E5,0x06E5}, /* 06E4 */ + {0x06E6,0x06E6},{0x06E7,0x06E7}, /* 06E6 */ + {0x06E8,0x06E8},{0x06E9,0x06E9}, /* 06E8 */ + {0x06EA,0x06EA},{0x06EB,0x06EB}, /* 06EA */ + {0x06EC,0x06EC},{0x06ED,0x06ED}, /* 06EC */ + {0x06EE,0x06EE},{0x06EF,0x06EF}, /* 06EE */ + {0x06F0,0x06F0},{0x06F1,0x06F1}, /* 06F0 */ + {0x06F2,0x06F2},{0x06F3,0x06F3}, /* 06F2 */ + {0x06F4,0x06F4},{0x06F5,0x06F5}, /* 06F4 */ + {0x06F6,0x06F6},{0x06F7,0x06F7}, /* 06F6 */ + {0x06F8,0x06F8},{0x06F9,0x06F9}, /* 06F8 */ + {0x06FA,0x06FA},{0x06FB,0x06FB}, /* 06FA */ + {0x06FC,0x06FC},{0x06FD,0x06FD}, /* 06FC */ + {0x06FE,0x06FE},{0x06FF,0x06FF} /* 06FE */ +}; + +static const MY_CASEFOLD_CHARACTER u520_casefold_page07[256]={ /* This page is dummy */ + {0x0700,0x0700},{0x0701,0x0701}, /* 0700 */ + {0x0702,0x0702},{0x0703,0x0703}, /* 0702 */ + {0x0704,0x0704},{0x0705,0x0705}, /* 0704 */ + {0x0706,0x0706},{0x0707,0x0707}, /* 0706 */ + {0x0708,0x0708},{0x0709,0x0709}, /* 0708 */ + {0x070A,0x070A},{0x070B,0x070B}, /* 070A */ + {0x070C,0x070C},{0x070D,0x070D}, /* 070C */ + {0x070E,0x070E},{0x070F,0x070F}, /* 070E */ + {0x0710,0x0710},{0x0711,0x0711}, /* 0710 */ + {0x0712,0x0712},{0x0713,0x0713}, /* 0712 */ + {0x0714,0x0714},{0x0715,0x0715}, /* 0714 */ + {0x0716,0x0716},{0x0717,0x0717}, /* 0716 */ + {0x0718,0x0718},{0x0719,0x0719}, /* 0718 */ + {0x071A,0x071A},{0x071B,0x071B}, /* 071A */ + {0x071C,0x071C},{0x071D,0x071D}, /* 071C */ + {0x071E,0x071E},{0x071F,0x071F}, /* 071E */ + {0x0720,0x0720},{0x0721,0x0721}, /* 0720 */ + {0x0722,0x0722},{0x0723,0x0723}, /* 0722 */ + {0x0724,0x0724},{0x0725,0x0725}, /* 0724 */ + {0x0726,0x0726},{0x0727,0x0727}, /* 0726 */ + {0x0728,0x0728},{0x0729,0x0729}, /* 0728 */ + {0x072A,0x072A},{0x072B,0x072B}, /* 072A */ + {0x072C,0x072C},{0x072D,0x072D}, /* 072C */ + {0x072E,0x072E},{0x072F,0x072F}, /* 072E */ + {0x0730,0x0730},{0x0731,0x0731}, /* 0730 */ + {0x0732,0x0732},{0x0733,0x0733}, /* 0732 */ + {0x0734,0x0734},{0x0735,0x0735}, /* 0734 */ + {0x0736,0x0736},{0x0737,0x0737}, /* 0736 */ + {0x0738,0x0738},{0x0739,0x0739}, /* 0738 */ + {0x073A,0x073A},{0x073B,0x073B}, /* 073A */ + {0x073C,0x073C},{0x073D,0x073D}, /* 073C */ + {0x073E,0x073E},{0x073F,0x073F}, /* 073E */ + {0x0740,0x0740},{0x0741,0x0741}, /* 0740 */ + {0x0742,0x0742},{0x0743,0x0743}, /* 0742 */ + {0x0744,0x0744},{0x0745,0x0745}, /* 0744 */ + {0x0746,0x0746},{0x0747,0x0747}, /* 0746 */ + {0x0748,0x0748},{0x0749,0x0749}, /* 0748 */ + {0x074A,0x074A},{0x074B,0x074B}, /* 074A */ + {0x074C,0x074C},{0x074D,0x074D}, /* 074C */ + {0x074E,0x074E},{0x074F,0x074F}, /* 074E */ + {0x0750,0x0750},{0x0751,0x0751}, /* 0750 */ + {0x0752,0x0752},{0x0753,0x0753}, /* 0752 */ + {0x0754,0x0754},{0x0755,0x0755}, /* 0754 */ + {0x0756,0x0756},{0x0757,0x0757}, /* 0756 */ + {0x0758,0x0758},{0x0759,0x0759}, /* 0758 */ + {0x075A,0x075A},{0x075B,0x075B}, /* 075A */ + {0x075C,0x075C},{0x075D,0x075D}, /* 075C */ + {0x075E,0x075E},{0x075F,0x075F}, /* 075E */ + {0x0760,0x0760},{0x0761,0x0761}, /* 0760 */ + {0x0762,0x0762},{0x0763,0x0763}, /* 0762 */ + {0x0764,0x0764},{0x0765,0x0765}, /* 0764 */ + {0x0766,0x0766},{0x0767,0x0767}, /* 0766 */ + {0x0768,0x0768},{0x0769,0x0769}, /* 0768 */ + {0x076A,0x076A},{0x076B,0x076B}, /* 076A */ + {0x076C,0x076C},{0x076D,0x076D}, /* 076C */ + {0x076E,0x076E},{0x076F,0x076F}, /* 076E */ + {0x0770,0x0770},{0x0771,0x0771}, /* 0770 */ + {0x0772,0x0772},{0x0773,0x0773}, /* 0772 */ + {0x0774,0x0774},{0x0775,0x0775}, /* 0774 */ + {0x0776,0x0776},{0x0777,0x0777}, /* 0776 */ + {0x0778,0x0778},{0x0779,0x0779}, /* 0778 */ + {0x077A,0x077A},{0x077B,0x077B}, /* 077A */ + {0x077C,0x077C},{0x077D,0x077D}, /* 077C */ + {0x077E,0x077E},{0x077F,0x077F}, /* 077E */ + {0x0780,0x0780},{0x0781,0x0781}, /* 0780 */ + {0x0782,0x0782},{0x0783,0x0783}, /* 0782 */ + {0x0784,0x0784},{0x0785,0x0785}, /* 0784 */ + {0x0786,0x0786},{0x0787,0x0787}, /* 0786 */ + {0x0788,0x0788},{0x0789,0x0789}, /* 0788 */ + {0x078A,0x078A},{0x078B,0x078B}, /* 078A */ + {0x078C,0x078C},{0x078D,0x078D}, /* 078C */ + {0x078E,0x078E},{0x078F,0x078F}, /* 078E */ + {0x0790,0x0790},{0x0791,0x0791}, /* 0790 */ + {0x0792,0x0792},{0x0793,0x0793}, /* 0792 */ + {0x0794,0x0794},{0x0795,0x0795}, /* 0794 */ + {0x0796,0x0796},{0x0797,0x0797}, /* 0796 */ + {0x0798,0x0798},{0x0799,0x0799}, /* 0798 */ + {0x079A,0x079A},{0x079B,0x079B}, /* 079A */ + {0x079C,0x079C},{0x079D,0x079D}, /* 079C */ + {0x079E,0x079E},{0x079F,0x079F}, /* 079E */ + {0x07A0,0x07A0},{0x07A1,0x07A1}, /* 07A0 */ + {0x07A2,0x07A2},{0x07A3,0x07A3}, /* 07A2 */ + {0x07A4,0x07A4},{0x07A5,0x07A5}, /* 07A4 */ + {0x07A6,0x07A6},{0x07A7,0x07A7}, /* 07A6 */ + {0x07A8,0x07A8},{0x07A9,0x07A9}, /* 07A8 */ + {0x07AA,0x07AA},{0x07AB,0x07AB}, /* 07AA */ + {0x07AC,0x07AC},{0x07AD,0x07AD}, /* 07AC */ + {0x07AE,0x07AE},{0x07AF,0x07AF}, /* 07AE */ + {0x07B0,0x07B0},{0x07B1,0x07B1}, /* 07B0 */ + {0x07B2,0x07B2},{0x07B3,0x07B3}, /* 07B2 */ + {0x07B4,0x07B4},{0x07B5,0x07B5}, /* 07B4 */ + {0x07B6,0x07B6},{0x07B7,0x07B7}, /* 07B6 */ + {0x07B8,0x07B8},{0x07B9,0x07B9}, /* 07B8 */ + {0x07BA,0x07BA},{0x07BB,0x07BB}, /* 07BA */ + {0x07BC,0x07BC},{0x07BD,0x07BD}, /* 07BC */ + {0x07BE,0x07BE},{0x07BF,0x07BF}, /* 07BE */ + {0x07C0,0x07C0},{0x07C1,0x07C1}, /* 07C0 */ + {0x07C2,0x07C2},{0x07C3,0x07C3}, /* 07C2 */ + {0x07C4,0x07C4},{0x07C5,0x07C5}, /* 07C4 */ + {0x07C6,0x07C6},{0x07C7,0x07C7}, /* 07C6 */ + {0x07C8,0x07C8},{0x07C9,0x07C9}, /* 07C8 */ + {0x07CA,0x07CA},{0x07CB,0x07CB}, /* 07CA */ + {0x07CC,0x07CC},{0x07CD,0x07CD}, /* 07CC */ + {0x07CE,0x07CE},{0x07CF,0x07CF}, /* 07CE */ + {0x07D0,0x07D0},{0x07D1,0x07D1}, /* 07D0 */ + {0x07D2,0x07D2},{0x07D3,0x07D3}, /* 07D2 */ + {0x07D4,0x07D4},{0x07D5,0x07D5}, /* 07D4 */ + {0x07D6,0x07D6},{0x07D7,0x07D7}, /* 07D6 */ + {0x07D8,0x07D8},{0x07D9,0x07D9}, /* 07D8 */ + {0x07DA,0x07DA},{0x07DB,0x07DB}, /* 07DA */ + {0x07DC,0x07DC},{0x07DD,0x07DD}, /* 07DC */ + {0x07DE,0x07DE},{0x07DF,0x07DF}, /* 07DE */ + {0x07E0,0x07E0},{0x07E1,0x07E1}, /* 07E0 */ + {0x07E2,0x07E2},{0x07E3,0x07E3}, /* 07E2 */ + {0x07E4,0x07E4},{0x07E5,0x07E5}, /* 07E4 */ + {0x07E6,0x07E6},{0x07E7,0x07E7}, /* 07E6 */ + {0x07E8,0x07E8},{0x07E9,0x07E9}, /* 07E8 */ + {0x07EA,0x07EA},{0x07EB,0x07EB}, /* 07EA */ + {0x07EC,0x07EC},{0x07ED,0x07ED}, /* 07EC */ + {0x07EE,0x07EE},{0x07EF,0x07EF}, /* 07EE */ + {0x07F0,0x07F0},{0x07F1,0x07F1}, /* 07F0 */ + {0x07F2,0x07F2},{0x07F3,0x07F3}, /* 07F2 */ + {0x07F4,0x07F4},{0x07F5,0x07F5}, /* 07F4 */ + {0x07F6,0x07F6},{0x07F7,0x07F7}, /* 07F6 */ + {0x07F8,0x07F8},{0x07F9,0x07F9}, /* 07F8 */ + {0x07FA,0x07FA},{0x07FB,0x07FB}, /* 07FA */ + {0x07FC,0x07FC},{0x07FD,0x07FD}, /* 07FC */ + {0x07FE,0x07FE},{0x07FF,0x07FF} /* 07FE */ +}; + +static const MY_CASEFOLD_CHARACTER u520_casefold_page10[256]={ + {0x1000,0x1000},{0x1001,0x1001}, /* 1000 */ + {0x1002,0x1002},{0x1003,0x1003}, /* 1002 */ + {0x1004,0x1004},{0x1005,0x1005}, /* 1004 */ + {0x1006,0x1006},{0x1007,0x1007}, /* 1006 */ + {0x1008,0x1008},{0x1009,0x1009}, /* 1008 */ + {0x100A,0x100A},{0x100B,0x100B}, /* 100A */ + {0x100C,0x100C},{0x100D,0x100D}, /* 100C */ + {0x100E,0x100E},{0x100F,0x100F}, /* 100E */ + {0x1010,0x1010},{0x1011,0x1011}, /* 1010 */ + {0x1012,0x1012},{0x1013,0x1013}, /* 1012 */ + {0x1014,0x1014},{0x1015,0x1015}, /* 1014 */ + {0x1016,0x1016},{0x1017,0x1017}, /* 1016 */ + {0x1018,0x1018},{0x1019,0x1019}, /* 1018 */ + {0x101A,0x101A},{0x101B,0x101B}, /* 101A */ + {0x101C,0x101C},{0x101D,0x101D}, /* 101C */ + {0x101E,0x101E},{0x101F,0x101F}, /* 101E */ + {0x1020,0x1020},{0x1021,0x1021}, /* 1020 */ + {0x1022,0x1022},{0x1023,0x1023}, /* 1022 */ + {0x1024,0x1024},{0x1025,0x1025}, /* 1024 */ + {0x1026,0x1026},{0x1027,0x1027}, /* 1026 */ + {0x1028,0x1028},{0x1029,0x1029}, /* 1028 */ + {0x102A,0x102A},{0x102B,0x102B}, /* 102A */ + {0x102C,0x102C},{0x102D,0x102D}, /* 102C */ + {0x102E,0x102E},{0x102F,0x102F}, /* 102E */ + {0x1030,0x1030},{0x1031,0x1031}, /* 1030 */ + {0x1032,0x1032},{0x1033,0x1033}, /* 1032 */ + {0x1034,0x1034},{0x1035,0x1035}, /* 1034 */ + {0x1036,0x1036},{0x1037,0x1037}, /* 1036 */ + {0x1038,0x1038},{0x1039,0x1039}, /* 1038 */ + {0x103A,0x103A},{0x103B,0x103B}, /* 103A */ + {0x103C,0x103C},{0x103D,0x103D}, /* 103C */ + {0x103E,0x103E},{0x103F,0x103F}, /* 103E */ + {0x1040,0x1040},{0x1041,0x1041}, /* 1040 */ + {0x1042,0x1042},{0x1043,0x1043}, /* 1042 */ + {0x1044,0x1044},{0x1045,0x1045}, /* 1044 */ + {0x1046,0x1046},{0x1047,0x1047}, /* 1046 */ + {0x1048,0x1048},{0x1049,0x1049}, /* 1048 */ + {0x104A,0x104A},{0x104B,0x104B}, /* 104A */ + {0x104C,0x104C},{0x104D,0x104D}, /* 104C */ + {0x104E,0x104E},{0x104F,0x104F}, /* 104E */ + {0x1050,0x1050},{0x1051,0x1051}, /* 1050 */ + {0x1052,0x1052},{0x1053,0x1053}, /* 1052 */ + {0x1054,0x1054},{0x1055,0x1055}, /* 1054 */ + {0x1056,0x1056},{0x1057,0x1057}, /* 1056 */ + {0x1058,0x1058},{0x1059,0x1059}, /* 1058 */ + {0x105A,0x105A},{0x105B,0x105B}, /* 105A */ + {0x105C,0x105C},{0x105D,0x105D}, /* 105C */ + {0x105E,0x105E},{0x105F,0x105F}, /* 105E */ + {0x1060,0x1060},{0x1061,0x1061}, /* 1060 */ + {0x1062,0x1062},{0x1063,0x1063}, /* 1062 */ + {0x1064,0x1064},{0x1065,0x1065}, /* 1064 */ + {0x1066,0x1066},{0x1067,0x1067}, /* 1066 */ + {0x1068,0x1068},{0x1069,0x1069}, /* 1068 */ + {0x106A,0x106A},{0x106B,0x106B}, /* 106A */ + {0x106C,0x106C},{0x106D,0x106D}, /* 106C */ + {0x106E,0x106E},{0x106F,0x106F}, /* 106E */ + {0x1070,0x1070},{0x1071,0x1071}, /* 1070 */ + {0x1072,0x1072},{0x1073,0x1073}, /* 1072 */ + {0x1074,0x1074},{0x1075,0x1075}, /* 1074 */ + {0x1076,0x1076},{0x1077,0x1077}, /* 1076 */ + {0x1078,0x1078},{0x1079,0x1079}, /* 1078 */ + {0x107A,0x107A},{0x107B,0x107B}, /* 107A */ + {0x107C,0x107C},{0x107D,0x107D}, /* 107C */ + {0x107E,0x107E},{0x107F,0x107F}, /* 107E */ + {0x1080,0x1080},{0x1081,0x1081}, /* 1080 */ + {0x1082,0x1082},{0x1083,0x1083}, /* 1082 */ + {0x1084,0x1084},{0x1085,0x1085}, /* 1084 */ + {0x1086,0x1086},{0x1087,0x1087}, /* 1086 */ + {0x1088,0x1088},{0x1089,0x1089}, /* 1088 */ + {0x108A,0x108A},{0x108B,0x108B}, /* 108A */ + {0x108C,0x108C},{0x108D,0x108D}, /* 108C */ + {0x108E,0x108E},{0x108F,0x108F}, /* 108E */ + {0x1090,0x1090},{0x1091,0x1091}, /* 1090 */ + {0x1092,0x1092},{0x1093,0x1093}, /* 1092 */ + {0x1094,0x1094},{0x1095,0x1095}, /* 1094 */ + {0x1096,0x1096},{0x1097,0x1097}, /* 1096 */ + {0x1098,0x1098},{0x1099,0x1099}, /* 1098 */ + {0x109A,0x109A},{0x109B,0x109B}, /* 109A */ + {0x109C,0x109C},{0x109D,0x109D}, /* 109C */ + {0x109E,0x109E},{0x109F,0x109F}, /* 109E */ + {0x10A0,0x2D00},{0x10A1,0x2D01}, /* 10A0 */ + {0x10A2,0x2D02},{0x10A3,0x2D03}, /* 10A2 */ + {0x10A4,0x2D04},{0x10A5,0x2D05}, /* 10A4 */ + {0x10A6,0x2D06},{0x10A7,0x2D07}, /* 10A6 */ + {0x10A8,0x2D08},{0x10A9,0x2D09}, /* 10A8 */ + {0x10AA,0x2D0A},{0x10AB,0x2D0B}, /* 10AA */ + {0x10AC,0x2D0C},{0x10AD,0x2D0D}, /* 10AC */ + {0x10AE,0x2D0E},{0x10AF,0x2D0F}, /* 10AE */ + {0x10B0,0x2D10},{0x10B1,0x2D11}, /* 10B0 */ + {0x10B2,0x2D12},{0x10B3,0x2D13}, /* 10B2 */ + {0x10B4,0x2D14},{0x10B5,0x2D15}, /* 10B4 */ + {0x10B6,0x2D16},{0x10B7,0x2D17}, /* 10B6 */ + {0x10B8,0x2D18},{0x10B9,0x2D19}, /* 10B8 */ + {0x10BA,0x2D1A},{0x10BB,0x2D1B}, /* 10BA */ + {0x10BC,0x2D1C},{0x10BD,0x2D1D}, /* 10BC */ + {0x10BE,0x2D1E},{0x10BF,0x2D1F}, /* 10BE */ + {0x10C0,0x2D20},{0x10C1,0x2D21}, /* 10C0 */ + {0x10C2,0x2D22},{0x10C3,0x2D23}, /* 10C2 */ + {0x10C4,0x2D24},{0x10C5,0x2D25}, /* 10C4 */ + {0x10C6,0x10C6},{0x10C7,0x10C7}, /* 10C6 */ + {0x10C8,0x10C8},{0x10C9,0x10C9}, /* 10C8 */ + {0x10CA,0x10CA},{0x10CB,0x10CB}, /* 10CA */ + {0x10CC,0x10CC},{0x10CD,0x10CD}, /* 10CC */ + {0x10CE,0x10CE},{0x10CF,0x10CF}, /* 10CE */ + {0x10D0,0x10D0},{0x10D1,0x10D1}, /* 10D0 */ + {0x10D2,0x10D2},{0x10D3,0x10D3}, /* 10D2 */ + {0x10D4,0x10D4},{0x10D5,0x10D5}, /* 10D4 */ + {0x10D6,0x10D6},{0x10D7,0x10D7}, /* 10D6 */ + {0x10D8,0x10D8},{0x10D9,0x10D9}, /* 10D8 */ + {0x10DA,0x10DA},{0x10DB,0x10DB}, /* 10DA */ + {0x10DC,0x10DC},{0x10DD,0x10DD}, /* 10DC */ + {0x10DE,0x10DE},{0x10DF,0x10DF}, /* 10DE */ + {0x10E0,0x10E0},{0x10E1,0x10E1}, /* 10E0 */ + {0x10E2,0x10E2},{0x10E3,0x10E3}, /* 10E2 */ + {0x10E4,0x10E4},{0x10E5,0x10E5}, /* 10E4 */ + {0x10E6,0x10E6},{0x10E7,0x10E7}, /* 10E6 */ + {0x10E8,0x10E8},{0x10E9,0x10E9}, /* 10E8 */ + {0x10EA,0x10EA},{0x10EB,0x10EB}, /* 10EA */ + {0x10EC,0x10EC},{0x10ED,0x10ED}, /* 10EC */ + {0x10EE,0x10EE},{0x10EF,0x10EF}, /* 10EE */ + {0x10F0,0x10F0},{0x10F1,0x10F1}, /* 10F0 */ + {0x10F2,0x10F2},{0x10F3,0x10F3}, /* 10F2 */ + {0x10F4,0x10F4},{0x10F5,0x10F5}, /* 10F4 */ + {0x10F6,0x10F6},{0x10F7,0x10F7}, /* 10F6 */ + {0x10F8,0x10F8},{0x10F9,0x10F9}, /* 10F8 */ + {0x10FA,0x10FA},{0x10FB,0x10FB}, /* 10FA */ + {0x10FC,0x10FC},{0x10FD,0x10FD}, /* 10FC */ + {0x10FE,0x10FE},{0x10FF,0x10FF} /* 10FE */ +}; + +static const MY_CASEFOLD_CHARACTER u520_casefold_page1D[256]={ + {0x1D00,0x1D00},{0x1D01,0x1D01}, /* 1D00 */ + {0x1D02,0x1D02},{0x1D03,0x1D03}, /* 1D02 */ + {0x1D04,0x1D04},{0x1D05,0x1D05}, /* 1D04 */ + {0x1D06,0x1D06},{0x1D07,0x1D07}, /* 1D06 */ + {0x1D08,0x1D08},{0x1D09,0x1D09}, /* 1D08 */ + {0x1D0A,0x1D0A},{0x1D0B,0x1D0B}, /* 1D0A */ + {0x1D0C,0x1D0C},{0x1D0D,0x1D0D}, /* 1D0C */ + {0x1D0E,0x1D0E},{0x1D0F,0x1D0F}, /* 1D0E */ + {0x1D10,0x1D10},{0x1D11,0x1D11}, /* 1D10 */ + {0x1D12,0x1D12},{0x1D13,0x1D13}, /* 1D12 */ + {0x1D14,0x1D14},{0x1D15,0x1D15}, /* 1D14 */ + {0x1D16,0x1D16},{0x1D17,0x1D17}, /* 1D16 */ + {0x1D18,0x1D18},{0x1D19,0x1D19}, /* 1D18 */ + {0x1D1A,0x1D1A},{0x1D1B,0x1D1B}, /* 1D1A */ + {0x1D1C,0x1D1C},{0x1D1D,0x1D1D}, /* 1D1C */ + {0x1D1E,0x1D1E},{0x1D1F,0x1D1F}, /* 1D1E */ + {0x1D20,0x1D20},{0x1D21,0x1D21}, /* 1D20 */ + {0x1D22,0x1D22},{0x1D23,0x1D23}, /* 1D22 */ + {0x1D24,0x1D24},{0x1D25,0x1D25}, /* 1D24 */ + {0x1D26,0x1D26},{0x1D27,0x1D27}, /* 1D26 */ + {0x1D28,0x1D28},{0x1D29,0x1D29}, /* 1D28 */ + {0x1D2A,0x1D2A},{0x1D2B,0x1D2B}, /* 1D2A */ + {0x1D2C,0x1D2C},{0x1D2D,0x1D2D}, /* 1D2C */ + {0x1D2E,0x1D2E},{0x1D2F,0x1D2F}, /* 1D2E */ + {0x1D30,0x1D30},{0x1D31,0x1D31}, /* 1D30 */ + {0x1D32,0x1D32},{0x1D33,0x1D33}, /* 1D32 */ + {0x1D34,0x1D34},{0x1D35,0x1D35}, /* 1D34 */ + {0x1D36,0x1D36},{0x1D37,0x1D37}, /* 1D36 */ + {0x1D38,0x1D38},{0x1D39,0x1D39}, /* 1D38 */ + {0x1D3A,0x1D3A},{0x1D3B,0x1D3B}, /* 1D3A */ + {0x1D3C,0x1D3C},{0x1D3D,0x1D3D}, /* 1D3C */ + {0x1D3E,0x1D3E},{0x1D3F,0x1D3F}, /* 1D3E */ + {0x1D40,0x1D40},{0x1D41,0x1D41}, /* 1D40 */ + {0x1D42,0x1D42},{0x1D43,0x1D43}, /* 1D42 */ + {0x1D44,0x1D44},{0x1D45,0x1D45}, /* 1D44 */ + {0x1D46,0x1D46},{0x1D47,0x1D47}, /* 1D46 */ + {0x1D48,0x1D48},{0x1D49,0x1D49}, /* 1D48 */ + {0x1D4A,0x1D4A},{0x1D4B,0x1D4B}, /* 1D4A */ + {0x1D4C,0x1D4C},{0x1D4D,0x1D4D}, /* 1D4C */ + {0x1D4E,0x1D4E},{0x1D4F,0x1D4F}, /* 1D4E */ + {0x1D50,0x1D50},{0x1D51,0x1D51}, /* 1D50 */ + {0x1D52,0x1D52},{0x1D53,0x1D53}, /* 1D52 */ + {0x1D54,0x1D54},{0x1D55,0x1D55}, /* 1D54 */ + {0x1D56,0x1D56},{0x1D57,0x1D57}, /* 1D56 */ + {0x1D58,0x1D58},{0x1D59,0x1D59}, /* 1D58 */ + {0x1D5A,0x1D5A},{0x1D5B,0x1D5B}, /* 1D5A */ + {0x1D5C,0x1D5C},{0x1D5D,0x1D5D}, /* 1D5C */ + {0x1D5E,0x1D5E},{0x1D5F,0x1D5F}, /* 1D5E */ + {0x1D60,0x1D60},{0x1D61,0x1D61}, /* 1D60 */ + {0x1D62,0x1D62},{0x1D63,0x1D63}, /* 1D62 */ + {0x1D64,0x1D64},{0x1D65,0x1D65}, /* 1D64 */ + {0x1D66,0x1D66},{0x1D67,0x1D67}, /* 1D66 */ + {0x1D68,0x1D68},{0x1D69,0x1D69}, /* 1D68 */ + {0x1D6A,0x1D6A},{0x1D6B,0x1D6B}, /* 1D6A */ + {0x1D6C,0x1D6C},{0x1D6D,0x1D6D}, /* 1D6C */ + {0x1D6E,0x1D6E},{0x1D6F,0x1D6F}, /* 1D6E */ + {0x1D70,0x1D70},{0x1D71,0x1D71}, /* 1D70 */ + {0x1D72,0x1D72},{0x1D73,0x1D73}, /* 1D72 */ + {0x1D74,0x1D74},{0x1D75,0x1D75}, /* 1D74 */ + {0x1D76,0x1D76},{0x1D77,0x1D77}, /* 1D76 */ + {0x1D78,0x1D78},{0xA77D,0x1D79}, /* 1D78 */ + {0x1D7A,0x1D7A},{0x1D7B,0x1D7B}, /* 1D7A */ + {0x1D7C,0x1D7C},{0x2C63,0x1D7D}, /* 1D7C */ + {0x1D7E,0x1D7E},{0x1D7F,0x1D7F}, /* 1D7E */ + {0x1D80,0x1D80},{0x1D81,0x1D81}, /* 1D80 */ + {0x1D82,0x1D82},{0x1D83,0x1D83}, /* 1D82 */ + {0x1D84,0x1D84},{0x1D85,0x1D85}, /* 1D84 */ + {0x1D86,0x1D86},{0x1D87,0x1D87}, /* 1D86 */ + {0x1D88,0x1D88},{0x1D89,0x1D89}, /* 1D88 */ + {0x1D8A,0x1D8A},{0x1D8B,0x1D8B}, /* 1D8A */ + {0x1D8C,0x1D8C},{0x1D8D,0x1D8D}, /* 1D8C */ + {0x1D8E,0x1D8E},{0x1D8F,0x1D8F}, /* 1D8E */ + {0x1D90,0x1D90},{0x1D91,0x1D91}, /* 1D90 */ + {0x1D92,0x1D92},{0x1D93,0x1D93}, /* 1D92 */ + {0x1D94,0x1D94},{0x1D95,0x1D95}, /* 1D94 */ + {0x1D96,0x1D96},{0x1D97,0x1D97}, /* 1D96 */ + {0x1D98,0x1D98},{0x1D99,0x1D99}, /* 1D98 */ + {0x1D9A,0x1D9A},{0x1D9B,0x1D9B}, /* 1D9A */ + {0x1D9C,0x1D9C},{0x1D9D,0x1D9D}, /* 1D9C */ + {0x1D9E,0x1D9E},{0x1D9F,0x1D9F}, /* 1D9E */ + {0x1DA0,0x1DA0},{0x1DA1,0x1DA1}, /* 1DA0 */ + {0x1DA2,0x1DA2},{0x1DA3,0x1DA3}, /* 1DA2 */ + {0x1DA4,0x1DA4},{0x1DA5,0x1DA5}, /* 1DA4 */ + {0x1DA6,0x1DA6},{0x1DA7,0x1DA7}, /* 1DA6 */ + {0x1DA8,0x1DA8},{0x1DA9,0x1DA9}, /* 1DA8 */ + {0x1DAA,0x1DAA},{0x1DAB,0x1DAB}, /* 1DAA */ + {0x1DAC,0x1DAC},{0x1DAD,0x1DAD}, /* 1DAC */ + {0x1DAE,0x1DAE},{0x1DAF,0x1DAF}, /* 1DAE */ + {0x1DB0,0x1DB0},{0x1DB1,0x1DB1}, /* 1DB0 */ + {0x1DB2,0x1DB2},{0x1DB3,0x1DB3}, /* 1DB2 */ + {0x1DB4,0x1DB4},{0x1DB5,0x1DB5}, /* 1DB4 */ + {0x1DB6,0x1DB6},{0x1DB7,0x1DB7}, /* 1DB6 */ + {0x1DB8,0x1DB8},{0x1DB9,0x1DB9}, /* 1DB8 */ + {0x1DBA,0x1DBA},{0x1DBB,0x1DBB}, /* 1DBA */ + {0x1DBC,0x1DBC},{0x1DBD,0x1DBD}, /* 1DBC */ + {0x1DBE,0x1DBE},{0x1DBF,0x1DBF}, /* 1DBE */ + {0x1DC0,0x1DC0},{0x1DC1,0x1DC1}, /* 1DC0 */ + {0x1DC2,0x1DC2},{0x1DC3,0x1DC3}, /* 1DC2 */ + {0x1DC4,0x1DC4},{0x1DC5,0x1DC5}, /* 1DC4 */ + {0x1DC6,0x1DC6},{0x1DC7,0x1DC7}, /* 1DC6 */ + {0x1DC8,0x1DC8},{0x1DC9,0x1DC9}, /* 1DC8 */ + {0x1DCA,0x1DCA},{0x1DCB,0x1DCB}, /* 1DCA */ + {0x1DCC,0x1DCC},{0x1DCD,0x1DCD}, /* 1DCC */ + {0x1DCE,0x1DCE},{0x1DCF,0x1DCF}, /* 1DCE */ + {0x1DD0,0x1DD0},{0x1DD1,0x1DD1}, /* 1DD0 */ + {0x1DD2,0x1DD2},{0x1DD3,0x1DD3}, /* 1DD2 */ + {0x1DD4,0x1DD4},{0x1DD5,0x1DD5}, /* 1DD4 */ + {0x1DD6,0x1DD6},{0x1DD7,0x1DD7}, /* 1DD6 */ + {0x1DD8,0x1DD8},{0x1DD9,0x1DD9}, /* 1DD8 */ + {0x1DDA,0x1DDA},{0x1DDB,0x1DDB}, /* 1DDA */ + {0x1DDC,0x1DDC},{0x1DDD,0x1DDD}, /* 1DDC */ + {0x1DDE,0x1DDE},{0x1DDF,0x1DDF}, /* 1DDE */ + {0x1DE0,0x1DE0},{0x1DE1,0x1DE1}, /* 1DE0 */ + {0x1DE2,0x1DE2},{0x1DE3,0x1DE3}, /* 1DE2 */ + {0x1DE4,0x1DE4},{0x1DE5,0x1DE5}, /* 1DE4 */ + {0x1DE6,0x1DE6},{0x1DE7,0x1DE7}, /* 1DE6 */ + {0x1DE8,0x1DE8},{0x1DE9,0x1DE9}, /* 1DE8 */ + {0x1DEA,0x1DEA},{0x1DEB,0x1DEB}, /* 1DEA */ + {0x1DEC,0x1DEC},{0x1DED,0x1DED}, /* 1DEC */ + {0x1DEE,0x1DEE},{0x1DEF,0x1DEF}, /* 1DEE */ + {0x1DF0,0x1DF0},{0x1DF1,0x1DF1}, /* 1DF0 */ + {0x1DF2,0x1DF2},{0x1DF3,0x1DF3}, /* 1DF2 */ + {0x1DF4,0x1DF4},{0x1DF5,0x1DF5}, /* 1DF4 */ + {0x1DF6,0x1DF6},{0x1DF7,0x1DF7}, /* 1DF6 */ + {0x1DF8,0x1DF8},{0x1DF9,0x1DF9}, /* 1DF8 */ + {0x1DFA,0x1DFA},{0x1DFB,0x1DFB}, /* 1DFA */ + {0x1DFC,0x1DFC},{0x1DFD,0x1DFD}, /* 1DFC */ + {0x1DFE,0x1DFE},{0x1DFF,0x1DFF} /* 1DFE */ +}; + +static const MY_CASEFOLD_CHARACTER u520_casefold_page1E[256]={ + {0x1E00,0x1E01},{0x1E00,0x1E01}, /* 1E00 */ + {0x1E02,0x1E03},{0x1E02,0x1E03}, /* 1E02 */ + {0x1E04,0x1E05},{0x1E04,0x1E05}, /* 1E04 */ + {0x1E06,0x1E07},{0x1E06,0x1E07}, /* 1E06 */ + {0x1E08,0x1E09},{0x1E08,0x1E09}, /* 1E08 */ + {0x1E0A,0x1E0B},{0x1E0A,0x1E0B}, /* 1E0A */ + {0x1E0C,0x1E0D},{0x1E0C,0x1E0D}, /* 1E0C */ + {0x1E0E,0x1E0F},{0x1E0E,0x1E0F}, /* 1E0E */ + {0x1E10,0x1E11},{0x1E10,0x1E11}, /* 1E10 */ + {0x1E12,0x1E13},{0x1E12,0x1E13}, /* 1E12 */ + {0x1E14,0x1E15},{0x1E14,0x1E15}, /* 1E14 */ + {0x1E16,0x1E17},{0x1E16,0x1E17}, /* 1E16 */ + {0x1E18,0x1E19},{0x1E18,0x1E19}, /* 1E18 */ + {0x1E1A,0x1E1B},{0x1E1A,0x1E1B}, /* 1E1A */ + {0x1E1C,0x1E1D},{0x1E1C,0x1E1D}, /* 1E1C */ + {0x1E1E,0x1E1F},{0x1E1E,0x1E1F}, /* 1E1E */ + {0x1E20,0x1E21},{0x1E20,0x1E21}, /* 1E20 */ + {0x1E22,0x1E23},{0x1E22,0x1E23}, /* 1E22 */ + {0x1E24,0x1E25},{0x1E24,0x1E25}, /* 1E24 */ + {0x1E26,0x1E27},{0x1E26,0x1E27}, /* 1E26 */ + {0x1E28,0x1E29},{0x1E28,0x1E29}, /* 1E28 */ + {0x1E2A,0x1E2B},{0x1E2A,0x1E2B}, /* 1E2A */ + {0x1E2C,0x1E2D},{0x1E2C,0x1E2D}, /* 1E2C */ + {0x1E2E,0x1E2F},{0x1E2E,0x1E2F}, /* 1E2E */ + {0x1E30,0x1E31},{0x1E30,0x1E31}, /* 1E30 */ + {0x1E32,0x1E33},{0x1E32,0x1E33}, /* 1E32 */ + {0x1E34,0x1E35},{0x1E34,0x1E35}, /* 1E34 */ + {0x1E36,0x1E37},{0x1E36,0x1E37}, /* 1E36 */ + {0x1E38,0x1E39},{0x1E38,0x1E39}, /* 1E38 */ + {0x1E3A,0x1E3B},{0x1E3A,0x1E3B}, /* 1E3A */ + {0x1E3C,0x1E3D},{0x1E3C,0x1E3D}, /* 1E3C */ + {0x1E3E,0x1E3F},{0x1E3E,0x1E3F}, /* 1E3E */ + {0x1E40,0x1E41},{0x1E40,0x1E41}, /* 1E40 */ + {0x1E42,0x1E43},{0x1E42,0x1E43}, /* 1E42 */ + {0x1E44,0x1E45},{0x1E44,0x1E45}, /* 1E44 */ + {0x1E46,0x1E47},{0x1E46,0x1E47}, /* 1E46 */ + {0x1E48,0x1E49},{0x1E48,0x1E49}, /* 1E48 */ + {0x1E4A,0x1E4B},{0x1E4A,0x1E4B}, /* 1E4A */ + {0x1E4C,0x1E4D},{0x1E4C,0x1E4D}, /* 1E4C */ + {0x1E4E,0x1E4F},{0x1E4E,0x1E4F}, /* 1E4E */ + {0x1E50,0x1E51},{0x1E50,0x1E51}, /* 1E50 */ + {0x1E52,0x1E53},{0x1E52,0x1E53}, /* 1E52 */ + {0x1E54,0x1E55},{0x1E54,0x1E55}, /* 1E54 */ + {0x1E56,0x1E57},{0x1E56,0x1E57}, /* 1E56 */ + {0x1E58,0x1E59},{0x1E58,0x1E59}, /* 1E58 */ + {0x1E5A,0x1E5B},{0x1E5A,0x1E5B}, /* 1E5A */ + {0x1E5C,0x1E5D},{0x1E5C,0x1E5D}, /* 1E5C */ + {0x1E5E,0x1E5F},{0x1E5E,0x1E5F}, /* 1E5E */ + {0x1E60,0x1E61},{0x1E60,0x1E61}, /* 1E60 */ + {0x1E62,0x1E63},{0x1E62,0x1E63}, /* 1E62 */ + {0x1E64,0x1E65},{0x1E64,0x1E65}, /* 1E64 */ + {0x1E66,0x1E67},{0x1E66,0x1E67}, /* 1E66 */ + {0x1E68,0x1E69},{0x1E68,0x1E69}, /* 1E68 */ + {0x1E6A,0x1E6B},{0x1E6A,0x1E6B}, /* 1E6A */ + {0x1E6C,0x1E6D},{0x1E6C,0x1E6D}, /* 1E6C */ + {0x1E6E,0x1E6F},{0x1E6E,0x1E6F}, /* 1E6E */ + {0x1E70,0x1E71},{0x1E70,0x1E71}, /* 1E70 */ + {0x1E72,0x1E73},{0x1E72,0x1E73}, /* 1E72 */ + {0x1E74,0x1E75},{0x1E74,0x1E75}, /* 1E74 */ + {0x1E76,0x1E77},{0x1E76,0x1E77}, /* 1E76 */ + {0x1E78,0x1E79},{0x1E78,0x1E79}, /* 1E78 */ + {0x1E7A,0x1E7B},{0x1E7A,0x1E7B}, /* 1E7A */ + {0x1E7C,0x1E7D},{0x1E7C,0x1E7D}, /* 1E7C */ + {0x1E7E,0x1E7F},{0x1E7E,0x1E7F}, /* 1E7E */ + {0x1E80,0x1E81},{0x1E80,0x1E81}, /* 1E80 */ + {0x1E82,0x1E83},{0x1E82,0x1E83}, /* 1E82 */ + {0x1E84,0x1E85},{0x1E84,0x1E85}, /* 1E84 */ + {0x1E86,0x1E87},{0x1E86,0x1E87}, /* 1E86 */ + {0x1E88,0x1E89},{0x1E88,0x1E89}, /* 1E88 */ + {0x1E8A,0x1E8B},{0x1E8A,0x1E8B}, /* 1E8A */ + {0x1E8C,0x1E8D},{0x1E8C,0x1E8D}, /* 1E8C */ + {0x1E8E,0x1E8F},{0x1E8E,0x1E8F}, /* 1E8E */ + {0x1E90,0x1E91},{0x1E90,0x1E91}, /* 1E90 */ + {0x1E92,0x1E93},{0x1E92,0x1E93}, /* 1E92 */ + {0x1E94,0x1E95},{0x1E94,0x1E95}, /* 1E94 */ + {0x1E96,0x1E96},{0x1E97,0x1E97}, /* 1E96 */ + {0x1E98,0x1E98},{0x1E99,0x1E99}, /* 1E98 */ + {0x1E9A,0x1E9A},{0x1E60,0x1E9B}, /* 1E9A */ + {0x1E9C,0x1E9C},{0x1E9D,0x1E9D}, /* 1E9C */ + {0x1E9E,0x00DF},{0x1E9F,0x1E9F}, /* 1E9E */ + {0x1EA0,0x1EA1},{0x1EA0,0x1EA1}, /* 1EA0 */ + {0x1EA2,0x1EA3},{0x1EA2,0x1EA3}, /* 1EA2 */ + {0x1EA4,0x1EA5},{0x1EA4,0x1EA5}, /* 1EA4 */ + {0x1EA6,0x1EA7},{0x1EA6,0x1EA7}, /* 1EA6 */ + {0x1EA8,0x1EA9},{0x1EA8,0x1EA9}, /* 1EA8 */ + {0x1EAA,0x1EAB},{0x1EAA,0x1EAB}, /* 1EAA */ + {0x1EAC,0x1EAD},{0x1EAC,0x1EAD}, /* 1EAC */ + {0x1EAE,0x1EAF},{0x1EAE,0x1EAF}, /* 1EAE */ + {0x1EB0,0x1EB1},{0x1EB0,0x1EB1}, /* 1EB0 */ + {0x1EB2,0x1EB3},{0x1EB2,0x1EB3}, /* 1EB2 */ + {0x1EB4,0x1EB5},{0x1EB4,0x1EB5}, /* 1EB4 */ + {0x1EB6,0x1EB7},{0x1EB6,0x1EB7}, /* 1EB6 */ + {0x1EB8,0x1EB9},{0x1EB8,0x1EB9}, /* 1EB8 */ + {0x1EBA,0x1EBB},{0x1EBA,0x1EBB}, /* 1EBA */ + {0x1EBC,0x1EBD},{0x1EBC,0x1EBD}, /* 1EBC */ + {0x1EBE,0x1EBF},{0x1EBE,0x1EBF}, /* 1EBE */ + {0x1EC0,0x1EC1},{0x1EC0,0x1EC1}, /* 1EC0 */ + {0x1EC2,0x1EC3},{0x1EC2,0x1EC3}, /* 1EC2 */ + {0x1EC4,0x1EC5},{0x1EC4,0x1EC5}, /* 1EC4 */ + {0x1EC6,0x1EC7},{0x1EC6,0x1EC7}, /* 1EC6 */ + {0x1EC8,0x1EC9},{0x1EC8,0x1EC9}, /* 1EC8 */ + {0x1ECA,0x1ECB},{0x1ECA,0x1ECB}, /* 1ECA */ + {0x1ECC,0x1ECD},{0x1ECC,0x1ECD}, /* 1ECC */ + {0x1ECE,0x1ECF},{0x1ECE,0x1ECF}, /* 1ECE */ + {0x1ED0,0x1ED1},{0x1ED0,0x1ED1}, /* 1ED0 */ + {0x1ED2,0x1ED3},{0x1ED2,0x1ED3}, /* 1ED2 */ + {0x1ED4,0x1ED5},{0x1ED4,0x1ED5}, /* 1ED4 */ + {0x1ED6,0x1ED7},{0x1ED6,0x1ED7}, /* 1ED6 */ + {0x1ED8,0x1ED9},{0x1ED8,0x1ED9}, /* 1ED8 */ + {0x1EDA,0x1EDB},{0x1EDA,0x1EDB}, /* 1EDA */ + {0x1EDC,0x1EDD},{0x1EDC,0x1EDD}, /* 1EDC */ + {0x1EDE,0x1EDF},{0x1EDE,0x1EDF}, /* 1EDE */ + {0x1EE0,0x1EE1},{0x1EE0,0x1EE1}, /* 1EE0 */ + {0x1EE2,0x1EE3},{0x1EE2,0x1EE3}, /* 1EE2 */ + {0x1EE4,0x1EE5},{0x1EE4,0x1EE5}, /* 1EE4 */ + {0x1EE6,0x1EE7},{0x1EE6,0x1EE7}, /* 1EE6 */ + {0x1EE8,0x1EE9},{0x1EE8,0x1EE9}, /* 1EE8 */ + {0x1EEA,0x1EEB},{0x1EEA,0x1EEB}, /* 1EEA */ + {0x1EEC,0x1EED},{0x1EEC,0x1EED}, /* 1EEC */ + {0x1EEE,0x1EEF},{0x1EEE,0x1EEF}, /* 1EEE */ + {0x1EF0,0x1EF1},{0x1EF0,0x1EF1}, /* 1EF0 */ + {0x1EF2,0x1EF3},{0x1EF2,0x1EF3}, /* 1EF2 */ + {0x1EF4,0x1EF5},{0x1EF4,0x1EF5}, /* 1EF4 */ + {0x1EF6,0x1EF7},{0x1EF6,0x1EF7}, /* 1EF6 */ + {0x1EF8,0x1EF9},{0x1EF8,0x1EF9}, /* 1EF8 */ + {0x1EFA,0x1EFB},{0x1EFA,0x1EFB}, /* 1EFA */ + {0x1EFC,0x1EFD},{0x1EFC,0x1EFD}, /* 1EFC */ + {0x1EFE,0x1EFF},{0x1EFE,0x1EFF} /* 1EFE */ +}; + +static const MY_CASEFOLD_CHARACTER u520_casefold_page1F[256]={ + {0x1F08,0x1F00},{0x1F09,0x1F01}, /* 1F00 */ + {0x1F0A,0x1F02},{0x1F0B,0x1F03}, /* 1F02 */ + {0x1F0C,0x1F04},{0x1F0D,0x1F05}, /* 1F04 */ + {0x1F0E,0x1F06},{0x1F0F,0x1F07}, /* 1F06 */ + {0x1F08,0x1F00},{0x1F09,0x1F01}, /* 1F08 */ + {0x1F0A,0x1F02},{0x1F0B,0x1F03}, /* 1F0A */ + {0x1F0C,0x1F04},{0x1F0D,0x1F05}, /* 1F0C */ + {0x1F0E,0x1F06},{0x1F0F,0x1F07}, /* 1F0E */ + {0x1F18,0x1F10},{0x1F19,0x1F11}, /* 1F10 */ + {0x1F1A,0x1F12},{0x1F1B,0x1F13}, /* 1F12 */ + {0x1F1C,0x1F14},{0x1F1D,0x1F15}, /* 1F14 */ + {0x1F16,0x1F16},{0x1F17,0x1F17}, /* 1F16 */ + {0x1F18,0x1F10},{0x1F19,0x1F11}, /* 1F18 */ + {0x1F1A,0x1F12},{0x1F1B,0x1F13}, /* 1F1A */ + {0x1F1C,0x1F14},{0x1F1D,0x1F15}, /* 1F1C */ + {0x1F1E,0x1F1E},{0x1F1F,0x1F1F}, /* 1F1E */ + {0x1F28,0x1F20},{0x1F29,0x1F21}, /* 1F20 */ + {0x1F2A,0x1F22},{0x1F2B,0x1F23}, /* 1F22 */ + {0x1F2C,0x1F24},{0x1F2D,0x1F25}, /* 1F24 */ + {0x1F2E,0x1F26},{0x1F2F,0x1F27}, /* 1F26 */ + {0x1F28,0x1F20},{0x1F29,0x1F21}, /* 1F28 */ + {0x1F2A,0x1F22},{0x1F2B,0x1F23}, /* 1F2A */ + {0x1F2C,0x1F24},{0x1F2D,0x1F25}, /* 1F2C */ + {0x1F2E,0x1F26},{0x1F2F,0x1F27}, /* 1F2E */ + {0x1F38,0x1F30},{0x1F39,0x1F31}, /* 1F30 */ + {0x1F3A,0x1F32},{0x1F3B,0x1F33}, /* 1F32 */ + {0x1F3C,0x1F34},{0x1F3D,0x1F35}, /* 1F34 */ + {0x1F3E,0x1F36},{0x1F3F,0x1F37}, /* 1F36 */ + {0x1F38,0x1F30},{0x1F39,0x1F31}, /* 1F38 */ + {0x1F3A,0x1F32},{0x1F3B,0x1F33}, /* 1F3A */ + {0x1F3C,0x1F34},{0x1F3D,0x1F35}, /* 1F3C */ + {0x1F3E,0x1F36},{0x1F3F,0x1F37}, /* 1F3E */ + {0x1F48,0x1F40},{0x1F49,0x1F41}, /* 1F40 */ + {0x1F4A,0x1F42},{0x1F4B,0x1F43}, /* 1F42 */ + {0x1F4C,0x1F44},{0x1F4D,0x1F45}, /* 1F44 */ + {0x1F46,0x1F46},{0x1F47,0x1F47}, /* 1F46 */ + {0x1F48,0x1F40},{0x1F49,0x1F41}, /* 1F48 */ + {0x1F4A,0x1F42},{0x1F4B,0x1F43}, /* 1F4A */ + {0x1F4C,0x1F44},{0x1F4D,0x1F45}, /* 1F4C */ + {0x1F4E,0x1F4E},{0x1F4F,0x1F4F}, /* 1F4E */ + {0x1F50,0x1F50},{0x1F59,0x1F51}, /* 1F50 */ + {0x1F52,0x1F52},{0x1F5B,0x1F53}, /* 1F52 */ + {0x1F54,0x1F54},{0x1F5D,0x1F55}, /* 1F54 */ + {0x1F56,0x1F56},{0x1F5F,0x1F57}, /* 1F56 */ + {0x1F58,0x1F58},{0x1F59,0x1F51}, /* 1F58 */ + {0x1F5A,0x1F5A},{0x1F5B,0x1F53}, /* 1F5A */ + {0x1F5C,0x1F5C},{0x1F5D,0x1F55}, /* 1F5C */ + {0x1F5E,0x1F5E},{0x1F5F,0x1F57}, /* 1F5E */ + {0x1F68,0x1F60},{0x1F69,0x1F61}, /* 1F60 */ + {0x1F6A,0x1F62},{0x1F6B,0x1F63}, /* 1F62 */ + {0x1F6C,0x1F64},{0x1F6D,0x1F65}, /* 1F64 */ + {0x1F6E,0x1F66},{0x1F6F,0x1F67}, /* 1F66 */ + {0x1F68,0x1F60},{0x1F69,0x1F61}, /* 1F68 */ + {0x1F6A,0x1F62},{0x1F6B,0x1F63}, /* 1F6A */ + {0x1F6C,0x1F64},{0x1F6D,0x1F65}, /* 1F6C */ + {0x1F6E,0x1F66},{0x1F6F,0x1F67}, /* 1F6E */ + {0x1FBA,0x1F70},{0x1FBB,0x1F71}, /* 1F70 */ + {0x1FC8,0x1F72},{0x1FC9,0x1F73}, /* 1F72 */ + {0x1FCA,0x1F74},{0x1FCB,0x1F75}, /* 1F74 */ + {0x1FDA,0x1F76},{0x1FDB,0x1F77}, /* 1F76 */ + {0x1FF8,0x1F78},{0x1FF9,0x1F79}, /* 1F78 */ + {0x1FEA,0x1F7A},{0x1FEB,0x1F7B}, /* 1F7A */ + {0x1FFA,0x1F7C},{0x1FFB,0x1F7D}, /* 1F7C */ + {0x1F7E,0x1F7E},{0x1F7F,0x1F7F}, /* 1F7E */ + {0x1F88,0x1F80},{0x1F89,0x1F81}, /* 1F80 */ + {0x1F8A,0x1F82},{0x1F8B,0x1F83}, /* 1F82 */ + {0x1F8C,0x1F84},{0x1F8D,0x1F85}, /* 1F84 */ + {0x1F8E,0x1F86},{0x1F8F,0x1F87}, /* 1F86 */ + {0x1F88,0x1F80},{0x1F89,0x1F81}, /* 1F88 */ + {0x1F8A,0x1F82},{0x1F8B,0x1F83}, /* 1F8A */ + {0x1F8C,0x1F84},{0x1F8D,0x1F85}, /* 1F8C */ + {0x1F8E,0x1F86},{0x1F8F,0x1F87}, /* 1F8E */ + {0x1F98,0x1F90},{0x1F99,0x1F91}, /* 1F90 */ + {0x1F9A,0x1F92},{0x1F9B,0x1F93}, /* 1F92 */ + {0x1F9C,0x1F94},{0x1F9D,0x1F95}, /* 1F94 */ + {0x1F9E,0x1F96},{0x1F9F,0x1F97}, /* 1F96 */ + {0x1F98,0x1F90},{0x1F99,0x1F91}, /* 1F98 */ + {0x1F9A,0x1F92},{0x1F9B,0x1F93}, /* 1F9A */ + {0x1F9C,0x1F94},{0x1F9D,0x1F95}, /* 1F9C */ + {0x1F9E,0x1F96},{0x1F9F,0x1F97}, /* 1F9E */ + {0x1FA8,0x1FA0},{0x1FA9,0x1FA1}, /* 1FA0 */ + {0x1FAA,0x1FA2},{0x1FAB,0x1FA3}, /* 1FA2 */ + {0x1FAC,0x1FA4},{0x1FAD,0x1FA5}, /* 1FA4 */ + {0x1FAE,0x1FA6},{0x1FAF,0x1FA7}, /* 1FA6 */ + {0x1FA8,0x1FA0},{0x1FA9,0x1FA1}, /* 1FA8 */ + {0x1FAA,0x1FA2},{0x1FAB,0x1FA3}, /* 1FAA */ + {0x1FAC,0x1FA4},{0x1FAD,0x1FA5}, /* 1FAC */ + {0x1FAE,0x1FA6},{0x1FAF,0x1FA7}, /* 1FAE */ + {0x1FB8,0x1FB0},{0x1FB9,0x1FB1}, /* 1FB0 */ + {0x1FB2,0x1FB2},{0x1FBC,0x1FB3}, /* 1FB2 */ + {0x1FB4,0x1FB4},{0x1FB5,0x1FB5}, /* 1FB4 */ + {0x1FB6,0x1FB6},{0x1FB7,0x1FB7}, /* 1FB6 */ + {0x1FB8,0x1FB0},{0x1FB9,0x1FB1}, /* 1FB8 */ + {0x1FBA,0x1F70},{0x1FBB,0x1F71}, /* 1FBA */ + {0x1FBC,0x1FB3},{0x1FBD,0x1FBD}, /* 1FBC */ + {0x0399,0x1FBE},{0x1FBF,0x1FBF}, /* 1FBE */ + {0x1FC0,0x1FC0},{0x1FC1,0x1FC1}, /* 1FC0 */ + {0x1FC2,0x1FC2},{0x1FCC,0x1FC3}, /* 1FC2 */ + {0x1FC4,0x1FC4},{0x1FC5,0x1FC5}, /* 1FC4 */ + {0x1FC6,0x1FC6},{0x1FC7,0x1FC7}, /* 1FC6 */ + {0x1FC8,0x1F72},{0x1FC9,0x1F73}, /* 1FC8 */ + {0x1FCA,0x1F74},{0x1FCB,0x1F75}, /* 1FCA */ + {0x1FCC,0x1FC3},{0x1FCD,0x1FCD}, /* 1FCC */ + {0x1FCE,0x1FCE},{0x1FCF,0x1FCF}, /* 1FCE */ + {0x1FD8,0x1FD0},{0x1FD9,0x1FD1}, /* 1FD0 */ + {0x1FD2,0x1FD2},{0x1FD3,0x1FD3}, /* 1FD2 */ + {0x1FD4,0x1FD4},{0x1FD5,0x1FD5}, /* 1FD4 */ + {0x1FD6,0x1FD6},{0x1FD7,0x1FD7}, /* 1FD6 */ + {0x1FD8,0x1FD0},{0x1FD9,0x1FD1}, /* 1FD8 */ + {0x1FDA,0x1F76},{0x1FDB,0x1F77}, /* 1FDA */ + {0x1FDC,0x1FDC},{0x1FDD,0x1FDD}, /* 1FDC */ + {0x1FDE,0x1FDE},{0x1FDF,0x1FDF}, /* 1FDE */ + {0x1FE8,0x1FE0},{0x1FE9,0x1FE1}, /* 1FE0 */ + {0x1FE2,0x1FE2},{0x1FE3,0x1FE3}, /* 1FE2 */ + {0x1FE4,0x1FE4},{0x1FEC,0x1FE5}, /* 1FE4 */ + {0x1FE6,0x1FE6},{0x1FE7,0x1FE7}, /* 1FE6 */ + {0x1FE8,0x1FE0},{0x1FE9,0x1FE1}, /* 1FE8 */ + {0x1FEA,0x1F7A},{0x1FEB,0x1F7B}, /* 1FEA */ + {0x1FEC,0x1FE5},{0x1FED,0x1FED}, /* 1FEC */ + {0x1FEE,0x1FEE},{0x1FEF,0x1FEF}, /* 1FEE */ + {0x1FF0,0x1FF0},{0x1FF1,0x1FF1}, /* 1FF0 */ + {0x1FF2,0x1FF2},{0x1FFC,0x1FF3}, /* 1FF2 */ + {0x1FF4,0x1FF4},{0x1FF5,0x1FF5}, /* 1FF4 */ + {0x1FF6,0x1FF6},{0x1FF7,0x1FF7}, /* 1FF6 */ + {0x1FF8,0x1F78},{0x1FF9,0x1F79}, /* 1FF8 */ + {0x1FFA,0x1F7C},{0x1FFB,0x1F7D}, /* 1FFA */ + {0x1FFC,0x1FF3},{0x1FFD,0x1FFD}, /* 1FFC */ + {0x1FFE,0x1FFE},{0x1FFF,0x1FFF} /* 1FFE */ +}; + +static const MY_CASEFOLD_CHARACTER u520_casefold_page21[256]={ + {0x2100,0x2100},{0x2101,0x2101}, /* 2100 */ + {0x2102,0x2102},{0x2103,0x2103}, /* 2102 */ + {0x2104,0x2104},{0x2105,0x2105}, /* 2104 */ + {0x2106,0x2106},{0x2107,0x2107}, /* 2106 */ + {0x2108,0x2108},{0x2109,0x2109}, /* 2108 */ + {0x210A,0x210A},{0x210B,0x210B}, /* 210A */ + {0x210C,0x210C},{0x210D,0x210D}, /* 210C */ + {0x210E,0x210E},{0x210F,0x210F}, /* 210E */ + {0x2110,0x2110},{0x2111,0x2111}, /* 2110 */ + {0x2112,0x2112},{0x2113,0x2113}, /* 2112 */ + {0x2114,0x2114},{0x2115,0x2115}, /* 2114 */ + {0x2116,0x2116},{0x2117,0x2117}, /* 2116 */ + {0x2118,0x2118},{0x2119,0x2119}, /* 2118 */ + {0x211A,0x211A},{0x211B,0x211B}, /* 211A */ + {0x211C,0x211C},{0x211D,0x211D}, /* 211C */ + {0x211E,0x211E},{0x211F,0x211F}, /* 211E */ + {0x2120,0x2120},{0x2121,0x2121}, /* 2120 */ + {0x2122,0x2122},{0x2123,0x2123}, /* 2122 */ + {0x2124,0x2124},{0x2125,0x2125}, /* 2124 */ + {0x2126,0x03C9},{0x2127,0x2127}, /* 2126 */ + {0x2128,0x2128},{0x2129,0x2129}, /* 2128 */ + {0x212A,0x006B},{0x212B,0x00E5}, /* 212A */ + {0x212C,0x212C},{0x212D,0x212D}, /* 212C */ + {0x212E,0x212E},{0x212F,0x212F}, /* 212E */ + {0x2130,0x2130},{0x2131,0x2131}, /* 2130 */ + {0x2132,0x214E},{0x2133,0x2133}, /* 2132 */ + {0x2134,0x2134},{0x2135,0x2135}, /* 2134 */ + {0x2136,0x2136},{0x2137,0x2137}, /* 2136 */ + {0x2138,0x2138},{0x2139,0x2139}, /* 2138 */ + {0x213A,0x213A},{0x213B,0x213B}, /* 213A */ + {0x213C,0x213C},{0x213D,0x213D}, /* 213C */ + {0x213E,0x213E},{0x213F,0x213F}, /* 213E */ + {0x2140,0x2140},{0x2141,0x2141}, /* 2140 */ + {0x2142,0x2142},{0x2143,0x2143}, /* 2142 */ + {0x2144,0x2144},{0x2145,0x2145}, /* 2144 */ + {0x2146,0x2146},{0x2147,0x2147}, /* 2146 */ + {0x2148,0x2148},{0x2149,0x2149}, /* 2148 */ + {0x214A,0x214A},{0x214B,0x214B}, /* 214A */ + {0x214C,0x214C},{0x214D,0x214D}, /* 214C */ + {0x2132,0x214E},{0x214F,0x214F}, /* 214E */ + {0x2150,0x2150},{0x2151,0x2151}, /* 2150 */ + {0x2152,0x2152},{0x2153,0x2153}, /* 2152 */ + {0x2154,0x2154},{0x2155,0x2155}, /* 2154 */ + {0x2156,0x2156},{0x2157,0x2157}, /* 2156 */ + {0x2158,0x2158},{0x2159,0x2159}, /* 2158 */ + {0x215A,0x215A},{0x215B,0x215B}, /* 215A */ + {0x215C,0x215C},{0x215D,0x215D}, /* 215C */ + {0x215E,0x215E},{0x215F,0x215F}, /* 215E */ + {0x2160,0x2170},{0x2161,0x2171}, /* 2160 */ + {0x2162,0x2172},{0x2163,0x2173}, /* 2162 */ + {0x2164,0x2174},{0x2165,0x2175}, /* 2164 */ + {0x2166,0x2176},{0x2167,0x2177}, /* 2166 */ + {0x2168,0x2178},{0x2169,0x2179}, /* 2168 */ + {0x216A,0x217A},{0x216B,0x217B}, /* 216A */ + {0x216C,0x217C},{0x216D,0x217D}, /* 216C */ + {0x216E,0x217E},{0x216F,0x217F}, /* 216E */ + {0x2160,0x2170},{0x2161,0x2171}, /* 2170 */ + {0x2162,0x2172},{0x2163,0x2173}, /* 2172 */ + {0x2164,0x2174},{0x2165,0x2175}, /* 2174 */ + {0x2166,0x2176},{0x2167,0x2177}, /* 2176 */ + {0x2168,0x2178},{0x2169,0x2179}, /* 2178 */ + {0x216A,0x217A},{0x216B,0x217B}, /* 217A */ + {0x216C,0x217C},{0x216D,0x217D}, /* 217C */ + {0x216E,0x217E},{0x216F,0x217F}, /* 217E */ + {0x2180,0x2180},{0x2181,0x2181}, /* 2180 */ + {0x2182,0x2182},{0x2183,0x2184}, /* 2182 */ + {0x2183,0x2184},{0x2185,0x2185}, /* 2184 */ + {0x2186,0x2186},{0x2187,0x2187}, /* 2186 */ + {0x2188,0x2188},{0x2189,0x2189}, /* 2188 */ + {0x218A,0x218A},{0x218B,0x218B}, /* 218A */ + {0x218C,0x218C},{0x218D,0x218D}, /* 218C */ + {0x218E,0x218E},{0x218F,0x218F}, /* 218E */ + {0x2190,0x2190},{0x2191,0x2191}, /* 2190 */ + {0x2192,0x2192},{0x2193,0x2193}, /* 2192 */ + {0x2194,0x2194},{0x2195,0x2195}, /* 2194 */ + {0x2196,0x2196},{0x2197,0x2197}, /* 2196 */ + {0x2198,0x2198},{0x2199,0x2199}, /* 2198 */ + {0x219A,0x219A},{0x219B,0x219B}, /* 219A */ + {0x219C,0x219C},{0x219D,0x219D}, /* 219C */ + {0x219E,0x219E},{0x219F,0x219F}, /* 219E */ + {0x21A0,0x21A0},{0x21A1,0x21A1}, /* 21A0 */ + {0x21A2,0x21A2},{0x21A3,0x21A3}, /* 21A2 */ + {0x21A4,0x21A4},{0x21A5,0x21A5}, /* 21A4 */ + {0x21A6,0x21A6},{0x21A7,0x21A7}, /* 21A6 */ + {0x21A8,0x21A8},{0x21A9,0x21A9}, /* 21A8 */ + {0x21AA,0x21AA},{0x21AB,0x21AB}, /* 21AA */ + {0x21AC,0x21AC},{0x21AD,0x21AD}, /* 21AC */ + {0x21AE,0x21AE},{0x21AF,0x21AF}, /* 21AE */ + {0x21B0,0x21B0},{0x21B1,0x21B1}, /* 21B0 */ + {0x21B2,0x21B2},{0x21B3,0x21B3}, /* 21B2 */ + {0x21B4,0x21B4},{0x21B5,0x21B5}, /* 21B4 */ + {0x21B6,0x21B6},{0x21B7,0x21B7}, /* 21B6 */ + {0x21B8,0x21B8},{0x21B9,0x21B9}, /* 21B8 */ + {0x21BA,0x21BA},{0x21BB,0x21BB}, /* 21BA */ + {0x21BC,0x21BC},{0x21BD,0x21BD}, /* 21BC */ + {0x21BE,0x21BE},{0x21BF,0x21BF}, /* 21BE */ + {0x21C0,0x21C0},{0x21C1,0x21C1}, /* 21C0 */ + {0x21C2,0x21C2},{0x21C3,0x21C3}, /* 21C2 */ + {0x21C4,0x21C4},{0x21C5,0x21C5}, /* 21C4 */ + {0x21C6,0x21C6},{0x21C7,0x21C7}, /* 21C6 */ + {0x21C8,0x21C8},{0x21C9,0x21C9}, /* 21C8 */ + {0x21CA,0x21CA},{0x21CB,0x21CB}, /* 21CA */ + {0x21CC,0x21CC},{0x21CD,0x21CD}, /* 21CC */ + {0x21CE,0x21CE},{0x21CF,0x21CF}, /* 21CE */ + {0x21D0,0x21D0},{0x21D1,0x21D1}, /* 21D0 */ + {0x21D2,0x21D2},{0x21D3,0x21D3}, /* 21D2 */ + {0x21D4,0x21D4},{0x21D5,0x21D5}, /* 21D4 */ + {0x21D6,0x21D6},{0x21D7,0x21D7}, /* 21D6 */ + {0x21D8,0x21D8},{0x21D9,0x21D9}, /* 21D8 */ + {0x21DA,0x21DA},{0x21DB,0x21DB}, /* 21DA */ + {0x21DC,0x21DC},{0x21DD,0x21DD}, /* 21DC */ + {0x21DE,0x21DE},{0x21DF,0x21DF}, /* 21DE */ + {0x21E0,0x21E0},{0x21E1,0x21E1}, /* 21E0 */ + {0x21E2,0x21E2},{0x21E3,0x21E3}, /* 21E2 */ + {0x21E4,0x21E4},{0x21E5,0x21E5}, /* 21E4 */ + {0x21E6,0x21E6},{0x21E7,0x21E7}, /* 21E6 */ + {0x21E8,0x21E8},{0x21E9,0x21E9}, /* 21E8 */ + {0x21EA,0x21EA},{0x21EB,0x21EB}, /* 21EA */ + {0x21EC,0x21EC},{0x21ED,0x21ED}, /* 21EC */ + {0x21EE,0x21EE},{0x21EF,0x21EF}, /* 21EE */ + {0x21F0,0x21F0},{0x21F1,0x21F1}, /* 21F0 */ + {0x21F2,0x21F2},{0x21F3,0x21F3}, /* 21F2 */ + {0x21F4,0x21F4},{0x21F5,0x21F5}, /* 21F4 */ + {0x21F6,0x21F6},{0x21F7,0x21F7}, /* 21F6 */ + {0x21F8,0x21F8},{0x21F9,0x21F9}, /* 21F8 */ + {0x21FA,0x21FA},{0x21FB,0x21FB}, /* 21FA */ + {0x21FC,0x21FC},{0x21FD,0x21FD}, /* 21FC */ + {0x21FE,0x21FE},{0x21FF,0x21FF} /* 21FE */ +}; + +static const MY_CASEFOLD_CHARACTER u520_casefold_page24[256]={ + {0x2400,0x2400},{0x2401,0x2401}, /* 2400 */ + {0x2402,0x2402},{0x2403,0x2403}, /* 2402 */ + {0x2404,0x2404},{0x2405,0x2405}, /* 2404 */ + {0x2406,0x2406},{0x2407,0x2407}, /* 2406 */ + {0x2408,0x2408},{0x2409,0x2409}, /* 2408 */ + {0x240A,0x240A},{0x240B,0x240B}, /* 240A */ + {0x240C,0x240C},{0x240D,0x240D}, /* 240C */ + {0x240E,0x240E},{0x240F,0x240F}, /* 240E */ + {0x2410,0x2410},{0x2411,0x2411}, /* 2410 */ + {0x2412,0x2412},{0x2413,0x2413}, /* 2412 */ + {0x2414,0x2414},{0x2415,0x2415}, /* 2414 */ + {0x2416,0x2416},{0x2417,0x2417}, /* 2416 */ + {0x2418,0x2418},{0x2419,0x2419}, /* 2418 */ + {0x241A,0x241A},{0x241B,0x241B}, /* 241A */ + {0x241C,0x241C},{0x241D,0x241D}, /* 241C */ + {0x241E,0x241E},{0x241F,0x241F}, /* 241E */ + {0x2420,0x2420},{0x2421,0x2421}, /* 2420 */ + {0x2422,0x2422},{0x2423,0x2423}, /* 2422 */ + {0x2424,0x2424},{0x2425,0x2425}, /* 2424 */ + {0x2426,0x2426},{0x2427,0x2427}, /* 2426 */ + {0x2428,0x2428},{0x2429,0x2429}, /* 2428 */ + {0x242A,0x242A},{0x242B,0x242B}, /* 242A */ + {0x242C,0x242C},{0x242D,0x242D}, /* 242C */ + {0x242E,0x242E},{0x242F,0x242F}, /* 242E */ + {0x2430,0x2430},{0x2431,0x2431}, /* 2430 */ + {0x2432,0x2432},{0x2433,0x2433}, /* 2432 */ + {0x2434,0x2434},{0x2435,0x2435}, /* 2434 */ + {0x2436,0x2436},{0x2437,0x2437}, /* 2436 */ + {0x2438,0x2438},{0x2439,0x2439}, /* 2438 */ + {0x243A,0x243A},{0x243B,0x243B}, /* 243A */ + {0x243C,0x243C},{0x243D,0x243D}, /* 243C */ + {0x243E,0x243E},{0x243F,0x243F}, /* 243E */ + {0x2440,0x2440},{0x2441,0x2441}, /* 2440 */ + {0x2442,0x2442},{0x2443,0x2443}, /* 2442 */ + {0x2444,0x2444},{0x2445,0x2445}, /* 2444 */ + {0x2446,0x2446},{0x2447,0x2447}, /* 2446 */ + {0x2448,0x2448},{0x2449,0x2449}, /* 2448 */ + {0x244A,0x244A},{0x244B,0x244B}, /* 244A */ + {0x244C,0x244C},{0x244D,0x244D}, /* 244C */ + {0x244E,0x244E},{0x244F,0x244F}, /* 244E */ + {0x2450,0x2450},{0x2451,0x2451}, /* 2450 */ + {0x2452,0x2452},{0x2453,0x2453}, /* 2452 */ + {0x2454,0x2454},{0x2455,0x2455}, /* 2454 */ + {0x2456,0x2456},{0x2457,0x2457}, /* 2456 */ + {0x2458,0x2458},{0x2459,0x2459}, /* 2458 */ + {0x245A,0x245A},{0x245B,0x245B}, /* 245A */ + {0x245C,0x245C},{0x245D,0x245D}, /* 245C */ + {0x245E,0x245E},{0x245F,0x245F}, /* 245E */ + {0x2460,0x2460},{0x2461,0x2461}, /* 2460 */ + {0x2462,0x2462},{0x2463,0x2463}, /* 2462 */ + {0x2464,0x2464},{0x2465,0x2465}, /* 2464 */ + {0x2466,0x2466},{0x2467,0x2467}, /* 2466 */ + {0x2468,0x2468},{0x2469,0x2469}, /* 2468 */ + {0x246A,0x246A},{0x246B,0x246B}, /* 246A */ + {0x246C,0x246C},{0x246D,0x246D}, /* 246C */ + {0x246E,0x246E},{0x246F,0x246F}, /* 246E */ + {0x2470,0x2470},{0x2471,0x2471}, /* 2470 */ + {0x2472,0x2472},{0x2473,0x2473}, /* 2472 */ + {0x2474,0x2474},{0x2475,0x2475}, /* 2474 */ + {0x2476,0x2476},{0x2477,0x2477}, /* 2476 */ + {0x2478,0x2478},{0x2479,0x2479}, /* 2478 */ + {0x247A,0x247A},{0x247B,0x247B}, /* 247A */ + {0x247C,0x247C},{0x247D,0x247D}, /* 247C */ + {0x247E,0x247E},{0x247F,0x247F}, /* 247E */ + {0x2480,0x2480},{0x2481,0x2481}, /* 2480 */ + {0x2482,0x2482},{0x2483,0x2483}, /* 2482 */ + {0x2484,0x2484},{0x2485,0x2485}, /* 2484 */ + {0x2486,0x2486},{0x2487,0x2487}, /* 2486 */ + {0x2488,0x2488},{0x2489,0x2489}, /* 2488 */ + {0x248A,0x248A},{0x248B,0x248B}, /* 248A */ + {0x248C,0x248C},{0x248D,0x248D}, /* 248C */ + {0x248E,0x248E},{0x248F,0x248F}, /* 248E */ + {0x2490,0x2490},{0x2491,0x2491}, /* 2490 */ + {0x2492,0x2492},{0x2493,0x2493}, /* 2492 */ + {0x2494,0x2494},{0x2495,0x2495}, /* 2494 */ + {0x2496,0x2496},{0x2497,0x2497}, /* 2496 */ + {0x2498,0x2498},{0x2499,0x2499}, /* 2498 */ + {0x249A,0x249A},{0x249B,0x249B}, /* 249A */ + {0x249C,0x249C},{0x249D,0x249D}, /* 249C */ + {0x249E,0x249E},{0x249F,0x249F}, /* 249E */ + {0x24A0,0x24A0},{0x24A1,0x24A1}, /* 24A0 */ + {0x24A2,0x24A2},{0x24A3,0x24A3}, /* 24A2 */ + {0x24A4,0x24A4},{0x24A5,0x24A5}, /* 24A4 */ + {0x24A6,0x24A6},{0x24A7,0x24A7}, /* 24A6 */ + {0x24A8,0x24A8},{0x24A9,0x24A9}, /* 24A8 */ + {0x24AA,0x24AA},{0x24AB,0x24AB}, /* 24AA */ + {0x24AC,0x24AC},{0x24AD,0x24AD}, /* 24AC */ + {0x24AE,0x24AE},{0x24AF,0x24AF}, /* 24AE */ + {0x24B0,0x24B0},{0x24B1,0x24B1}, /* 24B0 */ + {0x24B2,0x24B2},{0x24B3,0x24B3}, /* 24B2 */ + {0x24B4,0x24B4},{0x24B5,0x24B5}, /* 24B4 */ + {0x24B6,0x24D0},{0x24B7,0x24D1}, /* 24B6 */ + {0x24B8,0x24D2},{0x24B9,0x24D3}, /* 24B8 */ + {0x24BA,0x24D4},{0x24BB,0x24D5}, /* 24BA */ + {0x24BC,0x24D6},{0x24BD,0x24D7}, /* 24BC */ + {0x24BE,0x24D8},{0x24BF,0x24D9}, /* 24BE */ + {0x24C0,0x24DA},{0x24C1,0x24DB}, /* 24C0 */ + {0x24C2,0x24DC},{0x24C3,0x24DD}, /* 24C2 */ + {0x24C4,0x24DE},{0x24C5,0x24DF}, /* 24C4 */ + {0x24C6,0x24E0},{0x24C7,0x24E1}, /* 24C6 */ + {0x24C8,0x24E2},{0x24C9,0x24E3}, /* 24C8 */ + {0x24CA,0x24E4},{0x24CB,0x24E5}, /* 24CA */ + {0x24CC,0x24E6},{0x24CD,0x24E7}, /* 24CC */ + {0x24CE,0x24E8},{0x24CF,0x24E9}, /* 24CE */ + {0x24B6,0x24D0},{0x24B7,0x24D1}, /* 24D0 */ + {0x24B8,0x24D2},{0x24B9,0x24D3}, /* 24D2 */ + {0x24BA,0x24D4},{0x24BB,0x24D5}, /* 24D4 */ + {0x24BC,0x24D6},{0x24BD,0x24D7}, /* 24D6 */ + {0x24BE,0x24D8},{0x24BF,0x24D9}, /* 24D8 */ + {0x24C0,0x24DA},{0x24C1,0x24DB}, /* 24DA */ + {0x24C2,0x24DC},{0x24C3,0x24DD}, /* 24DC */ + {0x24C4,0x24DE},{0x24C5,0x24DF}, /* 24DE */ + {0x24C6,0x24E0},{0x24C7,0x24E1}, /* 24E0 */ + {0x24C8,0x24E2},{0x24C9,0x24E3}, /* 24E2 */ + {0x24CA,0x24E4},{0x24CB,0x24E5}, /* 24E4 */ + {0x24CC,0x24E6},{0x24CD,0x24E7}, /* 24E6 */ + {0x24CE,0x24E8},{0x24CF,0x24E9}, /* 24E8 */ + {0x24EA,0x24EA},{0x24EB,0x24EB}, /* 24EA */ + {0x24EC,0x24EC},{0x24ED,0x24ED}, /* 24EC */ + {0x24EE,0x24EE},{0x24EF,0x24EF}, /* 24EE */ + {0x24F0,0x24F0},{0x24F1,0x24F1}, /* 24F0 */ + {0x24F2,0x24F2},{0x24F3,0x24F3}, /* 24F2 */ + {0x24F4,0x24F4},{0x24F5,0x24F5}, /* 24F4 */ + {0x24F6,0x24F6},{0x24F7,0x24F7}, /* 24F6 */ + {0x24F8,0x24F8},{0x24F9,0x24F9}, /* 24F8 */ + {0x24FA,0x24FA},{0x24FB,0x24FB}, /* 24FA */ + {0x24FC,0x24FC},{0x24FD,0x24FD}, /* 24FC */ + {0x24FE,0x24FE},{0x24FF,0x24FF} /* 24FE */ +}; + +static const MY_CASEFOLD_CHARACTER u520_casefold_page2C[256]={ + {0x2C00,0x2C30},{0x2C01,0x2C31}, /* 2C00 */ + {0x2C02,0x2C32},{0x2C03,0x2C33}, /* 2C02 */ + {0x2C04,0x2C34},{0x2C05,0x2C35}, /* 2C04 */ + {0x2C06,0x2C36},{0x2C07,0x2C37}, /* 2C06 */ + {0x2C08,0x2C38},{0x2C09,0x2C39}, /* 2C08 */ + {0x2C0A,0x2C3A},{0x2C0B,0x2C3B}, /* 2C0A */ + {0x2C0C,0x2C3C},{0x2C0D,0x2C3D}, /* 2C0C */ + {0x2C0E,0x2C3E},{0x2C0F,0x2C3F}, /* 2C0E */ + {0x2C10,0x2C40},{0x2C11,0x2C41}, /* 2C10 */ + {0x2C12,0x2C42},{0x2C13,0x2C43}, /* 2C12 */ + {0x2C14,0x2C44},{0x2C15,0x2C45}, /* 2C14 */ + {0x2C16,0x2C46},{0x2C17,0x2C47}, /* 2C16 */ + {0x2C18,0x2C48},{0x2C19,0x2C49}, /* 2C18 */ + {0x2C1A,0x2C4A},{0x2C1B,0x2C4B}, /* 2C1A */ + {0x2C1C,0x2C4C},{0x2C1D,0x2C4D}, /* 2C1C */ + {0x2C1E,0x2C4E},{0x2C1F,0x2C4F}, /* 2C1E */ + {0x2C20,0x2C50},{0x2C21,0x2C51}, /* 2C20 */ + {0x2C22,0x2C52},{0x2C23,0x2C53}, /* 2C22 */ + {0x2C24,0x2C54},{0x2C25,0x2C55}, /* 2C24 */ + {0x2C26,0x2C56},{0x2C27,0x2C57}, /* 2C26 */ + {0x2C28,0x2C58},{0x2C29,0x2C59}, /* 2C28 */ + {0x2C2A,0x2C5A},{0x2C2B,0x2C5B}, /* 2C2A */ + {0x2C2C,0x2C5C},{0x2C2D,0x2C5D}, /* 2C2C */ + {0x2C2E,0x2C5E},{0x2C2F,0x2C2F}, /* 2C2E */ + {0x2C00,0x2C30},{0x2C01,0x2C31}, /* 2C30 */ + {0x2C02,0x2C32},{0x2C03,0x2C33}, /* 2C32 */ + {0x2C04,0x2C34},{0x2C05,0x2C35}, /* 2C34 */ + {0x2C06,0x2C36},{0x2C07,0x2C37}, /* 2C36 */ + {0x2C08,0x2C38},{0x2C09,0x2C39}, /* 2C38 */ + {0x2C0A,0x2C3A},{0x2C0B,0x2C3B}, /* 2C3A */ + {0x2C0C,0x2C3C},{0x2C0D,0x2C3D}, /* 2C3C */ + {0x2C0E,0x2C3E},{0x2C0F,0x2C3F}, /* 2C3E */ + {0x2C10,0x2C40},{0x2C11,0x2C41}, /* 2C40 */ + {0x2C12,0x2C42},{0x2C13,0x2C43}, /* 2C42 */ + {0x2C14,0x2C44},{0x2C15,0x2C45}, /* 2C44 */ + {0x2C16,0x2C46},{0x2C17,0x2C47}, /* 2C46 */ + {0x2C18,0x2C48},{0x2C19,0x2C49}, /* 2C48 */ + {0x2C1A,0x2C4A},{0x2C1B,0x2C4B}, /* 2C4A */ + {0x2C1C,0x2C4C},{0x2C1D,0x2C4D}, /* 2C4C */ + {0x2C1E,0x2C4E},{0x2C1F,0x2C4F}, /* 2C4E */ + {0x2C20,0x2C50},{0x2C21,0x2C51}, /* 2C50 */ + {0x2C22,0x2C52},{0x2C23,0x2C53}, /* 2C52 */ + {0x2C24,0x2C54},{0x2C25,0x2C55}, /* 2C54 */ + {0x2C26,0x2C56},{0x2C27,0x2C57}, /* 2C56 */ + {0x2C28,0x2C58},{0x2C29,0x2C59}, /* 2C58 */ + {0x2C2A,0x2C5A},{0x2C2B,0x2C5B}, /* 2C5A */ + {0x2C2C,0x2C5C},{0x2C2D,0x2C5D}, /* 2C5C */ + {0x2C2E,0x2C5E},{0x2C5F,0x2C5F}, /* 2C5E */ + {0x2C60,0x2C61},{0x2C60,0x2C61}, /* 2C60 */ + {0x2C62,0x026B},{0x2C63,0x1D7D}, /* 2C62 */ + {0x2C64,0x027D},{0x023A,0x2C65}, /* 2C64 */ + {0x023E,0x2C66},{0x2C67,0x2C68}, /* 2C66 */ + {0x2C67,0x2C68},{0x2C69,0x2C6A}, /* 2C68 */ + {0x2C69,0x2C6A},{0x2C6B,0x2C6C}, /* 2C6A */ + {0x2C6B,0x2C6C},{0x2C6D,0x0251}, /* 2C6C */ + {0x2C6E,0x0271},{0x2C6F,0x0250}, /* 2C6E */ + {0x2C70,0x0252},{0x2C71,0x2C71}, /* 2C70 */ + {0x2C72,0x2C73},{0x2C72,0x2C73}, /* 2C72 */ + {0x2C74,0x2C74},{0x2C75,0x2C76}, /* 2C74 */ + {0x2C75,0x2C76},{0x2C77,0x2C77}, /* 2C76 */ + {0x2C78,0x2C78},{0x2C79,0x2C79}, /* 2C78 */ + {0x2C7A,0x2C7A},{0x2C7B,0x2C7B}, /* 2C7A */ + {0x2C7C,0x2C7C},{0x2C7D,0x2C7D}, /* 2C7C */ + {0x2C7E,0x023F},{0x2C7F,0x0240}, /* 2C7E */ + {0x2C80,0x2C81},{0x2C80,0x2C81}, /* 2C80 */ + {0x2C82,0x2C83},{0x2C82,0x2C83}, /* 2C82 */ + {0x2C84,0x2C85},{0x2C84,0x2C85}, /* 2C84 */ + {0x2C86,0x2C87},{0x2C86,0x2C87}, /* 2C86 */ + {0x2C88,0x2C89},{0x2C88,0x2C89}, /* 2C88 */ + {0x2C8A,0x2C8B},{0x2C8A,0x2C8B}, /* 2C8A */ + {0x2C8C,0x2C8D},{0x2C8C,0x2C8D}, /* 2C8C */ + {0x2C8E,0x2C8F},{0x2C8E,0x2C8F}, /* 2C8E */ + {0x2C90,0x2C91},{0x2C90,0x2C91}, /* 2C90 */ + {0x2C92,0x2C93},{0x2C92,0x2C93}, /* 2C92 */ + {0x2C94,0x2C95},{0x2C94,0x2C95}, /* 2C94 */ + {0x2C96,0x2C97},{0x2C96,0x2C97}, /* 2C96 */ + {0x2C98,0x2C99},{0x2C98,0x2C99}, /* 2C98 */ + {0x2C9A,0x2C9B},{0x2C9A,0x2C9B}, /* 2C9A */ + {0x2C9C,0x2C9D},{0x2C9C,0x2C9D}, /* 2C9C */ + {0x2C9E,0x2C9F},{0x2C9E,0x2C9F}, /* 2C9E */ + {0x2CA0,0x2CA1},{0x2CA0,0x2CA1}, /* 2CA0 */ + {0x2CA2,0x2CA3},{0x2CA2,0x2CA3}, /* 2CA2 */ + {0x2CA4,0x2CA5},{0x2CA4,0x2CA5}, /* 2CA4 */ + {0x2CA6,0x2CA7},{0x2CA6,0x2CA7}, /* 2CA6 */ + {0x2CA8,0x2CA9},{0x2CA8,0x2CA9}, /* 2CA8 */ + {0x2CAA,0x2CAB},{0x2CAA,0x2CAB}, /* 2CAA */ + {0x2CAC,0x2CAD},{0x2CAC,0x2CAD}, /* 2CAC */ + {0x2CAE,0x2CAF},{0x2CAE,0x2CAF}, /* 2CAE */ + {0x2CB0,0x2CB1},{0x2CB0,0x2CB1}, /* 2CB0 */ + {0x2CB2,0x2CB3},{0x2CB2,0x2CB3}, /* 2CB2 */ + {0x2CB4,0x2CB5},{0x2CB4,0x2CB5}, /* 2CB4 */ + {0x2CB6,0x2CB7},{0x2CB6,0x2CB7}, /* 2CB6 */ + {0x2CB8,0x2CB9},{0x2CB8,0x2CB9}, /* 2CB8 */ + {0x2CBA,0x2CBB},{0x2CBA,0x2CBB}, /* 2CBA */ + {0x2CBC,0x2CBD},{0x2CBC,0x2CBD}, /* 2CBC */ + {0x2CBE,0x2CBF},{0x2CBE,0x2CBF}, /* 2CBE */ + {0x2CC0,0x2CC1},{0x2CC0,0x2CC1}, /* 2CC0 */ + {0x2CC2,0x2CC3},{0x2CC2,0x2CC3}, /* 2CC2 */ + {0x2CC4,0x2CC5},{0x2CC4,0x2CC5}, /* 2CC4 */ + {0x2CC6,0x2CC7},{0x2CC6,0x2CC7}, /* 2CC6 */ + {0x2CC8,0x2CC9},{0x2CC8,0x2CC9}, /* 2CC8 */ + {0x2CCA,0x2CCB},{0x2CCA,0x2CCB}, /* 2CCA */ + {0x2CCC,0x2CCD},{0x2CCC,0x2CCD}, /* 2CCC */ + {0x2CCE,0x2CCF},{0x2CCE,0x2CCF}, /* 2CCE */ + {0x2CD0,0x2CD1},{0x2CD0,0x2CD1}, /* 2CD0 */ + {0x2CD2,0x2CD3},{0x2CD2,0x2CD3}, /* 2CD2 */ + {0x2CD4,0x2CD5},{0x2CD4,0x2CD5}, /* 2CD4 */ + {0x2CD6,0x2CD7},{0x2CD6,0x2CD7}, /* 2CD6 */ + {0x2CD8,0x2CD9},{0x2CD8,0x2CD9}, /* 2CD8 */ + {0x2CDA,0x2CDB},{0x2CDA,0x2CDB}, /* 2CDA */ + {0x2CDC,0x2CDD},{0x2CDC,0x2CDD}, /* 2CDC */ + {0x2CDE,0x2CDF},{0x2CDE,0x2CDF}, /* 2CDE */ + {0x2CE0,0x2CE1},{0x2CE0,0x2CE1}, /* 2CE0 */ + {0x2CE2,0x2CE3},{0x2CE2,0x2CE3}, /* 2CE2 */ + {0x2CE4,0x2CE4},{0x2CE5,0x2CE5}, /* 2CE4 */ + {0x2CE6,0x2CE6},{0x2CE7,0x2CE7}, /* 2CE6 */ + {0x2CE8,0x2CE8},{0x2CE9,0x2CE9}, /* 2CE8 */ + {0x2CEA,0x2CEA},{0x2CEB,0x2CEC}, /* 2CEA */ + {0x2CEB,0x2CEC},{0x2CED,0x2CEE}, /* 2CEC */ + {0x2CED,0x2CEE},{0x2CEF,0x2CEF}, /* 2CEE */ + {0x2CF0,0x2CF0},{0x2CF1,0x2CF1}, /* 2CF0 */ + {0x2CF2,0x2CF2},{0x2CF3,0x2CF3}, /* 2CF2 */ + {0x2CF4,0x2CF4},{0x2CF5,0x2CF5}, /* 2CF4 */ + {0x2CF6,0x2CF6},{0x2CF7,0x2CF7}, /* 2CF6 */ + {0x2CF8,0x2CF8},{0x2CF9,0x2CF9}, /* 2CF8 */ + {0x2CFA,0x2CFA},{0x2CFB,0x2CFB}, /* 2CFA */ + {0x2CFC,0x2CFC},{0x2CFD,0x2CFD}, /* 2CFC */ + {0x2CFE,0x2CFE},{0x2CFF,0x2CFF} /* 2CFE */ +}; + +static const MY_CASEFOLD_CHARACTER u520_casefold_page2D[256]={ + {0x10A0,0x2D00},{0x10A1,0x2D01}, /* 2D00 */ + {0x10A2,0x2D02},{0x10A3,0x2D03}, /* 2D02 */ + {0x10A4,0x2D04},{0x10A5,0x2D05}, /* 2D04 */ + {0x10A6,0x2D06},{0x10A7,0x2D07}, /* 2D06 */ + {0x10A8,0x2D08},{0x10A9,0x2D09}, /* 2D08 */ + {0x10AA,0x2D0A},{0x10AB,0x2D0B}, /* 2D0A */ + {0x10AC,0x2D0C},{0x10AD,0x2D0D}, /* 2D0C */ + {0x10AE,0x2D0E},{0x10AF,0x2D0F}, /* 2D0E */ + {0x10B0,0x2D10},{0x10B1,0x2D11}, /* 2D10 */ + {0x10B2,0x2D12},{0x10B3,0x2D13}, /* 2D12 */ + {0x10B4,0x2D14},{0x10B5,0x2D15}, /* 2D14 */ + {0x10B6,0x2D16},{0x10B7,0x2D17}, /* 2D16 */ + {0x10B8,0x2D18},{0x10B9,0x2D19}, /* 2D18 */ + {0x10BA,0x2D1A},{0x10BB,0x2D1B}, /* 2D1A */ + {0x10BC,0x2D1C},{0x10BD,0x2D1D}, /* 2D1C */ + {0x10BE,0x2D1E},{0x10BF,0x2D1F}, /* 2D1E */ + {0x10C0,0x2D20},{0x10C1,0x2D21}, /* 2D20 */ + {0x10C2,0x2D22},{0x10C3,0x2D23}, /* 2D22 */ + {0x10C4,0x2D24},{0x10C5,0x2D25}, /* 2D24 */ + {0x2D26,0x2D26},{0x2D27,0x2D27}, /* 2D26 */ + {0x2D28,0x2D28},{0x2D29,0x2D29}, /* 2D28 */ + {0x2D2A,0x2D2A},{0x2D2B,0x2D2B}, /* 2D2A */ + {0x2D2C,0x2D2C},{0x2D2D,0x2D2D}, /* 2D2C */ + {0x2D2E,0x2D2E},{0x2D2F,0x2D2F}, /* 2D2E */ + {0x2D30,0x2D30},{0x2D31,0x2D31}, /* 2D30 */ + {0x2D32,0x2D32},{0x2D33,0x2D33}, /* 2D32 */ + {0x2D34,0x2D34},{0x2D35,0x2D35}, /* 2D34 */ + {0x2D36,0x2D36},{0x2D37,0x2D37}, /* 2D36 */ + {0x2D38,0x2D38},{0x2D39,0x2D39}, /* 2D38 */ + {0x2D3A,0x2D3A},{0x2D3B,0x2D3B}, /* 2D3A */ + {0x2D3C,0x2D3C},{0x2D3D,0x2D3D}, /* 2D3C */ + {0x2D3E,0x2D3E},{0x2D3F,0x2D3F}, /* 2D3E */ + {0x2D40,0x2D40},{0x2D41,0x2D41}, /* 2D40 */ + {0x2D42,0x2D42},{0x2D43,0x2D43}, /* 2D42 */ + {0x2D44,0x2D44},{0x2D45,0x2D45}, /* 2D44 */ + {0x2D46,0x2D46},{0x2D47,0x2D47}, /* 2D46 */ + {0x2D48,0x2D48},{0x2D49,0x2D49}, /* 2D48 */ + {0x2D4A,0x2D4A},{0x2D4B,0x2D4B}, /* 2D4A */ + {0x2D4C,0x2D4C},{0x2D4D,0x2D4D}, /* 2D4C */ + {0x2D4E,0x2D4E},{0x2D4F,0x2D4F}, /* 2D4E */ + {0x2D50,0x2D50},{0x2D51,0x2D51}, /* 2D50 */ + {0x2D52,0x2D52},{0x2D53,0x2D53}, /* 2D52 */ + {0x2D54,0x2D54},{0x2D55,0x2D55}, /* 2D54 */ + {0x2D56,0x2D56},{0x2D57,0x2D57}, /* 2D56 */ + {0x2D58,0x2D58},{0x2D59,0x2D59}, /* 2D58 */ + {0x2D5A,0x2D5A},{0x2D5B,0x2D5B}, /* 2D5A */ + {0x2D5C,0x2D5C},{0x2D5D,0x2D5D}, /* 2D5C */ + {0x2D5E,0x2D5E},{0x2D5F,0x2D5F}, /* 2D5E */ + {0x2D60,0x2D60},{0x2D61,0x2D61}, /* 2D60 */ + {0x2D62,0x2D62},{0x2D63,0x2D63}, /* 2D62 */ + {0x2D64,0x2D64},{0x2D65,0x2D65}, /* 2D64 */ + {0x2D66,0x2D66},{0x2D67,0x2D67}, /* 2D66 */ + {0x2D68,0x2D68},{0x2D69,0x2D69}, /* 2D68 */ + {0x2D6A,0x2D6A},{0x2D6B,0x2D6B}, /* 2D6A */ + {0x2D6C,0x2D6C},{0x2D6D,0x2D6D}, /* 2D6C */ + {0x2D6E,0x2D6E},{0x2D6F,0x2D6F}, /* 2D6E */ + {0x2D70,0x2D70},{0x2D71,0x2D71}, /* 2D70 */ + {0x2D72,0x2D72},{0x2D73,0x2D73}, /* 2D72 */ + {0x2D74,0x2D74},{0x2D75,0x2D75}, /* 2D74 */ + {0x2D76,0x2D76},{0x2D77,0x2D77}, /* 2D76 */ + {0x2D78,0x2D78},{0x2D79,0x2D79}, /* 2D78 */ + {0x2D7A,0x2D7A},{0x2D7B,0x2D7B}, /* 2D7A */ + {0x2D7C,0x2D7C},{0x2D7D,0x2D7D}, /* 2D7C */ + {0x2D7E,0x2D7E},{0x2D7F,0x2D7F}, /* 2D7E */ + {0x2D80,0x2D80},{0x2D81,0x2D81}, /* 2D80 */ + {0x2D82,0x2D82},{0x2D83,0x2D83}, /* 2D82 */ + {0x2D84,0x2D84},{0x2D85,0x2D85}, /* 2D84 */ + {0x2D86,0x2D86},{0x2D87,0x2D87}, /* 2D86 */ + {0x2D88,0x2D88},{0x2D89,0x2D89}, /* 2D88 */ + {0x2D8A,0x2D8A},{0x2D8B,0x2D8B}, /* 2D8A */ + {0x2D8C,0x2D8C},{0x2D8D,0x2D8D}, /* 2D8C */ + {0x2D8E,0x2D8E},{0x2D8F,0x2D8F}, /* 2D8E */ + {0x2D90,0x2D90},{0x2D91,0x2D91}, /* 2D90 */ + {0x2D92,0x2D92},{0x2D93,0x2D93}, /* 2D92 */ + {0x2D94,0x2D94},{0x2D95,0x2D95}, /* 2D94 */ + {0x2D96,0x2D96},{0x2D97,0x2D97}, /* 2D96 */ + {0x2D98,0x2D98},{0x2D99,0x2D99}, /* 2D98 */ + {0x2D9A,0x2D9A},{0x2D9B,0x2D9B}, /* 2D9A */ + {0x2D9C,0x2D9C},{0x2D9D,0x2D9D}, /* 2D9C */ + {0x2D9E,0x2D9E},{0x2D9F,0x2D9F}, /* 2D9E */ + {0x2DA0,0x2DA0},{0x2DA1,0x2DA1}, /* 2DA0 */ + {0x2DA2,0x2DA2},{0x2DA3,0x2DA3}, /* 2DA2 */ + {0x2DA4,0x2DA4},{0x2DA5,0x2DA5}, /* 2DA4 */ + {0x2DA6,0x2DA6},{0x2DA7,0x2DA7}, /* 2DA6 */ + {0x2DA8,0x2DA8},{0x2DA9,0x2DA9}, /* 2DA8 */ + {0x2DAA,0x2DAA},{0x2DAB,0x2DAB}, /* 2DAA */ + {0x2DAC,0x2DAC},{0x2DAD,0x2DAD}, /* 2DAC */ + {0x2DAE,0x2DAE},{0x2DAF,0x2DAF}, /* 2DAE */ + {0x2DB0,0x2DB0},{0x2DB1,0x2DB1}, /* 2DB0 */ + {0x2DB2,0x2DB2},{0x2DB3,0x2DB3}, /* 2DB2 */ + {0x2DB4,0x2DB4},{0x2DB5,0x2DB5}, /* 2DB4 */ + {0x2DB6,0x2DB6},{0x2DB7,0x2DB7}, /* 2DB6 */ + {0x2DB8,0x2DB8},{0x2DB9,0x2DB9}, /* 2DB8 */ + {0x2DBA,0x2DBA},{0x2DBB,0x2DBB}, /* 2DBA */ + {0x2DBC,0x2DBC},{0x2DBD,0x2DBD}, /* 2DBC */ + {0x2DBE,0x2DBE},{0x2DBF,0x2DBF}, /* 2DBE */ + {0x2DC0,0x2DC0},{0x2DC1,0x2DC1}, /* 2DC0 */ + {0x2DC2,0x2DC2},{0x2DC3,0x2DC3}, /* 2DC2 */ + {0x2DC4,0x2DC4},{0x2DC5,0x2DC5}, /* 2DC4 */ + {0x2DC6,0x2DC6},{0x2DC7,0x2DC7}, /* 2DC6 */ + {0x2DC8,0x2DC8},{0x2DC9,0x2DC9}, /* 2DC8 */ + {0x2DCA,0x2DCA},{0x2DCB,0x2DCB}, /* 2DCA */ + {0x2DCC,0x2DCC},{0x2DCD,0x2DCD}, /* 2DCC */ + {0x2DCE,0x2DCE},{0x2DCF,0x2DCF}, /* 2DCE */ + {0x2DD0,0x2DD0},{0x2DD1,0x2DD1}, /* 2DD0 */ + {0x2DD2,0x2DD2},{0x2DD3,0x2DD3}, /* 2DD2 */ + {0x2DD4,0x2DD4},{0x2DD5,0x2DD5}, /* 2DD4 */ + {0x2DD6,0x2DD6},{0x2DD7,0x2DD7}, /* 2DD6 */ + {0x2DD8,0x2DD8},{0x2DD9,0x2DD9}, /* 2DD8 */ + {0x2DDA,0x2DDA},{0x2DDB,0x2DDB}, /* 2DDA */ + {0x2DDC,0x2DDC},{0x2DDD,0x2DDD}, /* 2DDC */ + {0x2DDE,0x2DDE},{0x2DDF,0x2DDF}, /* 2DDE */ + {0x2DE0,0x2DE0},{0x2DE1,0x2DE1}, /* 2DE0 */ + {0x2DE2,0x2DE2},{0x2DE3,0x2DE3}, /* 2DE2 */ + {0x2DE4,0x2DE4},{0x2DE5,0x2DE5}, /* 2DE4 */ + {0x2DE6,0x2DE6},{0x2DE7,0x2DE7}, /* 2DE6 */ + {0x2DE8,0x2DE8},{0x2DE9,0x2DE9}, /* 2DE8 */ + {0x2DEA,0x2DEA},{0x2DEB,0x2DEB}, /* 2DEA */ + {0x2DEC,0x2DEC},{0x2DED,0x2DED}, /* 2DEC */ + {0x2DEE,0x2DEE},{0x2DEF,0x2DEF}, /* 2DEE */ + {0x2DF0,0x2DF0},{0x2DF1,0x2DF1}, /* 2DF0 */ + {0x2DF2,0x2DF2},{0x2DF3,0x2DF3}, /* 2DF2 */ + {0x2DF4,0x2DF4},{0x2DF5,0x2DF5}, /* 2DF4 */ + {0x2DF6,0x2DF6},{0x2DF7,0x2DF7}, /* 2DF6 */ + {0x2DF8,0x2DF8},{0x2DF9,0x2DF9}, /* 2DF8 */ + {0x2DFA,0x2DFA},{0x2DFB,0x2DFB}, /* 2DFA */ + {0x2DFC,0x2DFC},{0x2DFD,0x2DFD}, /* 2DFC */ + {0x2DFE,0x2DFE},{0x2DFF,0x2DFF} /* 2DFE */ +}; + +static const MY_CASEFOLD_CHARACTER u520_casefold_pageA6[256]={ + {0xA600,0xA600},{0xA601,0xA601}, /* A600 */ + {0xA602,0xA602},{0xA603,0xA603}, /* A602 */ + {0xA604,0xA604},{0xA605,0xA605}, /* A604 */ + {0xA606,0xA606},{0xA607,0xA607}, /* A606 */ + {0xA608,0xA608},{0xA609,0xA609}, /* A608 */ + {0xA60A,0xA60A},{0xA60B,0xA60B}, /* A60A */ + {0xA60C,0xA60C},{0xA60D,0xA60D}, /* A60C */ + {0xA60E,0xA60E},{0xA60F,0xA60F}, /* A60E */ + {0xA610,0xA610},{0xA611,0xA611}, /* A610 */ + {0xA612,0xA612},{0xA613,0xA613}, /* A612 */ + {0xA614,0xA614},{0xA615,0xA615}, /* A614 */ + {0xA616,0xA616},{0xA617,0xA617}, /* A616 */ + {0xA618,0xA618},{0xA619,0xA619}, /* A618 */ + {0xA61A,0xA61A},{0xA61B,0xA61B}, /* A61A */ + {0xA61C,0xA61C},{0xA61D,0xA61D}, /* A61C */ + {0xA61E,0xA61E},{0xA61F,0xA61F}, /* A61E */ + {0xA620,0xA620},{0xA621,0xA621}, /* A620 */ + {0xA622,0xA622},{0xA623,0xA623}, /* A622 */ + {0xA624,0xA624},{0xA625,0xA625}, /* A624 */ + {0xA626,0xA626},{0xA627,0xA627}, /* A626 */ + {0xA628,0xA628},{0xA629,0xA629}, /* A628 */ + {0xA62A,0xA62A},{0xA62B,0xA62B}, /* A62A */ + {0xA62C,0xA62C},{0xA62D,0xA62D}, /* A62C */ + {0xA62E,0xA62E},{0xA62F,0xA62F}, /* A62E */ + {0xA630,0xA630},{0xA631,0xA631}, /* A630 */ + {0xA632,0xA632},{0xA633,0xA633}, /* A632 */ + {0xA634,0xA634},{0xA635,0xA635}, /* A634 */ + {0xA636,0xA636},{0xA637,0xA637}, /* A636 */ + {0xA638,0xA638},{0xA639,0xA639}, /* A638 */ + {0xA63A,0xA63A},{0xA63B,0xA63B}, /* A63A */ + {0xA63C,0xA63C},{0xA63D,0xA63D}, /* A63C */ + {0xA63E,0xA63E},{0xA63F,0xA63F}, /* A63E */ + {0xA640,0xA641},{0xA640,0xA641}, /* A640 */ + {0xA642,0xA643},{0xA642,0xA643}, /* A642 */ + {0xA644,0xA645},{0xA644,0xA645}, /* A644 */ + {0xA646,0xA647},{0xA646,0xA647}, /* A646 */ + {0xA648,0xA649},{0xA648,0xA649}, /* A648 */ + {0xA64A,0xA64B},{0xA64A,0xA64B}, /* A64A */ + {0xA64C,0xA64D},{0xA64C,0xA64D}, /* A64C */ + {0xA64E,0xA64F},{0xA64E,0xA64F}, /* A64E */ + {0xA650,0xA651},{0xA650,0xA651}, /* A650 */ + {0xA652,0xA653},{0xA652,0xA653}, /* A652 */ + {0xA654,0xA655},{0xA654,0xA655}, /* A654 */ + {0xA656,0xA657},{0xA656,0xA657}, /* A656 */ + {0xA658,0xA659},{0xA658,0xA659}, /* A658 */ + {0xA65A,0xA65B},{0xA65A,0xA65B}, /* A65A */ + {0xA65C,0xA65D},{0xA65C,0xA65D}, /* A65C */ + {0xA65E,0xA65F},{0xA65E,0xA65F}, /* A65E */ + {0xA660,0xA660},{0xA661,0xA661}, /* A660 */ + {0xA662,0xA663},{0xA662,0xA663}, /* A662 */ + {0xA664,0xA665},{0xA664,0xA665}, /* A664 */ + {0xA666,0xA667},{0xA666,0xA667}, /* A666 */ + {0xA668,0xA669},{0xA668,0xA669}, /* A668 */ + {0xA66A,0xA66B},{0xA66A,0xA66B}, /* A66A */ + {0xA66C,0xA66D},{0xA66C,0xA66D}, /* A66C */ + {0xA66E,0xA66E},{0xA66F,0xA66F}, /* A66E */ + {0xA670,0xA670},{0xA671,0xA671}, /* A670 */ + {0xA672,0xA672},{0xA673,0xA673}, /* A672 */ + {0xA674,0xA674},{0xA675,0xA675}, /* A674 */ + {0xA676,0xA676},{0xA677,0xA677}, /* A676 */ + {0xA678,0xA678},{0xA679,0xA679}, /* A678 */ + {0xA67A,0xA67A},{0xA67B,0xA67B}, /* A67A */ + {0xA67C,0xA67C},{0xA67D,0xA67D}, /* A67C */ + {0xA67E,0xA67E},{0xA67F,0xA67F}, /* A67E */ + {0xA680,0xA681},{0xA680,0xA681}, /* A680 */ + {0xA682,0xA683},{0xA682,0xA683}, /* A682 */ + {0xA684,0xA685},{0xA684,0xA685}, /* A684 */ + {0xA686,0xA687},{0xA686,0xA687}, /* A686 */ + {0xA688,0xA689},{0xA688,0xA689}, /* A688 */ + {0xA68A,0xA68B},{0xA68A,0xA68B}, /* A68A */ + {0xA68C,0xA68D},{0xA68C,0xA68D}, /* A68C */ + {0xA68E,0xA68F},{0xA68E,0xA68F}, /* A68E */ + {0xA690,0xA691},{0xA690,0xA691}, /* A690 */ + {0xA692,0xA693},{0xA692,0xA693}, /* A692 */ + {0xA694,0xA695},{0xA694,0xA695}, /* A694 */ + {0xA696,0xA697},{0xA696,0xA697}, /* A696 */ + {0xA698,0xA698},{0xA699,0xA699}, /* A698 */ + {0xA69A,0xA69A},{0xA69B,0xA69B}, /* A69A */ + {0xA69C,0xA69C},{0xA69D,0xA69D}, /* A69C */ + {0xA69E,0xA69E},{0xA69F,0xA69F}, /* A69E */ + {0xA6A0,0xA6A0},{0xA6A1,0xA6A1}, /* A6A0 */ + {0xA6A2,0xA6A2},{0xA6A3,0xA6A3}, /* A6A2 */ + {0xA6A4,0xA6A4},{0xA6A5,0xA6A5}, /* A6A4 */ + {0xA6A6,0xA6A6},{0xA6A7,0xA6A7}, /* A6A6 */ + {0xA6A8,0xA6A8},{0xA6A9,0xA6A9}, /* A6A8 */ + {0xA6AA,0xA6AA},{0xA6AB,0xA6AB}, /* A6AA */ + {0xA6AC,0xA6AC},{0xA6AD,0xA6AD}, /* A6AC */ + {0xA6AE,0xA6AE},{0xA6AF,0xA6AF}, /* A6AE */ + {0xA6B0,0xA6B0},{0xA6B1,0xA6B1}, /* A6B0 */ + {0xA6B2,0xA6B2},{0xA6B3,0xA6B3}, /* A6B2 */ + {0xA6B4,0xA6B4},{0xA6B5,0xA6B5}, /* A6B4 */ + {0xA6B6,0xA6B6},{0xA6B7,0xA6B7}, /* A6B6 */ + {0xA6B8,0xA6B8},{0xA6B9,0xA6B9}, /* A6B8 */ + {0xA6BA,0xA6BA},{0xA6BB,0xA6BB}, /* A6BA */ + {0xA6BC,0xA6BC},{0xA6BD,0xA6BD}, /* A6BC */ + {0xA6BE,0xA6BE},{0xA6BF,0xA6BF}, /* A6BE */ + {0xA6C0,0xA6C0},{0xA6C1,0xA6C1}, /* A6C0 */ + {0xA6C2,0xA6C2},{0xA6C3,0xA6C3}, /* A6C2 */ + {0xA6C4,0xA6C4},{0xA6C5,0xA6C5}, /* A6C4 */ + {0xA6C6,0xA6C6},{0xA6C7,0xA6C7}, /* A6C6 */ + {0xA6C8,0xA6C8},{0xA6C9,0xA6C9}, /* A6C8 */ + {0xA6CA,0xA6CA},{0xA6CB,0xA6CB}, /* A6CA */ + {0xA6CC,0xA6CC},{0xA6CD,0xA6CD}, /* A6CC */ + {0xA6CE,0xA6CE},{0xA6CF,0xA6CF}, /* A6CE */ + {0xA6D0,0xA6D0},{0xA6D1,0xA6D1}, /* A6D0 */ + {0xA6D2,0xA6D2},{0xA6D3,0xA6D3}, /* A6D2 */ + {0xA6D4,0xA6D4},{0xA6D5,0xA6D5}, /* A6D4 */ + {0xA6D6,0xA6D6},{0xA6D7,0xA6D7}, /* A6D6 */ + {0xA6D8,0xA6D8},{0xA6D9,0xA6D9}, /* A6D8 */ + {0xA6DA,0xA6DA},{0xA6DB,0xA6DB}, /* A6DA */ + {0xA6DC,0xA6DC},{0xA6DD,0xA6DD}, /* A6DC */ + {0xA6DE,0xA6DE},{0xA6DF,0xA6DF}, /* A6DE */ + {0xA6E0,0xA6E0},{0xA6E1,0xA6E1}, /* A6E0 */ + {0xA6E2,0xA6E2},{0xA6E3,0xA6E3}, /* A6E2 */ + {0xA6E4,0xA6E4},{0xA6E5,0xA6E5}, /* A6E4 */ + {0xA6E6,0xA6E6},{0xA6E7,0xA6E7}, /* A6E6 */ + {0xA6E8,0xA6E8},{0xA6E9,0xA6E9}, /* A6E8 */ + {0xA6EA,0xA6EA},{0xA6EB,0xA6EB}, /* A6EA */ + {0xA6EC,0xA6EC},{0xA6ED,0xA6ED}, /* A6EC */ + {0xA6EE,0xA6EE},{0xA6EF,0xA6EF}, /* A6EE */ + {0xA6F0,0xA6F0},{0xA6F1,0xA6F1}, /* A6F0 */ + {0xA6F2,0xA6F2},{0xA6F3,0xA6F3}, /* A6F2 */ + {0xA6F4,0xA6F4},{0xA6F5,0xA6F5}, /* A6F4 */ + {0xA6F6,0xA6F6},{0xA6F7,0xA6F7}, /* A6F6 */ + {0xA6F8,0xA6F8},{0xA6F9,0xA6F9}, /* A6F8 */ + {0xA6FA,0xA6FA},{0xA6FB,0xA6FB}, /* A6FA */ + {0xA6FC,0xA6FC},{0xA6FD,0xA6FD}, /* A6FC */ + {0xA6FE,0xA6FE},{0xA6FF,0xA6FF} /* A6FE */ +}; + +static const MY_CASEFOLD_CHARACTER u520_casefold_pageA7[256]={ + {0xA700,0xA700},{0xA701,0xA701}, /* A700 */ + {0xA702,0xA702},{0xA703,0xA703}, /* A702 */ + {0xA704,0xA704},{0xA705,0xA705}, /* A704 */ + {0xA706,0xA706},{0xA707,0xA707}, /* A706 */ + {0xA708,0xA708},{0xA709,0xA709}, /* A708 */ + {0xA70A,0xA70A},{0xA70B,0xA70B}, /* A70A */ + {0xA70C,0xA70C},{0xA70D,0xA70D}, /* A70C */ + {0xA70E,0xA70E},{0xA70F,0xA70F}, /* A70E */ + {0xA710,0xA710},{0xA711,0xA711}, /* A710 */ + {0xA712,0xA712},{0xA713,0xA713}, /* A712 */ + {0xA714,0xA714},{0xA715,0xA715}, /* A714 */ + {0xA716,0xA716},{0xA717,0xA717}, /* A716 */ + {0xA718,0xA718},{0xA719,0xA719}, /* A718 */ + {0xA71A,0xA71A},{0xA71B,0xA71B}, /* A71A */ + {0xA71C,0xA71C},{0xA71D,0xA71D}, /* A71C */ + {0xA71E,0xA71E},{0xA71F,0xA71F}, /* A71E */ + {0xA720,0xA720},{0xA721,0xA721}, /* A720 */ + {0xA722,0xA723},{0xA722,0xA723}, /* A722 */ + {0xA724,0xA725},{0xA724,0xA725}, /* A724 */ + {0xA726,0xA727},{0xA726,0xA727}, /* A726 */ + {0xA728,0xA729},{0xA728,0xA729}, /* A728 */ + {0xA72A,0xA72B},{0xA72A,0xA72B}, /* A72A */ + {0xA72C,0xA72D},{0xA72C,0xA72D}, /* A72C */ + {0xA72E,0xA72F},{0xA72E,0xA72F}, /* A72E */ + {0xA730,0xA730},{0xA731,0xA731}, /* A730 */ + {0xA732,0xA733},{0xA732,0xA733}, /* A732 */ + {0xA734,0xA735},{0xA734,0xA735}, /* A734 */ + {0xA736,0xA737},{0xA736,0xA737}, /* A736 */ + {0xA738,0xA739},{0xA738,0xA739}, /* A738 */ + {0xA73A,0xA73B},{0xA73A,0xA73B}, /* A73A */ + {0xA73C,0xA73D},{0xA73C,0xA73D}, /* A73C */ + {0xA73E,0xA73F},{0xA73E,0xA73F}, /* A73E */ + {0xA740,0xA741},{0xA740,0xA741}, /* A740 */ + {0xA742,0xA743},{0xA742,0xA743}, /* A742 */ + {0xA744,0xA745},{0xA744,0xA745}, /* A744 */ + {0xA746,0xA747},{0xA746,0xA747}, /* A746 */ + {0xA748,0xA749},{0xA748,0xA749}, /* A748 */ + {0xA74A,0xA74B},{0xA74A,0xA74B}, /* A74A */ + {0xA74C,0xA74D},{0xA74C,0xA74D}, /* A74C */ + {0xA74E,0xA74F},{0xA74E,0xA74F}, /* A74E */ + {0xA750,0xA751},{0xA750,0xA751}, /* A750 */ + {0xA752,0xA753},{0xA752,0xA753}, /* A752 */ + {0xA754,0xA755},{0xA754,0xA755}, /* A754 */ + {0xA756,0xA757},{0xA756,0xA757}, /* A756 */ + {0xA758,0xA759},{0xA758,0xA759}, /* A758 */ + {0xA75A,0xA75B},{0xA75A,0xA75B}, /* A75A */ + {0xA75C,0xA75D},{0xA75C,0xA75D}, /* A75C */ + {0xA75E,0xA75F},{0xA75E,0xA75F}, /* A75E */ + {0xA760,0xA761},{0xA760,0xA761}, /* A760 */ + {0xA762,0xA763},{0xA762,0xA763}, /* A762 */ + {0xA764,0xA765},{0xA764,0xA765}, /* A764 */ + {0xA766,0xA767},{0xA766,0xA767}, /* A766 */ + {0xA768,0xA769},{0xA768,0xA769}, /* A768 */ + {0xA76A,0xA76B},{0xA76A,0xA76B}, /* A76A */ + {0xA76C,0xA76D},{0xA76C,0xA76D}, /* A76C */ + {0xA76E,0xA76F},{0xA76E,0xA76F}, /* A76E */ + {0xA770,0xA770},{0xA771,0xA771}, /* A770 */ + {0xA772,0xA772},{0xA773,0xA773}, /* A772 */ + {0xA774,0xA774},{0xA775,0xA775}, /* A774 */ + {0xA776,0xA776},{0xA777,0xA777}, /* A776 */ + {0xA778,0xA778},{0xA779,0xA77A}, /* A778 */ + {0xA779,0xA77A},{0xA77B,0xA77C}, /* A77A */ + {0xA77B,0xA77C},{0xA77D,0x1D79}, /* A77C */ + {0xA77E,0xA77F},{0xA77E,0xA77F}, /* A77E */ + {0xA780,0xA781},{0xA780,0xA781}, /* A780 */ + {0xA782,0xA783},{0xA782,0xA783}, /* A782 */ + {0xA784,0xA785},{0xA784,0xA785}, /* A784 */ + {0xA786,0xA787},{0xA786,0xA787}, /* A786 */ + {0xA788,0xA788},{0xA789,0xA789}, /* A788 */ + {0xA78A,0xA78A},{0xA78B,0xA78C}, /* A78A */ + {0xA78B,0xA78C},{0xA78D,0xA78D}, /* A78C */ + {0xA78E,0xA78E},{0xA78F,0xA78F}, /* A78E */ + {0xA790,0xA790},{0xA791,0xA791}, /* A790 */ + {0xA792,0xA792},{0xA793,0xA793}, /* A792 */ + {0xA794,0xA794},{0xA795,0xA795}, /* A794 */ + {0xA796,0xA796},{0xA797,0xA797}, /* A796 */ + {0xA798,0xA798},{0xA799,0xA799}, /* A798 */ + {0xA79A,0xA79A},{0xA79B,0xA79B}, /* A79A */ + {0xA79C,0xA79C},{0xA79D,0xA79D}, /* A79C */ + {0xA79E,0xA79E},{0xA79F,0xA79F}, /* A79E */ + {0xA7A0,0xA7A0},{0xA7A1,0xA7A1}, /* A7A0 */ + {0xA7A2,0xA7A2},{0xA7A3,0xA7A3}, /* A7A2 */ + {0xA7A4,0xA7A4},{0xA7A5,0xA7A5}, /* A7A4 */ + {0xA7A6,0xA7A6},{0xA7A7,0xA7A7}, /* A7A6 */ + {0xA7A8,0xA7A8},{0xA7A9,0xA7A9}, /* A7A8 */ + {0xA7AA,0xA7AA},{0xA7AB,0xA7AB}, /* A7AA */ + {0xA7AC,0xA7AC},{0xA7AD,0xA7AD}, /* A7AC */ + {0xA7AE,0xA7AE},{0xA7AF,0xA7AF}, /* A7AE */ + {0xA7B0,0xA7B0},{0xA7B1,0xA7B1}, /* A7B0 */ + {0xA7B2,0xA7B2},{0xA7B3,0xA7B3}, /* A7B2 */ + {0xA7B4,0xA7B4},{0xA7B5,0xA7B5}, /* A7B4 */ + {0xA7B6,0xA7B6},{0xA7B7,0xA7B7}, /* A7B6 */ + {0xA7B8,0xA7B8},{0xA7B9,0xA7B9}, /* A7B8 */ + {0xA7BA,0xA7BA},{0xA7BB,0xA7BB}, /* A7BA */ + {0xA7BC,0xA7BC},{0xA7BD,0xA7BD}, /* A7BC */ + {0xA7BE,0xA7BE},{0xA7BF,0xA7BF}, /* A7BE */ + {0xA7C0,0xA7C0},{0xA7C1,0xA7C1}, /* A7C0 */ + {0xA7C2,0xA7C2},{0xA7C3,0xA7C3}, /* A7C2 */ + {0xA7C4,0xA7C4},{0xA7C5,0xA7C5}, /* A7C4 */ + {0xA7C6,0xA7C6},{0xA7C7,0xA7C7}, /* A7C6 */ + {0xA7C8,0xA7C8},{0xA7C9,0xA7C9}, /* A7C8 */ + {0xA7CA,0xA7CA},{0xA7CB,0xA7CB}, /* A7CA */ + {0xA7CC,0xA7CC},{0xA7CD,0xA7CD}, /* A7CC */ + {0xA7CE,0xA7CE},{0xA7CF,0xA7CF}, /* A7CE */ + {0xA7D0,0xA7D0},{0xA7D1,0xA7D1}, /* A7D0 */ + {0xA7D2,0xA7D2},{0xA7D3,0xA7D3}, /* A7D2 */ + {0xA7D4,0xA7D4},{0xA7D5,0xA7D5}, /* A7D4 */ + {0xA7D6,0xA7D6},{0xA7D7,0xA7D7}, /* A7D6 */ + {0xA7D8,0xA7D8},{0xA7D9,0xA7D9}, /* A7D8 */ + {0xA7DA,0xA7DA},{0xA7DB,0xA7DB}, /* A7DA */ + {0xA7DC,0xA7DC},{0xA7DD,0xA7DD}, /* A7DC */ + {0xA7DE,0xA7DE},{0xA7DF,0xA7DF}, /* A7DE */ + {0xA7E0,0xA7E0},{0xA7E1,0xA7E1}, /* A7E0 */ + {0xA7E2,0xA7E2},{0xA7E3,0xA7E3}, /* A7E2 */ + {0xA7E4,0xA7E4},{0xA7E5,0xA7E5}, /* A7E4 */ + {0xA7E6,0xA7E6},{0xA7E7,0xA7E7}, /* A7E6 */ + {0xA7E8,0xA7E8},{0xA7E9,0xA7E9}, /* A7E8 */ + {0xA7EA,0xA7EA},{0xA7EB,0xA7EB}, /* A7EA */ + {0xA7EC,0xA7EC},{0xA7ED,0xA7ED}, /* A7EC */ + {0xA7EE,0xA7EE},{0xA7EF,0xA7EF}, /* A7EE */ + {0xA7F0,0xA7F0},{0xA7F1,0xA7F1}, /* A7F0 */ + {0xA7F2,0xA7F2},{0xA7F3,0xA7F3}, /* A7F2 */ + {0xA7F4,0xA7F4},{0xA7F5,0xA7F5}, /* A7F4 */ + {0xA7F6,0xA7F6},{0xA7F7,0xA7F7}, /* A7F6 */ + {0xA7F8,0xA7F8},{0xA7F9,0xA7F9}, /* A7F8 */ + {0xA7FA,0xA7FA},{0xA7FB,0xA7FB}, /* A7FA */ + {0xA7FC,0xA7FC},{0xA7FD,0xA7FD}, /* A7FC */ + {0xA7FE,0xA7FE},{0xA7FF,0xA7FF} /* A7FE */ +}; + +static const MY_CASEFOLD_CHARACTER u520_casefold_pageFF[256]={ + {0xFF00,0xFF00},{0xFF01,0xFF01}, /* FF00 */ + {0xFF02,0xFF02},{0xFF03,0xFF03}, /* FF02 */ + {0xFF04,0xFF04},{0xFF05,0xFF05}, /* FF04 */ + {0xFF06,0xFF06},{0xFF07,0xFF07}, /* FF06 */ + {0xFF08,0xFF08},{0xFF09,0xFF09}, /* FF08 */ + {0xFF0A,0xFF0A},{0xFF0B,0xFF0B}, /* FF0A */ + {0xFF0C,0xFF0C},{0xFF0D,0xFF0D}, /* FF0C */ + {0xFF0E,0xFF0E},{0xFF0F,0xFF0F}, /* FF0E */ + {0xFF10,0xFF10},{0xFF11,0xFF11}, /* FF10 */ + {0xFF12,0xFF12},{0xFF13,0xFF13}, /* FF12 */ + {0xFF14,0xFF14},{0xFF15,0xFF15}, /* FF14 */ + {0xFF16,0xFF16},{0xFF17,0xFF17}, /* FF16 */ + {0xFF18,0xFF18},{0xFF19,0xFF19}, /* FF18 */ + {0xFF1A,0xFF1A},{0xFF1B,0xFF1B}, /* FF1A */ + {0xFF1C,0xFF1C},{0xFF1D,0xFF1D}, /* FF1C */ + {0xFF1E,0xFF1E},{0xFF1F,0xFF1F}, /* FF1E */ + {0xFF20,0xFF20},{0xFF21,0xFF41}, /* FF20 */ + {0xFF22,0xFF42},{0xFF23,0xFF43}, /* FF22 */ + {0xFF24,0xFF44},{0xFF25,0xFF45}, /* FF24 */ + {0xFF26,0xFF46},{0xFF27,0xFF47}, /* FF26 */ + {0xFF28,0xFF48},{0xFF29,0xFF49}, /* FF28 */ + {0xFF2A,0xFF4A},{0xFF2B,0xFF4B}, /* FF2A */ + {0xFF2C,0xFF4C},{0xFF2D,0xFF4D}, /* FF2C */ + {0xFF2E,0xFF4E},{0xFF2F,0xFF4F}, /* FF2E */ + {0xFF30,0xFF50},{0xFF31,0xFF51}, /* FF30 */ + {0xFF32,0xFF52},{0xFF33,0xFF53}, /* FF32 */ + {0xFF34,0xFF54},{0xFF35,0xFF55}, /* FF34 */ + {0xFF36,0xFF56},{0xFF37,0xFF57}, /* FF36 */ + {0xFF38,0xFF58},{0xFF39,0xFF59}, /* FF38 */ + {0xFF3A,0xFF5A},{0xFF3B,0xFF3B}, /* FF3A */ + {0xFF3C,0xFF3C},{0xFF3D,0xFF3D}, /* FF3C */ + {0xFF3E,0xFF3E},{0xFF3F,0xFF3F}, /* FF3E */ + {0xFF40,0xFF40},{0xFF21,0xFF41}, /* FF40 */ + {0xFF22,0xFF42},{0xFF23,0xFF43}, /* FF42 */ + {0xFF24,0xFF44},{0xFF25,0xFF45}, /* FF44 */ + {0xFF26,0xFF46},{0xFF27,0xFF47}, /* FF46 */ + {0xFF28,0xFF48},{0xFF29,0xFF49}, /* FF48 */ + {0xFF2A,0xFF4A},{0xFF2B,0xFF4B}, /* FF4A */ + {0xFF2C,0xFF4C},{0xFF2D,0xFF4D}, /* FF4C */ + {0xFF2E,0xFF4E},{0xFF2F,0xFF4F}, /* FF4E */ + {0xFF30,0xFF50},{0xFF31,0xFF51}, /* FF50 */ + {0xFF32,0xFF52},{0xFF33,0xFF53}, /* FF52 */ + {0xFF34,0xFF54},{0xFF35,0xFF55}, /* FF54 */ + {0xFF36,0xFF56},{0xFF37,0xFF57}, /* FF56 */ + {0xFF38,0xFF58},{0xFF39,0xFF59}, /* FF58 */ + {0xFF3A,0xFF5A},{0xFF5B,0xFF5B}, /* FF5A */ + {0xFF5C,0xFF5C},{0xFF5D,0xFF5D}, /* FF5C */ + {0xFF5E,0xFF5E},{0xFF5F,0xFF5F}, /* FF5E */ + {0xFF60,0xFF60},{0xFF61,0xFF61}, /* FF60 */ + {0xFF62,0xFF62},{0xFF63,0xFF63}, /* FF62 */ + {0xFF64,0xFF64},{0xFF65,0xFF65}, /* FF64 */ + {0xFF66,0xFF66},{0xFF67,0xFF67}, /* FF66 */ + {0xFF68,0xFF68},{0xFF69,0xFF69}, /* FF68 */ + {0xFF6A,0xFF6A},{0xFF6B,0xFF6B}, /* FF6A */ + {0xFF6C,0xFF6C},{0xFF6D,0xFF6D}, /* FF6C */ + {0xFF6E,0xFF6E},{0xFF6F,0xFF6F}, /* FF6E */ + {0xFF70,0xFF70},{0xFF71,0xFF71}, /* FF70 */ + {0xFF72,0xFF72},{0xFF73,0xFF73}, /* FF72 */ + {0xFF74,0xFF74},{0xFF75,0xFF75}, /* FF74 */ + {0xFF76,0xFF76},{0xFF77,0xFF77}, /* FF76 */ + {0xFF78,0xFF78},{0xFF79,0xFF79}, /* FF78 */ + {0xFF7A,0xFF7A},{0xFF7B,0xFF7B}, /* FF7A */ + {0xFF7C,0xFF7C},{0xFF7D,0xFF7D}, /* FF7C */ + {0xFF7E,0xFF7E},{0xFF7F,0xFF7F}, /* FF7E */ + {0xFF80,0xFF80},{0xFF81,0xFF81}, /* FF80 */ + {0xFF82,0xFF82},{0xFF83,0xFF83}, /* FF82 */ + {0xFF84,0xFF84},{0xFF85,0xFF85}, /* FF84 */ + {0xFF86,0xFF86},{0xFF87,0xFF87}, /* FF86 */ + {0xFF88,0xFF88},{0xFF89,0xFF89}, /* FF88 */ + {0xFF8A,0xFF8A},{0xFF8B,0xFF8B}, /* FF8A */ + {0xFF8C,0xFF8C},{0xFF8D,0xFF8D}, /* FF8C */ + {0xFF8E,0xFF8E},{0xFF8F,0xFF8F}, /* FF8E */ + {0xFF90,0xFF90},{0xFF91,0xFF91}, /* FF90 */ + {0xFF92,0xFF92},{0xFF93,0xFF93}, /* FF92 */ + {0xFF94,0xFF94},{0xFF95,0xFF95}, /* FF94 */ + {0xFF96,0xFF96},{0xFF97,0xFF97}, /* FF96 */ + {0xFF98,0xFF98},{0xFF99,0xFF99}, /* FF98 */ + {0xFF9A,0xFF9A},{0xFF9B,0xFF9B}, /* FF9A */ + {0xFF9C,0xFF9C},{0xFF9D,0xFF9D}, /* FF9C */ + {0xFF9E,0xFF9E},{0xFF9F,0xFF9F}, /* FF9E */ + {0xFFA0,0xFFA0},{0xFFA1,0xFFA1}, /* FFA0 */ + {0xFFA2,0xFFA2},{0xFFA3,0xFFA3}, /* FFA2 */ + {0xFFA4,0xFFA4},{0xFFA5,0xFFA5}, /* FFA4 */ + {0xFFA6,0xFFA6},{0xFFA7,0xFFA7}, /* FFA6 */ + {0xFFA8,0xFFA8},{0xFFA9,0xFFA9}, /* FFA8 */ + {0xFFAA,0xFFAA},{0xFFAB,0xFFAB}, /* FFAA */ + {0xFFAC,0xFFAC},{0xFFAD,0xFFAD}, /* FFAC */ + {0xFFAE,0xFFAE},{0xFFAF,0xFFAF}, /* FFAE */ + {0xFFB0,0xFFB0},{0xFFB1,0xFFB1}, /* FFB0 */ + {0xFFB2,0xFFB2},{0xFFB3,0xFFB3}, /* FFB2 */ + {0xFFB4,0xFFB4},{0xFFB5,0xFFB5}, /* FFB4 */ + {0xFFB6,0xFFB6},{0xFFB7,0xFFB7}, /* FFB6 */ + {0xFFB8,0xFFB8},{0xFFB9,0xFFB9}, /* FFB8 */ + {0xFFBA,0xFFBA},{0xFFBB,0xFFBB}, /* FFBA */ + {0xFFBC,0xFFBC},{0xFFBD,0xFFBD}, /* FFBC */ + {0xFFBE,0xFFBE},{0xFFBF,0xFFBF}, /* FFBE */ + {0xFFC0,0xFFC0},{0xFFC1,0xFFC1}, /* FFC0 */ + {0xFFC2,0xFFC2},{0xFFC3,0xFFC3}, /* FFC2 */ + {0xFFC4,0xFFC4},{0xFFC5,0xFFC5}, /* FFC4 */ + {0xFFC6,0xFFC6},{0xFFC7,0xFFC7}, /* FFC6 */ + {0xFFC8,0xFFC8},{0xFFC9,0xFFC9}, /* FFC8 */ + {0xFFCA,0xFFCA},{0xFFCB,0xFFCB}, /* FFCA */ + {0xFFCC,0xFFCC},{0xFFCD,0xFFCD}, /* FFCC */ + {0xFFCE,0xFFCE},{0xFFCF,0xFFCF}, /* FFCE */ + {0xFFD0,0xFFD0},{0xFFD1,0xFFD1}, /* FFD0 */ + {0xFFD2,0xFFD2},{0xFFD3,0xFFD3}, /* FFD2 */ + {0xFFD4,0xFFD4},{0xFFD5,0xFFD5}, /* FFD4 */ + {0xFFD6,0xFFD6},{0xFFD7,0xFFD7}, /* FFD6 */ + {0xFFD8,0xFFD8},{0xFFD9,0xFFD9}, /* FFD8 */ + {0xFFDA,0xFFDA},{0xFFDB,0xFFDB}, /* FFDA */ + {0xFFDC,0xFFDC},{0xFFDD,0xFFDD}, /* FFDC */ + {0xFFDE,0xFFDE},{0xFFDF,0xFFDF}, /* FFDE */ + {0xFFE0,0xFFE0},{0xFFE1,0xFFE1}, /* FFE0 */ + {0xFFE2,0xFFE2},{0xFFE3,0xFFE3}, /* FFE2 */ + {0xFFE4,0xFFE4},{0xFFE5,0xFFE5}, /* FFE4 */ + {0xFFE6,0xFFE6},{0xFFE7,0xFFE7}, /* FFE6 */ + {0xFFE8,0xFFE8},{0xFFE9,0xFFE9}, /* FFE8 */ + {0xFFEA,0xFFEA},{0xFFEB,0xFFEB}, /* FFEA */ + {0xFFEC,0xFFEC},{0xFFED,0xFFED}, /* FFEC */ + {0xFFEE,0xFFEE},{0xFFEF,0xFFEF}, /* FFEE */ + {0xFFF0,0xFFF0},{0xFFF1,0xFFF1}, /* FFF0 */ + {0xFFF2,0xFFF2},{0xFFF3,0xFFF3}, /* FFF2 */ + {0xFFF4,0xFFF4},{0xFFF5,0xFFF5}, /* FFF4 */ + {0xFFF6,0xFFF6},{0xFFF7,0xFFF7}, /* FFF6 */ + {0xFFF8,0xFFF8},{0xFFF9,0xFFF9}, /* FFF8 */ + {0xFFFA,0xFFFA},{0xFFFB,0xFFFB}, /* FFFA */ + {0xFFFC,0xFFFC},{0xFFFD,0xFFFD}, /* FFFC */ + {0xFFFE,0xFFFE},{0xFFFF,0xFFFF} /* FFFE */ +}; + +static const MY_CASEFOLD_CHARACTER u520_casefold_page104[256]={ + {0x10400,0x10428},{0x10401,0x10429}, /* 10400 */ + {0x10402,0x1042A},{0x10403,0x1042B}, /* 10402 */ + {0x10404,0x1042C},{0x10405,0x1042D}, /* 10404 */ + {0x10406,0x1042E},{0x10407,0x1042F}, /* 10406 */ + {0x10408,0x10430},{0x10409,0x10431}, /* 10408 */ + {0x1040A,0x10432},{0x1040B,0x10433}, /* 1040A */ + {0x1040C,0x10434},{0x1040D,0x10435}, /* 1040C */ + {0x1040E,0x10436},{0x1040F,0x10437}, /* 1040E */ + {0x10410,0x10438},{0x10411,0x10439}, /* 10410 */ + {0x10412,0x1043A},{0x10413,0x1043B}, /* 10412 */ + {0x10414,0x1043C},{0x10415,0x1043D}, /* 10414 */ + {0x10416,0x1043E},{0x10417,0x1043F}, /* 10416 */ + {0x10418,0x10440},{0x10419,0x10441}, /* 10418 */ + {0x1041A,0x10442},{0x1041B,0x10443}, /* 1041A */ + {0x1041C,0x10444},{0x1041D,0x10445}, /* 1041C */ + {0x1041E,0x10446},{0x1041F,0x10447}, /* 1041E */ + {0x10420,0x10448},{0x10421,0x10449}, /* 10420 */ + {0x10422,0x1044A},{0x10423,0x1044B}, /* 10422 */ + {0x10424,0x1044C},{0x10425,0x1044D}, /* 10424 */ + {0x10426,0x1044E},{0x10427,0x1044F}, /* 10426 */ + {0x10400,0x10428},{0x10401,0x10429}, /* 10428 */ + {0x10402,0x1042A},{0x10403,0x1042B}, /* 1042A */ + {0x10404,0x1042C},{0x10405,0x1042D}, /* 1042C */ + {0x10406,0x1042E},{0x10407,0x1042F}, /* 1042E */ + {0x10408,0x10430},{0x10409,0x10431}, /* 10430 */ + {0x1040A,0x10432},{0x1040B,0x10433}, /* 10432 */ + {0x1040C,0x10434},{0x1040D,0x10435}, /* 10434 */ + {0x1040E,0x10436},{0x1040F,0x10437}, /* 10436 */ + {0x10410,0x10438},{0x10411,0x10439}, /* 10438 */ + {0x10412,0x1043A},{0x10413,0x1043B}, /* 1043A */ + {0x10414,0x1043C},{0x10415,0x1043D}, /* 1043C */ + {0x10416,0x1043E},{0x10417,0x1043F}, /* 1043E */ + {0x10418,0x10440},{0x10419,0x10441}, /* 10440 */ + {0x1041A,0x10442},{0x1041B,0x10443}, /* 10442 */ + {0x1041C,0x10444},{0x1041D,0x10445}, /* 10444 */ + {0x1041E,0x10446},{0x1041F,0x10447}, /* 10446 */ + {0x10420,0x10448},{0x10421,0x10449}, /* 10448 */ + {0x10422,0x1044A},{0x10423,0x1044B}, /* 1044A */ + {0x10424,0x1044C},{0x10425,0x1044D}, /* 1044C */ + {0x10426,0x1044E},{0x10427,0x1044F}, /* 1044E */ + {0x10450,0x10450},{0x10451,0x10451}, /* 10450 */ + {0x10452,0x10452},{0x10453,0x10453}, /* 10452 */ + {0x10454,0x10454},{0x10455,0x10455}, /* 10454 */ + {0x10456,0x10456},{0x10457,0x10457}, /* 10456 */ + {0x10458,0x10458},{0x10459,0x10459}, /* 10458 */ + {0x1045A,0x1045A},{0x1045B,0x1045B}, /* 1045A */ + {0x1045C,0x1045C},{0x1045D,0x1045D}, /* 1045C */ + {0x1045E,0x1045E},{0x1045F,0x1045F}, /* 1045E */ + {0x10460,0x10460},{0x10461,0x10461}, /* 10460 */ + {0x10462,0x10462},{0x10463,0x10463}, /* 10462 */ + {0x10464,0x10464},{0x10465,0x10465}, /* 10464 */ + {0x10466,0x10466},{0x10467,0x10467}, /* 10466 */ + {0x10468,0x10468},{0x10469,0x10469}, /* 10468 */ + {0x1046A,0x1046A},{0x1046B,0x1046B}, /* 1046A */ + {0x1046C,0x1046C},{0x1046D,0x1046D}, /* 1046C */ + {0x1046E,0x1046E},{0x1046F,0x1046F}, /* 1046E */ + {0x10470,0x10470},{0x10471,0x10471}, /* 10470 */ + {0x10472,0x10472},{0x10473,0x10473}, /* 10472 */ + {0x10474,0x10474},{0x10475,0x10475}, /* 10474 */ + {0x10476,0x10476},{0x10477,0x10477}, /* 10476 */ + {0x10478,0x10478},{0x10479,0x10479}, /* 10478 */ + {0x1047A,0x1047A},{0x1047B,0x1047B}, /* 1047A */ + {0x1047C,0x1047C},{0x1047D,0x1047D}, /* 1047C */ + {0x1047E,0x1047E},{0x1047F,0x1047F}, /* 1047E */ + {0x10480,0x10480},{0x10481,0x10481}, /* 10480 */ + {0x10482,0x10482},{0x10483,0x10483}, /* 10482 */ + {0x10484,0x10484},{0x10485,0x10485}, /* 10484 */ + {0x10486,0x10486},{0x10487,0x10487}, /* 10486 */ + {0x10488,0x10488},{0x10489,0x10489}, /* 10488 */ + {0x1048A,0x1048A},{0x1048B,0x1048B}, /* 1048A */ + {0x1048C,0x1048C},{0x1048D,0x1048D}, /* 1048C */ + {0x1048E,0x1048E},{0x1048F,0x1048F}, /* 1048E */ + {0x10490,0x10490},{0x10491,0x10491}, /* 10490 */ + {0x10492,0x10492},{0x10493,0x10493}, /* 10492 */ + {0x10494,0x10494},{0x10495,0x10495}, /* 10494 */ + {0x10496,0x10496},{0x10497,0x10497}, /* 10496 */ + {0x10498,0x10498},{0x10499,0x10499}, /* 10498 */ + {0x1049A,0x1049A},{0x1049B,0x1049B}, /* 1049A */ + {0x1049C,0x1049C},{0x1049D,0x1049D}, /* 1049C */ + {0x1049E,0x1049E},{0x1049F,0x1049F}, /* 1049E */ + {0x104A0,0x104A0},{0x104A1,0x104A1}, /* 104A0 */ + {0x104A2,0x104A2},{0x104A3,0x104A3}, /* 104A2 */ + {0x104A4,0x104A4},{0x104A5,0x104A5}, /* 104A4 */ + {0x104A6,0x104A6},{0x104A7,0x104A7}, /* 104A6 */ + {0x104A8,0x104A8},{0x104A9,0x104A9}, /* 104A8 */ + {0x104AA,0x104AA},{0x104AB,0x104AB}, /* 104AA */ + {0x104AC,0x104AC},{0x104AD,0x104AD}, /* 104AC */ + {0x104AE,0x104AE},{0x104AF,0x104AF}, /* 104AE */ + {0x104B0,0x104B0},{0x104B1,0x104B1}, /* 104B0 */ + {0x104B2,0x104B2},{0x104B3,0x104B3}, /* 104B2 */ + {0x104B4,0x104B4},{0x104B5,0x104B5}, /* 104B4 */ + {0x104B6,0x104B6},{0x104B7,0x104B7}, /* 104B6 */ + {0x104B8,0x104B8},{0x104B9,0x104B9}, /* 104B8 */ + {0x104BA,0x104BA},{0x104BB,0x104BB}, /* 104BA */ + {0x104BC,0x104BC},{0x104BD,0x104BD}, /* 104BC */ + {0x104BE,0x104BE},{0x104BF,0x104BF}, /* 104BE */ + {0x104C0,0x104C0},{0x104C1,0x104C1}, /* 104C0 */ + {0x104C2,0x104C2},{0x104C3,0x104C3}, /* 104C2 */ + {0x104C4,0x104C4},{0x104C5,0x104C5}, /* 104C4 */ + {0x104C6,0x104C6},{0x104C7,0x104C7}, /* 104C6 */ + {0x104C8,0x104C8},{0x104C9,0x104C9}, /* 104C8 */ + {0x104CA,0x104CA},{0x104CB,0x104CB}, /* 104CA */ + {0x104CC,0x104CC},{0x104CD,0x104CD}, /* 104CC */ + {0x104CE,0x104CE},{0x104CF,0x104CF}, /* 104CE */ + {0x104D0,0x104D0},{0x104D1,0x104D1}, /* 104D0 */ + {0x104D2,0x104D2},{0x104D3,0x104D3}, /* 104D2 */ + {0x104D4,0x104D4},{0x104D5,0x104D5}, /* 104D4 */ + {0x104D6,0x104D6},{0x104D7,0x104D7}, /* 104D6 */ + {0x104D8,0x104D8},{0x104D9,0x104D9}, /* 104D8 */ + {0x104DA,0x104DA},{0x104DB,0x104DB}, /* 104DA */ + {0x104DC,0x104DC},{0x104DD,0x104DD}, /* 104DC */ + {0x104DE,0x104DE},{0x104DF,0x104DF}, /* 104DE */ + {0x104E0,0x104E0},{0x104E1,0x104E1}, /* 104E0 */ + {0x104E2,0x104E2},{0x104E3,0x104E3}, /* 104E2 */ + {0x104E4,0x104E4},{0x104E5,0x104E5}, /* 104E4 */ + {0x104E6,0x104E6},{0x104E7,0x104E7}, /* 104E6 */ + {0x104E8,0x104E8},{0x104E9,0x104E9}, /* 104E8 */ + {0x104EA,0x104EA},{0x104EB,0x104EB}, /* 104EA */ + {0x104EC,0x104EC},{0x104ED,0x104ED}, /* 104EC */ + {0x104EE,0x104EE},{0x104EF,0x104EF}, /* 104EE */ + {0x104F0,0x104F0},{0x104F1,0x104F1}, /* 104F0 */ + {0x104F2,0x104F2},{0x104F3,0x104F3}, /* 104F2 */ + {0x104F4,0x104F4},{0x104F5,0x104F5}, /* 104F4 */ + {0x104F6,0x104F6},{0x104F7,0x104F7}, /* 104F6 */ + {0x104F8,0x104F8},{0x104F9,0x104F9}, /* 104F8 */ + {0x104FA,0x104FA},{0x104FB,0x104FB}, /* 104FA */ + {0x104FC,0x104FC},{0x104FD,0x104FD}, /* 104FC */ + {0x104FE,0x104FE},{0x104FF,0x104FF} /* 104FE */ +}; + +const MY_CASEFOLD_CHARACTER * my_u520_casefold_index[4352]={ + u520_casefold_page00, u520_casefold_page01, u520_casefold_page02, u520_casefold_page03, u520_casefold_page04, u520_casefold_page05, u520_casefold_page06, u520_casefold_page07, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + u520_casefold_page10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, u520_casefold_page1D, u520_casefold_page1E, u520_casefold_page1F, + NULL, u520_casefold_page21, NULL, NULL, u520_casefold_page24, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, u520_casefold_page2C, u520_casefold_page2D, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, u520_casefold_pageA6, u520_casefold_pageA7, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, u520_casefold_pageFF, + NULL, NULL, NULL, NULL, u520_casefold_page104, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL +}; diff --git a/strings/ctype-unidata.c b/strings/ctype-unidata.c new file mode 100644 index 00000000000..58a823d6970 --- /dev/null +++ b/strings/ctype-unidata.c @@ -0,0 +1,79 @@ +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. + Copyright (c) 2009, 2020, MariaDB + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; version 2 + of the License. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1335 USA */ + +#include "strings_def.h" +#include +#include "ctype-mb.h" + +#ifndef EILSEQ +#define EILSEQ ENOENT +#endif + + +#include "ctype-unidata.h" +#include "ctype-unicode300-general_ci.h" +#include "ctype-unicode300-general_mysql500_ci.h" +#include "ctype-unicode300-casefold.h" +#include "ctype-unicode300-casefold-tr.h" +#include "ctype-unicode520-casefold.h" + + + +MY_CASEFOLD_INFO my_casefold_default= +{ + 0xFFFF, + my_u300_casefold_index, + weight_general_ci_index +}; + + +/* + Turkish lower/upper mapping: + 1. LOWER(0x0049 LATIN CAPITAL LETTER I) -> + 0x0131 LATIN SMALL LETTER DOTLESS I + 2. UPPER(0x0069 LATIN SMALL LETTER I) -> + 0x0130 LATIN CAPITAL LETTER I WITH DOT ABOVE +*/ + +MY_CASEFOLD_INFO my_casefold_turkish= +{ + 0xFFFF, + my_u300tr_casefold_index, + weight_general_ci_index +}; + + +/* + general_mysql500_ci is very similar to general_ci, but maps sorting order + for U+00DF to 0x00DF instead of 0x0053. +*/ +MY_CASEFOLD_INFO my_casefold_mysql500= +{ + 0xFFFF, + my_u300_casefold_index, + weight_general_mysql500_ci_index +}; + + + +MY_CASEFOLD_INFO my_casefold_unicode520= +{ + 0x10FFFF, + my_u520_casefold_index, + NULL +}; diff --git a/strings/ctype-unidata.h b/strings/ctype-unidata.h index 24cf3e3ea05..ba3235e47e5 100644 --- a/strings/ctype-unidata.h +++ b/strings/ctype-unidata.h @@ -1,7 +1,7 @@ #ifndef CTYPE_UNIDATA_H_INCLUDED #define CTYPE_UNIDATA_H_INCLUDED /* - Copyright (c) 2018 MariaDB Corporation + Copyright (c) 2018, 2023 MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,43 +17,69 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#define MY_UNICASE_INFO_DEFAULT_MAXCHAR 0xFFFF -extern MY_UNICASE_CHARACTER my_unicase_default_page00[256]; -extern MY_UNICASE_CHARACTER *my_unicase_default_pages[256]; -extern MY_UNICASE_CHARACTER my_unicase_mysql500_page00[256]; -extern MY_UNICASE_CHARACTER *my_unicase_mysql500_pages[256]; +extern const uint16 weight_general_ci_page00[256]; +extern const uint16 *weight_general_ci_index[256]; +extern const uint16 weight_general_mysql500_ci_page00[256]; +extern const uint16 *weight_general_mysql500_ci_index[256]; +extern const MY_CASEFOLD_CHARACTER u300_casefold_page00[256]; static inline my_wc_t my_u300_tolower_7bit(uchar ch) { - return my_unicase_default_page00[ch].tolower; + return u300_casefold_page00[ch].tolower; } static inline my_wc_t my_u300_toupper_7bit(uchar ch) { - return my_unicase_default_page00[ch].toupper; + return u300_casefold_page00[ch].toupper; } -static inline void my_tosort_unicode_bmp(MY_UNICASE_INFO *uni_plane, +static inline my_wc_t my_general_ci_bmp_char_to_weight(my_wc_t wc) +{ + const uint16 *page; + DBUG_ASSERT((wc >> 8) < array_elements(weight_general_ci_index)); + page= weight_general_ci_index[wc >> 8]; + return page ? page[wc & 0xFF] : wc; +} + + +static inline my_wc_t my_general_ci_char_to_weight(my_wc_t wc) +{ + if ((wc >> 8) < array_elements(weight_general_ci_index)) + return my_general_ci_bmp_char_to_weight(wc); + return MY_CS_REPLACEMENT_CHARACTER; +} + + +static inline my_wc_t my_general_mysql500_ci_bmp_char_to_weight(my_wc_t wc) +{ + const uint16 *page; + DBUG_ASSERT((wc >> 8) < array_elements(weight_general_mysql500_ci_index)); + page= weight_general_mysql500_ci_index[wc >> 8]; + return page ? page[wc & 0xFF] : wc; +} + + +static inline void my_tosort_unicode_bmp(MY_CASEFOLD_INFO *uni_plane, my_wc_t *wc) { - const MY_UNICASE_CHARACTER *page; + const uint16 *page; DBUG_ASSERT(*wc <= uni_plane->maxchar); - if ((page= uni_plane->page[*wc >> 8])) - *wc= page[*wc & 0xFF].sort; + if ((page= uni_plane->simple_weight[*wc >> 8])) + *wc= page[*wc & 0xFF]; } -static inline void my_tosort_unicode(MY_UNICASE_INFO *uni_plane, +static inline void my_tosort_unicode(MY_CASEFOLD_INFO *uni_plane, my_wc_t *wc) { if (*wc <= uni_plane->maxchar) { - const MY_UNICASE_CHARACTER *page; - if ((page= uni_plane->page[*wc >> 8])) - *wc= page[*wc & 0xFF].sort; + const uint16 *page; + if ((page= uni_plane->simple_weight[*wc >> 8])) + *wc= page[*wc & 0xFF]; } else { @@ -63,9 +89,9 @@ static inline void my_tosort_unicode(MY_UNICASE_INFO *uni_plane, static inline void -my_tolower_unicode_bmp(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) +my_tolower_unicode_bmp(MY_CASEFOLD_INFO *uni_plane, my_wc_t *wc) { - const MY_UNICASE_CHARACTER *page; + const MY_CASEFOLD_CHARACTER *page; DBUG_ASSERT(*wc <= uni_plane->maxchar); if ((page= uni_plane->page[*wc >> 8])) *wc= page[*wc & 0xFF].tolower; @@ -73,9 +99,9 @@ my_tolower_unicode_bmp(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) static inline void -my_toupper_unicode_bmp(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) +my_toupper_unicode_bmp(MY_CASEFOLD_INFO *uni_plane, my_wc_t *wc) { - const MY_UNICASE_CHARACTER *page; + const MY_CASEFOLD_CHARACTER *page; DBUG_ASSERT(*wc <= uni_plane->maxchar); if ((page= uni_plane->page[*wc >> 8])) *wc= page[*wc & 0xFF].toupper; @@ -83,11 +109,11 @@ my_toupper_unicode_bmp(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) static inline void -my_tolower_unicode(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) +my_tolower_unicode(MY_CASEFOLD_INFO *uni_plane, my_wc_t *wc) { if (*wc <= uni_plane->maxchar) { - const MY_UNICASE_CHARACTER *page; + const MY_CASEFOLD_CHARACTER *page; if ((page= uni_plane->page[(*wc >> 8)])) *wc= page[*wc & 0xFF].tolower; } @@ -95,17 +121,23 @@ my_tolower_unicode(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) static inline void -my_toupper_unicode(MY_UNICASE_INFO *uni_plane, my_wc_t *wc) +my_toupper_unicode(MY_CASEFOLD_INFO *uni_plane, my_wc_t *wc) { if (*wc <= uni_plane->maxchar) { - const MY_UNICASE_CHARACTER *page; + const MY_CASEFOLD_CHARACTER *page; if ((page= uni_plane->page[(*wc >> 8)])) *wc= page[*wc & 0xFF].toupper; } } +extern MY_CASEFOLD_INFO my_casefold_default; +extern MY_CASEFOLD_INFO my_casefold_turkish; +extern MY_CASEFOLD_INFO my_casefold_mysql500; +extern MY_CASEFOLD_INFO my_casefold_unicode520; + + size_t my_strxfrm_pad_nweights_unicode(uchar *str, uchar *strend, size_t nweights); size_t my_strxfrm_pad_unicode(uchar *str, uchar *strend); diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 01beb8c9f19..8656f1f0593 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -113,4543 +113,18 @@ int my_valid_mbcharlen_utf8mb3(const uchar *s, const uchar *e) #include "my_uctype.h" -MY_UNICASE_CHARACTER my_unicase_default_page00[]={ - {0x0000,0x0000,0x0000}, {0x0001,0x0001,0x0001}, - {0x0002,0x0002,0x0002}, {0x0003,0x0003,0x0003}, - {0x0004,0x0004,0x0004}, {0x0005,0x0005,0x0005}, - {0x0006,0x0006,0x0006}, {0x0007,0x0007,0x0007}, - {0x0008,0x0008,0x0008}, {0x0009,0x0009,0x0009}, - {0x000A,0x000A,0x000A}, {0x000B,0x000B,0x000B}, - {0x000C,0x000C,0x000C}, {0x000D,0x000D,0x000D}, - {0x000E,0x000E,0x000E}, {0x000F,0x000F,0x000F}, - {0x0010,0x0010,0x0010}, {0x0011,0x0011,0x0011}, - {0x0012,0x0012,0x0012}, {0x0013,0x0013,0x0013}, - {0x0014,0x0014,0x0014}, {0x0015,0x0015,0x0015}, - {0x0016,0x0016,0x0016}, {0x0017,0x0017,0x0017}, - {0x0018,0x0018,0x0018}, {0x0019,0x0019,0x0019}, - {0x001A,0x001A,0x001A}, {0x001B,0x001B,0x001B}, - {0x001C,0x001C,0x001C}, {0x001D,0x001D,0x001D}, - {0x001E,0x001E,0x001E}, {0x001F,0x001F,0x001F}, - {0x0020,0x0020,0x0020}, {0x0021,0x0021,0x0021}, - {0x0022,0x0022,0x0022}, {0x0023,0x0023,0x0023}, - {0x0024,0x0024,0x0024}, {0x0025,0x0025,0x0025}, - {0x0026,0x0026,0x0026}, {0x0027,0x0027,0x0027}, - {0x0028,0x0028,0x0028}, {0x0029,0x0029,0x0029}, - {0x002A,0x002A,0x002A}, {0x002B,0x002B,0x002B}, - {0x002C,0x002C,0x002C}, {0x002D,0x002D,0x002D}, - {0x002E,0x002E,0x002E}, {0x002F,0x002F,0x002F}, - {0x0030,0x0030,0x0030}, {0x0031,0x0031,0x0031}, - {0x0032,0x0032,0x0032}, {0x0033,0x0033,0x0033}, - {0x0034,0x0034,0x0034}, {0x0035,0x0035,0x0035}, - {0x0036,0x0036,0x0036}, {0x0037,0x0037,0x0037}, - {0x0038,0x0038,0x0038}, {0x0039,0x0039,0x0039}, - {0x003A,0x003A,0x003A}, {0x003B,0x003B,0x003B}, - {0x003C,0x003C,0x003C}, {0x003D,0x003D,0x003D}, - {0x003E,0x003E,0x003E}, {0x003F,0x003F,0x003F}, - {0x0040,0x0040,0x0040}, {0x0041,0x0061,0x0041}, - {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043}, - {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045}, - {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047}, - {0x0048,0x0068,0x0048}, {0x0049,0x0069,0x0049}, - {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B}, - {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D}, - {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F}, - {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051}, - {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053}, - {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055}, - {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057}, - {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059}, - {0x005A,0x007A,0x005A}, {0x005B,0x005B,0x005B}, - {0x005C,0x005C,0x005C}, {0x005D,0x005D,0x005D}, - {0x005E,0x005E,0x005E}, {0x005F,0x005F,0x005F}, - {0x0060,0x0060,0x0060}, {0x0041,0x0061,0x0041}, - {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043}, - {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045}, - {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047}, - {0x0048,0x0068,0x0048}, {0x0049,0x0069,0x0049}, - {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B}, - {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D}, - {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F}, - {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051}, - {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053}, - {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055}, - {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057}, - {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059}, - {0x005A,0x007A,0x005A}, {0x007B,0x007B,0x007B}, - {0x007C,0x007C,0x007C}, {0x007D,0x007D,0x007D}, - {0x007E,0x007E,0x007E}, {0x007F,0x007F,0x007F}, - {0x0080,0x0080,0x0080}, {0x0081,0x0081,0x0081}, - {0x0082,0x0082,0x0082}, {0x0083,0x0083,0x0083}, - {0x0084,0x0084,0x0084}, {0x0085,0x0085,0x0085}, - {0x0086,0x0086,0x0086}, {0x0087,0x0087,0x0087}, - {0x0088,0x0088,0x0088}, {0x0089,0x0089,0x0089}, - {0x008A,0x008A,0x008A}, {0x008B,0x008B,0x008B}, - {0x008C,0x008C,0x008C}, {0x008D,0x008D,0x008D}, - {0x008E,0x008E,0x008E}, {0x008F,0x008F,0x008F}, - {0x0090,0x0090,0x0090}, {0x0091,0x0091,0x0091}, - {0x0092,0x0092,0x0092}, {0x0093,0x0093,0x0093}, - {0x0094,0x0094,0x0094}, {0x0095,0x0095,0x0095}, - {0x0096,0x0096,0x0096}, {0x0097,0x0097,0x0097}, - {0x0098,0x0098,0x0098}, {0x0099,0x0099,0x0099}, - {0x009A,0x009A,0x009A}, {0x009B,0x009B,0x009B}, - {0x009C,0x009C,0x009C}, {0x009D,0x009D,0x009D}, - {0x009E,0x009E,0x009E}, {0x009F,0x009F,0x009F}, - {0x00A0,0x00A0,0x00A0}, {0x00A1,0x00A1,0x00A1}, - {0x00A2,0x00A2,0x00A2}, {0x00A3,0x00A3,0x00A3}, - {0x00A4,0x00A4,0x00A4}, {0x00A5,0x00A5,0x00A5}, - {0x00A6,0x00A6,0x00A6}, {0x00A7,0x00A7,0x00A7}, - {0x00A8,0x00A8,0x00A8}, {0x00A9,0x00A9,0x00A9}, - {0x00AA,0x00AA,0x00AA}, {0x00AB,0x00AB,0x00AB}, - {0x00AC,0x00AC,0x00AC}, {0x00AD,0x00AD,0x00AD}, - {0x00AE,0x00AE,0x00AE}, {0x00AF,0x00AF,0x00AF}, - {0x00B0,0x00B0,0x00B0}, {0x00B1,0x00B1,0x00B1}, - {0x00B2,0x00B2,0x00B2}, {0x00B3,0x00B3,0x00B3}, - {0x00B4,0x00B4,0x00B4}, {0x039C,0x00B5,0x039C}, - {0x00B6,0x00B6,0x00B6}, {0x00B7,0x00B7,0x00B7}, - {0x00B8,0x00B8,0x00B8}, {0x00B9,0x00B9,0x00B9}, - {0x00BA,0x00BA,0x00BA}, {0x00BB,0x00BB,0x00BB}, - {0x00BC,0x00BC,0x00BC}, {0x00BD,0x00BD,0x00BD}, - {0x00BE,0x00BE,0x00BE}, {0x00BF,0x00BF,0x00BF}, - {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041}, - {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041}, - {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041}, - {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043}, - {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045}, - {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045}, - {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049}, - {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049}, - {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E}, - {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F}, - {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F}, - {0x00D6,0x00F6,0x004F}, {0x00D7,0x00D7,0x00D7}, - {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055}, - {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055}, - {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059}, - {0x00DE,0x00FE,0x00DE}, {0x00DF,0x00DF,0x0053}, - {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041}, - {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041}, - {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041}, - {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043}, - {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045}, - {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045}, - {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049}, - {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049}, - {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E}, - {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F}, - {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F}, - {0x00D6,0x00F6,0x004F}, {0x00F7,0x00F7,0x00F7}, - {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055}, - {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055}, - {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059}, - {0x00DE,0x00FE,0x00DE}, {0x0178,0x00FF,0x0059} -}; - - -/* - Almost similar to my_unicase_default_page00, but maps sorting order - for U+00DF to 0x00DF instead of 0x0053. -*/ -MY_UNICASE_CHARACTER my_unicase_mysql500_page00[]={ - {0x0000,0x0000,0x0000}, {0x0001,0x0001,0x0001}, - {0x0002,0x0002,0x0002}, {0x0003,0x0003,0x0003}, - {0x0004,0x0004,0x0004}, {0x0005,0x0005,0x0005}, - {0x0006,0x0006,0x0006}, {0x0007,0x0007,0x0007}, - {0x0008,0x0008,0x0008}, {0x0009,0x0009,0x0009}, - {0x000A,0x000A,0x000A}, {0x000B,0x000B,0x000B}, - {0x000C,0x000C,0x000C}, {0x000D,0x000D,0x000D}, - {0x000E,0x000E,0x000E}, {0x000F,0x000F,0x000F}, - {0x0010,0x0010,0x0010}, {0x0011,0x0011,0x0011}, - {0x0012,0x0012,0x0012}, {0x0013,0x0013,0x0013}, - {0x0014,0x0014,0x0014}, {0x0015,0x0015,0x0015}, - {0x0016,0x0016,0x0016}, {0x0017,0x0017,0x0017}, - {0x0018,0x0018,0x0018}, {0x0019,0x0019,0x0019}, - {0x001A,0x001A,0x001A}, {0x001B,0x001B,0x001B}, - {0x001C,0x001C,0x001C}, {0x001D,0x001D,0x001D}, - {0x001E,0x001E,0x001E}, {0x001F,0x001F,0x001F}, - {0x0020,0x0020,0x0020}, {0x0021,0x0021,0x0021}, - {0x0022,0x0022,0x0022}, {0x0023,0x0023,0x0023}, - {0x0024,0x0024,0x0024}, {0x0025,0x0025,0x0025}, - {0x0026,0x0026,0x0026}, {0x0027,0x0027,0x0027}, - {0x0028,0x0028,0x0028}, {0x0029,0x0029,0x0029}, - {0x002A,0x002A,0x002A}, {0x002B,0x002B,0x002B}, - {0x002C,0x002C,0x002C}, {0x002D,0x002D,0x002D}, - {0x002E,0x002E,0x002E}, {0x002F,0x002F,0x002F}, - {0x0030,0x0030,0x0030}, {0x0031,0x0031,0x0031}, - {0x0032,0x0032,0x0032}, {0x0033,0x0033,0x0033}, - {0x0034,0x0034,0x0034}, {0x0035,0x0035,0x0035}, - {0x0036,0x0036,0x0036}, {0x0037,0x0037,0x0037}, - {0x0038,0x0038,0x0038}, {0x0039,0x0039,0x0039}, - {0x003A,0x003A,0x003A}, {0x003B,0x003B,0x003B}, - {0x003C,0x003C,0x003C}, {0x003D,0x003D,0x003D}, - {0x003E,0x003E,0x003E}, {0x003F,0x003F,0x003F}, - {0x0040,0x0040,0x0040}, {0x0041,0x0061,0x0041}, - {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043}, - {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045}, - {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047}, - {0x0048,0x0068,0x0048}, {0x0049,0x0069,0x0049}, - {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B}, - {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D}, - {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F}, - {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051}, - {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053}, - {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055}, - {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057}, - {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059}, - {0x005A,0x007A,0x005A}, {0x005B,0x005B,0x005B}, - {0x005C,0x005C,0x005C}, {0x005D,0x005D,0x005D}, - {0x005E,0x005E,0x005E}, {0x005F,0x005F,0x005F}, - {0x0060,0x0060,0x0060}, {0x0041,0x0061,0x0041}, - {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043}, - {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045}, - {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047}, - {0x0048,0x0068,0x0048}, {0x0049,0x0069,0x0049}, - {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B}, - {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D}, - {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F}, - {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051}, - {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053}, - {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055}, - {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057}, - {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059}, - {0x005A,0x007A,0x005A}, {0x007B,0x007B,0x007B}, - {0x007C,0x007C,0x007C}, {0x007D,0x007D,0x007D}, - {0x007E,0x007E,0x007E}, {0x007F,0x007F,0x007F}, - {0x0080,0x0080,0x0080}, {0x0081,0x0081,0x0081}, - {0x0082,0x0082,0x0082}, {0x0083,0x0083,0x0083}, - {0x0084,0x0084,0x0084}, {0x0085,0x0085,0x0085}, - {0x0086,0x0086,0x0086}, {0x0087,0x0087,0x0087}, - {0x0088,0x0088,0x0088}, {0x0089,0x0089,0x0089}, - {0x008A,0x008A,0x008A}, {0x008B,0x008B,0x008B}, - {0x008C,0x008C,0x008C}, {0x008D,0x008D,0x008D}, - {0x008E,0x008E,0x008E}, {0x008F,0x008F,0x008F}, - {0x0090,0x0090,0x0090}, {0x0091,0x0091,0x0091}, - {0x0092,0x0092,0x0092}, {0x0093,0x0093,0x0093}, - {0x0094,0x0094,0x0094}, {0x0095,0x0095,0x0095}, - {0x0096,0x0096,0x0096}, {0x0097,0x0097,0x0097}, - {0x0098,0x0098,0x0098}, {0x0099,0x0099,0x0099}, - {0x009A,0x009A,0x009A}, {0x009B,0x009B,0x009B}, - {0x009C,0x009C,0x009C}, {0x009D,0x009D,0x009D}, - {0x009E,0x009E,0x009E}, {0x009F,0x009F,0x009F}, - {0x00A0,0x00A0,0x00A0}, {0x00A1,0x00A1,0x00A1}, - {0x00A2,0x00A2,0x00A2}, {0x00A3,0x00A3,0x00A3}, - {0x00A4,0x00A4,0x00A4}, {0x00A5,0x00A5,0x00A5}, - {0x00A6,0x00A6,0x00A6}, {0x00A7,0x00A7,0x00A7}, - {0x00A8,0x00A8,0x00A8}, {0x00A9,0x00A9,0x00A9}, - {0x00AA,0x00AA,0x00AA}, {0x00AB,0x00AB,0x00AB}, - {0x00AC,0x00AC,0x00AC}, {0x00AD,0x00AD,0x00AD}, - {0x00AE,0x00AE,0x00AE}, {0x00AF,0x00AF,0x00AF}, - {0x00B0,0x00B0,0x00B0}, {0x00B1,0x00B1,0x00B1}, - {0x00B2,0x00B2,0x00B2}, {0x00B3,0x00B3,0x00B3}, - {0x00B4,0x00B4,0x00B4}, {0x039C,0x00B5,0x039C}, - {0x00B6,0x00B6,0x00B6}, {0x00B7,0x00B7,0x00B7}, - {0x00B8,0x00B8,0x00B8}, {0x00B9,0x00B9,0x00B9}, - {0x00BA,0x00BA,0x00BA}, {0x00BB,0x00BB,0x00BB}, - {0x00BC,0x00BC,0x00BC}, {0x00BD,0x00BD,0x00BD}, - {0x00BE,0x00BE,0x00BE}, {0x00BF,0x00BF,0x00BF}, - {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041}, - {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041}, - {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041}, - {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043}, - {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045}, - {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045}, - {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049}, - {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049}, - {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E}, - {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F}, - {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F}, - {0x00D6,0x00F6,0x004F}, {0x00D7,0x00D7,0x00D7}, - {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055}, - {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055}, - {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059}, - {0x00DE,0x00FE,0x00DE}, {0x00DF,0x00DF,0x00DF}, - {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041}, - {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041}, - {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041}, - {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043}, - {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045}, - {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045}, - {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049}, - {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049}, - {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E}, - {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F}, - {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F}, - {0x00D6,0x00F6,0x004F}, {0x00F7,0x00F7,0x00F7}, - {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055}, - {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055}, - {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059}, - {0x00DE,0x00FE,0x00DE}, {0x0178,0x00FF,0x0059} -}; - - -static MY_UNICASE_CHARACTER plane01[]={ - {0x0100,0x0101,0x0041}, {0x0100,0x0101,0x0041}, - {0x0102,0x0103,0x0041}, {0x0102,0x0103,0x0041}, - {0x0104,0x0105,0x0041}, {0x0104,0x0105,0x0041}, - {0x0106,0x0107,0x0043}, {0x0106,0x0107,0x0043}, - {0x0108,0x0109,0x0043}, {0x0108,0x0109,0x0043}, - {0x010A,0x010B,0x0043}, {0x010A,0x010B,0x0043}, - {0x010C,0x010D,0x0043}, {0x010C,0x010D,0x0043}, - {0x010E,0x010F,0x0044}, {0x010E,0x010F,0x0044}, - {0x0110,0x0111,0x0110}, {0x0110,0x0111,0x0110}, - {0x0112,0x0113,0x0045}, {0x0112,0x0113,0x0045}, - {0x0114,0x0115,0x0045}, {0x0114,0x0115,0x0045}, - {0x0116,0x0117,0x0045}, {0x0116,0x0117,0x0045}, - {0x0118,0x0119,0x0045}, {0x0118,0x0119,0x0045}, - {0x011A,0x011B,0x0045}, {0x011A,0x011B,0x0045}, - {0x011C,0x011D,0x0047}, {0x011C,0x011D,0x0047}, - {0x011E,0x011F,0x0047}, {0x011E,0x011F,0x0047}, - {0x0120,0x0121,0x0047}, {0x0120,0x0121,0x0047}, - {0x0122,0x0123,0x0047}, {0x0122,0x0123,0x0047}, - {0x0124,0x0125,0x0048}, {0x0124,0x0125,0x0048}, - {0x0126,0x0127,0x0126}, {0x0126,0x0127,0x0126}, - {0x0128,0x0129,0x0049}, {0x0128,0x0129,0x0049}, - {0x012A,0x012B,0x0049}, {0x012A,0x012B,0x0049}, - {0x012C,0x012D,0x0049}, {0x012C,0x012D,0x0049}, - {0x012E,0x012F,0x0049}, {0x012E,0x012F,0x0049}, - {0x0130,0x0069,0x0049}, {0x0049,0x0131,0x0049}, - {0x0132,0x0133,0x0132}, {0x0132,0x0133,0x0132}, - {0x0134,0x0135,0x004A}, {0x0134,0x0135,0x004A}, - {0x0136,0x0137,0x004B}, {0x0136,0x0137,0x004B}, - {0x0138,0x0138,0x0138}, {0x0139,0x013A,0x004C}, - {0x0139,0x013A,0x004C}, {0x013B,0x013C,0x004C}, - {0x013B,0x013C,0x004C}, {0x013D,0x013E,0x004C}, - {0x013D,0x013E,0x004C}, {0x013F,0x0140,0x013F}, - {0x013F,0x0140,0x013F}, {0x0141,0x0142,0x0141}, - {0x0141,0x0142,0x0141}, {0x0143,0x0144,0x004E}, - {0x0143,0x0144,0x004E}, {0x0145,0x0146,0x004E}, - {0x0145,0x0146,0x004E}, {0x0147,0x0148,0x004E}, - {0x0147,0x0148,0x004E}, {0x0149,0x0149,0x0149}, - {0x014A,0x014B,0x014A}, {0x014A,0x014B,0x014A}, - {0x014C,0x014D,0x004F}, {0x014C,0x014D,0x004F}, - {0x014E,0x014F,0x004F}, {0x014E,0x014F,0x004F}, - {0x0150,0x0151,0x004F}, {0x0150,0x0151,0x004F}, - {0x0152,0x0153,0x0152}, {0x0152,0x0153,0x0152}, - {0x0154,0x0155,0x0052}, {0x0154,0x0155,0x0052}, - {0x0156,0x0157,0x0052}, {0x0156,0x0157,0x0052}, - {0x0158,0x0159,0x0052}, {0x0158,0x0159,0x0052}, - {0x015A,0x015B,0x0053}, {0x015A,0x015B,0x0053}, - {0x015C,0x015D,0x0053}, {0x015C,0x015D,0x0053}, - {0x015E,0x015F,0x0053}, {0x015E,0x015F,0x0053}, - {0x0160,0x0161,0x0053}, {0x0160,0x0161,0x0053}, - {0x0162,0x0163,0x0054}, {0x0162,0x0163,0x0054}, - {0x0164,0x0165,0x0054}, {0x0164,0x0165,0x0054}, - {0x0166,0x0167,0x0166}, {0x0166,0x0167,0x0166}, - {0x0168,0x0169,0x0055}, {0x0168,0x0169,0x0055}, - {0x016A,0x016B,0x0055}, {0x016A,0x016B,0x0055}, - {0x016C,0x016D,0x0055}, {0x016C,0x016D,0x0055}, - {0x016E,0x016F,0x0055}, {0x016E,0x016F,0x0055}, - {0x0170,0x0171,0x0055}, {0x0170,0x0171,0x0055}, - {0x0172,0x0173,0x0055}, {0x0172,0x0173,0x0055}, - {0x0174,0x0175,0x0057}, {0x0174,0x0175,0x0057}, - {0x0176,0x0177,0x0059}, {0x0176,0x0177,0x0059}, - {0x0178,0x00FF,0x0059}, {0x0179,0x017A,0x005A}, - {0x0179,0x017A,0x005A}, {0x017B,0x017C,0x005A}, - {0x017B,0x017C,0x005A}, {0x017D,0x017E,0x005A}, - {0x017D,0x017E,0x005A}, {0x0053,0x017F,0x0053}, - {0x0180,0x0180,0x0180}, {0x0181,0x0253,0x0181}, - {0x0182,0x0183,0x0182}, {0x0182,0x0183,0x0182}, - {0x0184,0x0185,0x0184}, {0x0184,0x0185,0x0184}, - {0x0186,0x0254,0x0186}, {0x0187,0x0188,0x0187}, - {0x0187,0x0188,0x0187}, {0x0189,0x0256,0x0189}, - {0x018A,0x0257,0x018A}, {0x018B,0x018C,0x018B}, - {0x018B,0x018C,0x018B}, {0x018D,0x018D,0x018D}, - {0x018E,0x01DD,0x018E}, {0x018F,0x0259,0x018F}, - {0x0190,0x025B,0x0190}, {0x0191,0x0192,0x0191}, - {0x0191,0x0192,0x0191}, {0x0193,0x0260,0x0193}, - {0x0194,0x0263,0x0194}, {0x01F6,0x0195,0x01F6}, - {0x0196,0x0269,0x0196}, {0x0197,0x0268,0x0197}, - {0x0198,0x0199,0x0198}, {0x0198,0x0199,0x0198}, - {0x019A,0x019A,0x019A}, {0x019B,0x019B,0x019B}, - {0x019C,0x026F,0x019C}, {0x019D,0x0272,0x019D}, - {0x019E,0x019E,0x019E}, {0x019F,0x0275,0x019F}, - {0x01A0,0x01A1,0x004F}, {0x01A0,0x01A1,0x004F}, - {0x01A2,0x01A3,0x01A2}, {0x01A2,0x01A3,0x01A2}, - {0x01A4,0x01A5,0x01A4}, {0x01A4,0x01A5,0x01A4}, - {0x01A6,0x0280,0x01A6}, {0x01A7,0x01A8,0x01A7}, - {0x01A7,0x01A8,0x01A7}, {0x01A9,0x0283,0x01A9}, - {0x01AA,0x01AA,0x01AA}, {0x01AB,0x01AB,0x01AB}, - {0x01AC,0x01AD,0x01AC}, {0x01AC,0x01AD,0x01AC}, - {0x01AE,0x0288,0x01AE}, {0x01AF,0x01B0,0x0055}, - {0x01AF,0x01B0,0x0055}, {0x01B1,0x028A,0x01B1}, - {0x01B2,0x028B,0x01B2}, {0x01B3,0x01B4,0x01B3}, - {0x01B3,0x01B4,0x01B3}, {0x01B5,0x01B6,0x01B5}, - {0x01B5,0x01B6,0x01B5}, {0x01B7,0x0292,0x01B7}, - {0x01B8,0x01B9,0x01B8}, {0x01B8,0x01B9,0x01B8}, - {0x01BA,0x01BA,0x01BA}, {0x01BB,0x01BB,0x01BB}, - {0x01BC,0x01BD,0x01BC}, {0x01BC,0x01BD,0x01BC}, - {0x01BE,0x01BE,0x01BE}, {0x01F7,0x01BF,0x01F7}, - {0x01C0,0x01C0,0x01C0}, {0x01C1,0x01C1,0x01C1}, - {0x01C2,0x01C2,0x01C2}, {0x01C3,0x01C3,0x01C3}, - {0x01C4,0x01C6,0x01C4}, {0x01C4,0x01C6,0x01C4}, - {0x01C4,0x01C6,0x01C4}, {0x01C7,0x01C9,0x01C7}, - {0x01C7,0x01C9,0x01C7}, {0x01C7,0x01C9,0x01C7}, - {0x01CA,0x01CC,0x01CA}, {0x01CA,0x01CC,0x01CA}, - {0x01CA,0x01CC,0x01CA}, {0x01CD,0x01CE,0x0041}, - {0x01CD,0x01CE,0x0041}, {0x01CF,0x01D0,0x0049}, - {0x01CF,0x01D0,0x0049}, {0x01D1,0x01D2,0x004F}, - {0x01D1,0x01D2,0x004F}, {0x01D3,0x01D4,0x0055}, - {0x01D3,0x01D4,0x0055}, {0x01D5,0x01D6,0x0055}, - {0x01D5,0x01D6,0x0055}, {0x01D7,0x01D8,0x0055}, - {0x01D7,0x01D8,0x0055}, {0x01D9,0x01DA,0x0055}, - {0x01D9,0x01DA,0x0055}, {0x01DB,0x01DC,0x0055}, - {0x01DB,0x01DC,0x0055}, {0x018E,0x01DD,0x018E}, - {0x01DE,0x01DF,0x0041}, {0x01DE,0x01DF,0x0041}, - {0x01E0,0x01E1,0x0041}, {0x01E0,0x01E1,0x0041}, - {0x01E2,0x01E3,0x00C6}, {0x01E2,0x01E3,0x00C6}, - {0x01E4,0x01E5,0x01E4}, {0x01E4,0x01E5,0x01E4}, - {0x01E6,0x01E7,0x0047}, {0x01E6,0x01E7,0x0047}, - {0x01E8,0x01E9,0x004B}, {0x01E8,0x01E9,0x004B}, - {0x01EA,0x01EB,0x004F}, {0x01EA,0x01EB,0x004F}, - {0x01EC,0x01ED,0x004F}, {0x01EC,0x01ED,0x004F}, - {0x01EE,0x01EF,0x01B7}, {0x01EE,0x01EF,0x01B7}, - {0x01F0,0x01F0,0x004A}, {0x01F1,0x01F3,0x01F1}, - {0x01F1,0x01F3,0x01F1}, {0x01F1,0x01F3,0x01F1}, - {0x01F4,0x01F5,0x0047}, {0x01F4,0x01F5,0x0047}, - {0x01F6,0x0195,0x01F6}, {0x01F7,0x01BF,0x01F7}, - {0x01F8,0x01F9,0x004E}, {0x01F8,0x01F9,0x004E}, - {0x01FA,0x01FB,0x0041}, {0x01FA,0x01FB,0x0041}, - {0x01FC,0x01FD,0x00C6}, {0x01FC,0x01FD,0x00C6}, - {0x01FE,0x01FF,0x00D8}, {0x01FE,0x01FF,0x00D8} -}; - -static MY_UNICASE_CHARACTER plane02[]={ - {0x0200,0x0201,0x0041}, {0x0200,0x0201,0x0041}, - {0x0202,0x0203,0x0041}, {0x0202,0x0203,0x0041}, - {0x0204,0x0205,0x0045}, {0x0204,0x0205,0x0045}, - {0x0206,0x0207,0x0045}, {0x0206,0x0207,0x0045}, - {0x0208,0x0209,0x0049}, {0x0208,0x0209,0x0049}, - {0x020A,0x020B,0x0049}, {0x020A,0x020B,0x0049}, - {0x020C,0x020D,0x004F}, {0x020C,0x020D,0x004F}, - {0x020E,0x020F,0x004F}, {0x020E,0x020F,0x004F}, - {0x0210,0x0211,0x0052}, {0x0210,0x0211,0x0052}, - {0x0212,0x0213,0x0052}, {0x0212,0x0213,0x0052}, - {0x0214,0x0215,0x0055}, {0x0214,0x0215,0x0055}, - {0x0216,0x0217,0x0055}, {0x0216,0x0217,0x0055}, - {0x0218,0x0219,0x0053}, {0x0218,0x0219,0x0053}, - {0x021A,0x021B,0x0054}, {0x021A,0x021B,0x0054}, - {0x021C,0x021D,0x021C}, {0x021C,0x021D,0x021C}, - {0x021E,0x021F,0x0048}, {0x021E,0x021F,0x0048}, - {0x0220,0x0220,0x0220}, {0x0221,0x0221,0x0221}, - {0x0222,0x0223,0x0222}, {0x0222,0x0223,0x0222}, - {0x0224,0x0225,0x0224}, {0x0224,0x0225,0x0224}, - {0x0226,0x0227,0x0041}, {0x0226,0x0227,0x0041}, - {0x0228,0x0229,0x0045}, {0x0228,0x0229,0x0045}, - {0x022A,0x022B,0x004F}, {0x022A,0x022B,0x004F}, - {0x022C,0x022D,0x004F}, {0x022C,0x022D,0x004F}, - {0x022E,0x022F,0x004F}, {0x022E,0x022F,0x004F}, - {0x0230,0x0231,0x004F}, {0x0230,0x0231,0x004F}, - {0x0232,0x0233,0x0059}, {0x0232,0x0233,0x0059}, - {0x0234,0x0234,0x0234}, {0x0235,0x0235,0x0235}, - {0x0236,0x0236,0x0236}, {0x0237,0x0237,0x0237}, - {0x0238,0x0238,0x0238}, {0x0239,0x0239,0x0239}, - {0x023A,0x023A,0x023A}, {0x023B,0x023B,0x023B}, - {0x023C,0x023C,0x023C}, {0x023D,0x023D,0x023D}, - {0x023E,0x023E,0x023E}, {0x023F,0x023F,0x023F}, - {0x0240,0x0240,0x0240}, {0x0241,0x0241,0x0241}, - {0x0242,0x0242,0x0242}, {0x0243,0x0243,0x0243}, - {0x0244,0x0244,0x0244}, {0x0245,0x0245,0x0245}, - {0x0246,0x0246,0x0246}, {0x0247,0x0247,0x0247}, - {0x0248,0x0248,0x0248}, {0x0249,0x0249,0x0249}, - {0x024A,0x024A,0x024A}, {0x024B,0x024B,0x024B}, - {0x024C,0x024C,0x024C}, {0x024D,0x024D,0x024D}, - {0x024E,0x024E,0x024E}, {0x024F,0x024F,0x024F}, - {0x0250,0x0250,0x0250}, {0x0251,0x0251,0x0251}, - {0x0252,0x0252,0x0252}, {0x0181,0x0253,0x0181}, - {0x0186,0x0254,0x0186}, {0x0255,0x0255,0x0255}, - {0x0189,0x0256,0x0189}, {0x018A,0x0257,0x018A}, - {0x0258,0x0258,0x0258}, {0x018F,0x0259,0x018F}, - {0x025A,0x025A,0x025A}, {0x0190,0x025B,0x0190}, - {0x025C,0x025C,0x025C}, {0x025D,0x025D,0x025D}, - {0x025E,0x025E,0x025E}, {0x025F,0x025F,0x025F}, - {0x0193,0x0260,0x0193}, {0x0261,0x0261,0x0261}, - {0x0262,0x0262,0x0262}, {0x0194,0x0263,0x0194}, - {0x0264,0x0264,0x0264}, {0x0265,0x0265,0x0265}, - {0x0266,0x0266,0x0266}, {0x0267,0x0267,0x0267}, - {0x0197,0x0268,0x0197}, {0x0196,0x0269,0x0196}, - {0x026A,0x026A,0x026A}, {0x026B,0x026B,0x026B}, - {0x026C,0x026C,0x026C}, {0x026D,0x026D,0x026D}, - {0x026E,0x026E,0x026E}, {0x019C,0x026F,0x019C}, - {0x0270,0x0270,0x0270}, {0x0271,0x0271,0x0271}, - {0x019D,0x0272,0x019D}, {0x0273,0x0273,0x0273}, - {0x0274,0x0274,0x0274}, {0x019F,0x0275,0x019F}, - {0x0276,0x0276,0x0276}, {0x0277,0x0277,0x0277}, - {0x0278,0x0278,0x0278}, {0x0279,0x0279,0x0279}, - {0x027A,0x027A,0x027A}, {0x027B,0x027B,0x027B}, - {0x027C,0x027C,0x027C}, {0x027D,0x027D,0x027D}, - {0x027E,0x027E,0x027E}, {0x027F,0x027F,0x027F}, - {0x01A6,0x0280,0x01A6}, {0x0281,0x0281,0x0281}, - {0x0282,0x0282,0x0282}, {0x01A9,0x0283,0x01A9}, - {0x0284,0x0284,0x0284}, {0x0285,0x0285,0x0285}, - {0x0286,0x0286,0x0286}, {0x0287,0x0287,0x0287}, - {0x01AE,0x0288,0x01AE}, {0x0289,0x0289,0x0289}, - {0x01B1,0x028A,0x01B1}, {0x01B2,0x028B,0x01B2}, - {0x028C,0x028C,0x028C}, {0x028D,0x028D,0x028D}, - {0x028E,0x028E,0x028E}, {0x028F,0x028F,0x028F}, - {0x0290,0x0290,0x0290}, {0x0291,0x0291,0x0291}, - {0x01B7,0x0292,0x01B7}, {0x0293,0x0293,0x0293}, - {0x0294,0x0294,0x0294}, {0x0295,0x0295,0x0295}, - {0x0296,0x0296,0x0296}, {0x0297,0x0297,0x0297}, - {0x0298,0x0298,0x0298}, {0x0299,0x0299,0x0299}, - {0x029A,0x029A,0x029A}, {0x029B,0x029B,0x029B}, - {0x029C,0x029C,0x029C}, {0x029D,0x029D,0x029D}, - {0x029E,0x029E,0x029E}, {0x029F,0x029F,0x029F}, - {0x02A0,0x02A0,0x02A0}, {0x02A1,0x02A1,0x02A1}, - {0x02A2,0x02A2,0x02A2}, {0x02A3,0x02A3,0x02A3}, - {0x02A4,0x02A4,0x02A4}, {0x02A5,0x02A5,0x02A5}, - {0x02A6,0x02A6,0x02A6}, {0x02A7,0x02A7,0x02A7}, - {0x02A8,0x02A8,0x02A8}, {0x02A9,0x02A9,0x02A9}, - {0x02AA,0x02AA,0x02AA}, {0x02AB,0x02AB,0x02AB}, - {0x02AC,0x02AC,0x02AC}, {0x02AD,0x02AD,0x02AD}, - {0x02AE,0x02AE,0x02AE}, {0x02AF,0x02AF,0x02AF}, - {0x02B0,0x02B0,0x02B0}, {0x02B1,0x02B1,0x02B1}, - {0x02B2,0x02B2,0x02B2}, {0x02B3,0x02B3,0x02B3}, - {0x02B4,0x02B4,0x02B4}, {0x02B5,0x02B5,0x02B5}, - {0x02B6,0x02B6,0x02B6}, {0x02B7,0x02B7,0x02B7}, - {0x02B8,0x02B8,0x02B8}, {0x02B9,0x02B9,0x02B9}, - {0x02BA,0x02BA,0x02BA}, {0x02BB,0x02BB,0x02BB}, - {0x02BC,0x02BC,0x02BC}, {0x02BD,0x02BD,0x02BD}, - {0x02BE,0x02BE,0x02BE}, {0x02BF,0x02BF,0x02BF}, - {0x02C0,0x02C0,0x02C0}, {0x02C1,0x02C1,0x02C1}, - {0x02C2,0x02C2,0x02C2}, {0x02C3,0x02C3,0x02C3}, - {0x02C4,0x02C4,0x02C4}, {0x02C5,0x02C5,0x02C5}, - {0x02C6,0x02C6,0x02C6}, {0x02C7,0x02C7,0x02C7}, - {0x02C8,0x02C8,0x02C8}, {0x02C9,0x02C9,0x02C9}, - {0x02CA,0x02CA,0x02CA}, {0x02CB,0x02CB,0x02CB}, - {0x02CC,0x02CC,0x02CC}, {0x02CD,0x02CD,0x02CD}, - {0x02CE,0x02CE,0x02CE}, {0x02CF,0x02CF,0x02CF}, - {0x02D0,0x02D0,0x02D0}, {0x02D1,0x02D1,0x02D1}, - {0x02D2,0x02D2,0x02D2}, {0x02D3,0x02D3,0x02D3}, - {0x02D4,0x02D4,0x02D4}, {0x02D5,0x02D5,0x02D5}, - {0x02D6,0x02D6,0x02D6}, {0x02D7,0x02D7,0x02D7}, - {0x02D8,0x02D8,0x02D8}, {0x02D9,0x02D9,0x02D9}, - {0x02DA,0x02DA,0x02DA}, {0x02DB,0x02DB,0x02DB}, - {0x02DC,0x02DC,0x02DC}, {0x02DD,0x02DD,0x02DD}, - {0x02DE,0x02DE,0x02DE}, {0x02DF,0x02DF,0x02DF}, - {0x02E0,0x02E0,0x02E0}, {0x02E1,0x02E1,0x02E1}, - {0x02E2,0x02E2,0x02E2}, {0x02E3,0x02E3,0x02E3}, - {0x02E4,0x02E4,0x02E4}, {0x02E5,0x02E5,0x02E5}, - {0x02E6,0x02E6,0x02E6}, {0x02E7,0x02E7,0x02E7}, - {0x02E8,0x02E8,0x02E8}, {0x02E9,0x02E9,0x02E9}, - {0x02EA,0x02EA,0x02EA}, {0x02EB,0x02EB,0x02EB}, - {0x02EC,0x02EC,0x02EC}, {0x02ED,0x02ED,0x02ED}, - {0x02EE,0x02EE,0x02EE}, {0x02EF,0x02EF,0x02EF}, - {0x02F0,0x02F0,0x02F0}, {0x02F1,0x02F1,0x02F1}, - {0x02F2,0x02F2,0x02F2}, {0x02F3,0x02F3,0x02F3}, - {0x02F4,0x02F4,0x02F4}, {0x02F5,0x02F5,0x02F5}, - {0x02F6,0x02F6,0x02F6}, {0x02F7,0x02F7,0x02F7}, - {0x02F8,0x02F8,0x02F8}, {0x02F9,0x02F9,0x02F9}, - {0x02FA,0x02FA,0x02FA}, {0x02FB,0x02FB,0x02FB}, - {0x02FC,0x02FC,0x02FC}, {0x02FD,0x02FD,0x02FD}, - {0x02FE,0x02FE,0x02FE}, {0x02FF,0x02FF,0x02FF} -}; - -static MY_UNICASE_CHARACTER plane03[]={ - {0x0300,0x0300,0x0300}, {0x0301,0x0301,0x0301}, - {0x0302,0x0302,0x0302}, {0x0303,0x0303,0x0303}, - {0x0304,0x0304,0x0304}, {0x0305,0x0305,0x0305}, - {0x0306,0x0306,0x0306}, {0x0307,0x0307,0x0307}, - {0x0308,0x0308,0x0308}, {0x0309,0x0309,0x0309}, - {0x030A,0x030A,0x030A}, {0x030B,0x030B,0x030B}, - {0x030C,0x030C,0x030C}, {0x030D,0x030D,0x030D}, - {0x030E,0x030E,0x030E}, {0x030F,0x030F,0x030F}, - {0x0310,0x0310,0x0310}, {0x0311,0x0311,0x0311}, - {0x0312,0x0312,0x0312}, {0x0313,0x0313,0x0313}, - {0x0314,0x0314,0x0314}, {0x0315,0x0315,0x0315}, - {0x0316,0x0316,0x0316}, {0x0317,0x0317,0x0317}, - {0x0318,0x0318,0x0318}, {0x0319,0x0319,0x0319}, - {0x031A,0x031A,0x031A}, {0x031B,0x031B,0x031B}, - {0x031C,0x031C,0x031C}, {0x031D,0x031D,0x031D}, - {0x031E,0x031E,0x031E}, {0x031F,0x031F,0x031F}, - {0x0320,0x0320,0x0320}, {0x0321,0x0321,0x0321}, - {0x0322,0x0322,0x0322}, {0x0323,0x0323,0x0323}, - {0x0324,0x0324,0x0324}, {0x0325,0x0325,0x0325}, - {0x0326,0x0326,0x0326}, {0x0327,0x0327,0x0327}, - {0x0328,0x0328,0x0328}, {0x0329,0x0329,0x0329}, - {0x032A,0x032A,0x032A}, {0x032B,0x032B,0x032B}, - {0x032C,0x032C,0x032C}, {0x032D,0x032D,0x032D}, - {0x032E,0x032E,0x032E}, {0x032F,0x032F,0x032F}, - {0x0330,0x0330,0x0330}, {0x0331,0x0331,0x0331}, - {0x0332,0x0332,0x0332}, {0x0333,0x0333,0x0333}, - {0x0334,0x0334,0x0334}, {0x0335,0x0335,0x0335}, - {0x0336,0x0336,0x0336}, {0x0337,0x0337,0x0337}, - {0x0338,0x0338,0x0338}, {0x0339,0x0339,0x0339}, - {0x033A,0x033A,0x033A}, {0x033B,0x033B,0x033B}, - {0x033C,0x033C,0x033C}, {0x033D,0x033D,0x033D}, - {0x033E,0x033E,0x033E}, {0x033F,0x033F,0x033F}, - {0x0340,0x0340,0x0340}, {0x0341,0x0341,0x0341}, - {0x0342,0x0342,0x0342}, {0x0343,0x0343,0x0343}, - {0x0344,0x0344,0x0344}, {0x0399,0x0345,0x0399}, - {0x0346,0x0346,0x0346}, {0x0347,0x0347,0x0347}, - {0x0348,0x0348,0x0348}, {0x0349,0x0349,0x0349}, - {0x034A,0x034A,0x034A}, {0x034B,0x034B,0x034B}, - {0x034C,0x034C,0x034C}, {0x034D,0x034D,0x034D}, - {0x034E,0x034E,0x034E}, {0x034F,0x034F,0x034F}, - {0x0350,0x0350,0x0350}, {0x0351,0x0351,0x0351}, - {0x0352,0x0352,0x0352}, {0x0353,0x0353,0x0353}, - {0x0354,0x0354,0x0354}, {0x0355,0x0355,0x0355}, - {0x0356,0x0356,0x0356}, {0x0357,0x0357,0x0357}, - {0x0358,0x0358,0x0358}, {0x0359,0x0359,0x0359}, - {0x035A,0x035A,0x035A}, {0x035B,0x035B,0x035B}, - {0x035C,0x035C,0x035C}, {0x035D,0x035D,0x035D}, - {0x035E,0x035E,0x035E}, {0x035F,0x035F,0x035F}, - {0x0360,0x0360,0x0360}, {0x0361,0x0361,0x0361}, - {0x0362,0x0362,0x0362}, {0x0363,0x0363,0x0363}, - {0x0364,0x0364,0x0364}, {0x0365,0x0365,0x0365}, - {0x0366,0x0366,0x0366}, {0x0367,0x0367,0x0367}, - {0x0368,0x0368,0x0368}, {0x0369,0x0369,0x0369}, - {0x036A,0x036A,0x036A}, {0x036B,0x036B,0x036B}, - {0x036C,0x036C,0x036C}, {0x036D,0x036D,0x036D}, - {0x036E,0x036E,0x036E}, {0x036F,0x036F,0x036F}, - {0x0370,0x0370,0x0370}, {0x0371,0x0371,0x0371}, - {0x0372,0x0372,0x0372}, {0x0373,0x0373,0x0373}, - {0x0374,0x0374,0x0374}, {0x0375,0x0375,0x0375}, - {0x0376,0x0376,0x0376}, {0x0377,0x0377,0x0377}, - {0x0378,0x0378,0x0378}, {0x0379,0x0379,0x0379}, - {0x037A,0x037A,0x037A}, {0x037B,0x037B,0x037B}, - {0x037C,0x037C,0x037C}, {0x037D,0x037D,0x037D}, - {0x037E,0x037E,0x037E}, {0x037F,0x037F,0x037F}, - {0x0380,0x0380,0x0380}, {0x0381,0x0381,0x0381}, - {0x0382,0x0382,0x0382}, {0x0383,0x0383,0x0383}, - {0x0384,0x0384,0x0384}, {0x0385,0x0385,0x0385}, - {0x0386,0x03AC,0x0391}, {0x0387,0x0387,0x0387}, - {0x0388,0x03AD,0x0395}, {0x0389,0x03AE,0x0397}, - {0x038A,0x03AF,0x0399}, {0x038B,0x038B,0x038B}, - {0x038C,0x03CC,0x039F}, {0x038D,0x038D,0x038D}, - {0x038E,0x03CD,0x03A5}, {0x038F,0x03CE,0x03A9}, - {0x0390,0x0390,0x0399}, {0x0391,0x03B1,0x0391}, - {0x0392,0x03B2,0x0392}, {0x0393,0x03B3,0x0393}, - {0x0394,0x03B4,0x0394}, {0x0395,0x03B5,0x0395}, - {0x0396,0x03B6,0x0396}, {0x0397,0x03B7,0x0397}, - {0x0398,0x03B8,0x0398}, {0x0399,0x03B9,0x0399}, - {0x039A,0x03BA,0x039A}, {0x039B,0x03BB,0x039B}, - {0x039C,0x03BC,0x039C}, {0x039D,0x03BD,0x039D}, - {0x039E,0x03BE,0x039E}, {0x039F,0x03BF,0x039F}, - {0x03A0,0x03C0,0x03A0}, {0x03A1,0x03C1,0x03A1}, - {0x03A2,0x03A2,0x03A2}, {0x03A3,0x03C3,0x03A3}, - {0x03A4,0x03C4,0x03A4}, {0x03A5,0x03C5,0x03A5}, - {0x03A6,0x03C6,0x03A6}, {0x03A7,0x03C7,0x03A7}, - {0x03A8,0x03C8,0x03A8}, {0x03A9,0x03C9,0x03A9}, - {0x03AA,0x03CA,0x0399}, {0x03AB,0x03CB,0x03A5}, - {0x0386,0x03AC,0x0391}, {0x0388,0x03AD,0x0395}, - {0x0389,0x03AE,0x0397}, {0x038A,0x03AF,0x0399}, - {0x03B0,0x03B0,0x03A5}, {0x0391,0x03B1,0x0391}, - {0x0392,0x03B2,0x0392}, {0x0393,0x03B3,0x0393}, - {0x0394,0x03B4,0x0394}, {0x0395,0x03B5,0x0395}, - {0x0396,0x03B6,0x0396}, {0x0397,0x03B7,0x0397}, - {0x0398,0x03B8,0x0398}, {0x0399,0x03B9,0x0399}, - {0x039A,0x03BA,0x039A}, {0x039B,0x03BB,0x039B}, - {0x039C,0x03BC,0x039C}, {0x039D,0x03BD,0x039D}, - {0x039E,0x03BE,0x039E}, {0x039F,0x03BF,0x039F}, - {0x03A0,0x03C0,0x03A0}, {0x03A1,0x03C1,0x03A1}, - {0x03A3,0x03C2,0x03A3}, {0x03A3,0x03C3,0x03A3}, - {0x03A4,0x03C4,0x03A4}, {0x03A5,0x03C5,0x03A5}, - {0x03A6,0x03C6,0x03A6}, {0x03A7,0x03C7,0x03A7}, - {0x03A8,0x03C8,0x03A8}, {0x03A9,0x03C9,0x03A9}, - {0x03AA,0x03CA,0x0399}, {0x03AB,0x03CB,0x03A5}, - {0x038C,0x03CC,0x039F}, {0x038E,0x03CD,0x03A5}, - {0x038F,0x03CE,0x03A9}, {0x03CF,0x03CF,0x03CF}, - {0x0392,0x03D0,0x0392}, {0x0398,0x03D1,0x0398}, - {0x03D2,0x03D2,0x03D2}, {0x03D3,0x03D3,0x03D2}, - {0x03D4,0x03D4,0x03D2}, {0x03A6,0x03D5,0x03A6}, - {0x03A0,0x03D6,0x03A0}, {0x03D7,0x03D7,0x03D7}, - {0x03D8,0x03D8,0x03D8}, {0x03D9,0x03D9,0x03D9}, - {0x03DA,0x03DB,0x03DA}, {0x03DA,0x03DB,0x03DA}, - {0x03DC,0x03DD,0x03DC}, {0x03DC,0x03DD,0x03DC}, - {0x03DE,0x03DF,0x03DE}, {0x03DE,0x03DF,0x03DE}, - {0x03E0,0x03E1,0x03E0}, {0x03E0,0x03E1,0x03E0}, - {0x03E2,0x03E3,0x03E2}, {0x03E2,0x03E3,0x03E2}, - {0x03E4,0x03E5,0x03E4}, {0x03E4,0x03E5,0x03E4}, - {0x03E6,0x03E7,0x03E6}, {0x03E6,0x03E7,0x03E6}, - {0x03E8,0x03E9,0x03E8}, {0x03E8,0x03E9,0x03E8}, - {0x03EA,0x03EB,0x03EA}, {0x03EA,0x03EB,0x03EA}, - {0x03EC,0x03ED,0x03EC}, {0x03EC,0x03ED,0x03EC}, - {0x03EE,0x03EF,0x03EE}, {0x03EE,0x03EF,0x03EE}, - {0x039A,0x03F0,0x039A}, {0x03A1,0x03F1,0x03A1}, - {0x03A3,0x03F2,0x03A3}, {0x03F3,0x03F3,0x03F3}, - {0x03F4,0x03F4,0x03F4}, {0x03F5,0x03F5,0x03F5}, - {0x03F6,0x03F6,0x03F6}, {0x03F7,0x03F7,0x03F7}, - {0x03F8,0x03F8,0x03F8}, {0x03F9,0x03F9,0x03F9}, - {0x03FA,0x03FA,0x03FA}, {0x03FB,0x03FB,0x03FB}, - {0x03FC,0x03FC,0x03FC}, {0x03FD,0x03FD,0x03FD}, - {0x03FE,0x03FE,0x03FE}, {0x03FF,0x03FF,0x03FF} -}; - -static MY_UNICASE_CHARACTER plane04[]={ - {0x0400,0x0450,0x0415}, {0x0401,0x0451,0x0415}, - {0x0402,0x0452,0x0402}, {0x0403,0x0453,0x0413}, - {0x0404,0x0454,0x0404}, {0x0405,0x0455,0x0405}, - {0x0406,0x0456,0x0406}, {0x0407,0x0457,0x0406}, - {0x0408,0x0458,0x0408}, {0x0409,0x0459,0x0409}, - {0x040A,0x045A,0x040A}, {0x040B,0x045B,0x040B}, - {0x040C,0x045C,0x041A}, {0x040D,0x045D,0x0418}, - {0x040E,0x045E,0x0423}, {0x040F,0x045F,0x040F}, - {0x0410,0x0430,0x0410}, {0x0411,0x0431,0x0411}, - {0x0412,0x0432,0x0412}, {0x0413,0x0433,0x0413}, - {0x0414,0x0434,0x0414}, {0x0415,0x0435,0x0415}, - {0x0416,0x0436,0x0416}, {0x0417,0x0437,0x0417}, - {0x0418,0x0438,0x0418}, {0x0419,0x0439,0x0419}, - {0x041A,0x043A,0x041A}, {0x041B,0x043B,0x041B}, - {0x041C,0x043C,0x041C}, {0x041D,0x043D,0x041D}, - {0x041E,0x043E,0x041E}, {0x041F,0x043F,0x041F}, - {0x0420,0x0440,0x0420}, {0x0421,0x0441,0x0421}, - {0x0422,0x0442,0x0422}, {0x0423,0x0443,0x0423}, - {0x0424,0x0444,0x0424}, {0x0425,0x0445,0x0425}, - {0x0426,0x0446,0x0426}, {0x0427,0x0447,0x0427}, - {0x0428,0x0448,0x0428}, {0x0429,0x0449,0x0429}, - {0x042A,0x044A,0x042A}, {0x042B,0x044B,0x042B}, - {0x042C,0x044C,0x042C}, {0x042D,0x044D,0x042D}, - {0x042E,0x044E,0x042E}, {0x042F,0x044F,0x042F}, - {0x0410,0x0430,0x0410}, {0x0411,0x0431,0x0411}, - {0x0412,0x0432,0x0412}, {0x0413,0x0433,0x0413}, - {0x0414,0x0434,0x0414}, {0x0415,0x0435,0x0415}, - {0x0416,0x0436,0x0416}, {0x0417,0x0437,0x0417}, - {0x0418,0x0438,0x0418}, {0x0419,0x0439,0x0419}, - {0x041A,0x043A,0x041A}, {0x041B,0x043B,0x041B}, - {0x041C,0x043C,0x041C}, {0x041D,0x043D,0x041D}, - {0x041E,0x043E,0x041E}, {0x041F,0x043F,0x041F}, - {0x0420,0x0440,0x0420}, {0x0421,0x0441,0x0421}, - {0x0422,0x0442,0x0422}, {0x0423,0x0443,0x0423}, - {0x0424,0x0444,0x0424}, {0x0425,0x0445,0x0425}, - {0x0426,0x0446,0x0426}, {0x0427,0x0447,0x0427}, - {0x0428,0x0448,0x0428}, {0x0429,0x0449,0x0429}, - {0x042A,0x044A,0x042A}, {0x042B,0x044B,0x042B}, - {0x042C,0x044C,0x042C}, {0x042D,0x044D,0x042D}, - {0x042E,0x044E,0x042E}, {0x042F,0x044F,0x042F}, - {0x0400,0x0450,0x0415}, {0x0401,0x0451,0x0415}, - {0x0402,0x0452,0x0402}, {0x0403,0x0453,0x0413}, - {0x0404,0x0454,0x0404}, {0x0405,0x0455,0x0405}, - {0x0406,0x0456,0x0406}, {0x0407,0x0457,0x0406}, - {0x0408,0x0458,0x0408}, {0x0409,0x0459,0x0409}, - {0x040A,0x045A,0x040A}, {0x040B,0x045B,0x040B}, - {0x040C,0x045C,0x041A}, {0x040D,0x045D,0x0418}, - {0x040E,0x045E,0x0423}, {0x040F,0x045F,0x040F}, - {0x0460,0x0461,0x0460}, {0x0460,0x0461,0x0460}, - {0x0462,0x0463,0x0462}, {0x0462,0x0463,0x0462}, - {0x0464,0x0465,0x0464}, {0x0464,0x0465,0x0464}, - {0x0466,0x0467,0x0466}, {0x0466,0x0467,0x0466}, - {0x0468,0x0469,0x0468}, {0x0468,0x0469,0x0468}, - {0x046A,0x046B,0x046A}, {0x046A,0x046B,0x046A}, - {0x046C,0x046D,0x046C}, {0x046C,0x046D,0x046C}, - {0x046E,0x046F,0x046E}, {0x046E,0x046F,0x046E}, - {0x0470,0x0471,0x0470}, {0x0470,0x0471,0x0470}, - {0x0472,0x0473,0x0472}, {0x0472,0x0473,0x0472}, - {0x0474,0x0475,0x0474}, {0x0474,0x0475,0x0474}, - {0x0476,0x0477,0x0474}, {0x0476,0x0477,0x0474}, - {0x0478,0x0479,0x0478}, {0x0478,0x0479,0x0478}, - {0x047A,0x047B,0x047A}, {0x047A,0x047B,0x047A}, - {0x047C,0x047D,0x047C}, {0x047C,0x047D,0x047C}, - {0x047E,0x047F,0x047E}, {0x047E,0x047F,0x047E}, - {0x0480,0x0481,0x0480}, {0x0480,0x0481,0x0480}, - {0x0482,0x0482,0x0482}, {0x0483,0x0483,0x0483}, - {0x0484,0x0484,0x0484}, {0x0485,0x0485,0x0485}, - {0x0486,0x0486,0x0486}, {0x0487,0x0487,0x0487}, - {0x0488,0x0488,0x0488}, {0x0489,0x0489,0x0489}, - {0x048A,0x048A,0x048A}, {0x048B,0x048B,0x048B}, - {0x048C,0x048D,0x048C}, {0x048C,0x048D,0x048C}, - {0x048E,0x048F,0x048E}, {0x048E,0x048F,0x048E}, - {0x0490,0x0491,0x0490}, {0x0490,0x0491,0x0490}, - {0x0492,0x0493,0x0492}, {0x0492,0x0493,0x0492}, - {0x0494,0x0495,0x0494}, {0x0494,0x0495,0x0494}, - {0x0496,0x0497,0x0496}, {0x0496,0x0497,0x0496}, - {0x0498,0x0499,0x0498}, {0x0498,0x0499,0x0498}, - {0x049A,0x049B,0x049A}, {0x049A,0x049B,0x049A}, - {0x049C,0x049D,0x049C}, {0x049C,0x049D,0x049C}, - {0x049E,0x049F,0x049E}, {0x049E,0x049F,0x049E}, - {0x04A0,0x04A1,0x04A0}, {0x04A0,0x04A1,0x04A0}, - {0x04A2,0x04A3,0x04A2}, {0x04A2,0x04A3,0x04A2}, - {0x04A4,0x04A5,0x04A4}, {0x04A4,0x04A5,0x04A4}, - {0x04A6,0x04A7,0x04A6}, {0x04A6,0x04A7,0x04A6}, - {0x04A8,0x04A9,0x04A8}, {0x04A8,0x04A9,0x04A8}, - {0x04AA,0x04AB,0x04AA}, {0x04AA,0x04AB,0x04AA}, - {0x04AC,0x04AD,0x04AC}, {0x04AC,0x04AD,0x04AC}, - {0x04AE,0x04AF,0x04AE}, {0x04AE,0x04AF,0x04AE}, - {0x04B0,0x04B1,0x04B0}, {0x04B0,0x04B1,0x04B0}, - {0x04B2,0x04B3,0x04B2}, {0x04B2,0x04B3,0x04B2}, - {0x04B4,0x04B5,0x04B4}, {0x04B4,0x04B5,0x04B4}, - {0x04B6,0x04B7,0x04B6}, {0x04B6,0x04B7,0x04B6}, - {0x04B8,0x04B9,0x04B8}, {0x04B8,0x04B9,0x04B8}, - {0x04BA,0x04BB,0x04BA}, {0x04BA,0x04BB,0x04BA}, - {0x04BC,0x04BD,0x04BC}, {0x04BC,0x04BD,0x04BC}, - {0x04BE,0x04BF,0x04BE}, {0x04BE,0x04BF,0x04BE}, - {0x04C0,0x04C0,0x04C0}, {0x04C1,0x04C2,0x0416}, - {0x04C1,0x04C2,0x0416}, {0x04C3,0x04C4,0x04C3}, - {0x04C3,0x04C4,0x04C3}, {0x04C5,0x04C5,0x04C5}, - {0x04C6,0x04C6,0x04C6}, {0x04C7,0x04C8,0x04C7}, - {0x04C7,0x04C8,0x04C7}, {0x04C9,0x04C9,0x04C9}, - {0x04CA,0x04CA,0x04CA}, {0x04CB,0x04CC,0x04CB}, - {0x04CB,0x04CC,0x04CB}, {0x04CD,0x04CD,0x04CD}, - {0x04CE,0x04CE,0x04CE}, {0x04CF,0x04CF,0x04CF}, - {0x04D0,0x04D1,0x0410}, {0x04D0,0x04D1,0x0410}, - {0x04D2,0x04D3,0x0410}, {0x04D2,0x04D3,0x0410}, - {0x04D4,0x04D5,0x04D4}, {0x04D4,0x04D5,0x04D4}, - {0x04D6,0x04D7,0x0415}, {0x04D6,0x04D7,0x0415}, - {0x04D8,0x04D9,0x04D8}, {0x04D8,0x04D9,0x04D8}, - {0x04DA,0x04DB,0x04D8}, {0x04DA,0x04DB,0x04D8}, - {0x04DC,0x04DD,0x0416}, {0x04DC,0x04DD,0x0416}, - {0x04DE,0x04DF,0x0417}, {0x04DE,0x04DF,0x0417}, - {0x04E0,0x04E1,0x04E0}, {0x04E0,0x04E1,0x04E0}, - {0x04E2,0x04E3,0x0418}, {0x04E2,0x04E3,0x0418}, - {0x04E4,0x04E5,0x0418}, {0x04E4,0x04E5,0x0418}, - {0x04E6,0x04E7,0x041E}, {0x04E6,0x04E7,0x041E}, - {0x04E8,0x04E9,0x04E8}, {0x04E8,0x04E9,0x04E8}, - {0x04EA,0x04EB,0x04E8}, {0x04EA,0x04EB,0x04E8}, - {0x04EC,0x04ED,0x042D}, {0x04EC,0x04ED,0x042D}, - {0x04EE,0x04EF,0x0423}, {0x04EE,0x04EF,0x0423}, - {0x04F0,0x04F1,0x0423}, {0x04F0,0x04F1,0x0423}, - {0x04F2,0x04F3,0x0423}, {0x04F2,0x04F3,0x0423}, - {0x04F4,0x04F5,0x0427}, {0x04F4,0x04F5,0x0427}, - {0x04F6,0x04F6,0x04F6}, {0x04F7,0x04F7,0x04F7}, - {0x04F8,0x04F9,0x042B}, {0x04F8,0x04F9,0x042B}, - {0x04FA,0x04FA,0x04FA}, {0x04FB,0x04FB,0x04FB}, - {0x04FC,0x04FC,0x04FC}, {0x04FD,0x04FD,0x04FD}, - {0x04FE,0x04FE,0x04FE}, {0x04FF,0x04FF,0x04FF} -}; - -static MY_UNICASE_CHARACTER plane05[]={ - {0x0500,0x0500,0x0500}, {0x0501,0x0501,0x0501}, - {0x0502,0x0502,0x0502}, {0x0503,0x0503,0x0503}, - {0x0504,0x0504,0x0504}, {0x0505,0x0505,0x0505}, - {0x0506,0x0506,0x0506}, {0x0507,0x0507,0x0507}, - {0x0508,0x0508,0x0508}, {0x0509,0x0509,0x0509}, - {0x050A,0x050A,0x050A}, {0x050B,0x050B,0x050B}, - {0x050C,0x050C,0x050C}, {0x050D,0x050D,0x050D}, - {0x050E,0x050E,0x050E}, {0x050F,0x050F,0x050F}, - {0x0510,0x0510,0x0510}, {0x0511,0x0511,0x0511}, - {0x0512,0x0512,0x0512}, {0x0513,0x0513,0x0513}, - {0x0514,0x0514,0x0514}, {0x0515,0x0515,0x0515}, - {0x0516,0x0516,0x0516}, {0x0517,0x0517,0x0517}, - {0x0518,0x0518,0x0518}, {0x0519,0x0519,0x0519}, - {0x051A,0x051A,0x051A}, {0x051B,0x051B,0x051B}, - {0x051C,0x051C,0x051C}, {0x051D,0x051D,0x051D}, - {0x051E,0x051E,0x051E}, {0x051F,0x051F,0x051F}, - {0x0520,0x0520,0x0520}, {0x0521,0x0521,0x0521}, - {0x0522,0x0522,0x0522}, {0x0523,0x0523,0x0523}, - {0x0524,0x0524,0x0524}, {0x0525,0x0525,0x0525}, - {0x0526,0x0526,0x0526}, {0x0527,0x0527,0x0527}, - {0x0528,0x0528,0x0528}, {0x0529,0x0529,0x0529}, - {0x052A,0x052A,0x052A}, {0x052B,0x052B,0x052B}, - {0x052C,0x052C,0x052C}, {0x052D,0x052D,0x052D}, - {0x052E,0x052E,0x052E}, {0x052F,0x052F,0x052F}, - {0x0530,0x0530,0x0530}, {0x0531,0x0561,0x0531}, - {0x0532,0x0562,0x0532}, {0x0533,0x0563,0x0533}, - {0x0534,0x0564,0x0534}, {0x0535,0x0565,0x0535}, - {0x0536,0x0566,0x0536}, {0x0537,0x0567,0x0537}, - {0x0538,0x0568,0x0538}, {0x0539,0x0569,0x0539}, - {0x053A,0x056A,0x053A}, {0x053B,0x056B,0x053B}, - {0x053C,0x056C,0x053C}, {0x053D,0x056D,0x053D}, - {0x053E,0x056E,0x053E}, {0x053F,0x056F,0x053F}, - {0x0540,0x0570,0x0540}, {0x0541,0x0571,0x0541}, - {0x0542,0x0572,0x0542}, {0x0543,0x0573,0x0543}, - {0x0544,0x0574,0x0544}, {0x0545,0x0575,0x0545}, - {0x0546,0x0576,0x0546}, {0x0547,0x0577,0x0547}, - {0x0548,0x0578,0x0548}, {0x0549,0x0579,0x0549}, - {0x054A,0x057A,0x054A}, {0x054B,0x057B,0x054B}, - {0x054C,0x057C,0x054C}, {0x054D,0x057D,0x054D}, - {0x054E,0x057E,0x054E}, {0x054F,0x057F,0x054F}, - {0x0550,0x0580,0x0550}, {0x0551,0x0581,0x0551}, - {0x0552,0x0582,0x0552}, {0x0553,0x0583,0x0553}, - {0x0554,0x0584,0x0554}, {0x0555,0x0585,0x0555}, - {0x0556,0x0586,0x0556}, {0x0557,0x0557,0x0557}, - {0x0558,0x0558,0x0558}, {0x0559,0x0559,0x0559}, - {0x055A,0x055A,0x055A}, {0x055B,0x055B,0x055B}, - {0x055C,0x055C,0x055C}, {0x055D,0x055D,0x055D}, - {0x055E,0x055E,0x055E}, {0x055F,0x055F,0x055F}, - {0x0560,0x0560,0x0560}, {0x0531,0x0561,0x0531}, - {0x0532,0x0562,0x0532}, {0x0533,0x0563,0x0533}, - {0x0534,0x0564,0x0534}, {0x0535,0x0565,0x0535}, - {0x0536,0x0566,0x0536}, {0x0537,0x0567,0x0537}, - {0x0538,0x0568,0x0538}, {0x0539,0x0569,0x0539}, - {0x053A,0x056A,0x053A}, {0x053B,0x056B,0x053B}, - {0x053C,0x056C,0x053C}, {0x053D,0x056D,0x053D}, - {0x053E,0x056E,0x053E}, {0x053F,0x056F,0x053F}, - {0x0540,0x0570,0x0540}, {0x0541,0x0571,0x0541}, - {0x0542,0x0572,0x0542}, {0x0543,0x0573,0x0543}, - {0x0544,0x0574,0x0544}, {0x0545,0x0575,0x0545}, - {0x0546,0x0576,0x0546}, {0x0547,0x0577,0x0547}, - {0x0548,0x0578,0x0548}, {0x0549,0x0579,0x0549}, - {0x054A,0x057A,0x054A}, {0x054B,0x057B,0x054B}, - {0x054C,0x057C,0x054C}, {0x054D,0x057D,0x054D}, - {0x054E,0x057E,0x054E}, {0x054F,0x057F,0x054F}, - {0x0550,0x0580,0x0550}, {0x0551,0x0581,0x0551}, - {0x0552,0x0582,0x0552}, {0x0553,0x0583,0x0553}, - {0x0554,0x0584,0x0554}, {0x0555,0x0585,0x0555}, - {0x0556,0x0586,0x0556}, {0x0587,0x0587,0x0587}, - {0x0588,0x0588,0x0588}, {0x0589,0x0589,0x0589}, - {0x058A,0x058A,0x058A}, {0x058B,0x058B,0x058B}, - {0x058C,0x058C,0x058C}, {0x058D,0x058D,0x058D}, - {0x058E,0x058E,0x058E}, {0x058F,0x058F,0x058F}, - {0x0590,0x0590,0x0590}, {0x0591,0x0591,0x0591}, - {0x0592,0x0592,0x0592}, {0x0593,0x0593,0x0593}, - {0x0594,0x0594,0x0594}, {0x0595,0x0595,0x0595}, - {0x0596,0x0596,0x0596}, {0x0597,0x0597,0x0597}, - {0x0598,0x0598,0x0598}, {0x0599,0x0599,0x0599}, - {0x059A,0x059A,0x059A}, {0x059B,0x059B,0x059B}, - {0x059C,0x059C,0x059C}, {0x059D,0x059D,0x059D}, - {0x059E,0x059E,0x059E}, {0x059F,0x059F,0x059F}, - {0x05A0,0x05A0,0x05A0}, {0x05A1,0x05A1,0x05A1}, - {0x05A2,0x05A2,0x05A2}, {0x05A3,0x05A3,0x05A3}, - {0x05A4,0x05A4,0x05A4}, {0x05A5,0x05A5,0x05A5}, - {0x05A6,0x05A6,0x05A6}, {0x05A7,0x05A7,0x05A7}, - {0x05A8,0x05A8,0x05A8}, {0x05A9,0x05A9,0x05A9}, - {0x05AA,0x05AA,0x05AA}, {0x05AB,0x05AB,0x05AB}, - {0x05AC,0x05AC,0x05AC}, {0x05AD,0x05AD,0x05AD}, - {0x05AE,0x05AE,0x05AE}, {0x05AF,0x05AF,0x05AF}, - {0x05B0,0x05B0,0x05B0}, {0x05B1,0x05B1,0x05B1}, - {0x05B2,0x05B2,0x05B2}, {0x05B3,0x05B3,0x05B3}, - {0x05B4,0x05B4,0x05B4}, {0x05B5,0x05B5,0x05B5}, - {0x05B6,0x05B6,0x05B6}, {0x05B7,0x05B7,0x05B7}, - {0x05B8,0x05B8,0x05B8}, {0x05B9,0x05B9,0x05B9}, - {0x05BA,0x05BA,0x05BA}, {0x05BB,0x05BB,0x05BB}, - {0x05BC,0x05BC,0x05BC}, {0x05BD,0x05BD,0x05BD}, - {0x05BE,0x05BE,0x05BE}, {0x05BF,0x05BF,0x05BF}, - {0x05C0,0x05C0,0x05C0}, {0x05C1,0x05C1,0x05C1}, - {0x05C2,0x05C2,0x05C2}, {0x05C3,0x05C3,0x05C3}, - {0x05C4,0x05C4,0x05C4}, {0x05C5,0x05C5,0x05C5}, - {0x05C6,0x05C6,0x05C6}, {0x05C7,0x05C7,0x05C7}, - {0x05C8,0x05C8,0x05C8}, {0x05C9,0x05C9,0x05C9}, - {0x05CA,0x05CA,0x05CA}, {0x05CB,0x05CB,0x05CB}, - {0x05CC,0x05CC,0x05CC}, {0x05CD,0x05CD,0x05CD}, - {0x05CE,0x05CE,0x05CE}, {0x05CF,0x05CF,0x05CF}, - {0x05D0,0x05D0,0x05D0}, {0x05D1,0x05D1,0x05D1}, - {0x05D2,0x05D2,0x05D2}, {0x05D3,0x05D3,0x05D3}, - {0x05D4,0x05D4,0x05D4}, {0x05D5,0x05D5,0x05D5}, - {0x05D6,0x05D6,0x05D6}, {0x05D7,0x05D7,0x05D7}, - {0x05D8,0x05D8,0x05D8}, {0x05D9,0x05D9,0x05D9}, - {0x05DA,0x05DA,0x05DA}, {0x05DB,0x05DB,0x05DB}, - {0x05DC,0x05DC,0x05DC}, {0x05DD,0x05DD,0x05DD}, - {0x05DE,0x05DE,0x05DE}, {0x05DF,0x05DF,0x05DF}, - {0x05E0,0x05E0,0x05E0}, {0x05E1,0x05E1,0x05E1}, - {0x05E2,0x05E2,0x05E2}, {0x05E3,0x05E3,0x05E3}, - {0x05E4,0x05E4,0x05E4}, {0x05E5,0x05E5,0x05E5}, - {0x05E6,0x05E6,0x05E6}, {0x05E7,0x05E7,0x05E7}, - {0x05E8,0x05E8,0x05E8}, {0x05E9,0x05E9,0x05E9}, - {0x05EA,0x05EA,0x05EA}, {0x05EB,0x05EB,0x05EB}, - {0x05EC,0x05EC,0x05EC}, {0x05ED,0x05ED,0x05ED}, - {0x05EE,0x05EE,0x05EE}, {0x05EF,0x05EF,0x05EF}, - {0x05F0,0x05F0,0x05F0}, {0x05F1,0x05F1,0x05F1}, - {0x05F2,0x05F2,0x05F2}, {0x05F3,0x05F3,0x05F3}, - {0x05F4,0x05F4,0x05F4}, {0x05F5,0x05F5,0x05F5}, - {0x05F6,0x05F6,0x05F6}, {0x05F7,0x05F7,0x05F7}, - {0x05F8,0x05F8,0x05F8}, {0x05F9,0x05F9,0x05F9}, - {0x05FA,0x05FA,0x05FA}, {0x05FB,0x05FB,0x05FB}, - {0x05FC,0x05FC,0x05FC}, {0x05FD,0x05FD,0x05FD}, - {0x05FE,0x05FE,0x05FE}, {0x05FF,0x05FF,0x05FF} -}; - -static MY_UNICASE_CHARACTER plane06[]={ /* This page is dummy */ - {0x0600,0x0600,0x0600}, {0x0601,0x0601,0x0601}, /* 0600 */ - {0x0602,0x0602,0x0602}, {0x0603,0x0603,0x0603}, /* 0602 */ - {0x0604,0x0604,0x0604}, {0x0605,0x0605,0x0605}, /* 0604 */ - {0x0606,0x0606,0x0606}, {0x0607,0x0607,0x0607}, /* 0606 */ - {0x0608,0x0608,0x0608}, {0x0609,0x0609,0x0609}, /* 0608 */ - {0x060A,0x060A,0x060A}, {0x060B,0x060B,0x060B}, /* 060A */ - {0x060C,0x060C,0x060C}, {0x060D,0x060D,0x060D}, /* 060C */ - {0x060E,0x060E,0x060E}, {0x060F,0x060F,0x060F}, /* 060E */ - {0x0610,0x0610,0x0610}, {0x0611,0x0611,0x0611}, /* 0610 */ - {0x0612,0x0612,0x0612}, {0x0613,0x0613,0x0613}, /* 0612 */ - {0x0614,0x0614,0x0614}, {0x0615,0x0615,0x0615}, /* 0614 */ - {0x0616,0x0616,0x0616}, {0x0617,0x0617,0x0617}, /* 0616 */ - {0x0618,0x0618,0x0618}, {0x0619,0x0619,0x0619}, /* 0618 */ - {0x061A,0x061A,0x061A}, {0x061B,0x061B,0x061B}, /* 061A */ - {0x061C,0x061C,0x061C}, {0x061D,0x061D,0x061D}, /* 061C */ - {0x061E,0x061E,0x061E}, {0x061F,0x061F,0x061F}, /* 061E */ - {0x0620,0x0620,0x0620}, {0x0621,0x0621,0x0621}, /* 0620 */ - {0x0622,0x0622,0x0622}, {0x0623,0x0623,0x0623}, /* 0622 */ - {0x0624,0x0624,0x0624}, {0x0625,0x0625,0x0625}, /* 0624 */ - {0x0626,0x0626,0x0626}, {0x0627,0x0627,0x0627}, /* 0626 */ - {0x0628,0x0628,0x0628}, {0x0629,0x0629,0x0629}, /* 0628 */ - {0x062A,0x062A,0x062A}, {0x062B,0x062B,0x062B}, /* 062A */ - {0x062C,0x062C,0x062C}, {0x062D,0x062D,0x062D}, /* 062C */ - {0x062E,0x062E,0x062E}, {0x062F,0x062F,0x062F}, /* 062E */ - {0x0630,0x0630,0x0630}, {0x0631,0x0631,0x0631}, /* 0630 */ - {0x0632,0x0632,0x0632}, {0x0633,0x0633,0x0633}, /* 0632 */ - {0x0634,0x0634,0x0634}, {0x0635,0x0635,0x0635}, /* 0634 */ - {0x0636,0x0636,0x0636}, {0x0637,0x0637,0x0637}, /* 0636 */ - {0x0638,0x0638,0x0638}, {0x0639,0x0639,0x0639}, /* 0638 */ - {0x063A,0x063A,0x063A}, {0x063B,0x063B,0x063B}, /* 063A */ - {0x063C,0x063C,0x063C}, {0x063D,0x063D,0x063D}, /* 063C */ - {0x063E,0x063E,0x063E}, {0x063F,0x063F,0x063F}, /* 063E */ - {0x0640,0x0640,0x0640}, {0x0641,0x0641,0x0641}, /* 0640 */ - {0x0642,0x0642,0x0642}, {0x0643,0x0643,0x0643}, /* 0642 */ - {0x0644,0x0644,0x0644}, {0x0645,0x0645,0x0645}, /* 0644 */ - {0x0646,0x0646,0x0646}, {0x0647,0x0647,0x0647}, /* 0646 */ - {0x0648,0x0648,0x0648}, {0x0649,0x0649,0x0649}, /* 0648 */ - {0x064A,0x064A,0x064A}, {0x064B,0x064B,0x064B}, /* 064A */ - {0x064C,0x064C,0x064C}, {0x064D,0x064D,0x064D}, /* 064C */ - {0x064E,0x064E,0x064E}, {0x064F,0x064F,0x064F}, /* 064E */ - {0x0650,0x0650,0x0650}, {0x0651,0x0651,0x0651}, /* 0650 */ - {0x0652,0x0652,0x0652}, {0x0653,0x0653,0x0653}, /* 0652 */ - {0x0654,0x0654,0x0654}, {0x0655,0x0655,0x0655}, /* 0654 */ - {0x0656,0x0656,0x0656}, {0x0657,0x0657,0x0657}, /* 0656 */ - {0x0658,0x0658,0x0658}, {0x0659,0x0659,0x0659}, /* 0658 */ - {0x065A,0x065A,0x065A}, {0x065B,0x065B,0x065B}, /* 065A */ - {0x065C,0x065C,0x065C}, {0x065D,0x065D,0x065D}, /* 065C */ - {0x065E,0x065E,0x065E}, {0x065F,0x065F,0x065F}, /* 065E */ - {0x0660,0x0660,0x0660}, {0x0661,0x0661,0x0661}, /* 0660 */ - {0x0662,0x0662,0x0662}, {0x0663,0x0663,0x0663}, /* 0662 */ - {0x0664,0x0664,0x0664}, {0x0665,0x0665,0x0665}, /* 0664 */ - {0x0666,0x0666,0x0666}, {0x0667,0x0667,0x0667}, /* 0666 */ - {0x0668,0x0668,0x0668}, {0x0669,0x0669,0x0669}, /* 0668 */ - {0x066A,0x066A,0x066A}, {0x066B,0x066B,0x066B}, /* 066A */ - {0x066C,0x066C,0x066C}, {0x066D,0x066D,0x066D}, /* 066C */ - {0x066E,0x066E,0x066E}, {0x066F,0x066F,0x066F}, /* 066E */ - {0x0670,0x0670,0x0670}, {0x0671,0x0671,0x0671}, /* 0670 */ - {0x0672,0x0672,0x0672}, {0x0673,0x0673,0x0673}, /* 0672 */ - {0x0674,0x0674,0x0674}, {0x0675,0x0675,0x0675}, /* 0674 */ - {0x0676,0x0676,0x0676}, {0x0677,0x0677,0x0677}, /* 0676 */ - {0x0678,0x0678,0x0678}, {0x0679,0x0679,0x0679}, /* 0678 */ - {0x067A,0x067A,0x067A}, {0x067B,0x067B,0x067B}, /* 067A */ - {0x067C,0x067C,0x067C}, {0x067D,0x067D,0x067D}, /* 067C */ - {0x067E,0x067E,0x067E}, {0x067F,0x067F,0x067F}, /* 067E */ - {0x0680,0x0680,0x0680}, {0x0681,0x0681,0x0681}, /* 0680 */ - {0x0682,0x0682,0x0682}, {0x0683,0x0683,0x0683}, /* 0682 */ - {0x0684,0x0684,0x0684}, {0x0685,0x0685,0x0685}, /* 0684 */ - {0x0686,0x0686,0x0686}, {0x0687,0x0687,0x0687}, /* 0686 */ - {0x0688,0x0688,0x0688}, {0x0689,0x0689,0x0689}, /* 0688 */ - {0x068A,0x068A,0x068A}, {0x068B,0x068B,0x068B}, /* 068A */ - {0x068C,0x068C,0x068C}, {0x068D,0x068D,0x068D}, /* 068C */ - {0x068E,0x068E,0x068E}, {0x068F,0x068F,0x068F}, /* 068E */ - {0x0690,0x0690,0x0690}, {0x0691,0x0691,0x0691}, /* 0690 */ - {0x0692,0x0692,0x0692}, {0x0693,0x0693,0x0693}, /* 0692 */ - {0x0694,0x0694,0x0694}, {0x0695,0x0695,0x0695}, /* 0694 */ - {0x0696,0x0696,0x0696}, {0x0697,0x0697,0x0697}, /* 0696 */ - {0x0698,0x0698,0x0698}, {0x0699,0x0699,0x0699}, /* 0698 */ - {0x069A,0x069A,0x069A}, {0x069B,0x069B,0x069B}, /* 069A */ - {0x069C,0x069C,0x069C}, {0x069D,0x069D,0x069D}, /* 069C */ - {0x069E,0x069E,0x069E}, {0x069F,0x069F,0x069F}, /* 069E */ - {0x06A0,0x06A0,0x06A0}, {0x06A1,0x06A1,0x06A1}, /* 06A0 */ - {0x06A2,0x06A2,0x06A2}, {0x06A3,0x06A3,0x06A3}, /* 06A2 */ - {0x06A4,0x06A4,0x06A4}, {0x06A5,0x06A5,0x06A5}, /* 06A4 */ - {0x06A6,0x06A6,0x06A6}, {0x06A7,0x06A7,0x06A7}, /* 06A6 */ - {0x06A8,0x06A8,0x06A8}, {0x06A9,0x06A9,0x06A9}, /* 06A8 */ - {0x06AA,0x06AA,0x06AA}, {0x06AB,0x06AB,0x06AB}, /* 06AA */ - {0x06AC,0x06AC,0x06AC}, {0x06AD,0x06AD,0x06AD}, /* 06AC */ - {0x06AE,0x06AE,0x06AE}, {0x06AF,0x06AF,0x06AF}, /* 06AE */ - {0x06B0,0x06B0,0x06B0}, {0x06B1,0x06B1,0x06B1}, /* 06B0 */ - {0x06B2,0x06B2,0x06B2}, {0x06B3,0x06B3,0x06B3}, /* 06B2 */ - {0x06B4,0x06B4,0x06B4}, {0x06B5,0x06B5,0x06B5}, /* 06B4 */ - {0x06B6,0x06B6,0x06B6}, {0x06B7,0x06B7,0x06B7}, /* 06B6 */ - {0x06B8,0x06B8,0x06B8}, {0x06B9,0x06B9,0x06B9}, /* 06B8 */ - {0x06BA,0x06BA,0x06BA}, {0x06BB,0x06BB,0x06BB}, /* 06BA */ - {0x06BC,0x06BC,0x06BC}, {0x06BD,0x06BD,0x06BD}, /* 06BC */ - {0x06BE,0x06BE,0x06BE}, {0x06BF,0x06BF,0x06BF}, /* 06BE */ - {0x06C0,0x06C0,0x06C0}, {0x06C1,0x06C1,0x06C1}, /* 06C0 */ - {0x06C2,0x06C2,0x06C2}, {0x06C3,0x06C3,0x06C3}, /* 06C2 */ - {0x06C4,0x06C4,0x06C4}, {0x06C5,0x06C5,0x06C5}, /* 06C4 */ - {0x06C6,0x06C6,0x06C6}, {0x06C7,0x06C7,0x06C7}, /* 06C6 */ - {0x06C8,0x06C8,0x06C8}, {0x06C9,0x06C9,0x06C9}, /* 06C8 */ - {0x06CA,0x06CA,0x06CA}, {0x06CB,0x06CB,0x06CB}, /* 06CA */ - {0x06CC,0x06CC,0x06CC}, {0x06CD,0x06CD,0x06CD}, /* 06CC */ - {0x06CE,0x06CE,0x06CE}, {0x06CF,0x06CF,0x06CF}, /* 06CE */ - {0x06D0,0x06D0,0x06D0}, {0x06D1,0x06D1,0x06D1}, /* 06D0 */ - {0x06D2,0x06D2,0x06D2}, {0x06D3,0x06D3,0x06D3}, /* 06D2 */ - {0x06D4,0x06D4,0x06D4}, {0x06D5,0x06D5,0x06D5}, /* 06D4 */ - {0x06D6,0x06D6,0x06D6}, {0x06D7,0x06D7,0x06D7}, /* 06D6 */ - {0x06D8,0x06D8,0x06D8}, {0x06D9,0x06D9,0x06D9}, /* 06D8 */ - {0x06DA,0x06DA,0x06DA}, {0x06DB,0x06DB,0x06DB}, /* 06DA */ - {0x06DC,0x06DC,0x06DC}, {0x06DD,0x06DD,0x06DD}, /* 06DC */ - {0x06DE,0x06DE,0x06DE}, {0x06DF,0x06DF,0x06DF}, /* 06DE */ - {0x06E0,0x06E0,0x06E0}, {0x06E1,0x06E1,0x06E1}, /* 06E0 */ - {0x06E2,0x06E2,0x06E2}, {0x06E3,0x06E3,0x06E3}, /* 06E2 */ - {0x06E4,0x06E4,0x06E4}, {0x06E5,0x06E5,0x06E5}, /* 06E4 */ - {0x06E6,0x06E6,0x06E6}, {0x06E7,0x06E7,0x06E7}, /* 06E6 */ - {0x06E8,0x06E8,0x06E8}, {0x06E9,0x06E9,0x06E9}, /* 06E8 */ - {0x06EA,0x06EA,0x06EA}, {0x06EB,0x06EB,0x06EB}, /* 06EA */ - {0x06EC,0x06EC,0x06EC}, {0x06ED,0x06ED,0x06ED}, /* 06EC */ - {0x06EE,0x06EE,0x06EE}, {0x06EF,0x06EF,0x06EF}, /* 06EE */ - {0x06F0,0x06F0,0x06F0}, {0x06F1,0x06F1,0x06F1}, /* 06F0 */ - {0x06F2,0x06F2,0x06F2}, {0x06F3,0x06F3,0x06F3}, /* 06F2 */ - {0x06F4,0x06F4,0x06F4}, {0x06F5,0x06F5,0x06F5}, /* 06F4 */ - {0x06F6,0x06F6,0x06F6}, {0x06F7,0x06F7,0x06F7}, /* 06F6 */ - {0x06F8,0x06F8,0x06F8}, {0x06F9,0x06F9,0x06F9}, /* 06F8 */ - {0x06FA,0x06FA,0x06FA}, {0x06FB,0x06FB,0x06FB}, /* 06FA */ - {0x06FC,0x06FC,0x06FC}, {0x06FD,0x06FD,0x06FD}, /* 06FC */ - {0x06FE,0x06FE,0x06FE}, {0x06FF,0x06FF,0x06FF} /* 06FE */ -}; - -static MY_UNICASE_CHARACTER plane07[]={ /* This page is dummy */ - {0x0700,0x0700,0x0700}, {0x0701,0x0701,0x0701}, /* 0700 */ - {0x0702,0x0702,0x0702}, {0x0703,0x0703,0x0703}, /* 0702 */ - {0x0704,0x0704,0x0704}, {0x0705,0x0705,0x0705}, /* 0704 */ - {0x0706,0x0706,0x0706}, {0x0707,0x0707,0x0707}, /* 0706 */ - {0x0708,0x0708,0x0708}, {0x0709,0x0709,0x0709}, /* 0708 */ - {0x070A,0x070A,0x070A}, {0x070B,0x070B,0x070B}, /* 070A */ - {0x070C,0x070C,0x070C}, {0x070D,0x070D,0x070D}, /* 070C */ - {0x070E,0x070E,0x070E}, {0x070F,0x070F,0x070F}, /* 070E */ - {0x0710,0x0710,0x0710}, {0x0711,0x0711,0x0711}, /* 0710 */ - {0x0712,0x0712,0x0712}, {0x0713,0x0713,0x0713}, /* 0712 */ - {0x0714,0x0714,0x0714}, {0x0715,0x0715,0x0715}, /* 0714 */ - {0x0716,0x0716,0x0716}, {0x0717,0x0717,0x0717}, /* 0716 */ - {0x0718,0x0718,0x0718}, {0x0719,0x0719,0x0719}, /* 0718 */ - {0x071A,0x071A,0x071A}, {0x071B,0x071B,0x071B}, /* 071A */ - {0x071C,0x071C,0x071C}, {0x071D,0x071D,0x071D}, /* 071C */ - {0x071E,0x071E,0x071E}, {0x071F,0x071F,0x071F}, /* 071E */ - {0x0720,0x0720,0x0720}, {0x0721,0x0721,0x0721}, /* 0720 */ - {0x0722,0x0722,0x0722}, {0x0723,0x0723,0x0723}, /* 0722 */ - {0x0724,0x0724,0x0724}, {0x0725,0x0725,0x0725}, /* 0724 */ - {0x0726,0x0726,0x0726}, {0x0727,0x0727,0x0727}, /* 0726 */ - {0x0728,0x0728,0x0728}, {0x0729,0x0729,0x0729}, /* 0728 */ - {0x072A,0x072A,0x072A}, {0x072B,0x072B,0x072B}, /* 072A */ - {0x072C,0x072C,0x072C}, {0x072D,0x072D,0x072D}, /* 072C */ - {0x072E,0x072E,0x072E}, {0x072F,0x072F,0x072F}, /* 072E */ - {0x0730,0x0730,0x0730}, {0x0731,0x0731,0x0731}, /* 0730 */ - {0x0732,0x0732,0x0732}, {0x0733,0x0733,0x0733}, /* 0732 */ - {0x0734,0x0734,0x0734}, {0x0735,0x0735,0x0735}, /* 0734 */ - {0x0736,0x0736,0x0736}, {0x0737,0x0737,0x0737}, /* 0736 */ - {0x0738,0x0738,0x0738}, {0x0739,0x0739,0x0739}, /* 0738 */ - {0x073A,0x073A,0x073A}, {0x073B,0x073B,0x073B}, /* 073A */ - {0x073C,0x073C,0x073C}, {0x073D,0x073D,0x073D}, /* 073C */ - {0x073E,0x073E,0x073E}, {0x073F,0x073F,0x073F}, /* 073E */ - {0x0740,0x0740,0x0740}, {0x0741,0x0741,0x0741}, /* 0740 */ - {0x0742,0x0742,0x0742}, {0x0743,0x0743,0x0743}, /* 0742 */ - {0x0744,0x0744,0x0744}, {0x0745,0x0745,0x0745}, /* 0744 */ - {0x0746,0x0746,0x0746}, {0x0747,0x0747,0x0747}, /* 0746 */ - {0x0748,0x0748,0x0748}, {0x0749,0x0749,0x0749}, /* 0748 */ - {0x074A,0x074A,0x074A}, {0x074B,0x074B,0x074B}, /* 074A */ - {0x074C,0x074C,0x074C}, {0x074D,0x074D,0x074D}, /* 074C */ - {0x074E,0x074E,0x074E}, {0x074F,0x074F,0x074F}, /* 074E */ - {0x0750,0x0750,0x0750}, {0x0751,0x0751,0x0751}, /* 0750 */ - {0x0752,0x0752,0x0752}, {0x0753,0x0753,0x0753}, /* 0752 */ - {0x0754,0x0754,0x0754}, {0x0755,0x0755,0x0755}, /* 0754 */ - {0x0756,0x0756,0x0756}, {0x0757,0x0757,0x0757}, /* 0756 */ - {0x0758,0x0758,0x0758}, {0x0759,0x0759,0x0759}, /* 0758 */ - {0x075A,0x075A,0x075A}, {0x075B,0x075B,0x075B}, /* 075A */ - {0x075C,0x075C,0x075C}, {0x075D,0x075D,0x075D}, /* 075C */ - {0x075E,0x075E,0x075E}, {0x075F,0x075F,0x075F}, /* 075E */ - {0x0760,0x0760,0x0760}, {0x0761,0x0761,0x0761}, /* 0760 */ - {0x0762,0x0762,0x0762}, {0x0763,0x0763,0x0763}, /* 0762 */ - {0x0764,0x0764,0x0764}, {0x0765,0x0765,0x0765}, /* 0764 */ - {0x0766,0x0766,0x0766}, {0x0767,0x0767,0x0767}, /* 0766 */ - {0x0768,0x0768,0x0768}, {0x0769,0x0769,0x0769}, /* 0768 */ - {0x076A,0x076A,0x076A}, {0x076B,0x076B,0x076B}, /* 076A */ - {0x076C,0x076C,0x076C}, {0x076D,0x076D,0x076D}, /* 076C */ - {0x076E,0x076E,0x076E}, {0x076F,0x076F,0x076F}, /* 076E */ - {0x0770,0x0770,0x0770}, {0x0771,0x0771,0x0771}, /* 0770 */ - {0x0772,0x0772,0x0772}, {0x0773,0x0773,0x0773}, /* 0772 */ - {0x0774,0x0774,0x0774}, {0x0775,0x0775,0x0775}, /* 0774 */ - {0x0776,0x0776,0x0776}, {0x0777,0x0777,0x0777}, /* 0776 */ - {0x0778,0x0778,0x0778}, {0x0779,0x0779,0x0779}, /* 0778 */ - {0x077A,0x077A,0x077A}, {0x077B,0x077B,0x077B}, /* 077A */ - {0x077C,0x077C,0x077C}, {0x077D,0x077D,0x077D}, /* 077C */ - {0x077E,0x077E,0x077E}, {0x077F,0x077F,0x077F}, /* 077E */ - {0x0780,0x0780,0x0780}, {0x0781,0x0781,0x0781}, /* 0780 */ - {0x0782,0x0782,0x0782}, {0x0783,0x0783,0x0783}, /* 0782 */ - {0x0784,0x0784,0x0784}, {0x0785,0x0785,0x0785}, /* 0784 */ - {0x0786,0x0786,0x0786}, {0x0787,0x0787,0x0787}, /* 0786 */ - {0x0788,0x0788,0x0788}, {0x0789,0x0789,0x0789}, /* 0788 */ - {0x078A,0x078A,0x078A}, {0x078B,0x078B,0x078B}, /* 078A */ - {0x078C,0x078C,0x078C}, {0x078D,0x078D,0x078D}, /* 078C */ - {0x078E,0x078E,0x078E}, {0x078F,0x078F,0x078F}, /* 078E */ - {0x0790,0x0790,0x0790}, {0x0791,0x0791,0x0791}, /* 0790 */ - {0x0792,0x0792,0x0792}, {0x0793,0x0793,0x0793}, /* 0792 */ - {0x0794,0x0794,0x0794}, {0x0795,0x0795,0x0795}, /* 0794 */ - {0x0796,0x0796,0x0796}, {0x0797,0x0797,0x0797}, /* 0796 */ - {0x0798,0x0798,0x0798}, {0x0799,0x0799,0x0799}, /* 0798 */ - {0x079A,0x079A,0x079A}, {0x079B,0x079B,0x079B}, /* 079A */ - {0x079C,0x079C,0x079C}, {0x079D,0x079D,0x079D}, /* 079C */ - {0x079E,0x079E,0x079E}, {0x079F,0x079F,0x079F}, /* 079E */ - {0x07A0,0x07A0,0x07A0}, {0x07A1,0x07A1,0x07A1}, /* 07A0 */ - {0x07A2,0x07A2,0x07A2}, {0x07A3,0x07A3,0x07A3}, /* 07A2 */ - {0x07A4,0x07A4,0x07A4}, {0x07A5,0x07A5,0x07A5}, /* 07A4 */ - {0x07A6,0x07A6,0x07A6}, {0x07A7,0x07A7,0x07A7}, /* 07A6 */ - {0x07A8,0x07A8,0x07A8}, {0x07A9,0x07A9,0x07A9}, /* 07A8 */ - {0x07AA,0x07AA,0x07AA}, {0x07AB,0x07AB,0x07AB}, /* 07AA */ - {0x07AC,0x07AC,0x07AC}, {0x07AD,0x07AD,0x07AD}, /* 07AC */ - {0x07AE,0x07AE,0x07AE}, {0x07AF,0x07AF,0x07AF}, /* 07AE */ - {0x07B0,0x07B0,0x07B0}, {0x07B1,0x07B1,0x07B1}, /* 07B0 */ - {0x07B2,0x07B2,0x07B2}, {0x07B3,0x07B3,0x07B3}, /* 07B2 */ - {0x07B4,0x07B4,0x07B4}, {0x07B5,0x07B5,0x07B5}, /* 07B4 */ - {0x07B6,0x07B6,0x07B6}, {0x07B7,0x07B7,0x07B7}, /* 07B6 */ - {0x07B8,0x07B8,0x07B8}, {0x07B9,0x07B9,0x07B9}, /* 07B8 */ - {0x07BA,0x07BA,0x07BA}, {0x07BB,0x07BB,0x07BB}, /* 07BA */ - {0x07BC,0x07BC,0x07BC}, {0x07BD,0x07BD,0x07BD}, /* 07BC */ - {0x07BE,0x07BE,0x07BE}, {0x07BF,0x07BF,0x07BF}, /* 07BE */ - {0x07C0,0x07C0,0x07C0}, {0x07C1,0x07C1,0x07C1}, /* 07C0 */ - {0x07C2,0x07C2,0x07C2}, {0x07C3,0x07C3,0x07C3}, /* 07C2 */ - {0x07C4,0x07C4,0x07C4}, {0x07C5,0x07C5,0x07C5}, /* 07C4 */ - {0x07C6,0x07C6,0x07C6}, {0x07C7,0x07C7,0x07C7}, /* 07C6 */ - {0x07C8,0x07C8,0x07C8}, {0x07C9,0x07C9,0x07C9}, /* 07C8 */ - {0x07CA,0x07CA,0x07CA}, {0x07CB,0x07CB,0x07CB}, /* 07CA */ - {0x07CC,0x07CC,0x07CC}, {0x07CD,0x07CD,0x07CD}, /* 07CC */ - {0x07CE,0x07CE,0x07CE}, {0x07CF,0x07CF,0x07CF}, /* 07CE */ - {0x07D0,0x07D0,0x07D0}, {0x07D1,0x07D1,0x07D1}, /* 07D0 */ - {0x07D2,0x07D2,0x07D2}, {0x07D3,0x07D3,0x07D3}, /* 07D2 */ - {0x07D4,0x07D4,0x07D4}, {0x07D5,0x07D5,0x07D5}, /* 07D4 */ - {0x07D6,0x07D6,0x07D6}, {0x07D7,0x07D7,0x07D7}, /* 07D6 */ - {0x07D8,0x07D8,0x07D8}, {0x07D9,0x07D9,0x07D9}, /* 07D8 */ - {0x07DA,0x07DA,0x07DA}, {0x07DB,0x07DB,0x07DB}, /* 07DA */ - {0x07DC,0x07DC,0x07DC}, {0x07DD,0x07DD,0x07DD}, /* 07DC */ - {0x07DE,0x07DE,0x07DE}, {0x07DF,0x07DF,0x07DF}, /* 07DE */ - {0x07E0,0x07E0,0x07E0}, {0x07E1,0x07E1,0x07E1}, /* 07E0 */ - {0x07E2,0x07E2,0x07E2}, {0x07E3,0x07E3,0x07E3}, /* 07E2 */ - {0x07E4,0x07E4,0x07E4}, {0x07E5,0x07E5,0x07E5}, /* 07E4 */ - {0x07E6,0x07E6,0x07E6}, {0x07E7,0x07E7,0x07E7}, /* 07E6 */ - {0x07E8,0x07E8,0x07E8}, {0x07E9,0x07E9,0x07E9}, /* 07E8 */ - {0x07EA,0x07EA,0x07EA}, {0x07EB,0x07EB,0x07EB}, /* 07EA */ - {0x07EC,0x07EC,0x07EC}, {0x07ED,0x07ED,0x07ED}, /* 07EC */ - {0x07EE,0x07EE,0x07EE}, {0x07EF,0x07EF,0x07EF}, /* 07EE */ - {0x07F0,0x07F0,0x07F0}, {0x07F1,0x07F1,0x07F1}, /* 07F0 */ - {0x07F2,0x07F2,0x07F2}, {0x07F3,0x07F3,0x07F3}, /* 07F2 */ - {0x07F4,0x07F4,0x07F4}, {0x07F5,0x07F5,0x07F5}, /* 07F4 */ - {0x07F6,0x07F6,0x07F6}, {0x07F7,0x07F7,0x07F7}, /* 07F6 */ - {0x07F8,0x07F8,0x07F8}, {0x07F9,0x07F9,0x07F9}, /* 07F8 */ - {0x07FA,0x07FA,0x07FA}, {0x07FB,0x07FB,0x07FB}, /* 07FA */ - {0x07FC,0x07FC,0x07FC}, {0x07FD,0x07FD,0x07FD}, /* 07FC */ - {0x07FE,0x07FE,0x07FE}, {0x07FF,0x07FF,0x07FF} /* 07FE */ -}; - -static MY_UNICASE_CHARACTER plane1E[]={ - {0x1E00,0x1E01,0x0041}, {0x1E00,0x1E01,0x0041}, - {0x1E02,0x1E03,0x0042}, {0x1E02,0x1E03,0x0042}, - {0x1E04,0x1E05,0x0042}, {0x1E04,0x1E05,0x0042}, - {0x1E06,0x1E07,0x0042}, {0x1E06,0x1E07,0x0042}, - {0x1E08,0x1E09,0x0043}, {0x1E08,0x1E09,0x0043}, - {0x1E0A,0x1E0B,0x0044}, {0x1E0A,0x1E0B,0x0044}, - {0x1E0C,0x1E0D,0x0044}, {0x1E0C,0x1E0D,0x0044}, - {0x1E0E,0x1E0F,0x0044}, {0x1E0E,0x1E0F,0x0044}, - {0x1E10,0x1E11,0x0044}, {0x1E10,0x1E11,0x0044}, - {0x1E12,0x1E13,0x0044}, {0x1E12,0x1E13,0x0044}, - {0x1E14,0x1E15,0x0045}, {0x1E14,0x1E15,0x0045}, - {0x1E16,0x1E17,0x0045}, {0x1E16,0x1E17,0x0045}, - {0x1E18,0x1E19,0x0045}, {0x1E18,0x1E19,0x0045}, - {0x1E1A,0x1E1B,0x0045}, {0x1E1A,0x1E1B,0x0045}, - {0x1E1C,0x1E1D,0x0045}, {0x1E1C,0x1E1D,0x0045}, - {0x1E1E,0x1E1F,0x0046}, {0x1E1E,0x1E1F,0x0046}, - {0x1E20,0x1E21,0x0047}, {0x1E20,0x1E21,0x0047}, - {0x1E22,0x1E23,0x0048}, {0x1E22,0x1E23,0x0048}, - {0x1E24,0x1E25,0x0048}, {0x1E24,0x1E25,0x0048}, - {0x1E26,0x1E27,0x0048}, {0x1E26,0x1E27,0x0048}, - {0x1E28,0x1E29,0x0048}, {0x1E28,0x1E29,0x0048}, - {0x1E2A,0x1E2B,0x0048}, {0x1E2A,0x1E2B,0x0048}, - {0x1E2C,0x1E2D,0x0049}, {0x1E2C,0x1E2D,0x0049}, - {0x1E2E,0x1E2F,0x0049}, {0x1E2E,0x1E2F,0x0049}, - {0x1E30,0x1E31,0x004B}, {0x1E30,0x1E31,0x004B}, - {0x1E32,0x1E33,0x004B}, {0x1E32,0x1E33,0x004B}, - {0x1E34,0x1E35,0x004B}, {0x1E34,0x1E35,0x004B}, - {0x1E36,0x1E37,0x004C}, {0x1E36,0x1E37,0x004C}, - {0x1E38,0x1E39,0x004C}, {0x1E38,0x1E39,0x004C}, - {0x1E3A,0x1E3B,0x004C}, {0x1E3A,0x1E3B,0x004C}, - {0x1E3C,0x1E3D,0x004C}, {0x1E3C,0x1E3D,0x004C}, - {0x1E3E,0x1E3F,0x004D}, {0x1E3E,0x1E3F,0x004D}, - {0x1E40,0x1E41,0x004D}, {0x1E40,0x1E41,0x004D}, - {0x1E42,0x1E43,0x004D}, {0x1E42,0x1E43,0x004D}, - {0x1E44,0x1E45,0x004E}, {0x1E44,0x1E45,0x004E}, - {0x1E46,0x1E47,0x004E}, {0x1E46,0x1E47,0x004E}, - {0x1E48,0x1E49,0x004E}, {0x1E48,0x1E49,0x004E}, - {0x1E4A,0x1E4B,0x004E}, {0x1E4A,0x1E4B,0x004E}, - {0x1E4C,0x1E4D,0x004F}, {0x1E4C,0x1E4D,0x004F}, - {0x1E4E,0x1E4F,0x004F}, {0x1E4E,0x1E4F,0x004F}, - {0x1E50,0x1E51,0x004F}, {0x1E50,0x1E51,0x004F}, - {0x1E52,0x1E53,0x004F}, {0x1E52,0x1E53,0x004F}, - {0x1E54,0x1E55,0x0050}, {0x1E54,0x1E55,0x0050}, - {0x1E56,0x1E57,0x0050}, {0x1E56,0x1E57,0x0050}, - {0x1E58,0x1E59,0x0052}, {0x1E58,0x1E59,0x0052}, - {0x1E5A,0x1E5B,0x0052}, {0x1E5A,0x1E5B,0x0052}, - {0x1E5C,0x1E5D,0x0052}, {0x1E5C,0x1E5D,0x0052}, - {0x1E5E,0x1E5F,0x0052}, {0x1E5E,0x1E5F,0x0052}, - {0x1E60,0x1E61,0x0053}, {0x1E60,0x1E61,0x0053}, - {0x1E62,0x1E63,0x0053}, {0x1E62,0x1E63,0x0053}, - {0x1E64,0x1E65,0x0053}, {0x1E64,0x1E65,0x0053}, - {0x1E66,0x1E67,0x0053}, {0x1E66,0x1E67,0x0053}, - {0x1E68,0x1E69,0x0053}, {0x1E68,0x1E69,0x0053}, - {0x1E6A,0x1E6B,0x0054}, {0x1E6A,0x1E6B,0x0054}, - {0x1E6C,0x1E6D,0x0054}, {0x1E6C,0x1E6D,0x0054}, - {0x1E6E,0x1E6F,0x0054}, {0x1E6E,0x1E6F,0x0054}, - {0x1E70,0x1E71,0x0054}, {0x1E70,0x1E71,0x0054}, - {0x1E72,0x1E73,0x0055}, {0x1E72,0x1E73,0x0055}, - {0x1E74,0x1E75,0x0055}, {0x1E74,0x1E75,0x0055}, - {0x1E76,0x1E77,0x0055}, {0x1E76,0x1E77,0x0055}, - {0x1E78,0x1E79,0x0055}, {0x1E78,0x1E79,0x0055}, - {0x1E7A,0x1E7B,0x0055}, {0x1E7A,0x1E7B,0x0055}, - {0x1E7C,0x1E7D,0x0056}, {0x1E7C,0x1E7D,0x0056}, - {0x1E7E,0x1E7F,0x0056}, {0x1E7E,0x1E7F,0x0056}, - {0x1E80,0x1E81,0x0057}, {0x1E80,0x1E81,0x0057}, - {0x1E82,0x1E83,0x0057}, {0x1E82,0x1E83,0x0057}, - {0x1E84,0x1E85,0x0057}, {0x1E84,0x1E85,0x0057}, - {0x1E86,0x1E87,0x0057}, {0x1E86,0x1E87,0x0057}, - {0x1E88,0x1E89,0x0057}, {0x1E88,0x1E89,0x0057}, - {0x1E8A,0x1E8B,0x0058}, {0x1E8A,0x1E8B,0x0058}, - {0x1E8C,0x1E8D,0x0058}, {0x1E8C,0x1E8D,0x0058}, - {0x1E8E,0x1E8F,0x0059}, {0x1E8E,0x1E8F,0x0059}, - {0x1E90,0x1E91,0x005A}, {0x1E90,0x1E91,0x005A}, - {0x1E92,0x1E93,0x005A}, {0x1E92,0x1E93,0x005A}, - {0x1E94,0x1E95,0x005A}, {0x1E94,0x1E95,0x005A}, - {0x1E96,0x1E96,0x0048}, {0x1E97,0x1E97,0x0054}, - {0x1E98,0x1E98,0x0057}, {0x1E99,0x1E99,0x0059}, - {0x1E9A,0x1E9A,0x1E9A}, {0x1E60,0x1E9B,0x0053}, - {0x1E9C,0x1E9C,0x1E9C}, {0x1E9D,0x1E9D,0x1E9D}, - {0x1E9E,0x1E9E,0x1E9E}, {0x1E9F,0x1E9F,0x1E9F}, - {0x1EA0,0x1EA1,0x0041}, {0x1EA0,0x1EA1,0x0041}, - {0x1EA2,0x1EA3,0x0041}, {0x1EA2,0x1EA3,0x0041}, - {0x1EA4,0x1EA5,0x0041}, {0x1EA4,0x1EA5,0x0041}, - {0x1EA6,0x1EA7,0x0041}, {0x1EA6,0x1EA7,0x0041}, - {0x1EA8,0x1EA9,0x0041}, {0x1EA8,0x1EA9,0x0041}, - {0x1EAA,0x1EAB,0x0041}, {0x1EAA,0x1EAB,0x0041}, - {0x1EAC,0x1EAD,0x0041}, {0x1EAC,0x1EAD,0x0041}, - {0x1EAE,0x1EAF,0x0041}, {0x1EAE,0x1EAF,0x0041}, - {0x1EB0,0x1EB1,0x0041}, {0x1EB0,0x1EB1,0x0041}, - {0x1EB2,0x1EB3,0x0041}, {0x1EB2,0x1EB3,0x0041}, - {0x1EB4,0x1EB5,0x0041}, {0x1EB4,0x1EB5,0x0041}, - {0x1EB6,0x1EB7,0x0041}, {0x1EB6,0x1EB7,0x0041}, - {0x1EB8,0x1EB9,0x0045}, {0x1EB8,0x1EB9,0x0045}, - {0x1EBA,0x1EBB,0x0045}, {0x1EBA,0x1EBB,0x0045}, - {0x1EBC,0x1EBD,0x0045}, {0x1EBC,0x1EBD,0x0045}, - {0x1EBE,0x1EBF,0x0045}, {0x1EBE,0x1EBF,0x0045}, - {0x1EC0,0x1EC1,0x0045}, {0x1EC0,0x1EC1,0x0045}, - {0x1EC2,0x1EC3,0x0045}, {0x1EC2,0x1EC3,0x0045}, - {0x1EC4,0x1EC5,0x0045}, {0x1EC4,0x1EC5,0x0045}, - {0x1EC6,0x1EC7,0x0045}, {0x1EC6,0x1EC7,0x0045}, - {0x1EC8,0x1EC9,0x0049}, {0x1EC8,0x1EC9,0x0049}, - {0x1ECA,0x1ECB,0x0049}, {0x1ECA,0x1ECB,0x0049}, - {0x1ECC,0x1ECD,0x004F}, {0x1ECC,0x1ECD,0x004F}, - {0x1ECE,0x1ECF,0x004F}, {0x1ECE,0x1ECF,0x004F}, - {0x1ED0,0x1ED1,0x004F}, {0x1ED0,0x1ED1,0x004F}, - {0x1ED2,0x1ED3,0x004F}, {0x1ED2,0x1ED3,0x004F}, - {0x1ED4,0x1ED5,0x004F}, {0x1ED4,0x1ED5,0x004F}, - {0x1ED6,0x1ED7,0x004F}, {0x1ED6,0x1ED7,0x004F}, - {0x1ED8,0x1ED9,0x004F}, {0x1ED8,0x1ED9,0x004F}, - {0x1EDA,0x1EDB,0x004F}, {0x1EDA,0x1EDB,0x004F}, - {0x1EDC,0x1EDD,0x004F}, {0x1EDC,0x1EDD,0x004F}, - {0x1EDE,0x1EDF,0x004F}, {0x1EDE,0x1EDF,0x004F}, - {0x1EE0,0x1EE1,0x004F}, {0x1EE0,0x1EE1,0x004F}, - {0x1EE2,0x1EE3,0x004F}, {0x1EE2,0x1EE3,0x004F}, - {0x1EE4,0x1EE5,0x0055}, {0x1EE4,0x1EE5,0x0055}, - {0x1EE6,0x1EE7,0x0055}, {0x1EE6,0x1EE7,0x0055}, - {0x1EE8,0x1EE9,0x0055}, {0x1EE8,0x1EE9,0x0055}, - {0x1EEA,0x1EEB,0x0055}, {0x1EEA,0x1EEB,0x0055}, - {0x1EEC,0x1EED,0x0055}, {0x1EEC,0x1EED,0x0055}, - {0x1EEE,0x1EEF,0x0055}, {0x1EEE,0x1EEF,0x0055}, - {0x1EF0,0x1EF1,0x0055}, {0x1EF0,0x1EF1,0x0055}, - {0x1EF2,0x1EF3,0x0059}, {0x1EF2,0x1EF3,0x0059}, - {0x1EF4,0x1EF5,0x0059}, {0x1EF4,0x1EF5,0x0059}, - {0x1EF6,0x1EF7,0x0059}, {0x1EF6,0x1EF7,0x0059}, - {0x1EF8,0x1EF9,0x0059}, {0x1EF8,0x1EF9,0x0059}, - {0x1EFA,0x1EFA,0x1EFA}, {0x1EFB,0x1EFB,0x1EFB}, - {0x1EFC,0x1EFC,0x1EFC}, {0x1EFD,0x1EFD,0x1EFD}, - {0x1EFE,0x1EFE,0x1EFE}, {0x1EFF,0x1EFF,0x1EFF} -}; - -static MY_UNICASE_CHARACTER plane1F[]={ - {0x1F08,0x1F00,0x0391}, {0x1F09,0x1F01,0x0391}, - {0x1F0A,0x1F02,0x0391}, {0x1F0B,0x1F03,0x0391}, - {0x1F0C,0x1F04,0x0391}, {0x1F0D,0x1F05,0x0391}, - {0x1F0E,0x1F06,0x0391}, {0x1F0F,0x1F07,0x0391}, - {0x1F08,0x1F00,0x0391}, {0x1F09,0x1F01,0x0391}, - {0x1F0A,0x1F02,0x0391}, {0x1F0B,0x1F03,0x0391}, - {0x1F0C,0x1F04,0x0391}, {0x1F0D,0x1F05,0x0391}, - {0x1F0E,0x1F06,0x0391}, {0x1F0F,0x1F07,0x0391}, - {0x1F18,0x1F10,0x0395}, {0x1F19,0x1F11,0x0395}, - {0x1F1A,0x1F12,0x0395}, {0x1F1B,0x1F13,0x0395}, - {0x1F1C,0x1F14,0x0395}, {0x1F1D,0x1F15,0x0395}, - {0x1F16,0x1F16,0x1F16}, {0x1F17,0x1F17,0x1F17}, - {0x1F18,0x1F10,0x0395}, {0x1F19,0x1F11,0x0395}, - {0x1F1A,0x1F12,0x0395}, {0x1F1B,0x1F13,0x0395}, - {0x1F1C,0x1F14,0x0395}, {0x1F1D,0x1F15,0x0395}, - {0x1F1E,0x1F1E,0x1F1E}, {0x1F1F,0x1F1F,0x1F1F}, - {0x1F28,0x1F20,0x0397}, {0x1F29,0x1F21,0x0397}, - {0x1F2A,0x1F22,0x0397}, {0x1F2B,0x1F23,0x0397}, - {0x1F2C,0x1F24,0x0397}, {0x1F2D,0x1F25,0x0397}, - {0x1F2E,0x1F26,0x0397}, {0x1F2F,0x1F27,0x0397}, - {0x1F28,0x1F20,0x0397}, {0x1F29,0x1F21,0x0397}, - {0x1F2A,0x1F22,0x0397}, {0x1F2B,0x1F23,0x0397}, - {0x1F2C,0x1F24,0x0397}, {0x1F2D,0x1F25,0x0397}, - {0x1F2E,0x1F26,0x0397}, {0x1F2F,0x1F27,0x0397}, - {0x1F38,0x1F30,0x0399}, {0x1F39,0x1F31,0x0399}, - {0x1F3A,0x1F32,0x0399}, {0x1F3B,0x1F33,0x0399}, - {0x1F3C,0x1F34,0x0399}, {0x1F3D,0x1F35,0x0399}, - {0x1F3E,0x1F36,0x0399}, {0x1F3F,0x1F37,0x0399}, - {0x1F38,0x1F30,0x0399}, {0x1F39,0x1F31,0x0399}, - {0x1F3A,0x1F32,0x0399}, {0x1F3B,0x1F33,0x0399}, - {0x1F3C,0x1F34,0x0399}, {0x1F3D,0x1F35,0x0399}, - {0x1F3E,0x1F36,0x0399}, {0x1F3F,0x1F37,0x0399}, - {0x1F48,0x1F40,0x039F}, {0x1F49,0x1F41,0x039F}, - {0x1F4A,0x1F42,0x039F}, {0x1F4B,0x1F43,0x039F}, - {0x1F4C,0x1F44,0x039F}, {0x1F4D,0x1F45,0x039F}, - {0x1F46,0x1F46,0x1F46}, {0x1F47,0x1F47,0x1F47}, - {0x1F48,0x1F40,0x039F}, {0x1F49,0x1F41,0x039F}, - {0x1F4A,0x1F42,0x039F}, {0x1F4B,0x1F43,0x039F}, - {0x1F4C,0x1F44,0x039F}, {0x1F4D,0x1F45,0x039F}, - {0x1F4E,0x1F4E,0x1F4E}, {0x1F4F,0x1F4F,0x1F4F}, - {0x1F50,0x1F50,0x03A5}, {0x1F59,0x1F51,0x03A5}, - {0x1F52,0x1F52,0x03A5}, {0x1F5B,0x1F53,0x03A5}, - {0x1F54,0x1F54,0x03A5}, {0x1F5D,0x1F55,0x03A5}, - {0x1F56,0x1F56,0x03A5}, {0x1F5F,0x1F57,0x03A5}, - {0x1F58,0x1F58,0x1F58}, {0x1F59,0x1F51,0x03A5}, - {0x1F5A,0x1F5A,0x1F5A}, {0x1F5B,0x1F53,0x03A5}, - {0x1F5C,0x1F5C,0x1F5C}, {0x1F5D,0x1F55,0x03A5}, - {0x1F5E,0x1F5E,0x1F5E}, {0x1F5F,0x1F57,0x03A5}, - {0x1F68,0x1F60,0x03A9}, {0x1F69,0x1F61,0x03A9}, - {0x1F6A,0x1F62,0x03A9}, {0x1F6B,0x1F63,0x03A9}, - {0x1F6C,0x1F64,0x03A9}, {0x1F6D,0x1F65,0x03A9}, - {0x1F6E,0x1F66,0x03A9}, {0x1F6F,0x1F67,0x03A9}, - {0x1F68,0x1F60,0x03A9}, {0x1F69,0x1F61,0x03A9}, - {0x1F6A,0x1F62,0x03A9}, {0x1F6B,0x1F63,0x03A9}, - {0x1F6C,0x1F64,0x03A9}, {0x1F6D,0x1F65,0x03A9}, - {0x1F6E,0x1F66,0x03A9}, {0x1F6F,0x1F67,0x03A9}, - {0x1FBA,0x1F70,0x0391}, {0x1FBB,0x1F71,0x1FBB}, - {0x1FC8,0x1F72,0x0395}, {0x1FC9,0x1F73,0x1FC9}, - {0x1FCA,0x1F74,0x0397}, {0x1FCB,0x1F75,0x1FCB}, - {0x1FDA,0x1F76,0x0399}, {0x1FDB,0x1F77,0x1FDB}, - {0x1FF8,0x1F78,0x039F}, {0x1FF9,0x1F79,0x1FF9}, - {0x1FEA,0x1F7A,0x03A5}, {0x1FEB,0x1F7B,0x1FEB}, - {0x1FFA,0x1F7C,0x03A9}, {0x1FFB,0x1F7D,0x1FFB}, - {0x1F7E,0x1F7E,0x1F7E}, {0x1F7F,0x1F7F,0x1F7F}, - {0x1F88,0x1F80,0x0391}, {0x1F89,0x1F81,0x0391}, - {0x1F8A,0x1F82,0x0391}, {0x1F8B,0x1F83,0x0391}, - {0x1F8C,0x1F84,0x0391}, {0x1F8D,0x1F85,0x0391}, - {0x1F8E,0x1F86,0x0391}, {0x1F8F,0x1F87,0x0391}, - {0x1F88,0x1F80,0x0391}, {0x1F89,0x1F81,0x0391}, - {0x1F8A,0x1F82,0x0391}, {0x1F8B,0x1F83,0x0391}, - {0x1F8C,0x1F84,0x0391}, {0x1F8D,0x1F85,0x0391}, - {0x1F8E,0x1F86,0x0391}, {0x1F8F,0x1F87,0x0391}, - {0x1F98,0x1F90,0x0397}, {0x1F99,0x1F91,0x0397}, - {0x1F9A,0x1F92,0x0397}, {0x1F9B,0x1F93,0x0397}, - {0x1F9C,0x1F94,0x0397}, {0x1F9D,0x1F95,0x0397}, - {0x1F9E,0x1F96,0x0397}, {0x1F9F,0x1F97,0x0397}, - {0x1F98,0x1F90,0x0397}, {0x1F99,0x1F91,0x0397}, - {0x1F9A,0x1F92,0x0397}, {0x1F9B,0x1F93,0x0397}, - {0x1F9C,0x1F94,0x0397}, {0x1F9D,0x1F95,0x0397}, - {0x1F9E,0x1F96,0x0397}, {0x1F9F,0x1F97,0x0397}, - {0x1FA8,0x1FA0,0x03A9}, {0x1FA9,0x1FA1,0x03A9}, - {0x1FAA,0x1FA2,0x03A9}, {0x1FAB,0x1FA3,0x03A9}, - {0x1FAC,0x1FA4,0x03A9}, {0x1FAD,0x1FA5,0x03A9}, - {0x1FAE,0x1FA6,0x03A9}, {0x1FAF,0x1FA7,0x03A9}, - {0x1FA8,0x1FA0,0x03A9}, {0x1FA9,0x1FA1,0x03A9}, - {0x1FAA,0x1FA2,0x03A9}, {0x1FAB,0x1FA3,0x03A9}, - {0x1FAC,0x1FA4,0x03A9}, {0x1FAD,0x1FA5,0x03A9}, - {0x1FAE,0x1FA6,0x03A9}, {0x1FAF,0x1FA7,0x03A9}, - {0x1FB8,0x1FB0,0x0391}, {0x1FB9,0x1FB1,0x0391}, - {0x1FB2,0x1FB2,0x0391}, {0x1FBC,0x1FB3,0x0391}, - {0x1FB4,0x1FB4,0x0391}, {0x1FB5,0x1FB5,0x1FB5}, - {0x1FB6,0x1FB6,0x0391}, {0x1FB7,0x1FB7,0x0391}, - {0x1FB8,0x1FB0,0x0391}, {0x1FB9,0x1FB1,0x0391}, - {0x1FBA,0x1F70,0x0391}, {0x1FBB,0x1F71,0x1FBB}, - {0x1FBC,0x1FB3,0x0391}, {0x1FBD,0x1FBD,0x1FBD}, - {0x0399,0x1FBE,0x0399}, {0x1FBF,0x1FBF,0x1FBF}, - {0x1FC0,0x1FC0,0x1FC0}, {0x1FC1,0x1FC1,0x1FC1}, - {0x1FC2,0x1FC2,0x0397}, {0x1FCC,0x1FC3,0x0397}, - {0x1FC4,0x1FC4,0x0397}, {0x1FC5,0x1FC5,0x1FC5}, - {0x1FC6,0x1FC6,0x0397}, {0x1FC7,0x1FC7,0x0397}, - {0x1FC8,0x1F72,0x0395}, {0x1FC9,0x1F73,0x1FC9}, - {0x1FCA,0x1F74,0x0397}, {0x1FCB,0x1F75,0x1FCB}, - {0x1FCC,0x1FC3,0x0397}, {0x1FCD,0x1FCD,0x1FCD}, - {0x1FCE,0x1FCE,0x1FCE}, {0x1FCF,0x1FCF,0x1FCF}, - {0x1FD8,0x1FD0,0x0399}, {0x1FD9,0x1FD1,0x0399}, - {0x1FD2,0x1FD2,0x0399}, {0x1FD3,0x1FD3,0x1FD3}, - {0x1FD4,0x1FD4,0x1FD4}, {0x1FD5,0x1FD5,0x1FD5}, - {0x1FD6,0x1FD6,0x0399}, {0x1FD7,0x1FD7,0x0399}, - {0x1FD8,0x1FD0,0x0399}, {0x1FD9,0x1FD1,0x0399}, - {0x1FDA,0x1F76,0x0399}, {0x1FDB,0x1F77,0x1FDB}, - {0x1FDC,0x1FDC,0x1FDC}, {0x1FDD,0x1FDD,0x1FDD}, - {0x1FDE,0x1FDE,0x1FDE}, {0x1FDF,0x1FDF,0x1FDF}, - {0x1FE8,0x1FE0,0x03A5}, {0x1FE9,0x1FE1,0x03A5}, - {0x1FE2,0x1FE2,0x03A5}, {0x1FE3,0x1FE3,0x1FE3}, - {0x1FE4,0x1FE4,0x03A1}, {0x1FEC,0x1FE5,0x03A1}, - {0x1FE6,0x1FE6,0x03A5}, {0x1FE7,0x1FE7,0x03A5}, - {0x1FE8,0x1FE0,0x03A5}, {0x1FE9,0x1FE1,0x03A5}, - {0x1FEA,0x1F7A,0x03A5}, {0x1FEB,0x1F7B,0x1FEB}, - {0x1FEC,0x1FE5,0x03A1}, {0x1FED,0x1FED,0x1FED}, - {0x1FEE,0x1FEE,0x1FEE}, {0x1FEF,0x1FEF,0x1FEF}, - {0x1FF0,0x1FF0,0x1FF0}, {0x1FF1,0x1FF1,0x1FF1}, - {0x1FF2,0x1FF2,0x03A9}, {0x1FFC,0x1FF3,0x03A9}, - {0x1FF4,0x1FF4,0x03A9}, {0x1FF5,0x1FF5,0x1FF5}, - {0x1FF6,0x1FF6,0x03A9}, {0x1FF7,0x1FF7,0x03A9}, - {0x1FF8,0x1F78,0x039F}, {0x1FF9,0x1F79,0x1FF9}, - {0x1FFA,0x1F7C,0x03A9}, {0x1FFB,0x1F7D,0x1FFB}, - {0x1FFC,0x1FF3,0x03A9}, {0x1FFD,0x1FFD,0x1FFD}, - {0x1FFE,0x1FFE,0x1FFE}, {0x1FFF,0x1FFF,0x1FFF} -}; - -static MY_UNICASE_CHARACTER plane21[]={ - {0x2100,0x2100,0x2100}, {0x2101,0x2101,0x2101}, - {0x2102,0x2102,0x2102}, {0x2103,0x2103,0x2103}, - {0x2104,0x2104,0x2104}, {0x2105,0x2105,0x2105}, - {0x2106,0x2106,0x2106}, {0x2107,0x2107,0x2107}, - {0x2108,0x2108,0x2108}, {0x2109,0x2109,0x2109}, - {0x210A,0x210A,0x210A}, {0x210B,0x210B,0x210B}, - {0x210C,0x210C,0x210C}, {0x210D,0x210D,0x210D}, - {0x210E,0x210E,0x210E}, {0x210F,0x210F,0x210F}, - {0x2110,0x2110,0x2110}, {0x2111,0x2111,0x2111}, - {0x2112,0x2112,0x2112}, {0x2113,0x2113,0x2113}, - {0x2114,0x2114,0x2114}, {0x2115,0x2115,0x2115}, - {0x2116,0x2116,0x2116}, {0x2117,0x2117,0x2117}, - {0x2118,0x2118,0x2118}, {0x2119,0x2119,0x2119}, - {0x211A,0x211A,0x211A}, {0x211B,0x211B,0x211B}, - {0x211C,0x211C,0x211C}, {0x211D,0x211D,0x211D}, - {0x211E,0x211E,0x211E}, {0x211F,0x211F,0x211F}, - {0x2120,0x2120,0x2120}, {0x2121,0x2121,0x2121}, - {0x2122,0x2122,0x2122}, {0x2123,0x2123,0x2123}, - {0x2124,0x2124,0x2124}, {0x2125,0x2125,0x2125}, - {0x2126,0x03C9,0x2126}, {0x2127,0x2127,0x2127}, - {0x2128,0x2128,0x2128}, {0x2129,0x2129,0x2129}, - {0x212A,0x006B,0x212A}, {0x212B,0x00E5,0x212B}, - {0x212C,0x212C,0x212C}, {0x212D,0x212D,0x212D}, - {0x212E,0x212E,0x212E}, {0x212F,0x212F,0x212F}, - {0x2130,0x2130,0x2130}, {0x2131,0x2131,0x2131}, - {0x2132,0x2132,0x2132}, {0x2133,0x2133,0x2133}, - {0x2134,0x2134,0x2134}, {0x2135,0x2135,0x2135}, - {0x2136,0x2136,0x2136}, {0x2137,0x2137,0x2137}, - {0x2138,0x2138,0x2138}, {0x2139,0x2139,0x2139}, - {0x213A,0x213A,0x213A}, {0x213B,0x213B,0x213B}, - {0x213C,0x213C,0x213C}, {0x213D,0x213D,0x213D}, - {0x213E,0x213E,0x213E}, {0x213F,0x213F,0x213F}, - {0x2140,0x2140,0x2140}, {0x2141,0x2141,0x2141}, - {0x2142,0x2142,0x2142}, {0x2143,0x2143,0x2143}, - {0x2144,0x2144,0x2144}, {0x2145,0x2145,0x2145}, - {0x2146,0x2146,0x2146}, {0x2147,0x2147,0x2147}, - {0x2148,0x2148,0x2148}, {0x2149,0x2149,0x2149}, - {0x214A,0x214A,0x214A}, {0x214B,0x214B,0x214B}, - {0x214C,0x214C,0x214C}, {0x214D,0x214D,0x214D}, - {0x214E,0x214E,0x214E}, {0x214F,0x214F,0x214F}, - {0x2150,0x2150,0x2150}, {0x2151,0x2151,0x2151}, - {0x2152,0x2152,0x2152}, {0x2153,0x2153,0x2153}, - {0x2154,0x2154,0x2154}, {0x2155,0x2155,0x2155}, - {0x2156,0x2156,0x2156}, {0x2157,0x2157,0x2157}, - {0x2158,0x2158,0x2158}, {0x2159,0x2159,0x2159}, - {0x215A,0x215A,0x215A}, {0x215B,0x215B,0x215B}, - {0x215C,0x215C,0x215C}, {0x215D,0x215D,0x215D}, - {0x215E,0x215E,0x215E}, {0x215F,0x215F,0x215F}, - {0x2160,0x2170,0x2160}, {0x2161,0x2171,0x2161}, - {0x2162,0x2172,0x2162}, {0x2163,0x2173,0x2163}, - {0x2164,0x2174,0x2164}, {0x2165,0x2175,0x2165}, - {0x2166,0x2176,0x2166}, {0x2167,0x2177,0x2167}, - {0x2168,0x2178,0x2168}, {0x2169,0x2179,0x2169}, - {0x216A,0x217A,0x216A}, {0x216B,0x217B,0x216B}, - {0x216C,0x217C,0x216C}, {0x216D,0x217D,0x216D}, - {0x216E,0x217E,0x216E}, {0x216F,0x217F,0x216F}, - {0x2160,0x2170,0x2160}, {0x2161,0x2171,0x2161}, - {0x2162,0x2172,0x2162}, {0x2163,0x2173,0x2163}, - {0x2164,0x2174,0x2164}, {0x2165,0x2175,0x2165}, - {0x2166,0x2176,0x2166}, {0x2167,0x2177,0x2167}, - {0x2168,0x2178,0x2168}, {0x2169,0x2179,0x2169}, - {0x216A,0x217A,0x216A}, {0x216B,0x217B,0x216B}, - {0x216C,0x217C,0x216C}, {0x216D,0x217D,0x216D}, - {0x216E,0x217E,0x216E}, {0x216F,0x217F,0x216F}, - {0x2180,0x2180,0x2180}, {0x2181,0x2181,0x2181}, - {0x2182,0x2182,0x2182}, {0x2183,0x2183,0x2183}, - {0x2184,0x2184,0x2184}, {0x2185,0x2185,0x2185}, - {0x2186,0x2186,0x2186}, {0x2187,0x2187,0x2187}, - {0x2188,0x2188,0x2188}, {0x2189,0x2189,0x2189}, - {0x218A,0x218A,0x218A}, {0x218B,0x218B,0x218B}, - {0x218C,0x218C,0x218C}, {0x218D,0x218D,0x218D}, - {0x218E,0x218E,0x218E}, {0x218F,0x218F,0x218F}, - {0x2190,0x2190,0x2190}, {0x2191,0x2191,0x2191}, - {0x2192,0x2192,0x2192}, {0x2193,0x2193,0x2193}, - {0x2194,0x2194,0x2194}, {0x2195,0x2195,0x2195}, - {0x2196,0x2196,0x2196}, {0x2197,0x2197,0x2197}, - {0x2198,0x2198,0x2198}, {0x2199,0x2199,0x2199}, - {0x219A,0x219A,0x219A}, {0x219B,0x219B,0x219B}, - {0x219C,0x219C,0x219C}, {0x219D,0x219D,0x219D}, - {0x219E,0x219E,0x219E}, {0x219F,0x219F,0x219F}, - {0x21A0,0x21A0,0x21A0}, {0x21A1,0x21A1,0x21A1}, - {0x21A2,0x21A2,0x21A2}, {0x21A3,0x21A3,0x21A3}, - {0x21A4,0x21A4,0x21A4}, {0x21A5,0x21A5,0x21A5}, - {0x21A6,0x21A6,0x21A6}, {0x21A7,0x21A7,0x21A7}, - {0x21A8,0x21A8,0x21A8}, {0x21A9,0x21A9,0x21A9}, - {0x21AA,0x21AA,0x21AA}, {0x21AB,0x21AB,0x21AB}, - {0x21AC,0x21AC,0x21AC}, {0x21AD,0x21AD,0x21AD}, - {0x21AE,0x21AE,0x21AE}, {0x21AF,0x21AF,0x21AF}, - {0x21B0,0x21B0,0x21B0}, {0x21B1,0x21B1,0x21B1}, - {0x21B2,0x21B2,0x21B2}, {0x21B3,0x21B3,0x21B3}, - {0x21B4,0x21B4,0x21B4}, {0x21B5,0x21B5,0x21B5}, - {0x21B6,0x21B6,0x21B6}, {0x21B7,0x21B7,0x21B7}, - {0x21B8,0x21B8,0x21B8}, {0x21B9,0x21B9,0x21B9}, - {0x21BA,0x21BA,0x21BA}, {0x21BB,0x21BB,0x21BB}, - {0x21BC,0x21BC,0x21BC}, {0x21BD,0x21BD,0x21BD}, - {0x21BE,0x21BE,0x21BE}, {0x21BF,0x21BF,0x21BF}, - {0x21C0,0x21C0,0x21C0}, {0x21C1,0x21C1,0x21C1}, - {0x21C2,0x21C2,0x21C2}, {0x21C3,0x21C3,0x21C3}, - {0x21C4,0x21C4,0x21C4}, {0x21C5,0x21C5,0x21C5}, - {0x21C6,0x21C6,0x21C6}, {0x21C7,0x21C7,0x21C7}, - {0x21C8,0x21C8,0x21C8}, {0x21C9,0x21C9,0x21C9}, - {0x21CA,0x21CA,0x21CA}, {0x21CB,0x21CB,0x21CB}, - {0x21CC,0x21CC,0x21CC}, {0x21CD,0x21CD,0x21CD}, - {0x21CE,0x21CE,0x21CE}, {0x21CF,0x21CF,0x21CF}, - {0x21D0,0x21D0,0x21D0}, {0x21D1,0x21D1,0x21D1}, - {0x21D2,0x21D2,0x21D2}, {0x21D3,0x21D3,0x21D3}, - {0x21D4,0x21D4,0x21D4}, {0x21D5,0x21D5,0x21D5}, - {0x21D6,0x21D6,0x21D6}, {0x21D7,0x21D7,0x21D7}, - {0x21D8,0x21D8,0x21D8}, {0x21D9,0x21D9,0x21D9}, - {0x21DA,0x21DA,0x21DA}, {0x21DB,0x21DB,0x21DB}, - {0x21DC,0x21DC,0x21DC}, {0x21DD,0x21DD,0x21DD}, - {0x21DE,0x21DE,0x21DE}, {0x21DF,0x21DF,0x21DF}, - {0x21E0,0x21E0,0x21E0}, {0x21E1,0x21E1,0x21E1}, - {0x21E2,0x21E2,0x21E2}, {0x21E3,0x21E3,0x21E3}, - {0x21E4,0x21E4,0x21E4}, {0x21E5,0x21E5,0x21E5}, - {0x21E6,0x21E6,0x21E6}, {0x21E7,0x21E7,0x21E7}, - {0x21E8,0x21E8,0x21E8}, {0x21E9,0x21E9,0x21E9}, - {0x21EA,0x21EA,0x21EA}, {0x21EB,0x21EB,0x21EB}, - {0x21EC,0x21EC,0x21EC}, {0x21ED,0x21ED,0x21ED}, - {0x21EE,0x21EE,0x21EE}, {0x21EF,0x21EF,0x21EF}, - {0x21F0,0x21F0,0x21F0}, {0x21F1,0x21F1,0x21F1}, - {0x21F2,0x21F2,0x21F2}, {0x21F3,0x21F3,0x21F3}, - {0x21F4,0x21F4,0x21F4}, {0x21F5,0x21F5,0x21F5}, - {0x21F6,0x21F6,0x21F6}, {0x21F7,0x21F7,0x21F7}, - {0x21F8,0x21F8,0x21F8}, {0x21F9,0x21F9,0x21F9}, - {0x21FA,0x21FA,0x21FA}, {0x21FB,0x21FB,0x21FB}, - {0x21FC,0x21FC,0x21FC}, {0x21FD,0x21FD,0x21FD}, - {0x21FE,0x21FE,0x21FE}, {0x21FF,0x21FF,0x21FF} -}; - -static MY_UNICASE_CHARACTER plane24[]={ - {0x2400,0x2400,0x2400}, {0x2401,0x2401,0x2401}, - {0x2402,0x2402,0x2402}, {0x2403,0x2403,0x2403}, - {0x2404,0x2404,0x2404}, {0x2405,0x2405,0x2405}, - {0x2406,0x2406,0x2406}, {0x2407,0x2407,0x2407}, - {0x2408,0x2408,0x2408}, {0x2409,0x2409,0x2409}, - {0x240A,0x240A,0x240A}, {0x240B,0x240B,0x240B}, - {0x240C,0x240C,0x240C}, {0x240D,0x240D,0x240D}, - {0x240E,0x240E,0x240E}, {0x240F,0x240F,0x240F}, - {0x2410,0x2410,0x2410}, {0x2411,0x2411,0x2411}, - {0x2412,0x2412,0x2412}, {0x2413,0x2413,0x2413}, - {0x2414,0x2414,0x2414}, {0x2415,0x2415,0x2415}, - {0x2416,0x2416,0x2416}, {0x2417,0x2417,0x2417}, - {0x2418,0x2418,0x2418}, {0x2419,0x2419,0x2419}, - {0x241A,0x241A,0x241A}, {0x241B,0x241B,0x241B}, - {0x241C,0x241C,0x241C}, {0x241D,0x241D,0x241D}, - {0x241E,0x241E,0x241E}, {0x241F,0x241F,0x241F}, - {0x2420,0x2420,0x2420}, {0x2421,0x2421,0x2421}, - {0x2422,0x2422,0x2422}, {0x2423,0x2423,0x2423}, - {0x2424,0x2424,0x2424}, {0x2425,0x2425,0x2425}, - {0x2426,0x2426,0x2426}, {0x2427,0x2427,0x2427}, - {0x2428,0x2428,0x2428}, {0x2429,0x2429,0x2429}, - {0x242A,0x242A,0x242A}, {0x242B,0x242B,0x242B}, - {0x242C,0x242C,0x242C}, {0x242D,0x242D,0x242D}, - {0x242E,0x242E,0x242E}, {0x242F,0x242F,0x242F}, - {0x2430,0x2430,0x2430}, {0x2431,0x2431,0x2431}, - {0x2432,0x2432,0x2432}, {0x2433,0x2433,0x2433}, - {0x2434,0x2434,0x2434}, {0x2435,0x2435,0x2435}, - {0x2436,0x2436,0x2436}, {0x2437,0x2437,0x2437}, - {0x2438,0x2438,0x2438}, {0x2439,0x2439,0x2439}, - {0x243A,0x243A,0x243A}, {0x243B,0x243B,0x243B}, - {0x243C,0x243C,0x243C}, {0x243D,0x243D,0x243D}, - {0x243E,0x243E,0x243E}, {0x243F,0x243F,0x243F}, - {0x2440,0x2440,0x2440}, {0x2441,0x2441,0x2441}, - {0x2442,0x2442,0x2442}, {0x2443,0x2443,0x2443}, - {0x2444,0x2444,0x2444}, {0x2445,0x2445,0x2445}, - {0x2446,0x2446,0x2446}, {0x2447,0x2447,0x2447}, - {0x2448,0x2448,0x2448}, {0x2449,0x2449,0x2449}, - {0x244A,0x244A,0x244A}, {0x244B,0x244B,0x244B}, - {0x244C,0x244C,0x244C}, {0x244D,0x244D,0x244D}, - {0x244E,0x244E,0x244E}, {0x244F,0x244F,0x244F}, - {0x2450,0x2450,0x2450}, {0x2451,0x2451,0x2451}, - {0x2452,0x2452,0x2452}, {0x2453,0x2453,0x2453}, - {0x2454,0x2454,0x2454}, {0x2455,0x2455,0x2455}, - {0x2456,0x2456,0x2456}, {0x2457,0x2457,0x2457}, - {0x2458,0x2458,0x2458}, {0x2459,0x2459,0x2459}, - {0x245A,0x245A,0x245A}, {0x245B,0x245B,0x245B}, - {0x245C,0x245C,0x245C}, {0x245D,0x245D,0x245D}, - {0x245E,0x245E,0x245E}, {0x245F,0x245F,0x245F}, - {0x2460,0x2460,0x2460}, {0x2461,0x2461,0x2461}, - {0x2462,0x2462,0x2462}, {0x2463,0x2463,0x2463}, - {0x2464,0x2464,0x2464}, {0x2465,0x2465,0x2465}, - {0x2466,0x2466,0x2466}, {0x2467,0x2467,0x2467}, - {0x2468,0x2468,0x2468}, {0x2469,0x2469,0x2469}, - {0x246A,0x246A,0x246A}, {0x246B,0x246B,0x246B}, - {0x246C,0x246C,0x246C}, {0x246D,0x246D,0x246D}, - {0x246E,0x246E,0x246E}, {0x246F,0x246F,0x246F}, - {0x2470,0x2470,0x2470}, {0x2471,0x2471,0x2471}, - {0x2472,0x2472,0x2472}, {0x2473,0x2473,0x2473}, - {0x2474,0x2474,0x2474}, {0x2475,0x2475,0x2475}, - {0x2476,0x2476,0x2476}, {0x2477,0x2477,0x2477}, - {0x2478,0x2478,0x2478}, {0x2479,0x2479,0x2479}, - {0x247A,0x247A,0x247A}, {0x247B,0x247B,0x247B}, - {0x247C,0x247C,0x247C}, {0x247D,0x247D,0x247D}, - {0x247E,0x247E,0x247E}, {0x247F,0x247F,0x247F}, - {0x2480,0x2480,0x2480}, {0x2481,0x2481,0x2481}, - {0x2482,0x2482,0x2482}, {0x2483,0x2483,0x2483}, - {0x2484,0x2484,0x2484}, {0x2485,0x2485,0x2485}, - {0x2486,0x2486,0x2486}, {0x2487,0x2487,0x2487}, - {0x2488,0x2488,0x2488}, {0x2489,0x2489,0x2489}, - {0x248A,0x248A,0x248A}, {0x248B,0x248B,0x248B}, - {0x248C,0x248C,0x248C}, {0x248D,0x248D,0x248D}, - {0x248E,0x248E,0x248E}, {0x248F,0x248F,0x248F}, - {0x2490,0x2490,0x2490}, {0x2491,0x2491,0x2491}, - {0x2492,0x2492,0x2492}, {0x2493,0x2493,0x2493}, - {0x2494,0x2494,0x2494}, {0x2495,0x2495,0x2495}, - {0x2496,0x2496,0x2496}, {0x2497,0x2497,0x2497}, - {0x2498,0x2498,0x2498}, {0x2499,0x2499,0x2499}, - {0x249A,0x249A,0x249A}, {0x249B,0x249B,0x249B}, - {0x249C,0x249C,0x249C}, {0x249D,0x249D,0x249D}, - {0x249E,0x249E,0x249E}, {0x249F,0x249F,0x249F}, - {0x24A0,0x24A0,0x24A0}, {0x24A1,0x24A1,0x24A1}, - {0x24A2,0x24A2,0x24A2}, {0x24A3,0x24A3,0x24A3}, - {0x24A4,0x24A4,0x24A4}, {0x24A5,0x24A5,0x24A5}, - {0x24A6,0x24A6,0x24A6}, {0x24A7,0x24A7,0x24A7}, - {0x24A8,0x24A8,0x24A8}, {0x24A9,0x24A9,0x24A9}, - {0x24AA,0x24AA,0x24AA}, {0x24AB,0x24AB,0x24AB}, - {0x24AC,0x24AC,0x24AC}, {0x24AD,0x24AD,0x24AD}, - {0x24AE,0x24AE,0x24AE}, {0x24AF,0x24AF,0x24AF}, - {0x24B0,0x24B0,0x24B0}, {0x24B1,0x24B1,0x24B1}, - {0x24B2,0x24B2,0x24B2}, {0x24B3,0x24B3,0x24B3}, - {0x24B4,0x24B4,0x24B4}, {0x24B5,0x24B5,0x24B5}, - {0x24B6,0x24D0,0x24B6}, {0x24B7,0x24D1,0x24B7}, - {0x24B8,0x24D2,0x24B8}, {0x24B9,0x24D3,0x24B9}, - {0x24BA,0x24D4,0x24BA}, {0x24BB,0x24D5,0x24BB}, - {0x24BC,0x24D6,0x24BC}, {0x24BD,0x24D7,0x24BD}, - {0x24BE,0x24D8,0x24BE}, {0x24BF,0x24D9,0x24BF}, - {0x24C0,0x24DA,0x24C0}, {0x24C1,0x24DB,0x24C1}, - {0x24C2,0x24DC,0x24C2}, {0x24C3,0x24DD,0x24C3}, - {0x24C4,0x24DE,0x24C4}, {0x24C5,0x24DF,0x24C5}, - {0x24C6,0x24E0,0x24C6}, {0x24C7,0x24E1,0x24C7}, - {0x24C8,0x24E2,0x24C8}, {0x24C9,0x24E3,0x24C9}, - {0x24CA,0x24E4,0x24CA}, {0x24CB,0x24E5,0x24CB}, - {0x24CC,0x24E6,0x24CC}, {0x24CD,0x24E7,0x24CD}, - {0x24CE,0x24E8,0x24CE}, {0x24CF,0x24E9,0x24CF}, - {0x24B6,0x24D0,0x24B6}, {0x24B7,0x24D1,0x24B7}, - {0x24B8,0x24D2,0x24B8}, {0x24B9,0x24D3,0x24B9}, - {0x24BA,0x24D4,0x24BA}, {0x24BB,0x24D5,0x24BB}, - {0x24BC,0x24D6,0x24BC}, {0x24BD,0x24D7,0x24BD}, - {0x24BE,0x24D8,0x24BE}, {0x24BF,0x24D9,0x24BF}, - {0x24C0,0x24DA,0x24C0}, {0x24C1,0x24DB,0x24C1}, - {0x24C2,0x24DC,0x24C2}, {0x24C3,0x24DD,0x24C3}, - {0x24C4,0x24DE,0x24C4}, {0x24C5,0x24DF,0x24C5}, - {0x24C6,0x24E0,0x24C6}, {0x24C7,0x24E1,0x24C7}, - {0x24C8,0x24E2,0x24C8}, {0x24C9,0x24E3,0x24C9}, - {0x24CA,0x24E4,0x24CA}, {0x24CB,0x24E5,0x24CB}, - {0x24CC,0x24E6,0x24CC}, {0x24CD,0x24E7,0x24CD}, - {0x24CE,0x24E8,0x24CE}, {0x24CF,0x24E9,0x24CF}, - {0x24EA,0x24EA,0x24EA}, {0x24EB,0x24EB,0x24EB}, - {0x24EC,0x24EC,0x24EC}, {0x24ED,0x24ED,0x24ED}, - {0x24EE,0x24EE,0x24EE}, {0x24EF,0x24EF,0x24EF}, - {0x24F0,0x24F0,0x24F0}, {0x24F1,0x24F1,0x24F1}, - {0x24F2,0x24F2,0x24F2}, {0x24F3,0x24F3,0x24F3}, - {0x24F4,0x24F4,0x24F4}, {0x24F5,0x24F5,0x24F5}, - {0x24F6,0x24F6,0x24F6}, {0x24F7,0x24F7,0x24F7}, - {0x24F8,0x24F8,0x24F8}, {0x24F9,0x24F9,0x24F9}, - {0x24FA,0x24FA,0x24FA}, {0x24FB,0x24FB,0x24FB}, - {0x24FC,0x24FC,0x24FC}, {0x24FD,0x24FD,0x24FD}, - {0x24FE,0x24FE,0x24FE}, {0x24FF,0x24FF,0x24FF} -}; - -static MY_UNICASE_CHARACTER planeFF[]={ - {0xFF00,0xFF00,0xFF00}, {0xFF01,0xFF01,0xFF01}, - {0xFF02,0xFF02,0xFF02}, {0xFF03,0xFF03,0xFF03}, - {0xFF04,0xFF04,0xFF04}, {0xFF05,0xFF05,0xFF05}, - {0xFF06,0xFF06,0xFF06}, {0xFF07,0xFF07,0xFF07}, - {0xFF08,0xFF08,0xFF08}, {0xFF09,0xFF09,0xFF09}, - {0xFF0A,0xFF0A,0xFF0A}, {0xFF0B,0xFF0B,0xFF0B}, - {0xFF0C,0xFF0C,0xFF0C}, {0xFF0D,0xFF0D,0xFF0D}, - {0xFF0E,0xFF0E,0xFF0E}, {0xFF0F,0xFF0F,0xFF0F}, - {0xFF10,0xFF10,0xFF10}, {0xFF11,0xFF11,0xFF11}, - {0xFF12,0xFF12,0xFF12}, {0xFF13,0xFF13,0xFF13}, - {0xFF14,0xFF14,0xFF14}, {0xFF15,0xFF15,0xFF15}, - {0xFF16,0xFF16,0xFF16}, {0xFF17,0xFF17,0xFF17}, - {0xFF18,0xFF18,0xFF18}, {0xFF19,0xFF19,0xFF19}, - {0xFF1A,0xFF1A,0xFF1A}, {0xFF1B,0xFF1B,0xFF1B}, - {0xFF1C,0xFF1C,0xFF1C}, {0xFF1D,0xFF1D,0xFF1D}, - {0xFF1E,0xFF1E,0xFF1E}, {0xFF1F,0xFF1F,0xFF1F}, - {0xFF20,0xFF20,0xFF20}, {0xFF21,0xFF41,0xFF21}, - {0xFF22,0xFF42,0xFF22}, {0xFF23,0xFF43,0xFF23}, - {0xFF24,0xFF44,0xFF24}, {0xFF25,0xFF45,0xFF25}, - {0xFF26,0xFF46,0xFF26}, {0xFF27,0xFF47,0xFF27}, - {0xFF28,0xFF48,0xFF28}, {0xFF29,0xFF49,0xFF29}, - {0xFF2A,0xFF4A,0xFF2A}, {0xFF2B,0xFF4B,0xFF2B}, - {0xFF2C,0xFF4C,0xFF2C}, {0xFF2D,0xFF4D,0xFF2D}, - {0xFF2E,0xFF4E,0xFF2E}, {0xFF2F,0xFF4F,0xFF2F}, - {0xFF30,0xFF50,0xFF30}, {0xFF31,0xFF51,0xFF31}, - {0xFF32,0xFF52,0xFF32}, {0xFF33,0xFF53,0xFF33}, - {0xFF34,0xFF54,0xFF34}, {0xFF35,0xFF55,0xFF35}, - {0xFF36,0xFF56,0xFF36}, {0xFF37,0xFF57,0xFF37}, - {0xFF38,0xFF58,0xFF38}, {0xFF39,0xFF59,0xFF39}, - {0xFF3A,0xFF5A,0xFF3A}, {0xFF3B,0xFF3B,0xFF3B}, - {0xFF3C,0xFF3C,0xFF3C}, {0xFF3D,0xFF3D,0xFF3D}, - {0xFF3E,0xFF3E,0xFF3E}, {0xFF3F,0xFF3F,0xFF3F}, - {0xFF40,0xFF40,0xFF40}, {0xFF21,0xFF41,0xFF21}, - {0xFF22,0xFF42,0xFF22}, {0xFF23,0xFF43,0xFF23}, - {0xFF24,0xFF44,0xFF24}, {0xFF25,0xFF45,0xFF25}, - {0xFF26,0xFF46,0xFF26}, {0xFF27,0xFF47,0xFF27}, - {0xFF28,0xFF48,0xFF28}, {0xFF29,0xFF49,0xFF29}, - {0xFF2A,0xFF4A,0xFF2A}, {0xFF2B,0xFF4B,0xFF2B}, - {0xFF2C,0xFF4C,0xFF2C}, {0xFF2D,0xFF4D,0xFF2D}, - {0xFF2E,0xFF4E,0xFF2E}, {0xFF2F,0xFF4F,0xFF2F}, - {0xFF30,0xFF50,0xFF30}, {0xFF31,0xFF51,0xFF31}, - {0xFF32,0xFF52,0xFF32}, {0xFF33,0xFF53,0xFF33}, - {0xFF34,0xFF54,0xFF34}, {0xFF35,0xFF55,0xFF35}, - {0xFF36,0xFF56,0xFF36}, {0xFF37,0xFF57,0xFF37}, - {0xFF38,0xFF58,0xFF38}, {0xFF39,0xFF59,0xFF39}, - {0xFF3A,0xFF5A,0xFF3A}, {0xFF5B,0xFF5B,0xFF5B}, - {0xFF5C,0xFF5C,0xFF5C}, {0xFF5D,0xFF5D,0xFF5D}, - {0xFF5E,0xFF5E,0xFF5E}, {0xFF5F,0xFF5F,0xFF5F}, - {0xFF60,0xFF60,0xFF60}, {0xFF61,0xFF61,0xFF61}, - {0xFF62,0xFF62,0xFF62}, {0xFF63,0xFF63,0xFF63}, - {0xFF64,0xFF64,0xFF64}, {0xFF65,0xFF65,0xFF65}, - {0xFF66,0xFF66,0xFF66}, {0xFF67,0xFF67,0xFF67}, - {0xFF68,0xFF68,0xFF68}, {0xFF69,0xFF69,0xFF69}, - {0xFF6A,0xFF6A,0xFF6A}, {0xFF6B,0xFF6B,0xFF6B}, - {0xFF6C,0xFF6C,0xFF6C}, {0xFF6D,0xFF6D,0xFF6D}, - {0xFF6E,0xFF6E,0xFF6E}, {0xFF6F,0xFF6F,0xFF6F}, - {0xFF70,0xFF70,0xFF70}, {0xFF71,0xFF71,0xFF71}, - {0xFF72,0xFF72,0xFF72}, {0xFF73,0xFF73,0xFF73}, - {0xFF74,0xFF74,0xFF74}, {0xFF75,0xFF75,0xFF75}, - {0xFF76,0xFF76,0xFF76}, {0xFF77,0xFF77,0xFF77}, - {0xFF78,0xFF78,0xFF78}, {0xFF79,0xFF79,0xFF79}, - {0xFF7A,0xFF7A,0xFF7A}, {0xFF7B,0xFF7B,0xFF7B}, - {0xFF7C,0xFF7C,0xFF7C}, {0xFF7D,0xFF7D,0xFF7D}, - {0xFF7E,0xFF7E,0xFF7E}, {0xFF7F,0xFF7F,0xFF7F}, - {0xFF80,0xFF80,0xFF80}, {0xFF81,0xFF81,0xFF81}, - {0xFF82,0xFF82,0xFF82}, {0xFF83,0xFF83,0xFF83}, - {0xFF84,0xFF84,0xFF84}, {0xFF85,0xFF85,0xFF85}, - {0xFF86,0xFF86,0xFF86}, {0xFF87,0xFF87,0xFF87}, - {0xFF88,0xFF88,0xFF88}, {0xFF89,0xFF89,0xFF89}, - {0xFF8A,0xFF8A,0xFF8A}, {0xFF8B,0xFF8B,0xFF8B}, - {0xFF8C,0xFF8C,0xFF8C}, {0xFF8D,0xFF8D,0xFF8D}, - {0xFF8E,0xFF8E,0xFF8E}, {0xFF8F,0xFF8F,0xFF8F}, - {0xFF90,0xFF90,0xFF90}, {0xFF91,0xFF91,0xFF91}, - {0xFF92,0xFF92,0xFF92}, {0xFF93,0xFF93,0xFF93}, - {0xFF94,0xFF94,0xFF94}, {0xFF95,0xFF95,0xFF95}, - {0xFF96,0xFF96,0xFF96}, {0xFF97,0xFF97,0xFF97}, - {0xFF98,0xFF98,0xFF98}, {0xFF99,0xFF99,0xFF99}, - {0xFF9A,0xFF9A,0xFF9A}, {0xFF9B,0xFF9B,0xFF9B}, - {0xFF9C,0xFF9C,0xFF9C}, {0xFF9D,0xFF9D,0xFF9D}, - {0xFF9E,0xFF9E,0xFF9E}, {0xFF9F,0xFF9F,0xFF9F}, - {0xFFA0,0xFFA0,0xFFA0}, {0xFFA1,0xFFA1,0xFFA1}, - {0xFFA2,0xFFA2,0xFFA2}, {0xFFA3,0xFFA3,0xFFA3}, - {0xFFA4,0xFFA4,0xFFA4}, {0xFFA5,0xFFA5,0xFFA5}, - {0xFFA6,0xFFA6,0xFFA6}, {0xFFA7,0xFFA7,0xFFA7}, - {0xFFA8,0xFFA8,0xFFA8}, {0xFFA9,0xFFA9,0xFFA9}, - {0xFFAA,0xFFAA,0xFFAA}, {0xFFAB,0xFFAB,0xFFAB}, - {0xFFAC,0xFFAC,0xFFAC}, {0xFFAD,0xFFAD,0xFFAD}, - {0xFFAE,0xFFAE,0xFFAE}, {0xFFAF,0xFFAF,0xFFAF}, - {0xFFB0,0xFFB0,0xFFB0}, {0xFFB1,0xFFB1,0xFFB1}, - {0xFFB2,0xFFB2,0xFFB2}, {0xFFB3,0xFFB3,0xFFB3}, - {0xFFB4,0xFFB4,0xFFB4}, {0xFFB5,0xFFB5,0xFFB5}, - {0xFFB6,0xFFB6,0xFFB6}, {0xFFB7,0xFFB7,0xFFB7}, - {0xFFB8,0xFFB8,0xFFB8}, {0xFFB9,0xFFB9,0xFFB9}, - {0xFFBA,0xFFBA,0xFFBA}, {0xFFBB,0xFFBB,0xFFBB}, - {0xFFBC,0xFFBC,0xFFBC}, {0xFFBD,0xFFBD,0xFFBD}, - {0xFFBE,0xFFBE,0xFFBE}, {0xFFBF,0xFFBF,0xFFBF}, - {0xFFC0,0xFFC0,0xFFC0}, {0xFFC1,0xFFC1,0xFFC1}, - {0xFFC2,0xFFC2,0xFFC2}, {0xFFC3,0xFFC3,0xFFC3}, - {0xFFC4,0xFFC4,0xFFC4}, {0xFFC5,0xFFC5,0xFFC5}, - {0xFFC6,0xFFC6,0xFFC6}, {0xFFC7,0xFFC7,0xFFC7}, - {0xFFC8,0xFFC8,0xFFC8}, {0xFFC9,0xFFC9,0xFFC9}, - {0xFFCA,0xFFCA,0xFFCA}, {0xFFCB,0xFFCB,0xFFCB}, - {0xFFCC,0xFFCC,0xFFCC}, {0xFFCD,0xFFCD,0xFFCD}, - {0xFFCE,0xFFCE,0xFFCE}, {0xFFCF,0xFFCF,0xFFCF}, - {0xFFD0,0xFFD0,0xFFD0}, {0xFFD1,0xFFD1,0xFFD1}, - {0xFFD2,0xFFD2,0xFFD2}, {0xFFD3,0xFFD3,0xFFD3}, - {0xFFD4,0xFFD4,0xFFD4}, {0xFFD5,0xFFD5,0xFFD5}, - {0xFFD6,0xFFD6,0xFFD6}, {0xFFD7,0xFFD7,0xFFD7}, - {0xFFD8,0xFFD8,0xFFD8}, {0xFFD9,0xFFD9,0xFFD9}, - {0xFFDA,0xFFDA,0xFFDA}, {0xFFDB,0xFFDB,0xFFDB}, - {0xFFDC,0xFFDC,0xFFDC}, {0xFFDD,0xFFDD,0xFFDD}, - {0xFFDE,0xFFDE,0xFFDE}, {0xFFDF,0xFFDF,0xFFDF}, - {0xFFE0,0xFFE0,0xFFE0}, {0xFFE1,0xFFE1,0xFFE1}, - {0xFFE2,0xFFE2,0xFFE2}, {0xFFE3,0xFFE3,0xFFE3}, - {0xFFE4,0xFFE4,0xFFE4}, {0xFFE5,0xFFE5,0xFFE5}, - {0xFFE6,0xFFE6,0xFFE6}, {0xFFE7,0xFFE7,0xFFE7}, - {0xFFE8,0xFFE8,0xFFE8}, {0xFFE9,0xFFE9,0xFFE9}, - {0xFFEA,0xFFEA,0xFFEA}, {0xFFEB,0xFFEB,0xFFEB}, - {0xFFEC,0xFFEC,0xFFEC}, {0xFFED,0xFFED,0xFFED}, - {0xFFEE,0xFFEE,0xFFEE}, {0xFFEF,0xFFEF,0xFFEF}, - {0xFFF0,0xFFF0,0xFFF0}, {0xFFF1,0xFFF1,0xFFF1}, - {0xFFF2,0xFFF2,0xFFF2}, {0xFFF3,0xFFF3,0xFFF3}, - {0xFFF4,0xFFF4,0xFFF4}, {0xFFF5,0xFFF5,0xFFF5}, - {0xFFF6,0xFFF6,0xFFF6}, {0xFFF7,0xFFF7,0xFFF7}, - {0xFFF8,0xFFF8,0xFFF8}, {0xFFF9,0xFFF9,0xFFF9}, - {0xFFFA,0xFFFA,0xFFFA}, {0xFFFB,0xFFFB,0xFFFB}, - {0xFFFC,0xFFFC,0xFFFC}, {0xFFFD,0xFFFD,0xFFFD}, - {0xFFFE,0xFFFE,0xFFFE}, {0xFFFF,0xFFFF,0xFFFF} -}; - - -MY_UNICASE_CHARACTER *my_unicase_default_pages[256]= -{ - my_unicase_default_page00, - plane01, plane02, plane03, plane04, plane05, plane06, plane07, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, plane1E, plane1F, - NULL, plane21, NULL, NULL, plane24, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, planeFF -}; - - -MY_UNICASE_INFO my_unicase_default= -{ - MY_UNICASE_INFO_DEFAULT_MAXCHAR, - my_unicase_default_pages -}; - - -/* - Reproduce old utf8mb3_general_ci behaviour before we fixed Bug#27877. -*/ -MY_UNICASE_CHARACTER *my_unicase_mysql500_pages[256]={ - my_unicase_mysql500_page00, - plane01, plane02, plane03, plane04, plane05, plane06, plane07, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, plane1E, plane1F, - NULL, plane21, NULL, NULL, plane24, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, planeFF - -}; - - -MY_UNICASE_INFO my_unicase_mysql500= -{ - 0xFFFF, - my_unicase_mysql500_pages -}; - - -/* - Turkish lower/upper mapping: - 1. LOWER(0x0049 LATIN CAPITAL LETTER I) -> - 0x0131 LATIN SMALL LETTER DOTLESS I - 2. UPPER(0x0069 LATIN SMALL LETTER I) -> - 0x0130 LATIN CAPITAL LETTER I WITH DOT ABOVE -*/ - -static MY_UNICASE_CHARACTER turk00[]= -{ - {0x0000,0x0000,0x0000}, {0x0001,0x0001,0x0001}, - {0x0002,0x0002,0x0002}, {0x0003,0x0003,0x0003}, - {0x0004,0x0004,0x0004}, {0x0005,0x0005,0x0005}, - {0x0006,0x0006,0x0006}, {0x0007,0x0007,0x0007}, - {0x0008,0x0008,0x0008}, {0x0009,0x0009,0x0009}, - {0x000A,0x000A,0x000A}, {0x000B,0x000B,0x000B}, - {0x000C,0x000C,0x000C}, {0x000D,0x000D,0x000D}, - {0x000E,0x000E,0x000E}, {0x000F,0x000F,0x000F}, - {0x0010,0x0010,0x0010}, {0x0011,0x0011,0x0011}, - {0x0012,0x0012,0x0012}, {0x0013,0x0013,0x0013}, - {0x0014,0x0014,0x0014}, {0x0015,0x0015,0x0015}, - {0x0016,0x0016,0x0016}, {0x0017,0x0017,0x0017}, - {0x0018,0x0018,0x0018}, {0x0019,0x0019,0x0019}, - {0x001A,0x001A,0x001A}, {0x001B,0x001B,0x001B}, - {0x001C,0x001C,0x001C}, {0x001D,0x001D,0x001D}, - {0x001E,0x001E,0x001E}, {0x001F,0x001F,0x001F}, - {0x0020,0x0020,0x0020}, {0x0021,0x0021,0x0021}, - {0x0022,0x0022,0x0022}, {0x0023,0x0023,0x0023}, - {0x0024,0x0024,0x0024}, {0x0025,0x0025,0x0025}, - {0x0026,0x0026,0x0026}, {0x0027,0x0027,0x0027}, - {0x0028,0x0028,0x0028}, {0x0029,0x0029,0x0029}, - {0x002A,0x002A,0x002A}, {0x002B,0x002B,0x002B}, - {0x002C,0x002C,0x002C}, {0x002D,0x002D,0x002D}, - {0x002E,0x002E,0x002E}, {0x002F,0x002F,0x002F}, - {0x0030,0x0030,0x0030}, {0x0031,0x0031,0x0031}, - {0x0032,0x0032,0x0032}, {0x0033,0x0033,0x0033}, - {0x0034,0x0034,0x0034}, {0x0035,0x0035,0x0035}, - {0x0036,0x0036,0x0036}, {0x0037,0x0037,0x0037}, - {0x0038,0x0038,0x0038}, {0x0039,0x0039,0x0039}, - {0x003A,0x003A,0x003A}, {0x003B,0x003B,0x003B}, - {0x003C,0x003C,0x003C}, {0x003D,0x003D,0x003D}, - {0x003E,0x003E,0x003E}, {0x003F,0x003F,0x003F}, - {0x0040,0x0040,0x0040}, {0x0041,0x0061,0x0041}, - {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043}, - {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045}, - {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047}, - {0x0048,0x0068,0x0048}, {0x0049,0x0131,0x0049}, - {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B}, - {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D}, - {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F}, - {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051}, - {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053}, - {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055}, - {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057}, - {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059}, - {0x005A,0x007A,0x005A}, {0x005B,0x005B,0x005B}, - {0x005C,0x005C,0x005C}, {0x005D,0x005D,0x005D}, - {0x005E,0x005E,0x005E}, {0x005F,0x005F,0x005F}, - {0x0060,0x0060,0x0060}, {0x0041,0x0061,0x0041}, - {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043}, - {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045}, - {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047}, - {0x0048,0x0068,0x0048}, {0x0130,0x0069,0x0049}, - {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B}, - {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D}, - {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F}, - {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051}, - {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053}, - {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055}, - {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057}, - {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059}, - {0x005A,0x007A,0x005A}, {0x007B,0x007B,0x007B}, - {0x007C,0x007C,0x007C}, {0x007D,0x007D,0x007D}, - {0x007E,0x007E,0x007E}, {0x007F,0x007F,0x007F}, - {0x0080,0x0080,0x0080}, {0x0081,0x0081,0x0081}, - {0x0082,0x0082,0x0082}, {0x0083,0x0083,0x0083}, - {0x0084,0x0084,0x0084}, {0x0085,0x0085,0x0085}, - {0x0086,0x0086,0x0086}, {0x0087,0x0087,0x0087}, - {0x0088,0x0088,0x0088}, {0x0089,0x0089,0x0089}, - {0x008A,0x008A,0x008A}, {0x008B,0x008B,0x008B}, - {0x008C,0x008C,0x008C}, {0x008D,0x008D,0x008D}, - {0x008E,0x008E,0x008E}, {0x008F,0x008F,0x008F}, - {0x0090,0x0090,0x0090}, {0x0091,0x0091,0x0091}, - {0x0092,0x0092,0x0092}, {0x0093,0x0093,0x0093}, - {0x0094,0x0094,0x0094}, {0x0095,0x0095,0x0095}, - {0x0096,0x0096,0x0096}, {0x0097,0x0097,0x0097}, - {0x0098,0x0098,0x0098}, {0x0099,0x0099,0x0099}, - {0x009A,0x009A,0x009A}, {0x009B,0x009B,0x009B}, - {0x009C,0x009C,0x009C}, {0x009D,0x009D,0x009D}, - {0x009E,0x009E,0x009E}, {0x009F,0x009F,0x009F}, - {0x00A0,0x00A0,0x00A0}, {0x00A1,0x00A1,0x00A1}, - {0x00A2,0x00A2,0x00A2}, {0x00A3,0x00A3,0x00A3}, - {0x00A4,0x00A4,0x00A4}, {0x00A5,0x00A5,0x00A5}, - {0x00A6,0x00A6,0x00A6}, {0x00A7,0x00A7,0x00A7}, - {0x00A8,0x00A8,0x00A8}, {0x00A9,0x00A9,0x00A9}, - {0x00AA,0x00AA,0x00AA}, {0x00AB,0x00AB,0x00AB}, - {0x00AC,0x00AC,0x00AC}, {0x00AD,0x00AD,0x00AD}, - {0x00AE,0x00AE,0x00AE}, {0x00AF,0x00AF,0x00AF}, - {0x00B0,0x00B0,0x00B0}, {0x00B1,0x00B1,0x00B1}, - {0x00B2,0x00B2,0x00B2}, {0x00B3,0x00B3,0x00B3}, - {0x00B4,0x00B4,0x00B4}, {0x039C,0x00B5,0x039C}, - {0x00B6,0x00B6,0x00B6}, {0x00B7,0x00B7,0x00B7}, - {0x00B8,0x00B8,0x00B8}, {0x00B9,0x00B9,0x00B9}, - {0x00BA,0x00BA,0x00BA}, {0x00BB,0x00BB,0x00BB}, - {0x00BC,0x00BC,0x00BC}, {0x00BD,0x00BD,0x00BD}, - {0x00BE,0x00BE,0x00BE}, {0x00BF,0x00BF,0x00BF}, - {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041}, - {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041}, - {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041}, - {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043}, - {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045}, - {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045}, - {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049}, - {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049}, - {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E}, - {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F}, - {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F}, - {0x00D6,0x00F6,0x004F}, {0x00D7,0x00D7,0x00D7}, - {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055}, - {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055}, - {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059}, - {0x00DE,0x00FE,0x00DE}, {0x00DF,0x00DF,0x00DF}, - {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041}, - {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041}, - {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041}, - {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043}, - {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045}, - {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045}, - {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049}, - {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049}, - {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E}, - {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F}, - {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F}, - {0x00D6,0x00F6,0x004F}, {0x00F7,0x00F7,0x00F7}, - {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055}, - {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055}, - {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059}, - {0x00DE,0x00FE,0x00DE}, {0x0178,0x00FF,0x0059} -}; - - - -static MY_UNICASE_CHARACTER *my_unicase_pages_turkish[256]= -{ - turk00, plane01, plane02, plane03, plane04, plane05, plane06, plane07, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, plane1E, plane1F, - NULL, plane21, NULL, NULL, plane24, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, planeFF -}; - - -MY_UNICASE_INFO my_unicase_turkish= -{ - 0xFFFF, - my_unicase_pages_turkish -}; - - -/* Unicode-5.2.0 case folding information */ -static MY_UNICASE_CHARACTER u520p00[]={ - {0x0000,0x0000,0x0000}, {0x0001,0x0001,0x0001}, /* 0000 */ - {0x0002,0x0002,0x0002}, {0x0003,0x0003,0x0003}, /* 0002 */ - {0x0004,0x0004,0x0004}, {0x0005,0x0005,0x0005}, /* 0004 */ - {0x0006,0x0006,0x0006}, {0x0007,0x0007,0x0007}, /* 0006 */ - {0x0008,0x0008,0x0008}, {0x0009,0x0009,0x0009}, /* 0008 */ - {0x000A,0x000A,0x000A}, {0x000B,0x000B,0x000B}, /* 000A */ - {0x000C,0x000C,0x000C}, {0x000D,0x000D,0x000D}, /* 000C */ - {0x000E,0x000E,0x000E}, {0x000F,0x000F,0x000F}, /* 000E */ - {0x0010,0x0010,0x0010}, {0x0011,0x0011,0x0011}, /* 0010 */ - {0x0012,0x0012,0x0012}, {0x0013,0x0013,0x0013}, /* 0012 */ - {0x0014,0x0014,0x0014}, {0x0015,0x0015,0x0015}, /* 0014 */ - {0x0016,0x0016,0x0016}, {0x0017,0x0017,0x0017}, /* 0016 */ - {0x0018,0x0018,0x0018}, {0x0019,0x0019,0x0019}, /* 0018 */ - {0x001A,0x001A,0x001A}, {0x001B,0x001B,0x001B}, /* 001A */ - {0x001C,0x001C,0x001C}, {0x001D,0x001D,0x001D}, /* 001C */ - {0x001E,0x001E,0x001E}, {0x001F,0x001F,0x001F}, /* 001E */ - {0x0020,0x0020,0x0020}, {0x0021,0x0021,0x0021}, /* 0020 */ - {0x0022,0x0022,0x0022}, {0x0023,0x0023,0x0023}, /* 0022 */ - {0x0024,0x0024,0x0024}, {0x0025,0x0025,0x0025}, /* 0024 */ - {0x0026,0x0026,0x0026}, {0x0027,0x0027,0x0027}, /* 0026 */ - {0x0028,0x0028,0x0028}, {0x0029,0x0029,0x0029}, /* 0028 */ - {0x002A,0x002A,0x002A}, {0x002B,0x002B,0x002B}, /* 002A */ - {0x002C,0x002C,0x002C}, {0x002D,0x002D,0x002D}, /* 002C */ - {0x002E,0x002E,0x002E}, {0x002F,0x002F,0x002F}, /* 002E */ - {0x0030,0x0030,0x0030}, {0x0031,0x0031,0x0031}, /* 0030 */ - {0x0032,0x0032,0x0032}, {0x0033,0x0033,0x0033}, /* 0032 */ - {0x0034,0x0034,0x0034}, {0x0035,0x0035,0x0035}, /* 0034 */ - {0x0036,0x0036,0x0036}, {0x0037,0x0037,0x0037}, /* 0036 */ - {0x0038,0x0038,0x0038}, {0x0039,0x0039,0x0039}, /* 0038 */ - {0x003A,0x003A,0x003A}, {0x003B,0x003B,0x003B}, /* 003A */ - {0x003C,0x003C,0x003C}, {0x003D,0x003D,0x003D}, /* 003C */ - {0x003E,0x003E,0x003E}, {0x003F,0x003F,0x003F}, /* 003E */ - {0x0040,0x0040,0x0040}, {0x0041,0x0061,0x0041}, /* 0040 */ - {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043}, /* 0042 */ - {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045}, /* 0044 */ - {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047}, /* 0046 */ - {0x0048,0x0068,0x0048}, {0x0049,0x0069,0x0049}, /* 0048 */ - {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B}, /* 004A */ - {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D}, /* 004C */ - {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F}, /* 004E */ - {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051}, /* 0050 */ - {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053}, /* 0052 */ - {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055}, /* 0054 */ - {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057}, /* 0056 */ - {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059}, /* 0058 */ - {0x005A,0x007A,0x005A}, {0x005B,0x005B,0x005B}, /* 005A */ - {0x005C,0x005C,0x005C}, {0x005D,0x005D,0x005D}, /* 005C */ - {0x005E,0x005E,0x005E}, {0x005F,0x005F,0x005F}, /* 005E */ - {0x0060,0x0060,0x0060}, {0x0041,0x0061,0x0041}, /* 0060 */ - {0x0042,0x0062,0x0042}, {0x0043,0x0063,0x0043}, /* 0062 */ - {0x0044,0x0064,0x0044}, {0x0045,0x0065,0x0045}, /* 0064 */ - {0x0046,0x0066,0x0046}, {0x0047,0x0067,0x0047}, /* 0066 */ - {0x0048,0x0068,0x0048}, {0x0049,0x0069,0x0049}, /* 0068 */ - {0x004A,0x006A,0x004A}, {0x004B,0x006B,0x004B}, /* 006A */ - {0x004C,0x006C,0x004C}, {0x004D,0x006D,0x004D}, /* 006C */ - {0x004E,0x006E,0x004E}, {0x004F,0x006F,0x004F}, /* 006E */ - {0x0050,0x0070,0x0050}, {0x0051,0x0071,0x0051}, /* 0070 */ - {0x0052,0x0072,0x0052}, {0x0053,0x0073,0x0053}, /* 0072 */ - {0x0054,0x0074,0x0054}, {0x0055,0x0075,0x0055}, /* 0074 */ - {0x0056,0x0076,0x0056}, {0x0057,0x0077,0x0057}, /* 0076 */ - {0x0058,0x0078,0x0058}, {0x0059,0x0079,0x0059}, /* 0078 */ - {0x005A,0x007A,0x005A}, {0x007B,0x007B,0x007B}, /* 007A */ - {0x007C,0x007C,0x007C}, {0x007D,0x007D,0x007D}, /* 007C */ - {0x007E,0x007E,0x007E}, {0x007F,0x007F,0x007F}, /* 007E */ - {0x0080,0x0080,0x0080}, {0x0081,0x0081,0x0081}, /* 0080 */ - {0x0082,0x0082,0x0082}, {0x0083,0x0083,0x0083}, /* 0082 */ - {0x0084,0x0084,0x0084}, {0x0085,0x0085,0x0085}, /* 0084 */ - {0x0086,0x0086,0x0086}, {0x0087,0x0087,0x0087}, /* 0086 */ - {0x0088,0x0088,0x0088}, {0x0089,0x0089,0x0089}, /* 0088 */ - {0x008A,0x008A,0x008A}, {0x008B,0x008B,0x008B}, /* 008A */ - {0x008C,0x008C,0x008C}, {0x008D,0x008D,0x008D}, /* 008C */ - {0x008E,0x008E,0x008E}, {0x008F,0x008F,0x008F}, /* 008E */ - {0x0090,0x0090,0x0090}, {0x0091,0x0091,0x0091}, /* 0090 */ - {0x0092,0x0092,0x0092}, {0x0093,0x0093,0x0093}, /* 0092 */ - {0x0094,0x0094,0x0094}, {0x0095,0x0095,0x0095}, /* 0094 */ - {0x0096,0x0096,0x0096}, {0x0097,0x0097,0x0097}, /* 0096 */ - {0x0098,0x0098,0x0098}, {0x0099,0x0099,0x0099}, /* 0098 */ - {0x009A,0x009A,0x009A}, {0x009B,0x009B,0x009B}, /* 009A */ - {0x009C,0x009C,0x009C}, {0x009D,0x009D,0x009D}, /* 009C */ - {0x009E,0x009E,0x009E}, {0x009F,0x009F,0x009F}, /* 009E */ - {0x00A0,0x00A0,0x00A0}, {0x00A1,0x00A1,0x00A1}, /* 00A0 */ - {0x00A2,0x00A2,0x00A2}, {0x00A3,0x00A3,0x00A3}, /* 00A2 */ - {0x00A4,0x00A4,0x00A4}, {0x00A5,0x00A5,0x00A5}, /* 00A4 */ - {0x00A6,0x00A6,0x00A6}, {0x00A7,0x00A7,0x00A7}, /* 00A6 */ - {0x00A8,0x00A8,0x00A8}, {0x00A9,0x00A9,0x00A9}, /* 00A8 */ - {0x00AA,0x00AA,0x00AA}, {0x00AB,0x00AB,0x00AB}, /* 00AA */ - {0x00AC,0x00AC,0x00AC}, {0x00AD,0x00AD,0x00AD}, /* 00AC */ - {0x00AE,0x00AE,0x00AE}, {0x00AF,0x00AF,0x00AF}, /* 00AE */ - {0x00B0,0x00B0,0x00B0}, {0x00B1,0x00B1,0x00B1}, /* 00B0 */ - {0x00B2,0x00B2,0x00B2}, {0x00B3,0x00B3,0x00B3}, /* 00B2 */ - {0x00B4,0x00B4,0x00B4}, {0x039C,0x00B5,0x039C}, /* 00B4 */ - {0x00B6,0x00B6,0x00B6}, {0x00B7,0x00B7,0x00B7}, /* 00B6 */ - {0x00B8,0x00B8,0x00B8}, {0x00B9,0x00B9,0x00B9}, /* 00B8 */ - {0x00BA,0x00BA,0x00BA}, {0x00BB,0x00BB,0x00BB}, /* 00BA */ - {0x00BC,0x00BC,0x00BC}, {0x00BD,0x00BD,0x00BD}, /* 00BC */ - {0x00BE,0x00BE,0x00BE}, {0x00BF,0x00BF,0x00BF}, /* 00BE */ - {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041}, /* 00C0 */ - {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041}, /* 00C2 */ - {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041}, /* 00C4 */ - {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043}, /* 00C6 */ - {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045}, /* 00C8 */ - {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045}, /* 00CA */ - {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049}, /* 00CC */ - {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049}, /* 00CE */ - {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E}, /* 00D0 */ - {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F}, /* 00D2 */ - {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F}, /* 00D4 */ - {0x00D6,0x00F6,0x004F}, {0x00D7,0x00D7,0x00D7}, /* 00D6 */ - {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055}, /* 00D8 */ - {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055}, /* 00DA */ - {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059}, /* 00DC */ - {0x00DE,0x00FE,0x00DE}, {0x00DF,0x00DF,0x0053}, /* 00DE */ - {0x00C0,0x00E0,0x0041}, {0x00C1,0x00E1,0x0041}, /* 00E0 */ - {0x00C2,0x00E2,0x0041}, {0x00C3,0x00E3,0x0041}, /* 00E2 */ - {0x00C4,0x00E4,0x0041}, {0x00C5,0x00E5,0x0041}, /* 00E4 */ - {0x00C6,0x00E6,0x00C6}, {0x00C7,0x00E7,0x0043}, /* 00E6 */ - {0x00C8,0x00E8,0x0045}, {0x00C9,0x00E9,0x0045}, /* 00E8 */ - {0x00CA,0x00EA,0x0045}, {0x00CB,0x00EB,0x0045}, /* 00EA */ - {0x00CC,0x00EC,0x0049}, {0x00CD,0x00ED,0x0049}, /* 00EC */ - {0x00CE,0x00EE,0x0049}, {0x00CF,0x00EF,0x0049}, /* 00EE */ - {0x00D0,0x00F0,0x00D0}, {0x00D1,0x00F1,0x004E}, /* 00F0 */ - {0x00D2,0x00F2,0x004F}, {0x00D3,0x00F3,0x004F}, /* 00F2 */ - {0x00D4,0x00F4,0x004F}, {0x00D5,0x00F5,0x004F}, /* 00F4 */ - {0x00D6,0x00F6,0x004F}, {0x00F7,0x00F7,0x00F7}, /* 00F6 */ - {0x00D8,0x00F8,0x00D8}, {0x00D9,0x00F9,0x0055}, /* 00F8 */ - {0x00DA,0x00FA,0x0055}, {0x00DB,0x00FB,0x0055}, /* 00FA */ - {0x00DC,0x00FC,0x0055}, {0x00DD,0x00FD,0x0059}, /* 00FC */ - {0x00DE,0x00FE,0x00DE}, {0x0178,0x00FF,0x0059} /* 00FE */ -}; - -static MY_UNICASE_CHARACTER u520p01[]={ - {0x0100,0x0101,0x0041}, {0x0100,0x0101,0x0041}, /* 0100 */ - {0x0102,0x0103,0x0041}, {0x0102,0x0103,0x0041}, /* 0102 */ - {0x0104,0x0105,0x0041}, {0x0104,0x0105,0x0041}, /* 0104 */ - {0x0106,0x0107,0x0043}, {0x0106,0x0107,0x0043}, /* 0106 */ - {0x0108,0x0109,0x0043}, {0x0108,0x0109,0x0043}, /* 0108 */ - {0x010A,0x010B,0x0043}, {0x010A,0x010B,0x0043}, /* 010A */ - {0x010C,0x010D,0x0043}, {0x010C,0x010D,0x0043}, /* 010C */ - {0x010E,0x010F,0x0044}, {0x010E,0x010F,0x0044}, /* 010E */ - {0x0110,0x0111,0x0110}, {0x0110,0x0111,0x0110}, /* 0110 */ - {0x0112,0x0113,0x0045}, {0x0112,0x0113,0x0045}, /* 0112 */ - {0x0114,0x0115,0x0045}, {0x0114,0x0115,0x0045}, /* 0114 */ - {0x0116,0x0117,0x0045}, {0x0116,0x0117,0x0045}, /* 0116 */ - {0x0118,0x0119,0x0045}, {0x0118,0x0119,0x0045}, /* 0118 */ - {0x011A,0x011B,0x0045}, {0x011A,0x011B,0x0045}, /* 011A */ - {0x011C,0x011D,0x0047}, {0x011C,0x011D,0x0047}, /* 011C */ - {0x011E,0x011F,0x0047}, {0x011E,0x011F,0x0047}, /* 011E */ - {0x0120,0x0121,0x0047}, {0x0120,0x0121,0x0047}, /* 0120 */ - {0x0122,0x0123,0x0047}, {0x0122,0x0123,0x0047}, /* 0122 */ - {0x0124,0x0125,0x0048}, {0x0124,0x0125,0x0048}, /* 0124 */ - {0x0126,0x0127,0x0126}, {0x0126,0x0127,0x0126}, /* 0126 */ - {0x0128,0x0129,0x0049}, {0x0128,0x0129,0x0049}, /* 0128 */ - {0x012A,0x012B,0x0049}, {0x012A,0x012B,0x0049}, /* 012A */ - {0x012C,0x012D,0x0049}, {0x012C,0x012D,0x0049}, /* 012C */ - {0x012E,0x012F,0x0049}, {0x012E,0x012F,0x0049}, /* 012E */ - {0x0130,0x0069,0x0049}, {0x0049,0x0131,0x0049}, /* 0130 */ - {0x0132,0x0133,0x0132}, {0x0132,0x0133,0x0132}, /* 0132 */ - {0x0134,0x0135,0x004A}, {0x0134,0x0135,0x004A}, /* 0134 */ - {0x0136,0x0137,0x004B}, {0x0136,0x0137,0x004B}, /* 0136 */ - {0x0138,0x0138,0x0138}, {0x0139,0x013A,0x004C}, /* 0138 */ - {0x0139,0x013A,0x004C}, {0x013B,0x013C,0x004C}, /* 013A */ - {0x013B,0x013C,0x004C}, {0x013D,0x013E,0x004C}, /* 013C */ - {0x013D,0x013E,0x004C}, {0x013F,0x0140,0x013F}, /* 013E */ - {0x013F,0x0140,0x013F}, {0x0141,0x0142,0x0141}, /* 0140 */ - {0x0141,0x0142,0x0141}, {0x0143,0x0144,0x004E}, /* 0142 */ - {0x0143,0x0144,0x004E}, {0x0145,0x0146,0x004E}, /* 0144 */ - {0x0145,0x0146,0x004E}, {0x0147,0x0148,0x004E}, /* 0146 */ - {0x0147,0x0148,0x004E}, {0x0149,0x0149,0x0149}, /* 0148 */ - {0x014A,0x014B,0x014A}, {0x014A,0x014B,0x014A}, /* 014A */ - {0x014C,0x014D,0x004F}, {0x014C,0x014D,0x004F}, /* 014C */ - {0x014E,0x014F,0x004F}, {0x014E,0x014F,0x004F}, /* 014E */ - {0x0150,0x0151,0x004F}, {0x0150,0x0151,0x004F}, /* 0150 */ - {0x0152,0x0153,0x0152}, {0x0152,0x0153,0x0152}, /* 0152 */ - {0x0154,0x0155,0x0052}, {0x0154,0x0155,0x0052}, /* 0154 */ - {0x0156,0x0157,0x0052}, {0x0156,0x0157,0x0052}, /* 0156 */ - {0x0158,0x0159,0x0052}, {0x0158,0x0159,0x0052}, /* 0158 */ - {0x015A,0x015B,0x0053}, {0x015A,0x015B,0x0053}, /* 015A */ - {0x015C,0x015D,0x0053}, {0x015C,0x015D,0x0053}, /* 015C */ - {0x015E,0x015F,0x0053}, {0x015E,0x015F,0x0053}, /* 015E */ - {0x0160,0x0161,0x0053}, {0x0160,0x0161,0x0053}, /* 0160 */ - {0x0162,0x0163,0x0054}, {0x0162,0x0163,0x0054}, /* 0162 */ - {0x0164,0x0165,0x0054}, {0x0164,0x0165,0x0054}, /* 0164 */ - {0x0166,0x0167,0x0166}, {0x0166,0x0167,0x0166}, /* 0166 */ - {0x0168,0x0169,0x0055}, {0x0168,0x0169,0x0055}, /* 0168 */ - {0x016A,0x016B,0x0055}, {0x016A,0x016B,0x0055}, /* 016A */ - {0x016C,0x016D,0x0055}, {0x016C,0x016D,0x0055}, /* 016C */ - {0x016E,0x016F,0x0055}, {0x016E,0x016F,0x0055}, /* 016E */ - {0x0170,0x0171,0x0055}, {0x0170,0x0171,0x0055}, /* 0170 */ - {0x0172,0x0173,0x0055}, {0x0172,0x0173,0x0055}, /* 0172 */ - {0x0174,0x0175,0x0057}, {0x0174,0x0175,0x0057}, /* 0174 */ - {0x0176,0x0177,0x0059}, {0x0176,0x0177,0x0059}, /* 0176 */ - {0x0178,0x00FF,0x0059}, {0x0179,0x017A,0x005A}, /* 0178 */ - {0x0179,0x017A,0x005A}, {0x017B,0x017C,0x005A}, /* 017A */ - {0x017B,0x017C,0x005A}, {0x017D,0x017E,0x005A}, /* 017C */ - {0x017D,0x017E,0x005A}, {0x0053,0x017F,0x0053}, /* 017E */ - {0x0243,0x0180,0x0243}, {0x0181,0x0253,0x0181}, /* 0180 */ - {0x0182,0x0183,0x0182}, {0x0182,0x0183,0x0182}, /* 0182 */ - {0x0184,0x0185,0x0184}, {0x0184,0x0185,0x0184}, /* 0184 */ - {0x0186,0x0254,0x0186}, {0x0187,0x0188,0x0187}, /* 0186 */ - {0x0187,0x0188,0x0187}, {0x0189,0x0256,0x0189}, /* 0188 */ - {0x018A,0x0257,0x018A}, {0x018B,0x018C,0x018B}, /* 018A */ - {0x018B,0x018C,0x018B}, {0x018D,0x018D,0x018D}, /* 018C */ - {0x018E,0x01DD,0x018E}, {0x018F,0x0259,0x018F}, /* 018E */ - {0x0190,0x025B,0x0190}, {0x0191,0x0192,0x0191}, /* 0190 */ - {0x0191,0x0192,0x0191}, {0x0193,0x0260,0x0193}, /* 0192 */ - {0x0194,0x0263,0x0194}, {0x01F6,0x0195,0x01F6}, /* 0194 */ - {0x0196,0x0269,0x0196}, {0x0197,0x0268,0x0197}, /* 0196 */ - {0x0198,0x0199,0x0198}, {0x0198,0x0199,0x0198}, /* 0198 */ - {0x023D,0x019A,0x023D}, {0x019B,0x019B,0x019B}, /* 019A */ - {0x019C,0x026F,0x019C}, {0x019D,0x0272,0x019D}, /* 019C */ - {0x0220,0x019E,0x0220}, {0x019F,0x0275,0x019F}, /* 019E */ - {0x01A0,0x01A1,0x004F}, {0x01A0,0x01A1,0x004F}, /* 01A0 */ - {0x01A2,0x01A3,0x01A2}, {0x01A2,0x01A3,0x01A2}, /* 01A2 */ - {0x01A4,0x01A5,0x01A4}, {0x01A4,0x01A5,0x01A4}, /* 01A4 */ - {0x01A6,0x0280,0x01A6}, {0x01A7,0x01A8,0x01A7}, /* 01A6 */ - {0x01A7,0x01A8,0x01A7}, {0x01A9,0x0283,0x01A9}, /* 01A8 */ - {0x01AA,0x01AA,0x01AA}, {0x01AB,0x01AB,0x01AB}, /* 01AA */ - {0x01AC,0x01AD,0x01AC}, {0x01AC,0x01AD,0x01AC}, /* 01AC */ - {0x01AE,0x0288,0x01AE}, {0x01AF,0x01B0,0x0055}, /* 01AE */ - {0x01AF,0x01B0,0x0055}, {0x01B1,0x028A,0x01B1}, /* 01B0 */ - {0x01B2,0x028B,0x01B2}, {0x01B3,0x01B4,0x01B3}, /* 01B2 */ - {0x01B3,0x01B4,0x01B3}, {0x01B5,0x01B6,0x01B5}, /* 01B4 */ - {0x01B5,0x01B6,0x01B5}, {0x01B7,0x0292,0x01B7}, /* 01B6 */ - {0x01B8,0x01B9,0x01B8}, {0x01B8,0x01B9,0x01B8}, /* 01B8 */ - {0x01BA,0x01BA,0x01BA}, {0x01BB,0x01BB,0x01BB}, /* 01BA */ - {0x01BC,0x01BD,0x01BC}, {0x01BC,0x01BD,0x01BC}, /* 01BC */ - {0x01BE,0x01BE,0x01BE}, {0x01F7,0x01BF,0x01F7}, /* 01BE */ - {0x01C0,0x01C0,0x01C0}, {0x01C1,0x01C1,0x01C1}, /* 01C0 */ - {0x01C2,0x01C2,0x01C2}, {0x01C3,0x01C3,0x01C3}, /* 01C2 */ - {0x01C4,0x01C6,0x01C4}, {0x01C4,0x01C6,0x01C4}, /* 01C4 */ - {0x01C4,0x01C6,0x01C4}, {0x01C7,0x01C9,0x01C7}, /* 01C6 */ - {0x01C7,0x01C9,0x01C7}, {0x01C7,0x01C9,0x01C7}, /* 01C8 */ - {0x01CA,0x01CC,0x01CA}, {0x01CA,0x01CC,0x01CA}, /* 01CA */ - {0x01CA,0x01CC,0x01CA}, {0x01CD,0x01CE,0x0041}, /* 01CC */ - {0x01CD,0x01CE,0x0041}, {0x01CF,0x01D0,0x0049}, /* 01CE */ - {0x01CF,0x01D0,0x0049}, {0x01D1,0x01D2,0x004F}, /* 01D0 */ - {0x01D1,0x01D2,0x004F}, {0x01D3,0x01D4,0x0055}, /* 01D2 */ - {0x01D3,0x01D4,0x0055}, {0x01D5,0x01D6,0x0055}, /* 01D4 */ - {0x01D5,0x01D6,0x0055}, {0x01D7,0x01D8,0x0055}, /* 01D6 */ - {0x01D7,0x01D8,0x0055}, {0x01D9,0x01DA,0x0055}, /* 01D8 */ - {0x01D9,0x01DA,0x0055}, {0x01DB,0x01DC,0x0055}, /* 01DA */ - {0x01DB,0x01DC,0x0055}, {0x018E,0x01DD,0x018E}, /* 01DC */ - {0x01DE,0x01DF,0x0041}, {0x01DE,0x01DF,0x0041}, /* 01DE */ - {0x01E0,0x01E1,0x0041}, {0x01E0,0x01E1,0x0041}, /* 01E0 */ - {0x01E2,0x01E3,0x00C6}, {0x01E2,0x01E3,0x00C6}, /* 01E2 */ - {0x01E4,0x01E5,0x01E4}, {0x01E4,0x01E5,0x01E4}, /* 01E4 */ - {0x01E6,0x01E7,0x0047}, {0x01E6,0x01E7,0x0047}, /* 01E6 */ - {0x01E8,0x01E9,0x004B}, {0x01E8,0x01E9,0x004B}, /* 01E8 */ - {0x01EA,0x01EB,0x004F}, {0x01EA,0x01EB,0x004F}, /* 01EA */ - {0x01EC,0x01ED,0x004F}, {0x01EC,0x01ED,0x004F}, /* 01EC */ - {0x01EE,0x01EF,0x01B7}, {0x01EE,0x01EF,0x01B7}, /* 01EE */ - {0x01F0,0x01F0,0x004A}, {0x01F1,0x01F3,0x01F1}, /* 01F0 */ - {0x01F1,0x01F3,0x01F1}, {0x01F1,0x01F3,0x01F1}, /* 01F2 */ - {0x01F4,0x01F5,0x0047}, {0x01F4,0x01F5,0x0047}, /* 01F4 */ - {0x01F6,0x0195,0x01F6}, {0x01F7,0x01BF,0x01F7}, /* 01F6 */ - {0x01F8,0x01F9,0x004E}, {0x01F8,0x01F9,0x004E}, /* 01F8 */ - {0x01FA,0x01FB,0x0041}, {0x01FA,0x01FB,0x0041}, /* 01FA */ - {0x01FC,0x01FD,0x00C6}, {0x01FC,0x01FD,0x00C6}, /* 01FC */ - {0x01FE,0x01FF,0x00D8}, {0x01FE,0x01FF,0x00D8} /* 01FE */ -}; - -static MY_UNICASE_CHARACTER u520p02[]={ - {0x0200,0x0201,0x0041}, {0x0200,0x0201,0x0041}, /* 0200 */ - {0x0202,0x0203,0x0041}, {0x0202,0x0203,0x0041}, /* 0202 */ - {0x0204,0x0205,0x0045}, {0x0204,0x0205,0x0045}, /* 0204 */ - {0x0206,0x0207,0x0045}, {0x0206,0x0207,0x0045}, /* 0206 */ - {0x0208,0x0209,0x0049}, {0x0208,0x0209,0x0049}, /* 0208 */ - {0x020A,0x020B,0x0049}, {0x020A,0x020B,0x0049}, /* 020A */ - {0x020C,0x020D,0x004F}, {0x020C,0x020D,0x004F}, /* 020C */ - {0x020E,0x020F,0x004F}, {0x020E,0x020F,0x004F}, /* 020E */ - {0x0210,0x0211,0x0052}, {0x0210,0x0211,0x0052}, /* 0210 */ - {0x0212,0x0213,0x0052}, {0x0212,0x0213,0x0052}, /* 0212 */ - {0x0214,0x0215,0x0055}, {0x0214,0x0215,0x0055}, /* 0214 */ - {0x0216,0x0217,0x0055}, {0x0216,0x0217,0x0055}, /* 0216 */ - {0x0218,0x0219,0x0053}, {0x0218,0x0219,0x0053}, /* 0218 */ - {0x021A,0x021B,0x0054}, {0x021A,0x021B,0x0054}, /* 021A */ - {0x021C,0x021D,0x021C}, {0x021C,0x021D,0x021C}, /* 021C */ - {0x021E,0x021F,0x0048}, {0x021E,0x021F,0x0048}, /* 021E */ - {0x0220,0x019E,0x0220}, {0x0221,0x0221,0x0221}, /* 0220 */ - {0x0222,0x0223,0x0222}, {0x0222,0x0223,0x0222}, /* 0222 */ - {0x0224,0x0225,0x0224}, {0x0224,0x0225,0x0224}, /* 0224 */ - {0x0226,0x0227,0x0041}, {0x0226,0x0227,0x0041}, /* 0226 */ - {0x0228,0x0229,0x0045}, {0x0228,0x0229,0x0045}, /* 0228 */ - {0x022A,0x022B,0x004F}, {0x022A,0x022B,0x004F}, /* 022A */ - {0x022C,0x022D,0x004F}, {0x022C,0x022D,0x004F}, /* 022C */ - {0x022E,0x022F,0x004F}, {0x022E,0x022F,0x004F}, /* 022E */ - {0x0230,0x0231,0x004F}, {0x0230,0x0231,0x004F}, /* 0230 */ - {0x0232,0x0233,0x0059}, {0x0232,0x0233,0x0059}, /* 0232 */ - {0x0234,0x0234,0x0234}, {0x0235,0x0235,0x0235}, /* 0234 */ - {0x0236,0x0236,0x0236}, {0x0237,0x0237,0x0237}, /* 0236 */ - {0x0238,0x0238,0x0238}, {0x0239,0x0239,0x0239}, /* 0238 */ - {0x023A,0x2C65,0x023A}, {0x023B,0x023C,0x023B}, /* 023A */ - {0x023B,0x023C,0x023B}, {0x023D,0x019A,0x023D}, /* 023C */ - {0x023E,0x2C66,0x023E}, {0x2C7E,0x023F,0x2C7E}, /* 023E */ - {0x2C7F,0x0240,0x2C7F}, {0x0241,0x0242,0x0241}, /* 0240 */ - {0x0241,0x0242,0x0241}, {0x0243,0x0180,0x0243}, /* 0242 */ - {0x0244,0x0289,0x0244}, {0x0245,0x028C,0x0245}, /* 0244 */ - {0x0246,0x0247,0x0246}, {0x0246,0x0247,0x0246}, /* 0246 */ - {0x0248,0x0249,0x0248}, {0x0248,0x0249,0x0248}, /* 0248 */ - {0x024A,0x024B,0x024A}, {0x024A,0x024B,0x024A}, /* 024A */ - {0x024C,0x024D,0x024C}, {0x024C,0x024D,0x024C}, /* 024C */ - {0x024E,0x024F,0x024E}, {0x024E,0x024F,0x024E}, /* 024E */ - {0x2C6F,0x0250,0x2C6F}, {0x2C6D,0x0251,0x2C6D}, /* 0250 */ - {0x2C70,0x0252,0x2C70}, {0x0181,0x0253,0x0181}, /* 0252 */ - {0x0186,0x0254,0x0186}, {0x0255,0x0255,0x0255}, /* 0254 */ - {0x0189,0x0256,0x0189}, {0x018A,0x0257,0x018A}, /* 0256 */ - {0x0258,0x0258,0x0258}, {0x018F,0x0259,0x018F}, /* 0258 */ - {0x025A,0x025A,0x025A}, {0x0190,0x025B,0x0190}, /* 025A */ - {0x025C,0x025C,0x025C}, {0x025D,0x025D,0x025D}, /* 025C */ - {0x025E,0x025E,0x025E}, {0x025F,0x025F,0x025F}, /* 025E */ - {0x0193,0x0260,0x0193}, {0x0261,0x0261,0x0261}, /* 0260 */ - {0x0262,0x0262,0x0262}, {0x0194,0x0263,0x0194}, /* 0262 */ - {0x0264,0x0264,0x0264}, {0x0265,0x0265,0x0265}, /* 0264 */ - {0x0266,0x0266,0x0266}, {0x0267,0x0267,0x0267}, /* 0266 */ - {0x0197,0x0268,0x0197}, {0x0196,0x0269,0x0196}, /* 0268 */ - {0x026A,0x026A,0x026A}, {0x2C62,0x026B,0x2C62}, /* 026A */ - {0x026C,0x026C,0x026C}, {0x026D,0x026D,0x026D}, /* 026C */ - {0x026E,0x026E,0x026E}, {0x019C,0x026F,0x019C}, /* 026E */ - {0x0270,0x0270,0x0270}, {0x2C6E,0x0271,0x2C6E}, /* 0270 */ - {0x019D,0x0272,0x019D}, {0x0273,0x0273,0x0273}, /* 0272 */ - {0x0274,0x0274,0x0274}, {0x019F,0x0275,0x019F}, /* 0274 */ - {0x0276,0x0276,0x0276}, {0x0277,0x0277,0x0277}, /* 0276 */ - {0x0278,0x0278,0x0278}, {0x0279,0x0279,0x0279}, /* 0278 */ - {0x027A,0x027A,0x027A}, {0x027B,0x027B,0x027B}, /* 027A */ - {0x027C,0x027C,0x027C}, {0x2C64,0x027D,0x2C64}, /* 027C */ - {0x027E,0x027E,0x027E}, {0x027F,0x027F,0x027F}, /* 027E */ - {0x01A6,0x0280,0x01A6}, {0x0281,0x0281,0x0281}, /* 0280 */ - {0x0282,0x0282,0x0282}, {0x01A9,0x0283,0x01A9}, /* 0282 */ - {0x0284,0x0284,0x0284}, {0x0285,0x0285,0x0285}, /* 0284 */ - {0x0286,0x0286,0x0286}, {0x0287,0x0287,0x0287}, /* 0286 */ - {0x01AE,0x0288,0x01AE}, {0x0244,0x0289,0x0244}, /* 0288 */ - {0x01B1,0x028A,0x01B1}, {0x01B2,0x028B,0x01B2}, /* 028A */ - {0x0245,0x028C,0x0245}, {0x028D,0x028D,0x028D}, /* 028C */ - {0x028E,0x028E,0x028E}, {0x028F,0x028F,0x028F}, /* 028E */ - {0x0290,0x0290,0x0290}, {0x0291,0x0291,0x0291}, /* 0290 */ - {0x01B7,0x0292,0x01B7}, {0x0293,0x0293,0x0293}, /* 0292 */ - {0x0294,0x0294,0x0294}, {0x0295,0x0295,0x0295}, /* 0294 */ - {0x0296,0x0296,0x0296}, {0x0297,0x0297,0x0297}, /* 0296 */ - {0x0298,0x0298,0x0298}, {0x0299,0x0299,0x0299}, /* 0298 */ - {0x029A,0x029A,0x029A}, {0x029B,0x029B,0x029B}, /* 029A */ - {0x029C,0x029C,0x029C}, {0x029D,0x029D,0x029D}, /* 029C */ - {0x029E,0x029E,0x029E}, {0x029F,0x029F,0x029F}, /* 029E */ - {0x02A0,0x02A0,0x02A0}, {0x02A1,0x02A1,0x02A1}, /* 02A0 */ - {0x02A2,0x02A2,0x02A2}, {0x02A3,0x02A3,0x02A3}, /* 02A2 */ - {0x02A4,0x02A4,0x02A4}, {0x02A5,0x02A5,0x02A5}, /* 02A4 */ - {0x02A6,0x02A6,0x02A6}, {0x02A7,0x02A7,0x02A7}, /* 02A6 */ - {0x02A8,0x02A8,0x02A8}, {0x02A9,0x02A9,0x02A9}, /* 02A8 */ - {0x02AA,0x02AA,0x02AA}, {0x02AB,0x02AB,0x02AB}, /* 02AA */ - {0x02AC,0x02AC,0x02AC}, {0x02AD,0x02AD,0x02AD}, /* 02AC */ - {0x02AE,0x02AE,0x02AE}, {0x02AF,0x02AF,0x02AF}, /* 02AE */ - {0x02B0,0x02B0,0x02B0}, {0x02B1,0x02B1,0x02B1}, /* 02B0 */ - {0x02B2,0x02B2,0x02B2}, {0x02B3,0x02B3,0x02B3}, /* 02B2 */ - {0x02B4,0x02B4,0x02B4}, {0x02B5,0x02B5,0x02B5}, /* 02B4 */ - {0x02B6,0x02B6,0x02B6}, {0x02B7,0x02B7,0x02B7}, /* 02B6 */ - {0x02B8,0x02B8,0x02B8}, {0x02B9,0x02B9,0x02B9}, /* 02B8 */ - {0x02BA,0x02BA,0x02BA}, {0x02BB,0x02BB,0x02BB}, /* 02BA */ - {0x02BC,0x02BC,0x02BC}, {0x02BD,0x02BD,0x02BD}, /* 02BC */ - {0x02BE,0x02BE,0x02BE}, {0x02BF,0x02BF,0x02BF}, /* 02BE */ - {0x02C0,0x02C0,0x02C0}, {0x02C1,0x02C1,0x02C1}, /* 02C0 */ - {0x02C2,0x02C2,0x02C2}, {0x02C3,0x02C3,0x02C3}, /* 02C2 */ - {0x02C4,0x02C4,0x02C4}, {0x02C5,0x02C5,0x02C5}, /* 02C4 */ - {0x02C6,0x02C6,0x02C6}, {0x02C7,0x02C7,0x02C7}, /* 02C6 */ - {0x02C8,0x02C8,0x02C8}, {0x02C9,0x02C9,0x02C9}, /* 02C8 */ - {0x02CA,0x02CA,0x02CA}, {0x02CB,0x02CB,0x02CB}, /* 02CA */ - {0x02CC,0x02CC,0x02CC}, {0x02CD,0x02CD,0x02CD}, /* 02CC */ - {0x02CE,0x02CE,0x02CE}, {0x02CF,0x02CF,0x02CF}, /* 02CE */ - {0x02D0,0x02D0,0x02D0}, {0x02D1,0x02D1,0x02D1}, /* 02D0 */ - {0x02D2,0x02D2,0x02D2}, {0x02D3,0x02D3,0x02D3}, /* 02D2 */ - {0x02D4,0x02D4,0x02D4}, {0x02D5,0x02D5,0x02D5}, /* 02D4 */ - {0x02D6,0x02D6,0x02D6}, {0x02D7,0x02D7,0x02D7}, /* 02D6 */ - {0x02D8,0x02D8,0x02D8}, {0x02D9,0x02D9,0x02D9}, /* 02D8 */ - {0x02DA,0x02DA,0x02DA}, {0x02DB,0x02DB,0x02DB}, /* 02DA */ - {0x02DC,0x02DC,0x02DC}, {0x02DD,0x02DD,0x02DD}, /* 02DC */ - {0x02DE,0x02DE,0x02DE}, {0x02DF,0x02DF,0x02DF}, /* 02DE */ - {0x02E0,0x02E0,0x02E0}, {0x02E1,0x02E1,0x02E1}, /* 02E0 */ - {0x02E2,0x02E2,0x02E2}, {0x02E3,0x02E3,0x02E3}, /* 02E2 */ - {0x02E4,0x02E4,0x02E4}, {0x02E5,0x02E5,0x02E5}, /* 02E4 */ - {0x02E6,0x02E6,0x02E6}, {0x02E7,0x02E7,0x02E7}, /* 02E6 */ - {0x02E8,0x02E8,0x02E8}, {0x02E9,0x02E9,0x02E9}, /* 02E8 */ - {0x02EA,0x02EA,0x02EA}, {0x02EB,0x02EB,0x02EB}, /* 02EA */ - {0x02EC,0x02EC,0x02EC}, {0x02ED,0x02ED,0x02ED}, /* 02EC */ - {0x02EE,0x02EE,0x02EE}, {0x02EF,0x02EF,0x02EF}, /* 02EE */ - {0x02F0,0x02F0,0x02F0}, {0x02F1,0x02F1,0x02F1}, /* 02F0 */ - {0x02F2,0x02F2,0x02F2}, {0x02F3,0x02F3,0x02F3}, /* 02F2 */ - {0x02F4,0x02F4,0x02F4}, {0x02F5,0x02F5,0x02F5}, /* 02F4 */ - {0x02F6,0x02F6,0x02F6}, {0x02F7,0x02F7,0x02F7}, /* 02F6 */ - {0x02F8,0x02F8,0x02F8}, {0x02F9,0x02F9,0x02F9}, /* 02F8 */ - {0x02FA,0x02FA,0x02FA}, {0x02FB,0x02FB,0x02FB}, /* 02FA */ - {0x02FC,0x02FC,0x02FC}, {0x02FD,0x02FD,0x02FD}, /* 02FC */ - {0x02FE,0x02FE,0x02FE}, {0x02FF,0x02FF,0x02FF} /* 02FE */ -}; - -static MY_UNICASE_CHARACTER u520p03[]={ - {0x0300,0x0300,0x0300}, {0x0301,0x0301,0x0301}, /* 0300 */ - {0x0302,0x0302,0x0302}, {0x0303,0x0303,0x0303}, /* 0302 */ - {0x0304,0x0304,0x0304}, {0x0305,0x0305,0x0305}, /* 0304 */ - {0x0306,0x0306,0x0306}, {0x0307,0x0307,0x0307}, /* 0306 */ - {0x0308,0x0308,0x0308}, {0x0309,0x0309,0x0309}, /* 0308 */ - {0x030A,0x030A,0x030A}, {0x030B,0x030B,0x030B}, /* 030A */ - {0x030C,0x030C,0x030C}, {0x030D,0x030D,0x030D}, /* 030C */ - {0x030E,0x030E,0x030E}, {0x030F,0x030F,0x030F}, /* 030E */ - {0x0310,0x0310,0x0310}, {0x0311,0x0311,0x0311}, /* 0310 */ - {0x0312,0x0312,0x0312}, {0x0313,0x0313,0x0313}, /* 0312 */ - {0x0314,0x0314,0x0314}, {0x0315,0x0315,0x0315}, /* 0314 */ - {0x0316,0x0316,0x0316}, {0x0317,0x0317,0x0317}, /* 0316 */ - {0x0318,0x0318,0x0318}, {0x0319,0x0319,0x0319}, /* 0318 */ - {0x031A,0x031A,0x031A}, {0x031B,0x031B,0x031B}, /* 031A */ - {0x031C,0x031C,0x031C}, {0x031D,0x031D,0x031D}, /* 031C */ - {0x031E,0x031E,0x031E}, {0x031F,0x031F,0x031F}, /* 031E */ - {0x0320,0x0320,0x0320}, {0x0321,0x0321,0x0321}, /* 0320 */ - {0x0322,0x0322,0x0322}, {0x0323,0x0323,0x0323}, /* 0322 */ - {0x0324,0x0324,0x0324}, {0x0325,0x0325,0x0325}, /* 0324 */ - {0x0326,0x0326,0x0326}, {0x0327,0x0327,0x0327}, /* 0326 */ - {0x0328,0x0328,0x0328}, {0x0329,0x0329,0x0329}, /* 0328 */ - {0x032A,0x032A,0x032A}, {0x032B,0x032B,0x032B}, /* 032A */ - {0x032C,0x032C,0x032C}, {0x032D,0x032D,0x032D}, /* 032C */ - {0x032E,0x032E,0x032E}, {0x032F,0x032F,0x032F}, /* 032E */ - {0x0330,0x0330,0x0330}, {0x0331,0x0331,0x0331}, /* 0330 */ - {0x0332,0x0332,0x0332}, {0x0333,0x0333,0x0333}, /* 0332 */ - {0x0334,0x0334,0x0334}, {0x0335,0x0335,0x0335}, /* 0334 */ - {0x0336,0x0336,0x0336}, {0x0337,0x0337,0x0337}, /* 0336 */ - {0x0338,0x0338,0x0338}, {0x0339,0x0339,0x0339}, /* 0338 */ - {0x033A,0x033A,0x033A}, {0x033B,0x033B,0x033B}, /* 033A */ - {0x033C,0x033C,0x033C}, {0x033D,0x033D,0x033D}, /* 033C */ - {0x033E,0x033E,0x033E}, {0x033F,0x033F,0x033F}, /* 033E */ - {0x0340,0x0340,0x0340}, {0x0341,0x0341,0x0341}, /* 0340 */ - {0x0342,0x0342,0x0342}, {0x0343,0x0343,0x0343}, /* 0342 */ - {0x0344,0x0344,0x0344}, {0x0399,0x0345,0x0399}, /* 0344 */ - {0x0346,0x0346,0x0346}, {0x0347,0x0347,0x0347}, /* 0346 */ - {0x0348,0x0348,0x0348}, {0x0349,0x0349,0x0349}, /* 0348 */ - {0x034A,0x034A,0x034A}, {0x034B,0x034B,0x034B}, /* 034A */ - {0x034C,0x034C,0x034C}, {0x034D,0x034D,0x034D}, /* 034C */ - {0x034E,0x034E,0x034E}, {0x034F,0x034F,0x034F}, /* 034E */ - {0x0350,0x0350,0x0350}, {0x0351,0x0351,0x0351}, /* 0350 */ - {0x0352,0x0352,0x0352}, {0x0353,0x0353,0x0353}, /* 0352 */ - {0x0354,0x0354,0x0354}, {0x0355,0x0355,0x0355}, /* 0354 */ - {0x0356,0x0356,0x0356}, {0x0357,0x0357,0x0357}, /* 0356 */ - {0x0358,0x0358,0x0358}, {0x0359,0x0359,0x0359}, /* 0358 */ - {0x035A,0x035A,0x035A}, {0x035B,0x035B,0x035B}, /* 035A */ - {0x035C,0x035C,0x035C}, {0x035D,0x035D,0x035D}, /* 035C */ - {0x035E,0x035E,0x035E}, {0x035F,0x035F,0x035F}, /* 035E */ - {0x0360,0x0360,0x0360}, {0x0361,0x0361,0x0361}, /* 0360 */ - {0x0362,0x0362,0x0362}, {0x0363,0x0363,0x0363}, /* 0362 */ - {0x0364,0x0364,0x0364}, {0x0365,0x0365,0x0365}, /* 0364 */ - {0x0366,0x0366,0x0366}, {0x0367,0x0367,0x0367}, /* 0366 */ - {0x0368,0x0368,0x0368}, {0x0369,0x0369,0x0369}, /* 0368 */ - {0x036A,0x036A,0x036A}, {0x036B,0x036B,0x036B}, /* 036A */ - {0x036C,0x036C,0x036C}, {0x036D,0x036D,0x036D}, /* 036C */ - {0x036E,0x036E,0x036E}, {0x036F,0x036F,0x036F}, /* 036E */ - {0x0370,0x0371,0x0370}, {0x0370,0x0371,0x0370}, /* 0370 */ - {0x0372,0x0373,0x0372}, {0x0372,0x0373,0x0372}, /* 0372 */ - {0x0374,0x0374,0x0374}, {0x0375,0x0375,0x0375}, /* 0374 */ - {0x0376,0x0377,0x0376}, {0x0376,0x0377,0x0376}, /* 0376 */ - {0x0378,0x0378,0x0378}, {0x0379,0x0379,0x0379}, /* 0378 */ - {0x037A,0x037A,0x037A}, {0x03FD,0x037B,0x03FD}, /* 037A */ - {0x03FE,0x037C,0x03FE}, {0x03FF,0x037D,0x03FF}, /* 037C */ - {0x037E,0x037E,0x037E}, {0x037F,0x037F,0x037F}, /* 037E */ - {0x0380,0x0380,0x0380}, {0x0381,0x0381,0x0381}, /* 0380 */ - {0x0382,0x0382,0x0382}, {0x0383,0x0383,0x0383}, /* 0382 */ - {0x0384,0x0384,0x0384}, {0x0385,0x0385,0x0385}, /* 0384 */ - {0x0386,0x03AC,0x0391}, {0x0387,0x0387,0x0387}, /* 0386 */ - {0x0388,0x03AD,0x0395}, {0x0389,0x03AE,0x0397}, /* 0388 */ - {0x038A,0x03AF,0x0399}, {0x038B,0x038B,0x038B}, /* 038A */ - {0x038C,0x03CC,0x039F}, {0x038D,0x038D,0x038D}, /* 038C */ - {0x038E,0x03CD,0x03A5}, {0x038F,0x03CE,0x03A9}, /* 038E */ - {0x0390,0x0390,0x0399}, {0x0391,0x03B1,0x0391}, /* 0390 */ - {0x0392,0x03B2,0x0392}, {0x0393,0x03B3,0x0393}, /* 0392 */ - {0x0394,0x03B4,0x0394}, {0x0395,0x03B5,0x0395}, /* 0394 */ - {0x0396,0x03B6,0x0396}, {0x0397,0x03B7,0x0397}, /* 0396 */ - {0x0398,0x03B8,0x0398}, {0x0399,0x03B9,0x0399}, /* 0398 */ - {0x039A,0x03BA,0x039A}, {0x039B,0x03BB,0x039B}, /* 039A */ - {0x039C,0x03BC,0x039C}, {0x039D,0x03BD,0x039D}, /* 039C */ - {0x039E,0x03BE,0x039E}, {0x039F,0x03BF,0x039F}, /* 039E */ - {0x03A0,0x03C0,0x03A0}, {0x03A1,0x03C1,0x03A1}, /* 03A0 */ - {0x03A2,0x03A2,0x03A2}, {0x03A3,0x03C3,0x03A3}, /* 03A2 */ - {0x03A4,0x03C4,0x03A4}, {0x03A5,0x03C5,0x03A5}, /* 03A4 */ - {0x03A6,0x03C6,0x03A6}, {0x03A7,0x03C7,0x03A7}, /* 03A6 */ - {0x03A8,0x03C8,0x03A8}, {0x03A9,0x03C9,0x03A9}, /* 03A8 */ - {0x03AA,0x03CA,0x0399}, {0x03AB,0x03CB,0x03A5}, /* 03AA */ - {0x0386,0x03AC,0x0391}, {0x0388,0x03AD,0x0395}, /* 03AC */ - {0x0389,0x03AE,0x0397}, {0x038A,0x03AF,0x0399}, /* 03AE */ - {0x03B0,0x03B0,0x03A5}, {0x0391,0x03B1,0x0391}, /* 03B0 */ - {0x0392,0x03B2,0x0392}, {0x0393,0x03B3,0x0393}, /* 03B2 */ - {0x0394,0x03B4,0x0394}, {0x0395,0x03B5,0x0395}, /* 03B4 */ - {0x0396,0x03B6,0x0396}, {0x0397,0x03B7,0x0397}, /* 03B6 */ - {0x0398,0x03B8,0x0398}, {0x0399,0x03B9,0x0399}, /* 03B8 */ - {0x039A,0x03BA,0x039A}, {0x039B,0x03BB,0x039B}, /* 03BA */ - {0x039C,0x03BC,0x039C}, {0x039D,0x03BD,0x039D}, /* 03BC */ - {0x039E,0x03BE,0x039E}, {0x039F,0x03BF,0x039F}, /* 03BE */ - {0x03A0,0x03C0,0x03A0}, {0x03A1,0x03C1,0x03A1}, /* 03C0 */ - {0x03A3,0x03C2,0x03A3}, {0x03A3,0x03C3,0x03A3}, /* 03C2 */ - {0x03A4,0x03C4,0x03A4}, {0x03A5,0x03C5,0x03A5}, /* 03C4 */ - {0x03A6,0x03C6,0x03A6}, {0x03A7,0x03C7,0x03A7}, /* 03C6 */ - {0x03A8,0x03C8,0x03A8}, {0x03A9,0x03C9,0x03A9}, /* 03C8 */ - {0x03AA,0x03CA,0x0399}, {0x03AB,0x03CB,0x03A5}, /* 03CA */ - {0x038C,0x03CC,0x039F}, {0x038E,0x03CD,0x03A5}, /* 03CC */ - {0x038F,0x03CE,0x03A9}, {0x03CF,0x03D7,0x03CF}, /* 03CE */ - {0x0392,0x03D0,0x0392}, {0x0398,0x03D1,0x0398}, /* 03D0 */ - {0x03D2,0x03D2,0x03D2}, {0x03D3,0x03D3,0x03D2}, /* 03D2 */ - {0x03D4,0x03D4,0x03D2}, {0x03A6,0x03D5,0x03A6}, /* 03D4 */ - {0x03A0,0x03D6,0x03A0}, {0x03CF,0x03D7,0x03CF}, /* 03D6 */ - {0x03D8,0x03D9,0x03D8}, {0x03D8,0x03D9,0x03D8}, /* 03D8 */ - {0x03DA,0x03DB,0x03DA}, {0x03DA,0x03DB,0x03DA}, /* 03DA */ - {0x03DC,0x03DD,0x03DC}, {0x03DC,0x03DD,0x03DC}, /* 03DC */ - {0x03DE,0x03DF,0x03DE}, {0x03DE,0x03DF,0x03DE}, /* 03DE */ - {0x03E0,0x03E1,0x03E0}, {0x03E0,0x03E1,0x03E0}, /* 03E0 */ - {0x03E2,0x03E3,0x03E2}, {0x03E2,0x03E3,0x03E2}, /* 03E2 */ - {0x03E4,0x03E5,0x03E4}, {0x03E4,0x03E5,0x03E4}, /* 03E4 */ - {0x03E6,0x03E7,0x03E6}, {0x03E6,0x03E7,0x03E6}, /* 03E6 */ - {0x03E8,0x03E9,0x03E8}, {0x03E8,0x03E9,0x03E8}, /* 03E8 */ - {0x03EA,0x03EB,0x03EA}, {0x03EA,0x03EB,0x03EA}, /* 03EA */ - {0x03EC,0x03ED,0x03EC}, {0x03EC,0x03ED,0x03EC}, /* 03EC */ - {0x03EE,0x03EF,0x03EE}, {0x03EE,0x03EF,0x03EE}, /* 03EE */ - {0x039A,0x03F0,0x039A}, {0x03A1,0x03F1,0x03A1}, /* 03F0 */ - {0x03F9,0x03F2,0x03F9}, {0x03F3,0x03F3,0x03F3}, /* 03F2 */ - {0x03F4,0x03B8,0x03F4}, {0x0395,0x03F5,0x0395}, /* 03F4 */ - {0x03F6,0x03F6,0x03F6}, {0x03F7,0x03F8,0x03F7}, /* 03F6 */ - {0x03F7,0x03F8,0x03F7}, {0x03F9,0x03F2,0x03F9}, /* 03F8 */ - {0x03FA,0x03FB,0x03FA}, {0x03FA,0x03FB,0x03FA}, /* 03FA */ - {0x03FC,0x03FC,0x03FC}, {0x03FD,0x037B,0x03FD}, /* 03FC */ - {0x03FE,0x037C,0x03FE}, {0x03FF,0x037D,0x03FF} /* 03FE */ -}; - -static MY_UNICASE_CHARACTER u520p04[]={ - {0x0400,0x0450,0x0415}, {0x0401,0x0451,0x0415}, /* 0400 */ - {0x0402,0x0452,0x0402}, {0x0403,0x0453,0x0413}, /* 0402 */ - {0x0404,0x0454,0x0404}, {0x0405,0x0455,0x0405}, /* 0404 */ - {0x0406,0x0456,0x0406}, {0x0407,0x0457,0x0406}, /* 0406 */ - {0x0408,0x0458,0x0408}, {0x0409,0x0459,0x0409}, /* 0408 */ - {0x040A,0x045A,0x040A}, {0x040B,0x045B,0x040B}, /* 040A */ - {0x040C,0x045C,0x041A}, {0x040D,0x045D,0x0418}, /* 040C */ - {0x040E,0x045E,0x0423}, {0x040F,0x045F,0x040F}, /* 040E */ - {0x0410,0x0430,0x0410}, {0x0411,0x0431,0x0411}, /* 0410 */ - {0x0412,0x0432,0x0412}, {0x0413,0x0433,0x0413}, /* 0412 */ - {0x0414,0x0434,0x0414}, {0x0415,0x0435,0x0415}, /* 0414 */ - {0x0416,0x0436,0x0416}, {0x0417,0x0437,0x0417}, /* 0416 */ - {0x0418,0x0438,0x0418}, {0x0419,0x0439,0x0419}, /* 0418 */ - {0x041A,0x043A,0x041A}, {0x041B,0x043B,0x041B}, /* 041A */ - {0x041C,0x043C,0x041C}, {0x041D,0x043D,0x041D}, /* 041C */ - {0x041E,0x043E,0x041E}, {0x041F,0x043F,0x041F}, /* 041E */ - {0x0420,0x0440,0x0420}, {0x0421,0x0441,0x0421}, /* 0420 */ - {0x0422,0x0442,0x0422}, {0x0423,0x0443,0x0423}, /* 0422 */ - {0x0424,0x0444,0x0424}, {0x0425,0x0445,0x0425}, /* 0424 */ - {0x0426,0x0446,0x0426}, {0x0427,0x0447,0x0427}, /* 0426 */ - {0x0428,0x0448,0x0428}, {0x0429,0x0449,0x0429}, /* 0428 */ - {0x042A,0x044A,0x042A}, {0x042B,0x044B,0x042B}, /* 042A */ - {0x042C,0x044C,0x042C}, {0x042D,0x044D,0x042D}, /* 042C */ - {0x042E,0x044E,0x042E}, {0x042F,0x044F,0x042F}, /* 042E */ - {0x0410,0x0430,0x0410}, {0x0411,0x0431,0x0411}, /* 0430 */ - {0x0412,0x0432,0x0412}, {0x0413,0x0433,0x0413}, /* 0432 */ - {0x0414,0x0434,0x0414}, {0x0415,0x0435,0x0415}, /* 0434 */ - {0x0416,0x0436,0x0416}, {0x0417,0x0437,0x0417}, /* 0436 */ - {0x0418,0x0438,0x0418}, {0x0419,0x0439,0x0419}, /* 0438 */ - {0x041A,0x043A,0x041A}, {0x041B,0x043B,0x041B}, /* 043A */ - {0x041C,0x043C,0x041C}, {0x041D,0x043D,0x041D}, /* 043C */ - {0x041E,0x043E,0x041E}, {0x041F,0x043F,0x041F}, /* 043E */ - {0x0420,0x0440,0x0420}, {0x0421,0x0441,0x0421}, /* 0440 */ - {0x0422,0x0442,0x0422}, {0x0423,0x0443,0x0423}, /* 0442 */ - {0x0424,0x0444,0x0424}, {0x0425,0x0445,0x0425}, /* 0444 */ - {0x0426,0x0446,0x0426}, {0x0427,0x0447,0x0427}, /* 0446 */ - {0x0428,0x0448,0x0428}, {0x0429,0x0449,0x0429}, /* 0448 */ - {0x042A,0x044A,0x042A}, {0x042B,0x044B,0x042B}, /* 044A */ - {0x042C,0x044C,0x042C}, {0x042D,0x044D,0x042D}, /* 044C */ - {0x042E,0x044E,0x042E}, {0x042F,0x044F,0x042F}, /* 044E */ - {0x0400,0x0450,0x0415}, {0x0401,0x0451,0x0415}, /* 0450 */ - {0x0402,0x0452,0x0402}, {0x0403,0x0453,0x0413}, /* 0452 */ - {0x0404,0x0454,0x0404}, {0x0405,0x0455,0x0405}, /* 0454 */ - {0x0406,0x0456,0x0406}, {0x0407,0x0457,0x0406}, /* 0456 */ - {0x0408,0x0458,0x0408}, {0x0409,0x0459,0x0409}, /* 0458 */ - {0x040A,0x045A,0x040A}, {0x040B,0x045B,0x040B}, /* 045A */ - {0x040C,0x045C,0x041A}, {0x040D,0x045D,0x0418}, /* 045C */ - {0x040E,0x045E,0x0423}, {0x040F,0x045F,0x040F}, /* 045E */ - {0x0460,0x0461,0x0460}, {0x0460,0x0461,0x0460}, /* 0460 */ - {0x0462,0x0463,0x0462}, {0x0462,0x0463,0x0462}, /* 0462 */ - {0x0464,0x0465,0x0464}, {0x0464,0x0465,0x0464}, /* 0464 */ - {0x0466,0x0467,0x0466}, {0x0466,0x0467,0x0466}, /* 0466 */ - {0x0468,0x0469,0x0468}, {0x0468,0x0469,0x0468}, /* 0468 */ - {0x046A,0x046B,0x046A}, {0x046A,0x046B,0x046A}, /* 046A */ - {0x046C,0x046D,0x046C}, {0x046C,0x046D,0x046C}, /* 046C */ - {0x046E,0x046F,0x046E}, {0x046E,0x046F,0x046E}, /* 046E */ - {0x0470,0x0471,0x0470}, {0x0470,0x0471,0x0470}, /* 0470 */ - {0x0472,0x0473,0x0472}, {0x0472,0x0473,0x0472}, /* 0472 */ - {0x0474,0x0475,0x0474}, {0x0474,0x0475,0x0474}, /* 0474 */ - {0x0476,0x0477,0x0474}, {0x0476,0x0477,0x0474}, /* 0476 */ - {0x0478,0x0479,0x0478}, {0x0478,0x0479,0x0478}, /* 0478 */ - {0x047A,0x047B,0x047A}, {0x047A,0x047B,0x047A}, /* 047A */ - {0x047C,0x047D,0x047C}, {0x047C,0x047D,0x047C}, /* 047C */ - {0x047E,0x047F,0x047E}, {0x047E,0x047F,0x047E}, /* 047E */ - {0x0480,0x0481,0x0480}, {0x0480,0x0481,0x0480}, /* 0480 */ - {0x0482,0x0482,0x0482}, {0x0483,0x0483,0x0483}, /* 0482 */ - {0x0484,0x0484,0x0484}, {0x0485,0x0485,0x0485}, /* 0484 */ - {0x0486,0x0486,0x0486}, {0x0487,0x0487,0x0487}, /* 0486 */ - {0x0488,0x0488,0x0488}, {0x0489,0x0489,0x0489}, /* 0488 */ - {0x048A,0x048B,0x048A}, {0x048A,0x048B,0x048A}, /* 048A */ - {0x048C,0x048D,0x048C}, {0x048C,0x048D,0x048C}, /* 048C */ - {0x048E,0x048F,0x048E}, {0x048E,0x048F,0x048E}, /* 048E */ - {0x0490,0x0491,0x0490}, {0x0490,0x0491,0x0490}, /* 0490 */ - {0x0492,0x0493,0x0492}, {0x0492,0x0493,0x0492}, /* 0492 */ - {0x0494,0x0495,0x0494}, {0x0494,0x0495,0x0494}, /* 0494 */ - {0x0496,0x0497,0x0496}, {0x0496,0x0497,0x0496}, /* 0496 */ - {0x0498,0x0499,0x0498}, {0x0498,0x0499,0x0498}, /* 0498 */ - {0x049A,0x049B,0x049A}, {0x049A,0x049B,0x049A}, /* 049A */ - {0x049C,0x049D,0x049C}, {0x049C,0x049D,0x049C}, /* 049C */ - {0x049E,0x049F,0x049E}, {0x049E,0x049F,0x049E}, /* 049E */ - {0x04A0,0x04A1,0x04A0}, {0x04A0,0x04A1,0x04A0}, /* 04A0 */ - {0x04A2,0x04A3,0x04A2}, {0x04A2,0x04A3,0x04A2}, /* 04A2 */ - {0x04A4,0x04A5,0x04A4}, {0x04A4,0x04A5,0x04A4}, /* 04A4 */ - {0x04A6,0x04A7,0x04A6}, {0x04A6,0x04A7,0x04A6}, /* 04A6 */ - {0x04A8,0x04A9,0x04A8}, {0x04A8,0x04A9,0x04A8}, /* 04A8 */ - {0x04AA,0x04AB,0x04AA}, {0x04AA,0x04AB,0x04AA}, /* 04AA */ - {0x04AC,0x04AD,0x04AC}, {0x04AC,0x04AD,0x04AC}, /* 04AC */ - {0x04AE,0x04AF,0x04AE}, {0x04AE,0x04AF,0x04AE}, /* 04AE */ - {0x04B0,0x04B1,0x04B0}, {0x04B0,0x04B1,0x04B0}, /* 04B0 */ - {0x04B2,0x04B3,0x04B2}, {0x04B2,0x04B3,0x04B2}, /* 04B2 */ - {0x04B4,0x04B5,0x04B4}, {0x04B4,0x04B5,0x04B4}, /* 04B4 */ - {0x04B6,0x04B7,0x04B6}, {0x04B6,0x04B7,0x04B6}, /* 04B6 */ - {0x04B8,0x04B9,0x04B8}, {0x04B8,0x04B9,0x04B8}, /* 04B8 */ - {0x04BA,0x04BB,0x04BA}, {0x04BA,0x04BB,0x04BA}, /* 04BA */ - {0x04BC,0x04BD,0x04BC}, {0x04BC,0x04BD,0x04BC}, /* 04BC */ - {0x04BE,0x04BF,0x04BE}, {0x04BE,0x04BF,0x04BE}, /* 04BE */ - {0x04C0,0x04CF,0x04C0}, {0x04C1,0x04C2,0x0416}, /* 04C0 */ - {0x04C1,0x04C2,0x0416}, {0x04C3,0x04C4,0x04C3}, /* 04C2 */ - {0x04C3,0x04C4,0x04C3}, {0x04C5,0x04C6,0x04C5}, /* 04C4 */ - {0x04C5,0x04C6,0x04C5}, {0x04C7,0x04C8,0x04C7}, /* 04C6 */ - {0x04C7,0x04C8,0x04C7}, {0x04C9,0x04CA,0x04C9}, /* 04C8 */ - {0x04C9,0x04CA,0x04C9}, {0x04CB,0x04CC,0x04CB}, /* 04CA */ - {0x04CB,0x04CC,0x04CB}, {0x04CD,0x04CE,0x04CD}, /* 04CC */ - {0x04CD,0x04CE,0x04CD}, {0x04C0,0x04CF,0x04C0}, /* 04CE */ - {0x04D0,0x04D1,0x0410}, {0x04D0,0x04D1,0x0410}, /* 04D0 */ - {0x04D2,0x04D3,0x0410}, {0x04D2,0x04D3,0x0410}, /* 04D2 */ - {0x04D4,0x04D5,0x04D4}, {0x04D4,0x04D5,0x04D4}, /* 04D4 */ - {0x04D6,0x04D7,0x0415}, {0x04D6,0x04D7,0x0415}, /* 04D6 */ - {0x04D8,0x04D9,0x04D8}, {0x04D8,0x04D9,0x04D8}, /* 04D8 */ - {0x04DA,0x04DB,0x04D8}, {0x04DA,0x04DB,0x04D8}, /* 04DA */ - {0x04DC,0x04DD,0x0416}, {0x04DC,0x04DD,0x0416}, /* 04DC */ - {0x04DE,0x04DF,0x0417}, {0x04DE,0x04DF,0x0417}, /* 04DE */ - {0x04E0,0x04E1,0x04E0}, {0x04E0,0x04E1,0x04E0}, /* 04E0 */ - {0x04E2,0x04E3,0x0418}, {0x04E2,0x04E3,0x0418}, /* 04E2 */ - {0x04E4,0x04E5,0x0418}, {0x04E4,0x04E5,0x0418}, /* 04E4 */ - {0x04E6,0x04E7,0x041E}, {0x04E6,0x04E7,0x041E}, /* 04E6 */ - {0x04E8,0x04E9,0x04E8}, {0x04E8,0x04E9,0x04E8}, /* 04E8 */ - {0x04EA,0x04EB,0x04E8}, {0x04EA,0x04EB,0x04E8}, /* 04EA */ - {0x04EC,0x04ED,0x042D}, {0x04EC,0x04ED,0x042D}, /* 04EC */ - {0x04EE,0x04EF,0x0423}, {0x04EE,0x04EF,0x0423}, /* 04EE */ - {0x04F0,0x04F1,0x0423}, {0x04F0,0x04F1,0x0423}, /* 04F0 */ - {0x04F2,0x04F3,0x0423}, {0x04F2,0x04F3,0x0423}, /* 04F2 */ - {0x04F4,0x04F5,0x0427}, {0x04F4,0x04F5,0x0427}, /* 04F4 */ - {0x04F6,0x04F7,0x04F6}, {0x04F6,0x04F7,0x04F6}, /* 04F6 */ - {0x04F8,0x04F9,0x042B}, {0x04F8,0x04F9,0x042B}, /* 04F8 */ - {0x04FA,0x04FB,0x04FA}, {0x04FA,0x04FB,0x04FA}, /* 04FA */ - {0x04FC,0x04FD,0x04FC}, {0x04FC,0x04FD,0x04FC}, /* 04FC */ - {0x04FE,0x04FF,0x04FE}, {0x04FE,0x04FF,0x04FE} /* 04FE */ -}; - -static MY_UNICASE_CHARACTER u520p05[]={ - {0x0500,0x0501,0x0500}, {0x0500,0x0501,0x0500}, /* 0500 */ - {0x0502,0x0503,0x0502}, {0x0502,0x0503,0x0502}, /* 0502 */ - {0x0504,0x0505,0x0504}, {0x0504,0x0505,0x0504}, /* 0504 */ - {0x0506,0x0507,0x0506}, {0x0506,0x0507,0x0506}, /* 0506 */ - {0x0508,0x0509,0x0508}, {0x0508,0x0509,0x0508}, /* 0508 */ - {0x050A,0x050B,0x050A}, {0x050A,0x050B,0x050A}, /* 050A */ - {0x050C,0x050D,0x050C}, {0x050C,0x050D,0x050C}, /* 050C */ - {0x050E,0x050F,0x050E}, {0x050E,0x050F,0x050E}, /* 050E */ - {0x0510,0x0511,0x0510}, {0x0510,0x0511,0x0510}, /* 0510 */ - {0x0512,0x0513,0x0512}, {0x0512,0x0513,0x0512}, /* 0512 */ - {0x0514,0x0515,0x0514}, {0x0514,0x0515,0x0514}, /* 0514 */ - {0x0516,0x0517,0x0516}, {0x0516,0x0517,0x0516}, /* 0516 */ - {0x0518,0x0519,0x0518}, {0x0518,0x0519,0x0518}, /* 0518 */ - {0x051A,0x051B,0x051A}, {0x051A,0x051B,0x051A}, /* 051A */ - {0x051C,0x051D,0x051C}, {0x051C,0x051D,0x051C}, /* 051C */ - {0x051E,0x051F,0x051E}, {0x051E,0x051F,0x051E}, /* 051E */ - {0x0520,0x0521,0x0520}, {0x0520,0x0521,0x0520}, /* 0520 */ - {0x0522,0x0523,0x0522}, {0x0522,0x0523,0x0522}, /* 0522 */ - {0x0524,0x0525,0x0524}, {0x0524,0x0525,0x0524}, /* 0524 */ - {0x0526,0x0526,0x0526}, {0x0527,0x0527,0x0527}, /* 0526 */ - {0x0528,0x0528,0x0528}, {0x0529,0x0529,0x0529}, /* 0528 */ - {0x052A,0x052A,0x052A}, {0x052B,0x052B,0x052B}, /* 052A */ - {0x052C,0x052C,0x052C}, {0x052D,0x052D,0x052D}, /* 052C */ - {0x052E,0x052E,0x052E}, {0x052F,0x052F,0x052F}, /* 052E */ - {0x0530,0x0530,0x0530}, {0x0531,0x0561,0x0531}, /* 0530 */ - {0x0532,0x0562,0x0532}, {0x0533,0x0563,0x0533}, /* 0532 */ - {0x0534,0x0564,0x0534}, {0x0535,0x0565,0x0535}, /* 0534 */ - {0x0536,0x0566,0x0536}, {0x0537,0x0567,0x0537}, /* 0536 */ - {0x0538,0x0568,0x0538}, {0x0539,0x0569,0x0539}, /* 0538 */ - {0x053A,0x056A,0x053A}, {0x053B,0x056B,0x053B}, /* 053A */ - {0x053C,0x056C,0x053C}, {0x053D,0x056D,0x053D}, /* 053C */ - {0x053E,0x056E,0x053E}, {0x053F,0x056F,0x053F}, /* 053E */ - {0x0540,0x0570,0x0540}, {0x0541,0x0571,0x0541}, /* 0540 */ - {0x0542,0x0572,0x0542}, {0x0543,0x0573,0x0543}, /* 0542 */ - {0x0544,0x0574,0x0544}, {0x0545,0x0575,0x0545}, /* 0544 */ - {0x0546,0x0576,0x0546}, {0x0547,0x0577,0x0547}, /* 0546 */ - {0x0548,0x0578,0x0548}, {0x0549,0x0579,0x0549}, /* 0548 */ - {0x054A,0x057A,0x054A}, {0x054B,0x057B,0x054B}, /* 054A */ - {0x054C,0x057C,0x054C}, {0x054D,0x057D,0x054D}, /* 054C */ - {0x054E,0x057E,0x054E}, {0x054F,0x057F,0x054F}, /* 054E */ - {0x0550,0x0580,0x0550}, {0x0551,0x0581,0x0551}, /* 0550 */ - {0x0552,0x0582,0x0552}, {0x0553,0x0583,0x0553}, /* 0552 */ - {0x0554,0x0584,0x0554}, {0x0555,0x0585,0x0555}, /* 0554 */ - {0x0556,0x0586,0x0556}, {0x0557,0x0557,0x0557}, /* 0556 */ - {0x0558,0x0558,0x0558}, {0x0559,0x0559,0x0559}, /* 0558 */ - {0x055A,0x055A,0x055A}, {0x055B,0x055B,0x055B}, /* 055A */ - {0x055C,0x055C,0x055C}, {0x055D,0x055D,0x055D}, /* 055C */ - {0x055E,0x055E,0x055E}, {0x055F,0x055F,0x055F}, /* 055E */ - {0x0560,0x0560,0x0560}, {0x0531,0x0561,0x0531}, /* 0560 */ - {0x0532,0x0562,0x0532}, {0x0533,0x0563,0x0533}, /* 0562 */ - {0x0534,0x0564,0x0534}, {0x0535,0x0565,0x0535}, /* 0564 */ - {0x0536,0x0566,0x0536}, {0x0537,0x0567,0x0537}, /* 0566 */ - {0x0538,0x0568,0x0538}, {0x0539,0x0569,0x0539}, /* 0568 */ - {0x053A,0x056A,0x053A}, {0x053B,0x056B,0x053B}, /* 056A */ - {0x053C,0x056C,0x053C}, {0x053D,0x056D,0x053D}, /* 056C */ - {0x053E,0x056E,0x053E}, {0x053F,0x056F,0x053F}, /* 056E */ - {0x0540,0x0570,0x0540}, {0x0541,0x0571,0x0541}, /* 0570 */ - {0x0542,0x0572,0x0542}, {0x0543,0x0573,0x0543}, /* 0572 */ - {0x0544,0x0574,0x0544}, {0x0545,0x0575,0x0545}, /* 0574 */ - {0x0546,0x0576,0x0546}, {0x0547,0x0577,0x0547}, /* 0576 */ - {0x0548,0x0578,0x0548}, {0x0549,0x0579,0x0549}, /* 0578 */ - {0x054A,0x057A,0x054A}, {0x054B,0x057B,0x054B}, /* 057A */ - {0x054C,0x057C,0x054C}, {0x054D,0x057D,0x054D}, /* 057C */ - {0x054E,0x057E,0x054E}, {0x054F,0x057F,0x054F}, /* 057E */ - {0x0550,0x0580,0x0550}, {0x0551,0x0581,0x0551}, /* 0580 */ - {0x0552,0x0582,0x0552}, {0x0553,0x0583,0x0553}, /* 0582 */ - {0x0554,0x0584,0x0554}, {0x0555,0x0585,0x0555}, /* 0584 */ - {0x0556,0x0586,0x0556}, {0x0587,0x0587,0x0587}, /* 0586 */ - {0x0588,0x0588,0x0588}, {0x0589,0x0589,0x0589}, /* 0588 */ - {0x058A,0x058A,0x058A}, {0x058B,0x058B,0x058B}, /* 058A */ - {0x058C,0x058C,0x058C}, {0x058D,0x058D,0x058D}, /* 058C */ - {0x058E,0x058E,0x058E}, {0x058F,0x058F,0x058F}, /* 058E */ - {0x0590,0x0590,0x0590}, {0x0591,0x0591,0x0591}, /* 0590 */ - {0x0592,0x0592,0x0592}, {0x0593,0x0593,0x0593}, /* 0592 */ - {0x0594,0x0594,0x0594}, {0x0595,0x0595,0x0595}, /* 0594 */ - {0x0596,0x0596,0x0596}, {0x0597,0x0597,0x0597}, /* 0596 */ - {0x0598,0x0598,0x0598}, {0x0599,0x0599,0x0599}, /* 0598 */ - {0x059A,0x059A,0x059A}, {0x059B,0x059B,0x059B}, /* 059A */ - {0x059C,0x059C,0x059C}, {0x059D,0x059D,0x059D}, /* 059C */ - {0x059E,0x059E,0x059E}, {0x059F,0x059F,0x059F}, /* 059E */ - {0x05A0,0x05A0,0x05A0}, {0x05A1,0x05A1,0x05A1}, /* 05A0 */ - {0x05A2,0x05A2,0x05A2}, {0x05A3,0x05A3,0x05A3}, /* 05A2 */ - {0x05A4,0x05A4,0x05A4}, {0x05A5,0x05A5,0x05A5}, /* 05A4 */ - {0x05A6,0x05A6,0x05A6}, {0x05A7,0x05A7,0x05A7}, /* 05A6 */ - {0x05A8,0x05A8,0x05A8}, {0x05A9,0x05A9,0x05A9}, /* 05A8 */ - {0x05AA,0x05AA,0x05AA}, {0x05AB,0x05AB,0x05AB}, /* 05AA */ - {0x05AC,0x05AC,0x05AC}, {0x05AD,0x05AD,0x05AD}, /* 05AC */ - {0x05AE,0x05AE,0x05AE}, {0x05AF,0x05AF,0x05AF}, /* 05AE */ - {0x05B0,0x05B0,0x05B0}, {0x05B1,0x05B1,0x05B1}, /* 05B0 */ - {0x05B2,0x05B2,0x05B2}, {0x05B3,0x05B3,0x05B3}, /* 05B2 */ - {0x05B4,0x05B4,0x05B4}, {0x05B5,0x05B5,0x05B5}, /* 05B4 */ - {0x05B6,0x05B6,0x05B6}, {0x05B7,0x05B7,0x05B7}, /* 05B6 */ - {0x05B8,0x05B8,0x05B8}, {0x05B9,0x05B9,0x05B9}, /* 05B8 */ - {0x05BA,0x05BA,0x05BA}, {0x05BB,0x05BB,0x05BB}, /* 05BA */ - {0x05BC,0x05BC,0x05BC}, {0x05BD,0x05BD,0x05BD}, /* 05BC */ - {0x05BE,0x05BE,0x05BE}, {0x05BF,0x05BF,0x05BF}, /* 05BE */ - {0x05C0,0x05C0,0x05C0}, {0x05C1,0x05C1,0x05C1}, /* 05C0 */ - {0x05C2,0x05C2,0x05C2}, {0x05C3,0x05C3,0x05C3}, /* 05C2 */ - {0x05C4,0x05C4,0x05C4}, {0x05C5,0x05C5,0x05C5}, /* 05C4 */ - {0x05C6,0x05C6,0x05C6}, {0x05C7,0x05C7,0x05C7}, /* 05C6 */ - {0x05C8,0x05C8,0x05C8}, {0x05C9,0x05C9,0x05C9}, /* 05C8 */ - {0x05CA,0x05CA,0x05CA}, {0x05CB,0x05CB,0x05CB}, /* 05CA */ - {0x05CC,0x05CC,0x05CC}, {0x05CD,0x05CD,0x05CD}, /* 05CC */ - {0x05CE,0x05CE,0x05CE}, {0x05CF,0x05CF,0x05CF}, /* 05CE */ - {0x05D0,0x05D0,0x05D0}, {0x05D1,0x05D1,0x05D1}, /* 05D0 */ - {0x05D2,0x05D2,0x05D2}, {0x05D3,0x05D3,0x05D3}, /* 05D2 */ - {0x05D4,0x05D4,0x05D4}, {0x05D5,0x05D5,0x05D5}, /* 05D4 */ - {0x05D6,0x05D6,0x05D6}, {0x05D7,0x05D7,0x05D7}, /* 05D6 */ - {0x05D8,0x05D8,0x05D8}, {0x05D9,0x05D9,0x05D9}, /* 05D8 */ - {0x05DA,0x05DA,0x05DA}, {0x05DB,0x05DB,0x05DB}, /* 05DA */ - {0x05DC,0x05DC,0x05DC}, {0x05DD,0x05DD,0x05DD}, /* 05DC */ - {0x05DE,0x05DE,0x05DE}, {0x05DF,0x05DF,0x05DF}, /* 05DE */ - {0x05E0,0x05E0,0x05E0}, {0x05E1,0x05E1,0x05E1}, /* 05E0 */ - {0x05E2,0x05E2,0x05E2}, {0x05E3,0x05E3,0x05E3}, /* 05E2 */ - {0x05E4,0x05E4,0x05E4}, {0x05E5,0x05E5,0x05E5}, /* 05E4 */ - {0x05E6,0x05E6,0x05E6}, {0x05E7,0x05E7,0x05E7}, /* 05E6 */ - {0x05E8,0x05E8,0x05E8}, {0x05E9,0x05E9,0x05E9}, /* 05E8 */ - {0x05EA,0x05EA,0x05EA}, {0x05EB,0x05EB,0x05EB}, /* 05EA */ - {0x05EC,0x05EC,0x05EC}, {0x05ED,0x05ED,0x05ED}, /* 05EC */ - {0x05EE,0x05EE,0x05EE}, {0x05EF,0x05EF,0x05EF}, /* 05EE */ - {0x05F0,0x05F0,0x05F0}, {0x05F1,0x05F1,0x05F1}, /* 05F0 */ - {0x05F2,0x05F2,0x05F2}, {0x05F3,0x05F3,0x05F3}, /* 05F2 */ - {0x05F4,0x05F4,0x05F4}, {0x05F5,0x05F5,0x05F5}, /* 05F4 */ - {0x05F6,0x05F6,0x05F6}, {0x05F7,0x05F7,0x05F7}, /* 05F6 */ - {0x05F8,0x05F8,0x05F8}, {0x05F9,0x05F9,0x05F9}, /* 05F8 */ - {0x05FA,0x05FA,0x05FA}, {0x05FB,0x05FB,0x05FB}, /* 05FA */ - {0x05FC,0x05FC,0x05FC}, {0x05FD,0x05FD,0x05FD}, /* 05FC */ - {0x05FE,0x05FE,0x05FE}, {0x05FF,0x05FF,0x05FF} /* 05FE */ -}; - -static MY_UNICASE_CHARACTER u520p10[]={ - {0x1000,0x1000,0x1000}, {0x1001,0x1001,0x1001}, /* 1000 */ - {0x1002,0x1002,0x1002}, {0x1003,0x1003,0x1003}, /* 1002 */ - {0x1004,0x1004,0x1004}, {0x1005,0x1005,0x1005}, /* 1004 */ - {0x1006,0x1006,0x1006}, {0x1007,0x1007,0x1007}, /* 1006 */ - {0x1008,0x1008,0x1008}, {0x1009,0x1009,0x1009}, /* 1008 */ - {0x100A,0x100A,0x100A}, {0x100B,0x100B,0x100B}, /* 100A */ - {0x100C,0x100C,0x100C}, {0x100D,0x100D,0x100D}, /* 100C */ - {0x100E,0x100E,0x100E}, {0x100F,0x100F,0x100F}, /* 100E */ - {0x1010,0x1010,0x1010}, {0x1011,0x1011,0x1011}, /* 1010 */ - {0x1012,0x1012,0x1012}, {0x1013,0x1013,0x1013}, /* 1012 */ - {0x1014,0x1014,0x1014}, {0x1015,0x1015,0x1015}, /* 1014 */ - {0x1016,0x1016,0x1016}, {0x1017,0x1017,0x1017}, /* 1016 */ - {0x1018,0x1018,0x1018}, {0x1019,0x1019,0x1019}, /* 1018 */ - {0x101A,0x101A,0x101A}, {0x101B,0x101B,0x101B}, /* 101A */ - {0x101C,0x101C,0x101C}, {0x101D,0x101D,0x101D}, /* 101C */ - {0x101E,0x101E,0x101E}, {0x101F,0x101F,0x101F}, /* 101E */ - {0x1020,0x1020,0x1020}, {0x1021,0x1021,0x1021}, /* 1020 */ - {0x1022,0x1022,0x1022}, {0x1023,0x1023,0x1023}, /* 1022 */ - {0x1024,0x1024,0x1024}, {0x1025,0x1025,0x1025}, /* 1024 */ - {0x1026,0x1026,0x1026}, {0x1027,0x1027,0x1027}, /* 1026 */ - {0x1028,0x1028,0x1028}, {0x1029,0x1029,0x1029}, /* 1028 */ - {0x102A,0x102A,0x102A}, {0x102B,0x102B,0x102B}, /* 102A */ - {0x102C,0x102C,0x102C}, {0x102D,0x102D,0x102D}, /* 102C */ - {0x102E,0x102E,0x102E}, {0x102F,0x102F,0x102F}, /* 102E */ - {0x1030,0x1030,0x1030}, {0x1031,0x1031,0x1031}, /* 1030 */ - {0x1032,0x1032,0x1032}, {0x1033,0x1033,0x1033}, /* 1032 */ - {0x1034,0x1034,0x1034}, {0x1035,0x1035,0x1035}, /* 1034 */ - {0x1036,0x1036,0x1036}, {0x1037,0x1037,0x1037}, /* 1036 */ - {0x1038,0x1038,0x1038}, {0x1039,0x1039,0x1039}, /* 1038 */ - {0x103A,0x103A,0x103A}, {0x103B,0x103B,0x103B}, /* 103A */ - {0x103C,0x103C,0x103C}, {0x103D,0x103D,0x103D}, /* 103C */ - {0x103E,0x103E,0x103E}, {0x103F,0x103F,0x103F}, /* 103E */ - {0x1040,0x1040,0x1040}, {0x1041,0x1041,0x1041}, /* 1040 */ - {0x1042,0x1042,0x1042}, {0x1043,0x1043,0x1043}, /* 1042 */ - {0x1044,0x1044,0x1044}, {0x1045,0x1045,0x1045}, /* 1044 */ - {0x1046,0x1046,0x1046}, {0x1047,0x1047,0x1047}, /* 1046 */ - {0x1048,0x1048,0x1048}, {0x1049,0x1049,0x1049}, /* 1048 */ - {0x104A,0x104A,0x104A}, {0x104B,0x104B,0x104B}, /* 104A */ - {0x104C,0x104C,0x104C}, {0x104D,0x104D,0x104D}, /* 104C */ - {0x104E,0x104E,0x104E}, {0x104F,0x104F,0x104F}, /* 104E */ - {0x1050,0x1050,0x1050}, {0x1051,0x1051,0x1051}, /* 1050 */ - {0x1052,0x1052,0x1052}, {0x1053,0x1053,0x1053}, /* 1052 */ - {0x1054,0x1054,0x1054}, {0x1055,0x1055,0x1055}, /* 1054 */ - {0x1056,0x1056,0x1056}, {0x1057,0x1057,0x1057}, /* 1056 */ - {0x1058,0x1058,0x1058}, {0x1059,0x1059,0x1059}, /* 1058 */ - {0x105A,0x105A,0x105A}, {0x105B,0x105B,0x105B}, /* 105A */ - {0x105C,0x105C,0x105C}, {0x105D,0x105D,0x105D}, /* 105C */ - {0x105E,0x105E,0x105E}, {0x105F,0x105F,0x105F}, /* 105E */ - {0x1060,0x1060,0x1060}, {0x1061,0x1061,0x1061}, /* 1060 */ - {0x1062,0x1062,0x1062}, {0x1063,0x1063,0x1063}, /* 1062 */ - {0x1064,0x1064,0x1064}, {0x1065,0x1065,0x1065}, /* 1064 */ - {0x1066,0x1066,0x1066}, {0x1067,0x1067,0x1067}, /* 1066 */ - {0x1068,0x1068,0x1068}, {0x1069,0x1069,0x1069}, /* 1068 */ - {0x106A,0x106A,0x106A}, {0x106B,0x106B,0x106B}, /* 106A */ - {0x106C,0x106C,0x106C}, {0x106D,0x106D,0x106D}, /* 106C */ - {0x106E,0x106E,0x106E}, {0x106F,0x106F,0x106F}, /* 106E */ - {0x1070,0x1070,0x1070}, {0x1071,0x1071,0x1071}, /* 1070 */ - {0x1072,0x1072,0x1072}, {0x1073,0x1073,0x1073}, /* 1072 */ - {0x1074,0x1074,0x1074}, {0x1075,0x1075,0x1075}, /* 1074 */ - {0x1076,0x1076,0x1076}, {0x1077,0x1077,0x1077}, /* 1076 */ - {0x1078,0x1078,0x1078}, {0x1079,0x1079,0x1079}, /* 1078 */ - {0x107A,0x107A,0x107A}, {0x107B,0x107B,0x107B}, /* 107A */ - {0x107C,0x107C,0x107C}, {0x107D,0x107D,0x107D}, /* 107C */ - {0x107E,0x107E,0x107E}, {0x107F,0x107F,0x107F}, /* 107E */ - {0x1080,0x1080,0x1080}, {0x1081,0x1081,0x1081}, /* 1080 */ - {0x1082,0x1082,0x1082}, {0x1083,0x1083,0x1083}, /* 1082 */ - {0x1084,0x1084,0x1084}, {0x1085,0x1085,0x1085}, /* 1084 */ - {0x1086,0x1086,0x1086}, {0x1087,0x1087,0x1087}, /* 1086 */ - {0x1088,0x1088,0x1088}, {0x1089,0x1089,0x1089}, /* 1088 */ - {0x108A,0x108A,0x108A}, {0x108B,0x108B,0x108B}, /* 108A */ - {0x108C,0x108C,0x108C}, {0x108D,0x108D,0x108D}, /* 108C */ - {0x108E,0x108E,0x108E}, {0x108F,0x108F,0x108F}, /* 108E */ - {0x1090,0x1090,0x1090}, {0x1091,0x1091,0x1091}, /* 1090 */ - {0x1092,0x1092,0x1092}, {0x1093,0x1093,0x1093}, /* 1092 */ - {0x1094,0x1094,0x1094}, {0x1095,0x1095,0x1095}, /* 1094 */ - {0x1096,0x1096,0x1096}, {0x1097,0x1097,0x1097}, /* 1096 */ - {0x1098,0x1098,0x1098}, {0x1099,0x1099,0x1099}, /* 1098 */ - {0x109A,0x109A,0x109A}, {0x109B,0x109B,0x109B}, /* 109A */ - {0x109C,0x109C,0x109C}, {0x109D,0x109D,0x109D}, /* 109C */ - {0x109E,0x109E,0x109E}, {0x109F,0x109F,0x109F}, /* 109E */ - {0x10A0,0x2D00,0x10A0}, {0x10A1,0x2D01,0x10A1}, /* 10A0 */ - {0x10A2,0x2D02,0x10A2}, {0x10A3,0x2D03,0x10A3}, /* 10A2 */ - {0x10A4,0x2D04,0x10A4}, {0x10A5,0x2D05,0x10A5}, /* 10A4 */ - {0x10A6,0x2D06,0x10A6}, {0x10A7,0x2D07,0x10A7}, /* 10A6 */ - {0x10A8,0x2D08,0x10A8}, {0x10A9,0x2D09,0x10A9}, /* 10A8 */ - {0x10AA,0x2D0A,0x10AA}, {0x10AB,0x2D0B,0x10AB}, /* 10AA */ - {0x10AC,0x2D0C,0x10AC}, {0x10AD,0x2D0D,0x10AD}, /* 10AC */ - {0x10AE,0x2D0E,0x10AE}, {0x10AF,0x2D0F,0x10AF}, /* 10AE */ - {0x10B0,0x2D10,0x10B0}, {0x10B1,0x2D11,0x10B1}, /* 10B0 */ - {0x10B2,0x2D12,0x10B2}, {0x10B3,0x2D13,0x10B3}, /* 10B2 */ - {0x10B4,0x2D14,0x10B4}, {0x10B5,0x2D15,0x10B5}, /* 10B4 */ - {0x10B6,0x2D16,0x10B6}, {0x10B7,0x2D17,0x10B7}, /* 10B6 */ - {0x10B8,0x2D18,0x10B8}, {0x10B9,0x2D19,0x10B9}, /* 10B8 */ - {0x10BA,0x2D1A,0x10BA}, {0x10BB,0x2D1B,0x10BB}, /* 10BA */ - {0x10BC,0x2D1C,0x10BC}, {0x10BD,0x2D1D,0x10BD}, /* 10BC */ - {0x10BE,0x2D1E,0x10BE}, {0x10BF,0x2D1F,0x10BF}, /* 10BE */ - {0x10C0,0x2D20,0x10C0}, {0x10C1,0x2D21,0x10C1}, /* 10C0 */ - {0x10C2,0x2D22,0x10C2}, {0x10C3,0x2D23,0x10C3}, /* 10C2 */ - {0x10C4,0x2D24,0x10C4}, {0x10C5,0x2D25,0x10C5}, /* 10C4 */ - {0x10C6,0x10C6,0x10C6}, {0x10C7,0x10C7,0x10C7}, /* 10C6 */ - {0x10C8,0x10C8,0x10C8}, {0x10C9,0x10C9,0x10C9}, /* 10C8 */ - {0x10CA,0x10CA,0x10CA}, {0x10CB,0x10CB,0x10CB}, /* 10CA */ - {0x10CC,0x10CC,0x10CC}, {0x10CD,0x10CD,0x10CD}, /* 10CC */ - {0x10CE,0x10CE,0x10CE}, {0x10CF,0x10CF,0x10CF}, /* 10CE */ - {0x10D0,0x10D0,0x10D0}, {0x10D1,0x10D1,0x10D1}, /* 10D0 */ - {0x10D2,0x10D2,0x10D2}, {0x10D3,0x10D3,0x10D3}, /* 10D2 */ - {0x10D4,0x10D4,0x10D4}, {0x10D5,0x10D5,0x10D5}, /* 10D4 */ - {0x10D6,0x10D6,0x10D6}, {0x10D7,0x10D7,0x10D7}, /* 10D6 */ - {0x10D8,0x10D8,0x10D8}, {0x10D9,0x10D9,0x10D9}, /* 10D8 */ - {0x10DA,0x10DA,0x10DA}, {0x10DB,0x10DB,0x10DB}, /* 10DA */ - {0x10DC,0x10DC,0x10DC}, {0x10DD,0x10DD,0x10DD}, /* 10DC */ - {0x10DE,0x10DE,0x10DE}, {0x10DF,0x10DF,0x10DF}, /* 10DE */ - {0x10E0,0x10E0,0x10E0}, {0x10E1,0x10E1,0x10E1}, /* 10E0 */ - {0x10E2,0x10E2,0x10E2}, {0x10E3,0x10E3,0x10E3}, /* 10E2 */ - {0x10E4,0x10E4,0x10E4}, {0x10E5,0x10E5,0x10E5}, /* 10E4 */ - {0x10E6,0x10E6,0x10E6}, {0x10E7,0x10E7,0x10E7}, /* 10E6 */ - {0x10E8,0x10E8,0x10E8}, {0x10E9,0x10E9,0x10E9}, /* 10E8 */ - {0x10EA,0x10EA,0x10EA}, {0x10EB,0x10EB,0x10EB}, /* 10EA */ - {0x10EC,0x10EC,0x10EC}, {0x10ED,0x10ED,0x10ED}, /* 10EC */ - {0x10EE,0x10EE,0x10EE}, {0x10EF,0x10EF,0x10EF}, /* 10EE */ - {0x10F0,0x10F0,0x10F0}, {0x10F1,0x10F1,0x10F1}, /* 10F0 */ - {0x10F2,0x10F2,0x10F2}, {0x10F3,0x10F3,0x10F3}, /* 10F2 */ - {0x10F4,0x10F4,0x10F4}, {0x10F5,0x10F5,0x10F5}, /* 10F4 */ - {0x10F6,0x10F6,0x10F6}, {0x10F7,0x10F7,0x10F7}, /* 10F6 */ - {0x10F8,0x10F8,0x10F8}, {0x10F9,0x10F9,0x10F9}, /* 10F8 */ - {0x10FA,0x10FA,0x10FA}, {0x10FB,0x10FB,0x10FB}, /* 10FA */ - {0x10FC,0x10FC,0x10FC}, {0x10FD,0x10FD,0x10FD}, /* 10FC */ - {0x10FE,0x10FE,0x10FE}, {0x10FF,0x10FF,0x10FF} /* 10FE */ -}; - -static MY_UNICASE_CHARACTER u520p1D[]={ - {0x1D00,0x1D00,0x1D00}, {0x1D01,0x1D01,0x1D01}, /* 1D00 */ - {0x1D02,0x1D02,0x1D02}, {0x1D03,0x1D03,0x1D03}, /* 1D02 */ - {0x1D04,0x1D04,0x1D04}, {0x1D05,0x1D05,0x1D05}, /* 1D04 */ - {0x1D06,0x1D06,0x1D06}, {0x1D07,0x1D07,0x1D07}, /* 1D06 */ - {0x1D08,0x1D08,0x1D08}, {0x1D09,0x1D09,0x1D09}, /* 1D08 */ - {0x1D0A,0x1D0A,0x1D0A}, {0x1D0B,0x1D0B,0x1D0B}, /* 1D0A */ - {0x1D0C,0x1D0C,0x1D0C}, {0x1D0D,0x1D0D,0x1D0D}, /* 1D0C */ - {0x1D0E,0x1D0E,0x1D0E}, {0x1D0F,0x1D0F,0x1D0F}, /* 1D0E */ - {0x1D10,0x1D10,0x1D10}, {0x1D11,0x1D11,0x1D11}, /* 1D10 */ - {0x1D12,0x1D12,0x1D12}, {0x1D13,0x1D13,0x1D13}, /* 1D12 */ - {0x1D14,0x1D14,0x1D14}, {0x1D15,0x1D15,0x1D15}, /* 1D14 */ - {0x1D16,0x1D16,0x1D16}, {0x1D17,0x1D17,0x1D17}, /* 1D16 */ - {0x1D18,0x1D18,0x1D18}, {0x1D19,0x1D19,0x1D19}, /* 1D18 */ - {0x1D1A,0x1D1A,0x1D1A}, {0x1D1B,0x1D1B,0x1D1B}, /* 1D1A */ - {0x1D1C,0x1D1C,0x1D1C}, {0x1D1D,0x1D1D,0x1D1D}, /* 1D1C */ - {0x1D1E,0x1D1E,0x1D1E}, {0x1D1F,0x1D1F,0x1D1F}, /* 1D1E */ - {0x1D20,0x1D20,0x1D20}, {0x1D21,0x1D21,0x1D21}, /* 1D20 */ - {0x1D22,0x1D22,0x1D22}, {0x1D23,0x1D23,0x1D23}, /* 1D22 */ - {0x1D24,0x1D24,0x1D24}, {0x1D25,0x1D25,0x1D25}, /* 1D24 */ - {0x1D26,0x1D26,0x1D26}, {0x1D27,0x1D27,0x1D27}, /* 1D26 */ - {0x1D28,0x1D28,0x1D28}, {0x1D29,0x1D29,0x1D29}, /* 1D28 */ - {0x1D2A,0x1D2A,0x1D2A}, {0x1D2B,0x1D2B,0x1D2B}, /* 1D2A */ - {0x1D2C,0x1D2C,0x1D2C}, {0x1D2D,0x1D2D,0x1D2D}, /* 1D2C */ - {0x1D2E,0x1D2E,0x1D2E}, {0x1D2F,0x1D2F,0x1D2F}, /* 1D2E */ - {0x1D30,0x1D30,0x1D30}, {0x1D31,0x1D31,0x1D31}, /* 1D30 */ - {0x1D32,0x1D32,0x1D32}, {0x1D33,0x1D33,0x1D33}, /* 1D32 */ - {0x1D34,0x1D34,0x1D34}, {0x1D35,0x1D35,0x1D35}, /* 1D34 */ - {0x1D36,0x1D36,0x1D36}, {0x1D37,0x1D37,0x1D37}, /* 1D36 */ - {0x1D38,0x1D38,0x1D38}, {0x1D39,0x1D39,0x1D39}, /* 1D38 */ - {0x1D3A,0x1D3A,0x1D3A}, {0x1D3B,0x1D3B,0x1D3B}, /* 1D3A */ - {0x1D3C,0x1D3C,0x1D3C}, {0x1D3D,0x1D3D,0x1D3D}, /* 1D3C */ - {0x1D3E,0x1D3E,0x1D3E}, {0x1D3F,0x1D3F,0x1D3F}, /* 1D3E */ - {0x1D40,0x1D40,0x1D40}, {0x1D41,0x1D41,0x1D41}, /* 1D40 */ - {0x1D42,0x1D42,0x1D42}, {0x1D43,0x1D43,0x1D43}, /* 1D42 */ - {0x1D44,0x1D44,0x1D44}, {0x1D45,0x1D45,0x1D45}, /* 1D44 */ - {0x1D46,0x1D46,0x1D46}, {0x1D47,0x1D47,0x1D47}, /* 1D46 */ - {0x1D48,0x1D48,0x1D48}, {0x1D49,0x1D49,0x1D49}, /* 1D48 */ - {0x1D4A,0x1D4A,0x1D4A}, {0x1D4B,0x1D4B,0x1D4B}, /* 1D4A */ - {0x1D4C,0x1D4C,0x1D4C}, {0x1D4D,0x1D4D,0x1D4D}, /* 1D4C */ - {0x1D4E,0x1D4E,0x1D4E}, {0x1D4F,0x1D4F,0x1D4F}, /* 1D4E */ - {0x1D50,0x1D50,0x1D50}, {0x1D51,0x1D51,0x1D51}, /* 1D50 */ - {0x1D52,0x1D52,0x1D52}, {0x1D53,0x1D53,0x1D53}, /* 1D52 */ - {0x1D54,0x1D54,0x1D54}, {0x1D55,0x1D55,0x1D55}, /* 1D54 */ - {0x1D56,0x1D56,0x1D56}, {0x1D57,0x1D57,0x1D57}, /* 1D56 */ - {0x1D58,0x1D58,0x1D58}, {0x1D59,0x1D59,0x1D59}, /* 1D58 */ - {0x1D5A,0x1D5A,0x1D5A}, {0x1D5B,0x1D5B,0x1D5B}, /* 1D5A */ - {0x1D5C,0x1D5C,0x1D5C}, {0x1D5D,0x1D5D,0x1D5D}, /* 1D5C */ - {0x1D5E,0x1D5E,0x1D5E}, {0x1D5F,0x1D5F,0x1D5F}, /* 1D5E */ - {0x1D60,0x1D60,0x1D60}, {0x1D61,0x1D61,0x1D61}, /* 1D60 */ - {0x1D62,0x1D62,0x1D62}, {0x1D63,0x1D63,0x1D63}, /* 1D62 */ - {0x1D64,0x1D64,0x1D64}, {0x1D65,0x1D65,0x1D65}, /* 1D64 */ - {0x1D66,0x1D66,0x1D66}, {0x1D67,0x1D67,0x1D67}, /* 1D66 */ - {0x1D68,0x1D68,0x1D68}, {0x1D69,0x1D69,0x1D69}, /* 1D68 */ - {0x1D6A,0x1D6A,0x1D6A}, {0x1D6B,0x1D6B,0x1D6B}, /* 1D6A */ - {0x1D6C,0x1D6C,0x1D6C}, {0x1D6D,0x1D6D,0x1D6D}, /* 1D6C */ - {0x1D6E,0x1D6E,0x1D6E}, {0x1D6F,0x1D6F,0x1D6F}, /* 1D6E */ - {0x1D70,0x1D70,0x1D70}, {0x1D71,0x1D71,0x1D71}, /* 1D70 */ - {0x1D72,0x1D72,0x1D72}, {0x1D73,0x1D73,0x1D73}, /* 1D72 */ - {0x1D74,0x1D74,0x1D74}, {0x1D75,0x1D75,0x1D75}, /* 1D74 */ - {0x1D76,0x1D76,0x1D76}, {0x1D77,0x1D77,0x1D77}, /* 1D76 */ - {0x1D78,0x1D78,0x1D78}, {0xA77D,0x1D79,0xA77D}, /* 1D78 */ - {0x1D7A,0x1D7A,0x1D7A}, {0x1D7B,0x1D7B,0x1D7B}, /* 1D7A */ - {0x1D7C,0x1D7C,0x1D7C}, {0x2C63,0x1D7D,0x2C63}, /* 1D7C */ - {0x1D7E,0x1D7E,0x1D7E}, {0x1D7F,0x1D7F,0x1D7F}, /* 1D7E */ - {0x1D80,0x1D80,0x1D80}, {0x1D81,0x1D81,0x1D81}, /* 1D80 */ - {0x1D82,0x1D82,0x1D82}, {0x1D83,0x1D83,0x1D83}, /* 1D82 */ - {0x1D84,0x1D84,0x1D84}, {0x1D85,0x1D85,0x1D85}, /* 1D84 */ - {0x1D86,0x1D86,0x1D86}, {0x1D87,0x1D87,0x1D87}, /* 1D86 */ - {0x1D88,0x1D88,0x1D88}, {0x1D89,0x1D89,0x1D89}, /* 1D88 */ - {0x1D8A,0x1D8A,0x1D8A}, {0x1D8B,0x1D8B,0x1D8B}, /* 1D8A */ - {0x1D8C,0x1D8C,0x1D8C}, {0x1D8D,0x1D8D,0x1D8D}, /* 1D8C */ - {0x1D8E,0x1D8E,0x1D8E}, {0x1D8F,0x1D8F,0x1D8F}, /* 1D8E */ - {0x1D90,0x1D90,0x1D90}, {0x1D91,0x1D91,0x1D91}, /* 1D90 */ - {0x1D92,0x1D92,0x1D92}, {0x1D93,0x1D93,0x1D93}, /* 1D92 */ - {0x1D94,0x1D94,0x1D94}, {0x1D95,0x1D95,0x1D95}, /* 1D94 */ - {0x1D96,0x1D96,0x1D96}, {0x1D97,0x1D97,0x1D97}, /* 1D96 */ - {0x1D98,0x1D98,0x1D98}, {0x1D99,0x1D99,0x1D99}, /* 1D98 */ - {0x1D9A,0x1D9A,0x1D9A}, {0x1D9B,0x1D9B,0x1D9B}, /* 1D9A */ - {0x1D9C,0x1D9C,0x1D9C}, {0x1D9D,0x1D9D,0x1D9D}, /* 1D9C */ - {0x1D9E,0x1D9E,0x1D9E}, {0x1D9F,0x1D9F,0x1D9F}, /* 1D9E */ - {0x1DA0,0x1DA0,0x1DA0}, {0x1DA1,0x1DA1,0x1DA1}, /* 1DA0 */ - {0x1DA2,0x1DA2,0x1DA2}, {0x1DA3,0x1DA3,0x1DA3}, /* 1DA2 */ - {0x1DA4,0x1DA4,0x1DA4}, {0x1DA5,0x1DA5,0x1DA5}, /* 1DA4 */ - {0x1DA6,0x1DA6,0x1DA6}, {0x1DA7,0x1DA7,0x1DA7}, /* 1DA6 */ - {0x1DA8,0x1DA8,0x1DA8}, {0x1DA9,0x1DA9,0x1DA9}, /* 1DA8 */ - {0x1DAA,0x1DAA,0x1DAA}, {0x1DAB,0x1DAB,0x1DAB}, /* 1DAA */ - {0x1DAC,0x1DAC,0x1DAC}, {0x1DAD,0x1DAD,0x1DAD}, /* 1DAC */ - {0x1DAE,0x1DAE,0x1DAE}, {0x1DAF,0x1DAF,0x1DAF}, /* 1DAE */ - {0x1DB0,0x1DB0,0x1DB0}, {0x1DB1,0x1DB1,0x1DB1}, /* 1DB0 */ - {0x1DB2,0x1DB2,0x1DB2}, {0x1DB3,0x1DB3,0x1DB3}, /* 1DB2 */ - {0x1DB4,0x1DB4,0x1DB4}, {0x1DB5,0x1DB5,0x1DB5}, /* 1DB4 */ - {0x1DB6,0x1DB6,0x1DB6}, {0x1DB7,0x1DB7,0x1DB7}, /* 1DB6 */ - {0x1DB8,0x1DB8,0x1DB8}, {0x1DB9,0x1DB9,0x1DB9}, /* 1DB8 */ - {0x1DBA,0x1DBA,0x1DBA}, {0x1DBB,0x1DBB,0x1DBB}, /* 1DBA */ - {0x1DBC,0x1DBC,0x1DBC}, {0x1DBD,0x1DBD,0x1DBD}, /* 1DBC */ - {0x1DBE,0x1DBE,0x1DBE}, {0x1DBF,0x1DBF,0x1DBF}, /* 1DBE */ - {0x1DC0,0x1DC0,0x1DC0}, {0x1DC1,0x1DC1,0x1DC1}, /* 1DC0 */ - {0x1DC2,0x1DC2,0x1DC2}, {0x1DC3,0x1DC3,0x1DC3}, /* 1DC2 */ - {0x1DC4,0x1DC4,0x1DC4}, {0x1DC5,0x1DC5,0x1DC5}, /* 1DC4 */ - {0x1DC6,0x1DC6,0x1DC6}, {0x1DC7,0x1DC7,0x1DC7}, /* 1DC6 */ - {0x1DC8,0x1DC8,0x1DC8}, {0x1DC9,0x1DC9,0x1DC9}, /* 1DC8 */ - {0x1DCA,0x1DCA,0x1DCA}, {0x1DCB,0x1DCB,0x1DCB}, /* 1DCA */ - {0x1DCC,0x1DCC,0x1DCC}, {0x1DCD,0x1DCD,0x1DCD}, /* 1DCC */ - {0x1DCE,0x1DCE,0x1DCE}, {0x1DCF,0x1DCF,0x1DCF}, /* 1DCE */ - {0x1DD0,0x1DD0,0x1DD0}, {0x1DD1,0x1DD1,0x1DD1}, /* 1DD0 */ - {0x1DD2,0x1DD2,0x1DD2}, {0x1DD3,0x1DD3,0x1DD3}, /* 1DD2 */ - {0x1DD4,0x1DD4,0x1DD4}, {0x1DD5,0x1DD5,0x1DD5}, /* 1DD4 */ - {0x1DD6,0x1DD6,0x1DD6}, {0x1DD7,0x1DD7,0x1DD7}, /* 1DD6 */ - {0x1DD8,0x1DD8,0x1DD8}, {0x1DD9,0x1DD9,0x1DD9}, /* 1DD8 */ - {0x1DDA,0x1DDA,0x1DDA}, {0x1DDB,0x1DDB,0x1DDB}, /* 1DDA */ - {0x1DDC,0x1DDC,0x1DDC}, {0x1DDD,0x1DDD,0x1DDD}, /* 1DDC */ - {0x1DDE,0x1DDE,0x1DDE}, {0x1DDF,0x1DDF,0x1DDF}, /* 1DDE */ - {0x1DE0,0x1DE0,0x1DE0}, {0x1DE1,0x1DE1,0x1DE1}, /* 1DE0 */ - {0x1DE2,0x1DE2,0x1DE2}, {0x1DE3,0x1DE3,0x1DE3}, /* 1DE2 */ - {0x1DE4,0x1DE4,0x1DE4}, {0x1DE5,0x1DE5,0x1DE5}, /* 1DE4 */ - {0x1DE6,0x1DE6,0x1DE6}, {0x1DE7,0x1DE7,0x1DE7}, /* 1DE6 */ - {0x1DE8,0x1DE8,0x1DE8}, {0x1DE9,0x1DE9,0x1DE9}, /* 1DE8 */ - {0x1DEA,0x1DEA,0x1DEA}, {0x1DEB,0x1DEB,0x1DEB}, /* 1DEA */ - {0x1DEC,0x1DEC,0x1DEC}, {0x1DED,0x1DED,0x1DED}, /* 1DEC */ - {0x1DEE,0x1DEE,0x1DEE}, {0x1DEF,0x1DEF,0x1DEF}, /* 1DEE */ - {0x1DF0,0x1DF0,0x1DF0}, {0x1DF1,0x1DF1,0x1DF1}, /* 1DF0 */ - {0x1DF2,0x1DF2,0x1DF2}, {0x1DF3,0x1DF3,0x1DF3}, /* 1DF2 */ - {0x1DF4,0x1DF4,0x1DF4}, {0x1DF5,0x1DF5,0x1DF5}, /* 1DF4 */ - {0x1DF6,0x1DF6,0x1DF6}, {0x1DF7,0x1DF7,0x1DF7}, /* 1DF6 */ - {0x1DF8,0x1DF8,0x1DF8}, {0x1DF9,0x1DF9,0x1DF9}, /* 1DF8 */ - {0x1DFA,0x1DFA,0x1DFA}, {0x1DFB,0x1DFB,0x1DFB}, /* 1DFA */ - {0x1DFC,0x1DFC,0x1DFC}, {0x1DFD,0x1DFD,0x1DFD}, /* 1DFC */ - {0x1DFE,0x1DFE,0x1DFE}, {0x1DFF,0x1DFF,0x1DFF} /* 1DFE */ -}; - -static MY_UNICASE_CHARACTER u520p1E[]={ - {0x1E00,0x1E01,0x0041}, {0x1E00,0x1E01,0x0041}, /* 1E00 */ - {0x1E02,0x1E03,0x0042}, {0x1E02,0x1E03,0x0042}, /* 1E02 */ - {0x1E04,0x1E05,0x0042}, {0x1E04,0x1E05,0x0042}, /* 1E04 */ - {0x1E06,0x1E07,0x0042}, {0x1E06,0x1E07,0x0042}, /* 1E06 */ - {0x1E08,0x1E09,0x0043}, {0x1E08,0x1E09,0x0043}, /* 1E08 */ - {0x1E0A,0x1E0B,0x0044}, {0x1E0A,0x1E0B,0x0044}, /* 1E0A */ - {0x1E0C,0x1E0D,0x0044}, {0x1E0C,0x1E0D,0x0044}, /* 1E0C */ - {0x1E0E,0x1E0F,0x0044}, {0x1E0E,0x1E0F,0x0044}, /* 1E0E */ - {0x1E10,0x1E11,0x0044}, {0x1E10,0x1E11,0x0044}, /* 1E10 */ - {0x1E12,0x1E13,0x0044}, {0x1E12,0x1E13,0x0044}, /* 1E12 */ - {0x1E14,0x1E15,0x0045}, {0x1E14,0x1E15,0x0045}, /* 1E14 */ - {0x1E16,0x1E17,0x0045}, {0x1E16,0x1E17,0x0045}, /* 1E16 */ - {0x1E18,0x1E19,0x0045}, {0x1E18,0x1E19,0x0045}, /* 1E18 */ - {0x1E1A,0x1E1B,0x0045}, {0x1E1A,0x1E1B,0x0045}, /* 1E1A */ - {0x1E1C,0x1E1D,0x0045}, {0x1E1C,0x1E1D,0x0045}, /* 1E1C */ - {0x1E1E,0x1E1F,0x0046}, {0x1E1E,0x1E1F,0x0046}, /* 1E1E */ - {0x1E20,0x1E21,0x0047}, {0x1E20,0x1E21,0x0047}, /* 1E20 */ - {0x1E22,0x1E23,0x0048}, {0x1E22,0x1E23,0x0048}, /* 1E22 */ - {0x1E24,0x1E25,0x0048}, {0x1E24,0x1E25,0x0048}, /* 1E24 */ - {0x1E26,0x1E27,0x0048}, {0x1E26,0x1E27,0x0048}, /* 1E26 */ - {0x1E28,0x1E29,0x0048}, {0x1E28,0x1E29,0x0048}, /* 1E28 */ - {0x1E2A,0x1E2B,0x0048}, {0x1E2A,0x1E2B,0x0048}, /* 1E2A */ - {0x1E2C,0x1E2D,0x0049}, {0x1E2C,0x1E2D,0x0049}, /* 1E2C */ - {0x1E2E,0x1E2F,0x0049}, {0x1E2E,0x1E2F,0x0049}, /* 1E2E */ - {0x1E30,0x1E31,0x004B}, {0x1E30,0x1E31,0x004B}, /* 1E30 */ - {0x1E32,0x1E33,0x004B}, {0x1E32,0x1E33,0x004B}, /* 1E32 */ - {0x1E34,0x1E35,0x004B}, {0x1E34,0x1E35,0x004B}, /* 1E34 */ - {0x1E36,0x1E37,0x004C}, {0x1E36,0x1E37,0x004C}, /* 1E36 */ - {0x1E38,0x1E39,0x004C}, {0x1E38,0x1E39,0x004C}, /* 1E38 */ - {0x1E3A,0x1E3B,0x004C}, {0x1E3A,0x1E3B,0x004C}, /* 1E3A */ - {0x1E3C,0x1E3D,0x004C}, {0x1E3C,0x1E3D,0x004C}, /* 1E3C */ - {0x1E3E,0x1E3F,0x004D}, {0x1E3E,0x1E3F,0x004D}, /* 1E3E */ - {0x1E40,0x1E41,0x004D}, {0x1E40,0x1E41,0x004D}, /* 1E40 */ - {0x1E42,0x1E43,0x004D}, {0x1E42,0x1E43,0x004D}, /* 1E42 */ - {0x1E44,0x1E45,0x004E}, {0x1E44,0x1E45,0x004E}, /* 1E44 */ - {0x1E46,0x1E47,0x004E}, {0x1E46,0x1E47,0x004E}, /* 1E46 */ - {0x1E48,0x1E49,0x004E}, {0x1E48,0x1E49,0x004E}, /* 1E48 */ - {0x1E4A,0x1E4B,0x004E}, {0x1E4A,0x1E4B,0x004E}, /* 1E4A */ - {0x1E4C,0x1E4D,0x004F}, {0x1E4C,0x1E4D,0x004F}, /* 1E4C */ - {0x1E4E,0x1E4F,0x004F}, {0x1E4E,0x1E4F,0x004F}, /* 1E4E */ - {0x1E50,0x1E51,0x004F}, {0x1E50,0x1E51,0x004F}, /* 1E50 */ - {0x1E52,0x1E53,0x004F}, {0x1E52,0x1E53,0x004F}, /* 1E52 */ - {0x1E54,0x1E55,0x0050}, {0x1E54,0x1E55,0x0050}, /* 1E54 */ - {0x1E56,0x1E57,0x0050}, {0x1E56,0x1E57,0x0050}, /* 1E56 */ - {0x1E58,0x1E59,0x0052}, {0x1E58,0x1E59,0x0052}, /* 1E58 */ - {0x1E5A,0x1E5B,0x0052}, {0x1E5A,0x1E5B,0x0052}, /* 1E5A */ - {0x1E5C,0x1E5D,0x0052}, {0x1E5C,0x1E5D,0x0052}, /* 1E5C */ - {0x1E5E,0x1E5F,0x0052}, {0x1E5E,0x1E5F,0x0052}, /* 1E5E */ - {0x1E60,0x1E61,0x0053}, {0x1E60,0x1E61,0x0053}, /* 1E60 */ - {0x1E62,0x1E63,0x0053}, {0x1E62,0x1E63,0x0053}, /* 1E62 */ - {0x1E64,0x1E65,0x0053}, {0x1E64,0x1E65,0x0053}, /* 1E64 */ - {0x1E66,0x1E67,0x0053}, {0x1E66,0x1E67,0x0053}, /* 1E66 */ - {0x1E68,0x1E69,0x0053}, {0x1E68,0x1E69,0x0053}, /* 1E68 */ - {0x1E6A,0x1E6B,0x0054}, {0x1E6A,0x1E6B,0x0054}, /* 1E6A */ - {0x1E6C,0x1E6D,0x0054}, {0x1E6C,0x1E6D,0x0054}, /* 1E6C */ - {0x1E6E,0x1E6F,0x0054}, {0x1E6E,0x1E6F,0x0054}, /* 1E6E */ - {0x1E70,0x1E71,0x0054}, {0x1E70,0x1E71,0x0054}, /* 1E70 */ - {0x1E72,0x1E73,0x0055}, {0x1E72,0x1E73,0x0055}, /* 1E72 */ - {0x1E74,0x1E75,0x0055}, {0x1E74,0x1E75,0x0055}, /* 1E74 */ - {0x1E76,0x1E77,0x0055}, {0x1E76,0x1E77,0x0055}, /* 1E76 */ - {0x1E78,0x1E79,0x0055}, {0x1E78,0x1E79,0x0055}, /* 1E78 */ - {0x1E7A,0x1E7B,0x0055}, {0x1E7A,0x1E7B,0x0055}, /* 1E7A */ - {0x1E7C,0x1E7D,0x0056}, {0x1E7C,0x1E7D,0x0056}, /* 1E7C */ - {0x1E7E,0x1E7F,0x0056}, {0x1E7E,0x1E7F,0x0056}, /* 1E7E */ - {0x1E80,0x1E81,0x0057}, {0x1E80,0x1E81,0x0057}, /* 1E80 */ - {0x1E82,0x1E83,0x0057}, {0x1E82,0x1E83,0x0057}, /* 1E82 */ - {0x1E84,0x1E85,0x0057}, {0x1E84,0x1E85,0x0057}, /* 1E84 */ - {0x1E86,0x1E87,0x0057}, {0x1E86,0x1E87,0x0057}, /* 1E86 */ - {0x1E88,0x1E89,0x0057}, {0x1E88,0x1E89,0x0057}, /* 1E88 */ - {0x1E8A,0x1E8B,0x0058}, {0x1E8A,0x1E8B,0x0058}, /* 1E8A */ - {0x1E8C,0x1E8D,0x0058}, {0x1E8C,0x1E8D,0x0058}, /* 1E8C */ - {0x1E8E,0x1E8F,0x0059}, {0x1E8E,0x1E8F,0x0059}, /* 1E8E */ - {0x1E90,0x1E91,0x005A}, {0x1E90,0x1E91,0x005A}, /* 1E90 */ - {0x1E92,0x1E93,0x005A}, {0x1E92,0x1E93,0x005A}, /* 1E92 */ - {0x1E94,0x1E95,0x005A}, {0x1E94,0x1E95,0x005A}, /* 1E94 */ - {0x1E96,0x1E96,0x0048}, {0x1E97,0x1E97,0x0054}, /* 1E96 */ - {0x1E98,0x1E98,0x0057}, {0x1E99,0x1E99,0x0059}, /* 1E98 */ - {0x1E9A,0x1E9A,0x1E9A}, {0x1E60,0x1E9B,0x0053}, /* 1E9A */ - {0x1E9C,0x1E9C,0x1E9C}, {0x1E9D,0x1E9D,0x1E9D}, /* 1E9C */ - {0x1E9E,0x00DF,0x1E9E}, {0x1E9F,0x1E9F,0x1E9F}, /* 1E9E */ - {0x1EA0,0x1EA1,0x0041}, {0x1EA0,0x1EA1,0x0041}, /* 1EA0 */ - {0x1EA2,0x1EA3,0x0041}, {0x1EA2,0x1EA3,0x0041}, /* 1EA2 */ - {0x1EA4,0x1EA5,0x0041}, {0x1EA4,0x1EA5,0x0041}, /* 1EA4 */ - {0x1EA6,0x1EA7,0x0041}, {0x1EA6,0x1EA7,0x0041}, /* 1EA6 */ - {0x1EA8,0x1EA9,0x0041}, {0x1EA8,0x1EA9,0x0041}, /* 1EA8 */ - {0x1EAA,0x1EAB,0x0041}, {0x1EAA,0x1EAB,0x0041}, /* 1EAA */ - {0x1EAC,0x1EAD,0x0041}, {0x1EAC,0x1EAD,0x0041}, /* 1EAC */ - {0x1EAE,0x1EAF,0x0041}, {0x1EAE,0x1EAF,0x0041}, /* 1EAE */ - {0x1EB0,0x1EB1,0x0041}, {0x1EB0,0x1EB1,0x0041}, /* 1EB0 */ - {0x1EB2,0x1EB3,0x0041}, {0x1EB2,0x1EB3,0x0041}, /* 1EB2 */ - {0x1EB4,0x1EB5,0x0041}, {0x1EB4,0x1EB5,0x0041}, /* 1EB4 */ - {0x1EB6,0x1EB7,0x0041}, {0x1EB6,0x1EB7,0x0041}, /* 1EB6 */ - {0x1EB8,0x1EB9,0x0045}, {0x1EB8,0x1EB9,0x0045}, /* 1EB8 */ - {0x1EBA,0x1EBB,0x0045}, {0x1EBA,0x1EBB,0x0045}, /* 1EBA */ - {0x1EBC,0x1EBD,0x0045}, {0x1EBC,0x1EBD,0x0045}, /* 1EBC */ - {0x1EBE,0x1EBF,0x0045}, {0x1EBE,0x1EBF,0x0045}, /* 1EBE */ - {0x1EC0,0x1EC1,0x0045}, {0x1EC0,0x1EC1,0x0045}, /* 1EC0 */ - {0x1EC2,0x1EC3,0x0045}, {0x1EC2,0x1EC3,0x0045}, /* 1EC2 */ - {0x1EC4,0x1EC5,0x0045}, {0x1EC4,0x1EC5,0x0045}, /* 1EC4 */ - {0x1EC6,0x1EC7,0x0045}, {0x1EC6,0x1EC7,0x0045}, /* 1EC6 */ - {0x1EC8,0x1EC9,0x0049}, {0x1EC8,0x1EC9,0x0049}, /* 1EC8 */ - {0x1ECA,0x1ECB,0x0049}, {0x1ECA,0x1ECB,0x0049}, /* 1ECA */ - {0x1ECC,0x1ECD,0x004F}, {0x1ECC,0x1ECD,0x004F}, /* 1ECC */ - {0x1ECE,0x1ECF,0x004F}, {0x1ECE,0x1ECF,0x004F}, /* 1ECE */ - {0x1ED0,0x1ED1,0x004F}, {0x1ED0,0x1ED1,0x004F}, /* 1ED0 */ - {0x1ED2,0x1ED3,0x004F}, {0x1ED2,0x1ED3,0x004F}, /* 1ED2 */ - {0x1ED4,0x1ED5,0x004F}, {0x1ED4,0x1ED5,0x004F}, /* 1ED4 */ - {0x1ED6,0x1ED7,0x004F}, {0x1ED6,0x1ED7,0x004F}, /* 1ED6 */ - {0x1ED8,0x1ED9,0x004F}, {0x1ED8,0x1ED9,0x004F}, /* 1ED8 */ - {0x1EDA,0x1EDB,0x004F}, {0x1EDA,0x1EDB,0x004F}, /* 1EDA */ - {0x1EDC,0x1EDD,0x004F}, {0x1EDC,0x1EDD,0x004F}, /* 1EDC */ - {0x1EDE,0x1EDF,0x004F}, {0x1EDE,0x1EDF,0x004F}, /* 1EDE */ - {0x1EE0,0x1EE1,0x004F}, {0x1EE0,0x1EE1,0x004F}, /* 1EE0 */ - {0x1EE2,0x1EE3,0x004F}, {0x1EE2,0x1EE3,0x004F}, /* 1EE2 */ - {0x1EE4,0x1EE5,0x0055}, {0x1EE4,0x1EE5,0x0055}, /* 1EE4 */ - {0x1EE6,0x1EE7,0x0055}, {0x1EE6,0x1EE7,0x0055}, /* 1EE6 */ - {0x1EE8,0x1EE9,0x0055}, {0x1EE8,0x1EE9,0x0055}, /* 1EE8 */ - {0x1EEA,0x1EEB,0x0055}, {0x1EEA,0x1EEB,0x0055}, /* 1EEA */ - {0x1EEC,0x1EED,0x0055}, {0x1EEC,0x1EED,0x0055}, /* 1EEC */ - {0x1EEE,0x1EEF,0x0055}, {0x1EEE,0x1EEF,0x0055}, /* 1EEE */ - {0x1EF0,0x1EF1,0x0055}, {0x1EF0,0x1EF1,0x0055}, /* 1EF0 */ - {0x1EF2,0x1EF3,0x0059}, {0x1EF2,0x1EF3,0x0059}, /* 1EF2 */ - {0x1EF4,0x1EF5,0x0059}, {0x1EF4,0x1EF5,0x0059}, /* 1EF4 */ - {0x1EF6,0x1EF7,0x0059}, {0x1EF6,0x1EF7,0x0059}, /* 1EF6 */ - {0x1EF8,0x1EF9,0x0059}, {0x1EF8,0x1EF9,0x0059}, /* 1EF8 */ - {0x1EFA,0x1EFB,0x1EFA}, {0x1EFA,0x1EFB,0x1EFA}, /* 1EFA */ - {0x1EFC,0x1EFD,0x1EFC}, {0x1EFC,0x1EFD,0x1EFC}, /* 1EFC */ - {0x1EFE,0x1EFF,0x1EFE}, {0x1EFE,0x1EFF,0x1EFE} /* 1EFE */ -}; - -static MY_UNICASE_CHARACTER u520p1F[]={ - {0x1F08,0x1F00,0x0391}, {0x1F09,0x1F01,0x0391}, /* 1F00 */ - {0x1F0A,0x1F02,0x0391}, {0x1F0B,0x1F03,0x0391}, /* 1F02 */ - {0x1F0C,0x1F04,0x0391}, {0x1F0D,0x1F05,0x0391}, /* 1F04 */ - {0x1F0E,0x1F06,0x0391}, {0x1F0F,0x1F07,0x0391}, /* 1F06 */ - {0x1F08,0x1F00,0x0391}, {0x1F09,0x1F01,0x0391}, /* 1F08 */ - {0x1F0A,0x1F02,0x0391}, {0x1F0B,0x1F03,0x0391}, /* 1F0A */ - {0x1F0C,0x1F04,0x0391}, {0x1F0D,0x1F05,0x0391}, /* 1F0C */ - {0x1F0E,0x1F06,0x0391}, {0x1F0F,0x1F07,0x0391}, /* 1F0E */ - {0x1F18,0x1F10,0x0395}, {0x1F19,0x1F11,0x0395}, /* 1F10 */ - {0x1F1A,0x1F12,0x0395}, {0x1F1B,0x1F13,0x0395}, /* 1F12 */ - {0x1F1C,0x1F14,0x0395}, {0x1F1D,0x1F15,0x0395}, /* 1F14 */ - {0x1F16,0x1F16,0x1F16}, {0x1F17,0x1F17,0x1F17}, /* 1F16 */ - {0x1F18,0x1F10,0x0395}, {0x1F19,0x1F11,0x0395}, /* 1F18 */ - {0x1F1A,0x1F12,0x0395}, {0x1F1B,0x1F13,0x0395}, /* 1F1A */ - {0x1F1C,0x1F14,0x0395}, {0x1F1D,0x1F15,0x0395}, /* 1F1C */ - {0x1F1E,0x1F1E,0x1F1E}, {0x1F1F,0x1F1F,0x1F1F}, /* 1F1E */ - {0x1F28,0x1F20,0x0397}, {0x1F29,0x1F21,0x0397}, /* 1F20 */ - {0x1F2A,0x1F22,0x0397}, {0x1F2B,0x1F23,0x0397}, /* 1F22 */ - {0x1F2C,0x1F24,0x0397}, {0x1F2D,0x1F25,0x0397}, /* 1F24 */ - {0x1F2E,0x1F26,0x0397}, {0x1F2F,0x1F27,0x0397}, /* 1F26 */ - {0x1F28,0x1F20,0x0397}, {0x1F29,0x1F21,0x0397}, /* 1F28 */ - {0x1F2A,0x1F22,0x0397}, {0x1F2B,0x1F23,0x0397}, /* 1F2A */ - {0x1F2C,0x1F24,0x0397}, {0x1F2D,0x1F25,0x0397}, /* 1F2C */ - {0x1F2E,0x1F26,0x0397}, {0x1F2F,0x1F27,0x0397}, /* 1F2E */ - {0x1F38,0x1F30,0x0399}, {0x1F39,0x1F31,0x0399}, /* 1F30 */ - {0x1F3A,0x1F32,0x0399}, {0x1F3B,0x1F33,0x0399}, /* 1F32 */ - {0x1F3C,0x1F34,0x0399}, {0x1F3D,0x1F35,0x0399}, /* 1F34 */ - {0x1F3E,0x1F36,0x0399}, {0x1F3F,0x1F37,0x0399}, /* 1F36 */ - {0x1F38,0x1F30,0x0399}, {0x1F39,0x1F31,0x0399}, /* 1F38 */ - {0x1F3A,0x1F32,0x0399}, {0x1F3B,0x1F33,0x0399}, /* 1F3A */ - {0x1F3C,0x1F34,0x0399}, {0x1F3D,0x1F35,0x0399}, /* 1F3C */ - {0x1F3E,0x1F36,0x0399}, {0x1F3F,0x1F37,0x0399}, /* 1F3E */ - {0x1F48,0x1F40,0x039F}, {0x1F49,0x1F41,0x039F}, /* 1F40 */ - {0x1F4A,0x1F42,0x039F}, {0x1F4B,0x1F43,0x039F}, /* 1F42 */ - {0x1F4C,0x1F44,0x039F}, {0x1F4D,0x1F45,0x039F}, /* 1F44 */ - {0x1F46,0x1F46,0x1F46}, {0x1F47,0x1F47,0x1F47}, /* 1F46 */ - {0x1F48,0x1F40,0x039F}, {0x1F49,0x1F41,0x039F}, /* 1F48 */ - {0x1F4A,0x1F42,0x039F}, {0x1F4B,0x1F43,0x039F}, /* 1F4A */ - {0x1F4C,0x1F44,0x039F}, {0x1F4D,0x1F45,0x039F}, /* 1F4C */ - {0x1F4E,0x1F4E,0x1F4E}, {0x1F4F,0x1F4F,0x1F4F}, /* 1F4E */ - {0x1F50,0x1F50,0x03A5}, {0x1F59,0x1F51,0x03A5}, /* 1F50 */ - {0x1F52,0x1F52,0x03A5}, {0x1F5B,0x1F53,0x03A5}, /* 1F52 */ - {0x1F54,0x1F54,0x03A5}, {0x1F5D,0x1F55,0x03A5}, /* 1F54 */ - {0x1F56,0x1F56,0x03A5}, {0x1F5F,0x1F57,0x03A5}, /* 1F56 */ - {0x1F58,0x1F58,0x1F58}, {0x1F59,0x1F51,0x03A5}, /* 1F58 */ - {0x1F5A,0x1F5A,0x1F5A}, {0x1F5B,0x1F53,0x03A5}, /* 1F5A */ - {0x1F5C,0x1F5C,0x1F5C}, {0x1F5D,0x1F55,0x03A5}, /* 1F5C */ - {0x1F5E,0x1F5E,0x1F5E}, {0x1F5F,0x1F57,0x03A5}, /* 1F5E */ - {0x1F68,0x1F60,0x03A9}, {0x1F69,0x1F61,0x03A9}, /* 1F60 */ - {0x1F6A,0x1F62,0x03A9}, {0x1F6B,0x1F63,0x03A9}, /* 1F62 */ - {0x1F6C,0x1F64,0x03A9}, {0x1F6D,0x1F65,0x03A9}, /* 1F64 */ - {0x1F6E,0x1F66,0x03A9}, {0x1F6F,0x1F67,0x03A9}, /* 1F66 */ - {0x1F68,0x1F60,0x03A9}, {0x1F69,0x1F61,0x03A9}, /* 1F68 */ - {0x1F6A,0x1F62,0x03A9}, {0x1F6B,0x1F63,0x03A9}, /* 1F6A */ - {0x1F6C,0x1F64,0x03A9}, {0x1F6D,0x1F65,0x03A9}, /* 1F6C */ - {0x1F6E,0x1F66,0x03A9}, {0x1F6F,0x1F67,0x03A9}, /* 1F6E */ - {0x1FBA,0x1F70,0x0391}, {0x1FBB,0x1F71,0x1FBB}, /* 1F70 */ - {0x1FC8,0x1F72,0x0395}, {0x1FC9,0x1F73,0x1FC9}, /* 1F72 */ - {0x1FCA,0x1F74,0x0397}, {0x1FCB,0x1F75,0x1FCB}, /* 1F74 */ - {0x1FDA,0x1F76,0x0399}, {0x1FDB,0x1F77,0x1FDB}, /* 1F76 */ - {0x1FF8,0x1F78,0x039F}, {0x1FF9,0x1F79,0x1FF9}, /* 1F78 */ - {0x1FEA,0x1F7A,0x03A5}, {0x1FEB,0x1F7B,0x1FEB}, /* 1F7A */ - {0x1FFA,0x1F7C,0x03A9}, {0x1FFB,0x1F7D,0x1FFB}, /* 1F7C */ - {0x1F7E,0x1F7E,0x1F7E}, {0x1F7F,0x1F7F,0x1F7F}, /* 1F7E */ - {0x1F88,0x1F80,0x0391}, {0x1F89,0x1F81,0x0391}, /* 1F80 */ - {0x1F8A,0x1F82,0x0391}, {0x1F8B,0x1F83,0x0391}, /* 1F82 */ - {0x1F8C,0x1F84,0x0391}, {0x1F8D,0x1F85,0x0391}, /* 1F84 */ - {0x1F8E,0x1F86,0x0391}, {0x1F8F,0x1F87,0x0391}, /* 1F86 */ - {0x1F88,0x1F80,0x0391}, {0x1F89,0x1F81,0x0391}, /* 1F88 */ - {0x1F8A,0x1F82,0x0391}, {0x1F8B,0x1F83,0x0391}, /* 1F8A */ - {0x1F8C,0x1F84,0x0391}, {0x1F8D,0x1F85,0x0391}, /* 1F8C */ - {0x1F8E,0x1F86,0x0391}, {0x1F8F,0x1F87,0x0391}, /* 1F8E */ - {0x1F98,0x1F90,0x0397}, {0x1F99,0x1F91,0x0397}, /* 1F90 */ - {0x1F9A,0x1F92,0x0397}, {0x1F9B,0x1F93,0x0397}, /* 1F92 */ - {0x1F9C,0x1F94,0x0397}, {0x1F9D,0x1F95,0x0397}, /* 1F94 */ - {0x1F9E,0x1F96,0x0397}, {0x1F9F,0x1F97,0x0397}, /* 1F96 */ - {0x1F98,0x1F90,0x0397}, {0x1F99,0x1F91,0x0397}, /* 1F98 */ - {0x1F9A,0x1F92,0x0397}, {0x1F9B,0x1F93,0x0397}, /* 1F9A */ - {0x1F9C,0x1F94,0x0397}, {0x1F9D,0x1F95,0x0397}, /* 1F9C */ - {0x1F9E,0x1F96,0x0397}, {0x1F9F,0x1F97,0x0397}, /* 1F9E */ - {0x1FA8,0x1FA0,0x03A9}, {0x1FA9,0x1FA1,0x03A9}, /* 1FA0 */ - {0x1FAA,0x1FA2,0x03A9}, {0x1FAB,0x1FA3,0x03A9}, /* 1FA2 */ - {0x1FAC,0x1FA4,0x03A9}, {0x1FAD,0x1FA5,0x03A9}, /* 1FA4 */ - {0x1FAE,0x1FA6,0x03A9}, {0x1FAF,0x1FA7,0x03A9}, /* 1FA6 */ - {0x1FA8,0x1FA0,0x03A9}, {0x1FA9,0x1FA1,0x03A9}, /* 1FA8 */ - {0x1FAA,0x1FA2,0x03A9}, {0x1FAB,0x1FA3,0x03A9}, /* 1FAA */ - {0x1FAC,0x1FA4,0x03A9}, {0x1FAD,0x1FA5,0x03A9}, /* 1FAC */ - {0x1FAE,0x1FA6,0x03A9}, {0x1FAF,0x1FA7,0x03A9}, /* 1FAE */ - {0x1FB8,0x1FB0,0x0391}, {0x1FB9,0x1FB1,0x0391}, /* 1FB0 */ - {0x1FB2,0x1FB2,0x0391}, {0x1FBC,0x1FB3,0x0391}, /* 1FB2 */ - {0x1FB4,0x1FB4,0x0391}, {0x1FB5,0x1FB5,0x1FB5}, /* 1FB4 */ - {0x1FB6,0x1FB6,0x0391}, {0x1FB7,0x1FB7,0x0391}, /* 1FB6 */ - {0x1FB8,0x1FB0,0x0391}, {0x1FB9,0x1FB1,0x0391}, /* 1FB8 */ - {0x1FBA,0x1F70,0x0391}, {0x1FBB,0x1F71,0x1FBB}, /* 1FBA */ - {0x1FBC,0x1FB3,0x0391}, {0x1FBD,0x1FBD,0x1FBD}, /* 1FBC */ - {0x0399,0x1FBE,0x0399}, {0x1FBF,0x1FBF,0x1FBF}, /* 1FBE */ - {0x1FC0,0x1FC0,0x1FC0}, {0x1FC1,0x1FC1,0x1FC1}, /* 1FC0 */ - {0x1FC2,0x1FC2,0x0397}, {0x1FCC,0x1FC3,0x0397}, /* 1FC2 */ - {0x1FC4,0x1FC4,0x0397}, {0x1FC5,0x1FC5,0x1FC5}, /* 1FC4 */ - {0x1FC6,0x1FC6,0x0397}, {0x1FC7,0x1FC7,0x0397}, /* 1FC6 */ - {0x1FC8,0x1F72,0x0395}, {0x1FC9,0x1F73,0x1FC9}, /* 1FC8 */ - {0x1FCA,0x1F74,0x0397}, {0x1FCB,0x1F75,0x1FCB}, /* 1FCA */ - {0x1FCC,0x1FC3,0x0397}, {0x1FCD,0x1FCD,0x1FCD}, /* 1FCC */ - {0x1FCE,0x1FCE,0x1FCE}, {0x1FCF,0x1FCF,0x1FCF}, /* 1FCE */ - {0x1FD8,0x1FD0,0x0399}, {0x1FD9,0x1FD1,0x0399}, /* 1FD0 */ - {0x1FD2,0x1FD2,0x0399}, {0x1FD3,0x1FD3,0x1FD3}, /* 1FD2 */ - {0x1FD4,0x1FD4,0x1FD4}, {0x1FD5,0x1FD5,0x1FD5}, /* 1FD4 */ - {0x1FD6,0x1FD6,0x0399}, {0x1FD7,0x1FD7,0x0399}, /* 1FD6 */ - {0x1FD8,0x1FD0,0x0399}, {0x1FD9,0x1FD1,0x0399}, /* 1FD8 */ - {0x1FDA,0x1F76,0x0399}, {0x1FDB,0x1F77,0x1FDB}, /* 1FDA */ - {0x1FDC,0x1FDC,0x1FDC}, {0x1FDD,0x1FDD,0x1FDD}, /* 1FDC */ - {0x1FDE,0x1FDE,0x1FDE}, {0x1FDF,0x1FDF,0x1FDF}, /* 1FDE */ - {0x1FE8,0x1FE0,0x03A5}, {0x1FE9,0x1FE1,0x03A5}, /* 1FE0 */ - {0x1FE2,0x1FE2,0x03A5}, {0x1FE3,0x1FE3,0x1FE3}, /* 1FE2 */ - {0x1FE4,0x1FE4,0x03A1}, {0x1FEC,0x1FE5,0x03A1}, /* 1FE4 */ - {0x1FE6,0x1FE6,0x03A5}, {0x1FE7,0x1FE7,0x03A5}, /* 1FE6 */ - {0x1FE8,0x1FE0,0x03A5}, {0x1FE9,0x1FE1,0x03A5}, /* 1FE8 */ - {0x1FEA,0x1F7A,0x03A5}, {0x1FEB,0x1F7B,0x1FEB}, /* 1FEA */ - {0x1FEC,0x1FE5,0x03A1}, {0x1FED,0x1FED,0x1FED}, /* 1FEC */ - {0x1FEE,0x1FEE,0x1FEE}, {0x1FEF,0x1FEF,0x1FEF}, /* 1FEE */ - {0x1FF0,0x1FF0,0x1FF0}, {0x1FF1,0x1FF1,0x1FF1}, /* 1FF0 */ - {0x1FF2,0x1FF2,0x03A9}, {0x1FFC,0x1FF3,0x03A9}, /* 1FF2 */ - {0x1FF4,0x1FF4,0x03A9}, {0x1FF5,0x1FF5,0x1FF5}, /* 1FF4 */ - {0x1FF6,0x1FF6,0x03A9}, {0x1FF7,0x1FF7,0x03A9}, /* 1FF6 */ - {0x1FF8,0x1F78,0x039F}, {0x1FF9,0x1F79,0x1FF9}, /* 1FF8 */ - {0x1FFA,0x1F7C,0x03A9}, {0x1FFB,0x1F7D,0x1FFB}, /* 1FFA */ - {0x1FFC,0x1FF3,0x03A9}, {0x1FFD,0x1FFD,0x1FFD}, /* 1FFC */ - {0x1FFE,0x1FFE,0x1FFE}, {0x1FFF,0x1FFF,0x1FFF} /* 1FFE */ -}; - -static MY_UNICASE_CHARACTER u520p21[]={ - {0x2100,0x2100,0x2100}, {0x2101,0x2101,0x2101}, /* 2100 */ - {0x2102,0x2102,0x2102}, {0x2103,0x2103,0x2103}, /* 2102 */ - {0x2104,0x2104,0x2104}, {0x2105,0x2105,0x2105}, /* 2104 */ - {0x2106,0x2106,0x2106}, {0x2107,0x2107,0x2107}, /* 2106 */ - {0x2108,0x2108,0x2108}, {0x2109,0x2109,0x2109}, /* 2108 */ - {0x210A,0x210A,0x210A}, {0x210B,0x210B,0x210B}, /* 210A */ - {0x210C,0x210C,0x210C}, {0x210D,0x210D,0x210D}, /* 210C */ - {0x210E,0x210E,0x210E}, {0x210F,0x210F,0x210F}, /* 210E */ - {0x2110,0x2110,0x2110}, {0x2111,0x2111,0x2111}, /* 2110 */ - {0x2112,0x2112,0x2112}, {0x2113,0x2113,0x2113}, /* 2112 */ - {0x2114,0x2114,0x2114}, {0x2115,0x2115,0x2115}, /* 2114 */ - {0x2116,0x2116,0x2116}, {0x2117,0x2117,0x2117}, /* 2116 */ - {0x2118,0x2118,0x2118}, {0x2119,0x2119,0x2119}, /* 2118 */ - {0x211A,0x211A,0x211A}, {0x211B,0x211B,0x211B}, /* 211A */ - {0x211C,0x211C,0x211C}, {0x211D,0x211D,0x211D}, /* 211C */ - {0x211E,0x211E,0x211E}, {0x211F,0x211F,0x211F}, /* 211E */ - {0x2120,0x2120,0x2120}, {0x2121,0x2121,0x2121}, /* 2120 */ - {0x2122,0x2122,0x2122}, {0x2123,0x2123,0x2123}, /* 2122 */ - {0x2124,0x2124,0x2124}, {0x2125,0x2125,0x2125}, /* 2124 */ - {0x2126,0x03C9,0x2126}, {0x2127,0x2127,0x2127}, /* 2126 */ - {0x2128,0x2128,0x2128}, {0x2129,0x2129,0x2129}, /* 2128 */ - {0x212A,0x006B,0x212A}, {0x212B,0x00E5,0x212B}, /* 212A */ - {0x212C,0x212C,0x212C}, {0x212D,0x212D,0x212D}, /* 212C */ - {0x212E,0x212E,0x212E}, {0x212F,0x212F,0x212F}, /* 212E */ - {0x2130,0x2130,0x2130}, {0x2131,0x2131,0x2131}, /* 2130 */ - {0x2132,0x214E,0x2132}, {0x2133,0x2133,0x2133}, /* 2132 */ - {0x2134,0x2134,0x2134}, {0x2135,0x2135,0x2135}, /* 2134 */ - {0x2136,0x2136,0x2136}, {0x2137,0x2137,0x2137}, /* 2136 */ - {0x2138,0x2138,0x2138}, {0x2139,0x2139,0x2139}, /* 2138 */ - {0x213A,0x213A,0x213A}, {0x213B,0x213B,0x213B}, /* 213A */ - {0x213C,0x213C,0x213C}, {0x213D,0x213D,0x213D}, /* 213C */ - {0x213E,0x213E,0x213E}, {0x213F,0x213F,0x213F}, /* 213E */ - {0x2140,0x2140,0x2140}, {0x2141,0x2141,0x2141}, /* 2140 */ - {0x2142,0x2142,0x2142}, {0x2143,0x2143,0x2143}, /* 2142 */ - {0x2144,0x2144,0x2144}, {0x2145,0x2145,0x2145}, /* 2144 */ - {0x2146,0x2146,0x2146}, {0x2147,0x2147,0x2147}, /* 2146 */ - {0x2148,0x2148,0x2148}, {0x2149,0x2149,0x2149}, /* 2148 */ - {0x214A,0x214A,0x214A}, {0x214B,0x214B,0x214B}, /* 214A */ - {0x214C,0x214C,0x214C}, {0x214D,0x214D,0x214D}, /* 214C */ - {0x2132,0x214E,0x2132}, {0x214F,0x214F,0x214F}, /* 214E */ - {0x2150,0x2150,0x2150}, {0x2151,0x2151,0x2151}, /* 2150 */ - {0x2152,0x2152,0x2152}, {0x2153,0x2153,0x2153}, /* 2152 */ - {0x2154,0x2154,0x2154}, {0x2155,0x2155,0x2155}, /* 2154 */ - {0x2156,0x2156,0x2156}, {0x2157,0x2157,0x2157}, /* 2156 */ - {0x2158,0x2158,0x2158}, {0x2159,0x2159,0x2159}, /* 2158 */ - {0x215A,0x215A,0x215A}, {0x215B,0x215B,0x215B}, /* 215A */ - {0x215C,0x215C,0x215C}, {0x215D,0x215D,0x215D}, /* 215C */ - {0x215E,0x215E,0x215E}, {0x215F,0x215F,0x215F}, /* 215E */ - {0x2160,0x2170,0x2160}, {0x2161,0x2171,0x2161}, /* 2160 */ - {0x2162,0x2172,0x2162}, {0x2163,0x2173,0x2163}, /* 2162 */ - {0x2164,0x2174,0x2164}, {0x2165,0x2175,0x2165}, /* 2164 */ - {0x2166,0x2176,0x2166}, {0x2167,0x2177,0x2167}, /* 2166 */ - {0x2168,0x2178,0x2168}, {0x2169,0x2179,0x2169}, /* 2168 */ - {0x216A,0x217A,0x216A}, {0x216B,0x217B,0x216B}, /* 216A */ - {0x216C,0x217C,0x216C}, {0x216D,0x217D,0x216D}, /* 216C */ - {0x216E,0x217E,0x216E}, {0x216F,0x217F,0x216F}, /* 216E */ - {0x2160,0x2170,0x2160}, {0x2161,0x2171,0x2161}, /* 2170 */ - {0x2162,0x2172,0x2162}, {0x2163,0x2173,0x2163}, /* 2172 */ - {0x2164,0x2174,0x2164}, {0x2165,0x2175,0x2165}, /* 2174 */ - {0x2166,0x2176,0x2166}, {0x2167,0x2177,0x2167}, /* 2176 */ - {0x2168,0x2178,0x2168}, {0x2169,0x2179,0x2169}, /* 2178 */ - {0x216A,0x217A,0x216A}, {0x216B,0x217B,0x216B}, /* 217A */ - {0x216C,0x217C,0x216C}, {0x216D,0x217D,0x216D}, /* 217C */ - {0x216E,0x217E,0x216E}, {0x216F,0x217F,0x216F}, /* 217E */ - {0x2180,0x2180,0x2180}, {0x2181,0x2181,0x2181}, /* 2180 */ - {0x2182,0x2182,0x2182}, {0x2183,0x2184,0x2183}, /* 2182 */ - {0x2183,0x2184,0x2183}, {0x2185,0x2185,0x2185}, /* 2184 */ - {0x2186,0x2186,0x2186}, {0x2187,0x2187,0x2187}, /* 2186 */ - {0x2188,0x2188,0x2188}, {0x2189,0x2189,0x2189}, /* 2188 */ - {0x218A,0x218A,0x218A}, {0x218B,0x218B,0x218B}, /* 218A */ - {0x218C,0x218C,0x218C}, {0x218D,0x218D,0x218D}, /* 218C */ - {0x218E,0x218E,0x218E}, {0x218F,0x218F,0x218F}, /* 218E */ - {0x2190,0x2190,0x2190}, {0x2191,0x2191,0x2191}, /* 2190 */ - {0x2192,0x2192,0x2192}, {0x2193,0x2193,0x2193}, /* 2192 */ - {0x2194,0x2194,0x2194}, {0x2195,0x2195,0x2195}, /* 2194 */ - {0x2196,0x2196,0x2196}, {0x2197,0x2197,0x2197}, /* 2196 */ - {0x2198,0x2198,0x2198}, {0x2199,0x2199,0x2199}, /* 2198 */ - {0x219A,0x219A,0x219A}, {0x219B,0x219B,0x219B}, /* 219A */ - {0x219C,0x219C,0x219C}, {0x219D,0x219D,0x219D}, /* 219C */ - {0x219E,0x219E,0x219E}, {0x219F,0x219F,0x219F}, /* 219E */ - {0x21A0,0x21A0,0x21A0}, {0x21A1,0x21A1,0x21A1}, /* 21A0 */ - {0x21A2,0x21A2,0x21A2}, {0x21A3,0x21A3,0x21A3}, /* 21A2 */ - {0x21A4,0x21A4,0x21A4}, {0x21A5,0x21A5,0x21A5}, /* 21A4 */ - {0x21A6,0x21A6,0x21A6}, {0x21A7,0x21A7,0x21A7}, /* 21A6 */ - {0x21A8,0x21A8,0x21A8}, {0x21A9,0x21A9,0x21A9}, /* 21A8 */ - {0x21AA,0x21AA,0x21AA}, {0x21AB,0x21AB,0x21AB}, /* 21AA */ - {0x21AC,0x21AC,0x21AC}, {0x21AD,0x21AD,0x21AD}, /* 21AC */ - {0x21AE,0x21AE,0x21AE}, {0x21AF,0x21AF,0x21AF}, /* 21AE */ - {0x21B0,0x21B0,0x21B0}, {0x21B1,0x21B1,0x21B1}, /* 21B0 */ - {0x21B2,0x21B2,0x21B2}, {0x21B3,0x21B3,0x21B3}, /* 21B2 */ - {0x21B4,0x21B4,0x21B4}, {0x21B5,0x21B5,0x21B5}, /* 21B4 */ - {0x21B6,0x21B6,0x21B6}, {0x21B7,0x21B7,0x21B7}, /* 21B6 */ - {0x21B8,0x21B8,0x21B8}, {0x21B9,0x21B9,0x21B9}, /* 21B8 */ - {0x21BA,0x21BA,0x21BA}, {0x21BB,0x21BB,0x21BB}, /* 21BA */ - {0x21BC,0x21BC,0x21BC}, {0x21BD,0x21BD,0x21BD}, /* 21BC */ - {0x21BE,0x21BE,0x21BE}, {0x21BF,0x21BF,0x21BF}, /* 21BE */ - {0x21C0,0x21C0,0x21C0}, {0x21C1,0x21C1,0x21C1}, /* 21C0 */ - {0x21C2,0x21C2,0x21C2}, {0x21C3,0x21C3,0x21C3}, /* 21C2 */ - {0x21C4,0x21C4,0x21C4}, {0x21C5,0x21C5,0x21C5}, /* 21C4 */ - {0x21C6,0x21C6,0x21C6}, {0x21C7,0x21C7,0x21C7}, /* 21C6 */ - {0x21C8,0x21C8,0x21C8}, {0x21C9,0x21C9,0x21C9}, /* 21C8 */ - {0x21CA,0x21CA,0x21CA}, {0x21CB,0x21CB,0x21CB}, /* 21CA */ - {0x21CC,0x21CC,0x21CC}, {0x21CD,0x21CD,0x21CD}, /* 21CC */ - {0x21CE,0x21CE,0x21CE}, {0x21CF,0x21CF,0x21CF}, /* 21CE */ - {0x21D0,0x21D0,0x21D0}, {0x21D1,0x21D1,0x21D1}, /* 21D0 */ - {0x21D2,0x21D2,0x21D2}, {0x21D3,0x21D3,0x21D3}, /* 21D2 */ - {0x21D4,0x21D4,0x21D4}, {0x21D5,0x21D5,0x21D5}, /* 21D4 */ - {0x21D6,0x21D6,0x21D6}, {0x21D7,0x21D7,0x21D7}, /* 21D6 */ - {0x21D8,0x21D8,0x21D8}, {0x21D9,0x21D9,0x21D9}, /* 21D8 */ - {0x21DA,0x21DA,0x21DA}, {0x21DB,0x21DB,0x21DB}, /* 21DA */ - {0x21DC,0x21DC,0x21DC}, {0x21DD,0x21DD,0x21DD}, /* 21DC */ - {0x21DE,0x21DE,0x21DE}, {0x21DF,0x21DF,0x21DF}, /* 21DE */ - {0x21E0,0x21E0,0x21E0}, {0x21E1,0x21E1,0x21E1}, /* 21E0 */ - {0x21E2,0x21E2,0x21E2}, {0x21E3,0x21E3,0x21E3}, /* 21E2 */ - {0x21E4,0x21E4,0x21E4}, {0x21E5,0x21E5,0x21E5}, /* 21E4 */ - {0x21E6,0x21E6,0x21E6}, {0x21E7,0x21E7,0x21E7}, /* 21E6 */ - {0x21E8,0x21E8,0x21E8}, {0x21E9,0x21E9,0x21E9}, /* 21E8 */ - {0x21EA,0x21EA,0x21EA}, {0x21EB,0x21EB,0x21EB}, /* 21EA */ - {0x21EC,0x21EC,0x21EC}, {0x21ED,0x21ED,0x21ED}, /* 21EC */ - {0x21EE,0x21EE,0x21EE}, {0x21EF,0x21EF,0x21EF}, /* 21EE */ - {0x21F0,0x21F0,0x21F0}, {0x21F1,0x21F1,0x21F1}, /* 21F0 */ - {0x21F2,0x21F2,0x21F2}, {0x21F3,0x21F3,0x21F3}, /* 21F2 */ - {0x21F4,0x21F4,0x21F4}, {0x21F5,0x21F5,0x21F5}, /* 21F4 */ - {0x21F6,0x21F6,0x21F6}, {0x21F7,0x21F7,0x21F7}, /* 21F6 */ - {0x21F8,0x21F8,0x21F8}, {0x21F9,0x21F9,0x21F9}, /* 21F8 */ - {0x21FA,0x21FA,0x21FA}, {0x21FB,0x21FB,0x21FB}, /* 21FA */ - {0x21FC,0x21FC,0x21FC}, {0x21FD,0x21FD,0x21FD}, /* 21FC */ - {0x21FE,0x21FE,0x21FE}, {0x21FF,0x21FF,0x21FF} /* 21FE */ -}; - -static MY_UNICASE_CHARACTER u520p24[]={ - {0x2400,0x2400,0x2400}, {0x2401,0x2401,0x2401}, /* 2400 */ - {0x2402,0x2402,0x2402}, {0x2403,0x2403,0x2403}, /* 2402 */ - {0x2404,0x2404,0x2404}, {0x2405,0x2405,0x2405}, /* 2404 */ - {0x2406,0x2406,0x2406}, {0x2407,0x2407,0x2407}, /* 2406 */ - {0x2408,0x2408,0x2408}, {0x2409,0x2409,0x2409}, /* 2408 */ - {0x240A,0x240A,0x240A}, {0x240B,0x240B,0x240B}, /* 240A */ - {0x240C,0x240C,0x240C}, {0x240D,0x240D,0x240D}, /* 240C */ - {0x240E,0x240E,0x240E}, {0x240F,0x240F,0x240F}, /* 240E */ - {0x2410,0x2410,0x2410}, {0x2411,0x2411,0x2411}, /* 2410 */ - {0x2412,0x2412,0x2412}, {0x2413,0x2413,0x2413}, /* 2412 */ - {0x2414,0x2414,0x2414}, {0x2415,0x2415,0x2415}, /* 2414 */ - {0x2416,0x2416,0x2416}, {0x2417,0x2417,0x2417}, /* 2416 */ - {0x2418,0x2418,0x2418}, {0x2419,0x2419,0x2419}, /* 2418 */ - {0x241A,0x241A,0x241A}, {0x241B,0x241B,0x241B}, /* 241A */ - {0x241C,0x241C,0x241C}, {0x241D,0x241D,0x241D}, /* 241C */ - {0x241E,0x241E,0x241E}, {0x241F,0x241F,0x241F}, /* 241E */ - {0x2420,0x2420,0x2420}, {0x2421,0x2421,0x2421}, /* 2420 */ - {0x2422,0x2422,0x2422}, {0x2423,0x2423,0x2423}, /* 2422 */ - {0x2424,0x2424,0x2424}, {0x2425,0x2425,0x2425}, /* 2424 */ - {0x2426,0x2426,0x2426}, {0x2427,0x2427,0x2427}, /* 2426 */ - {0x2428,0x2428,0x2428}, {0x2429,0x2429,0x2429}, /* 2428 */ - {0x242A,0x242A,0x242A}, {0x242B,0x242B,0x242B}, /* 242A */ - {0x242C,0x242C,0x242C}, {0x242D,0x242D,0x242D}, /* 242C */ - {0x242E,0x242E,0x242E}, {0x242F,0x242F,0x242F}, /* 242E */ - {0x2430,0x2430,0x2430}, {0x2431,0x2431,0x2431}, /* 2430 */ - {0x2432,0x2432,0x2432}, {0x2433,0x2433,0x2433}, /* 2432 */ - {0x2434,0x2434,0x2434}, {0x2435,0x2435,0x2435}, /* 2434 */ - {0x2436,0x2436,0x2436}, {0x2437,0x2437,0x2437}, /* 2436 */ - {0x2438,0x2438,0x2438}, {0x2439,0x2439,0x2439}, /* 2438 */ - {0x243A,0x243A,0x243A}, {0x243B,0x243B,0x243B}, /* 243A */ - {0x243C,0x243C,0x243C}, {0x243D,0x243D,0x243D}, /* 243C */ - {0x243E,0x243E,0x243E}, {0x243F,0x243F,0x243F}, /* 243E */ - {0x2440,0x2440,0x2440}, {0x2441,0x2441,0x2441}, /* 2440 */ - {0x2442,0x2442,0x2442}, {0x2443,0x2443,0x2443}, /* 2442 */ - {0x2444,0x2444,0x2444}, {0x2445,0x2445,0x2445}, /* 2444 */ - {0x2446,0x2446,0x2446}, {0x2447,0x2447,0x2447}, /* 2446 */ - {0x2448,0x2448,0x2448}, {0x2449,0x2449,0x2449}, /* 2448 */ - {0x244A,0x244A,0x244A}, {0x244B,0x244B,0x244B}, /* 244A */ - {0x244C,0x244C,0x244C}, {0x244D,0x244D,0x244D}, /* 244C */ - {0x244E,0x244E,0x244E}, {0x244F,0x244F,0x244F}, /* 244E */ - {0x2450,0x2450,0x2450}, {0x2451,0x2451,0x2451}, /* 2450 */ - {0x2452,0x2452,0x2452}, {0x2453,0x2453,0x2453}, /* 2452 */ - {0x2454,0x2454,0x2454}, {0x2455,0x2455,0x2455}, /* 2454 */ - {0x2456,0x2456,0x2456}, {0x2457,0x2457,0x2457}, /* 2456 */ - {0x2458,0x2458,0x2458}, {0x2459,0x2459,0x2459}, /* 2458 */ - {0x245A,0x245A,0x245A}, {0x245B,0x245B,0x245B}, /* 245A */ - {0x245C,0x245C,0x245C}, {0x245D,0x245D,0x245D}, /* 245C */ - {0x245E,0x245E,0x245E}, {0x245F,0x245F,0x245F}, /* 245E */ - {0x2460,0x2460,0x2460}, {0x2461,0x2461,0x2461}, /* 2460 */ - {0x2462,0x2462,0x2462}, {0x2463,0x2463,0x2463}, /* 2462 */ - {0x2464,0x2464,0x2464}, {0x2465,0x2465,0x2465}, /* 2464 */ - {0x2466,0x2466,0x2466}, {0x2467,0x2467,0x2467}, /* 2466 */ - {0x2468,0x2468,0x2468}, {0x2469,0x2469,0x2469}, /* 2468 */ - {0x246A,0x246A,0x246A}, {0x246B,0x246B,0x246B}, /* 246A */ - {0x246C,0x246C,0x246C}, {0x246D,0x246D,0x246D}, /* 246C */ - {0x246E,0x246E,0x246E}, {0x246F,0x246F,0x246F}, /* 246E */ - {0x2470,0x2470,0x2470}, {0x2471,0x2471,0x2471}, /* 2470 */ - {0x2472,0x2472,0x2472}, {0x2473,0x2473,0x2473}, /* 2472 */ - {0x2474,0x2474,0x2474}, {0x2475,0x2475,0x2475}, /* 2474 */ - {0x2476,0x2476,0x2476}, {0x2477,0x2477,0x2477}, /* 2476 */ - {0x2478,0x2478,0x2478}, {0x2479,0x2479,0x2479}, /* 2478 */ - {0x247A,0x247A,0x247A}, {0x247B,0x247B,0x247B}, /* 247A */ - {0x247C,0x247C,0x247C}, {0x247D,0x247D,0x247D}, /* 247C */ - {0x247E,0x247E,0x247E}, {0x247F,0x247F,0x247F}, /* 247E */ - {0x2480,0x2480,0x2480}, {0x2481,0x2481,0x2481}, /* 2480 */ - {0x2482,0x2482,0x2482}, {0x2483,0x2483,0x2483}, /* 2482 */ - {0x2484,0x2484,0x2484}, {0x2485,0x2485,0x2485}, /* 2484 */ - {0x2486,0x2486,0x2486}, {0x2487,0x2487,0x2487}, /* 2486 */ - {0x2488,0x2488,0x2488}, {0x2489,0x2489,0x2489}, /* 2488 */ - {0x248A,0x248A,0x248A}, {0x248B,0x248B,0x248B}, /* 248A */ - {0x248C,0x248C,0x248C}, {0x248D,0x248D,0x248D}, /* 248C */ - {0x248E,0x248E,0x248E}, {0x248F,0x248F,0x248F}, /* 248E */ - {0x2490,0x2490,0x2490}, {0x2491,0x2491,0x2491}, /* 2490 */ - {0x2492,0x2492,0x2492}, {0x2493,0x2493,0x2493}, /* 2492 */ - {0x2494,0x2494,0x2494}, {0x2495,0x2495,0x2495}, /* 2494 */ - {0x2496,0x2496,0x2496}, {0x2497,0x2497,0x2497}, /* 2496 */ - {0x2498,0x2498,0x2498}, {0x2499,0x2499,0x2499}, /* 2498 */ - {0x249A,0x249A,0x249A}, {0x249B,0x249B,0x249B}, /* 249A */ - {0x249C,0x249C,0x249C}, {0x249D,0x249D,0x249D}, /* 249C */ - {0x249E,0x249E,0x249E}, {0x249F,0x249F,0x249F}, /* 249E */ - {0x24A0,0x24A0,0x24A0}, {0x24A1,0x24A1,0x24A1}, /* 24A0 */ - {0x24A2,0x24A2,0x24A2}, {0x24A3,0x24A3,0x24A3}, /* 24A2 */ - {0x24A4,0x24A4,0x24A4}, {0x24A5,0x24A5,0x24A5}, /* 24A4 */ - {0x24A6,0x24A6,0x24A6}, {0x24A7,0x24A7,0x24A7}, /* 24A6 */ - {0x24A8,0x24A8,0x24A8}, {0x24A9,0x24A9,0x24A9}, /* 24A8 */ - {0x24AA,0x24AA,0x24AA}, {0x24AB,0x24AB,0x24AB}, /* 24AA */ - {0x24AC,0x24AC,0x24AC}, {0x24AD,0x24AD,0x24AD}, /* 24AC */ - {0x24AE,0x24AE,0x24AE}, {0x24AF,0x24AF,0x24AF}, /* 24AE */ - {0x24B0,0x24B0,0x24B0}, {0x24B1,0x24B1,0x24B1}, /* 24B0 */ - {0x24B2,0x24B2,0x24B2}, {0x24B3,0x24B3,0x24B3}, /* 24B2 */ - {0x24B4,0x24B4,0x24B4}, {0x24B5,0x24B5,0x24B5}, /* 24B4 */ - {0x24B6,0x24D0,0x24B6}, {0x24B7,0x24D1,0x24B7}, /* 24B6 */ - {0x24B8,0x24D2,0x24B8}, {0x24B9,0x24D3,0x24B9}, /* 24B8 */ - {0x24BA,0x24D4,0x24BA}, {0x24BB,0x24D5,0x24BB}, /* 24BA */ - {0x24BC,0x24D6,0x24BC}, {0x24BD,0x24D7,0x24BD}, /* 24BC */ - {0x24BE,0x24D8,0x24BE}, {0x24BF,0x24D9,0x24BF}, /* 24BE */ - {0x24C0,0x24DA,0x24C0}, {0x24C1,0x24DB,0x24C1}, /* 24C0 */ - {0x24C2,0x24DC,0x24C2}, {0x24C3,0x24DD,0x24C3}, /* 24C2 */ - {0x24C4,0x24DE,0x24C4}, {0x24C5,0x24DF,0x24C5}, /* 24C4 */ - {0x24C6,0x24E0,0x24C6}, {0x24C7,0x24E1,0x24C7}, /* 24C6 */ - {0x24C8,0x24E2,0x24C8}, {0x24C9,0x24E3,0x24C9}, /* 24C8 */ - {0x24CA,0x24E4,0x24CA}, {0x24CB,0x24E5,0x24CB}, /* 24CA */ - {0x24CC,0x24E6,0x24CC}, {0x24CD,0x24E7,0x24CD}, /* 24CC */ - {0x24CE,0x24E8,0x24CE}, {0x24CF,0x24E9,0x24CF}, /* 24CE */ - {0x24B6,0x24D0,0x24B6}, {0x24B7,0x24D1,0x24B7}, /* 24D0 */ - {0x24B8,0x24D2,0x24B8}, {0x24B9,0x24D3,0x24B9}, /* 24D2 */ - {0x24BA,0x24D4,0x24BA}, {0x24BB,0x24D5,0x24BB}, /* 24D4 */ - {0x24BC,0x24D6,0x24BC}, {0x24BD,0x24D7,0x24BD}, /* 24D6 */ - {0x24BE,0x24D8,0x24BE}, {0x24BF,0x24D9,0x24BF}, /* 24D8 */ - {0x24C0,0x24DA,0x24C0}, {0x24C1,0x24DB,0x24C1}, /* 24DA */ - {0x24C2,0x24DC,0x24C2}, {0x24C3,0x24DD,0x24C3}, /* 24DC */ - {0x24C4,0x24DE,0x24C4}, {0x24C5,0x24DF,0x24C5}, /* 24DE */ - {0x24C6,0x24E0,0x24C6}, {0x24C7,0x24E1,0x24C7}, /* 24E0 */ - {0x24C8,0x24E2,0x24C8}, {0x24C9,0x24E3,0x24C9}, /* 24E2 */ - {0x24CA,0x24E4,0x24CA}, {0x24CB,0x24E5,0x24CB}, /* 24E4 */ - {0x24CC,0x24E6,0x24CC}, {0x24CD,0x24E7,0x24CD}, /* 24E6 */ - {0x24CE,0x24E8,0x24CE}, {0x24CF,0x24E9,0x24CF}, /* 24E8 */ - {0x24EA,0x24EA,0x24EA}, {0x24EB,0x24EB,0x24EB}, /* 24EA */ - {0x24EC,0x24EC,0x24EC}, {0x24ED,0x24ED,0x24ED}, /* 24EC */ - {0x24EE,0x24EE,0x24EE}, {0x24EF,0x24EF,0x24EF}, /* 24EE */ - {0x24F0,0x24F0,0x24F0}, {0x24F1,0x24F1,0x24F1}, /* 24F0 */ - {0x24F2,0x24F2,0x24F2}, {0x24F3,0x24F3,0x24F3}, /* 24F2 */ - {0x24F4,0x24F4,0x24F4}, {0x24F5,0x24F5,0x24F5}, /* 24F4 */ - {0x24F6,0x24F6,0x24F6}, {0x24F7,0x24F7,0x24F7}, /* 24F6 */ - {0x24F8,0x24F8,0x24F8}, {0x24F9,0x24F9,0x24F9}, /* 24F8 */ - {0x24FA,0x24FA,0x24FA}, {0x24FB,0x24FB,0x24FB}, /* 24FA */ - {0x24FC,0x24FC,0x24FC}, {0x24FD,0x24FD,0x24FD}, /* 24FC */ - {0x24FE,0x24FE,0x24FE}, {0x24FF,0x24FF,0x24FF} /* 24FE */ -}; - -static MY_UNICASE_CHARACTER u520p2C[]={ - {0x2C00,0x2C30,0x2C00}, {0x2C01,0x2C31,0x2C01}, /* 2C00 */ - {0x2C02,0x2C32,0x2C02}, {0x2C03,0x2C33,0x2C03}, /* 2C02 */ - {0x2C04,0x2C34,0x2C04}, {0x2C05,0x2C35,0x2C05}, /* 2C04 */ - {0x2C06,0x2C36,0x2C06}, {0x2C07,0x2C37,0x2C07}, /* 2C06 */ - {0x2C08,0x2C38,0x2C08}, {0x2C09,0x2C39,0x2C09}, /* 2C08 */ - {0x2C0A,0x2C3A,0x2C0A}, {0x2C0B,0x2C3B,0x2C0B}, /* 2C0A */ - {0x2C0C,0x2C3C,0x2C0C}, {0x2C0D,0x2C3D,0x2C0D}, /* 2C0C */ - {0x2C0E,0x2C3E,0x2C0E}, {0x2C0F,0x2C3F,0x2C0F}, /* 2C0E */ - {0x2C10,0x2C40,0x2C10}, {0x2C11,0x2C41,0x2C11}, /* 2C10 */ - {0x2C12,0x2C42,0x2C12}, {0x2C13,0x2C43,0x2C13}, /* 2C12 */ - {0x2C14,0x2C44,0x2C14}, {0x2C15,0x2C45,0x2C15}, /* 2C14 */ - {0x2C16,0x2C46,0x2C16}, {0x2C17,0x2C47,0x2C17}, /* 2C16 */ - {0x2C18,0x2C48,0x2C18}, {0x2C19,0x2C49,0x2C19}, /* 2C18 */ - {0x2C1A,0x2C4A,0x2C1A}, {0x2C1B,0x2C4B,0x2C1B}, /* 2C1A */ - {0x2C1C,0x2C4C,0x2C1C}, {0x2C1D,0x2C4D,0x2C1D}, /* 2C1C */ - {0x2C1E,0x2C4E,0x2C1E}, {0x2C1F,0x2C4F,0x2C1F}, /* 2C1E */ - {0x2C20,0x2C50,0x2C20}, {0x2C21,0x2C51,0x2C21}, /* 2C20 */ - {0x2C22,0x2C52,0x2C22}, {0x2C23,0x2C53,0x2C23}, /* 2C22 */ - {0x2C24,0x2C54,0x2C24}, {0x2C25,0x2C55,0x2C25}, /* 2C24 */ - {0x2C26,0x2C56,0x2C26}, {0x2C27,0x2C57,0x2C27}, /* 2C26 */ - {0x2C28,0x2C58,0x2C28}, {0x2C29,0x2C59,0x2C29}, /* 2C28 */ - {0x2C2A,0x2C5A,0x2C2A}, {0x2C2B,0x2C5B,0x2C2B}, /* 2C2A */ - {0x2C2C,0x2C5C,0x2C2C}, {0x2C2D,0x2C5D,0x2C2D}, /* 2C2C */ - {0x2C2E,0x2C5E,0x2C2E}, {0x2C2F,0x2C2F,0x2C2F}, /* 2C2E */ - {0x2C00,0x2C30,0x2C00}, {0x2C01,0x2C31,0x2C01}, /* 2C30 */ - {0x2C02,0x2C32,0x2C02}, {0x2C03,0x2C33,0x2C03}, /* 2C32 */ - {0x2C04,0x2C34,0x2C04}, {0x2C05,0x2C35,0x2C05}, /* 2C34 */ - {0x2C06,0x2C36,0x2C06}, {0x2C07,0x2C37,0x2C07}, /* 2C36 */ - {0x2C08,0x2C38,0x2C08}, {0x2C09,0x2C39,0x2C09}, /* 2C38 */ - {0x2C0A,0x2C3A,0x2C0A}, {0x2C0B,0x2C3B,0x2C0B}, /* 2C3A */ - {0x2C0C,0x2C3C,0x2C0C}, {0x2C0D,0x2C3D,0x2C0D}, /* 2C3C */ - {0x2C0E,0x2C3E,0x2C0E}, {0x2C0F,0x2C3F,0x2C0F}, /* 2C3E */ - {0x2C10,0x2C40,0x2C10}, {0x2C11,0x2C41,0x2C11}, /* 2C40 */ - {0x2C12,0x2C42,0x2C12}, {0x2C13,0x2C43,0x2C13}, /* 2C42 */ - {0x2C14,0x2C44,0x2C14}, {0x2C15,0x2C45,0x2C15}, /* 2C44 */ - {0x2C16,0x2C46,0x2C16}, {0x2C17,0x2C47,0x2C17}, /* 2C46 */ - {0x2C18,0x2C48,0x2C18}, {0x2C19,0x2C49,0x2C19}, /* 2C48 */ - {0x2C1A,0x2C4A,0x2C1A}, {0x2C1B,0x2C4B,0x2C1B}, /* 2C4A */ - {0x2C1C,0x2C4C,0x2C1C}, {0x2C1D,0x2C4D,0x2C1D}, /* 2C4C */ - {0x2C1E,0x2C4E,0x2C1E}, {0x2C1F,0x2C4F,0x2C1F}, /* 2C4E */ - {0x2C20,0x2C50,0x2C20}, {0x2C21,0x2C51,0x2C21}, /* 2C50 */ - {0x2C22,0x2C52,0x2C22}, {0x2C23,0x2C53,0x2C23}, /* 2C52 */ - {0x2C24,0x2C54,0x2C24}, {0x2C25,0x2C55,0x2C25}, /* 2C54 */ - {0x2C26,0x2C56,0x2C26}, {0x2C27,0x2C57,0x2C27}, /* 2C56 */ - {0x2C28,0x2C58,0x2C28}, {0x2C29,0x2C59,0x2C29}, /* 2C58 */ - {0x2C2A,0x2C5A,0x2C2A}, {0x2C2B,0x2C5B,0x2C2B}, /* 2C5A */ - {0x2C2C,0x2C5C,0x2C2C}, {0x2C2D,0x2C5D,0x2C2D}, /* 2C5C */ - {0x2C2E,0x2C5E,0x2C2E}, {0x2C5F,0x2C5F,0x2C5F}, /* 2C5E */ - {0x2C60,0x2C61,0x2C60}, {0x2C60,0x2C61,0x2C60}, /* 2C60 */ - {0x2C62,0x026B,0x2C62}, {0x2C63,0x1D7D,0x2C63}, /* 2C62 */ - {0x2C64,0x027D,0x2C64}, {0x023A,0x2C65,0x023A}, /* 2C64 */ - {0x023E,0x2C66,0x023E}, {0x2C67,0x2C68,0x2C67}, /* 2C66 */ - {0x2C67,0x2C68,0x2C67}, {0x2C69,0x2C6A,0x2C69}, /* 2C68 */ - {0x2C69,0x2C6A,0x2C69}, {0x2C6B,0x2C6C,0x2C6B}, /* 2C6A */ - {0x2C6B,0x2C6C,0x2C6B}, {0x2C6D,0x0251,0x2C6D}, /* 2C6C */ - {0x2C6E,0x0271,0x2C6E}, {0x2C6F,0x0250,0x2C6F}, /* 2C6E */ - {0x2C70,0x0252,0x2C70}, {0x2C71,0x2C71,0x2C71}, /* 2C70 */ - {0x2C72,0x2C73,0x2C72}, {0x2C72,0x2C73,0x2C72}, /* 2C72 */ - {0x2C74,0x2C74,0x2C74}, {0x2C75,0x2C76,0x2C75}, /* 2C74 */ - {0x2C75,0x2C76,0x2C75}, {0x2C77,0x2C77,0x2C77}, /* 2C76 */ - {0x2C78,0x2C78,0x2C78}, {0x2C79,0x2C79,0x2C79}, /* 2C78 */ - {0x2C7A,0x2C7A,0x2C7A}, {0x2C7B,0x2C7B,0x2C7B}, /* 2C7A */ - {0x2C7C,0x2C7C,0x2C7C}, {0x2C7D,0x2C7D,0x2C7D}, /* 2C7C */ - {0x2C7E,0x023F,0x2C7E}, {0x2C7F,0x0240,0x2C7F}, /* 2C7E */ - {0x2C80,0x2C81,0x2C80}, {0x2C80,0x2C81,0x2C80}, /* 2C80 */ - {0x2C82,0x2C83,0x2C82}, {0x2C82,0x2C83,0x2C82}, /* 2C82 */ - {0x2C84,0x2C85,0x2C84}, {0x2C84,0x2C85,0x2C84}, /* 2C84 */ - {0x2C86,0x2C87,0x2C86}, {0x2C86,0x2C87,0x2C86}, /* 2C86 */ - {0x2C88,0x2C89,0x2C88}, {0x2C88,0x2C89,0x2C88}, /* 2C88 */ - {0x2C8A,0x2C8B,0x2C8A}, {0x2C8A,0x2C8B,0x2C8A}, /* 2C8A */ - {0x2C8C,0x2C8D,0x2C8C}, {0x2C8C,0x2C8D,0x2C8C}, /* 2C8C */ - {0x2C8E,0x2C8F,0x2C8E}, {0x2C8E,0x2C8F,0x2C8E}, /* 2C8E */ - {0x2C90,0x2C91,0x2C90}, {0x2C90,0x2C91,0x2C90}, /* 2C90 */ - {0x2C92,0x2C93,0x2C92}, {0x2C92,0x2C93,0x2C92}, /* 2C92 */ - {0x2C94,0x2C95,0x2C94}, {0x2C94,0x2C95,0x2C94}, /* 2C94 */ - {0x2C96,0x2C97,0x2C96}, {0x2C96,0x2C97,0x2C96}, /* 2C96 */ - {0x2C98,0x2C99,0x2C98}, {0x2C98,0x2C99,0x2C98}, /* 2C98 */ - {0x2C9A,0x2C9B,0x2C9A}, {0x2C9A,0x2C9B,0x2C9A}, /* 2C9A */ - {0x2C9C,0x2C9D,0x2C9C}, {0x2C9C,0x2C9D,0x2C9C}, /* 2C9C */ - {0x2C9E,0x2C9F,0x2C9E}, {0x2C9E,0x2C9F,0x2C9E}, /* 2C9E */ - {0x2CA0,0x2CA1,0x2CA0}, {0x2CA0,0x2CA1,0x2CA0}, /* 2CA0 */ - {0x2CA2,0x2CA3,0x2CA2}, {0x2CA2,0x2CA3,0x2CA2}, /* 2CA2 */ - {0x2CA4,0x2CA5,0x2CA4}, {0x2CA4,0x2CA5,0x2CA4}, /* 2CA4 */ - {0x2CA6,0x2CA7,0x2CA6}, {0x2CA6,0x2CA7,0x2CA6}, /* 2CA6 */ - {0x2CA8,0x2CA9,0x2CA8}, {0x2CA8,0x2CA9,0x2CA8}, /* 2CA8 */ - {0x2CAA,0x2CAB,0x2CAA}, {0x2CAA,0x2CAB,0x2CAA}, /* 2CAA */ - {0x2CAC,0x2CAD,0x2CAC}, {0x2CAC,0x2CAD,0x2CAC}, /* 2CAC */ - {0x2CAE,0x2CAF,0x2CAE}, {0x2CAE,0x2CAF,0x2CAE}, /* 2CAE */ - {0x2CB0,0x2CB1,0x2CB0}, {0x2CB0,0x2CB1,0x2CB0}, /* 2CB0 */ - {0x2CB2,0x2CB3,0x2CB2}, {0x2CB2,0x2CB3,0x2CB2}, /* 2CB2 */ - {0x2CB4,0x2CB5,0x2CB4}, {0x2CB4,0x2CB5,0x2CB4}, /* 2CB4 */ - {0x2CB6,0x2CB7,0x2CB6}, {0x2CB6,0x2CB7,0x2CB6}, /* 2CB6 */ - {0x2CB8,0x2CB9,0x2CB8}, {0x2CB8,0x2CB9,0x2CB8}, /* 2CB8 */ - {0x2CBA,0x2CBB,0x2CBA}, {0x2CBA,0x2CBB,0x2CBA}, /* 2CBA */ - {0x2CBC,0x2CBD,0x2CBC}, {0x2CBC,0x2CBD,0x2CBC}, /* 2CBC */ - {0x2CBE,0x2CBF,0x2CBE}, {0x2CBE,0x2CBF,0x2CBE}, /* 2CBE */ - {0x2CC0,0x2CC1,0x2CC0}, {0x2CC0,0x2CC1,0x2CC0}, /* 2CC0 */ - {0x2CC2,0x2CC3,0x2CC2}, {0x2CC2,0x2CC3,0x2CC2}, /* 2CC2 */ - {0x2CC4,0x2CC5,0x2CC4}, {0x2CC4,0x2CC5,0x2CC4}, /* 2CC4 */ - {0x2CC6,0x2CC7,0x2CC6}, {0x2CC6,0x2CC7,0x2CC6}, /* 2CC6 */ - {0x2CC8,0x2CC9,0x2CC8}, {0x2CC8,0x2CC9,0x2CC8}, /* 2CC8 */ - {0x2CCA,0x2CCB,0x2CCA}, {0x2CCA,0x2CCB,0x2CCA}, /* 2CCA */ - {0x2CCC,0x2CCD,0x2CCC}, {0x2CCC,0x2CCD,0x2CCC}, /* 2CCC */ - {0x2CCE,0x2CCF,0x2CCE}, {0x2CCE,0x2CCF,0x2CCE}, /* 2CCE */ - {0x2CD0,0x2CD1,0x2CD0}, {0x2CD0,0x2CD1,0x2CD0}, /* 2CD0 */ - {0x2CD2,0x2CD3,0x2CD2}, {0x2CD2,0x2CD3,0x2CD2}, /* 2CD2 */ - {0x2CD4,0x2CD5,0x2CD4}, {0x2CD4,0x2CD5,0x2CD4}, /* 2CD4 */ - {0x2CD6,0x2CD7,0x2CD6}, {0x2CD6,0x2CD7,0x2CD6}, /* 2CD6 */ - {0x2CD8,0x2CD9,0x2CD8}, {0x2CD8,0x2CD9,0x2CD8}, /* 2CD8 */ - {0x2CDA,0x2CDB,0x2CDA}, {0x2CDA,0x2CDB,0x2CDA}, /* 2CDA */ - {0x2CDC,0x2CDD,0x2CDC}, {0x2CDC,0x2CDD,0x2CDC}, /* 2CDC */ - {0x2CDE,0x2CDF,0x2CDE}, {0x2CDE,0x2CDF,0x2CDE}, /* 2CDE */ - {0x2CE0,0x2CE1,0x2CE0}, {0x2CE0,0x2CE1,0x2CE0}, /* 2CE0 */ - {0x2CE2,0x2CE3,0x2CE2}, {0x2CE2,0x2CE3,0x2CE2}, /* 2CE2 */ - {0x2CE4,0x2CE4,0x2CE4}, {0x2CE5,0x2CE5,0x2CE5}, /* 2CE4 */ - {0x2CE6,0x2CE6,0x2CE6}, {0x2CE7,0x2CE7,0x2CE7}, /* 2CE6 */ - {0x2CE8,0x2CE8,0x2CE8}, {0x2CE9,0x2CE9,0x2CE9}, /* 2CE8 */ - {0x2CEA,0x2CEA,0x2CEA}, {0x2CEB,0x2CEC,0x2CEB}, /* 2CEA */ - {0x2CEB,0x2CEC,0x2CEB}, {0x2CED,0x2CEE,0x2CED}, /* 2CEC */ - {0x2CED,0x2CEE,0x2CED}, {0x2CEF,0x2CEF,0x2CEF}, /* 2CEE */ - {0x2CF0,0x2CF0,0x2CF0}, {0x2CF1,0x2CF1,0x2CF1}, /* 2CF0 */ - {0x2CF2,0x2CF2,0x2CF2}, {0x2CF3,0x2CF3,0x2CF3}, /* 2CF2 */ - {0x2CF4,0x2CF4,0x2CF4}, {0x2CF5,0x2CF5,0x2CF5}, /* 2CF4 */ - {0x2CF6,0x2CF6,0x2CF6}, {0x2CF7,0x2CF7,0x2CF7}, /* 2CF6 */ - {0x2CF8,0x2CF8,0x2CF8}, {0x2CF9,0x2CF9,0x2CF9}, /* 2CF8 */ - {0x2CFA,0x2CFA,0x2CFA}, {0x2CFB,0x2CFB,0x2CFB}, /* 2CFA */ - {0x2CFC,0x2CFC,0x2CFC}, {0x2CFD,0x2CFD,0x2CFD}, /* 2CFC */ - {0x2CFE,0x2CFE,0x2CFE}, {0x2CFF,0x2CFF,0x2CFF} /* 2CFE */ -}; - -static MY_UNICASE_CHARACTER u520p2D[]={ - {0x10A0,0x2D00,0x10A0}, {0x10A1,0x2D01,0x10A1}, /* 2D00 */ - {0x10A2,0x2D02,0x10A2}, {0x10A3,0x2D03,0x10A3}, /* 2D02 */ - {0x10A4,0x2D04,0x10A4}, {0x10A5,0x2D05,0x10A5}, /* 2D04 */ - {0x10A6,0x2D06,0x10A6}, {0x10A7,0x2D07,0x10A7}, /* 2D06 */ - {0x10A8,0x2D08,0x10A8}, {0x10A9,0x2D09,0x10A9}, /* 2D08 */ - {0x10AA,0x2D0A,0x10AA}, {0x10AB,0x2D0B,0x10AB}, /* 2D0A */ - {0x10AC,0x2D0C,0x10AC}, {0x10AD,0x2D0D,0x10AD}, /* 2D0C */ - {0x10AE,0x2D0E,0x10AE}, {0x10AF,0x2D0F,0x10AF}, /* 2D0E */ - {0x10B0,0x2D10,0x10B0}, {0x10B1,0x2D11,0x10B1}, /* 2D10 */ - {0x10B2,0x2D12,0x10B2}, {0x10B3,0x2D13,0x10B3}, /* 2D12 */ - {0x10B4,0x2D14,0x10B4}, {0x10B5,0x2D15,0x10B5}, /* 2D14 */ - {0x10B6,0x2D16,0x10B6}, {0x10B7,0x2D17,0x10B7}, /* 2D16 */ - {0x10B8,0x2D18,0x10B8}, {0x10B9,0x2D19,0x10B9}, /* 2D18 */ - {0x10BA,0x2D1A,0x10BA}, {0x10BB,0x2D1B,0x10BB}, /* 2D1A */ - {0x10BC,0x2D1C,0x10BC}, {0x10BD,0x2D1D,0x10BD}, /* 2D1C */ - {0x10BE,0x2D1E,0x10BE}, {0x10BF,0x2D1F,0x10BF}, /* 2D1E */ - {0x10C0,0x2D20,0x10C0}, {0x10C1,0x2D21,0x10C1}, /* 2D20 */ - {0x10C2,0x2D22,0x10C2}, {0x10C3,0x2D23,0x10C3}, /* 2D22 */ - {0x10C4,0x2D24,0x10C4}, {0x10C5,0x2D25,0x10C5}, /* 2D24 */ - {0x2D26,0x2D26,0x2D26}, {0x2D27,0x2D27,0x2D27}, /* 2D26 */ - {0x2D28,0x2D28,0x2D28}, {0x2D29,0x2D29,0x2D29}, /* 2D28 */ - {0x2D2A,0x2D2A,0x2D2A}, {0x2D2B,0x2D2B,0x2D2B}, /* 2D2A */ - {0x2D2C,0x2D2C,0x2D2C}, {0x2D2D,0x2D2D,0x2D2D}, /* 2D2C */ - {0x2D2E,0x2D2E,0x2D2E}, {0x2D2F,0x2D2F,0x2D2F}, /* 2D2E */ - {0x2D30,0x2D30,0x2D30}, {0x2D31,0x2D31,0x2D31}, /* 2D30 */ - {0x2D32,0x2D32,0x2D32}, {0x2D33,0x2D33,0x2D33}, /* 2D32 */ - {0x2D34,0x2D34,0x2D34}, {0x2D35,0x2D35,0x2D35}, /* 2D34 */ - {0x2D36,0x2D36,0x2D36}, {0x2D37,0x2D37,0x2D37}, /* 2D36 */ - {0x2D38,0x2D38,0x2D38}, {0x2D39,0x2D39,0x2D39}, /* 2D38 */ - {0x2D3A,0x2D3A,0x2D3A}, {0x2D3B,0x2D3B,0x2D3B}, /* 2D3A */ - {0x2D3C,0x2D3C,0x2D3C}, {0x2D3D,0x2D3D,0x2D3D}, /* 2D3C */ - {0x2D3E,0x2D3E,0x2D3E}, {0x2D3F,0x2D3F,0x2D3F}, /* 2D3E */ - {0x2D40,0x2D40,0x2D40}, {0x2D41,0x2D41,0x2D41}, /* 2D40 */ - {0x2D42,0x2D42,0x2D42}, {0x2D43,0x2D43,0x2D43}, /* 2D42 */ - {0x2D44,0x2D44,0x2D44}, {0x2D45,0x2D45,0x2D45}, /* 2D44 */ - {0x2D46,0x2D46,0x2D46}, {0x2D47,0x2D47,0x2D47}, /* 2D46 */ - {0x2D48,0x2D48,0x2D48}, {0x2D49,0x2D49,0x2D49}, /* 2D48 */ - {0x2D4A,0x2D4A,0x2D4A}, {0x2D4B,0x2D4B,0x2D4B}, /* 2D4A */ - {0x2D4C,0x2D4C,0x2D4C}, {0x2D4D,0x2D4D,0x2D4D}, /* 2D4C */ - {0x2D4E,0x2D4E,0x2D4E}, {0x2D4F,0x2D4F,0x2D4F}, /* 2D4E */ - {0x2D50,0x2D50,0x2D50}, {0x2D51,0x2D51,0x2D51}, /* 2D50 */ - {0x2D52,0x2D52,0x2D52}, {0x2D53,0x2D53,0x2D53}, /* 2D52 */ - {0x2D54,0x2D54,0x2D54}, {0x2D55,0x2D55,0x2D55}, /* 2D54 */ - {0x2D56,0x2D56,0x2D56}, {0x2D57,0x2D57,0x2D57}, /* 2D56 */ - {0x2D58,0x2D58,0x2D58}, {0x2D59,0x2D59,0x2D59}, /* 2D58 */ - {0x2D5A,0x2D5A,0x2D5A}, {0x2D5B,0x2D5B,0x2D5B}, /* 2D5A */ - {0x2D5C,0x2D5C,0x2D5C}, {0x2D5D,0x2D5D,0x2D5D}, /* 2D5C */ - {0x2D5E,0x2D5E,0x2D5E}, {0x2D5F,0x2D5F,0x2D5F}, /* 2D5E */ - {0x2D60,0x2D60,0x2D60}, {0x2D61,0x2D61,0x2D61}, /* 2D60 */ - {0x2D62,0x2D62,0x2D62}, {0x2D63,0x2D63,0x2D63}, /* 2D62 */ - {0x2D64,0x2D64,0x2D64}, {0x2D65,0x2D65,0x2D65}, /* 2D64 */ - {0x2D66,0x2D66,0x2D66}, {0x2D67,0x2D67,0x2D67}, /* 2D66 */ - {0x2D68,0x2D68,0x2D68}, {0x2D69,0x2D69,0x2D69}, /* 2D68 */ - {0x2D6A,0x2D6A,0x2D6A}, {0x2D6B,0x2D6B,0x2D6B}, /* 2D6A */ - {0x2D6C,0x2D6C,0x2D6C}, {0x2D6D,0x2D6D,0x2D6D}, /* 2D6C */ - {0x2D6E,0x2D6E,0x2D6E}, {0x2D6F,0x2D6F,0x2D6F}, /* 2D6E */ - {0x2D70,0x2D70,0x2D70}, {0x2D71,0x2D71,0x2D71}, /* 2D70 */ - {0x2D72,0x2D72,0x2D72}, {0x2D73,0x2D73,0x2D73}, /* 2D72 */ - {0x2D74,0x2D74,0x2D74}, {0x2D75,0x2D75,0x2D75}, /* 2D74 */ - {0x2D76,0x2D76,0x2D76}, {0x2D77,0x2D77,0x2D77}, /* 2D76 */ - {0x2D78,0x2D78,0x2D78}, {0x2D79,0x2D79,0x2D79}, /* 2D78 */ - {0x2D7A,0x2D7A,0x2D7A}, {0x2D7B,0x2D7B,0x2D7B}, /* 2D7A */ - {0x2D7C,0x2D7C,0x2D7C}, {0x2D7D,0x2D7D,0x2D7D}, /* 2D7C */ - {0x2D7E,0x2D7E,0x2D7E}, {0x2D7F,0x2D7F,0x2D7F}, /* 2D7E */ - {0x2D80,0x2D80,0x2D80}, {0x2D81,0x2D81,0x2D81}, /* 2D80 */ - {0x2D82,0x2D82,0x2D82}, {0x2D83,0x2D83,0x2D83}, /* 2D82 */ - {0x2D84,0x2D84,0x2D84}, {0x2D85,0x2D85,0x2D85}, /* 2D84 */ - {0x2D86,0x2D86,0x2D86}, {0x2D87,0x2D87,0x2D87}, /* 2D86 */ - {0x2D88,0x2D88,0x2D88}, {0x2D89,0x2D89,0x2D89}, /* 2D88 */ - {0x2D8A,0x2D8A,0x2D8A}, {0x2D8B,0x2D8B,0x2D8B}, /* 2D8A */ - {0x2D8C,0x2D8C,0x2D8C}, {0x2D8D,0x2D8D,0x2D8D}, /* 2D8C */ - {0x2D8E,0x2D8E,0x2D8E}, {0x2D8F,0x2D8F,0x2D8F}, /* 2D8E */ - {0x2D90,0x2D90,0x2D90}, {0x2D91,0x2D91,0x2D91}, /* 2D90 */ - {0x2D92,0x2D92,0x2D92}, {0x2D93,0x2D93,0x2D93}, /* 2D92 */ - {0x2D94,0x2D94,0x2D94}, {0x2D95,0x2D95,0x2D95}, /* 2D94 */ - {0x2D96,0x2D96,0x2D96}, {0x2D97,0x2D97,0x2D97}, /* 2D96 */ - {0x2D98,0x2D98,0x2D98}, {0x2D99,0x2D99,0x2D99}, /* 2D98 */ - {0x2D9A,0x2D9A,0x2D9A}, {0x2D9B,0x2D9B,0x2D9B}, /* 2D9A */ - {0x2D9C,0x2D9C,0x2D9C}, {0x2D9D,0x2D9D,0x2D9D}, /* 2D9C */ - {0x2D9E,0x2D9E,0x2D9E}, {0x2D9F,0x2D9F,0x2D9F}, /* 2D9E */ - {0x2DA0,0x2DA0,0x2DA0}, {0x2DA1,0x2DA1,0x2DA1}, /* 2DA0 */ - {0x2DA2,0x2DA2,0x2DA2}, {0x2DA3,0x2DA3,0x2DA3}, /* 2DA2 */ - {0x2DA4,0x2DA4,0x2DA4}, {0x2DA5,0x2DA5,0x2DA5}, /* 2DA4 */ - {0x2DA6,0x2DA6,0x2DA6}, {0x2DA7,0x2DA7,0x2DA7}, /* 2DA6 */ - {0x2DA8,0x2DA8,0x2DA8}, {0x2DA9,0x2DA9,0x2DA9}, /* 2DA8 */ - {0x2DAA,0x2DAA,0x2DAA}, {0x2DAB,0x2DAB,0x2DAB}, /* 2DAA */ - {0x2DAC,0x2DAC,0x2DAC}, {0x2DAD,0x2DAD,0x2DAD}, /* 2DAC */ - {0x2DAE,0x2DAE,0x2DAE}, {0x2DAF,0x2DAF,0x2DAF}, /* 2DAE */ - {0x2DB0,0x2DB0,0x2DB0}, {0x2DB1,0x2DB1,0x2DB1}, /* 2DB0 */ - {0x2DB2,0x2DB2,0x2DB2}, {0x2DB3,0x2DB3,0x2DB3}, /* 2DB2 */ - {0x2DB4,0x2DB4,0x2DB4}, {0x2DB5,0x2DB5,0x2DB5}, /* 2DB4 */ - {0x2DB6,0x2DB6,0x2DB6}, {0x2DB7,0x2DB7,0x2DB7}, /* 2DB6 */ - {0x2DB8,0x2DB8,0x2DB8}, {0x2DB9,0x2DB9,0x2DB9}, /* 2DB8 */ - {0x2DBA,0x2DBA,0x2DBA}, {0x2DBB,0x2DBB,0x2DBB}, /* 2DBA */ - {0x2DBC,0x2DBC,0x2DBC}, {0x2DBD,0x2DBD,0x2DBD}, /* 2DBC */ - {0x2DBE,0x2DBE,0x2DBE}, {0x2DBF,0x2DBF,0x2DBF}, /* 2DBE */ - {0x2DC0,0x2DC0,0x2DC0}, {0x2DC1,0x2DC1,0x2DC1}, /* 2DC0 */ - {0x2DC2,0x2DC2,0x2DC2}, {0x2DC3,0x2DC3,0x2DC3}, /* 2DC2 */ - {0x2DC4,0x2DC4,0x2DC4}, {0x2DC5,0x2DC5,0x2DC5}, /* 2DC4 */ - {0x2DC6,0x2DC6,0x2DC6}, {0x2DC7,0x2DC7,0x2DC7}, /* 2DC6 */ - {0x2DC8,0x2DC8,0x2DC8}, {0x2DC9,0x2DC9,0x2DC9}, /* 2DC8 */ - {0x2DCA,0x2DCA,0x2DCA}, {0x2DCB,0x2DCB,0x2DCB}, /* 2DCA */ - {0x2DCC,0x2DCC,0x2DCC}, {0x2DCD,0x2DCD,0x2DCD}, /* 2DCC */ - {0x2DCE,0x2DCE,0x2DCE}, {0x2DCF,0x2DCF,0x2DCF}, /* 2DCE */ - {0x2DD0,0x2DD0,0x2DD0}, {0x2DD1,0x2DD1,0x2DD1}, /* 2DD0 */ - {0x2DD2,0x2DD2,0x2DD2}, {0x2DD3,0x2DD3,0x2DD3}, /* 2DD2 */ - {0x2DD4,0x2DD4,0x2DD4}, {0x2DD5,0x2DD5,0x2DD5}, /* 2DD4 */ - {0x2DD6,0x2DD6,0x2DD6}, {0x2DD7,0x2DD7,0x2DD7}, /* 2DD6 */ - {0x2DD8,0x2DD8,0x2DD8}, {0x2DD9,0x2DD9,0x2DD9}, /* 2DD8 */ - {0x2DDA,0x2DDA,0x2DDA}, {0x2DDB,0x2DDB,0x2DDB}, /* 2DDA */ - {0x2DDC,0x2DDC,0x2DDC}, {0x2DDD,0x2DDD,0x2DDD}, /* 2DDC */ - {0x2DDE,0x2DDE,0x2DDE}, {0x2DDF,0x2DDF,0x2DDF}, /* 2DDE */ - {0x2DE0,0x2DE0,0x2DE0}, {0x2DE1,0x2DE1,0x2DE1}, /* 2DE0 */ - {0x2DE2,0x2DE2,0x2DE2}, {0x2DE3,0x2DE3,0x2DE3}, /* 2DE2 */ - {0x2DE4,0x2DE4,0x2DE4}, {0x2DE5,0x2DE5,0x2DE5}, /* 2DE4 */ - {0x2DE6,0x2DE6,0x2DE6}, {0x2DE7,0x2DE7,0x2DE7}, /* 2DE6 */ - {0x2DE8,0x2DE8,0x2DE8}, {0x2DE9,0x2DE9,0x2DE9}, /* 2DE8 */ - {0x2DEA,0x2DEA,0x2DEA}, {0x2DEB,0x2DEB,0x2DEB}, /* 2DEA */ - {0x2DEC,0x2DEC,0x2DEC}, {0x2DED,0x2DED,0x2DED}, /* 2DEC */ - {0x2DEE,0x2DEE,0x2DEE}, {0x2DEF,0x2DEF,0x2DEF}, /* 2DEE */ - {0x2DF0,0x2DF0,0x2DF0}, {0x2DF1,0x2DF1,0x2DF1}, /* 2DF0 */ - {0x2DF2,0x2DF2,0x2DF2}, {0x2DF3,0x2DF3,0x2DF3}, /* 2DF2 */ - {0x2DF4,0x2DF4,0x2DF4}, {0x2DF5,0x2DF5,0x2DF5}, /* 2DF4 */ - {0x2DF6,0x2DF6,0x2DF6}, {0x2DF7,0x2DF7,0x2DF7}, /* 2DF6 */ - {0x2DF8,0x2DF8,0x2DF8}, {0x2DF9,0x2DF9,0x2DF9}, /* 2DF8 */ - {0x2DFA,0x2DFA,0x2DFA}, {0x2DFB,0x2DFB,0x2DFB}, /* 2DFA */ - {0x2DFC,0x2DFC,0x2DFC}, {0x2DFD,0x2DFD,0x2DFD}, /* 2DFC */ - {0x2DFE,0x2DFE,0x2DFE}, {0x2DFF,0x2DFF,0x2DFF} /* 2DFE */ -}; - -static MY_UNICASE_CHARACTER u520pA6[]={ - {0xA600,0xA600,0xA600}, {0xA601,0xA601,0xA601}, /* A600 */ - {0xA602,0xA602,0xA602}, {0xA603,0xA603,0xA603}, /* A602 */ - {0xA604,0xA604,0xA604}, {0xA605,0xA605,0xA605}, /* A604 */ - {0xA606,0xA606,0xA606}, {0xA607,0xA607,0xA607}, /* A606 */ - {0xA608,0xA608,0xA608}, {0xA609,0xA609,0xA609}, /* A608 */ - {0xA60A,0xA60A,0xA60A}, {0xA60B,0xA60B,0xA60B}, /* A60A */ - {0xA60C,0xA60C,0xA60C}, {0xA60D,0xA60D,0xA60D}, /* A60C */ - {0xA60E,0xA60E,0xA60E}, {0xA60F,0xA60F,0xA60F}, /* A60E */ - {0xA610,0xA610,0xA610}, {0xA611,0xA611,0xA611}, /* A610 */ - {0xA612,0xA612,0xA612}, {0xA613,0xA613,0xA613}, /* A612 */ - {0xA614,0xA614,0xA614}, {0xA615,0xA615,0xA615}, /* A614 */ - {0xA616,0xA616,0xA616}, {0xA617,0xA617,0xA617}, /* A616 */ - {0xA618,0xA618,0xA618}, {0xA619,0xA619,0xA619}, /* A618 */ - {0xA61A,0xA61A,0xA61A}, {0xA61B,0xA61B,0xA61B}, /* A61A */ - {0xA61C,0xA61C,0xA61C}, {0xA61D,0xA61D,0xA61D}, /* A61C */ - {0xA61E,0xA61E,0xA61E}, {0xA61F,0xA61F,0xA61F}, /* A61E */ - {0xA620,0xA620,0xA620}, {0xA621,0xA621,0xA621}, /* A620 */ - {0xA622,0xA622,0xA622}, {0xA623,0xA623,0xA623}, /* A622 */ - {0xA624,0xA624,0xA624}, {0xA625,0xA625,0xA625}, /* A624 */ - {0xA626,0xA626,0xA626}, {0xA627,0xA627,0xA627}, /* A626 */ - {0xA628,0xA628,0xA628}, {0xA629,0xA629,0xA629}, /* A628 */ - {0xA62A,0xA62A,0xA62A}, {0xA62B,0xA62B,0xA62B}, /* A62A */ - {0xA62C,0xA62C,0xA62C}, {0xA62D,0xA62D,0xA62D}, /* A62C */ - {0xA62E,0xA62E,0xA62E}, {0xA62F,0xA62F,0xA62F}, /* A62E */ - {0xA630,0xA630,0xA630}, {0xA631,0xA631,0xA631}, /* A630 */ - {0xA632,0xA632,0xA632}, {0xA633,0xA633,0xA633}, /* A632 */ - {0xA634,0xA634,0xA634}, {0xA635,0xA635,0xA635}, /* A634 */ - {0xA636,0xA636,0xA636}, {0xA637,0xA637,0xA637}, /* A636 */ - {0xA638,0xA638,0xA638}, {0xA639,0xA639,0xA639}, /* A638 */ - {0xA63A,0xA63A,0xA63A}, {0xA63B,0xA63B,0xA63B}, /* A63A */ - {0xA63C,0xA63C,0xA63C}, {0xA63D,0xA63D,0xA63D}, /* A63C */ - {0xA63E,0xA63E,0xA63E}, {0xA63F,0xA63F,0xA63F}, /* A63E */ - {0xA640,0xA641,0xA640}, {0xA640,0xA641,0xA640}, /* A640 */ - {0xA642,0xA643,0xA642}, {0xA642,0xA643,0xA642}, /* A642 */ - {0xA644,0xA645,0xA644}, {0xA644,0xA645,0xA644}, /* A644 */ - {0xA646,0xA647,0xA646}, {0xA646,0xA647,0xA646}, /* A646 */ - {0xA648,0xA649,0xA648}, {0xA648,0xA649,0xA648}, /* A648 */ - {0xA64A,0xA64B,0xA64A}, {0xA64A,0xA64B,0xA64A}, /* A64A */ - {0xA64C,0xA64D,0xA64C}, {0xA64C,0xA64D,0xA64C}, /* A64C */ - {0xA64E,0xA64F,0xA64E}, {0xA64E,0xA64F,0xA64E}, /* A64E */ - {0xA650,0xA651,0xA650}, {0xA650,0xA651,0xA650}, /* A650 */ - {0xA652,0xA653,0xA652}, {0xA652,0xA653,0xA652}, /* A652 */ - {0xA654,0xA655,0xA654}, {0xA654,0xA655,0xA654}, /* A654 */ - {0xA656,0xA657,0xA656}, {0xA656,0xA657,0xA656}, /* A656 */ - {0xA658,0xA659,0xA658}, {0xA658,0xA659,0xA658}, /* A658 */ - {0xA65A,0xA65B,0xA65A}, {0xA65A,0xA65B,0xA65A}, /* A65A */ - {0xA65C,0xA65D,0xA65C}, {0xA65C,0xA65D,0xA65C}, /* A65C */ - {0xA65E,0xA65F,0xA65E}, {0xA65E,0xA65F,0xA65E}, /* A65E */ - {0xA660,0xA660,0xA660}, {0xA661,0xA661,0xA661}, /* A660 */ - {0xA662,0xA663,0xA662}, {0xA662,0xA663,0xA662}, /* A662 */ - {0xA664,0xA665,0xA664}, {0xA664,0xA665,0xA664}, /* A664 */ - {0xA666,0xA667,0xA666}, {0xA666,0xA667,0xA666}, /* A666 */ - {0xA668,0xA669,0xA668}, {0xA668,0xA669,0xA668}, /* A668 */ - {0xA66A,0xA66B,0xA66A}, {0xA66A,0xA66B,0xA66A}, /* A66A */ - {0xA66C,0xA66D,0xA66C}, {0xA66C,0xA66D,0xA66C}, /* A66C */ - {0xA66E,0xA66E,0xA66E}, {0xA66F,0xA66F,0xA66F}, /* A66E */ - {0xA670,0xA670,0xA670}, {0xA671,0xA671,0xA671}, /* A670 */ - {0xA672,0xA672,0xA672}, {0xA673,0xA673,0xA673}, /* A672 */ - {0xA674,0xA674,0xA674}, {0xA675,0xA675,0xA675}, /* A674 */ - {0xA676,0xA676,0xA676}, {0xA677,0xA677,0xA677}, /* A676 */ - {0xA678,0xA678,0xA678}, {0xA679,0xA679,0xA679}, /* A678 */ - {0xA67A,0xA67A,0xA67A}, {0xA67B,0xA67B,0xA67B}, /* A67A */ - {0xA67C,0xA67C,0xA67C}, {0xA67D,0xA67D,0xA67D}, /* A67C */ - {0xA67E,0xA67E,0xA67E}, {0xA67F,0xA67F,0xA67F}, /* A67E */ - {0xA680,0xA681,0xA680}, {0xA680,0xA681,0xA680}, /* A680 */ - {0xA682,0xA683,0xA682}, {0xA682,0xA683,0xA682}, /* A682 */ - {0xA684,0xA685,0xA684}, {0xA684,0xA685,0xA684}, /* A684 */ - {0xA686,0xA687,0xA686}, {0xA686,0xA687,0xA686}, /* A686 */ - {0xA688,0xA689,0xA688}, {0xA688,0xA689,0xA688}, /* A688 */ - {0xA68A,0xA68B,0xA68A}, {0xA68A,0xA68B,0xA68A}, /* A68A */ - {0xA68C,0xA68D,0xA68C}, {0xA68C,0xA68D,0xA68C}, /* A68C */ - {0xA68E,0xA68F,0xA68E}, {0xA68E,0xA68F,0xA68E}, /* A68E */ - {0xA690,0xA691,0xA690}, {0xA690,0xA691,0xA690}, /* A690 */ - {0xA692,0xA693,0xA692}, {0xA692,0xA693,0xA692}, /* A692 */ - {0xA694,0xA695,0xA694}, {0xA694,0xA695,0xA694}, /* A694 */ - {0xA696,0xA697,0xA696}, {0xA696,0xA697,0xA696}, /* A696 */ - {0xA698,0xA698,0xA698}, {0xA699,0xA699,0xA699}, /* A698 */ - {0xA69A,0xA69A,0xA69A}, {0xA69B,0xA69B,0xA69B}, /* A69A */ - {0xA69C,0xA69C,0xA69C}, {0xA69D,0xA69D,0xA69D}, /* A69C */ - {0xA69E,0xA69E,0xA69E}, {0xA69F,0xA69F,0xA69F}, /* A69E */ - {0xA6A0,0xA6A0,0xA6A0}, {0xA6A1,0xA6A1,0xA6A1}, /* A6A0 */ - {0xA6A2,0xA6A2,0xA6A2}, {0xA6A3,0xA6A3,0xA6A3}, /* A6A2 */ - {0xA6A4,0xA6A4,0xA6A4}, {0xA6A5,0xA6A5,0xA6A5}, /* A6A4 */ - {0xA6A6,0xA6A6,0xA6A6}, {0xA6A7,0xA6A7,0xA6A7}, /* A6A6 */ - {0xA6A8,0xA6A8,0xA6A8}, {0xA6A9,0xA6A9,0xA6A9}, /* A6A8 */ - {0xA6AA,0xA6AA,0xA6AA}, {0xA6AB,0xA6AB,0xA6AB}, /* A6AA */ - {0xA6AC,0xA6AC,0xA6AC}, {0xA6AD,0xA6AD,0xA6AD}, /* A6AC */ - {0xA6AE,0xA6AE,0xA6AE}, {0xA6AF,0xA6AF,0xA6AF}, /* A6AE */ - {0xA6B0,0xA6B0,0xA6B0}, {0xA6B1,0xA6B1,0xA6B1}, /* A6B0 */ - {0xA6B2,0xA6B2,0xA6B2}, {0xA6B3,0xA6B3,0xA6B3}, /* A6B2 */ - {0xA6B4,0xA6B4,0xA6B4}, {0xA6B5,0xA6B5,0xA6B5}, /* A6B4 */ - {0xA6B6,0xA6B6,0xA6B6}, {0xA6B7,0xA6B7,0xA6B7}, /* A6B6 */ - {0xA6B8,0xA6B8,0xA6B8}, {0xA6B9,0xA6B9,0xA6B9}, /* A6B8 */ - {0xA6BA,0xA6BA,0xA6BA}, {0xA6BB,0xA6BB,0xA6BB}, /* A6BA */ - {0xA6BC,0xA6BC,0xA6BC}, {0xA6BD,0xA6BD,0xA6BD}, /* A6BC */ - {0xA6BE,0xA6BE,0xA6BE}, {0xA6BF,0xA6BF,0xA6BF}, /* A6BE */ - {0xA6C0,0xA6C0,0xA6C0}, {0xA6C1,0xA6C1,0xA6C1}, /* A6C0 */ - {0xA6C2,0xA6C2,0xA6C2}, {0xA6C3,0xA6C3,0xA6C3}, /* A6C2 */ - {0xA6C4,0xA6C4,0xA6C4}, {0xA6C5,0xA6C5,0xA6C5}, /* A6C4 */ - {0xA6C6,0xA6C6,0xA6C6}, {0xA6C7,0xA6C7,0xA6C7}, /* A6C6 */ - {0xA6C8,0xA6C8,0xA6C8}, {0xA6C9,0xA6C9,0xA6C9}, /* A6C8 */ - {0xA6CA,0xA6CA,0xA6CA}, {0xA6CB,0xA6CB,0xA6CB}, /* A6CA */ - {0xA6CC,0xA6CC,0xA6CC}, {0xA6CD,0xA6CD,0xA6CD}, /* A6CC */ - {0xA6CE,0xA6CE,0xA6CE}, {0xA6CF,0xA6CF,0xA6CF}, /* A6CE */ - {0xA6D0,0xA6D0,0xA6D0}, {0xA6D1,0xA6D1,0xA6D1}, /* A6D0 */ - {0xA6D2,0xA6D2,0xA6D2}, {0xA6D3,0xA6D3,0xA6D3}, /* A6D2 */ - {0xA6D4,0xA6D4,0xA6D4}, {0xA6D5,0xA6D5,0xA6D5}, /* A6D4 */ - {0xA6D6,0xA6D6,0xA6D6}, {0xA6D7,0xA6D7,0xA6D7}, /* A6D6 */ - {0xA6D8,0xA6D8,0xA6D8}, {0xA6D9,0xA6D9,0xA6D9}, /* A6D8 */ - {0xA6DA,0xA6DA,0xA6DA}, {0xA6DB,0xA6DB,0xA6DB}, /* A6DA */ - {0xA6DC,0xA6DC,0xA6DC}, {0xA6DD,0xA6DD,0xA6DD}, /* A6DC */ - {0xA6DE,0xA6DE,0xA6DE}, {0xA6DF,0xA6DF,0xA6DF}, /* A6DE */ - {0xA6E0,0xA6E0,0xA6E0}, {0xA6E1,0xA6E1,0xA6E1}, /* A6E0 */ - {0xA6E2,0xA6E2,0xA6E2}, {0xA6E3,0xA6E3,0xA6E3}, /* A6E2 */ - {0xA6E4,0xA6E4,0xA6E4}, {0xA6E5,0xA6E5,0xA6E5}, /* A6E4 */ - {0xA6E6,0xA6E6,0xA6E6}, {0xA6E7,0xA6E7,0xA6E7}, /* A6E6 */ - {0xA6E8,0xA6E8,0xA6E8}, {0xA6E9,0xA6E9,0xA6E9}, /* A6E8 */ - {0xA6EA,0xA6EA,0xA6EA}, {0xA6EB,0xA6EB,0xA6EB}, /* A6EA */ - {0xA6EC,0xA6EC,0xA6EC}, {0xA6ED,0xA6ED,0xA6ED}, /* A6EC */ - {0xA6EE,0xA6EE,0xA6EE}, {0xA6EF,0xA6EF,0xA6EF}, /* A6EE */ - {0xA6F0,0xA6F0,0xA6F0}, {0xA6F1,0xA6F1,0xA6F1}, /* A6F0 */ - {0xA6F2,0xA6F2,0xA6F2}, {0xA6F3,0xA6F3,0xA6F3}, /* A6F2 */ - {0xA6F4,0xA6F4,0xA6F4}, {0xA6F5,0xA6F5,0xA6F5}, /* A6F4 */ - {0xA6F6,0xA6F6,0xA6F6}, {0xA6F7,0xA6F7,0xA6F7}, /* A6F6 */ - {0xA6F8,0xA6F8,0xA6F8}, {0xA6F9,0xA6F9,0xA6F9}, /* A6F8 */ - {0xA6FA,0xA6FA,0xA6FA}, {0xA6FB,0xA6FB,0xA6FB}, /* A6FA */ - {0xA6FC,0xA6FC,0xA6FC}, {0xA6FD,0xA6FD,0xA6FD}, /* A6FC */ - {0xA6FE,0xA6FE,0xA6FE}, {0xA6FF,0xA6FF,0xA6FF} /* A6FE */ -}; - -static MY_UNICASE_CHARACTER u520pA7[]={ - {0xA700,0xA700,0xA700}, {0xA701,0xA701,0xA701}, /* A700 */ - {0xA702,0xA702,0xA702}, {0xA703,0xA703,0xA703}, /* A702 */ - {0xA704,0xA704,0xA704}, {0xA705,0xA705,0xA705}, /* A704 */ - {0xA706,0xA706,0xA706}, {0xA707,0xA707,0xA707}, /* A706 */ - {0xA708,0xA708,0xA708}, {0xA709,0xA709,0xA709}, /* A708 */ - {0xA70A,0xA70A,0xA70A}, {0xA70B,0xA70B,0xA70B}, /* A70A */ - {0xA70C,0xA70C,0xA70C}, {0xA70D,0xA70D,0xA70D}, /* A70C */ - {0xA70E,0xA70E,0xA70E}, {0xA70F,0xA70F,0xA70F}, /* A70E */ - {0xA710,0xA710,0xA710}, {0xA711,0xA711,0xA711}, /* A710 */ - {0xA712,0xA712,0xA712}, {0xA713,0xA713,0xA713}, /* A712 */ - {0xA714,0xA714,0xA714}, {0xA715,0xA715,0xA715}, /* A714 */ - {0xA716,0xA716,0xA716}, {0xA717,0xA717,0xA717}, /* A716 */ - {0xA718,0xA718,0xA718}, {0xA719,0xA719,0xA719}, /* A718 */ - {0xA71A,0xA71A,0xA71A}, {0xA71B,0xA71B,0xA71B}, /* A71A */ - {0xA71C,0xA71C,0xA71C}, {0xA71D,0xA71D,0xA71D}, /* A71C */ - {0xA71E,0xA71E,0xA71E}, {0xA71F,0xA71F,0xA71F}, /* A71E */ - {0xA720,0xA720,0xA720}, {0xA721,0xA721,0xA721}, /* A720 */ - {0xA722,0xA723,0xA722}, {0xA722,0xA723,0xA722}, /* A722 */ - {0xA724,0xA725,0xA724}, {0xA724,0xA725,0xA724}, /* A724 */ - {0xA726,0xA727,0xA726}, {0xA726,0xA727,0xA726}, /* A726 */ - {0xA728,0xA729,0xA728}, {0xA728,0xA729,0xA728}, /* A728 */ - {0xA72A,0xA72B,0xA72A}, {0xA72A,0xA72B,0xA72A}, /* A72A */ - {0xA72C,0xA72D,0xA72C}, {0xA72C,0xA72D,0xA72C}, /* A72C */ - {0xA72E,0xA72F,0xA72E}, {0xA72E,0xA72F,0xA72E}, /* A72E */ - {0xA730,0xA730,0xA730}, {0xA731,0xA731,0xA731}, /* A730 */ - {0xA732,0xA733,0xA732}, {0xA732,0xA733,0xA732}, /* A732 */ - {0xA734,0xA735,0xA734}, {0xA734,0xA735,0xA734}, /* A734 */ - {0xA736,0xA737,0xA736}, {0xA736,0xA737,0xA736}, /* A736 */ - {0xA738,0xA739,0xA738}, {0xA738,0xA739,0xA738}, /* A738 */ - {0xA73A,0xA73B,0xA73A}, {0xA73A,0xA73B,0xA73A}, /* A73A */ - {0xA73C,0xA73D,0xA73C}, {0xA73C,0xA73D,0xA73C}, /* A73C */ - {0xA73E,0xA73F,0xA73E}, {0xA73E,0xA73F,0xA73E}, /* A73E */ - {0xA740,0xA741,0xA740}, {0xA740,0xA741,0xA740}, /* A740 */ - {0xA742,0xA743,0xA742}, {0xA742,0xA743,0xA742}, /* A742 */ - {0xA744,0xA745,0xA744}, {0xA744,0xA745,0xA744}, /* A744 */ - {0xA746,0xA747,0xA746}, {0xA746,0xA747,0xA746}, /* A746 */ - {0xA748,0xA749,0xA748}, {0xA748,0xA749,0xA748}, /* A748 */ - {0xA74A,0xA74B,0xA74A}, {0xA74A,0xA74B,0xA74A}, /* A74A */ - {0xA74C,0xA74D,0xA74C}, {0xA74C,0xA74D,0xA74C}, /* A74C */ - {0xA74E,0xA74F,0xA74E}, {0xA74E,0xA74F,0xA74E}, /* A74E */ - {0xA750,0xA751,0xA750}, {0xA750,0xA751,0xA750}, /* A750 */ - {0xA752,0xA753,0xA752}, {0xA752,0xA753,0xA752}, /* A752 */ - {0xA754,0xA755,0xA754}, {0xA754,0xA755,0xA754}, /* A754 */ - {0xA756,0xA757,0xA756}, {0xA756,0xA757,0xA756}, /* A756 */ - {0xA758,0xA759,0xA758}, {0xA758,0xA759,0xA758}, /* A758 */ - {0xA75A,0xA75B,0xA75A}, {0xA75A,0xA75B,0xA75A}, /* A75A */ - {0xA75C,0xA75D,0xA75C}, {0xA75C,0xA75D,0xA75C}, /* A75C */ - {0xA75E,0xA75F,0xA75E}, {0xA75E,0xA75F,0xA75E}, /* A75E */ - {0xA760,0xA761,0xA760}, {0xA760,0xA761,0xA760}, /* A760 */ - {0xA762,0xA763,0xA762}, {0xA762,0xA763,0xA762}, /* A762 */ - {0xA764,0xA765,0xA764}, {0xA764,0xA765,0xA764}, /* A764 */ - {0xA766,0xA767,0xA766}, {0xA766,0xA767,0xA766}, /* A766 */ - {0xA768,0xA769,0xA768}, {0xA768,0xA769,0xA768}, /* A768 */ - {0xA76A,0xA76B,0xA76A}, {0xA76A,0xA76B,0xA76A}, /* A76A */ - {0xA76C,0xA76D,0xA76C}, {0xA76C,0xA76D,0xA76C}, /* A76C */ - {0xA76E,0xA76F,0xA76E}, {0xA76E,0xA76F,0xA76E}, /* A76E */ - {0xA770,0xA770,0xA770}, {0xA771,0xA771,0xA771}, /* A770 */ - {0xA772,0xA772,0xA772}, {0xA773,0xA773,0xA773}, /* A772 */ - {0xA774,0xA774,0xA774}, {0xA775,0xA775,0xA775}, /* A774 */ - {0xA776,0xA776,0xA776}, {0xA777,0xA777,0xA777}, /* A776 */ - {0xA778,0xA778,0xA778}, {0xA779,0xA77A,0xA779}, /* A778 */ - {0xA779,0xA77A,0xA779}, {0xA77B,0xA77C,0xA77B}, /* A77A */ - {0xA77B,0xA77C,0xA77B}, {0xA77D,0x1D79,0xA77D}, /* A77C */ - {0xA77E,0xA77F,0xA77E}, {0xA77E,0xA77F,0xA77E}, /* A77E */ - {0xA780,0xA781,0xA780}, {0xA780,0xA781,0xA780}, /* A780 */ - {0xA782,0xA783,0xA782}, {0xA782,0xA783,0xA782}, /* A782 */ - {0xA784,0xA785,0xA784}, {0xA784,0xA785,0xA784}, /* A784 */ - {0xA786,0xA787,0xA786}, {0xA786,0xA787,0xA786}, /* A786 */ - {0xA788,0xA788,0xA788}, {0xA789,0xA789,0xA789}, /* A788 */ - {0xA78A,0xA78A,0xA78A}, {0xA78B,0xA78C,0xA78B}, /* A78A */ - {0xA78B,0xA78C,0xA78B}, {0xA78D,0xA78D,0xA78D}, /* A78C */ - {0xA78E,0xA78E,0xA78E}, {0xA78F,0xA78F,0xA78F}, /* A78E */ - {0xA790,0xA790,0xA790}, {0xA791,0xA791,0xA791}, /* A790 */ - {0xA792,0xA792,0xA792}, {0xA793,0xA793,0xA793}, /* A792 */ - {0xA794,0xA794,0xA794}, {0xA795,0xA795,0xA795}, /* A794 */ - {0xA796,0xA796,0xA796}, {0xA797,0xA797,0xA797}, /* A796 */ - {0xA798,0xA798,0xA798}, {0xA799,0xA799,0xA799}, /* A798 */ - {0xA79A,0xA79A,0xA79A}, {0xA79B,0xA79B,0xA79B}, /* A79A */ - {0xA79C,0xA79C,0xA79C}, {0xA79D,0xA79D,0xA79D}, /* A79C */ - {0xA79E,0xA79E,0xA79E}, {0xA79F,0xA79F,0xA79F}, /* A79E */ - {0xA7A0,0xA7A0,0xA7A0}, {0xA7A1,0xA7A1,0xA7A1}, /* A7A0 */ - {0xA7A2,0xA7A2,0xA7A2}, {0xA7A3,0xA7A3,0xA7A3}, /* A7A2 */ - {0xA7A4,0xA7A4,0xA7A4}, {0xA7A5,0xA7A5,0xA7A5}, /* A7A4 */ - {0xA7A6,0xA7A6,0xA7A6}, {0xA7A7,0xA7A7,0xA7A7}, /* A7A6 */ - {0xA7A8,0xA7A8,0xA7A8}, {0xA7A9,0xA7A9,0xA7A9}, /* A7A8 */ - {0xA7AA,0xA7AA,0xA7AA}, {0xA7AB,0xA7AB,0xA7AB}, /* A7AA */ - {0xA7AC,0xA7AC,0xA7AC}, {0xA7AD,0xA7AD,0xA7AD}, /* A7AC */ - {0xA7AE,0xA7AE,0xA7AE}, {0xA7AF,0xA7AF,0xA7AF}, /* A7AE */ - {0xA7B0,0xA7B0,0xA7B0}, {0xA7B1,0xA7B1,0xA7B1}, /* A7B0 */ - {0xA7B2,0xA7B2,0xA7B2}, {0xA7B3,0xA7B3,0xA7B3}, /* A7B2 */ - {0xA7B4,0xA7B4,0xA7B4}, {0xA7B5,0xA7B5,0xA7B5}, /* A7B4 */ - {0xA7B6,0xA7B6,0xA7B6}, {0xA7B7,0xA7B7,0xA7B7}, /* A7B6 */ - {0xA7B8,0xA7B8,0xA7B8}, {0xA7B9,0xA7B9,0xA7B9}, /* A7B8 */ - {0xA7BA,0xA7BA,0xA7BA}, {0xA7BB,0xA7BB,0xA7BB}, /* A7BA */ - {0xA7BC,0xA7BC,0xA7BC}, {0xA7BD,0xA7BD,0xA7BD}, /* A7BC */ - {0xA7BE,0xA7BE,0xA7BE}, {0xA7BF,0xA7BF,0xA7BF}, /* A7BE */ - {0xA7C0,0xA7C0,0xA7C0}, {0xA7C1,0xA7C1,0xA7C1}, /* A7C0 */ - {0xA7C2,0xA7C2,0xA7C2}, {0xA7C3,0xA7C3,0xA7C3}, /* A7C2 */ - {0xA7C4,0xA7C4,0xA7C4}, {0xA7C5,0xA7C5,0xA7C5}, /* A7C4 */ - {0xA7C6,0xA7C6,0xA7C6}, {0xA7C7,0xA7C7,0xA7C7}, /* A7C6 */ - {0xA7C8,0xA7C8,0xA7C8}, {0xA7C9,0xA7C9,0xA7C9}, /* A7C8 */ - {0xA7CA,0xA7CA,0xA7CA}, {0xA7CB,0xA7CB,0xA7CB}, /* A7CA */ - {0xA7CC,0xA7CC,0xA7CC}, {0xA7CD,0xA7CD,0xA7CD}, /* A7CC */ - {0xA7CE,0xA7CE,0xA7CE}, {0xA7CF,0xA7CF,0xA7CF}, /* A7CE */ - {0xA7D0,0xA7D0,0xA7D0}, {0xA7D1,0xA7D1,0xA7D1}, /* A7D0 */ - {0xA7D2,0xA7D2,0xA7D2}, {0xA7D3,0xA7D3,0xA7D3}, /* A7D2 */ - {0xA7D4,0xA7D4,0xA7D4}, {0xA7D5,0xA7D5,0xA7D5}, /* A7D4 */ - {0xA7D6,0xA7D6,0xA7D6}, {0xA7D7,0xA7D7,0xA7D7}, /* A7D6 */ - {0xA7D8,0xA7D8,0xA7D8}, {0xA7D9,0xA7D9,0xA7D9}, /* A7D8 */ - {0xA7DA,0xA7DA,0xA7DA}, {0xA7DB,0xA7DB,0xA7DB}, /* A7DA */ - {0xA7DC,0xA7DC,0xA7DC}, {0xA7DD,0xA7DD,0xA7DD}, /* A7DC */ - {0xA7DE,0xA7DE,0xA7DE}, {0xA7DF,0xA7DF,0xA7DF}, /* A7DE */ - {0xA7E0,0xA7E0,0xA7E0}, {0xA7E1,0xA7E1,0xA7E1}, /* A7E0 */ - {0xA7E2,0xA7E2,0xA7E2}, {0xA7E3,0xA7E3,0xA7E3}, /* A7E2 */ - {0xA7E4,0xA7E4,0xA7E4}, {0xA7E5,0xA7E5,0xA7E5}, /* A7E4 */ - {0xA7E6,0xA7E6,0xA7E6}, {0xA7E7,0xA7E7,0xA7E7}, /* A7E6 */ - {0xA7E8,0xA7E8,0xA7E8}, {0xA7E9,0xA7E9,0xA7E9}, /* A7E8 */ - {0xA7EA,0xA7EA,0xA7EA}, {0xA7EB,0xA7EB,0xA7EB}, /* A7EA */ - {0xA7EC,0xA7EC,0xA7EC}, {0xA7ED,0xA7ED,0xA7ED}, /* A7EC */ - {0xA7EE,0xA7EE,0xA7EE}, {0xA7EF,0xA7EF,0xA7EF}, /* A7EE */ - {0xA7F0,0xA7F0,0xA7F0}, {0xA7F1,0xA7F1,0xA7F1}, /* A7F0 */ - {0xA7F2,0xA7F2,0xA7F2}, {0xA7F3,0xA7F3,0xA7F3}, /* A7F2 */ - {0xA7F4,0xA7F4,0xA7F4}, {0xA7F5,0xA7F5,0xA7F5}, /* A7F4 */ - {0xA7F6,0xA7F6,0xA7F6}, {0xA7F7,0xA7F7,0xA7F7}, /* A7F6 */ - {0xA7F8,0xA7F8,0xA7F8}, {0xA7F9,0xA7F9,0xA7F9}, /* A7F8 */ - {0xA7FA,0xA7FA,0xA7FA}, {0xA7FB,0xA7FB,0xA7FB}, /* A7FA */ - {0xA7FC,0xA7FC,0xA7FC}, {0xA7FD,0xA7FD,0xA7FD}, /* A7FC */ - {0xA7FE,0xA7FE,0xA7FE}, {0xA7FF,0xA7FF,0xA7FF} /* A7FE */ -}; - -static MY_UNICASE_CHARACTER u520pFF[]={ - {0xFF00,0xFF00,0xFF00}, {0xFF01,0xFF01,0xFF01}, /* FF00 */ - {0xFF02,0xFF02,0xFF02}, {0xFF03,0xFF03,0xFF03}, /* FF02 */ - {0xFF04,0xFF04,0xFF04}, {0xFF05,0xFF05,0xFF05}, /* FF04 */ - {0xFF06,0xFF06,0xFF06}, {0xFF07,0xFF07,0xFF07}, /* FF06 */ - {0xFF08,0xFF08,0xFF08}, {0xFF09,0xFF09,0xFF09}, /* FF08 */ - {0xFF0A,0xFF0A,0xFF0A}, {0xFF0B,0xFF0B,0xFF0B}, /* FF0A */ - {0xFF0C,0xFF0C,0xFF0C}, {0xFF0D,0xFF0D,0xFF0D}, /* FF0C */ - {0xFF0E,0xFF0E,0xFF0E}, {0xFF0F,0xFF0F,0xFF0F}, /* FF0E */ - {0xFF10,0xFF10,0xFF10}, {0xFF11,0xFF11,0xFF11}, /* FF10 */ - {0xFF12,0xFF12,0xFF12}, {0xFF13,0xFF13,0xFF13}, /* FF12 */ - {0xFF14,0xFF14,0xFF14}, {0xFF15,0xFF15,0xFF15}, /* FF14 */ - {0xFF16,0xFF16,0xFF16}, {0xFF17,0xFF17,0xFF17}, /* FF16 */ - {0xFF18,0xFF18,0xFF18}, {0xFF19,0xFF19,0xFF19}, /* FF18 */ - {0xFF1A,0xFF1A,0xFF1A}, {0xFF1B,0xFF1B,0xFF1B}, /* FF1A */ - {0xFF1C,0xFF1C,0xFF1C}, {0xFF1D,0xFF1D,0xFF1D}, /* FF1C */ - {0xFF1E,0xFF1E,0xFF1E}, {0xFF1F,0xFF1F,0xFF1F}, /* FF1E */ - {0xFF20,0xFF20,0xFF20}, {0xFF21,0xFF41,0xFF21}, /* FF20 */ - {0xFF22,0xFF42,0xFF22}, {0xFF23,0xFF43,0xFF23}, /* FF22 */ - {0xFF24,0xFF44,0xFF24}, {0xFF25,0xFF45,0xFF25}, /* FF24 */ - {0xFF26,0xFF46,0xFF26}, {0xFF27,0xFF47,0xFF27}, /* FF26 */ - {0xFF28,0xFF48,0xFF28}, {0xFF29,0xFF49,0xFF29}, /* FF28 */ - {0xFF2A,0xFF4A,0xFF2A}, {0xFF2B,0xFF4B,0xFF2B}, /* FF2A */ - {0xFF2C,0xFF4C,0xFF2C}, {0xFF2D,0xFF4D,0xFF2D}, /* FF2C */ - {0xFF2E,0xFF4E,0xFF2E}, {0xFF2F,0xFF4F,0xFF2F}, /* FF2E */ - {0xFF30,0xFF50,0xFF30}, {0xFF31,0xFF51,0xFF31}, /* FF30 */ - {0xFF32,0xFF52,0xFF32}, {0xFF33,0xFF53,0xFF33}, /* FF32 */ - {0xFF34,0xFF54,0xFF34}, {0xFF35,0xFF55,0xFF35}, /* FF34 */ - {0xFF36,0xFF56,0xFF36}, {0xFF37,0xFF57,0xFF37}, /* FF36 */ - {0xFF38,0xFF58,0xFF38}, {0xFF39,0xFF59,0xFF39}, /* FF38 */ - {0xFF3A,0xFF5A,0xFF3A}, {0xFF3B,0xFF3B,0xFF3B}, /* FF3A */ - {0xFF3C,0xFF3C,0xFF3C}, {0xFF3D,0xFF3D,0xFF3D}, /* FF3C */ - {0xFF3E,0xFF3E,0xFF3E}, {0xFF3F,0xFF3F,0xFF3F}, /* FF3E */ - {0xFF40,0xFF40,0xFF40}, {0xFF21,0xFF41,0xFF21}, /* FF40 */ - {0xFF22,0xFF42,0xFF22}, {0xFF23,0xFF43,0xFF23}, /* FF42 */ - {0xFF24,0xFF44,0xFF24}, {0xFF25,0xFF45,0xFF25}, /* FF44 */ - {0xFF26,0xFF46,0xFF26}, {0xFF27,0xFF47,0xFF27}, /* FF46 */ - {0xFF28,0xFF48,0xFF28}, {0xFF29,0xFF49,0xFF29}, /* FF48 */ - {0xFF2A,0xFF4A,0xFF2A}, {0xFF2B,0xFF4B,0xFF2B}, /* FF4A */ - {0xFF2C,0xFF4C,0xFF2C}, {0xFF2D,0xFF4D,0xFF2D}, /* FF4C */ - {0xFF2E,0xFF4E,0xFF2E}, {0xFF2F,0xFF4F,0xFF2F}, /* FF4E */ - {0xFF30,0xFF50,0xFF30}, {0xFF31,0xFF51,0xFF31}, /* FF50 */ - {0xFF32,0xFF52,0xFF32}, {0xFF33,0xFF53,0xFF33}, /* FF52 */ - {0xFF34,0xFF54,0xFF34}, {0xFF35,0xFF55,0xFF35}, /* FF54 */ - {0xFF36,0xFF56,0xFF36}, {0xFF37,0xFF57,0xFF37}, /* FF56 */ - {0xFF38,0xFF58,0xFF38}, {0xFF39,0xFF59,0xFF39}, /* FF58 */ - {0xFF3A,0xFF5A,0xFF3A}, {0xFF5B,0xFF5B,0xFF5B}, /* FF5A */ - {0xFF5C,0xFF5C,0xFF5C}, {0xFF5D,0xFF5D,0xFF5D}, /* FF5C */ - {0xFF5E,0xFF5E,0xFF5E}, {0xFF5F,0xFF5F,0xFF5F}, /* FF5E */ - {0xFF60,0xFF60,0xFF60}, {0xFF61,0xFF61,0xFF61}, /* FF60 */ - {0xFF62,0xFF62,0xFF62}, {0xFF63,0xFF63,0xFF63}, /* FF62 */ - {0xFF64,0xFF64,0xFF64}, {0xFF65,0xFF65,0xFF65}, /* FF64 */ - {0xFF66,0xFF66,0xFF66}, {0xFF67,0xFF67,0xFF67}, /* FF66 */ - {0xFF68,0xFF68,0xFF68}, {0xFF69,0xFF69,0xFF69}, /* FF68 */ - {0xFF6A,0xFF6A,0xFF6A}, {0xFF6B,0xFF6B,0xFF6B}, /* FF6A */ - {0xFF6C,0xFF6C,0xFF6C}, {0xFF6D,0xFF6D,0xFF6D}, /* FF6C */ - {0xFF6E,0xFF6E,0xFF6E}, {0xFF6F,0xFF6F,0xFF6F}, /* FF6E */ - {0xFF70,0xFF70,0xFF70}, {0xFF71,0xFF71,0xFF71}, /* FF70 */ - {0xFF72,0xFF72,0xFF72}, {0xFF73,0xFF73,0xFF73}, /* FF72 */ - {0xFF74,0xFF74,0xFF74}, {0xFF75,0xFF75,0xFF75}, /* FF74 */ - {0xFF76,0xFF76,0xFF76}, {0xFF77,0xFF77,0xFF77}, /* FF76 */ - {0xFF78,0xFF78,0xFF78}, {0xFF79,0xFF79,0xFF79}, /* FF78 */ - {0xFF7A,0xFF7A,0xFF7A}, {0xFF7B,0xFF7B,0xFF7B}, /* FF7A */ - {0xFF7C,0xFF7C,0xFF7C}, {0xFF7D,0xFF7D,0xFF7D}, /* FF7C */ - {0xFF7E,0xFF7E,0xFF7E}, {0xFF7F,0xFF7F,0xFF7F}, /* FF7E */ - {0xFF80,0xFF80,0xFF80}, {0xFF81,0xFF81,0xFF81}, /* FF80 */ - {0xFF82,0xFF82,0xFF82}, {0xFF83,0xFF83,0xFF83}, /* FF82 */ - {0xFF84,0xFF84,0xFF84}, {0xFF85,0xFF85,0xFF85}, /* FF84 */ - {0xFF86,0xFF86,0xFF86}, {0xFF87,0xFF87,0xFF87}, /* FF86 */ - {0xFF88,0xFF88,0xFF88}, {0xFF89,0xFF89,0xFF89}, /* FF88 */ - {0xFF8A,0xFF8A,0xFF8A}, {0xFF8B,0xFF8B,0xFF8B}, /* FF8A */ - {0xFF8C,0xFF8C,0xFF8C}, {0xFF8D,0xFF8D,0xFF8D}, /* FF8C */ - {0xFF8E,0xFF8E,0xFF8E}, {0xFF8F,0xFF8F,0xFF8F}, /* FF8E */ - {0xFF90,0xFF90,0xFF90}, {0xFF91,0xFF91,0xFF91}, /* FF90 */ - {0xFF92,0xFF92,0xFF92}, {0xFF93,0xFF93,0xFF93}, /* FF92 */ - {0xFF94,0xFF94,0xFF94}, {0xFF95,0xFF95,0xFF95}, /* FF94 */ - {0xFF96,0xFF96,0xFF96}, {0xFF97,0xFF97,0xFF97}, /* FF96 */ - {0xFF98,0xFF98,0xFF98}, {0xFF99,0xFF99,0xFF99}, /* FF98 */ - {0xFF9A,0xFF9A,0xFF9A}, {0xFF9B,0xFF9B,0xFF9B}, /* FF9A */ - {0xFF9C,0xFF9C,0xFF9C}, {0xFF9D,0xFF9D,0xFF9D}, /* FF9C */ - {0xFF9E,0xFF9E,0xFF9E}, {0xFF9F,0xFF9F,0xFF9F}, /* FF9E */ - {0xFFA0,0xFFA0,0xFFA0}, {0xFFA1,0xFFA1,0xFFA1}, /* FFA0 */ - {0xFFA2,0xFFA2,0xFFA2}, {0xFFA3,0xFFA3,0xFFA3}, /* FFA2 */ - {0xFFA4,0xFFA4,0xFFA4}, {0xFFA5,0xFFA5,0xFFA5}, /* FFA4 */ - {0xFFA6,0xFFA6,0xFFA6}, {0xFFA7,0xFFA7,0xFFA7}, /* FFA6 */ - {0xFFA8,0xFFA8,0xFFA8}, {0xFFA9,0xFFA9,0xFFA9}, /* FFA8 */ - {0xFFAA,0xFFAA,0xFFAA}, {0xFFAB,0xFFAB,0xFFAB}, /* FFAA */ - {0xFFAC,0xFFAC,0xFFAC}, {0xFFAD,0xFFAD,0xFFAD}, /* FFAC */ - {0xFFAE,0xFFAE,0xFFAE}, {0xFFAF,0xFFAF,0xFFAF}, /* FFAE */ - {0xFFB0,0xFFB0,0xFFB0}, {0xFFB1,0xFFB1,0xFFB1}, /* FFB0 */ - {0xFFB2,0xFFB2,0xFFB2}, {0xFFB3,0xFFB3,0xFFB3}, /* FFB2 */ - {0xFFB4,0xFFB4,0xFFB4}, {0xFFB5,0xFFB5,0xFFB5}, /* FFB4 */ - {0xFFB6,0xFFB6,0xFFB6}, {0xFFB7,0xFFB7,0xFFB7}, /* FFB6 */ - {0xFFB8,0xFFB8,0xFFB8}, {0xFFB9,0xFFB9,0xFFB9}, /* FFB8 */ - {0xFFBA,0xFFBA,0xFFBA}, {0xFFBB,0xFFBB,0xFFBB}, /* FFBA */ - {0xFFBC,0xFFBC,0xFFBC}, {0xFFBD,0xFFBD,0xFFBD}, /* FFBC */ - {0xFFBE,0xFFBE,0xFFBE}, {0xFFBF,0xFFBF,0xFFBF}, /* FFBE */ - {0xFFC0,0xFFC0,0xFFC0}, {0xFFC1,0xFFC1,0xFFC1}, /* FFC0 */ - {0xFFC2,0xFFC2,0xFFC2}, {0xFFC3,0xFFC3,0xFFC3}, /* FFC2 */ - {0xFFC4,0xFFC4,0xFFC4}, {0xFFC5,0xFFC5,0xFFC5}, /* FFC4 */ - {0xFFC6,0xFFC6,0xFFC6}, {0xFFC7,0xFFC7,0xFFC7}, /* FFC6 */ - {0xFFC8,0xFFC8,0xFFC8}, {0xFFC9,0xFFC9,0xFFC9}, /* FFC8 */ - {0xFFCA,0xFFCA,0xFFCA}, {0xFFCB,0xFFCB,0xFFCB}, /* FFCA */ - {0xFFCC,0xFFCC,0xFFCC}, {0xFFCD,0xFFCD,0xFFCD}, /* FFCC */ - {0xFFCE,0xFFCE,0xFFCE}, {0xFFCF,0xFFCF,0xFFCF}, /* FFCE */ - {0xFFD0,0xFFD0,0xFFD0}, {0xFFD1,0xFFD1,0xFFD1}, /* FFD0 */ - {0xFFD2,0xFFD2,0xFFD2}, {0xFFD3,0xFFD3,0xFFD3}, /* FFD2 */ - {0xFFD4,0xFFD4,0xFFD4}, {0xFFD5,0xFFD5,0xFFD5}, /* FFD4 */ - {0xFFD6,0xFFD6,0xFFD6}, {0xFFD7,0xFFD7,0xFFD7}, /* FFD6 */ - {0xFFD8,0xFFD8,0xFFD8}, {0xFFD9,0xFFD9,0xFFD9}, /* FFD8 */ - {0xFFDA,0xFFDA,0xFFDA}, {0xFFDB,0xFFDB,0xFFDB}, /* FFDA */ - {0xFFDC,0xFFDC,0xFFDC}, {0xFFDD,0xFFDD,0xFFDD}, /* FFDC */ - {0xFFDE,0xFFDE,0xFFDE}, {0xFFDF,0xFFDF,0xFFDF}, /* FFDE */ - {0xFFE0,0xFFE0,0xFFE0}, {0xFFE1,0xFFE1,0xFFE1}, /* FFE0 */ - {0xFFE2,0xFFE2,0xFFE2}, {0xFFE3,0xFFE3,0xFFE3}, /* FFE2 */ - {0xFFE4,0xFFE4,0xFFE4}, {0xFFE5,0xFFE5,0xFFE5}, /* FFE4 */ - {0xFFE6,0xFFE6,0xFFE6}, {0xFFE7,0xFFE7,0xFFE7}, /* FFE6 */ - {0xFFE8,0xFFE8,0xFFE8}, {0xFFE9,0xFFE9,0xFFE9}, /* FFE8 */ - {0xFFEA,0xFFEA,0xFFEA}, {0xFFEB,0xFFEB,0xFFEB}, /* FFEA */ - {0xFFEC,0xFFEC,0xFFEC}, {0xFFED,0xFFED,0xFFED}, /* FFEC */ - {0xFFEE,0xFFEE,0xFFEE}, {0xFFEF,0xFFEF,0xFFEF}, /* FFEE */ - {0xFFF0,0xFFF0,0xFFF0}, {0xFFF1,0xFFF1,0xFFF1}, /* FFF0 */ - {0xFFF2,0xFFF2,0xFFF2}, {0xFFF3,0xFFF3,0xFFF3}, /* FFF2 */ - {0xFFF4,0xFFF4,0xFFF4}, {0xFFF5,0xFFF5,0xFFF5}, /* FFF4 */ - {0xFFF6,0xFFF6,0xFFF6}, {0xFFF7,0xFFF7,0xFFF7}, /* FFF6 */ - {0xFFF8,0xFFF8,0xFFF8}, {0xFFF9,0xFFF9,0xFFF9}, /* FFF8 */ - {0xFFFA,0xFFFA,0xFFFA}, {0xFFFB,0xFFFB,0xFFFB}, /* FFFA */ - {0xFFFC,0xFFFC,0xFFFC}, {0xFFFD,0xFFFD,0xFFFD}, /* FFFC */ - {0xFFFE,0xFFFE,0xFFFE}, {0xFFFF,0xFFFF,0xFFFF} /* FFFE */ -}; - -static MY_UNICASE_CHARACTER u520p104[]={ - {0x10400,0x10428,0x10400}, {0x10401,0x10429,0x10401}, /* 10400 */ - {0x10402,0x1042A,0x10402}, {0x10403,0x1042B,0x10403}, /* 10402 */ - {0x10404,0x1042C,0x10404}, {0x10405,0x1042D,0x10405}, /* 10404 */ - {0x10406,0x1042E,0x10406}, {0x10407,0x1042F,0x10407}, /* 10406 */ - {0x10408,0x10430,0x10408}, {0x10409,0x10431,0x10409}, /* 10408 */ - {0x1040A,0x10432,0x1040A}, {0x1040B,0x10433,0x1040B}, /* 1040A */ - {0x1040C,0x10434,0x1040C}, {0x1040D,0x10435,0x1040D}, /* 1040C */ - {0x1040E,0x10436,0x1040E}, {0x1040F,0x10437,0x1040F}, /* 1040E */ - {0x10410,0x10438,0x10410}, {0x10411,0x10439,0x10411}, /* 10410 */ - {0x10412,0x1043A,0x10412}, {0x10413,0x1043B,0x10413}, /* 10412 */ - {0x10414,0x1043C,0x10414}, {0x10415,0x1043D,0x10415}, /* 10414 */ - {0x10416,0x1043E,0x10416}, {0x10417,0x1043F,0x10417}, /* 10416 */ - {0x10418,0x10440,0x10418}, {0x10419,0x10441,0x10419}, /* 10418 */ - {0x1041A,0x10442,0x1041A}, {0x1041B,0x10443,0x1041B}, /* 1041A */ - {0x1041C,0x10444,0x1041C}, {0x1041D,0x10445,0x1041D}, /* 1041C */ - {0x1041E,0x10446,0x1041E}, {0x1041F,0x10447,0x1041F}, /* 1041E */ - {0x10420,0x10448,0x10420}, {0x10421,0x10449,0x10421}, /* 10420 */ - {0x10422,0x1044A,0x10422}, {0x10423,0x1044B,0x10423}, /* 10422 */ - {0x10424,0x1044C,0x10424}, {0x10425,0x1044D,0x10425}, /* 10424 */ - {0x10426,0x1044E,0x10426}, {0x10427,0x1044F,0x10427}, /* 10426 */ - {0x10400,0x10428,0x10400}, {0x10401,0x10429,0x10401}, /* 10428 */ - {0x10402,0x1042A,0x10402}, {0x10403,0x1042B,0x10403}, /* 1042A */ - {0x10404,0x1042C,0x10404}, {0x10405,0x1042D,0x10405}, /* 1042C */ - {0x10406,0x1042E,0x10406}, {0x10407,0x1042F,0x10407}, /* 1042E */ - {0x10408,0x10430,0x10408}, {0x10409,0x10431,0x10409}, /* 10430 */ - {0x1040A,0x10432,0x1040A}, {0x1040B,0x10433,0x1040B}, /* 10432 */ - {0x1040C,0x10434,0x1040C}, {0x1040D,0x10435,0x1040D}, /* 10434 */ - {0x1040E,0x10436,0x1040E}, {0x1040F,0x10437,0x1040F}, /* 10436 */ - {0x10410,0x10438,0x10410}, {0x10411,0x10439,0x10411}, /* 10438 */ - {0x10412,0x1043A,0x10412}, {0x10413,0x1043B,0x10413}, /* 1043A */ - {0x10414,0x1043C,0x10414}, {0x10415,0x1043D,0x10415}, /* 1043C */ - {0x10416,0x1043E,0x10416}, {0x10417,0x1043F,0x10417}, /* 1043E */ - {0x10418,0x10440,0x10418}, {0x10419,0x10441,0x10419}, /* 10440 */ - {0x1041A,0x10442,0x1041A}, {0x1041B,0x10443,0x1041B}, /* 10442 */ - {0x1041C,0x10444,0x1041C}, {0x1041D,0x10445,0x1041D}, /* 10444 */ - {0x1041E,0x10446,0x1041E}, {0x1041F,0x10447,0x1041F}, /* 10446 */ - {0x10420,0x10448,0x10420}, {0x10421,0x10449,0x10421}, /* 10448 */ - {0x10422,0x1044A,0x10422}, {0x10423,0x1044B,0x10423}, /* 1044A */ - {0x10424,0x1044C,0x10424}, {0x10425,0x1044D,0x10425}, /* 1044C */ - {0x10426,0x1044E,0x10426}, {0x10427,0x1044F,0x10427}, /* 1044E */ - {0x10450,0x10450,0x10450}, {0x10451,0x10451,0x10451}, /* 10450 */ - {0x10452,0x10452,0x10452}, {0x10453,0x10453,0x10453}, /* 10452 */ - {0x10454,0x10454,0x10454}, {0x10455,0x10455,0x10455}, /* 10454 */ - {0x10456,0x10456,0x10456}, {0x10457,0x10457,0x10457}, /* 10456 */ - {0x10458,0x10458,0x10458}, {0x10459,0x10459,0x10459}, /* 10458 */ - {0x1045A,0x1045A,0x1045A}, {0x1045B,0x1045B,0x1045B}, /* 1045A */ - {0x1045C,0x1045C,0x1045C}, {0x1045D,0x1045D,0x1045D}, /* 1045C */ - {0x1045E,0x1045E,0x1045E}, {0x1045F,0x1045F,0x1045F}, /* 1045E */ - {0x10460,0x10460,0x10460}, {0x10461,0x10461,0x10461}, /* 10460 */ - {0x10462,0x10462,0x10462}, {0x10463,0x10463,0x10463}, /* 10462 */ - {0x10464,0x10464,0x10464}, {0x10465,0x10465,0x10465}, /* 10464 */ - {0x10466,0x10466,0x10466}, {0x10467,0x10467,0x10467}, /* 10466 */ - {0x10468,0x10468,0x10468}, {0x10469,0x10469,0x10469}, /* 10468 */ - {0x1046A,0x1046A,0x1046A}, {0x1046B,0x1046B,0x1046B}, /* 1046A */ - {0x1046C,0x1046C,0x1046C}, {0x1046D,0x1046D,0x1046D}, /* 1046C */ - {0x1046E,0x1046E,0x1046E}, {0x1046F,0x1046F,0x1046F}, /* 1046E */ - {0x10470,0x10470,0x10470}, {0x10471,0x10471,0x10471}, /* 10470 */ - {0x10472,0x10472,0x10472}, {0x10473,0x10473,0x10473}, /* 10472 */ - {0x10474,0x10474,0x10474}, {0x10475,0x10475,0x10475}, /* 10474 */ - {0x10476,0x10476,0x10476}, {0x10477,0x10477,0x10477}, /* 10476 */ - {0x10478,0x10478,0x10478}, {0x10479,0x10479,0x10479}, /* 10478 */ - {0x1047A,0x1047A,0x1047A}, {0x1047B,0x1047B,0x1047B}, /* 1047A */ - {0x1047C,0x1047C,0x1047C}, {0x1047D,0x1047D,0x1047D}, /* 1047C */ - {0x1047E,0x1047E,0x1047E}, {0x1047F,0x1047F,0x1047F}, /* 1047E */ - {0x10480,0x10480,0x10480}, {0x10481,0x10481,0x10481}, /* 10480 */ - {0x10482,0x10482,0x10482}, {0x10483,0x10483,0x10483}, /* 10482 */ - {0x10484,0x10484,0x10484}, {0x10485,0x10485,0x10485}, /* 10484 */ - {0x10486,0x10486,0x10486}, {0x10487,0x10487,0x10487}, /* 10486 */ - {0x10488,0x10488,0x10488}, {0x10489,0x10489,0x10489}, /* 10488 */ - {0x1048A,0x1048A,0x1048A}, {0x1048B,0x1048B,0x1048B}, /* 1048A */ - {0x1048C,0x1048C,0x1048C}, {0x1048D,0x1048D,0x1048D}, /* 1048C */ - {0x1048E,0x1048E,0x1048E}, {0x1048F,0x1048F,0x1048F}, /* 1048E */ - {0x10490,0x10490,0x10490}, {0x10491,0x10491,0x10491}, /* 10490 */ - {0x10492,0x10492,0x10492}, {0x10493,0x10493,0x10493}, /* 10492 */ - {0x10494,0x10494,0x10494}, {0x10495,0x10495,0x10495}, /* 10494 */ - {0x10496,0x10496,0x10496}, {0x10497,0x10497,0x10497}, /* 10496 */ - {0x10498,0x10498,0x10498}, {0x10499,0x10499,0x10499}, /* 10498 */ - {0x1049A,0x1049A,0x1049A}, {0x1049B,0x1049B,0x1049B}, /* 1049A */ - {0x1049C,0x1049C,0x1049C}, {0x1049D,0x1049D,0x1049D}, /* 1049C */ - {0x1049E,0x1049E,0x1049E}, {0x1049F,0x1049F,0x1049F}, /* 1049E */ - {0x104A0,0x104A0,0x104A0}, {0x104A1,0x104A1,0x104A1}, /* 104A0 */ - {0x104A2,0x104A2,0x104A2}, {0x104A3,0x104A3,0x104A3}, /* 104A2 */ - {0x104A4,0x104A4,0x104A4}, {0x104A5,0x104A5,0x104A5}, /* 104A4 */ - {0x104A6,0x104A6,0x104A6}, {0x104A7,0x104A7,0x104A7}, /* 104A6 */ - {0x104A8,0x104A8,0x104A8}, {0x104A9,0x104A9,0x104A9}, /* 104A8 */ - {0x104AA,0x104AA,0x104AA}, {0x104AB,0x104AB,0x104AB}, /* 104AA */ - {0x104AC,0x104AC,0x104AC}, {0x104AD,0x104AD,0x104AD}, /* 104AC */ - {0x104AE,0x104AE,0x104AE}, {0x104AF,0x104AF,0x104AF}, /* 104AE */ - {0x104B0,0x104B0,0x104B0}, {0x104B1,0x104B1,0x104B1}, /* 104B0 */ - {0x104B2,0x104B2,0x104B2}, {0x104B3,0x104B3,0x104B3}, /* 104B2 */ - {0x104B4,0x104B4,0x104B4}, {0x104B5,0x104B5,0x104B5}, /* 104B4 */ - {0x104B6,0x104B6,0x104B6}, {0x104B7,0x104B7,0x104B7}, /* 104B6 */ - {0x104B8,0x104B8,0x104B8}, {0x104B9,0x104B9,0x104B9}, /* 104B8 */ - {0x104BA,0x104BA,0x104BA}, {0x104BB,0x104BB,0x104BB}, /* 104BA */ - {0x104BC,0x104BC,0x104BC}, {0x104BD,0x104BD,0x104BD}, /* 104BC */ - {0x104BE,0x104BE,0x104BE}, {0x104BF,0x104BF,0x104BF}, /* 104BE */ - {0x104C0,0x104C0,0x104C0}, {0x104C1,0x104C1,0x104C1}, /* 104C0 */ - {0x104C2,0x104C2,0x104C2}, {0x104C3,0x104C3,0x104C3}, /* 104C2 */ - {0x104C4,0x104C4,0x104C4}, {0x104C5,0x104C5,0x104C5}, /* 104C4 */ - {0x104C6,0x104C6,0x104C6}, {0x104C7,0x104C7,0x104C7}, /* 104C6 */ - {0x104C8,0x104C8,0x104C8}, {0x104C9,0x104C9,0x104C9}, /* 104C8 */ - {0x104CA,0x104CA,0x104CA}, {0x104CB,0x104CB,0x104CB}, /* 104CA */ - {0x104CC,0x104CC,0x104CC}, {0x104CD,0x104CD,0x104CD}, /* 104CC */ - {0x104CE,0x104CE,0x104CE}, {0x104CF,0x104CF,0x104CF}, /* 104CE */ - {0x104D0,0x104D0,0x104D0}, {0x104D1,0x104D1,0x104D1}, /* 104D0 */ - {0x104D2,0x104D2,0x104D2}, {0x104D3,0x104D3,0x104D3}, /* 104D2 */ - {0x104D4,0x104D4,0x104D4}, {0x104D5,0x104D5,0x104D5}, /* 104D4 */ - {0x104D6,0x104D6,0x104D6}, {0x104D7,0x104D7,0x104D7}, /* 104D6 */ - {0x104D8,0x104D8,0x104D8}, {0x104D9,0x104D9,0x104D9}, /* 104D8 */ - {0x104DA,0x104DA,0x104DA}, {0x104DB,0x104DB,0x104DB}, /* 104DA */ - {0x104DC,0x104DC,0x104DC}, {0x104DD,0x104DD,0x104DD}, /* 104DC */ - {0x104DE,0x104DE,0x104DE}, {0x104DF,0x104DF,0x104DF}, /* 104DE */ - {0x104E0,0x104E0,0x104E0}, {0x104E1,0x104E1,0x104E1}, /* 104E0 */ - {0x104E2,0x104E2,0x104E2}, {0x104E3,0x104E3,0x104E3}, /* 104E2 */ - {0x104E4,0x104E4,0x104E4}, {0x104E5,0x104E5,0x104E5}, /* 104E4 */ - {0x104E6,0x104E6,0x104E6}, {0x104E7,0x104E7,0x104E7}, /* 104E6 */ - {0x104E8,0x104E8,0x104E8}, {0x104E9,0x104E9,0x104E9}, /* 104E8 */ - {0x104EA,0x104EA,0x104EA}, {0x104EB,0x104EB,0x104EB}, /* 104EA */ - {0x104EC,0x104EC,0x104EC}, {0x104ED,0x104ED,0x104ED}, /* 104EC */ - {0x104EE,0x104EE,0x104EE}, {0x104EF,0x104EF,0x104EF}, /* 104EE */ - {0x104F0,0x104F0,0x104F0}, {0x104F1,0x104F1,0x104F1}, /* 104F0 */ - {0x104F2,0x104F2,0x104F2}, {0x104F3,0x104F3,0x104F3}, /* 104F2 */ - {0x104F4,0x104F4,0x104F4}, {0x104F5,0x104F5,0x104F5}, /* 104F4 */ - {0x104F6,0x104F6,0x104F6}, {0x104F7,0x104F7,0x104F7}, /* 104F6 */ - {0x104F8,0x104F8,0x104F8}, {0x104F9,0x104F9,0x104F9}, /* 104F8 */ - {0x104FA,0x104FA,0x104FA}, {0x104FB,0x104FB,0x104FB}, /* 104FA */ - {0x104FC,0x104FC,0x104FC}, {0x104FD,0x104FD,0x104FD}, /* 104FC */ - {0x104FE,0x104FE,0x104FE}, {0x104FF,0x104FF,0x104FF} /* 104FE */ -}; - - -MY_UNICASE_CHARACTER *my_unicase_pages_unicode520[4352]= -{ - u520p00, u520p01, u520p02, u520p03, u520p04, u520p05, plane06, plane07, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - u520p10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, u520p1D, u520p1E, u520p1F, - NULL, u520p21, NULL, NULL, u520p24, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, u520p2C, u520p2D, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, u520pA6, u520pA7, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, u520pFF, - NULL, NULL, NULL, NULL,u520p104, NULL, NULL, NULL, -}; - - -MY_UNICASE_INFO my_unicase_unicode520= -{ - 0x104FF, - my_unicase_pages_unicode520 -}; - - static uint my_casefold_multiply_utf8mbx(CHARSET_INFO *cs) { DBUG_ASSERT(cs->mbminlen == 1 && cs->mbmaxlen >= 3); - if (cs->caseinfo == &my_unicase_unicode520) + if (cs->casefold == &my_casefold_unicode520) return 2; - if (cs->caseinfo == &my_unicase_turkish) + if (cs->casefold == &my_casefold_turkish) return 2; - if (cs->caseinfo == &my_unicase_default) + if (cs->casefold == &my_casefold_default) return 1; - if (cs->caseinfo == &my_unicase_mysql500) + if (cs->casefold == &my_casefold_mysql500) return 1; DBUG_ASSERT(0); /*Unknown case folding data */ return 1; @@ -4670,7 +145,7 @@ int my_wildcmp_unicode_impl(CHARSET_INFO *cs, const char *str,const char *str_end, const char *wildstr,const char *wildend, int escape, int w_one, int w_many, - MY_UNICASE_INFO *weights, int recurse_level) + MY_CASEFOLD_INFO *weights, int recurse_level) { int result= -1; /* Not found, using wildcards */ my_wc_t s_wc, w_wc; @@ -4815,7 +290,7 @@ my_wildcmp_unicode(CHARSET_INFO *cs, const char *str,const char *str_end, const char *wildstr,const char *wildend, int escape, int w_one, int w_many, - MY_UNICASE_INFO *weights) + MY_CASEFOLD_INFO *weights) { return my_wildcmp_unicode_impl(cs, str, str_end, wildstr, wildend, @@ -5198,7 +673,7 @@ static size_t my_caseup_utf8mb3(CHARSET_INFO *cs, int srcres, dstres; const char *srcend= src + srclen; char *dstend= dst + dstlen, *dst0= dst; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; DBUG_ASSERT(src != dst || cs->cset->caseup_multiply(cs) == 1); while ((src < srcend) && @@ -5220,7 +695,7 @@ static void my_hash_sort_utf8mb3_nopad(CHARSET_INFO *cs, const uchar *s, size_t my_wc_t wc; int res; const uchar *e= s+slen; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; register ulong m1= *nr1, m2= *nr2; while ((s < e) && (res=my_utf8mb3_uni(cs,&wc, (uchar *)s, (uchar*)e))>0 ) @@ -5251,7 +726,7 @@ static size_t my_caseup_str_utf8mb3(CHARSET_INFO *cs, char *src) my_wc_t wc; int srcres, dstres; char *dst= src, *dst0= src; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; DBUG_ASSERT(cs->cset->caseup_multiply(cs) == 1); while (*src && @@ -5276,7 +751,7 @@ static size_t my_casedn_utf8mb3(CHARSET_INFO *cs, int srcres, dstres; const char *srcend= src + srclen; char *dstend= dst + dstlen, *dst0= dst; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; DBUG_ASSERT(src != dst || cs->cset->casedn_multiply(cs) == 1); while ((src < srcend) && @@ -5297,7 +772,7 @@ static size_t my_casedn_str_utf8mb3(CHARSET_INFO *cs, char *src) my_wc_t wc; int srcres, dstres; char *dst= src, *dst0= src; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; DBUG_ASSERT(cs->cset->casedn_multiply(cs) == 1); while (*src && @@ -5350,7 +825,7 @@ static size_t my_casedn_str_utf8mb3(CHARSET_INFO *cs, char *src) static int my_strcasecmp_utf8mb3(CHARSET_INFO *cs, const char *s, const char *t) { - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; while (s[0] && t[0]) { my_wc_t s_wc,t_wc; @@ -5432,7 +907,7 @@ int my_wildcmp_utf8mb3(CHARSET_INFO *cs, const char *wildstr,const char *wildend, int escape, int w_one, int w_many) { - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; return my_wildcmp_unicode(cs,str,str_end,wildstr,wildend, escape,w_one,w_many,uni_plane); } @@ -5467,33 +942,32 @@ int my_charlen_utf8mb3(CHARSET_INFO *cs __attribute__((unused)), static inline int my_weight_mb1_utf8mb3_general_ci(uchar b) { - return (int) my_unicase_default_page00[b & 0xFF].sort; + return (int) weight_general_ci_page00[b & 0xFF]; } static inline int my_weight_mb2_utf8mb3_general_ci(uchar b0, uchar b1) { my_wc_t wc= UTF8MB2_CODE(b0, b1); - MY_UNICASE_CHARACTER *page= my_unicase_default_pages[wc >> 8]; + const uint16 *page= weight_general_ci_index[wc >> 8]; /* 2-byte utf8 sequences encode Unicode characters up to U+07FF. - my_unicase_default_pages[N] has non-NULL page pointers + weight_general_ci_index[N] has non-NULL page pointers for all N in the range [0..7]. - - my_unicase_default_pages[0..5] point to real translation data - - my_unicase_default_pages[6..7] point to dummy pages + - weight_general_ci_index[0..5] point to real translation data + - weight_general_ci_index[6..7] point to dummy pages (without real translation). By adding these dummy pages we can avoid testing 'page' against NULL. This gives up to 20% performance improvement. */ - return (int) page[wc & 0xFF].sort; + return (int) page[wc & 0xFF]; } static inline int my_weight_mb3_utf8mb3_general_ci(uchar b0, uchar b1, uchar b2) { my_wc_t wc= UTF8MB3_CODE(b0, b1, b2); - MY_UNICASE_CHARACTER *page= my_unicase_default_pages[wc >> 8]; - return (int) (page ? page[wc & 0xFF].sort : wc); + return my_general_ci_bmp_char_to_weight((uint16) wc); } @@ -5502,9 +976,7 @@ static inline int my_weight_mb3_utf8mb3_general_ci(uchar b0, uchar b1, uchar b2) #define DEFINE_STRNXFRM_UNICODE_NOPAD #define MY_MB_WC(cs, pwc, s, e) my_mb_wc_utf8mb3_quick(pwc, s, e) #define OPTIMIZE_ASCII 1 -#define UNICASE_MAXCHAR MY_UNICASE_INFO_DEFAULT_MAXCHAR -#define UNICASE_PAGE0 my_unicase_default_page00 -#define UNICASE_PAGES my_unicase_default_pages +#define MY_WC_WEIGHT(x) my_general_ci_bmp_char_to_weight(x) #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB1(x) my_weight_mb1_utf8mb3_general_ci(x) #define WEIGHT_MB2(x,y) my_weight_mb2_utf8mb3_general_ci(x,y) @@ -5525,19 +997,19 @@ static inline int my_weight_mb3_utf8mb3_general_ci(uchar b0, uchar b1, uchar b2) static inline int my_weight_mb1_utf8mb3_general_mysql500_ci(uchar b) { - return (int) my_unicase_mysql500_page00[b & 0xFF].sort; + return (int) weight_general_mysql500_ci_page00[b & 0xFF]; } static inline int my_weight_mb2_utf8mb3_general_mysql500_ci(uchar b0, uchar b1) { my_wc_t wc= UTF8MB2_CODE(b0, b1); - MY_UNICASE_CHARACTER *page= my_unicase_mysql500_pages[wc >> 8]; + const uint16 *page= weight_general_mysql500_ci_index[wc >> 8]; /* `page` should never be NULL for 2-byte utf8 characters. See comments in my_weight_mb2_utf8mb3_general_ci(). */ - return (int) page[wc & 0xFF].sort; + return (int) page[wc & 0xFF]; } @@ -5545,8 +1017,16 @@ static inline int my_weight_mb3_utf8mb3_general_mysql500_ci(uchar b0, uchar b1, uchar b2) { my_wc_t wc= UTF8MB3_CODE(b0, b1, b2); - MY_UNICASE_CHARACTER *page= my_unicase_mysql500_pages[wc >> 8]; - return (int) (page ? page[wc & 0xFF].sort : wc); + const uint16 *page= weight_general_mysql500_ci_index[wc >> 8]; + return (int) (page ? page[wc & 0xFF] : wc); +} + + +static inline int +my_wc_weight_utf8mb3_general_mysql500_ci(my_wc_t wc) +{ + const uint16 *page= weight_general_mysql500_ci_index[wc >> 8]; + return (int) (page ? page[wc & 0xFF] : wc); } @@ -5554,10 +1034,8 @@ my_weight_mb3_utf8mb3_general_mysql500_ci(uchar b0, uchar b1, uchar b2) #define DEFINE_STRNXFRM_UNICODE #define MY_MB_WC(cs, pwc, s, e) my_mb_wc_utf8mb3_quick(pwc, s, e) #define OPTIMIZE_ASCII 1 -#define UNICASE_MAXCHAR MY_UNICASE_INFO_DEFAULT_MAXCHAR -#define UNICASE_PAGE0 my_unicase_mysql500_page00 -#define UNICASE_PAGES my_unicase_mysql500_pages #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) +#define MY_WC_WEIGHT(x) my_wc_weight_utf8mb3_general_mysql500_ci(x) #define WEIGHT_MB1(x) my_weight_mb1_utf8mb3_general_mysql500_ci(x) #define WEIGHT_MB2(x,y) my_weight_mb2_utf8mb3_general_mysql500_ci(x,y) #define WEIGHT_MB3(x,y,z) my_weight_mb3_utf8mb3_general_mysql500_ci(x,y,z) @@ -5775,8 +1253,7 @@ struct charset_info_st my_charset_utf8mb3_general_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -5807,8 +1284,7 @@ struct charset_info_st my_charset_utf8mb3_general_mysql500_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_mysql500, /* caseinfo */ + &my_casefold_mysql500, /* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -5839,8 +1315,7 @@ struct charset_info_st my_charset_utf8mb3_bin= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -5871,8 +1346,7 @@ struct charset_info_st my_charset_utf8mb3_general_nopad_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ + &my_casefold_default, /* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -5903,8 +1377,7 @@ struct charset_info_st my_charset_utf8mb3_nopad_bin= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -5940,7 +1413,7 @@ static int my_strnncoll_utf8mb3_cs(CHARSET_INFO *cs, const uchar *te=t+tlen; int save_diff = 0; int diff; - MY_UNICASE_INFO *const *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *const *uni_plane= cs->casefold; while ( s < se && t < te ) { @@ -5983,7 +1456,7 @@ static int my_strnncollsp_utf8mb3_cs(CHARSET_INFO *cs, const uchar *se= s + slen; const uchar *te= t + tlen; int save_diff= 0; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; while ( s < se && t < te ) { @@ -6067,8 +1540,7 @@ struct charset_info_st my_charset_utf8mb3_general_cs= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -7341,9 +2813,7 @@ my_wc_to_printable_filename(CHARSET_INFO *cs, my_wc_t wc, #define DEFINE_STRNXFRM_UNICODE #define MY_MB_WC(cs, pwc, s, e) my_mb_wc_filename(cs, pwc, s, e) #define OPTIMIZE_ASCII 0 -#define UNICASE_MAXCHAR MY_UNICASE_INFO_DEFAULT_MAXCHAR -#define UNICASE_PAGE0 my_unicase_default_page00 -#define UNICASE_PAGES my_unicase_default_pages +#define MY_WC_WEIGHT(x) my_general_ci_char_to_weight(x) /* #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) @@ -7426,8 +2896,7 @@ struct charset_info_st my_charset_filename= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -7651,7 +3120,7 @@ my_caseup_utf8mb4(CHARSET_INFO *cs, const char *src, size_t srclen, int srcres, dstres; const char *srcend= src + srclen; char *dstend= dst + dstlen, *dst0= dst; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; DBUG_ASSERT(src != dst || cs->cset->caseup_multiply(cs) == 1); while ((src < srcend) && @@ -7675,7 +3144,7 @@ my_hash_sort_utf8mb4_nopad(CHARSET_INFO *cs, const uchar *s, size_t slen, my_wc_t wc; int res; const uchar *e= s + slen; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; register ulong m1= *nr1, m2= *nr2; while ((res= my_mb_wc_utf8mb4(cs, &wc, (uchar*) s, (uchar*) e)) > 0) @@ -7719,7 +3188,7 @@ my_caseup_str_utf8mb4(CHARSET_INFO *cs, char *src) my_wc_t wc; int srcres, dstres; char *dst= src, *dst0= src; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; DBUG_ASSERT(cs->cset->caseup_multiply(cs) == 1); while (*src && @@ -7745,7 +3214,7 @@ my_casedn_utf8mb4(CHARSET_INFO *cs, int srcres, dstres; const char *srcend= src + srclen; char *dstend= dst + dstlen, *dst0= dst; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; DBUG_ASSERT(src != dst || cs->cset->casedn_multiply(cs) == 1); while ((src < srcend) && @@ -7768,7 +3237,7 @@ my_casedn_str_utf8mb4(CHARSET_INFO *cs, char *src) my_wc_t wc; int srcres, dstres; char *dst= src, *dst0= src; - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; DBUG_ASSERT(cs->cset->casedn_multiply(cs) == 1); while (*src && @@ -7817,7 +3286,7 @@ my_casedn_str_utf8mb4(CHARSET_INFO *cs, char *src) static int my_strcasecmp_utf8mb4(CHARSET_INFO *cs, const char *s, const char *t) { - MY_UNICASE_INFO *uni_plane= cs->caseinfo; + MY_CASEFOLD_INFO *uni_plane= cs->casefold; while (s[0] && t[0]) { my_wc_t s_wc,t_wc; @@ -7881,7 +3350,7 @@ my_wildcmp_utf8mb4(CHARSET_INFO *cs, int escape, int w_one, int w_many) { return my_wildcmp_unicode(cs, str, strend, wildstr, wildend, - escape, w_one, w_many, cs->caseinfo); + escape, w_one, w_many, cs->casefold); } @@ -7928,9 +3397,7 @@ my_charlen_utf8mb4(CHARSET_INFO *cs __attribute__((unused)), #define DEFINE_STRNXFRM_UNICODE_NOPAD #define MY_MB_WC(cs, pwc, s, e) my_mb_wc_utf8mb4_quick(pwc, s, e) #define OPTIMIZE_ASCII 1 -#define UNICASE_MAXCHAR MY_UNICASE_INFO_DEFAULT_MAXCHAR -#define UNICASE_PAGE0 my_unicase_default_page00 -#define UNICASE_PAGES my_unicase_default_pages +#define MY_WC_WEIGHT(x) my_general_ci_char_to_weight(x) #define IS_MB4_CHAR(b0,b1,b2,b3) IS_UTF8MB4_STEP3(b0,b1,b2,b3) #define WEIGHT_ILSEQ(x) (0xFF0000 + (uchar) (x)) #define WEIGHT_MB1(b0) my_weight_mb1_utf8mb3_general_ci(b0) @@ -8116,8 +3583,7 @@ struct charset_info_st my_charset_utf8mb4_general_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -8149,8 +3615,7 @@ struct charset_info_st my_charset_utf8mb4_bin= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -8182,8 +3647,7 @@ struct charset_info_st my_charset_utf8mb4_general_nopad_ci= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -8215,8 +3679,7 @@ struct charset_info_st my_charset_utf8mb4_nopad_bin= NULL, /* uca */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* casefold */ - &my_unicase_default,/* caseinfo */ + &my_casefold_default,/* casefold */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index 86b7de97010..a908bdd2b95 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -711,7 +711,6 @@ struct charset_info_st my_charset_cp1250_czech_cs = tab_cp1250_uni, /* tab_to_uni */ idx_uni_cp1250, /* tab_from_uni */ NULL, /* casefold */ - &my_unicase_default, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 2, /* strxfrm_multiply */ diff --git a/strings/strcoll.inl b/strings/strcoll.inl index ce220bebadb..a70009991df 100644 --- a/strings/strcoll.inl +++ b/strings/strcoll.inl @@ -490,16 +490,12 @@ MY_FUNCTION_NAME(strnxfrm)(CHARSET_INFO *cs, #error OPTIMIZE_ASCII must be defined for DEFINE_STRNXFRM_UNICODE #endif -#ifndef UNICASE_MAXCHAR -#error UNICASE_MAXCHAR must be defined for DEFINE_STRNXFRM_UNICODE +#if OPTIMIZE_ASCII && !defined(WEIGHT_MB1) +#error WEIGHT_MB1 must be defined for DEFINE_STRNXFRM_UNICODE #endif -#ifndef UNICASE_PAGE0 -#error UNICASE_PAGE0 must be defined for DEFINE_STRNXFRM_UNICODE -#endif - -#ifndef UNICASE_PAGES -#error UNICASE_PAGES must be defined for DEFINE_STRNXFRM_UNICODE +#ifndef MY_WC_WEIGHT +#error MY_WC_WEIGHT must be defined for DEFINE_STRNXFRM_UNICODE #endif @@ -514,7 +510,6 @@ MY_FUNCTION_NAME(strnxfrm_internal)(CHARSET_INFO *cs __attribute__((unused)), DBUG_ASSERT(src || !se); DBUG_ASSERT((cs->state & MY_CS_LOWER_SORT) == 0); - DBUG_ASSERT(0x7F <= UNICASE_MAXCHAR); for (; dst < de && *nweights; (*nweights)--) { @@ -524,7 +519,7 @@ MY_FUNCTION_NAME(strnxfrm_internal)(CHARSET_INFO *cs __attribute__((unused)), break; if (src[0] <= 0x7F) { - wc= UNICASE_PAGE0[*src++].sort; + wc= WEIGHT_MB1(*src++); PUT_WC_BE2_HAVE_1BYTE(dst, de, wc); continue; } @@ -532,14 +527,7 @@ MY_FUNCTION_NAME(strnxfrm_internal)(CHARSET_INFO *cs __attribute__((unused)), if ((res= MY_MB_WC(cs, &wc, src, se)) <= 0) break; src+= res; - if (wc <= UNICASE_MAXCHAR) - { - MY_UNICASE_CHARACTER *page; - if ((page= UNICASE_PAGES[wc >> 8])) - wc= page[wc & 0xFF].sort; - } - else - wc= MY_CS_REPLACEMENT_CHARACTER; + wc= MY_WC_WEIGHT(wc); PUT_WC_BE2_HAVE_1BYTE(dst, de, wc); } return dst - dst0; @@ -722,9 +710,7 @@ MY_FUNCTION_NAME(strnxfrm_nopad)(CHARSET_INFO *cs, #undef MY_FUNCTION_NAME #undef MY_MB_WC #undef OPTIMIZE_ASCII -#undef UNICASE_MAXCHAR -#undef UNICASE_PAGE0 -#undef UNICASE_PAGES +#undef MY_WC_WEIGHT #undef WEIGHT_ILSEQ #undef WEIGHT_MB1 #undef WEIGHT_MB2 diff --git a/strings/unidata-dump.c b/strings/unidata-dump.c new file mode 100644 index 00000000000..5ecc8cb0c8c --- /dev/null +++ b/strings/unidata-dump.c @@ -0,0 +1,1110 @@ +const char COPYING[]= "\ +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.\n\ + Copyright (c) 2009, 2023, MariaDB Corporation.\n\ +\n\ + This program is free software; you can redistribute it and/or modify\n\ + it under the terms of the GNU General Public License as published by\n\ + the Free Software Foundation; version 2 of the License.\n\ +\n\ + This program is distributed in the hope that it will be useful,\n\ + but WITHOUT ANY WARRANTY; without even the implied warranty of\n\ + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\ + GNU General Public License for more details.\n\ +\n\ + You should have received a copy of the GNU General Public License\n\ + along with this program; if not, write to the Free Software\n\ + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA\n\ +*/\n"; + +#include +#include +#include + +#define MAX_UNI_CHAR 0x10FFFF +#define MAX_UNI_PAGE 0x10FF + +#define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1)) + + +typedef unsigned int my_wchar_t; + +/* Character types, as in m_ctype.h */ +#define _MY_U 01 /* Upper case */ +#define _MY_L 02 /* Lower case */ +#define _MY_NMR 04 /* Numeral (digit) */ +#define _MY_SPC 010 /* Spacing character */ +#define _MY_PNT 020 /* Punctuation */ +#define _MY_CTR 040 /* Control character */ +#define _MY_B 0100 /* Blank */ +#define _MY_X 0200 /* heXadecimal digit */ + +#define CT_MAX _MY_X +#define CT_CJK _MY_L | _MY_U +#define CT_HANGUL _MY_L | _MY_U +#define CT_NONE 0 + + +/* Decomposition types */ +typedef enum +{ + DT_UNKNOWN, + DT_FONT, + DT_NOBREAK, + DT_INITIAL, + DT_MEDIAL, + DT_FINAL, + DT_ISOLATED, + DT_CIRCLE, + DT_SUPER, + DT_SUB, + DT_VERTICAL, + DT_WIDE, + DT_NARROW, + DT_SMALL, + DT_SQUARE, + DT_FRACTION, + DT_COMPAT +} decomposition_type_t; + + +typedef enum +{ + PAGE_DATA_USELESS= 0, + PAGE_DATA_IMPORTANT= 1, + PAGE_DATA_DUMMY= 2 +} page_data_type_t; + + +typedef struct +{ + page_data_type_t page_tab; + int page_overridden; + int page_ctype; +} PAGE_STAT; + + +typedef struct +{ + const char *mode_name; + int print_ctype; + int print_toupper; + int print_tolower; + int print_noaccent; + int print_noaccent_tolower; + int print_noaccent_toupper; + int print_curly_brackets_in_items; + int print_curly_brackets_in_index; + int chars_per_line; + int single_array; + int pages_per_line_in_index; + int const_data; + const char *page_data_type_name; + const char *page_name; + const char *page_name_derived; + const char *index_data_type_name; + const char *index_name; +} UNIDATA_OPT_MODE; + + +typedef struct +{ + my_wchar_t max_char; + my_wchar_t dummy_pages_codepoint_max; + const char *filename; + UNIDATA_OPT_MODE mode; +} UNIDATA_OPT; + + +my_wchar_t npages_by_opt(const UNIDATA_OPT *opt) +{ + return (opt->max_char + 1) / 256; +} + + +typedef struct my_ctype_name_st +{ + const char *name; + int val; + int to_be_decomposed; +} MY_CTYPE_NAME_ST; + + +static MY_CTYPE_NAME_ST my_ctype_name[]= +{ + {"Lu", _MY_U, 1}, /* Letter, Uppercase */ + {"Ll", _MY_L, 1}, /* Letter, Lowercase */ + {"Lt", _MY_U, 1}, /* Letter, Titlecase */ + {"Lo", _MY_L, 1}, /* Letter, other */ + {"Lm", _MY_L, 0}, /* Letter, Modifier */ + + {"Nd", _MY_NMR, 0}, /* Number, Decimal Digit */ + {"Nl", _MY_NMR|_MY_U|_MY_L, 0}, /* Number, Letter */ + {"No", _MY_NMR|_MY_PNT, 0}, /* Number, Other */ + + {"Mn", _MY_L|_MY_PNT, 0}, /* Mark, Nonspacing */ + {"Mc", _MY_L|_MY_PNT, 1}, /* Mark, Spacing Combining */ + {"Me", _MY_L|_MY_PNT, 0}, /* Mark, Enclosing */ + + {"Pc", _MY_PNT, 0}, /* Punctuation, Connector */ + {"Pd", _MY_PNT, 0}, /* Punctuation, Dash */ + {"Ps", _MY_PNT, 0}, /* Punctuation, Open */ + {"Pe", _MY_PNT, 0}, /* Punctuation, Close */ + {"Pi", _MY_PNT, 0}, /* Punctuation, Initial quote */ + {"Pf", _MY_PNT, 0}, /* Punctuation, Final quote */ + {"Po", _MY_PNT, 0}, /* Punctuation, Other */ + + {"Sm", _MY_PNT, 0}, /* Symbol, Math */ + {"Sc", _MY_PNT, 0}, /* Symbol, Currency */ + {"Sk", _MY_PNT, 0}, /* Symbol, Modifier */ + {"So", _MY_PNT, 0}, /* Symbol, Other */ + + {"Zs", _MY_SPC, 0}, /* Separator, Space */ + {"Zl", _MY_SPC, 0}, /* Separator, Line */ + {"Zp", _MY_SPC, 0}, /* Separator, Paragraph */ + + {"Cc", _MY_CTR, 0}, /* Other, Control */ + {"Cf", _MY_CTR, 0}, /* Other, Format */ + {"Cs", _MY_CTR, 0}, /* Other, Surrogate */ + {"Co", _MY_CTR, 0}, /* Other, Private Use */ + {"Cn", _MY_CTR, 0}, /* Other, Not Assigned */ + {NULL, 0, 0} +}; + + +static const MY_CTYPE_NAME_ST * +ctype_name_st_find(my_wchar_t codepoint, const char *tok) +{ + MY_CTYPE_NAME_ST *p; + for (p= my_ctype_name; p->name; p++) + { + if (!strncasecmp(p->name, tok, 2)) + return p; + } + return NULL; +} + + +static int +ctype_name_st_to_num(const MY_CTYPE_NAME_ST *st, my_wchar_t codepoint) +{ + if ((codepoint >= 'a' && codepoint <= 'z') || + (codepoint >= 'A' && codepoint <= 'Z')) + return st->val | _MY_X; + return st->val; +} + + +static UNIDATA_OPT opt_caseinfo= +{ + 0x10FFFF, /* max_char */ + 0x7FF, /* dummy_pages_codepoint_max == utf8 mb2 range */ + NULL, /*filename*/ + { + "caseinfo", /* mode name */ + 0, /* print_ctype */ + 1, /* print_toupper */ + 1, /* print_tolower */ + 0, /* print_noaccent */ + 0, /* print_noaccent_tolower */ + 1, /* print_noaccent_toupper */ + 1, /* print_curly_brackets_in_items */ + 0, /* print_curly_brackets_in_index */ + 2, /* chars_per_line */ + 0, /* single_array */ + 8, /* pages_per_line_in_index */ + 0, /* const_data */ + "MY_UNICASE_CHARACTER", /* page_data_type_name */ + "plane", /* page_name */ + NULL, /* page_name_derived */ + "MY_UNICASE_CHARACTER *", /* index_data_type_name */ + "my_unicase_default_pages" /* index_name */ + } +}; + + +static UNIDATA_OPT opt_casefold= +{ + 0x10FFFF, /* max_char */ + 0x7FF, /* dummy_pages_codepoint_max == utf8 mb2 range */ + NULL, /*filename*/ + { + "casefold", /* mode name */ + 0, /* print_ctype */ + 1, /* print_toupper */ + 1, /* print_tolower */ + 0, /* print_noaccent */ + 0, /* print_noaccent_tolower */ + 0, /* print_noaccent_toupper */ + 1, /* print_curly_brackets_in_items */ + 0, /* print_curly_brackets_in_index */ + 2, /* chars_per_line */ + 0, /* single_array */ + 8, /* pages_per_line_in_index */ + 1, /* const_data */ + "MY_CASEFOLD_CHARACTER" , /* page_data_type_name */ + "page", /* page_name */ + NULL, /* page_name_derived */ + "MY_CASEFOLD_CHARACTER *", /* index_data_type_name */ + "my_casefold_default_pages" /* index_name */ + } +}; + + +static UNIDATA_OPT opt_casefold_tr= +{ + 0x10FFFF, /* max_char */ + 0x7FF, /* dummy_pages_codepoint_max == utf8 mb2 range */ + NULL, /*filename*/ + { + "casefold-tr", /* mode name */ + 0, /* print_ctype */ + 1, /* print_toupper */ + 1, /* print_tolower */ + 0, /* print_noaccent */ + 0, /* print_noaccent_tolower */ + 0, /* print_noaccent_toupper */ + 1, /* print_curly_brackets_in_items */ + 0, /* print_curly_brackets_in_index */ + 2, /* chars_per_line */ + 0, /* single_array */ + 8, /* pages_per_line_in_index */ + 1, /* const_data */ + "MY_CASEFOLD_CHARACTER" , /* page_data_type_name */ + "page_tr", /* page_name */ + "page", /* page_name_derived */ + "MY_CASEFOLD_CHARACTER *", /* index_data_type_name */ + "my_casefold_tr_pages" /* index_name */ + } +}; + + +static UNIDATA_OPT opt_weight_general_ci= +{ + 0xFFFF, /* max_char */ + 0x7FF, /* dummy_pages_codepoint_max == utf8 mb2 range */ + NULL, /*filename*/ + { + "weight_general_ci", /* mode name */ + 0, /* print_ctype */ + 0, /* print_toupper */ + 0, /* print_tolower */ + 0, /* print_noaccent */ + 0, /* print_noaccent_tolower */ + 1, /* print_noaccent_toupper */ + 0, /* print_curly_brackets_in_items */ + 0, /* print_curly_brackets_in_index */ + 8, /* chars_per_line */ + 0, /* single_array */ + 2, /* pages_per_line_in_index */ + 1, /* const_data */ + "uint16", /* page_data_type_name */ + "weight_general_ci_page", /* page_name */ + NULL, /* page_name_derived */ + "uint16 *", /* index_data_type_name */ + "weight_general_ci_index" /* index_name */ + } +}; + + +static UNIDATA_OPT opt_weight_general_mysql500_ci= +{ + 0xFFFF, /* max_char */ + 0x7FF, /* dummy_pages_codepoint_max == utf8 mb2 range */ + NULL, /*filename*/ + { + "weight_general_mysql500_ci", /* mode name */ + 0, /* print_ctype */ + 0, /* print_toupper */ + 0, /* print_tolower */ + 0, /* print_noaccent */ + 0, /* print_noaccent_tolower */ + 1, /* print_noaccent_toupper */ + 0, /* print_curly_brackets_in_items */ + 0, /* print_curly_brackets_in_index */ + 8, /* chars_per_line */ + 0, /* single_array */ + 2, /* pages_per_line_in_index */ + 1, /* const_data */ + "uint16", /* page_data_type_name */ + "weight_general_mysql500_ci_page", /* page_name */ + "weight_general_ci_page", /* page_name_derived */ + "uint16 *", /* index_data_type_name */ + "weight_general_mysql500_ci_index" /* index_name */ + } +}; + + +static UNIDATA_OPT opt_ctype= +{ + 0x10FFFF, /* max_char */ + 0x7FF, /* dummy_pages_codepoint_max == utf8 mb2 range */ + NULL, /*filename*/ + { + "ctype", /* mode name */ + 1, /* print_ctype */ + 0, /* print_toupper */ + 0, /* print_tolower */ + 0, /* print_noaccent */ + 0, /* print_noaccent_tolower */ + 0, /* print_noaccent_toupper */ + 0, /* print_curly_brackets_in_items */ + 1, /* print_curly_brackets_in_index */ + 16, /* chars_per_line */ + 0, /* single_array */ + 1, /* pages_per_line_in_index */ + 1, /* const_data */ + "unsigned char", /* page_data_type_name */ + "uctype_page", /* page_name */ + NULL, /* page_name_derived */ + "MY_UNI_CTYPE", /* index_data_type_name */ + "my_uni_ctype" /* index_name */ + } +}; + + +int opt_set_mode(UNIDATA_OPT *to, const char *name_and_value, const char *value) +{ + if (!strcmp(value, "casefold")) + { + to->mode= opt_casefold.mode; + return 0; + } + else if (!strcmp(value, "casefold-tr")) + { + to->mode= opt_casefold_tr.mode; + return 0; + } + else if (!strcmp(value, "caseinfo")) + { + to->mode= opt_caseinfo.mode; + return 0; + } + else if (!strcmp(value, "weight_general_ci")) + { + to->mode= opt_weight_general_ci.mode; + return 0; + } + else if (!strcmp(value, "weight_general_mysql500_ci")) + { + to->mode= opt_weight_general_mysql500_ci.mode; + return 0; + } + else if (!strcmp(value, "ctype")) + { + to->mode= opt_ctype.mode; + return 0; + } + fprintf(stderr, "Bad option: %s\n", name_and_value); + return 1; +} + + +static decomposition_type_t +get_decomposition_type(const char *str) +{ + if (!strcmp(str, "")) return DT_FONT; + if (!strcmp(str, "")) return DT_NOBREAK; + if (!strcmp(str, "")) return DT_INITIAL; + if (!strcmp(str, "")) return DT_MEDIAL; + if (!strcmp(str, "")) return DT_FINAL; + if (!strcmp(str, "")) return DT_ISOLATED; + if (!strcmp(str, "")) return DT_CIRCLE; + if (!strcmp(str, "")) return DT_SUPER; + if (!strcmp(str, "")) return DT_SUB; + if (!strcmp(str, "")) return DT_VERTICAL; + if (!strcmp(str, "")) return DT_WIDE; + if (!strcmp(str, "")) return DT_NARROW; + if (!strcmp(str, "")) return DT_SMALL; + if (!strcmp(str, "")) return DT_SQUARE; + if (!strcmp(str, "")) return DT_FRACTION; + if (!strcmp(str, "")) return DT_COMPAT; + return DT_UNKNOWN; +} + + +#define MAX_DECOMP 20 + + +typedef struct +{ + int ctype; + int toupper; + int tolower; + int noaccent; + int noaccent_tolower; + int noaccent_toupper; + int decomp_type; + int decomp[MAX_DECOMP]; + int to_be_decomposed; +} UNIDATA_CHAR; + + + +/************* Initialization functions *********/ + + +static int +strip_accent(UNIDATA_CHAR *code, int i) +{ + if (code[i].decomp[0] && + code[i].decomp[1] >= 0x0300 && + code[i].decomp[1] <= 0x036F && + code[i].decomp[2] == 0) + return strip_accent(code, code[i].decomp[0]); + return i; +} + + +static void +set_noaccent(const UNIDATA_OPT *opt, UNIDATA_CHAR *code) +{ + my_wchar_t i; + for (i= 0; i <= opt->max_char; i++) + { + code[i].noaccent= strip_accent(code, i); + } +} + + +static void +set_noaccent_tolower(const UNIDATA_OPT *opt, UNIDATA_CHAR *code) +{ + my_wchar_t i; + for (i= 0; i <= opt->max_char; i++) + { + code[i].noaccent_tolower= code[code[i].noaccent].tolower; + } +} + + +static void +set_noaccent_toupper(const UNIDATA_OPT *opt, UNIDATA_CHAR *code) +{ + my_wchar_t i; + for (i= 0; i <= opt->max_char; i++) + { + code[i].noaccent_toupper= code[code[i].noaccent].toupper; + } +} + + +static void +set_default_case_folding(const UNIDATA_OPT *opt, UNIDATA_CHAR *code) +{ + my_wchar_t i; + for (i= 0; i <= opt->max_char; i++) + { + code[i].tolower= i; + code[i].toupper= i; + } +} + + +/* + Fill ideographs +*/ + +static void +fill_cjk(UNIDATA_CHAR *code) +{ + size_t i; + /* CJK Ideographs Extension A (U+3400 - U+4DB5) */ + for(i=0x3400;i<=0x4DB5;i++) + { + code[i].tolower=i; + code[i].ctype= CT_CJK; + } + /* CJK Ideographs (U+4E00 - U+9FA5) */ + for(i=0x4E00;i<=0x9FA5;i++) + { + code[i].tolower=i; + code[i].ctype= CT_CJK; + } + /* Hangul Syllables (U+AC00 - U+D7A3) */ + for(i=0xAC00;i<=0xD7A3;i++) + { + code[i].tolower=i; + code[i].ctype= CT_HANGUL; + } +} + + +/************* Loading functions ***************/ + + +static void handle_general_category(const UNIDATA_OPT *opt, + UNIDATA_CHAR *ch, + const char *tok, + my_wchar_t codepoint) +{ + /* + TODO: check if ctype is set correctly. + A difference can break fulltext indexes. + */ + + const MY_CTYPE_NAME_ST *ct= ctype_name_st_find( + (my_wchar_t) codepoint, tok); + if (ct) + { + ch->ctype|= ctype_name_st_to_num( + ct, + (my_wchar_t) codepoint); + ch->to_be_decomposed= ct->to_be_decomposed; + } +} + + +int handle_decomposition(UNIDATA_CHAR *ch, char *tok, const char *str) +{ + char *lt, *part; + size_t num; + + if (!ch->to_be_decomposed) + return 0; /* Decompose only letters */ + + for (part= strtok_r(tok, " ", <), num= 0; + part; + part= strtok_r(NULL, " ", <)) + { + char *end; + if (part[0] == '<') + { + if ((ch->decomp_type= get_decomposition_type(part)) == DT_UNKNOWN) + { + fprintf(stderr, "Unknown decomposition type:\n%s\n", str); + return 1; + } + continue; + } + + if (num + 1 >= MAX_DECOMP) + { + fprintf(stderr, "Too many decomposition parts:\n%s\n", str); + return 1; + } + ch->decomp[num]= strtol(part,&end,16); + ch->decomp[num+1]= 0; + num++; + } + return 0; +} + + +static int +parse_unidata_line(const UNIDATA_OPT *opt, char *str, UNIDATA_CHAR *unidata) +{ + unsigned long codepoint= 0; + int fieldno= 0; + char *s; + + for (s= str; *s; fieldno++) + { + char *tok= s, *e; + + if ((e= strchr(s,';'))) + { + *e= '\0'; + s= e + 1; + } + else + { + s+= strlen(s); + } + + switch (fieldno) + { + case 0: /* Code point */ + codepoint= strtoul(tok, NULL, 16); + if (codepoint > opt->max_char) + return 1; + break; + case 1: /* name */ + break; + case 2: /* general category */ + handle_general_category(opt, &unidata[codepoint], + tok, (my_wchar_t) codepoint); + break; + case 3: /* Canonical combining class */ + break; + case 4: /* BiDi class */ + break; + case 5: /* Decomposition type */ + if (tok[0] && handle_decomposition(&unidata[codepoint], tok, str)) + return -1; + break; + case 6: /* Numeric_Type, Numeric Value */ + break; + case 7: /* Numeric_Type, Numeric Value */ + break; + case 8: /* Numeric_Type, Numeric Value */ + break; + case 9: /* BiDi mirrored */ + break; + case 10: /* Unicode_1_Name */ + break; + case 11: /* ISO_Comment */ + break; + case 12: /*Simple_Uppercase_Mapping*/ + if (tok[0]) + unidata[codepoint].toupper= strtol(tok, NULL, 16); + break; + case 13: /*Simple_Lowercase_Mapping*/ + if (tok[0]) + unidata[codepoint].tolower= strtol(tok, NULL, 16); + break; + case 14: /* Simple_Titlecase_Mapping */ + break; + } + } + + return 0; +} + + +static int +load_unidata_file(const UNIDATA_OPT *opt, FILE *f, UNIDATA_CHAR *unidata) +{ + char str[1024]; + + while (fgets(str, sizeof(str), f)) + { + if (parse_unidata_line(opt, str, unidata) < 0) + return 1; + } + return 0; +} + + +static int +load_unidata(const UNIDATA_OPT *opt, UNIDATA_CHAR *unidata) +{ + FILE *f; + int rc; + if (!(f= fopen(opt->filename, "r"))) + { + fprintf(stderr, "Could not open file '%s'\n", opt->filename); + return 1; + } + rc= load_unidata_file(opt, f, unidata); + fclose(f); + return rc; +} + +/************** Printing functions ********************/ + +static void +print_one_char(const UNIDATA_OPT *opt, UNIDATA_CHAR *data, int code) +{ + UNIDATA_CHAR *ch= &data[code]; + const char *comma= ""; + + if (opt->mode.print_curly_brackets_in_items) + printf("{"); + + if (opt->mode.print_ctype) + { + printf("%s", comma); + printf("%3d", ch->ctype); + comma= ","; + } + + if (opt->mode.print_toupper) + { + printf("%s", comma); + printf("0x%04X", ch->toupper); + comma= ","; + } + + if (opt->mode.print_tolower) + { + printf("%s", comma); + printf("0x%04X", ch->tolower); + comma= ","; + } + + if (opt->mode.print_noaccent) + { + printf("%s", comma); + printf("0x%04X", ch->noaccent); + comma= ","; + } + + if (opt->mode.print_noaccent_tolower) + { + printf("%s", comma); + printf("0x%04X", ch->noaccent_tolower); + comma= ","; + } + + if (opt->mode.print_noaccent_toupper) + { + printf("%s", comma); + printf("0x%04X", ch->noaccent_toupper); + comma= ","; + } + + if (opt->mode.print_curly_brackets_in_items) + printf("}"); + + if (opt->mode.single_array || + (code & 0xFF) != 0xFF) /* Don't print comma for the last char in a page */ + printf(","); + else + printf(" "); +} + + +static void +print_one_page(const UNIDATA_OPT *opt, UNIDATA_CHAR *data, + my_wchar_t pageno, const PAGE_STAT *pstat) +{ + my_wchar_t charnum; + + if (!opt->mode.single_array || pageno == 0) + { + printf("%s%s%s %s%02X[256]={%s\n", + pageno == 0 ? "" : "static ", + opt->mode.const_data ? "const " : "", + opt->mode.page_data_type_name, opt->mode.page_name, + (unsigned int) pageno, + pstat[pageno].page_tab == PAGE_DATA_DUMMY ? + " /* This page is dummy */" : ""); + } + + for (charnum= 0; charnum < 256; charnum++) + { + my_wchar_t codepoint= (pageno << 8) + charnum; + my_wchar_t rem= charnum % opt->mode.chars_per_line; + if (!rem) + printf(" "); + print_one_char(opt, data, codepoint); + if (rem + 1 == opt->mode.chars_per_line) + { + printf(" /* %04X */", (codepoint + 1) - opt->mode.chars_per_line); + printf("\n"); + } + } + if (!opt->mode.single_array) + printf("};\n\n"); +} + + +static const char *page_name_in_index(const UNIDATA_OPT *opt, + const PAGE_STAT *pstat, + my_wchar_t pageno) +{ + if (!opt->mode.page_name_derived) + return opt->mode.page_name; + + return pstat[pageno].page_overridden ? + opt->mode.page_name : + opt->mode.page_name_derived; +} + + +static void print_page_index(const UNIDATA_OPT *opt, + const PAGE_STAT *pstat) +{ + my_wchar_t page; + my_wchar_t npages= npages_by_opt(opt); + int printing_ctype= !strcmp(opt->mode.index_data_type_name, "MY_UNI_CTYPE"); + + printf("%s%s %s[%d]={\n", + opt->mode.const_data ? "const " : "", + opt->mode.index_data_type_name, opt->mode.index_name, + (unsigned int) npages); + + for (page= 0; page < npages; page++) + { + my_wchar_t rem= page % opt->mode.pages_per_line_in_index; + if (!rem) + printf(" "); + if (opt->mode.print_curly_brackets_in_index) + printf("{"); + if (printing_ctype) + printf("%d,", pstat[page].page_ctype); + + if (pstat[page].page_tab) + printf("%s%02X", page_name_in_index(opt, pstat, page), page); + else + printf("NULL"); + + if (opt->mode.print_curly_brackets_in_index) + printf("}"); + + if (page + 1 < npages) + printf(","); + + if (rem + 1 == opt->mode.pages_per_line_in_index) + printf("\n"); + else + printf(" "); + } + printf("};\n"); +} + + +static void print(UNIDATA_OPT *opt, UNIDATA_CHAR *unidata, const PAGE_STAT *pstat) +{ + my_wchar_t npages= npages_by_opt(opt); + my_wchar_t page; + + /* Print all pages */ + for (page= 0; page < npages; page++) + { + if (opt->mode.page_name_derived && !pstat[page].page_overridden) + continue; + if (opt->mode.single_array || pstat[page].page_tab) + print_one_page(opt, unidata, page, pstat); + } + + /* Print index */ + if (!opt->mode.single_array) + print_page_index(opt, pstat); +} + + +void print_command_line_options(int ac, char **av) +{ + int i; + printf("/*\n"); + printf(" Generated by:\n"); + for (i= 0; i < ac; i++) + { + printf(" %s%s%s\n", i > 0 ? " " : "", av[i], i+1 < ac ? " \\" :""); + } + printf("\n"); + printf("*/\n"); +} + + +static void calc_page_parameters(const UNIDATA_OPT *opt, const UNIDATA_CHAR *code, + PAGE_STAT *pstat) +{ + my_wchar_t npages= npages_by_opt(opt); + my_wchar_t page; + for(page= 0; page < npages; page++) + { + int ntype[CT_MAX + 1], t; + int character, done=0; + + memset(ntype,0,sizeof(ntype)); + for(character= 0;character < 256; character++) + { + size_t cod= (page << 8) + character; + const UNIDATA_CHAR *ch= &code[cod]; + ntype[ch->ctype]++; + + if((ch->tolower != cod || + ch->toupper != cod || + ch->noaccent != cod || + ch->noaccent_toupper != cod) && + (opt->mode.print_tolower || + opt->mode.print_toupper || + opt->mode.print_noaccent || + opt->mode.print_noaccent_toupper)) + { + pstat[page].page_tab= PAGE_DATA_IMPORTANT; + } + } + + if (opt->mode.print_ctype) + { + for (t= 0; t <= CT_MAX; t++) + { + if(ntype[t]==256) + { + /* All ctypes are the same */ + pstat[page].page_ctype= t; + done=1; + break; + } + } + } + else + { + done= 1; /* Don't need ctype */ + } + + if(!done) + { + /* Mixed page, lets create the table */ + pstat[page].page_ctype= CT_NONE; + pstat[page].page_tab= PAGE_DATA_IMPORTANT; + } + if (!pstat[page].page_tab && + page <= (opt->dummy_pages_codepoint_max >> 8)) + pstat[page].page_tab= PAGE_DATA_DUMMY; + } +} + + +static UNIDATA_CHAR code[MAX_UNI_CHAR + 1]; +static PAGE_STAT pstat[MAX_UNI_PAGE + 1]; + + +int usage(int ac, char **av) +{ + fprintf(stderr, "Usage: %s filename\n", av[0]); + return 1; +} + + +const char *one_opt(const char *option, const char *name, size_t length) +{ + if (!strncmp(option, name, length)) + return option + length; + return 0; +} + + +int get_option_bool(int *to, const char *name_and_value, const char *value) +{ + if (!strcmp(value, "1")) + *to= 1; + else if (!strcmp(value, "0")) + *to= 0; + else + { + fprintf(stderr, "Bad option: %s\n", name_and_value); + return 1; + } + return 0; +} + + +int get_option_codepoint(my_wchar_t *to, const char *name_and_value, const char *value) +{ + unsigned long codepoint= value[0]=='0' && value[1]=='x' ? + strtoul(value + 2, NULL, 16) : + strtoul(value, NULL, 10); + if (codepoint > MAX_UNI_CHAR) + { + fprintf(stderr, "Too large --max-char: %s\n", name_and_value); + return 1; + } + *to= (my_wchar_t) codepoint; + return 0; +} + + +int process_param(UNIDATA_OPT *opt, int ac, char **av) +{ + int i; + if (ac < 2) + return usage(ac, av); + for (i= 1; i < ac; i++) + { + const char *op; + if ((op= one_opt(av[i], STRING_WITH_LEN("--mode=")))) + { + if (opt_set_mode(opt, av[i], op)) + return 1; + } + else if ((op= one_opt(av[i], STRING_WITH_LEN("--max-char=")))) + { + if (get_option_codepoint(&opt->max_char, av[i], op)) + return 1; + } + else if ((op= one_opt(av[i], STRING_WITH_LEN("--print-toupper=")))) + { + if (get_option_bool(&opt->mode.print_toupper, av[i], op)) + return 1; + } + else if ((op= one_opt(av[i], STRING_WITH_LEN("--print-tolower=")))) + { + if (get_option_bool(&opt->mode.print_tolower, av[i], op)) + return 1; + } + else if ((op= one_opt(av[i], STRING_WITH_LEN("--print-noaccent-toupper=")))) + { + if (get_option_bool(&opt->mode.print_noaccent_toupper, av[i], op)) + return 1; + } + else if ((op= one_opt(av[i], STRING_WITH_LEN("--page-name=")))) + { + opt->mode.page_name= op; + } + else if ((op= one_opt(av[i], STRING_WITH_LEN("--page-name-derived=")))) + { + opt->mode.page_name_derived= op; + } + else if ((op= one_opt(av[i], STRING_WITH_LEN("--index-name=")))) + { + opt->mode.index_name= op; + } + else + { + if (av[i][0] == '-' && av[i][1] == '-') + { + fprintf(stderr, "Unknown option: %s\n", av[i]); + return 1; + } + break; + } + } + if (i + 1 != ac) + return usage(ac, av); + opt->filename= av[i]; + return 0; +} + + +int main(int ac,char **av) +{ + UNIDATA_OPT opt= opt_caseinfo; + + if (process_param(&opt, ac, av)) + return 1; + + memset(code,0,sizeof(code)); + memset(pstat,0,sizeof(pstat)); + + set_default_case_folding(&opt, code); + + fill_cjk(code); + + if (load_unidata(&opt, code)) + return 1; + + set_noaccent(&opt, code); + set_noaccent_tolower(&opt, code); + set_noaccent_toupper(&opt, code); + + /* + Bug#8385: utf8_general_ci treats cyrillic letters I and SHORT I as the same + Because of decomposition applied, noaccent_toupper for the following letters: + U+0419 CYRILLIC CAPITAL LETTER SHORT I + U+0439 CYRILLIC SMALL LETTER SHORT I + was set to: + U+418 CYRILLIC CAPITAL LETTER I + Reset it back to U+0419. + */ + code[0x0419].noaccent_toupper= 0x0419; + code[0x0439].noaccent_toupper= 0x0419; + + /* + Bug#27877 incorrect german order in utf8_general_ci + */ + if (strcmp(opt.mode.mode_name, "weight_general_mysql500_ci")) + { + code[0x00DF].noaccent_toupper= code['s'].noaccent_toupper; + } + else + pstat[0].page_overridden= 1; + + if (!strcmp(opt.mode.mode_name, "casefold-tr")) + { + code[0x49].tolower= 0x0131; + code[0x69].toupper= 0x0130; + pstat[0].page_overridden= 1; + } + + calc_page_parameters(&opt, code, pstat); + + printf("%s\n", COPYING); + print_command_line_options(ac, av); + print(&opt, code, pstat); + + return 0; +} From c21745dbe4b8e1489b1f2f27de094df04143830a Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 2 Mar 2023 17:37:36 +0400 Subject: [PATCH 130/260] MDEV-30577 Case folding for uca1400 collations is not up to date Adding casefolding for Unicode-14.0.0 into uca1400 collations. --- mysql-test/include/ctype_casefolding.inc | 6 + .../ctype_casefolding_supplementary.inc | 16 + mysql-test/main/ctype_ldml.result | 47 + mysql-test/main/ctype_ldml.test | 7 + mysql-test/main/ctype_utf8_uca.result | 63 + mysql-test/main/ctype_utf8mb4_uca.result | 165 + mysql-test/main/ctype_utf8mb4_uca.test | 5 + ...type_utf8mb4_uca1400_ai_ci_casefold.result | 2927 ++++++++++++ .../ctype_utf8mb4_uca1400_ai_ci_casefold.test | 15 + strings/ctype-uca.c | 6 +- strings/ctype-unicode1400-casefold-tr.h | 704 +++ strings/ctype-unicode1400-casefold.h | 4240 +++++++++++++++++ strings/ctype-unidata.c | 18 + strings/ctype-unidata.h | 2 + strings/ctype-utf8.c | 4 +- 15 files changed, 8221 insertions(+), 4 deletions(-) create mode 100644 mysql-test/include/ctype_casefolding_supplementary.inc create mode 100644 mysql-test/main/ctype_utf8mb4_uca1400_ai_ci_casefold.result create mode 100644 mysql-test/main/ctype_utf8mb4_uca1400_ai_ci_casefold.test create mode 100644 strings/ctype-unicode1400-casefold-tr.h create mode 100644 strings/ctype-unicode1400-casefold.h diff --git a/mysql-test/include/ctype_casefolding.inc b/mysql-test/include/ctype_casefolding.inc index 74b2ab7650a..fc77b396f68 100644 --- a/mysql-test/include/ctype_casefolding.inc +++ b/mysql-test/include/ctype_casefolding.inc @@ -21,6 +21,12 @@ INSERT INTO case_folding (code) VALUES (0x0131) /* LATIN SMALL LETTER DOTLESS I */ ; +INSERT INTO case_folding (code) VALUES +(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */, +(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */; + UPDATE case_folding SET c=CHAR(code USING ucs2); SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding; DROP TABLE case_folding; diff --git a/mysql-test/include/ctype_casefolding_supplementary.inc b/mysql-test/include/ctype_casefolding_supplementary.inc new file mode 100644 index 00000000000..7646ab5682e --- /dev/null +++ b/mysql-test/include/ctype_casefolding_supplementary.inc @@ -0,0 +1,16 @@ +CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c, SPACE(64) AS comment LIMIT 0; +SHOW CREATE TABLE case_folding; + +INSERT INTO case_folding (code, comment) VALUES (0x10595, 'VITHKUQI CAPITAL LETTER ZE (Unicode-14.0)'); +INSERT INTO case_folding (code, comment) VALUES (0x105BC, 'VITHKUQI SMALL LETTER ZE (Unicode-14.0)'); +INSERT INTO case_folding (code, comment) VALUES (0x1E921, 'ADLAM CAPITAL LETTER SHA (Unicode-9.0)'); +INSERT INTO case_folding (code, comment) VALUES (0x1E943, 'ADLAM SMALL LETTER SHA (Unicode-9.0)'); + +UPDATE case_folding SET c=CHAR(code USING utf32); +SELECT + HEX(CONVERT(c USING utf32)) AS ch, + HEX(CONVERT(LOWER(c) USING utf32)) AS cl, + HEX(CONVERT(UPPER(c) USING utf32)) AS cu, + comment +FROM case_folding ORDER BY BINARY(c); +DROP TABLE case_folding; diff --git a/mysql-test/main/ctype_ldml.result b/mysql-test/main/ctype_ldml.result index a23e835d1fa..31508fcd1b1 100644 --- a/mysql-test/main/ctype_ldml.result +++ b/mysql-test/main/ctype_ldml.result @@ -3074,6 +3074,11 @@ INSERT INTO case_folding (code) VALUES (0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */, (0x0131) /* LATIN SMALL LETTER DOTLESS I */ ; +INSERT INTO case_folding (code) VALUES +(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */, +(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */; UPDATE case_folding SET c=CHAR(code USING ucs2); SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding; HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c @@ -3091,6 +3096,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c 69 69 49 i 130 69 C4B0 İ 131 C4B1 49 ı +2C2F E2B0AF E2B0AF Ⱟ +2C5F E2B19F E2B19F ⱟ +A7C0 EA9F80 EA9F80 Ꟁ +A7C1 EA9F81 EA9F81 ꟁ DROP TABLE case_folding; # # End of 10.3 tests @@ -3267,6 +3276,11 @@ INSERT INTO case_folding (code) VALUES (0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */, (0x0131) /* LATIN SMALL LETTER DOTLESS I */ ; +INSERT INTO case_folding (code) VALUES +(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */, +(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */; UPDATE case_folding SET c=CHAR(code USING ucs2); SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding; HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c @@ -3284,6 +3298,39 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c 69 69 49 i 130 69 C4B0 İ 131 C4B1 49 ı +2C2F E2B19F E2B0AF Ⱟ +2C5F E2B19F E2B0AF ⱟ +A7C0 EA9F81 EA9F80 Ꟁ +A7C1 EA9F81 EA9F80 ꟁ +DROP TABLE case_folding; +# +# MDEV-30577 Case folding for uca1400 collations is not up to date +# +SET NAMES utf8mb4 COLLATE utf8mb4_uca1400_test01_as_ci; +CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c, SPACE(64) AS comment LIMIT 0; +SHOW CREATE TABLE case_folding; +Table Create Table +case_folding CREATE TABLE `case_folding` ( + `code` int(1) NOT NULL, + `c` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_test01_as_ci DEFAULT NULL, + `comment` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_test01_as_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO case_folding (code, comment) VALUES (0x10595, 'VITHKUQI CAPITAL LETTER ZE (Unicode-14.0)'); +INSERT INTO case_folding (code, comment) VALUES (0x105BC, 'VITHKUQI SMALL LETTER ZE (Unicode-14.0)'); +INSERT INTO case_folding (code, comment) VALUES (0x1E921, 'ADLAM CAPITAL LETTER SHA (Unicode-9.0)'); +INSERT INTO case_folding (code, comment) VALUES (0x1E943, 'ADLAM SMALL LETTER SHA (Unicode-9.0)'); +UPDATE case_folding SET c=CHAR(code USING utf32); +SELECT +HEX(CONVERT(c USING utf32)) AS ch, +HEX(CONVERT(LOWER(c) USING utf32)) AS cl, +HEX(CONVERT(UPPER(c) USING utf32)) AS cu, +comment +FROM case_folding ORDER BY BINARY(c); +ch cl cu comment +00010595 000105BC 00010595 VITHKUQI CAPITAL LETTER ZE (Unicode-14.0) +000105BC 000105BC 00010595 VITHKUQI SMALL LETTER ZE (Unicode-14.0) +0001E921 0001E943 0001E921 ADLAM CAPITAL LETTER SHA (Unicode-9.0) +0001E943 0001E943 0001E921 ADLAM SMALL LETTER SHA (Unicode-9.0) DROP TABLE case_folding; # # End of 10.10 tests diff --git a/mysql-test/main/ctype_ldml.test b/mysql-test/main/ctype_ldml.test index 6336a1d0f5f..9189630e5a3 100644 --- a/mysql-test/main/ctype_ldml.test +++ b/mysql-test/main/ctype_ldml.test @@ -704,6 +704,13 @@ DROP TABLE t1; SET NAMES utf8mb4 COLLATE utf8mb4_uca1400_test01_as_ci; --source include/ctype_casefolding.inc +--echo # +--echo # MDEV-30577 Case folding for uca1400 collations is not up to date +--echo # + +SET NAMES utf8mb4 COLLATE utf8mb4_uca1400_test01_as_ci; +--source include/ctype_casefolding_supplementary.inc + --echo # --echo # End of 10.10 tests --echo # diff --git a/mysql-test/main/ctype_utf8_uca.result b/mysql-test/main/ctype_utf8_uca.result index bacdd81cbd9..97bdadbb97b 100644 --- a/mysql-test/main/ctype_utf8_uca.result +++ b/mysql-test/main/ctype_utf8_uca.result @@ -618,6 +618,11 @@ INSERT INTO case_folding (code) VALUES (0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */, (0x0131) /* LATIN SMALL LETTER DOTLESS I */ ; +INSERT INTO case_folding (code) VALUES +(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */, +(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */; UPDATE case_folding SET c=CHAR(code USING ucs2); SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding; HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c @@ -635,6 +640,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c 69 69 49 i 130 69 C4B0 İ 131 C4B1 49 ı +2C2F E2B0AF E2B0AF Ⱟ +2C5F E2B19F E2B19F ⱟ +A7C0 EA9F80 EA9F80 Ꟁ +A7C1 EA9F81 EA9F81 ꟁ DROP TABLE case_folding; SET NAMES utf8mb3 COLLATE utf8mb3_turkish_ci /*Unicode-4.0 folding, with Turkish mapping for I */; CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0; @@ -661,6 +670,11 @@ INSERT INTO case_folding (code) VALUES (0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */, (0x0131) /* LATIN SMALL LETTER DOTLESS I */ ; +INSERT INTO case_folding (code) VALUES +(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */, +(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */; UPDATE case_folding SET c=CHAR(code USING ucs2); SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding; HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c @@ -678,6 +692,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c 69 69 C4B0 i 130 69 C4B0 İ 131 C4B1 49 ı +2C2F E2B0AF E2B0AF Ⱟ +2C5F E2B19F E2B19F ⱟ +A7C0 EA9F80 EA9F80 Ꟁ +A7C1 EA9F81 EA9F81 ꟁ DROP TABLE case_folding; SET NAMES utf8mb3 COLLATE utf8mb3_unicode_520_ci; CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0; @@ -704,6 +722,11 @@ INSERT INTO case_folding (code) VALUES (0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */, (0x0131) /* LATIN SMALL LETTER DOTLESS I */ ; +INSERT INTO case_folding (code) VALUES +(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */, +(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */; UPDATE case_folding SET c=CHAR(code USING ucs2); SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding; HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c @@ -721,6 +744,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c 69 69 49 i 130 69 C4B0 İ 131 C4B1 49 ı +2C2F E2B0AF E2B0AF Ⱟ +2C5F E2B19F E2B19F ⱟ +A7C0 EA9F80 EA9F80 Ꟁ +A7C1 EA9F81 EA9F81 ꟁ DROP TABLE case_folding; SET NAMES utf8mb3 COLLATE utf8mb3_unicode_520_nopad_ci; CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0; @@ -747,6 +774,11 @@ INSERT INTO case_folding (code) VALUES (0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */, (0x0131) /* LATIN SMALL LETTER DOTLESS I */ ; +INSERT INTO case_folding (code) VALUES +(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */, +(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */; UPDATE case_folding SET c=CHAR(code USING ucs2); SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding; HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c @@ -764,6 +796,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c 69 69 49 i 130 69 C4B0 İ 131 C4B1 49 ı +2C2F E2B0AF E2B0AF Ⱟ +2C5F E2B19F E2B19F ⱟ +A7C0 EA9F80 EA9F80 Ꟁ +A7C1 EA9F81 EA9F81 ꟁ DROP TABLE case_folding; SET NAMES utf8mb3 COLLATE utf8mb3_myanmar_ci; CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0; @@ -790,6 +826,11 @@ INSERT INTO case_folding (code) VALUES (0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */, (0x0131) /* LATIN SMALL LETTER DOTLESS I */ ; +INSERT INTO case_folding (code) VALUES +(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */, +(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */; UPDATE case_folding SET c=CHAR(code USING ucs2); SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding; HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c @@ -807,6 +848,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c 69 69 49 i 130 69 C4B0 İ 131 C4B1 49 ı +2C2F E2B0AF E2B0AF Ⱟ +2C5F E2B19F E2B19F ⱟ +A7C0 EA9F80 EA9F80 Ꟁ +A7C1 EA9F81 EA9F81 ꟁ DROP TABLE case_folding; SET NAMES utf8mb3 COLLATE utf8mb3_thai_520_w2; CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0; @@ -833,6 +878,11 @@ INSERT INTO case_folding (code) VALUES (0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */, (0x0131) /* LATIN SMALL LETTER DOTLESS I */ ; +INSERT INTO case_folding (code) VALUES +(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */, +(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */; UPDATE case_folding SET c=CHAR(code USING ucs2); SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding; HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c @@ -850,6 +900,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c 69 69 49 i 130 69 C4B0 İ 131 C4B1 49 ı +2C2F E2B0AF E2B0AF Ⱟ +2C5F E2B19F E2B19F ⱟ +A7C0 EA9F80 EA9F80 Ꟁ +A7C1 EA9F81 EA9F81 ꟁ DROP TABLE case_folding; # # End of 10.3 tests @@ -1805,6 +1859,11 @@ INSERT INTO case_folding (code) VALUES (0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */, (0x0131) /* LATIN SMALL LETTER DOTLESS I */ ; +INSERT INTO case_folding (code) VALUES +(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */, +(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */; UPDATE case_folding SET c=CHAR(code USING ucs2); SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding; HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c @@ -1822,6 +1881,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c 69 69 49 i 130 69 C4B0 İ 131 C4B1 49 ı +2C2F E2B19F E2B0AF Ⱟ +2C5F E2B19F E2B0AF ⱟ +A7C0 EA9F81 EA9F80 Ꟁ +A7C1 EA9F81 EA9F80 ꟁ DROP TABLE case_folding; # # End of 10.10 tests diff --git a/mysql-test/main/ctype_utf8mb4_uca.result b/mysql-test/main/ctype_utf8mb4_uca.result index 42de45c98a3..3cd25891119 100644 --- a/mysql-test/main/ctype_utf8mb4_uca.result +++ b/mysql-test/main/ctype_utf8mb4_uca.result @@ -6636,6 +6636,11 @@ INSERT INTO case_folding (code) VALUES (0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */, (0x0131) /* LATIN SMALL LETTER DOTLESS I */ ; +INSERT INTO case_folding (code) VALUES +(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */, +(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */; UPDATE case_folding SET c=CHAR(code USING ucs2); SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding; HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c @@ -6653,6 +6658,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c 69 69 49 i 130 69 C4B0 İ 131 C4B1 49 ı +2C2F E2B0AF E2B0AF Ⱟ +2C5F E2B19F E2B19F ⱟ +A7C0 EA9F80 EA9F80 Ꟁ +A7C1 EA9F81 EA9F81 ꟁ DROP TABLE case_folding; SET NAMES utf8mb4 COLLATE utf8mb4_turkish_ci /*Unicode-4.0 folding with Turkish mapping for I */; CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0; @@ -6679,6 +6688,11 @@ INSERT INTO case_folding (code) VALUES (0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */, (0x0131) /* LATIN SMALL LETTER DOTLESS I */ ; +INSERT INTO case_folding (code) VALUES +(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */, +(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */; UPDATE case_folding SET c=CHAR(code USING ucs2); SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding; HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c @@ -6696,6 +6710,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c 69 69 C4B0 i 130 69 C4B0 İ 131 C4B1 49 ı +2C2F E2B0AF E2B0AF Ⱟ +2C5F E2B19F E2B19F ⱟ +A7C0 EA9F80 EA9F80 Ꟁ +A7C1 EA9F81 EA9F81 ꟁ DROP TABLE case_folding; SET NAMES utf8mb4 COLLATE utf8mb4_unicode_520_ci; CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0; @@ -6722,6 +6740,11 @@ INSERT INTO case_folding (code) VALUES (0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */, (0x0131) /* LATIN SMALL LETTER DOTLESS I */ ; +INSERT INTO case_folding (code) VALUES +(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */, +(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */; UPDATE case_folding SET c=CHAR(code USING ucs2); SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding; HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c @@ -6739,6 +6762,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c 69 69 49 i 130 69 C4B0 İ 131 C4B1 49 ı +2C2F E2B0AF E2B0AF Ⱟ +2C5F E2B19F E2B19F ⱟ +A7C0 EA9F80 EA9F80 Ꟁ +A7C1 EA9F81 EA9F81 ꟁ DROP TABLE case_folding; SET NAMES utf8mb4 COLLATE utf8mb4_unicode_520_nopad_ci; CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0; @@ -6765,6 +6792,11 @@ INSERT INTO case_folding (code) VALUES (0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */, (0x0131) /* LATIN SMALL LETTER DOTLESS I */ ; +INSERT INTO case_folding (code) VALUES +(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */, +(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */; UPDATE case_folding SET c=CHAR(code USING ucs2); SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding; HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c @@ -6782,6 +6814,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c 69 69 49 i 130 69 C4B0 İ 131 C4B1 49 ı +2C2F E2B0AF E2B0AF Ⱟ +2C5F E2B19F E2B19F ⱟ +A7C0 EA9F80 EA9F80 Ꟁ +A7C1 EA9F81 EA9F81 ꟁ DROP TABLE case_folding; SET NAMES utf8mb4 COLLATE utf8mb4_myanmar_ci; CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0; @@ -6808,6 +6844,11 @@ INSERT INTO case_folding (code) VALUES (0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */, (0x0131) /* LATIN SMALL LETTER DOTLESS I */ ; +INSERT INTO case_folding (code) VALUES +(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */, +(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */; UPDATE case_folding SET c=CHAR(code USING ucs2); SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding; HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c @@ -6825,6 +6866,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c 69 69 49 i 130 69 C4B0 İ 131 C4B1 49 ı +2C2F E2B0AF E2B0AF Ⱟ +2C5F E2B19F E2B19F ⱟ +A7C0 EA9F80 EA9F80 Ꟁ +A7C1 EA9F81 EA9F81 ꟁ DROP TABLE case_folding; SET NAMES utf8mb4 COLLATE utf8mb4_thai_520_w2; CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0; @@ -6851,6 +6896,11 @@ INSERT INTO case_folding (code) VALUES (0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */, (0x0131) /* LATIN SMALL LETTER DOTLESS I */ ; +INSERT INTO case_folding (code) VALUES +(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */, +(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */; UPDATE case_folding SET c=CHAR(code USING ucs2); SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding; HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c @@ -6868,6 +6918,10 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c 69 69 49 i 130 69 C4B0 İ 131 C4B1 49 ı +2C2F E2B0AF E2B0AF Ⱟ +2C5F E2B19F E2B19F ⱟ +A7C0 EA9F80 EA9F80 Ꟁ +A7C1 EA9F81 EA9F81 ꟁ DROP TABLE case_folding; # # End of 10.3 tests @@ -11499,6 +11553,11 @@ INSERT INTO case_folding (code) VALUES (0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */, (0x0131) /* LATIN SMALL LETTER DOTLESS I */ ; +INSERT INTO case_folding (code) VALUES +(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */, +(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */; UPDATE case_folding SET c=CHAR(code USING ucs2); SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding; HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c @@ -11516,6 +11575,112 @@ HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c 69 69 49 i 130 69 C4B0 İ 131 C4B1 49 ı +2C2F E2B19F E2B0AF Ⱟ +2C5F E2B19F E2B0AF ⱟ +A7C0 EA9F81 EA9F80 Ꟁ +A7C1 EA9F81 EA9F80 ꟁ +DROP TABLE case_folding; +CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c, SPACE(64) AS comment LIMIT 0; +SHOW CREATE TABLE case_folding; +Table Create Table +case_folding CREATE TABLE `case_folding` ( + `code` int(1) NOT NULL, + `c` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL, + `comment` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO case_folding (code, comment) VALUES (0x10595, 'VITHKUQI CAPITAL LETTER ZE (Unicode-14.0)'); +INSERT INTO case_folding (code, comment) VALUES (0x105BC, 'VITHKUQI SMALL LETTER ZE (Unicode-14.0)'); +INSERT INTO case_folding (code, comment) VALUES (0x1E921, 'ADLAM CAPITAL LETTER SHA (Unicode-9.0)'); +INSERT INTO case_folding (code, comment) VALUES (0x1E943, 'ADLAM SMALL LETTER SHA (Unicode-9.0)'); +UPDATE case_folding SET c=CHAR(code USING utf32); +SELECT +HEX(CONVERT(c USING utf32)) AS ch, +HEX(CONVERT(LOWER(c) USING utf32)) AS cl, +HEX(CONVERT(UPPER(c) USING utf32)) AS cu, +comment +FROM case_folding ORDER BY BINARY(c); +ch cl cu comment +00010595 000105BC 00010595 VITHKUQI CAPITAL LETTER ZE (Unicode-14.0) +000105BC 000105BC 00010595 VITHKUQI SMALL LETTER ZE (Unicode-14.0) +0001E921 0001E943 0001E921 ADLAM CAPITAL LETTER SHA (Unicode-9.0) +0001E943 0001E943 0001E921 ADLAM SMALL LETTER SHA (Unicode-9.0) +DROP TABLE case_folding; +SET NAMES utf8mb4 COLLATE utf8mb4_uca1400_turkish_ai_ci; +CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c LIMIT 0; +SHOW CREATE TABLE case_folding; +Table Create Table +case_folding CREATE TABLE `case_folding` ( + `code` int(1) NOT NULL, + `c` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_turkish_ai_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO case_folding (code) VALUES +(0x23A), +(0x23E), +(0x23F), +(0x240), +(0x250), +(0x251), +(0x252), +(0x26B), +(0x271), +(0x27D); +INSERT INTO case_folding (code) VALUES +(0x0049) /* LATIN CAPITAL LETTER I */, +(0x0069) /* LATIN SMALL LETTER I */, +(0x0130) /* LATIN CAPITAL LETTER I WITH DOT ABOVE */, +(0x0131) /* LATIN SMALL LETTER DOTLESS I */ +; +INSERT INTO case_folding (code) VALUES +(0x2C2F) /* GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0x2C5F) /* GLAGOLITIC SMALL LETTER CAUDATE CHRIVI (Unicode-14.0) */, +(0xA7C0) /* LATIN CAPITAL LETTER OLD POLISH O (Unicode-14.0) */, +(0xA7C1) /* LATIN SMALL LETTER OLD POLISH O (Unicode-14.0) */; +UPDATE case_folding SET c=CHAR(code USING ucs2); +SELECT HEX(code), HEX(LOWER(c)), HEX(UPPER(c)), c FROM case_folding; +HEX(code) HEX(LOWER(c)) HEX(UPPER(c)) c +23A E2B1A5 C8BA Ⱥ +23E E2B1A6 C8BE Ⱦ +23F C8BF E2B1BE ȿ +240 C980 E2B1BF ɀ +250 C990 E2B1AF ɐ +251 C991 E2B1AD ɑ +252 C992 E2B1B0 ɒ +26B C9AB E2B1A2 ɫ +271 C9B1 E2B1AE ɱ +27D C9BD E2B1A4 ɽ +49 C4B1 49 I +69 69 C4B0 i +130 69 C4B0 İ +131 C4B1 49 ı +2C2F E2B19F E2B0AF Ⱟ +2C5F E2B19F E2B0AF ⱟ +A7C0 EA9F81 EA9F80 Ꟁ +A7C1 EA9F81 EA9F80 ꟁ +DROP TABLE case_folding; +CREATE OR REPLACE TABLE case_folding AS SELECT 0 AS code, SPACE(32) AS c, SPACE(64) AS comment LIMIT 0; +SHOW CREATE TABLE case_folding; +Table Create Table +case_folding CREATE TABLE `case_folding` ( + `code` int(1) NOT NULL, + `c` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_turkish_ai_ci DEFAULT NULL, + `comment` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_turkish_ai_ci DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO case_folding (code, comment) VALUES (0x10595, 'VITHKUQI CAPITAL LETTER ZE (Unicode-14.0)'); +INSERT INTO case_folding (code, comment) VALUES (0x105BC, 'VITHKUQI SMALL LETTER ZE (Unicode-14.0)'); +INSERT INTO case_folding (code, comment) VALUES (0x1E921, 'ADLAM CAPITAL LETTER SHA (Unicode-9.0)'); +INSERT INTO case_folding (code, comment) VALUES (0x1E943, 'ADLAM SMALL LETTER SHA (Unicode-9.0)'); +UPDATE case_folding SET c=CHAR(code USING utf32); +SELECT +HEX(CONVERT(c USING utf32)) AS ch, +HEX(CONVERT(LOWER(c) USING utf32)) AS cl, +HEX(CONVERT(UPPER(c) USING utf32)) AS cu, +comment +FROM case_folding ORDER BY BINARY(c); +ch cl cu comment +00010595 000105BC 00010595 VITHKUQI CAPITAL LETTER ZE (Unicode-14.0) +000105BC 000105BC 00010595 VITHKUQI SMALL LETTER ZE (Unicode-14.0) +0001E921 0001E943 0001E921 ADLAM CAPITAL LETTER SHA (Unicode-9.0) +0001E943 0001E943 0001E921 ADLAM SMALL LETTER SHA (Unicode-9.0) DROP TABLE case_folding; # # End of 10.10 tests diff --git a/mysql-test/main/ctype_utf8mb4_uca.test b/mysql-test/main/ctype_utf8mb4_uca.test index 3f428447cc9..1b709ebba69 100644 --- a/mysql-test/main/ctype_utf8mb4_uca.test +++ b/mysql-test/main/ctype_utf8mb4_uca.test @@ -435,6 +435,11 @@ DROP PROCEDURE test_styles; SET NAMES utf8mb4 COLLATE utf8mb4_uca1400_ai_ci; --source include/ctype_casefolding.inc +--source include/ctype_casefolding_supplementary.inc + +SET NAMES utf8mb4 COLLATE utf8mb4_uca1400_turkish_ai_ci; +--source include/ctype_casefolding.inc +--source include/ctype_casefolding_supplementary.inc --echo # --echo # End of 10.10 tests diff --git a/mysql-test/main/ctype_utf8mb4_uca1400_ai_ci_casefold.result b/mysql-test/main/ctype_utf8mb4_uca1400_ai_ci_casefold.result new file mode 100644 index 00000000000..85e87f217cc --- /dev/null +++ b/mysql-test/main/ctype_utf8mb4_uca1400_ai_ci_casefold.result @@ -0,0 +1,2927 @@ +# +# Start of 10.10 tests +# +# +# MDEV-30577 Case folding for uca1400 collations is not up to date +# +SET NAMES utf8mb4 COLLATE utf8mb4_uca1400_ai_ci; +EXECUTE IMMEDIATE SFORMAT(' +CREATE VIEW v_bmp AS +SELECT + seq AS codepoint, + LPAD(HEX(seq),4,''0'') AS codepoint_hex4, + CONVERT(CHAR(seq USING utf32) USING {}) COLLATE {} AS c +FROM + seq_0_to_65535', @@character_set_connection, @@collation_connection); +SELECT COLLATION(c) FROM v_bmp LIMIT 1; +COLLATION(c) +utf8mb4_uca1400_ai_ci +SELECT +codepoint_hex4, +HEX(CAST(LOWER(c) AS CHAR CHARACTER SET ucs2)), +HEX(CAST(UPPER(c) AS CHAR CHARACTER SET ucs2)) +FROM v_bmp +WHERE BINARY(c)<>BINARY(LOWER(c)) OR BINARY(c)<>BINARY(UPPER(c)); +codepoint_hex4 HEX(CAST(LOWER(c) AS CHAR CHARACTER SET ucs2)) HEX(CAST(UPPER(c) AS CHAR CHARACTER SET ucs2)) +0041 0061 0041 +0042 0062 0042 +0043 0063 0043 +0044 0064 0044 +0045 0065 0045 +0046 0066 0046 +0047 0067 0047 +0048 0068 0048 +0049 0069 0049 +004A 006A 004A +004B 006B 004B +004C 006C 004C +004D 006D 004D +004E 006E 004E +004F 006F 004F +0050 0070 0050 +0051 0071 0051 +0052 0072 0052 +0053 0073 0053 +0054 0074 0054 +0055 0075 0055 +0056 0076 0056 +0057 0077 0057 +0058 0078 0058 +0059 0079 0059 +005A 007A 005A +0061 0061 0041 +0062 0062 0042 +0063 0063 0043 +0064 0064 0044 +0065 0065 0045 +0066 0066 0046 +0067 0067 0047 +0068 0068 0048 +0069 0069 0049 +006A 006A 004A +006B 006B 004B +006C 006C 004C +006D 006D 004D +006E 006E 004E +006F 006F 004F +0070 0070 0050 +0071 0071 0051 +0072 0072 0052 +0073 0073 0053 +0074 0074 0054 +0075 0075 0055 +0076 0076 0056 +0077 0077 0057 +0078 0078 0058 +0079 0079 0059 +007A 007A 005A +00B5 00B5 039C +00C0 00E0 00C0 +00C1 00E1 00C1 +00C2 00E2 00C2 +00C3 00E3 00C3 +00C4 00E4 00C4 +00C5 00E5 00C5 +00C6 00E6 00C6 +00C7 00E7 00C7 +00C8 00E8 00C8 +00C9 00E9 00C9 +00CA 00EA 00CA +00CB 00EB 00CB +00CC 00EC 00CC +00CD 00ED 00CD +00CE 00EE 00CE +00CF 00EF 00CF +00D0 00F0 00D0 +00D1 00F1 00D1 +00D2 00F2 00D2 +00D3 00F3 00D3 +00D4 00F4 00D4 +00D5 00F5 00D5 +00D6 00F6 00D6 +00D8 00F8 00D8 +00D9 00F9 00D9 +00DA 00FA 00DA +00DB 00FB 00DB +00DC 00FC 00DC +00DD 00FD 00DD +00DE 00FE 00DE +00E0 00E0 00C0 +00E1 00E1 00C1 +00E2 00E2 00C2 +00E3 00E3 00C3 +00E4 00E4 00C4 +00E5 00E5 00C5 +00E6 00E6 00C6 +00E7 00E7 00C7 +00E8 00E8 00C8 +00E9 00E9 00C9 +00EA 00EA 00CA +00EB 00EB 00CB +00EC 00EC 00CC +00ED 00ED 00CD +00EE 00EE 00CE +00EF 00EF 00CF +00F0 00F0 00D0 +00F1 00F1 00D1 +00F2 00F2 00D2 +00F3 00F3 00D3 +00F4 00F4 00D4 +00F5 00F5 00D5 +00F6 00F6 00D6 +00F8 00F8 00D8 +00F9 00F9 00D9 +00FA 00FA 00DA +00FB 00FB 00DB +00FC 00FC 00DC +00FD 00FD 00DD +00FE 00FE 00DE +00FF 00FF 0178 +0100 0101 0100 +0101 0101 0100 +0102 0103 0102 +0103 0103 0102 +0104 0105 0104 +0105 0105 0104 +0106 0107 0106 +0107 0107 0106 +0108 0109 0108 +0109 0109 0108 +010A 010B 010A +010B 010B 010A +010C 010D 010C +010D 010D 010C +010E 010F 010E +010F 010F 010E +0110 0111 0110 +0111 0111 0110 +0112 0113 0112 +0113 0113 0112 +0114 0115 0114 +0115 0115 0114 +0116 0117 0116 +0117 0117 0116 +0118 0119 0118 +0119 0119 0118 +011A 011B 011A +011B 011B 011A +011C 011D 011C +011D 011D 011C +011E 011F 011E +011F 011F 011E +0120 0121 0120 +0121 0121 0120 +0122 0123 0122 +0123 0123 0122 +0124 0125 0124 +0125 0125 0124 +0126 0127 0126 +0127 0127 0126 +0128 0129 0128 +0129 0129 0128 +012A 012B 012A +012B 012B 012A +012C 012D 012C +012D 012D 012C +012E 012F 012E +012F 012F 012E +0130 0069 0130 +0131 0131 0049 +0132 0133 0132 +0133 0133 0132 +0134 0135 0134 +0135 0135 0134 +0136 0137 0136 +0137 0137 0136 +0139 013A 0139 +013A 013A 0139 +013B 013C 013B +013C 013C 013B +013D 013E 013D +013E 013E 013D +013F 0140 013F +0140 0140 013F +0141 0142 0141 +0142 0142 0141 +0143 0144 0143 +0144 0144 0143 +0145 0146 0145 +0146 0146 0145 +0147 0148 0147 +0148 0148 0147 +014A 014B 014A +014B 014B 014A +014C 014D 014C +014D 014D 014C +014E 014F 014E +014F 014F 014E +0150 0151 0150 +0151 0151 0150 +0152 0153 0152 +0153 0153 0152 +0154 0155 0154 +0155 0155 0154 +0156 0157 0156 +0157 0157 0156 +0158 0159 0158 +0159 0159 0158 +015A 015B 015A +015B 015B 015A +015C 015D 015C +015D 015D 015C +015E 015F 015E +015F 015F 015E +0160 0161 0160 +0161 0161 0160 +0162 0163 0162 +0163 0163 0162 +0164 0165 0164 +0165 0165 0164 +0166 0167 0166 +0167 0167 0166 +0168 0169 0168 +0169 0169 0168 +016A 016B 016A +016B 016B 016A +016C 016D 016C +016D 016D 016C +016E 016F 016E +016F 016F 016E +0170 0171 0170 +0171 0171 0170 +0172 0173 0172 +0173 0173 0172 +0174 0175 0174 +0175 0175 0174 +0176 0177 0176 +0177 0177 0176 +0178 00FF 0178 +0179 017A 0179 +017A 017A 0179 +017B 017C 017B +017C 017C 017B +017D 017E 017D +017E 017E 017D +017F 017F 0053 +0180 0180 0243 +0181 0253 0181 +0182 0183 0182 +0183 0183 0182 +0184 0185 0184 +0185 0185 0184 +0186 0254 0186 +0187 0188 0187 +0188 0188 0187 +0189 0256 0189 +018A 0257 018A +018B 018C 018B +018C 018C 018B +018E 01DD 018E +018F 0259 018F +0190 025B 0190 +0191 0192 0191 +0192 0192 0191 +0193 0260 0193 +0194 0263 0194 +0195 0195 01F6 +0196 0269 0196 +0197 0268 0197 +0198 0199 0198 +0199 0199 0198 +019A 019A 023D +019C 026F 019C +019D 0272 019D +019E 019E 0220 +019F 0275 019F +01A0 01A1 01A0 +01A1 01A1 01A0 +01A2 01A3 01A2 +01A3 01A3 01A2 +01A4 01A5 01A4 +01A5 01A5 01A4 +01A6 0280 01A6 +01A7 01A8 01A7 +01A8 01A8 01A7 +01A9 0283 01A9 +01AC 01AD 01AC +01AD 01AD 01AC +01AE 0288 01AE +01AF 01B0 01AF +01B0 01B0 01AF +01B1 028A 01B1 +01B2 028B 01B2 +01B3 01B4 01B3 +01B4 01B4 01B3 +01B5 01B6 01B5 +01B6 01B6 01B5 +01B7 0292 01B7 +01B8 01B9 01B8 +01B9 01B9 01B8 +01BC 01BD 01BC +01BD 01BD 01BC +01BF 01BF 01F7 +01C4 01C6 01C4 +01C5 01C6 01C4 +01C6 01C6 01C4 +01C7 01C9 01C7 +01C8 01C9 01C7 +01C9 01C9 01C7 +01CA 01CC 01CA +01CB 01CC 01CA +01CC 01CC 01CA +01CD 01CE 01CD +01CE 01CE 01CD +01CF 01D0 01CF +01D0 01D0 01CF +01D1 01D2 01D1 +01D2 01D2 01D1 +01D3 01D4 01D3 +01D4 01D4 01D3 +01D5 01D6 01D5 +01D6 01D6 01D5 +01D7 01D8 01D7 +01D8 01D8 01D7 +01D9 01DA 01D9 +01DA 01DA 01D9 +01DB 01DC 01DB +01DC 01DC 01DB +01DD 01DD 018E +01DE 01DF 01DE +01DF 01DF 01DE +01E0 01E1 01E0 +01E1 01E1 01E0 +01E2 01E3 01E2 +01E3 01E3 01E2 +01E4 01E5 01E4 +01E5 01E5 01E4 +01E6 01E7 01E6 +01E7 01E7 01E6 +01E8 01E9 01E8 +01E9 01E9 01E8 +01EA 01EB 01EA +01EB 01EB 01EA +01EC 01ED 01EC +01ED 01ED 01EC +01EE 01EF 01EE +01EF 01EF 01EE +01F1 01F3 01F1 +01F2 01F3 01F1 +01F3 01F3 01F1 +01F4 01F5 01F4 +01F5 01F5 01F4 +01F6 0195 01F6 +01F7 01BF 01F7 +01F8 01F9 01F8 +01F9 01F9 01F8 +01FA 01FB 01FA +01FB 01FB 01FA +01FC 01FD 01FC +01FD 01FD 01FC +01FE 01FF 01FE +01FF 01FF 01FE +0200 0201 0200 +0201 0201 0200 +0202 0203 0202 +0203 0203 0202 +0204 0205 0204 +0205 0205 0204 +0206 0207 0206 +0207 0207 0206 +0208 0209 0208 +0209 0209 0208 +020A 020B 020A +020B 020B 020A +020C 020D 020C +020D 020D 020C +020E 020F 020E +020F 020F 020E +0210 0211 0210 +0211 0211 0210 +0212 0213 0212 +0213 0213 0212 +0214 0215 0214 +0215 0215 0214 +0216 0217 0216 +0217 0217 0216 +0218 0219 0218 +0219 0219 0218 +021A 021B 021A +021B 021B 021A +021C 021D 021C +021D 021D 021C +021E 021F 021E +021F 021F 021E +0220 019E 0220 +0222 0223 0222 +0223 0223 0222 +0224 0225 0224 +0225 0225 0224 +0226 0227 0226 +0227 0227 0226 +0228 0229 0228 +0229 0229 0228 +022A 022B 022A +022B 022B 022A +022C 022D 022C +022D 022D 022C +022E 022F 022E +022F 022F 022E +0230 0231 0230 +0231 0231 0230 +0232 0233 0232 +0233 0233 0232 +023A 2C65 023A +023B 023C 023B +023C 023C 023B +023D 019A 023D +023E 2C66 023E +023F 023F 2C7E +0240 0240 2C7F +0241 0242 0241 +0242 0242 0241 +0243 0180 0243 +0244 0289 0244 +0245 028C 0245 +0246 0247 0246 +0247 0247 0246 +0248 0249 0248 +0249 0249 0248 +024A 024B 024A +024B 024B 024A +024C 024D 024C +024D 024D 024C +024E 024F 024E +024F 024F 024E +0250 0250 2C6F +0251 0251 2C6D +0252 0252 2C70 +0253 0253 0181 +0254 0254 0186 +0256 0256 0189 +0257 0257 018A +0259 0259 018F +025B 025B 0190 +025C 025C A7AB +0260 0260 0193 +0261 0261 A7AC +0263 0263 0194 +0265 0265 A78D +0266 0266 A7AA +0268 0268 0197 +0269 0269 0196 +026A 026A A7AE +026B 026B 2C62 +026C 026C A7AD +026F 026F 019C +0271 0271 2C6E +0272 0272 019D +0275 0275 019F +027D 027D 2C64 +0280 0280 01A6 +0282 0282 A7C5 +0283 0283 01A9 +0287 0287 A7B1 +0288 0288 01AE +0289 0289 0244 +028A 028A 01B1 +028B 028B 01B2 +028C 028C 0245 +0292 0292 01B7 +029D 029D A7B2 +029E 029E A7B0 +0345 0345 0399 +0370 0371 0370 +0371 0371 0370 +0372 0373 0372 +0373 0373 0372 +0376 0377 0376 +0377 0377 0376 +037B 037B 03FD +037C 037C 03FE +037D 037D 03FF +037F 03F3 037F +0386 03AC 0386 +0388 03AD 0388 +0389 03AE 0389 +038A 03AF 038A +038C 03CC 038C +038E 03CD 038E +038F 03CE 038F +0391 03B1 0391 +0392 03B2 0392 +0393 03B3 0393 +0394 03B4 0394 +0395 03B5 0395 +0396 03B6 0396 +0397 03B7 0397 +0398 03B8 0398 +0399 03B9 0399 +039A 03BA 039A +039B 03BB 039B +039C 03BC 039C +039D 03BD 039D +039E 03BE 039E +039F 03BF 039F +03A0 03C0 03A0 +03A1 03C1 03A1 +03A3 03C3 03A3 +03A4 03C4 03A4 +03A5 03C5 03A5 +03A6 03C6 03A6 +03A7 03C7 03A7 +03A8 03C8 03A8 +03A9 03C9 03A9 +03AA 03CA 03AA +03AB 03CB 03AB +03AC 03AC 0386 +03AD 03AD 0388 +03AE 03AE 0389 +03AF 03AF 038A +03B1 03B1 0391 +03B2 03B2 0392 +03B3 03B3 0393 +03B4 03B4 0394 +03B5 03B5 0395 +03B6 03B6 0396 +03B7 03B7 0397 +03B8 03B8 0398 +03B9 03B9 0399 +03BA 03BA 039A +03BB 03BB 039B +03BC 03BC 039C +03BD 03BD 039D +03BE 03BE 039E +03BF 03BF 039F +03C0 03C0 03A0 +03C1 03C1 03A1 +03C2 03C2 03A3 +03C3 03C3 03A3 +03C4 03C4 03A4 +03C5 03C5 03A5 +03C6 03C6 03A6 +03C7 03C7 03A7 +03C8 03C8 03A8 +03C9 03C9 03A9 +03CA 03CA 03AA +03CB 03CB 03AB +03CC 03CC 038C +03CD 03CD 038E +03CE 03CE 038F +03CF 03D7 03CF +03D0 03D0 0392 +03D1 03D1 0398 +03D5 03D5 03A6 +03D6 03D6 03A0 +03D7 03D7 03CF +03D8 03D9 03D8 +03D9 03D9 03D8 +03DA 03DB 03DA +03DB 03DB 03DA +03DC 03DD 03DC +03DD 03DD 03DC +03DE 03DF 03DE +03DF 03DF 03DE +03E0 03E1 03E0 +03E1 03E1 03E0 +03E2 03E3 03E2 +03E3 03E3 03E2 +03E4 03E5 03E4 +03E5 03E5 03E4 +03E6 03E7 03E6 +03E7 03E7 03E6 +03E8 03E9 03E8 +03E9 03E9 03E8 +03EA 03EB 03EA +03EB 03EB 03EA +03EC 03ED 03EC +03ED 03ED 03EC +03EE 03EF 03EE +03EF 03EF 03EE +03F0 03F0 039A +03F1 03F1 03A1 +03F2 03F2 03F9 +03F3 03F3 037F +03F4 03B8 03F4 +03F5 03F5 0395 +03F7 03F8 03F7 +03F8 03F8 03F7 +03F9 03F2 03F9 +03FA 03FB 03FA +03FB 03FB 03FA +03FD 037B 03FD +03FE 037C 03FE +03FF 037D 03FF +0400 0450 0400 +0401 0451 0401 +0402 0452 0402 +0403 0453 0403 +0404 0454 0404 +0405 0455 0405 +0406 0456 0406 +0407 0457 0407 +0408 0458 0408 +0409 0459 0409 +040A 045A 040A +040B 045B 040B +040C 045C 040C +040D 045D 040D +040E 045E 040E +040F 045F 040F +0410 0430 0410 +0411 0431 0411 +0412 0432 0412 +0413 0433 0413 +0414 0434 0414 +0415 0435 0415 +0416 0436 0416 +0417 0437 0417 +0418 0438 0418 +0419 0439 0419 +041A 043A 041A +041B 043B 041B +041C 043C 041C +041D 043D 041D +041E 043E 041E +041F 043F 041F +0420 0440 0420 +0421 0441 0421 +0422 0442 0422 +0423 0443 0423 +0424 0444 0424 +0425 0445 0425 +0426 0446 0426 +0427 0447 0427 +0428 0448 0428 +0429 0449 0429 +042A 044A 042A +042B 044B 042B +042C 044C 042C +042D 044D 042D +042E 044E 042E +042F 044F 042F +0430 0430 0410 +0431 0431 0411 +0432 0432 0412 +0433 0433 0413 +0434 0434 0414 +0435 0435 0415 +0436 0436 0416 +0437 0437 0417 +0438 0438 0418 +0439 0439 0419 +043A 043A 041A +043B 043B 041B +043C 043C 041C +043D 043D 041D +043E 043E 041E +043F 043F 041F +0440 0440 0420 +0441 0441 0421 +0442 0442 0422 +0443 0443 0423 +0444 0444 0424 +0445 0445 0425 +0446 0446 0426 +0447 0447 0427 +0448 0448 0428 +0449 0449 0429 +044A 044A 042A +044B 044B 042B +044C 044C 042C +044D 044D 042D +044E 044E 042E +044F 044F 042F +0450 0450 0400 +0451 0451 0401 +0452 0452 0402 +0453 0453 0403 +0454 0454 0404 +0455 0455 0405 +0456 0456 0406 +0457 0457 0407 +0458 0458 0408 +0459 0459 0409 +045A 045A 040A +045B 045B 040B +045C 045C 040C +045D 045D 040D +045E 045E 040E +045F 045F 040F +0460 0461 0460 +0461 0461 0460 +0462 0463 0462 +0463 0463 0462 +0464 0465 0464 +0465 0465 0464 +0466 0467 0466 +0467 0467 0466 +0468 0469 0468 +0469 0469 0468 +046A 046B 046A +046B 046B 046A +046C 046D 046C +046D 046D 046C +046E 046F 046E +046F 046F 046E +0470 0471 0470 +0471 0471 0470 +0472 0473 0472 +0473 0473 0472 +0474 0475 0474 +0475 0475 0474 +0476 0477 0476 +0477 0477 0476 +0478 0479 0478 +0479 0479 0478 +047A 047B 047A +047B 047B 047A +047C 047D 047C +047D 047D 047C +047E 047F 047E +047F 047F 047E +0480 0481 0480 +0481 0481 0480 +048A 048B 048A +048B 048B 048A +048C 048D 048C +048D 048D 048C +048E 048F 048E +048F 048F 048E +0490 0491 0490 +0491 0491 0490 +0492 0493 0492 +0493 0493 0492 +0494 0495 0494 +0495 0495 0494 +0496 0497 0496 +0497 0497 0496 +0498 0499 0498 +0499 0499 0498 +049A 049B 049A +049B 049B 049A +049C 049D 049C +049D 049D 049C +049E 049F 049E +049F 049F 049E +04A0 04A1 04A0 +04A1 04A1 04A0 +04A2 04A3 04A2 +04A3 04A3 04A2 +04A4 04A5 04A4 +04A5 04A5 04A4 +04A6 04A7 04A6 +04A7 04A7 04A6 +04A8 04A9 04A8 +04A9 04A9 04A8 +04AA 04AB 04AA +04AB 04AB 04AA +04AC 04AD 04AC +04AD 04AD 04AC +04AE 04AF 04AE +04AF 04AF 04AE +04B0 04B1 04B0 +04B1 04B1 04B0 +04B2 04B3 04B2 +04B3 04B3 04B2 +04B4 04B5 04B4 +04B5 04B5 04B4 +04B6 04B7 04B6 +04B7 04B7 04B6 +04B8 04B9 04B8 +04B9 04B9 04B8 +04BA 04BB 04BA +04BB 04BB 04BA +04BC 04BD 04BC +04BD 04BD 04BC +04BE 04BF 04BE +04BF 04BF 04BE +04C0 04CF 04C0 +04C1 04C2 04C1 +04C2 04C2 04C1 +04C3 04C4 04C3 +04C4 04C4 04C3 +04C5 04C6 04C5 +04C6 04C6 04C5 +04C7 04C8 04C7 +04C8 04C8 04C7 +04C9 04CA 04C9 +04CA 04CA 04C9 +04CB 04CC 04CB +04CC 04CC 04CB +04CD 04CE 04CD +04CE 04CE 04CD +04CF 04CF 04C0 +04D0 04D1 04D0 +04D1 04D1 04D0 +04D2 04D3 04D2 +04D3 04D3 04D2 +04D4 04D5 04D4 +04D5 04D5 04D4 +04D6 04D7 04D6 +04D7 04D7 04D6 +04D8 04D9 04D8 +04D9 04D9 04D8 +04DA 04DB 04DA +04DB 04DB 04DA +04DC 04DD 04DC +04DD 04DD 04DC +04DE 04DF 04DE +04DF 04DF 04DE +04E0 04E1 04E0 +04E1 04E1 04E0 +04E2 04E3 04E2 +04E3 04E3 04E2 +04E4 04E5 04E4 +04E5 04E5 04E4 +04E6 04E7 04E6 +04E7 04E7 04E6 +04E8 04E9 04E8 +04E9 04E9 04E8 +04EA 04EB 04EA +04EB 04EB 04EA +04EC 04ED 04EC +04ED 04ED 04EC +04EE 04EF 04EE +04EF 04EF 04EE +04F0 04F1 04F0 +04F1 04F1 04F0 +04F2 04F3 04F2 +04F3 04F3 04F2 +04F4 04F5 04F4 +04F5 04F5 04F4 +04F6 04F7 04F6 +04F7 04F7 04F6 +04F8 04F9 04F8 +04F9 04F9 04F8 +04FA 04FB 04FA +04FB 04FB 04FA +04FC 04FD 04FC +04FD 04FD 04FC +04FE 04FF 04FE +04FF 04FF 04FE +0500 0501 0500 +0501 0501 0500 +0502 0503 0502 +0503 0503 0502 +0504 0505 0504 +0505 0505 0504 +0506 0507 0506 +0507 0507 0506 +0508 0509 0508 +0509 0509 0508 +050A 050B 050A +050B 050B 050A +050C 050D 050C +050D 050D 050C +050E 050F 050E +050F 050F 050E +0510 0511 0510 +0511 0511 0510 +0512 0513 0512 +0513 0513 0512 +0514 0515 0514 +0515 0515 0514 +0516 0517 0516 +0517 0517 0516 +0518 0519 0518 +0519 0519 0518 +051A 051B 051A +051B 051B 051A +051C 051D 051C +051D 051D 051C +051E 051F 051E +051F 051F 051E +0520 0521 0520 +0521 0521 0520 +0522 0523 0522 +0523 0523 0522 +0524 0525 0524 +0525 0525 0524 +0526 0527 0526 +0527 0527 0526 +0528 0529 0528 +0529 0529 0528 +052A 052B 052A +052B 052B 052A +052C 052D 052C +052D 052D 052C +052E 052F 052E +052F 052F 052E +0531 0561 0531 +0532 0562 0532 +0533 0563 0533 +0534 0564 0534 +0535 0565 0535 +0536 0566 0536 +0537 0567 0537 +0538 0568 0538 +0539 0569 0539 +053A 056A 053A +053B 056B 053B +053C 056C 053C +053D 056D 053D +053E 056E 053E +053F 056F 053F +0540 0570 0540 +0541 0571 0541 +0542 0572 0542 +0543 0573 0543 +0544 0574 0544 +0545 0575 0545 +0546 0576 0546 +0547 0577 0547 +0548 0578 0548 +0549 0579 0549 +054A 057A 054A +054B 057B 054B +054C 057C 054C +054D 057D 054D +054E 057E 054E +054F 057F 054F +0550 0580 0550 +0551 0581 0551 +0552 0582 0552 +0553 0583 0553 +0554 0584 0554 +0555 0585 0555 +0556 0586 0556 +0561 0561 0531 +0562 0562 0532 +0563 0563 0533 +0564 0564 0534 +0565 0565 0535 +0566 0566 0536 +0567 0567 0537 +0568 0568 0538 +0569 0569 0539 +056A 056A 053A +056B 056B 053B +056C 056C 053C +056D 056D 053D +056E 056E 053E +056F 056F 053F +0570 0570 0540 +0571 0571 0541 +0572 0572 0542 +0573 0573 0543 +0574 0574 0544 +0575 0575 0545 +0576 0576 0546 +0577 0577 0547 +0578 0578 0548 +0579 0579 0549 +057A 057A 054A +057B 057B 054B +057C 057C 054C +057D 057D 054D +057E 057E 054E +057F 057F 054F +0580 0580 0550 +0581 0581 0551 +0582 0582 0552 +0583 0583 0553 +0584 0584 0554 +0585 0585 0555 +0586 0586 0556 +10A0 2D00 10A0 +10A1 2D01 10A1 +10A2 2D02 10A2 +10A3 2D03 10A3 +10A4 2D04 10A4 +10A5 2D05 10A5 +10A6 2D06 10A6 +10A7 2D07 10A7 +10A8 2D08 10A8 +10A9 2D09 10A9 +10AA 2D0A 10AA +10AB 2D0B 10AB +10AC 2D0C 10AC +10AD 2D0D 10AD +10AE 2D0E 10AE +10AF 2D0F 10AF +10B0 2D10 10B0 +10B1 2D11 10B1 +10B2 2D12 10B2 +10B3 2D13 10B3 +10B4 2D14 10B4 +10B5 2D15 10B5 +10B6 2D16 10B6 +10B7 2D17 10B7 +10B8 2D18 10B8 +10B9 2D19 10B9 +10BA 2D1A 10BA +10BB 2D1B 10BB +10BC 2D1C 10BC +10BD 2D1D 10BD +10BE 2D1E 10BE +10BF 2D1F 10BF +10C0 2D20 10C0 +10C1 2D21 10C1 +10C2 2D22 10C2 +10C3 2D23 10C3 +10C4 2D24 10C4 +10C5 2D25 10C5 +10C7 2D27 10C7 +10CD 2D2D 10CD +10D0 10D0 1C90 +10D1 10D1 1C91 +10D2 10D2 1C92 +10D3 10D3 1C93 +10D4 10D4 1C94 +10D5 10D5 1C95 +10D6 10D6 1C96 +10D7 10D7 1C97 +10D8 10D8 1C98 +10D9 10D9 1C99 +10DA 10DA 1C9A +10DB 10DB 1C9B +10DC 10DC 1C9C +10DD 10DD 1C9D +10DE 10DE 1C9E +10DF 10DF 1C9F +10E0 10E0 1CA0 +10E1 10E1 1CA1 +10E2 10E2 1CA2 +10E3 10E3 1CA3 +10E4 10E4 1CA4 +10E5 10E5 1CA5 +10E6 10E6 1CA6 +10E7 10E7 1CA7 +10E8 10E8 1CA8 +10E9 10E9 1CA9 +10EA 10EA 1CAA +10EB 10EB 1CAB +10EC 10EC 1CAC +10ED 10ED 1CAD +10EE 10EE 1CAE +10EF 10EF 1CAF +10F0 10F0 1CB0 +10F1 10F1 1CB1 +10F2 10F2 1CB2 +10F3 10F3 1CB3 +10F4 10F4 1CB4 +10F5 10F5 1CB5 +10F6 10F6 1CB6 +10F7 10F7 1CB7 +10F8 10F8 1CB8 +10F9 10F9 1CB9 +10FA 10FA 1CBA +10FD 10FD 1CBD +10FE 10FE 1CBE +10FF 10FF 1CBF +13A0 AB70 13A0 +13A1 AB71 13A1 +13A2 AB72 13A2 +13A3 AB73 13A3 +13A4 AB74 13A4 +13A5 AB75 13A5 +13A6 AB76 13A6 +13A7 AB77 13A7 +13A8 AB78 13A8 +13A9 AB79 13A9 +13AA AB7A 13AA +13AB AB7B 13AB +13AC AB7C 13AC +13AD AB7D 13AD +13AE AB7E 13AE +13AF AB7F 13AF +13B0 AB80 13B0 +13B1 AB81 13B1 +13B2 AB82 13B2 +13B3 AB83 13B3 +13B4 AB84 13B4 +13B5 AB85 13B5 +13B6 AB86 13B6 +13B7 AB87 13B7 +13B8 AB88 13B8 +13B9 AB89 13B9 +13BA AB8A 13BA +13BB AB8B 13BB +13BC AB8C 13BC +13BD AB8D 13BD +13BE AB8E 13BE +13BF AB8F 13BF +13C0 AB90 13C0 +13C1 AB91 13C1 +13C2 AB92 13C2 +13C3 AB93 13C3 +13C4 AB94 13C4 +13C5 AB95 13C5 +13C6 AB96 13C6 +13C7 AB97 13C7 +13C8 AB98 13C8 +13C9 AB99 13C9 +13CA AB9A 13CA +13CB AB9B 13CB +13CC AB9C 13CC +13CD AB9D 13CD +13CE AB9E 13CE +13CF AB9F 13CF +13D0 ABA0 13D0 +13D1 ABA1 13D1 +13D2 ABA2 13D2 +13D3 ABA3 13D3 +13D4 ABA4 13D4 +13D5 ABA5 13D5 +13D6 ABA6 13D6 +13D7 ABA7 13D7 +13D8 ABA8 13D8 +13D9 ABA9 13D9 +13DA ABAA 13DA +13DB ABAB 13DB +13DC ABAC 13DC +13DD ABAD 13DD +13DE ABAE 13DE +13DF ABAF 13DF +13E0 ABB0 13E0 +13E1 ABB1 13E1 +13E2 ABB2 13E2 +13E3 ABB3 13E3 +13E4 ABB4 13E4 +13E5 ABB5 13E5 +13E6 ABB6 13E6 +13E7 ABB7 13E7 +13E8 ABB8 13E8 +13E9 ABB9 13E9 +13EA ABBA 13EA +13EB ABBB 13EB +13EC ABBC 13EC +13ED ABBD 13ED +13EE ABBE 13EE +13EF ABBF 13EF +13F0 13F8 13F0 +13F1 13F9 13F1 +13F2 13FA 13F2 +13F3 13FB 13F3 +13F4 13FC 13F4 +13F5 13FD 13F5 +13F8 13F8 13F0 +13F9 13F9 13F1 +13FA 13FA 13F2 +13FB 13FB 13F3 +13FC 13FC 13F4 +13FD 13FD 13F5 +1C80 1C80 0412 +1C81 1C81 0414 +1C82 1C82 041E +1C83 1C83 0421 +1C84 1C84 0422 +1C85 1C85 0422 +1C86 1C86 042A +1C87 1C87 0462 +1C88 1C88 A64A +1C90 10D0 1C90 +1C91 10D1 1C91 +1C92 10D2 1C92 +1C93 10D3 1C93 +1C94 10D4 1C94 +1C95 10D5 1C95 +1C96 10D6 1C96 +1C97 10D7 1C97 +1C98 10D8 1C98 +1C99 10D9 1C99 +1C9A 10DA 1C9A +1C9B 10DB 1C9B +1C9C 10DC 1C9C +1C9D 10DD 1C9D +1C9E 10DE 1C9E +1C9F 10DF 1C9F +1CA0 10E0 1CA0 +1CA1 10E1 1CA1 +1CA2 10E2 1CA2 +1CA3 10E3 1CA3 +1CA4 10E4 1CA4 +1CA5 10E5 1CA5 +1CA6 10E6 1CA6 +1CA7 10E7 1CA7 +1CA8 10E8 1CA8 +1CA9 10E9 1CA9 +1CAA 10EA 1CAA +1CAB 10EB 1CAB +1CAC 10EC 1CAC +1CAD 10ED 1CAD +1CAE 10EE 1CAE +1CAF 10EF 1CAF +1CB0 10F0 1CB0 +1CB1 10F1 1CB1 +1CB2 10F2 1CB2 +1CB3 10F3 1CB3 +1CB4 10F4 1CB4 +1CB5 10F5 1CB5 +1CB6 10F6 1CB6 +1CB7 10F7 1CB7 +1CB8 10F8 1CB8 +1CB9 10F9 1CB9 +1CBA 10FA 1CBA +1CBD 10FD 1CBD +1CBE 10FE 1CBE +1CBF 10FF 1CBF +1D79 1D79 A77D +1D7D 1D7D 2C63 +1D8E 1D8E A7C6 +1E00 1E01 1E00 +1E01 1E01 1E00 +1E02 1E03 1E02 +1E03 1E03 1E02 +1E04 1E05 1E04 +1E05 1E05 1E04 +1E06 1E07 1E06 +1E07 1E07 1E06 +1E08 1E09 1E08 +1E09 1E09 1E08 +1E0A 1E0B 1E0A +1E0B 1E0B 1E0A +1E0C 1E0D 1E0C +1E0D 1E0D 1E0C +1E0E 1E0F 1E0E +1E0F 1E0F 1E0E +1E10 1E11 1E10 +1E11 1E11 1E10 +1E12 1E13 1E12 +1E13 1E13 1E12 +1E14 1E15 1E14 +1E15 1E15 1E14 +1E16 1E17 1E16 +1E17 1E17 1E16 +1E18 1E19 1E18 +1E19 1E19 1E18 +1E1A 1E1B 1E1A +1E1B 1E1B 1E1A +1E1C 1E1D 1E1C +1E1D 1E1D 1E1C +1E1E 1E1F 1E1E +1E1F 1E1F 1E1E +1E20 1E21 1E20 +1E21 1E21 1E20 +1E22 1E23 1E22 +1E23 1E23 1E22 +1E24 1E25 1E24 +1E25 1E25 1E24 +1E26 1E27 1E26 +1E27 1E27 1E26 +1E28 1E29 1E28 +1E29 1E29 1E28 +1E2A 1E2B 1E2A +1E2B 1E2B 1E2A +1E2C 1E2D 1E2C +1E2D 1E2D 1E2C +1E2E 1E2F 1E2E +1E2F 1E2F 1E2E +1E30 1E31 1E30 +1E31 1E31 1E30 +1E32 1E33 1E32 +1E33 1E33 1E32 +1E34 1E35 1E34 +1E35 1E35 1E34 +1E36 1E37 1E36 +1E37 1E37 1E36 +1E38 1E39 1E38 +1E39 1E39 1E38 +1E3A 1E3B 1E3A +1E3B 1E3B 1E3A +1E3C 1E3D 1E3C +1E3D 1E3D 1E3C +1E3E 1E3F 1E3E +1E3F 1E3F 1E3E +1E40 1E41 1E40 +1E41 1E41 1E40 +1E42 1E43 1E42 +1E43 1E43 1E42 +1E44 1E45 1E44 +1E45 1E45 1E44 +1E46 1E47 1E46 +1E47 1E47 1E46 +1E48 1E49 1E48 +1E49 1E49 1E48 +1E4A 1E4B 1E4A +1E4B 1E4B 1E4A +1E4C 1E4D 1E4C +1E4D 1E4D 1E4C +1E4E 1E4F 1E4E +1E4F 1E4F 1E4E +1E50 1E51 1E50 +1E51 1E51 1E50 +1E52 1E53 1E52 +1E53 1E53 1E52 +1E54 1E55 1E54 +1E55 1E55 1E54 +1E56 1E57 1E56 +1E57 1E57 1E56 +1E58 1E59 1E58 +1E59 1E59 1E58 +1E5A 1E5B 1E5A +1E5B 1E5B 1E5A +1E5C 1E5D 1E5C +1E5D 1E5D 1E5C +1E5E 1E5F 1E5E +1E5F 1E5F 1E5E +1E60 1E61 1E60 +1E61 1E61 1E60 +1E62 1E63 1E62 +1E63 1E63 1E62 +1E64 1E65 1E64 +1E65 1E65 1E64 +1E66 1E67 1E66 +1E67 1E67 1E66 +1E68 1E69 1E68 +1E69 1E69 1E68 +1E6A 1E6B 1E6A +1E6B 1E6B 1E6A +1E6C 1E6D 1E6C +1E6D 1E6D 1E6C +1E6E 1E6F 1E6E +1E6F 1E6F 1E6E +1E70 1E71 1E70 +1E71 1E71 1E70 +1E72 1E73 1E72 +1E73 1E73 1E72 +1E74 1E75 1E74 +1E75 1E75 1E74 +1E76 1E77 1E76 +1E77 1E77 1E76 +1E78 1E79 1E78 +1E79 1E79 1E78 +1E7A 1E7B 1E7A +1E7B 1E7B 1E7A +1E7C 1E7D 1E7C +1E7D 1E7D 1E7C +1E7E 1E7F 1E7E +1E7F 1E7F 1E7E +1E80 1E81 1E80 +1E81 1E81 1E80 +1E82 1E83 1E82 +1E83 1E83 1E82 +1E84 1E85 1E84 +1E85 1E85 1E84 +1E86 1E87 1E86 +1E87 1E87 1E86 +1E88 1E89 1E88 +1E89 1E89 1E88 +1E8A 1E8B 1E8A +1E8B 1E8B 1E8A +1E8C 1E8D 1E8C +1E8D 1E8D 1E8C +1E8E 1E8F 1E8E +1E8F 1E8F 1E8E +1E90 1E91 1E90 +1E91 1E91 1E90 +1E92 1E93 1E92 +1E93 1E93 1E92 +1E94 1E95 1E94 +1E95 1E95 1E94 +1E9B 1E9B 1E60 +1E9E 00DF 1E9E +1EA0 1EA1 1EA0 +1EA1 1EA1 1EA0 +1EA2 1EA3 1EA2 +1EA3 1EA3 1EA2 +1EA4 1EA5 1EA4 +1EA5 1EA5 1EA4 +1EA6 1EA7 1EA6 +1EA7 1EA7 1EA6 +1EA8 1EA9 1EA8 +1EA9 1EA9 1EA8 +1EAA 1EAB 1EAA +1EAB 1EAB 1EAA +1EAC 1EAD 1EAC +1EAD 1EAD 1EAC +1EAE 1EAF 1EAE +1EAF 1EAF 1EAE +1EB0 1EB1 1EB0 +1EB1 1EB1 1EB0 +1EB2 1EB3 1EB2 +1EB3 1EB3 1EB2 +1EB4 1EB5 1EB4 +1EB5 1EB5 1EB4 +1EB6 1EB7 1EB6 +1EB7 1EB7 1EB6 +1EB8 1EB9 1EB8 +1EB9 1EB9 1EB8 +1EBA 1EBB 1EBA +1EBB 1EBB 1EBA +1EBC 1EBD 1EBC +1EBD 1EBD 1EBC +1EBE 1EBF 1EBE +1EBF 1EBF 1EBE +1EC0 1EC1 1EC0 +1EC1 1EC1 1EC0 +1EC2 1EC3 1EC2 +1EC3 1EC3 1EC2 +1EC4 1EC5 1EC4 +1EC5 1EC5 1EC4 +1EC6 1EC7 1EC6 +1EC7 1EC7 1EC6 +1EC8 1EC9 1EC8 +1EC9 1EC9 1EC8 +1ECA 1ECB 1ECA +1ECB 1ECB 1ECA +1ECC 1ECD 1ECC +1ECD 1ECD 1ECC +1ECE 1ECF 1ECE +1ECF 1ECF 1ECE +1ED0 1ED1 1ED0 +1ED1 1ED1 1ED0 +1ED2 1ED3 1ED2 +1ED3 1ED3 1ED2 +1ED4 1ED5 1ED4 +1ED5 1ED5 1ED4 +1ED6 1ED7 1ED6 +1ED7 1ED7 1ED6 +1ED8 1ED9 1ED8 +1ED9 1ED9 1ED8 +1EDA 1EDB 1EDA +1EDB 1EDB 1EDA +1EDC 1EDD 1EDC +1EDD 1EDD 1EDC +1EDE 1EDF 1EDE +1EDF 1EDF 1EDE +1EE0 1EE1 1EE0 +1EE1 1EE1 1EE0 +1EE2 1EE3 1EE2 +1EE3 1EE3 1EE2 +1EE4 1EE5 1EE4 +1EE5 1EE5 1EE4 +1EE6 1EE7 1EE6 +1EE7 1EE7 1EE6 +1EE8 1EE9 1EE8 +1EE9 1EE9 1EE8 +1EEA 1EEB 1EEA +1EEB 1EEB 1EEA +1EEC 1EED 1EEC +1EED 1EED 1EEC +1EEE 1EEF 1EEE +1EEF 1EEF 1EEE +1EF0 1EF1 1EF0 +1EF1 1EF1 1EF0 +1EF2 1EF3 1EF2 +1EF3 1EF3 1EF2 +1EF4 1EF5 1EF4 +1EF5 1EF5 1EF4 +1EF6 1EF7 1EF6 +1EF7 1EF7 1EF6 +1EF8 1EF9 1EF8 +1EF9 1EF9 1EF8 +1EFA 1EFB 1EFA +1EFB 1EFB 1EFA +1EFC 1EFD 1EFC +1EFD 1EFD 1EFC +1EFE 1EFF 1EFE +1EFF 1EFF 1EFE +1F00 1F00 1F08 +1F01 1F01 1F09 +1F02 1F02 1F0A +1F03 1F03 1F0B +1F04 1F04 1F0C +1F05 1F05 1F0D +1F06 1F06 1F0E +1F07 1F07 1F0F +1F08 1F00 1F08 +1F09 1F01 1F09 +1F0A 1F02 1F0A +1F0B 1F03 1F0B +1F0C 1F04 1F0C +1F0D 1F05 1F0D +1F0E 1F06 1F0E +1F0F 1F07 1F0F +1F10 1F10 1F18 +1F11 1F11 1F19 +1F12 1F12 1F1A +1F13 1F13 1F1B +1F14 1F14 1F1C +1F15 1F15 1F1D +1F18 1F10 1F18 +1F19 1F11 1F19 +1F1A 1F12 1F1A +1F1B 1F13 1F1B +1F1C 1F14 1F1C +1F1D 1F15 1F1D +1F20 1F20 1F28 +1F21 1F21 1F29 +1F22 1F22 1F2A +1F23 1F23 1F2B +1F24 1F24 1F2C +1F25 1F25 1F2D +1F26 1F26 1F2E +1F27 1F27 1F2F +1F28 1F20 1F28 +1F29 1F21 1F29 +1F2A 1F22 1F2A +1F2B 1F23 1F2B +1F2C 1F24 1F2C +1F2D 1F25 1F2D +1F2E 1F26 1F2E +1F2F 1F27 1F2F +1F30 1F30 1F38 +1F31 1F31 1F39 +1F32 1F32 1F3A +1F33 1F33 1F3B +1F34 1F34 1F3C +1F35 1F35 1F3D +1F36 1F36 1F3E +1F37 1F37 1F3F +1F38 1F30 1F38 +1F39 1F31 1F39 +1F3A 1F32 1F3A +1F3B 1F33 1F3B +1F3C 1F34 1F3C +1F3D 1F35 1F3D +1F3E 1F36 1F3E +1F3F 1F37 1F3F +1F40 1F40 1F48 +1F41 1F41 1F49 +1F42 1F42 1F4A +1F43 1F43 1F4B +1F44 1F44 1F4C +1F45 1F45 1F4D +1F48 1F40 1F48 +1F49 1F41 1F49 +1F4A 1F42 1F4A +1F4B 1F43 1F4B +1F4C 1F44 1F4C +1F4D 1F45 1F4D +1F51 1F51 1F59 +1F53 1F53 1F5B +1F55 1F55 1F5D +1F57 1F57 1F5F +1F59 1F51 1F59 +1F5B 1F53 1F5B +1F5D 1F55 1F5D +1F5F 1F57 1F5F +1F60 1F60 1F68 +1F61 1F61 1F69 +1F62 1F62 1F6A +1F63 1F63 1F6B +1F64 1F64 1F6C +1F65 1F65 1F6D +1F66 1F66 1F6E +1F67 1F67 1F6F +1F68 1F60 1F68 +1F69 1F61 1F69 +1F6A 1F62 1F6A +1F6B 1F63 1F6B +1F6C 1F64 1F6C +1F6D 1F65 1F6D +1F6E 1F66 1F6E +1F6F 1F67 1F6F +1F70 1F70 1FBA +1F71 1F71 1FBB +1F72 1F72 1FC8 +1F73 1F73 1FC9 +1F74 1F74 1FCA +1F75 1F75 1FCB +1F76 1F76 1FDA +1F77 1F77 1FDB +1F78 1F78 1FF8 +1F79 1F79 1FF9 +1F7A 1F7A 1FEA +1F7B 1F7B 1FEB +1F7C 1F7C 1FFA +1F7D 1F7D 1FFB +1F80 1F80 1F88 +1F81 1F81 1F89 +1F82 1F82 1F8A +1F83 1F83 1F8B +1F84 1F84 1F8C +1F85 1F85 1F8D +1F86 1F86 1F8E +1F87 1F87 1F8F +1F88 1F80 1F88 +1F89 1F81 1F89 +1F8A 1F82 1F8A +1F8B 1F83 1F8B +1F8C 1F84 1F8C +1F8D 1F85 1F8D +1F8E 1F86 1F8E +1F8F 1F87 1F8F +1F90 1F90 1F98 +1F91 1F91 1F99 +1F92 1F92 1F9A +1F93 1F93 1F9B +1F94 1F94 1F9C +1F95 1F95 1F9D +1F96 1F96 1F9E +1F97 1F97 1F9F +1F98 1F90 1F98 +1F99 1F91 1F99 +1F9A 1F92 1F9A +1F9B 1F93 1F9B +1F9C 1F94 1F9C +1F9D 1F95 1F9D +1F9E 1F96 1F9E +1F9F 1F97 1F9F +1FA0 1FA0 1FA8 +1FA1 1FA1 1FA9 +1FA2 1FA2 1FAA +1FA3 1FA3 1FAB +1FA4 1FA4 1FAC +1FA5 1FA5 1FAD +1FA6 1FA6 1FAE +1FA7 1FA7 1FAF +1FA8 1FA0 1FA8 +1FA9 1FA1 1FA9 +1FAA 1FA2 1FAA +1FAB 1FA3 1FAB +1FAC 1FA4 1FAC +1FAD 1FA5 1FAD +1FAE 1FA6 1FAE +1FAF 1FA7 1FAF +1FB0 1FB0 1FB8 +1FB1 1FB1 1FB9 +1FB3 1FB3 1FBC +1FB8 1FB0 1FB8 +1FB9 1FB1 1FB9 +1FBA 1F70 1FBA +1FBB 1F71 1FBB +1FBC 1FB3 1FBC +1FBE 1FBE 0399 +1FC3 1FC3 1FCC +1FC8 1F72 1FC8 +1FC9 1F73 1FC9 +1FCA 1F74 1FCA +1FCB 1F75 1FCB +1FCC 1FC3 1FCC +1FD0 1FD0 1FD8 +1FD1 1FD1 1FD9 +1FD8 1FD0 1FD8 +1FD9 1FD1 1FD9 +1FDA 1F76 1FDA +1FDB 1F77 1FDB +1FE0 1FE0 1FE8 +1FE1 1FE1 1FE9 +1FE5 1FE5 1FEC +1FE8 1FE0 1FE8 +1FE9 1FE1 1FE9 +1FEA 1F7A 1FEA +1FEB 1F7B 1FEB +1FEC 1FE5 1FEC +1FF3 1FF3 1FFC +1FF8 1F78 1FF8 +1FF9 1F79 1FF9 +1FFA 1F7C 1FFA +1FFB 1F7D 1FFB +1FFC 1FF3 1FFC +2126 03C9 2126 +212A 006B 212A +212B 00E5 212B +2132 214E 2132 +214E 214E 2132 +2160 2170 2160 +2161 2171 2161 +2162 2172 2162 +2163 2173 2163 +2164 2174 2164 +2165 2175 2165 +2166 2176 2166 +2167 2177 2167 +2168 2178 2168 +2169 2179 2169 +216A 217A 216A +216B 217B 216B +216C 217C 216C +216D 217D 216D +216E 217E 216E +216F 217F 216F +2170 2170 2160 +2171 2171 2161 +2172 2172 2162 +2173 2173 2163 +2174 2174 2164 +2175 2175 2165 +2176 2176 2166 +2177 2177 2167 +2178 2178 2168 +2179 2179 2169 +217A 217A 216A +217B 217B 216B +217C 217C 216C +217D 217D 216D +217E 217E 216E +217F 217F 216F +2183 2184 2183 +2184 2184 2183 +24B6 24D0 24B6 +24B7 24D1 24B7 +24B8 24D2 24B8 +24B9 24D3 24B9 +24BA 24D4 24BA +24BB 24D5 24BB +24BC 24D6 24BC +24BD 24D7 24BD +24BE 24D8 24BE +24BF 24D9 24BF +24C0 24DA 24C0 +24C1 24DB 24C1 +24C2 24DC 24C2 +24C3 24DD 24C3 +24C4 24DE 24C4 +24C5 24DF 24C5 +24C6 24E0 24C6 +24C7 24E1 24C7 +24C8 24E2 24C8 +24C9 24E3 24C9 +24CA 24E4 24CA +24CB 24E5 24CB +24CC 24E6 24CC +24CD 24E7 24CD +24CE 24E8 24CE +24CF 24E9 24CF +24D0 24D0 24B6 +24D1 24D1 24B7 +24D2 24D2 24B8 +24D3 24D3 24B9 +24D4 24D4 24BA +24D5 24D5 24BB +24D6 24D6 24BC +24D7 24D7 24BD +24D8 24D8 24BE +24D9 24D9 24BF +24DA 24DA 24C0 +24DB 24DB 24C1 +24DC 24DC 24C2 +24DD 24DD 24C3 +24DE 24DE 24C4 +24DF 24DF 24C5 +24E0 24E0 24C6 +24E1 24E1 24C7 +24E2 24E2 24C8 +24E3 24E3 24C9 +24E4 24E4 24CA +24E5 24E5 24CB +24E6 24E6 24CC +24E7 24E7 24CD +24E8 24E8 24CE +24E9 24E9 24CF +2C00 2C30 2C00 +2C01 2C31 2C01 +2C02 2C32 2C02 +2C03 2C33 2C03 +2C04 2C34 2C04 +2C05 2C35 2C05 +2C06 2C36 2C06 +2C07 2C37 2C07 +2C08 2C38 2C08 +2C09 2C39 2C09 +2C0A 2C3A 2C0A +2C0B 2C3B 2C0B +2C0C 2C3C 2C0C +2C0D 2C3D 2C0D +2C0E 2C3E 2C0E +2C0F 2C3F 2C0F +2C10 2C40 2C10 +2C11 2C41 2C11 +2C12 2C42 2C12 +2C13 2C43 2C13 +2C14 2C44 2C14 +2C15 2C45 2C15 +2C16 2C46 2C16 +2C17 2C47 2C17 +2C18 2C48 2C18 +2C19 2C49 2C19 +2C1A 2C4A 2C1A +2C1B 2C4B 2C1B +2C1C 2C4C 2C1C +2C1D 2C4D 2C1D +2C1E 2C4E 2C1E +2C1F 2C4F 2C1F +2C20 2C50 2C20 +2C21 2C51 2C21 +2C22 2C52 2C22 +2C23 2C53 2C23 +2C24 2C54 2C24 +2C25 2C55 2C25 +2C26 2C56 2C26 +2C27 2C57 2C27 +2C28 2C58 2C28 +2C29 2C59 2C29 +2C2A 2C5A 2C2A +2C2B 2C5B 2C2B +2C2C 2C5C 2C2C +2C2D 2C5D 2C2D +2C2E 2C5E 2C2E +2C2F 2C5F 2C2F +2C30 2C30 2C00 +2C31 2C31 2C01 +2C32 2C32 2C02 +2C33 2C33 2C03 +2C34 2C34 2C04 +2C35 2C35 2C05 +2C36 2C36 2C06 +2C37 2C37 2C07 +2C38 2C38 2C08 +2C39 2C39 2C09 +2C3A 2C3A 2C0A +2C3B 2C3B 2C0B +2C3C 2C3C 2C0C +2C3D 2C3D 2C0D +2C3E 2C3E 2C0E +2C3F 2C3F 2C0F +2C40 2C40 2C10 +2C41 2C41 2C11 +2C42 2C42 2C12 +2C43 2C43 2C13 +2C44 2C44 2C14 +2C45 2C45 2C15 +2C46 2C46 2C16 +2C47 2C47 2C17 +2C48 2C48 2C18 +2C49 2C49 2C19 +2C4A 2C4A 2C1A +2C4B 2C4B 2C1B +2C4C 2C4C 2C1C +2C4D 2C4D 2C1D +2C4E 2C4E 2C1E +2C4F 2C4F 2C1F +2C50 2C50 2C20 +2C51 2C51 2C21 +2C52 2C52 2C22 +2C53 2C53 2C23 +2C54 2C54 2C24 +2C55 2C55 2C25 +2C56 2C56 2C26 +2C57 2C57 2C27 +2C58 2C58 2C28 +2C59 2C59 2C29 +2C5A 2C5A 2C2A +2C5B 2C5B 2C2B +2C5C 2C5C 2C2C +2C5D 2C5D 2C2D +2C5E 2C5E 2C2E +2C5F 2C5F 2C2F +2C60 2C61 2C60 +2C61 2C61 2C60 +2C62 026B 2C62 +2C63 1D7D 2C63 +2C64 027D 2C64 +2C65 2C65 023A +2C66 2C66 023E +2C67 2C68 2C67 +2C68 2C68 2C67 +2C69 2C6A 2C69 +2C6A 2C6A 2C69 +2C6B 2C6C 2C6B +2C6C 2C6C 2C6B +2C6D 0251 2C6D +2C6E 0271 2C6E +2C6F 0250 2C6F +2C70 0252 2C70 +2C72 2C73 2C72 +2C73 2C73 2C72 +2C75 2C76 2C75 +2C76 2C76 2C75 +2C7E 023F 2C7E +2C7F 0240 2C7F +2C80 2C81 2C80 +2C81 2C81 2C80 +2C82 2C83 2C82 +2C83 2C83 2C82 +2C84 2C85 2C84 +2C85 2C85 2C84 +2C86 2C87 2C86 +2C87 2C87 2C86 +2C88 2C89 2C88 +2C89 2C89 2C88 +2C8A 2C8B 2C8A +2C8B 2C8B 2C8A +2C8C 2C8D 2C8C +2C8D 2C8D 2C8C +2C8E 2C8F 2C8E +2C8F 2C8F 2C8E +2C90 2C91 2C90 +2C91 2C91 2C90 +2C92 2C93 2C92 +2C93 2C93 2C92 +2C94 2C95 2C94 +2C95 2C95 2C94 +2C96 2C97 2C96 +2C97 2C97 2C96 +2C98 2C99 2C98 +2C99 2C99 2C98 +2C9A 2C9B 2C9A +2C9B 2C9B 2C9A +2C9C 2C9D 2C9C +2C9D 2C9D 2C9C +2C9E 2C9F 2C9E +2C9F 2C9F 2C9E +2CA0 2CA1 2CA0 +2CA1 2CA1 2CA0 +2CA2 2CA3 2CA2 +2CA3 2CA3 2CA2 +2CA4 2CA5 2CA4 +2CA5 2CA5 2CA4 +2CA6 2CA7 2CA6 +2CA7 2CA7 2CA6 +2CA8 2CA9 2CA8 +2CA9 2CA9 2CA8 +2CAA 2CAB 2CAA +2CAB 2CAB 2CAA +2CAC 2CAD 2CAC +2CAD 2CAD 2CAC +2CAE 2CAF 2CAE +2CAF 2CAF 2CAE +2CB0 2CB1 2CB0 +2CB1 2CB1 2CB0 +2CB2 2CB3 2CB2 +2CB3 2CB3 2CB2 +2CB4 2CB5 2CB4 +2CB5 2CB5 2CB4 +2CB6 2CB7 2CB6 +2CB7 2CB7 2CB6 +2CB8 2CB9 2CB8 +2CB9 2CB9 2CB8 +2CBA 2CBB 2CBA +2CBB 2CBB 2CBA +2CBC 2CBD 2CBC +2CBD 2CBD 2CBC +2CBE 2CBF 2CBE +2CBF 2CBF 2CBE +2CC0 2CC1 2CC0 +2CC1 2CC1 2CC0 +2CC2 2CC3 2CC2 +2CC3 2CC3 2CC2 +2CC4 2CC5 2CC4 +2CC5 2CC5 2CC4 +2CC6 2CC7 2CC6 +2CC7 2CC7 2CC6 +2CC8 2CC9 2CC8 +2CC9 2CC9 2CC8 +2CCA 2CCB 2CCA +2CCB 2CCB 2CCA +2CCC 2CCD 2CCC +2CCD 2CCD 2CCC +2CCE 2CCF 2CCE +2CCF 2CCF 2CCE +2CD0 2CD1 2CD0 +2CD1 2CD1 2CD0 +2CD2 2CD3 2CD2 +2CD3 2CD3 2CD2 +2CD4 2CD5 2CD4 +2CD5 2CD5 2CD4 +2CD6 2CD7 2CD6 +2CD7 2CD7 2CD6 +2CD8 2CD9 2CD8 +2CD9 2CD9 2CD8 +2CDA 2CDB 2CDA +2CDB 2CDB 2CDA +2CDC 2CDD 2CDC +2CDD 2CDD 2CDC +2CDE 2CDF 2CDE +2CDF 2CDF 2CDE +2CE0 2CE1 2CE0 +2CE1 2CE1 2CE0 +2CE2 2CE3 2CE2 +2CE3 2CE3 2CE2 +2CEB 2CEC 2CEB +2CEC 2CEC 2CEB +2CED 2CEE 2CED +2CEE 2CEE 2CED +2CF2 2CF3 2CF2 +2CF3 2CF3 2CF2 +2D00 2D00 10A0 +2D01 2D01 10A1 +2D02 2D02 10A2 +2D03 2D03 10A3 +2D04 2D04 10A4 +2D05 2D05 10A5 +2D06 2D06 10A6 +2D07 2D07 10A7 +2D08 2D08 10A8 +2D09 2D09 10A9 +2D0A 2D0A 10AA +2D0B 2D0B 10AB +2D0C 2D0C 10AC +2D0D 2D0D 10AD +2D0E 2D0E 10AE +2D0F 2D0F 10AF +2D10 2D10 10B0 +2D11 2D11 10B1 +2D12 2D12 10B2 +2D13 2D13 10B3 +2D14 2D14 10B4 +2D15 2D15 10B5 +2D16 2D16 10B6 +2D17 2D17 10B7 +2D18 2D18 10B8 +2D19 2D19 10B9 +2D1A 2D1A 10BA +2D1B 2D1B 10BB +2D1C 2D1C 10BC +2D1D 2D1D 10BD +2D1E 2D1E 10BE +2D1F 2D1F 10BF +2D20 2D20 10C0 +2D21 2D21 10C1 +2D22 2D22 10C2 +2D23 2D23 10C3 +2D24 2D24 10C4 +2D25 2D25 10C5 +2D27 2D27 10C7 +2D2D 2D2D 10CD +A640 A641 A640 +A641 A641 A640 +A642 A643 A642 +A643 A643 A642 +A644 A645 A644 +A645 A645 A644 +A646 A647 A646 +A647 A647 A646 +A648 A649 A648 +A649 A649 A648 +A64A A64B A64A +A64B A64B A64A +A64C A64D A64C +A64D A64D A64C +A64E A64F A64E +A64F A64F A64E +A650 A651 A650 +A651 A651 A650 +A652 A653 A652 +A653 A653 A652 +A654 A655 A654 +A655 A655 A654 +A656 A657 A656 +A657 A657 A656 +A658 A659 A658 +A659 A659 A658 +A65A A65B A65A +A65B A65B A65A +A65C A65D A65C +A65D A65D A65C +A65E A65F A65E +A65F A65F A65E +A660 A661 A660 +A661 A661 A660 +A662 A663 A662 +A663 A663 A662 +A664 A665 A664 +A665 A665 A664 +A666 A667 A666 +A667 A667 A666 +A668 A669 A668 +A669 A669 A668 +A66A A66B A66A +A66B A66B A66A +A66C A66D A66C +A66D A66D A66C +A680 A681 A680 +A681 A681 A680 +A682 A683 A682 +A683 A683 A682 +A684 A685 A684 +A685 A685 A684 +A686 A687 A686 +A687 A687 A686 +A688 A689 A688 +A689 A689 A688 +A68A A68B A68A +A68B A68B A68A +A68C A68D A68C +A68D A68D A68C +A68E A68F A68E +A68F A68F A68E +A690 A691 A690 +A691 A691 A690 +A692 A693 A692 +A693 A693 A692 +A694 A695 A694 +A695 A695 A694 +A696 A697 A696 +A697 A697 A696 +A698 A699 A698 +A699 A699 A698 +A69A A69B A69A +A69B A69B A69A +A722 A723 A722 +A723 A723 A722 +A724 A725 A724 +A725 A725 A724 +A726 A727 A726 +A727 A727 A726 +A728 A729 A728 +A729 A729 A728 +A72A A72B A72A +A72B A72B A72A +A72C A72D A72C +A72D A72D A72C +A72E A72F A72E +A72F A72F A72E +A732 A733 A732 +A733 A733 A732 +A734 A735 A734 +A735 A735 A734 +A736 A737 A736 +A737 A737 A736 +A738 A739 A738 +A739 A739 A738 +A73A A73B A73A +A73B A73B A73A +A73C A73D A73C +A73D A73D A73C +A73E A73F A73E +A73F A73F A73E +A740 A741 A740 +A741 A741 A740 +A742 A743 A742 +A743 A743 A742 +A744 A745 A744 +A745 A745 A744 +A746 A747 A746 +A747 A747 A746 +A748 A749 A748 +A749 A749 A748 +A74A A74B A74A +A74B A74B A74A +A74C A74D A74C +A74D A74D A74C +A74E A74F A74E +A74F A74F A74E +A750 A751 A750 +A751 A751 A750 +A752 A753 A752 +A753 A753 A752 +A754 A755 A754 +A755 A755 A754 +A756 A757 A756 +A757 A757 A756 +A758 A759 A758 +A759 A759 A758 +A75A A75B A75A +A75B A75B A75A +A75C A75D A75C +A75D A75D A75C +A75E A75F A75E +A75F A75F A75E +A760 A761 A760 +A761 A761 A760 +A762 A763 A762 +A763 A763 A762 +A764 A765 A764 +A765 A765 A764 +A766 A767 A766 +A767 A767 A766 +A768 A769 A768 +A769 A769 A768 +A76A A76B A76A +A76B A76B A76A +A76C A76D A76C +A76D A76D A76C +A76E A76F A76E +A76F A76F A76E +A779 A77A A779 +A77A A77A A779 +A77B A77C A77B +A77C A77C A77B +A77D 1D79 A77D +A77E A77F A77E +A77F A77F A77E +A780 A781 A780 +A781 A781 A780 +A782 A783 A782 +A783 A783 A782 +A784 A785 A784 +A785 A785 A784 +A786 A787 A786 +A787 A787 A786 +A78B A78C A78B +A78C A78C A78B +A78D 0265 A78D +A790 A791 A790 +A791 A791 A790 +A792 A793 A792 +A793 A793 A792 +A794 A794 A7C4 +A796 A797 A796 +A797 A797 A796 +A798 A799 A798 +A799 A799 A798 +A79A A79B A79A +A79B A79B A79A +A79C A79D A79C +A79D A79D A79C +A79E A79F A79E +A79F A79F A79E +A7A0 A7A1 A7A0 +A7A1 A7A1 A7A0 +A7A2 A7A3 A7A2 +A7A3 A7A3 A7A2 +A7A4 A7A5 A7A4 +A7A5 A7A5 A7A4 +A7A6 A7A7 A7A6 +A7A7 A7A7 A7A6 +A7A8 A7A9 A7A8 +A7A9 A7A9 A7A8 +A7AA 0266 A7AA +A7AB 025C A7AB +A7AC 0261 A7AC +A7AD 026C A7AD +A7AE 026A A7AE +A7B0 029E A7B0 +A7B1 0287 A7B1 +A7B2 029D A7B2 +A7B3 AB53 A7B3 +A7B4 A7B5 A7B4 +A7B5 A7B5 A7B4 +A7B6 A7B7 A7B6 +A7B7 A7B7 A7B6 +A7B8 A7B9 A7B8 +A7B9 A7B9 A7B8 +A7BA A7BB A7BA +A7BB A7BB A7BA +A7BC A7BD A7BC +A7BD A7BD A7BC +A7BE A7BF A7BE +A7BF A7BF A7BE +A7C0 A7C1 A7C0 +A7C1 A7C1 A7C0 +A7C2 A7C3 A7C2 +A7C3 A7C3 A7C2 +A7C4 A794 A7C4 +A7C5 0282 A7C5 +A7C6 1D8E A7C6 +A7C7 A7C8 A7C7 +A7C8 A7C8 A7C7 +A7C9 A7CA A7C9 +A7CA A7CA A7C9 +A7D0 A7D1 A7D0 +A7D1 A7D1 A7D0 +A7D6 A7D7 A7D6 +A7D7 A7D7 A7D6 +A7D8 A7D9 A7D8 +A7D9 A7D9 A7D8 +A7F5 A7F6 A7F5 +A7F6 A7F6 A7F5 +AB53 AB53 A7B3 +AB70 AB70 13A0 +AB71 AB71 13A1 +AB72 AB72 13A2 +AB73 AB73 13A3 +AB74 AB74 13A4 +AB75 AB75 13A5 +AB76 AB76 13A6 +AB77 AB77 13A7 +AB78 AB78 13A8 +AB79 AB79 13A9 +AB7A AB7A 13AA +AB7B AB7B 13AB +AB7C AB7C 13AC +AB7D AB7D 13AD +AB7E AB7E 13AE +AB7F AB7F 13AF +AB80 AB80 13B0 +AB81 AB81 13B1 +AB82 AB82 13B2 +AB83 AB83 13B3 +AB84 AB84 13B4 +AB85 AB85 13B5 +AB86 AB86 13B6 +AB87 AB87 13B7 +AB88 AB88 13B8 +AB89 AB89 13B9 +AB8A AB8A 13BA +AB8B AB8B 13BB +AB8C AB8C 13BC +AB8D AB8D 13BD +AB8E AB8E 13BE +AB8F AB8F 13BF +AB90 AB90 13C0 +AB91 AB91 13C1 +AB92 AB92 13C2 +AB93 AB93 13C3 +AB94 AB94 13C4 +AB95 AB95 13C5 +AB96 AB96 13C6 +AB97 AB97 13C7 +AB98 AB98 13C8 +AB99 AB99 13C9 +AB9A AB9A 13CA +AB9B AB9B 13CB +AB9C AB9C 13CC +AB9D AB9D 13CD +AB9E AB9E 13CE +AB9F AB9F 13CF +ABA0 ABA0 13D0 +ABA1 ABA1 13D1 +ABA2 ABA2 13D2 +ABA3 ABA3 13D3 +ABA4 ABA4 13D4 +ABA5 ABA5 13D5 +ABA6 ABA6 13D6 +ABA7 ABA7 13D7 +ABA8 ABA8 13D8 +ABA9 ABA9 13D9 +ABAA ABAA 13DA +ABAB ABAB 13DB +ABAC ABAC 13DC +ABAD ABAD 13DD +ABAE ABAE 13DE +ABAF ABAF 13DF +ABB0 ABB0 13E0 +ABB1 ABB1 13E1 +ABB2 ABB2 13E2 +ABB3 ABB3 13E3 +ABB4 ABB4 13E4 +ABB5 ABB5 13E5 +ABB6 ABB6 13E6 +ABB7 ABB7 13E7 +ABB8 ABB8 13E8 +ABB9 ABB9 13E9 +ABBA ABBA 13EA +ABBB ABBB 13EB +ABBC ABBC 13EC +ABBD ABBD 13ED +ABBE ABBE 13EE +ABBF ABBF 13EF +FF21 FF41 FF21 +FF22 FF42 FF22 +FF23 FF43 FF23 +FF24 FF44 FF24 +FF25 FF45 FF25 +FF26 FF46 FF26 +FF27 FF47 FF27 +FF28 FF48 FF28 +FF29 FF49 FF29 +FF2A FF4A FF2A +FF2B FF4B FF2B +FF2C FF4C FF2C +FF2D FF4D FF2D +FF2E FF4E FF2E +FF2F FF4F FF2F +FF30 FF50 FF30 +FF31 FF51 FF31 +FF32 FF52 FF32 +FF33 FF53 FF33 +FF34 FF54 FF34 +FF35 FF55 FF35 +FF36 FF56 FF36 +FF37 FF57 FF37 +FF38 FF58 FF38 +FF39 FF59 FF39 +FF3A FF5A FF3A +FF41 FF41 FF21 +FF42 FF42 FF22 +FF43 FF43 FF23 +FF44 FF44 FF24 +FF45 FF45 FF25 +FF46 FF46 FF26 +FF47 FF47 FF27 +FF48 FF48 FF28 +FF49 FF49 FF29 +FF4A FF4A FF2A +FF4B FF4B FF2B +FF4C FF4C FF2C +FF4D FF4D FF2D +FF4E FF4E FF2E +FF4F FF4F FF2F +FF50 FF50 FF30 +FF51 FF51 FF31 +FF52 FF52 FF32 +FF53 FF53 FF33 +FF54 FF54 FF34 +FF55 FF55 FF35 +FF56 FF56 FF36 +FF57 FF57 FF37 +FF58 FF58 FF38 +FF59 FF59 FF39 +FF5A FF5A FF3A +DROP VIEW v_bmp; +EXECUTE IMMEDIATE SFORMAT(' +CREATE VIEW v_supplementary AS +SELECT + seq AS codepoint, + LPAD(HEX(seq),8,''0'') AS codepoint_hex8, + CONVERT(CHAR(seq USING utf32) USING {}) COLLATE {} AS c +FROM + seq_65536_to_1114111', @@character_set_connection, @@collation_connection); +SELECT COLLATION(c) FROM v_supplementary LIMIT 1; +COLLATION(c) +utf8mb4_uca1400_ai_ci +SELECT +codepoint_hex8, +HEX(CAST(LOWER(c) AS CHAR CHARACTER SET utf32)), +HEX(CAST(UPPER(c) AS CHAR CHARACTER SET utf32)) +FROM v_supplementary +WHERE BINARY(c)<>BINARY(LOWER(c)) OR BINARY(c)<>BINARY(UPPER(c)); +codepoint_hex8 HEX(CAST(LOWER(c) AS CHAR CHARACTER SET utf32)) HEX(CAST(UPPER(c) AS CHAR CHARACTER SET utf32)) +00010400 00010428 00010400 +00010401 00010429 00010401 +00010402 0001042A 00010402 +00010403 0001042B 00010403 +00010404 0001042C 00010404 +00010405 0001042D 00010405 +00010406 0001042E 00010406 +00010407 0001042F 00010407 +00010408 00010430 00010408 +00010409 00010431 00010409 +0001040A 00010432 0001040A +0001040B 00010433 0001040B +0001040C 00010434 0001040C +0001040D 00010435 0001040D +0001040E 00010436 0001040E +0001040F 00010437 0001040F +00010410 00010438 00010410 +00010411 00010439 00010411 +00010412 0001043A 00010412 +00010413 0001043B 00010413 +00010414 0001043C 00010414 +00010415 0001043D 00010415 +00010416 0001043E 00010416 +00010417 0001043F 00010417 +00010418 00010440 00010418 +00010419 00010441 00010419 +0001041A 00010442 0001041A +0001041B 00010443 0001041B +0001041C 00010444 0001041C +0001041D 00010445 0001041D +0001041E 00010446 0001041E +0001041F 00010447 0001041F +00010420 00010448 00010420 +00010421 00010449 00010421 +00010422 0001044A 00010422 +00010423 0001044B 00010423 +00010424 0001044C 00010424 +00010425 0001044D 00010425 +00010426 0001044E 00010426 +00010427 0001044F 00010427 +00010428 00010428 00010400 +00010429 00010429 00010401 +0001042A 0001042A 00010402 +0001042B 0001042B 00010403 +0001042C 0001042C 00010404 +0001042D 0001042D 00010405 +0001042E 0001042E 00010406 +0001042F 0001042F 00010407 +00010430 00010430 00010408 +00010431 00010431 00010409 +00010432 00010432 0001040A +00010433 00010433 0001040B +00010434 00010434 0001040C +00010435 00010435 0001040D +00010436 00010436 0001040E +00010437 00010437 0001040F +00010438 00010438 00010410 +00010439 00010439 00010411 +0001043A 0001043A 00010412 +0001043B 0001043B 00010413 +0001043C 0001043C 00010414 +0001043D 0001043D 00010415 +0001043E 0001043E 00010416 +0001043F 0001043F 00010417 +00010440 00010440 00010418 +00010441 00010441 00010419 +00010442 00010442 0001041A +00010443 00010443 0001041B +00010444 00010444 0001041C +00010445 00010445 0001041D +00010446 00010446 0001041E +00010447 00010447 0001041F +00010448 00010448 00010420 +00010449 00010449 00010421 +0001044A 0001044A 00010422 +0001044B 0001044B 00010423 +0001044C 0001044C 00010424 +0001044D 0001044D 00010425 +0001044E 0001044E 00010426 +0001044F 0001044F 00010427 +000104B0 000104D8 000104B0 +000104B1 000104D9 000104B1 +000104B2 000104DA 000104B2 +000104B3 000104DB 000104B3 +000104B4 000104DC 000104B4 +000104B5 000104DD 000104B5 +000104B6 000104DE 000104B6 +000104B7 000104DF 000104B7 +000104B8 000104E0 000104B8 +000104B9 000104E1 000104B9 +000104BA 000104E2 000104BA +000104BB 000104E3 000104BB +000104BC 000104E4 000104BC +000104BD 000104E5 000104BD +000104BE 000104E6 000104BE +000104BF 000104E7 000104BF +000104C0 000104E8 000104C0 +000104C1 000104E9 000104C1 +000104C2 000104EA 000104C2 +000104C3 000104EB 000104C3 +000104C4 000104EC 000104C4 +000104C5 000104ED 000104C5 +000104C6 000104EE 000104C6 +000104C7 000104EF 000104C7 +000104C8 000104F0 000104C8 +000104C9 000104F1 000104C9 +000104CA 000104F2 000104CA +000104CB 000104F3 000104CB +000104CC 000104F4 000104CC +000104CD 000104F5 000104CD +000104CE 000104F6 000104CE +000104CF 000104F7 000104CF +000104D0 000104F8 000104D0 +000104D1 000104F9 000104D1 +000104D2 000104FA 000104D2 +000104D3 000104FB 000104D3 +000104D8 000104D8 000104B0 +000104D9 000104D9 000104B1 +000104DA 000104DA 000104B2 +000104DB 000104DB 000104B3 +000104DC 000104DC 000104B4 +000104DD 000104DD 000104B5 +000104DE 000104DE 000104B6 +000104DF 000104DF 000104B7 +000104E0 000104E0 000104B8 +000104E1 000104E1 000104B9 +000104E2 000104E2 000104BA +000104E3 000104E3 000104BB +000104E4 000104E4 000104BC +000104E5 000104E5 000104BD +000104E6 000104E6 000104BE +000104E7 000104E7 000104BF +000104E8 000104E8 000104C0 +000104E9 000104E9 000104C1 +000104EA 000104EA 000104C2 +000104EB 000104EB 000104C3 +000104EC 000104EC 000104C4 +000104ED 000104ED 000104C5 +000104EE 000104EE 000104C6 +000104EF 000104EF 000104C7 +000104F0 000104F0 000104C8 +000104F1 000104F1 000104C9 +000104F2 000104F2 000104CA +000104F3 000104F3 000104CB +000104F4 000104F4 000104CC +000104F5 000104F5 000104CD +000104F6 000104F6 000104CE +000104F7 000104F7 000104CF +000104F8 000104F8 000104D0 +000104F9 000104F9 000104D1 +000104FA 000104FA 000104D2 +000104FB 000104FB 000104D3 +00010570 00010597 00010570 +00010571 00010598 00010571 +00010572 00010599 00010572 +00010573 0001059A 00010573 +00010574 0001059B 00010574 +00010575 0001059C 00010575 +00010576 0001059D 00010576 +00010577 0001059E 00010577 +00010578 0001059F 00010578 +00010579 000105A0 00010579 +0001057A 000105A1 0001057A +0001057C 000105A3 0001057C +0001057D 000105A4 0001057D +0001057E 000105A5 0001057E +0001057F 000105A6 0001057F +00010580 000105A7 00010580 +00010581 000105A8 00010581 +00010582 000105A9 00010582 +00010583 000105AA 00010583 +00010584 000105AB 00010584 +00010585 000105AC 00010585 +00010586 000105AD 00010586 +00010587 000105AE 00010587 +00010588 000105AF 00010588 +00010589 000105B0 00010589 +0001058A 000105B1 0001058A +0001058C 000105B3 0001058C +0001058D 000105B4 0001058D +0001058E 000105B5 0001058E +0001058F 000105B6 0001058F +00010590 000105B7 00010590 +00010591 000105B8 00010591 +00010592 000105B9 00010592 +00010594 000105BB 00010594 +00010595 000105BC 00010595 +00010597 00010597 00010570 +00010598 00010598 00010571 +00010599 00010599 00010572 +0001059A 0001059A 00010573 +0001059B 0001059B 00010574 +0001059C 0001059C 00010575 +0001059D 0001059D 00010576 +0001059E 0001059E 00010577 +0001059F 0001059F 00010578 +000105A0 000105A0 00010579 +000105A1 000105A1 0001057A +000105A3 000105A3 0001057C +000105A4 000105A4 0001057D +000105A5 000105A5 0001057E +000105A6 000105A6 0001057F +000105A7 000105A7 00010580 +000105A8 000105A8 00010581 +000105A9 000105A9 00010582 +000105AA 000105AA 00010583 +000105AB 000105AB 00010584 +000105AC 000105AC 00010585 +000105AD 000105AD 00010586 +000105AE 000105AE 00010587 +000105AF 000105AF 00010588 +000105B0 000105B0 00010589 +000105B1 000105B1 0001058A +000105B3 000105B3 0001058C +000105B4 000105B4 0001058D +000105B5 000105B5 0001058E +000105B6 000105B6 0001058F +000105B7 000105B7 00010590 +000105B8 000105B8 00010591 +000105B9 000105B9 00010592 +000105BB 000105BB 00010594 +000105BC 000105BC 00010595 +00010C80 00010CC0 00010C80 +00010C81 00010CC1 00010C81 +00010C82 00010CC2 00010C82 +00010C83 00010CC3 00010C83 +00010C84 00010CC4 00010C84 +00010C85 00010CC5 00010C85 +00010C86 00010CC6 00010C86 +00010C87 00010CC7 00010C87 +00010C88 00010CC8 00010C88 +00010C89 00010CC9 00010C89 +00010C8A 00010CCA 00010C8A +00010C8B 00010CCB 00010C8B +00010C8C 00010CCC 00010C8C +00010C8D 00010CCD 00010C8D +00010C8E 00010CCE 00010C8E +00010C8F 00010CCF 00010C8F +00010C90 00010CD0 00010C90 +00010C91 00010CD1 00010C91 +00010C92 00010CD2 00010C92 +00010C93 00010CD3 00010C93 +00010C94 00010CD4 00010C94 +00010C95 00010CD5 00010C95 +00010C96 00010CD6 00010C96 +00010C97 00010CD7 00010C97 +00010C98 00010CD8 00010C98 +00010C99 00010CD9 00010C99 +00010C9A 00010CDA 00010C9A +00010C9B 00010CDB 00010C9B +00010C9C 00010CDC 00010C9C +00010C9D 00010CDD 00010C9D +00010C9E 00010CDE 00010C9E +00010C9F 00010CDF 00010C9F +00010CA0 00010CE0 00010CA0 +00010CA1 00010CE1 00010CA1 +00010CA2 00010CE2 00010CA2 +00010CA3 00010CE3 00010CA3 +00010CA4 00010CE4 00010CA4 +00010CA5 00010CE5 00010CA5 +00010CA6 00010CE6 00010CA6 +00010CA7 00010CE7 00010CA7 +00010CA8 00010CE8 00010CA8 +00010CA9 00010CE9 00010CA9 +00010CAA 00010CEA 00010CAA +00010CAB 00010CEB 00010CAB +00010CAC 00010CEC 00010CAC +00010CAD 00010CED 00010CAD +00010CAE 00010CEE 00010CAE +00010CAF 00010CEF 00010CAF +00010CB0 00010CF0 00010CB0 +00010CB1 00010CF1 00010CB1 +00010CB2 00010CF2 00010CB2 +00010CC0 00010CC0 00010C80 +00010CC1 00010CC1 00010C81 +00010CC2 00010CC2 00010C82 +00010CC3 00010CC3 00010C83 +00010CC4 00010CC4 00010C84 +00010CC5 00010CC5 00010C85 +00010CC6 00010CC6 00010C86 +00010CC7 00010CC7 00010C87 +00010CC8 00010CC8 00010C88 +00010CC9 00010CC9 00010C89 +00010CCA 00010CCA 00010C8A +00010CCB 00010CCB 00010C8B +00010CCC 00010CCC 00010C8C +00010CCD 00010CCD 00010C8D +00010CCE 00010CCE 00010C8E +00010CCF 00010CCF 00010C8F +00010CD0 00010CD0 00010C90 +00010CD1 00010CD1 00010C91 +00010CD2 00010CD2 00010C92 +00010CD3 00010CD3 00010C93 +00010CD4 00010CD4 00010C94 +00010CD5 00010CD5 00010C95 +00010CD6 00010CD6 00010C96 +00010CD7 00010CD7 00010C97 +00010CD8 00010CD8 00010C98 +00010CD9 00010CD9 00010C99 +00010CDA 00010CDA 00010C9A +00010CDB 00010CDB 00010C9B +00010CDC 00010CDC 00010C9C +00010CDD 00010CDD 00010C9D +00010CDE 00010CDE 00010C9E +00010CDF 00010CDF 00010C9F +00010CE0 00010CE0 00010CA0 +00010CE1 00010CE1 00010CA1 +00010CE2 00010CE2 00010CA2 +00010CE3 00010CE3 00010CA3 +00010CE4 00010CE4 00010CA4 +00010CE5 00010CE5 00010CA5 +00010CE6 00010CE6 00010CA6 +00010CE7 00010CE7 00010CA7 +00010CE8 00010CE8 00010CA8 +00010CE9 00010CE9 00010CA9 +00010CEA 00010CEA 00010CAA +00010CEB 00010CEB 00010CAB +00010CEC 00010CEC 00010CAC +00010CED 00010CED 00010CAD +00010CEE 00010CEE 00010CAE +00010CEF 00010CEF 00010CAF +00010CF0 00010CF0 00010CB0 +00010CF1 00010CF1 00010CB1 +00010CF2 00010CF2 00010CB2 +000118A0 000118C0 000118A0 +000118A1 000118C1 000118A1 +000118A2 000118C2 000118A2 +000118A3 000118C3 000118A3 +000118A4 000118C4 000118A4 +000118A5 000118C5 000118A5 +000118A6 000118C6 000118A6 +000118A7 000118C7 000118A7 +000118A8 000118C8 000118A8 +000118A9 000118C9 000118A9 +000118AA 000118CA 000118AA +000118AB 000118CB 000118AB +000118AC 000118CC 000118AC +000118AD 000118CD 000118AD +000118AE 000118CE 000118AE +000118AF 000118CF 000118AF +000118B0 000118D0 000118B0 +000118B1 000118D1 000118B1 +000118B2 000118D2 000118B2 +000118B3 000118D3 000118B3 +000118B4 000118D4 000118B4 +000118B5 000118D5 000118B5 +000118B6 000118D6 000118B6 +000118B7 000118D7 000118B7 +000118B8 000118D8 000118B8 +000118B9 000118D9 000118B9 +000118BA 000118DA 000118BA +000118BB 000118DB 000118BB +000118BC 000118DC 000118BC +000118BD 000118DD 000118BD +000118BE 000118DE 000118BE +000118BF 000118DF 000118BF +000118C0 000118C0 000118A0 +000118C1 000118C1 000118A1 +000118C2 000118C2 000118A2 +000118C3 000118C3 000118A3 +000118C4 000118C4 000118A4 +000118C5 000118C5 000118A5 +000118C6 000118C6 000118A6 +000118C7 000118C7 000118A7 +000118C8 000118C8 000118A8 +000118C9 000118C9 000118A9 +000118CA 000118CA 000118AA +000118CB 000118CB 000118AB +000118CC 000118CC 000118AC +000118CD 000118CD 000118AD +000118CE 000118CE 000118AE +000118CF 000118CF 000118AF +000118D0 000118D0 000118B0 +000118D1 000118D1 000118B1 +000118D2 000118D2 000118B2 +000118D3 000118D3 000118B3 +000118D4 000118D4 000118B4 +000118D5 000118D5 000118B5 +000118D6 000118D6 000118B6 +000118D7 000118D7 000118B7 +000118D8 000118D8 000118B8 +000118D9 000118D9 000118B9 +000118DA 000118DA 000118BA +000118DB 000118DB 000118BB +000118DC 000118DC 000118BC +000118DD 000118DD 000118BD +000118DE 000118DE 000118BE +000118DF 000118DF 000118BF +00016E40 00016E60 00016E40 +00016E41 00016E61 00016E41 +00016E42 00016E62 00016E42 +00016E43 00016E63 00016E43 +00016E44 00016E64 00016E44 +00016E45 00016E65 00016E45 +00016E46 00016E66 00016E46 +00016E47 00016E67 00016E47 +00016E48 00016E68 00016E48 +00016E49 00016E69 00016E49 +00016E4A 00016E6A 00016E4A +00016E4B 00016E6B 00016E4B +00016E4C 00016E6C 00016E4C +00016E4D 00016E6D 00016E4D +00016E4E 00016E6E 00016E4E +00016E4F 00016E6F 00016E4F +00016E50 00016E70 00016E50 +00016E51 00016E71 00016E51 +00016E52 00016E72 00016E52 +00016E53 00016E73 00016E53 +00016E54 00016E74 00016E54 +00016E55 00016E75 00016E55 +00016E56 00016E76 00016E56 +00016E57 00016E77 00016E57 +00016E58 00016E78 00016E58 +00016E59 00016E79 00016E59 +00016E5A 00016E7A 00016E5A +00016E5B 00016E7B 00016E5B +00016E5C 00016E7C 00016E5C +00016E5D 00016E7D 00016E5D +00016E5E 00016E7E 00016E5E +00016E5F 00016E7F 00016E5F +00016E60 00016E60 00016E40 +00016E61 00016E61 00016E41 +00016E62 00016E62 00016E42 +00016E63 00016E63 00016E43 +00016E64 00016E64 00016E44 +00016E65 00016E65 00016E45 +00016E66 00016E66 00016E46 +00016E67 00016E67 00016E47 +00016E68 00016E68 00016E48 +00016E69 00016E69 00016E49 +00016E6A 00016E6A 00016E4A +00016E6B 00016E6B 00016E4B +00016E6C 00016E6C 00016E4C +00016E6D 00016E6D 00016E4D +00016E6E 00016E6E 00016E4E +00016E6F 00016E6F 00016E4F +00016E70 00016E70 00016E50 +00016E71 00016E71 00016E51 +00016E72 00016E72 00016E52 +00016E73 00016E73 00016E53 +00016E74 00016E74 00016E54 +00016E75 00016E75 00016E55 +00016E76 00016E76 00016E56 +00016E77 00016E77 00016E57 +00016E78 00016E78 00016E58 +00016E79 00016E79 00016E59 +00016E7A 00016E7A 00016E5A +00016E7B 00016E7B 00016E5B +00016E7C 00016E7C 00016E5C +00016E7D 00016E7D 00016E5D +00016E7E 00016E7E 00016E5E +00016E7F 00016E7F 00016E5F +0001E900 0001E922 0001E900 +0001E901 0001E923 0001E901 +0001E902 0001E924 0001E902 +0001E903 0001E925 0001E903 +0001E904 0001E926 0001E904 +0001E905 0001E927 0001E905 +0001E906 0001E928 0001E906 +0001E907 0001E929 0001E907 +0001E908 0001E92A 0001E908 +0001E909 0001E92B 0001E909 +0001E90A 0001E92C 0001E90A +0001E90B 0001E92D 0001E90B +0001E90C 0001E92E 0001E90C +0001E90D 0001E92F 0001E90D +0001E90E 0001E930 0001E90E +0001E90F 0001E931 0001E90F +0001E910 0001E932 0001E910 +0001E911 0001E933 0001E911 +0001E912 0001E934 0001E912 +0001E913 0001E935 0001E913 +0001E914 0001E936 0001E914 +0001E915 0001E937 0001E915 +0001E916 0001E938 0001E916 +0001E917 0001E939 0001E917 +0001E918 0001E93A 0001E918 +0001E919 0001E93B 0001E919 +0001E91A 0001E93C 0001E91A +0001E91B 0001E93D 0001E91B +0001E91C 0001E93E 0001E91C +0001E91D 0001E93F 0001E91D +0001E91E 0001E940 0001E91E +0001E91F 0001E941 0001E91F +0001E920 0001E942 0001E920 +0001E921 0001E943 0001E921 +0001E922 0001E922 0001E900 +0001E923 0001E923 0001E901 +0001E924 0001E924 0001E902 +0001E925 0001E925 0001E903 +0001E926 0001E926 0001E904 +0001E927 0001E927 0001E905 +0001E928 0001E928 0001E906 +0001E929 0001E929 0001E907 +0001E92A 0001E92A 0001E908 +0001E92B 0001E92B 0001E909 +0001E92C 0001E92C 0001E90A +0001E92D 0001E92D 0001E90B +0001E92E 0001E92E 0001E90C +0001E92F 0001E92F 0001E90D +0001E930 0001E930 0001E90E +0001E931 0001E931 0001E90F +0001E932 0001E932 0001E910 +0001E933 0001E933 0001E911 +0001E934 0001E934 0001E912 +0001E935 0001E935 0001E913 +0001E936 0001E936 0001E914 +0001E937 0001E937 0001E915 +0001E938 0001E938 0001E916 +0001E939 0001E939 0001E917 +0001E93A 0001E93A 0001E918 +0001E93B 0001E93B 0001E919 +0001E93C 0001E93C 0001E91A +0001E93D 0001E93D 0001E91B +0001E93E 0001E93E 0001E91C +0001E93F 0001E93F 0001E91D +0001E940 0001E940 0001E91E +0001E941 0001E941 0001E91F +0001E942 0001E942 0001E920 +0001E943 0001E943 0001E921 +DROP VIEW v_supplementary; +# +# End of 10.10 tests +# diff --git a/mysql-test/main/ctype_utf8mb4_uca1400_ai_ci_casefold.test b/mysql-test/main/ctype_utf8mb4_uca1400_ai_ci_casefold.test new file mode 100644 index 00000000000..288f86155e2 --- /dev/null +++ b/mysql-test/main/ctype_utf8mb4_uca1400_ai_ci_casefold.test @@ -0,0 +1,15 @@ +--echo # +--echo # Start of 10.10 tests +--echo # + +--echo # +--echo # MDEV-30577 Case folding for uca1400 collations is not up to date +--echo # + +SET NAMES utf8mb4 COLLATE utf8mb4_uca1400_ai_ci; +--source include/ctype_unicode_casefold_bmp.inc +--source include/ctype_unicode_casefold_supplementary.inc + +--echo # +--echo # End of 10.10 tests +--echo # diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 1e8661bef54..aa4d366208f 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -34768,7 +34768,7 @@ create_tailoring(struct charset_info_st *cs, else if (rules.version == 1400) /* Unicode-14.0.0 */ { src_uca= &my_uca_v1400; - cs->casefold= &my_casefold_unicode520; + cs->casefold= &my_casefold_unicode1400; } else if (rules.version == 400) /* Unicode-4.0.0 requested */ { @@ -39455,9 +39455,9 @@ my_uca1400_collation_definition_init(MY_CHARSET_LOADER *loader, dst->uca= &my_uca_v1400; dst->tailoring= def->tailoring; if (def->tailoring == turkish) - dst->casefold= &my_casefold_turkish; /*TODO: casefold_1400_turkish */ + dst->casefold= &my_casefold_unicode1400tr; else - dst->casefold= &my_casefold_unicode520; /*TODO: casefold_1400*/ + dst->casefold= &my_casefold_unicode1400; if (nopad) dst->state|= MY_CS_NOPAD; my_ci_set_level_flags(dst, (1 << MY_CS_LEVEL_BIT_PRIMARY) | diff --git a/strings/ctype-unicode1400-casefold-tr.h b/strings/ctype-unicode1400-casefold-tr.h new file mode 100644 index 00000000000..25e1b5d3d59 --- /dev/null +++ b/strings/ctype-unicode1400-casefold-tr.h @@ -0,0 +1,704 @@ +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. + Copyright (c) 2009, 2023, MariaDB Corporation. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA +*/ + +/* + Generated by: + ./unidata-dump \ + --mode=casefold-tr \ + --page-name=u1400tr_casefold_page \ + --page-name-derived=u1400_casefold_page \ + --index-name=my_u1400tr_casefold_index \ + UnicodeData-14.0.0.txt + +*/ +const MY_CASEFOLD_CHARACTER u1400tr_casefold_page00[256]={ + {0x0000,0x0000},{0x0001,0x0001}, /* 0000 */ + {0x0002,0x0002},{0x0003,0x0003}, /* 0002 */ + {0x0004,0x0004},{0x0005,0x0005}, /* 0004 */ + {0x0006,0x0006},{0x0007,0x0007}, /* 0006 */ + {0x0008,0x0008},{0x0009,0x0009}, /* 0008 */ + {0x000A,0x000A},{0x000B,0x000B}, /* 000A */ + {0x000C,0x000C},{0x000D,0x000D}, /* 000C */ + {0x000E,0x000E},{0x000F,0x000F}, /* 000E */ + {0x0010,0x0010},{0x0011,0x0011}, /* 0010 */ + {0x0012,0x0012},{0x0013,0x0013}, /* 0012 */ + {0x0014,0x0014},{0x0015,0x0015}, /* 0014 */ + {0x0016,0x0016},{0x0017,0x0017}, /* 0016 */ + {0x0018,0x0018},{0x0019,0x0019}, /* 0018 */ + {0x001A,0x001A},{0x001B,0x001B}, /* 001A */ + {0x001C,0x001C},{0x001D,0x001D}, /* 001C */ + {0x001E,0x001E},{0x001F,0x001F}, /* 001E */ + {0x0020,0x0020},{0x0021,0x0021}, /* 0020 */ + {0x0022,0x0022},{0x0023,0x0023}, /* 0022 */ + {0x0024,0x0024},{0x0025,0x0025}, /* 0024 */ + {0x0026,0x0026},{0x0027,0x0027}, /* 0026 */ + {0x0028,0x0028},{0x0029,0x0029}, /* 0028 */ + {0x002A,0x002A},{0x002B,0x002B}, /* 002A */ + {0x002C,0x002C},{0x002D,0x002D}, /* 002C */ + {0x002E,0x002E},{0x002F,0x002F}, /* 002E */ + {0x0030,0x0030},{0x0031,0x0031}, /* 0030 */ + {0x0032,0x0032},{0x0033,0x0033}, /* 0032 */ + {0x0034,0x0034},{0x0035,0x0035}, /* 0034 */ + {0x0036,0x0036},{0x0037,0x0037}, /* 0036 */ + {0x0038,0x0038},{0x0039,0x0039}, /* 0038 */ + {0x003A,0x003A},{0x003B,0x003B}, /* 003A */ + {0x003C,0x003C},{0x003D,0x003D}, /* 003C */ + {0x003E,0x003E},{0x003F,0x003F}, /* 003E */ + {0x0040,0x0040},{0x0041,0x0061}, /* 0040 */ + {0x0042,0x0062},{0x0043,0x0063}, /* 0042 */ + {0x0044,0x0064},{0x0045,0x0065}, /* 0044 */ + {0x0046,0x0066},{0x0047,0x0067}, /* 0046 */ + {0x0048,0x0068},{0x0049,0x0131}, /* 0048 */ + {0x004A,0x006A},{0x004B,0x006B}, /* 004A */ + {0x004C,0x006C},{0x004D,0x006D}, /* 004C */ + {0x004E,0x006E},{0x004F,0x006F}, /* 004E */ + {0x0050,0x0070},{0x0051,0x0071}, /* 0050 */ + {0x0052,0x0072},{0x0053,0x0073}, /* 0052 */ + {0x0054,0x0074},{0x0055,0x0075}, /* 0054 */ + {0x0056,0x0076},{0x0057,0x0077}, /* 0056 */ + {0x0058,0x0078},{0x0059,0x0079}, /* 0058 */ + {0x005A,0x007A},{0x005B,0x005B}, /* 005A */ + {0x005C,0x005C},{0x005D,0x005D}, /* 005C */ + {0x005E,0x005E},{0x005F,0x005F}, /* 005E */ + {0x0060,0x0060},{0x0041,0x0061}, /* 0060 */ + {0x0042,0x0062},{0x0043,0x0063}, /* 0062 */ + {0x0044,0x0064},{0x0045,0x0065}, /* 0064 */ + {0x0046,0x0066},{0x0047,0x0067}, /* 0066 */ + {0x0048,0x0068},{0x0130,0x0069}, /* 0068 */ + {0x004A,0x006A},{0x004B,0x006B}, /* 006A */ + {0x004C,0x006C},{0x004D,0x006D}, /* 006C */ + {0x004E,0x006E},{0x004F,0x006F}, /* 006E */ + {0x0050,0x0070},{0x0051,0x0071}, /* 0070 */ + {0x0052,0x0072},{0x0053,0x0073}, /* 0072 */ + {0x0054,0x0074},{0x0055,0x0075}, /* 0074 */ + {0x0056,0x0076},{0x0057,0x0077}, /* 0076 */ + {0x0058,0x0078},{0x0059,0x0079}, /* 0078 */ + {0x005A,0x007A},{0x007B,0x007B}, /* 007A */ + {0x007C,0x007C},{0x007D,0x007D}, /* 007C */ + {0x007E,0x007E},{0x007F,0x007F}, /* 007E */ + {0x0080,0x0080},{0x0081,0x0081}, /* 0080 */ + {0x0082,0x0082},{0x0083,0x0083}, /* 0082 */ + {0x0084,0x0084},{0x0085,0x0085}, /* 0084 */ + {0x0086,0x0086},{0x0087,0x0087}, /* 0086 */ + {0x0088,0x0088},{0x0089,0x0089}, /* 0088 */ + {0x008A,0x008A},{0x008B,0x008B}, /* 008A */ + {0x008C,0x008C},{0x008D,0x008D}, /* 008C */ + {0x008E,0x008E},{0x008F,0x008F}, /* 008E */ + {0x0090,0x0090},{0x0091,0x0091}, /* 0090 */ + {0x0092,0x0092},{0x0093,0x0093}, /* 0092 */ + {0x0094,0x0094},{0x0095,0x0095}, /* 0094 */ + {0x0096,0x0096},{0x0097,0x0097}, /* 0096 */ + {0x0098,0x0098},{0x0099,0x0099}, /* 0098 */ + {0x009A,0x009A},{0x009B,0x009B}, /* 009A */ + {0x009C,0x009C},{0x009D,0x009D}, /* 009C */ + {0x009E,0x009E},{0x009F,0x009F}, /* 009E */ + {0x00A0,0x00A0},{0x00A1,0x00A1}, /* 00A0 */ + {0x00A2,0x00A2},{0x00A3,0x00A3}, /* 00A2 */ + {0x00A4,0x00A4},{0x00A5,0x00A5}, /* 00A4 */ + {0x00A6,0x00A6},{0x00A7,0x00A7}, /* 00A6 */ + {0x00A8,0x00A8},{0x00A9,0x00A9}, /* 00A8 */ + {0x00AA,0x00AA},{0x00AB,0x00AB}, /* 00AA */ + {0x00AC,0x00AC},{0x00AD,0x00AD}, /* 00AC */ + {0x00AE,0x00AE},{0x00AF,0x00AF}, /* 00AE */ + {0x00B0,0x00B0},{0x00B1,0x00B1}, /* 00B0 */ + {0x00B2,0x00B2},{0x00B3,0x00B3}, /* 00B2 */ + {0x00B4,0x00B4},{0x039C,0x00B5}, /* 00B4 */ + {0x00B6,0x00B6},{0x00B7,0x00B7}, /* 00B6 */ + {0x00B8,0x00B8},{0x00B9,0x00B9}, /* 00B8 */ + {0x00BA,0x00BA},{0x00BB,0x00BB}, /* 00BA */ + {0x00BC,0x00BC},{0x00BD,0x00BD}, /* 00BC */ + {0x00BE,0x00BE},{0x00BF,0x00BF}, /* 00BE */ + {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00C0 */ + {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00C2 */ + {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00C4 */ + {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00C6 */ + {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00C8 */ + {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00CA */ + {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00CC */ + {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00CE */ + {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00D0 */ + {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00D2 */ + {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00D4 */ + {0x00D6,0x00F6},{0x00D7,0x00D7}, /* 00D6 */ + {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00D8 */ + {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00DA */ + {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00DC */ + {0x00DE,0x00FE},{0x00DF,0x00DF}, /* 00DE */ + {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00E0 */ + {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00E2 */ + {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00E4 */ + {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00E6 */ + {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00E8 */ + {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00EA */ + {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00EC */ + {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00EE */ + {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00F0 */ + {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00F2 */ + {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00F4 */ + {0x00D6,0x00F6},{0x00F7,0x00F7}, /* 00F6 */ + {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00F8 */ + {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00FA */ + {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00FC */ + {0x00DE,0x00FE},{0x0178,0x00FF} /* 00FE */ +}; + +const MY_CASEFOLD_CHARACTER * my_u1400tr_casefold_index[4352]={ + u1400tr_casefold_page00, u1400_casefold_page01, u1400_casefold_page02, u1400_casefold_page03, u1400_casefold_page04, u1400_casefold_page05, u1400_casefold_page06, u1400_casefold_page07, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + u1400_casefold_page10, NULL, NULL, u1400_casefold_page13, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, u1400_casefold_page1C, u1400_casefold_page1D, u1400_casefold_page1E, u1400_casefold_page1F, + NULL, u1400_casefold_page21, NULL, NULL, u1400_casefold_page24, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, u1400_casefold_page2C, u1400_casefold_page2D, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, u1400_casefold_pageA6, u1400_casefold_pageA7, + NULL, NULL, NULL, u1400_casefold_pageAB, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, u1400_casefold_pageFF, + NULL, NULL, NULL, NULL, u1400_casefold_page104, u1400_casefold_page105, NULL, NULL, + NULL, NULL, NULL, NULL, u1400_casefold_page10C, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + u1400_casefold_page118, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, u1400_casefold_page16E, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, u1400_casefold_page1E9, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL +}; diff --git a/strings/ctype-unicode1400-casefold.h b/strings/ctype-unicode1400-casefold.h new file mode 100644 index 00000000000..dae180d0157 --- /dev/null +++ b/strings/ctype-unicode1400-casefold.h @@ -0,0 +1,4240 @@ +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. + Copyright (c) 2009, 2023, MariaDB Corporation. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA +*/ + +/* + Generated by: + ./unidata-dump \ + --mode=casefold \ + --page-name=u1400_casefold_page \ + --index-name=my_u1400_casefold_index \ + UnicodeData-14.0.0.txt + +*/ +const MY_CASEFOLD_CHARACTER u1400_casefold_page00[256]={ + {0x0000,0x0000},{0x0001,0x0001}, /* 0000 */ + {0x0002,0x0002},{0x0003,0x0003}, /* 0002 */ + {0x0004,0x0004},{0x0005,0x0005}, /* 0004 */ + {0x0006,0x0006},{0x0007,0x0007}, /* 0006 */ + {0x0008,0x0008},{0x0009,0x0009}, /* 0008 */ + {0x000A,0x000A},{0x000B,0x000B}, /* 000A */ + {0x000C,0x000C},{0x000D,0x000D}, /* 000C */ + {0x000E,0x000E},{0x000F,0x000F}, /* 000E */ + {0x0010,0x0010},{0x0011,0x0011}, /* 0010 */ + {0x0012,0x0012},{0x0013,0x0013}, /* 0012 */ + {0x0014,0x0014},{0x0015,0x0015}, /* 0014 */ + {0x0016,0x0016},{0x0017,0x0017}, /* 0016 */ + {0x0018,0x0018},{0x0019,0x0019}, /* 0018 */ + {0x001A,0x001A},{0x001B,0x001B}, /* 001A */ + {0x001C,0x001C},{0x001D,0x001D}, /* 001C */ + {0x001E,0x001E},{0x001F,0x001F}, /* 001E */ + {0x0020,0x0020},{0x0021,0x0021}, /* 0020 */ + {0x0022,0x0022},{0x0023,0x0023}, /* 0022 */ + {0x0024,0x0024},{0x0025,0x0025}, /* 0024 */ + {0x0026,0x0026},{0x0027,0x0027}, /* 0026 */ + {0x0028,0x0028},{0x0029,0x0029}, /* 0028 */ + {0x002A,0x002A},{0x002B,0x002B}, /* 002A */ + {0x002C,0x002C},{0x002D,0x002D}, /* 002C */ + {0x002E,0x002E},{0x002F,0x002F}, /* 002E */ + {0x0030,0x0030},{0x0031,0x0031}, /* 0030 */ + {0x0032,0x0032},{0x0033,0x0033}, /* 0032 */ + {0x0034,0x0034},{0x0035,0x0035}, /* 0034 */ + {0x0036,0x0036},{0x0037,0x0037}, /* 0036 */ + {0x0038,0x0038},{0x0039,0x0039}, /* 0038 */ + {0x003A,0x003A},{0x003B,0x003B}, /* 003A */ + {0x003C,0x003C},{0x003D,0x003D}, /* 003C */ + {0x003E,0x003E},{0x003F,0x003F}, /* 003E */ + {0x0040,0x0040},{0x0041,0x0061}, /* 0040 */ + {0x0042,0x0062},{0x0043,0x0063}, /* 0042 */ + {0x0044,0x0064},{0x0045,0x0065}, /* 0044 */ + {0x0046,0x0066},{0x0047,0x0067}, /* 0046 */ + {0x0048,0x0068},{0x0049,0x0069}, /* 0048 */ + {0x004A,0x006A},{0x004B,0x006B}, /* 004A */ + {0x004C,0x006C},{0x004D,0x006D}, /* 004C */ + {0x004E,0x006E},{0x004F,0x006F}, /* 004E */ + {0x0050,0x0070},{0x0051,0x0071}, /* 0050 */ + {0x0052,0x0072},{0x0053,0x0073}, /* 0052 */ + {0x0054,0x0074},{0x0055,0x0075}, /* 0054 */ + {0x0056,0x0076},{0x0057,0x0077}, /* 0056 */ + {0x0058,0x0078},{0x0059,0x0079}, /* 0058 */ + {0x005A,0x007A},{0x005B,0x005B}, /* 005A */ + {0x005C,0x005C},{0x005D,0x005D}, /* 005C */ + {0x005E,0x005E},{0x005F,0x005F}, /* 005E */ + {0x0060,0x0060},{0x0041,0x0061}, /* 0060 */ + {0x0042,0x0062},{0x0043,0x0063}, /* 0062 */ + {0x0044,0x0064},{0x0045,0x0065}, /* 0064 */ + {0x0046,0x0066},{0x0047,0x0067}, /* 0066 */ + {0x0048,0x0068},{0x0049,0x0069}, /* 0068 */ + {0x004A,0x006A},{0x004B,0x006B}, /* 006A */ + {0x004C,0x006C},{0x004D,0x006D}, /* 006C */ + {0x004E,0x006E},{0x004F,0x006F}, /* 006E */ + {0x0050,0x0070},{0x0051,0x0071}, /* 0070 */ + {0x0052,0x0072},{0x0053,0x0073}, /* 0072 */ + {0x0054,0x0074},{0x0055,0x0075}, /* 0074 */ + {0x0056,0x0076},{0x0057,0x0077}, /* 0076 */ + {0x0058,0x0078},{0x0059,0x0079}, /* 0078 */ + {0x005A,0x007A},{0x007B,0x007B}, /* 007A */ + {0x007C,0x007C},{0x007D,0x007D}, /* 007C */ + {0x007E,0x007E},{0x007F,0x007F}, /* 007E */ + {0x0080,0x0080},{0x0081,0x0081}, /* 0080 */ + {0x0082,0x0082},{0x0083,0x0083}, /* 0082 */ + {0x0084,0x0084},{0x0085,0x0085}, /* 0084 */ + {0x0086,0x0086},{0x0087,0x0087}, /* 0086 */ + {0x0088,0x0088},{0x0089,0x0089}, /* 0088 */ + {0x008A,0x008A},{0x008B,0x008B}, /* 008A */ + {0x008C,0x008C},{0x008D,0x008D}, /* 008C */ + {0x008E,0x008E},{0x008F,0x008F}, /* 008E */ + {0x0090,0x0090},{0x0091,0x0091}, /* 0090 */ + {0x0092,0x0092},{0x0093,0x0093}, /* 0092 */ + {0x0094,0x0094},{0x0095,0x0095}, /* 0094 */ + {0x0096,0x0096},{0x0097,0x0097}, /* 0096 */ + {0x0098,0x0098},{0x0099,0x0099}, /* 0098 */ + {0x009A,0x009A},{0x009B,0x009B}, /* 009A */ + {0x009C,0x009C},{0x009D,0x009D}, /* 009C */ + {0x009E,0x009E},{0x009F,0x009F}, /* 009E */ + {0x00A0,0x00A0},{0x00A1,0x00A1}, /* 00A0 */ + {0x00A2,0x00A2},{0x00A3,0x00A3}, /* 00A2 */ + {0x00A4,0x00A4},{0x00A5,0x00A5}, /* 00A4 */ + {0x00A6,0x00A6},{0x00A7,0x00A7}, /* 00A6 */ + {0x00A8,0x00A8},{0x00A9,0x00A9}, /* 00A8 */ + {0x00AA,0x00AA},{0x00AB,0x00AB}, /* 00AA */ + {0x00AC,0x00AC},{0x00AD,0x00AD}, /* 00AC */ + {0x00AE,0x00AE},{0x00AF,0x00AF}, /* 00AE */ + {0x00B0,0x00B0},{0x00B1,0x00B1}, /* 00B0 */ + {0x00B2,0x00B2},{0x00B3,0x00B3}, /* 00B2 */ + {0x00B4,0x00B4},{0x039C,0x00B5}, /* 00B4 */ + {0x00B6,0x00B6},{0x00B7,0x00B7}, /* 00B6 */ + {0x00B8,0x00B8},{0x00B9,0x00B9}, /* 00B8 */ + {0x00BA,0x00BA},{0x00BB,0x00BB}, /* 00BA */ + {0x00BC,0x00BC},{0x00BD,0x00BD}, /* 00BC */ + {0x00BE,0x00BE},{0x00BF,0x00BF}, /* 00BE */ + {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00C0 */ + {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00C2 */ + {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00C4 */ + {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00C6 */ + {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00C8 */ + {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00CA */ + {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00CC */ + {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00CE */ + {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00D0 */ + {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00D2 */ + {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00D4 */ + {0x00D6,0x00F6},{0x00D7,0x00D7}, /* 00D6 */ + {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00D8 */ + {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00DA */ + {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00DC */ + {0x00DE,0x00FE},{0x00DF,0x00DF}, /* 00DE */ + {0x00C0,0x00E0},{0x00C1,0x00E1}, /* 00E0 */ + {0x00C2,0x00E2},{0x00C3,0x00E3}, /* 00E2 */ + {0x00C4,0x00E4},{0x00C5,0x00E5}, /* 00E4 */ + {0x00C6,0x00E6},{0x00C7,0x00E7}, /* 00E6 */ + {0x00C8,0x00E8},{0x00C9,0x00E9}, /* 00E8 */ + {0x00CA,0x00EA},{0x00CB,0x00EB}, /* 00EA */ + {0x00CC,0x00EC},{0x00CD,0x00ED}, /* 00EC */ + {0x00CE,0x00EE},{0x00CF,0x00EF}, /* 00EE */ + {0x00D0,0x00F0},{0x00D1,0x00F1}, /* 00F0 */ + {0x00D2,0x00F2},{0x00D3,0x00F3}, /* 00F2 */ + {0x00D4,0x00F4},{0x00D5,0x00F5}, /* 00F4 */ + {0x00D6,0x00F6},{0x00F7,0x00F7}, /* 00F6 */ + {0x00D8,0x00F8},{0x00D9,0x00F9}, /* 00F8 */ + {0x00DA,0x00FA},{0x00DB,0x00FB}, /* 00FA */ + {0x00DC,0x00FC},{0x00DD,0x00FD}, /* 00FC */ + {0x00DE,0x00FE},{0x0178,0x00FF} /* 00FE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page01[256]={ + {0x0100,0x0101},{0x0100,0x0101}, /* 0100 */ + {0x0102,0x0103},{0x0102,0x0103}, /* 0102 */ + {0x0104,0x0105},{0x0104,0x0105}, /* 0104 */ + {0x0106,0x0107},{0x0106,0x0107}, /* 0106 */ + {0x0108,0x0109},{0x0108,0x0109}, /* 0108 */ + {0x010A,0x010B},{0x010A,0x010B}, /* 010A */ + {0x010C,0x010D},{0x010C,0x010D}, /* 010C */ + {0x010E,0x010F},{0x010E,0x010F}, /* 010E */ + {0x0110,0x0111},{0x0110,0x0111}, /* 0110 */ + {0x0112,0x0113},{0x0112,0x0113}, /* 0112 */ + {0x0114,0x0115},{0x0114,0x0115}, /* 0114 */ + {0x0116,0x0117},{0x0116,0x0117}, /* 0116 */ + {0x0118,0x0119},{0x0118,0x0119}, /* 0118 */ + {0x011A,0x011B},{0x011A,0x011B}, /* 011A */ + {0x011C,0x011D},{0x011C,0x011D}, /* 011C */ + {0x011E,0x011F},{0x011E,0x011F}, /* 011E */ + {0x0120,0x0121},{0x0120,0x0121}, /* 0120 */ + {0x0122,0x0123},{0x0122,0x0123}, /* 0122 */ + {0x0124,0x0125},{0x0124,0x0125}, /* 0124 */ + {0x0126,0x0127},{0x0126,0x0127}, /* 0126 */ + {0x0128,0x0129},{0x0128,0x0129}, /* 0128 */ + {0x012A,0x012B},{0x012A,0x012B}, /* 012A */ + {0x012C,0x012D},{0x012C,0x012D}, /* 012C */ + {0x012E,0x012F},{0x012E,0x012F}, /* 012E */ + {0x0130,0x0069},{0x0049,0x0131}, /* 0130 */ + {0x0132,0x0133},{0x0132,0x0133}, /* 0132 */ + {0x0134,0x0135},{0x0134,0x0135}, /* 0134 */ + {0x0136,0x0137},{0x0136,0x0137}, /* 0136 */ + {0x0138,0x0138},{0x0139,0x013A}, /* 0138 */ + {0x0139,0x013A},{0x013B,0x013C}, /* 013A */ + {0x013B,0x013C},{0x013D,0x013E}, /* 013C */ + {0x013D,0x013E},{0x013F,0x0140}, /* 013E */ + {0x013F,0x0140},{0x0141,0x0142}, /* 0140 */ + {0x0141,0x0142},{0x0143,0x0144}, /* 0142 */ + {0x0143,0x0144},{0x0145,0x0146}, /* 0144 */ + {0x0145,0x0146},{0x0147,0x0148}, /* 0146 */ + {0x0147,0x0148},{0x0149,0x0149}, /* 0148 */ + {0x014A,0x014B},{0x014A,0x014B}, /* 014A */ + {0x014C,0x014D},{0x014C,0x014D}, /* 014C */ + {0x014E,0x014F},{0x014E,0x014F}, /* 014E */ + {0x0150,0x0151},{0x0150,0x0151}, /* 0150 */ + {0x0152,0x0153},{0x0152,0x0153}, /* 0152 */ + {0x0154,0x0155},{0x0154,0x0155}, /* 0154 */ + {0x0156,0x0157},{0x0156,0x0157}, /* 0156 */ + {0x0158,0x0159},{0x0158,0x0159}, /* 0158 */ + {0x015A,0x015B},{0x015A,0x015B}, /* 015A */ + {0x015C,0x015D},{0x015C,0x015D}, /* 015C */ + {0x015E,0x015F},{0x015E,0x015F}, /* 015E */ + {0x0160,0x0161},{0x0160,0x0161}, /* 0160 */ + {0x0162,0x0163},{0x0162,0x0163}, /* 0162 */ + {0x0164,0x0165},{0x0164,0x0165}, /* 0164 */ + {0x0166,0x0167},{0x0166,0x0167}, /* 0166 */ + {0x0168,0x0169},{0x0168,0x0169}, /* 0168 */ + {0x016A,0x016B},{0x016A,0x016B}, /* 016A */ + {0x016C,0x016D},{0x016C,0x016D}, /* 016C */ + {0x016E,0x016F},{0x016E,0x016F}, /* 016E */ + {0x0170,0x0171},{0x0170,0x0171}, /* 0170 */ + {0x0172,0x0173},{0x0172,0x0173}, /* 0172 */ + {0x0174,0x0175},{0x0174,0x0175}, /* 0174 */ + {0x0176,0x0177},{0x0176,0x0177}, /* 0176 */ + {0x0178,0x00FF},{0x0179,0x017A}, /* 0178 */ + {0x0179,0x017A},{0x017B,0x017C}, /* 017A */ + {0x017B,0x017C},{0x017D,0x017E}, /* 017C */ + {0x017D,0x017E},{0x0053,0x017F}, /* 017E */ + {0x0243,0x0180},{0x0181,0x0253}, /* 0180 */ + {0x0182,0x0183},{0x0182,0x0183}, /* 0182 */ + {0x0184,0x0185},{0x0184,0x0185}, /* 0184 */ + {0x0186,0x0254},{0x0187,0x0188}, /* 0186 */ + {0x0187,0x0188},{0x0189,0x0256}, /* 0188 */ + {0x018A,0x0257},{0x018B,0x018C}, /* 018A */ + {0x018B,0x018C},{0x018D,0x018D}, /* 018C */ + {0x018E,0x01DD},{0x018F,0x0259}, /* 018E */ + {0x0190,0x025B},{0x0191,0x0192}, /* 0190 */ + {0x0191,0x0192},{0x0193,0x0260}, /* 0192 */ + {0x0194,0x0263},{0x01F6,0x0195}, /* 0194 */ + {0x0196,0x0269},{0x0197,0x0268}, /* 0196 */ + {0x0198,0x0199},{0x0198,0x0199}, /* 0198 */ + {0x023D,0x019A},{0x019B,0x019B}, /* 019A */ + {0x019C,0x026F},{0x019D,0x0272}, /* 019C */ + {0x0220,0x019E},{0x019F,0x0275}, /* 019E */ + {0x01A0,0x01A1},{0x01A0,0x01A1}, /* 01A0 */ + {0x01A2,0x01A3},{0x01A2,0x01A3}, /* 01A2 */ + {0x01A4,0x01A5},{0x01A4,0x01A5}, /* 01A4 */ + {0x01A6,0x0280},{0x01A7,0x01A8}, /* 01A6 */ + {0x01A7,0x01A8},{0x01A9,0x0283}, /* 01A8 */ + {0x01AA,0x01AA},{0x01AB,0x01AB}, /* 01AA */ + {0x01AC,0x01AD},{0x01AC,0x01AD}, /* 01AC */ + {0x01AE,0x0288},{0x01AF,0x01B0}, /* 01AE */ + {0x01AF,0x01B0},{0x01B1,0x028A}, /* 01B0 */ + {0x01B2,0x028B},{0x01B3,0x01B4}, /* 01B2 */ + {0x01B3,0x01B4},{0x01B5,0x01B6}, /* 01B4 */ + {0x01B5,0x01B6},{0x01B7,0x0292}, /* 01B6 */ + {0x01B8,0x01B9},{0x01B8,0x01B9}, /* 01B8 */ + {0x01BA,0x01BA},{0x01BB,0x01BB}, /* 01BA */ + {0x01BC,0x01BD},{0x01BC,0x01BD}, /* 01BC */ + {0x01BE,0x01BE},{0x01F7,0x01BF}, /* 01BE */ + {0x01C0,0x01C0},{0x01C1,0x01C1}, /* 01C0 */ + {0x01C2,0x01C2},{0x01C3,0x01C3}, /* 01C2 */ + {0x01C4,0x01C6},{0x01C4,0x01C6}, /* 01C4 */ + {0x01C4,0x01C6},{0x01C7,0x01C9}, /* 01C6 */ + {0x01C7,0x01C9},{0x01C7,0x01C9}, /* 01C8 */ + {0x01CA,0x01CC},{0x01CA,0x01CC}, /* 01CA */ + {0x01CA,0x01CC},{0x01CD,0x01CE}, /* 01CC */ + {0x01CD,0x01CE},{0x01CF,0x01D0}, /* 01CE */ + {0x01CF,0x01D0},{0x01D1,0x01D2}, /* 01D0 */ + {0x01D1,0x01D2},{0x01D3,0x01D4}, /* 01D2 */ + {0x01D3,0x01D4},{0x01D5,0x01D6}, /* 01D4 */ + {0x01D5,0x01D6},{0x01D7,0x01D8}, /* 01D6 */ + {0x01D7,0x01D8},{0x01D9,0x01DA}, /* 01D8 */ + {0x01D9,0x01DA},{0x01DB,0x01DC}, /* 01DA */ + {0x01DB,0x01DC},{0x018E,0x01DD}, /* 01DC */ + {0x01DE,0x01DF},{0x01DE,0x01DF}, /* 01DE */ + {0x01E0,0x01E1},{0x01E0,0x01E1}, /* 01E0 */ + {0x01E2,0x01E3},{0x01E2,0x01E3}, /* 01E2 */ + {0x01E4,0x01E5},{0x01E4,0x01E5}, /* 01E4 */ + {0x01E6,0x01E7},{0x01E6,0x01E7}, /* 01E6 */ + {0x01E8,0x01E9},{0x01E8,0x01E9}, /* 01E8 */ + {0x01EA,0x01EB},{0x01EA,0x01EB}, /* 01EA */ + {0x01EC,0x01ED},{0x01EC,0x01ED}, /* 01EC */ + {0x01EE,0x01EF},{0x01EE,0x01EF}, /* 01EE */ + {0x01F0,0x01F0},{0x01F1,0x01F3}, /* 01F0 */ + {0x01F1,0x01F3},{0x01F1,0x01F3}, /* 01F2 */ + {0x01F4,0x01F5},{0x01F4,0x01F5}, /* 01F4 */ + {0x01F6,0x0195},{0x01F7,0x01BF}, /* 01F6 */ + {0x01F8,0x01F9},{0x01F8,0x01F9}, /* 01F8 */ + {0x01FA,0x01FB},{0x01FA,0x01FB}, /* 01FA */ + {0x01FC,0x01FD},{0x01FC,0x01FD}, /* 01FC */ + {0x01FE,0x01FF},{0x01FE,0x01FF} /* 01FE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page02[256]={ + {0x0200,0x0201},{0x0200,0x0201}, /* 0200 */ + {0x0202,0x0203},{0x0202,0x0203}, /* 0202 */ + {0x0204,0x0205},{0x0204,0x0205}, /* 0204 */ + {0x0206,0x0207},{0x0206,0x0207}, /* 0206 */ + {0x0208,0x0209},{0x0208,0x0209}, /* 0208 */ + {0x020A,0x020B},{0x020A,0x020B}, /* 020A */ + {0x020C,0x020D},{0x020C,0x020D}, /* 020C */ + {0x020E,0x020F},{0x020E,0x020F}, /* 020E */ + {0x0210,0x0211},{0x0210,0x0211}, /* 0210 */ + {0x0212,0x0213},{0x0212,0x0213}, /* 0212 */ + {0x0214,0x0215},{0x0214,0x0215}, /* 0214 */ + {0x0216,0x0217},{0x0216,0x0217}, /* 0216 */ + {0x0218,0x0219},{0x0218,0x0219}, /* 0218 */ + {0x021A,0x021B},{0x021A,0x021B}, /* 021A */ + {0x021C,0x021D},{0x021C,0x021D}, /* 021C */ + {0x021E,0x021F},{0x021E,0x021F}, /* 021E */ + {0x0220,0x019E},{0x0221,0x0221}, /* 0220 */ + {0x0222,0x0223},{0x0222,0x0223}, /* 0222 */ + {0x0224,0x0225},{0x0224,0x0225}, /* 0224 */ + {0x0226,0x0227},{0x0226,0x0227}, /* 0226 */ + {0x0228,0x0229},{0x0228,0x0229}, /* 0228 */ + {0x022A,0x022B},{0x022A,0x022B}, /* 022A */ + {0x022C,0x022D},{0x022C,0x022D}, /* 022C */ + {0x022E,0x022F},{0x022E,0x022F}, /* 022E */ + {0x0230,0x0231},{0x0230,0x0231}, /* 0230 */ + {0x0232,0x0233},{0x0232,0x0233}, /* 0232 */ + {0x0234,0x0234},{0x0235,0x0235}, /* 0234 */ + {0x0236,0x0236},{0x0237,0x0237}, /* 0236 */ + {0x0238,0x0238},{0x0239,0x0239}, /* 0238 */ + {0x023A,0x2C65},{0x023B,0x023C}, /* 023A */ + {0x023B,0x023C},{0x023D,0x019A}, /* 023C */ + {0x023E,0x2C66},{0x2C7E,0x023F}, /* 023E */ + {0x2C7F,0x0240},{0x0241,0x0242}, /* 0240 */ + {0x0241,0x0242},{0x0243,0x0180}, /* 0242 */ + {0x0244,0x0289},{0x0245,0x028C}, /* 0244 */ + {0x0246,0x0247},{0x0246,0x0247}, /* 0246 */ + {0x0248,0x0249},{0x0248,0x0249}, /* 0248 */ + {0x024A,0x024B},{0x024A,0x024B}, /* 024A */ + {0x024C,0x024D},{0x024C,0x024D}, /* 024C */ + {0x024E,0x024F},{0x024E,0x024F}, /* 024E */ + {0x2C6F,0x0250},{0x2C6D,0x0251}, /* 0250 */ + {0x2C70,0x0252},{0x0181,0x0253}, /* 0252 */ + {0x0186,0x0254},{0x0255,0x0255}, /* 0254 */ + {0x0189,0x0256},{0x018A,0x0257}, /* 0256 */ + {0x0258,0x0258},{0x018F,0x0259}, /* 0258 */ + {0x025A,0x025A},{0x0190,0x025B}, /* 025A */ + {0xA7AB,0x025C},{0x025D,0x025D}, /* 025C */ + {0x025E,0x025E},{0x025F,0x025F}, /* 025E */ + {0x0193,0x0260},{0xA7AC,0x0261}, /* 0260 */ + {0x0262,0x0262},{0x0194,0x0263}, /* 0262 */ + {0x0264,0x0264},{0xA78D,0x0265}, /* 0264 */ + {0xA7AA,0x0266},{0x0267,0x0267}, /* 0266 */ + {0x0197,0x0268},{0x0196,0x0269}, /* 0268 */ + {0xA7AE,0x026A},{0x2C62,0x026B}, /* 026A */ + {0xA7AD,0x026C},{0x026D,0x026D}, /* 026C */ + {0x026E,0x026E},{0x019C,0x026F}, /* 026E */ + {0x0270,0x0270},{0x2C6E,0x0271}, /* 0270 */ + {0x019D,0x0272},{0x0273,0x0273}, /* 0272 */ + {0x0274,0x0274},{0x019F,0x0275}, /* 0274 */ + {0x0276,0x0276},{0x0277,0x0277}, /* 0276 */ + {0x0278,0x0278},{0x0279,0x0279}, /* 0278 */ + {0x027A,0x027A},{0x027B,0x027B}, /* 027A */ + {0x027C,0x027C},{0x2C64,0x027D}, /* 027C */ + {0x027E,0x027E},{0x027F,0x027F}, /* 027E */ + {0x01A6,0x0280},{0x0281,0x0281}, /* 0280 */ + {0xA7C5,0x0282},{0x01A9,0x0283}, /* 0282 */ + {0x0284,0x0284},{0x0285,0x0285}, /* 0284 */ + {0x0286,0x0286},{0xA7B1,0x0287}, /* 0286 */ + {0x01AE,0x0288},{0x0244,0x0289}, /* 0288 */ + {0x01B1,0x028A},{0x01B2,0x028B}, /* 028A */ + {0x0245,0x028C},{0x028D,0x028D}, /* 028C */ + {0x028E,0x028E},{0x028F,0x028F}, /* 028E */ + {0x0290,0x0290},{0x0291,0x0291}, /* 0290 */ + {0x01B7,0x0292},{0x0293,0x0293}, /* 0292 */ + {0x0294,0x0294},{0x0295,0x0295}, /* 0294 */ + {0x0296,0x0296},{0x0297,0x0297}, /* 0296 */ + {0x0298,0x0298},{0x0299,0x0299}, /* 0298 */ + {0x029A,0x029A},{0x029B,0x029B}, /* 029A */ + {0x029C,0x029C},{0xA7B2,0x029D}, /* 029C */ + {0xA7B0,0x029E},{0x029F,0x029F}, /* 029E */ + {0x02A0,0x02A0},{0x02A1,0x02A1}, /* 02A0 */ + {0x02A2,0x02A2},{0x02A3,0x02A3}, /* 02A2 */ + {0x02A4,0x02A4},{0x02A5,0x02A5}, /* 02A4 */ + {0x02A6,0x02A6},{0x02A7,0x02A7}, /* 02A6 */ + {0x02A8,0x02A8},{0x02A9,0x02A9}, /* 02A8 */ + {0x02AA,0x02AA},{0x02AB,0x02AB}, /* 02AA */ + {0x02AC,0x02AC},{0x02AD,0x02AD}, /* 02AC */ + {0x02AE,0x02AE},{0x02AF,0x02AF}, /* 02AE */ + {0x02B0,0x02B0},{0x02B1,0x02B1}, /* 02B0 */ + {0x02B2,0x02B2},{0x02B3,0x02B3}, /* 02B2 */ + {0x02B4,0x02B4},{0x02B5,0x02B5}, /* 02B4 */ + {0x02B6,0x02B6},{0x02B7,0x02B7}, /* 02B6 */ + {0x02B8,0x02B8},{0x02B9,0x02B9}, /* 02B8 */ + {0x02BA,0x02BA},{0x02BB,0x02BB}, /* 02BA */ + {0x02BC,0x02BC},{0x02BD,0x02BD}, /* 02BC */ + {0x02BE,0x02BE},{0x02BF,0x02BF}, /* 02BE */ + {0x02C0,0x02C0},{0x02C1,0x02C1}, /* 02C0 */ + {0x02C2,0x02C2},{0x02C3,0x02C3}, /* 02C2 */ + {0x02C4,0x02C4},{0x02C5,0x02C5}, /* 02C4 */ + {0x02C6,0x02C6},{0x02C7,0x02C7}, /* 02C6 */ + {0x02C8,0x02C8},{0x02C9,0x02C9}, /* 02C8 */ + {0x02CA,0x02CA},{0x02CB,0x02CB}, /* 02CA */ + {0x02CC,0x02CC},{0x02CD,0x02CD}, /* 02CC */ + {0x02CE,0x02CE},{0x02CF,0x02CF}, /* 02CE */ + {0x02D0,0x02D0},{0x02D1,0x02D1}, /* 02D0 */ + {0x02D2,0x02D2},{0x02D3,0x02D3}, /* 02D2 */ + {0x02D4,0x02D4},{0x02D5,0x02D5}, /* 02D4 */ + {0x02D6,0x02D6},{0x02D7,0x02D7}, /* 02D6 */ + {0x02D8,0x02D8},{0x02D9,0x02D9}, /* 02D8 */ + {0x02DA,0x02DA},{0x02DB,0x02DB}, /* 02DA */ + {0x02DC,0x02DC},{0x02DD,0x02DD}, /* 02DC */ + {0x02DE,0x02DE},{0x02DF,0x02DF}, /* 02DE */ + {0x02E0,0x02E0},{0x02E1,0x02E1}, /* 02E0 */ + {0x02E2,0x02E2},{0x02E3,0x02E3}, /* 02E2 */ + {0x02E4,0x02E4},{0x02E5,0x02E5}, /* 02E4 */ + {0x02E6,0x02E6},{0x02E7,0x02E7}, /* 02E6 */ + {0x02E8,0x02E8},{0x02E9,0x02E9}, /* 02E8 */ + {0x02EA,0x02EA},{0x02EB,0x02EB}, /* 02EA */ + {0x02EC,0x02EC},{0x02ED,0x02ED}, /* 02EC */ + {0x02EE,0x02EE},{0x02EF,0x02EF}, /* 02EE */ + {0x02F0,0x02F0},{0x02F1,0x02F1}, /* 02F0 */ + {0x02F2,0x02F2},{0x02F3,0x02F3}, /* 02F2 */ + {0x02F4,0x02F4},{0x02F5,0x02F5}, /* 02F4 */ + {0x02F6,0x02F6},{0x02F7,0x02F7}, /* 02F6 */ + {0x02F8,0x02F8},{0x02F9,0x02F9}, /* 02F8 */ + {0x02FA,0x02FA},{0x02FB,0x02FB}, /* 02FA */ + {0x02FC,0x02FC},{0x02FD,0x02FD}, /* 02FC */ + {0x02FE,0x02FE},{0x02FF,0x02FF} /* 02FE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page03[256]={ + {0x0300,0x0300},{0x0301,0x0301}, /* 0300 */ + {0x0302,0x0302},{0x0303,0x0303}, /* 0302 */ + {0x0304,0x0304},{0x0305,0x0305}, /* 0304 */ + {0x0306,0x0306},{0x0307,0x0307}, /* 0306 */ + {0x0308,0x0308},{0x0309,0x0309}, /* 0308 */ + {0x030A,0x030A},{0x030B,0x030B}, /* 030A */ + {0x030C,0x030C},{0x030D,0x030D}, /* 030C */ + {0x030E,0x030E},{0x030F,0x030F}, /* 030E */ + {0x0310,0x0310},{0x0311,0x0311}, /* 0310 */ + {0x0312,0x0312},{0x0313,0x0313}, /* 0312 */ + {0x0314,0x0314},{0x0315,0x0315}, /* 0314 */ + {0x0316,0x0316},{0x0317,0x0317}, /* 0316 */ + {0x0318,0x0318},{0x0319,0x0319}, /* 0318 */ + {0x031A,0x031A},{0x031B,0x031B}, /* 031A */ + {0x031C,0x031C},{0x031D,0x031D}, /* 031C */ + {0x031E,0x031E},{0x031F,0x031F}, /* 031E */ + {0x0320,0x0320},{0x0321,0x0321}, /* 0320 */ + {0x0322,0x0322},{0x0323,0x0323}, /* 0322 */ + {0x0324,0x0324},{0x0325,0x0325}, /* 0324 */ + {0x0326,0x0326},{0x0327,0x0327}, /* 0326 */ + {0x0328,0x0328},{0x0329,0x0329}, /* 0328 */ + {0x032A,0x032A},{0x032B,0x032B}, /* 032A */ + {0x032C,0x032C},{0x032D,0x032D}, /* 032C */ + {0x032E,0x032E},{0x032F,0x032F}, /* 032E */ + {0x0330,0x0330},{0x0331,0x0331}, /* 0330 */ + {0x0332,0x0332},{0x0333,0x0333}, /* 0332 */ + {0x0334,0x0334},{0x0335,0x0335}, /* 0334 */ + {0x0336,0x0336},{0x0337,0x0337}, /* 0336 */ + {0x0338,0x0338},{0x0339,0x0339}, /* 0338 */ + {0x033A,0x033A},{0x033B,0x033B}, /* 033A */ + {0x033C,0x033C},{0x033D,0x033D}, /* 033C */ + {0x033E,0x033E},{0x033F,0x033F}, /* 033E */ + {0x0340,0x0340},{0x0341,0x0341}, /* 0340 */ + {0x0342,0x0342},{0x0343,0x0343}, /* 0342 */ + {0x0344,0x0344},{0x0399,0x0345}, /* 0344 */ + {0x0346,0x0346},{0x0347,0x0347}, /* 0346 */ + {0x0348,0x0348},{0x0349,0x0349}, /* 0348 */ + {0x034A,0x034A},{0x034B,0x034B}, /* 034A */ + {0x034C,0x034C},{0x034D,0x034D}, /* 034C */ + {0x034E,0x034E},{0x034F,0x034F}, /* 034E */ + {0x0350,0x0350},{0x0351,0x0351}, /* 0350 */ + {0x0352,0x0352},{0x0353,0x0353}, /* 0352 */ + {0x0354,0x0354},{0x0355,0x0355}, /* 0354 */ + {0x0356,0x0356},{0x0357,0x0357}, /* 0356 */ + {0x0358,0x0358},{0x0359,0x0359}, /* 0358 */ + {0x035A,0x035A},{0x035B,0x035B}, /* 035A */ + {0x035C,0x035C},{0x035D,0x035D}, /* 035C */ + {0x035E,0x035E},{0x035F,0x035F}, /* 035E */ + {0x0360,0x0360},{0x0361,0x0361}, /* 0360 */ + {0x0362,0x0362},{0x0363,0x0363}, /* 0362 */ + {0x0364,0x0364},{0x0365,0x0365}, /* 0364 */ + {0x0366,0x0366},{0x0367,0x0367}, /* 0366 */ + {0x0368,0x0368},{0x0369,0x0369}, /* 0368 */ + {0x036A,0x036A},{0x036B,0x036B}, /* 036A */ + {0x036C,0x036C},{0x036D,0x036D}, /* 036C */ + {0x036E,0x036E},{0x036F,0x036F}, /* 036E */ + {0x0370,0x0371},{0x0370,0x0371}, /* 0370 */ + {0x0372,0x0373},{0x0372,0x0373}, /* 0372 */ + {0x0374,0x0374},{0x0375,0x0375}, /* 0374 */ + {0x0376,0x0377},{0x0376,0x0377}, /* 0376 */ + {0x0378,0x0378},{0x0379,0x0379}, /* 0378 */ + {0x037A,0x037A},{0x03FD,0x037B}, /* 037A */ + {0x03FE,0x037C},{0x03FF,0x037D}, /* 037C */ + {0x037E,0x037E},{0x037F,0x03F3}, /* 037E */ + {0x0380,0x0380},{0x0381,0x0381}, /* 0380 */ + {0x0382,0x0382},{0x0383,0x0383}, /* 0382 */ + {0x0384,0x0384},{0x0385,0x0385}, /* 0384 */ + {0x0386,0x03AC},{0x0387,0x0387}, /* 0386 */ + {0x0388,0x03AD},{0x0389,0x03AE}, /* 0388 */ + {0x038A,0x03AF},{0x038B,0x038B}, /* 038A */ + {0x038C,0x03CC},{0x038D,0x038D}, /* 038C */ + {0x038E,0x03CD},{0x038F,0x03CE}, /* 038E */ + {0x0390,0x0390},{0x0391,0x03B1}, /* 0390 */ + {0x0392,0x03B2},{0x0393,0x03B3}, /* 0392 */ + {0x0394,0x03B4},{0x0395,0x03B5}, /* 0394 */ + {0x0396,0x03B6},{0x0397,0x03B7}, /* 0396 */ + {0x0398,0x03B8},{0x0399,0x03B9}, /* 0398 */ + {0x039A,0x03BA},{0x039B,0x03BB}, /* 039A */ + {0x039C,0x03BC},{0x039D,0x03BD}, /* 039C */ + {0x039E,0x03BE},{0x039F,0x03BF}, /* 039E */ + {0x03A0,0x03C0},{0x03A1,0x03C1}, /* 03A0 */ + {0x03A2,0x03A2},{0x03A3,0x03C3}, /* 03A2 */ + {0x03A4,0x03C4},{0x03A5,0x03C5}, /* 03A4 */ + {0x03A6,0x03C6},{0x03A7,0x03C7}, /* 03A6 */ + {0x03A8,0x03C8},{0x03A9,0x03C9}, /* 03A8 */ + {0x03AA,0x03CA},{0x03AB,0x03CB}, /* 03AA */ + {0x0386,0x03AC},{0x0388,0x03AD}, /* 03AC */ + {0x0389,0x03AE},{0x038A,0x03AF}, /* 03AE */ + {0x03B0,0x03B0},{0x0391,0x03B1}, /* 03B0 */ + {0x0392,0x03B2},{0x0393,0x03B3}, /* 03B2 */ + {0x0394,0x03B4},{0x0395,0x03B5}, /* 03B4 */ + {0x0396,0x03B6},{0x0397,0x03B7}, /* 03B6 */ + {0x0398,0x03B8},{0x0399,0x03B9}, /* 03B8 */ + {0x039A,0x03BA},{0x039B,0x03BB}, /* 03BA */ + {0x039C,0x03BC},{0x039D,0x03BD}, /* 03BC */ + {0x039E,0x03BE},{0x039F,0x03BF}, /* 03BE */ + {0x03A0,0x03C0},{0x03A1,0x03C1}, /* 03C0 */ + {0x03A3,0x03C2},{0x03A3,0x03C3}, /* 03C2 */ + {0x03A4,0x03C4},{0x03A5,0x03C5}, /* 03C4 */ + {0x03A6,0x03C6},{0x03A7,0x03C7}, /* 03C6 */ + {0x03A8,0x03C8},{0x03A9,0x03C9}, /* 03C8 */ + {0x03AA,0x03CA},{0x03AB,0x03CB}, /* 03CA */ + {0x038C,0x03CC},{0x038E,0x03CD}, /* 03CC */ + {0x038F,0x03CE},{0x03CF,0x03D7}, /* 03CE */ + {0x0392,0x03D0},{0x0398,0x03D1}, /* 03D0 */ + {0x03D2,0x03D2},{0x03D3,0x03D3}, /* 03D2 */ + {0x03D4,0x03D4},{0x03A6,0x03D5}, /* 03D4 */ + {0x03A0,0x03D6},{0x03CF,0x03D7}, /* 03D6 */ + {0x03D8,0x03D9},{0x03D8,0x03D9}, /* 03D8 */ + {0x03DA,0x03DB},{0x03DA,0x03DB}, /* 03DA */ + {0x03DC,0x03DD},{0x03DC,0x03DD}, /* 03DC */ + {0x03DE,0x03DF},{0x03DE,0x03DF}, /* 03DE */ + {0x03E0,0x03E1},{0x03E0,0x03E1}, /* 03E0 */ + {0x03E2,0x03E3},{0x03E2,0x03E3}, /* 03E2 */ + {0x03E4,0x03E5},{0x03E4,0x03E5}, /* 03E4 */ + {0x03E6,0x03E7},{0x03E6,0x03E7}, /* 03E6 */ + {0x03E8,0x03E9},{0x03E8,0x03E9}, /* 03E8 */ + {0x03EA,0x03EB},{0x03EA,0x03EB}, /* 03EA */ + {0x03EC,0x03ED},{0x03EC,0x03ED}, /* 03EC */ + {0x03EE,0x03EF},{0x03EE,0x03EF}, /* 03EE */ + {0x039A,0x03F0},{0x03A1,0x03F1}, /* 03F0 */ + {0x03F9,0x03F2},{0x037F,0x03F3}, /* 03F2 */ + {0x03F4,0x03B8},{0x0395,0x03F5}, /* 03F4 */ + {0x03F6,0x03F6},{0x03F7,0x03F8}, /* 03F6 */ + {0x03F7,0x03F8},{0x03F9,0x03F2}, /* 03F8 */ + {0x03FA,0x03FB},{0x03FA,0x03FB}, /* 03FA */ + {0x03FC,0x03FC},{0x03FD,0x037B}, /* 03FC */ + {0x03FE,0x037C},{0x03FF,0x037D} /* 03FE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page04[256]={ + {0x0400,0x0450},{0x0401,0x0451}, /* 0400 */ + {0x0402,0x0452},{0x0403,0x0453}, /* 0402 */ + {0x0404,0x0454},{0x0405,0x0455}, /* 0404 */ + {0x0406,0x0456},{0x0407,0x0457}, /* 0406 */ + {0x0408,0x0458},{0x0409,0x0459}, /* 0408 */ + {0x040A,0x045A},{0x040B,0x045B}, /* 040A */ + {0x040C,0x045C},{0x040D,0x045D}, /* 040C */ + {0x040E,0x045E},{0x040F,0x045F}, /* 040E */ + {0x0410,0x0430},{0x0411,0x0431}, /* 0410 */ + {0x0412,0x0432},{0x0413,0x0433}, /* 0412 */ + {0x0414,0x0434},{0x0415,0x0435}, /* 0414 */ + {0x0416,0x0436},{0x0417,0x0437}, /* 0416 */ + {0x0418,0x0438},{0x0419,0x0439}, /* 0418 */ + {0x041A,0x043A},{0x041B,0x043B}, /* 041A */ + {0x041C,0x043C},{0x041D,0x043D}, /* 041C */ + {0x041E,0x043E},{0x041F,0x043F}, /* 041E */ + {0x0420,0x0440},{0x0421,0x0441}, /* 0420 */ + {0x0422,0x0442},{0x0423,0x0443}, /* 0422 */ + {0x0424,0x0444},{0x0425,0x0445}, /* 0424 */ + {0x0426,0x0446},{0x0427,0x0447}, /* 0426 */ + {0x0428,0x0448},{0x0429,0x0449}, /* 0428 */ + {0x042A,0x044A},{0x042B,0x044B}, /* 042A */ + {0x042C,0x044C},{0x042D,0x044D}, /* 042C */ + {0x042E,0x044E},{0x042F,0x044F}, /* 042E */ + {0x0410,0x0430},{0x0411,0x0431}, /* 0430 */ + {0x0412,0x0432},{0x0413,0x0433}, /* 0432 */ + {0x0414,0x0434},{0x0415,0x0435}, /* 0434 */ + {0x0416,0x0436},{0x0417,0x0437}, /* 0436 */ + {0x0418,0x0438},{0x0419,0x0439}, /* 0438 */ + {0x041A,0x043A},{0x041B,0x043B}, /* 043A */ + {0x041C,0x043C},{0x041D,0x043D}, /* 043C */ + {0x041E,0x043E},{0x041F,0x043F}, /* 043E */ + {0x0420,0x0440},{0x0421,0x0441}, /* 0440 */ + {0x0422,0x0442},{0x0423,0x0443}, /* 0442 */ + {0x0424,0x0444},{0x0425,0x0445}, /* 0444 */ + {0x0426,0x0446},{0x0427,0x0447}, /* 0446 */ + {0x0428,0x0448},{0x0429,0x0449}, /* 0448 */ + {0x042A,0x044A},{0x042B,0x044B}, /* 044A */ + {0x042C,0x044C},{0x042D,0x044D}, /* 044C */ + {0x042E,0x044E},{0x042F,0x044F}, /* 044E */ + {0x0400,0x0450},{0x0401,0x0451}, /* 0450 */ + {0x0402,0x0452},{0x0403,0x0453}, /* 0452 */ + {0x0404,0x0454},{0x0405,0x0455}, /* 0454 */ + {0x0406,0x0456},{0x0407,0x0457}, /* 0456 */ + {0x0408,0x0458},{0x0409,0x0459}, /* 0458 */ + {0x040A,0x045A},{0x040B,0x045B}, /* 045A */ + {0x040C,0x045C},{0x040D,0x045D}, /* 045C */ + {0x040E,0x045E},{0x040F,0x045F}, /* 045E */ + {0x0460,0x0461},{0x0460,0x0461}, /* 0460 */ + {0x0462,0x0463},{0x0462,0x0463}, /* 0462 */ + {0x0464,0x0465},{0x0464,0x0465}, /* 0464 */ + {0x0466,0x0467},{0x0466,0x0467}, /* 0466 */ + {0x0468,0x0469},{0x0468,0x0469}, /* 0468 */ + {0x046A,0x046B},{0x046A,0x046B}, /* 046A */ + {0x046C,0x046D},{0x046C,0x046D}, /* 046C */ + {0x046E,0x046F},{0x046E,0x046F}, /* 046E */ + {0x0470,0x0471},{0x0470,0x0471}, /* 0470 */ + {0x0472,0x0473},{0x0472,0x0473}, /* 0472 */ + {0x0474,0x0475},{0x0474,0x0475}, /* 0474 */ + {0x0476,0x0477},{0x0476,0x0477}, /* 0476 */ + {0x0478,0x0479},{0x0478,0x0479}, /* 0478 */ + {0x047A,0x047B},{0x047A,0x047B}, /* 047A */ + {0x047C,0x047D},{0x047C,0x047D}, /* 047C */ + {0x047E,0x047F},{0x047E,0x047F}, /* 047E */ + {0x0480,0x0481},{0x0480,0x0481}, /* 0480 */ + {0x0482,0x0482},{0x0483,0x0483}, /* 0482 */ + {0x0484,0x0484},{0x0485,0x0485}, /* 0484 */ + {0x0486,0x0486},{0x0487,0x0487}, /* 0486 */ + {0x0488,0x0488},{0x0489,0x0489}, /* 0488 */ + {0x048A,0x048B},{0x048A,0x048B}, /* 048A */ + {0x048C,0x048D},{0x048C,0x048D}, /* 048C */ + {0x048E,0x048F},{0x048E,0x048F}, /* 048E */ + {0x0490,0x0491},{0x0490,0x0491}, /* 0490 */ + {0x0492,0x0493},{0x0492,0x0493}, /* 0492 */ + {0x0494,0x0495},{0x0494,0x0495}, /* 0494 */ + {0x0496,0x0497},{0x0496,0x0497}, /* 0496 */ + {0x0498,0x0499},{0x0498,0x0499}, /* 0498 */ + {0x049A,0x049B},{0x049A,0x049B}, /* 049A */ + {0x049C,0x049D},{0x049C,0x049D}, /* 049C */ + {0x049E,0x049F},{0x049E,0x049F}, /* 049E */ + {0x04A0,0x04A1},{0x04A0,0x04A1}, /* 04A0 */ + {0x04A2,0x04A3},{0x04A2,0x04A3}, /* 04A2 */ + {0x04A4,0x04A5},{0x04A4,0x04A5}, /* 04A4 */ + {0x04A6,0x04A7},{0x04A6,0x04A7}, /* 04A6 */ + {0x04A8,0x04A9},{0x04A8,0x04A9}, /* 04A8 */ + {0x04AA,0x04AB},{0x04AA,0x04AB}, /* 04AA */ + {0x04AC,0x04AD},{0x04AC,0x04AD}, /* 04AC */ + {0x04AE,0x04AF},{0x04AE,0x04AF}, /* 04AE */ + {0x04B0,0x04B1},{0x04B0,0x04B1}, /* 04B0 */ + {0x04B2,0x04B3},{0x04B2,0x04B3}, /* 04B2 */ + {0x04B4,0x04B5},{0x04B4,0x04B5}, /* 04B4 */ + {0x04B6,0x04B7},{0x04B6,0x04B7}, /* 04B6 */ + {0x04B8,0x04B9},{0x04B8,0x04B9}, /* 04B8 */ + {0x04BA,0x04BB},{0x04BA,0x04BB}, /* 04BA */ + {0x04BC,0x04BD},{0x04BC,0x04BD}, /* 04BC */ + {0x04BE,0x04BF},{0x04BE,0x04BF}, /* 04BE */ + {0x04C0,0x04CF},{0x04C1,0x04C2}, /* 04C0 */ + {0x04C1,0x04C2},{0x04C3,0x04C4}, /* 04C2 */ + {0x04C3,0x04C4},{0x04C5,0x04C6}, /* 04C4 */ + {0x04C5,0x04C6},{0x04C7,0x04C8}, /* 04C6 */ + {0x04C7,0x04C8},{0x04C9,0x04CA}, /* 04C8 */ + {0x04C9,0x04CA},{0x04CB,0x04CC}, /* 04CA */ + {0x04CB,0x04CC},{0x04CD,0x04CE}, /* 04CC */ + {0x04CD,0x04CE},{0x04C0,0x04CF}, /* 04CE */ + {0x04D0,0x04D1},{0x04D0,0x04D1}, /* 04D0 */ + {0x04D2,0x04D3},{0x04D2,0x04D3}, /* 04D2 */ + {0x04D4,0x04D5},{0x04D4,0x04D5}, /* 04D4 */ + {0x04D6,0x04D7},{0x04D6,0x04D7}, /* 04D6 */ + {0x04D8,0x04D9},{0x04D8,0x04D9}, /* 04D8 */ + {0x04DA,0x04DB},{0x04DA,0x04DB}, /* 04DA */ + {0x04DC,0x04DD},{0x04DC,0x04DD}, /* 04DC */ + {0x04DE,0x04DF},{0x04DE,0x04DF}, /* 04DE */ + {0x04E0,0x04E1},{0x04E0,0x04E1}, /* 04E0 */ + {0x04E2,0x04E3},{0x04E2,0x04E3}, /* 04E2 */ + {0x04E4,0x04E5},{0x04E4,0x04E5}, /* 04E4 */ + {0x04E6,0x04E7},{0x04E6,0x04E7}, /* 04E6 */ + {0x04E8,0x04E9},{0x04E8,0x04E9}, /* 04E8 */ + {0x04EA,0x04EB},{0x04EA,0x04EB}, /* 04EA */ + {0x04EC,0x04ED},{0x04EC,0x04ED}, /* 04EC */ + {0x04EE,0x04EF},{0x04EE,0x04EF}, /* 04EE */ + {0x04F0,0x04F1},{0x04F0,0x04F1}, /* 04F0 */ + {0x04F2,0x04F3},{0x04F2,0x04F3}, /* 04F2 */ + {0x04F4,0x04F5},{0x04F4,0x04F5}, /* 04F4 */ + {0x04F6,0x04F7},{0x04F6,0x04F7}, /* 04F6 */ + {0x04F8,0x04F9},{0x04F8,0x04F9}, /* 04F8 */ + {0x04FA,0x04FB},{0x04FA,0x04FB}, /* 04FA */ + {0x04FC,0x04FD},{0x04FC,0x04FD}, /* 04FC */ + {0x04FE,0x04FF},{0x04FE,0x04FF} /* 04FE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page05[256]={ + {0x0500,0x0501},{0x0500,0x0501}, /* 0500 */ + {0x0502,0x0503},{0x0502,0x0503}, /* 0502 */ + {0x0504,0x0505},{0x0504,0x0505}, /* 0504 */ + {0x0506,0x0507},{0x0506,0x0507}, /* 0506 */ + {0x0508,0x0509},{0x0508,0x0509}, /* 0508 */ + {0x050A,0x050B},{0x050A,0x050B}, /* 050A */ + {0x050C,0x050D},{0x050C,0x050D}, /* 050C */ + {0x050E,0x050F},{0x050E,0x050F}, /* 050E */ + {0x0510,0x0511},{0x0510,0x0511}, /* 0510 */ + {0x0512,0x0513},{0x0512,0x0513}, /* 0512 */ + {0x0514,0x0515},{0x0514,0x0515}, /* 0514 */ + {0x0516,0x0517},{0x0516,0x0517}, /* 0516 */ + {0x0518,0x0519},{0x0518,0x0519}, /* 0518 */ + {0x051A,0x051B},{0x051A,0x051B}, /* 051A */ + {0x051C,0x051D},{0x051C,0x051D}, /* 051C */ + {0x051E,0x051F},{0x051E,0x051F}, /* 051E */ + {0x0520,0x0521},{0x0520,0x0521}, /* 0520 */ + {0x0522,0x0523},{0x0522,0x0523}, /* 0522 */ + {0x0524,0x0525},{0x0524,0x0525}, /* 0524 */ + {0x0526,0x0527},{0x0526,0x0527}, /* 0526 */ + {0x0528,0x0529},{0x0528,0x0529}, /* 0528 */ + {0x052A,0x052B},{0x052A,0x052B}, /* 052A */ + {0x052C,0x052D},{0x052C,0x052D}, /* 052C */ + {0x052E,0x052F},{0x052E,0x052F}, /* 052E */ + {0x0530,0x0530},{0x0531,0x0561}, /* 0530 */ + {0x0532,0x0562},{0x0533,0x0563}, /* 0532 */ + {0x0534,0x0564},{0x0535,0x0565}, /* 0534 */ + {0x0536,0x0566},{0x0537,0x0567}, /* 0536 */ + {0x0538,0x0568},{0x0539,0x0569}, /* 0538 */ + {0x053A,0x056A},{0x053B,0x056B}, /* 053A */ + {0x053C,0x056C},{0x053D,0x056D}, /* 053C */ + {0x053E,0x056E},{0x053F,0x056F}, /* 053E */ + {0x0540,0x0570},{0x0541,0x0571}, /* 0540 */ + {0x0542,0x0572},{0x0543,0x0573}, /* 0542 */ + {0x0544,0x0574},{0x0545,0x0575}, /* 0544 */ + {0x0546,0x0576},{0x0547,0x0577}, /* 0546 */ + {0x0548,0x0578},{0x0549,0x0579}, /* 0548 */ + {0x054A,0x057A},{0x054B,0x057B}, /* 054A */ + {0x054C,0x057C},{0x054D,0x057D}, /* 054C */ + {0x054E,0x057E},{0x054F,0x057F}, /* 054E */ + {0x0550,0x0580},{0x0551,0x0581}, /* 0550 */ + {0x0552,0x0582},{0x0553,0x0583}, /* 0552 */ + {0x0554,0x0584},{0x0555,0x0585}, /* 0554 */ + {0x0556,0x0586},{0x0557,0x0557}, /* 0556 */ + {0x0558,0x0558},{0x0559,0x0559}, /* 0558 */ + {0x055A,0x055A},{0x055B,0x055B}, /* 055A */ + {0x055C,0x055C},{0x055D,0x055D}, /* 055C */ + {0x055E,0x055E},{0x055F,0x055F}, /* 055E */ + {0x0560,0x0560},{0x0531,0x0561}, /* 0560 */ + {0x0532,0x0562},{0x0533,0x0563}, /* 0562 */ + {0x0534,0x0564},{0x0535,0x0565}, /* 0564 */ + {0x0536,0x0566},{0x0537,0x0567}, /* 0566 */ + {0x0538,0x0568},{0x0539,0x0569}, /* 0568 */ + {0x053A,0x056A},{0x053B,0x056B}, /* 056A */ + {0x053C,0x056C},{0x053D,0x056D}, /* 056C */ + {0x053E,0x056E},{0x053F,0x056F}, /* 056E */ + {0x0540,0x0570},{0x0541,0x0571}, /* 0570 */ + {0x0542,0x0572},{0x0543,0x0573}, /* 0572 */ + {0x0544,0x0574},{0x0545,0x0575}, /* 0574 */ + {0x0546,0x0576},{0x0547,0x0577}, /* 0576 */ + {0x0548,0x0578},{0x0549,0x0579}, /* 0578 */ + {0x054A,0x057A},{0x054B,0x057B}, /* 057A */ + {0x054C,0x057C},{0x054D,0x057D}, /* 057C */ + {0x054E,0x057E},{0x054F,0x057F}, /* 057E */ + {0x0550,0x0580},{0x0551,0x0581}, /* 0580 */ + {0x0552,0x0582},{0x0553,0x0583}, /* 0582 */ + {0x0554,0x0584},{0x0555,0x0585}, /* 0584 */ + {0x0556,0x0586},{0x0587,0x0587}, /* 0586 */ + {0x0588,0x0588},{0x0589,0x0589}, /* 0588 */ + {0x058A,0x058A},{0x058B,0x058B}, /* 058A */ + {0x058C,0x058C},{0x058D,0x058D}, /* 058C */ + {0x058E,0x058E},{0x058F,0x058F}, /* 058E */ + {0x0590,0x0590},{0x0591,0x0591}, /* 0590 */ + {0x0592,0x0592},{0x0593,0x0593}, /* 0592 */ + {0x0594,0x0594},{0x0595,0x0595}, /* 0594 */ + {0x0596,0x0596},{0x0597,0x0597}, /* 0596 */ + {0x0598,0x0598},{0x0599,0x0599}, /* 0598 */ + {0x059A,0x059A},{0x059B,0x059B}, /* 059A */ + {0x059C,0x059C},{0x059D,0x059D}, /* 059C */ + {0x059E,0x059E},{0x059F,0x059F}, /* 059E */ + {0x05A0,0x05A0},{0x05A1,0x05A1}, /* 05A0 */ + {0x05A2,0x05A2},{0x05A3,0x05A3}, /* 05A2 */ + {0x05A4,0x05A4},{0x05A5,0x05A5}, /* 05A4 */ + {0x05A6,0x05A6},{0x05A7,0x05A7}, /* 05A6 */ + {0x05A8,0x05A8},{0x05A9,0x05A9}, /* 05A8 */ + {0x05AA,0x05AA},{0x05AB,0x05AB}, /* 05AA */ + {0x05AC,0x05AC},{0x05AD,0x05AD}, /* 05AC */ + {0x05AE,0x05AE},{0x05AF,0x05AF}, /* 05AE */ + {0x05B0,0x05B0},{0x05B1,0x05B1}, /* 05B0 */ + {0x05B2,0x05B2},{0x05B3,0x05B3}, /* 05B2 */ + {0x05B4,0x05B4},{0x05B5,0x05B5}, /* 05B4 */ + {0x05B6,0x05B6},{0x05B7,0x05B7}, /* 05B6 */ + {0x05B8,0x05B8},{0x05B9,0x05B9}, /* 05B8 */ + {0x05BA,0x05BA},{0x05BB,0x05BB}, /* 05BA */ + {0x05BC,0x05BC},{0x05BD,0x05BD}, /* 05BC */ + {0x05BE,0x05BE},{0x05BF,0x05BF}, /* 05BE */ + {0x05C0,0x05C0},{0x05C1,0x05C1}, /* 05C0 */ + {0x05C2,0x05C2},{0x05C3,0x05C3}, /* 05C2 */ + {0x05C4,0x05C4},{0x05C5,0x05C5}, /* 05C4 */ + {0x05C6,0x05C6},{0x05C7,0x05C7}, /* 05C6 */ + {0x05C8,0x05C8},{0x05C9,0x05C9}, /* 05C8 */ + {0x05CA,0x05CA},{0x05CB,0x05CB}, /* 05CA */ + {0x05CC,0x05CC},{0x05CD,0x05CD}, /* 05CC */ + {0x05CE,0x05CE},{0x05CF,0x05CF}, /* 05CE */ + {0x05D0,0x05D0},{0x05D1,0x05D1}, /* 05D0 */ + {0x05D2,0x05D2},{0x05D3,0x05D3}, /* 05D2 */ + {0x05D4,0x05D4},{0x05D5,0x05D5}, /* 05D4 */ + {0x05D6,0x05D6},{0x05D7,0x05D7}, /* 05D6 */ + {0x05D8,0x05D8},{0x05D9,0x05D9}, /* 05D8 */ + {0x05DA,0x05DA},{0x05DB,0x05DB}, /* 05DA */ + {0x05DC,0x05DC},{0x05DD,0x05DD}, /* 05DC */ + {0x05DE,0x05DE},{0x05DF,0x05DF}, /* 05DE */ + {0x05E0,0x05E0},{0x05E1,0x05E1}, /* 05E0 */ + {0x05E2,0x05E2},{0x05E3,0x05E3}, /* 05E2 */ + {0x05E4,0x05E4},{0x05E5,0x05E5}, /* 05E4 */ + {0x05E6,0x05E6},{0x05E7,0x05E7}, /* 05E6 */ + {0x05E8,0x05E8},{0x05E9,0x05E9}, /* 05E8 */ + {0x05EA,0x05EA},{0x05EB,0x05EB}, /* 05EA */ + {0x05EC,0x05EC},{0x05ED,0x05ED}, /* 05EC */ + {0x05EE,0x05EE},{0x05EF,0x05EF}, /* 05EE */ + {0x05F0,0x05F0},{0x05F1,0x05F1}, /* 05F0 */ + {0x05F2,0x05F2},{0x05F3,0x05F3}, /* 05F2 */ + {0x05F4,0x05F4},{0x05F5,0x05F5}, /* 05F4 */ + {0x05F6,0x05F6},{0x05F7,0x05F7}, /* 05F6 */ + {0x05F8,0x05F8},{0x05F9,0x05F9}, /* 05F8 */ + {0x05FA,0x05FA},{0x05FB,0x05FB}, /* 05FA */ + {0x05FC,0x05FC},{0x05FD,0x05FD}, /* 05FC */ + {0x05FE,0x05FE},{0x05FF,0x05FF} /* 05FE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page06[256]={ /* This page is dummy */ + {0x0600,0x0600},{0x0601,0x0601}, /* 0600 */ + {0x0602,0x0602},{0x0603,0x0603}, /* 0602 */ + {0x0604,0x0604},{0x0605,0x0605}, /* 0604 */ + {0x0606,0x0606},{0x0607,0x0607}, /* 0606 */ + {0x0608,0x0608},{0x0609,0x0609}, /* 0608 */ + {0x060A,0x060A},{0x060B,0x060B}, /* 060A */ + {0x060C,0x060C},{0x060D,0x060D}, /* 060C */ + {0x060E,0x060E},{0x060F,0x060F}, /* 060E */ + {0x0610,0x0610},{0x0611,0x0611}, /* 0610 */ + {0x0612,0x0612},{0x0613,0x0613}, /* 0612 */ + {0x0614,0x0614},{0x0615,0x0615}, /* 0614 */ + {0x0616,0x0616},{0x0617,0x0617}, /* 0616 */ + {0x0618,0x0618},{0x0619,0x0619}, /* 0618 */ + {0x061A,0x061A},{0x061B,0x061B}, /* 061A */ + {0x061C,0x061C},{0x061D,0x061D}, /* 061C */ + {0x061E,0x061E},{0x061F,0x061F}, /* 061E */ + {0x0620,0x0620},{0x0621,0x0621}, /* 0620 */ + {0x0622,0x0622},{0x0623,0x0623}, /* 0622 */ + {0x0624,0x0624},{0x0625,0x0625}, /* 0624 */ + {0x0626,0x0626},{0x0627,0x0627}, /* 0626 */ + {0x0628,0x0628},{0x0629,0x0629}, /* 0628 */ + {0x062A,0x062A},{0x062B,0x062B}, /* 062A */ + {0x062C,0x062C},{0x062D,0x062D}, /* 062C */ + {0x062E,0x062E},{0x062F,0x062F}, /* 062E */ + {0x0630,0x0630},{0x0631,0x0631}, /* 0630 */ + {0x0632,0x0632},{0x0633,0x0633}, /* 0632 */ + {0x0634,0x0634},{0x0635,0x0635}, /* 0634 */ + {0x0636,0x0636},{0x0637,0x0637}, /* 0636 */ + {0x0638,0x0638},{0x0639,0x0639}, /* 0638 */ + {0x063A,0x063A},{0x063B,0x063B}, /* 063A */ + {0x063C,0x063C},{0x063D,0x063D}, /* 063C */ + {0x063E,0x063E},{0x063F,0x063F}, /* 063E */ + {0x0640,0x0640},{0x0641,0x0641}, /* 0640 */ + {0x0642,0x0642},{0x0643,0x0643}, /* 0642 */ + {0x0644,0x0644},{0x0645,0x0645}, /* 0644 */ + {0x0646,0x0646},{0x0647,0x0647}, /* 0646 */ + {0x0648,0x0648},{0x0649,0x0649}, /* 0648 */ + {0x064A,0x064A},{0x064B,0x064B}, /* 064A */ + {0x064C,0x064C},{0x064D,0x064D}, /* 064C */ + {0x064E,0x064E},{0x064F,0x064F}, /* 064E */ + {0x0650,0x0650},{0x0651,0x0651}, /* 0650 */ + {0x0652,0x0652},{0x0653,0x0653}, /* 0652 */ + {0x0654,0x0654},{0x0655,0x0655}, /* 0654 */ + {0x0656,0x0656},{0x0657,0x0657}, /* 0656 */ + {0x0658,0x0658},{0x0659,0x0659}, /* 0658 */ + {0x065A,0x065A},{0x065B,0x065B}, /* 065A */ + {0x065C,0x065C},{0x065D,0x065D}, /* 065C */ + {0x065E,0x065E},{0x065F,0x065F}, /* 065E */ + {0x0660,0x0660},{0x0661,0x0661}, /* 0660 */ + {0x0662,0x0662},{0x0663,0x0663}, /* 0662 */ + {0x0664,0x0664},{0x0665,0x0665}, /* 0664 */ + {0x0666,0x0666},{0x0667,0x0667}, /* 0666 */ + {0x0668,0x0668},{0x0669,0x0669}, /* 0668 */ + {0x066A,0x066A},{0x066B,0x066B}, /* 066A */ + {0x066C,0x066C},{0x066D,0x066D}, /* 066C */ + {0x066E,0x066E},{0x066F,0x066F}, /* 066E */ + {0x0670,0x0670},{0x0671,0x0671}, /* 0670 */ + {0x0672,0x0672},{0x0673,0x0673}, /* 0672 */ + {0x0674,0x0674},{0x0675,0x0675}, /* 0674 */ + {0x0676,0x0676},{0x0677,0x0677}, /* 0676 */ + {0x0678,0x0678},{0x0679,0x0679}, /* 0678 */ + {0x067A,0x067A},{0x067B,0x067B}, /* 067A */ + {0x067C,0x067C},{0x067D,0x067D}, /* 067C */ + {0x067E,0x067E},{0x067F,0x067F}, /* 067E */ + {0x0680,0x0680},{0x0681,0x0681}, /* 0680 */ + {0x0682,0x0682},{0x0683,0x0683}, /* 0682 */ + {0x0684,0x0684},{0x0685,0x0685}, /* 0684 */ + {0x0686,0x0686},{0x0687,0x0687}, /* 0686 */ + {0x0688,0x0688},{0x0689,0x0689}, /* 0688 */ + {0x068A,0x068A},{0x068B,0x068B}, /* 068A */ + {0x068C,0x068C},{0x068D,0x068D}, /* 068C */ + {0x068E,0x068E},{0x068F,0x068F}, /* 068E */ + {0x0690,0x0690},{0x0691,0x0691}, /* 0690 */ + {0x0692,0x0692},{0x0693,0x0693}, /* 0692 */ + {0x0694,0x0694},{0x0695,0x0695}, /* 0694 */ + {0x0696,0x0696},{0x0697,0x0697}, /* 0696 */ + {0x0698,0x0698},{0x0699,0x0699}, /* 0698 */ + {0x069A,0x069A},{0x069B,0x069B}, /* 069A */ + {0x069C,0x069C},{0x069D,0x069D}, /* 069C */ + {0x069E,0x069E},{0x069F,0x069F}, /* 069E */ + {0x06A0,0x06A0},{0x06A1,0x06A1}, /* 06A0 */ + {0x06A2,0x06A2},{0x06A3,0x06A3}, /* 06A2 */ + {0x06A4,0x06A4},{0x06A5,0x06A5}, /* 06A4 */ + {0x06A6,0x06A6},{0x06A7,0x06A7}, /* 06A6 */ + {0x06A8,0x06A8},{0x06A9,0x06A9}, /* 06A8 */ + {0x06AA,0x06AA},{0x06AB,0x06AB}, /* 06AA */ + {0x06AC,0x06AC},{0x06AD,0x06AD}, /* 06AC */ + {0x06AE,0x06AE},{0x06AF,0x06AF}, /* 06AE */ + {0x06B0,0x06B0},{0x06B1,0x06B1}, /* 06B0 */ + {0x06B2,0x06B2},{0x06B3,0x06B3}, /* 06B2 */ + {0x06B4,0x06B4},{0x06B5,0x06B5}, /* 06B4 */ + {0x06B6,0x06B6},{0x06B7,0x06B7}, /* 06B6 */ + {0x06B8,0x06B8},{0x06B9,0x06B9}, /* 06B8 */ + {0x06BA,0x06BA},{0x06BB,0x06BB}, /* 06BA */ + {0x06BC,0x06BC},{0x06BD,0x06BD}, /* 06BC */ + {0x06BE,0x06BE},{0x06BF,0x06BF}, /* 06BE */ + {0x06C0,0x06C0},{0x06C1,0x06C1}, /* 06C0 */ + {0x06C2,0x06C2},{0x06C3,0x06C3}, /* 06C2 */ + {0x06C4,0x06C4},{0x06C5,0x06C5}, /* 06C4 */ + {0x06C6,0x06C6},{0x06C7,0x06C7}, /* 06C6 */ + {0x06C8,0x06C8},{0x06C9,0x06C9}, /* 06C8 */ + {0x06CA,0x06CA},{0x06CB,0x06CB}, /* 06CA */ + {0x06CC,0x06CC},{0x06CD,0x06CD}, /* 06CC */ + {0x06CE,0x06CE},{0x06CF,0x06CF}, /* 06CE */ + {0x06D0,0x06D0},{0x06D1,0x06D1}, /* 06D0 */ + {0x06D2,0x06D2},{0x06D3,0x06D3}, /* 06D2 */ + {0x06D4,0x06D4},{0x06D5,0x06D5}, /* 06D4 */ + {0x06D6,0x06D6},{0x06D7,0x06D7}, /* 06D6 */ + {0x06D8,0x06D8},{0x06D9,0x06D9}, /* 06D8 */ + {0x06DA,0x06DA},{0x06DB,0x06DB}, /* 06DA */ + {0x06DC,0x06DC},{0x06DD,0x06DD}, /* 06DC */ + {0x06DE,0x06DE},{0x06DF,0x06DF}, /* 06DE */ + {0x06E0,0x06E0},{0x06E1,0x06E1}, /* 06E0 */ + {0x06E2,0x06E2},{0x06E3,0x06E3}, /* 06E2 */ + {0x06E4,0x06E4},{0x06E5,0x06E5}, /* 06E4 */ + {0x06E6,0x06E6},{0x06E7,0x06E7}, /* 06E6 */ + {0x06E8,0x06E8},{0x06E9,0x06E9}, /* 06E8 */ + {0x06EA,0x06EA},{0x06EB,0x06EB}, /* 06EA */ + {0x06EC,0x06EC},{0x06ED,0x06ED}, /* 06EC */ + {0x06EE,0x06EE},{0x06EF,0x06EF}, /* 06EE */ + {0x06F0,0x06F0},{0x06F1,0x06F1}, /* 06F0 */ + {0x06F2,0x06F2},{0x06F3,0x06F3}, /* 06F2 */ + {0x06F4,0x06F4},{0x06F5,0x06F5}, /* 06F4 */ + {0x06F6,0x06F6},{0x06F7,0x06F7}, /* 06F6 */ + {0x06F8,0x06F8},{0x06F9,0x06F9}, /* 06F8 */ + {0x06FA,0x06FA},{0x06FB,0x06FB}, /* 06FA */ + {0x06FC,0x06FC},{0x06FD,0x06FD}, /* 06FC */ + {0x06FE,0x06FE},{0x06FF,0x06FF} /* 06FE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page07[256]={ /* This page is dummy */ + {0x0700,0x0700},{0x0701,0x0701}, /* 0700 */ + {0x0702,0x0702},{0x0703,0x0703}, /* 0702 */ + {0x0704,0x0704},{0x0705,0x0705}, /* 0704 */ + {0x0706,0x0706},{0x0707,0x0707}, /* 0706 */ + {0x0708,0x0708},{0x0709,0x0709}, /* 0708 */ + {0x070A,0x070A},{0x070B,0x070B}, /* 070A */ + {0x070C,0x070C},{0x070D,0x070D}, /* 070C */ + {0x070E,0x070E},{0x070F,0x070F}, /* 070E */ + {0x0710,0x0710},{0x0711,0x0711}, /* 0710 */ + {0x0712,0x0712},{0x0713,0x0713}, /* 0712 */ + {0x0714,0x0714},{0x0715,0x0715}, /* 0714 */ + {0x0716,0x0716},{0x0717,0x0717}, /* 0716 */ + {0x0718,0x0718},{0x0719,0x0719}, /* 0718 */ + {0x071A,0x071A},{0x071B,0x071B}, /* 071A */ + {0x071C,0x071C},{0x071D,0x071D}, /* 071C */ + {0x071E,0x071E},{0x071F,0x071F}, /* 071E */ + {0x0720,0x0720},{0x0721,0x0721}, /* 0720 */ + {0x0722,0x0722},{0x0723,0x0723}, /* 0722 */ + {0x0724,0x0724},{0x0725,0x0725}, /* 0724 */ + {0x0726,0x0726},{0x0727,0x0727}, /* 0726 */ + {0x0728,0x0728},{0x0729,0x0729}, /* 0728 */ + {0x072A,0x072A},{0x072B,0x072B}, /* 072A */ + {0x072C,0x072C},{0x072D,0x072D}, /* 072C */ + {0x072E,0x072E},{0x072F,0x072F}, /* 072E */ + {0x0730,0x0730},{0x0731,0x0731}, /* 0730 */ + {0x0732,0x0732},{0x0733,0x0733}, /* 0732 */ + {0x0734,0x0734},{0x0735,0x0735}, /* 0734 */ + {0x0736,0x0736},{0x0737,0x0737}, /* 0736 */ + {0x0738,0x0738},{0x0739,0x0739}, /* 0738 */ + {0x073A,0x073A},{0x073B,0x073B}, /* 073A */ + {0x073C,0x073C},{0x073D,0x073D}, /* 073C */ + {0x073E,0x073E},{0x073F,0x073F}, /* 073E */ + {0x0740,0x0740},{0x0741,0x0741}, /* 0740 */ + {0x0742,0x0742},{0x0743,0x0743}, /* 0742 */ + {0x0744,0x0744},{0x0745,0x0745}, /* 0744 */ + {0x0746,0x0746},{0x0747,0x0747}, /* 0746 */ + {0x0748,0x0748},{0x0749,0x0749}, /* 0748 */ + {0x074A,0x074A},{0x074B,0x074B}, /* 074A */ + {0x074C,0x074C},{0x074D,0x074D}, /* 074C */ + {0x074E,0x074E},{0x074F,0x074F}, /* 074E */ + {0x0750,0x0750},{0x0751,0x0751}, /* 0750 */ + {0x0752,0x0752},{0x0753,0x0753}, /* 0752 */ + {0x0754,0x0754},{0x0755,0x0755}, /* 0754 */ + {0x0756,0x0756},{0x0757,0x0757}, /* 0756 */ + {0x0758,0x0758},{0x0759,0x0759}, /* 0758 */ + {0x075A,0x075A},{0x075B,0x075B}, /* 075A */ + {0x075C,0x075C},{0x075D,0x075D}, /* 075C */ + {0x075E,0x075E},{0x075F,0x075F}, /* 075E */ + {0x0760,0x0760},{0x0761,0x0761}, /* 0760 */ + {0x0762,0x0762},{0x0763,0x0763}, /* 0762 */ + {0x0764,0x0764},{0x0765,0x0765}, /* 0764 */ + {0x0766,0x0766},{0x0767,0x0767}, /* 0766 */ + {0x0768,0x0768},{0x0769,0x0769}, /* 0768 */ + {0x076A,0x076A},{0x076B,0x076B}, /* 076A */ + {0x076C,0x076C},{0x076D,0x076D}, /* 076C */ + {0x076E,0x076E},{0x076F,0x076F}, /* 076E */ + {0x0770,0x0770},{0x0771,0x0771}, /* 0770 */ + {0x0772,0x0772},{0x0773,0x0773}, /* 0772 */ + {0x0774,0x0774},{0x0775,0x0775}, /* 0774 */ + {0x0776,0x0776},{0x0777,0x0777}, /* 0776 */ + {0x0778,0x0778},{0x0779,0x0779}, /* 0778 */ + {0x077A,0x077A},{0x077B,0x077B}, /* 077A */ + {0x077C,0x077C},{0x077D,0x077D}, /* 077C */ + {0x077E,0x077E},{0x077F,0x077F}, /* 077E */ + {0x0780,0x0780},{0x0781,0x0781}, /* 0780 */ + {0x0782,0x0782},{0x0783,0x0783}, /* 0782 */ + {0x0784,0x0784},{0x0785,0x0785}, /* 0784 */ + {0x0786,0x0786},{0x0787,0x0787}, /* 0786 */ + {0x0788,0x0788},{0x0789,0x0789}, /* 0788 */ + {0x078A,0x078A},{0x078B,0x078B}, /* 078A */ + {0x078C,0x078C},{0x078D,0x078D}, /* 078C */ + {0x078E,0x078E},{0x078F,0x078F}, /* 078E */ + {0x0790,0x0790},{0x0791,0x0791}, /* 0790 */ + {0x0792,0x0792},{0x0793,0x0793}, /* 0792 */ + {0x0794,0x0794},{0x0795,0x0795}, /* 0794 */ + {0x0796,0x0796},{0x0797,0x0797}, /* 0796 */ + {0x0798,0x0798},{0x0799,0x0799}, /* 0798 */ + {0x079A,0x079A},{0x079B,0x079B}, /* 079A */ + {0x079C,0x079C},{0x079D,0x079D}, /* 079C */ + {0x079E,0x079E},{0x079F,0x079F}, /* 079E */ + {0x07A0,0x07A0},{0x07A1,0x07A1}, /* 07A0 */ + {0x07A2,0x07A2},{0x07A3,0x07A3}, /* 07A2 */ + {0x07A4,0x07A4},{0x07A5,0x07A5}, /* 07A4 */ + {0x07A6,0x07A6},{0x07A7,0x07A7}, /* 07A6 */ + {0x07A8,0x07A8},{0x07A9,0x07A9}, /* 07A8 */ + {0x07AA,0x07AA},{0x07AB,0x07AB}, /* 07AA */ + {0x07AC,0x07AC},{0x07AD,0x07AD}, /* 07AC */ + {0x07AE,0x07AE},{0x07AF,0x07AF}, /* 07AE */ + {0x07B0,0x07B0},{0x07B1,0x07B1}, /* 07B0 */ + {0x07B2,0x07B2},{0x07B3,0x07B3}, /* 07B2 */ + {0x07B4,0x07B4},{0x07B5,0x07B5}, /* 07B4 */ + {0x07B6,0x07B6},{0x07B7,0x07B7}, /* 07B6 */ + {0x07B8,0x07B8},{0x07B9,0x07B9}, /* 07B8 */ + {0x07BA,0x07BA},{0x07BB,0x07BB}, /* 07BA */ + {0x07BC,0x07BC},{0x07BD,0x07BD}, /* 07BC */ + {0x07BE,0x07BE},{0x07BF,0x07BF}, /* 07BE */ + {0x07C0,0x07C0},{0x07C1,0x07C1}, /* 07C0 */ + {0x07C2,0x07C2},{0x07C3,0x07C3}, /* 07C2 */ + {0x07C4,0x07C4},{0x07C5,0x07C5}, /* 07C4 */ + {0x07C6,0x07C6},{0x07C7,0x07C7}, /* 07C6 */ + {0x07C8,0x07C8},{0x07C9,0x07C9}, /* 07C8 */ + {0x07CA,0x07CA},{0x07CB,0x07CB}, /* 07CA */ + {0x07CC,0x07CC},{0x07CD,0x07CD}, /* 07CC */ + {0x07CE,0x07CE},{0x07CF,0x07CF}, /* 07CE */ + {0x07D0,0x07D0},{0x07D1,0x07D1}, /* 07D0 */ + {0x07D2,0x07D2},{0x07D3,0x07D3}, /* 07D2 */ + {0x07D4,0x07D4},{0x07D5,0x07D5}, /* 07D4 */ + {0x07D6,0x07D6},{0x07D7,0x07D7}, /* 07D6 */ + {0x07D8,0x07D8},{0x07D9,0x07D9}, /* 07D8 */ + {0x07DA,0x07DA},{0x07DB,0x07DB}, /* 07DA */ + {0x07DC,0x07DC},{0x07DD,0x07DD}, /* 07DC */ + {0x07DE,0x07DE},{0x07DF,0x07DF}, /* 07DE */ + {0x07E0,0x07E0},{0x07E1,0x07E1}, /* 07E0 */ + {0x07E2,0x07E2},{0x07E3,0x07E3}, /* 07E2 */ + {0x07E4,0x07E4},{0x07E5,0x07E5}, /* 07E4 */ + {0x07E6,0x07E6},{0x07E7,0x07E7}, /* 07E6 */ + {0x07E8,0x07E8},{0x07E9,0x07E9}, /* 07E8 */ + {0x07EA,0x07EA},{0x07EB,0x07EB}, /* 07EA */ + {0x07EC,0x07EC},{0x07ED,0x07ED}, /* 07EC */ + {0x07EE,0x07EE},{0x07EF,0x07EF}, /* 07EE */ + {0x07F0,0x07F0},{0x07F1,0x07F1}, /* 07F0 */ + {0x07F2,0x07F2},{0x07F3,0x07F3}, /* 07F2 */ + {0x07F4,0x07F4},{0x07F5,0x07F5}, /* 07F4 */ + {0x07F6,0x07F6},{0x07F7,0x07F7}, /* 07F6 */ + {0x07F8,0x07F8},{0x07F9,0x07F9}, /* 07F8 */ + {0x07FA,0x07FA},{0x07FB,0x07FB}, /* 07FA */ + {0x07FC,0x07FC},{0x07FD,0x07FD}, /* 07FC */ + {0x07FE,0x07FE},{0x07FF,0x07FF} /* 07FE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page10[256]={ + {0x1000,0x1000},{0x1001,0x1001}, /* 1000 */ + {0x1002,0x1002},{0x1003,0x1003}, /* 1002 */ + {0x1004,0x1004},{0x1005,0x1005}, /* 1004 */ + {0x1006,0x1006},{0x1007,0x1007}, /* 1006 */ + {0x1008,0x1008},{0x1009,0x1009}, /* 1008 */ + {0x100A,0x100A},{0x100B,0x100B}, /* 100A */ + {0x100C,0x100C},{0x100D,0x100D}, /* 100C */ + {0x100E,0x100E},{0x100F,0x100F}, /* 100E */ + {0x1010,0x1010},{0x1011,0x1011}, /* 1010 */ + {0x1012,0x1012},{0x1013,0x1013}, /* 1012 */ + {0x1014,0x1014},{0x1015,0x1015}, /* 1014 */ + {0x1016,0x1016},{0x1017,0x1017}, /* 1016 */ + {0x1018,0x1018},{0x1019,0x1019}, /* 1018 */ + {0x101A,0x101A},{0x101B,0x101B}, /* 101A */ + {0x101C,0x101C},{0x101D,0x101D}, /* 101C */ + {0x101E,0x101E},{0x101F,0x101F}, /* 101E */ + {0x1020,0x1020},{0x1021,0x1021}, /* 1020 */ + {0x1022,0x1022},{0x1023,0x1023}, /* 1022 */ + {0x1024,0x1024},{0x1025,0x1025}, /* 1024 */ + {0x1026,0x1026},{0x1027,0x1027}, /* 1026 */ + {0x1028,0x1028},{0x1029,0x1029}, /* 1028 */ + {0x102A,0x102A},{0x102B,0x102B}, /* 102A */ + {0x102C,0x102C},{0x102D,0x102D}, /* 102C */ + {0x102E,0x102E},{0x102F,0x102F}, /* 102E */ + {0x1030,0x1030},{0x1031,0x1031}, /* 1030 */ + {0x1032,0x1032},{0x1033,0x1033}, /* 1032 */ + {0x1034,0x1034},{0x1035,0x1035}, /* 1034 */ + {0x1036,0x1036},{0x1037,0x1037}, /* 1036 */ + {0x1038,0x1038},{0x1039,0x1039}, /* 1038 */ + {0x103A,0x103A},{0x103B,0x103B}, /* 103A */ + {0x103C,0x103C},{0x103D,0x103D}, /* 103C */ + {0x103E,0x103E},{0x103F,0x103F}, /* 103E */ + {0x1040,0x1040},{0x1041,0x1041}, /* 1040 */ + {0x1042,0x1042},{0x1043,0x1043}, /* 1042 */ + {0x1044,0x1044},{0x1045,0x1045}, /* 1044 */ + {0x1046,0x1046},{0x1047,0x1047}, /* 1046 */ + {0x1048,0x1048},{0x1049,0x1049}, /* 1048 */ + {0x104A,0x104A},{0x104B,0x104B}, /* 104A */ + {0x104C,0x104C},{0x104D,0x104D}, /* 104C */ + {0x104E,0x104E},{0x104F,0x104F}, /* 104E */ + {0x1050,0x1050},{0x1051,0x1051}, /* 1050 */ + {0x1052,0x1052},{0x1053,0x1053}, /* 1052 */ + {0x1054,0x1054},{0x1055,0x1055}, /* 1054 */ + {0x1056,0x1056},{0x1057,0x1057}, /* 1056 */ + {0x1058,0x1058},{0x1059,0x1059}, /* 1058 */ + {0x105A,0x105A},{0x105B,0x105B}, /* 105A */ + {0x105C,0x105C},{0x105D,0x105D}, /* 105C */ + {0x105E,0x105E},{0x105F,0x105F}, /* 105E */ + {0x1060,0x1060},{0x1061,0x1061}, /* 1060 */ + {0x1062,0x1062},{0x1063,0x1063}, /* 1062 */ + {0x1064,0x1064},{0x1065,0x1065}, /* 1064 */ + {0x1066,0x1066},{0x1067,0x1067}, /* 1066 */ + {0x1068,0x1068},{0x1069,0x1069}, /* 1068 */ + {0x106A,0x106A},{0x106B,0x106B}, /* 106A */ + {0x106C,0x106C},{0x106D,0x106D}, /* 106C */ + {0x106E,0x106E},{0x106F,0x106F}, /* 106E */ + {0x1070,0x1070},{0x1071,0x1071}, /* 1070 */ + {0x1072,0x1072},{0x1073,0x1073}, /* 1072 */ + {0x1074,0x1074},{0x1075,0x1075}, /* 1074 */ + {0x1076,0x1076},{0x1077,0x1077}, /* 1076 */ + {0x1078,0x1078},{0x1079,0x1079}, /* 1078 */ + {0x107A,0x107A},{0x107B,0x107B}, /* 107A */ + {0x107C,0x107C},{0x107D,0x107D}, /* 107C */ + {0x107E,0x107E},{0x107F,0x107F}, /* 107E */ + {0x1080,0x1080},{0x1081,0x1081}, /* 1080 */ + {0x1082,0x1082},{0x1083,0x1083}, /* 1082 */ + {0x1084,0x1084},{0x1085,0x1085}, /* 1084 */ + {0x1086,0x1086},{0x1087,0x1087}, /* 1086 */ + {0x1088,0x1088},{0x1089,0x1089}, /* 1088 */ + {0x108A,0x108A},{0x108B,0x108B}, /* 108A */ + {0x108C,0x108C},{0x108D,0x108D}, /* 108C */ + {0x108E,0x108E},{0x108F,0x108F}, /* 108E */ + {0x1090,0x1090},{0x1091,0x1091}, /* 1090 */ + {0x1092,0x1092},{0x1093,0x1093}, /* 1092 */ + {0x1094,0x1094},{0x1095,0x1095}, /* 1094 */ + {0x1096,0x1096},{0x1097,0x1097}, /* 1096 */ + {0x1098,0x1098},{0x1099,0x1099}, /* 1098 */ + {0x109A,0x109A},{0x109B,0x109B}, /* 109A */ + {0x109C,0x109C},{0x109D,0x109D}, /* 109C */ + {0x109E,0x109E},{0x109F,0x109F}, /* 109E */ + {0x10A0,0x2D00},{0x10A1,0x2D01}, /* 10A0 */ + {0x10A2,0x2D02},{0x10A3,0x2D03}, /* 10A2 */ + {0x10A4,0x2D04},{0x10A5,0x2D05}, /* 10A4 */ + {0x10A6,0x2D06},{0x10A7,0x2D07}, /* 10A6 */ + {0x10A8,0x2D08},{0x10A9,0x2D09}, /* 10A8 */ + {0x10AA,0x2D0A},{0x10AB,0x2D0B}, /* 10AA */ + {0x10AC,0x2D0C},{0x10AD,0x2D0D}, /* 10AC */ + {0x10AE,0x2D0E},{0x10AF,0x2D0F}, /* 10AE */ + {0x10B0,0x2D10},{0x10B1,0x2D11}, /* 10B0 */ + {0x10B2,0x2D12},{0x10B3,0x2D13}, /* 10B2 */ + {0x10B4,0x2D14},{0x10B5,0x2D15}, /* 10B4 */ + {0x10B6,0x2D16},{0x10B7,0x2D17}, /* 10B6 */ + {0x10B8,0x2D18},{0x10B9,0x2D19}, /* 10B8 */ + {0x10BA,0x2D1A},{0x10BB,0x2D1B}, /* 10BA */ + {0x10BC,0x2D1C},{0x10BD,0x2D1D}, /* 10BC */ + {0x10BE,0x2D1E},{0x10BF,0x2D1F}, /* 10BE */ + {0x10C0,0x2D20},{0x10C1,0x2D21}, /* 10C0 */ + {0x10C2,0x2D22},{0x10C3,0x2D23}, /* 10C2 */ + {0x10C4,0x2D24},{0x10C5,0x2D25}, /* 10C4 */ + {0x10C6,0x10C6},{0x10C7,0x2D27}, /* 10C6 */ + {0x10C8,0x10C8},{0x10C9,0x10C9}, /* 10C8 */ + {0x10CA,0x10CA},{0x10CB,0x10CB}, /* 10CA */ + {0x10CC,0x10CC},{0x10CD,0x2D2D}, /* 10CC */ + {0x10CE,0x10CE},{0x10CF,0x10CF}, /* 10CE */ + {0x1C90,0x10D0},{0x1C91,0x10D1}, /* 10D0 */ + {0x1C92,0x10D2},{0x1C93,0x10D3}, /* 10D2 */ + {0x1C94,0x10D4},{0x1C95,0x10D5}, /* 10D4 */ + {0x1C96,0x10D6},{0x1C97,0x10D7}, /* 10D6 */ + {0x1C98,0x10D8},{0x1C99,0x10D9}, /* 10D8 */ + {0x1C9A,0x10DA},{0x1C9B,0x10DB}, /* 10DA */ + {0x1C9C,0x10DC},{0x1C9D,0x10DD}, /* 10DC */ + {0x1C9E,0x10DE},{0x1C9F,0x10DF}, /* 10DE */ + {0x1CA0,0x10E0},{0x1CA1,0x10E1}, /* 10E0 */ + {0x1CA2,0x10E2},{0x1CA3,0x10E3}, /* 10E2 */ + {0x1CA4,0x10E4},{0x1CA5,0x10E5}, /* 10E4 */ + {0x1CA6,0x10E6},{0x1CA7,0x10E7}, /* 10E6 */ + {0x1CA8,0x10E8},{0x1CA9,0x10E9}, /* 10E8 */ + {0x1CAA,0x10EA},{0x1CAB,0x10EB}, /* 10EA */ + {0x1CAC,0x10EC},{0x1CAD,0x10ED}, /* 10EC */ + {0x1CAE,0x10EE},{0x1CAF,0x10EF}, /* 10EE */ + {0x1CB0,0x10F0},{0x1CB1,0x10F1}, /* 10F0 */ + {0x1CB2,0x10F2},{0x1CB3,0x10F3}, /* 10F2 */ + {0x1CB4,0x10F4},{0x1CB5,0x10F5}, /* 10F4 */ + {0x1CB6,0x10F6},{0x1CB7,0x10F7}, /* 10F6 */ + {0x1CB8,0x10F8},{0x1CB9,0x10F9}, /* 10F8 */ + {0x1CBA,0x10FA},{0x10FB,0x10FB}, /* 10FA */ + {0x10FC,0x10FC},{0x1CBD,0x10FD}, /* 10FC */ + {0x1CBE,0x10FE},{0x1CBF,0x10FF} /* 10FE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page13[256]={ + {0x1300,0x1300},{0x1301,0x1301}, /* 1300 */ + {0x1302,0x1302},{0x1303,0x1303}, /* 1302 */ + {0x1304,0x1304},{0x1305,0x1305}, /* 1304 */ + {0x1306,0x1306},{0x1307,0x1307}, /* 1306 */ + {0x1308,0x1308},{0x1309,0x1309}, /* 1308 */ + {0x130A,0x130A},{0x130B,0x130B}, /* 130A */ + {0x130C,0x130C},{0x130D,0x130D}, /* 130C */ + {0x130E,0x130E},{0x130F,0x130F}, /* 130E */ + {0x1310,0x1310},{0x1311,0x1311}, /* 1310 */ + {0x1312,0x1312},{0x1313,0x1313}, /* 1312 */ + {0x1314,0x1314},{0x1315,0x1315}, /* 1314 */ + {0x1316,0x1316},{0x1317,0x1317}, /* 1316 */ + {0x1318,0x1318},{0x1319,0x1319}, /* 1318 */ + {0x131A,0x131A},{0x131B,0x131B}, /* 131A */ + {0x131C,0x131C},{0x131D,0x131D}, /* 131C */ + {0x131E,0x131E},{0x131F,0x131F}, /* 131E */ + {0x1320,0x1320},{0x1321,0x1321}, /* 1320 */ + {0x1322,0x1322},{0x1323,0x1323}, /* 1322 */ + {0x1324,0x1324},{0x1325,0x1325}, /* 1324 */ + {0x1326,0x1326},{0x1327,0x1327}, /* 1326 */ + {0x1328,0x1328},{0x1329,0x1329}, /* 1328 */ + {0x132A,0x132A},{0x132B,0x132B}, /* 132A */ + {0x132C,0x132C},{0x132D,0x132D}, /* 132C */ + {0x132E,0x132E},{0x132F,0x132F}, /* 132E */ + {0x1330,0x1330},{0x1331,0x1331}, /* 1330 */ + {0x1332,0x1332},{0x1333,0x1333}, /* 1332 */ + {0x1334,0x1334},{0x1335,0x1335}, /* 1334 */ + {0x1336,0x1336},{0x1337,0x1337}, /* 1336 */ + {0x1338,0x1338},{0x1339,0x1339}, /* 1338 */ + {0x133A,0x133A},{0x133B,0x133B}, /* 133A */ + {0x133C,0x133C},{0x133D,0x133D}, /* 133C */ + {0x133E,0x133E},{0x133F,0x133F}, /* 133E */ + {0x1340,0x1340},{0x1341,0x1341}, /* 1340 */ + {0x1342,0x1342},{0x1343,0x1343}, /* 1342 */ + {0x1344,0x1344},{0x1345,0x1345}, /* 1344 */ + {0x1346,0x1346},{0x1347,0x1347}, /* 1346 */ + {0x1348,0x1348},{0x1349,0x1349}, /* 1348 */ + {0x134A,0x134A},{0x134B,0x134B}, /* 134A */ + {0x134C,0x134C},{0x134D,0x134D}, /* 134C */ + {0x134E,0x134E},{0x134F,0x134F}, /* 134E */ + {0x1350,0x1350},{0x1351,0x1351}, /* 1350 */ + {0x1352,0x1352},{0x1353,0x1353}, /* 1352 */ + {0x1354,0x1354},{0x1355,0x1355}, /* 1354 */ + {0x1356,0x1356},{0x1357,0x1357}, /* 1356 */ + {0x1358,0x1358},{0x1359,0x1359}, /* 1358 */ + {0x135A,0x135A},{0x135B,0x135B}, /* 135A */ + {0x135C,0x135C},{0x135D,0x135D}, /* 135C */ + {0x135E,0x135E},{0x135F,0x135F}, /* 135E */ + {0x1360,0x1360},{0x1361,0x1361}, /* 1360 */ + {0x1362,0x1362},{0x1363,0x1363}, /* 1362 */ + {0x1364,0x1364},{0x1365,0x1365}, /* 1364 */ + {0x1366,0x1366},{0x1367,0x1367}, /* 1366 */ + {0x1368,0x1368},{0x1369,0x1369}, /* 1368 */ + {0x136A,0x136A},{0x136B,0x136B}, /* 136A */ + {0x136C,0x136C},{0x136D,0x136D}, /* 136C */ + {0x136E,0x136E},{0x136F,0x136F}, /* 136E */ + {0x1370,0x1370},{0x1371,0x1371}, /* 1370 */ + {0x1372,0x1372},{0x1373,0x1373}, /* 1372 */ + {0x1374,0x1374},{0x1375,0x1375}, /* 1374 */ + {0x1376,0x1376},{0x1377,0x1377}, /* 1376 */ + {0x1378,0x1378},{0x1379,0x1379}, /* 1378 */ + {0x137A,0x137A},{0x137B,0x137B}, /* 137A */ + {0x137C,0x137C},{0x137D,0x137D}, /* 137C */ + {0x137E,0x137E},{0x137F,0x137F}, /* 137E */ + {0x1380,0x1380},{0x1381,0x1381}, /* 1380 */ + {0x1382,0x1382},{0x1383,0x1383}, /* 1382 */ + {0x1384,0x1384},{0x1385,0x1385}, /* 1384 */ + {0x1386,0x1386},{0x1387,0x1387}, /* 1386 */ + {0x1388,0x1388},{0x1389,0x1389}, /* 1388 */ + {0x138A,0x138A},{0x138B,0x138B}, /* 138A */ + {0x138C,0x138C},{0x138D,0x138D}, /* 138C */ + {0x138E,0x138E},{0x138F,0x138F}, /* 138E */ + {0x1390,0x1390},{0x1391,0x1391}, /* 1390 */ + {0x1392,0x1392},{0x1393,0x1393}, /* 1392 */ + {0x1394,0x1394},{0x1395,0x1395}, /* 1394 */ + {0x1396,0x1396},{0x1397,0x1397}, /* 1396 */ + {0x1398,0x1398},{0x1399,0x1399}, /* 1398 */ + {0x139A,0x139A},{0x139B,0x139B}, /* 139A */ + {0x139C,0x139C},{0x139D,0x139D}, /* 139C */ + {0x139E,0x139E},{0x139F,0x139F}, /* 139E */ + {0x13A0,0xAB70},{0x13A1,0xAB71}, /* 13A0 */ + {0x13A2,0xAB72},{0x13A3,0xAB73}, /* 13A2 */ + {0x13A4,0xAB74},{0x13A5,0xAB75}, /* 13A4 */ + {0x13A6,0xAB76},{0x13A7,0xAB77}, /* 13A6 */ + {0x13A8,0xAB78},{0x13A9,0xAB79}, /* 13A8 */ + {0x13AA,0xAB7A},{0x13AB,0xAB7B}, /* 13AA */ + {0x13AC,0xAB7C},{0x13AD,0xAB7D}, /* 13AC */ + {0x13AE,0xAB7E},{0x13AF,0xAB7F}, /* 13AE */ + {0x13B0,0xAB80},{0x13B1,0xAB81}, /* 13B0 */ + {0x13B2,0xAB82},{0x13B3,0xAB83}, /* 13B2 */ + {0x13B4,0xAB84},{0x13B5,0xAB85}, /* 13B4 */ + {0x13B6,0xAB86},{0x13B7,0xAB87}, /* 13B6 */ + {0x13B8,0xAB88},{0x13B9,0xAB89}, /* 13B8 */ + {0x13BA,0xAB8A},{0x13BB,0xAB8B}, /* 13BA */ + {0x13BC,0xAB8C},{0x13BD,0xAB8D}, /* 13BC */ + {0x13BE,0xAB8E},{0x13BF,0xAB8F}, /* 13BE */ + {0x13C0,0xAB90},{0x13C1,0xAB91}, /* 13C0 */ + {0x13C2,0xAB92},{0x13C3,0xAB93}, /* 13C2 */ + {0x13C4,0xAB94},{0x13C5,0xAB95}, /* 13C4 */ + {0x13C6,0xAB96},{0x13C7,0xAB97}, /* 13C6 */ + {0x13C8,0xAB98},{0x13C9,0xAB99}, /* 13C8 */ + {0x13CA,0xAB9A},{0x13CB,0xAB9B}, /* 13CA */ + {0x13CC,0xAB9C},{0x13CD,0xAB9D}, /* 13CC */ + {0x13CE,0xAB9E},{0x13CF,0xAB9F}, /* 13CE */ + {0x13D0,0xABA0},{0x13D1,0xABA1}, /* 13D0 */ + {0x13D2,0xABA2},{0x13D3,0xABA3}, /* 13D2 */ + {0x13D4,0xABA4},{0x13D5,0xABA5}, /* 13D4 */ + {0x13D6,0xABA6},{0x13D7,0xABA7}, /* 13D6 */ + {0x13D8,0xABA8},{0x13D9,0xABA9}, /* 13D8 */ + {0x13DA,0xABAA},{0x13DB,0xABAB}, /* 13DA */ + {0x13DC,0xABAC},{0x13DD,0xABAD}, /* 13DC */ + {0x13DE,0xABAE},{0x13DF,0xABAF}, /* 13DE */ + {0x13E0,0xABB0},{0x13E1,0xABB1}, /* 13E0 */ + {0x13E2,0xABB2},{0x13E3,0xABB3}, /* 13E2 */ + {0x13E4,0xABB4},{0x13E5,0xABB5}, /* 13E4 */ + {0x13E6,0xABB6},{0x13E7,0xABB7}, /* 13E6 */ + {0x13E8,0xABB8},{0x13E9,0xABB9}, /* 13E8 */ + {0x13EA,0xABBA},{0x13EB,0xABBB}, /* 13EA */ + {0x13EC,0xABBC},{0x13ED,0xABBD}, /* 13EC */ + {0x13EE,0xABBE},{0x13EF,0xABBF}, /* 13EE */ + {0x13F0,0x13F8},{0x13F1,0x13F9}, /* 13F0 */ + {0x13F2,0x13FA},{0x13F3,0x13FB}, /* 13F2 */ + {0x13F4,0x13FC},{0x13F5,0x13FD}, /* 13F4 */ + {0x13F6,0x13F6},{0x13F7,0x13F7}, /* 13F6 */ + {0x13F0,0x13F8},{0x13F1,0x13F9}, /* 13F8 */ + {0x13F2,0x13FA},{0x13F3,0x13FB}, /* 13FA */ + {0x13F4,0x13FC},{0x13F5,0x13FD}, /* 13FC */ + {0x13FE,0x13FE},{0x13FF,0x13FF} /* 13FE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page1C[256]={ + {0x1C00,0x1C00},{0x1C01,0x1C01}, /* 1C00 */ + {0x1C02,0x1C02},{0x1C03,0x1C03}, /* 1C02 */ + {0x1C04,0x1C04},{0x1C05,0x1C05}, /* 1C04 */ + {0x1C06,0x1C06},{0x1C07,0x1C07}, /* 1C06 */ + {0x1C08,0x1C08},{0x1C09,0x1C09}, /* 1C08 */ + {0x1C0A,0x1C0A},{0x1C0B,0x1C0B}, /* 1C0A */ + {0x1C0C,0x1C0C},{0x1C0D,0x1C0D}, /* 1C0C */ + {0x1C0E,0x1C0E},{0x1C0F,0x1C0F}, /* 1C0E */ + {0x1C10,0x1C10},{0x1C11,0x1C11}, /* 1C10 */ + {0x1C12,0x1C12},{0x1C13,0x1C13}, /* 1C12 */ + {0x1C14,0x1C14},{0x1C15,0x1C15}, /* 1C14 */ + {0x1C16,0x1C16},{0x1C17,0x1C17}, /* 1C16 */ + {0x1C18,0x1C18},{0x1C19,0x1C19}, /* 1C18 */ + {0x1C1A,0x1C1A},{0x1C1B,0x1C1B}, /* 1C1A */ + {0x1C1C,0x1C1C},{0x1C1D,0x1C1D}, /* 1C1C */ + {0x1C1E,0x1C1E},{0x1C1F,0x1C1F}, /* 1C1E */ + {0x1C20,0x1C20},{0x1C21,0x1C21}, /* 1C20 */ + {0x1C22,0x1C22},{0x1C23,0x1C23}, /* 1C22 */ + {0x1C24,0x1C24},{0x1C25,0x1C25}, /* 1C24 */ + {0x1C26,0x1C26},{0x1C27,0x1C27}, /* 1C26 */ + {0x1C28,0x1C28},{0x1C29,0x1C29}, /* 1C28 */ + {0x1C2A,0x1C2A},{0x1C2B,0x1C2B}, /* 1C2A */ + {0x1C2C,0x1C2C},{0x1C2D,0x1C2D}, /* 1C2C */ + {0x1C2E,0x1C2E},{0x1C2F,0x1C2F}, /* 1C2E */ + {0x1C30,0x1C30},{0x1C31,0x1C31}, /* 1C30 */ + {0x1C32,0x1C32},{0x1C33,0x1C33}, /* 1C32 */ + {0x1C34,0x1C34},{0x1C35,0x1C35}, /* 1C34 */ + {0x1C36,0x1C36},{0x1C37,0x1C37}, /* 1C36 */ + {0x1C38,0x1C38},{0x1C39,0x1C39}, /* 1C38 */ + {0x1C3A,0x1C3A},{0x1C3B,0x1C3B}, /* 1C3A */ + {0x1C3C,0x1C3C},{0x1C3D,0x1C3D}, /* 1C3C */ + {0x1C3E,0x1C3E},{0x1C3F,0x1C3F}, /* 1C3E */ + {0x1C40,0x1C40},{0x1C41,0x1C41}, /* 1C40 */ + {0x1C42,0x1C42},{0x1C43,0x1C43}, /* 1C42 */ + {0x1C44,0x1C44},{0x1C45,0x1C45}, /* 1C44 */ + {0x1C46,0x1C46},{0x1C47,0x1C47}, /* 1C46 */ + {0x1C48,0x1C48},{0x1C49,0x1C49}, /* 1C48 */ + {0x1C4A,0x1C4A},{0x1C4B,0x1C4B}, /* 1C4A */ + {0x1C4C,0x1C4C},{0x1C4D,0x1C4D}, /* 1C4C */ + {0x1C4E,0x1C4E},{0x1C4F,0x1C4F}, /* 1C4E */ + {0x1C50,0x1C50},{0x1C51,0x1C51}, /* 1C50 */ + {0x1C52,0x1C52},{0x1C53,0x1C53}, /* 1C52 */ + {0x1C54,0x1C54},{0x1C55,0x1C55}, /* 1C54 */ + {0x1C56,0x1C56},{0x1C57,0x1C57}, /* 1C56 */ + {0x1C58,0x1C58},{0x1C59,0x1C59}, /* 1C58 */ + {0x1C5A,0x1C5A},{0x1C5B,0x1C5B}, /* 1C5A */ + {0x1C5C,0x1C5C},{0x1C5D,0x1C5D}, /* 1C5C */ + {0x1C5E,0x1C5E},{0x1C5F,0x1C5F}, /* 1C5E */ + {0x1C60,0x1C60},{0x1C61,0x1C61}, /* 1C60 */ + {0x1C62,0x1C62},{0x1C63,0x1C63}, /* 1C62 */ + {0x1C64,0x1C64},{0x1C65,0x1C65}, /* 1C64 */ + {0x1C66,0x1C66},{0x1C67,0x1C67}, /* 1C66 */ + {0x1C68,0x1C68},{0x1C69,0x1C69}, /* 1C68 */ + {0x1C6A,0x1C6A},{0x1C6B,0x1C6B}, /* 1C6A */ + {0x1C6C,0x1C6C},{0x1C6D,0x1C6D}, /* 1C6C */ + {0x1C6E,0x1C6E},{0x1C6F,0x1C6F}, /* 1C6E */ + {0x1C70,0x1C70},{0x1C71,0x1C71}, /* 1C70 */ + {0x1C72,0x1C72},{0x1C73,0x1C73}, /* 1C72 */ + {0x1C74,0x1C74},{0x1C75,0x1C75}, /* 1C74 */ + {0x1C76,0x1C76},{0x1C77,0x1C77}, /* 1C76 */ + {0x1C78,0x1C78},{0x1C79,0x1C79}, /* 1C78 */ + {0x1C7A,0x1C7A},{0x1C7B,0x1C7B}, /* 1C7A */ + {0x1C7C,0x1C7C},{0x1C7D,0x1C7D}, /* 1C7C */ + {0x1C7E,0x1C7E},{0x1C7F,0x1C7F}, /* 1C7E */ + {0x0412,0x1C80},{0x0414,0x1C81}, /* 1C80 */ + {0x041E,0x1C82},{0x0421,0x1C83}, /* 1C82 */ + {0x0422,0x1C84},{0x0422,0x1C85}, /* 1C84 */ + {0x042A,0x1C86},{0x0462,0x1C87}, /* 1C86 */ + {0xA64A,0x1C88},{0x1C89,0x1C89}, /* 1C88 */ + {0x1C8A,0x1C8A},{0x1C8B,0x1C8B}, /* 1C8A */ + {0x1C8C,0x1C8C},{0x1C8D,0x1C8D}, /* 1C8C */ + {0x1C8E,0x1C8E},{0x1C8F,0x1C8F}, /* 1C8E */ + {0x1C90,0x10D0},{0x1C91,0x10D1}, /* 1C90 */ + {0x1C92,0x10D2},{0x1C93,0x10D3}, /* 1C92 */ + {0x1C94,0x10D4},{0x1C95,0x10D5}, /* 1C94 */ + {0x1C96,0x10D6},{0x1C97,0x10D7}, /* 1C96 */ + {0x1C98,0x10D8},{0x1C99,0x10D9}, /* 1C98 */ + {0x1C9A,0x10DA},{0x1C9B,0x10DB}, /* 1C9A */ + {0x1C9C,0x10DC},{0x1C9D,0x10DD}, /* 1C9C */ + {0x1C9E,0x10DE},{0x1C9F,0x10DF}, /* 1C9E */ + {0x1CA0,0x10E0},{0x1CA1,0x10E1}, /* 1CA0 */ + {0x1CA2,0x10E2},{0x1CA3,0x10E3}, /* 1CA2 */ + {0x1CA4,0x10E4},{0x1CA5,0x10E5}, /* 1CA4 */ + {0x1CA6,0x10E6},{0x1CA7,0x10E7}, /* 1CA6 */ + {0x1CA8,0x10E8},{0x1CA9,0x10E9}, /* 1CA8 */ + {0x1CAA,0x10EA},{0x1CAB,0x10EB}, /* 1CAA */ + {0x1CAC,0x10EC},{0x1CAD,0x10ED}, /* 1CAC */ + {0x1CAE,0x10EE},{0x1CAF,0x10EF}, /* 1CAE */ + {0x1CB0,0x10F0},{0x1CB1,0x10F1}, /* 1CB0 */ + {0x1CB2,0x10F2},{0x1CB3,0x10F3}, /* 1CB2 */ + {0x1CB4,0x10F4},{0x1CB5,0x10F5}, /* 1CB4 */ + {0x1CB6,0x10F6},{0x1CB7,0x10F7}, /* 1CB6 */ + {0x1CB8,0x10F8},{0x1CB9,0x10F9}, /* 1CB8 */ + {0x1CBA,0x10FA},{0x1CBB,0x1CBB}, /* 1CBA */ + {0x1CBC,0x1CBC},{0x1CBD,0x10FD}, /* 1CBC */ + {0x1CBE,0x10FE},{0x1CBF,0x10FF}, /* 1CBE */ + {0x1CC0,0x1CC0},{0x1CC1,0x1CC1}, /* 1CC0 */ + {0x1CC2,0x1CC2},{0x1CC3,0x1CC3}, /* 1CC2 */ + {0x1CC4,0x1CC4},{0x1CC5,0x1CC5}, /* 1CC4 */ + {0x1CC6,0x1CC6},{0x1CC7,0x1CC7}, /* 1CC6 */ + {0x1CC8,0x1CC8},{0x1CC9,0x1CC9}, /* 1CC8 */ + {0x1CCA,0x1CCA},{0x1CCB,0x1CCB}, /* 1CCA */ + {0x1CCC,0x1CCC},{0x1CCD,0x1CCD}, /* 1CCC */ + {0x1CCE,0x1CCE},{0x1CCF,0x1CCF}, /* 1CCE */ + {0x1CD0,0x1CD0},{0x1CD1,0x1CD1}, /* 1CD0 */ + {0x1CD2,0x1CD2},{0x1CD3,0x1CD3}, /* 1CD2 */ + {0x1CD4,0x1CD4},{0x1CD5,0x1CD5}, /* 1CD4 */ + {0x1CD6,0x1CD6},{0x1CD7,0x1CD7}, /* 1CD6 */ + {0x1CD8,0x1CD8},{0x1CD9,0x1CD9}, /* 1CD8 */ + {0x1CDA,0x1CDA},{0x1CDB,0x1CDB}, /* 1CDA */ + {0x1CDC,0x1CDC},{0x1CDD,0x1CDD}, /* 1CDC */ + {0x1CDE,0x1CDE},{0x1CDF,0x1CDF}, /* 1CDE */ + {0x1CE0,0x1CE0},{0x1CE1,0x1CE1}, /* 1CE0 */ + {0x1CE2,0x1CE2},{0x1CE3,0x1CE3}, /* 1CE2 */ + {0x1CE4,0x1CE4},{0x1CE5,0x1CE5}, /* 1CE4 */ + {0x1CE6,0x1CE6},{0x1CE7,0x1CE7}, /* 1CE6 */ + {0x1CE8,0x1CE8},{0x1CE9,0x1CE9}, /* 1CE8 */ + {0x1CEA,0x1CEA},{0x1CEB,0x1CEB}, /* 1CEA */ + {0x1CEC,0x1CEC},{0x1CED,0x1CED}, /* 1CEC */ + {0x1CEE,0x1CEE},{0x1CEF,0x1CEF}, /* 1CEE */ + {0x1CF0,0x1CF0},{0x1CF1,0x1CF1}, /* 1CF0 */ + {0x1CF2,0x1CF2},{0x1CF3,0x1CF3}, /* 1CF2 */ + {0x1CF4,0x1CF4},{0x1CF5,0x1CF5}, /* 1CF4 */ + {0x1CF6,0x1CF6},{0x1CF7,0x1CF7}, /* 1CF6 */ + {0x1CF8,0x1CF8},{0x1CF9,0x1CF9}, /* 1CF8 */ + {0x1CFA,0x1CFA},{0x1CFB,0x1CFB}, /* 1CFA */ + {0x1CFC,0x1CFC},{0x1CFD,0x1CFD}, /* 1CFC */ + {0x1CFE,0x1CFE},{0x1CFF,0x1CFF} /* 1CFE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page1D[256]={ + {0x1D00,0x1D00},{0x1D01,0x1D01}, /* 1D00 */ + {0x1D02,0x1D02},{0x1D03,0x1D03}, /* 1D02 */ + {0x1D04,0x1D04},{0x1D05,0x1D05}, /* 1D04 */ + {0x1D06,0x1D06},{0x1D07,0x1D07}, /* 1D06 */ + {0x1D08,0x1D08},{0x1D09,0x1D09}, /* 1D08 */ + {0x1D0A,0x1D0A},{0x1D0B,0x1D0B}, /* 1D0A */ + {0x1D0C,0x1D0C},{0x1D0D,0x1D0D}, /* 1D0C */ + {0x1D0E,0x1D0E},{0x1D0F,0x1D0F}, /* 1D0E */ + {0x1D10,0x1D10},{0x1D11,0x1D11}, /* 1D10 */ + {0x1D12,0x1D12},{0x1D13,0x1D13}, /* 1D12 */ + {0x1D14,0x1D14},{0x1D15,0x1D15}, /* 1D14 */ + {0x1D16,0x1D16},{0x1D17,0x1D17}, /* 1D16 */ + {0x1D18,0x1D18},{0x1D19,0x1D19}, /* 1D18 */ + {0x1D1A,0x1D1A},{0x1D1B,0x1D1B}, /* 1D1A */ + {0x1D1C,0x1D1C},{0x1D1D,0x1D1D}, /* 1D1C */ + {0x1D1E,0x1D1E},{0x1D1F,0x1D1F}, /* 1D1E */ + {0x1D20,0x1D20},{0x1D21,0x1D21}, /* 1D20 */ + {0x1D22,0x1D22},{0x1D23,0x1D23}, /* 1D22 */ + {0x1D24,0x1D24},{0x1D25,0x1D25}, /* 1D24 */ + {0x1D26,0x1D26},{0x1D27,0x1D27}, /* 1D26 */ + {0x1D28,0x1D28},{0x1D29,0x1D29}, /* 1D28 */ + {0x1D2A,0x1D2A},{0x1D2B,0x1D2B}, /* 1D2A */ + {0x1D2C,0x1D2C},{0x1D2D,0x1D2D}, /* 1D2C */ + {0x1D2E,0x1D2E},{0x1D2F,0x1D2F}, /* 1D2E */ + {0x1D30,0x1D30},{0x1D31,0x1D31}, /* 1D30 */ + {0x1D32,0x1D32},{0x1D33,0x1D33}, /* 1D32 */ + {0x1D34,0x1D34},{0x1D35,0x1D35}, /* 1D34 */ + {0x1D36,0x1D36},{0x1D37,0x1D37}, /* 1D36 */ + {0x1D38,0x1D38},{0x1D39,0x1D39}, /* 1D38 */ + {0x1D3A,0x1D3A},{0x1D3B,0x1D3B}, /* 1D3A */ + {0x1D3C,0x1D3C},{0x1D3D,0x1D3D}, /* 1D3C */ + {0x1D3E,0x1D3E},{0x1D3F,0x1D3F}, /* 1D3E */ + {0x1D40,0x1D40},{0x1D41,0x1D41}, /* 1D40 */ + {0x1D42,0x1D42},{0x1D43,0x1D43}, /* 1D42 */ + {0x1D44,0x1D44},{0x1D45,0x1D45}, /* 1D44 */ + {0x1D46,0x1D46},{0x1D47,0x1D47}, /* 1D46 */ + {0x1D48,0x1D48},{0x1D49,0x1D49}, /* 1D48 */ + {0x1D4A,0x1D4A},{0x1D4B,0x1D4B}, /* 1D4A */ + {0x1D4C,0x1D4C},{0x1D4D,0x1D4D}, /* 1D4C */ + {0x1D4E,0x1D4E},{0x1D4F,0x1D4F}, /* 1D4E */ + {0x1D50,0x1D50},{0x1D51,0x1D51}, /* 1D50 */ + {0x1D52,0x1D52},{0x1D53,0x1D53}, /* 1D52 */ + {0x1D54,0x1D54},{0x1D55,0x1D55}, /* 1D54 */ + {0x1D56,0x1D56},{0x1D57,0x1D57}, /* 1D56 */ + {0x1D58,0x1D58},{0x1D59,0x1D59}, /* 1D58 */ + {0x1D5A,0x1D5A},{0x1D5B,0x1D5B}, /* 1D5A */ + {0x1D5C,0x1D5C},{0x1D5D,0x1D5D}, /* 1D5C */ + {0x1D5E,0x1D5E},{0x1D5F,0x1D5F}, /* 1D5E */ + {0x1D60,0x1D60},{0x1D61,0x1D61}, /* 1D60 */ + {0x1D62,0x1D62},{0x1D63,0x1D63}, /* 1D62 */ + {0x1D64,0x1D64},{0x1D65,0x1D65}, /* 1D64 */ + {0x1D66,0x1D66},{0x1D67,0x1D67}, /* 1D66 */ + {0x1D68,0x1D68},{0x1D69,0x1D69}, /* 1D68 */ + {0x1D6A,0x1D6A},{0x1D6B,0x1D6B}, /* 1D6A */ + {0x1D6C,0x1D6C},{0x1D6D,0x1D6D}, /* 1D6C */ + {0x1D6E,0x1D6E},{0x1D6F,0x1D6F}, /* 1D6E */ + {0x1D70,0x1D70},{0x1D71,0x1D71}, /* 1D70 */ + {0x1D72,0x1D72},{0x1D73,0x1D73}, /* 1D72 */ + {0x1D74,0x1D74},{0x1D75,0x1D75}, /* 1D74 */ + {0x1D76,0x1D76},{0x1D77,0x1D77}, /* 1D76 */ + {0x1D78,0x1D78},{0xA77D,0x1D79}, /* 1D78 */ + {0x1D7A,0x1D7A},{0x1D7B,0x1D7B}, /* 1D7A */ + {0x1D7C,0x1D7C},{0x2C63,0x1D7D}, /* 1D7C */ + {0x1D7E,0x1D7E},{0x1D7F,0x1D7F}, /* 1D7E */ + {0x1D80,0x1D80},{0x1D81,0x1D81}, /* 1D80 */ + {0x1D82,0x1D82},{0x1D83,0x1D83}, /* 1D82 */ + {0x1D84,0x1D84},{0x1D85,0x1D85}, /* 1D84 */ + {0x1D86,0x1D86},{0x1D87,0x1D87}, /* 1D86 */ + {0x1D88,0x1D88},{0x1D89,0x1D89}, /* 1D88 */ + {0x1D8A,0x1D8A},{0x1D8B,0x1D8B}, /* 1D8A */ + {0x1D8C,0x1D8C},{0x1D8D,0x1D8D}, /* 1D8C */ + {0xA7C6,0x1D8E},{0x1D8F,0x1D8F}, /* 1D8E */ + {0x1D90,0x1D90},{0x1D91,0x1D91}, /* 1D90 */ + {0x1D92,0x1D92},{0x1D93,0x1D93}, /* 1D92 */ + {0x1D94,0x1D94},{0x1D95,0x1D95}, /* 1D94 */ + {0x1D96,0x1D96},{0x1D97,0x1D97}, /* 1D96 */ + {0x1D98,0x1D98},{0x1D99,0x1D99}, /* 1D98 */ + {0x1D9A,0x1D9A},{0x1D9B,0x1D9B}, /* 1D9A */ + {0x1D9C,0x1D9C},{0x1D9D,0x1D9D}, /* 1D9C */ + {0x1D9E,0x1D9E},{0x1D9F,0x1D9F}, /* 1D9E */ + {0x1DA0,0x1DA0},{0x1DA1,0x1DA1}, /* 1DA0 */ + {0x1DA2,0x1DA2},{0x1DA3,0x1DA3}, /* 1DA2 */ + {0x1DA4,0x1DA4},{0x1DA5,0x1DA5}, /* 1DA4 */ + {0x1DA6,0x1DA6},{0x1DA7,0x1DA7}, /* 1DA6 */ + {0x1DA8,0x1DA8},{0x1DA9,0x1DA9}, /* 1DA8 */ + {0x1DAA,0x1DAA},{0x1DAB,0x1DAB}, /* 1DAA */ + {0x1DAC,0x1DAC},{0x1DAD,0x1DAD}, /* 1DAC */ + {0x1DAE,0x1DAE},{0x1DAF,0x1DAF}, /* 1DAE */ + {0x1DB0,0x1DB0},{0x1DB1,0x1DB1}, /* 1DB0 */ + {0x1DB2,0x1DB2},{0x1DB3,0x1DB3}, /* 1DB2 */ + {0x1DB4,0x1DB4},{0x1DB5,0x1DB5}, /* 1DB4 */ + {0x1DB6,0x1DB6},{0x1DB7,0x1DB7}, /* 1DB6 */ + {0x1DB8,0x1DB8},{0x1DB9,0x1DB9}, /* 1DB8 */ + {0x1DBA,0x1DBA},{0x1DBB,0x1DBB}, /* 1DBA */ + {0x1DBC,0x1DBC},{0x1DBD,0x1DBD}, /* 1DBC */ + {0x1DBE,0x1DBE},{0x1DBF,0x1DBF}, /* 1DBE */ + {0x1DC0,0x1DC0},{0x1DC1,0x1DC1}, /* 1DC0 */ + {0x1DC2,0x1DC2},{0x1DC3,0x1DC3}, /* 1DC2 */ + {0x1DC4,0x1DC4},{0x1DC5,0x1DC5}, /* 1DC4 */ + {0x1DC6,0x1DC6},{0x1DC7,0x1DC7}, /* 1DC6 */ + {0x1DC8,0x1DC8},{0x1DC9,0x1DC9}, /* 1DC8 */ + {0x1DCA,0x1DCA},{0x1DCB,0x1DCB}, /* 1DCA */ + {0x1DCC,0x1DCC},{0x1DCD,0x1DCD}, /* 1DCC */ + {0x1DCE,0x1DCE},{0x1DCF,0x1DCF}, /* 1DCE */ + {0x1DD0,0x1DD0},{0x1DD1,0x1DD1}, /* 1DD0 */ + {0x1DD2,0x1DD2},{0x1DD3,0x1DD3}, /* 1DD2 */ + {0x1DD4,0x1DD4},{0x1DD5,0x1DD5}, /* 1DD4 */ + {0x1DD6,0x1DD6},{0x1DD7,0x1DD7}, /* 1DD6 */ + {0x1DD8,0x1DD8},{0x1DD9,0x1DD9}, /* 1DD8 */ + {0x1DDA,0x1DDA},{0x1DDB,0x1DDB}, /* 1DDA */ + {0x1DDC,0x1DDC},{0x1DDD,0x1DDD}, /* 1DDC */ + {0x1DDE,0x1DDE},{0x1DDF,0x1DDF}, /* 1DDE */ + {0x1DE0,0x1DE0},{0x1DE1,0x1DE1}, /* 1DE0 */ + {0x1DE2,0x1DE2},{0x1DE3,0x1DE3}, /* 1DE2 */ + {0x1DE4,0x1DE4},{0x1DE5,0x1DE5}, /* 1DE4 */ + {0x1DE6,0x1DE6},{0x1DE7,0x1DE7}, /* 1DE6 */ + {0x1DE8,0x1DE8},{0x1DE9,0x1DE9}, /* 1DE8 */ + {0x1DEA,0x1DEA},{0x1DEB,0x1DEB}, /* 1DEA */ + {0x1DEC,0x1DEC},{0x1DED,0x1DED}, /* 1DEC */ + {0x1DEE,0x1DEE},{0x1DEF,0x1DEF}, /* 1DEE */ + {0x1DF0,0x1DF0},{0x1DF1,0x1DF1}, /* 1DF0 */ + {0x1DF2,0x1DF2},{0x1DF3,0x1DF3}, /* 1DF2 */ + {0x1DF4,0x1DF4},{0x1DF5,0x1DF5}, /* 1DF4 */ + {0x1DF6,0x1DF6},{0x1DF7,0x1DF7}, /* 1DF6 */ + {0x1DF8,0x1DF8},{0x1DF9,0x1DF9}, /* 1DF8 */ + {0x1DFA,0x1DFA},{0x1DFB,0x1DFB}, /* 1DFA */ + {0x1DFC,0x1DFC},{0x1DFD,0x1DFD}, /* 1DFC */ + {0x1DFE,0x1DFE},{0x1DFF,0x1DFF} /* 1DFE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page1E[256]={ + {0x1E00,0x1E01},{0x1E00,0x1E01}, /* 1E00 */ + {0x1E02,0x1E03},{0x1E02,0x1E03}, /* 1E02 */ + {0x1E04,0x1E05},{0x1E04,0x1E05}, /* 1E04 */ + {0x1E06,0x1E07},{0x1E06,0x1E07}, /* 1E06 */ + {0x1E08,0x1E09},{0x1E08,0x1E09}, /* 1E08 */ + {0x1E0A,0x1E0B},{0x1E0A,0x1E0B}, /* 1E0A */ + {0x1E0C,0x1E0D},{0x1E0C,0x1E0D}, /* 1E0C */ + {0x1E0E,0x1E0F},{0x1E0E,0x1E0F}, /* 1E0E */ + {0x1E10,0x1E11},{0x1E10,0x1E11}, /* 1E10 */ + {0x1E12,0x1E13},{0x1E12,0x1E13}, /* 1E12 */ + {0x1E14,0x1E15},{0x1E14,0x1E15}, /* 1E14 */ + {0x1E16,0x1E17},{0x1E16,0x1E17}, /* 1E16 */ + {0x1E18,0x1E19},{0x1E18,0x1E19}, /* 1E18 */ + {0x1E1A,0x1E1B},{0x1E1A,0x1E1B}, /* 1E1A */ + {0x1E1C,0x1E1D},{0x1E1C,0x1E1D}, /* 1E1C */ + {0x1E1E,0x1E1F},{0x1E1E,0x1E1F}, /* 1E1E */ + {0x1E20,0x1E21},{0x1E20,0x1E21}, /* 1E20 */ + {0x1E22,0x1E23},{0x1E22,0x1E23}, /* 1E22 */ + {0x1E24,0x1E25},{0x1E24,0x1E25}, /* 1E24 */ + {0x1E26,0x1E27},{0x1E26,0x1E27}, /* 1E26 */ + {0x1E28,0x1E29},{0x1E28,0x1E29}, /* 1E28 */ + {0x1E2A,0x1E2B},{0x1E2A,0x1E2B}, /* 1E2A */ + {0x1E2C,0x1E2D},{0x1E2C,0x1E2D}, /* 1E2C */ + {0x1E2E,0x1E2F},{0x1E2E,0x1E2F}, /* 1E2E */ + {0x1E30,0x1E31},{0x1E30,0x1E31}, /* 1E30 */ + {0x1E32,0x1E33},{0x1E32,0x1E33}, /* 1E32 */ + {0x1E34,0x1E35},{0x1E34,0x1E35}, /* 1E34 */ + {0x1E36,0x1E37},{0x1E36,0x1E37}, /* 1E36 */ + {0x1E38,0x1E39},{0x1E38,0x1E39}, /* 1E38 */ + {0x1E3A,0x1E3B},{0x1E3A,0x1E3B}, /* 1E3A */ + {0x1E3C,0x1E3D},{0x1E3C,0x1E3D}, /* 1E3C */ + {0x1E3E,0x1E3F},{0x1E3E,0x1E3F}, /* 1E3E */ + {0x1E40,0x1E41},{0x1E40,0x1E41}, /* 1E40 */ + {0x1E42,0x1E43},{0x1E42,0x1E43}, /* 1E42 */ + {0x1E44,0x1E45},{0x1E44,0x1E45}, /* 1E44 */ + {0x1E46,0x1E47},{0x1E46,0x1E47}, /* 1E46 */ + {0x1E48,0x1E49},{0x1E48,0x1E49}, /* 1E48 */ + {0x1E4A,0x1E4B},{0x1E4A,0x1E4B}, /* 1E4A */ + {0x1E4C,0x1E4D},{0x1E4C,0x1E4D}, /* 1E4C */ + {0x1E4E,0x1E4F},{0x1E4E,0x1E4F}, /* 1E4E */ + {0x1E50,0x1E51},{0x1E50,0x1E51}, /* 1E50 */ + {0x1E52,0x1E53},{0x1E52,0x1E53}, /* 1E52 */ + {0x1E54,0x1E55},{0x1E54,0x1E55}, /* 1E54 */ + {0x1E56,0x1E57},{0x1E56,0x1E57}, /* 1E56 */ + {0x1E58,0x1E59},{0x1E58,0x1E59}, /* 1E58 */ + {0x1E5A,0x1E5B},{0x1E5A,0x1E5B}, /* 1E5A */ + {0x1E5C,0x1E5D},{0x1E5C,0x1E5D}, /* 1E5C */ + {0x1E5E,0x1E5F},{0x1E5E,0x1E5F}, /* 1E5E */ + {0x1E60,0x1E61},{0x1E60,0x1E61}, /* 1E60 */ + {0x1E62,0x1E63},{0x1E62,0x1E63}, /* 1E62 */ + {0x1E64,0x1E65},{0x1E64,0x1E65}, /* 1E64 */ + {0x1E66,0x1E67},{0x1E66,0x1E67}, /* 1E66 */ + {0x1E68,0x1E69},{0x1E68,0x1E69}, /* 1E68 */ + {0x1E6A,0x1E6B},{0x1E6A,0x1E6B}, /* 1E6A */ + {0x1E6C,0x1E6D},{0x1E6C,0x1E6D}, /* 1E6C */ + {0x1E6E,0x1E6F},{0x1E6E,0x1E6F}, /* 1E6E */ + {0x1E70,0x1E71},{0x1E70,0x1E71}, /* 1E70 */ + {0x1E72,0x1E73},{0x1E72,0x1E73}, /* 1E72 */ + {0x1E74,0x1E75},{0x1E74,0x1E75}, /* 1E74 */ + {0x1E76,0x1E77},{0x1E76,0x1E77}, /* 1E76 */ + {0x1E78,0x1E79},{0x1E78,0x1E79}, /* 1E78 */ + {0x1E7A,0x1E7B},{0x1E7A,0x1E7B}, /* 1E7A */ + {0x1E7C,0x1E7D},{0x1E7C,0x1E7D}, /* 1E7C */ + {0x1E7E,0x1E7F},{0x1E7E,0x1E7F}, /* 1E7E */ + {0x1E80,0x1E81},{0x1E80,0x1E81}, /* 1E80 */ + {0x1E82,0x1E83},{0x1E82,0x1E83}, /* 1E82 */ + {0x1E84,0x1E85},{0x1E84,0x1E85}, /* 1E84 */ + {0x1E86,0x1E87},{0x1E86,0x1E87}, /* 1E86 */ + {0x1E88,0x1E89},{0x1E88,0x1E89}, /* 1E88 */ + {0x1E8A,0x1E8B},{0x1E8A,0x1E8B}, /* 1E8A */ + {0x1E8C,0x1E8D},{0x1E8C,0x1E8D}, /* 1E8C */ + {0x1E8E,0x1E8F},{0x1E8E,0x1E8F}, /* 1E8E */ + {0x1E90,0x1E91},{0x1E90,0x1E91}, /* 1E90 */ + {0x1E92,0x1E93},{0x1E92,0x1E93}, /* 1E92 */ + {0x1E94,0x1E95},{0x1E94,0x1E95}, /* 1E94 */ + {0x1E96,0x1E96},{0x1E97,0x1E97}, /* 1E96 */ + {0x1E98,0x1E98},{0x1E99,0x1E99}, /* 1E98 */ + {0x1E9A,0x1E9A},{0x1E60,0x1E9B}, /* 1E9A */ + {0x1E9C,0x1E9C},{0x1E9D,0x1E9D}, /* 1E9C */ + {0x1E9E,0x00DF},{0x1E9F,0x1E9F}, /* 1E9E */ + {0x1EA0,0x1EA1},{0x1EA0,0x1EA1}, /* 1EA0 */ + {0x1EA2,0x1EA3},{0x1EA2,0x1EA3}, /* 1EA2 */ + {0x1EA4,0x1EA5},{0x1EA4,0x1EA5}, /* 1EA4 */ + {0x1EA6,0x1EA7},{0x1EA6,0x1EA7}, /* 1EA6 */ + {0x1EA8,0x1EA9},{0x1EA8,0x1EA9}, /* 1EA8 */ + {0x1EAA,0x1EAB},{0x1EAA,0x1EAB}, /* 1EAA */ + {0x1EAC,0x1EAD},{0x1EAC,0x1EAD}, /* 1EAC */ + {0x1EAE,0x1EAF},{0x1EAE,0x1EAF}, /* 1EAE */ + {0x1EB0,0x1EB1},{0x1EB0,0x1EB1}, /* 1EB0 */ + {0x1EB2,0x1EB3},{0x1EB2,0x1EB3}, /* 1EB2 */ + {0x1EB4,0x1EB5},{0x1EB4,0x1EB5}, /* 1EB4 */ + {0x1EB6,0x1EB7},{0x1EB6,0x1EB7}, /* 1EB6 */ + {0x1EB8,0x1EB9},{0x1EB8,0x1EB9}, /* 1EB8 */ + {0x1EBA,0x1EBB},{0x1EBA,0x1EBB}, /* 1EBA */ + {0x1EBC,0x1EBD},{0x1EBC,0x1EBD}, /* 1EBC */ + {0x1EBE,0x1EBF},{0x1EBE,0x1EBF}, /* 1EBE */ + {0x1EC0,0x1EC1},{0x1EC0,0x1EC1}, /* 1EC0 */ + {0x1EC2,0x1EC3},{0x1EC2,0x1EC3}, /* 1EC2 */ + {0x1EC4,0x1EC5},{0x1EC4,0x1EC5}, /* 1EC4 */ + {0x1EC6,0x1EC7},{0x1EC6,0x1EC7}, /* 1EC6 */ + {0x1EC8,0x1EC9},{0x1EC8,0x1EC9}, /* 1EC8 */ + {0x1ECA,0x1ECB},{0x1ECA,0x1ECB}, /* 1ECA */ + {0x1ECC,0x1ECD},{0x1ECC,0x1ECD}, /* 1ECC */ + {0x1ECE,0x1ECF},{0x1ECE,0x1ECF}, /* 1ECE */ + {0x1ED0,0x1ED1},{0x1ED0,0x1ED1}, /* 1ED0 */ + {0x1ED2,0x1ED3},{0x1ED2,0x1ED3}, /* 1ED2 */ + {0x1ED4,0x1ED5},{0x1ED4,0x1ED5}, /* 1ED4 */ + {0x1ED6,0x1ED7},{0x1ED6,0x1ED7}, /* 1ED6 */ + {0x1ED8,0x1ED9},{0x1ED8,0x1ED9}, /* 1ED8 */ + {0x1EDA,0x1EDB},{0x1EDA,0x1EDB}, /* 1EDA */ + {0x1EDC,0x1EDD},{0x1EDC,0x1EDD}, /* 1EDC */ + {0x1EDE,0x1EDF},{0x1EDE,0x1EDF}, /* 1EDE */ + {0x1EE0,0x1EE1},{0x1EE0,0x1EE1}, /* 1EE0 */ + {0x1EE2,0x1EE3},{0x1EE2,0x1EE3}, /* 1EE2 */ + {0x1EE4,0x1EE5},{0x1EE4,0x1EE5}, /* 1EE4 */ + {0x1EE6,0x1EE7},{0x1EE6,0x1EE7}, /* 1EE6 */ + {0x1EE8,0x1EE9},{0x1EE8,0x1EE9}, /* 1EE8 */ + {0x1EEA,0x1EEB},{0x1EEA,0x1EEB}, /* 1EEA */ + {0x1EEC,0x1EED},{0x1EEC,0x1EED}, /* 1EEC */ + {0x1EEE,0x1EEF},{0x1EEE,0x1EEF}, /* 1EEE */ + {0x1EF0,0x1EF1},{0x1EF0,0x1EF1}, /* 1EF0 */ + {0x1EF2,0x1EF3},{0x1EF2,0x1EF3}, /* 1EF2 */ + {0x1EF4,0x1EF5},{0x1EF4,0x1EF5}, /* 1EF4 */ + {0x1EF6,0x1EF7},{0x1EF6,0x1EF7}, /* 1EF6 */ + {0x1EF8,0x1EF9},{0x1EF8,0x1EF9}, /* 1EF8 */ + {0x1EFA,0x1EFB},{0x1EFA,0x1EFB}, /* 1EFA */ + {0x1EFC,0x1EFD},{0x1EFC,0x1EFD}, /* 1EFC */ + {0x1EFE,0x1EFF},{0x1EFE,0x1EFF} /* 1EFE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page1F[256]={ + {0x1F08,0x1F00},{0x1F09,0x1F01}, /* 1F00 */ + {0x1F0A,0x1F02},{0x1F0B,0x1F03}, /* 1F02 */ + {0x1F0C,0x1F04},{0x1F0D,0x1F05}, /* 1F04 */ + {0x1F0E,0x1F06},{0x1F0F,0x1F07}, /* 1F06 */ + {0x1F08,0x1F00},{0x1F09,0x1F01}, /* 1F08 */ + {0x1F0A,0x1F02},{0x1F0B,0x1F03}, /* 1F0A */ + {0x1F0C,0x1F04},{0x1F0D,0x1F05}, /* 1F0C */ + {0x1F0E,0x1F06},{0x1F0F,0x1F07}, /* 1F0E */ + {0x1F18,0x1F10},{0x1F19,0x1F11}, /* 1F10 */ + {0x1F1A,0x1F12},{0x1F1B,0x1F13}, /* 1F12 */ + {0x1F1C,0x1F14},{0x1F1D,0x1F15}, /* 1F14 */ + {0x1F16,0x1F16},{0x1F17,0x1F17}, /* 1F16 */ + {0x1F18,0x1F10},{0x1F19,0x1F11}, /* 1F18 */ + {0x1F1A,0x1F12},{0x1F1B,0x1F13}, /* 1F1A */ + {0x1F1C,0x1F14},{0x1F1D,0x1F15}, /* 1F1C */ + {0x1F1E,0x1F1E},{0x1F1F,0x1F1F}, /* 1F1E */ + {0x1F28,0x1F20},{0x1F29,0x1F21}, /* 1F20 */ + {0x1F2A,0x1F22},{0x1F2B,0x1F23}, /* 1F22 */ + {0x1F2C,0x1F24},{0x1F2D,0x1F25}, /* 1F24 */ + {0x1F2E,0x1F26},{0x1F2F,0x1F27}, /* 1F26 */ + {0x1F28,0x1F20},{0x1F29,0x1F21}, /* 1F28 */ + {0x1F2A,0x1F22},{0x1F2B,0x1F23}, /* 1F2A */ + {0x1F2C,0x1F24},{0x1F2D,0x1F25}, /* 1F2C */ + {0x1F2E,0x1F26},{0x1F2F,0x1F27}, /* 1F2E */ + {0x1F38,0x1F30},{0x1F39,0x1F31}, /* 1F30 */ + {0x1F3A,0x1F32},{0x1F3B,0x1F33}, /* 1F32 */ + {0x1F3C,0x1F34},{0x1F3D,0x1F35}, /* 1F34 */ + {0x1F3E,0x1F36},{0x1F3F,0x1F37}, /* 1F36 */ + {0x1F38,0x1F30},{0x1F39,0x1F31}, /* 1F38 */ + {0x1F3A,0x1F32},{0x1F3B,0x1F33}, /* 1F3A */ + {0x1F3C,0x1F34},{0x1F3D,0x1F35}, /* 1F3C */ + {0x1F3E,0x1F36},{0x1F3F,0x1F37}, /* 1F3E */ + {0x1F48,0x1F40},{0x1F49,0x1F41}, /* 1F40 */ + {0x1F4A,0x1F42},{0x1F4B,0x1F43}, /* 1F42 */ + {0x1F4C,0x1F44},{0x1F4D,0x1F45}, /* 1F44 */ + {0x1F46,0x1F46},{0x1F47,0x1F47}, /* 1F46 */ + {0x1F48,0x1F40},{0x1F49,0x1F41}, /* 1F48 */ + {0x1F4A,0x1F42},{0x1F4B,0x1F43}, /* 1F4A */ + {0x1F4C,0x1F44},{0x1F4D,0x1F45}, /* 1F4C */ + {0x1F4E,0x1F4E},{0x1F4F,0x1F4F}, /* 1F4E */ + {0x1F50,0x1F50},{0x1F59,0x1F51}, /* 1F50 */ + {0x1F52,0x1F52},{0x1F5B,0x1F53}, /* 1F52 */ + {0x1F54,0x1F54},{0x1F5D,0x1F55}, /* 1F54 */ + {0x1F56,0x1F56},{0x1F5F,0x1F57}, /* 1F56 */ + {0x1F58,0x1F58},{0x1F59,0x1F51}, /* 1F58 */ + {0x1F5A,0x1F5A},{0x1F5B,0x1F53}, /* 1F5A */ + {0x1F5C,0x1F5C},{0x1F5D,0x1F55}, /* 1F5C */ + {0x1F5E,0x1F5E},{0x1F5F,0x1F57}, /* 1F5E */ + {0x1F68,0x1F60},{0x1F69,0x1F61}, /* 1F60 */ + {0x1F6A,0x1F62},{0x1F6B,0x1F63}, /* 1F62 */ + {0x1F6C,0x1F64},{0x1F6D,0x1F65}, /* 1F64 */ + {0x1F6E,0x1F66},{0x1F6F,0x1F67}, /* 1F66 */ + {0x1F68,0x1F60},{0x1F69,0x1F61}, /* 1F68 */ + {0x1F6A,0x1F62},{0x1F6B,0x1F63}, /* 1F6A */ + {0x1F6C,0x1F64},{0x1F6D,0x1F65}, /* 1F6C */ + {0x1F6E,0x1F66},{0x1F6F,0x1F67}, /* 1F6E */ + {0x1FBA,0x1F70},{0x1FBB,0x1F71}, /* 1F70 */ + {0x1FC8,0x1F72},{0x1FC9,0x1F73}, /* 1F72 */ + {0x1FCA,0x1F74},{0x1FCB,0x1F75}, /* 1F74 */ + {0x1FDA,0x1F76},{0x1FDB,0x1F77}, /* 1F76 */ + {0x1FF8,0x1F78},{0x1FF9,0x1F79}, /* 1F78 */ + {0x1FEA,0x1F7A},{0x1FEB,0x1F7B}, /* 1F7A */ + {0x1FFA,0x1F7C},{0x1FFB,0x1F7D}, /* 1F7C */ + {0x1F7E,0x1F7E},{0x1F7F,0x1F7F}, /* 1F7E */ + {0x1F88,0x1F80},{0x1F89,0x1F81}, /* 1F80 */ + {0x1F8A,0x1F82},{0x1F8B,0x1F83}, /* 1F82 */ + {0x1F8C,0x1F84},{0x1F8D,0x1F85}, /* 1F84 */ + {0x1F8E,0x1F86},{0x1F8F,0x1F87}, /* 1F86 */ + {0x1F88,0x1F80},{0x1F89,0x1F81}, /* 1F88 */ + {0x1F8A,0x1F82},{0x1F8B,0x1F83}, /* 1F8A */ + {0x1F8C,0x1F84},{0x1F8D,0x1F85}, /* 1F8C */ + {0x1F8E,0x1F86},{0x1F8F,0x1F87}, /* 1F8E */ + {0x1F98,0x1F90},{0x1F99,0x1F91}, /* 1F90 */ + {0x1F9A,0x1F92},{0x1F9B,0x1F93}, /* 1F92 */ + {0x1F9C,0x1F94},{0x1F9D,0x1F95}, /* 1F94 */ + {0x1F9E,0x1F96},{0x1F9F,0x1F97}, /* 1F96 */ + {0x1F98,0x1F90},{0x1F99,0x1F91}, /* 1F98 */ + {0x1F9A,0x1F92},{0x1F9B,0x1F93}, /* 1F9A */ + {0x1F9C,0x1F94},{0x1F9D,0x1F95}, /* 1F9C */ + {0x1F9E,0x1F96},{0x1F9F,0x1F97}, /* 1F9E */ + {0x1FA8,0x1FA0},{0x1FA9,0x1FA1}, /* 1FA0 */ + {0x1FAA,0x1FA2},{0x1FAB,0x1FA3}, /* 1FA2 */ + {0x1FAC,0x1FA4},{0x1FAD,0x1FA5}, /* 1FA4 */ + {0x1FAE,0x1FA6},{0x1FAF,0x1FA7}, /* 1FA6 */ + {0x1FA8,0x1FA0},{0x1FA9,0x1FA1}, /* 1FA8 */ + {0x1FAA,0x1FA2},{0x1FAB,0x1FA3}, /* 1FAA */ + {0x1FAC,0x1FA4},{0x1FAD,0x1FA5}, /* 1FAC */ + {0x1FAE,0x1FA6},{0x1FAF,0x1FA7}, /* 1FAE */ + {0x1FB8,0x1FB0},{0x1FB9,0x1FB1}, /* 1FB0 */ + {0x1FB2,0x1FB2},{0x1FBC,0x1FB3}, /* 1FB2 */ + {0x1FB4,0x1FB4},{0x1FB5,0x1FB5}, /* 1FB4 */ + {0x1FB6,0x1FB6},{0x1FB7,0x1FB7}, /* 1FB6 */ + {0x1FB8,0x1FB0},{0x1FB9,0x1FB1}, /* 1FB8 */ + {0x1FBA,0x1F70},{0x1FBB,0x1F71}, /* 1FBA */ + {0x1FBC,0x1FB3},{0x1FBD,0x1FBD}, /* 1FBC */ + {0x0399,0x1FBE},{0x1FBF,0x1FBF}, /* 1FBE */ + {0x1FC0,0x1FC0},{0x1FC1,0x1FC1}, /* 1FC0 */ + {0x1FC2,0x1FC2},{0x1FCC,0x1FC3}, /* 1FC2 */ + {0x1FC4,0x1FC4},{0x1FC5,0x1FC5}, /* 1FC4 */ + {0x1FC6,0x1FC6},{0x1FC7,0x1FC7}, /* 1FC6 */ + {0x1FC8,0x1F72},{0x1FC9,0x1F73}, /* 1FC8 */ + {0x1FCA,0x1F74},{0x1FCB,0x1F75}, /* 1FCA */ + {0x1FCC,0x1FC3},{0x1FCD,0x1FCD}, /* 1FCC */ + {0x1FCE,0x1FCE},{0x1FCF,0x1FCF}, /* 1FCE */ + {0x1FD8,0x1FD0},{0x1FD9,0x1FD1}, /* 1FD0 */ + {0x1FD2,0x1FD2},{0x1FD3,0x1FD3}, /* 1FD2 */ + {0x1FD4,0x1FD4},{0x1FD5,0x1FD5}, /* 1FD4 */ + {0x1FD6,0x1FD6},{0x1FD7,0x1FD7}, /* 1FD6 */ + {0x1FD8,0x1FD0},{0x1FD9,0x1FD1}, /* 1FD8 */ + {0x1FDA,0x1F76},{0x1FDB,0x1F77}, /* 1FDA */ + {0x1FDC,0x1FDC},{0x1FDD,0x1FDD}, /* 1FDC */ + {0x1FDE,0x1FDE},{0x1FDF,0x1FDF}, /* 1FDE */ + {0x1FE8,0x1FE0},{0x1FE9,0x1FE1}, /* 1FE0 */ + {0x1FE2,0x1FE2},{0x1FE3,0x1FE3}, /* 1FE2 */ + {0x1FE4,0x1FE4},{0x1FEC,0x1FE5}, /* 1FE4 */ + {0x1FE6,0x1FE6},{0x1FE7,0x1FE7}, /* 1FE6 */ + {0x1FE8,0x1FE0},{0x1FE9,0x1FE1}, /* 1FE8 */ + {0x1FEA,0x1F7A},{0x1FEB,0x1F7B}, /* 1FEA */ + {0x1FEC,0x1FE5},{0x1FED,0x1FED}, /* 1FEC */ + {0x1FEE,0x1FEE},{0x1FEF,0x1FEF}, /* 1FEE */ + {0x1FF0,0x1FF0},{0x1FF1,0x1FF1}, /* 1FF0 */ + {0x1FF2,0x1FF2},{0x1FFC,0x1FF3}, /* 1FF2 */ + {0x1FF4,0x1FF4},{0x1FF5,0x1FF5}, /* 1FF4 */ + {0x1FF6,0x1FF6},{0x1FF7,0x1FF7}, /* 1FF6 */ + {0x1FF8,0x1F78},{0x1FF9,0x1F79}, /* 1FF8 */ + {0x1FFA,0x1F7C},{0x1FFB,0x1F7D}, /* 1FFA */ + {0x1FFC,0x1FF3},{0x1FFD,0x1FFD}, /* 1FFC */ + {0x1FFE,0x1FFE},{0x1FFF,0x1FFF} /* 1FFE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page21[256]={ + {0x2100,0x2100},{0x2101,0x2101}, /* 2100 */ + {0x2102,0x2102},{0x2103,0x2103}, /* 2102 */ + {0x2104,0x2104},{0x2105,0x2105}, /* 2104 */ + {0x2106,0x2106},{0x2107,0x2107}, /* 2106 */ + {0x2108,0x2108},{0x2109,0x2109}, /* 2108 */ + {0x210A,0x210A},{0x210B,0x210B}, /* 210A */ + {0x210C,0x210C},{0x210D,0x210D}, /* 210C */ + {0x210E,0x210E},{0x210F,0x210F}, /* 210E */ + {0x2110,0x2110},{0x2111,0x2111}, /* 2110 */ + {0x2112,0x2112},{0x2113,0x2113}, /* 2112 */ + {0x2114,0x2114},{0x2115,0x2115}, /* 2114 */ + {0x2116,0x2116},{0x2117,0x2117}, /* 2116 */ + {0x2118,0x2118},{0x2119,0x2119}, /* 2118 */ + {0x211A,0x211A},{0x211B,0x211B}, /* 211A */ + {0x211C,0x211C},{0x211D,0x211D}, /* 211C */ + {0x211E,0x211E},{0x211F,0x211F}, /* 211E */ + {0x2120,0x2120},{0x2121,0x2121}, /* 2120 */ + {0x2122,0x2122},{0x2123,0x2123}, /* 2122 */ + {0x2124,0x2124},{0x2125,0x2125}, /* 2124 */ + {0x2126,0x03C9},{0x2127,0x2127}, /* 2126 */ + {0x2128,0x2128},{0x2129,0x2129}, /* 2128 */ + {0x212A,0x006B},{0x212B,0x00E5}, /* 212A */ + {0x212C,0x212C},{0x212D,0x212D}, /* 212C */ + {0x212E,0x212E},{0x212F,0x212F}, /* 212E */ + {0x2130,0x2130},{0x2131,0x2131}, /* 2130 */ + {0x2132,0x214E},{0x2133,0x2133}, /* 2132 */ + {0x2134,0x2134},{0x2135,0x2135}, /* 2134 */ + {0x2136,0x2136},{0x2137,0x2137}, /* 2136 */ + {0x2138,0x2138},{0x2139,0x2139}, /* 2138 */ + {0x213A,0x213A},{0x213B,0x213B}, /* 213A */ + {0x213C,0x213C},{0x213D,0x213D}, /* 213C */ + {0x213E,0x213E},{0x213F,0x213F}, /* 213E */ + {0x2140,0x2140},{0x2141,0x2141}, /* 2140 */ + {0x2142,0x2142},{0x2143,0x2143}, /* 2142 */ + {0x2144,0x2144},{0x2145,0x2145}, /* 2144 */ + {0x2146,0x2146},{0x2147,0x2147}, /* 2146 */ + {0x2148,0x2148},{0x2149,0x2149}, /* 2148 */ + {0x214A,0x214A},{0x214B,0x214B}, /* 214A */ + {0x214C,0x214C},{0x214D,0x214D}, /* 214C */ + {0x2132,0x214E},{0x214F,0x214F}, /* 214E */ + {0x2150,0x2150},{0x2151,0x2151}, /* 2150 */ + {0x2152,0x2152},{0x2153,0x2153}, /* 2152 */ + {0x2154,0x2154},{0x2155,0x2155}, /* 2154 */ + {0x2156,0x2156},{0x2157,0x2157}, /* 2156 */ + {0x2158,0x2158},{0x2159,0x2159}, /* 2158 */ + {0x215A,0x215A},{0x215B,0x215B}, /* 215A */ + {0x215C,0x215C},{0x215D,0x215D}, /* 215C */ + {0x215E,0x215E},{0x215F,0x215F}, /* 215E */ + {0x2160,0x2170},{0x2161,0x2171}, /* 2160 */ + {0x2162,0x2172},{0x2163,0x2173}, /* 2162 */ + {0x2164,0x2174},{0x2165,0x2175}, /* 2164 */ + {0x2166,0x2176},{0x2167,0x2177}, /* 2166 */ + {0x2168,0x2178},{0x2169,0x2179}, /* 2168 */ + {0x216A,0x217A},{0x216B,0x217B}, /* 216A */ + {0x216C,0x217C},{0x216D,0x217D}, /* 216C */ + {0x216E,0x217E},{0x216F,0x217F}, /* 216E */ + {0x2160,0x2170},{0x2161,0x2171}, /* 2170 */ + {0x2162,0x2172},{0x2163,0x2173}, /* 2172 */ + {0x2164,0x2174},{0x2165,0x2175}, /* 2174 */ + {0x2166,0x2176},{0x2167,0x2177}, /* 2176 */ + {0x2168,0x2178},{0x2169,0x2179}, /* 2178 */ + {0x216A,0x217A},{0x216B,0x217B}, /* 217A */ + {0x216C,0x217C},{0x216D,0x217D}, /* 217C */ + {0x216E,0x217E},{0x216F,0x217F}, /* 217E */ + {0x2180,0x2180},{0x2181,0x2181}, /* 2180 */ + {0x2182,0x2182},{0x2183,0x2184}, /* 2182 */ + {0x2183,0x2184},{0x2185,0x2185}, /* 2184 */ + {0x2186,0x2186},{0x2187,0x2187}, /* 2186 */ + {0x2188,0x2188},{0x2189,0x2189}, /* 2188 */ + {0x218A,0x218A},{0x218B,0x218B}, /* 218A */ + {0x218C,0x218C},{0x218D,0x218D}, /* 218C */ + {0x218E,0x218E},{0x218F,0x218F}, /* 218E */ + {0x2190,0x2190},{0x2191,0x2191}, /* 2190 */ + {0x2192,0x2192},{0x2193,0x2193}, /* 2192 */ + {0x2194,0x2194},{0x2195,0x2195}, /* 2194 */ + {0x2196,0x2196},{0x2197,0x2197}, /* 2196 */ + {0x2198,0x2198},{0x2199,0x2199}, /* 2198 */ + {0x219A,0x219A},{0x219B,0x219B}, /* 219A */ + {0x219C,0x219C},{0x219D,0x219D}, /* 219C */ + {0x219E,0x219E},{0x219F,0x219F}, /* 219E */ + {0x21A0,0x21A0},{0x21A1,0x21A1}, /* 21A0 */ + {0x21A2,0x21A2},{0x21A3,0x21A3}, /* 21A2 */ + {0x21A4,0x21A4},{0x21A5,0x21A5}, /* 21A4 */ + {0x21A6,0x21A6},{0x21A7,0x21A7}, /* 21A6 */ + {0x21A8,0x21A8},{0x21A9,0x21A9}, /* 21A8 */ + {0x21AA,0x21AA},{0x21AB,0x21AB}, /* 21AA */ + {0x21AC,0x21AC},{0x21AD,0x21AD}, /* 21AC */ + {0x21AE,0x21AE},{0x21AF,0x21AF}, /* 21AE */ + {0x21B0,0x21B0},{0x21B1,0x21B1}, /* 21B0 */ + {0x21B2,0x21B2},{0x21B3,0x21B3}, /* 21B2 */ + {0x21B4,0x21B4},{0x21B5,0x21B5}, /* 21B4 */ + {0x21B6,0x21B6},{0x21B7,0x21B7}, /* 21B6 */ + {0x21B8,0x21B8},{0x21B9,0x21B9}, /* 21B8 */ + {0x21BA,0x21BA},{0x21BB,0x21BB}, /* 21BA */ + {0x21BC,0x21BC},{0x21BD,0x21BD}, /* 21BC */ + {0x21BE,0x21BE},{0x21BF,0x21BF}, /* 21BE */ + {0x21C0,0x21C0},{0x21C1,0x21C1}, /* 21C0 */ + {0x21C2,0x21C2},{0x21C3,0x21C3}, /* 21C2 */ + {0x21C4,0x21C4},{0x21C5,0x21C5}, /* 21C4 */ + {0x21C6,0x21C6},{0x21C7,0x21C7}, /* 21C6 */ + {0x21C8,0x21C8},{0x21C9,0x21C9}, /* 21C8 */ + {0x21CA,0x21CA},{0x21CB,0x21CB}, /* 21CA */ + {0x21CC,0x21CC},{0x21CD,0x21CD}, /* 21CC */ + {0x21CE,0x21CE},{0x21CF,0x21CF}, /* 21CE */ + {0x21D0,0x21D0},{0x21D1,0x21D1}, /* 21D0 */ + {0x21D2,0x21D2},{0x21D3,0x21D3}, /* 21D2 */ + {0x21D4,0x21D4},{0x21D5,0x21D5}, /* 21D4 */ + {0x21D6,0x21D6},{0x21D7,0x21D7}, /* 21D6 */ + {0x21D8,0x21D8},{0x21D9,0x21D9}, /* 21D8 */ + {0x21DA,0x21DA},{0x21DB,0x21DB}, /* 21DA */ + {0x21DC,0x21DC},{0x21DD,0x21DD}, /* 21DC */ + {0x21DE,0x21DE},{0x21DF,0x21DF}, /* 21DE */ + {0x21E0,0x21E0},{0x21E1,0x21E1}, /* 21E0 */ + {0x21E2,0x21E2},{0x21E3,0x21E3}, /* 21E2 */ + {0x21E4,0x21E4},{0x21E5,0x21E5}, /* 21E4 */ + {0x21E6,0x21E6},{0x21E7,0x21E7}, /* 21E6 */ + {0x21E8,0x21E8},{0x21E9,0x21E9}, /* 21E8 */ + {0x21EA,0x21EA},{0x21EB,0x21EB}, /* 21EA */ + {0x21EC,0x21EC},{0x21ED,0x21ED}, /* 21EC */ + {0x21EE,0x21EE},{0x21EF,0x21EF}, /* 21EE */ + {0x21F0,0x21F0},{0x21F1,0x21F1}, /* 21F0 */ + {0x21F2,0x21F2},{0x21F3,0x21F3}, /* 21F2 */ + {0x21F4,0x21F4},{0x21F5,0x21F5}, /* 21F4 */ + {0x21F6,0x21F6},{0x21F7,0x21F7}, /* 21F6 */ + {0x21F8,0x21F8},{0x21F9,0x21F9}, /* 21F8 */ + {0x21FA,0x21FA},{0x21FB,0x21FB}, /* 21FA */ + {0x21FC,0x21FC},{0x21FD,0x21FD}, /* 21FC */ + {0x21FE,0x21FE},{0x21FF,0x21FF} /* 21FE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page24[256]={ + {0x2400,0x2400},{0x2401,0x2401}, /* 2400 */ + {0x2402,0x2402},{0x2403,0x2403}, /* 2402 */ + {0x2404,0x2404},{0x2405,0x2405}, /* 2404 */ + {0x2406,0x2406},{0x2407,0x2407}, /* 2406 */ + {0x2408,0x2408},{0x2409,0x2409}, /* 2408 */ + {0x240A,0x240A},{0x240B,0x240B}, /* 240A */ + {0x240C,0x240C},{0x240D,0x240D}, /* 240C */ + {0x240E,0x240E},{0x240F,0x240F}, /* 240E */ + {0x2410,0x2410},{0x2411,0x2411}, /* 2410 */ + {0x2412,0x2412},{0x2413,0x2413}, /* 2412 */ + {0x2414,0x2414},{0x2415,0x2415}, /* 2414 */ + {0x2416,0x2416},{0x2417,0x2417}, /* 2416 */ + {0x2418,0x2418},{0x2419,0x2419}, /* 2418 */ + {0x241A,0x241A},{0x241B,0x241B}, /* 241A */ + {0x241C,0x241C},{0x241D,0x241D}, /* 241C */ + {0x241E,0x241E},{0x241F,0x241F}, /* 241E */ + {0x2420,0x2420},{0x2421,0x2421}, /* 2420 */ + {0x2422,0x2422},{0x2423,0x2423}, /* 2422 */ + {0x2424,0x2424},{0x2425,0x2425}, /* 2424 */ + {0x2426,0x2426},{0x2427,0x2427}, /* 2426 */ + {0x2428,0x2428},{0x2429,0x2429}, /* 2428 */ + {0x242A,0x242A},{0x242B,0x242B}, /* 242A */ + {0x242C,0x242C},{0x242D,0x242D}, /* 242C */ + {0x242E,0x242E},{0x242F,0x242F}, /* 242E */ + {0x2430,0x2430},{0x2431,0x2431}, /* 2430 */ + {0x2432,0x2432},{0x2433,0x2433}, /* 2432 */ + {0x2434,0x2434},{0x2435,0x2435}, /* 2434 */ + {0x2436,0x2436},{0x2437,0x2437}, /* 2436 */ + {0x2438,0x2438},{0x2439,0x2439}, /* 2438 */ + {0x243A,0x243A},{0x243B,0x243B}, /* 243A */ + {0x243C,0x243C},{0x243D,0x243D}, /* 243C */ + {0x243E,0x243E},{0x243F,0x243F}, /* 243E */ + {0x2440,0x2440},{0x2441,0x2441}, /* 2440 */ + {0x2442,0x2442},{0x2443,0x2443}, /* 2442 */ + {0x2444,0x2444},{0x2445,0x2445}, /* 2444 */ + {0x2446,0x2446},{0x2447,0x2447}, /* 2446 */ + {0x2448,0x2448},{0x2449,0x2449}, /* 2448 */ + {0x244A,0x244A},{0x244B,0x244B}, /* 244A */ + {0x244C,0x244C},{0x244D,0x244D}, /* 244C */ + {0x244E,0x244E},{0x244F,0x244F}, /* 244E */ + {0x2450,0x2450},{0x2451,0x2451}, /* 2450 */ + {0x2452,0x2452},{0x2453,0x2453}, /* 2452 */ + {0x2454,0x2454},{0x2455,0x2455}, /* 2454 */ + {0x2456,0x2456},{0x2457,0x2457}, /* 2456 */ + {0x2458,0x2458},{0x2459,0x2459}, /* 2458 */ + {0x245A,0x245A},{0x245B,0x245B}, /* 245A */ + {0x245C,0x245C},{0x245D,0x245D}, /* 245C */ + {0x245E,0x245E},{0x245F,0x245F}, /* 245E */ + {0x2460,0x2460},{0x2461,0x2461}, /* 2460 */ + {0x2462,0x2462},{0x2463,0x2463}, /* 2462 */ + {0x2464,0x2464},{0x2465,0x2465}, /* 2464 */ + {0x2466,0x2466},{0x2467,0x2467}, /* 2466 */ + {0x2468,0x2468},{0x2469,0x2469}, /* 2468 */ + {0x246A,0x246A},{0x246B,0x246B}, /* 246A */ + {0x246C,0x246C},{0x246D,0x246D}, /* 246C */ + {0x246E,0x246E},{0x246F,0x246F}, /* 246E */ + {0x2470,0x2470},{0x2471,0x2471}, /* 2470 */ + {0x2472,0x2472},{0x2473,0x2473}, /* 2472 */ + {0x2474,0x2474},{0x2475,0x2475}, /* 2474 */ + {0x2476,0x2476},{0x2477,0x2477}, /* 2476 */ + {0x2478,0x2478},{0x2479,0x2479}, /* 2478 */ + {0x247A,0x247A},{0x247B,0x247B}, /* 247A */ + {0x247C,0x247C},{0x247D,0x247D}, /* 247C */ + {0x247E,0x247E},{0x247F,0x247F}, /* 247E */ + {0x2480,0x2480},{0x2481,0x2481}, /* 2480 */ + {0x2482,0x2482},{0x2483,0x2483}, /* 2482 */ + {0x2484,0x2484},{0x2485,0x2485}, /* 2484 */ + {0x2486,0x2486},{0x2487,0x2487}, /* 2486 */ + {0x2488,0x2488},{0x2489,0x2489}, /* 2488 */ + {0x248A,0x248A},{0x248B,0x248B}, /* 248A */ + {0x248C,0x248C},{0x248D,0x248D}, /* 248C */ + {0x248E,0x248E},{0x248F,0x248F}, /* 248E */ + {0x2490,0x2490},{0x2491,0x2491}, /* 2490 */ + {0x2492,0x2492},{0x2493,0x2493}, /* 2492 */ + {0x2494,0x2494},{0x2495,0x2495}, /* 2494 */ + {0x2496,0x2496},{0x2497,0x2497}, /* 2496 */ + {0x2498,0x2498},{0x2499,0x2499}, /* 2498 */ + {0x249A,0x249A},{0x249B,0x249B}, /* 249A */ + {0x249C,0x249C},{0x249D,0x249D}, /* 249C */ + {0x249E,0x249E},{0x249F,0x249F}, /* 249E */ + {0x24A0,0x24A0},{0x24A1,0x24A1}, /* 24A0 */ + {0x24A2,0x24A2},{0x24A3,0x24A3}, /* 24A2 */ + {0x24A4,0x24A4},{0x24A5,0x24A5}, /* 24A4 */ + {0x24A6,0x24A6},{0x24A7,0x24A7}, /* 24A6 */ + {0x24A8,0x24A8},{0x24A9,0x24A9}, /* 24A8 */ + {0x24AA,0x24AA},{0x24AB,0x24AB}, /* 24AA */ + {0x24AC,0x24AC},{0x24AD,0x24AD}, /* 24AC */ + {0x24AE,0x24AE},{0x24AF,0x24AF}, /* 24AE */ + {0x24B0,0x24B0},{0x24B1,0x24B1}, /* 24B0 */ + {0x24B2,0x24B2},{0x24B3,0x24B3}, /* 24B2 */ + {0x24B4,0x24B4},{0x24B5,0x24B5}, /* 24B4 */ + {0x24B6,0x24D0},{0x24B7,0x24D1}, /* 24B6 */ + {0x24B8,0x24D2},{0x24B9,0x24D3}, /* 24B8 */ + {0x24BA,0x24D4},{0x24BB,0x24D5}, /* 24BA */ + {0x24BC,0x24D6},{0x24BD,0x24D7}, /* 24BC */ + {0x24BE,0x24D8},{0x24BF,0x24D9}, /* 24BE */ + {0x24C0,0x24DA},{0x24C1,0x24DB}, /* 24C0 */ + {0x24C2,0x24DC},{0x24C3,0x24DD}, /* 24C2 */ + {0x24C4,0x24DE},{0x24C5,0x24DF}, /* 24C4 */ + {0x24C6,0x24E0},{0x24C7,0x24E1}, /* 24C6 */ + {0x24C8,0x24E2},{0x24C9,0x24E3}, /* 24C8 */ + {0x24CA,0x24E4},{0x24CB,0x24E5}, /* 24CA */ + {0x24CC,0x24E6},{0x24CD,0x24E7}, /* 24CC */ + {0x24CE,0x24E8},{0x24CF,0x24E9}, /* 24CE */ + {0x24B6,0x24D0},{0x24B7,0x24D1}, /* 24D0 */ + {0x24B8,0x24D2},{0x24B9,0x24D3}, /* 24D2 */ + {0x24BA,0x24D4},{0x24BB,0x24D5}, /* 24D4 */ + {0x24BC,0x24D6},{0x24BD,0x24D7}, /* 24D6 */ + {0x24BE,0x24D8},{0x24BF,0x24D9}, /* 24D8 */ + {0x24C0,0x24DA},{0x24C1,0x24DB}, /* 24DA */ + {0x24C2,0x24DC},{0x24C3,0x24DD}, /* 24DC */ + {0x24C4,0x24DE},{0x24C5,0x24DF}, /* 24DE */ + {0x24C6,0x24E0},{0x24C7,0x24E1}, /* 24E0 */ + {0x24C8,0x24E2},{0x24C9,0x24E3}, /* 24E2 */ + {0x24CA,0x24E4},{0x24CB,0x24E5}, /* 24E4 */ + {0x24CC,0x24E6},{0x24CD,0x24E7}, /* 24E6 */ + {0x24CE,0x24E8},{0x24CF,0x24E9}, /* 24E8 */ + {0x24EA,0x24EA},{0x24EB,0x24EB}, /* 24EA */ + {0x24EC,0x24EC},{0x24ED,0x24ED}, /* 24EC */ + {0x24EE,0x24EE},{0x24EF,0x24EF}, /* 24EE */ + {0x24F0,0x24F0},{0x24F1,0x24F1}, /* 24F0 */ + {0x24F2,0x24F2},{0x24F3,0x24F3}, /* 24F2 */ + {0x24F4,0x24F4},{0x24F5,0x24F5}, /* 24F4 */ + {0x24F6,0x24F6},{0x24F7,0x24F7}, /* 24F6 */ + {0x24F8,0x24F8},{0x24F9,0x24F9}, /* 24F8 */ + {0x24FA,0x24FA},{0x24FB,0x24FB}, /* 24FA */ + {0x24FC,0x24FC},{0x24FD,0x24FD}, /* 24FC */ + {0x24FE,0x24FE},{0x24FF,0x24FF} /* 24FE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page2C[256]={ + {0x2C00,0x2C30},{0x2C01,0x2C31}, /* 2C00 */ + {0x2C02,0x2C32},{0x2C03,0x2C33}, /* 2C02 */ + {0x2C04,0x2C34},{0x2C05,0x2C35}, /* 2C04 */ + {0x2C06,0x2C36},{0x2C07,0x2C37}, /* 2C06 */ + {0x2C08,0x2C38},{0x2C09,0x2C39}, /* 2C08 */ + {0x2C0A,0x2C3A},{0x2C0B,0x2C3B}, /* 2C0A */ + {0x2C0C,0x2C3C},{0x2C0D,0x2C3D}, /* 2C0C */ + {0x2C0E,0x2C3E},{0x2C0F,0x2C3F}, /* 2C0E */ + {0x2C10,0x2C40},{0x2C11,0x2C41}, /* 2C10 */ + {0x2C12,0x2C42},{0x2C13,0x2C43}, /* 2C12 */ + {0x2C14,0x2C44},{0x2C15,0x2C45}, /* 2C14 */ + {0x2C16,0x2C46},{0x2C17,0x2C47}, /* 2C16 */ + {0x2C18,0x2C48},{0x2C19,0x2C49}, /* 2C18 */ + {0x2C1A,0x2C4A},{0x2C1B,0x2C4B}, /* 2C1A */ + {0x2C1C,0x2C4C},{0x2C1D,0x2C4D}, /* 2C1C */ + {0x2C1E,0x2C4E},{0x2C1F,0x2C4F}, /* 2C1E */ + {0x2C20,0x2C50},{0x2C21,0x2C51}, /* 2C20 */ + {0x2C22,0x2C52},{0x2C23,0x2C53}, /* 2C22 */ + {0x2C24,0x2C54},{0x2C25,0x2C55}, /* 2C24 */ + {0x2C26,0x2C56},{0x2C27,0x2C57}, /* 2C26 */ + {0x2C28,0x2C58},{0x2C29,0x2C59}, /* 2C28 */ + {0x2C2A,0x2C5A},{0x2C2B,0x2C5B}, /* 2C2A */ + {0x2C2C,0x2C5C},{0x2C2D,0x2C5D}, /* 2C2C */ + {0x2C2E,0x2C5E},{0x2C2F,0x2C5F}, /* 2C2E */ + {0x2C00,0x2C30},{0x2C01,0x2C31}, /* 2C30 */ + {0x2C02,0x2C32},{0x2C03,0x2C33}, /* 2C32 */ + {0x2C04,0x2C34},{0x2C05,0x2C35}, /* 2C34 */ + {0x2C06,0x2C36},{0x2C07,0x2C37}, /* 2C36 */ + {0x2C08,0x2C38},{0x2C09,0x2C39}, /* 2C38 */ + {0x2C0A,0x2C3A},{0x2C0B,0x2C3B}, /* 2C3A */ + {0x2C0C,0x2C3C},{0x2C0D,0x2C3D}, /* 2C3C */ + {0x2C0E,0x2C3E},{0x2C0F,0x2C3F}, /* 2C3E */ + {0x2C10,0x2C40},{0x2C11,0x2C41}, /* 2C40 */ + {0x2C12,0x2C42},{0x2C13,0x2C43}, /* 2C42 */ + {0x2C14,0x2C44},{0x2C15,0x2C45}, /* 2C44 */ + {0x2C16,0x2C46},{0x2C17,0x2C47}, /* 2C46 */ + {0x2C18,0x2C48},{0x2C19,0x2C49}, /* 2C48 */ + {0x2C1A,0x2C4A},{0x2C1B,0x2C4B}, /* 2C4A */ + {0x2C1C,0x2C4C},{0x2C1D,0x2C4D}, /* 2C4C */ + {0x2C1E,0x2C4E},{0x2C1F,0x2C4F}, /* 2C4E */ + {0x2C20,0x2C50},{0x2C21,0x2C51}, /* 2C50 */ + {0x2C22,0x2C52},{0x2C23,0x2C53}, /* 2C52 */ + {0x2C24,0x2C54},{0x2C25,0x2C55}, /* 2C54 */ + {0x2C26,0x2C56},{0x2C27,0x2C57}, /* 2C56 */ + {0x2C28,0x2C58},{0x2C29,0x2C59}, /* 2C58 */ + {0x2C2A,0x2C5A},{0x2C2B,0x2C5B}, /* 2C5A */ + {0x2C2C,0x2C5C},{0x2C2D,0x2C5D}, /* 2C5C */ + {0x2C2E,0x2C5E},{0x2C2F,0x2C5F}, /* 2C5E */ + {0x2C60,0x2C61},{0x2C60,0x2C61}, /* 2C60 */ + {0x2C62,0x026B},{0x2C63,0x1D7D}, /* 2C62 */ + {0x2C64,0x027D},{0x023A,0x2C65}, /* 2C64 */ + {0x023E,0x2C66},{0x2C67,0x2C68}, /* 2C66 */ + {0x2C67,0x2C68},{0x2C69,0x2C6A}, /* 2C68 */ + {0x2C69,0x2C6A},{0x2C6B,0x2C6C}, /* 2C6A */ + {0x2C6B,0x2C6C},{0x2C6D,0x0251}, /* 2C6C */ + {0x2C6E,0x0271},{0x2C6F,0x0250}, /* 2C6E */ + {0x2C70,0x0252},{0x2C71,0x2C71}, /* 2C70 */ + {0x2C72,0x2C73},{0x2C72,0x2C73}, /* 2C72 */ + {0x2C74,0x2C74},{0x2C75,0x2C76}, /* 2C74 */ + {0x2C75,0x2C76},{0x2C77,0x2C77}, /* 2C76 */ + {0x2C78,0x2C78},{0x2C79,0x2C79}, /* 2C78 */ + {0x2C7A,0x2C7A},{0x2C7B,0x2C7B}, /* 2C7A */ + {0x2C7C,0x2C7C},{0x2C7D,0x2C7D}, /* 2C7C */ + {0x2C7E,0x023F},{0x2C7F,0x0240}, /* 2C7E */ + {0x2C80,0x2C81},{0x2C80,0x2C81}, /* 2C80 */ + {0x2C82,0x2C83},{0x2C82,0x2C83}, /* 2C82 */ + {0x2C84,0x2C85},{0x2C84,0x2C85}, /* 2C84 */ + {0x2C86,0x2C87},{0x2C86,0x2C87}, /* 2C86 */ + {0x2C88,0x2C89},{0x2C88,0x2C89}, /* 2C88 */ + {0x2C8A,0x2C8B},{0x2C8A,0x2C8B}, /* 2C8A */ + {0x2C8C,0x2C8D},{0x2C8C,0x2C8D}, /* 2C8C */ + {0x2C8E,0x2C8F},{0x2C8E,0x2C8F}, /* 2C8E */ + {0x2C90,0x2C91},{0x2C90,0x2C91}, /* 2C90 */ + {0x2C92,0x2C93},{0x2C92,0x2C93}, /* 2C92 */ + {0x2C94,0x2C95},{0x2C94,0x2C95}, /* 2C94 */ + {0x2C96,0x2C97},{0x2C96,0x2C97}, /* 2C96 */ + {0x2C98,0x2C99},{0x2C98,0x2C99}, /* 2C98 */ + {0x2C9A,0x2C9B},{0x2C9A,0x2C9B}, /* 2C9A */ + {0x2C9C,0x2C9D},{0x2C9C,0x2C9D}, /* 2C9C */ + {0x2C9E,0x2C9F},{0x2C9E,0x2C9F}, /* 2C9E */ + {0x2CA0,0x2CA1},{0x2CA0,0x2CA1}, /* 2CA0 */ + {0x2CA2,0x2CA3},{0x2CA2,0x2CA3}, /* 2CA2 */ + {0x2CA4,0x2CA5},{0x2CA4,0x2CA5}, /* 2CA4 */ + {0x2CA6,0x2CA7},{0x2CA6,0x2CA7}, /* 2CA6 */ + {0x2CA8,0x2CA9},{0x2CA8,0x2CA9}, /* 2CA8 */ + {0x2CAA,0x2CAB},{0x2CAA,0x2CAB}, /* 2CAA */ + {0x2CAC,0x2CAD},{0x2CAC,0x2CAD}, /* 2CAC */ + {0x2CAE,0x2CAF},{0x2CAE,0x2CAF}, /* 2CAE */ + {0x2CB0,0x2CB1},{0x2CB0,0x2CB1}, /* 2CB0 */ + {0x2CB2,0x2CB3},{0x2CB2,0x2CB3}, /* 2CB2 */ + {0x2CB4,0x2CB5},{0x2CB4,0x2CB5}, /* 2CB4 */ + {0x2CB6,0x2CB7},{0x2CB6,0x2CB7}, /* 2CB6 */ + {0x2CB8,0x2CB9},{0x2CB8,0x2CB9}, /* 2CB8 */ + {0x2CBA,0x2CBB},{0x2CBA,0x2CBB}, /* 2CBA */ + {0x2CBC,0x2CBD},{0x2CBC,0x2CBD}, /* 2CBC */ + {0x2CBE,0x2CBF},{0x2CBE,0x2CBF}, /* 2CBE */ + {0x2CC0,0x2CC1},{0x2CC0,0x2CC1}, /* 2CC0 */ + {0x2CC2,0x2CC3},{0x2CC2,0x2CC3}, /* 2CC2 */ + {0x2CC4,0x2CC5},{0x2CC4,0x2CC5}, /* 2CC4 */ + {0x2CC6,0x2CC7},{0x2CC6,0x2CC7}, /* 2CC6 */ + {0x2CC8,0x2CC9},{0x2CC8,0x2CC9}, /* 2CC8 */ + {0x2CCA,0x2CCB},{0x2CCA,0x2CCB}, /* 2CCA */ + {0x2CCC,0x2CCD},{0x2CCC,0x2CCD}, /* 2CCC */ + {0x2CCE,0x2CCF},{0x2CCE,0x2CCF}, /* 2CCE */ + {0x2CD0,0x2CD1},{0x2CD0,0x2CD1}, /* 2CD0 */ + {0x2CD2,0x2CD3},{0x2CD2,0x2CD3}, /* 2CD2 */ + {0x2CD4,0x2CD5},{0x2CD4,0x2CD5}, /* 2CD4 */ + {0x2CD6,0x2CD7},{0x2CD6,0x2CD7}, /* 2CD6 */ + {0x2CD8,0x2CD9},{0x2CD8,0x2CD9}, /* 2CD8 */ + {0x2CDA,0x2CDB},{0x2CDA,0x2CDB}, /* 2CDA */ + {0x2CDC,0x2CDD},{0x2CDC,0x2CDD}, /* 2CDC */ + {0x2CDE,0x2CDF},{0x2CDE,0x2CDF}, /* 2CDE */ + {0x2CE0,0x2CE1},{0x2CE0,0x2CE1}, /* 2CE0 */ + {0x2CE2,0x2CE3},{0x2CE2,0x2CE3}, /* 2CE2 */ + {0x2CE4,0x2CE4},{0x2CE5,0x2CE5}, /* 2CE4 */ + {0x2CE6,0x2CE6},{0x2CE7,0x2CE7}, /* 2CE6 */ + {0x2CE8,0x2CE8},{0x2CE9,0x2CE9}, /* 2CE8 */ + {0x2CEA,0x2CEA},{0x2CEB,0x2CEC}, /* 2CEA */ + {0x2CEB,0x2CEC},{0x2CED,0x2CEE}, /* 2CEC */ + {0x2CED,0x2CEE},{0x2CEF,0x2CEF}, /* 2CEE */ + {0x2CF0,0x2CF0},{0x2CF1,0x2CF1}, /* 2CF0 */ + {0x2CF2,0x2CF3},{0x2CF2,0x2CF3}, /* 2CF2 */ + {0x2CF4,0x2CF4},{0x2CF5,0x2CF5}, /* 2CF4 */ + {0x2CF6,0x2CF6},{0x2CF7,0x2CF7}, /* 2CF6 */ + {0x2CF8,0x2CF8},{0x2CF9,0x2CF9}, /* 2CF8 */ + {0x2CFA,0x2CFA},{0x2CFB,0x2CFB}, /* 2CFA */ + {0x2CFC,0x2CFC},{0x2CFD,0x2CFD}, /* 2CFC */ + {0x2CFE,0x2CFE},{0x2CFF,0x2CFF} /* 2CFE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page2D[256]={ + {0x10A0,0x2D00},{0x10A1,0x2D01}, /* 2D00 */ + {0x10A2,0x2D02},{0x10A3,0x2D03}, /* 2D02 */ + {0x10A4,0x2D04},{0x10A5,0x2D05}, /* 2D04 */ + {0x10A6,0x2D06},{0x10A7,0x2D07}, /* 2D06 */ + {0x10A8,0x2D08},{0x10A9,0x2D09}, /* 2D08 */ + {0x10AA,0x2D0A},{0x10AB,0x2D0B}, /* 2D0A */ + {0x10AC,0x2D0C},{0x10AD,0x2D0D}, /* 2D0C */ + {0x10AE,0x2D0E},{0x10AF,0x2D0F}, /* 2D0E */ + {0x10B0,0x2D10},{0x10B1,0x2D11}, /* 2D10 */ + {0x10B2,0x2D12},{0x10B3,0x2D13}, /* 2D12 */ + {0x10B4,0x2D14},{0x10B5,0x2D15}, /* 2D14 */ + {0x10B6,0x2D16},{0x10B7,0x2D17}, /* 2D16 */ + {0x10B8,0x2D18},{0x10B9,0x2D19}, /* 2D18 */ + {0x10BA,0x2D1A},{0x10BB,0x2D1B}, /* 2D1A */ + {0x10BC,0x2D1C},{0x10BD,0x2D1D}, /* 2D1C */ + {0x10BE,0x2D1E},{0x10BF,0x2D1F}, /* 2D1E */ + {0x10C0,0x2D20},{0x10C1,0x2D21}, /* 2D20 */ + {0x10C2,0x2D22},{0x10C3,0x2D23}, /* 2D22 */ + {0x10C4,0x2D24},{0x10C5,0x2D25}, /* 2D24 */ + {0x2D26,0x2D26},{0x10C7,0x2D27}, /* 2D26 */ + {0x2D28,0x2D28},{0x2D29,0x2D29}, /* 2D28 */ + {0x2D2A,0x2D2A},{0x2D2B,0x2D2B}, /* 2D2A */ + {0x2D2C,0x2D2C},{0x10CD,0x2D2D}, /* 2D2C */ + {0x2D2E,0x2D2E},{0x2D2F,0x2D2F}, /* 2D2E */ + {0x2D30,0x2D30},{0x2D31,0x2D31}, /* 2D30 */ + {0x2D32,0x2D32},{0x2D33,0x2D33}, /* 2D32 */ + {0x2D34,0x2D34},{0x2D35,0x2D35}, /* 2D34 */ + {0x2D36,0x2D36},{0x2D37,0x2D37}, /* 2D36 */ + {0x2D38,0x2D38},{0x2D39,0x2D39}, /* 2D38 */ + {0x2D3A,0x2D3A},{0x2D3B,0x2D3B}, /* 2D3A */ + {0x2D3C,0x2D3C},{0x2D3D,0x2D3D}, /* 2D3C */ + {0x2D3E,0x2D3E},{0x2D3F,0x2D3F}, /* 2D3E */ + {0x2D40,0x2D40},{0x2D41,0x2D41}, /* 2D40 */ + {0x2D42,0x2D42},{0x2D43,0x2D43}, /* 2D42 */ + {0x2D44,0x2D44},{0x2D45,0x2D45}, /* 2D44 */ + {0x2D46,0x2D46},{0x2D47,0x2D47}, /* 2D46 */ + {0x2D48,0x2D48},{0x2D49,0x2D49}, /* 2D48 */ + {0x2D4A,0x2D4A},{0x2D4B,0x2D4B}, /* 2D4A */ + {0x2D4C,0x2D4C},{0x2D4D,0x2D4D}, /* 2D4C */ + {0x2D4E,0x2D4E},{0x2D4F,0x2D4F}, /* 2D4E */ + {0x2D50,0x2D50},{0x2D51,0x2D51}, /* 2D50 */ + {0x2D52,0x2D52},{0x2D53,0x2D53}, /* 2D52 */ + {0x2D54,0x2D54},{0x2D55,0x2D55}, /* 2D54 */ + {0x2D56,0x2D56},{0x2D57,0x2D57}, /* 2D56 */ + {0x2D58,0x2D58},{0x2D59,0x2D59}, /* 2D58 */ + {0x2D5A,0x2D5A},{0x2D5B,0x2D5B}, /* 2D5A */ + {0x2D5C,0x2D5C},{0x2D5D,0x2D5D}, /* 2D5C */ + {0x2D5E,0x2D5E},{0x2D5F,0x2D5F}, /* 2D5E */ + {0x2D60,0x2D60},{0x2D61,0x2D61}, /* 2D60 */ + {0x2D62,0x2D62},{0x2D63,0x2D63}, /* 2D62 */ + {0x2D64,0x2D64},{0x2D65,0x2D65}, /* 2D64 */ + {0x2D66,0x2D66},{0x2D67,0x2D67}, /* 2D66 */ + {0x2D68,0x2D68},{0x2D69,0x2D69}, /* 2D68 */ + {0x2D6A,0x2D6A},{0x2D6B,0x2D6B}, /* 2D6A */ + {0x2D6C,0x2D6C},{0x2D6D,0x2D6D}, /* 2D6C */ + {0x2D6E,0x2D6E},{0x2D6F,0x2D6F}, /* 2D6E */ + {0x2D70,0x2D70},{0x2D71,0x2D71}, /* 2D70 */ + {0x2D72,0x2D72},{0x2D73,0x2D73}, /* 2D72 */ + {0x2D74,0x2D74},{0x2D75,0x2D75}, /* 2D74 */ + {0x2D76,0x2D76},{0x2D77,0x2D77}, /* 2D76 */ + {0x2D78,0x2D78},{0x2D79,0x2D79}, /* 2D78 */ + {0x2D7A,0x2D7A},{0x2D7B,0x2D7B}, /* 2D7A */ + {0x2D7C,0x2D7C},{0x2D7D,0x2D7D}, /* 2D7C */ + {0x2D7E,0x2D7E},{0x2D7F,0x2D7F}, /* 2D7E */ + {0x2D80,0x2D80},{0x2D81,0x2D81}, /* 2D80 */ + {0x2D82,0x2D82},{0x2D83,0x2D83}, /* 2D82 */ + {0x2D84,0x2D84},{0x2D85,0x2D85}, /* 2D84 */ + {0x2D86,0x2D86},{0x2D87,0x2D87}, /* 2D86 */ + {0x2D88,0x2D88},{0x2D89,0x2D89}, /* 2D88 */ + {0x2D8A,0x2D8A},{0x2D8B,0x2D8B}, /* 2D8A */ + {0x2D8C,0x2D8C},{0x2D8D,0x2D8D}, /* 2D8C */ + {0x2D8E,0x2D8E},{0x2D8F,0x2D8F}, /* 2D8E */ + {0x2D90,0x2D90},{0x2D91,0x2D91}, /* 2D90 */ + {0x2D92,0x2D92},{0x2D93,0x2D93}, /* 2D92 */ + {0x2D94,0x2D94},{0x2D95,0x2D95}, /* 2D94 */ + {0x2D96,0x2D96},{0x2D97,0x2D97}, /* 2D96 */ + {0x2D98,0x2D98},{0x2D99,0x2D99}, /* 2D98 */ + {0x2D9A,0x2D9A},{0x2D9B,0x2D9B}, /* 2D9A */ + {0x2D9C,0x2D9C},{0x2D9D,0x2D9D}, /* 2D9C */ + {0x2D9E,0x2D9E},{0x2D9F,0x2D9F}, /* 2D9E */ + {0x2DA0,0x2DA0},{0x2DA1,0x2DA1}, /* 2DA0 */ + {0x2DA2,0x2DA2},{0x2DA3,0x2DA3}, /* 2DA2 */ + {0x2DA4,0x2DA4},{0x2DA5,0x2DA5}, /* 2DA4 */ + {0x2DA6,0x2DA6},{0x2DA7,0x2DA7}, /* 2DA6 */ + {0x2DA8,0x2DA8},{0x2DA9,0x2DA9}, /* 2DA8 */ + {0x2DAA,0x2DAA},{0x2DAB,0x2DAB}, /* 2DAA */ + {0x2DAC,0x2DAC},{0x2DAD,0x2DAD}, /* 2DAC */ + {0x2DAE,0x2DAE},{0x2DAF,0x2DAF}, /* 2DAE */ + {0x2DB0,0x2DB0},{0x2DB1,0x2DB1}, /* 2DB0 */ + {0x2DB2,0x2DB2},{0x2DB3,0x2DB3}, /* 2DB2 */ + {0x2DB4,0x2DB4},{0x2DB5,0x2DB5}, /* 2DB4 */ + {0x2DB6,0x2DB6},{0x2DB7,0x2DB7}, /* 2DB6 */ + {0x2DB8,0x2DB8},{0x2DB9,0x2DB9}, /* 2DB8 */ + {0x2DBA,0x2DBA},{0x2DBB,0x2DBB}, /* 2DBA */ + {0x2DBC,0x2DBC},{0x2DBD,0x2DBD}, /* 2DBC */ + {0x2DBE,0x2DBE},{0x2DBF,0x2DBF}, /* 2DBE */ + {0x2DC0,0x2DC0},{0x2DC1,0x2DC1}, /* 2DC0 */ + {0x2DC2,0x2DC2},{0x2DC3,0x2DC3}, /* 2DC2 */ + {0x2DC4,0x2DC4},{0x2DC5,0x2DC5}, /* 2DC4 */ + {0x2DC6,0x2DC6},{0x2DC7,0x2DC7}, /* 2DC6 */ + {0x2DC8,0x2DC8},{0x2DC9,0x2DC9}, /* 2DC8 */ + {0x2DCA,0x2DCA},{0x2DCB,0x2DCB}, /* 2DCA */ + {0x2DCC,0x2DCC},{0x2DCD,0x2DCD}, /* 2DCC */ + {0x2DCE,0x2DCE},{0x2DCF,0x2DCF}, /* 2DCE */ + {0x2DD0,0x2DD0},{0x2DD1,0x2DD1}, /* 2DD0 */ + {0x2DD2,0x2DD2},{0x2DD3,0x2DD3}, /* 2DD2 */ + {0x2DD4,0x2DD4},{0x2DD5,0x2DD5}, /* 2DD4 */ + {0x2DD6,0x2DD6},{0x2DD7,0x2DD7}, /* 2DD6 */ + {0x2DD8,0x2DD8},{0x2DD9,0x2DD9}, /* 2DD8 */ + {0x2DDA,0x2DDA},{0x2DDB,0x2DDB}, /* 2DDA */ + {0x2DDC,0x2DDC},{0x2DDD,0x2DDD}, /* 2DDC */ + {0x2DDE,0x2DDE},{0x2DDF,0x2DDF}, /* 2DDE */ + {0x2DE0,0x2DE0},{0x2DE1,0x2DE1}, /* 2DE0 */ + {0x2DE2,0x2DE2},{0x2DE3,0x2DE3}, /* 2DE2 */ + {0x2DE4,0x2DE4},{0x2DE5,0x2DE5}, /* 2DE4 */ + {0x2DE6,0x2DE6},{0x2DE7,0x2DE7}, /* 2DE6 */ + {0x2DE8,0x2DE8},{0x2DE9,0x2DE9}, /* 2DE8 */ + {0x2DEA,0x2DEA},{0x2DEB,0x2DEB}, /* 2DEA */ + {0x2DEC,0x2DEC},{0x2DED,0x2DED}, /* 2DEC */ + {0x2DEE,0x2DEE},{0x2DEF,0x2DEF}, /* 2DEE */ + {0x2DF0,0x2DF0},{0x2DF1,0x2DF1}, /* 2DF0 */ + {0x2DF2,0x2DF2},{0x2DF3,0x2DF3}, /* 2DF2 */ + {0x2DF4,0x2DF4},{0x2DF5,0x2DF5}, /* 2DF4 */ + {0x2DF6,0x2DF6},{0x2DF7,0x2DF7}, /* 2DF6 */ + {0x2DF8,0x2DF8},{0x2DF9,0x2DF9}, /* 2DF8 */ + {0x2DFA,0x2DFA},{0x2DFB,0x2DFB}, /* 2DFA */ + {0x2DFC,0x2DFC},{0x2DFD,0x2DFD}, /* 2DFC */ + {0x2DFE,0x2DFE},{0x2DFF,0x2DFF} /* 2DFE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_pageA6[256]={ + {0xA600,0xA600},{0xA601,0xA601}, /* A600 */ + {0xA602,0xA602},{0xA603,0xA603}, /* A602 */ + {0xA604,0xA604},{0xA605,0xA605}, /* A604 */ + {0xA606,0xA606},{0xA607,0xA607}, /* A606 */ + {0xA608,0xA608},{0xA609,0xA609}, /* A608 */ + {0xA60A,0xA60A},{0xA60B,0xA60B}, /* A60A */ + {0xA60C,0xA60C},{0xA60D,0xA60D}, /* A60C */ + {0xA60E,0xA60E},{0xA60F,0xA60F}, /* A60E */ + {0xA610,0xA610},{0xA611,0xA611}, /* A610 */ + {0xA612,0xA612},{0xA613,0xA613}, /* A612 */ + {0xA614,0xA614},{0xA615,0xA615}, /* A614 */ + {0xA616,0xA616},{0xA617,0xA617}, /* A616 */ + {0xA618,0xA618},{0xA619,0xA619}, /* A618 */ + {0xA61A,0xA61A},{0xA61B,0xA61B}, /* A61A */ + {0xA61C,0xA61C},{0xA61D,0xA61D}, /* A61C */ + {0xA61E,0xA61E},{0xA61F,0xA61F}, /* A61E */ + {0xA620,0xA620},{0xA621,0xA621}, /* A620 */ + {0xA622,0xA622},{0xA623,0xA623}, /* A622 */ + {0xA624,0xA624},{0xA625,0xA625}, /* A624 */ + {0xA626,0xA626},{0xA627,0xA627}, /* A626 */ + {0xA628,0xA628},{0xA629,0xA629}, /* A628 */ + {0xA62A,0xA62A},{0xA62B,0xA62B}, /* A62A */ + {0xA62C,0xA62C},{0xA62D,0xA62D}, /* A62C */ + {0xA62E,0xA62E},{0xA62F,0xA62F}, /* A62E */ + {0xA630,0xA630},{0xA631,0xA631}, /* A630 */ + {0xA632,0xA632},{0xA633,0xA633}, /* A632 */ + {0xA634,0xA634},{0xA635,0xA635}, /* A634 */ + {0xA636,0xA636},{0xA637,0xA637}, /* A636 */ + {0xA638,0xA638},{0xA639,0xA639}, /* A638 */ + {0xA63A,0xA63A},{0xA63B,0xA63B}, /* A63A */ + {0xA63C,0xA63C},{0xA63D,0xA63D}, /* A63C */ + {0xA63E,0xA63E},{0xA63F,0xA63F}, /* A63E */ + {0xA640,0xA641},{0xA640,0xA641}, /* A640 */ + {0xA642,0xA643},{0xA642,0xA643}, /* A642 */ + {0xA644,0xA645},{0xA644,0xA645}, /* A644 */ + {0xA646,0xA647},{0xA646,0xA647}, /* A646 */ + {0xA648,0xA649},{0xA648,0xA649}, /* A648 */ + {0xA64A,0xA64B},{0xA64A,0xA64B}, /* A64A */ + {0xA64C,0xA64D},{0xA64C,0xA64D}, /* A64C */ + {0xA64E,0xA64F},{0xA64E,0xA64F}, /* A64E */ + {0xA650,0xA651},{0xA650,0xA651}, /* A650 */ + {0xA652,0xA653},{0xA652,0xA653}, /* A652 */ + {0xA654,0xA655},{0xA654,0xA655}, /* A654 */ + {0xA656,0xA657},{0xA656,0xA657}, /* A656 */ + {0xA658,0xA659},{0xA658,0xA659}, /* A658 */ + {0xA65A,0xA65B},{0xA65A,0xA65B}, /* A65A */ + {0xA65C,0xA65D},{0xA65C,0xA65D}, /* A65C */ + {0xA65E,0xA65F},{0xA65E,0xA65F}, /* A65E */ + {0xA660,0xA661},{0xA660,0xA661}, /* A660 */ + {0xA662,0xA663},{0xA662,0xA663}, /* A662 */ + {0xA664,0xA665},{0xA664,0xA665}, /* A664 */ + {0xA666,0xA667},{0xA666,0xA667}, /* A666 */ + {0xA668,0xA669},{0xA668,0xA669}, /* A668 */ + {0xA66A,0xA66B},{0xA66A,0xA66B}, /* A66A */ + {0xA66C,0xA66D},{0xA66C,0xA66D}, /* A66C */ + {0xA66E,0xA66E},{0xA66F,0xA66F}, /* A66E */ + {0xA670,0xA670},{0xA671,0xA671}, /* A670 */ + {0xA672,0xA672},{0xA673,0xA673}, /* A672 */ + {0xA674,0xA674},{0xA675,0xA675}, /* A674 */ + {0xA676,0xA676},{0xA677,0xA677}, /* A676 */ + {0xA678,0xA678},{0xA679,0xA679}, /* A678 */ + {0xA67A,0xA67A},{0xA67B,0xA67B}, /* A67A */ + {0xA67C,0xA67C},{0xA67D,0xA67D}, /* A67C */ + {0xA67E,0xA67E},{0xA67F,0xA67F}, /* A67E */ + {0xA680,0xA681},{0xA680,0xA681}, /* A680 */ + {0xA682,0xA683},{0xA682,0xA683}, /* A682 */ + {0xA684,0xA685},{0xA684,0xA685}, /* A684 */ + {0xA686,0xA687},{0xA686,0xA687}, /* A686 */ + {0xA688,0xA689},{0xA688,0xA689}, /* A688 */ + {0xA68A,0xA68B},{0xA68A,0xA68B}, /* A68A */ + {0xA68C,0xA68D},{0xA68C,0xA68D}, /* A68C */ + {0xA68E,0xA68F},{0xA68E,0xA68F}, /* A68E */ + {0xA690,0xA691},{0xA690,0xA691}, /* A690 */ + {0xA692,0xA693},{0xA692,0xA693}, /* A692 */ + {0xA694,0xA695},{0xA694,0xA695}, /* A694 */ + {0xA696,0xA697},{0xA696,0xA697}, /* A696 */ + {0xA698,0xA699},{0xA698,0xA699}, /* A698 */ + {0xA69A,0xA69B},{0xA69A,0xA69B}, /* A69A */ + {0xA69C,0xA69C},{0xA69D,0xA69D}, /* A69C */ + {0xA69E,0xA69E},{0xA69F,0xA69F}, /* A69E */ + {0xA6A0,0xA6A0},{0xA6A1,0xA6A1}, /* A6A0 */ + {0xA6A2,0xA6A2},{0xA6A3,0xA6A3}, /* A6A2 */ + {0xA6A4,0xA6A4},{0xA6A5,0xA6A5}, /* A6A4 */ + {0xA6A6,0xA6A6},{0xA6A7,0xA6A7}, /* A6A6 */ + {0xA6A8,0xA6A8},{0xA6A9,0xA6A9}, /* A6A8 */ + {0xA6AA,0xA6AA},{0xA6AB,0xA6AB}, /* A6AA */ + {0xA6AC,0xA6AC},{0xA6AD,0xA6AD}, /* A6AC */ + {0xA6AE,0xA6AE},{0xA6AF,0xA6AF}, /* A6AE */ + {0xA6B0,0xA6B0},{0xA6B1,0xA6B1}, /* A6B0 */ + {0xA6B2,0xA6B2},{0xA6B3,0xA6B3}, /* A6B2 */ + {0xA6B4,0xA6B4},{0xA6B5,0xA6B5}, /* A6B4 */ + {0xA6B6,0xA6B6},{0xA6B7,0xA6B7}, /* A6B6 */ + {0xA6B8,0xA6B8},{0xA6B9,0xA6B9}, /* A6B8 */ + {0xA6BA,0xA6BA},{0xA6BB,0xA6BB}, /* A6BA */ + {0xA6BC,0xA6BC},{0xA6BD,0xA6BD}, /* A6BC */ + {0xA6BE,0xA6BE},{0xA6BF,0xA6BF}, /* A6BE */ + {0xA6C0,0xA6C0},{0xA6C1,0xA6C1}, /* A6C0 */ + {0xA6C2,0xA6C2},{0xA6C3,0xA6C3}, /* A6C2 */ + {0xA6C4,0xA6C4},{0xA6C5,0xA6C5}, /* A6C4 */ + {0xA6C6,0xA6C6},{0xA6C7,0xA6C7}, /* A6C6 */ + {0xA6C8,0xA6C8},{0xA6C9,0xA6C9}, /* A6C8 */ + {0xA6CA,0xA6CA},{0xA6CB,0xA6CB}, /* A6CA */ + {0xA6CC,0xA6CC},{0xA6CD,0xA6CD}, /* A6CC */ + {0xA6CE,0xA6CE},{0xA6CF,0xA6CF}, /* A6CE */ + {0xA6D0,0xA6D0},{0xA6D1,0xA6D1}, /* A6D0 */ + {0xA6D2,0xA6D2},{0xA6D3,0xA6D3}, /* A6D2 */ + {0xA6D4,0xA6D4},{0xA6D5,0xA6D5}, /* A6D4 */ + {0xA6D6,0xA6D6},{0xA6D7,0xA6D7}, /* A6D6 */ + {0xA6D8,0xA6D8},{0xA6D9,0xA6D9}, /* A6D8 */ + {0xA6DA,0xA6DA},{0xA6DB,0xA6DB}, /* A6DA */ + {0xA6DC,0xA6DC},{0xA6DD,0xA6DD}, /* A6DC */ + {0xA6DE,0xA6DE},{0xA6DF,0xA6DF}, /* A6DE */ + {0xA6E0,0xA6E0},{0xA6E1,0xA6E1}, /* A6E0 */ + {0xA6E2,0xA6E2},{0xA6E3,0xA6E3}, /* A6E2 */ + {0xA6E4,0xA6E4},{0xA6E5,0xA6E5}, /* A6E4 */ + {0xA6E6,0xA6E6},{0xA6E7,0xA6E7}, /* A6E6 */ + {0xA6E8,0xA6E8},{0xA6E9,0xA6E9}, /* A6E8 */ + {0xA6EA,0xA6EA},{0xA6EB,0xA6EB}, /* A6EA */ + {0xA6EC,0xA6EC},{0xA6ED,0xA6ED}, /* A6EC */ + {0xA6EE,0xA6EE},{0xA6EF,0xA6EF}, /* A6EE */ + {0xA6F0,0xA6F0},{0xA6F1,0xA6F1}, /* A6F0 */ + {0xA6F2,0xA6F2},{0xA6F3,0xA6F3}, /* A6F2 */ + {0xA6F4,0xA6F4},{0xA6F5,0xA6F5}, /* A6F4 */ + {0xA6F6,0xA6F6},{0xA6F7,0xA6F7}, /* A6F6 */ + {0xA6F8,0xA6F8},{0xA6F9,0xA6F9}, /* A6F8 */ + {0xA6FA,0xA6FA},{0xA6FB,0xA6FB}, /* A6FA */ + {0xA6FC,0xA6FC},{0xA6FD,0xA6FD}, /* A6FC */ + {0xA6FE,0xA6FE},{0xA6FF,0xA6FF} /* A6FE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_pageA7[256]={ + {0xA700,0xA700},{0xA701,0xA701}, /* A700 */ + {0xA702,0xA702},{0xA703,0xA703}, /* A702 */ + {0xA704,0xA704},{0xA705,0xA705}, /* A704 */ + {0xA706,0xA706},{0xA707,0xA707}, /* A706 */ + {0xA708,0xA708},{0xA709,0xA709}, /* A708 */ + {0xA70A,0xA70A},{0xA70B,0xA70B}, /* A70A */ + {0xA70C,0xA70C},{0xA70D,0xA70D}, /* A70C */ + {0xA70E,0xA70E},{0xA70F,0xA70F}, /* A70E */ + {0xA710,0xA710},{0xA711,0xA711}, /* A710 */ + {0xA712,0xA712},{0xA713,0xA713}, /* A712 */ + {0xA714,0xA714},{0xA715,0xA715}, /* A714 */ + {0xA716,0xA716},{0xA717,0xA717}, /* A716 */ + {0xA718,0xA718},{0xA719,0xA719}, /* A718 */ + {0xA71A,0xA71A},{0xA71B,0xA71B}, /* A71A */ + {0xA71C,0xA71C},{0xA71D,0xA71D}, /* A71C */ + {0xA71E,0xA71E},{0xA71F,0xA71F}, /* A71E */ + {0xA720,0xA720},{0xA721,0xA721}, /* A720 */ + {0xA722,0xA723},{0xA722,0xA723}, /* A722 */ + {0xA724,0xA725},{0xA724,0xA725}, /* A724 */ + {0xA726,0xA727},{0xA726,0xA727}, /* A726 */ + {0xA728,0xA729},{0xA728,0xA729}, /* A728 */ + {0xA72A,0xA72B},{0xA72A,0xA72B}, /* A72A */ + {0xA72C,0xA72D},{0xA72C,0xA72D}, /* A72C */ + {0xA72E,0xA72F},{0xA72E,0xA72F}, /* A72E */ + {0xA730,0xA730},{0xA731,0xA731}, /* A730 */ + {0xA732,0xA733},{0xA732,0xA733}, /* A732 */ + {0xA734,0xA735},{0xA734,0xA735}, /* A734 */ + {0xA736,0xA737},{0xA736,0xA737}, /* A736 */ + {0xA738,0xA739},{0xA738,0xA739}, /* A738 */ + {0xA73A,0xA73B},{0xA73A,0xA73B}, /* A73A */ + {0xA73C,0xA73D},{0xA73C,0xA73D}, /* A73C */ + {0xA73E,0xA73F},{0xA73E,0xA73F}, /* A73E */ + {0xA740,0xA741},{0xA740,0xA741}, /* A740 */ + {0xA742,0xA743},{0xA742,0xA743}, /* A742 */ + {0xA744,0xA745},{0xA744,0xA745}, /* A744 */ + {0xA746,0xA747},{0xA746,0xA747}, /* A746 */ + {0xA748,0xA749},{0xA748,0xA749}, /* A748 */ + {0xA74A,0xA74B},{0xA74A,0xA74B}, /* A74A */ + {0xA74C,0xA74D},{0xA74C,0xA74D}, /* A74C */ + {0xA74E,0xA74F},{0xA74E,0xA74F}, /* A74E */ + {0xA750,0xA751},{0xA750,0xA751}, /* A750 */ + {0xA752,0xA753},{0xA752,0xA753}, /* A752 */ + {0xA754,0xA755},{0xA754,0xA755}, /* A754 */ + {0xA756,0xA757},{0xA756,0xA757}, /* A756 */ + {0xA758,0xA759},{0xA758,0xA759}, /* A758 */ + {0xA75A,0xA75B},{0xA75A,0xA75B}, /* A75A */ + {0xA75C,0xA75D},{0xA75C,0xA75D}, /* A75C */ + {0xA75E,0xA75F},{0xA75E,0xA75F}, /* A75E */ + {0xA760,0xA761},{0xA760,0xA761}, /* A760 */ + {0xA762,0xA763},{0xA762,0xA763}, /* A762 */ + {0xA764,0xA765},{0xA764,0xA765}, /* A764 */ + {0xA766,0xA767},{0xA766,0xA767}, /* A766 */ + {0xA768,0xA769},{0xA768,0xA769}, /* A768 */ + {0xA76A,0xA76B},{0xA76A,0xA76B}, /* A76A */ + {0xA76C,0xA76D},{0xA76C,0xA76D}, /* A76C */ + {0xA76E,0xA76F},{0xA76E,0xA76F}, /* A76E */ + {0xA770,0xA770},{0xA771,0xA771}, /* A770 */ + {0xA772,0xA772},{0xA773,0xA773}, /* A772 */ + {0xA774,0xA774},{0xA775,0xA775}, /* A774 */ + {0xA776,0xA776},{0xA777,0xA777}, /* A776 */ + {0xA778,0xA778},{0xA779,0xA77A}, /* A778 */ + {0xA779,0xA77A},{0xA77B,0xA77C}, /* A77A */ + {0xA77B,0xA77C},{0xA77D,0x1D79}, /* A77C */ + {0xA77E,0xA77F},{0xA77E,0xA77F}, /* A77E */ + {0xA780,0xA781},{0xA780,0xA781}, /* A780 */ + {0xA782,0xA783},{0xA782,0xA783}, /* A782 */ + {0xA784,0xA785},{0xA784,0xA785}, /* A784 */ + {0xA786,0xA787},{0xA786,0xA787}, /* A786 */ + {0xA788,0xA788},{0xA789,0xA789}, /* A788 */ + {0xA78A,0xA78A},{0xA78B,0xA78C}, /* A78A */ + {0xA78B,0xA78C},{0xA78D,0x0265}, /* A78C */ + {0xA78E,0xA78E},{0xA78F,0xA78F}, /* A78E */ + {0xA790,0xA791},{0xA790,0xA791}, /* A790 */ + {0xA792,0xA793},{0xA792,0xA793}, /* A792 */ + {0xA7C4,0xA794},{0xA795,0xA795}, /* A794 */ + {0xA796,0xA797},{0xA796,0xA797}, /* A796 */ + {0xA798,0xA799},{0xA798,0xA799}, /* A798 */ + {0xA79A,0xA79B},{0xA79A,0xA79B}, /* A79A */ + {0xA79C,0xA79D},{0xA79C,0xA79D}, /* A79C */ + {0xA79E,0xA79F},{0xA79E,0xA79F}, /* A79E */ + {0xA7A0,0xA7A1},{0xA7A0,0xA7A1}, /* A7A0 */ + {0xA7A2,0xA7A3},{0xA7A2,0xA7A3}, /* A7A2 */ + {0xA7A4,0xA7A5},{0xA7A4,0xA7A5}, /* A7A4 */ + {0xA7A6,0xA7A7},{0xA7A6,0xA7A7}, /* A7A6 */ + {0xA7A8,0xA7A9},{0xA7A8,0xA7A9}, /* A7A8 */ + {0xA7AA,0x0266},{0xA7AB,0x025C}, /* A7AA */ + {0xA7AC,0x0261},{0xA7AD,0x026C}, /* A7AC */ + {0xA7AE,0x026A},{0xA7AF,0xA7AF}, /* A7AE */ + {0xA7B0,0x029E},{0xA7B1,0x0287}, /* A7B0 */ + {0xA7B2,0x029D},{0xA7B3,0xAB53}, /* A7B2 */ + {0xA7B4,0xA7B5},{0xA7B4,0xA7B5}, /* A7B4 */ + {0xA7B6,0xA7B7},{0xA7B6,0xA7B7}, /* A7B6 */ + {0xA7B8,0xA7B9},{0xA7B8,0xA7B9}, /* A7B8 */ + {0xA7BA,0xA7BB},{0xA7BA,0xA7BB}, /* A7BA */ + {0xA7BC,0xA7BD},{0xA7BC,0xA7BD}, /* A7BC */ + {0xA7BE,0xA7BF},{0xA7BE,0xA7BF}, /* A7BE */ + {0xA7C0,0xA7C1},{0xA7C0,0xA7C1}, /* A7C0 */ + {0xA7C2,0xA7C3},{0xA7C2,0xA7C3}, /* A7C2 */ + {0xA7C4,0xA794},{0xA7C5,0x0282}, /* A7C4 */ + {0xA7C6,0x1D8E},{0xA7C7,0xA7C8}, /* A7C6 */ + {0xA7C7,0xA7C8},{0xA7C9,0xA7CA}, /* A7C8 */ + {0xA7C9,0xA7CA},{0xA7CB,0xA7CB}, /* A7CA */ + {0xA7CC,0xA7CC},{0xA7CD,0xA7CD}, /* A7CC */ + {0xA7CE,0xA7CE},{0xA7CF,0xA7CF}, /* A7CE */ + {0xA7D0,0xA7D1},{0xA7D0,0xA7D1}, /* A7D0 */ + {0xA7D2,0xA7D2},{0xA7D3,0xA7D3}, /* A7D2 */ + {0xA7D4,0xA7D4},{0xA7D5,0xA7D5}, /* A7D4 */ + {0xA7D6,0xA7D7},{0xA7D6,0xA7D7}, /* A7D6 */ + {0xA7D8,0xA7D9},{0xA7D8,0xA7D9}, /* A7D8 */ + {0xA7DA,0xA7DA},{0xA7DB,0xA7DB}, /* A7DA */ + {0xA7DC,0xA7DC},{0xA7DD,0xA7DD}, /* A7DC */ + {0xA7DE,0xA7DE},{0xA7DF,0xA7DF}, /* A7DE */ + {0xA7E0,0xA7E0},{0xA7E1,0xA7E1}, /* A7E0 */ + {0xA7E2,0xA7E2},{0xA7E3,0xA7E3}, /* A7E2 */ + {0xA7E4,0xA7E4},{0xA7E5,0xA7E5}, /* A7E4 */ + {0xA7E6,0xA7E6},{0xA7E7,0xA7E7}, /* A7E6 */ + {0xA7E8,0xA7E8},{0xA7E9,0xA7E9}, /* A7E8 */ + {0xA7EA,0xA7EA},{0xA7EB,0xA7EB}, /* A7EA */ + {0xA7EC,0xA7EC},{0xA7ED,0xA7ED}, /* A7EC */ + {0xA7EE,0xA7EE},{0xA7EF,0xA7EF}, /* A7EE */ + {0xA7F0,0xA7F0},{0xA7F1,0xA7F1}, /* A7F0 */ + {0xA7F2,0xA7F2},{0xA7F3,0xA7F3}, /* A7F2 */ + {0xA7F4,0xA7F4},{0xA7F5,0xA7F6}, /* A7F4 */ + {0xA7F5,0xA7F6},{0xA7F7,0xA7F7}, /* A7F6 */ + {0xA7F8,0xA7F8},{0xA7F9,0xA7F9}, /* A7F8 */ + {0xA7FA,0xA7FA},{0xA7FB,0xA7FB}, /* A7FA */ + {0xA7FC,0xA7FC},{0xA7FD,0xA7FD}, /* A7FC */ + {0xA7FE,0xA7FE},{0xA7FF,0xA7FF} /* A7FE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_pageAB[256]={ + {0xAB00,0xAB00},{0xAB01,0xAB01}, /* AB00 */ + {0xAB02,0xAB02},{0xAB03,0xAB03}, /* AB02 */ + {0xAB04,0xAB04},{0xAB05,0xAB05}, /* AB04 */ + {0xAB06,0xAB06},{0xAB07,0xAB07}, /* AB06 */ + {0xAB08,0xAB08},{0xAB09,0xAB09}, /* AB08 */ + {0xAB0A,0xAB0A},{0xAB0B,0xAB0B}, /* AB0A */ + {0xAB0C,0xAB0C},{0xAB0D,0xAB0D}, /* AB0C */ + {0xAB0E,0xAB0E},{0xAB0F,0xAB0F}, /* AB0E */ + {0xAB10,0xAB10},{0xAB11,0xAB11}, /* AB10 */ + {0xAB12,0xAB12},{0xAB13,0xAB13}, /* AB12 */ + {0xAB14,0xAB14},{0xAB15,0xAB15}, /* AB14 */ + {0xAB16,0xAB16},{0xAB17,0xAB17}, /* AB16 */ + {0xAB18,0xAB18},{0xAB19,0xAB19}, /* AB18 */ + {0xAB1A,0xAB1A},{0xAB1B,0xAB1B}, /* AB1A */ + {0xAB1C,0xAB1C},{0xAB1D,0xAB1D}, /* AB1C */ + {0xAB1E,0xAB1E},{0xAB1F,0xAB1F}, /* AB1E */ + {0xAB20,0xAB20},{0xAB21,0xAB21}, /* AB20 */ + {0xAB22,0xAB22},{0xAB23,0xAB23}, /* AB22 */ + {0xAB24,0xAB24},{0xAB25,0xAB25}, /* AB24 */ + {0xAB26,0xAB26},{0xAB27,0xAB27}, /* AB26 */ + {0xAB28,0xAB28},{0xAB29,0xAB29}, /* AB28 */ + {0xAB2A,0xAB2A},{0xAB2B,0xAB2B}, /* AB2A */ + {0xAB2C,0xAB2C},{0xAB2D,0xAB2D}, /* AB2C */ + {0xAB2E,0xAB2E},{0xAB2F,0xAB2F}, /* AB2E */ + {0xAB30,0xAB30},{0xAB31,0xAB31}, /* AB30 */ + {0xAB32,0xAB32},{0xAB33,0xAB33}, /* AB32 */ + {0xAB34,0xAB34},{0xAB35,0xAB35}, /* AB34 */ + {0xAB36,0xAB36},{0xAB37,0xAB37}, /* AB36 */ + {0xAB38,0xAB38},{0xAB39,0xAB39}, /* AB38 */ + {0xAB3A,0xAB3A},{0xAB3B,0xAB3B}, /* AB3A */ + {0xAB3C,0xAB3C},{0xAB3D,0xAB3D}, /* AB3C */ + {0xAB3E,0xAB3E},{0xAB3F,0xAB3F}, /* AB3E */ + {0xAB40,0xAB40},{0xAB41,0xAB41}, /* AB40 */ + {0xAB42,0xAB42},{0xAB43,0xAB43}, /* AB42 */ + {0xAB44,0xAB44},{0xAB45,0xAB45}, /* AB44 */ + {0xAB46,0xAB46},{0xAB47,0xAB47}, /* AB46 */ + {0xAB48,0xAB48},{0xAB49,0xAB49}, /* AB48 */ + {0xAB4A,0xAB4A},{0xAB4B,0xAB4B}, /* AB4A */ + {0xAB4C,0xAB4C},{0xAB4D,0xAB4D}, /* AB4C */ + {0xAB4E,0xAB4E},{0xAB4F,0xAB4F}, /* AB4E */ + {0xAB50,0xAB50},{0xAB51,0xAB51}, /* AB50 */ + {0xAB52,0xAB52},{0xA7B3,0xAB53}, /* AB52 */ + {0xAB54,0xAB54},{0xAB55,0xAB55}, /* AB54 */ + {0xAB56,0xAB56},{0xAB57,0xAB57}, /* AB56 */ + {0xAB58,0xAB58},{0xAB59,0xAB59}, /* AB58 */ + {0xAB5A,0xAB5A},{0xAB5B,0xAB5B}, /* AB5A */ + {0xAB5C,0xAB5C},{0xAB5D,0xAB5D}, /* AB5C */ + {0xAB5E,0xAB5E},{0xAB5F,0xAB5F}, /* AB5E */ + {0xAB60,0xAB60},{0xAB61,0xAB61}, /* AB60 */ + {0xAB62,0xAB62},{0xAB63,0xAB63}, /* AB62 */ + {0xAB64,0xAB64},{0xAB65,0xAB65}, /* AB64 */ + {0xAB66,0xAB66},{0xAB67,0xAB67}, /* AB66 */ + {0xAB68,0xAB68},{0xAB69,0xAB69}, /* AB68 */ + {0xAB6A,0xAB6A},{0xAB6B,0xAB6B}, /* AB6A */ + {0xAB6C,0xAB6C},{0xAB6D,0xAB6D}, /* AB6C */ + {0xAB6E,0xAB6E},{0xAB6F,0xAB6F}, /* AB6E */ + {0x13A0,0xAB70},{0x13A1,0xAB71}, /* AB70 */ + {0x13A2,0xAB72},{0x13A3,0xAB73}, /* AB72 */ + {0x13A4,0xAB74},{0x13A5,0xAB75}, /* AB74 */ + {0x13A6,0xAB76},{0x13A7,0xAB77}, /* AB76 */ + {0x13A8,0xAB78},{0x13A9,0xAB79}, /* AB78 */ + {0x13AA,0xAB7A},{0x13AB,0xAB7B}, /* AB7A */ + {0x13AC,0xAB7C},{0x13AD,0xAB7D}, /* AB7C */ + {0x13AE,0xAB7E},{0x13AF,0xAB7F}, /* AB7E */ + {0x13B0,0xAB80},{0x13B1,0xAB81}, /* AB80 */ + {0x13B2,0xAB82},{0x13B3,0xAB83}, /* AB82 */ + {0x13B4,0xAB84},{0x13B5,0xAB85}, /* AB84 */ + {0x13B6,0xAB86},{0x13B7,0xAB87}, /* AB86 */ + {0x13B8,0xAB88},{0x13B9,0xAB89}, /* AB88 */ + {0x13BA,0xAB8A},{0x13BB,0xAB8B}, /* AB8A */ + {0x13BC,0xAB8C},{0x13BD,0xAB8D}, /* AB8C */ + {0x13BE,0xAB8E},{0x13BF,0xAB8F}, /* AB8E */ + {0x13C0,0xAB90},{0x13C1,0xAB91}, /* AB90 */ + {0x13C2,0xAB92},{0x13C3,0xAB93}, /* AB92 */ + {0x13C4,0xAB94},{0x13C5,0xAB95}, /* AB94 */ + {0x13C6,0xAB96},{0x13C7,0xAB97}, /* AB96 */ + {0x13C8,0xAB98},{0x13C9,0xAB99}, /* AB98 */ + {0x13CA,0xAB9A},{0x13CB,0xAB9B}, /* AB9A */ + {0x13CC,0xAB9C},{0x13CD,0xAB9D}, /* AB9C */ + {0x13CE,0xAB9E},{0x13CF,0xAB9F}, /* AB9E */ + {0x13D0,0xABA0},{0x13D1,0xABA1}, /* ABA0 */ + {0x13D2,0xABA2},{0x13D3,0xABA3}, /* ABA2 */ + {0x13D4,0xABA4},{0x13D5,0xABA5}, /* ABA4 */ + {0x13D6,0xABA6},{0x13D7,0xABA7}, /* ABA6 */ + {0x13D8,0xABA8},{0x13D9,0xABA9}, /* ABA8 */ + {0x13DA,0xABAA},{0x13DB,0xABAB}, /* ABAA */ + {0x13DC,0xABAC},{0x13DD,0xABAD}, /* ABAC */ + {0x13DE,0xABAE},{0x13DF,0xABAF}, /* ABAE */ + {0x13E0,0xABB0},{0x13E1,0xABB1}, /* ABB0 */ + {0x13E2,0xABB2},{0x13E3,0xABB3}, /* ABB2 */ + {0x13E4,0xABB4},{0x13E5,0xABB5}, /* ABB4 */ + {0x13E6,0xABB6},{0x13E7,0xABB7}, /* ABB6 */ + {0x13E8,0xABB8},{0x13E9,0xABB9}, /* ABB8 */ + {0x13EA,0xABBA},{0x13EB,0xABBB}, /* ABBA */ + {0x13EC,0xABBC},{0x13ED,0xABBD}, /* ABBC */ + {0x13EE,0xABBE},{0x13EF,0xABBF}, /* ABBE */ + {0xABC0,0xABC0},{0xABC1,0xABC1}, /* ABC0 */ + {0xABC2,0xABC2},{0xABC3,0xABC3}, /* ABC2 */ + {0xABC4,0xABC4},{0xABC5,0xABC5}, /* ABC4 */ + {0xABC6,0xABC6},{0xABC7,0xABC7}, /* ABC6 */ + {0xABC8,0xABC8},{0xABC9,0xABC9}, /* ABC8 */ + {0xABCA,0xABCA},{0xABCB,0xABCB}, /* ABCA */ + {0xABCC,0xABCC},{0xABCD,0xABCD}, /* ABCC */ + {0xABCE,0xABCE},{0xABCF,0xABCF}, /* ABCE */ + {0xABD0,0xABD0},{0xABD1,0xABD1}, /* ABD0 */ + {0xABD2,0xABD2},{0xABD3,0xABD3}, /* ABD2 */ + {0xABD4,0xABD4},{0xABD5,0xABD5}, /* ABD4 */ + {0xABD6,0xABD6},{0xABD7,0xABD7}, /* ABD6 */ + {0xABD8,0xABD8},{0xABD9,0xABD9}, /* ABD8 */ + {0xABDA,0xABDA},{0xABDB,0xABDB}, /* ABDA */ + {0xABDC,0xABDC},{0xABDD,0xABDD}, /* ABDC */ + {0xABDE,0xABDE},{0xABDF,0xABDF}, /* ABDE */ + {0xABE0,0xABE0},{0xABE1,0xABE1}, /* ABE0 */ + {0xABE2,0xABE2},{0xABE3,0xABE3}, /* ABE2 */ + {0xABE4,0xABE4},{0xABE5,0xABE5}, /* ABE4 */ + {0xABE6,0xABE6},{0xABE7,0xABE7}, /* ABE6 */ + {0xABE8,0xABE8},{0xABE9,0xABE9}, /* ABE8 */ + {0xABEA,0xABEA},{0xABEB,0xABEB}, /* ABEA */ + {0xABEC,0xABEC},{0xABED,0xABED}, /* ABEC */ + {0xABEE,0xABEE},{0xABEF,0xABEF}, /* ABEE */ + {0xABF0,0xABF0},{0xABF1,0xABF1}, /* ABF0 */ + {0xABF2,0xABF2},{0xABF3,0xABF3}, /* ABF2 */ + {0xABF4,0xABF4},{0xABF5,0xABF5}, /* ABF4 */ + {0xABF6,0xABF6},{0xABF7,0xABF7}, /* ABF6 */ + {0xABF8,0xABF8},{0xABF9,0xABF9}, /* ABF8 */ + {0xABFA,0xABFA},{0xABFB,0xABFB}, /* ABFA */ + {0xABFC,0xABFC},{0xABFD,0xABFD}, /* ABFC */ + {0xABFE,0xABFE},{0xABFF,0xABFF} /* ABFE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_pageFF[256]={ + {0xFF00,0xFF00},{0xFF01,0xFF01}, /* FF00 */ + {0xFF02,0xFF02},{0xFF03,0xFF03}, /* FF02 */ + {0xFF04,0xFF04},{0xFF05,0xFF05}, /* FF04 */ + {0xFF06,0xFF06},{0xFF07,0xFF07}, /* FF06 */ + {0xFF08,0xFF08},{0xFF09,0xFF09}, /* FF08 */ + {0xFF0A,0xFF0A},{0xFF0B,0xFF0B}, /* FF0A */ + {0xFF0C,0xFF0C},{0xFF0D,0xFF0D}, /* FF0C */ + {0xFF0E,0xFF0E},{0xFF0F,0xFF0F}, /* FF0E */ + {0xFF10,0xFF10},{0xFF11,0xFF11}, /* FF10 */ + {0xFF12,0xFF12},{0xFF13,0xFF13}, /* FF12 */ + {0xFF14,0xFF14},{0xFF15,0xFF15}, /* FF14 */ + {0xFF16,0xFF16},{0xFF17,0xFF17}, /* FF16 */ + {0xFF18,0xFF18},{0xFF19,0xFF19}, /* FF18 */ + {0xFF1A,0xFF1A},{0xFF1B,0xFF1B}, /* FF1A */ + {0xFF1C,0xFF1C},{0xFF1D,0xFF1D}, /* FF1C */ + {0xFF1E,0xFF1E},{0xFF1F,0xFF1F}, /* FF1E */ + {0xFF20,0xFF20},{0xFF21,0xFF41}, /* FF20 */ + {0xFF22,0xFF42},{0xFF23,0xFF43}, /* FF22 */ + {0xFF24,0xFF44},{0xFF25,0xFF45}, /* FF24 */ + {0xFF26,0xFF46},{0xFF27,0xFF47}, /* FF26 */ + {0xFF28,0xFF48},{0xFF29,0xFF49}, /* FF28 */ + {0xFF2A,0xFF4A},{0xFF2B,0xFF4B}, /* FF2A */ + {0xFF2C,0xFF4C},{0xFF2D,0xFF4D}, /* FF2C */ + {0xFF2E,0xFF4E},{0xFF2F,0xFF4F}, /* FF2E */ + {0xFF30,0xFF50},{0xFF31,0xFF51}, /* FF30 */ + {0xFF32,0xFF52},{0xFF33,0xFF53}, /* FF32 */ + {0xFF34,0xFF54},{0xFF35,0xFF55}, /* FF34 */ + {0xFF36,0xFF56},{0xFF37,0xFF57}, /* FF36 */ + {0xFF38,0xFF58},{0xFF39,0xFF59}, /* FF38 */ + {0xFF3A,0xFF5A},{0xFF3B,0xFF3B}, /* FF3A */ + {0xFF3C,0xFF3C},{0xFF3D,0xFF3D}, /* FF3C */ + {0xFF3E,0xFF3E},{0xFF3F,0xFF3F}, /* FF3E */ + {0xFF40,0xFF40},{0xFF21,0xFF41}, /* FF40 */ + {0xFF22,0xFF42},{0xFF23,0xFF43}, /* FF42 */ + {0xFF24,0xFF44},{0xFF25,0xFF45}, /* FF44 */ + {0xFF26,0xFF46},{0xFF27,0xFF47}, /* FF46 */ + {0xFF28,0xFF48},{0xFF29,0xFF49}, /* FF48 */ + {0xFF2A,0xFF4A},{0xFF2B,0xFF4B}, /* FF4A */ + {0xFF2C,0xFF4C},{0xFF2D,0xFF4D}, /* FF4C */ + {0xFF2E,0xFF4E},{0xFF2F,0xFF4F}, /* FF4E */ + {0xFF30,0xFF50},{0xFF31,0xFF51}, /* FF50 */ + {0xFF32,0xFF52},{0xFF33,0xFF53}, /* FF52 */ + {0xFF34,0xFF54},{0xFF35,0xFF55}, /* FF54 */ + {0xFF36,0xFF56},{0xFF37,0xFF57}, /* FF56 */ + {0xFF38,0xFF58},{0xFF39,0xFF59}, /* FF58 */ + {0xFF3A,0xFF5A},{0xFF5B,0xFF5B}, /* FF5A */ + {0xFF5C,0xFF5C},{0xFF5D,0xFF5D}, /* FF5C */ + {0xFF5E,0xFF5E},{0xFF5F,0xFF5F}, /* FF5E */ + {0xFF60,0xFF60},{0xFF61,0xFF61}, /* FF60 */ + {0xFF62,0xFF62},{0xFF63,0xFF63}, /* FF62 */ + {0xFF64,0xFF64},{0xFF65,0xFF65}, /* FF64 */ + {0xFF66,0xFF66},{0xFF67,0xFF67}, /* FF66 */ + {0xFF68,0xFF68},{0xFF69,0xFF69}, /* FF68 */ + {0xFF6A,0xFF6A},{0xFF6B,0xFF6B}, /* FF6A */ + {0xFF6C,0xFF6C},{0xFF6D,0xFF6D}, /* FF6C */ + {0xFF6E,0xFF6E},{0xFF6F,0xFF6F}, /* FF6E */ + {0xFF70,0xFF70},{0xFF71,0xFF71}, /* FF70 */ + {0xFF72,0xFF72},{0xFF73,0xFF73}, /* FF72 */ + {0xFF74,0xFF74},{0xFF75,0xFF75}, /* FF74 */ + {0xFF76,0xFF76},{0xFF77,0xFF77}, /* FF76 */ + {0xFF78,0xFF78},{0xFF79,0xFF79}, /* FF78 */ + {0xFF7A,0xFF7A},{0xFF7B,0xFF7B}, /* FF7A */ + {0xFF7C,0xFF7C},{0xFF7D,0xFF7D}, /* FF7C */ + {0xFF7E,0xFF7E},{0xFF7F,0xFF7F}, /* FF7E */ + {0xFF80,0xFF80},{0xFF81,0xFF81}, /* FF80 */ + {0xFF82,0xFF82},{0xFF83,0xFF83}, /* FF82 */ + {0xFF84,0xFF84},{0xFF85,0xFF85}, /* FF84 */ + {0xFF86,0xFF86},{0xFF87,0xFF87}, /* FF86 */ + {0xFF88,0xFF88},{0xFF89,0xFF89}, /* FF88 */ + {0xFF8A,0xFF8A},{0xFF8B,0xFF8B}, /* FF8A */ + {0xFF8C,0xFF8C},{0xFF8D,0xFF8D}, /* FF8C */ + {0xFF8E,0xFF8E},{0xFF8F,0xFF8F}, /* FF8E */ + {0xFF90,0xFF90},{0xFF91,0xFF91}, /* FF90 */ + {0xFF92,0xFF92},{0xFF93,0xFF93}, /* FF92 */ + {0xFF94,0xFF94},{0xFF95,0xFF95}, /* FF94 */ + {0xFF96,0xFF96},{0xFF97,0xFF97}, /* FF96 */ + {0xFF98,0xFF98},{0xFF99,0xFF99}, /* FF98 */ + {0xFF9A,0xFF9A},{0xFF9B,0xFF9B}, /* FF9A */ + {0xFF9C,0xFF9C},{0xFF9D,0xFF9D}, /* FF9C */ + {0xFF9E,0xFF9E},{0xFF9F,0xFF9F}, /* FF9E */ + {0xFFA0,0xFFA0},{0xFFA1,0xFFA1}, /* FFA0 */ + {0xFFA2,0xFFA2},{0xFFA3,0xFFA3}, /* FFA2 */ + {0xFFA4,0xFFA4},{0xFFA5,0xFFA5}, /* FFA4 */ + {0xFFA6,0xFFA6},{0xFFA7,0xFFA7}, /* FFA6 */ + {0xFFA8,0xFFA8},{0xFFA9,0xFFA9}, /* FFA8 */ + {0xFFAA,0xFFAA},{0xFFAB,0xFFAB}, /* FFAA */ + {0xFFAC,0xFFAC},{0xFFAD,0xFFAD}, /* FFAC */ + {0xFFAE,0xFFAE},{0xFFAF,0xFFAF}, /* FFAE */ + {0xFFB0,0xFFB0},{0xFFB1,0xFFB1}, /* FFB0 */ + {0xFFB2,0xFFB2},{0xFFB3,0xFFB3}, /* FFB2 */ + {0xFFB4,0xFFB4},{0xFFB5,0xFFB5}, /* FFB4 */ + {0xFFB6,0xFFB6},{0xFFB7,0xFFB7}, /* FFB6 */ + {0xFFB8,0xFFB8},{0xFFB9,0xFFB9}, /* FFB8 */ + {0xFFBA,0xFFBA},{0xFFBB,0xFFBB}, /* FFBA */ + {0xFFBC,0xFFBC},{0xFFBD,0xFFBD}, /* FFBC */ + {0xFFBE,0xFFBE},{0xFFBF,0xFFBF}, /* FFBE */ + {0xFFC0,0xFFC0},{0xFFC1,0xFFC1}, /* FFC0 */ + {0xFFC2,0xFFC2},{0xFFC3,0xFFC3}, /* FFC2 */ + {0xFFC4,0xFFC4},{0xFFC5,0xFFC5}, /* FFC4 */ + {0xFFC6,0xFFC6},{0xFFC7,0xFFC7}, /* FFC6 */ + {0xFFC8,0xFFC8},{0xFFC9,0xFFC9}, /* FFC8 */ + {0xFFCA,0xFFCA},{0xFFCB,0xFFCB}, /* FFCA */ + {0xFFCC,0xFFCC},{0xFFCD,0xFFCD}, /* FFCC */ + {0xFFCE,0xFFCE},{0xFFCF,0xFFCF}, /* FFCE */ + {0xFFD0,0xFFD0},{0xFFD1,0xFFD1}, /* FFD0 */ + {0xFFD2,0xFFD2},{0xFFD3,0xFFD3}, /* FFD2 */ + {0xFFD4,0xFFD4},{0xFFD5,0xFFD5}, /* FFD4 */ + {0xFFD6,0xFFD6},{0xFFD7,0xFFD7}, /* FFD6 */ + {0xFFD8,0xFFD8},{0xFFD9,0xFFD9}, /* FFD8 */ + {0xFFDA,0xFFDA},{0xFFDB,0xFFDB}, /* FFDA */ + {0xFFDC,0xFFDC},{0xFFDD,0xFFDD}, /* FFDC */ + {0xFFDE,0xFFDE},{0xFFDF,0xFFDF}, /* FFDE */ + {0xFFE0,0xFFE0},{0xFFE1,0xFFE1}, /* FFE0 */ + {0xFFE2,0xFFE2},{0xFFE3,0xFFE3}, /* FFE2 */ + {0xFFE4,0xFFE4},{0xFFE5,0xFFE5}, /* FFE4 */ + {0xFFE6,0xFFE6},{0xFFE7,0xFFE7}, /* FFE6 */ + {0xFFE8,0xFFE8},{0xFFE9,0xFFE9}, /* FFE8 */ + {0xFFEA,0xFFEA},{0xFFEB,0xFFEB}, /* FFEA */ + {0xFFEC,0xFFEC},{0xFFED,0xFFED}, /* FFEC */ + {0xFFEE,0xFFEE},{0xFFEF,0xFFEF}, /* FFEE */ + {0xFFF0,0xFFF0},{0xFFF1,0xFFF1}, /* FFF0 */ + {0xFFF2,0xFFF2},{0xFFF3,0xFFF3}, /* FFF2 */ + {0xFFF4,0xFFF4},{0xFFF5,0xFFF5}, /* FFF4 */ + {0xFFF6,0xFFF6},{0xFFF7,0xFFF7}, /* FFF6 */ + {0xFFF8,0xFFF8},{0xFFF9,0xFFF9}, /* FFF8 */ + {0xFFFA,0xFFFA},{0xFFFB,0xFFFB}, /* FFFA */ + {0xFFFC,0xFFFC},{0xFFFD,0xFFFD}, /* FFFC */ + {0xFFFE,0xFFFE},{0xFFFF,0xFFFF} /* FFFE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page104[256]={ + {0x10400,0x10428},{0x10401,0x10429}, /* 10400 */ + {0x10402,0x1042A},{0x10403,0x1042B}, /* 10402 */ + {0x10404,0x1042C},{0x10405,0x1042D}, /* 10404 */ + {0x10406,0x1042E},{0x10407,0x1042F}, /* 10406 */ + {0x10408,0x10430},{0x10409,0x10431}, /* 10408 */ + {0x1040A,0x10432},{0x1040B,0x10433}, /* 1040A */ + {0x1040C,0x10434},{0x1040D,0x10435}, /* 1040C */ + {0x1040E,0x10436},{0x1040F,0x10437}, /* 1040E */ + {0x10410,0x10438},{0x10411,0x10439}, /* 10410 */ + {0x10412,0x1043A},{0x10413,0x1043B}, /* 10412 */ + {0x10414,0x1043C},{0x10415,0x1043D}, /* 10414 */ + {0x10416,0x1043E},{0x10417,0x1043F}, /* 10416 */ + {0x10418,0x10440},{0x10419,0x10441}, /* 10418 */ + {0x1041A,0x10442},{0x1041B,0x10443}, /* 1041A */ + {0x1041C,0x10444},{0x1041D,0x10445}, /* 1041C */ + {0x1041E,0x10446},{0x1041F,0x10447}, /* 1041E */ + {0x10420,0x10448},{0x10421,0x10449}, /* 10420 */ + {0x10422,0x1044A},{0x10423,0x1044B}, /* 10422 */ + {0x10424,0x1044C},{0x10425,0x1044D}, /* 10424 */ + {0x10426,0x1044E},{0x10427,0x1044F}, /* 10426 */ + {0x10400,0x10428},{0x10401,0x10429}, /* 10428 */ + {0x10402,0x1042A},{0x10403,0x1042B}, /* 1042A */ + {0x10404,0x1042C},{0x10405,0x1042D}, /* 1042C */ + {0x10406,0x1042E},{0x10407,0x1042F}, /* 1042E */ + {0x10408,0x10430},{0x10409,0x10431}, /* 10430 */ + {0x1040A,0x10432},{0x1040B,0x10433}, /* 10432 */ + {0x1040C,0x10434},{0x1040D,0x10435}, /* 10434 */ + {0x1040E,0x10436},{0x1040F,0x10437}, /* 10436 */ + {0x10410,0x10438},{0x10411,0x10439}, /* 10438 */ + {0x10412,0x1043A},{0x10413,0x1043B}, /* 1043A */ + {0x10414,0x1043C},{0x10415,0x1043D}, /* 1043C */ + {0x10416,0x1043E},{0x10417,0x1043F}, /* 1043E */ + {0x10418,0x10440},{0x10419,0x10441}, /* 10440 */ + {0x1041A,0x10442},{0x1041B,0x10443}, /* 10442 */ + {0x1041C,0x10444},{0x1041D,0x10445}, /* 10444 */ + {0x1041E,0x10446},{0x1041F,0x10447}, /* 10446 */ + {0x10420,0x10448},{0x10421,0x10449}, /* 10448 */ + {0x10422,0x1044A},{0x10423,0x1044B}, /* 1044A */ + {0x10424,0x1044C},{0x10425,0x1044D}, /* 1044C */ + {0x10426,0x1044E},{0x10427,0x1044F}, /* 1044E */ + {0x10450,0x10450},{0x10451,0x10451}, /* 10450 */ + {0x10452,0x10452},{0x10453,0x10453}, /* 10452 */ + {0x10454,0x10454},{0x10455,0x10455}, /* 10454 */ + {0x10456,0x10456},{0x10457,0x10457}, /* 10456 */ + {0x10458,0x10458},{0x10459,0x10459}, /* 10458 */ + {0x1045A,0x1045A},{0x1045B,0x1045B}, /* 1045A */ + {0x1045C,0x1045C},{0x1045D,0x1045D}, /* 1045C */ + {0x1045E,0x1045E},{0x1045F,0x1045F}, /* 1045E */ + {0x10460,0x10460},{0x10461,0x10461}, /* 10460 */ + {0x10462,0x10462},{0x10463,0x10463}, /* 10462 */ + {0x10464,0x10464},{0x10465,0x10465}, /* 10464 */ + {0x10466,0x10466},{0x10467,0x10467}, /* 10466 */ + {0x10468,0x10468},{0x10469,0x10469}, /* 10468 */ + {0x1046A,0x1046A},{0x1046B,0x1046B}, /* 1046A */ + {0x1046C,0x1046C},{0x1046D,0x1046D}, /* 1046C */ + {0x1046E,0x1046E},{0x1046F,0x1046F}, /* 1046E */ + {0x10470,0x10470},{0x10471,0x10471}, /* 10470 */ + {0x10472,0x10472},{0x10473,0x10473}, /* 10472 */ + {0x10474,0x10474},{0x10475,0x10475}, /* 10474 */ + {0x10476,0x10476},{0x10477,0x10477}, /* 10476 */ + {0x10478,0x10478},{0x10479,0x10479}, /* 10478 */ + {0x1047A,0x1047A},{0x1047B,0x1047B}, /* 1047A */ + {0x1047C,0x1047C},{0x1047D,0x1047D}, /* 1047C */ + {0x1047E,0x1047E},{0x1047F,0x1047F}, /* 1047E */ + {0x10480,0x10480},{0x10481,0x10481}, /* 10480 */ + {0x10482,0x10482},{0x10483,0x10483}, /* 10482 */ + {0x10484,0x10484},{0x10485,0x10485}, /* 10484 */ + {0x10486,0x10486},{0x10487,0x10487}, /* 10486 */ + {0x10488,0x10488},{0x10489,0x10489}, /* 10488 */ + {0x1048A,0x1048A},{0x1048B,0x1048B}, /* 1048A */ + {0x1048C,0x1048C},{0x1048D,0x1048D}, /* 1048C */ + {0x1048E,0x1048E},{0x1048F,0x1048F}, /* 1048E */ + {0x10490,0x10490},{0x10491,0x10491}, /* 10490 */ + {0x10492,0x10492},{0x10493,0x10493}, /* 10492 */ + {0x10494,0x10494},{0x10495,0x10495}, /* 10494 */ + {0x10496,0x10496},{0x10497,0x10497}, /* 10496 */ + {0x10498,0x10498},{0x10499,0x10499}, /* 10498 */ + {0x1049A,0x1049A},{0x1049B,0x1049B}, /* 1049A */ + {0x1049C,0x1049C},{0x1049D,0x1049D}, /* 1049C */ + {0x1049E,0x1049E},{0x1049F,0x1049F}, /* 1049E */ + {0x104A0,0x104A0},{0x104A1,0x104A1}, /* 104A0 */ + {0x104A2,0x104A2},{0x104A3,0x104A3}, /* 104A2 */ + {0x104A4,0x104A4},{0x104A5,0x104A5}, /* 104A4 */ + {0x104A6,0x104A6},{0x104A7,0x104A7}, /* 104A6 */ + {0x104A8,0x104A8},{0x104A9,0x104A9}, /* 104A8 */ + {0x104AA,0x104AA},{0x104AB,0x104AB}, /* 104AA */ + {0x104AC,0x104AC},{0x104AD,0x104AD}, /* 104AC */ + {0x104AE,0x104AE},{0x104AF,0x104AF}, /* 104AE */ + {0x104B0,0x104D8},{0x104B1,0x104D9}, /* 104B0 */ + {0x104B2,0x104DA},{0x104B3,0x104DB}, /* 104B2 */ + {0x104B4,0x104DC},{0x104B5,0x104DD}, /* 104B4 */ + {0x104B6,0x104DE},{0x104B7,0x104DF}, /* 104B6 */ + {0x104B8,0x104E0},{0x104B9,0x104E1}, /* 104B8 */ + {0x104BA,0x104E2},{0x104BB,0x104E3}, /* 104BA */ + {0x104BC,0x104E4},{0x104BD,0x104E5}, /* 104BC */ + {0x104BE,0x104E6},{0x104BF,0x104E7}, /* 104BE */ + {0x104C0,0x104E8},{0x104C1,0x104E9}, /* 104C0 */ + {0x104C2,0x104EA},{0x104C3,0x104EB}, /* 104C2 */ + {0x104C4,0x104EC},{0x104C5,0x104ED}, /* 104C4 */ + {0x104C6,0x104EE},{0x104C7,0x104EF}, /* 104C6 */ + {0x104C8,0x104F0},{0x104C9,0x104F1}, /* 104C8 */ + {0x104CA,0x104F2},{0x104CB,0x104F3}, /* 104CA */ + {0x104CC,0x104F4},{0x104CD,0x104F5}, /* 104CC */ + {0x104CE,0x104F6},{0x104CF,0x104F7}, /* 104CE */ + {0x104D0,0x104F8},{0x104D1,0x104F9}, /* 104D0 */ + {0x104D2,0x104FA},{0x104D3,0x104FB}, /* 104D2 */ + {0x104D4,0x104D4},{0x104D5,0x104D5}, /* 104D4 */ + {0x104D6,0x104D6},{0x104D7,0x104D7}, /* 104D6 */ + {0x104B0,0x104D8},{0x104B1,0x104D9}, /* 104D8 */ + {0x104B2,0x104DA},{0x104B3,0x104DB}, /* 104DA */ + {0x104B4,0x104DC},{0x104B5,0x104DD}, /* 104DC */ + {0x104B6,0x104DE},{0x104B7,0x104DF}, /* 104DE */ + {0x104B8,0x104E0},{0x104B9,0x104E1}, /* 104E0 */ + {0x104BA,0x104E2},{0x104BB,0x104E3}, /* 104E2 */ + {0x104BC,0x104E4},{0x104BD,0x104E5}, /* 104E4 */ + {0x104BE,0x104E6},{0x104BF,0x104E7}, /* 104E6 */ + {0x104C0,0x104E8},{0x104C1,0x104E9}, /* 104E8 */ + {0x104C2,0x104EA},{0x104C3,0x104EB}, /* 104EA */ + {0x104C4,0x104EC},{0x104C5,0x104ED}, /* 104EC */ + {0x104C6,0x104EE},{0x104C7,0x104EF}, /* 104EE */ + {0x104C8,0x104F0},{0x104C9,0x104F1}, /* 104F0 */ + {0x104CA,0x104F2},{0x104CB,0x104F3}, /* 104F2 */ + {0x104CC,0x104F4},{0x104CD,0x104F5}, /* 104F4 */ + {0x104CE,0x104F6},{0x104CF,0x104F7}, /* 104F6 */ + {0x104D0,0x104F8},{0x104D1,0x104F9}, /* 104F8 */ + {0x104D2,0x104FA},{0x104D3,0x104FB}, /* 104FA */ + {0x104FC,0x104FC},{0x104FD,0x104FD}, /* 104FC */ + {0x104FE,0x104FE},{0x104FF,0x104FF} /* 104FE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page105[256]={ + {0x10500,0x10500},{0x10501,0x10501}, /* 10500 */ + {0x10502,0x10502},{0x10503,0x10503}, /* 10502 */ + {0x10504,0x10504},{0x10505,0x10505}, /* 10504 */ + {0x10506,0x10506},{0x10507,0x10507}, /* 10506 */ + {0x10508,0x10508},{0x10509,0x10509}, /* 10508 */ + {0x1050A,0x1050A},{0x1050B,0x1050B}, /* 1050A */ + {0x1050C,0x1050C},{0x1050D,0x1050D}, /* 1050C */ + {0x1050E,0x1050E},{0x1050F,0x1050F}, /* 1050E */ + {0x10510,0x10510},{0x10511,0x10511}, /* 10510 */ + {0x10512,0x10512},{0x10513,0x10513}, /* 10512 */ + {0x10514,0x10514},{0x10515,0x10515}, /* 10514 */ + {0x10516,0x10516},{0x10517,0x10517}, /* 10516 */ + {0x10518,0x10518},{0x10519,0x10519}, /* 10518 */ + {0x1051A,0x1051A},{0x1051B,0x1051B}, /* 1051A */ + {0x1051C,0x1051C},{0x1051D,0x1051D}, /* 1051C */ + {0x1051E,0x1051E},{0x1051F,0x1051F}, /* 1051E */ + {0x10520,0x10520},{0x10521,0x10521}, /* 10520 */ + {0x10522,0x10522},{0x10523,0x10523}, /* 10522 */ + {0x10524,0x10524},{0x10525,0x10525}, /* 10524 */ + {0x10526,0x10526},{0x10527,0x10527}, /* 10526 */ + {0x10528,0x10528},{0x10529,0x10529}, /* 10528 */ + {0x1052A,0x1052A},{0x1052B,0x1052B}, /* 1052A */ + {0x1052C,0x1052C},{0x1052D,0x1052D}, /* 1052C */ + {0x1052E,0x1052E},{0x1052F,0x1052F}, /* 1052E */ + {0x10530,0x10530},{0x10531,0x10531}, /* 10530 */ + {0x10532,0x10532},{0x10533,0x10533}, /* 10532 */ + {0x10534,0x10534},{0x10535,0x10535}, /* 10534 */ + {0x10536,0x10536},{0x10537,0x10537}, /* 10536 */ + {0x10538,0x10538},{0x10539,0x10539}, /* 10538 */ + {0x1053A,0x1053A},{0x1053B,0x1053B}, /* 1053A */ + {0x1053C,0x1053C},{0x1053D,0x1053D}, /* 1053C */ + {0x1053E,0x1053E},{0x1053F,0x1053F}, /* 1053E */ + {0x10540,0x10540},{0x10541,0x10541}, /* 10540 */ + {0x10542,0x10542},{0x10543,0x10543}, /* 10542 */ + {0x10544,0x10544},{0x10545,0x10545}, /* 10544 */ + {0x10546,0x10546},{0x10547,0x10547}, /* 10546 */ + {0x10548,0x10548},{0x10549,0x10549}, /* 10548 */ + {0x1054A,0x1054A},{0x1054B,0x1054B}, /* 1054A */ + {0x1054C,0x1054C},{0x1054D,0x1054D}, /* 1054C */ + {0x1054E,0x1054E},{0x1054F,0x1054F}, /* 1054E */ + {0x10550,0x10550},{0x10551,0x10551}, /* 10550 */ + {0x10552,0x10552},{0x10553,0x10553}, /* 10552 */ + {0x10554,0x10554},{0x10555,0x10555}, /* 10554 */ + {0x10556,0x10556},{0x10557,0x10557}, /* 10556 */ + {0x10558,0x10558},{0x10559,0x10559}, /* 10558 */ + {0x1055A,0x1055A},{0x1055B,0x1055B}, /* 1055A */ + {0x1055C,0x1055C},{0x1055D,0x1055D}, /* 1055C */ + {0x1055E,0x1055E},{0x1055F,0x1055F}, /* 1055E */ + {0x10560,0x10560},{0x10561,0x10561}, /* 10560 */ + {0x10562,0x10562},{0x10563,0x10563}, /* 10562 */ + {0x10564,0x10564},{0x10565,0x10565}, /* 10564 */ + {0x10566,0x10566},{0x10567,0x10567}, /* 10566 */ + {0x10568,0x10568},{0x10569,0x10569}, /* 10568 */ + {0x1056A,0x1056A},{0x1056B,0x1056B}, /* 1056A */ + {0x1056C,0x1056C},{0x1056D,0x1056D}, /* 1056C */ + {0x1056E,0x1056E},{0x1056F,0x1056F}, /* 1056E */ + {0x10570,0x10597},{0x10571,0x10598}, /* 10570 */ + {0x10572,0x10599},{0x10573,0x1059A}, /* 10572 */ + {0x10574,0x1059B},{0x10575,0x1059C}, /* 10574 */ + {0x10576,0x1059D},{0x10577,0x1059E}, /* 10576 */ + {0x10578,0x1059F},{0x10579,0x105A0}, /* 10578 */ + {0x1057A,0x105A1},{0x1057B,0x1057B}, /* 1057A */ + {0x1057C,0x105A3},{0x1057D,0x105A4}, /* 1057C */ + {0x1057E,0x105A5},{0x1057F,0x105A6}, /* 1057E */ + {0x10580,0x105A7},{0x10581,0x105A8}, /* 10580 */ + {0x10582,0x105A9},{0x10583,0x105AA}, /* 10582 */ + {0x10584,0x105AB},{0x10585,0x105AC}, /* 10584 */ + {0x10586,0x105AD},{0x10587,0x105AE}, /* 10586 */ + {0x10588,0x105AF},{0x10589,0x105B0}, /* 10588 */ + {0x1058A,0x105B1},{0x1058B,0x1058B}, /* 1058A */ + {0x1058C,0x105B3},{0x1058D,0x105B4}, /* 1058C */ + {0x1058E,0x105B5},{0x1058F,0x105B6}, /* 1058E */ + {0x10590,0x105B7},{0x10591,0x105B8}, /* 10590 */ + {0x10592,0x105B9},{0x10593,0x10593}, /* 10592 */ + {0x10594,0x105BB},{0x10595,0x105BC}, /* 10594 */ + {0x10596,0x10596},{0x10570,0x10597}, /* 10596 */ + {0x10571,0x10598},{0x10572,0x10599}, /* 10598 */ + {0x10573,0x1059A},{0x10574,0x1059B}, /* 1059A */ + {0x10575,0x1059C},{0x10576,0x1059D}, /* 1059C */ + {0x10577,0x1059E},{0x10578,0x1059F}, /* 1059E */ + {0x10579,0x105A0},{0x1057A,0x105A1}, /* 105A0 */ + {0x105A2,0x105A2},{0x1057C,0x105A3}, /* 105A2 */ + {0x1057D,0x105A4},{0x1057E,0x105A5}, /* 105A4 */ + {0x1057F,0x105A6},{0x10580,0x105A7}, /* 105A6 */ + {0x10581,0x105A8},{0x10582,0x105A9}, /* 105A8 */ + {0x10583,0x105AA},{0x10584,0x105AB}, /* 105AA */ + {0x10585,0x105AC},{0x10586,0x105AD}, /* 105AC */ + {0x10587,0x105AE},{0x10588,0x105AF}, /* 105AE */ + {0x10589,0x105B0},{0x1058A,0x105B1}, /* 105B0 */ + {0x105B2,0x105B2},{0x1058C,0x105B3}, /* 105B2 */ + {0x1058D,0x105B4},{0x1058E,0x105B5}, /* 105B4 */ + {0x1058F,0x105B6},{0x10590,0x105B7}, /* 105B6 */ + {0x10591,0x105B8},{0x10592,0x105B9}, /* 105B8 */ + {0x105BA,0x105BA},{0x10594,0x105BB}, /* 105BA */ + {0x10595,0x105BC},{0x105BD,0x105BD}, /* 105BC */ + {0x105BE,0x105BE},{0x105BF,0x105BF}, /* 105BE */ + {0x105C0,0x105C0},{0x105C1,0x105C1}, /* 105C0 */ + {0x105C2,0x105C2},{0x105C3,0x105C3}, /* 105C2 */ + {0x105C4,0x105C4},{0x105C5,0x105C5}, /* 105C4 */ + {0x105C6,0x105C6},{0x105C7,0x105C7}, /* 105C6 */ + {0x105C8,0x105C8},{0x105C9,0x105C9}, /* 105C8 */ + {0x105CA,0x105CA},{0x105CB,0x105CB}, /* 105CA */ + {0x105CC,0x105CC},{0x105CD,0x105CD}, /* 105CC */ + {0x105CE,0x105CE},{0x105CF,0x105CF}, /* 105CE */ + {0x105D0,0x105D0},{0x105D1,0x105D1}, /* 105D0 */ + {0x105D2,0x105D2},{0x105D3,0x105D3}, /* 105D2 */ + {0x105D4,0x105D4},{0x105D5,0x105D5}, /* 105D4 */ + {0x105D6,0x105D6},{0x105D7,0x105D7}, /* 105D6 */ + {0x105D8,0x105D8},{0x105D9,0x105D9}, /* 105D8 */ + {0x105DA,0x105DA},{0x105DB,0x105DB}, /* 105DA */ + {0x105DC,0x105DC},{0x105DD,0x105DD}, /* 105DC */ + {0x105DE,0x105DE},{0x105DF,0x105DF}, /* 105DE */ + {0x105E0,0x105E0},{0x105E1,0x105E1}, /* 105E0 */ + {0x105E2,0x105E2},{0x105E3,0x105E3}, /* 105E2 */ + {0x105E4,0x105E4},{0x105E5,0x105E5}, /* 105E4 */ + {0x105E6,0x105E6},{0x105E7,0x105E7}, /* 105E6 */ + {0x105E8,0x105E8},{0x105E9,0x105E9}, /* 105E8 */ + {0x105EA,0x105EA},{0x105EB,0x105EB}, /* 105EA */ + {0x105EC,0x105EC},{0x105ED,0x105ED}, /* 105EC */ + {0x105EE,0x105EE},{0x105EF,0x105EF}, /* 105EE */ + {0x105F0,0x105F0},{0x105F1,0x105F1}, /* 105F0 */ + {0x105F2,0x105F2},{0x105F3,0x105F3}, /* 105F2 */ + {0x105F4,0x105F4},{0x105F5,0x105F5}, /* 105F4 */ + {0x105F6,0x105F6},{0x105F7,0x105F7}, /* 105F6 */ + {0x105F8,0x105F8},{0x105F9,0x105F9}, /* 105F8 */ + {0x105FA,0x105FA},{0x105FB,0x105FB}, /* 105FA */ + {0x105FC,0x105FC},{0x105FD,0x105FD}, /* 105FC */ + {0x105FE,0x105FE},{0x105FF,0x105FF} /* 105FE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page10C[256]={ + {0x10C00,0x10C00},{0x10C01,0x10C01}, /* 10C00 */ + {0x10C02,0x10C02},{0x10C03,0x10C03}, /* 10C02 */ + {0x10C04,0x10C04},{0x10C05,0x10C05}, /* 10C04 */ + {0x10C06,0x10C06},{0x10C07,0x10C07}, /* 10C06 */ + {0x10C08,0x10C08},{0x10C09,0x10C09}, /* 10C08 */ + {0x10C0A,0x10C0A},{0x10C0B,0x10C0B}, /* 10C0A */ + {0x10C0C,0x10C0C},{0x10C0D,0x10C0D}, /* 10C0C */ + {0x10C0E,0x10C0E},{0x10C0F,0x10C0F}, /* 10C0E */ + {0x10C10,0x10C10},{0x10C11,0x10C11}, /* 10C10 */ + {0x10C12,0x10C12},{0x10C13,0x10C13}, /* 10C12 */ + {0x10C14,0x10C14},{0x10C15,0x10C15}, /* 10C14 */ + {0x10C16,0x10C16},{0x10C17,0x10C17}, /* 10C16 */ + {0x10C18,0x10C18},{0x10C19,0x10C19}, /* 10C18 */ + {0x10C1A,0x10C1A},{0x10C1B,0x10C1B}, /* 10C1A */ + {0x10C1C,0x10C1C},{0x10C1D,0x10C1D}, /* 10C1C */ + {0x10C1E,0x10C1E},{0x10C1F,0x10C1F}, /* 10C1E */ + {0x10C20,0x10C20},{0x10C21,0x10C21}, /* 10C20 */ + {0x10C22,0x10C22},{0x10C23,0x10C23}, /* 10C22 */ + {0x10C24,0x10C24},{0x10C25,0x10C25}, /* 10C24 */ + {0x10C26,0x10C26},{0x10C27,0x10C27}, /* 10C26 */ + {0x10C28,0x10C28},{0x10C29,0x10C29}, /* 10C28 */ + {0x10C2A,0x10C2A},{0x10C2B,0x10C2B}, /* 10C2A */ + {0x10C2C,0x10C2C},{0x10C2D,0x10C2D}, /* 10C2C */ + {0x10C2E,0x10C2E},{0x10C2F,0x10C2F}, /* 10C2E */ + {0x10C30,0x10C30},{0x10C31,0x10C31}, /* 10C30 */ + {0x10C32,0x10C32},{0x10C33,0x10C33}, /* 10C32 */ + {0x10C34,0x10C34},{0x10C35,0x10C35}, /* 10C34 */ + {0x10C36,0x10C36},{0x10C37,0x10C37}, /* 10C36 */ + {0x10C38,0x10C38},{0x10C39,0x10C39}, /* 10C38 */ + {0x10C3A,0x10C3A},{0x10C3B,0x10C3B}, /* 10C3A */ + {0x10C3C,0x10C3C},{0x10C3D,0x10C3D}, /* 10C3C */ + {0x10C3E,0x10C3E},{0x10C3F,0x10C3F}, /* 10C3E */ + {0x10C40,0x10C40},{0x10C41,0x10C41}, /* 10C40 */ + {0x10C42,0x10C42},{0x10C43,0x10C43}, /* 10C42 */ + {0x10C44,0x10C44},{0x10C45,0x10C45}, /* 10C44 */ + {0x10C46,0x10C46},{0x10C47,0x10C47}, /* 10C46 */ + {0x10C48,0x10C48},{0x10C49,0x10C49}, /* 10C48 */ + {0x10C4A,0x10C4A},{0x10C4B,0x10C4B}, /* 10C4A */ + {0x10C4C,0x10C4C},{0x10C4D,0x10C4D}, /* 10C4C */ + {0x10C4E,0x10C4E},{0x10C4F,0x10C4F}, /* 10C4E */ + {0x10C50,0x10C50},{0x10C51,0x10C51}, /* 10C50 */ + {0x10C52,0x10C52},{0x10C53,0x10C53}, /* 10C52 */ + {0x10C54,0x10C54},{0x10C55,0x10C55}, /* 10C54 */ + {0x10C56,0x10C56},{0x10C57,0x10C57}, /* 10C56 */ + {0x10C58,0x10C58},{0x10C59,0x10C59}, /* 10C58 */ + {0x10C5A,0x10C5A},{0x10C5B,0x10C5B}, /* 10C5A */ + {0x10C5C,0x10C5C},{0x10C5D,0x10C5D}, /* 10C5C */ + {0x10C5E,0x10C5E},{0x10C5F,0x10C5F}, /* 10C5E */ + {0x10C60,0x10C60},{0x10C61,0x10C61}, /* 10C60 */ + {0x10C62,0x10C62},{0x10C63,0x10C63}, /* 10C62 */ + {0x10C64,0x10C64},{0x10C65,0x10C65}, /* 10C64 */ + {0x10C66,0x10C66},{0x10C67,0x10C67}, /* 10C66 */ + {0x10C68,0x10C68},{0x10C69,0x10C69}, /* 10C68 */ + {0x10C6A,0x10C6A},{0x10C6B,0x10C6B}, /* 10C6A */ + {0x10C6C,0x10C6C},{0x10C6D,0x10C6D}, /* 10C6C */ + {0x10C6E,0x10C6E},{0x10C6F,0x10C6F}, /* 10C6E */ + {0x10C70,0x10C70},{0x10C71,0x10C71}, /* 10C70 */ + {0x10C72,0x10C72},{0x10C73,0x10C73}, /* 10C72 */ + {0x10C74,0x10C74},{0x10C75,0x10C75}, /* 10C74 */ + {0x10C76,0x10C76},{0x10C77,0x10C77}, /* 10C76 */ + {0x10C78,0x10C78},{0x10C79,0x10C79}, /* 10C78 */ + {0x10C7A,0x10C7A},{0x10C7B,0x10C7B}, /* 10C7A */ + {0x10C7C,0x10C7C},{0x10C7D,0x10C7D}, /* 10C7C */ + {0x10C7E,0x10C7E},{0x10C7F,0x10C7F}, /* 10C7E */ + {0x10C80,0x10CC0},{0x10C81,0x10CC1}, /* 10C80 */ + {0x10C82,0x10CC2},{0x10C83,0x10CC3}, /* 10C82 */ + {0x10C84,0x10CC4},{0x10C85,0x10CC5}, /* 10C84 */ + {0x10C86,0x10CC6},{0x10C87,0x10CC7}, /* 10C86 */ + {0x10C88,0x10CC8},{0x10C89,0x10CC9}, /* 10C88 */ + {0x10C8A,0x10CCA},{0x10C8B,0x10CCB}, /* 10C8A */ + {0x10C8C,0x10CCC},{0x10C8D,0x10CCD}, /* 10C8C */ + {0x10C8E,0x10CCE},{0x10C8F,0x10CCF}, /* 10C8E */ + {0x10C90,0x10CD0},{0x10C91,0x10CD1}, /* 10C90 */ + {0x10C92,0x10CD2},{0x10C93,0x10CD3}, /* 10C92 */ + {0x10C94,0x10CD4},{0x10C95,0x10CD5}, /* 10C94 */ + {0x10C96,0x10CD6},{0x10C97,0x10CD7}, /* 10C96 */ + {0x10C98,0x10CD8},{0x10C99,0x10CD9}, /* 10C98 */ + {0x10C9A,0x10CDA},{0x10C9B,0x10CDB}, /* 10C9A */ + {0x10C9C,0x10CDC},{0x10C9D,0x10CDD}, /* 10C9C */ + {0x10C9E,0x10CDE},{0x10C9F,0x10CDF}, /* 10C9E */ + {0x10CA0,0x10CE0},{0x10CA1,0x10CE1}, /* 10CA0 */ + {0x10CA2,0x10CE2},{0x10CA3,0x10CE3}, /* 10CA2 */ + {0x10CA4,0x10CE4},{0x10CA5,0x10CE5}, /* 10CA4 */ + {0x10CA6,0x10CE6},{0x10CA7,0x10CE7}, /* 10CA6 */ + {0x10CA8,0x10CE8},{0x10CA9,0x10CE9}, /* 10CA8 */ + {0x10CAA,0x10CEA},{0x10CAB,0x10CEB}, /* 10CAA */ + {0x10CAC,0x10CEC},{0x10CAD,0x10CED}, /* 10CAC */ + {0x10CAE,0x10CEE},{0x10CAF,0x10CEF}, /* 10CAE */ + {0x10CB0,0x10CF0},{0x10CB1,0x10CF1}, /* 10CB0 */ + {0x10CB2,0x10CF2},{0x10CB3,0x10CB3}, /* 10CB2 */ + {0x10CB4,0x10CB4},{0x10CB5,0x10CB5}, /* 10CB4 */ + {0x10CB6,0x10CB6},{0x10CB7,0x10CB7}, /* 10CB6 */ + {0x10CB8,0x10CB8},{0x10CB9,0x10CB9}, /* 10CB8 */ + {0x10CBA,0x10CBA},{0x10CBB,0x10CBB}, /* 10CBA */ + {0x10CBC,0x10CBC},{0x10CBD,0x10CBD}, /* 10CBC */ + {0x10CBE,0x10CBE},{0x10CBF,0x10CBF}, /* 10CBE */ + {0x10C80,0x10CC0},{0x10C81,0x10CC1}, /* 10CC0 */ + {0x10C82,0x10CC2},{0x10C83,0x10CC3}, /* 10CC2 */ + {0x10C84,0x10CC4},{0x10C85,0x10CC5}, /* 10CC4 */ + {0x10C86,0x10CC6},{0x10C87,0x10CC7}, /* 10CC6 */ + {0x10C88,0x10CC8},{0x10C89,0x10CC9}, /* 10CC8 */ + {0x10C8A,0x10CCA},{0x10C8B,0x10CCB}, /* 10CCA */ + {0x10C8C,0x10CCC},{0x10C8D,0x10CCD}, /* 10CCC */ + {0x10C8E,0x10CCE},{0x10C8F,0x10CCF}, /* 10CCE */ + {0x10C90,0x10CD0},{0x10C91,0x10CD1}, /* 10CD0 */ + {0x10C92,0x10CD2},{0x10C93,0x10CD3}, /* 10CD2 */ + {0x10C94,0x10CD4},{0x10C95,0x10CD5}, /* 10CD4 */ + {0x10C96,0x10CD6},{0x10C97,0x10CD7}, /* 10CD6 */ + {0x10C98,0x10CD8},{0x10C99,0x10CD9}, /* 10CD8 */ + {0x10C9A,0x10CDA},{0x10C9B,0x10CDB}, /* 10CDA */ + {0x10C9C,0x10CDC},{0x10C9D,0x10CDD}, /* 10CDC */ + {0x10C9E,0x10CDE},{0x10C9F,0x10CDF}, /* 10CDE */ + {0x10CA0,0x10CE0},{0x10CA1,0x10CE1}, /* 10CE0 */ + {0x10CA2,0x10CE2},{0x10CA3,0x10CE3}, /* 10CE2 */ + {0x10CA4,0x10CE4},{0x10CA5,0x10CE5}, /* 10CE4 */ + {0x10CA6,0x10CE6},{0x10CA7,0x10CE7}, /* 10CE6 */ + {0x10CA8,0x10CE8},{0x10CA9,0x10CE9}, /* 10CE8 */ + {0x10CAA,0x10CEA},{0x10CAB,0x10CEB}, /* 10CEA */ + {0x10CAC,0x10CEC},{0x10CAD,0x10CED}, /* 10CEC */ + {0x10CAE,0x10CEE},{0x10CAF,0x10CEF}, /* 10CEE */ + {0x10CB0,0x10CF0},{0x10CB1,0x10CF1}, /* 10CF0 */ + {0x10CB2,0x10CF2},{0x10CF3,0x10CF3}, /* 10CF2 */ + {0x10CF4,0x10CF4},{0x10CF5,0x10CF5}, /* 10CF4 */ + {0x10CF6,0x10CF6},{0x10CF7,0x10CF7}, /* 10CF6 */ + {0x10CF8,0x10CF8},{0x10CF9,0x10CF9}, /* 10CF8 */ + {0x10CFA,0x10CFA},{0x10CFB,0x10CFB}, /* 10CFA */ + {0x10CFC,0x10CFC},{0x10CFD,0x10CFD}, /* 10CFC */ + {0x10CFE,0x10CFE},{0x10CFF,0x10CFF} /* 10CFE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page118[256]={ + {0x11800,0x11800},{0x11801,0x11801}, /* 11800 */ + {0x11802,0x11802},{0x11803,0x11803}, /* 11802 */ + {0x11804,0x11804},{0x11805,0x11805}, /* 11804 */ + {0x11806,0x11806},{0x11807,0x11807}, /* 11806 */ + {0x11808,0x11808},{0x11809,0x11809}, /* 11808 */ + {0x1180A,0x1180A},{0x1180B,0x1180B}, /* 1180A */ + {0x1180C,0x1180C},{0x1180D,0x1180D}, /* 1180C */ + {0x1180E,0x1180E},{0x1180F,0x1180F}, /* 1180E */ + {0x11810,0x11810},{0x11811,0x11811}, /* 11810 */ + {0x11812,0x11812},{0x11813,0x11813}, /* 11812 */ + {0x11814,0x11814},{0x11815,0x11815}, /* 11814 */ + {0x11816,0x11816},{0x11817,0x11817}, /* 11816 */ + {0x11818,0x11818},{0x11819,0x11819}, /* 11818 */ + {0x1181A,0x1181A},{0x1181B,0x1181B}, /* 1181A */ + {0x1181C,0x1181C},{0x1181D,0x1181D}, /* 1181C */ + {0x1181E,0x1181E},{0x1181F,0x1181F}, /* 1181E */ + {0x11820,0x11820},{0x11821,0x11821}, /* 11820 */ + {0x11822,0x11822},{0x11823,0x11823}, /* 11822 */ + {0x11824,0x11824},{0x11825,0x11825}, /* 11824 */ + {0x11826,0x11826},{0x11827,0x11827}, /* 11826 */ + {0x11828,0x11828},{0x11829,0x11829}, /* 11828 */ + {0x1182A,0x1182A},{0x1182B,0x1182B}, /* 1182A */ + {0x1182C,0x1182C},{0x1182D,0x1182D}, /* 1182C */ + {0x1182E,0x1182E},{0x1182F,0x1182F}, /* 1182E */ + {0x11830,0x11830},{0x11831,0x11831}, /* 11830 */ + {0x11832,0x11832},{0x11833,0x11833}, /* 11832 */ + {0x11834,0x11834},{0x11835,0x11835}, /* 11834 */ + {0x11836,0x11836},{0x11837,0x11837}, /* 11836 */ + {0x11838,0x11838},{0x11839,0x11839}, /* 11838 */ + {0x1183A,0x1183A},{0x1183B,0x1183B}, /* 1183A */ + {0x1183C,0x1183C},{0x1183D,0x1183D}, /* 1183C */ + {0x1183E,0x1183E},{0x1183F,0x1183F}, /* 1183E */ + {0x11840,0x11840},{0x11841,0x11841}, /* 11840 */ + {0x11842,0x11842},{0x11843,0x11843}, /* 11842 */ + {0x11844,0x11844},{0x11845,0x11845}, /* 11844 */ + {0x11846,0x11846},{0x11847,0x11847}, /* 11846 */ + {0x11848,0x11848},{0x11849,0x11849}, /* 11848 */ + {0x1184A,0x1184A},{0x1184B,0x1184B}, /* 1184A */ + {0x1184C,0x1184C},{0x1184D,0x1184D}, /* 1184C */ + {0x1184E,0x1184E},{0x1184F,0x1184F}, /* 1184E */ + {0x11850,0x11850},{0x11851,0x11851}, /* 11850 */ + {0x11852,0x11852},{0x11853,0x11853}, /* 11852 */ + {0x11854,0x11854},{0x11855,0x11855}, /* 11854 */ + {0x11856,0x11856},{0x11857,0x11857}, /* 11856 */ + {0x11858,0x11858},{0x11859,0x11859}, /* 11858 */ + {0x1185A,0x1185A},{0x1185B,0x1185B}, /* 1185A */ + {0x1185C,0x1185C},{0x1185D,0x1185D}, /* 1185C */ + {0x1185E,0x1185E},{0x1185F,0x1185F}, /* 1185E */ + {0x11860,0x11860},{0x11861,0x11861}, /* 11860 */ + {0x11862,0x11862},{0x11863,0x11863}, /* 11862 */ + {0x11864,0x11864},{0x11865,0x11865}, /* 11864 */ + {0x11866,0x11866},{0x11867,0x11867}, /* 11866 */ + {0x11868,0x11868},{0x11869,0x11869}, /* 11868 */ + {0x1186A,0x1186A},{0x1186B,0x1186B}, /* 1186A */ + {0x1186C,0x1186C},{0x1186D,0x1186D}, /* 1186C */ + {0x1186E,0x1186E},{0x1186F,0x1186F}, /* 1186E */ + {0x11870,0x11870},{0x11871,0x11871}, /* 11870 */ + {0x11872,0x11872},{0x11873,0x11873}, /* 11872 */ + {0x11874,0x11874},{0x11875,0x11875}, /* 11874 */ + {0x11876,0x11876},{0x11877,0x11877}, /* 11876 */ + {0x11878,0x11878},{0x11879,0x11879}, /* 11878 */ + {0x1187A,0x1187A},{0x1187B,0x1187B}, /* 1187A */ + {0x1187C,0x1187C},{0x1187D,0x1187D}, /* 1187C */ + {0x1187E,0x1187E},{0x1187F,0x1187F}, /* 1187E */ + {0x11880,0x11880},{0x11881,0x11881}, /* 11880 */ + {0x11882,0x11882},{0x11883,0x11883}, /* 11882 */ + {0x11884,0x11884},{0x11885,0x11885}, /* 11884 */ + {0x11886,0x11886},{0x11887,0x11887}, /* 11886 */ + {0x11888,0x11888},{0x11889,0x11889}, /* 11888 */ + {0x1188A,0x1188A},{0x1188B,0x1188B}, /* 1188A */ + {0x1188C,0x1188C},{0x1188D,0x1188D}, /* 1188C */ + {0x1188E,0x1188E},{0x1188F,0x1188F}, /* 1188E */ + {0x11890,0x11890},{0x11891,0x11891}, /* 11890 */ + {0x11892,0x11892},{0x11893,0x11893}, /* 11892 */ + {0x11894,0x11894},{0x11895,0x11895}, /* 11894 */ + {0x11896,0x11896},{0x11897,0x11897}, /* 11896 */ + {0x11898,0x11898},{0x11899,0x11899}, /* 11898 */ + {0x1189A,0x1189A},{0x1189B,0x1189B}, /* 1189A */ + {0x1189C,0x1189C},{0x1189D,0x1189D}, /* 1189C */ + {0x1189E,0x1189E},{0x1189F,0x1189F}, /* 1189E */ + {0x118A0,0x118C0},{0x118A1,0x118C1}, /* 118A0 */ + {0x118A2,0x118C2},{0x118A3,0x118C3}, /* 118A2 */ + {0x118A4,0x118C4},{0x118A5,0x118C5}, /* 118A4 */ + {0x118A6,0x118C6},{0x118A7,0x118C7}, /* 118A6 */ + {0x118A8,0x118C8},{0x118A9,0x118C9}, /* 118A8 */ + {0x118AA,0x118CA},{0x118AB,0x118CB}, /* 118AA */ + {0x118AC,0x118CC},{0x118AD,0x118CD}, /* 118AC */ + {0x118AE,0x118CE},{0x118AF,0x118CF}, /* 118AE */ + {0x118B0,0x118D0},{0x118B1,0x118D1}, /* 118B0 */ + {0x118B2,0x118D2},{0x118B3,0x118D3}, /* 118B2 */ + {0x118B4,0x118D4},{0x118B5,0x118D5}, /* 118B4 */ + {0x118B6,0x118D6},{0x118B7,0x118D7}, /* 118B6 */ + {0x118B8,0x118D8},{0x118B9,0x118D9}, /* 118B8 */ + {0x118BA,0x118DA},{0x118BB,0x118DB}, /* 118BA */ + {0x118BC,0x118DC},{0x118BD,0x118DD}, /* 118BC */ + {0x118BE,0x118DE},{0x118BF,0x118DF}, /* 118BE */ + {0x118A0,0x118C0},{0x118A1,0x118C1}, /* 118C0 */ + {0x118A2,0x118C2},{0x118A3,0x118C3}, /* 118C2 */ + {0x118A4,0x118C4},{0x118A5,0x118C5}, /* 118C4 */ + {0x118A6,0x118C6},{0x118A7,0x118C7}, /* 118C6 */ + {0x118A8,0x118C8},{0x118A9,0x118C9}, /* 118C8 */ + {0x118AA,0x118CA},{0x118AB,0x118CB}, /* 118CA */ + {0x118AC,0x118CC},{0x118AD,0x118CD}, /* 118CC */ + {0x118AE,0x118CE},{0x118AF,0x118CF}, /* 118CE */ + {0x118B0,0x118D0},{0x118B1,0x118D1}, /* 118D0 */ + {0x118B2,0x118D2},{0x118B3,0x118D3}, /* 118D2 */ + {0x118B4,0x118D4},{0x118B5,0x118D5}, /* 118D4 */ + {0x118B6,0x118D6},{0x118B7,0x118D7}, /* 118D6 */ + {0x118B8,0x118D8},{0x118B9,0x118D9}, /* 118D8 */ + {0x118BA,0x118DA},{0x118BB,0x118DB}, /* 118DA */ + {0x118BC,0x118DC},{0x118BD,0x118DD}, /* 118DC */ + {0x118BE,0x118DE},{0x118BF,0x118DF}, /* 118DE */ + {0x118E0,0x118E0},{0x118E1,0x118E1}, /* 118E0 */ + {0x118E2,0x118E2},{0x118E3,0x118E3}, /* 118E2 */ + {0x118E4,0x118E4},{0x118E5,0x118E5}, /* 118E4 */ + {0x118E6,0x118E6},{0x118E7,0x118E7}, /* 118E6 */ + {0x118E8,0x118E8},{0x118E9,0x118E9}, /* 118E8 */ + {0x118EA,0x118EA},{0x118EB,0x118EB}, /* 118EA */ + {0x118EC,0x118EC},{0x118ED,0x118ED}, /* 118EC */ + {0x118EE,0x118EE},{0x118EF,0x118EF}, /* 118EE */ + {0x118F0,0x118F0},{0x118F1,0x118F1}, /* 118F0 */ + {0x118F2,0x118F2},{0x118F3,0x118F3}, /* 118F2 */ + {0x118F4,0x118F4},{0x118F5,0x118F5}, /* 118F4 */ + {0x118F6,0x118F6},{0x118F7,0x118F7}, /* 118F6 */ + {0x118F8,0x118F8},{0x118F9,0x118F9}, /* 118F8 */ + {0x118FA,0x118FA},{0x118FB,0x118FB}, /* 118FA */ + {0x118FC,0x118FC},{0x118FD,0x118FD}, /* 118FC */ + {0x118FE,0x118FE},{0x118FF,0x118FF} /* 118FE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page16E[256]={ + {0x16E00,0x16E00},{0x16E01,0x16E01}, /* 16E00 */ + {0x16E02,0x16E02},{0x16E03,0x16E03}, /* 16E02 */ + {0x16E04,0x16E04},{0x16E05,0x16E05}, /* 16E04 */ + {0x16E06,0x16E06},{0x16E07,0x16E07}, /* 16E06 */ + {0x16E08,0x16E08},{0x16E09,0x16E09}, /* 16E08 */ + {0x16E0A,0x16E0A},{0x16E0B,0x16E0B}, /* 16E0A */ + {0x16E0C,0x16E0C},{0x16E0D,0x16E0D}, /* 16E0C */ + {0x16E0E,0x16E0E},{0x16E0F,0x16E0F}, /* 16E0E */ + {0x16E10,0x16E10},{0x16E11,0x16E11}, /* 16E10 */ + {0x16E12,0x16E12},{0x16E13,0x16E13}, /* 16E12 */ + {0x16E14,0x16E14},{0x16E15,0x16E15}, /* 16E14 */ + {0x16E16,0x16E16},{0x16E17,0x16E17}, /* 16E16 */ + {0x16E18,0x16E18},{0x16E19,0x16E19}, /* 16E18 */ + {0x16E1A,0x16E1A},{0x16E1B,0x16E1B}, /* 16E1A */ + {0x16E1C,0x16E1C},{0x16E1D,0x16E1D}, /* 16E1C */ + {0x16E1E,0x16E1E},{0x16E1F,0x16E1F}, /* 16E1E */ + {0x16E20,0x16E20},{0x16E21,0x16E21}, /* 16E20 */ + {0x16E22,0x16E22},{0x16E23,0x16E23}, /* 16E22 */ + {0x16E24,0x16E24},{0x16E25,0x16E25}, /* 16E24 */ + {0x16E26,0x16E26},{0x16E27,0x16E27}, /* 16E26 */ + {0x16E28,0x16E28},{0x16E29,0x16E29}, /* 16E28 */ + {0x16E2A,0x16E2A},{0x16E2B,0x16E2B}, /* 16E2A */ + {0x16E2C,0x16E2C},{0x16E2D,0x16E2D}, /* 16E2C */ + {0x16E2E,0x16E2E},{0x16E2F,0x16E2F}, /* 16E2E */ + {0x16E30,0x16E30},{0x16E31,0x16E31}, /* 16E30 */ + {0x16E32,0x16E32},{0x16E33,0x16E33}, /* 16E32 */ + {0x16E34,0x16E34},{0x16E35,0x16E35}, /* 16E34 */ + {0x16E36,0x16E36},{0x16E37,0x16E37}, /* 16E36 */ + {0x16E38,0x16E38},{0x16E39,0x16E39}, /* 16E38 */ + {0x16E3A,0x16E3A},{0x16E3B,0x16E3B}, /* 16E3A */ + {0x16E3C,0x16E3C},{0x16E3D,0x16E3D}, /* 16E3C */ + {0x16E3E,0x16E3E},{0x16E3F,0x16E3F}, /* 16E3E */ + {0x16E40,0x16E60},{0x16E41,0x16E61}, /* 16E40 */ + {0x16E42,0x16E62},{0x16E43,0x16E63}, /* 16E42 */ + {0x16E44,0x16E64},{0x16E45,0x16E65}, /* 16E44 */ + {0x16E46,0x16E66},{0x16E47,0x16E67}, /* 16E46 */ + {0x16E48,0x16E68},{0x16E49,0x16E69}, /* 16E48 */ + {0x16E4A,0x16E6A},{0x16E4B,0x16E6B}, /* 16E4A */ + {0x16E4C,0x16E6C},{0x16E4D,0x16E6D}, /* 16E4C */ + {0x16E4E,0x16E6E},{0x16E4F,0x16E6F}, /* 16E4E */ + {0x16E50,0x16E70},{0x16E51,0x16E71}, /* 16E50 */ + {0x16E52,0x16E72},{0x16E53,0x16E73}, /* 16E52 */ + {0x16E54,0x16E74},{0x16E55,0x16E75}, /* 16E54 */ + {0x16E56,0x16E76},{0x16E57,0x16E77}, /* 16E56 */ + {0x16E58,0x16E78},{0x16E59,0x16E79}, /* 16E58 */ + {0x16E5A,0x16E7A},{0x16E5B,0x16E7B}, /* 16E5A */ + {0x16E5C,0x16E7C},{0x16E5D,0x16E7D}, /* 16E5C */ + {0x16E5E,0x16E7E},{0x16E5F,0x16E7F}, /* 16E5E */ + {0x16E40,0x16E60},{0x16E41,0x16E61}, /* 16E60 */ + {0x16E42,0x16E62},{0x16E43,0x16E63}, /* 16E62 */ + {0x16E44,0x16E64},{0x16E45,0x16E65}, /* 16E64 */ + {0x16E46,0x16E66},{0x16E47,0x16E67}, /* 16E66 */ + {0x16E48,0x16E68},{0x16E49,0x16E69}, /* 16E68 */ + {0x16E4A,0x16E6A},{0x16E4B,0x16E6B}, /* 16E6A */ + {0x16E4C,0x16E6C},{0x16E4D,0x16E6D}, /* 16E6C */ + {0x16E4E,0x16E6E},{0x16E4F,0x16E6F}, /* 16E6E */ + {0x16E50,0x16E70},{0x16E51,0x16E71}, /* 16E70 */ + {0x16E52,0x16E72},{0x16E53,0x16E73}, /* 16E72 */ + {0x16E54,0x16E74},{0x16E55,0x16E75}, /* 16E74 */ + {0x16E56,0x16E76},{0x16E57,0x16E77}, /* 16E76 */ + {0x16E58,0x16E78},{0x16E59,0x16E79}, /* 16E78 */ + {0x16E5A,0x16E7A},{0x16E5B,0x16E7B}, /* 16E7A */ + {0x16E5C,0x16E7C},{0x16E5D,0x16E7D}, /* 16E7C */ + {0x16E5E,0x16E7E},{0x16E5F,0x16E7F}, /* 16E7E */ + {0x16E80,0x16E80},{0x16E81,0x16E81}, /* 16E80 */ + {0x16E82,0x16E82},{0x16E83,0x16E83}, /* 16E82 */ + {0x16E84,0x16E84},{0x16E85,0x16E85}, /* 16E84 */ + {0x16E86,0x16E86},{0x16E87,0x16E87}, /* 16E86 */ + {0x16E88,0x16E88},{0x16E89,0x16E89}, /* 16E88 */ + {0x16E8A,0x16E8A},{0x16E8B,0x16E8B}, /* 16E8A */ + {0x16E8C,0x16E8C},{0x16E8D,0x16E8D}, /* 16E8C */ + {0x16E8E,0x16E8E},{0x16E8F,0x16E8F}, /* 16E8E */ + {0x16E90,0x16E90},{0x16E91,0x16E91}, /* 16E90 */ + {0x16E92,0x16E92},{0x16E93,0x16E93}, /* 16E92 */ + {0x16E94,0x16E94},{0x16E95,0x16E95}, /* 16E94 */ + {0x16E96,0x16E96},{0x16E97,0x16E97}, /* 16E96 */ + {0x16E98,0x16E98},{0x16E99,0x16E99}, /* 16E98 */ + {0x16E9A,0x16E9A},{0x16E9B,0x16E9B}, /* 16E9A */ + {0x16E9C,0x16E9C},{0x16E9D,0x16E9D}, /* 16E9C */ + {0x16E9E,0x16E9E},{0x16E9F,0x16E9F}, /* 16E9E */ + {0x16EA0,0x16EA0},{0x16EA1,0x16EA1}, /* 16EA0 */ + {0x16EA2,0x16EA2},{0x16EA3,0x16EA3}, /* 16EA2 */ + {0x16EA4,0x16EA4},{0x16EA5,0x16EA5}, /* 16EA4 */ + {0x16EA6,0x16EA6},{0x16EA7,0x16EA7}, /* 16EA6 */ + {0x16EA8,0x16EA8},{0x16EA9,0x16EA9}, /* 16EA8 */ + {0x16EAA,0x16EAA},{0x16EAB,0x16EAB}, /* 16EAA */ + {0x16EAC,0x16EAC},{0x16EAD,0x16EAD}, /* 16EAC */ + {0x16EAE,0x16EAE},{0x16EAF,0x16EAF}, /* 16EAE */ + {0x16EB0,0x16EB0},{0x16EB1,0x16EB1}, /* 16EB0 */ + {0x16EB2,0x16EB2},{0x16EB3,0x16EB3}, /* 16EB2 */ + {0x16EB4,0x16EB4},{0x16EB5,0x16EB5}, /* 16EB4 */ + {0x16EB6,0x16EB6},{0x16EB7,0x16EB7}, /* 16EB6 */ + {0x16EB8,0x16EB8},{0x16EB9,0x16EB9}, /* 16EB8 */ + {0x16EBA,0x16EBA},{0x16EBB,0x16EBB}, /* 16EBA */ + {0x16EBC,0x16EBC},{0x16EBD,0x16EBD}, /* 16EBC */ + {0x16EBE,0x16EBE},{0x16EBF,0x16EBF}, /* 16EBE */ + {0x16EC0,0x16EC0},{0x16EC1,0x16EC1}, /* 16EC0 */ + {0x16EC2,0x16EC2},{0x16EC3,0x16EC3}, /* 16EC2 */ + {0x16EC4,0x16EC4},{0x16EC5,0x16EC5}, /* 16EC4 */ + {0x16EC6,0x16EC6},{0x16EC7,0x16EC7}, /* 16EC6 */ + {0x16EC8,0x16EC8},{0x16EC9,0x16EC9}, /* 16EC8 */ + {0x16ECA,0x16ECA},{0x16ECB,0x16ECB}, /* 16ECA */ + {0x16ECC,0x16ECC},{0x16ECD,0x16ECD}, /* 16ECC */ + {0x16ECE,0x16ECE},{0x16ECF,0x16ECF}, /* 16ECE */ + {0x16ED0,0x16ED0},{0x16ED1,0x16ED1}, /* 16ED0 */ + {0x16ED2,0x16ED2},{0x16ED3,0x16ED3}, /* 16ED2 */ + {0x16ED4,0x16ED4},{0x16ED5,0x16ED5}, /* 16ED4 */ + {0x16ED6,0x16ED6},{0x16ED7,0x16ED7}, /* 16ED6 */ + {0x16ED8,0x16ED8},{0x16ED9,0x16ED9}, /* 16ED8 */ + {0x16EDA,0x16EDA},{0x16EDB,0x16EDB}, /* 16EDA */ + {0x16EDC,0x16EDC},{0x16EDD,0x16EDD}, /* 16EDC */ + {0x16EDE,0x16EDE},{0x16EDF,0x16EDF}, /* 16EDE */ + {0x16EE0,0x16EE0},{0x16EE1,0x16EE1}, /* 16EE0 */ + {0x16EE2,0x16EE2},{0x16EE3,0x16EE3}, /* 16EE2 */ + {0x16EE4,0x16EE4},{0x16EE5,0x16EE5}, /* 16EE4 */ + {0x16EE6,0x16EE6},{0x16EE7,0x16EE7}, /* 16EE6 */ + {0x16EE8,0x16EE8},{0x16EE9,0x16EE9}, /* 16EE8 */ + {0x16EEA,0x16EEA},{0x16EEB,0x16EEB}, /* 16EEA */ + {0x16EEC,0x16EEC},{0x16EED,0x16EED}, /* 16EEC */ + {0x16EEE,0x16EEE},{0x16EEF,0x16EEF}, /* 16EEE */ + {0x16EF0,0x16EF0},{0x16EF1,0x16EF1}, /* 16EF0 */ + {0x16EF2,0x16EF2},{0x16EF3,0x16EF3}, /* 16EF2 */ + {0x16EF4,0x16EF4},{0x16EF5,0x16EF5}, /* 16EF4 */ + {0x16EF6,0x16EF6},{0x16EF7,0x16EF7}, /* 16EF6 */ + {0x16EF8,0x16EF8},{0x16EF9,0x16EF9}, /* 16EF8 */ + {0x16EFA,0x16EFA},{0x16EFB,0x16EFB}, /* 16EFA */ + {0x16EFC,0x16EFC},{0x16EFD,0x16EFD}, /* 16EFC */ + {0x16EFE,0x16EFE},{0x16EFF,0x16EFF} /* 16EFE */ +}; + +static const MY_CASEFOLD_CHARACTER u1400_casefold_page1E9[256]={ + {0x1E900,0x1E922},{0x1E901,0x1E923}, /* 1E900 */ + {0x1E902,0x1E924},{0x1E903,0x1E925}, /* 1E902 */ + {0x1E904,0x1E926},{0x1E905,0x1E927}, /* 1E904 */ + {0x1E906,0x1E928},{0x1E907,0x1E929}, /* 1E906 */ + {0x1E908,0x1E92A},{0x1E909,0x1E92B}, /* 1E908 */ + {0x1E90A,0x1E92C},{0x1E90B,0x1E92D}, /* 1E90A */ + {0x1E90C,0x1E92E},{0x1E90D,0x1E92F}, /* 1E90C */ + {0x1E90E,0x1E930},{0x1E90F,0x1E931}, /* 1E90E */ + {0x1E910,0x1E932},{0x1E911,0x1E933}, /* 1E910 */ + {0x1E912,0x1E934},{0x1E913,0x1E935}, /* 1E912 */ + {0x1E914,0x1E936},{0x1E915,0x1E937}, /* 1E914 */ + {0x1E916,0x1E938},{0x1E917,0x1E939}, /* 1E916 */ + {0x1E918,0x1E93A},{0x1E919,0x1E93B}, /* 1E918 */ + {0x1E91A,0x1E93C},{0x1E91B,0x1E93D}, /* 1E91A */ + {0x1E91C,0x1E93E},{0x1E91D,0x1E93F}, /* 1E91C */ + {0x1E91E,0x1E940},{0x1E91F,0x1E941}, /* 1E91E */ + {0x1E920,0x1E942},{0x1E921,0x1E943}, /* 1E920 */ + {0x1E900,0x1E922},{0x1E901,0x1E923}, /* 1E922 */ + {0x1E902,0x1E924},{0x1E903,0x1E925}, /* 1E924 */ + {0x1E904,0x1E926},{0x1E905,0x1E927}, /* 1E926 */ + {0x1E906,0x1E928},{0x1E907,0x1E929}, /* 1E928 */ + {0x1E908,0x1E92A},{0x1E909,0x1E92B}, /* 1E92A */ + {0x1E90A,0x1E92C},{0x1E90B,0x1E92D}, /* 1E92C */ + {0x1E90C,0x1E92E},{0x1E90D,0x1E92F}, /* 1E92E */ + {0x1E90E,0x1E930},{0x1E90F,0x1E931}, /* 1E930 */ + {0x1E910,0x1E932},{0x1E911,0x1E933}, /* 1E932 */ + {0x1E912,0x1E934},{0x1E913,0x1E935}, /* 1E934 */ + {0x1E914,0x1E936},{0x1E915,0x1E937}, /* 1E936 */ + {0x1E916,0x1E938},{0x1E917,0x1E939}, /* 1E938 */ + {0x1E918,0x1E93A},{0x1E919,0x1E93B}, /* 1E93A */ + {0x1E91A,0x1E93C},{0x1E91B,0x1E93D}, /* 1E93C */ + {0x1E91C,0x1E93E},{0x1E91D,0x1E93F}, /* 1E93E */ + {0x1E91E,0x1E940},{0x1E91F,0x1E941}, /* 1E940 */ + {0x1E920,0x1E942},{0x1E921,0x1E943}, /* 1E942 */ + {0x1E944,0x1E944},{0x1E945,0x1E945}, /* 1E944 */ + {0x1E946,0x1E946},{0x1E947,0x1E947}, /* 1E946 */ + {0x1E948,0x1E948},{0x1E949,0x1E949}, /* 1E948 */ + {0x1E94A,0x1E94A},{0x1E94B,0x1E94B}, /* 1E94A */ + {0x1E94C,0x1E94C},{0x1E94D,0x1E94D}, /* 1E94C */ + {0x1E94E,0x1E94E},{0x1E94F,0x1E94F}, /* 1E94E */ + {0x1E950,0x1E950},{0x1E951,0x1E951}, /* 1E950 */ + {0x1E952,0x1E952},{0x1E953,0x1E953}, /* 1E952 */ + {0x1E954,0x1E954},{0x1E955,0x1E955}, /* 1E954 */ + {0x1E956,0x1E956},{0x1E957,0x1E957}, /* 1E956 */ + {0x1E958,0x1E958},{0x1E959,0x1E959}, /* 1E958 */ + {0x1E95A,0x1E95A},{0x1E95B,0x1E95B}, /* 1E95A */ + {0x1E95C,0x1E95C},{0x1E95D,0x1E95D}, /* 1E95C */ + {0x1E95E,0x1E95E},{0x1E95F,0x1E95F}, /* 1E95E */ + {0x1E960,0x1E960},{0x1E961,0x1E961}, /* 1E960 */ + {0x1E962,0x1E962},{0x1E963,0x1E963}, /* 1E962 */ + {0x1E964,0x1E964},{0x1E965,0x1E965}, /* 1E964 */ + {0x1E966,0x1E966},{0x1E967,0x1E967}, /* 1E966 */ + {0x1E968,0x1E968},{0x1E969,0x1E969}, /* 1E968 */ + {0x1E96A,0x1E96A},{0x1E96B,0x1E96B}, /* 1E96A */ + {0x1E96C,0x1E96C},{0x1E96D,0x1E96D}, /* 1E96C */ + {0x1E96E,0x1E96E},{0x1E96F,0x1E96F}, /* 1E96E */ + {0x1E970,0x1E970},{0x1E971,0x1E971}, /* 1E970 */ + {0x1E972,0x1E972},{0x1E973,0x1E973}, /* 1E972 */ + {0x1E974,0x1E974},{0x1E975,0x1E975}, /* 1E974 */ + {0x1E976,0x1E976},{0x1E977,0x1E977}, /* 1E976 */ + {0x1E978,0x1E978},{0x1E979,0x1E979}, /* 1E978 */ + {0x1E97A,0x1E97A},{0x1E97B,0x1E97B}, /* 1E97A */ + {0x1E97C,0x1E97C},{0x1E97D,0x1E97D}, /* 1E97C */ + {0x1E97E,0x1E97E},{0x1E97F,0x1E97F}, /* 1E97E */ + {0x1E980,0x1E980},{0x1E981,0x1E981}, /* 1E980 */ + {0x1E982,0x1E982},{0x1E983,0x1E983}, /* 1E982 */ + {0x1E984,0x1E984},{0x1E985,0x1E985}, /* 1E984 */ + {0x1E986,0x1E986},{0x1E987,0x1E987}, /* 1E986 */ + {0x1E988,0x1E988},{0x1E989,0x1E989}, /* 1E988 */ + {0x1E98A,0x1E98A},{0x1E98B,0x1E98B}, /* 1E98A */ + {0x1E98C,0x1E98C},{0x1E98D,0x1E98D}, /* 1E98C */ + {0x1E98E,0x1E98E},{0x1E98F,0x1E98F}, /* 1E98E */ + {0x1E990,0x1E990},{0x1E991,0x1E991}, /* 1E990 */ + {0x1E992,0x1E992},{0x1E993,0x1E993}, /* 1E992 */ + {0x1E994,0x1E994},{0x1E995,0x1E995}, /* 1E994 */ + {0x1E996,0x1E996},{0x1E997,0x1E997}, /* 1E996 */ + {0x1E998,0x1E998},{0x1E999,0x1E999}, /* 1E998 */ + {0x1E99A,0x1E99A},{0x1E99B,0x1E99B}, /* 1E99A */ + {0x1E99C,0x1E99C},{0x1E99D,0x1E99D}, /* 1E99C */ + {0x1E99E,0x1E99E},{0x1E99F,0x1E99F}, /* 1E99E */ + {0x1E9A0,0x1E9A0},{0x1E9A1,0x1E9A1}, /* 1E9A0 */ + {0x1E9A2,0x1E9A2},{0x1E9A3,0x1E9A3}, /* 1E9A2 */ + {0x1E9A4,0x1E9A4},{0x1E9A5,0x1E9A5}, /* 1E9A4 */ + {0x1E9A6,0x1E9A6},{0x1E9A7,0x1E9A7}, /* 1E9A6 */ + {0x1E9A8,0x1E9A8},{0x1E9A9,0x1E9A9}, /* 1E9A8 */ + {0x1E9AA,0x1E9AA},{0x1E9AB,0x1E9AB}, /* 1E9AA */ + {0x1E9AC,0x1E9AC},{0x1E9AD,0x1E9AD}, /* 1E9AC */ + {0x1E9AE,0x1E9AE},{0x1E9AF,0x1E9AF}, /* 1E9AE */ + {0x1E9B0,0x1E9B0},{0x1E9B1,0x1E9B1}, /* 1E9B0 */ + {0x1E9B2,0x1E9B2},{0x1E9B3,0x1E9B3}, /* 1E9B2 */ + {0x1E9B4,0x1E9B4},{0x1E9B5,0x1E9B5}, /* 1E9B4 */ + {0x1E9B6,0x1E9B6},{0x1E9B7,0x1E9B7}, /* 1E9B6 */ + {0x1E9B8,0x1E9B8},{0x1E9B9,0x1E9B9}, /* 1E9B8 */ + {0x1E9BA,0x1E9BA},{0x1E9BB,0x1E9BB}, /* 1E9BA */ + {0x1E9BC,0x1E9BC},{0x1E9BD,0x1E9BD}, /* 1E9BC */ + {0x1E9BE,0x1E9BE},{0x1E9BF,0x1E9BF}, /* 1E9BE */ + {0x1E9C0,0x1E9C0},{0x1E9C1,0x1E9C1}, /* 1E9C0 */ + {0x1E9C2,0x1E9C2},{0x1E9C3,0x1E9C3}, /* 1E9C2 */ + {0x1E9C4,0x1E9C4},{0x1E9C5,0x1E9C5}, /* 1E9C4 */ + {0x1E9C6,0x1E9C6},{0x1E9C7,0x1E9C7}, /* 1E9C6 */ + {0x1E9C8,0x1E9C8},{0x1E9C9,0x1E9C9}, /* 1E9C8 */ + {0x1E9CA,0x1E9CA},{0x1E9CB,0x1E9CB}, /* 1E9CA */ + {0x1E9CC,0x1E9CC},{0x1E9CD,0x1E9CD}, /* 1E9CC */ + {0x1E9CE,0x1E9CE},{0x1E9CF,0x1E9CF}, /* 1E9CE */ + {0x1E9D0,0x1E9D0},{0x1E9D1,0x1E9D1}, /* 1E9D0 */ + {0x1E9D2,0x1E9D2},{0x1E9D3,0x1E9D3}, /* 1E9D2 */ + {0x1E9D4,0x1E9D4},{0x1E9D5,0x1E9D5}, /* 1E9D4 */ + {0x1E9D6,0x1E9D6},{0x1E9D7,0x1E9D7}, /* 1E9D6 */ + {0x1E9D8,0x1E9D8},{0x1E9D9,0x1E9D9}, /* 1E9D8 */ + {0x1E9DA,0x1E9DA},{0x1E9DB,0x1E9DB}, /* 1E9DA */ + {0x1E9DC,0x1E9DC},{0x1E9DD,0x1E9DD}, /* 1E9DC */ + {0x1E9DE,0x1E9DE},{0x1E9DF,0x1E9DF}, /* 1E9DE */ + {0x1E9E0,0x1E9E0},{0x1E9E1,0x1E9E1}, /* 1E9E0 */ + {0x1E9E2,0x1E9E2},{0x1E9E3,0x1E9E3}, /* 1E9E2 */ + {0x1E9E4,0x1E9E4},{0x1E9E5,0x1E9E5}, /* 1E9E4 */ + {0x1E9E6,0x1E9E6},{0x1E9E7,0x1E9E7}, /* 1E9E6 */ + {0x1E9E8,0x1E9E8},{0x1E9E9,0x1E9E9}, /* 1E9E8 */ + {0x1E9EA,0x1E9EA},{0x1E9EB,0x1E9EB}, /* 1E9EA */ + {0x1E9EC,0x1E9EC},{0x1E9ED,0x1E9ED}, /* 1E9EC */ + {0x1E9EE,0x1E9EE},{0x1E9EF,0x1E9EF}, /* 1E9EE */ + {0x1E9F0,0x1E9F0},{0x1E9F1,0x1E9F1}, /* 1E9F0 */ + {0x1E9F2,0x1E9F2},{0x1E9F3,0x1E9F3}, /* 1E9F2 */ + {0x1E9F4,0x1E9F4},{0x1E9F5,0x1E9F5}, /* 1E9F4 */ + {0x1E9F6,0x1E9F6},{0x1E9F7,0x1E9F7}, /* 1E9F6 */ + {0x1E9F8,0x1E9F8},{0x1E9F9,0x1E9F9}, /* 1E9F8 */ + {0x1E9FA,0x1E9FA},{0x1E9FB,0x1E9FB}, /* 1E9FA */ + {0x1E9FC,0x1E9FC},{0x1E9FD,0x1E9FD}, /* 1E9FC */ + {0x1E9FE,0x1E9FE},{0x1E9FF,0x1E9FF} /* 1E9FE */ +}; + +const MY_CASEFOLD_CHARACTER * my_u1400_casefold_index[4352]={ + u1400_casefold_page00, u1400_casefold_page01, u1400_casefold_page02, u1400_casefold_page03, u1400_casefold_page04, u1400_casefold_page05, u1400_casefold_page06, u1400_casefold_page07, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + u1400_casefold_page10, NULL, NULL, u1400_casefold_page13, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, u1400_casefold_page1C, u1400_casefold_page1D, u1400_casefold_page1E, u1400_casefold_page1F, + NULL, u1400_casefold_page21, NULL, NULL, u1400_casefold_page24, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, u1400_casefold_page2C, u1400_casefold_page2D, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, u1400_casefold_pageA6, u1400_casefold_pageA7, + NULL, NULL, NULL, u1400_casefold_pageAB, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, u1400_casefold_pageFF, + NULL, NULL, NULL, NULL, u1400_casefold_page104, u1400_casefold_page105, NULL, NULL, + NULL, NULL, NULL, NULL, u1400_casefold_page10C, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + u1400_casefold_page118, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, u1400_casefold_page16E, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, u1400_casefold_page1E9, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL +}; diff --git a/strings/ctype-unidata.c b/strings/ctype-unidata.c index 58a823d6970..77bec5418c4 100644 --- a/strings/ctype-unidata.c +++ b/strings/ctype-unidata.c @@ -31,6 +31,8 @@ #include "ctype-unicode300-casefold.h" #include "ctype-unicode300-casefold-tr.h" #include "ctype-unicode520-casefold.h" +#include "ctype-unicode1400-casefold.h" +#include "ctype-unicode1400-casefold-tr.h" @@ -77,3 +79,19 @@ MY_CASEFOLD_INFO my_casefold_unicode520= my_u520_casefold_index, NULL }; + + +MY_CASEFOLD_INFO my_casefold_unicode1400= +{ + 0x10FFFF, + my_u1400_casefold_index, + NULL +}; + + +MY_CASEFOLD_INFO my_casefold_unicode1400tr= +{ + 0x10FFFF, + my_u1400tr_casefold_index, + NULL +}; diff --git a/strings/ctype-unidata.h b/strings/ctype-unidata.h index ba3235e47e5..0bcf96c09a0 100644 --- a/strings/ctype-unidata.h +++ b/strings/ctype-unidata.h @@ -136,6 +136,8 @@ extern MY_CASEFOLD_INFO my_casefold_default; extern MY_CASEFOLD_INFO my_casefold_turkish; extern MY_CASEFOLD_INFO my_casefold_mysql500; extern MY_CASEFOLD_INFO my_casefold_unicode520; +extern MY_CASEFOLD_INFO my_casefold_unicode1400; +extern MY_CASEFOLD_INFO my_casefold_unicode1400tr; size_t my_strxfrm_pad_nweights_unicode(uchar *str, uchar *strend, size_t nweights); diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 8656f1f0593..121a3f945f6 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -118,7 +118,9 @@ static uint my_casefold_multiply_utf8mbx(CHARSET_INFO *cs) { DBUG_ASSERT(cs->mbminlen == 1 && cs->mbmaxlen >= 3); - if (cs->casefold == &my_casefold_unicode520) + if (cs->casefold == &my_casefold_unicode520 || + cs->casefold == &my_casefold_unicode1400 || + cs->casefold == &my_casefold_unicode1400tr) return 2; if (cs->casefold == &my_casefold_turkish) return 2; From bc3bfcf943b817b19a41e4f599b4f2e9a259b263 Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Mon, 20 Mar 2023 15:20:32 +0100 Subject: [PATCH 131/260] MDEV-30862 Assertion `mode_ == m_high_priority' failed CREATE TABLE AS SELECT is not supported in combination with streaming replication. --- .../suite/galera_sr/r/MDEV-30862.result | 11 +++++++++ mysql-test/suite/galera_sr/t/MDEV-30862.test | 24 +++++++++++++++++++ sql/sql_table.cc | 13 ++++++++++ 3 files changed, 48 insertions(+) create mode 100644 mysql-test/suite/galera_sr/r/MDEV-30862.result create mode 100644 mysql-test/suite/galera_sr/t/MDEV-30862.test diff --git a/mysql-test/suite/galera_sr/r/MDEV-30862.result b/mysql-test/suite/galera_sr/r/MDEV-30862.result new file mode 100644 index 00000000000..43da77f24df --- /dev/null +++ b/mysql-test/suite/galera_sr/r/MDEV-30862.result @@ -0,0 +1,11 @@ +connection node_2; +connection node_1; +SET autocommit=0; +SET SESSION wsrep_trx_fragment_size=1; +CREATE TABLE t2 SELECT seq FROM seq_1_to_50; +ERROR 42000: CREATE TABLE AS SELECT is not supported with streaming replication +CREATE TABLE t1 (f1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY); +INSERT INTO t1 VALUES(DEFAULT); +CREATE TABLE t2 SELECT * FROM t1; +ERROR 42000: CREATE TABLE AS SELECT is not supported with streaming replication +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/t/MDEV-30862.test b/mysql-test/suite/galera_sr/t/MDEV-30862.test new file mode 100644 index 00000000000..6be77b4d71b --- /dev/null +++ b/mysql-test/suite/galera_sr/t/MDEV-30862.test @@ -0,0 +1,24 @@ +# +# MDEV-30862 Assertion `mode_ == m_high_priority' failed in +# void wsrep::client_state::after_applying() +# + +--source include/galera_cluster.inc +--source include/have_sequence.inc + +SET autocommit=0; +SET SESSION wsrep_trx_fragment_size=1; +--error ER_NOT_ALLOWED_COMMAND +CREATE TABLE t2 SELECT seq FROM seq_1_to_50; + + +# +# Same test without using seq +# +CREATE TABLE t1 (f1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY); +INSERT INTO t1 VALUES(DEFAULT); +--error ER_NOT_ALLOWED_COMMAND +CREATE TABLE t2 SELECT * FROM t1; + + +DROP TABLE t1; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 9f13dcde40f..1e88e7722e3 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -11569,6 +11569,19 @@ bool Sql_cmd_create_table_like::execute(THD *thd) } #endif +#ifdef WITH_WSREP + if (select_lex->item_list.elements && // With SELECT + WSREP(thd) && thd->variables.wsrep_trx_fragment_size > 0) + { + my_message( + ER_NOT_ALLOWED_COMMAND, + "CREATE TABLE AS SELECT is not supported with streaming replication", + MYF(0)); + res= 1; + goto end_with_restore_list; + } +#endif /* WITH_WSREP */ + if (select_lex->item_list.elements || select_lex->tvc) // With select or TVC { select_result *result; From be7ef6566fab6088b5222eae184226ed6b5994d3 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Tue, 28 Mar 2023 10:25:59 +0300 Subject: [PATCH 132/260] MDEV-30605: Wrong result while using index for group-by A GROUP BY query which uses "MIN(pk)" and has "pk<>const" in the WHERE clause would produce wrong result when handled with "Using index for group-by". Here "pk" column is the table's primary key. The problem was introduced by fix for MDEV-23634. It made the range optimizer to not produce ranges for conditions in form "pk != const". However, LooseScan code requires that the optimizer is able to convert the condition on the MIN/MAX column into an equivalent range. The range is used to locate the row that has the MIN/MAX value. LooseScan checks this in check_group_min_max_predicates(). This fix makes the code in that function to take into account that "pk != const" does not produce a range. --- mysql-test/main/group_min_max.result | 12 ++++++++ mysql-test/main/group_min_max.test | 11 +++++++ sql/opt_range.cc | 46 +++++++++++++++++----------- 3 files changed, 51 insertions(+), 18 deletions(-) diff --git a/mysql-test/main/group_min_max.result b/mysql-test/main/group_min_max.result index d1bd4d8cedb..a87a79fbc56 100644 --- a/mysql-test/main/group_min_max.result +++ b/mysql-test/main/group_min_max.result @@ -4083,5 +4083,17 @@ MIN(pk) 1 DROP TABLE t1, t2; # +# MDEV-30605 Wrong result while using index for group-by +# +CREATE TABLE t1 (pk INT primary key, a int, key(a)) engine=innodb; +INSERT INTO t1 VALUES (1,-1),(2,8),(3,5),(4,-1),(5,10), (6,-1); +SELECT MIN(pk), a FROM t1 WHERE pk <> 1 GROUP BY a; +MIN(pk) a +4 -1 +3 5 +2 8 +5 10 +DROP TABLE t1; +# # End of 10.5 tests # diff --git a/mysql-test/main/group_min_max.test b/mysql-test/main/group_min_max.test index 7de57d75d36..5f7981b8b30 100644 --- a/mysql-test/main/group_min_max.test +++ b/mysql-test/main/group_min_max.test @@ -1737,6 +1737,17 @@ SELECT SQL_BUFFER_RESULT MIN(pk) FROM t1, t2; SELECT MIN(pk) FROM t1, t2; DROP TABLE t1, t2; +--echo # +--echo # MDEV-30605 Wrong result while using index for group-by +--echo # + +CREATE TABLE t1 (pk INT primary key, a int, key(a)) engine=innodb; +INSERT INTO t1 VALUES (1,-1),(2,8),(3,5),(4,-1),(5,10), (6,-1); + +SELECT MIN(pk), a FROM t1 WHERE pk <> 1 GROUP BY a; + +DROP TABLE t1; + --echo # --echo # End of 10.5 tests --echo # diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 223799a3235..82b19e23fd4 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -461,7 +461,7 @@ void print_range_for_non_indexed_field(String *out, Field *field, static void print_min_range_operator(String *out, const ha_rkey_function flag); static void print_max_range_operator(String *out, const ha_rkey_function flag); -static bool is_field_an_unique_index(RANGE_OPT_PARAM *param, Field *field); +static bool is_field_an_unique_index(Field *field); /* SEL_IMERGE is a list of possible ways to do index merge, i.e. it is @@ -7752,8 +7752,13 @@ SEL_TREE *Item_func_ne::get_func_mm_tree(RANGE_OPT_PARAM *param, If this condition is a "col1<>...", where there is a UNIQUE KEY(col1), do not construct a SEL_TREE from it. A condition that excludes just one row in the table is not selective (unless there are only a few rows) + + Note: this logic must be in sync with code in + check_group_min_max_predicates(). That function walks an Item* condition + and checks if the range optimizer would produce an equivalent range for + it. */ - if (is_field_an_unique_index(param, field)) + if (param->using_real_indexes && is_field_an_unique_index(field)) DBUG_RETURN(NULL); DBUG_RETURN(get_ne_mm_tree(param, field, value, value)); } @@ -7865,7 +7870,7 @@ SEL_TREE *Item_func_in::get_func_mm_tree(RANGE_OPT_PARAM *param, - if there are a lot of constants, the overhead of building and processing enormous range list is not worth it. */ - if (is_field_an_unique_index(param, field)) + if (param->using_real_indexes && is_field_an_unique_index(field)) DBUG_RETURN(0); /* Get a SEL_TREE for "(-inf|NULL) < X < c_0" interval. */ @@ -8574,24 +8579,18 @@ SEL_TREE *Item_equal::get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) In the future we could also add "almost unique" indexes where any value is present only in a few rows (but necessarily exactly one row) */ -static bool is_field_an_unique_index(RANGE_OPT_PARAM *param, Field *field) +static bool is_field_an_unique_index(Field *field) { DBUG_ENTER("is_field_an_unique_index"); - - // The check for using_real_indexes is there because of the heuristics - // this function is used for. - if (param->using_real_indexes) + key_map::Iterator it(field->key_start); + uint key_no; + while ((key_no= it++) != key_map::Iterator::BITMAP_END) { - key_map::Iterator it(field->key_start); - uint key_no; - while ((key_no= it++) != key_map::Iterator::BITMAP_END) + KEY *key_info= &field->table->key_info[key_no]; + if (key_info->user_defined_key_parts == 1 && + (key_info->flags & HA_NOSAME)) { - KEY *key_info= &field->table->key_info[key_no]; - if (key_info->user_defined_key_parts == 1 && - (key_info->flags & HA_NOSAME)) - { - DBUG_RETURN(true); - } + DBUG_RETURN(true); } } DBUG_RETURN(false); @@ -13475,7 +13474,7 @@ cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts, - (C between const_i and const_j) - C IS NULL - C IS NOT NULL - - C != const + - C != const (unless C is the primary key) SA4. If Q has a GROUP BY clause, there are no other aggregate functions except MIN and MAX. For queries with DISTINCT, aggregate functions are allowed. @@ -14358,6 +14357,17 @@ check_group_min_max_predicates(Item *cond, Item_field *min_max_arg_item, if (!simple_pred(pred, args, &inv)) DBUG_RETURN(FALSE); + /* + Follow the logic in Item_func_ne::get_func_mm_tree(): condition + in form "tbl.primary_key <> const" is not used to produce intervals. + + If the condition doesn't have an equivalent interval, this means we + fail LooseScan's condition SA3. Return FALSE to indicate this. + */ + if (pred_type == Item_func::NE_FUNC && + is_field_an_unique_index(min_max_arg_item->field)) + DBUG_RETURN(FALSE); + if (args[0] && args[1]) // this is a binary function or BETWEEN { DBUG_ASSERT(pred->fixed_type_handler()); From 485a1b1f116f0c5e73fce3a97ffdac84c861b3c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 18 Apr 2023 14:54:40 +0300 Subject: [PATCH 133/260] MDEV-30863 Server freeze, all threads in trx_assign_rseg_low() trx_assign_rseg_low(): Simplify the debug check. trx_rseg_t::reinit(): Reset the skip_allocation() flag. This logic was broken in the merge commit 3e2ad0e918d5d38322994ec9e08fc5dda3a80707 of commit 0de3be8cfdfc26f5c236eaefe12d03c7b4af22c8 (that is, innodb_undo_log_truncate=ON would never be "completed"). Tested by: Matthias Leich --- storage/innobase/include/trx0rseg.h | 3 ++- storage/innobase/trx/trx0rseg.cc | 1 + storage/innobase/trx/trx0trx.cc | 20 +++++--------------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/storage/innobase/include/trx0rseg.h b/storage/innobase/include/trx0rseg.h index 8b7eacbbc18..1d95b7d2e7a 100644 --- a/storage/innobase/include/trx0rseg.h +++ b/storage/innobase/include/trx0rseg.h @@ -129,7 +129,8 @@ public: #endif } /** @return whether the segment is marked for undo truncation */ - bool skip_allocation() const { return ref_load() & SKIP; } + bool skip_allocation() const + { return ref.load(std::memory_order_acquire) & SKIP; } /** Increment the reference count */ void acquire() { ut_d(auto r=) ref.fetch_add(REF); ut_ad(!(r & SKIP)); } diff --git a/storage/innobase/trx/trx0rseg.cc b/storage/innobase/trx/trx0rseg.cc index d30300d70a7..6d95dcf06f1 100644 --- a/storage/innobase/trx/trx0rseg.cc +++ b/storage/innobase/trx/trx0rseg.cc @@ -403,6 +403,7 @@ void trx_rseg_t::reinit(uint32_t page) last_commit_and_offset= 0; last_page_no= FIL_NULL; curr_size= 1; + ref.store(0, std::memory_order_release); } /** Read the undo log lists. diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index d7ab02844bf..ed1187e179b 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -811,30 +811,20 @@ static void trx_assign_rseg_low(trx_t *trx) static Atomic_counter rseg_slot; unsigned slot = rseg_slot++ % TRX_SYS_N_RSEGS; ut_d(if (trx_rseg_n_slots_debug) slot = 0); + ut_d(const auto start_scan_slot = slot); trx_rseg_t* rseg; -#ifdef UNIV_DEBUG - ulint start_scan_slot = slot; - bool look_for_rollover = false; -#endif /* UNIV_DEBUG */ - bool allocated; do { for (;;) { rseg = &trx_sys.rseg_array[slot]; -#ifdef UNIV_DEBUG - /* Ensure that we are not revisiting the same - slot that we have already inspected. */ - if (look_for_rollover) { + do { + ut_d(if (!trx_rseg_n_slots_debug) continue); + slot = (slot + 1) % TRX_SYS_N_RSEGS; ut_ad(start_scan_slot != slot); - } - look_for_rollover = true; -#endif /* UNIV_DEBUG */ - - ut_d(if (!trx_rseg_n_slots_debug)) - slot = (slot + 1) % TRX_SYS_N_RSEGS; + } while (0); if (!rseg->space) { continue; From feeeacc4d747868c234425dc12c157c6e5fa8fbb Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Wed, 29 Mar 2023 13:55:30 +0200 Subject: [PATCH 134/260] MDEV-30955 Explicit locks released too early in rollback path Assertion `thd->mdl_context.is_lock_owner()` fires when a client is disconnected, while transaction and and a table is opened through `HANDLER` interface. Reason for the assertion is that when a connection closes, its ongoing transaction is eventually rolled back in `Wsrep_client_state::bf_rollback()`. This method also releases explicit which are expected to survive beyond the transaction lifetime. This patch also removes calls to `mysql_ull_cleanup()`. User level locks are not supported in combination with Galera, making these calls unnecessary. --- mysql-test/suite/galera/r/MDEV-30955.result | 26 ++++++++ mysql-test/suite/galera/t/MDEV-30955.test | 70 +++++++++++++++++++++ sql/sql_parse.cc | 2 +- sql/wsrep_client_service.cc | 2 - sql/wsrep_high_priority_service.cc | 2 - 5 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 mysql-test/suite/galera/r/MDEV-30955.result create mode 100644 mysql-test/suite/galera/t/MDEV-30955.test diff --git a/mysql-test/suite/galera/r/MDEV-30955.result b/mysql-test/suite/galera/r/MDEV-30955.result new file mode 100644 index 00000000000..2a090cb58bc --- /dev/null +++ b/mysql-test/suite/galera/r/MDEV-30955.result @@ -0,0 +1,26 @@ +connection node_2; +connection node_1; +CREATE TABLE t (a CHAR(1) KEY); +START TRANSACTION; +HANDLER t OPEN; +disconnect node_1; +connect node_1, 127.0.0.1, root, , test, $NODE_MYPORT_1; +DROP TABLE t; +BACKUP STAGE START; +START TRANSACTION; +disconnect node_1; +connect node_1, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +CREATE TABLE t2 (f1 INTEGER PRIMARY KEY); +START TRANSACTION; +INSERT INTO t1 VALUES(1); +HANDLER t2 OPEN; +connection node_2; +INSERT INTO t1 VALUES(1); +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1a; +connection node_1; +COMMIT; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +DROP TABLE t1,t2; diff --git a/mysql-test/suite/galera/t/MDEV-30955.test b/mysql-test/suite/galera/t/MDEV-30955.test new file mode 100644 index 00000000000..18577120e83 --- /dev/null +++ b/mysql-test/suite/galera/t/MDEV-30955.test @@ -0,0 +1,70 @@ +# +# MDEV-30955 +# Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, +# table->s->db.str, table->s->table_name.str, MDL_SHARED)' +# failed in close_thread_table() +# + +--source include/galera_cluster.inc + +# +# Test 1: Assertion thd->mdl_context.is_lock_owner() +# failed in close_thread_table() +# +CREATE TABLE t (a CHAR(1) KEY); +START TRANSACTION; +HANDLER t OPEN; + +# +# If bug is present the transaction will be aborted +# through Wsrep_client_service::bf_rollback() and +# release explicit locks too early. Later, during +# THD::cleanup(), table t will be closed and the +# THD is expected to be owner of the MDL lock that +# was just released. +# +--disconnect node_1 + +--connect node_1, 127.0.0.1, root, , test, $NODE_MYPORT_1 +DROP TABLE t; + + +# +# Test 2: Similar issue reproduces also with BACKUP STAGE locks. +# See comments in MDEV-25037 +# + +BACKUP STAGE START; +START TRANSACTION; +--disconnect node_1 +--connect node_1, 127.0.0.1, root, , test, $NODE_MYPORT_1 + + +# +# Test 3: Assertion `!thd->mdl_context.has_locks()' failed +# in do_command() +# + +--connection node_1 +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +CREATE TABLE t2 (f1 INTEGER PRIMARY KEY); + +--let $bf_count = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.global_status WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` + +START TRANSACTION; +INSERT INTO t1 VALUES(1); +HANDLER t2 OPEN; + +--connection node_2 +INSERT INTO t1 VALUES(1); + +--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 +--connection node_1a +--let $wait_condition = SELECT VARIABLE_VALUE = $bf_count + 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts' +--source include/wait_condition.inc + +--connection node_1 +--error ER_LOCK_DEADLOCK +COMMIT; + +DROP TABLE t1,t2; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index c495ae2d6c4..c95993e1604 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1309,7 +1309,7 @@ bool do_command(THD *thd) in wsrep_before_command(). */ WSREP_LOG_THD(thd, "enter found BF aborted"); - DBUG_ASSERT(!thd->mdl_context.has_locks()); + DBUG_ASSERT(!thd->mdl_context.has_transactional_locks()); DBUG_ASSERT(!thd->get_stmt_da()->is_set()); /* We let COM_QUIT and COM_STMT_CLOSE to execute even if wsrep aborted. */ if (command == COM_STMT_EXECUTE) diff --git a/sql/wsrep_client_service.cc b/sql/wsrep_client_service.cc index f00dfccf274..0399cf4f442 100644 --- a/sql/wsrep_client_service.cc +++ b/sql/wsrep_client_service.cc @@ -362,8 +362,6 @@ int Wsrep_client_service::bf_rollback() m_thd->global_read_lock.unlock_global_read_lock(m_thd); } m_thd->release_transactional_locks(); - mysql_ull_cleanup(m_thd); - m_thd->mdl_context.release_explicit_locks(); DBUG_RETURN(ret); } diff --git a/sql/wsrep_high_priority_service.cc b/sql/wsrep_high_priority_service.cc index 96269481559..3c6524b7ddf 100644 --- a/sql/wsrep_high_priority_service.cc +++ b/sql/wsrep_high_priority_service.cc @@ -357,8 +357,6 @@ int Wsrep_high_priority_service::rollback(const wsrep::ws_handle& ws_handle, m_thd->wsrep_cs().prepare_for_ordering(ws_handle, ws_meta, false); int ret= (trans_rollback_stmt(m_thd) || trans_rollback(m_thd)); m_thd->release_transactional_locks(); - mysql_ull_cleanup(m_thd); - m_thd->mdl_context.release_explicit_locks(); free_root(m_thd->mem_root, MYF(MY_KEEP_PREALLOC)); From 75063d128812347228873e2dce4ae7799f348ebf Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Tue, 4 Apr 2023 15:54:26 +1000 Subject: [PATCH 135/260] MDEV-30542 Add multilength spider self-reference detection test --- .../bugfix/r/self_reference_multi.result | 21 ++++++++++++++ .../spider/bugfix/t/self_reference_multi.test | 29 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result create mode 100644 storage/spider/mysql-test/spider/bugfix/t/self_reference_multi.test diff --git a/storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result b/storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result new file mode 100644 index 00000000000..c4399ddf9d2 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result @@ -0,0 +1,21 @@ +for master_1 +for child2 +for child3 + +MDEV-6268 SPIDER table with no COMMENT clause causes queries to wait forever + +CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); +create table t2 (c int); +create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"'; +create table t0 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t1"'; +alter table t2 ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t0"'; +select * from t0; +ERROR HY000: An infinite loop is detected when opening table test.t0 +select * from t1; +ERROR HY000: An infinite loop is detected when opening table test.t0 +select * from t2; +ERROR HY000: An infinite loop is detected when opening table test.t0 +drop table t0, t1, t2; +for master_1 +for child2 +for child3 diff --git a/storage/spider/mysql-test/spider/bugfix/t/self_reference_multi.test b/storage/spider/mysql-test/spider/bugfix/t/self_reference_multi.test new file mode 100644 index 00000000000..8b6f070d167 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/self_reference_multi.test @@ -0,0 +1,29 @@ +--disable_query_log +--disable_result_log +--source ../../t/test_init.inc +--enable_result_log +--enable_query_log + +--echo +--echo MDEV-6268 SPIDER table with no COMMENT clause causes queries to wait forever +--echo + +--replace_regex /SOCKET ".*"/SOCKET "$MASTER_1_MYSOCK"/ +eval CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); +create table t2 (c int); +create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"'; +create table t0 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t1"'; +alter table t2 ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t0"'; +--error 12719 +select * from t0; +--error 12719 +select * from t1; +--error 12719 +select * from t2; +drop table t0, t1, t2; + +--disable_query_log +--disable_result_log +--source ../../t/test_deinit.inc +--enable_result_log +--enable_query_log From d6651864773afc2b7534285ee0d50d4fd6b47e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 19 Apr 2023 14:08:53 +0300 Subject: [PATCH 136/260] MDEV-28976: mtr must wait for server to actually die do_shutdown_server(): Call wait_until_dead() also when we are forcibly killing the process (timeout=0). We have evidence that killing the process may take some time and cause mystery failures in crash recovery tests. For InnoDB, several failures were observed between commit da094188f60bf67e3d90227304a4ea256fe2630f and commit 0ee1082bd2e7e7049c4f0e686bad53cf7ba053ab when no advisory file locking was being used by default. --- client/mysqltest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 6330d4f881d..9e9b122c5fe 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -5191,7 +5191,7 @@ void do_shutdown_server(struct st_command *command) if (timeout) (void) my_kill(pid, SIGABRT); /* Give server a few seconds to die in all cases */ - if (!timeout || wait_until_dead(pid, timeout < 5 ? 5 : timeout)) + if (wait_until_dead(pid, timeout < 5 ? 5 : timeout)) { (void) my_kill(pid, SIGKILL); } From b2bbc66a41a7b3b622fbcd477e777c45e3248886 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Mon, 10 Apr 2023 11:57:39 +0530 Subject: [PATCH 137/260] MDEV-24011 InnoDB: Failing assertion: index_cache->words == NULL in fts0fts.cc line 551 This issue happens when race condition happens when DDL and fts optimize thread. DDL adds the new index to fts cache. At the same time, fts optimize thread clears the cache and reinitialize it. Take cache init lock before reinitializing the cache. fts_sync_commit() should take dict_sys mutex to avoid the deadlock with create index. --- storage/innobase/fts/fts0fts.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc index 224fc9593b7..8ce6fee0b76 100644 --- a/storage/innobase/fts/fts0fts.cc +++ b/storage/innobase/fts/fts0fts.cc @@ -851,7 +851,7 @@ fts_drop_index( dberr_t err = DB_SUCCESS; ut_a(indexes); - + ut_d(dict_sys.assert_locked()); if ((ib_vector_size(indexes) == 1 && (index == static_cast( ib_vector_getp(table->fts->indexes, 0))) @@ -873,7 +873,9 @@ fts_drop_index( current_doc_id = table->fts->cache->next_doc_id; first_doc_id = table->fts->cache->first_doc_id; + rw_lock_x_lock(&table->fts->cache->init_lock); fts_cache_clear(table->fts->cache); + rw_lock_x_unlock(&table->fts->cache->init_lock); fts_cache_destroy(table->fts->cache); table->fts->cache = fts_cache_create(table); table->fts->cache->next_doc_id = current_doc_id; @@ -4192,9 +4194,15 @@ fts_sync_commit( /* We need to do this within the deleted lock since fts_delete() can attempt to add a deleted doc id to the cache deleted id array. */ + mutex_enter(&dict_sys.mutex); + sync->table->fts->dict_locked = true; + rw_lock_x_lock(&cache->init_lock); fts_cache_clear(cache); DEBUG_SYNC_C("fts_deleted_doc_ids_clear"); fts_cache_init(cache); + rw_lock_x_unlock(&cache->init_lock); + sync->table->fts->dict_locked = false; + mutex_exit(&dict_sys.mutex); rw_lock_x_unlock(&cache->lock); if (UNIV_LIKELY(error == DB_SUCCESS)) { From 2bfd04e3145b238df5f31143b98b1df501f43d1e Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Tue, 11 Apr 2023 18:36:55 +0530 Subject: [PATCH 138/260] MDEV-31025 Redundant table alter fails when fixed column stored externally row_merge_buf_add(): Has strict assert that fixed length mismatch shouldn't happen while rebuilding the redundant row format table btr_index_rec_validate(): Fixed size column can be stored externally. So sum of inline stored length and external stored length of the column should be equal to total column length --- .../innodb/r/default_row_format_alter.result | 20 +++++++++++++++++++ .../innodb/t/default_row_format_alter.test | 17 ++++++++++++++++ storage/innobase/btr/btr0btr.cc | 2 +- storage/innobase/row/row0merge.cc | 5 ----- 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/mysql-test/suite/innodb/r/default_row_format_alter.result b/mysql-test/suite/innodb/r/default_row_format_alter.result index 42cbab8a5f2..33936b59003 100644 --- a/mysql-test/suite/innodb/r/default_row_format_alter.result +++ b/mysql-test/suite/innodb/r/default_row_format_alter.result @@ -129,5 +129,25 @@ SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1'; ROW_FORMAT Dynamic DROP TABLE t1; +# +# MDEV-31025 Redundant table alter fails when fixed column +# stored externally +# +set @old_sql_mode = @@sql_mode; +SET @@sql_mode=''; +CREATE TABLE t1(pk INT,c CHAR(255),c2 CHAR(255),c3 CHAR(255), +c4 char(255), c5 char(255), c6 char(255), +c7 char(255), c8 char(255), primary key(pk) +)Engine=InnoDB character set utf32 ROW_FORMAT=REDUNDANT; +INSERT INTO t1(pk, c) VALUES (1, repeat('a', 255)); +ALTER TABLE t1 FORCE; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SELECT LENGTH(c) FROM t1; +LENGTH(c) +1020 +DROP TABLE t1; +set @@sql_mode = @old_sql_mode; # End of 10.4 tests SET GLOBAL innodb_default_row_format = @row_format; diff --git a/mysql-test/suite/innodb/t/default_row_format_alter.test b/mysql-test/suite/innodb/t/default_row_format_alter.test index f5dd246efb5..5f2170454f3 100644 --- a/mysql-test/suite/innodb/t/default_row_format_alter.test +++ b/mysql-test/suite/innodb/t/default_row_format_alter.test @@ -150,6 +150,23 @@ ALTER TABLE t1 DROP b; SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1'; DROP TABLE t1; +--echo # +--echo # MDEV-31025 Redundant table alter fails when fixed column +--echo # stored externally +--echo # +set @old_sql_mode = @@sql_mode; +SET @@sql_mode=''; +CREATE TABLE t1(pk INT,c CHAR(255),c2 CHAR(255),c3 CHAR(255), + c4 char(255), c5 char(255), c6 char(255), + c7 char(255), c8 char(255), primary key(pk) + )Engine=InnoDB character set utf32 ROW_FORMAT=REDUNDANT; +INSERT INTO t1(pk, c) VALUES (1, repeat('a', 255)); +ALTER TABLE t1 FORCE; +CHECK TABLE t1; +SELECT LENGTH(c) FROM t1; +DROP TABLE t1; +set @@sql_mode = @old_sql_mode; + --echo # End of 10.4 tests SET GLOBAL innodb_default_row_format = @row_format; diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index f54a8e1125a..2df94715750 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -4713,7 +4713,7 @@ n_field_mismatch: len -= BTR_EXTERN_FIELD_REF_SIZE; ulint extern_len = mach_read_from_4( data + len + BTR_EXTERN_LEN + 4); - if (fixed_size == extern_len) { + if (fixed_size == extern_len + len) { goto next_field; } } diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 9d755ce6f1e..f0aed489f22 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -681,11 +681,6 @@ error: row_field, field, col->len, old_table->space->zip_size(), conv_heap); - } else { - /* Field length mismatch should not - happen when rebuilding redundant row - format table. */ - ut_ad(index->table->not_redundant()); } } } From 660afb1e9c11d4fe1ba806557c60cda3f62b1be1 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Thu, 13 Apr 2023 16:26:03 +0530 Subject: [PATCH 139/260] MDEV-30076 ibuf_insert tries to insert the entry for uncommitted index - Change buffer should not buffer the changes for uncommitted index --- storage/innobase/ibuf/ibuf0ibuf.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc index 3fe74c3a270..d611c7793f7 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -3577,6 +3577,10 @@ ibuf_insert( ulint zip_size, que_thr_t* thr) { + if (!index->is_committed()) { + return false; + } + dberr_t err; ulint entry_size; ibool no_counter; From 1892f5d8fcb73350973f93b1a89cdc1482a5c116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 19 Apr 2023 14:46:49 +0300 Subject: [PATCH 140/260] MDEV-30863 fixup: Hang in a debug build trx_assign_rseg_low(): Correct a debug injection condition. --- storage/innobase/trx/trx0trx.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index ed1187e179b..a84ae220839 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -821,7 +821,7 @@ static void trx_assign_rseg_low(trx_t *trx) rseg = &trx_sys.rseg_array[slot]; do { - ut_d(if (!trx_rseg_n_slots_debug) continue); + ut_d(if (trx_rseg_n_slots_debug) continue); slot = (slot + 1) % TRX_SYS_N_RSEGS; ut_ad(start_scan_slot != slot); } while (0); From 210db2935cb3802f6806ba3b23c32263611e3e2f Mon Sep 17 00:00:00 2001 From: Denis Protivensky Date: Tue, 14 Mar 2023 14:08:12 +0300 Subject: [PATCH 141/260] MDEV-30804 Rollback multi-engine transaction requiring 2PC but committing in one phase Signed-off-by: Julius Goryavsky --- mysql-test/suite/galera/r/MDEV-30804.result | 11 +++++++++++ mysql-test/suite/galera/t/MDEV-30804.cnf | 7 +++++++ mysql-test/suite/galera/t/MDEV-30804.test | 21 +++++++++++++++++++++ sql/handler.cc | 14 +++++++++++++- 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/galera/r/MDEV-30804.result create mode 100644 mysql-test/suite/galera/t/MDEV-30804.cnf create mode 100644 mysql-test/suite/galera/t/MDEV-30804.test diff --git a/mysql-test/suite/galera/r/MDEV-30804.result b/mysql-test/suite/galera/r/MDEV-30804.result new file mode 100644 index 00000000000..2bf323d19f8 --- /dev/null +++ b/mysql-test/suite/galera/r/MDEV-30804.result @@ -0,0 +1,11 @@ +connection node_2; +connection node_1; +CREATE TABLE t (a INT) ENGINE=Aria; +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +START TRANSACTION; +INSERT INTO t VALUES ('1'); +INSERT INTO t1 VALUES ('1'); +COMMIT; +ERROR HY000: Transactional commit not supported by involved engine(s) +DROP TABLE t; +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/MDEV-30804.cnf b/mysql-test/suite/galera/t/MDEV-30804.cnf new file mode 100644 index 00000000000..9dbd81f758d --- /dev/null +++ b/mysql-test/suite/galera/t/MDEV-30804.cnf @@ -0,0 +1,7 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +log-bin + +[mysqld.2] +log-bin diff --git a/mysql-test/suite/galera/t/MDEV-30804.test b/mysql-test/suite/galera/t/MDEV-30804.test new file mode 100644 index 00000000000..561953a0578 --- /dev/null +++ b/mysql-test/suite/galera/t/MDEV-30804.test @@ -0,0 +1,21 @@ +# +# Test that transaction requiring two-phase commit and involving +# storage engines not supporting it rolls back with a message. +# + +--source include/galera_cluster.inc +--source include/have_innodb.inc +--source include/have_aria.inc + +CREATE TABLE t (a INT) ENGINE=Aria; +CREATE TABLE t1 (a INT) ENGINE=InnoDB; + +START TRANSACTION; +INSERT INTO t VALUES ('1'); +INSERT INTO t1 VALUES ('1'); + +--error ER_ERROR_DURING_COMMIT +COMMIT; + +DROP TABLE t; +DROP TABLE t1; diff --git a/sql/handler.cc b/sql/handler.cc index 4afd30021ee..e0dd51376ad 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1733,7 +1733,19 @@ int ha_commit_trans(THD *thd, bool all) ordering is normally done. Commit ordering must be done here. */ if (run_wsrep_hooks) - error= wsrep_before_commit(thd, all); + { + // This commit involves more than one storage engine and requires + // two phases, but some engines don't support it. + // Issue a message to the client and roll back the transaction. + if (trans->no_2pc && rw_ha_count > 1) + { + my_message(ER_ERROR_DURING_COMMIT, "Transactional commit not supported " + "by involved engine(s)", MYF(0)); + error= 1; + } + else + error= wsrep_before_commit(thd, all); + } if (error) { ha_rollback_trans(thd, FALSE); From 78368e5866383333407a4e2752c8b62df8fb8c29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 19 Apr 2023 15:52:11 +0300 Subject: [PATCH 142/260] MDEV-30863 fixup: Assertion failure when using innodb_undo_tablespaces=0 trx_assign_rseg_low(): Let us restore the debug variable look_for_rollover to avoid assertion failures when a server that was created with multiple undo tablespaces is being started with innodb_undo_tablespaces=0. --- storage/innobase/trx/trx0trx.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index a84ae220839..88e42b2ebad 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -812,6 +812,7 @@ static void trx_assign_rseg_low(trx_t *trx) unsigned slot = rseg_slot++ % TRX_SYS_N_RSEGS; ut_d(if (trx_rseg_n_slots_debug) slot = 0); ut_d(const auto start_scan_slot = slot); + ut_d(bool look_for_rollover = false); trx_rseg_t* rseg; bool allocated; @@ -819,12 +820,10 @@ static void trx_assign_rseg_low(trx_t *trx) do { for (;;) { rseg = &trx_sys.rseg_array[slot]; - - do { - ut_d(if (trx_rseg_n_slots_debug) continue); - slot = (slot + 1) % TRX_SYS_N_RSEGS; - ut_ad(start_scan_slot != slot); - } while (0); + ut_ad(!look_for_rollover || start_scan_slot != slot); + ut_d(look_for_rollover = true); + ut_d(if (!trx_rseg_n_slots_debug)) + slot = (slot + 1) % TRX_SYS_N_RSEGS; if (!rseg->space) { continue; From 854e8b189e422e2d2e61e66380a18b9f8e33646d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 19 Apr 2023 15:53:26 +0300 Subject: [PATCH 143/260] MDEV-28976 fixup: A better fix do_shutdown_server(): After sending SIGKILL, invoke wait_until_dead(). Thanks to Sergei Golubchik for pointing out that the previous fix does not actually work. --- client/mysqltest.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 9e9b122c5fe..e745f8a3d2f 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -5191,9 +5191,10 @@ void do_shutdown_server(struct st_command *command) if (timeout) (void) my_kill(pid, SIGABRT); /* Give server a few seconds to die in all cases */ - if (wait_until_dead(pid, timeout < 5 ? 5 : timeout)) + if (!timeout || wait_until_dead(pid, timeout < 5 ? 5 : timeout)) { (void) my_kill(pid, SIGKILL); + wait_until_dead(pid, 5); } } DBUG_VOID_RETURN; From 0cda0e4e150864c0bd0062d45d554508bc77fc90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 19 Apr 2023 18:56:58 +0300 Subject: [PATCH 144/260] MDEV-31080 fil_validate() failures during deferred tablespace recovery fil_space_t::create(), fil_space_t::add(): Expect the caller to acquire and release fil_system.mutex. In this way, creating a tablespace and adding the first (usually only) data file will be atomic. recv_sys_t::recover_deferred(): Correctly protect some changes by holding fil_system.mutex. Tested by: Matthias Leich --- extra/mariabackup/xtrabackup.cc | 17 +++++++++------- storage/innobase/fil/fil0fil.cc | 29 ++++++++++++++++++---------- storage/innobase/fsp/fsp0space.cc | 24 ++++++++++++----------- storage/innobase/fsp/fsp0sysspace.cc | 10 ++++++---- storage/innobase/log/log0recv.cc | 18 +++++++++++------ storage/innobase/srv/srv0start.cc | 6 ++---- 6 files changed, 62 insertions(+), 42 deletions(-) diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index 9de1ef853b9..0a0ba9cd98e 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -3454,20 +3454,20 @@ static void xb_load_single_table_tablespace(const char *dirname, bool is_empty_file = file->exists() && file->is_empty_file(); if (err == DB_SUCCESS && file->space_id() != SRV_TMP_SPACE_ID) { + mysql_mutex_lock(&fil_system.mutex); space = fil_space_t::create( file->space_id(), file->flags(), FIL_TYPE_TABLESPACE, nullptr/* TODO: crypt_data */, FIL_ENCRYPTION_DEFAULT, file->handle() != OS_FILE_CLOSED); - - ut_a(space != NULL); + ut_ad(space); fil_node_t* node= space->add( file->filepath(), skip_node_page0 ? file->detach() : pfs_os_file_t(), 0, false, false); node->deferred= defer; - mysql_mutex_lock(&fil_system.mutex); - space->read_page0(); + if (!space->read_page0()) + err = DB_CANNOT_OPEN_FILE; mysql_mutex_unlock(&fil_system.mutex); if (srv_operation == SRV_OPERATION_RESTORE_DELTA @@ -5324,9 +5324,12 @@ exit: ut_ad(fil_space_t::zip_size(flags) == info.zip_size); ut_ad(fil_space_t::physical_size(flags) == info.page_size); - if (fil_space_t::create(info.space_id, flags, - FIL_TYPE_TABLESPACE, 0, FIL_ENCRYPTION_DEFAULT, - true)) { + mysql_mutex_lock(&fil_system.mutex); + fil_space_t* space = fil_space_t::create(info.space_id, flags, + FIL_TYPE_TABLESPACE, 0, + FIL_ENCRYPTION_DEFAULT, true); + mysql_mutex_unlock(&fil_system.mutex); + if (space) { *success = xb_space_create_file(real_name, info.space_id, flags, &file); } else { diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 19ebdc8d67e..48d205f428a 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -311,6 +311,8 @@ fil_node_t* fil_space_t::add(const char* name, pfs_os_file_t handle, uint32_t size, bool is_raw, bool atomic_write, uint32_t max_pages) { + mysql_mutex_assert_owner(&fil_system.mutex); + fil_node_t* node; ut_ad(name != NULL); @@ -335,7 +337,6 @@ fil_node_t* fil_space_t::add(const char* name, pfs_os_file_t handle, node->atomic_write = atomic_write; - mysql_mutex_lock(&fil_system.mutex); this->size += size; UT_LIST_ADD_LAST(chain, node); if (node->is_open()) { @@ -346,7 +347,6 @@ fil_node_t* fil_space_t::add(const char* name, pfs_os_file_t handle, release(); } } - mysql_mutex_unlock(&fil_system.mutex); return node; } @@ -946,6 +946,7 @@ fil_space_t *fil_space_t::create(ulint id, ulint flags, { fil_space_t* space; + mysql_mutex_assert_owner(&fil_system.mutex); ut_ad(fil_system.is_initialised()); ut_ad(fil_space_t::is_valid_flags(flags & ~FSP_FLAGS_MEM_MASK, id)); ut_ad(srv_page_size == UNIV_PAGE_SIZE_ORIG || flags != 0); @@ -978,8 +979,6 @@ fil_space_t *fil_space_t::create(ulint id, ulint flags, space->latch.SRW_LOCK_INIT(fil_space_latch_key); - mysql_mutex_lock(&fil_system.mutex); - if (const fil_space_t *old_space = fil_space_get_by_id(id)) { ib::error() << "Trying to add tablespace with id " << id << " to the cache, but tablespace '" @@ -987,7 +986,6 @@ fil_space_t *fil_space_t::create(ulint id, ulint flags, ? old_space->chain.start->name : "") << "' already exists in the cache!"; - mysql_mutex_unlock(&fil_system.mutex); space->~fil_space_t(); ut_free(space); return(NULL); @@ -1034,12 +1032,12 @@ fil_space_t *fil_space_t::create(ulint id, ulint flags, if (rotate) { fil_system.default_encrypt_tables.push_back(*space); space->is_in_default_encrypt = true; - } - mysql_mutex_unlock(&fil_system.mutex); - - if (rotate && srv_n_fil_crypt_threads_started) { - fil_crypt_threads_signal(); + if (srv_n_fil_crypt_threads_started) { + mysql_mutex_unlock(&fil_system.mutex); + fil_crypt_threads_signal(); + mysql_mutex_lock(&fil_system.mutex); + } } return(space); @@ -1998,16 +1996,20 @@ err_exit: DBUG_EXECUTE_IF("checkpoint_after_file_create", log_make_checkpoint();); + mysql_mutex_lock(&fil_system.mutex); if (fil_space_t* space = fil_space_t::create(space_id, flags, FIL_TYPE_TABLESPACE, crypt_data, mode, true)) { fil_node_t* node = space->add(path, file, size, false, true); + mysql_mutex_unlock(&fil_system.mutex); IF_WIN(node->find_metadata(), node->find_metadata(file, true)); mtr.start(); mtr.set_named_space(space); ut_a(fsp_header_init(space, size, &mtr) == DB_SUCCESS); mtr.commit(); return space; + } else { + mysql_mutex_unlock(&fil_system.mutex); } if (space_name.data()) { @@ -2267,8 +2269,10 @@ skip_validate: first_page) : NULL; + mysql_mutex_lock(&fil_system.mutex); space = fil_space_t::create(id, flags, purpose, crypt_data); if (!space) { + mysql_mutex_unlock(&fil_system.mutex); goto error; } @@ -2278,6 +2282,7 @@ skip_validate: space->add( df_remote.is_open() ? df_remote.filepath() : df_default.filepath(), OS_FILE_CLOSED, 0, false, true); + mysql_mutex_unlock(&fil_system.mutex); if (must_validate && !srv_read_only_mode) { df_remote.close(); @@ -2566,10 +2571,13 @@ tablespace_check: return FIL_LOAD_INVALID; } + mysql_mutex_lock(&fil_system.mutex); + space = fil_space_t::create( space_id, flags, FIL_TYPE_TABLESPACE, crypt_data); if (space == NULL) { + mysql_mutex_unlock(&fil_system.mutex); return(FIL_LOAD_INVALID); } @@ -2581,6 +2589,7 @@ tablespace_check: let fil_node_open() do that task. */ space->add(file.filepath(), OS_FILE_CLOSED, 0, false, false); + mysql_mutex_unlock(&fil_system.mutex); return(FIL_LOAD_OK); } diff --git a/storage/innobase/fsp/fsp0space.cc b/storage/innobase/fsp/fsp0space.cc index b069250ff9f..8c6344946a4 100644 --- a/storage/innobase/fsp/fsp0space.cc +++ b/storage/innobase/fsp/fsp0space.cc @@ -88,25 +88,25 @@ Tablespace::open_or_create(bool is_temp) ut_ad(!m_files.empty()); for (iterator it = begin(); it != end(); ++it) { - if (it->m_exists) { err = it->open_or_create( m_ignore_read_only ? false : srv_read_only_mode); + if (err != DB_SUCCESS) { + return err; + } } else { err = it->open_or_create( m_ignore_read_only ? false : srv_read_only_mode); + if (err != DB_SUCCESS) { + return err; + } + /* Set the correct open flags now that we have successfully created the file. */ - if (err == DB_SUCCESS) { - file_found(*it); - } - } - - if (err != DB_SUCCESS) { - break; + file_found(*it); } /* We can close the handle now and open the tablespace @@ -130,20 +130,22 @@ Tablespace::open_or_create(bool is_temp) fsp_flags = FSP_FLAGS_PAGE_SSIZE(); } + mysql_mutex_lock(&fil_system.mutex); space = fil_space_t::create( m_space_id, fsp_flags, is_temp ? FIL_TYPE_TEMPORARY : FIL_TYPE_TABLESPACE, NULL); if (!space) { + mysql_mutex_unlock(&fil_system.mutex); return DB_ERROR; } + } else { + mysql_mutex_lock(&fil_system.mutex); } - - ut_a(fil_validate()); - space->add(it->m_filepath, OS_FILE_CLOSED, it->m_size, false, true); + mysql_mutex_unlock(&fil_system.mutex); } return(err); diff --git a/storage/innobase/fsp/fsp0sysspace.cc b/storage/innobase/fsp/fsp0sysspace.cc index 497e4100557..577db8eb9f2 100644 --- a/storage/innobase/fsp/fsp0sysspace.cc +++ b/storage/innobase/fsp/fsp0sysspace.cc @@ -921,6 +921,7 @@ SysTablespace::open_or_create( /* Close the curent handles, add space and file info to the fil_system cache and the Data Dictionary, and re-open them in file_system cache so that they stay open until shutdown. */ + mysql_mutex_lock(&fil_system.mutex); ulint node_counter = 0; for (files_t::iterator it = begin; it != end; ++it) { it->close(); @@ -934,7 +935,8 @@ SysTablespace::open_or_create( FIL_TYPE_TEMPORARY, NULL); ut_ad(space == fil_system.temp_space); if (!space) { - return DB_ERROR; + err = DB_ERROR; + break; } ut_ad(!space->is_compressed()); ut_ad(space->full_crc32()); @@ -945,12 +947,11 @@ SysTablespace::open_or_create( FIL_TYPE_TABLESPACE, NULL); ut_ad(space == fil_system.sys_space); if (!space) { - return DB_ERROR; + err = DB_ERROR; + break; } } - ut_a(fil_validate()); - uint32_t max_size = (++node_counter == m_files.size() ? (m_last_file_size_max == 0 ? UINT32_MAX @@ -961,6 +962,7 @@ SysTablespace::open_or_create( it->m_type != SRV_NOT_RAW, true, max_size); } + mysql_mutex_unlock(&fil_system.mutex); return(err); } diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 3b6e3008a95..f87ff15c393 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -785,9 +785,10 @@ retry: if (!os_file_status(name->c_str(), &exists, &ftype) || !exists) goto processed; } - create(it, *name, static_cast - (1U << FSP_FLAGS_FCRC32_POS_MARKER | - FSP_FLAGS_FCRC32_PAGE_SSIZE()), nullptr, 0); + if (create(it, *name, static_cast + (1U << FSP_FLAGS_FCRC32_POS_MARKER | + FSP_FLAGS_FCRC32_PAGE_SSIZE()), nullptr, 0)) + mysql_mutex_unlock(&fil_system.mutex); } } else @@ -816,7 +817,7 @@ processed: @param flags FSP_SPACE_FLAGS @param crypt_data encryption metadata @param size tablespace size in pages - @return tablespace + @return tablespace; the caller must release fil_system.mutex @retval nullptr if crypt_data is invalid */ static fil_space_t *create(const recv_spaces_t::const_iterator &it, const std::string &name, uint32_t flags, @@ -828,6 +829,7 @@ processed: ut_free(crypt_data); return nullptr; } + mysql_mutex_lock(&fil_system.mutex); fil_space_t *space= fil_space_t::create(it->first, flags, FIL_TYPE_TABLESPACE, crypt_data); ut_ad(space); @@ -900,12 +902,13 @@ processed: space->free_limit= fsp_header_get_field(page, FSP_FREE_LIMIT); space->free_len= flst_get_len(FSP_HEADER_OFFSET + FSP_FREE + page); fil_node_t *node= UT_LIST_GET_FIRST(space->chain); + mysql_mutex_unlock(&fil_system.mutex); if (!space->acquire()) - { + { free_space: fil_space_free(it->first, false); goto next_item; - } + } if (os_file_write(IORequestWrite, node->name, node->handle, page, 0, fil_space_t::physical_size(flags)) != DB_SUCCESS) @@ -975,6 +978,7 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p, space->free_len= flst_get_len(FSP_HEADER_OFFSET + FSP_FREE + page); fil_node_t *node= UT_LIST_GET_FIRST(space->chain); node->deferred= true; + mysql_mutex_unlock(&fil_system.mutex); if (!space->acquire()) goto release_and_fail; fil_names_dirty(space); @@ -998,8 +1002,10 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p, uint32_t(file_size / fil_space_t::physical_size(flags)); if (n_pages > size) { + mysql_mutex_lock(&fil_system.mutex); space->size= node->size= n_pages; space->set_committed_size(); + mysql_mutex_unlock(&fil_system.mutex); goto size_set; } } diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index a1368c5146c..707804f2206 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -559,14 +559,12 @@ err_exit: fil_set_max_space_id_if_bigger(space_id); + mysql_mutex_lock(&fil_system.mutex); fil_space_t *space= fil_space_t::create(space_id, fsp_flags, FIL_TYPE_TABLESPACE, nullptr, FIL_ENCRYPTION_DEFAULT, true); - ut_a(fil_validate()); - ut_a(space); - + ut_ad(space); fil_node_t *file= space->add(name, fh, 0, false, true); - mysql_mutex_lock(&fil_system.mutex); if (create) { From 27ff972be22880a4046652bc94c2f97fffb456c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 19 Apr 2023 18:57:18 +0300 Subject: [PATCH 145/260] MDEV-26827 fixup: Do not hog buf_pool.mutex buf_flush_LRU_list_batch(): When evicting clean pages, release and reacquire the buf_pool.mutex after every 32 pages. Also, eliminate some conditional branches. --- storage/innobase/buf/buf0flu.cc | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 5a9e3cbb34e..3ef70741da1 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -1255,6 +1255,11 @@ static void buf_flush_LRU_list_batch(ulint max, bool evict, ++n->evicted; /* fall through */ case 1: + if (UNIV_LIKELY(scanned & 31)) + continue; + mysql_mutex_unlock(&buf_pool.mutex); + reacquire_mutex: + mysql_mutex_lock(&buf_pool.mutex); continue; } @@ -1290,32 +1295,37 @@ static void buf_flush_LRU_list_batch(ulint max, bool evict, auto p= buf_flush_space(space_id); space= p.first; last_space_id= space_id; + if (!space) + { + mysql_mutex_lock(&buf_pool.mutex); + goto no_space; + } mysql_mutex_lock(&buf_pool.mutex); - if (p.second) - buf_pool.stat.n_pages_written+= p.second; + buf_pool.stat.n_pages_written+= p.second; } else + { ut_ad(!space); + goto no_space; + } } else if (space->is_stopping()) { space->release(); space= nullptr; - } - - if (!space) - { + no_space: mysql_mutex_lock(&buf_pool.flush_list_mutex); buf_flush_discard_page(bpage); + continue; } - else if (neighbors && space->is_rotational()) + + if (neighbors && space->is_rotational()) { mysql_mutex_unlock(&buf_pool.mutex); n->flushed+= buf_flush_try_neighbors(space, page_id, bpage, neighbors == 1, do_evict, n->flushed, max); -reacquire_mutex: - mysql_mutex_lock(&buf_pool.mutex); + goto reacquire_mutex; } else if (n->flushed >= max && !recv_recovery_is_on()) { From f7791cc7cbedfb29b7cdd68df000108988f77fd3 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 20 Apr 2023 10:10:23 +1000 Subject: [PATCH 146/260] Revert "MDEV-30186 Use of uninitialized value in substitution" This reverts commit 0e737f78980fcfe83b05c27215eb3f5ede1ea473. As noted by Andrew, this introduces race conditions in the setting and using of the global $test_name_for_report. --- mysql-test/mariadb-test-run.pl | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/mysql-test/mariadb-test-run.pl b/mysql-test/mariadb-test-run.pl index 670f63a990f..46a51d2fa58 100755 --- a/mysql-test/mariadb-test-run.pl +++ b/mysql-test/mariadb-test-run.pl @@ -145,7 +145,6 @@ my $opt_start_exit; my $start_only; my $file_wsrep_provider; my $num_saved_cores= 0; # Number of core files saved in vardir/log/ so far. -my $test_name_for_report; our @global_suppressions; @@ -516,13 +515,13 @@ sub main { } if ( not @$completed ) { - if ($test_name_for_report) - { - my $tinfo = My::Test->new(name => $test_name_for_report); - $tinfo->{result}= 'MTR_RES_FAILED'; - $tinfo->{comment}=' '; - mtr_report_test($tinfo); - } + my $test_name= mtr_grab_file($path_testlog); + $test_name =~ s/^CURRENT_TEST:\s//; + chomp($test_name); + my $tinfo = My::Test->new(name => $test_name); + $tinfo->{result}= 'MTR_RES_FAILED'; + $tinfo->{comment}=' '; + mtr_report_test($tinfo); mtr_error("Test suite aborted"); } @@ -3741,8 +3740,8 @@ sub resfile_report_test ($) { sub run_testcase ($$) { my ($tinfo, $server_socket)= @_; my $print_freq=20; - $test_name_for_report= $tinfo->{name}; - mtr_verbose("Running test:", $test_name_for_report); + + mtr_verbose("Running test:", $tinfo->{name}); $ENV{'MTR_TEST_NAME'} = $tinfo->{name}; resfile_report_test($tinfo) if $opt_resfile; @@ -5131,10 +5130,12 @@ sub mysqld_start ($$) { if (!$rc) { # Report failure about the last test case before exit - my $tinfo = My::Test->new(name => $test_name_for_report); + my $test_name= mtr_grab_file($path_current_testlog); + $test_name =~ s/^CURRENT_TEST:\s//; + my $tinfo = My::Test->new(name => $test_name); $tinfo->{result}= 'MTR_RES_FAILED'; $tinfo->{failures}= 1; - $tinfo->{logfile}=get_log_from_proc($mysqld->{'proc'}, $test_name_for_report); + $tinfo->{logfile}=get_log_from_proc($mysqld->{'proc'}, $tinfo->{name}); report_option('verbose', 1); mtr_report_test($tinfo); } From c21bc17a51f6eef6158ef80e7deeb5a280598c1d Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 20 Apr 2023 10:13:12 +1000 Subject: [PATCH 147/260] MDEV-30186: mtr: Use of uninitialized value $test_name in substitution There is an assumption that when there are are no completed tests, that means they are still running and then an attempt is made to identify these tests as stalled. The other possibility is however there are no tests that where run. Test this early and then exit quickly and no later misunderstandings need to be made. --- mysql-test/mariadb-test-run.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mysql-test/mariadb-test-run.pl b/mysql-test/mariadb-test-run.pl index 46a51d2fa58..4fc4d9f050e 100755 --- a/mysql-test/mariadb-test-run.pl +++ b/mysql-test/mariadb-test-run.pl @@ -401,6 +401,11 @@ sub main { mtr_report("Collecting tests..."); my $tests= collect_test_cases($opt_reorder, $opt_suites, \@opt_cases, \@opt_skip_test_list); + if (@$tests == 0) { + mtr_report("No tests to run..."); + exit 0; + } + mark_time_used('collect'); mysql_install_db(default_mysqld(), "$opt_vardir/install.db") unless using_extern(); From 7e31a8e7fa97a87fc164381588d172bf0e76abb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 20 Apr 2023 14:08:48 +0300 Subject: [PATCH 148/260] MDEV-26827 fixup: Fix os_aio_wait_until_no_pending_writes() io_callback(): Process the request before releasing the write slot. Before commit a091d6ac4e7d2d7873749e685943b3032ccfda57 when we had a duplicated counter for writes, either ordering was fine. Now, correctness depends on os_aio_wait_until_no_pending_writes(). --- storage/innobase/os/os0file.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index d366c784b96..e816f6ef7b1 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -3457,9 +3457,8 @@ static void io_callback(tpool::aiocb *cb) else { ut_ad(write_slots->contains(cb)); - const IORequest req{request}; + fil_aio_callback(request); write_slots->release(cb); - fil_aio_callback(req); } } From fc6e8a3d3264078bed28632a289130b1dc24daea Mon Sep 17 00:00:00 2001 From: Mikhail Chalov Date: Tue, 31 Jan 2023 14:14:55 -0800 Subject: [PATCH 149/260] Minimize unsafe C functions usage - replace strcat() and strcpy() Similar to 567b6812 continue to replace use of strcat() and strcpy() with safer options strncat() and strncpy(). All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services --- storage/connect/reldef.cpp | 26 ++++++++-------- storage/connect/tabbson.cpp | 47 ++++++++++++++-------------- storage/connect/tabdos.cpp | 61 ++++++++++++++++++++----------------- storage/connect/tabext.cpp | 55 ++++++++++++++++++++------------- storage/connect/tabfmt.cpp | 38 +++++++++++++---------- storage/connect/tabjdbc.cpp | 45 ++++++++++++++------------- storage/connect/tabjson.cpp | 54 ++++++++++++++++---------------- 7 files changed, 178 insertions(+), 148 deletions(-) diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp index 144d31735d6..786a53db5a2 100644 --- a/storage/connect/reldef.cpp +++ b/storage/connect/reldef.cpp @@ -91,11 +91,11 @@ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char* tab, char* db, bool info) /* directories are used (to make this even remotely secure). */ /*********************************************************************/ if (check_valid_path(module, strlen(module))) { - strcpy(g->Message, "Module cannot contain a path"); + safe_strcpy(g->Message, sizeof(g->Message), "Module cannot contain a path"); return NULL; } else if (strlen(subtype)+1+3 >= sizeof(getname)) { - strcpy(g->Message, "Subtype string too long"); + safe_strcpy(g->Message, sizeof(g->Message), "Subtype string too long"); return NULL; } else @@ -118,7 +118,8 @@ PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char* tab, char* db, bool info) FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, rc, 0, (LPTSTR)buf, sizeof(buf), NULL); - strcat(strcat(g->Message, ": "), buf); + safe_strcat(g->Message, sizeof(g->Message), ": "); + safe_strcat(g->Message, sizeof(g->Message), buf); return NULL; } // endif hDll @@ -281,7 +282,7 @@ char *RELDEF::GetStringCatInfo(PGLOBAL g, PCSZ what, PCSZ sdef) if (IsFileType(GetTypeID(ftype))) { name= Hc->GetPartName(); sval= (char*)PlugSubAlloc(g, NULL, strlen(name) + 12); - strcat(strcpy(sval, name), "."); + snprintf(sval, strlen(name) + 12, "%s.", name); n= strlen(sval); // Fold ftype to lower case @@ -622,12 +623,11 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g) /* directories are used (to make this even remotely secure). */ /*********************************************************************/ if (check_valid_path(Module, strlen(Module))) { - strcpy(g->Message, "Module cannot contain a path"); + safe_strcpy(g->Message, sizeof(g->Message), "Module cannot contain a path"); return NULL; } else // PlugSetPath(soname, Module, GetPluginDir()); // Crashes on Fedora - strncat(strcpy(soname, GetPluginDir()), Module, - sizeof(soname) - strlen(soname) - 1); + snprintf(soname, sizeof(soname), "%s%s", GetPluginDir(), Module); #if defined(_WIN32) // Is the DLL already loaded? @@ -641,7 +641,8 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g) FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, rc, 0, (LPTSTR)buf, sizeof(buf), NULL); - strcat(strcat(g->Message, ": "), buf); + safe_strcat(g->Message, sizeof(g->Message), ": "); + safe_strcat(g->Message, sizeof(g->Message), buf); return NULL; } // endif hDll @@ -661,7 +662,8 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g) FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, rc, 0, (LPTSTR)buf, sizeof(buf), NULL); - strcat(strcat(g->Message, ": "), buf); + safe_strcat(g->Message, sizeof(g->Message), ": "); + safe_strcat(g->Message, sizeof(g->Message), buf); FreeLibrary((HMODULE)Hdll); return NULL; } // endif getdef @@ -810,7 +812,7 @@ PTDB OEMDEF::GetTable(PGLOBAL g, MODE mode) else txfp = new(g) ZLBFAM(defp); #else // !GZ_SUPPORT - strcpy(g->Message, "Compress not supported"); + safe_strcpy(g->Message, sizeof(g->Message), "Compress not supported"); return NULL; #endif // !GZ_SUPPORT } else if (rfm == RECFM_VAR) { @@ -833,7 +835,7 @@ PTDB OEMDEF::GetTable(PGLOBAL g, MODE mode) else txfp = new(g) VCTFAM((PVCTDEF)defp); #else // !VCT_SUPPORT - strcpy(g->Message, "VCT no more supported"); + safe_strcpy(g->Message, sizeof(g->Message), "VCT no more supported"); return NULL; #endif // !VCT_SUPPORT } // endif's @@ -924,7 +926,7 @@ int COLDEF::Define(PGLOBAL g, void *, PCOLINFO cfp, int poff) return -1; } // endswitch - strcpy(F.Type, GetFormatType(Buf_Type)); + safe_strcpy(F.Type, sizeof(F.Type), GetFormatType(Buf_Type)); F.Length = cfp->Length; F.Prec = cfp->Scale; Offset = (cfp->Offset < 0) ? poff : cfp->Offset; diff --git a/storage/connect/tabbson.cpp b/storage/connect/tabbson.cpp index 22d8648d7c0..2ea74da94b0 100644 --- a/storage/connect/tabbson.cpp +++ b/storage/connect/tabbson.cpp @@ -39,6 +39,7 @@ #include "checklvl.h" #include "resource.h" #include "mycat.h" // for FNC_COL +#include "m_string.h" /***********************************************************************/ /* This should be an option. */ @@ -80,7 +81,7 @@ PQRYRES BSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info) } // endif info if (GetIntegerTableOption(g, topt, "Multiple", 0)) { - strcpy(g->Message, "Cannot find column definition for multiple table"); + safe_strcpy(g->Message, sizeof(g->Message), "Cannot find column definition for multiple table"); return NULL; } // endif Multiple @@ -206,7 +207,7 @@ int BSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt) tdp->Uri = (dsn && *dsn ? dsn : NULL); if (!tdp->Fn && !tdp->Uri) { - strcpy(g->Message, MSG(MISSING_FNAME)); + safe_strcpy(g->Message, sizeof(g->Message), MSG(MISSING_FNAME)); return 0; } else topt->subtype = NULL; @@ -318,7 +319,7 @@ int BSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt) switch (tjnp->ReadDB(g)) { case RC_EF: - strcpy(g->Message, "Void json table"); + safe_strcpy(g->Message, sizeof(g->Message), "Void json table"); case RC_FX: goto err; default: @@ -328,7 +329,7 @@ int BSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt) } // endif pretty if (!(row = (jsp) ? bp->GetObject(jsp) : NULL)) { - strcpy(g->Message, "Can only retrieve columns from object rows"); + safe_strcpy(g->Message, sizeof(g->Message), "Can only retrieve columns from object rows"); goto err; } // endif row @@ -405,7 +406,7 @@ bool BSONDISC::Find(PGLOBAL g, PBVAL jvp, PCSZ key, int j) if (jvp && !bp->IsJson(jvp)) { if (JsonAllPath() && !fmt[bf]) - strcat(fmt, colname); + safe_strcat(fmt, sizeof(fmt), colname); jcol.Type = (JTYP)jvp->Type; @@ -439,7 +440,7 @@ bool BSONDISC::Find(PGLOBAL g, PBVAL jvp, PCSZ key, int j) jcol.Cbn = true; } else if (j < lvl && !Stringified(strfy, colname)) { if (!fmt[bf]) - strcat(fmt, colname); + safe_strcat(fmt, sizeof(fmt), colname); p = fmt + strlen(fmt); jsp = jvp; @@ -510,11 +511,11 @@ bool BSONDISC::Find(PGLOBAL g, PBVAL jvp, PCSZ key, int j) } else if (lvl >= 0) { if (Stringified(strfy, colname)) { if (!fmt[bf]) - strcat(fmt, colname); + safe_strcat(fmt, sizeof(fmt), colname); - strcat(fmt, ".*"); + safe_strcat(fmt, sizeof(fmt), ".*"); } else if (JsonAllPath() && !fmt[bf]) - strcat(fmt, colname); + safe_strcat(fmt, sizeof(fmt), colname); jcol.Type = TYPE_STRG; jcol.Len = sz; @@ -961,7 +962,7 @@ PVAL BCUTIL::ExpandArray(PGLOBAL g, PBVAL arp, int n) } // endif ars if (!(bvp = GetArrayValue(arp, (nodes[n].Rx = nodes[n].Nx)))) { - strcpy(g->Message, "Logical error expanding array"); + safe_strcpy(g->Message, sizeof(g->Message), "Logical error expanding array"); throw 666; } // endif jvp @@ -1146,7 +1147,7 @@ PBVAL BCUTIL::GetRow(PGLOBAL g) } else if (row->Type == TYPE_JAR) { AddArrayValue(row, (nwr = NewVal(type))); } else { - strcpy(g->Message, "Wrong type when writing new row"); + safe_strcpy(g->Message, sizeof(g->Message), "Wrong type when writing new row"); nwr = NULL; } // endif's @@ -1255,7 +1256,7 @@ PTDB BSONDEF::GetTable(PGLOBAL g, MODE m) // Allocate the parse work memory G = PlugInit(NULL, (size_t)Lrecl * (Pretty < 0 ? 3 : 5)); } else { - strcpy(g->Message, "LRECL is not defined"); + safe_strcpy(g->Message, sizeof(g->Message), "LRECL is not defined"); return NULL; } // endif Lrecl @@ -1295,7 +1296,7 @@ PTDB BSONDEF::GetTable(PGLOBAL g, MODE m) } else if (m == MODE_INSERT) { txfp = new(g) ZIPFAM(this); } else { - strcpy(g->Message, "UPDATE/DELETE not supported for ZIP"); + safe_strcpy(g->Message, sizeof(g->Message), "UPDATE/DELETE not supported for ZIP"); return NULL; } // endif's m #else // !ZIP_SUPPORT @@ -1325,10 +1326,10 @@ PTDB BSONDEF::GetTable(PGLOBAL g, MODE m) if (m == MODE_READ || m == MODE_ANY || m == MODE_ALTER) { txfp = new(g) UNZFAM(this); } else if (m == MODE_INSERT) { - strcpy(g->Message, "INSERT supported only for zipped JSON when pretty=0"); + safe_strcpy(g->Message, sizeof(g->Message), "INSERT supported only for zipped JSON when pretty=0"); return NULL; } else { - strcpy(g->Message, "UPDATE/DELETE not supported for ZIP"); + safe_strcpy(g->Message, sizeof(g->Message), "UPDATE/DELETE not supported for ZIP"); return NULL; } // endif's m #else // !ZIP_SUPPORT @@ -1661,7 +1662,7 @@ bool TDBBSN::PrepareWriting(PGLOBAL g) strcat(s, ","); if ((signed)strlen(s) > Lrecl) { - strncpy(To_Line, s, Lrecl); + safe_strcpy(To_Line, Lrecl, s); snprintf(g->Message, sizeof(g->Message), "Line truncated (lrecl=%d)", Lrecl); return PushWarning(g, this); } else @@ -1764,7 +1765,7 @@ bool BSONCOL::CheckExpand(PGLOBAL g, int i, PSZ nm, bool b) Xpd = true; // Expandable object Nodes[i].Op = OP_EXP; } else if (b) { - strcpy(g->Message, "Cannot expand more than one branch"); + safe_strcpy(g->Message, sizeof(g->Message), "Cannot expand more than one branch"); return true; } // endif Xcol @@ -1975,7 +1976,7 @@ bool BSONCOL::ParseJpath(PGLOBAL g) if (SetArrayOptions(g, p, i, Nodes[i - 1].Key)) return true; else if (Xpd && Tbp->Mode == MODE_DELETE) { - strcpy(g->Message, "Cannot delete expanded columns"); + safe_strcpy(g->Message, sizeof(g->Message), "Cannot delete expanded columns"); return true; } // endif Xpd @@ -2096,7 +2097,7 @@ void BSONCOL::ReadColumn(PGLOBAL g) void BSONCOL::WriteColumn(PGLOBAL g) { if (Xpd && Tbp->Pretty < 2) { - strcpy(g->Message, "Cannot write expanded column when Pretty is not 2"); + safe_strcpy(g->Message, sizeof(g->Message), "Cannot write expanded column when Pretty is not 2"); throw 666; } // endif Xpd @@ -2126,7 +2127,7 @@ void BSONCOL::WriteColumn(PGLOBAL g) char *s = Value->GetCharValue(); if (!(jsp = Cp->ParseJson(g, s, strlen(s)))) { - strcpy(g->Message, s); + safe_strcpy(g->Message, sizeof(g->Message), s); throw 666; } // endif jsp @@ -2312,7 +2313,7 @@ int TDBBSON::MakeDocument(PGLOBAL g) if (!a && *p && *p != '[' && !IsNum(p)) { // obj is a key if (jsp->Type != TYPE_JOB) { - strcpy(g->Message, "Table path does not match the json file"); + safe_strcpy(g->Message, sizeof(g->Message), "Table path does not match the json file"); return RC_FX; } // endif Type @@ -2338,7 +2339,7 @@ int TDBBSON::MakeDocument(PGLOBAL g) } // endif p if (jsp->Type != TYPE_JAR) { - strcpy(g->Message, "Table path does not match the json file"); + safe_strcpy(g->Message, sizeof(g->Message), "Table path does not match the json file"); return RC_FX; } // endif Type @@ -2432,7 +2433,7 @@ void TDBBSON::ResetSize(void) int TDBBSON::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool) { if (pxdf) { - strcpy(g->Message, "JSON not indexable when pretty = 2"); + safe_strcpy(g->Message, sizeof(g->Message), "JSON not indexable when pretty = 2"); return RC_FX; } else return RC_OK; diff --git a/storage/connect/tabdos.cpp b/storage/connect/tabdos.cpp index 797b988b309..4b50af0954e 100644 --- a/storage/connect/tabdos.cpp +++ b/storage/connect/tabdos.cpp @@ -62,6 +62,7 @@ #include "tabmul.h" #include "array.h" #include "blkfil.h" +#include "m_string.h" /***********************************************************************/ /* DB static variables. */ @@ -258,7 +259,7 @@ bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf) sep = GetBoolCatInfo("SepIndex", false); if (!sep && pxdf) { - strcpy(g->Message, MSG(NO_RECOV_SPACE)); + safe_strcpy(g->Message, sizeof(g->Message), MSG(NO_RECOV_SPACE)); return true; } // endif sep @@ -293,7 +294,8 @@ bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf) for (; pxdf; pxdf = pxdf->GetNext()) { _splitpath(Ofn, drive, direc, fname, NULL); - strcat(strcat(fname, "_"), pxdf->GetName()); + safe_strcat(fname, sizeof(fname), "_"); + safe_strcat(fname, sizeof(fname), pxdf->GetName()); _makepath(filename, drive, direc, fname, ftype); PlugSetPath(filename, filename, GetPath()); #if defined(_WIN32) @@ -312,7 +314,7 @@ bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf) } else { // !sep // Drop all indexes, delete the common file PlugSetPath(filename, Ofn, GetPath()); - strcat(PlugRemoveType(filename, filename), ftype); + safe_strcat(PlugRemoveType(filename, filename), sizeof(filename), ftype); #if defined(_WIN32) if (!DeleteFile(filename)) rc = (GetLastError() != ERROR_FILE_NOT_FOUND); @@ -365,7 +367,7 @@ PTDB DOSDEF::GetTable(PGLOBAL g, MODE mode) if (mode == MODE_READ || mode == MODE_ANY || mode == MODE_ALTER) { txfp = new(g) UZDFAM(this); } else { - strcpy(g->Message, "Zipped DBF tables are read only"); + safe_strcpy(g->Message, sizeof(g->Message), "Zipped DBF tables are read only"); return NULL; } // endif's mode @@ -386,7 +388,7 @@ PTDB DOSDEF::GetTable(PGLOBAL g, MODE mode) } else if (mode == MODE_INSERT) { txfp = new(g) ZIPFAM(this); } else { - strcpy(g->Message, "UPDATE/DELETE not supported for ZIP"); + safe_strcpy(g->Message, sizeof(g->Message), "UPDATE/DELETE not supported for ZIP"); return NULL; } // endif's mode @@ -397,7 +399,7 @@ PTDB DOSDEF::GetTable(PGLOBAL g, MODE mode) } else if (mode == MODE_INSERT) { txfp = new(g) ZPXFAM(this); } else { - strcpy(g->Message, "UPDATE/DELETE not supported for ZIP"); + safe_strcpy(g->Message, sizeof(g->Message), "UPDATE/DELETE not supported for ZIP"); return NULL; } // endif's mode @@ -654,7 +656,7 @@ int TDBDOS::MakeBlockValues(PGLOBAL g) if ((nrec = defp->GetElemt()) < 2) { if (!To_Def->Partitioned()) { // This may be wrong to do in some cases - strcpy(g->Message, MSG(TABLE_NOT_OPT)); + safe_strcpy(g->Message, sizeof(g->Message), MSG(TABLE_NOT_OPT)); return RC_INFO; // Not to be optimized } else return RC_OK; @@ -674,7 +676,7 @@ int TDBDOS::MakeBlockValues(PGLOBAL g) if ((block = (int)((MaxSize + (int)nrec - 1) / (int)nrec)) < 2) { // This may be wrong to do in some cases defp->RemoveOptValues(g); - strcpy(g->Message, MSG(TABLE_NOT_OPT)); + safe_strcpy(g->Message, sizeof(g->Message), MSG(TABLE_NOT_OPT)); return RC_INFO; // Not to be optimized } // endif block @@ -757,7 +759,7 @@ int TDBDOS::MakeBlockValues(PGLOBAL g) // No optimised columns. Still useful for blocked variable tables. if (!colp && defp->Recfm != RECFM_VAR) { - strcpy(g->Message, "No optimised columns"); + safe_strcpy(g->Message, sizeof(g->Message), "No optimised columns"); return RC_INFO; } // endif colp @@ -787,7 +789,8 @@ int TDBDOS::MakeBlockValues(PGLOBAL g) /*********************************************************************/ char *p = (char *)PlugSubAlloc(g, NULL, 24 + strlen(Name)); - dup->Step = strcat(strcpy(p, MSG(OPTIMIZING)), Name); + snprintf(p, 24 + strlen(Name), "%s%s", MSG(OPTIMIZING), Name); + dup->Step = p; dup->ProgMax = GetProgMax(g); dup->ProgCur = 0; #endif // SOCKET_MODE || THREAD @@ -804,7 +807,7 @@ int TDBDOS::MakeBlockValues(PGLOBAL g) } else { if (++curnum >= nrec) { if (++curblk >= block) { - strcpy(g->Message, MSG(BAD_BLK_ESTIM)); + safe_strcpy(g->Message, sizeof(g->Message), MSG(BAD_BLK_ESTIM)); goto err; } else curnum = 0; @@ -832,7 +835,7 @@ int TDBDOS::MakeBlockValues(PGLOBAL g) #if defined(PROG_INFO) if (!dup->Step) { - strcpy(g->Message, MSG(OPT_CANCELLED)); + safe_strcpy(g->Message, sizeof(g->Message), MSG(OPT_CANCELLED)); goto err; } else dup->ProgCur = GetProgCur(); @@ -912,7 +915,8 @@ bool TDBDOS::SaveBlockValues(PGLOBAL g) if (!(opfile = fopen(filename, "wb"))) { snprintf(g->Message, sizeof(g->Message), MSG(OPEN_MODE_ERROR), "wb", (int)errno, filename); - strcat(strcat(g->Message, ": "), strerror(errno)); + safe_strcat(g->Message, sizeof(g->Message), ": "); + safe_strcat(g->Message, sizeof(g->Message), strerror(errno)); if (trace(1)) htrc("%s\n", g->Message); @@ -1227,7 +1231,8 @@ bool TDBDOS::GetDistinctColumnValues(PGLOBAL g, int nrec) /* Initialize progress information */ /*********************************************************************/ p = (char *)PlugSubAlloc(g, NULL, 48 + strlen(Name)); - dup->Step = strcat(strcpy(p, MSG(GET_DIST_VALS)), Name); + snprintf(p, 48 + strlen(Name), "%s%s", MSG(GET_DIST_VALS), Name); + dup->Step = p; dup->ProgMax = GetProgMax(g); dup->ProgCur = 0; @@ -1239,12 +1244,12 @@ bool TDBDOS::GetDistinctColumnValues(PGLOBAL g, int nrec) #if defined(SOCKET_MODE) if (SendProgress(dup)) { - strcpy(g->Message, MSG(OPT_CANCELLED)); + safe_strcpy(g->Message, sizeof(g->Message), MSG(OPT_CANCELLED)); return true; } else #elif defined(THREAD) if (!dup->Step) { - strcpy(g->Message, MSG(OPT_CANCELLED)); + safe_strcpy(g->Message, sizeof(g->Message), MSG(OPT_CANCELLED)); return true; } else #endif // THREAD @@ -1525,7 +1530,7 @@ PBF TDBDOS::CheckBlockFilari(PGLOBAL g, PXOB *arg, int op, bool *cnv) } else if (n == 8 || n == 14) { if (n == 8 && ctype != TYPE_LIST) { // Should never happen - strcpy(g->Message, "Block opt: bad constant"); + safe_strcpy(g->Message, sizeof(g->Message), "Block opt: bad constant"); throw 99; } // endif Conv @@ -1683,7 +1688,7 @@ int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add) // Are we are called from CreateTable or CreateIndex? if (pxdf) { if (!add && dfp->GetIndx()) { - strcpy(g->Message, MSG(INDX_EXIST_YET)); + safe_strcpy(g->Message, sizeof(g->Message), MSG(INDX_EXIST_YET)); return RC_FX; } // endif To_Indx @@ -1795,7 +1800,7 @@ int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add) htrc("Exception %d: %s\n", n, g->Message); rc = RC_FX; } catch (const char *msg) { - strcpy(g->Message, msg); + safe_strcpy(g->Message, sizeof(g->Message), msg); rc = RC_FX; } // end catch @@ -1829,7 +1834,7 @@ bool TDBDOS::InitialyzeIndex(PGLOBAL g, volatile PIXDEF xdp, bool sorted) PKPDEF kdp; if (!xdp && !(xdp = To_Xdp)) { - strcpy(g->Message, "NULL dynamic index"); + safe_strcpy(g->Message, sizeof(g->Message), "NULL dynamic index"); return true; } else dynamic = To_Filter && xdp->IsUnique() && xdp->IsDynamic(); @@ -1918,7 +1923,7 @@ bool TDBDOS::InitialyzeIndex(PGLOBAL g, volatile PIXDEF xdp, bool sorted) htrc("Exception %d: %s\n", n, g->Message); brc = true; } catch (const char *msg) { - strcpy(g->Message, msg); + safe_strcpy(g->Message, sizeof(g->Message), msg); brc = true; } // end catch @@ -2679,38 +2684,38 @@ void DOSCOL::WriteColumn(PGLOBAL g) if (Ldz || Nod || Dcm >= 0) { switch (Buf_Type) { case TYPE_SHORT: - strcpy(fmt, (Ldz) ? "%0*hd" : "%*.hd"); + safe_strcpy(fmt, sizeof(fmt), (Ldz) ? "%0*hd" : "%*.hd"); i = 0; if (Nod) for (; i < Dcm; i++) - strcat(fmt, "0"); + safe_strcat(fmt, sizeof(fmt), "0"); len = sprintf(Buf, fmt, field - i, Value->GetShortValue()); break; case TYPE_INT: - strcpy(fmt, (Ldz) ? "%0*d" : "%*.d"); + safe_strcpy(fmt, sizeof(fmt), (Ldz) ? "%0*d" : "%*.d"); i = 0; if (Nod) for (; i < Dcm; i++) - strcat(fmt, "0"); + safe_strcat(fmt,sizeof(fmt), "0"); len = sprintf(Buf, fmt, field - i, Value->GetIntValue()); break; case TYPE_TINY: - strcpy(fmt, (Ldz) ? "%0*d" : "%*.d"); + safe_strcpy(fmt, sizeof(fmt), (Ldz) ? "%0*d" : "%*.d"); i = 0; if (Nod) for (; i < Dcm; i++) - strcat(fmt, "0"); + safe_strcat(fmt, sizeof(fmt), "0"); len = sprintf(Buf, fmt, field - i, Value->GetTinyValue()); break; case TYPE_DOUBLE: case TYPE_DECIM: - strcpy(fmt, (Ldz) ? "%0*.*lf" : "%*.*lf"); + safe_strcpy(fmt, sizeof(fmt), (Ldz) ? "%0*.*lf" : "%*.*lf"); len = field + ((Nod && Dcm) ? 1 : 0); snprintf(Buf, len + 1, fmt, len, Dcm, Value->GetFloatValue()); len = strlen(Buf); diff --git a/storage/connect/tabext.cpp b/storage/connect/tabext.cpp index 01c55cca1cd..9d8a4aca077 100644 --- a/storage/connect/tabext.cpp +++ b/storage/connect/tabext.cpp @@ -65,7 +65,7 @@ int CONDFIL::Init(PGLOBAL g, PHC hc) while (alt) { if (!(p = strchr(alt, '='))) { - strcpy(g->Message, "Invalid alias list"); + safe_strcpy(g->Message, sizeof(g->Message), "Invalid alias list"); rc = RC_FX; break; } // endif !p @@ -126,7 +126,7 @@ EXTDEF::EXTDEF(void) bool EXTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) { if (g->Createas) { - strcpy(g->Message, + safe_strcpy(g->Message, sizeof(g->Message), "Multiple-table UPDATE/DELETE commands are not supported"); return true; } // endif multi @@ -349,7 +349,7 @@ bool TDBEXT::MakeSrcdef(PGLOBAL g) int n_placeholders = count_placeholders(Srcdef); if (n_placeholders < 0) { - strcpy(g->Message, "MakeSQL: Wrong place holders specification"); + safe_strcpy(g->Message, sizeof(g->Message), "MakeSQL: Wrong place holders specification"); return true; } @@ -372,7 +372,7 @@ bool TDBEXT::MakeSrcdef(PGLOBAL g) Query = new(g)STRING(g, strlen(Srcdef) + strlen(fil1) + strlen(fil2)); Query->SetLength(sprintf(Query->GetStr(), Srcdef, fil2, fil1)); } else { - strcpy(g->Message, "MakeSQL: Wrong place holders specification"); + safe_strcpy(g->Message, sizeof(g->Message), "MakeSQL: Wrong place holders specification"); return true; } // endif's ph @@ -513,7 +513,7 @@ bool TDBEXT::MakeSQL(PGLOBAL g, bool cnt) len += ((Mode == MODE_READX) ? 256 : 1); if (Query->IsTruncated()) { - strcpy(g->Message, "MakeSQL: Out of memory"); + safe_strcpy(g->Message, sizeof(g->Message), "MakeSQL: Out of memory"); return true; } else Query->Resize(len); @@ -574,6 +574,7 @@ bool TDBEXT::MakeCommand(PGLOBAL g) bool qtd = Quoted > 0; char q = qtd ? *Quote : ' '; int i = 0, k = 0; + size_t stmt_sz = 0; // Make a lower case copy of the originale query and change // back ticks to the data source identifier quoting character @@ -585,26 +586,30 @@ bool TDBEXT::MakeCommand(PGLOBAL g) p[7] = 0; // Remove where clause Qrystr[(p - qrystr) + 7] = 0; body = To_CondFil->Body; - stmt = (char*)PlugSubAlloc(g, NULL, strlen(qrystr) - + strlen(body) + 64); + stmt_sz = strlen(qrystr) + strlen(body) + 64; } else - stmt = (char*)PlugSubAlloc(g, NULL, strlen(Qrystr) + 64); + stmt_sz = strlen(Qrystr) + 64; + stmt = (char*)PlugSubAlloc(g, NULL, stmt_sz); // Check whether the table name is equal to a keyword // If so, it must be quoted in the original query - strlwr(strcat(strcat(strcpy(name, " "), Name), " ")); + snprintf(name, sizeof(name), " %s ", Name); + strlwr(name); if (strstr(" update delete low_priority ignore quick from ", name)) { if (Quote) { - strlwr(strcat(strcat(strcpy(name, Quote), Name), Quote)); + snprintf(name, sizeof(name), "%s%s%s", Quote, Name, Quote); + strlwr(name); k += 2; } else { - strcpy(g->Message, "Quoted must be specified"); + safe_strcpy(g->Message, sizeof(g->Message), "Quoted must be specified"); return true; } // endif Quote - } else - strlwr(strcpy(name, Name)); // Not a keyword + } else { + safe_strcpy(name, sizeof(name), Name); // Not a keyword + strlwr(name); + } if ((p = strstr(qrystr, name))) { for (i = 0; i < p - qrystr; i++) @@ -618,21 +623,29 @@ bool TDBEXT::MakeCommand(PGLOBAL g) schmp = Schema; if (qtd && *(p - 1) == ' ') { - if (schmp) - strcat(strcat(stmt, schmp), "."); + if (schmp) { + safe_strcat(stmt, stmt_sz, schmp); + safe_strcat(stmt, stmt_sz, "."); + } - strcat(strcat(strcat(stmt, Quote), TableName), Quote); + safe_strcat(stmt, stmt_sz, Quote); + safe_strcat(stmt, stmt_sz, TableName); + safe_strcat(stmt, stmt_sz, Quote); } else { if (schmp) { if (qtd && *(p - 1) != ' ') { stmt[i - 1] = 0; - strcat(strcat(strcat(stmt, schmp), "."), Quote); - } else - strcat(strcat(stmt, schmp), "."); + safe_strcat(stmt, stmt_sz, schmp); + safe_strcat(stmt, stmt_sz, "."); + safe_strcat(stmt, stmt_sz, Quote); + } else { + safe_strcat(stmt, stmt_sz, schmp); + safe_strcat(stmt, stmt_sz, "."); + } } // endif schmp - strcat(stmt, TableName); + safe_strcat(stmt, stmt_sz, TableName); } // endif's i = (int)strlen(stmt); @@ -644,7 +657,7 @@ bool TDBEXT::MakeCommand(PGLOBAL g) RemoveConst(g, stmt); if (body) - strcat(stmt, body); + safe_strcat(stmt, stmt_sz, body); } else { snprintf(g->Message, sizeof(g->Message), "Cannot use this %s command", diff --git a/storage/connect/tabfmt.cpp b/storage/connect/tabfmt.cpp index f20d9afb959..b93b7d8dc8b 100644 --- a/storage/connect/tabfmt.cpp +++ b/storage/connect/tabfmt.cpp @@ -62,6 +62,7 @@ #define NO_FUNC #include "plgcnx.h" // For DB types #include "resource.h" +#include "m_string.h" /***********************************************************************/ /* This should be an option. */ @@ -137,7 +138,7 @@ PQRYRES CSVColumns(PGLOBAL g, PCSZ dp, PTOS topt, bool info) ? strchr(tdp->Entry, '*') || strchr(tdp->Entry, '?') : GetBooleanTableOption(g, topt, "Mulentries", false); #else // !ZIP_SUPPORT - strcpy(g->Message, "ZIP not supported by this version"); + safe_strcpy(g->Message, sizeof(g->Message), "ZIP not supported by this version"); return NULL; #endif // !ZIP_SUPPORT } // endif // Zipped @@ -145,7 +146,7 @@ PQRYRES CSVColumns(PGLOBAL g, PCSZ dp, PTOS topt, bool info) fn = tdp->Fn = GetStringTableOption(g, topt, "Filename", NULL); if (!tdp->Fn) { - strcpy(g->Message, MSG(MISSING_FNAME)); + safe_strcpy(g->Message, sizeof(g->Message), MSG(MISSING_FNAME)); return NULL; } // endif Fn @@ -472,7 +473,7 @@ bool CSVDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) if (Catfunc == FNC_NO) for (PCOLDEF cdp = To_Cols; cdp; cdp = cdp->GetNext()) if (cdp->GetOffset() < 1 && !cdp->IsSpecial()) { - strcpy(g->Message, MSG(BAD_OFFSET_VAL)); + safe_strcpy(g->Message, sizeof(g->Message), MSG(BAD_OFFSET_VAL)); return true; } // endif Offset @@ -528,11 +529,11 @@ PTDB CSVDEF::GetTable(PGLOBAL g, MODE mode) } else if (mode == MODE_INSERT) { txfp = new(g) ZIPFAM(this); } else { - strcpy(g->Message, "UPDATE/DELETE not supported for ZIP"); + safe_strcpy(g->Message, sizeof(g->Message), "UPDATE/DELETE not supported for ZIP"); return NULL; } // endif's mode #else // !ZIP_SUPPORT - strcpy(g->Message, "ZIP not supported"); + safe_strcpy(g->Message, sizeof(g->Message), "ZIP not supported"); return NULL; #endif // !ZIP_SUPPORT } else if (map) { @@ -546,7 +547,7 @@ PTDB CSVDEF::GetTable(PGLOBAL g, MODE mode) txfp = new(g) ZLBFAM(this); #else // !GZ_SUPPORT - strcpy(g->Message, "Compress not supported"); + safe_strcpy(g->Message, sizeof(g->Message), "Compress not supported"); return NULL; #endif // !GZ_SUPPORT } else @@ -879,7 +880,7 @@ bool TDBCSV::SkipHeader(PGLOBAL g) if (q) To_Line[strlen(To_Line)] = Qot; - strcat(To_Line, cdp->GetName()); + safe_strcat(To_Line, Lrecl, cdp->GetName()); if (q) To_Line[strlen(To_Line)] = Qot; @@ -1049,14 +1050,16 @@ bool TDBCSV::PrepareWriting(PGLOBAL g) for (i = 0; i < Fields; i++) { if (i) - strcat(To_Line, sep); + safe_strcat(To_Line, Lrecl, sep); if (Field[i]) { if (!strlen(Field[i])) { // Generally null fields are not quoted - if (Quoted > 2) + if (Quoted > 2) { // Except if explicitly required - strcat(strcat(To_Line, qot), qot); + safe_strcat(To_Line, Lrecl, qot); + safe_strcat(To_Line, Lrecl, qot); + } } else if (Qot && (strchr(Field[i], Sep) || *Field[i] == Qot || Quoted > 1 || (Quoted == 1 && !Fldtyp[i]))) { @@ -1075,12 +1078,15 @@ bool TDBCSV::PrepareWriting(PGLOBAL g) To_Line[k++] = Qot; To_Line[k] = '\0'; - } else - strcat(strcat(strcat(To_Line, qot), Field[i]), qot); + } else { + safe_strcat(To_Line, Lrecl, qot); + safe_strcat(To_Line, Lrecl, Field[i]); + safe_strcat(To_Line, Lrecl, qot); + } } else - strcat(To_Line, Field[i]); + safe_strcat(To_Line, Lrecl, Field[i]); } } // endfor i @@ -1157,7 +1163,7 @@ int TDBCSV::CheckWrite(PGLOBAL g) } // endif } if ((nlen += n) > maxlen) { - strcpy(g->Message, MSG(LINE_TOO_LONG)); + safe_strcpy(g->Message, sizeof(g->Message), MSG(LINE_TOO_LONG)); return -1; } // endif nlen @@ -1267,7 +1273,7 @@ bool TDBFMT::OpenDB(PGLOBAL g) } // endif n FldFormat[i] = (PSZ)PlugSubAlloc(g, NULL, n + 5); - strcpy(FldFormat[i], pfm); + safe_strcpy(FldFormat[i], n + 5, pfm); if (!strcmp(pfm + n, "%m")) { // This is a field that can be missing. Flag it so it can @@ -1277,7 +1283,7 @@ bool TDBFMT::OpenDB(PGLOBAL g) } else if (i+1 < Fields && strcmp(pfm + n, "%n")) { // There are trailing characters after the field contents // add a marker for the next field start position. - strcat(FldFormat[i], "%n"); + safe_strcat(FldFormat[i], n + 5, "%n"); FmtTest[i] = 1; } // endif's diff --git a/storage/connect/tabjdbc.cpp b/storage/connect/tabjdbc.cpp index dc1f5e2fe5b..fe7609a1cac 100644 --- a/storage/connect/tabjdbc.cpp +++ b/storage/connect/tabjdbc.cpp @@ -277,7 +277,7 @@ PTDB JDBCDEF::GetTable(PGLOBAL g, MODE m) if (Multiple == 1) tdbp = new(g)TDBMUL(tdbp); else if (Multiple == 2) - strcpy(g->Message, "NO_JDBC_MUL"); + safe_strcpy(g->Message, sizeof(g->Message), "NO_JDBC_MUL"); } // endswitch Catfunc @@ -386,7 +386,7 @@ bool TDBJDBC::MakeInsert(PGLOBAL g) for (colp = Columns; colp; colp = colp->GetNext()) if (colp->IsSpecial()) { - strcpy(g->Message, "No JDBC special columns"); + safe_strcpy(g->Message, sizeof(g->Message), "No JDBC special columns"); return true; } else { // Column name can be encoded in UTF-8 @@ -460,7 +460,7 @@ bool TDBJDBC::MakeInsert(PGLOBAL g) } // endfor colp if ((Query->Append(") VALUES ("))) { - strcpy(g->Message, "MakeInsert: Out of memory"); + safe_strcpy(g->Message, sizeof(g->Message), "MakeInsert: Out of memory"); return true; } else // in case prepared statement fails pos = Query->GetLength(); @@ -470,7 +470,7 @@ bool TDBJDBC::MakeInsert(PGLOBAL g) Query->Append("?,"); if (Query->IsTruncated()) { - strcpy(g->Message, "MakeInsert: Out of memory"); + safe_strcpy(g->Message, sizeof(g->Message), "MakeInsert: Out of memory"); return true; } else Query->RepLast(')'); @@ -532,12 +532,15 @@ int TDBJDBC::Cardinality(PGLOBAL g) // Table name can be encoded in UTF-8 Decode(TableName, tbn, sizeof(tbn)); - strcpy(qry, "SELECT COUNT(*) FROM "); + safe_strcpy(qry, sizeof(qry), "SELECT COUNT(*) FROM "); - if (Quote) - strcat(strcat(strcat(qry, Quote), tbn), Quote); + if (Quote) { + safe_strcat(qry, sizeof(qry), Quote); + safe_strcat(qry, sizeof(qry), tbn); + safe_strcat(qry, sizeof(qry), Quote); + } else - strcat(qry, tbn); + safe_strcat(qry, sizeof(qry), tbn); // Allocate a Count(*) column (must not use the default constructor) Cnp = new(g)JDBCCOL; @@ -654,7 +657,7 @@ bool TDBJDBC::OpenDB(PGLOBAL g) if ((Qrp = Jcp->AllocateResult(g, this))) Memory = 2; // Must be filled else { - strcpy(g->Message, "Result set memory allocation failed"); + safe_strcpy(g->Message, sizeof(g->Message), "Result set memory allocation failed"); return true; } // endif n @@ -681,7 +684,7 @@ bool TDBJDBC::OpenDB(PGLOBAL g) #if 0 if (!(rc = MakeInsert(g))) { if (Nparm != Jcp->PrepareSQL(Query->GetStr())) { - strcpy(g->Message, MSG(PARM_CNT_MISS)); + safe_strcpy(g->Message, sizeof(g->Message), MSG(PARM_CNT_MISS)); rc = true; } else rc = BindParameters(g); @@ -733,12 +736,12 @@ bool TDBJDBC::SetRecpos(PGLOBAL g, int recpos) CurNum = recpos; Fpos = recpos; } else { - strcpy(g->Message, "Scrolling out of row set NIY"); + safe_strcpy(g->Message, sizeof(g->Message), "Scrolling out of row set NIY"); return true; } // endif recpos } else { - strcpy(g->Message, "This action requires a scrollable cursor"); + safe_strcpy(g->Message, sizeof(g->Message), "This action requires a scrollable cursor"); return true; } // endif's @@ -784,7 +787,7 @@ bool TDBJDBC::ReadKey(PGLOBAL g, OPVAL op, const key_range *kr) if (To_CondFil) if (Query->Append(" AND ") || Query->Append(To_CondFil->Body)) { - strcpy(g->Message, "Readkey: Out of memory"); + safe_strcpy(g->Message, sizeof(g->Message), "Readkey: Out of memory"); return true; } // endif Append @@ -917,7 +920,7 @@ int TDBJDBC::WriteDB(PGLOBAL g) } // endfor colp if (unlikely(Query->IsTruncated())) { - strcpy(g->Message, "WriteDB: Out of memory"); + safe_strcpy(g->Message, sizeof(g->Message), "WriteDB: Out of memory"); return RC_FX; } // endif Query @@ -1110,13 +1113,13 @@ PCMD TDBXJDC::MakeCMD(PGLOBAL g) (To_CondFil->Op == OP_EQ || To_CondFil->Op == OP_IN)) { xcmd = To_CondFil->Cmds; } else - strcpy(g->Message, "Invalid command specification filter"); + safe_strcpy(g->Message, sizeof(g->Message), "Invalid command specification filter"); } else - strcpy(g->Message, "No command column in select list"); + safe_strcpy(g->Message, sizeof(g->Message), "No command column in select list"); } else if (!Srcdef) - strcpy(g->Message, "No Srcdef default command"); + safe_strcpy(g->Message, sizeof(g->Message), "No Srcdef default command"); else xcmd = new(g) CMD(g, Srcdef); @@ -1149,7 +1152,7 @@ bool TDBXJDC::OpenDB(PGLOBAL g) this, Tdb_No, Use, Mode); if (Use == USE_OPEN) { - strcpy(g->Message, "Multiple execution is not allowed"); + safe_strcpy(g->Message, sizeof(g->Message), "Multiple execution is not allowed"); return true; } // endif use @@ -1171,7 +1174,7 @@ bool TDBXJDC::OpenDB(PGLOBAL g) Use = USE_OPEN; // Do it now in case we are recursively called if (Mode != MODE_READ && Mode != MODE_READX) { - strcpy(g->Message, "No INSERT/DELETE/UPDATE of XJDBC tables"); + safe_strcpy(g->Message, sizeof(g->Message), "No INSERT/DELETE/UPDATE of XJDBC tables"); return true; } // endif Mode @@ -1224,7 +1227,7 @@ int TDBXJDC::ReadDB(PGLOBAL g) /***********************************************************************/ int TDBXJDC::WriteDB(PGLOBAL g) { - strcpy(g->Message, "Execsrc tables are read only"); + safe_strcpy(g->Message, sizeof(g->Message), "Execsrc tables are read only"); return RC_FX; } // end of DeleteDB @@ -1233,7 +1236,7 @@ int TDBXJDC::WriteDB(PGLOBAL g) /***********************************************************************/ int TDBXJDC::DeleteDB(PGLOBAL g, int irc) { - strcpy(g->Message, "NO_XJDBC_DELETE"); + safe_strcpy(g->Message, sizeof(g->Message), "NO_XJDBC_DELETE"); return RC_FX; } // end of DeleteDB diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp index 67eb5bbede0..4462541d712 100644 --- a/storage/connect/tabjson.cpp +++ b/storage/connect/tabjson.cpp @@ -85,7 +85,7 @@ PQRYRES JSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info) } // endif info if (GetIntegerTableOption(g, topt, "Multiple", 0)) { - strcpy(g->Message, "Cannot find column definition for multiple table"); + safe_strcpy(g->Message, sizeof(g->Message), "Cannot find column definition for multiple table"); return NULL; } // endif Multiple @@ -212,7 +212,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt) tdp->Uri = (dsn && *dsn ? dsn : NULL); if (!tdp->Fn && !tdp->Uri) { - strcpy(g->Message, MSG(MISSING_FNAME)); + safe_strcpy(g->Message, sizeof(g->Message), MSG(MISSING_FNAME)); return 0; } else topt->subtype = NULL; @@ -320,7 +320,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt) switch (tjnp->ReadDB(g)) { case RC_EF: - strcpy(g->Message, "Void json table"); + safe_strcpy(g->Message, sizeof(g->Message), "Void json table"); case RC_FX: goto err; default: @@ -333,7 +333,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt) } // endif pretty if (!(row = (jsp) ? jsp->GetObject() : NULL)) { - strcpy(g->Message, "Can only retrieve columns from object rows"); + safe_strcpy(g->Message, sizeof(g->Message), "Can only retrieve columns from object rows"); goto err; } // endif row @@ -417,7 +417,7 @@ bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, PCSZ key, int j) if (jvp && jvp->DataType != TYPE_JSON) { if (JsonAllPath() && !fmt[bf]) - strcat(fmt, colname); + safe_strcat(fmt, sizeof(fmt), colname); jcol.Type = jvp->DataType; @@ -450,7 +450,7 @@ bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, PCSZ key, int j) jcol.Cbn = true; } else if (j < lvl && !Stringified(strfy, colname)) { if (!fmt[bf]) - strcat(fmt, colname); + safe_strcat(fmt, sizeof(fmt), colname); p = fmt + strlen(fmt); jsp = jvp->GetJson(); @@ -520,11 +520,11 @@ bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, PCSZ key, int j) } else if (lvl >= 0) { if (Stringified(strfy, colname)) { if (!fmt[bf]) - strcat(fmt, colname); + safe_strcat(fmt, sizeof(fmt), colname); - strcat(fmt, ".*"); + safe_strcat(fmt, sizeof(fmt), ".*"); } else if (JsonAllPath() && !fmt[bf]) - strcat(fmt, colname); + safe_strcat(fmt, sizeof(fmt), colname); jcol.Type = TYPE_STRG; jcol.Len = sz; @@ -735,7 +735,7 @@ PTDB JSONDEF::GetTable(PGLOBAL g, MODE m) } else if (m == MODE_INSERT) { txfp = new(g) ZIPFAM(this); } else { - strcpy(g->Message, "UPDATE/DELETE not supported for ZIP"); + safe_strcpy(g->Message, sizeof(g->Message), "UPDATE/DELETE not supported for ZIP"); return NULL; } // endif's m #else // !ZIP_SUPPORT @@ -775,7 +775,7 @@ PTDB JSONDEF::GetTable(PGLOBAL g, MODE m) #endif // 0 ((TDBJSN*)tdbp)->G = PlugInit(NULL, (size_t)Lrecl * (Pretty >= 0 ? 12 : 4)); } else { - strcpy(g->Message, "LRECL is not defined"); + safe_strcpy(g->Message, sizeof(g->Message), "LRECL is not defined"); return NULL; } // endif Lrecl @@ -785,10 +785,10 @@ PTDB JSONDEF::GetTable(PGLOBAL g, MODE m) if (m == MODE_READ || m == MODE_ANY || m == MODE_ALTER) { txfp = new(g) UNZFAM(this); } else if (m == MODE_INSERT) { - strcpy(g->Message, "INSERT supported only for zipped JSON when pretty=0"); + safe_strcpy(g->Message, sizeof(g->Message), "INSERT supported only for zipped JSON when pretty=0"); return NULL; } else { - strcpy(g->Message, "UPDATE/DELETE not supported for ZIP"); + safe_strcpy(g->Message, sizeof(g->Message), "UPDATE/DELETE not supported for ZIP"); return NULL; } // endif's m #else // !ZIP_SUPPORT @@ -1145,7 +1145,7 @@ int TDBJSN::ReadDB(PGLOBAL g) { M = 1; rc = RC_OK; } else if (Pretty != 1 || strcmp(To_Line, "]")) { - strcpy(g->Message, G->Message); + safe_strcpy(g->Message, sizeof(g->Message), G->Message); rc = RC_FX; } else rc = RC_EF; @@ -1258,7 +1258,7 @@ bool TDBJSN::PrepareWriting(PGLOBAL g) strcat(s, ","); if ((signed)strlen(s) > Lrecl) { - strncpy(To_Line, s, Lrecl); + safe_strcpy(To_Line, Lrecl, s); snprintf(g->Message, sizeof(g->Message), "Line truncated (lrecl=%d)", Lrecl); return PushWarning(g, this); } else @@ -1360,7 +1360,7 @@ bool JSONCOL::CheckExpand(PGLOBAL g, int i, PSZ nm, bool b) Xpd = true; // Expandable object Nodes[i].Op = OP_EXP; } else if (b) { - strcpy(g->Message, "Cannot expand more than one branch"); + safe_strcpy(g->Message, sizeof(g->Message), "Cannot expand more than one branch"); return true; } // endif Xcol @@ -1571,7 +1571,7 @@ bool JSONCOL::ParseJpath(PGLOBAL g) if (SetArrayOptions(g, p, i, Nodes[i - 1].Key)) return true; else if (Xpd && Tjp->Mode == MODE_DELETE) { - strcpy(g->Message, "Cannot delete expanded columns"); + safe_strcpy(g->Message, sizeof(g->Message), "Cannot delete expanded columns"); return true; } // endif Xpd @@ -1675,7 +1675,7 @@ PSZ JSONCOL::GetJpath(PGLOBAL g, bool proj) PVAL JSONCOL::MakeJson(PGLOBAL g, PJSON jsp, int n) { if (Value->IsTypeNum()) { - strcpy(g->Message, "Cannot make Json for a numeric column"); + safe_strcpy(g->Message, sizeof(g->Message), "Cannot make Json for a numeric column"); if (!Warned) { PushWarning(g, Tjp); @@ -1690,10 +1690,10 @@ PVAL JSONCOL::MakeJson(PGLOBAL g, PJSON jsp, int n) ulong len = Tjp->Lrecl ? Tjp->Lrecl : 500; PBSON bsp = JbinAlloc(g, NULL, len, jsp); - strcat(bsp->Msg, " column"); + safe_strcat(bsp->Msg, sizeof(bsp->Msg), " column"); ((BINVAL*)Value)->SetBinValue(bsp, sizeof(BSON)); } else { - strcpy(g->Message, "Column size too small"); + safe_strcpy(g->Message, sizeof(g->Message), "Column size too small"); Value->SetValue_char(NULL, 0); } // endif Clen #endif // 0 @@ -1937,7 +1937,7 @@ PVAL JSONCOL::ExpandArray(PGLOBAL g, PJAR arp, int n) } // endif ars if (!(jvp = arp->GetArrayValue((Nodes[n].Rx = Nodes[n].Nx)))) { - strcpy(g->Message, "Logical error expanding array"); + safe_strcpy(g->Message, sizeof(g->Message), "Logical error expanding array"); throw 666; } // endif jvp @@ -2125,7 +2125,7 @@ PJSON JSONCOL::GetRow(PGLOBAL g) ((PJAR)row)->AddArrayValue(G, new(G) JVALUE(nwr)); ((PJAR)row)->InitArray(G); } else { - strcpy(g->Message, "Wrong type when writing new row"); + safe_strcpy(g->Message, sizeof(g->Message), "Wrong type when writing new row"); nwr = NULL; } // endif's @@ -2146,7 +2146,7 @@ PJSON JSONCOL::GetRow(PGLOBAL g) void JSONCOL::WriteColumn(PGLOBAL g) { if (Xpd && Tjp->Pretty < 2) { - strcpy(g->Message, "Cannot write expanded column when Pretty is not 2"); + safe_strcpy(g->Message, sizeof(g->Message), "Cannot write expanded column when Pretty is not 2"); throw 666; } // endif Xpd @@ -2182,7 +2182,7 @@ void JSONCOL::WriteColumn(PGLOBAL g) if (s && *s) { if (!(jsp = ParseJson(G, s, strlen(s)))) { - strcpy(g->Message, s); + safe_strcpy(g->Message, sizeof(g->Message), s); throw 666; } // endif jsp @@ -2365,7 +2365,7 @@ int TDBJSON::MakeDocument(PGLOBAL g) if (!a && *p && *p != '[' && !IsNum(p)) { // obj is a key if (jsp->GetType() != TYPE_JOB) { - strcpy(g->Message, "Table path does not match the json file"); + safe_strcpy(g->Message, sizeof(g->Message), "Table path does not match the json file"); return RC_FX; } // endif Type @@ -2391,7 +2391,7 @@ int TDBJSON::MakeDocument(PGLOBAL g) } // endif p if (jsp->GetType() != TYPE_JAR) { - strcpy(g->Message, "Table path does not match the json file"); + safe_strcpy(g->Message, sizeof(g->Message), "Table path does not match the json file"); return RC_FX; } // endif Type @@ -2486,7 +2486,7 @@ void TDBJSON::ResetSize(void) int TDBJSON::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool) { if (pxdf) { - strcpy(g->Message, "JSON not indexable when pretty = 2"); + safe_strcpy(g->Message, sizeof(g->Message), "JSON not indexable when pretty = 2"); return RC_FX; } else return RC_OK; From 3bab137f58127c35c2eba5e052598bff5d59853b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 20 Apr 2023 16:58:28 +0200 Subject: [PATCH 150/260] 1.2.13 --- zlib/CMakeLists.txt | 42 +--- zlib/ChangeLog | 24 +- zlib/LICENSE | 22 ++ zlib/Makefile.in | 20 +- zlib/README | 4 +- zlib/compress.c | 6 +- zlib/configure | 97 ++++---- zlib/contrib/README.contrib | 2 +- zlib/contrib/delphi/ZLib.pas | 2 +- zlib/contrib/dotzlib/DotZLib/UnitTests.cs | 2 +- zlib/contrib/infback9/inftree9.c | 4 +- zlib/contrib/infback9/inftree9.h | 2 +- zlib/contrib/minizip/configure.ac | 2 +- zlib/contrib/minizip/crypt.h | 2 +- zlib/contrib/minizip/ioapi.c | 22 +- zlib/contrib/minizip/ioapi.h | 2 +- zlib/contrib/minizip/iowin32.c | 5 + zlib/contrib/minizip/miniunz.c | 2 +- zlib/contrib/minizip/minizip.c | 6 +- zlib/contrib/minizip/unzip.c | 4 +- zlib/contrib/minizip/zip.c | 7 +- zlib/contrib/pascal/zlibpas.pas | 2 +- zlib/contrib/puff/README | 2 +- zlib/contrib/puff/puff.c | 4 +- zlib/contrib/puff/pufftest.c | 2 +- zlib/contrib/vstudio/readme.txt | 5 +- .../vstudio/vc10/miniunz.vcxproj.filters | 2 +- .../vstudio/vc10/minizip.vcxproj.filters | 2 +- zlib/contrib/vstudio/vc10/testzlib.vcxproj | 24 +- .../vstudio/vc10/testzlib.vcxproj.filters | 5 +- .../vstudio/vc10/testzlibdll.vcxproj.filters | 2 +- zlib/contrib/vstudio/vc10/zlib.rc | 6 +- zlib/contrib/vstudio/vc10/zlibstat.vcxproj | 50 ++-- .../vstudio/vc10/zlibstat.vcxproj.filters | 3 - zlib/contrib/vstudio/vc10/zlibvc.vcxproj | 58 ++--- .../vstudio/vc10/zlibvc.vcxproj.filters | 3 - zlib/contrib/vstudio/vc11/testzlib.vcxproj | 24 +- zlib/contrib/vstudio/vc11/zlib.rc | 6 +- zlib/contrib/vstudio/vc11/zlibstat.vcxproj | 34 ++- zlib/contrib/vstudio/vc11/zlibvc.vcxproj | 58 ++--- zlib/contrib/vstudio/vc12/testzlib.vcxproj | 24 +- zlib/contrib/vstudio/vc12/zlib.rc | 6 +- zlib/contrib/vstudio/vc12/zlibstat.vcxproj | 34 ++- zlib/contrib/vstudio/vc12/zlibvc.vcxproj | 58 ++--- zlib/contrib/vstudio/vc14/testzlib.vcxproj | 24 +- zlib/contrib/vstudio/vc14/zlib.rc | 6 +- zlib/contrib/vstudio/vc14/zlibstat.vcxproj | 34 ++- zlib/contrib/vstudio/vc14/zlibvc.vcxproj | 58 ++--- zlib/contrib/vstudio/vc9/miniunz.vcproj | 2 +- zlib/contrib/vstudio/vc9/minizip.vcproj | 2 +- zlib/contrib/vstudio/vc9/testzlib.vcproj | 66 +----- zlib/contrib/vstudio/vc9/testzlibdll.vcproj | 2 +- zlib/contrib/vstudio/vc9/zlib.rc | 6 +- zlib/contrib/vstudio/vc9/zlibstat.vcproj | 76 +----- zlib/contrib/vstudio/vc9/zlibvc.vcproj | 82 ++----- zlib/crc32.c | 33 ++- zlib/deflate.c | 218 +++++++++--------- zlib/deflate.h | 4 +- zlib/examples/enough.c | 2 +- zlib/examples/fitblk.c | 4 +- zlib/examples/gun.c | 2 +- zlib/examples/gzappend.c | 4 +- zlib/examples/gzlog.h | 2 +- zlib/examples/zran.c | 2 +- zlib/gzlib.c | 2 +- zlib/gzread.c | 8 +- zlib/gzwrite.c | 2 +- zlib/infback.c | 17 +- zlib/inflate.c | 7 +- zlib/inftrees.c | 4 +- zlib/inftrees.h | 2 +- zlib/make_vms.com | 4 +- zlib/os400/README400 | 6 +- zlib/os400/bndsrc | 8 + zlib/os400/zlib.inc | 6 +- zlib/qnx/package.qpg | 10 +- zlib/test/example.c | 3 +- zlib/test/minigzip.c | 2 +- zlib/treebuild.xml | 4 +- zlib/trees.c | 123 +++++----- zlib/uncompr.c | 4 +- zlib/win32/README-WIN32.txt | 4 +- zlib/win32/zlib1.rc | 2 +- zlib/zconf.h | 19 +- zlib/zconf.h.cmakein | 19 +- zlib/zconf.h.in | 19 +- zlib/zlib.3 | 4 +- zlib/zlib.3.pdf | Bin 8848 -> 19366 bytes zlib/zlib.h | 20 +- zlib/zlib2ansi | 4 +- zlib/zutil.c | 16 +- zlib/zutil.h | 1 + 92 files changed, 674 insertions(+), 968 deletions(-) create mode 100644 zlib/LICENSE diff --git a/zlib/CMakeLists.txt b/zlib/CMakeLists.txt index e6fbb37d105..b412dc7feb7 100644 --- a/zlib/CMakeLists.txt +++ b/zlib/CMakeLists.txt @@ -3,10 +3,7 @@ set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON) project(zlib C) -set(VERSION "1.2.12") - -option(ASM686 "Enable building i686 assembly implementation") -option(AMD64 "Enable building amd64 assembly implementation") +set(VERSION "1.2.13") set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables") set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries") @@ -129,39 +126,6 @@ if(NOT MINGW) ) endif() -if(CMAKE_COMPILER_IS_GNUCC) - if(ASM686) - set(ZLIB_ASMS contrib/asm686/match.S) - elseif (AMD64) - set(ZLIB_ASMS contrib/amd64/amd64-match.S) - endif () - - if(ZLIB_ASMS) - add_definitions(-DASMV) - set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE) - endif() -endif() - -if(MSVC) - if(ASM686) - ENABLE_LANGUAGE(ASM_MASM) - set(ZLIB_ASMS - contrib/masmx86/inffas32.asm - contrib/masmx86/match686.asm - ) - elseif (AMD64) - ENABLE_LANGUAGE(ASM_MASM) - set(ZLIB_ASMS - contrib/masmx64/gvmat64.asm - contrib/masmx64/inffasx64.asm - ) - endif() - - if(ZLIB_ASMS) - add_definitions(-DASMV -DASMINF) - endif() -endif() - # parse the full version number from zlib.h and include in ZLIB_FULL_VERSION file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents) string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*" @@ -183,8 +147,8 @@ if(MINGW) set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) endif(MINGW) -add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) -add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) +add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) +add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) set_target_properties(zlib PROPERTIES SOVERSION 1) diff --git a/zlib/ChangeLog b/zlib/ChangeLog index f0b0e618092..457526bc6a5 100644 --- a/zlib/ChangeLog +++ b/zlib/ChangeLog @@ -1,6 +1,18 @@ ChangeLog file for zlib +Changes in 1.2.13 (13 Oct 2022) +- Fix configure issue that discarded provided CC definition +- Correct incorrect inputs provided to the CRC functions +- Repair prototypes and exporting of new CRC functions +- Fix inflateBack to detect invalid input with distances too far +- Have infback() deliver all of the available output up to any error +- Fix a bug when getting a gzip header extra field with inflate() +- Fix bug in block type selection when Z_FIXED used +- Tighten deflateBound bounds +- Remove deleted assembler code references +- Various portability and appearance improvements + Changes in 1.2.12 (27 Mar 2022) - Cygwin does not have _wopen(), so do not create gzopen_w() there - Permit a deflateParams() parameter change as soon as possible @@ -159,7 +171,7 @@ Changes in 1.2.7.1 (24 Mar 2013) - Fix types in contrib/minizip to match result of get_crc_table() - Simplify contrib/vstudio/vc10 with 'd' suffix - Add TOP support to win32/Makefile.msc -- Suport i686 and amd64 assembler builds in CMakeLists.txt +- Support i686 and amd64 assembler builds in CMakeLists.txt - Fix typos in the use of _LARGEFILE64_SOURCE in zconf.h - Add vc11 and vc12 build files to contrib/vstudio - Add gzvprintf() as an undocumented function in zlib @@ -359,14 +371,14 @@ Changes in 1.2.5.1 (10 Sep 2011) - Use u4 type for crc_table to avoid conversion warnings - Apply casts in zlib.h to avoid conversion warnings - Add OF to prototypes for adler32_combine_ and crc32_combine_ [Miller] -- Improve inflateSync() documentation to note indeterminancy +- Improve inflateSync() documentation to note indeterminacy - Add deflatePending() function to return the amount of pending output - Correct the spelling of "specification" in FAQ [Randers-Pehrson] - Add a check in configure for stdarg.h, use for gzprintf() - Check that pointers fit in ints when gzprint() compiled old style - Add dummy name before $(SHAREDLIBV) in Makefile [Bar-Lev, Bowler] - Delete line in configure that adds -L. libz.a to LDFLAGS [Weigelt] -- Add debug records in assmebler code [Londer] +- Add debug records in assembler code [Londer] - Update RFC references to use http://tools.ietf.org/html/... [Li] - Add --archs option, use of libtool to configure for Mac OS X [Borstel] @@ -1033,7 +1045,7 @@ Changes in 1.2.0.1 (17 March 2003) - Include additional header file on VMS for off_t typedef - Try to use _vsnprintf where it supplants vsprintf [Vollant] - Add some casts in inffast.c -- Enchance comments in zlib.h on what happens if gzprintf() tries to +- Enhance comments in zlib.h on what happens if gzprintf() tries to write more than 4095 bytes before compression - Remove unused state from inflateBackEnd() - Remove exit(0) from minigzip.c, example.c @@ -1211,7 +1223,7 @@ Changes in 1.0.9 (17 Feb 1998) - Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8 - in inftrees.c, avoid cc -O bug on HP (Farshid Elahi) - in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with - the declaration of FAR (Gilles VOllant) + the declaration of FAR (Gilles Vollant) - install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann) - read_buf buf parameter of type Bytef* instead of charf* - zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout) @@ -1567,7 +1579,7 @@ Changes in 0.4: - renamed deflateOptions as deflateInit2, call one or the other but not both - added the method parameter for deflateInit2 - added inflateInit2 -- simplied considerably deflateInit and inflateInit by not supporting +- simplified considerably deflateInit and inflateInit by not supporting user-provided history buffer. This is supported only in deflateInit2 and inflateInit2 diff --git a/zlib/LICENSE b/zlib/LICENSE new file mode 100644 index 00000000000..ab8ee6f7142 --- /dev/null +++ b/zlib/LICENSE @@ -0,0 +1,22 @@ +Copyright notice: + + (C) 1995-2022 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu diff --git a/zlib/Makefile.in b/zlib/Makefile.in index 3d858aa3a24..7d2713f4c57 100644 --- a/zlib/Makefile.in +++ b/zlib/Makefile.in @@ -7,10 +7,6 @@ # Normally configure builds both a static and a shared library. # If you want to build just a static library, use: ./configure --static -# To use the asm code, type: -# cp contrib/asm?86/match.S ./match.S -# make LOC=-DASMV OBJA=match.o - # To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type: # make install # To install in $HOME instead of /usr/local, use: @@ -26,13 +22,13 @@ CFLAGS=-O SFLAGS=-O LDFLAGS= -TEST_LDFLAGS=-L. libz.a +TEST_LDFLAGS=$(LDFLAGS) -L. libz.a LDSHARED=$(CC) CPP=$(CC) -E STATICLIB=libz.a SHAREDLIB=libz.so -SHAREDLIBV=libz.so.1.2.12 +SHAREDLIBV=libz.so.1.2.13 SHAREDLIBM=libz.so.1 LIBS=$(STATICLIB) $(SHAREDLIBV) @@ -87,7 +83,7 @@ test: all teststatic testshared teststatic: static @TMPST=tmpst_$$; \ - if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \ + if echo hello world | ${QEMU_RUN} ./minigzip | ${QEMU_RUN} ./minigzip -d && ${QEMU_RUN} ./example $$TMPST ; then \ echo ' *** zlib test OK ***'; \ else \ echo ' *** zlib test FAILED ***'; false; \ @@ -100,7 +96,7 @@ testshared: shared DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \ SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \ TMPSH=tmpsh_$$; \ - if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh $$TMPSH; then \ + if echo hello world | ${QEMU_RUN} ./minigzipsh | ${QEMU_RUN} ./minigzipsh -d && ${QEMU_RUN} ./examplesh $$TMPSH; then \ echo ' *** zlib shared test OK ***'; \ else \ echo ' *** zlib shared test FAILED ***'; false; \ @@ -109,7 +105,7 @@ testshared: shared test64: all64 @TMP64=tmp64_$$; \ - if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \ + if echo hello world | ${QEMU_RUN} ./minigzip64 | ${QEMU_RUN} ./minigzip64 -d && ${QEMU_RUN} ./example64 $$TMP64; then \ echo ' *** zlib 64-bit test OK ***'; \ else \ echo ' *** zlib 64-bit test FAILED ***'; false; \ @@ -124,7 +120,7 @@ infcover: infcover.o libz.a cover: infcover rm -f *.gcda - ./infcover + ${QEMU_RUN} ./infcover gcov inf*.c libz.a: $(OBJS) @@ -292,10 +288,10 @@ minigzip$(EXE): minigzip.o $(STATICLIB) $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) examplesh$(EXE): example.o $(SHAREDLIBV) - $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV) + $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) -L. $(SHAREDLIBV) minigzipsh$(EXE): minigzip.o $(SHAREDLIBV) - $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV) + $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) -L. $(SHAREDLIBV) example64$(EXE): example64.o $(STATICLIB) $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS) diff --git a/zlib/README b/zlib/README index 024b79d3d8c..ba34d1894a9 100644 --- a/zlib/README +++ b/zlib/README @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.12 is a general purpose data compression library. All the code is +zlib 1.2.13 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and @@ -31,7 +31,7 @@ Mark Nelson wrote an article about zlib for the Jan. 1997 issue of Dr. Dobb's Journal; a copy of the article is available at http://marknelson.us/1997/01/01/zlib-engine/ . -The changes made in version 1.2.12 are documented in the file ChangeLog. +The changes made in version 1.2.13 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory contrib/ . diff --git a/zlib/compress.c b/zlib/compress.c index e2db404abf8..2ad5326c14e 100644 --- a/zlib/compress.c +++ b/zlib/compress.c @@ -19,7 +19,7 @@ memory, Z_BUF_ERROR if there was not enough room in the output buffer, Z_STREAM_ERROR if the level parameter is invalid. */ -int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) +int ZEXPORT compress2(dest, destLen, source, sourceLen, level) Bytef *dest; uLongf *destLen; const Bytef *source; @@ -65,7 +65,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) /* =========================================================================== */ -int ZEXPORT compress (dest, destLen, source, sourceLen) +int ZEXPORT compress(dest, destLen, source, sourceLen) Bytef *dest; uLongf *destLen; const Bytef *source; @@ -78,7 +78,7 @@ int ZEXPORT compress (dest, destLen, source, sourceLen) If the default memLevel or windowBits for deflateInit() is changed, then this function needs to be updated. */ -uLong ZEXPORT compressBound (sourceLen) +uLong ZEXPORT compressBound(sourceLen) uLong sourceLen; { return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + diff --git a/zlib/configure b/zlib/configure index 52ff4a04ea8..fa4d5daaba9 100755 --- a/zlib/configure +++ b/zlib/configure @@ -32,8 +32,11 @@ fi # set command prefix for cross-compilation if [ -n "${CHOST}" ]; then - uname="`echo "${CHOST}" | sed -e 's/^[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)-.*$/\1/'`" + uname=${CHOST} + mname=${CHOST} CROSS_PREFIX="${CHOST}-" +else + mname=`(uname -a || echo unknown) 2>/dev/null` fi # destination name for static library @@ -174,9 +177,10 @@ if test -z "$CC"; then else cc=${CROSS_PREFIX}cc fi +else + cc=${CC} fi -cflags=${CFLAGS-"-O3"} -# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure + case "$cc" in *gcc*) gcc=1 ;; *clang*) gcc=1 ;; @@ -202,13 +206,13 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then fi if test "$warn" -eq 1; then if test "$zconst" -eq 1; then - CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -pedantic -DZLIB_CONST" + CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -DZLIB_CONST" else - CFLAGS="${CFLAGS} -Wall -Wextra -pedantic" + CFLAGS="${CFLAGS} -Wall -Wextra" fi fi if test $sanitize -eq 1; then - CFLAGS="${CFLAGS} -fsanitize=address" + CFLAGS="${CFLAGS} -g -fsanitize=address" fi if test $debug -eq 1; then CFLAGS="${CFLAGS} -DZLIB_DEBUG" @@ -218,47 +222,52 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then uname=`(uname -s || echo unknown) 2>/dev/null` fi case "$uname" in - Linux* | linux* | GNU | GNU/* | solaris*) + Linux* | linux* | *-linux* | GNU | GNU/* | solaris*) + case "$mname" in + *sparc*) + LDFLAGS="${LDFLAGS} -Wl,--no-warn-rwx-segments" ;; + esac LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"} ;; *BSD | *bsd* | DragonFly) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"} LDCONFIG="ldconfig -m" ;; - CYGWIN* | Cygwin* | cygwin* | OS/2*) + CYGWIN* | Cygwin* | cygwin* | *-cygwin* | OS/2*) EXE='.exe' ;; - MINGW* | mingw*) -# temporary bypass + MINGW* | mingw* | *-mingw*) rm -f $test.[co] $test $test$shared_ext - echo "Please use win32/Makefile.gcc instead." | tee -a configure.log - leave 1 + echo "If this doesn't work for you, try win32/Makefile.gcc." | tee -a configure.log LDSHARED=${LDSHARED-"$cc -shared"} LDSHAREDLIBC="" EXE='.exe' ;; - QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4 - # (alain.bonnefoy@icbt.com) - LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"} ;; + QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4 + # (alain.bonnefoy@icbt.com) + LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"} ;; HP-UX*) - LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"} - case `(uname -m || echo unknown) 2>/dev/null` in - ia64) - shared_ext='.so' - SHAREDLIB='libz.so' ;; - *) - shared_ext='.sl' - SHAREDLIB='libz.sl' ;; - esac ;; - Darwin* | darwin*) - shared_ext='.dylib' - SHAREDLIB=libz$shared_ext - SHAREDLIBV=libz.$VER$shared_ext - SHAREDLIBM=libz.$VER1$shared_ext - LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"} - if libtool -V 2>&1 | grep Apple > /dev/null; then - AR="libtool" - else - AR="/usr/bin/libtool" - fi - ARFLAGS="-o" ;; - *) LDSHARED=${LDSHARED-"$cc -shared"} ;; + LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"} + case `(uname -m || echo unknown) 2>/dev/null` in + ia64) + shared_ext='.so' + SHAREDLIB='libz.so' ;; + *) + shared_ext='.sl' + SHAREDLIB='libz.sl' ;; + esac ;; + AIX*) + LDFLAGS="${LDFLAGS} -Wl,-brtl" ;; + Darwin* | darwin* | *-darwin*) + shared_ext='.dylib' + SHAREDLIB=libz$shared_ext + SHAREDLIBV=libz.$VER$shared_ext + SHAREDLIBM=libz.$VER1$shared_ext + LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"} + if libtool -V 2>&1 | grep Apple > /dev/null; then + AR="libtool" + else + AR="/usr/bin/libtool" + fi + ARFLAGS="-o" ;; + *) + LDSHARED=${LDSHARED-"$cc -shared"} ;; esac else # find system name and corresponding cc options @@ -450,20 +459,6 @@ else TEST="all teststatic testshared" fi -# check for underscores in external names for use by assembler code -CPP=${CPP-"$CC -E"} -case $CFLAGS in - *ASMV*) - echo >> configure.log - show "$NM $test.o | grep _hello" - if test "`$NM $test.o | grep _hello | tee -a configure.log`" = ""; then - CPP="$CPP -DNO_UNDERLINE" - echo Checking for underline in external names... No. | tee -a configure.log - else - echo Checking for underline in external names... Yes. | tee -a configure.log - fi ;; -esac - echo >> configure.log # check for size_t diff --git a/zlib/contrib/README.contrib b/zlib/contrib/README.contrib index 335e43508be..5e5f9505409 100644 --- a/zlib/contrib/README.contrib +++ b/zlib/contrib/README.contrib @@ -1,4 +1,4 @@ -All files under this contrib directory are UNSUPPORTED. There were +All files under this contrib directory are UNSUPPORTED. They were provided by users of zlib and were not tested by the authors of zlib. Use at your own risk. Please contact the authors of the contributions for help about these, not the zlib authors. Thanks. diff --git a/zlib/contrib/delphi/ZLib.pas b/zlib/contrib/delphi/ZLib.pas index d40dad8a11d..8be5fa22c4c 100644 --- a/zlib/contrib/delphi/ZLib.pas +++ b/zlib/contrib/delphi/ZLib.pas @@ -152,7 +152,7 @@ procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer; const OutBuf: Pointer; BufSize: Integer); const - zlib_version = '1.2.12'; + zlib_version = '1.2.13'; type EZlibError = class(Exception); diff --git a/zlib/contrib/dotzlib/DotZLib/UnitTests.cs b/zlib/contrib/dotzlib/DotZLib/UnitTests.cs index 865c80200a5..16a0ebb072d 100644 --- a/zlib/contrib/dotzlib/DotZLib/UnitTests.cs +++ b/zlib/contrib/dotzlib/DotZLib/UnitTests.cs @@ -156,7 +156,7 @@ namespace DotZLibTests public void Info_Version() { Info info = new Info(); - Assert.AreEqual("1.2.12", Info.Version); + Assert.AreEqual("1.2.13", Info.Version); Assert.AreEqual(32, info.SizeOfUInt); Assert.AreEqual(32, info.SizeOfULong); Assert.AreEqual(32, info.SizeOfPointer); diff --git a/zlib/contrib/infback9/inftree9.c b/zlib/contrib/infback9/inftree9.c index 05506066ce0..10827a6aa01 100644 --- a/zlib/contrib/infback9/inftree9.c +++ b/zlib/contrib/infback9/inftree9.c @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate9_copyright[] = - " inflate9 1.2.12 Copyright 1995-2022 Mark Adler "; + " inflate9 1.2.13 Copyright 1995-2022 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -64,7 +64,7 @@ unsigned short FAR *work; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, 130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132, - 133, 133, 133, 133, 144, 199, 202}; + 133, 133, 133, 133, 144, 194, 65}; static const unsigned short dbase[32] = { /* Distance codes 0..31 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, diff --git a/zlib/contrib/infback9/inftree9.h b/zlib/contrib/infback9/inftree9.h index 5ab21f0c6d1..3b394978e3f 100644 --- a/zlib/contrib/infback9/inftree9.h +++ b/zlib/contrib/infback9/inftree9.h @@ -38,7 +38,7 @@ typedef struct { /* Maximum size of the dynamic table. The maximum number of code structures is 1446, which is the sum of 852 for literal/length codes and 594 for distance codes. These values were found by exhaustive searches using the program - examples/enough.c found in the zlib distribtution. The arguments to that + examples/enough.c found in the zlib distribution. The arguments to that program are the number of symbols, the initial root table size, and the maximum bit length of a code. "enough 286 9 15" for literal/length codes returns returns 852, and "enough 32 6 15" for distance codes returns 594. diff --git a/zlib/contrib/minizip/configure.ac b/zlib/contrib/minizip/configure.ac index 6409abc8933..bff300b3045 100644 --- a/zlib/contrib/minizip/configure.ac +++ b/zlib/contrib/minizip/configure.ac @@ -1,7 +1,7 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -AC_INIT([minizip], [1.2.12], [bugzilla.redhat.com]) +AC_INIT([minizip], [1.2.13], [bugzilla.redhat.com]) AC_CONFIG_SRCDIR([minizip.c]) AM_INIT_AUTOMAKE([foreign]) LT_INIT diff --git a/zlib/contrib/minizip/crypt.h b/zlib/contrib/minizip/crypt.h index 9da15373d8b..1cc41f19d78 100644 --- a/zlib/contrib/minizip/crypt.h +++ b/zlib/contrib/minizip/crypt.h @@ -85,7 +85,7 @@ static void init_keys(const char* passwd,unsigned long* pkeys,const z_crc_t* pcr #define RAND_HEAD_LEN 12 /* "last resort" source for second part of crypt seed pattern */ # ifndef ZCR_SEED2 -# define ZCR_SEED2 3141592654L /* use PI as default pattern */ +# define ZCR_SEED2 3141592654UL /* use PI as default pattern */ # endif static unsigned crypthead(const char* passwd, /* password string */ diff --git a/zlib/contrib/minizip/ioapi.c b/zlib/contrib/minizip/ioapi.c index d666e5a2289..814a6fd38c2 100644 --- a/zlib/contrib/minizip/ioapi.c +++ b/zlib/contrib/minizip/ioapi.c @@ -94,9 +94,9 @@ static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream)); static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode) { - (void)opaque; FILE* file = NULL; const char* mode_fopen = NULL; + (void)opaque; if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) mode_fopen = "rb"; else @@ -113,9 +113,9 @@ static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, in static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode) { - (void)opaque; FILE* file = NULL; const char* mode_fopen = NULL; + (void)opaque; if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) mode_fopen = "rb"; else @@ -133,24 +133,24 @@ static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size) { - (void)opaque; uLong ret; + (void)opaque; ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); return ret; } static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size) { - (void)opaque; uLong ret; + (void)opaque; ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); return ret; } static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream) { - (void)opaque; long ret; + (void)opaque; ret = ftell((FILE *)stream); return ret; } @@ -158,17 +158,17 @@ static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream) static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream) { - (void)opaque; ZPOS64_T ret; + (void)opaque; ret = (ZPOS64_T)FTELLO_FUNC((FILE *)stream); return ret; } static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin) { - (void)opaque; int fseek_origin=0; long ret; + (void)opaque; switch (origin) { case ZLIB_FILEFUNC_SEEK_CUR : @@ -190,9 +190,9 @@ static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offs static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin) { - (void)opaque; int fseek_origin=0; long ret; + (void)opaque; switch (origin) { case ZLIB_FILEFUNC_SEEK_CUR : @@ -208,7 +208,7 @@ static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T } ret = 0; - if(FSEEKO_FUNC((FILE *)stream, (long)offset, fseek_origin) != 0) + if(FSEEKO_FUNC((FILE *)stream, (z_off_t)offset, fseek_origin) != 0) ret = -1; return ret; @@ -217,16 +217,16 @@ static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream) { - (void)opaque; int ret; + (void)opaque; ret = fclose((FILE *)stream); return ret; } static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream) { - (void)opaque; int ret; + (void)opaque; ret = ferror((FILE *)stream); return ret; } diff --git a/zlib/contrib/minizip/ioapi.h b/zlib/contrib/minizip/ioapi.h index 114bfab762f..ae9ca7e8337 100644 --- a/zlib/contrib/minizip/ioapi.h +++ b/zlib/contrib/minizip/ioapi.h @@ -50,7 +50,7 @@ #define ftello64 ftell #define fseeko64 fseek #else -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) #define fopen64 fopen #define ftello64 ftello #define fseeko64 fseeko diff --git a/zlib/contrib/minizip/iowin32.c b/zlib/contrib/minizip/iowin32.c index 274f39eb1dd..7df525172b2 100644 --- a/zlib/contrib/minizip/iowin32.c +++ b/zlib/contrib/minizip/iowin32.c @@ -28,6 +28,11 @@ // see Include/shared/winapifamily.h in the Windows Kit #if defined(WINAPI_FAMILY_PARTITION) && (!(defined(IOWIN32_USING_WINRT_API))) + +#if !defined(WINAPI_FAMILY_ONE_PARTITION) +#define WINAPI_FAMILY_ONE_PARTITION(PartitionSet, Partition) ((WINAPI_FAMILY & PartitionSet) == Partition) +#endif + #if WINAPI_FAMILY_ONE_PARTITION(WINAPI_FAMILY, WINAPI_PARTITION_APP) #define IOWIN32_USING_WINRT_API 1 #endif diff --git a/zlib/contrib/minizip/miniunz.c b/zlib/contrib/minizip/miniunz.c index f103815efb3..0dc9b50815a 100644 --- a/zlib/contrib/minizip/miniunz.c +++ b/zlib/contrib/minizip/miniunz.c @@ -564,7 +564,7 @@ int main(argc,argv) while ((*p)!='\0') { - char c=*(p++);; + char c=*(p++); if ((c=='l') || (c=='L')) opt_do_list = 1; if ((c=='v') || (c=='V')) diff --git a/zlib/contrib/minizip/minizip.c b/zlib/contrib/minizip/minizip.c index 7f937aa5b2a..e8561b15f91 100644 --- a/zlib/contrib/minizip/minizip.c +++ b/zlib/contrib/minizip/minizip.c @@ -190,7 +190,7 @@ static int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf, FILE * fin = FOPEN_FUNC(filenameinzip,"rb"); unsigned long size_read = 0; - unsigned long total_read = 0; + /* unsigned long total_read = 0; */ if (fin==NULL) { err = ZIP_ERRNO; @@ -210,7 +210,7 @@ static int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf, if (size_read>0) calculate_crc = crc32_z(calculate_crc,buf,size_read); - total_read += size_read; + /* total_read += size_read; */ } while ((err == ZIP_OK) && (size_read>0)); @@ -277,7 +277,7 @@ int main(argc,argv) while ((*p)!='\0') { - char c=*(p++);; + char c=*(p++); if ((c=='o') || (c=='O')) opt_overwrite = 1; if ((c=='a') || (c=='A')) diff --git a/zlib/contrib/minizip/unzip.c b/zlib/contrib/minizip/unzip.c index 5e12e474740..3036b470b72 100644 --- a/zlib/contrib/minizip/unzip.c +++ b/zlib/contrib/minizip/unzip.c @@ -112,7 +112,7 @@ # define ALLOC(size) (malloc(size)) #endif #ifndef TRYFREE -# define TRYFREE(p) {if (p) free(p);} +# define TRYFREE(p) { free(p);} #endif #define SIZECENTRALDIRITEM (0x2e) @@ -1566,6 +1566,7 @@ extern int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, pfile_in_zip_read_info->stream_initialised=Z_BZIP2ED; else { + TRYFREE(pfile_in_zip_read_info->read_buffer); TRYFREE(pfile_in_zip_read_info); return err; } @@ -1586,6 +1587,7 @@ extern int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, pfile_in_zip_read_info->stream_initialised=Z_DEFLATED; else { + TRYFREE(pfile_in_zip_read_info->read_buffer); TRYFREE(pfile_in_zip_read_info); return err; } diff --git a/zlib/contrib/minizip/zip.c b/zlib/contrib/minizip/zip.c index 4e611e11630..66d693f85a5 100644 --- a/zlib/contrib/minizip/zip.c +++ b/zlib/contrib/minizip/zip.c @@ -1471,11 +1471,6 @@ extern int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned in { uLong uTotalOutBefore = zi->ci.stream.total_out; err=deflate(&zi->ci.stream, Z_NO_FLUSH); - if(uTotalOutBefore > zi->ci.stream.total_out) - { - int bBreak = 0; - bBreak++; - } zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; } @@ -1959,7 +1954,7 @@ extern int ZEXPORT zipRemoveExtraInfoBlock (char* pData, int* dataLen, short sHe int retVal = ZIP_OK; - if(pData == NULL || *dataLen < 4) + if(pData == NULL || dataLen == NULL || *dataLen < 4) return ZIP_PARAMERROR; pNewHeader = (char*)ALLOC((unsigned)*dataLen); diff --git a/zlib/contrib/pascal/zlibpas.pas b/zlib/contrib/pascal/zlibpas.pas index adb5cd60b01..bf3fff6ff6f 100644 --- a/zlib/contrib/pascal/zlibpas.pas +++ b/zlib/contrib/pascal/zlibpas.pas @@ -10,7 +10,7 @@ unit zlibpas; interface const - ZLIB_VERSION = '1.2.12'; + ZLIB_VERSION = '1.2.13'; ZLIB_VERNUM = $12a0; type diff --git a/zlib/contrib/puff/README b/zlib/contrib/puff/README index bbc4cb595ec..d8192c78747 100644 --- a/zlib/contrib/puff/README +++ b/zlib/contrib/puff/README @@ -38,7 +38,7 @@ Then you can call puff() to decompress a deflate stream that is in memory in its entirety at source, to a sufficiently sized block of memory for the decompressed data at dest. puff() is the only external symbol in puff.c The only C library functions that puff.c needs are setjmp() and longjmp(), which -are used to simplify error checking in the code to improve readabilty. puff.c +are used to simplify error checking in the code to improve readability. puff.c does no memory allocation, and uses less than 2K bytes off of the stack. If destlen is not enough space for the uncompressed data, then inflate will diff --git a/zlib/contrib/puff/puff.c b/zlib/contrib/puff/puff.c index c6c90d71420..6737ff6153f 100644 --- a/zlib/contrib/puff/puff.c +++ b/zlib/contrib/puff/puff.c @@ -43,7 +43,7 @@ * - Use pointers instead of long to specify source and * destination sizes to avoid arbitrary 4 GB limits * 1.2 17 Mar 2002 - Add faster version of decode(), doubles speed (!), - * but leave simple version for readabilty + * but leave simple version for readability * - Make sure invalid distances detected if pointers * are 16 bits * - Fix fixed codes table error @@ -624,7 +624,7 @@ local int fixed(struct state *s) * are themselves compressed using Huffman codes and run-length encoding. In * the list of code lengths, a 0 symbol means no code, a 1..15 symbol means * that length, and the symbols 16, 17, and 18 are run-length instructions. - * Each of 16, 17, and 18 are follwed by extra bits to define the length of + * Each of 16, 17, and 18 are followed by extra bits to define the length of * the run. 16 copies the last length 3 to 6 times. 17 represents 3 to 10 * zero lengths, and 18 represents 11 to 138 zero lengths. Unused symbols * are common, hence the special coding for zero lengths. diff --git a/zlib/contrib/puff/pufftest.c b/zlib/contrib/puff/pufftest.c index 776481488c9..5f72ecc8276 100644 --- a/zlib/contrib/puff/pufftest.c +++ b/zlib/contrib/puff/pufftest.c @@ -143,7 +143,7 @@ int main(int argc, char **argv) len - sourcelen); } - /* if requested, inflate again and write decompressd data to stdout */ + /* if requested, inflate again and write decompressed data to stdout */ if (put && ret == 0) { if (fail) destlen >>= 1; diff --git a/zlib/contrib/vstudio/readme.txt b/zlib/contrib/vstudio/readme.txt index d396d4309f3..17e693ffd54 100644 --- a/zlib/contrib/vstudio/readme.txt +++ b/zlib/contrib/vstudio/readme.txt @@ -1,4 +1,4 @@ -Building instructions for the DLL versions of Zlib 1.2.12 +Building instructions for the DLL versions of Zlib 1.2.13 ======================================================== This directory contains projects that build zlib and minizip using @@ -17,9 +17,6 @@ More information can be found at this site. Build instructions for Visual Studio 2008 (32 bits or 64 bits) -------------------------------------------------------------- - Decompress current zlib, including all contrib/* files -- Compile assembly code (with Visual Studio Command Prompt) by running: - bld_ml64.bat (in contrib\masmx64) - bld_ml32.bat (in contrib\masmx86) - Open contrib\vstudio\vc9\zlibvc.sln with Microsoft Visual C++ 2008 - Or run: vcbuild /rebuild contrib\vstudio\vc9\zlibvc.sln "Release|Win32" diff --git a/zlib/contrib/vstudio/vc10/miniunz.vcxproj.filters b/zlib/contrib/vstudio/vc10/miniunz.vcxproj.filters index 0b2a3de2dfe..e53556a6386 100644 --- a/zlib/contrib/vstudio/vc10/miniunz.vcxproj.filters +++ b/zlib/contrib/vstudio/vc10/miniunz.vcxproj.filters @@ -3,7 +3,7 @@ {048af943-022b-4db6-beeb-a54c34774ee2} - cpp;c;cxx;def;odl;idl;hpj;bat;asm + cpp;c;cxx;def;odl;idl;hpj;bat {c1d600d2-888f-4aea-b73e-8b0dd9befa0c} diff --git a/zlib/contrib/vstudio/vc10/minizip.vcxproj.filters b/zlib/contrib/vstudio/vc10/minizip.vcxproj.filters index dd73cd31329..bd18d715e7c 100644 --- a/zlib/contrib/vstudio/vc10/minizip.vcxproj.filters +++ b/zlib/contrib/vstudio/vc10/minizip.vcxproj.filters @@ -3,7 +3,7 @@ {c0419b40-bf50-40da-b153-ff74215b79de} - cpp;c;cxx;def;odl;idl;hpj;bat;asm + cpp;c;cxx;def;odl;idl;hpj;bat {bb87b070-735b-478e-92ce-7383abb2f36c} diff --git a/zlib/contrib/vstudio/vc10/testzlib.vcxproj b/zlib/contrib/vstudio/vc10/testzlib.vcxproj index 9088d176f8c..0e668f7643b 100644 --- a/zlib/contrib/vstudio/vc10/testzlib.vcxproj +++ b/zlib/contrib/vstudio/vc10/testzlib.vcxproj @@ -181,7 +181,7 @@ Disabled ..\..\..;%(AdditionalIncludeDirectories) - ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) true Default MultiThreadedDebug @@ -194,7 +194,7 @@ EditAndContinue - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)testzlib.exe true $(OutDir)testzlib.pdb @@ -241,7 +241,7 @@ OnlyExplicitInline true ..\..\..;%(AdditionalIncludeDirectories) - ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) true Default MultiThreaded @@ -254,7 +254,7 @@ ProgramDatabase - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)testzlib.exe true Console @@ -269,14 +269,14 @@ ..\..\..;%(AdditionalIncludeDirectories) - ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) Default MultiThreadedDebugDLL false $(IntDir) - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) @@ -352,14 +352,14 @@ ..\..\..;%(AdditionalIncludeDirectories) - ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) Default MultiThreadedDLL false $(IntDir) - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) @@ -398,14 +398,6 @@ - - true - true - true - true - true - true - diff --git a/zlib/contrib/vstudio/vc10/testzlib.vcxproj.filters b/zlib/contrib/vstudio/vc10/testzlib.vcxproj.filters index 249daa89caf..3cf52ee3edc 100644 --- a/zlib/contrib/vstudio/vc10/testzlib.vcxproj.filters +++ b/zlib/contrib/vstudio/vc10/testzlib.vcxproj.filters @@ -3,7 +3,7 @@ {c1f6a2e3-5da5-4955-8653-310d3efe05a9} - cpp;c;cxx;def;odl;idl;hpj;bat;asm + cpp;c;cxx;def;odl;idl;hpj;bat {c2aaffdc-2c95-4d6f-8466-4bec5890af2c} @@ -30,9 +30,6 @@ Source Files - - Source Files - Source Files diff --git a/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.filters b/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.filters index 53a8693bb0a..aeb550e9c33 100644 --- a/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.filters +++ b/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.filters @@ -3,7 +3,7 @@ {fa61a89f-93fc-4c89-b29e-36224b7592f4} - cpp;c;cxx;def;odl;idl;hpj;bat;asm + cpp;c;cxx;def;odl;idl;hpj;bat {d4b85da0-2ba2-4934-b57f-e2584e3848ee} diff --git a/zlib/contrib/vstudio/vc10/zlib.rc b/zlib/contrib/vstudio/vc10/zlib.rc index 8ad25f1031a..876027498a3 100644 --- a/zlib/contrib/vstudio/vc10/zlib.rc +++ b/zlib/contrib/vstudio/vc10/zlib.rc @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1, 2, 12, 0 - PRODUCTVERSION 1, 2, 12, 0 + FILEVERSION 1, 2, 13, 0 + PRODUCTVERSION 1, 2, 13, 0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,7 +17,7 @@ BEGIN BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.12\0" + VALUE "FileVersion", "1.2.13\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlibwapi.dll\0" VALUE "ProductName", "ZLib.DLL\0" diff --git a/zlib/contrib/vstudio/vc10/zlibstat.vcxproj b/zlib/contrib/vstudio/vc10/zlibstat.vcxproj index b9f2bbe5f0b..c7ed09e5195 100644 --- a/zlib/contrib/vstudio/vc10/zlibstat.vcxproj +++ b/zlib/contrib/vstudio/vc10/zlibstat.vcxproj @@ -160,7 +160,7 @@ Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) @@ -182,16 +182,12 @@ $(OutDir)zlibstat.lib true - - cd ..\..\masmx86 -bld_ml32.bat - OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -210,19 +206,15 @@ bld_ml32.bat /MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions) - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibstat.lib true - - cd ..\..\masmx86 -bld_ml32.bat - OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -252,7 +244,7 @@ bld_ml32.bat Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) @@ -274,10 +266,6 @@ bld_ml32.bat $(OutDir)zlibstat.lib true - - cd ..\..\masmx64 -bld_ml64.bat - @@ -285,7 +273,7 @@ bld_ml64.bat Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) @@ -314,8 +302,8 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) true @@ -334,14 +322,10 @@ bld_ml64.bat /MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions) - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibstat.lib true - - cd ..\..\masmx64 -bld_ml64.bat - @@ -349,7 +333,7 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) true @@ -379,7 +363,7 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) true @@ -409,7 +393,7 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) true @@ -443,14 +427,6 @@ bld_ml64.bat - - true - true - true - true - true - true - diff --git a/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters b/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters index c8c7f7ea395..ba7e23d3253 100644 --- a/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters +++ b/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters @@ -33,9 +33,6 @@ Source Files - - Source Files - Source Files diff --git a/zlib/contrib/vstudio/vc10/zlibvc.vcxproj b/zlib/contrib/vstudio/vc10/zlibvc.vcxproj index 6ff9ddb0772..19dfc35bf31 100644 --- a/zlib/contrib/vstudio/vc10/zlibvc.vcxproj +++ b/zlib/contrib/vstudio/vc10/zlibvc.vcxproj @@ -197,8 +197,8 @@ Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions) MultiThreadedDebug @@ -219,7 +219,7 @@ /MACHINE:I386 %(AdditionalOptions) - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) true .\zlibvc.def true @@ -229,10 +229,6 @@ - - cd ..\..\masmx86 -bld_ml32.bat - @@ -244,7 +240,7 @@ bld_ml32.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions) true @@ -288,8 +284,8 @@ bld_ml32.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions) true @@ -312,7 +308,7 @@ bld_ml32.bat /MACHINE:I386 %(AdditionalOptions) - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) true false .\zlibvc.def @@ -322,10 +318,6 @@ bld_ml32.bat - - cd ..\..\masmx86 -bld_ml32.bat - @@ -337,8 +329,8 @@ bld_ml32.bat Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) MultiThreadedDebugDLL @@ -358,7 +350,7 @@ bld_ml32.bat 0x040c - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) true .\zlibvc.def true @@ -366,10 +358,6 @@ bld_ml32.bat Windows MachineX64 - - cd ..\..\masmx64 -bld_ml64.bat - @@ -381,7 +369,7 @@ bld_ml64.bat Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) @@ -424,7 +412,7 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) true @@ -465,7 +453,7 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) true @@ -510,8 +498,8 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) true @@ -533,7 +521,7 @@ bld_ml64.bat 0x040c - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) true false .\zlibvc.def @@ -541,10 +529,6 @@ bld_ml64.bat Windows MachineX64 - - cd ..\..\masmx64 -bld_ml64.bat - @@ -556,7 +540,7 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) true @@ -601,14 +585,6 @@ bld_ml64.bat - - true - true - true - true - true - true - diff --git a/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.filters b/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.filters index 180b71cd61d..67c444ab9ab 100644 --- a/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.filters +++ b/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.filters @@ -42,9 +42,6 @@ Source Files - - Source Files - Source Files diff --git a/zlib/contrib/vstudio/vc11/testzlib.vcxproj b/zlib/contrib/vstudio/vc11/testzlib.vcxproj index 6d559540130..c6198c1fd29 100644 --- a/zlib/contrib/vstudio/vc11/testzlib.vcxproj +++ b/zlib/contrib/vstudio/vc11/testzlib.vcxproj @@ -187,7 +187,7 @@ Disabled ..\..\..;%(AdditionalIncludeDirectories) - ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) true Default MultiThreadedDebugDLL @@ -200,7 +200,7 @@ ProgramDatabase - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)testzlib.exe true $(OutDir)testzlib.pdb @@ -247,7 +247,7 @@ OnlyExplicitInline true ..\..\..;%(AdditionalIncludeDirectories) - ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) true Default MultiThreaded @@ -260,7 +260,7 @@ ProgramDatabase - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)testzlib.exe true Console @@ -275,14 +275,14 @@ ..\..\..;%(AdditionalIncludeDirectories) - ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) Default MultiThreadedDebugDLL false $(IntDir) - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) @@ -358,14 +358,14 @@ ..\..\..;%(AdditionalIncludeDirectories) - ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) Default MultiThreadedDLL false $(IntDir) - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) @@ -404,14 +404,6 @@ - - true - true - true - true - true - true - diff --git a/zlib/contrib/vstudio/vc11/zlib.rc b/zlib/contrib/vstudio/vc11/zlib.rc index 8ad25f1031a..876027498a3 100644 --- a/zlib/contrib/vstudio/vc11/zlib.rc +++ b/zlib/contrib/vstudio/vc11/zlib.rc @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1, 2, 12, 0 - PRODUCTVERSION 1, 2, 12, 0 + FILEVERSION 1, 2, 13, 0 + PRODUCTVERSION 1, 2, 13, 0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,7 +17,7 @@ BEGIN BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.12\0" + VALUE "FileVersion", "1.2.13\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlibwapi.dll\0" VALUE "ProductName", "ZLib.DLL\0" diff --git a/zlib/contrib/vstudio/vc11/zlibstat.vcxproj b/zlib/contrib/vstudio/vc11/zlibstat.vcxproj index 806b76a88b6..86fb1c8bf60 100644 --- a/zlib/contrib/vstudio/vc11/zlibstat.vcxproj +++ b/zlib/contrib/vstudio/vc11/zlibstat.vcxproj @@ -167,7 +167,7 @@ Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) @@ -193,8 +193,8 @@ OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -213,7 +213,7 @@ /MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions) - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibstat.lib true @@ -221,7 +221,7 @@ OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -251,7 +251,7 @@ Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) @@ -280,7 +280,7 @@ Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) @@ -309,8 +309,8 @@ OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) true @@ -329,7 +329,7 @@ /MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions) - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibstat.lib true @@ -340,7 +340,7 @@ OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) true @@ -370,7 +370,7 @@ OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) true @@ -400,7 +400,7 @@ OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) true @@ -434,14 +434,6 @@ - - true - true - true - true - true - true - diff --git a/zlib/contrib/vstudio/vc11/zlibvc.vcxproj b/zlib/contrib/vstudio/vc11/zlibvc.vcxproj index c65b95fdbb5..fc8cd9c1765 100644 --- a/zlib/contrib/vstudio/vc11/zlibvc.vcxproj +++ b/zlib/contrib/vstudio/vc11/zlibvc.vcxproj @@ -204,8 +204,8 @@ Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions) MultiThreadedDebugDLL @@ -226,7 +226,7 @@ /MACHINE:I386 %(AdditionalOptions) - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibwapi.dll true .\zlibvc.def @@ -240,10 +240,6 @@ $(OutDir)zlibwapi.lib - - cd ..\..\masmx86 -bld_ml32.bat - @@ -255,7 +251,7 @@ bld_ml32.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions) true @@ -303,8 +299,8 @@ bld_ml32.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions) true @@ -327,7 +323,7 @@ bld_ml32.bat /MACHINE:I386 %(AdditionalOptions) - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibwapi.dll true false @@ -341,10 +337,6 @@ bld_ml32.bat $(OutDir)zlibwapi.lib - - cd ..\..\masmx86 -bld_ml32.bat - @@ -356,8 +348,8 @@ bld_ml32.bat Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) MultiThreadedDebugDLL @@ -377,7 +369,7 @@ bld_ml32.bat 0x040c - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibwapi.dll true .\zlibvc.def @@ -389,10 +381,6 @@ bld_ml32.bat $(OutDir)zlibwapi.lib MachineX64 - - cd ..\..\contrib\masmx64 -bld_ml64.bat - @@ -404,7 +392,7 @@ bld_ml64.bat Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) @@ -447,7 +435,7 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) true @@ -492,7 +480,7 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) true @@ -537,8 +525,8 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) true @@ -560,7 +548,7 @@ bld_ml64.bat 0x040c - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibwapi.dll true false @@ -572,10 +560,6 @@ bld_ml64.bat $(OutDir)zlibwapi.lib MachineX64 - - cd ..\..\masmx64 -bld_ml64.bat - @@ -587,7 +571,7 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) true @@ -632,14 +616,6 @@ bld_ml64.bat - - true - true - true - true - true - true - diff --git a/zlib/contrib/vstudio/vc12/testzlib.vcxproj b/zlib/contrib/vstudio/vc12/testzlib.vcxproj index 64b2cbe34a2..41303c0af48 100644 --- a/zlib/contrib/vstudio/vc12/testzlib.vcxproj +++ b/zlib/contrib/vstudio/vc12/testzlib.vcxproj @@ -190,7 +190,7 @@ Disabled ..\..\..;%(AdditionalIncludeDirectories) - ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) true Default MultiThreadedDebugDLL @@ -203,7 +203,7 @@ ProgramDatabase - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)testzlib.exe true $(OutDir)testzlib.pdb @@ -250,7 +250,7 @@ OnlyExplicitInline true ..\..\..;%(AdditionalIncludeDirectories) - ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) true Default MultiThreaded @@ -263,7 +263,7 @@ ProgramDatabase - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)testzlib.exe true Console @@ -279,14 +279,14 @@ ..\..\..;%(AdditionalIncludeDirectories) - ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) Default MultiThreadedDebugDLL false $(IntDir) - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) @@ -362,14 +362,14 @@ ..\..\..;%(AdditionalIncludeDirectories) - ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) Default MultiThreadedDLL false $(IntDir) - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) @@ -408,14 +408,6 @@ - - true - true - true - true - true - true - diff --git a/zlib/contrib/vstudio/vc12/zlib.rc b/zlib/contrib/vstudio/vc12/zlib.rc index 94758735069..cdd7985d41e 100644 --- a/zlib/contrib/vstudio/vc12/zlib.rc +++ b/zlib/contrib/vstudio/vc12/zlib.rc @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1, 2, 12, 0 - PRODUCTVERSION 1, 2, 12, 0 + FILEVERSION 1, 2, 13, 0 + PRODUCTVERSION 1, 2, 13, 0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,7 +17,7 @@ BEGIN BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.12\0" + VALUE "FileVersion", "1.2.13\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlibwapi.dll\0" VALUE "ProductName", "ZLib.DLL\0" diff --git a/zlib/contrib/vstudio/vc12/zlibstat.vcxproj b/zlib/contrib/vstudio/vc12/zlibstat.vcxproj index 3fdee7c5078..6629d8e2a3a 100644 --- a/zlib/contrib/vstudio/vc12/zlibstat.vcxproj +++ b/zlib/contrib/vstudio/vc12/zlibstat.vcxproj @@ -170,7 +170,7 @@ Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) @@ -196,8 +196,8 @@ OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -216,7 +216,7 @@ /MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions) - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibstat.lib true @@ -224,7 +224,7 @@ OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -254,7 +254,7 @@ Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) @@ -283,7 +283,7 @@ Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) @@ -312,8 +312,8 @@ OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) true @@ -332,7 +332,7 @@ /MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions) - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibstat.lib true @@ -343,7 +343,7 @@ OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) true @@ -373,7 +373,7 @@ OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) true @@ -403,7 +403,7 @@ OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) true @@ -437,14 +437,6 @@ - - true - true - true - true - true - true - diff --git a/zlib/contrib/vstudio/vc12/zlibvc.vcxproj b/zlib/contrib/vstudio/vc12/zlibvc.vcxproj index ab2b6c36035..4e0de691ef3 100644 --- a/zlib/contrib/vstudio/vc12/zlibvc.vcxproj +++ b/zlib/contrib/vstudio/vc12/zlibvc.vcxproj @@ -207,8 +207,8 @@ Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions) MultiThreadedDebugDLL @@ -229,7 +229,7 @@ /MACHINE:I386 %(AdditionalOptions) - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibwapi.dll true .\zlibvc.def @@ -243,10 +243,6 @@ $(OutDir)zlibwapi.lib - - cd ..\..\masmx86 -bld_ml32.bat - @@ -258,7 +254,7 @@ bld_ml32.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions) true @@ -306,8 +302,8 @@ bld_ml32.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions) true @@ -330,7 +326,7 @@ bld_ml32.bat /MACHINE:I386 %(AdditionalOptions) - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibwapi.dll true false @@ -345,10 +341,6 @@ bld_ml32.bat $(OutDir)zlibwapi.lib false - - cd ..\..\masmx86 -bld_ml32.bat - @@ -360,8 +352,8 @@ bld_ml32.bat Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) MultiThreadedDebugDLL @@ -381,7 +373,7 @@ bld_ml32.bat 0x040c - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibwapi.dll true .\zlibvc.def @@ -393,10 +385,6 @@ bld_ml32.bat $(OutDir)zlibwapi.lib MachineX64 - - cd ..\..\contrib\masmx64 -bld_ml64.bat - @@ -408,7 +396,7 @@ bld_ml64.bat Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) @@ -451,7 +439,7 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) true @@ -496,7 +484,7 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) true @@ -541,8 +529,8 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) true @@ -564,7 +552,7 @@ bld_ml64.bat 0x040c - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibwapi.dll true false @@ -576,10 +564,6 @@ bld_ml64.bat $(OutDir)zlibwapi.lib MachineX64 - - cd ..\..\masmx64 -bld_ml64.bat - @@ -591,7 +575,7 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) true @@ -636,14 +620,6 @@ bld_ml64.bat - - true - true - true - true - true - true - diff --git a/zlib/contrib/vstudio/vc14/testzlib.vcxproj b/zlib/contrib/vstudio/vc14/testzlib.vcxproj index 2c371252aeb..545204954dd 100644 --- a/zlib/contrib/vstudio/vc14/testzlib.vcxproj +++ b/zlib/contrib/vstudio/vc14/testzlib.vcxproj @@ -190,7 +190,7 @@ Disabled ..\..\..;%(AdditionalIncludeDirectories) - ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) true Default MultiThreadedDebugDLL @@ -203,7 +203,7 @@ ProgramDatabase - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)testzlib.exe true $(OutDir)testzlib.pdb @@ -250,7 +250,7 @@ OnlyExplicitInline true ..\..\..;%(AdditionalIncludeDirectories) - ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) true Default MultiThreaded @@ -263,7 +263,7 @@ ProgramDatabase - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)testzlib.exe true Console @@ -279,14 +279,14 @@ ..\..\..;%(AdditionalIncludeDirectories) - ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) Default MultiThreadedDebugDLL false $(IntDir) - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) @@ -362,14 +362,14 @@ ..\..\..;%(AdditionalIncludeDirectories) - ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) Default MultiThreadedDLL false $(IntDir) - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) @@ -408,14 +408,6 @@ - - true - true - true - true - true - true - diff --git a/zlib/contrib/vstudio/vc14/zlib.rc b/zlib/contrib/vstudio/vc14/zlib.rc index 94758735069..cdd7985d41e 100644 --- a/zlib/contrib/vstudio/vc14/zlib.rc +++ b/zlib/contrib/vstudio/vc14/zlib.rc @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1, 2, 12, 0 - PRODUCTVERSION 1, 2, 12, 0 + FILEVERSION 1, 2, 13, 0 + PRODUCTVERSION 1, 2, 13, 0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,7 +17,7 @@ BEGIN BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.12\0" + VALUE "FileVersion", "1.2.13\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlibwapi.dll\0" VALUE "ProductName", "ZLib.DLL\0" diff --git a/zlib/contrib/vstudio/vc14/zlibstat.vcxproj b/zlib/contrib/vstudio/vc14/zlibstat.vcxproj index 3e4b986392e..85c1e8958e6 100644 --- a/zlib/contrib/vstudio/vc14/zlibstat.vcxproj +++ b/zlib/contrib/vstudio/vc14/zlibstat.vcxproj @@ -170,7 +170,7 @@ Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) @@ -196,8 +196,8 @@ OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -216,7 +216,7 @@ /MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions) - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibstat.lib true @@ -224,7 +224,7 @@ OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -254,7 +254,7 @@ Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) @@ -283,7 +283,7 @@ Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) @@ -312,8 +312,8 @@ OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) true @@ -332,7 +332,7 @@ /MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions) - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibstat.lib true @@ -343,7 +343,7 @@ OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) true @@ -373,7 +373,7 @@ OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) true @@ -403,7 +403,7 @@ OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions) true @@ -437,14 +437,6 @@ - - true - true - true - true - true - true - diff --git a/zlib/contrib/vstudio/vc14/zlibvc.vcxproj b/zlib/contrib/vstudio/vc14/zlibvc.vcxproj index f8f673cb056..424ff55b7ed 100644 --- a/zlib/contrib/vstudio/vc14/zlibvc.vcxproj +++ b/zlib/contrib/vstudio/vc14/zlibvc.vcxproj @@ -207,8 +207,8 @@ Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions) MultiThreadedDebugDLL @@ -229,7 +229,7 @@ /MACHINE:I386 %(AdditionalOptions) - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibwapi.dll true .\zlibvc.def @@ -243,10 +243,6 @@ $(OutDir)zlibwapi.lib - - cd ..\..\masmx86 -bld_ml32.bat - @@ -258,7 +254,7 @@ bld_ml32.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions) true @@ -306,8 +302,8 @@ bld_ml32.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions) true @@ -330,7 +326,7 @@ bld_ml32.bat /MACHINE:I386 %(AdditionalOptions) - ..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibwapi.dll true false @@ -345,10 +341,6 @@ bld_ml32.bat $(OutDir)zlibwapi.lib false - - cd ..\..\masmx86 -bld_ml32.bat - @@ -360,8 +352,8 @@ bld_ml32.bat Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) MultiThreadedDebugDLL @@ -381,7 +373,7 @@ bld_ml32.bat 0x040c - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibwapi.dll true .\zlibvc.def @@ -393,10 +385,6 @@ bld_ml32.bat $(OutDir)zlibwapi.lib MachineX64 - - cd ..\..\contrib\masmx64 -bld_ml64.bat - @@ -408,7 +396,7 @@ bld_ml64.bat Disabled - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) @@ -451,7 +439,7 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) true @@ -496,7 +484,7 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) true @@ -541,8 +529,8 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) - _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions) + ..\..\..;%(AdditionalIncludeDirectories) + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) true @@ -564,7 +552,7 @@ bld_ml64.bat 0x040c - ..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies) + %(AdditionalDependencies) $(OutDir)zlibwapi.dll true false @@ -576,10 +564,6 @@ bld_ml64.bat $(OutDir)zlibwapi.lib MachineX64 - - cd ..\..\masmx64 -bld_ml64.bat - @@ -591,7 +575,7 @@ bld_ml64.bat OnlyExplicitInline - ..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories) + ..\..\..;%(AdditionalIncludeDirectories) _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions) true @@ -636,14 +620,6 @@ bld_ml64.bat - - true - true - true - true - true - true - diff --git a/zlib/contrib/vstudio/vc9/miniunz.vcproj b/zlib/contrib/vstudio/vc9/miniunz.vcproj index 7da32b91eaf..cc3d13a10c0 100644 --- a/zlib/contrib/vstudio/vc9/miniunz.vcproj +++ b/zlib/contrib/vstudio/vc9/miniunz.vcproj @@ -542,7 +542,7 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/zlib/contrib/vstudio/vc9/testzlibdll.vcproj b/zlib/contrib/vstudio/vc9/testzlibdll.vcproj index b1ddde05f98..6448b497cd5 100644 --- a/zlib/contrib/vstudio/vc9/testzlibdll.vcproj +++ b/zlib/contrib/vstudio/vc9/testzlibdll.vcproj @@ -542,7 +542,7 @@ @@ -343,8 +342,8 @@ @@ -418,7 +416,7 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/zlib/contrib/vstudio/vc9/zlibvc.vcproj b/zlib/contrib/vstudio/vc9/zlibvc.vcproj index c9a89471e70..f11dd1fbf3c 100644 --- a/zlib/contrib/vstudio/vc9/zlibvc.vcproj +++ b/zlib/contrib/vstudio/vc9/zlibvc.vcproj @@ -53,8 +53,8 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/zlib/crc32.c b/zlib/crc32.c index a1bdce5c23c..f8357b083f7 100644 --- a/zlib/crc32.c +++ b/zlib/crc32.c @@ -98,13 +98,22 @@ # endif #endif +/* If available, use the ARM processor CRC32 instruction. */ +#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8 +# define ARMCRC32 +#endif + /* Local functions. */ local z_crc_t multmodp OF((z_crc_t a, z_crc_t b)); local z_crc_t x2nmodp OF((z_off64_t n, unsigned k)); -/* If available, use the ARM processor CRC32 instruction. */ -#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8 -# define ARMCRC32 +#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE)) + local z_word_t byte_swap OF((z_word_t word)); +#endif + +#if defined(W) && !defined(ARMCRC32) + local z_crc_t crc_word OF((z_word_t data)); + local z_word_t crc_word_big OF((z_word_t data)); #endif #if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE)) @@ -630,7 +639,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) #endif /* DYNAMIC_CRC_TABLE */ /* Pre-condition the CRC */ - crc ^= 0xffffffff; + crc = (~crc) & 0xffffffff; /* Compute the CRC up to a word boundary. */ while (len && ((z_size_t)buf & 7) != 0) { @@ -645,8 +654,8 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) len &= 7; /* Do three interleaved CRCs to realize the throughput of one crc32x - instruction per cycle. Each CRC is calcuated on Z_BATCH words. The three - CRCs are combined into a single CRC after each set of batches. */ + instruction per cycle. Each CRC is calculated on Z_BATCH words. The + three CRCs are combined into a single CRC after each set of batches. */ while (num >= 3 * Z_BATCH) { crc1 = 0; crc2 = 0; @@ -749,7 +758,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) #endif /* DYNAMIC_CRC_TABLE */ /* Pre-condition the CRC */ - crc ^= 0xffffffff; + crc = (~crc) & 0xffffffff; #ifdef W @@ -1077,7 +1086,7 @@ uLong ZEXPORT crc32_combine64(crc1, crc2, len2) #ifdef DYNAMIC_CRC_TABLE once(&made, make_crc_table); #endif /* DYNAMIC_CRC_TABLE */ - return multmodp(x2nmodp(len2, 3), crc1) ^ crc2; + return multmodp(x2nmodp(len2, 3), crc1) ^ (crc2 & 0xffffffff); } /* ========================================================================= */ @@ -1086,7 +1095,7 @@ uLong ZEXPORT crc32_combine(crc1, crc2, len2) uLong crc2; z_off_t len2; { - return crc32_combine64(crc1, crc2, len2); + return crc32_combine64(crc1, crc2, (z_off64_t)len2); } /* ========================================================================= */ @@ -1103,14 +1112,14 @@ uLong ZEXPORT crc32_combine_gen64(len2) uLong ZEXPORT crc32_combine_gen(len2) z_off_t len2; { - return crc32_combine_gen64(len2); + return crc32_combine_gen64((z_off64_t)len2); } /* ========================================================================= */ -uLong crc32_combine_op(crc1, crc2, op) +uLong ZEXPORT crc32_combine_op(crc1, crc2, op) uLong crc1; uLong crc2; uLong op; { - return multmodp(op, crc1) ^ crc2; + return multmodp(op, crc1) ^ (crc2 & 0xffffffff); } diff --git a/zlib/deflate.c b/zlib/deflate.c index 799fb93cc04..4a689db3598 100644 --- a/zlib/deflate.c +++ b/zlib/deflate.c @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.12 Copyright 1995-2022 Jean-loup Gailly and Mark Adler "; + " deflate 1.2.13 Copyright 1995-2022 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -87,13 +87,7 @@ local void lm_init OF((deflate_state *s)); local void putShortMSB OF((deflate_state *s, uInt b)); local void flush_pending OF((z_streamp strm)); local unsigned read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); -#ifdef ASMV -# pragma message("Assembler code may have bugs -- use at your own risk") - void match_init OF((void)); /* asm code initialization */ - uInt longest_match OF((deflate_state *s, IPos cur_match)); -#else local uInt longest_match OF((deflate_state *s, IPos cur_match)); -#endif #ifdef ZLIB_DEBUG local void check_match OF((deflate_state *s, IPos start, IPos match, @@ -160,7 +154,7 @@ local const config configuration_table[10] = { * characters, so that a running hash key can be computed from the previous * key instead of complete recalculation each time. */ -#define UPDATE_HASH(s,h,c) (h = (((h)<hash_shift) ^ (c)) & s->hash_mask) +#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask) /* =========================================================================== @@ -191,9 +185,9 @@ local const config configuration_table[10] = { */ #define CLEAR_HASH(s) \ do { \ - s->head[s->hash_size-1] = NIL; \ + s->head[s->hash_size - 1] = NIL; \ zmemzero((Bytef *)s->head, \ - (unsigned)(s->hash_size-1)*sizeof(*s->head)); \ + (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \ } while (0) /* =========================================================================== @@ -285,6 +279,8 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, if (windowBits < 0) { /* suppress zlib wrapper */ wrap = 0; + if (windowBits < -15) + return Z_STREAM_ERROR; windowBits = -windowBits; } #ifdef GZIP @@ -314,7 +310,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, s->hash_bits = (uInt)memLevel + 7; s->hash_size = 1 << s->hash_bits; s->hash_mask = s->hash_size - 1; - s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); + s->hash_shift = ((s->hash_bits + MIN_MATCH-1) / MIN_MATCH); s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte)); s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos)); @@ -340,11 +336,11 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, * sym_buf value to read moves forward three bytes. From that symbol, up to * 31 bits are written to pending_buf. The closest the written pending_buf * bits gets to the next sym_buf symbol to read is just before the last - * code is written. At that time, 31*(n-2) bits have been written, just - * after 24*(n-2) bits have been consumed from sym_buf. sym_buf starts at - * 8*n bits into pending_buf. (Note that the symbol buffer fills when n-1 + * code is written. At that time, 31*(n - 2) bits have been written, just + * after 24*(n - 2) bits have been consumed from sym_buf. sym_buf starts at + * 8*n bits into pending_buf. (Note that the symbol buffer fills when n - 1 * symbols are written.) The closest the writing gets to what is unread is - * then n+14 bits. Here n is lit_bufsize, which is 16384 by default, and + * then n + 14 bits. Here n is lit_bufsize, which is 16384 by default, and * can range from 128 to 32768. * * Therefore, at a minimum, there are 142 bits of space between what is @@ -390,7 +386,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, /* ========================================================================= * Check for a valid deflate stream state. Return 0 if ok, 1 if not. */ -local int deflateStateCheck (strm) +local int deflateStateCheck(strm) z_streamp strm; { deflate_state *s; @@ -413,7 +409,7 @@ local int deflateStateCheck (strm) } /* ========================================================================= */ -int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) +int ZEXPORT deflateSetDictionary(strm, dictionary, dictLength) z_streamp strm; const Bytef *dictionary; uInt dictLength; @@ -482,7 +478,7 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) } /* ========================================================================= */ -int ZEXPORT deflateGetDictionary (strm, dictionary, dictLength) +int ZEXPORT deflateGetDictionary(strm, dictionary, dictLength) z_streamp strm; Bytef *dictionary; uInt *dictLength; @@ -504,7 +500,7 @@ int ZEXPORT deflateGetDictionary (strm, dictionary, dictLength) } /* ========================================================================= */ -int ZEXPORT deflateResetKeep (strm) +int ZEXPORT deflateResetKeep(strm) z_streamp strm; { deflate_state *s; @@ -542,7 +538,7 @@ int ZEXPORT deflateResetKeep (strm) } /* ========================================================================= */ -int ZEXPORT deflateReset (strm) +int ZEXPORT deflateReset(strm) z_streamp strm; { int ret; @@ -554,7 +550,7 @@ int ZEXPORT deflateReset (strm) } /* ========================================================================= */ -int ZEXPORT deflateSetHeader (strm, head) +int ZEXPORT deflateSetHeader(strm, head) z_streamp strm; gz_headerp head; { @@ -565,7 +561,7 @@ int ZEXPORT deflateSetHeader (strm, head) } /* ========================================================================= */ -int ZEXPORT deflatePending (strm, pending, bits) +int ZEXPORT deflatePending(strm, pending, bits) unsigned *pending; int *bits; z_streamp strm; @@ -579,7 +575,7 @@ int ZEXPORT deflatePending (strm, pending, bits) } /* ========================================================================= */ -int ZEXPORT deflatePrime (strm, bits, value) +int ZEXPORT deflatePrime(strm, bits, value) z_streamp strm; int bits; int value; @@ -674,36 +670,50 @@ int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) } /* ========================================================================= - * For the default windowBits of 15 and memLevel of 8, this function returns - * a close to exact, as well as small, upper bound on the compressed size. - * They are coded as constants here for a reason--if the #define's are - * changed, then this function needs to be changed as well. The return - * value for 15 and 8 only works for those exact settings. + * For the default windowBits of 15 and memLevel of 8, this function returns a + * close to exact, as well as small, upper bound on the compressed size. This + * is an expansion of ~0.03%, plus a small constant. * - * For any setting other than those defaults for windowBits and memLevel, - * the value returned is a conservative worst case for the maximum expansion - * resulting from using fixed blocks instead of stored blocks, which deflate - * can emit on compressed data for some combinations of the parameters. + * For any setting other than those defaults for windowBits and memLevel, one + * of two worst case bounds is returned. This is at most an expansion of ~4% or + * ~13%, plus a small constant. * - * This function could be more sophisticated to provide closer upper bounds for - * every combination of windowBits and memLevel. But even the conservative - * upper bound of about 14% expansion does not seem onerous for output buffer - * allocation. + * Both the 0.03% and 4% derive from the overhead of stored blocks. The first + * one is for stored blocks of 16383 bytes (memLevel == 8), whereas the second + * is for stored blocks of 127 bytes (the worst case memLevel == 1). The + * expansion results from five bytes of header for each stored block. + * + * The larger expansion of 13% results from a window size less than or equal to + * the symbols buffer size (windowBits <= memLevel + 7). In that case some of + * the data being compressed may have slid out of the sliding window, impeding + * a stored block from being emitted. Then the only choice is a fixed or + * dynamic block, where a fixed block limits the maximum expansion to 9 bits + * per 8-bit byte, plus 10 bits for every block. The smallest block size for + * which this can occur is 255 (memLevel == 2). + * + * Shifts are used to approximate divisions, for speed. */ uLong ZEXPORT deflateBound(strm, sourceLen) z_streamp strm; uLong sourceLen; { deflate_state *s; - uLong complen, wraplen; + uLong fixedlen, storelen, wraplen; - /* conservative upper bound for compressed data */ - complen = sourceLen + - ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5; + /* upper bound for fixed blocks with 9-bit literals and length 255 + (memLevel == 2, which is the lowest that may not use stored blocks) -- + ~13% overhead plus a small constant */ + fixedlen = sourceLen + (sourceLen >> 3) + (sourceLen >> 8) + + (sourceLen >> 9) + 4; - /* if can't get parameters, return conservative bound plus zlib wrapper */ + /* upper bound for stored blocks with length 127 (memLevel == 1) -- + ~4% overhead plus a small constant */ + storelen = sourceLen + (sourceLen >> 5) + (sourceLen >> 7) + + (sourceLen >> 11) + 7; + + /* if can't get parameters, return larger bound plus a zlib wrapper */ if (deflateStateCheck(strm)) - return complen + 6; + return (fixedlen > storelen ? fixedlen : storelen) + 6; /* compute wrapper length */ s = strm->state; @@ -740,11 +750,12 @@ uLong ZEXPORT deflateBound(strm, sourceLen) wraplen = 6; } - /* if not default parameters, return conservative bound */ + /* if not default parameters, return one of the conservative bounds */ if (s->w_bits != 15 || s->hash_bits != 8 + 7) - return complen + wraplen; + return (s->w_bits <= s->hash_bits ? fixedlen : storelen) + wraplen; - /* default settings: return tight bound for that case */ + /* default settings: return tight bound for that case -- ~0.03% overhead + plus a small constant */ return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + (sourceLen >> 25) + 13 - 6 + wraplen; } @@ -754,7 +765,7 @@ uLong ZEXPORT deflateBound(strm, sourceLen) * IN assertion: the stream state is correct and there is enough room in * pending_buf. */ -local void putShortMSB (s, b) +local void putShortMSB(s, b) deflate_state *s; uInt b; { @@ -801,7 +812,7 @@ local void flush_pending(strm) } while (0) /* ========================================================================= */ -int ZEXPORT deflate (strm, flush) +int ZEXPORT deflate(strm, flush) z_streamp strm; int flush; { @@ -856,7 +867,7 @@ int ZEXPORT deflate (strm, flush) s->status = BUSY_STATE; if (s->status == INIT_STATE) { /* zlib header */ - uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; + uInt header = (Z_DEFLATED + ((s->w_bits - 8) << 4)) << 8; uInt level_flags; if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2) @@ -1116,7 +1127,7 @@ int ZEXPORT deflate (strm, flush) } /* ========================================================================= */ -int ZEXPORT deflateEnd (strm) +int ZEXPORT deflateEnd(strm) z_streamp strm; { int status; @@ -1142,7 +1153,7 @@ int ZEXPORT deflateEnd (strm) * To simplify the source, this is not supported for 16-bit MSDOS (which * doesn't have enough memory anyway to duplicate compression states). */ -int ZEXPORT deflateCopy (dest, source) +int ZEXPORT deflateCopy(dest, source) z_streamp dest; z_streamp source; { @@ -1231,7 +1242,7 @@ local unsigned read_buf(strm, buf, size) /* =========================================================================== * Initialize the "longest match" routines for a new zlib stream */ -local void lm_init (s) +local void lm_init(s) deflate_state *s; { s->window_size = (ulg)2L*s->w_size; @@ -1252,11 +1263,6 @@ local void lm_init (s) s->match_length = s->prev_length = MIN_MATCH-1; s->match_available = 0; s->ins_h = 0; -#ifndef FASTEST -#ifdef ASMV - match_init(); /* initialize the asm code */ -#endif -#endif } #ifndef FASTEST @@ -1269,10 +1275,6 @@ local void lm_init (s) * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 * OUT assertion: the match length is not greater than s->lookahead. */ -#ifndef ASMV -/* For 80x86 and 680x0, an optimized version will be provided in match.asm or - * match.S. The code will be functionally equivalent. - */ local uInt longest_match(s, cur_match) deflate_state *s; IPos cur_match; /* current match */ @@ -1297,10 +1299,10 @@ local uInt longest_match(s, cur_match) */ register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; register ush scan_start = *(ushf*)scan; - register ush scan_end = *(ushf*)(scan+best_len-1); + register ush scan_end = *(ushf*)(scan + best_len - 1); #else register Bytef *strend = s->window + s->strstart + MAX_MATCH; - register Byte scan_end1 = scan[best_len-1]; + register Byte scan_end1 = scan[best_len - 1]; register Byte scan_end = scan[best_len]; #endif @@ -1318,7 +1320,8 @@ local uInt longest_match(s, cur_match) */ if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead; - Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, + "need lookahead"); do { Assert(cur_match < s->strstart, "no future"); @@ -1336,43 +1339,44 @@ local uInt longest_match(s, cur_match) /* This code assumes sizeof(unsigned short) == 2. Do not use * UNALIGNED_OK if your compiler uses a different size. */ - if (*(ushf*)(match+best_len-1) != scan_end || + if (*(ushf*)(match + best_len - 1) != scan_end || *(ushf*)match != scan_start) continue; /* It is not necessary to compare scan[2] and match[2] since they are * always equal when the other bytes match, given that the hash keys * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at - * strstart+3, +5, ... up to strstart+257. We check for insufficient + * strstart + 3, + 5, up to strstart + 257. We check for insufficient * lookahead only every 4th comparison; the 128th check will be made - * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is + * at strstart + 257. If MAX_MATCH-2 is not a multiple of 8, it is * necessary to put more guard bytes at the end of the window, or * to check more often for insufficient lookahead. */ Assert(scan[2] == match[2], "scan[2]?"); scan++, match++; do { - } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && - *(ushf*)(scan+=2) == *(ushf*)(match+=2) && + } while (*(ushf*)(scan += 2) == *(ushf*)(match += 2) && + *(ushf*)(scan += 2) == *(ushf*)(match += 2) && + *(ushf*)(scan += 2) == *(ushf*)(match += 2) && + *(ushf*)(scan += 2) == *(ushf*)(match += 2) && scan < strend); /* The funny "do {}" generates better code on most compilers */ - /* Here, scan <= window+strstart+257 */ - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + /* Here, scan <= window + strstart + 257 */ + Assert(scan <= s->window + (unsigned)(s->window_size - 1), + "wild scan"); if (*scan == *match) scan++; - len = (MAX_MATCH - 1) - (int)(strend-scan); + len = (MAX_MATCH - 1) - (int)(strend - scan); scan = strend - (MAX_MATCH-1); #else /* UNALIGNED_OK */ - if (match[best_len] != scan_end || - match[best_len-1] != scan_end1 || - *match != *scan || - *++match != scan[1]) continue; + if (match[best_len] != scan_end || + match[best_len - 1] != scan_end1 || + *match != *scan || + *++match != scan[1]) continue; - /* The check at best_len-1 can be removed because it will be made + /* The check at best_len - 1 can be removed because it will be made * again later. (This heuristic is not always a win.) * It is not necessary to compare scan[2] and match[2] since they * are always equal when the other bytes match, given that @@ -1382,7 +1386,7 @@ local uInt longest_match(s, cur_match) Assert(*scan == *match, "match[2]?"); /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. + * the 256th check will be made at strstart + 258. */ do { } while (*++scan == *++match && *++scan == *++match && @@ -1391,7 +1395,8 @@ local uInt longest_match(s, cur_match) *++scan == *++match && *++scan == *++match && scan < strend); - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + Assert(scan <= s->window + (unsigned)(s->window_size - 1), + "wild scan"); len = MAX_MATCH - (int)(strend - scan); scan = strend - MAX_MATCH; @@ -1403,9 +1408,9 @@ local uInt longest_match(s, cur_match) best_len = len; if (len >= nice_match) break; #ifdef UNALIGNED_OK - scan_end = *(ushf*)(scan+best_len-1); + scan_end = *(ushf*)(scan + best_len - 1); #else - scan_end1 = scan[best_len-1]; + scan_end1 = scan[best_len - 1]; scan_end = scan[best_len]; #endif } @@ -1415,7 +1420,6 @@ local uInt longest_match(s, cur_match) if ((uInt)best_len <= s->lookahead) return (uInt)best_len; return s->lookahead; } -#endif /* ASMV */ #else /* FASTEST */ @@ -1436,7 +1440,8 @@ local uInt longest_match(s, cur_match) */ Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); - Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); + Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, + "need lookahead"); Assert(cur_match < s->strstart, "no future"); @@ -1446,7 +1451,7 @@ local uInt longest_match(s, cur_match) */ if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1; - /* The check at best_len-1 can be removed because it will be made + /* The check at best_len - 1 can be removed because it will be made * again later. (This heuristic is not always a win.) * It is not necessary to compare scan[2] and match[2] since they * are always equal when the other bytes match, given that @@ -1456,7 +1461,7 @@ local uInt longest_match(s, cur_match) Assert(*scan == *match, "match[2]?"); /* We check for insufficient lookahead only every 8th comparison; - * the 256th check will be made at strstart+258. + * the 256th check will be made at strstart + 258. */ do { } while (*++scan == *++match && *++scan == *++match && @@ -1465,7 +1470,7 @@ local uInt longest_match(s, cur_match) *++scan == *++match && *++scan == *++match && scan < strend); - Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); + Assert(scan <= s->window + (unsigned)(s->window_size - 1), "wild scan"); len = MAX_MATCH - (int)(strend - scan); @@ -1501,7 +1506,7 @@ local void check_match(s, start, match, length) z_error("invalid match"); } if (z_verbose > 1) { - fprintf(stderr,"\\[%d,%d]", start-match, length); + fprintf(stderr,"\\[%d,%d]", start - match, length); do { putc(s->window[start++], stderr); } while (--length != 0); } } @@ -1547,9 +1552,9 @@ local void fill_window(s) /* If the window is almost full and there is insufficient lookahead, * move the upper half to the lower one to make room in the upper half. */ - if (s->strstart >= wsize+MAX_DIST(s)) { + if (s->strstart >= wsize + MAX_DIST(s)) { - zmemcpy(s->window, s->window+wsize, (unsigned)wsize - more); + zmemcpy(s->window, s->window + wsize, (unsigned)wsize - more); s->match_start -= wsize; s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ s->block_start -= (long) wsize; @@ -1680,7 +1685,7 @@ local void fill_window(s) * * deflate_stored() is written to minimize the number of times an input byte is * copied. It is most efficient with large input and output buffers, which - * maximizes the opportunites to have a single copy from next_in to next_out. + * maximizes the opportunities to have a single copy from next_in to next_out. */ local block_state deflate_stored(s, flush) deflate_state *s; @@ -1890,7 +1895,7 @@ local block_state deflate_fast(s, flush) if (s->lookahead == 0) break; /* flush the current block */ } - /* Insert the string window[strstart .. strstart+2] in the + /* Insert the string window[strstart .. strstart + 2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = NIL; @@ -1938,7 +1943,7 @@ local block_state deflate_fast(s, flush) s->strstart += s->match_length; s->match_length = 0; s->ins_h = s->window[s->strstart]; - UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]); + UPDATE_HASH(s, s->ins_h, s->window[s->strstart + 1]); #if MIN_MATCH != 3 Call UPDATE_HASH() MIN_MATCH-3 more times #endif @@ -1949,7 +1954,7 @@ local block_state deflate_fast(s, flush) } else { /* No match, output a literal byte */ Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); + _tr_tally_lit(s, s->window[s->strstart], bflush); s->lookahead--; s->strstart++; } @@ -1993,7 +1998,7 @@ local block_state deflate_slow(s, flush) if (s->lookahead == 0) break; /* flush the current block */ } - /* Insert the string window[strstart .. strstart+2] in the + /* Insert the string window[strstart .. strstart + 2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = NIL; @@ -2035,17 +2040,17 @@ local block_state deflate_slow(s, flush) uInt max_insert = s->strstart + s->lookahead - MIN_MATCH; /* Do not insert strings in hash table beyond this. */ - check_match(s, s->strstart-1, s->prev_match, s->prev_length); + check_match(s, s->strstart - 1, s->prev_match, s->prev_length); - _tr_tally_dist(s, s->strstart -1 - s->prev_match, + _tr_tally_dist(s, s->strstart - 1 - s->prev_match, s->prev_length - MIN_MATCH, bflush); /* Insert in hash table all strings up to the end of the match. - * strstart-1 and strstart are already inserted. If there is not + * strstart - 1 and strstart are already inserted. If there is not * enough lookahead, the last two strings are not inserted in * the hash table. */ - s->lookahead -= s->prev_length-1; + s->lookahead -= s->prev_length - 1; s->prev_length -= 2; do { if (++s->strstart <= max_insert) { @@ -2063,8 +2068,8 @@ local block_state deflate_slow(s, flush) * single literal. If there was a match but the current match * is longer, truncate the previous match to a single literal. */ - Tracevv((stderr,"%c", s->window[s->strstart-1])); - _tr_tally_lit(s, s->window[s->strstart-1], bflush); + Tracevv((stderr,"%c", s->window[s->strstart - 1])); + _tr_tally_lit(s, s->window[s->strstart - 1], bflush); if (bflush) { FLUSH_BLOCK_ONLY(s, 0); } @@ -2082,8 +2087,8 @@ local block_state deflate_slow(s, flush) } Assert (flush != Z_NO_FLUSH, "no flush?"); if (s->match_available) { - Tracevv((stderr,"%c", s->window[s->strstart-1])); - _tr_tally_lit(s, s->window[s->strstart-1], bflush); + Tracevv((stderr,"%c", s->window[s->strstart - 1])); + _tr_tally_lit(s, s->window[s->strstart - 1], bflush); s->match_available = 0; } s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1; @@ -2140,7 +2145,8 @@ local block_state deflate_rle(s, flush) if (s->match_length > s->lookahead) s->match_length = s->lookahead; } - Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); + Assert(scan <= s->window + (uInt)(s->window_size - 1), + "wild scan"); } /* Emit match if have run of MIN_MATCH or longer, else emit literal */ @@ -2155,7 +2161,7 @@ local block_state deflate_rle(s, flush) } else { /* No match, output a literal byte */ Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); + _tr_tally_lit(s, s->window[s->strstart], bflush); s->lookahead--; s->strstart++; } @@ -2195,7 +2201,7 @@ local block_state deflate_huff(s, flush) /* Output a literal byte */ s->match_length = 0; Tracevv((stderr,"%c", s->window[s->strstart])); - _tr_tally_lit (s, s->window[s->strstart], bflush); + _tr_tally_lit(s, s->window[s->strstart], bflush); s->lookahead--; s->strstart++; if (bflush) FLUSH_BLOCK(s, 0); diff --git a/zlib/deflate.h b/zlib/deflate.h index 17c226113b0..1a06cd5f25d 100644 --- a/zlib/deflate.h +++ b/zlib/deflate.h @@ -329,8 +329,8 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, # define _tr_tally_dist(s, distance, length, flush) \ { uch len = (uch)(length); \ ush dist = (ush)(distance); \ - s->sym_buf[s->sym_next++] = dist; \ - s->sym_buf[s->sym_next++] = dist >> 8; \ + s->sym_buf[s->sym_next++] = (uch)dist; \ + s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \ s->sym_buf[s->sym_next++] = len; \ dist--; \ s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ diff --git a/zlib/examples/enough.c b/zlib/examples/enough.c index 19cf08c1f97..8a3cade4923 100644 --- a/zlib/examples/enough.c +++ b/zlib/examples/enough.c @@ -486,7 +486,7 @@ local void enough(int syms) { // are 286, 9, and 15 respectively, for the deflate literal/length code. The // possible codes are counted for each number of coded symbols from two to the // maximum. The counts for each of those and the total number of codes are -// shown. The maximum number of inflate table entires is then calculated across +// shown. The maximum number of inflate table entries is then calculated across // all possible codes. Each new maximum number of table entries and the // associated sub-code (starting at root + 1 == 10 bits) is shown. // diff --git a/zlib/examples/fitblk.c b/zlib/examples/fitblk.c index c61de5c9967..68f56809d0c 100644 --- a/zlib/examples/fitblk.c +++ b/zlib/examples/fitblk.c @@ -17,7 +17,7 @@ data in order to determine how much of that input will compress to nearly the requested output block size. The first pass generates enough deflate blocks to produce output to fill the requested - output size plus a specfied excess amount (see the EXCESS define + output size plus a specified excess amount (see the EXCESS define below). The last deflate block may go quite a bit past that, but is discarded. The second pass decompresses and recompresses just the compressed data that fit in the requested plus excess sized @@ -109,7 +109,7 @@ local int recompress(z_streamp inf, z_streamp def) if (ret == Z_MEM_ERROR) return ret; - /* compress what was decompresed until done or no room */ + /* compress what was decompressed until done or no room */ def->avail_in = RAWLEN - inf->avail_out; def->next_in = raw; if (inf->avail_out != 0) diff --git a/zlib/examples/gun.c b/zlib/examples/gun.c index be44fa51ff5..bea5497e5c2 100644 --- a/zlib/examples/gun.c +++ b/zlib/examples/gun.c @@ -43,7 +43,7 @@ gun will also decompress files made by Unix compress, which uses LZW compression. These files are automatically detected by virtue of their magic header bytes. Since the end of Unix compress stream is marked by the - end-of-file, they cannot be concantenated. If a Unix compress stream is + end-of-file, they cannot be concatenated. If a Unix compress stream is encountered in an input file, it is the last stream in that file. Like gunzip and uncompress, the file attributes of the original compressed diff --git a/zlib/examples/gzappend.c b/zlib/examples/gzappend.c index d7eea3e97a5..23e93cf6899 100644 --- a/zlib/examples/gzappend.c +++ b/zlib/examples/gzappend.c @@ -33,7 +33,7 @@ * - Add L to constants in lseek() calls * - Remove some debugging information in error messages * - Use new data_type definition for zlib 1.2.1 - * - Simplfy and unify file operations + * - Simplify and unify file operations * - Finish off gzip file in gztack() * - Use deflatePrime() instead of adding empty blocks * - Keep gzip file clean on appended file read errors @@ -54,7 +54,7 @@ block boundary to facilitate locating and modifying the last block bit at the start of the final deflate block. Also whether using Z_BLOCK or not, another required feature of zlib 1.2.x is that inflate() now provides the - number of unusued bits in the last input byte used. gzappend will not work + number of unused bits in the last input byte used. gzappend will not work with versions of zlib earlier than 1.2.1. gzappend first decompresses the gzip file internally, discarding all but diff --git a/zlib/examples/gzlog.h b/zlib/examples/gzlog.h index 86f0cecba5b..4f051095561 100644 --- a/zlib/examples/gzlog.h +++ b/zlib/examples/gzlog.h @@ -40,7 +40,7 @@ its new size at that time. After each write operation, the log file is a valid gzip file that can decompressed to recover what was written. - The gzlog operations can be interupted at any point due to an application or + The gzlog operations can be interrupted at any point due to an application or system crash, and the log file will be recovered the next time the log is opened with gzlog_open(). */ diff --git a/zlib/examples/zran.c b/zlib/examples/zran.c index f279db71c78..879c47ccf74 100644 --- a/zlib/examples/zran.c +++ b/zlib/examples/zran.c @@ -21,7 +21,7 @@ An access point can be created at the start of any deflate block, by saving the starting file offset and bit of that block, and the 32K bytes of uncompressed data that precede that block. Also the uncompressed offset of - that block is saved to provide a referece for locating a desired starting + that block is saved to provide a reference for locating a desired starting point in the uncompressed stream. deflate_index_build() works by decompressing the input zlib or gzip stream a block at a time, and at the end of each block deciding if enough uncompressed data has gone by to diff --git a/zlib/gzlib.c b/zlib/gzlib.c index dddaf268730..55da46a453f 100644 --- a/zlib/gzlib.c +++ b/zlib/gzlib.c @@ -30,7 +30,7 @@ local gzFile gz_open OF((const void *, int, const char *)); The gz_strwinerror function does not change the current setting of GetLastError. */ -char ZLIB_INTERNAL *gz_strwinerror (error) +char ZLIB_INTERNAL *gz_strwinerror(error) DWORD error; { static char buf[1024]; diff --git a/zlib/gzread.c b/zlib/gzread.c index 884c9bfe4cf..dd77381596c 100644 --- a/zlib/gzread.c +++ b/zlib/gzread.c @@ -157,11 +157,9 @@ local int gz_look(state) the output buffer is larger than the input buffer, which also assures space for gzungetc() */ state->x.next = state->out; - if (strm->avail_in) { - memcpy(state->x.next, strm->next_in, strm->avail_in); - state->x.have = strm->avail_in; - strm->avail_in = 0; - } + memcpy(state->x.next, strm->next_in, strm->avail_in); + state->x.have = strm->avail_in; + strm->avail_in = 0; state->how = COPY; state->direct = 1; return 0; diff --git a/zlib/gzwrite.c b/zlib/gzwrite.c index a8ffc8f53da..eb8a0e5893f 100644 --- a/zlib/gzwrite.c +++ b/zlib/gzwrite.c @@ -474,7 +474,7 @@ int ZEXPORTVA gzprintf(gzFile file, const char *format, ...) #else /* !STDC && !Z_HAVE_STDARG_H */ /* -- see zlib.h -- */ -int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, +int ZEXPORTVA gzprintf(file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) gzFile file; const char *format; diff --git a/zlib/infback.c b/zlib/infback.c index a390c58e816..babeaf1806f 100644 --- a/zlib/infback.c +++ b/zlib/infback.c @@ -66,6 +66,7 @@ int stream_size; state->window = window; state->wnext = 0; state->whave = 0; + state->sane = 1; return Z_OK; } @@ -605,25 +606,27 @@ void FAR *out_desc; break; case DONE: - /* inflate stream terminated properly -- write leftover output */ + /* inflate stream terminated properly */ ret = Z_STREAM_END; - if (left < state->wsize) { - if (out(out_desc, state->window, state->wsize - left)) - ret = Z_BUF_ERROR; - } goto inf_leave; case BAD: ret = Z_DATA_ERROR; goto inf_leave; - default: /* can't happen, but makes compilers happy */ + default: + /* can't happen, but makes compilers happy */ ret = Z_STREAM_ERROR; goto inf_leave; } - /* Return unused input */ + /* Write leftover output and return unused input */ inf_leave: + if (left < state->wsize) { + if (out(out_desc, state->window, state->wsize - left) && + ret == Z_STREAM_END) + ret = Z_BUF_ERROR; + } strm->next_in = next; strm->avail_in = have; return ret; diff --git a/zlib/inflate.c b/zlib/inflate.c index 7be8c63662a..8acbef44e99 100644 --- a/zlib/inflate.c +++ b/zlib/inflate.c @@ -168,6 +168,8 @@ int windowBits; /* extract wrap request from windowBits parameter */ if (windowBits < 0) { + if (windowBits < -15) + return Z_STREAM_ERROR; wrap = 0; windowBits = -windowBits; } @@ -764,8 +766,9 @@ int flush; if (copy > have) copy = have; if (copy) { if (state->head != Z_NULL && - state->head->extra != Z_NULL) { - len = state->head->extra_len - state->length; + state->head->extra != Z_NULL && + (len = state->head->extra_len - state->length) < + state->head->extra_max) { zmemcpy(state->head->extra + len, next, len + copy > state->head->extra_max ? state->head->extra_max - len : copy); diff --git a/zlib/inftrees.c b/zlib/inftrees.c index 09462a740b1..57d2793bec9 100644 --- a/zlib/inftrees.c +++ b/zlib/inftrees.c @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.2.12 Copyright 1995-2022 Mark Adler "; + " inflate 1.2.13 Copyright 1995-2022 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -62,7 +62,7 @@ unsigned short FAR *work; 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 199, 202}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 194, 65}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, diff --git a/zlib/inftrees.h b/zlib/inftrees.h index baa53a0b1a1..f53665311c1 100644 --- a/zlib/inftrees.h +++ b/zlib/inftrees.h @@ -38,7 +38,7 @@ typedef struct { /* Maximum size of the dynamic table. The maximum number of code structures is 1444, which is the sum of 852 for literal/length codes and 592 for distance codes. These values were found by exhaustive searches using the program - examples/enough.c found in the zlib distribtution. The arguments to that + examples/enough.c found in the zlib distribution. The arguments to that program are the number of symbols, the initial root table size, and the maximum bit length of a code. "enough 286 9 15" for literal/length codes returns returns 852, and "enough 30 6 15" for distance codes returns 592. diff --git a/zlib/make_vms.com b/zlib/make_vms.com index 65e9d0cbc8e..4dc8a891355 100644 --- a/zlib/make_vms.com +++ b/zlib/make_vms.com @@ -14,9 +14,9 @@ $! 0.02 20061008 Adapt to new Makefile.in $! 0.03 20091224 Add support for large file check $! 0.04 20100110 Add new gzclose, gzlib, gzread, gzwrite $! 0.05 20100221 Exchange zlibdefs.h by zconf.h.in -$! 0.06 20120111 Fix missing amiss_err, update zconf_h.in, fix new exmples +$! 0.06 20120111 Fix missing amiss_err, update zconf_h.in, fix new examples $! subdir path, update module search in makefile.in -$! 0.07 20120115 Triggered by work done by Alexey Chupahin completly redesigned +$! 0.07 20120115 Triggered by work done by Alexey Chupahin completely redesigned $! shared image creation $! 0.08 20120219 Make it work on VAX again, pre-load missing symbols to shared $! image diff --git a/zlib/os400/README400 b/zlib/os400/README400 index 10f6c9d4018..c06fa8459a0 100644 --- a/zlib/os400/README400 +++ b/zlib/os400/README400 @@ -1,9 +1,9 @@ - ZLIB version 1.2.12 for OS/400 installation instructions + ZLIB version 1.2.13 for OS/400 installation instructions 1) Download and unpack the zlib tarball to some IFS directory. (i.e.: /path/to/the/zlib/ifs/source/directory) - If the installed IFS command suppors gzip format, this is straightforward, + If the installed IFS command supports gzip format, this is straightforward, else you have to unpack first to some directory on a system supporting it, then move the whole directory to the IFS via the network (via SMB or FTP). @@ -43,6 +43,6 @@ Notes: For OS/400 ILE RPG programmers, a /copy member defining the ZLIB Remember that most foreign textual data are ASCII coded: this implementation does not handle conversion from/to ASCII, so - text data code conversions must be done explicitely. + text data code conversions must be done explicitly. Mainly for the reason above, always open zipped files in binary mode. diff --git a/zlib/os400/bndsrc b/zlib/os400/bndsrc index 5e6e0a2f0af..9f92bb10cf3 100644 --- a/zlib/os400/bndsrc +++ b/zlib/os400/bndsrc @@ -116,4 +116,12 @@ STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB') EXPORT SYMBOL("inflateValidate") EXPORT SYMBOL("uncompress2") +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ +/* Version 1.2.12 additional entry points. */ +/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ + + EXPORT SYMBOL("crc32_combine_gen64") + EXPORT SYMBOL("crc32_combine_gen") + EXPORT SYMBOL("crc32_combine_op") + ENDPGMEXP diff --git a/zlib/os400/zlib.inc b/zlib/os400/zlib.inc index fda156bf958..c273c863c61 100644 --- a/zlib/os400/zlib.inc +++ b/zlib/os400/zlib.inc @@ -1,7 +1,7 @@ * ZLIB.INC - Interface to the general purpose compression library * * ILE RPG400 version by Patrick Monnerat, DATASPHERE. - * Version 1.2.12 + * Version 1.2.13 * * * WARNING: @@ -22,12 +22,12 @@ * * Versioning information. * - D ZLIB_VERSION C '1.2.12' + D ZLIB_VERSION C '1.2.13' D ZLIB_VERNUM C X'12a0' D ZLIB_VER_MAJOR C 1 D ZLIB_VER_MINOR C 2 D ZLIB_VER_REVISION... - D C 12 + D C 13 D ZLIB_VER_SUBREVISION... D C 0 * diff --git a/zlib/qnx/package.qpg b/zlib/qnx/package.qpg index badd1d5a0a7..ba2f1a2d6c3 100644 --- a/zlib/qnx/package.qpg +++ b/zlib/qnx/package.qpg @@ -25,10 +25,10 @@ - - - - + + + + @@ -63,7 +63,7 @@ - 1.2.12 + 1.2.13 Medium Stable diff --git a/zlib/test/example.c b/zlib/test/example.c index 949f4f6256f..1470bc842ee 100644 --- a/zlib/test/example.c +++ b/zlib/test/example.c @@ -555,7 +555,8 @@ int main(argc, argv) exit(1); } else if (strcmp(zlibVersion(), ZLIB_VERSION) != 0) { - fprintf(stderr, "warning: different zlib version\n"); + fprintf(stderr, "warning: different zlib version linked: %s\n", + zlibVersion()); } printf("zlib version %s = 0x%04x, compile flags = 0x%lx\n", diff --git a/zlib/test/minigzip.c b/zlib/test/minigzip.c index e22fb08c0a2..a649d2b3d9b 100644 --- a/zlib/test/minigzip.c +++ b/zlib/test/minigzip.c @@ -500,7 +500,7 @@ void file_uncompress(file) char *infile, *outfile; FILE *out; gzFile in; - unsigned len = strlen(file); + z_size_t len = strlen(file); if (len + strlen(GZ_SUFFIX) >= sizeof(buf)) { fprintf(stderr, "%s: filename too long\n", prog); diff --git a/zlib/treebuild.xml b/zlib/treebuild.xml index 781b4c98cc2..0017a45d3c5 100644 --- a/zlib/treebuild.xml +++ b/zlib/treebuild.xml @@ -1,6 +1,6 @@ - - + + zip compression library diff --git a/zlib/trees.c b/zlib/trees.c index f73fd99c37b..5f305c47221 100644 --- a/zlib/trees.c +++ b/zlib/trees.c @@ -193,7 +193,7 @@ local void send_bits(s, value, length) s->bits_sent += (ulg)length; /* If not enough room in bi_buf, use (valid) bits from bi_buf and - * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid)) + * (16 - bi_valid) bits from value, leaving (width - (16 - bi_valid)) * unused bits in value. */ if (s->bi_valid > (int)Buf_size - length) { @@ -256,7 +256,7 @@ local void tr_static_init() length = 0; for (code = 0; code < LENGTH_CODES-1; code++) { base_length[code] = length; - for (n = 0; n < (1< dist code (0..29) */ dist = 0; for (code = 0 ; code < 16; code++) { base_dist[code] = dist; - for (n = 0; n < (1<>= 7; /* from now on, all distances are divided by 128 */ for ( ; code < D_CODES; code++) { base_dist[code] = dist << 7; - for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) { + for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) { _dist_code[256 + dist++] = (uch)code; } } - Assert (dist == 256, "tr_static_init: 256+dist != 512"); + Assert (dist == 256, "tr_static_init: 256 + dist != 512"); /* Construct the codes of the static literal tree */ for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0; @@ -312,7 +312,7 @@ local void tr_static_init() } /* =========================================================================== - * Genererate the file trees.h describing the static trees. + * Generate the file trees.h describing the static trees. */ #ifdef GEN_TREES_H # ifndef ZLIB_DEBUG @@ -321,7 +321,7 @@ local void tr_static_init() # define SEPARATOR(i, last, width) \ ((i) == (last)? "\n};\n\n" : \ - ((i) % (width) == (width)-1 ? ",\n" : ", ")) + ((i) % (width) == (width) - 1 ? ",\n" : ", ")) void gen_trees_header() { @@ -458,7 +458,7 @@ local void pqdownheap(s, tree, k) while (j <= s->heap_len) { /* Set j to the smallest of the two sons: */ if (j < s->heap_len && - smaller(tree, s->heap[j+1], s->heap[j], s->depth)) { + smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) { j++; } /* Exit if v is smaller than both sons */ @@ -507,7 +507,7 @@ local void gen_bitlen(s, desc) */ tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */ - for (h = s->heap_max+1; h < HEAP_SIZE; h++) { + for (h = s->heap_max + 1; h < HEAP_SIZE; h++) { n = s->heap[h]; bits = tree[tree[n].Dad].Len + 1; if (bits > max_length) bits = max_length, overflow++; @@ -518,7 +518,7 @@ local void gen_bitlen(s, desc) s->bl_count[bits]++; xbits = 0; - if (n >= base) xbits = extra[n-base]; + if (n >= base) xbits = extra[n - base]; f = tree[n].Freq; s->opt_len += (ulg)f * (unsigned)(bits + xbits); if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits); @@ -530,10 +530,10 @@ local void gen_bitlen(s, desc) /* Find the first bit length which could increase: */ do { - bits = max_length-1; + bits = max_length - 1; while (s->bl_count[bits] == 0) bits--; - s->bl_count[bits]--; /* move one leaf down the tree */ - s->bl_count[bits+1] += 2; /* move one overflow item as its brother */ + s->bl_count[bits]--; /* move one leaf down the tree */ + s->bl_count[bits + 1] += 2; /* move one overflow item as its brother */ s->bl_count[max_length]--; /* The brother of the overflow item also moves one step up, * but this does not affect bl_count[max_length] @@ -569,7 +569,7 @@ local void gen_bitlen(s, desc) * OUT assertion: the field code is set for all tree elements of non * zero code length. */ -local void gen_codes (tree, max_code, bl_count) +local void gen_codes(tree, max_code, bl_count) ct_data *tree; /* the tree to decorate */ int max_code; /* largest code with non zero frequency */ ushf *bl_count; /* number of codes at each bit length */ @@ -583,13 +583,13 @@ local void gen_codes (tree, max_code, bl_count) * without bit reversal. */ for (bits = 1; bits <= MAX_BITS; bits++) { - code = (code + bl_count[bits-1]) << 1; + code = (code + bl_count[bits - 1]) << 1; next_code[bits] = (ush)code; } /* Check that the bit counts in bl_count are consistent. The last code * must be all ones. */ - Assert (code + bl_count[MAX_BITS]-1 == (1<heap_len = 0, s->heap_max = HEAP_SIZE; @@ -652,7 +652,7 @@ local void build_tree(s, desc) } desc->max_code = max_code; - /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, + /* The elements heap[heap_len/2 + 1 .. heap_len] are leaves of the tree, * establish sub-heaps of increasing lengths: */ for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n); @@ -700,7 +700,7 @@ local void build_tree(s, desc) * Scan a literal or distance tree to determine the frequencies of the codes * in the bit length tree. */ -local void scan_tree (s, tree, max_code) +local void scan_tree(s, tree, max_code) deflate_state *s; ct_data *tree; /* the tree to be scanned */ int max_code; /* and its largest code of non zero frequency */ @@ -714,10 +714,10 @@ local void scan_tree (s, tree, max_code) int min_count = 4; /* min repeat count */ if (nextlen == 0) max_count = 138, min_count = 3; - tree[max_code+1].Len = (ush)0xffff; /* guard */ + tree[max_code + 1].Len = (ush)0xffff; /* guard */ for (n = 0; n <= max_code; n++) { - curlen = nextlen; nextlen = tree[n+1].Len; + curlen = nextlen; nextlen = tree[n + 1].Len; if (++count < max_count && curlen == nextlen) { continue; } else if (count < min_count) { @@ -745,7 +745,7 @@ local void scan_tree (s, tree, max_code) * Send a literal or distance tree in compressed form, using the codes in * bl_tree. */ -local void send_tree (s, tree, max_code) +local void send_tree(s, tree, max_code) deflate_state *s; ct_data *tree; /* the tree to be scanned */ int max_code; /* and its largest code of non zero frequency */ @@ -758,11 +758,11 @@ local void send_tree (s, tree, max_code) int max_count = 7; /* max repeat count */ int min_count = 4; /* min repeat count */ - /* tree[max_code+1].Len = -1; */ /* guard already set */ + /* tree[max_code + 1].Len = -1; */ /* guard already set */ if (nextlen == 0) max_count = 138, min_count = 3; for (n = 0; n <= max_code; n++) { - curlen = nextlen; nextlen = tree[n+1].Len; + curlen = nextlen; nextlen = tree[n + 1].Len; if (++count < max_count && curlen == nextlen) { continue; } else if (count < min_count) { @@ -773,13 +773,13 @@ local void send_tree (s, tree, max_code) send_code(s, curlen, s->bl_tree); count--; } Assert(count >= 3 && count <= 6, " 3_6?"); - send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2); + send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2); } else if (count <= 10) { - send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3); + send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3); } else { - send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7); + send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7); } count = 0; prevlen = curlen; if (nextlen == 0) { @@ -807,8 +807,8 @@ local int build_bl_tree(s) /* Build the bit length tree: */ build_tree(s, (tree_desc *)(&(s->bl_desc))); - /* opt_len now includes the length of the tree representations, except - * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. + /* opt_len now includes the length of the tree representations, except the + * lengths of the bit lengths codes and the 5 + 5 + 4 bits for the counts. */ /* Determine the number of bit length codes to send. The pkzip format @@ -819,7 +819,7 @@ local int build_bl_tree(s) if (s->bl_tree[bl_order[max_blindex]].Len != 0) break; } /* Update opt_len to include the bit length tree and counts */ - s->opt_len += 3*((ulg)max_blindex+1) + 5+5+4; + s->opt_len += 3*((ulg)max_blindex + 1) + 5 + 5 + 4; Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", s->opt_len, s->static_len)); @@ -841,19 +841,19 @@ local void send_all_trees(s, lcodes, dcodes, blcodes) Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, "too many codes"); Tracev((stderr, "\nbl counts: ")); - send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */ - send_bits(s, dcodes-1, 5); - send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */ + send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */ + send_bits(s, dcodes - 1, 5); + send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */ for (rank = 0; rank < blcodes; rank++) { Tracev((stderr, "\nbl code %2d ", bl_order[rank])); send_bits(s, s->bl_tree[bl_order[rank]].Len, 3); } Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); - send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */ + send_tree(s, (ct_data *)s->dyn_ltree, lcodes - 1); /* literal tree */ Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); - send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */ + send_tree(s, (ct_data *)s->dyn_dtree, dcodes - 1); /* distance tree */ Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); } @@ -866,7 +866,7 @@ void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last) ulg stored_len; /* length of input block */ int last; /* one if this is the last block for a file */ { - send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */ + send_bits(s, (STORED_BLOCK<<1) + last, 3); /* send block type */ bi_windup(s); /* align on byte boundary */ put_short(s, (ush)stored_len); put_short(s, (ush)~stored_len); @@ -877,7 +877,7 @@ void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last) s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L; s->compressed_len += (stored_len + 4) << 3; s->bits_sent += 2*16; - s->bits_sent += stored_len<<3; + s->bits_sent += stored_len << 3; #endif } @@ -943,14 +943,17 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) max_blindex = build_bl_tree(s); /* Determine the best encoding. Compute the block lengths in bytes. */ - opt_lenb = (s->opt_len+3+7)>>3; - static_lenb = (s->static_len+3+7)>>3; + opt_lenb = (s->opt_len + 3 + 7) >> 3; + static_lenb = (s->static_len + 3 + 7) >> 3; Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, s->sym_next / 3)); - if (static_lenb <= opt_lenb) opt_lenb = static_lenb; +#ifndef FORCE_STATIC + if (static_lenb <= opt_lenb || s->strategy == Z_FIXED) +#endif + opt_lenb = static_lenb; } else { Assert(buf != (char*)0, "lost buf"); @@ -960,7 +963,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) #ifdef FORCE_STORED if (buf != (char*)0) { /* force stored block */ #else - if (stored_len+4 <= opt_lenb && buf != (char*)0) { + if (stored_len + 4 <= opt_lenb && buf != (char*)0) { /* 4: two words for the lengths */ #endif /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. @@ -971,21 +974,17 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) */ _tr_stored_block(s, buf, stored_len, last); -#ifdef FORCE_STATIC - } else if (static_lenb >= 0) { /* force static trees */ -#else - } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) { -#endif - send_bits(s, (STATIC_TREES<<1)+last, 3); + } else if (static_lenb == opt_lenb) { + send_bits(s, (STATIC_TREES<<1) + last, 3); compress_block(s, (const ct_data *)static_ltree, (const ct_data *)static_dtree); #ifdef ZLIB_DEBUG s->compressed_len += 3 + s->static_len; #endif } else { - send_bits(s, (DYN_TREES<<1)+last, 3); - send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1, - max_blindex+1); + send_bits(s, (DYN_TREES<<1) + last, 3); + send_all_trees(s, s->l_desc.max_code + 1, s->d_desc.max_code + 1, + max_blindex + 1); compress_block(s, (const ct_data *)s->dyn_ltree, (const ct_data *)s->dyn_dtree); #ifdef ZLIB_DEBUG @@ -1004,22 +1003,22 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) s->compressed_len += 7; /* align on byte boundary */ #endif } - Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, - s->compressed_len-7*last)); + Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len >> 3, + s->compressed_len - 7*last)); } /* =========================================================================== * Save the match info and tally the frequency counts. Return true if * the current block must be flushed. */ -int ZLIB_INTERNAL _tr_tally (s, dist, lc) +int ZLIB_INTERNAL _tr_tally(s, dist, lc) deflate_state *s; unsigned dist; /* distance of matched string */ - unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ + unsigned lc; /* match length - MIN_MATCH or unmatched char (dist==0) */ { - s->sym_buf[s->sym_next++] = dist; - s->sym_buf[s->sym_next++] = dist >> 8; - s->sym_buf[s->sym_next++] = lc; + s->sym_buf[s->sym_next++] = (uch)dist; + s->sym_buf[s->sym_next++] = (uch)(dist >> 8); + s->sym_buf[s->sym_next++] = (uch)lc; if (dist == 0) { /* lc is the unmatched char */ s->dyn_ltree[lc].Freq++; @@ -1031,7 +1030,7 @@ int ZLIB_INTERNAL _tr_tally (s, dist, lc) (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); - s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++; + s->dyn_ltree[_length_code[lc] + LITERALS + 1].Freq++; s->dyn_dtree[d_code(dist)].Freq++; } return (s->sym_next == s->sym_end); @@ -1061,7 +1060,7 @@ local void compress_block(s, ltree, dtree) } else { /* Here, lc is the match length - MIN_MATCH */ code = _length_code[lc]; - send_code(s, code+LITERALS+1, ltree); /* send the length code */ + send_code(s, code + LITERALS + 1, ltree); /* send length code */ extra = extra_lbits[code]; if (extra != 0) { lc -= base_length[code]; @@ -1177,6 +1176,6 @@ local void bi_windup(s) s->bi_buf = 0; s->bi_valid = 0; #ifdef ZLIB_DEBUG - s->bits_sent = (s->bits_sent+7) & ~7; + s->bits_sent = (s->bits_sent + 7) & ~7; #endif } diff --git a/zlib/uncompr.c b/zlib/uncompr.c index f03a1a865e3..f9532f46c1a 100644 --- a/zlib/uncompr.c +++ b/zlib/uncompr.c @@ -24,7 +24,7 @@ Z_DATA_ERROR if the input data was corrupted, including if the input data is an incomplete zlib stream. */ -int ZEXPORT uncompress2 (dest, destLen, source, sourceLen) +int ZEXPORT uncompress2(dest, destLen, source, sourceLen) Bytef *dest; uLongf *destLen; const Bytef *source; @@ -83,7 +83,7 @@ int ZEXPORT uncompress2 (dest, destLen, source, sourceLen) err; } -int ZEXPORT uncompress (dest, destLen, source, sourceLen) +int ZEXPORT uncompress(dest, destLen, source, sourceLen) Bytef *dest; uLongf *destLen; const Bytef *source; diff --git a/zlib/win32/README-WIN32.txt b/zlib/win32/README-WIN32.txt index 536cfec6f67..050197d80f7 100644 --- a/zlib/win32/README-WIN32.txt +++ b/zlib/win32/README-WIN32.txt @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.12 is a general purpose data compression library. All the code is +zlib 1.2.13 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) @@ -22,7 +22,7 @@ before asking for help. Manifest: -The package zlib-1.2.12-win32-x86.zip will contain the following files: +The package zlib-1.2.13-win32-x86.zip will contain the following files: README-WIN32.txt This document ChangeLog Changes since previous zlib packages diff --git a/zlib/win32/zlib1.rc b/zlib/win32/zlib1.rc index 234e641c329..ceb4ee5c69e 100644 --- a/zlib/win32/zlib1.rc +++ b/zlib/win32/zlib1.rc @@ -26,7 +26,7 @@ BEGIN VALUE "FileDescription", "zlib data compression library\0" VALUE "FileVersion", ZLIB_VERSION "\0" VALUE "InternalName", "zlib1.dll\0" - VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0" + VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0" VALUE "OriginalFilename", "zlib1.dll\0" VALUE "ProductName", "zlib\0" VALUE "ProductVersion", ZLIB_VERSION "\0" diff --git a/zlib/zconf.h b/zlib/zconf.h index 5e1d68a004e..bf977d3e70a 100644 --- a/zlib/zconf.h +++ b/zlib/zconf.h @@ -38,6 +38,9 @@ # define crc32 z_crc32 # define crc32_combine z_crc32_combine # define crc32_combine64 z_crc32_combine64 +# define crc32_combine_gen z_crc32_combine_gen +# define crc32_combine_gen64 z_crc32_combine_gen64 +# define crc32_combine_op z_crc32_combine_op # define crc32_z z_crc32_z # define deflate z_deflate # define deflateBound z_deflateBound @@ -349,6 +352,9 @@ # ifdef FAR # undef FAR # endif +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif # include /* No need for _export, use ZLIB.DEF instead. */ /* For complete Windows compatibility, use WINAPI, not __stdcall. */ @@ -467,11 +473,18 @@ typedef uLong FAR uLongf; # undef _LARGEFILE64_SOURCE #endif -#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) -# define Z_HAVE_UNISTD_H +#ifndef Z_HAVE_UNISTD_H +# ifdef __WATCOMC__ +# define Z_HAVE_UNISTD_H +# endif +#endif +#ifndef Z_HAVE_UNISTD_H +# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32) +# define Z_HAVE_UNISTD_H +# endif #endif #ifndef Z_SOLO -# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) +# if defined(Z_HAVE_UNISTD_H) # include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ # ifdef VMS # include /* for off_t */ diff --git a/zlib/zconf.h.cmakein b/zlib/zconf.h.cmakein index a7f24cce60f..247ba2461dd 100644 --- a/zlib/zconf.h.cmakein +++ b/zlib/zconf.h.cmakein @@ -40,6 +40,9 @@ # define crc32 z_crc32 # define crc32_combine z_crc32_combine # define crc32_combine64 z_crc32_combine64 +# define crc32_combine_gen z_crc32_combine_gen +# define crc32_combine_gen64 z_crc32_combine_gen64 +# define crc32_combine_op z_crc32_combine_op # define crc32_z z_crc32_z # define deflate z_deflate # define deflateBound z_deflateBound @@ -351,6 +354,9 @@ # ifdef FAR # undef FAR # endif +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif # include /* No need for _export, use ZLIB.DEF instead. */ /* For complete Windows compatibility, use WINAPI, not __stdcall. */ @@ -469,11 +475,18 @@ typedef uLong FAR uLongf; # undef _LARGEFILE64_SOURCE #endif -#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) -# define Z_HAVE_UNISTD_H +#ifndef Z_HAVE_UNISTD_H +# ifdef __WATCOMC__ +# define Z_HAVE_UNISTD_H +# endif +#endif +#ifndef Z_HAVE_UNISTD_H +# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32) +# define Z_HAVE_UNISTD_H +# endif #endif #ifndef Z_SOLO -# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) +# if defined(Z_HAVE_UNISTD_H) # include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ # ifdef VMS # include /* for off_t */ diff --git a/zlib/zconf.h.in b/zlib/zconf.h.in index 5e1d68a004e..bf977d3e70a 100644 --- a/zlib/zconf.h.in +++ b/zlib/zconf.h.in @@ -38,6 +38,9 @@ # define crc32 z_crc32 # define crc32_combine z_crc32_combine # define crc32_combine64 z_crc32_combine64 +# define crc32_combine_gen z_crc32_combine_gen +# define crc32_combine_gen64 z_crc32_combine_gen64 +# define crc32_combine_op z_crc32_combine_op # define crc32_z z_crc32_z # define deflate z_deflate # define deflateBound z_deflateBound @@ -349,6 +352,9 @@ # ifdef FAR # undef FAR # endif +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif # include /* No need for _export, use ZLIB.DEF instead. */ /* For complete Windows compatibility, use WINAPI, not __stdcall. */ @@ -467,11 +473,18 @@ typedef uLong FAR uLongf; # undef _LARGEFILE64_SOURCE #endif -#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) -# define Z_HAVE_UNISTD_H +#ifndef Z_HAVE_UNISTD_H +# ifdef __WATCOMC__ +# define Z_HAVE_UNISTD_H +# endif +#endif +#ifndef Z_HAVE_UNISTD_H +# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32) +# define Z_HAVE_UNISTD_H +# endif #endif #ifndef Z_SOLO -# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) +# if defined(Z_HAVE_UNISTD_H) # include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ # ifdef VMS # include /* for off_t */ diff --git a/zlib/zlib.3 b/zlib/zlib.3 index bcaebd9f02c..6f6e91404df 100644 --- a/zlib/zlib.3 +++ b/zlib/zlib.3 @@ -1,4 +1,4 @@ -.TH ZLIB 3 "27 Mar 2022" +.TH ZLIB 3 "13 Oct 2022" .SH NAME zlib \- compression/decompression library .SH SYNOPSIS @@ -105,7 +105,7 @@ before asking for help. Send questions and/or comments to zlib@gzip.org, or (for the Windows DLL version) to Gilles Vollant (info@winimage.com). .SH AUTHORS AND LICENSE -Version 1.2.12 +Version 1.2.13 .LP Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler .LP diff --git a/zlib/zlib.3.pdf b/zlib/zlib.3.pdf index 54d677ab01708639e04f9972ef20c52b00ba432d..8132d840c861ea6823b8ec0b41ee5050ea56ff15 100644 GIT binary patch literal 19366 zcmch<2Ut`|(=bYoA{iuzBRLN<3lRxHPyxTvpmr@^V_hRmRy7xM62u=U|8QR)KrK9mD|wATHNm zaBAurQo7o50Hm~(j?7&Umz%7do}!GLxQmswC&CU12TI(KR?hB7aY-Pl?v8YEN6Ond zz%R4^swO;s5D&=N;y#|37+3}FWP`K?2>>NpV1Nn|jsSt>9bibfEZoxB3N9gm=Y~YU zVUBoS*~La55g+AA{3rC^8b|0Z*m5^BgLmcLOczha^!9&vk}{2^c=shWhAmoyN?^}+ z>87O9;U}ITR^2*dwG=pN`r4X=|1nZsf^-OD{^<32$8@eMBJkjc%Ias5lZpGvrrbl^ z5=BR`y)zl!h7WZT`C|Gkd`tEo^zMxIP@SEOXQe&UnHh?@uxmPE@yqF%;7o8uO?lWm zPUU~NkTx*o+5KYYq~)PiEf%j!wX=I8r3S=~F5WC6YY| zQC~@v%Q$bJO#1S;V>`}u4?-{KPaFax-!*$bgr5f= z^eOn1+1GKmjRy!&LcWOUHcao&#eUu&`tlf$JH2mjuIee++0@_5t;6fv`ApJl69>AS zRNnIT{o|U)339JUPKFg^yIJmuk&`@vayK_9Sc*YQD@C*(p471&@(N*6YD&juZeDjW z>Ro%XrBug#93u7tCD+7?O8HBvM_B%2^=@tmMhI7Xy&Q&FGxiXDD;w;oyJA;OKs`8? ze+};@2&Xn`x9wgXZKnd7l%{qwKfMz;~A2zYU@VGRHiZK#7w+$ zwXsI?k3#Zr`tj zDWAnO=3)hfMLmM3dLJg}Q5e1;S-S3Kis?=0jFYB0SRqk`%42S7c7L+jfGM$Dh$3Dn z0@ET@#Cko!s*z2f_ffrAEW>d*!`4md0iqNoq1Z0m4+=ysp)5R;(}XVF$(Gc956xeo zQhg?8cBG`~O91myb<;shmrV1fH%S*+ux*7!L{VoRyfL`er?>3tIk`10zSj7a{tdLd z6l=JtJfX<3pBU^g5HR}W4VOvU1@|&FF^PEUgV<}$II|Im#%#r+Y@yP~+y?U>xn%qP zv9kCp{cxqqfO1MBGrIYMKxu0rO~ zSgsOL#w9%k>h&N5Su?v$=H|BtP*Oo+1rC1)$q3uLi~g%_!;WxWDbt&XHr7V?%wyiZbi zwdGPZ$@Jd)mfi;;^BRMfukZ}2Cb!o6Nrpe@7syPIE)s^Jl@OC)p;pw`G0s=je7d2p zTaV6&N^>vY7j#1SQR^dqLxj3hxiN7!CWl4hm(1;OC+tTGR;ix6bI>zt32uCIqwh(m zq1|2NxeO3wlZ)NqOokTcmt8k^FA$`&OQEdQL|J8haG6+8`tets57+oeg|}hJ)JGo! z$1~-sNp|<7tRSShtJ|HrZP9*x89R3$Khx>TaAs?}zzVcym8aKGcPm#$Ejgo0)Wjxl zX8`5*KsYOq9;iH_VGEk^xR~WN)hIowSg2{zOWGE;(cCXlUOh3>-+C+j;wYy+%%=48 zCj4EC=%Cp4r^5}3(+>^elen0-$V^All~7ARxTL6*^p|Q;egJtf8NAb3SbvT>)esCC zUz*iXf3%unaW{L?TSQ0l4!Ab0-i4Oa++KxUUu@67e3!>?3Q6vAw_XG*TI5+d3i!3y zP5d7#VAS-bi258$4B(yoT%10$iZU-;+ zH$N4^R-HHToqVb?M*W=^iD5`6H~H_ZWuQd8Ps@EN-DyiS@FI2ZOfz= z{JoIx7b!PH9!tZih&j3%|6-frhQ<4_5|QvyO(Xpi#P~A-y&Wwm-!r3?A-NJ2vt_Nf z*>mI?>*5Ag_&p$RhIz)Xqf}6~XcCEJC-wSGU0=y2iHPTl*Lbl^Vq(Zk+(vYY3oP)R zi=30$99rMqD|xs^pN^8fIr~M7M#Kyrd)LPO-Zdi*KL^pUitT+=W7ZdO^PMWTXb*zl z`SX{&7P&^HUoJ_UeXNl$sj1o^%BtIfm0uX1N;*Rv^R}rT@sXQ5=uCFOKzKD1v?QB( z^6K?7Rrv`ws)8r4>5XNUUatl%Ip16_dbBtBR^*O9?%;KH46>RHh6akk7Ff!)HrQI5 z%E2~*SPy;fhga9vAMTTN*GWl^(>645sT%9&6+(*V4VX0bl9P@<=?zFVj1oo`2iI5Y zzxZ;`hDSU%DXXUP*59HkcdRvQxT9 zF`P}y))r-`CF`Tc!*&W}i)5tP4~8=gukNn3DLGc@5uT`uqOcLyhiaT&W^ zY>PmRE6FGpz7Ct{>3B2YBbF#HSTm_HXIKmxLP;P?$WbX)52R&Hts$%46Bz#K|lkOeOlfX7#jld~M|zBL_<`F;fX$5EbaE z@5f|#cw-FJjnhif21u%Xx>r9X7{&XimnpKkmu6BM**-gG<6E4c2t?xK*|AA984}L- z&|nQmjBDNMd8@Z6Omd_s%Wd(R5Oy=T*w6CYD2I6_;nE6vnVQAQjbWvb71KszPPCiI zAM^>r56cM5(QM)tTvNMfpu^fThtuVyLPgFWTX`8NR+4q$lA!R$lN0=+@Yu5%C1)RH zblR=`z2gsd=$Ke6K|xif8;P8H5H5DxGDpQnYz~j|u!5rzK6oKYDqp}?}d4k(?M?WZoc35&eAj+<< zoMUaWr{lLxaFag=iP(0_Vd8z8y0<||H~QQN1~F=iJRd1in)lhYWYanq>Y0V-FsqOdkzBmb-tpWD2+6Y2EvNfl zAgzQgQnQ(y*4|nnxd$!j7Vf+d|0*4lg0C7EVLGT>WJ=_i6-Q)fj)e}yQE^x_qDaac z-T2%)k{IvW9kwe=8cggAklH`WT25WO&(1^FbS+xFzHQqewl030FO4sO1(TY@%KE?q zqP~qOSd{mpEs?a;Uk6~RmBTQh-rkI+j>EgVpFX;wIr0q^eE;+=p9vZUPQ=)+a$hRd zTuOYW%iX?^t@ng<9Ym-PSvQ|NQS>GX_V9>(EEF_*N6@KDVcukPm_^sK^+2(_G+A4H zjrqh@42`5&{NW&mCd4$IEs%@eq4)yLIFgAczBE?bO*~qY*|(NT<@`)O#(io1)NK-_o?*?~T@R7se8Mjus4_0*XSt3(1-Z)_ZsT+X6OlRYfV)U}xV$PDS{fp{JcJ z4-Jt&FgqeePl+>PI)7k)Ffj7_U@~Yqqm-74My4F$)pz?McAK=My?RW8Ab-rM-^a$L z&h<%~mWxV%Bz{O%t?10Php9vo)vMq0r_5Zb#3O~HC@xl=d>A7|awVm4@uJ<@MZO>3 z?#~H0vLCN9Hbx8P^RNFgOkkL(djG{nB?m^PqyM$xJH{dWk{j_Ervl23ywed}HEG=H zja>(sT)mIL87z-tDXm_g=&CcOAq3Ly-Bk+@*hjb?aGd@CTe`Vp!kw&sJr)9~%SXw} z2gu7SFTb!L-mfyqKc6!p|LQ^0-QZ*5M}f-+&ACCVah%&Irh?#Hp(iijyxfgns;+K4 z43>d0`mky(_r{zOOa;!4qDX1gnS29fVo=YNs^>W!k>WR-qn^ce_QJ?(X4XfQ(w{k; zvR&US9bAt*2{Uz|)Ay(~kG4|0Q8x%Hu1i+%5~*&#_|$Q{7FsHCcuRi+1z)R) z&739lX0Du-Qm=#CvpuKJKi;|UJ&%bRFkq_boO(}V@agn;<;>XQNtgsAIO1uex3ylTa5_rTKKLzr;F3nL8P>B=J;EMZR`X&aDVczl17X zfAS%*M?@IuWZ3fYutA#nUhz<8$>#IurbJ|_Gd&3>GdefVR$|-vqL$i1e{F9xB0w;BrCf_FW{2T_MDc;_d zRHk$vUtu=|6V0w5DxYl{&Q=d>PZ5ZwoIR)VX0FhblB6e1lrY4tB z_jSzyzu)Y&p65;bpuu^A6rp)p(YhdP#muSkuk)%K3_qkE7Mq$L+PGQ02b+1t| zZW=w}6qmE`2MTgJUfi~6VmwtBemg7YIvSC|Oa-x_sW{f!?>#0v%mbQuP7VI<7#bP-%8z4 zz(0zNOlVzQQz@JaSEeq)?|=K>bZ#zv73!c2HmvrsN);?h)GTuMJC z!}t`QT4bgF;qhB$sYR<)js+-eue#72TarORXOY0<-Fivsf_Sn?rD7r9qdf(W+?Zyn z&3KhpYYmUf_7d-dzs@M(Q0V1OmrTe*Ra|aU%id5CKJPzlN9+pgI6?41#C?>H1*^_?Xj3U)rQdyFn3sEB zJ8FkBEB2et+SWEoUmwL1sL@TFy0uk`%^D(zM0}84-qJ&?#9Y2>|uyexYKHFi$5rF0T*!Cw`ZkWp@QtURL z$8a=jJ0biIE!Y>G@AOhVExCx3tXt!3C2iTI`_*K0g|r6VI~Qc?WTuIK$r@&7A9!De zW~4}KR`wA4Lg|iAUmBExoleE^$+<_?HwW`-3BD(k=>cTSV)5KY`;6KHP6U25X3T8+ znN%NfywvVB`qik83eeiHF=yn^3WLcK^qQp$(db)+6yrD{IYn3`w3xo~n~ZnUxD;M( zK;B)G#3N0vmyAV^kUX%WebDUE{aNkX&E#8Le(N;1-mHF`NqhgjmZ!&WQ{%SjN41w( z9+6cK<5s-+Y1b1e$Jk@UCq8zkyNjl|SyF$*rTH|qeo??!@J&bK29Kri$xYQlkG{dl zSW^&*pv9mENK$9C0foVxNL4)7^voqesqV2)MERqG$){!&d))+-Bl^7JMngsNKZJ;0 zMbqG{Y)^45bJUnH*Skf#s$H0feq|;#_o84KE!wdb2xe1aBIP}R_XfN>0e>=MsiCt` z?$hXvAdN-AY&BtgT#3?2sqYy^cixds_$j?H0-yC$G#*PwkyHCBYVcCGFCiij(Q#u* z>!9Naal^)i2g-mK>kGE#Z#Q)*D9d+_vSQcq5{F@r?KY1L3H`B^9#KLhI5LK=<9K4e z*(e=~XHVIpY8AH7lGvh2zIepPeoZWqpO5rD%8kc_IU_HeCSfG6N(X}J8d+QTDEVT0 zY(&}OkS(+uAHDCz9`%aXQHiu>HRz)iEz=#%w4v?uIy`ymMT@13im>yjt8eB}z|YwY z5c5|L3L@Iycy4DPzOTwRntBhrP;P3Je^KkD?kh^UoJ_?KlHKk7%D~5_)wkDi(5JhJ z_2V90N0Q=%rv z>NfejMS6f>Z#;?AzDU@Qj{}ZWdHs={rrU}o;$#)Kb8OhLM`lt8<)tBW3yDc4?|wX- z`NrB-P7`Fqkj`|`C1#Sm?{%wa8ozYGHzC&F9^KDWAKNs|_c;yrJW<*@p~S67_D^&c zSb&v97k9FicOz?6662J=?AizA`qL%ref86`Tg-;{yZ&JiT&?t%76C+9koOOZfbTEI zvyQh59IOGefrC}yR(3FHXD^U34{%!m0tE>QLrw6&TFywo4GrP}pb&5;B#8IYM-3Fi z-JIPKmT)(~d#!>8x->_$@PMK} z?34c=*%ADs?!VZ%GLL@e=aS`1iHV5;Z2`msx{{9@2&`;pTVCxT&{KW%U3j)D|KrR8mTEck3 zKNEs@S1tKXh?n`FT>o2)OPaqhq+xFG%l-nZsLC4MRpqz~ckqBC?JQwj>J|=muI})w z-js#ASt9IQkj@AYpdFVCU1`rHBGBD-2sfmREerwTg@RRJztRvW6s&J&g|u}u#)Aq9 z0Z9Mt@8_M%U*L=P-ynV~`*mONN@%~81C;ssFYQ|3?_bckguVLmTw?sh{G$x|i}vMJ zh?n;#9KQhGPbl8Y5&-M3_FU!w8azCJ+RHfs`!#k>HbAqTq@3LB{>*E;TOcn7+ojAP ze|6kthyG_TsH*EJ%jy5t3)0RGR{!XN%R2u>7YGUeiypY71^oRBxn0Wr_pgA!rRE6& zeRo;Xo*t!5rcL`z$OCtkK3?04**k zLh{@$Kjf6Yu0W-TG9$3}R%?+5tu4e8lwFVpfBE!!s3{VB8d0@R~1PRk=DZ-FDZtqLO;(rrU$XkSAO8DxIKb@hvnjyF&;4^K6e27k@#ju?j-I^+sUgKS zbCF$&)PzGnPjlk5yY<9jJ;m#13$6KkT3wVeL8u`_APh!XIz^n@!jL;*VV)o$WB(fwKokF*v{Bq3<(uwrnQ{-O8J`NDv6CS&u%mzhKCCYwfw2R@S7e^TDM6fdJ z(dL1&J6(vSFo=R*I?zW=N@0-RekpGuIIqeH5+L@C9tg*1hng;Wa9oj&J%yZ8>JH!uJRc`S!{8U%9A#@L1(j}qQejapw z;)01YsWhc=krx`k(Jdr@kz_kzfB|&v)(~!n=rV zCjB~FmsSC1i)nIVPT`|2Iw6Bn+jouk?ei%_2F1s7nkrd7ia0dPSa4KePdjoN9fbW@ z!i`p+dyqjjw=uLb&PFrpw7q%oR7r%HEh;j6=kSOtm_rcjOgO_`SHWJ62z_&r#x3xH zeZSp!HtMmUm;dt68Sjd^siU{_yMm&RBQ#(f162X+$}D6 zfRtM2erP`f&WogHj)mSE9C-`JOQK!sU;RlXL!=c>O^4>h&EGzt>8yFBajh8H`L$R$ z>vZ(G{7_7M%2pW9jwBP6DzyqFUu8dkuQ1=&I7MBg>^_qfM{$Ki?>vT_ij#Ffi3F)O zrE#^xXvTMD9;rtKlN!?C;ytTl2aP*jEjt0>;!n9RgobU0KHlal7TjK}GkWJf4oiKB z*EpVYc*l8+k}LpMPuWDbc;_y=%3gbeQ z)e`zohtlv7geBHK_U9FN@8aHkqL0IoBuUOI9(cLhBuKm3U$Z>jAYdC>U()oR*-h?E zi=N1Y+y+`ABE!V-L+ZLxcgUm3SlS%|KIQzuQ_fC!!2pONF_xD@XSp3(7PP#+{EFT8 zN3`Wki6&x7 zXK$q5YDA^%-jcSj-T79#<9U0;04>ktyF~EG!wTBvJ#Mc&hqP-x-@DIV;inyMdxG%f z=UuHXn&dNti+QN%Z;Odaq&E9&{)M;FoO=-~!Zqy*b*>G-cM$j}Y$05-BOYn8J{_A#UD-Uv=>JRE`B@r9;; z*AnZo=)KQ@yv-ux$yyIFl+BA-k#6ao=}a)`m6Qoh8IbCFNj zg4yS@=3Jbkg3{L?BuzDDei=r2W>3d|vGM(xNnFP;I+tB)=&S6StVan_x@&#O{o=GoaL@Xtu0$8Svot;9E#)n0_C2aQv5|c?w|v%BlY7B5 z0@L%1XCA#EWll5VwR(HK$tK%W{Lgoy#E+2Q*<2$RL_qpCZaPR~yt+{@%=Zd=b^N3) zcY-*%!^;cNg}hl{`viHnY%MhJd&3#I-*n9EbEvrjDOp7voQ#CYrzE1uD=s?`SNjTuJTKC-`{z_1<+l6nf z8*u6&#Kn~WDW+602+s4fT-X-6xTA?OEJ19N(5BpapWA!-DSuP;v+)!od>V6T4;5U#+7W;4#~NnzcCrdQ>3R3Ny$Fr*dUGxecowxK$B z;*siHL{U7)?gndgKM$el*z2Ykiuof`opp!PEd#y-!m75c`0j+)t#Jeadmn41BR@O+ z_>_7wqP_Vnfqi>+{hJWsVBHIuh-i<(U|N$@ZhNj1(>Vieh~L*`lxEM|hnwPP`6RwR z^^)^5pLvrWSX=U@&lE_s&AT{Oh_^6a^MffM<~-o`MkXOlJ;+Jc(7~FEoex0?6mb_Q z8l-cweVP)l&bU%Y3kUoA`&8ZyC9RIrOG(~aEjykU%A`MPRuk*L7?6#)=%y05*%ZI^ zYD}${D&DtUAMsS{!Rz$I4d!|X|B`Lnk_Oej)!qPGkG#Hq$kDCGw-N;aGaa!1{*|G~`#;%<5P|<@C;n*~N`a*T^H3Hn z2UY;z1uFuEqAFMotPa)yYk{@FI$&L};ZIxeZ&u)yd*e4N@VBSqe{Tgscm;WXw*s~8 zRkZbKCDRUO1)fkSw}|wPREWju+#&XEK9b%+#ak7yWDeobDA38LcXwci@Q5>uL@N1_ ze;U4)lOJSjo}_9;({l*8Vl$cv>u&5eUf8KAdT{f*<{i$LJX<+EPx$-=ad$gdDE^xY z-x7J2!!iL?0e+Qt-d%<6myrxf;(fkQ2RAzRY43$fX#=Jn_8)KFynuqsCb}qdHTbT- z5$0yU?H)M1K1LWSBV7V+aH^xstao!bj;h%)JXUEtAB+olRNj}J^OVpW+*=~H!5qu> zIn|-b%8C1ZDSVM~t$5_($3@e~g?${+`ysO$>-oZ?u$N2&Ns0PZDyqhfMhU|@d<4B9 z$;AXT4I(^wEV7sfwpe&F^R~>H;q)U8FK;`STuXf1vMNTsXwhu)Nscfu0hvIO5K8w< zT;9sC&Uq<#kKLQ&-7ca`TeQ9gy&?a$GA->CX0QbZ!D2V-u)i9?aLQ3Wy4sT z&18J^s^k%Kv|#cOEUigW0_vv$Ja-6=G}U*q^8Lpp>5jut{g&=3%P9Aho4K$&w_Hyj ztr$xbO;h8)5W&6B@Di>M@b6JjShir=BJaAxPcMu6Y`wZtA8!1`olhyBT9^@MTE8=I zz$DkI-z5JrZpgGSx@h+9_4q+(-(9k7qIvDap;4jW^;L1|YlmLc9Cun`b8=8ZLmchU z!F9LVTPXDA{qo3SmrU{mm-&ll2%HOPvvL(X>_9VW&w^92?uc+=j&np+kBy+fA|XrY z456%~xm_wz?Pr1yyvI_B=Z9O~B+(DMh(GYcwx8jp8^Q(kJiFidb+cLXkSsJP_?>U2 zkDKbsf^%7RBkT}sqNcCkkF3iq`tc*Ao)PVmJ4y93BLty=Xibkhac*dYM5Ha0g73*w z11%@!v;Bi5NcehqLfZQc{{8kZ&>bHid^Xk6%wDzoI?IZX6eMxf!WAS{P_!#PpCiQ z29Mv*yN5R3x6sAnQ5lwC_J!RkLdWAm4IP!1vE_0MF}i=FmS-|3KSJc0p$W;Y`ceAU zrx^UGiX9TzhZ?O@$IB5qcO9m>+P3TL%|Y_G4;5PF(&yHf4Y{IXIO`Mo zr+wcUTi)j6;uu$oHBF@78$Z%4>u%J}AGBgok0W`w>CHet^%}#$3LBNgD{++j_zSC> z*24QE&cL?|QY~1W+r1{ZXEbIDY0VcZ6LC*AR?NOozMZL}RCeZWqw@8^)7vhXrT03( zdXIBI3b%;8BHkBEo=3t9YhBarW=#^VEqr#?CidpTyW}z{I2;)1-&cq*q`I;rks``F ztoZc(RC-UnCLi(!n(C=l4Q)vg*gxtw;u*Awm&;E zh$o>}$7`yn>p4PVF6zli=-FRuVKM! zt@eGtw8JZ5xSsFYhj&W-6P8R2=IG?*Smd6>CEW>gEDYc`rmliv7^hNc_1`(KMU`l? zeXhj|scKy@&Q0Mn*zJ#gV`m6EFQ@bw@SiHxQS3R-Ab4Yd%OQ1u6C(9!k9WU(T(dyl zEJr`?Bg^@iPm^bvf6uA^b1ezlq6E!w$3!lADvIv6g`Z#Vnaojp&~UW~Zr&hoP?O$* zK@cfy)=vg-2uvo#R+anHH{f`*CQ0v8XP-BfniCN&DuZn>Uq8rW~)p^EzTJ}l9a0apX=6dkL`athyR<4()@Gf(gW**4Zuc#>jQ=a zydM?_n58`&=>WF|azE2o?w~8Th=a4!FXxCA;2yEQau3;g04awnUx}@^i!Iyd ziLBw7H#99DY(1dHW~3$vSs+p+lclH6C+K_FAhVF}=~S9|5n!^z;x zAdYBrvG6O=(e$-tf)Xn}@e$8B6P3ly+Apt!RR;RG`wWv)bM2Sbp|dmhVZq~Bf_edL z0~Ez@qp8H$_T&du4(>|UPLuTeFO~+X3Q2g=&i3aooY`XvLrSfOb_X+4Z>~HWle9Um z3;NWx#Jd-=M;fZnd5!HZ9+%2>WnA@~42nl|Ev)xlzbB?YFkGMF{$esS+nBiunR0tD zvsAF&(-$s2PJ^VuL1bkjagE6qAT!&1$f5s}BF@|{rVt5ijcrdkgNv=iZzbl!!K zmaThSharSZ`aAp1Q=KWNABZg#zBs;8Meo4orahW`Ic*iA_~eaU5)E_bbv(KTCyjx8 zNflC+thcYSTC%u!Dg}L^UN7eku~rC7C65*!sz+u&)JAZ$7{xF8E|Kq5?gXYHJH2tqWt$?rpc&)$7RYX6Bq7sk9ET%(@*L{LUDoJrR?1)m){Qx`>#8W|V&~ z!aC1ma?JXP&+RXRlKtBHe8grIU~H91F=OsF1ySxKTyZ+p{7*?Im_Xt;rWA{kw~#u4cy! zbo#X-e#${9M13Z*krOu!TzM|=`IV#<<<^UT2y;Lu2AMr++jt%I+1!L{ZSXVfKkhTFikp%pI`ypX-vguS5* ze%U$nSyHGmm4hNF!eG5vm@paqWcG<{tY2g59VO^-eXFW4U}9%_lc*i_}JddJ-N) zdTH9@EWEt4D(=q@W@LifW~xPcm7M&lL;-Nz%Vx22dy>< zJua)h2VTkR&bzlZ!(zkCl3q44`uWf61geer341R;T1zz$rsJKYJV6?SR@5HPjpLC^ z^uvrhN{9W&@i}S~!%DNo3lMF1;0q`6Z0f4x)}IweM|lE zd74(kd;9tk)D6u3tnB#U?pbwG#t2PH$?;5!k-^h&8KYy)0^=%HoTCct#l?EBRUrij z2>*`8657(I*o>UA$jBf{^J{9Lwp(juniAG&AvXoqyK?);RR`i89~GGRLI@1{xD39?lO#LLsTc_dN-|rQwEyMosnrgM6p*>pzr(Bh46y8 zF~QEbZdmea*8}UIR@F=E^WjBk1HzE^ZcyNC|V#-gnZE3l@hbyYnQ-njWF`Gk;!+^X7i{>fk zk=2`unqn$k)*#O^{ELn!)}M>*``=kyUpAFCD{!P4Xxf>iK*LCGY~o?@)O_{g@C(tc zWJJUA-kZAIn-$wzZ31aqa~C=rdUa=PJ1r>aZ_LUWhtLh~F&sm2IF22$UUw<-#A z4ZQ7p{Q!RsJ5O=4-<2^{hVe_+3%+|XGPM!jZ$mH{gM`)0bL;$HOBgXkGzAfAJ`rfX zi{v;b32xV)LB?w9g!^kJP1)l1)6p|NpW~h9*Hg_(66ZC|5 z=Z+2^zPVnKICVG5qKbls5p7PT`rI+G02bEd)zFPf$YSUU@BUol{HCaIETj-=r5PqM zX;71q_hQSaej}-4l}M!B{c9Sw=hsgsOH{1yv#y_fQ@O>2?Sm^uDbcbsUwhhPr+Yin z|4n(5N4LCeX}fP#7j;B~K=;SuifD(CmzdE3QJ(QmA>HNylHhPg^t+sLafNmaToKAz@HPAu1K=12 ztRzYzt~oq3YXP+UdBp#5rS5_eS|4M3p6b(R_N4VMIQlA<>YEotqvrml#~NG0DHcoL z+i1DTNW-pRW-oO`oNc8?4b=E`hJ$d5Cq&UIgHwpC> z>SD4awQzi#A*ihT zNF&D$cjnGY|ImlsDcUBbT*ohIMjrmv2(*(Hf43VoWmGd_E~jq=bw%xo(|4^}L28eJ z)57sg##x z1#t$-hBBXbof%$f)uq6(C!UP49#SSR=j%NGZ0Zqyk51g()X62AB)+|zH6>B8$X#S4 z3PgwXa=Y5{V}H`C%9zmM_IE2^HH=Z}6I4HUZqG%O_L|o%6iv8pty$`p6u-GccT?PY!662d}awT>S}wZ-lUx=t(Ny(+?VUAeV**lqwAZBBFt0=4Ye^V zK8+)?8y;_}NrrQu4HJkwVon~5{)nm5aUOe^z|yEL6g!CXab`Fo32b+HA3~8l8Lg)JSqFa`=y^Y5AkgR z8|YH}%D#V567(}_N8e4T=>J;wJyhr}U#8W}tAi;j@zUaXeERH*VPm`+J^SV@)D0gl z_dp7Dobln$N!q*dMGRVn6g7m~p_1G-rgdHrvD??(u`GKRXtR61x0rQk$#|~HT87+B z(NTSdusnOQYYh43NqbknB!xWn@j!d?c(mASk517Z9WO#GF*M`i=9G<4lf;Z;4=SOD z2`mQ{CoTb_>JM(<qKT@(xtYTYD?euAp-(c#n=M zd2KX|iuGO&bsAB&==J$|G1I_X_;V-+MhLQrpz%G0UHAU6^^8b#;;)Y1o8QyD>&7R2 z73Urkh~)-zS{i+QrVtgeWdfa4yJ0gqTdW>C2d&`@WTMmT!d5n|SS;`g?|Z6{pz>*q z?Z&LdGt-M>9h<>=j-G%vzj^L;`H3_W#j3kv{3n%n_~v_INsbj zI6D~%@GQgHJ$$O*rN9|apr|eU+Pn=HAMJyMK0f4eXJV|$AVPDTx8wCaSDMrpGB6tB zA&C~AcQZ^P)4dYU*AEkPUJl47muwnoZ3l{;vF+A3CA69^g4f1L`y6@3C6Rba9ayfxXR?{>U-J`m+x{@^fI`{AQ|WkyXtZ&+ZxXE}t(rXV*K zE}z6L_=Y8B4~j=BjP+ZPxQV;p1o=zJ=M+}rKGv&3c}FoP-i#4j#KnfbsR5*JEMFv| zyO*apYOpyr%ahxR@eZ&ep%vWcZ}Xhg@VU^;8-B4d{})vo>H*L7 zO1C()p3WU`P-C?xb}#6M#0_%jeX?XcJKa~4pXIupotA6#`7@rszZ0j0i7!sE6$vCmr{9BkhHr2 z8+ucXGB@}K0gf~eU9de4MjWb}MCR5D0o_UbM*>uBy)b7%73O1f*oHNaBTg&sO~LL~ z!+>^l`NJsVD0p_6Cz&A5fX$*`o|jN&a@PFhHNu|9j@0c){?FUh=W4~adG(EcYpMgx z$g`dBjWlPvjszobgCNT;d`e;lP{KE)cDy^m>z)&lT-x-=(jFU6V^6yKI@U9p$uu3z zF)CRREH7?Eh3F_QfCvh^a~22jza{bT-WJub58POOD)G5=J=pRZw-M-`R4L_?gju32 zaR^I_zRJDylvd7hsLy$?2+#e15pE`;($6D#tumh(@3%&q$Ml@ru!qf16-(~##Z6;< zko4X9%sSE3t)k^d*HwDaNE-a`Sa3YL&$_c!xhP-M>@1JgtDfFfyoK7^hUO@VDNlMW zu%pO=a%4NypFjA_-VNlOw8h{ZQ6pKhP-6%7RgX(#McLRM{@hJXl`K;oG@%m8ABe>o zS{5LnEZ_GulOn4oo2?Py&Z-YjtySC(qkTQ37Y~@sY6u^= zqZJHl%lfCQ5b*Q;eT(alc-X(9dkj=n{s`@XK!o`JbRdaIdI4cX zfX@wN0k^Sp5@-3^*2x00vl3^~=U3%Xb&-MF+THa*z_oqUbS!=BErqREBqi{~Bw@fI zDL9uG%!SMP>Kz+yARr)0oL)vtMV|f=z)Qr-(Zvx6%LREkIykwBc!{%Ip@;zK%VIDK z=n4dBFV141ssTbeJ3H9h0l~lA!rTxp2rnnd8UX}wc{(HPK@e^M7Jwwe%34GV2#fwn z5XgzM*dmcGB4Dtmrzf{3FSj$o1`H7v76$V`!B8j{0Kw(v?SzDRaXGm$0QFrl0tB!B zf#&4KeZ>3>lHUS0Cv$pAM1I=n#h zfRqRj&TZvx2}g*tC}^mF6l|T{kUs-|K@c8p9^jt^{HtOAhx!0v{`dNT9{9z#7yu)p z3Pj9Wd&>f0<`PgIKn4&VAihlp3KiiI5P=AB@d%3W@Q8u`0}|*h096KfDGKnClz)Nx z8{}`O&Ilc#4<&36&eql-55OCGDLM!@M3@`;v&Jj5Ur=J;OQHVO=zl2&n2W0F|1Jne z$4k|^gcFf0@>yAe;STW2D&2rifdGtHS&CRYBOGB!K>b}@fEdB6H|c-@ z-C&Ur18ySi0B5(vm1;{lAb%zt>@Jl|!~y1HBhKQ*Wd*l}xjP_PBy^pwpsjw&&cRON zXW|ME{1>hNBH61VVCVos2LCxQCGbH1mp=dZ2>mr10o(ZEES{Hh%|ABuf1B+77+KSO73!;QSvTeyK0(e^YQa35j3l z4ZIL=Yar?t%8PfYSwBA@K(ToFLDryOWdcwkAm;k=19JLR229Dqz-f-ZmGKAwto~;i zzc4`QKj3&ELV!&Ej>{{=2kiL&y-X0o|DU)JC`1t0mH0cHfDj)LlKr0VfCkhRY+s`%gFl9>M>V0S~W`z(08A7rs0m@*nj0c>YnZ5ab{ALU;r( zOEZTNHaG-xdz;PaD;8@P(mJSH4 z=w$5-0xG*a&!Z>{G8W^LmzEWf737nWlM<8>=8=+z^7Hcv0C|2vVL6D5l*IoT!sPNC Zj2jY$Kwc>oL`aYy3cQd@PF)`F{{hl>t`h(N delta 6912 zcmb7GcU)81wiX1$C?JS{NEeWvgd`;N5<-um1*J(1(tB^AN=G2lrAhA~pwg5oO#}p_ zC{5{IKtK?9I5YRn+?n@&@7?v!+2`BeYWwVU)+$IQibGLysmm(}f`y;}uCDdR&*JOk z@3inah1~p1NIraKzM*N`sfn{0Q?U!=25!i@m@ilQ*=svLS z9yt3r@3WhEOeuG7-j&KC{~nk6CP{yPhY>ix7q#~3`bms&s<|#x&Dw^t_Pj(Z=HO22 z3~;)s>GHGmn=aD*6=xBZSA6@ULg>OZ-TjPk7w_vLnzW47%v8=~zC*H9ujRi?Q}cR4 zU+*vd%Far(r{?K&uNV1Q=iIZ(x~CS{m=9%bepSgnnR2o%p3C=cA$qs1y0G+t-ese?0muE>yG6D6^vyE76? zF7|`gJ%at(&q-1Jj>9&*R23cR8o;NVkF5RZ`)j^?W&GHHYo_so9-;Ha2ZniXO7H55 z3S{hb1ad7mw7;<59O2NQ-W71kUP9>=4IH~on6*c``AwAdp7gRehi_|gXMMAwzR{*< zHr6N!RV7yLqBN{CU3l%iir`3)h){!)CR-3aE!-V&u_d%S_xHx)?Mm%R)na%UJtfhe z2@m%Vsq(jWx-ZJc7vn_I-E|YHZD&}H8j45WI_9Vp3(R?$<{ntwSJ`nSx2cS!?F&-X zKp1T8^KDq(Ys4jSS`PqW&XJ@2pCM8awckkuhH-9a-RqUs;s27wJp=^$>pR@LOdd+$<(!2WgT}m6nyw>7M0o2 zS{PgRl0*=#t--j%a2F&c*8gnHw$QP<0;(TgqvWwUhXaa&i>DJd0dv_U{@!9Cl!Rykt{5YUx zOy*}2cN8(bP9A3=Y~#ulW&9m;otF^DRPPv;dt50=Kl56%!H%*^O0W#WPqoLJoROX^ z+ykR?fgSkI#H<=_jY%sb>HS~Tuf)7I(}r}beR*}PVLj+@R;M9g{Un?~#esR{DDQDl zK8>D7wuU109Iul<{lPu!F|++L$W%b$J2bh3R(*0SKANv+J61*}%#1<1c%2y390K?n zL<15E0*NEB$4F z5ri59<&CNvT#14#D2^h}Dn!Q$|*6SO-9PuoRc{qo@cVmzIsD> zoFKfdrJM5omtp;putW_ZO>8^ji;4B9{C55hm&gZCb;eeIE3U`hWHIZK{E`XXWItli z6Q0tTJ*k?BuIyqB8n(V29!u{^PV!|1{IoZR0cT^zf8D4tq( zdo+KX$SdyG24He)OAbb#JD|(9HN~L#mnuu|Q7kL3-xZ`tweqX4G7IR0n#46#S0x;* zTuprErr3LgEnvN;Q48kK!-e#+4)aSVhr8j)gww*=qp@l;+2dRBmQ-zu?w+wAc z^6up9#;8%RM8~RT*Zu4&Ko-H9#f+mkK3kslg>tlz_->XsZC8Cm(kY~hQ{VN&^Ymop zaZfUPEgb&455+_a6ZtpNWo^C1}9~43m3iGK`K#FGyrvJ(O(T)Bk89 zNAq*RSzAtFqwFkxHdR_j`S$JJ3H;)ScAsqRC05ES6c4p3L)zJFb~V- z|1A2smo*sEa)tD6zmPAr$|Lp?ouHEW*;zQbQs>w*iKYVrsu|bo5`UpuQUt%xQt+&C z(EBP|^w(mIWhs*(N-ophm1U$eoUO|1VXH{Oo1F3_<9ju$Ujk3oO>Zk-Xv|-Y;bpt8 z+KOXoCrz~}4Vuwo1$~2-q@yR)k2T;8m2AW|_$Ecvcw6(u)BtOHi$drzpJ8SSyT*I7 z!dew+4c~=}e$9@-mufR`XU+J)SSF9kIBCB($EWM-r>Fi&DLXBfg4KL`vTGdZzkm5| zkqclL1u{=DiCT(}Rt;wG86A9zA&ywJP)ohpRTN<1NJpg+*0w=?82Sk(pHlR4B0kgF zK*vB#BR+>t3gP^G7q|A4mKHj}#v?gb~Hw0q*czOr#!Q#5*Yp$f$ zJ#gZ6_(Rmk$?5wkhBBP>tAU#1rasf>d)M1;jW|{@cp#?dLo`3DF{+7&X}!1%6m`Y#3}d$mAQn zl6wVi?X`R&kM=7TA04s8=WHBx4XPg+oei=3R^%OyTfjmN92l}G)-_Z+7sv z?mWJ!Sl-zY#_{wO6^zsSV_W#9`7`#8i_&Mr*rk(qbd-EiEH6v zJU_9uVhsEKnk*fI@7>QkjOXI{*B%MHH|#om{0Hhx3dpT2jtb=i~->z{LA879r4 zwE{oOX1w(z3wv+({!6keNFr)Xm}fWpS>NXM{HEfOA~K%3HR~D(WFk-9ke7)N+D_U! zI-cQ9#-L4}rRi!txL)z9HZzxrGYVe|mlT#~2D0SfLqa-u4VlGGuF>mA|E#muDd!Dj zLyy@`dmxkM32EC$UxETG^jImNma6x6YgSVx9BSS{bIWIl#aDK;uh>>j0IY?VtZXGH zr`ee~ki2!Yf%JlEq$i6%kLK_F`~hU|^pwKco4dF=<4o)T=PL(OYk&wFi0#)CA_4+2 z{|f{||3D=qfND7Vhpv`vU|4()Cqaiw75}~6ug!gm&$w~4FcHK$aj3;Kj=3eEw9>ig zggYQlQc4P8|HP!jr|K0_INWP;dvo>r_Ws#fD2Kb{8I>)0HpKekbC= zzqOxnc2)6fY51#XEb(!=U~^z+e1l`-;e`cLFFV(_&d5cak{=~!W~HYVympxrJ&wU*lWkbACcE zz56m3rW)2Wr>e9jw$gLL^iT2dH|25_PlO-dE=&b<4G(y)Xg}dS&V2tO`=^_&+gLT( zI8!V(;`-g%+gCi}@=^^?Sf*>G5?D!eR~OvyB8uDwjm2393lx@7FG#DYjrH%D4Iki|F#Fw}&*RGau7?)s- zT;+PNcNfd2MVZa&oZ&LB4*b`rQ{gnK(w|8kOpUJG*uCI6VBl{?#L!AKMnLg0CBYKV zv&MB$T|sdz0fYx!CnLMlqPHgGbqf+iSa=oycN^)72QczqZ10UEk1WL8?)OtT; zn4?8MT9vPMqkk^@)3bN{Nvy4>bvWAh1Om$qFDjl!+ywuVfv3^wzNuHiULfJ>7wS6A z3K8EGP zOTIB{U}z-)Z;TRNg7AT-?KE1N0y44y7J^BqR#d~Rt(htYRTQT5pie-#r=m6c`bZ#DH6j3;>gm^-YKAw-nP97FS0Y!x=(moDw?H{B|^V`RnUoS$hZN)i^1@p{ouY|jfS@vHF zuUg|GTVX&3@h9F<)v2&t{Gn3*qP~(g4NK=`2wwucLkDZWe_c%d%oJ~CJ?>0(iq9$+ z*m|qS!QJnAYsi04JLE~mqY}rwr2H85PBSyG@MOa#& zikHFQHFu$n`JodJJL2}{EG^#h!j@Y z(!3>_kLDhbd@af}vCfm+UrR3Wb!n_t7mpkuN;hBF6)}05!SAr>)?loHjdsfw+ORDIs!I* z@rsF^C_ahP#b*scoUY@RjN<+uku!ms^QhhqePYL<9;+(B0s3O!)+W%#H;;zbVL!quCca|{@f2YT` zk775uHxe%t*I)8KsE|3in!d)*64t62V1Q4{SQij_HzfD4i4`+*osCWYq``qv2jh3W zzm{t(&{AXHm7<>3De)UhqtGHDTfWKXWOb(Ko=vz|TY$S`2i7d_;uHz7Ng+BVQ7#E^=F^bJbEkI~cwCneM?hJqP%b*{X6GbP^S zbl+M3ZQ;&bWwK9#6;-IU(o$-#tgFXDaJ>4}SFh&H$6Tb$493|UlNYkaMgzwdGPmB!B0BPqf*r1Nn7Ur+Z29I|z%mjppLHtTB6iIM z-tWEG-`BsIb$BeD*KN1=N9(5lvv-4Gf3#_^C>%z(LvMEz<>{)Zf&;`#q+;FpWvBLK>oxZr-J4^+b0y5n4}%uEC^rnXj2Zn)pm z__YThu&^)?8X0MC{z;N^ur>c11Ntk@|JCeY$Uv06nS;5N{X;e|g22ea#0~z7=I@91 z2LUK=WnqDH#@UCW_$IZ>kTnr=%7Y0E^z=Ajt z2tp7Hwtx$Q&PC7!0fU<2aH3$4DfkY74W&dPDkKah5Gk_$M~ZPMX-W`8P#CTahKYei z#6ZG?DU{&fAqEA%|Hx{xf&%CNC-DC?+!_wWe4^hIeXm3Z06~P|U>I2BJm^g&hQGdE zQ$`Sh2+GP#c(BNMDf|*Pdp5vt3lIVf{Rbuj5bN}Z8frI`L zAq);XFVJ7|=gEjbp#Lx^0)hV%6M_CS5%{mm{x5s3&L&p2IOp>MQw5xV30_rJLpf2X zoG1thL4al9a5)r2UK9jFf)ENwusjs00FsxI_&*tjfb*Y)i>ryVtEV&00)P+}g#oy@ JP#6Wke*x#FFIE5m diff --git a/zlib/zlib.h b/zlib/zlib.h index 4a98e38bf34..953cb5012dc 100644 --- a/zlib/zlib.h +++ b/zlib/zlib.h @@ -1,5 +1,5 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.12, March 11th, 2022 + version 1.2.13, October 13th, 2022 Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler @@ -37,11 +37,11 @@ extern "C" { #endif -#define ZLIB_VERSION "1.2.12" -#define ZLIB_VERNUM 0x12c0 +#define ZLIB_VERSION "1.2.13" +#define ZLIB_VERNUM 0x12d0 #define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MINOR 2 -#define ZLIB_VER_REVISION 12 +#define ZLIB_VER_REVISION 13 #define ZLIB_VER_SUBREVISION 0 /* @@ -276,7 +276,7 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); == 0), or after each call of deflate(). If deflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. See deflatePending(), - which can be used if desired to determine whether or not there is more ouput + which can be used if desired to determine whether or not there is more output in that case. Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to @@ -660,7 +660,7 @@ ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm, to dictionary. dictionary must have enough space, where 32768 bytes is always enough. If deflateGetDictionary() is called with dictionary equal to Z_NULL, then only the dictionary length is returned, and nothing is copied. - Similary, if dictLength is Z_NULL, then it is not set. + Similarly, if dictLength is Z_NULL, then it is not set. deflateGetDictionary() may return a length less than the window size, even when more than the window size in input has been provided. It may return up @@ -915,7 +915,7 @@ ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, to dictionary. dictionary must have enough space, where 32768 bytes is always enough. If inflateGetDictionary() is called with dictionary equal to Z_NULL, then only the dictionary length is returned, and nothing is copied. - Similary, if dictLength is Z_NULL, then it is not set. + Similarly, if dictLength is Z_NULL, then it is not set. inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the stream state is inconsistent. @@ -1437,12 +1437,12 @@ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, In the event that the end of file is reached and only a partial item is available at the end, i.e. the remaining uncompressed data length is not a - multiple of size, then the final partial item is nevetheless read into buf + multiple of size, then the final partial item is nevertheless read into buf and the end-of-file flag is set. The length of the partial item read is not provided, but could be inferred from the result of gztell(). This behavior is the same as the behavior of fread() implementations in common libraries, but it prevents the direct use of gzfread() to read a concurrently written - file, reseting and retrying on end-of-file, when size is not 1. + file, resetting and retrying on end-of-file, when size is not 1. */ ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len)); @@ -1913,7 +1913,7 @@ ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int)); -ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp)); +ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF((z_streamp)); ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); #if defined(_WIN32) && !defined(Z_SOLO) diff --git a/zlib/zlib2ansi b/zlib/zlib2ansi index 15e3e165f37..23b2a1d5a3e 100755 --- a/zlib/zlib2ansi +++ b/zlib/zlib2ansi @@ -8,7 +8,7 @@ # TODO # -# Asumes no function pointer parameters. unless they are typedefed. +# Assumes no function pointer parameters. unless they are typedefed. # Assumes no literal strings that look like function definitions # Assumes functions start at the beginning of a line @@ -104,7 +104,7 @@ sub StripComments no warnings; - # Strip C & C++ coments + # Strip C & C++ comments # From the perlfaq $_[0] =~ diff --git a/zlib/zutil.c b/zlib/zutil.c index dcab28a0d51..9543ae825e3 100644 --- a/zlib/zutil.c +++ b/zlib/zutil.c @@ -61,9 +61,11 @@ uLong ZEXPORT zlibCompileFlags() #ifdef ZLIB_DEBUG flags += 1 << 8; #endif + /* #if defined(ASMV) || defined(ASMINF) flags += 1 << 9; #endif + */ #ifdef ZLIB_WINAPI flags += 1 << 10; #endif @@ -119,7 +121,7 @@ uLong ZEXPORT zlibCompileFlags() # endif int ZLIB_INTERNAL z_verbose = verbose; -void ZLIB_INTERNAL z_error (m) +void ZLIB_INTERNAL z_error(m) char *m; { fprintf(stderr, "%s\n", m); @@ -214,7 +216,7 @@ local ptr_table table[MAX_PTR]; * a protected system like OS/2. Use Microsoft C instead. */ -voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size) +voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) { voidpf buf; ulg bsize = (ulg)items*size; @@ -240,7 +242,7 @@ voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size) return buf; } -void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) +void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) { int n; @@ -277,13 +279,13 @@ void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) # define _hfree hfree #endif -voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size) +voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, uInt items, uInt size) { (void)opaque; return _halloc((long)items, size); } -void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) +void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) { (void)opaque; _hfree(ptr); @@ -302,7 +304,7 @@ extern voidp calloc OF((uInt items, uInt size)); extern void free OF((voidpf ptr)); #endif -voidpf ZLIB_INTERNAL zcalloc (opaque, items, size) +voidpf ZLIB_INTERNAL zcalloc(opaque, items, size) voidpf opaque; unsigned items; unsigned size; @@ -312,7 +314,7 @@ voidpf ZLIB_INTERNAL zcalloc (opaque, items, size) (voidpf)calloc(items, size); } -void ZLIB_INTERNAL zcfree (opaque, ptr) +void ZLIB_INTERNAL zcfree(opaque, ptr) voidpf opaque; voidpf ptr; { diff --git a/zlib/zutil.h b/zlib/zutil.h index d9a20ae1bf4..0bc7f4ecd1c 100644 --- a/zlib/zutil.h +++ b/zlib/zutil.h @@ -193,6 +193,7 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0) ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t)); #endif /* common defaults */ From c6e58a8d173b7e9689952d07678ba79702ba8021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 21 Apr 2023 11:05:44 +0300 Subject: [PATCH 151/260] MDEV-30753 fixup: Unsafe buffer page restoration trx_purge_free_segment(): The buffer-fix only prevents a block from being freed completely from the buffer pool, but it will not prevent the block from being evicted. Recheck the page identifier after acquiring an exclusive page latch. If it has changed, backtrack and invoke buf_page_get_gen() to look up the page normally. --- storage/innobase/trx/trx0purge.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index 38438108480..b22a85f4646 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -367,19 +367,30 @@ void trx_purge_free_segment(mtr_t &mtr, trx_rseg_t* rseg, fil_addr_t hdr_addr) block->frame, &mtr)) { block->fix(); + const page_id_t id{block->page.id()}; mtr.commit(); /* NOTE: If the server is killed after the log that was produced up to this point was written, and before the log from the mtr.commit() in our caller is written, then the pages belonging to the undo log will become unaccessible garbage. - This does not matters when using multiple innodb_undo_tablespaces; + This does not matter when using multiple innodb_undo_tablespaces; innodb_undo_log_truncate=ON will be able to reclaim the space. */ log_free_check(); mtr.start(); ut_ad(rw_lock_s_lock_nowait(block->debug_latch, __FILE__, __LINE__)); rw_lock_x_lock(&block->lock); - mtr_memo_push(&mtr, block, MTR_MEMO_PAGE_X_FIX); + if (UNIV_UNLIKELY(block->page.id() != id)) + { + block->unfix(); + rw_lock_x_unlock(&block->lock); + ut_d(rw_lock_s_unlock(block->debug_latch)); + block= buf_page_get(id, 0, RW_X_LATCH, &mtr); + if (!block) + return; + } + else + mtr_memo_push(&mtr, block, MTR_MEMO_PAGE_X_FIX); } while (!fseg_free_step(TRX_UNDO_SEG_HDR + TRX_UNDO_FSEG_HEADER + From e55e761eae707e47e86af1899335c777e194fdd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 21 Apr 2023 16:49:59 +0300 Subject: [PATCH 152/260] MDEV-31084 assert(waiting) failed in TP_connection_generic::wait_end buf_flush_wait_flushed(): Correct the logic for registering a wait around buf_flush_wait() that commit a091d6ac4e7d2d7873749e685943b3032ccfda57 recently broke. This should be easily repeatable when using a non-default startup parameter: thread-handling=pool-of-threads --- storage/innobase/buf/buf0flu.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 3ef70741da1..75286d9d33b 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -1905,9 +1905,13 @@ ATTRIBUTE_COLD void buf_flush_wait_flushed(lsn_t sync_lsn) } else #endif + { + thd_wait_begin(nullptr, THD_WAIT_DISKIO); + tpool::tpool_wait_begin(); buf_flush_wait(sync_lsn); - - thd_wait_end(nullptr); + tpool::tpool_wait_end(); + thd_wait_end(nullptr); + } } mysql_mutex_unlock(&buf_pool.flush_list_mutex); From 46af63bfe202b62a5665e1aa09d069b5b5613249 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 10 Apr 2023 11:35:38 +0400 Subject: [PATCH 153/260] MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset MDEV-28769 earlier disabled the use if IDs with non-default collations in statements like: SET character_set_results=2/*latin2_czech_cs*/; SET character_set_client=2/*latin2_czech_cs*/; SET character_set_server=2/*latin2_czech_cs*/; SET character_set_connection=2/*latin2_czech_cs*/; MDEV-30824 later fixed "mysqlbinlog" to dump character set names instead of IDs in these statements: < SET @@session.character_set_client=33, ... /*!*/; > SET @@session.character_set_client=utf8mb3, ... /*!*/; However, mysqlbinlog from old (pre MDEV-30824) distributions can still produce incorrect statements with numeric non-default collation IDs. New servers should still be able to load old dumps. Allowing the use of "SET @@character_set_xxx=ID" with numeric non-default collation IDs but only if: - the current THD is a true slave thread or - the current THD a pseudo slave thread (loading a mysqlbinlog output). --- .../r/character_set_client_basic.result | 11 +++++++++ .../r/character_set_connection_basic.result | 16 +++++++++++++ .../r/character_set_results_basic.result | Bin 16427 -> 16895 bytes .../r/character_set_server_basic.result | 16 +++++++++++++ .../t/character_set_client_basic.test | 9 +++++++ .../t/character_set_connection_basic.test | 13 +++++++++++ .../t/character_set_results_basic.test | 12 ++++++++++ .../t/character_set_server_basic.test | 12 ++++++++++ sql/sys_vars.cc | 22 ++++++++++++++---- 9 files changed, 107 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/character_set_client_basic.result b/mysql-test/suite/sys_vars/r/character_set_client_basic.result index d62d88027c7..14c8bcfd058 100644 --- a/mysql-test/suite/sys_vars/r/character_set_client_basic.result +++ b/mysql-test/suite/sys_vars/r/character_set_client_basic.result @@ -500,5 +500,16 @@ res # SET GLOBAL character_set_client=2; ERROR 42000: Unknown character set: '2' +# +# MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset +# +SET @@pseudo_slave_mode=1; +SET character_set_client=2/*latin2_czech_cs*/; +SHOW VARIABLES LIKE 'character_set_client'; +Variable_name Value +character_set_client latin2 +SET @@pseudo_slave_mode=0; +Warnings: +Warning 1231 Slave applier execution mode not active, statement ineffective. SET @@global.character_set_client = @global_start_value; SET @@session.character_set_client = @session_start_value; diff --git a/mysql-test/suite/sys_vars/r/character_set_connection_basic.result b/mysql-test/suite/sys_vars/r/character_set_connection_basic.result index e356d62ed2b..bbb4f4e5f75 100644 --- a/mysql-test/suite/sys_vars/r/character_set_connection_basic.result +++ b/mysql-test/suite/sys_vars/r/character_set_connection_basic.result @@ -494,5 +494,21 @@ SELECT @@session.character_set_connection = WHERE VARIABLE_NAME='character_set_connection') AS res; res 1 +# +# MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset +# +SET character_set_connection=2/*latin2_czech_cs*/; +ERROR 42000: Unknown character set: '2' +SET @@pseudo_slave_mode=1; +SET character_set_connection=2/*latin2_czech_cs*/; +SHOW VARIABLES LIKE 'character_set_connection'; +Variable_name Value +character_set_connection latin2 +SHOW VARIABLES LIKE 'collation_connection'; +Variable_name Value +collation_connection latin2_general_ci +SET @@pseudo_slave_mode=0; +Warnings: +Warning 1231 Slave applier execution mode not active, statement ineffective. SET @@global.character_set_connection = @global_start_value; SET @@global.character_set_client = @save_character_set_client; diff --git a/mysql-test/suite/sys_vars/r/character_set_results_basic.result b/mysql-test/suite/sys_vars/r/character_set_results_basic.result index d1c6a52ba177c0b07efa3ba653ea42c1025b3e94..1346c8b42cac7e5b1b44f33f851388c23d7d2573 100644 GIT binary patch delta 394 zcmZ`#!AiqG5Tz7^TMSrJvW*$7g?C)vIuQVLQz>F-aFDxZupAAOj$#(Qf4R zumPu8J2J>IP~jJ#V-O3J%w- zdlf4iFK=ex3@4-E`PiPqcywi_@16ZhPj_g<=sibQ&=56;@&xsily}$K#`0eSv!~B! zB(fCo$={?At4*|Neg)7)_9=`2pU_JblLGR)iZ5ij*b*BME2=O=p@0bt0xW1_lbxlh-*00su)N2a*5) diff --git a/mysql-test/suite/sys_vars/r/character_set_server_basic.result b/mysql-test/suite/sys_vars/r/character_set_server_basic.result index e0a13c729fe..7445be6aef1 100644 --- a/mysql-test/suite/sys_vars/r/character_set_server_basic.result +++ b/mysql-test/suite/sys_vars/r/character_set_server_basic.result @@ -486,5 +486,21 @@ SELECT @@session.character_set_server = WHERE VARIABLE_NAME='character_set_server') AS res; res 1 +# +# MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset +# +SET character_set_server=2/*latin2_czech_cs*/; +ERROR 42000: Unknown character set: '2' +SET @@pseudo_slave_mode=1; +SET character_set_server=2/*latin2_czech_cs*/; +SHOW VARIABLES LIKE 'character_set_server'; +Variable_name Value +character_set_server latin2 +SHOW VARIABLES LIKE 'collation_server'; +Variable_name Value +collation_server latin2_general_ci +SET @@pseudo_slave_mode=0; +Warnings: +Warning 1231 Slave applier execution mode not active, statement ineffective. SET @@global.character_set_server = @global_start_value; SET @@session.character_set_server = @session_start_value; diff --git a/mysql-test/suite/sys_vars/t/character_set_client_basic.test b/mysql-test/suite/sys_vars/t/character_set_client_basic.test index 09f758a0316..44c0d240a9d 100644 --- a/mysql-test/suite/sys_vars/t/character_set_client_basic.test +++ b/mysql-test/suite/sys_vars/t/character_set_client_basic.test @@ -350,6 +350,15 @@ SELECT @@session.character_set_client = --error ER_UNKNOWN_CHARACTER_SET SET GLOBAL character_set_client=2; +--echo # +--echo # MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset +--echo # + +SET @@pseudo_slave_mode=1; +SET character_set_client=2/*latin2_czech_cs*/; +SHOW VARIABLES LIKE 'character_set_client'; +SET @@pseudo_slave_mode=0; + #################################### # Restore initial value # #################################### diff --git a/mysql-test/suite/sys_vars/t/character_set_connection_basic.test b/mysql-test/suite/sys_vars/t/character_set_connection_basic.test index 3d9094fca04..46bdfcb52e2 100644 --- a/mysql-test/suite/sys_vars/t/character_set_connection_basic.test +++ b/mysql-test/suite/sys_vars/t/character_set_connection_basic.test @@ -275,6 +275,19 @@ SELECT @@session.character_set_connection = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='character_set_connection') AS res; +--echo # +--echo # MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset +--echo # + +--error ER_UNKNOWN_CHARACTER_SET +SET character_set_connection=2/*latin2_czech_cs*/; +SET @@pseudo_slave_mode=1; +SET character_set_connection=2/*latin2_czech_cs*/; +SHOW VARIABLES LIKE 'character_set_connection'; +SHOW VARIABLES LIKE 'collation_connection'; +SET @@pseudo_slave_mode=0; + + #################################### # Restore initial value # #################################### diff --git a/mysql-test/suite/sys_vars/t/character_set_results_basic.test b/mysql-test/suite/sys_vars/t/character_set_results_basic.test index 617332b9780..41090be6657 100644 --- a/mysql-test/suite/sys_vars/t/character_set_results_basic.test +++ b/mysql-test/suite/sys_vars/t/character_set_results_basic.test @@ -272,6 +272,18 @@ SELECT @@session.character_set_results = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='character_set_results') AS res; +--echo # +--echo # MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset +--echo # + +--error ER_UNKNOWN_CHARACTER_SET +SET character_set_results=2/*latin2_czech_cs*/; +SET @@pseudo_slave_mode=1; +SET character_set_results=2; +SHOW VARIABLES LIKE 'character_set_results'; +SET @@pseudo_slave_mode=0; + + #################################### # Restore initial value # #################################### diff --git a/mysql-test/suite/sys_vars/t/character_set_server_basic.test b/mysql-test/suite/sys_vars/t/character_set_server_basic.test index b2f4788fdae..929dbfaf143 100644 --- a/mysql-test/suite/sys_vars/t/character_set_server_basic.test +++ b/mysql-test/suite/sys_vars/t/character_set_server_basic.test @@ -266,6 +266,18 @@ SELECT @@session.character_set_server = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='character_set_server') AS res; +--echo # +--echo # MDEV-31018 Replica of 10.3, 10.4, <10.5.19 and <10.6.12 to 10.11 will not work when using non-default charset +--echo # + +--error ER_UNKNOWN_CHARACTER_SET +SET character_set_server=2/*latin2_czech_cs*/; +SET @@pseudo_slave_mode=1; +SET character_set_server=2/*latin2_czech_cs*/; +SHOW VARIABLES LIKE 'character_set_server'; +SHOW VARIABLES LIKE 'collation_server'; +SET @@pseudo_slave_mode=0; + #################################### # Restore initial value # #################################### diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 10f9de106f8..45b5fe20ff6 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -791,12 +791,26 @@ static bool check_charset(sys_var *self, THD *thd, set_var *var) { int csno= (int)var->value->val_int(); CHARSET_INFO *cs; - if (!(var->save_result.ptr= cs= get_charset(csno, MYF(0))) || - !(cs->state & MY_CS_PRIMARY)) + if ((var->save_result.ptr= cs= get_charset(csno, MYF(0)))) { - my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), llstr(csno, buff)); - return true; + /* + Backward compatibility: pre MDEV-30824 servers + can write non-default collation IDs to binary log: + SET character_set_client=83; -- utf8mb3_bin + Convert a non-default collation to the compiled default collation, + e.g. utf8mb3_bin to utf8mb3_general_ci, but only if + - THD is a slave thread or + - is processing a mysqlbinlog output. + */ + if ((cs->state & MY_CS_PRIMARY) || + ((thd->variables.pseudo_slave_mode || thd->slave_thread) && + (var->save_result.ptr= + Lex_exact_charset_opt_extended_collate(cs, true). + find_default_collation()))) + return false; } + my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), llstr(csno, buff)); + return true; } return false; } From da1c91fb9232fbea88d3f9a27f81b39f85cfc468 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Tue, 28 Feb 2023 10:43:39 +1100 Subject: [PATCH 154/260] MDEV-30713 field length handling for CONNECT engine fp->field_length was unsigned and therefore the negative condition around it. Backport of cc182aca9352 fixes it, however to correct the consistent use of types pcf->Length needs to be unsigned too. At one point pcf->Precision is assigned from pcf->Length so that's also unsigned. GetTypeSize is assigned to length and has a length argument. A -1 default value seemed dangerious to case, so at least 0 should assert if every hit. --- storage/connect/catalog.h | 4 ++-- storage/connect/ha_connect.cc | 5 +---- storage/connect/tabext.cpp | 2 +- storage/connect/value.cpp | 8 ++++---- storage/connect/value.h | 2 +- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/storage/connect/catalog.h b/storage/connect/catalog.h index 2649a50cf76..a46615f5d6e 100644 --- a/storage/connect/catalog.h +++ b/storage/connect/catalog.h @@ -39,9 +39,9 @@ typedef struct _colinfo { PCSZ Name; int Type; int Offset; - int Length; + unsigned Length; int Key; - int Precision; + unsigned Precision; int Scale; int Opt; int Freq; diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 81960332cbe..0a0a206c9c8 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -1618,10 +1618,7 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf) pcf->Scale= 0; pcf->Opt= (fop) ? (int)fop->opt : 0; - if (fp->field_length >= 0) - pcf->Length= fp->field_length; - else - pcf->Length= 256; // BLOB? + pcf->Length= fp->field_length; pcf->Precision= pcf->Length; diff --git a/storage/connect/tabext.cpp b/storage/connect/tabext.cpp index 9d8a4aca077..6903e112238 100644 --- a/storage/connect/tabext.cpp +++ b/storage/connect/tabext.cpp @@ -466,7 +466,7 @@ bool TDBEXT::MakeSQL(PGLOBAL g, bool cnt) if (Quote) { // Tabname can have both database and table identifiers, we need to parse - if (res= strstr(buf, ".")) + if ((res= strstr(buf, "."))) { // Parse schema my_len= res - buf + 1; diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp index 498ec71a87f..7265b2ed0ca 100644 --- a/storage/connect/value.cpp +++ b/storage/connect/value.cpp @@ -163,9 +163,9 @@ PCSZ GetTypeName(int type) /***********************************************************************/ /* GetTypeSize: returns the PlugDB internal type size. */ /***********************************************************************/ -int GetTypeSize(int type, int len) - { - switch (type) { +unsigned GetTypeSize(int type, unsigned len) +{ + switch (type) { case TYPE_DECIM: case TYPE_BIN: case TYPE_STRING: len = len * sizeof(char); break; @@ -176,7 +176,7 @@ int GetTypeSize(int type, int len) case TYPE_DOUBLE: len = sizeof(double); break; case TYPE_TINY: len = sizeof(char); break; case TYPE_PCHAR: len = sizeof(char*); break; - default: len = -1; + default: len = 0; } // endswitch type return len; diff --git a/storage/connect/value.h b/storage/connect/value.h index a0d947347c3..7eb0dec29f2 100644 --- a/storage/connect/value.h +++ b/storage/connect/value.h @@ -41,7 +41,7 @@ typedef struct _datpar *PDTP; // For DTVAL /***********************************************************************/ // Exported functions DllExport PCSZ GetTypeName(int); -DllExport int GetTypeSize(int, int); +DllExport unsigned GetTypeSize(int, unsigned); #ifdef ODBC_SUPPORT /* This function is exported for use in OEM table type DLLs */ DllExport int TranslateSQLType(int stp, int prec, From 40eff3f868108a202d88e4da339fc539cbf29e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 21 Apr 2023 17:52:47 +0300 Subject: [PATCH 155/260] MDEV-26827 fixup: hangs and !os_aio_pending_writes() assertion failures buf_LRU_get_free_block(): Always wake up the page cleaner if needed before exiting the inner loop. srv_prepare_to_delete_redo_log_file(): Replace a debug assertion with a wait in debug builds. Starting with commit 7e31a8e7fa97a87fc164381588d172bf0e76abb6 the debug assertion ut_ad(!os_aio_pending_writes()) could occasionally fail, while it would hold in core dumps of crashes. The failure can be reproduced more easily by adding a sleep to the write completion callback function, right before releasing to write_slots. srv_start(): Remove a bogus debug assertion ut_ad(!os_aio_pending_writes()) that could fail in mariadb-backup --prepare. In an rr replay trace, we had buf_pool.flush_list.count==0 but write_slots->m_cache.m_pos==1 and buf_page_t::write_complete() was executing u_unlock(). --- storage/innobase/buf/buf0lru.cc | 6 +++--- storage/innobase/srv/srv0start.cc | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc index 844e288843b..feb15fc226c 100644 --- a/storage/innobase/buf/buf0lru.cc +++ b/storage/innobase/buf/buf0lru.cc @@ -448,15 +448,15 @@ got_block: mysql_mutex_unlock(&buf_pool.mutex); mysql_mutex_lock(&buf_pool.flush_list_mutex); const auto n_flush = buf_pool.n_flush(); + if (!buf_pool.try_LRU_scan) { + buf_pool.page_cleaner_wakeup(true); + } mysql_mutex_unlock(&buf_pool.flush_list_mutex); mysql_mutex_lock(&buf_pool.mutex); if (!n_flush) { goto not_found; } if (!buf_pool.try_LRU_scan) { - mysql_mutex_lock(&buf_pool.flush_list_mutex); - buf_pool.page_cleaner_wakeup(true); - mysql_mutex_unlock(&buf_pool.flush_list_mutex); my_cond_wait(&buf_pool.done_free, &buf_pool.mutex.m_mutex); } diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 707804f2206..5f6b4b02e16 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -970,10 +970,10 @@ same_size: ut_ad(flushed_lsn == log_sys.get_lsn()); ut_ad(!os_aio_pending_reads()); - ut_ad(!os_aio_pending_writes()); ut_d(mysql_mutex_lock(&buf_pool.flush_list_mutex)); ut_ad(!buf_pool.get_oldest_modification(0)); ut_d(mysql_mutex_unlock(&buf_pool.flush_list_mutex)); + ut_d(os_aio_wait_until_no_pending_writes()); DBUG_RETURN(flushed_lsn); } @@ -1608,7 +1608,6 @@ file_checked: ut_ad(recv_no_log_write); err = fil_write_flushed_lsn(log_sys.get_lsn()); ut_ad(!os_aio_pending_reads()); - ut_ad(!os_aio_pending_writes()); ut_d(mysql_mutex_lock(&buf_pool.flush_list_mutex)); ut_ad(!buf_pool.get_oldest_modification(0)); ut_d(mysql_mutex_unlock(&buf_pool.flush_list_mutex)); From 86767bcc0f121db3ad83a74647a642754a0ce57f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 21 Apr 2023 17:58:09 +0300 Subject: [PATCH 156/260] MDEV-29593 Purge misses a chance to free not-yet-reused undo pages trx_purge_truncate_rseg_history(): If all other conditions for invoking trx_purge_remove_log_hdr() hold, but the state is TRX_UNDO_CACHED instead of TRX_UNDO_TO_PURGE, detach and free it. Tested by: Matthias Leich --- storage/innobase/include/mtr0mtr.h | 2 +- storage/innobase/trx/trx0purge.cc | 231 ++++++++++++++--------------- 2 files changed, 116 insertions(+), 117 deletions(-) diff --git a/storage/innobase/include/mtr0mtr.h b/storage/innobase/include/mtr0mtr.h index 1c044319ca0..5ce297ba5c9 100644 --- a/storage/innobase/include/mtr0mtr.h +++ b/storage/innobase/include/mtr0mtr.h @@ -343,7 +343,7 @@ public: { mtr_memo_slot_t &slot= m_memo[savepoint]; ut_ad(slot.type <= MTR_MEMO_BUF_FIX); - ut_ad(type <= MTR_MEMO_BUF_FIX); + ut_ad(type < MTR_MEMO_S_LOCK); slot.type= type; } diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index ded4d63d705..4a2fa214b37 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -275,7 +275,7 @@ trx_purge_add_undo_to_history(const trx_t* trx, trx_undo_t*& undo, mtr_t* mtr) if (undo->state != TRX_UNDO_CACHED) { /* The undo log segment will not be reused */ ut_a(undo->id < TRX_RSEG_N_SLOTS); - compile_time_assert(FIL_NULL == 0xffffffff); + static_assert(FIL_NULL == 0xffffffff, ""); mtr->memset(rseg_header, TRX_RSEG + TRX_RSEG_UNDO_SLOTS + undo->id * TRX_RSEG_SLOT_SIZE, 4, 0xff); @@ -385,45 +385,11 @@ static dberr_t trx_purge_remove_log_hdr(buf_block_t *rseg, buf_block_t* log, uint16_t(offset + TRX_UNDO_HISTORY_NODE), mtr); } -MY_ATTRIBUTE((nonnull, warn_unused_result)) -/** Free an undo log segment, and remove the header from the history list. -@param[in,out] mtr mini-transaction -@param[in,out] rseg rollback segment -@param[in] hdr_addr file address of log_hdr -@return error code */ -static dberr_t -trx_purge_free_segment(mtr_t &mtr, trx_rseg_t* rseg, fil_addr_t hdr_addr) +/** Free an undo log segment. +@param block rollback segment header page +@param mtr mini-transaction */ +static void trx_purge_free_segment(buf_block_t *block, mtr_t &mtr) { - mtr.commit(); - log_free_check(); - mtr.start(); - - const page_id_t hdr_page_id{rseg->space->id, hdr_addr.page}; - dberr_t err; - buf_block_t *rseg_hdr= rseg->get(&mtr, &err); - if (!rseg_hdr) - return err; - buf_block_t *block= buf_page_get_gen(hdr_page_id, 0, RW_X_LATCH, - nullptr, BUF_GET_POSSIBLY_FREED, - &mtr, &err); - if (!block) - return err; - - const uint32_t seg_size= - flst_get_len(TRX_UNDO_SEG_HDR + TRX_UNDO_PAGE_LIST + block->page.frame); - - err= trx_purge_remove_log_hdr(rseg_hdr, block, hdr_addr.boffset, &mtr); - if (UNIV_UNLIKELY(err != DB_SUCCESS)) - return err; - - ut_ad(rseg->curr_size >= seg_size); - rseg->curr_size-= seg_size; - rseg->history_size--; - - byte *hist= TRX_RSEG + TRX_RSEG_HISTORY_SIZE + rseg_hdr->page.frame; - ut_ad(mach_read_from_4(hist) >= seg_size); - mtr.write<4>(*rseg_hdr, hist, mach_read_from_4(hist) - seg_size); - while (!fseg_free_step_not_header(TRX_UNDO_SEG_HDR + TRX_UNDO_FSEG_HEADER + block->page.frame, &mtr)) { @@ -444,9 +410,9 @@ trx_purge_free_segment(mtr_t &mtr, trx_rseg_t* rseg, fil_addr_t hdr_addr) { block->unfix(); block->page.lock.x_unlock(); - block= buf_page_get_gen(id, 0, RW_X_LATCH, nullptr, BUF_GET, &mtr, &err); + block= buf_page_get_gen(id, 0, RW_X_LATCH, nullptr, BUF_GET, &mtr); if (!block) - return err; + return; } else mtr.memo_push(block, MTR_MEMO_PAGE_X_MODIFY); @@ -454,102 +420,135 @@ trx_purge_free_segment(mtr_t &mtr, trx_rseg_t* rseg, fil_addr_t hdr_addr) while (!fseg_free_step(TRX_UNDO_SEG_HDR + TRX_UNDO_FSEG_HEADER + block->page.frame, &mtr)); - return DB_SUCCESS; } /** Remove unnecessary history data from a rollback segment. @param[in,out] rseg rollback segment @param[in] limit truncate anything before this @return error code */ -static -dberr_t -trx_purge_truncate_rseg_history( - trx_rseg_t& rseg, - const purge_sys_t::iterator& limit) +static dberr_t +trx_purge_truncate_rseg_history(trx_rseg_t& rseg, + const purge_sys_t::iterator& limit) { - fil_addr_t hdr_addr; - mtr_t mtr; + fil_addr_t hdr_addr; + mtr_t mtr; - mtr.start(); + log_free_check(); + mtr.start(); - dberr_t err; - buf_block_t* rseg_hdr = rseg.get(&mtr, &err); - if (!rseg_hdr) { - goto func_exit; - } + dberr_t err; +reget: + buf_block_t *rseg_hdr= rseg.get(&mtr, &err); + if (!rseg_hdr) + { +func_exit: + mtr.commit(); + return err; + } - hdr_addr = flst_get_last(TRX_RSEG + TRX_RSEG_HISTORY - + rseg_hdr->page.frame); - hdr_addr.boffset = static_cast(hdr_addr.boffset - - TRX_UNDO_HISTORY_NODE); + hdr_addr= flst_get_last(TRX_RSEG + TRX_RSEG_HISTORY + rseg_hdr->page.frame); + hdr_addr.boffset= static_cast(hdr_addr.boffset - + TRX_UNDO_HISTORY_NODE); loop: - if (hdr_addr.page == FIL_NULL) { -func_exit: - mtr.commit(); - return err; - } + if (hdr_addr.page == FIL_NULL) + goto func_exit; - buf_block_t* block = buf_page_get_gen(page_id_t(rseg.space->id, - hdr_addr.page), - 0, RW_X_LATCH, nullptr, - BUF_GET_POSSIBLY_FREED, - &mtr, &err); - if (!block) { - goto func_exit; - } + buf_block_t *b= + buf_page_get_gen(page_id_t(rseg.space->id, hdr_addr.page), + 0, RW_X_LATCH, nullptr, BUF_GET_POSSIBLY_FREED, + &mtr, &err); + if (!b) + goto func_exit; - const trx_id_t undo_trx_no = mach_read_from_8( - block->page.frame + hdr_addr.boffset + TRX_UNDO_TRX_NO); + const trx_id_t undo_trx_no= + mach_read_from_8(b->page.frame + hdr_addr.boffset + TRX_UNDO_TRX_NO); - if (undo_trx_no >= limit.trx_no) { - if (undo_trx_no == limit.trx_no) { - err = trx_undo_truncate_start( - &rseg, hdr_addr.page, - hdr_addr.boffset, limit.undo_no); - } + if (undo_trx_no >= limit.trx_no) + { + if (undo_trx_no == limit.trx_no) + err = trx_undo_truncate_start(&rseg, hdr_addr.page, + hdr_addr.boffset, limit.undo_no); + goto func_exit; + } - goto func_exit; - } + fil_addr_t prev_hdr_addr= + flst_get_prev_addr(b->page.frame + hdr_addr.boffset + + TRX_UNDO_HISTORY_NODE); + prev_hdr_addr.boffset= static_cast(prev_hdr_addr.boffset - + TRX_UNDO_HISTORY_NODE); + err= trx_purge_remove_log_hdr(rseg_hdr, b, hdr_addr.boffset, &mtr); + if (UNIV_UNLIKELY(err != DB_SUCCESS)) + goto func_exit; - fil_addr_t prev_hdr_addr = flst_get_prev_addr( - block->page.frame + hdr_addr.boffset + TRX_UNDO_HISTORY_NODE); - prev_hdr_addr.boffset = static_cast(prev_hdr_addr.boffset - - TRX_UNDO_HISTORY_NODE); + rseg_hdr->fix(); - if (!rseg.is_referenced() - && rseg.needs_purge <= (purge_sys.head.trx_no - ? purge_sys.head.trx_no - : purge_sys.tail.trx_no) - && mach_read_from_2(TRX_UNDO_SEG_HDR + TRX_UNDO_STATE - + block->page.frame) - == TRX_UNDO_TO_PURGE - && !mach_read_from_2(block->page.frame + hdr_addr.boffset - + TRX_UNDO_NEXT_LOG)) { - /* We can free the whole log segment. - This will call trx_purge_remove_log_hdr(). */ - err = trx_purge_free_segment(mtr, &rseg, hdr_addr); - } else { - /* Remove the log hdr from the rseg history. */ - rseg.history_size--; - err = trx_purge_remove_log_hdr(rseg_hdr, block, - hdr_addr.boffset, &mtr); - } + if (mach_read_from_2(b->page.frame + hdr_addr.boffset + TRX_UNDO_NEXT_LOG) || + rseg.is_referenced() || + rseg.needs_purge > (purge_sys.head.trx_no + ? purge_sys.head.trx_no + : purge_sys.tail.trx_no)) + /* We cannot free the entire undo page. */; + else + { + const uint32_t seg_size= + flst_get_len(TRX_UNDO_SEG_HDR + TRX_UNDO_PAGE_LIST + b->page.frame); + switch (mach_read_from_2(TRX_UNDO_SEG_HDR + TRX_UNDO_STATE + + b->page.frame)) { + case TRX_UNDO_TO_PURGE: + { + byte *hist= TRX_RSEG + TRX_RSEG_HISTORY_SIZE + rseg_hdr->page.frame; + ut_ad(mach_read_from_4(hist) >= seg_size); + mtr.write<4>(*rseg_hdr, hist, mach_read_from_4(hist) - seg_size); + } + free_segment: + ut_ad(rseg.curr_size >= seg_size); + rseg.curr_size-= seg_size; + trx_purge_free_segment(b, mtr); + break; + case TRX_UNDO_CACHED: + /* rseg.undo_cached must point to this page */ + trx_undo_t *undo= UT_LIST_GET_FIRST(rseg.undo_cached); + for (; undo; undo= UT_LIST_GET_NEXT(undo_list, undo)) + if (undo->hdr_page_no == hdr_addr.page) + goto found_cached; + ut_ad("inconsistent undo logs" == 0); + break; + found_cached: + UT_LIST_REMOVE(rseg.undo_cached, undo); + static_assert(FIL_NULL == 0xffffffff, ""); + if (UNIV_UNLIKELY(mach_read_from_4(TRX_RSEG + TRX_RSEG_FORMAT + + rseg_hdr->page.frame))) + trx_rseg_format_upgrade(rseg_hdr, &mtr); + mtr.memset(rseg_hdr, TRX_RSEG + TRX_RSEG_UNDO_SLOTS + + undo->id * TRX_RSEG_SLOT_SIZE, 4, 0xff); + ut_free(undo); + mtr.write<8,mtr_t::MAYBE_NOP>(*rseg_hdr, TRX_RSEG + TRX_RSEG_MAX_TRX_ID + + rseg_hdr->page.frame, + trx_sys.get_max_trx_id() - 1); + MONITOR_DEC(MONITOR_NUM_UNDO_SLOT_CACHED); + MONITOR_DEC(MONITOR_NUM_UNDO_SLOT_USED); + goto free_segment; + } + } - mtr.commit(); - if (err != DB_SUCCESS) { - return err; - } - mtr.start(); + hdr_addr= prev_hdr_addr; - hdr_addr = prev_hdr_addr; + mtr.commit(); + ut_ad(rseg.history_size > 0); + rseg.history_size--; + log_free_check(); + mtr.start(); + rseg_hdr->page.lock.x_lock(); + if (UNIV_UNLIKELY(rseg_hdr->page.id() != rseg.page_id())) + { + rseg_hdr->unfix(); + rseg_hdr->page.lock.x_unlock(); + goto reget; + } + mtr.memo_push(rseg_hdr, MTR_MEMO_PAGE_X_MODIFY); - rseg_hdr = rseg.get(&mtr, &err); - if (!rseg_hdr) { - goto func_exit; - } - - goto loop; + goto loop; } /** Cleanse purge queue to remove the rseg that reside in undo-tablespace From 204e7225dce32130ac2c96f469611d2cb421241e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 21 Apr 2023 17:58:18 +0300 Subject: [PATCH 157/260] Cleanup: MONITOR_EXISTING trx_undo_slots_used, trx_undo_slots_cached Let us remove explicit updates of MONITOR_NUM_UNDO_SLOT_USED and MONITOR_NUM_UNDO_SLOT_CACHED, and let us compute the rough values from trx_sys.rseg_array[] on demand. --- .../r/innodb_skip_innodb_is_tables.result | 4 +-- storage/innobase/srv/srv0mon.cc | 34 ++++++++++++++++--- storage/innobase/trx/trx0purge.cc | 5 --- storage/innobase/trx/trx0rseg.cc | 2 -- storage/innobase/trx/trx0undo.cc | 6 ---- .../r/innodb_i_s_tables_disabled.result | 4 +-- 6 files changed, 33 insertions(+), 22 deletions(-) diff --git a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result index 9bdb546482e..9810e49bd20 100644 --- a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result +++ b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result @@ -164,8 +164,8 @@ trx_commits_insert_update transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NUL trx_rollbacks transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of transactions rolled back trx_rollbacks_savepoint transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of transactions rolled back to savepoint trx_rseg_history_len transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Length of the TRX_RSEG_HISTORY list -trx_undo_slots_used transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of undo slots used -trx_undo_slots_cached transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of undo slots cached +trx_undo_slots_used transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of undo slots used +trx_undo_slots_cached transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of undo slots cached trx_rseg_current_size transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Current rollback segment size in pages purge_del_mark_records purge 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of delete-marked rows purged purge_upd_exist_or_extern_records purge 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of purges on updates of existing records and updates on delete marked record with externally stored field diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc index b6496d03908..2a3720641bc 100644 --- a/storage/innobase/srv/srv0mon.cc +++ b/storage/innobase/srv/srv0mon.cc @@ -704,16 +704,18 @@ static monitor_info_t innodb_counter_info[] = {"trx_rseg_history_len", "transaction", "Length of the TRX_RSEG_HISTORY list", static_cast( - MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT | MONITOR_DEFAULT_ON), + MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT), MONITOR_DEFAULT_START, MONITOR_RSEG_HISTORY_LEN}, {"trx_undo_slots_used", "transaction", "Number of undo slots used", - MONITOR_NONE, + static_cast( + MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT), MONITOR_DEFAULT_START, MONITOR_NUM_UNDO_SLOT_USED}, {"trx_undo_slots_cached", "transaction", "Number of undo slots cached", - MONITOR_NONE, + static_cast( + MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT | MONITOR_DEFAULT_ON), MONITOR_DEFAULT_START, MONITOR_NUM_UNDO_SLOT_CACHED}, {"trx_rseg_current_size", "transaction", @@ -1383,6 +1385,24 @@ TPOOL_SUPPRESS_TSAN static ulint srv_mon_get_rseg_size() return size; } +/** @return number of used undo log slots */ +TPOOL_SUPPRESS_TSAN static ulint srv_mon_get_rseg_used() +{ + ulint size= 0; + for (const auto &rseg : trx_sys.rseg_array) + size+= UT_LIST_GET_LEN(rseg.undo_list); + return size; +} + +/** @return number of cached undo log slots */ +TPOOL_SUPPRESS_TSAN static ulint srv_mon_get_rseg_cached() +{ + ulint size= 0; + for (const auto &rseg : trx_sys.rseg_array) + size+= UT_LIST_GET_LEN(rseg.undo_cached); + return size; +} + /****************************************************************//** This function consolidates some existing server counters used by "system status variables". These existing system variables do not have @@ -1690,7 +1710,12 @@ srv_mon_process_existing_counter( case MONITOR_RSEG_CUR_SIZE: value = srv_mon_get_rseg_size(); break; - + case MONITOR_NUM_UNDO_SLOT_USED: + value = srv_mon_get_rseg_used(); + break; + case MONITOR_NUM_UNDO_SLOT_CACHED: + value = srv_mon_get_rseg_cached(); + break; case MONITOR_OVLD_N_FILE_OPENED: value = fil_system.n_open; break; @@ -1812,7 +1837,6 @@ srv_mon_process_existing_counter( case MONITOR_TIMEOUT: value = lock_sys.timeouts; break; - default: ut_error; } diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index 4a2fa214b37..7a63b1155b6 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -280,8 +280,6 @@ trx_purge_add_undo_to_history(const trx_t* trx, trx_undo_t*& undo, mtr_t* mtr) TRX_RSEG + TRX_RSEG_UNDO_SLOTS + undo->id * TRX_RSEG_SLOT_SIZE, 4, 0xff); - MONITOR_DEC(MONITOR_NUM_UNDO_SLOT_USED); - uint32_t hist_size = mach_read_from_4( TRX_RSEG_HISTORY_SIZE + TRX_RSEG + rseg_header->page.frame); @@ -363,7 +361,6 @@ trx_purge_add_undo_to_history(const trx_t* trx, trx_undo_t*& undo, mtr_t* mtr) if (undo->state == TRX_UNDO_CACHED) { UT_LIST_ADD_FIRST(rseg->undo_cached, undo); - MONITOR_INC(MONITOR_NUM_UNDO_SLOT_CACHED); } else { ut_ad(undo->state == TRX_UNDO_TO_PURGE); ut_free(undo); @@ -526,8 +523,6 @@ loop: mtr.write<8,mtr_t::MAYBE_NOP>(*rseg_hdr, TRX_RSEG + TRX_RSEG_MAX_TRX_ID + rseg_hdr->page.frame, trx_sys.get_max_trx_id() - 1); - MONITOR_DEC(MONITOR_NUM_UNDO_SLOT_CACHED); - MONITOR_DEC(MONITOR_NUM_UNDO_SLOT_USED); goto free_segment; } } diff --git a/storage/innobase/trx/trx0rseg.cc b/storage/innobase/trx/trx0rseg.cc index 6d95dcf06f1..0d7b96e9280 100644 --- a/storage/innobase/trx/trx0rseg.cc +++ b/storage/innobase/trx/trx0rseg.cc @@ -394,7 +394,6 @@ void trx_rseg_t::reinit(uint32_t page) { next= UT_LIST_GET_NEXT(undo_list, undo); UT_LIST_REMOVE(undo_cached, undo); - MONITOR_DEC(MONITOR_NUM_UNDO_SLOT_CACHED); ut_free(undo); } @@ -425,7 +424,6 @@ static dberr_t trx_undo_lists_init(trx_rseg_t *rseg, if (!undo) return DB_CORRUPTION; rseg->curr_size+= undo->size; - MONITOR_INC(MONITOR_NUM_UNDO_SLOT_USED); } } diff --git a/storage/innobase/trx/trx0undo.cc b/storage/innobase/trx/trx0undo.cc index 33b1f93ff65..bccb6538e63 100644 --- a/storage/innobase/trx/trx0undo.cc +++ b/storage/innobase/trx/trx0undo.cc @@ -535,8 +535,6 @@ trx_undo_seg_create(fil_space_t *space, buf_block_t *rseg_hdr, ulint *id, + slot_no * TRX_RSEG_SLOT_SIZE + rseg_hdr->page.frame, block->page.id().page_no()); - MONITOR_INC(MONITOR_NUM_UNDO_SLOT_USED); - *err = DB_SUCCESS; return block; } @@ -996,7 +994,6 @@ static void trx_undo_seg_free(const trx_undo_t *undo) static_assert(FIL_NULL == 0xffffffff, "compatibility"); mtr.memset(rseg_header, TRX_RSEG + TRX_RSEG_UNDO_SLOTS + undo->id * TRX_RSEG_SLOT_SIZE, 4, 0xff); - MONITOR_DEC(MONITOR_NUM_UNDO_SLOT_USED); } } @@ -1155,7 +1152,6 @@ corrupted_type: UT_LIST_ADD_LAST(rseg->undo_list, undo); } else { UT_LIST_ADD_LAST(rseg->undo_cached, undo); - MONITOR_INC(MONITOR_NUM_UNDO_SLOT_CACHED); } mtr.commit(); @@ -1333,7 +1329,6 @@ trx_undo_reuse_cached(trx_t* trx, trx_rseg_t* rseg, trx_undo_t** pundo, } UT_LIST_REMOVE(rseg->undo_cached, undo); - MONITOR_DEC(MONITOR_NUM_UNDO_SLOT_CACHED); *pundo = undo; @@ -1546,7 +1541,6 @@ void trx_undo_commit_cleanup(trx_undo_t *undo) if (undo->state == TRX_UNDO_CACHED) { UT_LIST_ADD_FIRST(rseg->undo_cached, undo); - MONITOR_INC(MONITOR_NUM_UNDO_SLOT_CACHED); undo = nullptr; } else { ut_ad(undo->state == TRX_UNDO_TO_PURGE); diff --git a/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result b/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result index d3f0ee3bcd9..064019a3bfc 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result @@ -146,8 +146,8 @@ trx_commits_insert_update transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NUL trx_rollbacks transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of transactions rolled back trx_rollbacks_savepoint transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of transactions rolled back to savepoint trx_rseg_history_len transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Length of the TRX_RSEG_HISTORY list -trx_undo_slots_used transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of undo slots used -trx_undo_slots_cached transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of undo slots cached +trx_undo_slots_used transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of undo slots used +trx_undo_slots_cached transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of undo slots cached trx_rseg_current_size transaction 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Current rollback segment size in pages purge_del_mark_records purge 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of delete-marked rows purged purge_upd_exist_or_extern_records purge 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of purges on updates of existing records and updates on delete marked record with externally stored field From 51e62cb3b3b5f28a67c3c5862b3cb60ecf87180a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 21 Apr 2023 17:58:26 +0300 Subject: [PATCH 158/260] MDEV-26782 InnoDB temporary tablespace: reclaiming of free space does not work The motivation of this change is to allow undo pages for temporary tables to be marked free as often as possible, so that we can avoid buf_pool.LRU eviction (and writes) of undo pages that contain data that is no longer needed. For temporary tables, no MVCC or purge of history is needed, and reusing cached undo log pages might not help that much. It is possible that this may cause some performance regression due to more frequent allocation and freeing of undo log pages, but I only measured a performance improvement. trx_write_serialisation_history(): Never cache temporary undo log pages. trx_undo_reuse_cached(): Assert that the rollback segment is persistent. trx_undo_assign_low(): Add template. Never invoke trx_undo_reuse_cached() for temporary tables. Tested by: Matthias Leich --- storage/innobase/include/trx0undo.h | 10 ++- storage/innobase/trx/trx0rec.cc | 10 ++- storage/innobase/trx/trx0trx.cc | 8 +- storage/innobase/trx/trx0undo.cc | 114 ++++++++++++++-------------- 4 files changed, 78 insertions(+), 64 deletions(-) diff --git a/storage/innobase/include/trx0undo.h b/storage/innobase/include/trx0undo.h index 3474a903f6c..670fe00c25b 100644 --- a/storage/innobase/include/trx0undo.h +++ b/storage/innobase/include/trx0undo.h @@ -203,16 +203,18 @@ trx_undo_assign(trx_t* trx, dberr_t* err, mtr_t* mtr) MY_ATTRIBUTE((nonnull)); /** Assign an undo log for a transaction. A new undo log is created or a cached undo log reused. +@tparam is_temp whether this is temporary undo log @param[in,out] trx transaction @param[in] rseg rollback segment @param[out] undo the undo log -@param[out] err error code @param[in,out] mtr mini-transaction +@param[out] err error code @return the undo log block -@retval NULL on error */ +@retval nullptr on error */ +template buf_block_t* -trx_undo_assign_low(trx_t* trx, trx_rseg_t* rseg, trx_undo_t** undo, - dberr_t* err, mtr_t* mtr) +trx_undo_assign_low(trx_t *trx, trx_rseg_t *rseg, trx_undo_t **undo, + mtr_t *mtr, dberr_t *err) MY_ATTRIBUTE((nonnull, warn_unused_result)); /******************************************************************//** Sets the state of the undo log segment at a transaction finish. diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc index dc24f083d05..d3f64754d89 100644 --- a/storage/innobase/trx/trx0rec.cc +++ b/storage/innobase/trx/trx0rec.cc @@ -1868,26 +1868,28 @@ trx_undo_report_row_operation( } mtr_t mtr; + dberr_t err; mtr.start(); trx_undo_t** pundo; trx_rseg_t* rseg; const bool is_temp = index->table->is_temporary(); + buf_block_t* undo_block; if (is_temp) { mtr.set_log_mode(MTR_LOG_NO_REDO); - rseg = trx->get_temp_rseg(); pundo = &trx->rsegs.m_noredo.undo; + undo_block = trx_undo_assign_low(trx, rseg, pundo, + &mtr, &err); } else { ut_ad(!trx->read_only); ut_ad(trx->id); pundo = &trx->rsegs.m_redo.undo; rseg = trx->rsegs.m_redo.rseg; + undo_block = trx_undo_assign_low(trx, rseg, pundo, + &mtr, &err); } - dberr_t err; - buf_block_t* undo_block = trx_undo_assign_low(trx, rseg, pundo, - &err, &mtr); trx_undo_t* undo = *pundo; ut_ad((err == DB_SUCCESS) == (undo_block != NULL)); if (UNIV_UNLIKELY(undo_block == NULL)) { diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index 88e42b2ebad..b96ababb1f3 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -1023,7 +1023,13 @@ trx_write_serialisation_history( mtr_t temp_mtr; temp_mtr.start(); temp_mtr.set_log_mode(MTR_LOG_NO_REDO); - trx_undo_set_state_at_finish(undo, &temp_mtr); + buf_block_t* block= buf_page_get(page_id_t(SRV_TMP_SPACE_ID, + undo->hdr_page_no), + 0, RW_X_LATCH, mtr); + ut_a(block); + temp_mtr.write<2>(*block, TRX_UNDO_SEG_HDR + TRX_UNDO_STATE + + block->page.frame, TRX_UNDO_TO_PURGE); + undo->state = TRX_UNDO_TO_PURGE; temp_mtr.commit(); } diff --git a/storage/innobase/trx/trx0undo.cc b/storage/innobase/trx/trx0undo.cc index bccb6538e63..20434d9fb9c 100644 --- a/storage/innobase/trx/trx0undo.cc +++ b/storage/innobase/trx/trx0undo.cc @@ -1290,27 +1290,25 @@ trx_undo_create(trx_t* trx, trx_rseg_t* rseg, trx_undo_t** undo, @param[in,out] rseg rollback segment @param[out] pundo the undo log memory object @param[in,out] mtr mini-transaction +@param[out] err error code @return the undo log block @retval NULL if none cached */ static buf_block_t* trx_undo_reuse_cached(trx_t* trx, trx_rseg_t* rseg, trx_undo_t** pundo, - mtr_t* mtr) + mtr_t* mtr, dberr_t *err) { - if (rseg->is_persistent()) { - ut_ad(rseg->is_referenced()); - if (rseg->needs_purge <= trx->id) { - /* trx_purge_truncate_history() compares - rseg->needs_purge <= head.trx_no - so we need to compensate for that. - The rseg->needs_purge after crash - recovery would be at least trx->id + 1, - because that is the minimum possible value - assigned by trx_serialise() on commit. */ - rseg->needs_purge = trx->id + 1; - } - } else { - ut_ad(!rseg->is_referenced()); + ut_ad(rseg->is_persistent()); + ut_ad(rseg->is_referenced()); + if (rseg->needs_purge <= trx->id) { + /* trx_purge_truncate_history() compares + rseg->needs_purge <= head.trx_no + so we need to compensate for that. + The rseg->needs_purge after crash + recovery would be at least trx->id + 1, + because that is the minimum possible value + assigned by trx_serialise() on commit. */ + rseg->needs_purge = trx->id + 1; } trx_undo_t* undo = UT_LIST_GET_FIRST(rseg->undo_cached); @@ -1321,9 +1319,10 @@ trx_undo_reuse_cached(trx_t* trx, trx_rseg_t* rseg, trx_undo_t** pundo, ut_ad(undo->size == 1); ut_ad(undo->id < TRX_RSEG_N_SLOTS); - buf_block_t* block = buf_page_get(page_id_t(undo->rseg->space->id, - undo->hdr_page_no), - 0, RW_X_LATCH, mtr); + buf_block_t* block = buf_page_get_gen(page_id_t(undo->rseg->space->id, + undo->hdr_page_no), + 0, RW_X_LATCH, nullptr, BUF_GET, + mtr, err); if (!block) { return NULL; } @@ -1374,11 +1373,12 @@ trx_undo_assign(trx_t* trx, dberr_t* err, mtr_t* mtr) BUF_GET, mtr, err); } + *err = DB_SUCCESS; trx_rseg_t* rseg = trx->rsegs.m_redo.rseg; rseg->latch.wr_lock(SRW_LOCK_CALL); buf_block_t* block = trx_undo_reuse_cached( - trx, rseg, &trx->rsegs.m_redo.undo, mtr); + trx, rseg, &trx->rsegs.m_redo.undo, mtr, err); if (!block) { block = trx_undo_create(trx, rseg, &trx->rsegs.m_redo.undo, @@ -1387,8 +1387,6 @@ trx_undo_assign(trx_t* trx, dberr_t* err, mtr_t* mtr) if (!block) { goto func_exit; } - } else { - *err = DB_SUCCESS; } UT_LIST_ADD_FIRST(rseg->undo_list, trx->rsegs.m_redo.undo); @@ -1400,18 +1398,20 @@ func_exit: /** Assign an undo log for a transaction. A new undo log is created or a cached undo log reused. +@tparam is_temp whether this is temporary undo log @param[in,out] trx transaction @param[in] rseg rollback segment @param[out] undo the undo log -@param[out] err error code @param[in,out] mtr mini-transaction +@param[out] err error code @return the undo log block -@retval NULL on error */ +@retval nullptr on error */ +template buf_block_t* -trx_undo_assign_low(trx_t* trx, trx_rseg_t* rseg, trx_undo_t** undo, - dberr_t* err, mtr_t* mtr) +trx_undo_assign_low(trx_t *trx, trx_rseg_t *rseg, trx_undo_t **undo, + mtr_t *mtr, dberr_t *err) { - ut_d(const bool is_temp = rseg == trx->rsegs.m_noredo.rseg); + ut_ad(is_temp == (rseg == trx->rsegs.m_noredo.rseg)); ut_ad(is_temp || rseg == trx->rsegs.m_redo.rseg); ut_ad(undo == (is_temp ? &trx->rsegs.m_noredo.undo @@ -1431,19 +1431,24 @@ trx_undo_assign_low(trx_t* trx, trx_rseg_t* rseg, trx_undo_t** undo, *err = DB_TOO_MANY_CONCURRENT_TRXS; return NULL; ); + *err = DB_SUCCESS; rseg->latch.wr_lock(SRW_LOCK_CALL); - buf_block_t* block = trx_undo_reuse_cached(trx, rseg, undo, mtr); - - if (!block) { - block = trx_undo_create(trx, rseg, undo, err, mtr); - ut_ad(!block == (*err != DB_SUCCESS)); - if (!block) { - goto func_exit; - } + buf_block_t* block; + if (is_temp) { + ut_ad(!UT_LIST_GET_LEN(rseg->undo_cached)); } else { - *err = DB_SUCCESS; + block = trx_undo_reuse_cached(trx, rseg, undo, mtr, err); + if (block) { + goto got_block; + } + } + block = trx_undo_create(trx, rseg, undo, err, mtr); + ut_ad(!block == (*err != DB_SUCCESS)); + if (!block) { + goto func_exit; } +got_block: UT_LIST_ADD_FIRST(rseg->undo_list, *undo); func_exit: @@ -1451,6 +1456,13 @@ func_exit: return block; } +template buf_block_t* +trx_undo_assign_low(trx_t *trx, trx_rseg_t *rseg, trx_undo_t **undo, + mtr_t *mtr, dberr_t *err); +template buf_block_t* +trx_undo_assign_low(trx_t *trx, trx_rseg_t *rseg, trx_undo_t **undo, + mtr_t *mtr, dberr_t *err); + /******************************************************************//** Sets the state of the undo log segment at a transaction finish. @return undo log segment header page, x-latched */ @@ -1461,6 +1473,7 @@ trx_undo_set_state_at_finish( mtr_t* mtr) /*!< in: mtr */ { ut_ad(undo->id < TRX_RSEG_N_SLOTS); + ut_ad(undo->rseg->is_persistent()); buf_block_t *block= buf_page_get(page_id_t(undo->rseg->space->id, undo->hdr_page_no), 0, @@ -1532,28 +1545,19 @@ the data can be discarded. @param undo temporary undo log */ void trx_undo_commit_cleanup(trx_undo_t *undo) { - trx_rseg_t* rseg = undo->rseg; - ut_ad(rseg->space == fil_system.temp_space); + trx_rseg_t *rseg= undo->rseg; + ut_ad(rseg->space == fil_system.temp_space); + rseg->latch.wr_lock(SRW_LOCK_CALL); - rseg->latch.wr_lock(SRW_LOCK_CALL); + UT_LIST_REMOVE(rseg->undo_list, undo); + ut_ad(undo->state == TRX_UNDO_TO_PURGE); + /* Delete first the undo log segment in the file */ + trx_undo_seg_free(undo); + ut_ad(rseg->curr_size > undo->size); + rseg->curr_size-= undo->size; - UT_LIST_REMOVE(rseg->undo_list, undo); - - if (undo->state == TRX_UNDO_CACHED) { - UT_LIST_ADD_FIRST(rseg->undo_cached, undo); - undo = nullptr; - } else { - ut_ad(undo->state == TRX_UNDO_TO_PURGE); - - /* Delete first the undo log segment in the file */ - trx_undo_seg_free(undo); - - ut_ad(rseg->curr_size > undo->size); - rseg->curr_size -= undo->size; - } - - rseg->latch.wr_unlock(); - ut_free(undo); + rseg->latch.wr_unlock(); + ut_free(undo); } /** At shutdown, frees the undo logs of a transaction. */ From 9f98a2acd71dcfbdb32a08e72a4737359ed9be40 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 13 Apr 2023 15:42:53 +0400 Subject: [PATCH 159/260] MDEV-30968 mariadb-backup does not copy Aria logs if aria_log_dir_path is used - `mariadb-backup --backup` was fixed to fetch the value of the @@aria_log_dir_path server variable and copy aria_log* files from @@aria_log_dir_path directory to the backup directory. Absolute and relative (to --datadir) paths are supported. Before this change aria_log* files were copied to the backup only if they were in the default location in @@datadir. - `mariadb-backup --copy-back` now understands a new my.cnf and command line parameter --aria-log-dir-path. `mariadb-backup --copy-back` in the main loop in copy_back() (when copying back from the backup directory to --datadir) was fixed to ignore all aria_log* files. A new function copy_back_aria_logs() was added. It consists of a separate loop copying back aria_log* files from the backup directory to the directory specified in --aria-log-dir-path. Absolute and relative (to --datadir) paths are supported. If --aria-log-dir-path is not specified, aria_log* files are copied to --datadir by default. - The function is_absolute_path() was fixed to understand MTR style paths on Windows with forward slashes, e.g. --aria-log-dir-path=D:/Buildbot/amd64-windows/build/mysql-test/var/... --- extra/mariabackup/backup_copy.cc | 70 +++++++++++- extra/mariabackup/backup_mysql.cc | 7 ++ extra/mariabackup/xtrabackup.cc | 14 ++- extra/mariabackup/xtrabackup.h | 1 + .../mariabackup/aria_log_dir_path.result | 41 +++++++ .../suite/mariabackup/aria_log_dir_path.test | 105 ++++++++++++++++++ .../mariabackup/aria_log_dir_path_rel.result | 41 +++++++ .../mariabackup/aria_log_dir_path_rel.test | 4 + storage/innobase/include/os0file.h | 6 +- 9 files changed, 281 insertions(+), 8 deletions(-) create mode 100644 mysql-test/suite/mariabackup/aria_log_dir_path.result create mode 100644 mysql-test/suite/mariabackup/aria_log_dir_path.test create mode 100644 mysql-test/suite/mariabackup/aria_log_dir_path_rel.result create mode 100644 mysql-test/suite/mariabackup/aria_log_dir_path_rel.test diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc index ffaf6dc98e4..8ab52fa983b 100644 --- a/extra/mariabackup/backup_copy.cc +++ b/extra/mariabackup/backup_copy.cc @@ -130,7 +130,9 @@ struct datadir_thread_ctxt_t { bool ret; }; -static bool backup_files_from_datadir(ds_ctxt *ds_data, const char *dir_path); +static bool backup_files_from_datadir(ds_ctxt_t *ds_data, + const char *dir_path, + const char *prefix); /************************************************************************ Retirn true if character if file separator */ @@ -1499,7 +1501,11 @@ bool backup_start(ds_ctxt *ds_data, ds_ctxt *ds_meta, return(false); } - if (!backup_files_from_datadir(ds_data, fil_path_to_mysql_datadir)) { + if (!backup_files_from_datadir(ds_data, fil_path_to_mysql_datadir, + "aws-kms-key") || + !backup_files_from_datadir(ds_data, + aria_log_dir_path, + "aria_log")) { return false; } @@ -1714,7 +1720,12 @@ ibx_copy_incremental_over_full() } } - if (!(ret = backup_files_from_datadir(ds_data, xtrabackup_incremental_dir))) + if (!(ret = backup_files_from_datadir(ds_data, + xtrabackup_incremental_dir, + "aws-kms-key")) || + !(ret = backup_files_from_datadir(ds_data, + xtrabackup_incremental_dir, + "aria_log"))) goto cleanup; /* copy supplementary files */ @@ -1829,6 +1840,41 @@ public: } }; + +static inline bool +is_aria_log_dir_file(const datadir_node_t &node) +{ + return starts_with(node.filepath_rel, "aria_log"); +} + + +bool +copy_back_aria_logs() +{ + Copy_back_dst_dir dst_dir_buf; + const char *dstdir= dst_dir_buf.make(aria_log_dir_path); + std::unique_ptr + ds_ctxt_aria_log_dir_path(ds_create(dstdir, DS_TYPE_LOCAL), ds_destroy); + + datadir_node_t node; + datadir_node_init(&node); + datadir_iter_t *it = datadir_iter_new(".", false); + + while (datadir_iter_next(it, &node)) + { + if (!is_aria_log_dir_file(node)) + continue; + if (!copy_or_move_file(ds_ctxt_aria_log_dir_path.get(), + node.filepath, node.filepath_rel, + dstdir, 1)) + return false; + } + datadir_node_free(&node); + datadir_iter_free(it); + return true; +} + + bool copy_back() { @@ -1861,6 +1907,10 @@ copy_back() && !directory_exists(srv_log_group_home_dir, true)) { return(false); } + if (aria_log_dir_path && *aria_log_dir_path + && !directory_exists(aria_log_dir_path, true)) { + return false; + } /* cd to backup directory */ if (my_setwd(xtrabackup_target_dir, MYF(MY_WME))) @@ -1869,6 +1919,9 @@ copy_back() return(false); } + if (!copy_back_aria_logs()) + return false; + /* parse data file path */ if (!innobase_data_file_path) { @@ -1973,6 +2026,10 @@ copy_back() int i_tmp; bool is_ibdata_file; + /* Skip aria log files */ + if (is_aria_log_dir_file(node)) + continue; + if (strstr(node.filepath,"/" ROCKSDB_BACKUP_DIR "/") #ifdef _WIN32 || strstr(node.filepath,"\\" ROCKSDB_BACKUP_DIR "\\") @@ -2209,7 +2266,9 @@ decrypt_decompress() Do not copy the Innodb files (ibdata1, redo log files), as this is done in a separate step. */ -static bool backup_files_from_datadir(ds_ctxt *ds_data, const char *dir_path) +static bool backup_files_from_datadir(ds_ctxt_t *ds_data, + const char *dir_path, + const char *prefix) { os_file_dir_t dir = os_file_opendir(dir_path); if (dir == IF_WIN(INVALID_HANDLE_VALUE, nullptr)) return false; @@ -2225,8 +2284,7 @@ static bool backup_files_from_datadir(ds_ctxt *ds_data, const char *dir_path) if (!pname) pname = info.name; - if (!starts_with(pname, "aws-kms-key") && - !starts_with(pname, "aria_log")) + if (!starts_with(pname, prefix)) /* For ES exchange the above line with the following code: (!xtrabackup_prepare || !xtrabackup_incremental_dir || !starts_with(pname, "aria_log"))) diff --git a/extra/mariabackup/backup_mysql.cc b/extra/mariabackup/backup_mysql.cc index 6003bfb36c4..1831485e957 100644 --- a/extra/mariabackup/backup_mysql.cc +++ b/extra/mariabackup/backup_mysql.cc @@ -367,6 +367,7 @@ bool get_mysql_vars(MYSQL *connection) char *innodb_undo_directory_var= NULL; char *innodb_page_size_var= NULL; char *innodb_undo_tablespaces_var= NULL; + char *aria_log_dir_path_var= NULL; char *page_zip_level_var= NULL; char *ignore_db_dirs= NULL; char *endptr; @@ -397,6 +398,7 @@ bool get_mysql_vars(MYSQL *connection) {"innodb_undo_tablespaces", &innodb_undo_tablespaces_var}, {"innodb_compression_level", &page_zip_level_var}, {"ignore_db_dirs", &ignore_db_dirs}, + {"aria_log_dir_path", &aria_log_dir_path_var}, {NULL, NULL}}; read_mysql_variables(connection, "SHOW VARIABLES", mysql_vars, true); @@ -538,6 +540,11 @@ bool get_mysql_vars(MYSQL *connection) ut_ad(*endptr == 0); } + if (aria_log_dir_path_var) + { + aria_log_dir_path= my_strdup(aria_log_dir_path_var, MYF(MY_FAE)); + } + if (page_zip_level_var != NULL) { page_zip_level= strtoul(page_zip_level_var, &endptr, 10); diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index ee12034c910..96c90b5afad 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -266,6 +266,8 @@ my_bool innobase_locks_unsafe_for_binlog; my_bool innobase_rollback_on_timeout; my_bool innobase_create_status_file; +char *aria_log_dir_path; + /* The following counter is used to convey information to InnoDB about server activity: in selects it is not sensible to call srv_active_wake_master_thread after each fetch or search, we only do @@ -1105,7 +1107,8 @@ enum options_xtrabackup OPT_XTRA_CHECK_PRIVILEGES, OPT_XTRA_MYSQLD_ARGS, OPT_XB_IGNORE_INNODB_PAGE_CORRUPTION, - OPT_INNODB_FORCE_RECOVERY + OPT_INNODB_FORCE_RECOVERY, + OPT_ARIA_LOG_DIR_PATH }; struct my_option xb_client_options[]= { @@ -1696,6 +1699,11 @@ struct my_option xb_server_options[] = &innodb_log_checksums, &innodb_log_checksums, 0, GET_BOOL, REQUIRED_ARG, 1, 0, 0, 0, 0, 0 }, + {"aria_log_dir_path", OPT_ARIA_LOG_DIR_PATH, + "Path to individual files and their sizes.", + &aria_log_dir_path, &aria_log_dir_path, + 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"open_files_limit", OPT_OPEN_FILES_LIMIT, "the maximum number of file " "descriptors to reserve with setrlimit().", (G_PTR*) &xb_open_files_limit, (G_PTR*) &xb_open_files_limit, 0, GET_ULONG, @@ -2012,6 +2020,10 @@ xb_get_one_option(int optid, } break; + case OPT_ARIA_LOG_DIR_PATH: + ADD_PRINT_PARAM_OPT(aria_log_dir_path); + break; + case OPT_XTRA_TARGET_DIR: strmake(xtrabackup_real_target_dir,argument, sizeof(xtrabackup_real_target_dir)-1); xtrabackup_target_dir= xtrabackup_real_target_dir; diff --git a/extra/mariabackup/xtrabackup.h b/extra/mariabackup/xtrabackup.h index de3a96443a3..df2f766aedb 100644 --- a/extra/mariabackup/xtrabackup.h +++ b/extra/mariabackup/xtrabackup.h @@ -74,6 +74,7 @@ extern char *xtrabackup_incremental_dir; extern char *xtrabackup_incremental_basedir; extern char *innobase_data_home_dir; extern char *innobase_buffer_pool_filename; +extern char *aria_log_dir_path; extern char *xb_plugin_dir; extern char *xb_rocksdb_datadir; extern my_bool xb_backup_rocksdb; diff --git a/mysql-test/suite/mariabackup/aria_log_dir_path.result b/mysql-test/suite/mariabackup/aria_log_dir_path.result new file mode 100644 index 00000000000..1a877321bbe --- /dev/null +++ b/mysql-test/suite/mariabackup/aria_log_dir_path.result @@ -0,0 +1,41 @@ +# +# MDEV-30968 mariadb-backup does not copy Aria logs if aria_log_dir_path is used +# +# Restart mariadbd with the test specific parameters +# restart: --aria-log-file-size=8388608 --aria-log-purge-type=external --loose-aria-log-dir-path=MYSQLTEST_VARDIR/tmp/backup_aria_log_dir_path +# Create and populate an Aria table (and Aria logs) +CREATE TABLE t1 (id INT, txt LONGTEXT) ENGINE=Aria; +BEGIN NOT ATOMIC +FOR id IN 0..9 DO +INSERT INTO test.t1 (id, txt) VALUES (id, REPEAT(id,1024*1024)); +END FOR; +END; +$$ +# Testing aria log files before --backup +SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/; +SHOW ENGINE aria logs; +Type Name Status +Aria aria_log.00000001 free +Aria aria_log.00000002 in use +# mariadb-backup --backup +# mariadb-backup --prepare +# shutdown server +# remove datadir +# remove aria-log-dir-path +# mariadb-backup --copy-back +# with parameters: --defaults-file=MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=MYSQLTEST_VARDIR/mysqld.1/data/ --target-dir=MYSQLTEST_VARDIR/tmp/backup --parallel=2 --throttle=1 --aria-log-dir-path=MYSQLTEST_VARDIR/tmp/backup_aria_log_dir_path +# starting server +# restart: --aria-log-file-size=8388608 --aria-log-purge-type=external --loose-aria-log-dir-path=MYSQLTEST_VARDIR/tmp/backup_aria_log_dir_path +# Check that the table is there after --copy-back +SELECT COUNT(*) from t1; +COUNT(*) +10 +DROP TABLE t1; +# Testing aria log files after --copy-back +SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/; +SHOW ENGINE aria logs; +Type Name Status +Aria aria_log.00000001 free +Aria aria_log.00000002 in use +# Restarting mariadbd with default parameters +# restart diff --git a/mysql-test/suite/mariabackup/aria_log_dir_path.test b/mysql-test/suite/mariabackup/aria_log_dir_path.test new file mode 100644 index 00000000000..0178cd4eae5 --- /dev/null +++ b/mysql-test/suite/mariabackup/aria_log_dir_path.test @@ -0,0 +1,105 @@ +--source include/have_maria.inc + +--echo # +--echo # MDEV-30968 mariadb-backup does not copy Aria logs if aria_log_dir_path is used +--echo # + +--let $datadir=`SELECT @@datadir` +--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup + +if ($ARIA_LOGDIR_MARIADB == '') +{ + --let $ARIA_LOGDIR_MARIADB=$MYSQLTEST_VARDIR/tmp/backup_aria_log_dir_path +} + +if ($ARIA_LOGDIR_FS == '') +{ + --let $ARIA_LOGDIR_FS=$MYSQLTEST_VARDIR/tmp/backup_aria_log_dir_path +} + +--let $server_parameters=--aria-log-file-size=8388608 --aria-log-purge-type=external --loose-aria-log-dir-path=$ARIA_LOGDIR_MARIADB + + +--echo # Restart mariadbd with the test specific parameters +--mkdir $ARIA_LOGDIR_FS +--let $restart_parameters=$server_parameters +--source include/restart_mysqld.inc + + +--echo # Create and populate an Aria table (and Aria logs) +CREATE TABLE t1 (id INT, txt LONGTEXT) ENGINE=Aria; +DELIMITER $$; +BEGIN NOT ATOMIC + FOR id IN 0..9 DO + INSERT INTO test.t1 (id, txt) VALUES (id, REPEAT(id,1024*1024)); + END FOR; +END; +$$ +DELIMITER ;$$ + + +--echo # Testing aria log files before --backup +SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/; +--file_exists $ARIA_LOGDIR_FS/aria_log_control +--file_exists $ARIA_LOGDIR_FS/aria_log.00000001 +--file_exists $ARIA_LOGDIR_FS/aria_log.00000002 +--error 1 +--file_exists $ARIA_LOGDIR_FS/aria_log.00000003 +--replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/ +SHOW ENGINE aria logs; + + +--echo # mariadb-backup --backup +--disable_result_log +--mkdir $targetdir +--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir +--enable_result_log + + +--echo # mariadb-backup --prepare +--disable_result_log +--exec $XTRABACKUP --prepare --target-dir=$targetdir +--enable_result_log + + +--echo # shutdown server +--disable_result_log +--source include/shutdown_mysqld.inc +--echo # remove datadir +--rmdir $datadir +--echo # remove aria-log-dir-path +--rmdir $ARIA_LOGDIR_FS + +--echo # mariadb-backup --copy-back +--let $mariadb_backup_parameters=--defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$datadir --target-dir=$targetdir --parallel=2 --throttle=1 --aria-log-dir-path=$ARIA_LOGDIR_MARIADB +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--exec echo "# with parameters: $mariadb_backup_parameters" +--exec $XTRABACKUP $mariadb_backup_parameters + +--echo # starting server +--let $restart_parameters=$server_parameters +--source include/start_mysqld.inc +--enable_result_log +--rmdir $targetdir + + +--echo # Check that the table is there after --copy-back +SELECT COUNT(*) from t1; +DROP TABLE t1; + + +--echo # Testing aria log files after --copy-back +SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/; +--file_exists $ARIA_LOGDIR_FS/aria_log_control +--file_exists $ARIA_LOGDIR_FS/aria_log.00000001 +--file_exists $ARIA_LOGDIR_FS/aria_log.00000002 +--error 1 +--file_exists $ARIA_LOGDIR_FS/aria_log.00000003 +--replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/ +SHOW ENGINE aria logs; + + +--echo # Restarting mariadbd with default parameters +--let $restart_parameters= +--source include/restart_mysqld.inc +--rmdir $ARIA_LOGDIR_FS diff --git a/mysql-test/suite/mariabackup/aria_log_dir_path_rel.result b/mysql-test/suite/mariabackup/aria_log_dir_path_rel.result new file mode 100644 index 00000000000..7fef26096e0 --- /dev/null +++ b/mysql-test/suite/mariabackup/aria_log_dir_path_rel.result @@ -0,0 +1,41 @@ +# +# MDEV-30968 mariadb-backup does not copy Aria logs if aria_log_dir_path is used +# +# Restart mariadbd with the test specific parameters +# restart: --aria-log-file-size=8388608 --aria-log-purge-type=external --loose-aria-log-dir-path=../../tmp/backup_aria_log_dir_path_rel +# Create and populate an Aria table (and Aria logs) +CREATE TABLE t1 (id INT, txt LONGTEXT) ENGINE=Aria; +BEGIN NOT ATOMIC +FOR id IN 0..9 DO +INSERT INTO test.t1 (id, txt) VALUES (id, REPEAT(id,1024*1024)); +END FOR; +END; +$$ +# Testing aria log files before --backup +SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/; +SHOW ENGINE aria logs; +Type Name Status +Aria aria_log.00000001 free +Aria aria_log.00000002 in use +# mariadb-backup --backup +# mariadb-backup --prepare +# shutdown server +# remove datadir +# remove aria-log-dir-path +# mariadb-backup --copy-back +# with parameters: --defaults-file=MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=MYSQLTEST_VARDIR/mysqld.1/data/ --target-dir=MYSQLTEST_VARDIR/tmp/backup --parallel=2 --throttle=1 --aria-log-dir-path=../../tmp/backup_aria_log_dir_path_rel +# starting server +# restart: --aria-log-file-size=8388608 --aria-log-purge-type=external --loose-aria-log-dir-path=../../tmp/backup_aria_log_dir_path_rel +# Check that the table is there after --copy-back +SELECT COUNT(*) from t1; +COUNT(*) +10 +DROP TABLE t1; +# Testing aria log files after --copy-back +SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/; +SHOW ENGINE aria logs; +Type Name Status +Aria aria_log.00000001 free +Aria aria_log.00000002 in use +# Restarting mariadbd with default parameters +# restart diff --git a/mysql-test/suite/mariabackup/aria_log_dir_path_rel.test b/mysql-test/suite/mariabackup/aria_log_dir_path_rel.test new file mode 100644 index 00000000000..c8169959929 --- /dev/null +++ b/mysql-test/suite/mariabackup/aria_log_dir_path_rel.test @@ -0,0 +1,4 @@ +--let $ARIA_LOGDIR_MARIADB=../../tmp/backup_aria_log_dir_path_rel +--let $ARIA_LOGDIR_FS=$MYSQLTEST_VARDIR/tmp/backup_aria_log_dir_path_rel + +--source aria_log_dir_path.test diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index 20fcc0b64b8..76d4f465b95 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -1567,7 +1567,11 @@ is_absolute_path( } #ifdef _WIN32 - if (path[1] == ':' && path[2] == OS_PATH_SEPARATOR) { + // This will conflict during a 10.5->10.6 merge. + // Choose the 10.6 version as is. + if (path[1] == ':' && + (path[2] == OS_PATH_SEPARATOR || + path[2] == OS_PATH_SEPARATOR_ALT)) { return(true); } #endif /* _WIN32 */ From 6dc6c22c14fe204dbac43b6132c5bd130c69aba1 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Fri, 21 Apr 2023 18:49:52 -0700 Subject: [PATCH 160/260] MDEV-31085 Crash when processing multi-update using view with optimizer_trace on This bug caused server crash when processing a multi-update statement that used views if optimizer tracing was enabled. The bug was introduced in the patch for MDEV-30539 that could incorrectly detect the most top level selects of queries if views were used in them. Approved by Oleksandr Byelkin --- mysql-test/main/opt_trace.result | 356 +++++++++++++++++++++++++++++++ mysql-test/main/opt_trace.test | 19 ++ sql/sql_select.cc | 4 +- 3 files changed, 377 insertions(+), 2 deletions(-) diff --git a/mysql-test/main/opt_trace.result b/mysql-test/main/opt_trace.result index a8b391ffbe8..a7a8fb88e6d 100644 --- a/mysql-test/main/opt_trace.result +++ b/mysql-test/main/opt_trace.result @@ -8505,5 +8505,361 @@ SELECT a FROM t1 WHERE (a,b) in (SELECT @c,@d); a DROP TABLE t1; # +# MDEV-31085: multi-update using view with optimizer trace enabled +# +SET SESSION optimizer_trace = 'enabled=on'; +CREATE TABLE t (a int, b int); +CREATE VIEW v AS SELECT 1 AS c UNION SELECT 2 AS c; +INSERT INTO t VALUES (0,4),(5,6); +UPDATE t, v SET t.b = t.a, t.a = v.c WHERE v.c < t.a; +SELECT * FROM information_schema.optimizer_trace; +QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES +UPDATE t, v SET t.b = t.a, t.a = v.c WHERE v.c < t.a { + "steps": [ + { + "view": { + "table": "v", + "select_id": 2, + "algorithm": "materialized" + } + }, + { + "join_preparation": { + "select_id": 2, + "steps": [ + { + "expanded_query": "/* select#2 */ select 1 AS c" + } + ] + } + }, + { + "join_preparation": { + "select_id": 3, + "steps": [ + { + "expanded_query": "/* select#3 */ select 2 AS c" + } + ] + } + }, + { + "join_preparation": { + "select_id": 1, + "steps": [ + { + "expanded_query": "/* select#1 */ update t join v set t.b = t.a,t.a = v.c where v.c < t.a" + } + ] + } + }, + { + "join_optimization": { + "select_id": 1, + "steps": [ + { + "condition_processing": { + "condition": "WHERE", + "original_condition": "v.c < t.a", + "steps": [ + { + "transformation": "equality_propagation", + "resulting_condition": "v.c < t.a" + }, + { + "transformation": "constant_propagation", + "resulting_condition": "v.c < t.a" + }, + { + "transformation": "trivial_condition_removal", + "resulting_condition": "v.c < t.a" + } + ] + } + }, + { + "join_optimization": { + "select_id": 2, + "steps": [] + } + }, + { + "join_optimization": { + "select_id": 3, + "steps": [] + } + }, + { + "table_dependencies": [ + { + "table": "t", + "row_may_be_null": false, + "map_bit": 0, + "depends_on_map_bits": [] + }, + { + "table": "", + "row_may_be_null": false, + "map_bit": 1, + "depends_on_map_bits": [] + } + ] + }, + { + "ref_optimizer_key_uses": [] + }, + { + "rows_estimation": [ + { + "table": "t", + "table_scan": { + "rows": 2, + "cost": 2.0044 + } + }, + { + "table": "", + "table_scan": { + "rows": 2, + "cost": 2 + } + } + ] + }, + { + "considered_execution_plans": [ + { + "plan_prefix": [], + "table": "t", + "best_access_path": { + "considered_access_paths": [ + { + "access_type": "scan", + "resulting_rows": 2, + "cost": 2.0044, + "chosen": true + } + ], + "chosen_access_method": { + "type": "scan", + "records": 2, + "cost": 2.0044, + "uses_join_buffering": false + } + }, + "rows_for_plan": 2, + "cost_for_plan": 2.4044, + "rest_of_plan": [ + { + "plan_prefix": ["t"], + "table": "", + "best_access_path": { + "considered_access_paths": [ + { + "access_type": "scan", + "resulting_rows": 2, + "cost": 2, + "chosen": true + } + ], + "chosen_access_method": { + "type": "scan", + "records": 2, + "cost": 2, + "uses_join_buffering": true + } + }, + "rows_for_plan": 4, + "cost_for_plan": 5.2044, + "estimated_join_cardinality": 4 + } + ] + }, + { + "plan_prefix": [], + "table": "", + "best_access_path": { + "considered_access_paths": [ + { + "access_type": "scan", + "resulting_rows": 2, + "cost": 2, + "chosen": true + } + ], + "chosen_access_method": { + "type": "scan", + "records": 2, + "cost": 2, + "uses_join_buffering": false + } + }, + "rows_for_plan": 2, + "cost_for_plan": 2.4, + "rest_of_plan": [ + { + "plan_prefix": [""], + "table": "t", + "best_access_path": { + "considered_access_paths": [ + { + "access_type": "scan", + "resulting_rows": 2, + "cost": 2.0044, + "chosen": true + } + ], + "chosen_access_method": { + "type": "scan", + "records": 2, + "cost": 2.0044, + "uses_join_buffering": true + } + }, + "rows_for_plan": 4, + "cost_for_plan": 5.2044, + "pruned_by_cost": true + } + ] + } + ] + }, + { + "best_join_order": ["t", ""] + }, + { + "attaching_conditions_to_tables": { + "original_condition": "v.c < t.a", + "attached_conditions_computation": [], + "attached_conditions_summary": [ + { + "table": "t", + "attached": null + }, + { + "table": "", + "attached": "v.c < t.a" + } + ] + } + } + ] + } + }, + { + "join_execution": { + "select_id": 1, + "steps": [ + { + "join_execution": { + "select_id": 2, + "steps": [] + } + }, + { + "join_execution": { + "select_id": 3, + "steps": [] + } + }, + { + "join_preparation": { + "select_id": "fake", + "steps": [ + { + "expanded_query": "select c AS c from dual" + } + ] + } + }, + { + "join_optimization": { + "select_id": "fake", + "steps": [ + { + "table_dependencies": [ + { + "table": "union", + "row_may_be_null": false, + "map_bit": 0, + "depends_on_map_bits": [] + } + ] + }, + { + "rows_estimation": [ + { + "table": "union", + "table_scan": { + "rows": 2, + "cost": 10.1 + } + } + ] + }, + { + "considered_execution_plans": [ + { + "plan_prefix": [], + "table": "union", + "best_access_path": { + "considered_access_paths": [ + { + "access_type": "scan", + "resulting_rows": 2, + "cost": 10.1, + "chosen": true + } + ], + "chosen_access_method": { + "type": "scan", + "records": 2, + "cost": 10.1, + "uses_join_buffering": false + } + }, + "rows_for_plan": 2, + "cost_for_plan": 10.5, + "estimated_join_cardinality": 2 + } + ] + }, + { + "best_join_order": ["union"] + }, + { + "attaching_conditions_to_tables": { + "original_condition": null, + "attached_conditions_computation": [], + "attached_conditions_summary": [ + { + "table": "union", + "attached": null + } + ] + } + } + ] + } + }, + { + "join_execution": { + "select_id": "fake", + "steps": [] + } + } + ] + } + } + ] +} 0 0 +SELECT * FROM t; +a b +0 4 +1 5 +SET optimizer_trace=DEFAULT; +DROP VIEW v; +DROP TABLE t; +# # End of 10.4 tests # diff --git a/mysql-test/main/opt_trace.test b/mysql-test/main/opt_trace.test index 0785d828a07..e0be5360069 100644 --- a/mysql-test/main/opt_trace.test +++ b/mysql-test/main/opt_trace.test @@ -677,6 +677,25 @@ INSERT INTO t1 VALUES (0,0); SELECT a FROM t1 WHERE (a,b) in (SELECT @c,@d); DROP TABLE t1; +--echo # +--echo # MDEV-31085: multi-update using view with optimizer trace enabled +--echo # + +SET SESSION optimizer_trace = 'enabled=on'; + +CREATE TABLE t (a int, b int); +CREATE VIEW v AS SELECT 1 AS c UNION SELECT 2 AS c; +INSERT INTO t VALUES (0,4),(5,6); +UPDATE t, v SET t.b = t.a, t.a = v.c WHERE v.c < t.a; +SELECT * FROM information_schema.optimizer_trace; + +SELECT * FROM t; + +SET optimizer_trace=DEFAULT; + +DROP VIEW v; +DROP TABLE t; + --echo # --echo # End of 10.4 tests --echo # diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 0651c1d58bd..03a2c3d0853 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -28050,7 +28050,7 @@ void st_select_lex::print_item_list(THD *thd, String *str, outer_select() can not be used here because it is for name resolution and will return NULL at any end of name resolution chain (view/derived) */ - bool top_level= (get_master()->get_master() == 0); + bool top_level= (get_master() == &thd->lex->unit); List_iterator_fast it(item_list); Item *item; while ((item= it++)) @@ -28157,7 +28157,7 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type) return; } - bool top_level= (get_master()->get_master() == 0); + bool top_level= (get_master() == &thd->lex->unit); enum explainable_cmd_type sel_type= SELECT_CMD; if (top_level) sel_type= get_explainable_cmd_type(thd); From 2c567b2fa37b60fd6db06ddc113d107fd9863208 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Sat, 22 Apr 2023 16:42:52 +0530 Subject: [PATCH 161/260] MDEV-30996 insert.. select in presence of full text index freezes all other commits at commit time - This patch does the following: git revert --no-commit 673243c8938957ef1c01ffd3bfd35b5ae31ef484 git revert --no-commit 6c669b9586f72d6d760cc3956c1a0cb09ace2367 git revert --no-commit bacaf2d4f4c6d77a0b6c1ae4daddd19f81ef6fa3 git checkout HEAD mysql-test git revert --no-commit 1fd7d3a9adac50de37e40e92188077e3515de505 Above command reverts MDEV-29277, MDEV-25581, MDEV-29342. When binlog is enabled, trasaction takes a lot of time to do sync operation on innodb fts table. This leads to block of other transaction commit. To avoid this failure, remove the fulltext sync operation during transaction commit. So reverted MDEV-25581 related patches. We filed MDEV-31105 to avoid the memory consumption problem during fulltext sync operation. --- .../innodb_fts/r/concurrent_insert.result | 2 +- mysql-test/suite/innodb_fts/r/sync.result | 16 +- .../suite/innodb_fts/r/sync_block.result | 83 +++++ .../suite/innodb_fts/t/concurrent_insert.test | 2 +- mysql-test/suite/innodb_fts/t/sync.test | 4 +- mysql-test/suite/innodb_fts/t/sync_block.test | 124 +++++++ storage/innobase/fts/fts0fts.cc | 325 +++++++++++++----- storage/innobase/fts/fts0opt.cc | 56 ++- storage/innobase/handler/handler0alter.cc | 8 +- storage/innobase/include/fts0fts.h | 9 +- storage/innobase/include/fts0types.h | 32 +- 11 files changed, 552 insertions(+), 109 deletions(-) create mode 100644 mysql-test/suite/innodb_fts/r/sync_block.result create mode 100644 mysql-test/suite/innodb_fts/t/sync_block.test diff --git a/mysql-test/suite/innodb_fts/r/concurrent_insert.result b/mysql-test/suite/innodb_fts/r/concurrent_insert.result index 2335982816b..bc47511b046 100644 --- a/mysql-test/suite/innodb_fts/r/concurrent_insert.result +++ b/mysql-test/suite/innodb_fts/r/concurrent_insert.result @@ -19,7 +19,7 @@ INSERT INTO t2 VALUES('mariadb'); connection default; SET @saved_dbug = @@GLOBAL.debug_dbug; SET GLOBAL debug_dbug ='+d,fts_instrument_sync_request,ib_optimize_wq_hang'; -SET DEBUG_SYNC= 'fts_sync_end +SET DEBUG_SYNC= 'fts_instrument_sync_request SIGNAL drop_index_start WAIT_FOR sync_op'; INSERT INTO t1 VALUES('Keyword'); connect con1,localhost,root,,,; diff --git a/mysql-test/suite/innodb_fts/r/sync.result b/mysql-test/suite/innodb_fts/r/sync.result index 74a5d2f13fb..928efffdb21 100644 --- a/mysql-test/suite/innodb_fts/r/sync.result +++ b/mysql-test/suite/innodb_fts/r/sync.result @@ -11,19 +11,19 @@ INSERT INTO t1(title) VALUES('database'); connection con1; SET @old_dbug = @@SESSION.debug_dbug; SET debug_dbug = '+d,fts_instrument_sync_debug'; -SET DEBUG_SYNC= 'fts_sync_end SIGNAL written WAIT_FOR selected'; +SET DEBUG_SYNC= 'fts_write_node SIGNAL written WAIT_FOR selected'; INSERT INTO t1(title) VALUES('mysql database'); connection default; SET DEBUG_SYNC= 'now WAIT_FOR written'; SET GLOBAL innodb_ft_aux_table="test/t1"; SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE; WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION -SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE; -WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION database 2 3 2 2 0 database 2 3 2 3 6 mysql 1 3 2 1 0 mysql 1 3 2 3 0 +SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE; +WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION SET GLOBAL innodb_ft_aux_table=default; SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database'); FTS_DOC_ID title @@ -59,7 +59,7 @@ INSERT INTO t1(title) VALUES('mysql'); INSERT INTO t1(title) VALUES('database'); connection con1; SET debug_dbug = '+d,fts_instrument_sync_debug'; -SET DEBUG_SYNC= 'fts_sync_end SIGNAL written WAIT_FOR inserted'; +SET DEBUG_SYNC= 'fts_write_node SIGNAL written WAIT_FOR inserted'; INSERT INTO t1(title) VALUES('mysql database'); connection default; SET DEBUG_SYNC= 'now WAIT_FOR written'; @@ -70,14 +70,14 @@ SET debug_dbug = @old_dbug; SET GLOBAL innodb_ft_aux_table="test/t1"; SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE; WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION -database 4 4 1 4 6 -mysql 4 4 1 4 0 SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE; WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION database 2 3 2 2 0 database 2 3 2 3 6 -mysql 1 3 2 1 0 -mysql 1 3 2 3 0 +database 4 4 1 4 6 +mysql 1 4 3 1 0 +mysql 1 4 3 3 0 +mysql 1 4 3 4 0 SET GLOBAL innodb_ft_aux_table=default; SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database'); FTS_DOC_ID title diff --git a/mysql-test/suite/innodb_fts/r/sync_block.result b/mysql-test/suite/innodb_fts/r/sync_block.result new file mode 100644 index 00000000000..65bee127e80 --- /dev/null +++ b/mysql-test/suite/innodb_fts/r/sync_block.result @@ -0,0 +1,83 @@ +SET @old_log_output = @@global.log_output; +SET @old_slow_query_log = @@global.slow_query_log; +SET @old_general_log = @@global.general_log; +SET @old_long_query_time = @@global.long_query_time; +SET @old_debug = @@global.debug_dbug; +SET GLOBAL log_output = 'TABLE'; +SET GLOBAL general_log = 1; +SET GLOBAL slow_query_log = 1; +SET GLOBAL long_query_time = 1; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connection default; +# Case 1: Sync blocks DML(insert) on the same table. +CREATE TABLE t1 ( +FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, +title VARCHAR(200), +FULLTEXT(title) +) ENGINE = InnoDB; +connection con1; +SET GLOBAL debug_dbug='+d,fts_instrument_sync_debug,fts_instrument_sync_sleep'; +SET DEBUG_SYNC= 'fts_sync_begin SIGNAL begin WAIT_FOR continue'; +INSERT INTO t1(title) VALUES('mysql database'); +connection con2; +SET DEBUG_SYNC= 'now WAIT_FOR begin'; +SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database'); +connection default; +SET DEBUG_SYNC= 'now SIGNAL continue'; +connection con1; +/* connection con1 */ INSERT INTO t1(title) VALUES('mysql database'); +connection con2; +/* conneciton con2 */ SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database'); +FTS_DOC_ID title +connection default; +# make con1 & con2 show up in mysql.slow_log +SELECT SLEEP(2); +SLEEP(2) +0 +# slow log results should only contain INSERT INTO t1. +SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02'; +sql_text +INSERT INTO t1(title) VALUES('mysql database') +SET GLOBAL debug_dbug = @old_debug; +TRUNCATE TABLE mysql.slow_log; +DROP TABLE t1; +# Case 2: Sync blocks DML(insert) on other tables. +CREATE TABLE t1 ( +FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, +title VARCHAR(200), +FULLTEXT(title) +) ENGINE = InnoDB; +CREATE TABLE t2(id INT); +connection con1; +SET GLOBAL debug_dbug='+d,fts_instrument_sync_request,fts_instrument_sync_sleep'; +SET DEBUG_SYNC= 'fts_instrument_sync_request SIGNAL begin WAIT_FOR continue'; +INSERT INTO t1(title) VALUES('mysql database'); +connection con2; +SET DEBUG_SYNC= 'now WAIT_FOR begin'; +INSERT INTO t2 VALUES(1); +connection default; +SET DEBUG_SYNC= 'now SIGNAL continue'; +connection con1; +/* connection con1 */ INSERT INTO t1(title) VALUES('mysql database'); +connection con2; +/* conneciton con2 */ INSERT INTO t2 VALUES(1); +connection default; +SET DEBUG_SYNC = 'RESET'; +# make con1 & con2 show up in mysql.slow_log +SELECT SLEEP(2); +SLEEP(2) +0 +# slow log results should be empty here. +SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02'; +sql_text +SET GLOBAL debug_dbug = @old_debug; +TRUNCATE TABLE mysql.slow_log; +DROP TABLE t1,t2; +disconnect con1; +disconnect con2; +# Restore slow log settings. +SET GLOBAL log_output = @old_log_output; +SET GLOBAL general_log = @old_general_log; +SET GLOBAL slow_query_log = @old_slow_query_log; +SET GLOBAL long_query_time = @old_long_query_time; diff --git a/mysql-test/suite/innodb_fts/t/concurrent_insert.test b/mysql-test/suite/innodb_fts/t/concurrent_insert.test index b6991f6e503..9b4d9517b1a 100644 --- a/mysql-test/suite/innodb_fts/t/concurrent_insert.test +++ b/mysql-test/suite/innodb_fts/t/concurrent_insert.test @@ -31,7 +31,7 @@ INSERT INTO t2 VALUES('mariadb'); connection default; SET @saved_dbug = @@GLOBAL.debug_dbug; SET GLOBAL debug_dbug ='+d,fts_instrument_sync_request,ib_optimize_wq_hang'; -SET DEBUG_SYNC= 'fts_sync_end +SET DEBUG_SYNC= 'fts_instrument_sync_request SIGNAL drop_index_start WAIT_FOR sync_op'; send INSERT INTO t1 VALUES('Keyword'); diff --git a/mysql-test/suite/innodb_fts/t/sync.test b/mysql-test/suite/innodb_fts/t/sync.test index 7c5c835f2ee..168309a5c92 100644 --- a/mysql-test/suite/innodb_fts/t/sync.test +++ b/mysql-test/suite/innodb_fts/t/sync.test @@ -27,7 +27,7 @@ connection con1; SET @old_dbug = @@SESSION.debug_dbug; SET debug_dbug = '+d,fts_instrument_sync_debug'; -SET DEBUG_SYNC= 'fts_sync_end SIGNAL written WAIT_FOR selected'; +SET DEBUG_SYNC= 'fts_write_node SIGNAL written WAIT_FOR selected'; send INSERT INTO t1(title) VALUES('mysql database'); @@ -74,7 +74,7 @@ connection con1; SET debug_dbug = '+d,fts_instrument_sync_debug'; -SET DEBUG_SYNC= 'fts_sync_end SIGNAL written WAIT_FOR inserted'; +SET DEBUG_SYNC= 'fts_write_node SIGNAL written WAIT_FOR inserted'; send INSERT INTO t1(title) VALUES('mysql database'); diff --git a/mysql-test/suite/innodb_fts/t/sync_block.test b/mysql-test/suite/innodb_fts/t/sync_block.test new file mode 100644 index 00000000000..895d2ba8a59 --- /dev/null +++ b/mysql-test/suite/innodb_fts/t/sync_block.test @@ -0,0 +1,124 @@ +# +# BUG#22516559 MYSQL INSTANCE STALLS WHEN SYNCING FTS INDEX +# + +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc +--source include/have_log_bin.inc +--source include/count_sessions.inc + +SET @old_log_output = @@global.log_output; +SET @old_slow_query_log = @@global.slow_query_log; +SET @old_general_log = @@global.general_log; +SET @old_long_query_time = @@global.long_query_time; +SET @old_debug = @@global.debug_dbug; + +SET GLOBAL log_output = 'TABLE'; +SET GLOBAL general_log = 1; +SET GLOBAL slow_query_log = 1; +SET GLOBAL long_query_time = 1; + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); +connection default; + +--echo # Case 1: Sync blocks DML(insert) on the same table. +CREATE TABLE t1 ( + FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, + title VARCHAR(200), + FULLTEXT(title) +) ENGINE = InnoDB; + +connection con1; + +SET GLOBAL debug_dbug='+d,fts_instrument_sync_debug,fts_instrument_sync_sleep'; + +SET DEBUG_SYNC= 'fts_sync_begin SIGNAL begin WAIT_FOR continue'; + +send INSERT INTO t1(title) VALUES('mysql database'); + +connection con2; + +SET DEBUG_SYNC= 'now WAIT_FOR begin'; + +send SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database'); + +connection default; +SET DEBUG_SYNC= 'now SIGNAL continue'; + +connection con1; +--echo /* connection con1 */ INSERT INTO t1(title) VALUES('mysql database'); +--reap + +connection con2; +--echo /* conneciton con2 */ SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database'); +--reap + +connection default; +-- echo # make con1 & con2 show up in mysql.slow_log +SELECT SLEEP(2); +-- echo # slow log results should only contain INSERT INTO t1. +SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02'; + +SET GLOBAL debug_dbug = @old_debug; +TRUNCATE TABLE mysql.slow_log; + +DROP TABLE t1; + +--echo # Case 2: Sync blocks DML(insert) on other tables. +CREATE TABLE t1 ( + FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, + title VARCHAR(200), + FULLTEXT(title) +) ENGINE = InnoDB; + +CREATE TABLE t2(id INT); + +connection con1; + +SET GLOBAL debug_dbug='+d,fts_instrument_sync_request,fts_instrument_sync_sleep'; + +SET DEBUG_SYNC= 'fts_instrument_sync_request SIGNAL begin WAIT_FOR continue'; + +send INSERT INTO t1(title) VALUES('mysql database'); + +connection con2; + +SET DEBUG_SYNC= 'now WAIT_FOR begin'; + +send INSERT INTO t2 VALUES(1); + +connection default; +SET DEBUG_SYNC= 'now SIGNAL continue'; + +connection con1; +--echo /* connection con1 */ INSERT INTO t1(title) VALUES('mysql database'); +--reap + +connection con2; +--echo /* conneciton con2 */ INSERT INTO t2 VALUES(1); +--reap + +connection default; +SET DEBUG_SYNC = 'RESET'; +-- echo # make con1 & con2 show up in mysql.slow_log +SELECT SLEEP(2); +-- echo # slow log results should be empty here. +SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02'; + +SET GLOBAL debug_dbug = @old_debug; +TRUNCATE TABLE mysql.slow_log; + +DROP TABLE t1,t2; + +disconnect con1; +disconnect con2; + +--source include/wait_until_count_sessions.inc + +-- echo # Restore slow log settings. +SET GLOBAL log_output = @old_log_output; +SET GLOBAL general_log = @old_general_log; +SET GLOBAL slow_query_log = @old_slow_query_log; +SET GLOBAL long_query_time = @old_long_query_time; diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc index eed2eb72cd1..f94aed58d21 100644 --- a/storage/innobase/fts/fts0fts.cc +++ b/storage/innobase/fts/fts0fts.cc @@ -38,22 +38,6 @@ Full Text Search interface #include "dict0stats.h" #include "btr0pcur.h" -/** The SYNC state of the cache. There is one instance of this struct -associated with each ADD thread. */ -struct fts_sync_t { - /** Transaction used for SYNCing the cache to disk */ - trx_t *trx; - /** Table with FTS index(es) */ - dict_table_t *table; - /** Max size in bytes of the cache */ - ulint max_cache_size; - /** The doc id at which the cache was noted as being - full, we use this to set the upper_limit field */ - doc_id_t max_doc_id; - /** SYNC start time; only used if fts_enable_diag_print */ - time_t start_time; -}; - static const ulint FTS_MAX_ID_LEN = 32; /** Column name from the FTS config table */ @@ -201,8 +185,15 @@ struct fts_tokenize_param_t { /** Run SYNC on the table, i.e., write out data from the cache to the FTS auxiliary INDEX table and clear the cache at the end. @param[in,out] sync sync state +@param[in] unlock_cache whether unlock cache lock when write node +@param[in] wait whether wait when a sync is in progress @return DB_SUCCESS if all OK */ -static dberr_t fts_sync(fts_sync_t *sync); +static +dberr_t +fts_sync( + fts_sync_t* sync, + bool unlock_cache, + bool wait); /****************************************************************//** Release all resources help by the words rb tree e.g., the node ilist. */ @@ -275,6 +266,7 @@ fts_cache_destroy(fts_cache_t* cache) mysql_mutex_destroy(&cache->init_lock); mysql_mutex_destroy(&cache->deleted_lock); mysql_mutex_destroy(&cache->doc_id_lock); + pthread_cond_destroy(&cache->sync->cond); if (cache->stopword_info.cached_stopword) { rbt_free(cache->stopword_info.cached_stopword); @@ -574,6 +566,7 @@ fts_index_cache_init( for (i = 0; i < FTS_NUM_AUX_INDEX; ++i) { ut_a(index_cache->ins_graph[i] == NULL); + ut_a(index_cache->sel_graph[i] == NULL); } } @@ -643,6 +636,7 @@ fts_cache_create( mem_heap_zalloc(heap, sizeof(fts_sync_t))); cache->sync->table = table; + pthread_cond_init(&cache->sync->cond, nullptr); /* Create the index cache vector that will hold the inverted indexes. */ cache->indexes = ib_vector_create( @@ -968,6 +962,10 @@ fts_cache_index_cache_create( mem_heap_zalloc(static_cast( cache->self_heap->arg), n_bytes)); + index_cache->sel_graph = static_cast( + mem_heap_zalloc(static_cast( + cache->self_heap->arg), n_bytes)); + fts_index_cache_init(cache->sync_heap, index_cache); if (cache->get_docs) { @@ -1041,6 +1039,13 @@ fts_cache_clear( index_cache->ins_graph[j] = NULL; } + + if (index_cache->sel_graph[j] != NULL) { + + que_graph_free(index_cache->sel_graph[j]); + + index_cache->sel_graph[j] = NULL; + } } index_cache->doc_stats = NULL; @@ -1333,7 +1338,8 @@ fts_cache_add_doc( ib_vector_last(word->nodes)); } - if (!fts_node || fts_node->ilist_size > FTS_ILIST_MAX_SIZE + if (fts_node == NULL || fts_node->synced + || fts_node->ilist_size > FTS_ILIST_MAX_SIZE || doc_id < fts_node->last_doc_id) { fts_node = static_cast( @@ -3320,7 +3326,7 @@ fts_add_doc_from_tuple( if (cache->total_size > fts_max_cache_size / 5 || fts_need_sync) { - fts_sync(cache->sync); + fts_sync(cache->sync, true, false); } mtr_start(&mtr); @@ -3356,7 +3362,7 @@ fts_add_doc_by_id( dict_index_t* fts_id_index; ibool is_id_cluster; fts_cache_t* cache = ftt->table->fts->cache; - bool need_sync= false; + ut_ad(cache->get_docs); /* If Doc ID has been supplied by the user, then the table @@ -3496,32 +3502,44 @@ fts_add_doc_by_id( get_doc->index_cache, doc_id, doc.tokens); - /** FTS cache sync should happen - frequently. Because user thread - shouldn't hold the cache lock for - longer time. So cache should sync - whenever cache size exceeds 512 KB */ - need_sync = - cache->total_size > 512*1024; + bool need_sync = !cache->sync->in_progress + && (fts_need_sync + || (cache->total_size + - cache->total_size_at_sync) + > fts_max_cache_size / 10); + if (need_sync) { + cache->total_size_at_sync = + cache->total_size; + } mysql_mutex_unlock(&table->fts->cache->lock); DBUG_EXECUTE_IF( "fts_instrument_sync", - fts_sync_table(table); + fts_optimize_request_sync_table(table); + mysql_mutex_lock(&cache->lock); + if (cache->sync->in_progress) + my_cond_wait( + &cache->sync->cond, + &cache->lock.m_mutex); + mysql_mutex_unlock(&cache->lock); ); DBUG_EXECUTE_IF( "fts_instrument_sync_debug", - fts_sync(cache->sync); + fts_sync(cache->sync, true, true); ); DEBUG_SYNC_C("fts_instrument_sync_request"); DBUG_EXECUTE_IF( "fts_instrument_sync_request", - need_sync= true; + fts_optimize_request_sync_table(table); ); + if (need_sync) { + fts_optimize_request_sync_table(table); + } + mtr_start(&mtr); if (i < num_idx - 1) { @@ -3547,10 +3565,6 @@ func_exit: ut_free(pcur.old_rec_buf); mem_heap_free(heap); - - if (need_sync) { - fts_sync_table(table); - } } @@ -3910,13 +3924,15 @@ static MY_ATTRIBUTE((nonnull, warn_unused_result)) dberr_t fts_sync_write_words( trx_t* trx, - fts_index_cache_t* index_cache) + fts_index_cache_t* index_cache, + bool unlock_cache) { fts_table_t fts_table; ulint n_nodes = 0; ulint n_words = 0; const ib_rbt_node_t* rbt_node; dberr_t error = DB_SUCCESS; + ibool print_error = FALSE; dict_table_t* table = index_cache->index->table; FTS_INIT_INDEX_TABLE( @@ -3947,36 +3963,53 @@ fts_sync_write_words( fts_table.suffix = fts_get_suffix(selected); + /* We iterate over all the nodes even if there was an error */ for (i = 0; i < ib_vector_size(word->nodes); ++i) { fts_node_t* fts_node = static_cast( ib_vector_get(word->nodes, i)); - error = fts_write_node( - trx, &index_cache->ins_graph[selected], - &fts_table, &word->text, fts_node); + if (fts_node->synced) { + continue; + } else { + fts_node->synced = true; + } - DEBUG_SYNC_C("fts_write_node"); - DBUG_EXECUTE_IF("fts_write_node_crash", + /*FIXME: we need to handle the error properly. */ + if (error == DB_SUCCESS) { + if (unlock_cache) { + mysql_mutex_unlock( + &table->fts->cache->lock); + } + + error = fts_write_node( + trx, + &index_cache->ins_graph[selected], + &fts_table, &word->text, fts_node); + + DEBUG_SYNC_C("fts_write_node"); + DBUG_EXECUTE_IF("fts_write_node_crash", DBUG_SUICIDE();); - DBUG_EXECUTE_IF("fts_instrument_sync_sleep", + DBUG_EXECUTE_IF( + "fts_instrument_sync_sleep", std::this_thread::sleep_for( std::chrono::seconds(1));); - if (error != DB_SUCCESS) { - goto err_exit; + if (unlock_cache) { + mysql_mutex_lock( + &table->fts->cache->lock); + } } } n_nodes += ib_vector_size(word->nodes); - if (UNIV_UNLIKELY(error != DB_SUCCESS)) { -err_exit: + if (UNIV_UNLIKELY(error != DB_SUCCESS) && !print_error) { ib::error() << "(" << error << ") writing" " word node to FTS auxiliary index table " << table->name; - break; + print_error = TRUE; } } @@ -4035,44 +4068,58 @@ fts_sync_index( ut_ad(rbt_validate(index_cache->words)); - return(fts_sync_write_words(trx, index_cache)); + return(fts_sync_write_words(trx, index_cache, sync->unlock_cache)); } -/** Rollback a sync operation -@param[in,out] sync sync state */ +/** Check if index cache has been synced completely +@param[in,out] index_cache index cache +@return true if index is synced, otherwise false. */ static -void -fts_sync_rollback( - fts_sync_t* sync) +bool +fts_sync_index_check( + fts_index_cache_t* index_cache) { - trx_t* trx = sync->trx; - fts_cache_t* cache = sync->table->fts->cache; + const ib_rbt_node_t* rbt_node; - for (ulint i = 0; i < ib_vector_size(cache->indexes); ++i) { - ulint j; - fts_index_cache_t* index_cache; + for (rbt_node = rbt_first(index_cache->words); + rbt_node != NULL; + rbt_node = rbt_next(index_cache->words, rbt_node)) { - index_cache = static_cast( - ib_vector_get(cache->indexes, i)); + fts_tokenizer_word_t* word; + word = rbt_value(fts_tokenizer_word_t, rbt_node); - for (j = 0; fts_index_selector[j].value; ++j) { + fts_node_t* fts_node; + fts_node = static_cast(ib_vector_last(word->nodes)); - if (index_cache->ins_graph[j] != NULL) { - - que_graph_free(index_cache->ins_graph[j]); - - index_cache->ins_graph[j] = NULL; - } + if (!fts_node->synced) { + return(false); } } - mysql_mutex_unlock(&cache->lock); + return(true); +} - fts_sql_rollback(trx); +/** Reset synced flag in index cache when rollback +@param[in,out] index_cache index cache */ +static +void +fts_sync_index_reset( + fts_index_cache_t* index_cache) +{ + const ib_rbt_node_t* rbt_node; - /* Avoid assertion in trx_t::free(). */ - trx->dict_operation_lock_mode = false; - trx->free(); + for (rbt_node = rbt_first(index_cache->words); + rbt_node != NULL; + rbt_node = rbt_next(index_cache->words, rbt_node)) { + + fts_tokenizer_word_t* word; + word = rbt_value(fts_tokenizer_word_t, rbt_node); + + fts_node_t* fts_node; + fts_node = static_cast(ib_vector_last(word->nodes)); + + fts_node->synced = false; + } } /** Commit the SYNC, change state of processed doc ids etc. @@ -4105,20 +4152,19 @@ fts_sync_commit( sync, cache->deleted_doc_ids); } + /* We need to do this within the deleted lock since fts_delete() can + attempt to add a deleted doc id to the cache deleted id array. */ + fts_cache_clear(cache); + DEBUG_SYNC_C("fts_deleted_doc_ids_clear"); + fts_cache_init(cache); + mysql_mutex_unlock(&cache->lock); + if (UNIV_LIKELY(error == DB_SUCCESS)) { - /* We need to do this within the deleted lock - since fts_delete() can attempt to add a deleted - doc id to the cache deleted id array. */ - fts_cache_clear(cache); - DEBUG_SYNC_C("fts_deleted_doc_ids_clear"); - fts_cache_init(cache); - mysql_mutex_unlock(&cache->lock); fts_sql_commit(trx); } else { + fts_sql_rollback(trx); ib::error() << "(" << error << ") during SYNC of " "table " << sync->table->name; - fts_sync_rollback(sync); - return error; } if (UNIV_UNLIKELY(fts_enable_diag_print) && elapsed_time) { @@ -4138,13 +4184,66 @@ fts_sync_commit( return(error); } +/** Rollback a sync operation +@param[in,out] sync sync state */ +static +void +fts_sync_rollback( + fts_sync_t* sync) +{ + trx_t* trx = sync->trx; + fts_cache_t* cache = sync->table->fts->cache; + + for (ulint i = 0; i < ib_vector_size(cache->indexes); ++i) { + ulint j; + fts_index_cache_t* index_cache; + + index_cache = static_cast( + ib_vector_get(cache->indexes, i)); + + /* Reset synced flag so nodes will not be skipped + in the next sync, see fts_sync_write_words(). */ + fts_sync_index_reset(index_cache); + + for (j = 0; fts_index_selector[j].value; ++j) { + + if (index_cache->ins_graph[j] != NULL) { + + que_graph_free(index_cache->ins_graph[j]); + + index_cache->ins_graph[j] = NULL; + } + + if (index_cache->sel_graph[j] != NULL) { + + que_graph_free(index_cache->sel_graph[j]); + + index_cache->sel_graph[j] = NULL; + } + } + } + + mysql_mutex_unlock(&cache->lock); + + fts_sql_rollback(trx); + + /* Avoid assertion in trx_t::free(). */ + trx->dict_operation_lock_mode = false; + trx->free(); +} + /** Run SYNC on the table, i.e., write out data from the cache to the FTS auxiliary INDEX table and clear the cache at the end. @param[in,out] sync sync state @param[in] unlock_cache whether unlock cache lock when write node @param[in] wait whether wait when a sync is in progress @return DB_SUCCESS if all OK */ -static dberr_t fts_sync(fts_sync_t *sync) +static +dberr_t +fts_sync( + fts_sync_t* sync, + bool unlock_cache, + bool wait) { if (srv_read_only_mode) { return DB_READ_ONLY; @@ -4155,13 +4254,33 @@ static dberr_t fts_sync(fts_sync_t *sync) fts_cache_t* cache = sync->table->fts->cache; mysql_mutex_lock(&cache->lock); + + /* Check if cache is being synced. + Note: we release cache lock in fts_sync_write_words() to + avoid long wait for the lock by other threads. */ + if (sync->in_progress) { + if (!wait) { + mysql_mutex_unlock(&cache->lock); + return(DB_SUCCESS); + } + do { + my_cond_wait(&sync->cond, &cache->lock.m_mutex); + } while (sync->in_progress); + } + + sync->unlock_cache = unlock_cache; + sync->in_progress = true; + DEBUG_SYNC_C("fts_sync_begin"); fts_sync_begin(sync); +begin_sync: const size_t fts_cache_size= fts_max_cache_size; if (cache->total_size > fts_cache_size) { /* Avoid the case: sync never finish when insert/update keeps comming. */ + ut_ad(sync->unlock_cache); + sync->unlock_cache = false; ib::warn() << "Total InnoDB FTS size " << cache->total_size << " for the table " << cache->sync->table->name @@ -4185,23 +4304,52 @@ static dberr_t fts_sync(fts_sync_t *sync) error = fts_sync_index(sync, index_cache); if (error != DB_SUCCESS) { - goto err_exit; + goto end_sync; + } + + if (!sync->unlock_cache + && cache->total_size < fts_max_cache_size) { + /* Reset the unlock cache if the value + is less than innodb_ft_cache_size */ + sync->unlock_cache = true; } } DBUG_EXECUTE_IF("fts_instrument_sync_interrupted", + sync->interrupted = true; error = DB_INTERRUPTED; - goto err_exit; + goto end_sync; ); - if (error == DB_SUCCESS) { + /* Make sure all the caches are synced. */ + for (i = 0; i < ib_vector_size(cache->indexes); ++i) { + fts_index_cache_t* index_cache; + + index_cache = static_cast( + ib_vector_get(cache->indexes, i)); + + if (index_cache->index->to_be_dropped + || fts_sync_index_check(index_cache)) { + continue; + } + + goto begin_sync; + } + +end_sync: + if (error == DB_SUCCESS && !sync->interrupted) { error = fts_sync_commit(sync); } else { -err_exit: fts_sync_rollback(sync); - return error; } + mysql_mutex_lock(&cache->lock); + ut_ad(sync->in_progress); + sync->interrupted = false; + sync->in_progress = false; + pthread_cond_broadcast(&sync->cond); + mysql_mutex_unlock(&cache->lock); + /* We need to check whether an optimize is required, for that we make copies of the two variables that control the trigger. These variables can change behind our back and we don't want to hold the @@ -4213,7 +4361,6 @@ err_exit: mysql_mutex_unlock(&cache->deleted_lock); - DEBUG_SYNC_C("fts_sync_end"); return(error); } @@ -4222,12 +4369,12 @@ FTS auxiliary INDEX table and clear the cache at the end. @param[in,out] table fts table @param[in] wait whether wait for existing sync to finish @return DB_SUCCESS on success, error code on failure. */ -dberr_t fts_sync_table(dict_table_t* table) +dberr_t fts_sync_table(dict_table_t* table, bool wait) { ut_ad(table->fts); return table->space && !table->corrupted && table->fts->cache - ? fts_sync(table->fts->cache->sync) + ? fts_sync(table->fts->cache->sync, !wait, wait) : DB_SUCCESS; } diff --git a/storage/innobase/fts/fts0opt.cc b/storage/innobase/fts/fts0opt.cc index 7c40a25e6e7..fe31767d901 100644 --- a/storage/innobase/fts/fts0opt.cc +++ b/storage/innobase/fts/fts0opt.cc @@ -83,8 +83,9 @@ enum fts_msg_type_t { FTS_MSG_ADD_TABLE, /*!< Add table to the optimize thread's work queue */ - FTS_MSG_DEL_TABLE /*!< Remove a table from the optimize + FTS_MSG_DEL_TABLE, /*!< Remove a table from the optimize threads work queue */ + FTS_MSG_SYNC_TABLE /*!< Sync fts cache of a table */ }; /** Compressed list of words that have been read from FTS INDEX @@ -2624,6 +2625,36 @@ fts_optimize_remove_table( mysql_mutex_unlock(&fts_optimize_wq->mutex); } +/** Send sync fts cache for the table. +@param[in] table table to sync */ +void +fts_optimize_request_sync_table( + dict_table_t* table) +{ + /* if the optimize system not yet initialized, return */ + if (!fts_optimize_wq) { + return; + } + + mysql_mutex_lock(&fts_optimize_wq->mutex); + + /* FTS optimizer thread is already exited */ + if (fts_opt_start_shutdown) { + ib::info() << "Try to sync table " << table->name + << " after FTS optimize thread exiting."; + } else if (table->fts->sync_message) { + /* If the table already has SYNC message in + fts_optimize_wq queue then ignore it */ + } else { + add_msg(fts_optimize_create_msg(FTS_MSG_SYNC_TABLE, table)); + table->fts->sync_message = true; + DBUG_EXECUTE_IF("fts_optimize_wq_count_check", + DBUG_ASSERT(fts_optimize_wq->length <= 1000);); + } + + mysql_mutex_unlock(&fts_optimize_wq->mutex); +} + /** Add a table to fts_slots if it doesn't already exist. */ static bool fts_optimize_new_table(dict_table_t* table) { @@ -2765,8 +2796,7 @@ static void fts_optimize_sync_table(dict_table_t *table, if (sync_table->fts && sync_table->fts->cache && sync_table->is_accessible()) { - fts_sync_table(sync_table); - + fts_sync_table(sync_table, false); if (process_message) { mysql_mutex_lock(&fts_optimize_wq->mutex); @@ -2866,6 +2896,24 @@ retry_later: --n_tables; } break; + + case FTS_MSG_SYNC_TABLE: + if (UNIV_UNLIKELY(wsrep_sst_disable_writes)) { + add_msg(msg); + goto retry_later; + } + + DBUG_EXECUTE_IF( + "fts_instrument_msg_sync_sleep", + std::this_thread::sleep_for( + std::chrono::milliseconds( + 300));); + + fts_optimize_sync_table( + static_cast(msg->ptr), + true); + break; + default: ut_error; } @@ -2998,7 +3046,7 @@ void fts_sync_during_ddl(dict_table_t* table) if (!sync_message) return; - fts_sync_table(table); + fts_sync_table(table, false); mysql_mutex_lock(&fts_optimize_wq->mutex); table->fts->sync_message = false; diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 7e4beeede3b..06101e6cca5 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -11584,8 +11584,12 @@ foreign_fail: ut_d(dict_table_check_for_dup_indexes( ctx->new_table, CHECK_ABORTED_OK)); - ut_ad(!ctx->new_table->fts - || fts_check_cached_index(ctx->new_table)); +#ifdef UNIV_DEBUG + if (!(ctx->new_table->fts != NULL + && ctx->new_table->fts->cache->sync->in_progress)) { + ut_a(fts_check_cached_index(ctx->new_table)); + } +#endif } unlock_and_close_files(deleted, trx); diff --git a/storage/innobase/include/fts0fts.h b/storage/innobase/include/fts0fts.h index 720fe7f25b9..c0151b44063 100644 --- a/storage/innobase/include/fts0fts.h +++ b/storage/innobase/include/fts0fts.h @@ -648,6 +648,12 @@ fts_optimize_remove_table( void fts_optimize_shutdown(); +/** Send sync fts cache for the table. +@param[in] table table to sync */ +void +fts_optimize_request_sync_table( + dict_table_t* table); + /**********************************************************************//** Take a FTS savepoint. */ void @@ -702,8 +708,9 @@ fts_savepoint_rollback_last_stmt( /** Run SYNC on the table, i.e., write out data from the cache to the FTS auxiliary INDEX table and clear the cache at the end. @param[in,out] table fts table +@param[in] wait whether to wait for existing sync to finish @return DB_SUCCESS on success, error code on failure. */ -dberr_t fts_sync_table(dict_table_t* table); +dberr_t fts_sync_table(dict_table_t* table, bool wait = true); /****************************************************************//** Create an FTS index cache. */ diff --git a/storage/innobase/include/fts0types.h b/storage/innobase/include/fts0types.h index 04e99d595c5..fb278d543c4 100644 --- a/storage/innobase/include/fts0types.h +++ b/storage/innobase/include/fts0types.h @@ -75,6 +75,7 @@ struct fts_index_cache_t { que_t** ins_graph; /*!< Insert query graphs */ + que_t** sel_graph; /*!< Select query graphs */ CHARSET_INFO* charset; /*!< charset */ }; @@ -86,7 +87,35 @@ struct fts_stopword_t { CHARSET_INFO* charset; /*!< charset for stopword */ }; -struct fts_sync_t; +/** The SYNC state of the cache. There is one instance of this struct +associated with each ADD thread. */ +struct fts_sync_t { + trx_t* trx; /*!< The transaction used for SYNCing + the cache to disk */ + dict_table_t* table; /*!< Table with FTS index(es) */ + ulint max_cache_size; /*!< Max size in bytes of the cache */ + ibool cache_full; /*!< flag, when true it indicates that + we need to sync the cache to disk */ + ulint lower_index; /*!< the start index of the doc id + vector from where to start adding + documents to the FTS cache */ + ulint upper_index; /*!< max index of the doc id vector to + add to the FTS cache */ + ibool interrupted; /*!< TRUE if SYNC was interrupted */ + doc_id_t min_doc_id; /*!< The smallest doc id added to the + cache. It should equal to + doc_ids[lower_index] */ + doc_id_t max_doc_id; /*!< The doc id at which the cache was + noted as being full, we use this to + set the upper_limit field */ + time_t start_time; /*!< SYNC start time; only used if + fts_enable_diag_print */ + bool in_progress; /*!< flag whether sync is in progress.*/ + bool unlock_cache; /*!< flag whether unlock cache when + write fts node */ + /** condition variable for in_progress; used with table->fts->cache->lock */ + pthread_cond_t cond; +}; /** The cache for the FTS system. It is a memory-based inverted index that new entries are added to, until it grows over the configured maximum @@ -175,6 +204,7 @@ struct fts_node_t { ulint ilist_size_alloc; /*!< Allocated size of ilist in bytes */ + bool synced; /*!< flag whether the node is synced */ }; /** A tokenizer word. Contains information about one word. */ From d3e394b3b1ff1e2c4e160972aad1f78a13fbb62e Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 24 Apr 2023 10:27:55 +0400 Subject: [PATCH 162/260] A cleanup for MDEV-30968 mariadb-backup does not copy Aria logs if aria_log_dir_path is used Fixing buildbot failures on mariabackup.aria_log_dir_path_rel. The problem was that directory_exists() was called with the relative aria_log_dir_path value, while the current directory in mariadb-backup is not necessarily equal to datadir when MTR is running. Fix: - Moving building the absolute path un level upper: from the function copy_back_aria_logs() to the function copy_back(). - Passing the built absolute path to both directory_exists() and copy_back_aria_logs() as a parameter. --- extra/mariabackup/backup_copy.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc index 8ab52fa983b..05acc1e6765 100644 --- a/extra/mariabackup/backup_copy.cc +++ b/extra/mariabackup/backup_copy.cc @@ -1849,10 +1849,8 @@ is_aria_log_dir_file(const datadir_node_t &node) bool -copy_back_aria_logs() +copy_back_aria_logs(const char *dstdir) { - Copy_back_dst_dir dst_dir_buf; - const char *dstdir= dst_dir_buf.make(aria_log_dir_path); std::unique_ptr ds_ctxt_aria_log_dir_path(ds_create(dstdir, DS_TYPE_LOCAL), ds_destroy); @@ -1907,8 +1905,11 @@ copy_back() && !directory_exists(srv_log_group_home_dir, true)) { return(false); } + + Copy_back_dst_dir aria_log_dir_path_dst; + const char *aria_log_dir_path_abs= aria_log_dir_path_dst.make(aria_log_dir_path); if (aria_log_dir_path && *aria_log_dir_path - && !directory_exists(aria_log_dir_path, true)) { + && !directory_exists(aria_log_dir_path_abs, true)) { return false; } @@ -1919,7 +1920,7 @@ copy_back() return(false); } - if (!copy_back_aria_logs()) + if (!copy_back_aria_logs(aria_log_dir_path_abs)) return false; /* parse data file path */ From 0976afec889d8914326f9e71b15ea215470dadba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 24 Apr 2023 09:57:58 +0300 Subject: [PATCH 163/260] MDEV-31114 Assertion !...is_waiting() failed in os_aio_wait_until_no_pending_writes() os_aio_wait_until_no_pending_reads(), os_aio_wait_until_pending_writes(): Add a Boolean parameter to indicate whether the wait should be declared in the thread pool. buf_flush_wait(): The callers have already declared a wait, so let us avoid doing that again, just call os_aio_wait_until_pending_writes(false). buf_flush_wait_flushed(): Do not declare a wait in the rare case that the buf_flush_page_cleaner thread has been shut down already. buf_flush_page_cleaner(), buf_flush_buffer_pool(): In the code that runs during shutdown, do not declare waits. buf_flush_buffer_pool(): Remove a debug assertion that might fail. What really matters here is buf_pool.flush_list.count==0. buf_read_recv_pages(), srv_prepare_to_delete_redo_log_file(): Do not declare waits during InnoDB startup. --- storage/innobase/buf/buf0buf.cc | 4 ++-- storage/innobase/buf/buf0dump.cc | 2 +- storage/innobase/buf/buf0flu.cc | 13 ++++++------- storage/innobase/buf/buf0rea.cc | 2 +- storage/innobase/include/os0file.h | 10 ++++++---- storage/innobase/log/log0recv.cc | 2 +- storage/innobase/os/os0file.cc | 18 ++++++++++-------- storage/innobase/row/row0quiesce.cc | 2 +- storage/innobase/srv/srv0start.cc | 2 +- 9 files changed, 29 insertions(+), 26 deletions(-) diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 462b1eb634a..693826917c9 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -1317,11 +1317,11 @@ buf_tmp_buffer_t *buf_pool_t::io_buf_t::reserve() for (buf_tmp_buffer_t *s= slots, *e= slots + n_slots; s != e; s++) if (s->acquire()) return s; - os_aio_wait_until_no_pending_writes(); + os_aio_wait_until_no_pending_writes(true); for (buf_tmp_buffer_t *s= slots, *e= slots + n_slots; s != e; s++) if (s->acquire()) return s; - os_aio_wait_until_no_pending_reads(); + os_aio_wait_until_no_pending_reads(true); } } diff --git a/storage/innobase/buf/buf0dump.cc b/storage/innobase/buf/buf0dump.cc index 05b18de1d5b..03876666f1d 100644 --- a/storage/innobase/buf/buf0dump.cc +++ b/storage/innobase/buf/buf0dump.cc @@ -647,7 +647,7 @@ buf_load() ut_free(dump); if (i == dump_n) { - os_aio_wait_until_no_pending_reads(); + os_aio_wait_until_no_pending_reads(true); } ut_sprintf_timestamp(now); diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 75286d9d33b..fff70eefd13 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -246,7 +246,7 @@ void buf_flush_remove_pages(ulint id) if (!deferred) break; - os_aio_wait_until_no_pending_writes(); + os_aio_wait_until_no_pending_writes(true); } } @@ -1692,7 +1692,7 @@ done: space->release(); if (space->purpose == FIL_TYPE_IMPORT) - os_aio_wait_until_no_pending_writes(); + os_aio_wait_until_no_pending_writes(true); else buf_dblwr.flush_buffered_writes(); @@ -1862,7 +1862,7 @@ static void buf_flush_wait(lsn_t lsn) break; } mysql_mutex_unlock(&buf_pool.flush_list_mutex); - os_aio_wait_until_no_pending_writes(); + os_aio_wait_until_no_pending_writes(false); mysql_mutex_lock(&buf_pool.flush_list_mutex); } } @@ -1898,7 +1898,7 @@ ATTRIBUTE_COLD void buf_flush_wait_flushed(lsn_t sync_lsn) MONITOR_FLUSH_SYNC_COUNT, MONITOR_FLUSH_SYNC_PAGES, n_pages); } - os_aio_wait_until_no_pending_writes(); + os_aio_wait_until_no_pending_writes(false); mysql_mutex_lock(&buf_pool.flush_list_mutex); } while (buf_pool.get_oldest_modification(sync_lsn) < sync_lsn); @@ -2421,7 +2421,7 @@ static void buf_flush_page_cleaner() mysql_mutex_lock(&buf_pool.flush_list_mutex); buf_flush_wait_LRU_batch_end(); mysql_mutex_unlock(&buf_pool.flush_list_mutex); - os_aio_wait_until_no_pending_writes(); + os_aio_wait_until_no_pending_writes(false); } mysql_mutex_lock(&buf_pool.flush_list_mutex); @@ -2471,7 +2471,7 @@ ATTRIBUTE_COLD void buf_flush_buffer_pool() { mysql_mutex_unlock(&buf_pool.flush_list_mutex); buf_flush_list(srv_max_io_capacity); - os_aio_wait_until_no_pending_writes(); + os_aio_wait_until_no_pending_writes(false); mysql_mutex_lock(&buf_pool.flush_list_mutex); service_manager_extend_timeout(INNODB_EXTEND_TIMEOUT_INTERVAL, "Waiting to flush " ULINTPF " pages", @@ -2479,7 +2479,6 @@ ATTRIBUTE_COLD void buf_flush_buffer_pool() } mysql_mutex_unlock(&buf_pool.flush_list_mutex); - ut_ad(!os_aio_pending_writes()); ut_ad(!os_aio_pending_reads()); } diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc index b8fa3055adf..1fe629ca8a7 100644 --- a/storage/innobase/buf/buf0rea.cc +++ b/storage/innobase/buf/buf0rea.cc @@ -687,7 +687,7 @@ void buf_read_recv_pages(ulint space_id, const uint32_t* page_nos, ulint n) } if (os_aio_pending_reads() >= limit) { - os_aio_wait_until_no_pending_reads(); + os_aio_wait_until_no_pending_reads(false); } space->reacquire(); diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index f8ae0f51557..7ac0579cc07 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -1066,11 +1066,13 @@ size_t os_aio_pending_reads_approx(); /** @return number of pending writes */ size_t os_aio_pending_writes(); -/** Wait until there are no pending asynchronous writes. */ -void os_aio_wait_until_no_pending_writes(); +/** Wait until there are no pending asynchronous writes. +@param declare whether the wait will be declared in tpool */ +void os_aio_wait_until_no_pending_writes(bool declare); -/** Wait until all pending asynchronous reads have completed. */ -void os_aio_wait_until_no_pending_reads(); +/** Wait until all pending asynchronous reads have completed. +@param declare whether the wait will be declared in tpool */ +void os_aio_wait_until_no_pending_reads(bool declare); /** Prints info of the aio arrays. @param[in/out] file file where to print */ diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index f87ff15c393..78ba8b70a49 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -3407,7 +3407,7 @@ next_free_block: else { mysql_mutex_unlock(&mutex); - os_aio_wait_until_no_pending_reads(); + os_aio_wait_until_no_pending_reads(false); mysql_mutex_lock(&mutex); ut_ad(pages.empty()); } diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index e816f6ef7b1..3b81dc7ee07 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -3644,9 +3644,9 @@ void os_aio_free() } /** Wait until there are no pending asynchronous writes. */ -static void os_aio_wait_until_no_pending_writes_low() +static void os_aio_wait_until_no_pending_writes_low(bool declare) { - bool notify_wait = write_slots->pending_io_count() > 0; + const bool notify_wait= declare && write_slots->pending_io_count(); if (notify_wait) tpool::tpool_wait_begin(); @@ -3657,10 +3657,11 @@ static void os_aio_wait_until_no_pending_writes_low() tpool::tpool_wait_end(); } -/** Wait until there are no pending asynchronous writes. */ -void os_aio_wait_until_no_pending_writes() +/** Wait until there are no pending asynchronous writes. +@param declare whether the wait will be declared in tpool */ +void os_aio_wait_until_no_pending_writes(bool declare) { - os_aio_wait_until_no_pending_writes_low(); + os_aio_wait_until_no_pending_writes_low(declare); buf_dblwr.wait_flush_buffered_writes(); } @@ -3688,10 +3689,11 @@ size_t os_aio_pending_writes() return pending; } -/** Wait until all pending asynchronous reads have completed. */ -void os_aio_wait_until_no_pending_reads() +/** Wait until all pending asynchronous reads have completed. +@param declare whether the wait will be declared in tpool */ +void os_aio_wait_until_no_pending_reads(bool declare) { - const auto notify_wait= read_slots->pending_io_count(); + const bool notify_wait= declare && read_slots->pending_io_count(); if (notify_wait) tpool::tpool_wait_begin(); diff --git a/storage/innobase/row/row0quiesce.cc b/storage/innobase/row/row0quiesce.cc index a4d634f2d14..eadb30bfcfa 100644 --- a/storage/innobase/row/row0quiesce.cc +++ b/storage/innobase/row/row0quiesce.cc @@ -553,7 +553,7 @@ row_quiesce_table_start( if (!trx_is_interrupted(trx)) { /* Ensure that all asynchronous IO is completed. */ - os_aio_wait_until_no_pending_writes(); + os_aio_wait_until_no_pending_writes(true); table->space->flush(); if (row_quiesce_write_cfg(table, trx->mysql_thd) diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 5f6b4b02e16..c111120ea0e 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -973,7 +973,7 @@ same_size: ut_d(mysql_mutex_lock(&buf_pool.flush_list_mutex)); ut_ad(!buf_pool.get_oldest_modification(0)); ut_d(mysql_mutex_unlock(&buf_pool.flush_list_mutex)); - ut_d(os_aio_wait_until_no_pending_writes()); + ut_d(os_aio_wait_until_no_pending_writes(false)); DBUG_RETURN(flushed_lsn); } From 5dc9a6b4558d50298882b3d76b3249e9419e3682 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Fri, 21 Apr 2023 13:46:14 -0700 Subject: [PATCH 164/260] MDEV-31102 Crash when pushing condition into view defined as union This bug could manifest itself at the first execution of prepared statement created for queries using a materialized view defined as union. A crash could happen for sure if the query contained a condition pushable into the view and this condition was over the column defined via a complex string expression requiring implicit conversion from one charset to another for some of its sub-expressions. The bug could cause crashes when executing PS for some other queries whose optimization needed building clones for such expressions. This bug was introduced in the patch for MDEV-29988 where the class Item_direct_ref_to_item was added. The implementations of the virtual methods get_copy() and build_clone() were invalid for the class and this could cause crashes after the method build_clone() was called for expressions containing objects of the Item_direct_ref_to_item type. Approved by Sergei Golubchik --- mysql-test/main/derived_cond_pushdown.result | 83 ++++++++++++++++++++ mysql-test/main/derived_cond_pushdown.test | 30 +++++++ sql/item.h | 17 +++- 3 files changed, 128 insertions(+), 2 deletions(-) diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result index 41f9ac6fca1..4b202ea7a12 100644 --- a/mysql-test/main/derived_cond_pushdown.result +++ b/mysql-test/main/derived_cond_pushdown.result @@ -18275,4 +18275,87 @@ id select_type table type possible_keys key key_len ref rows Extra 3 DERIVED t1 ALL NULL NULL NULL NULL 3 Using temporary drop view v1; drop table t1; +# +# MDEV-31102: execution of PS for query where pushdown of condition +# into view defined as union is applied +# +create table t1 ( +n int, +lv varchar(31) charset latin1, +mv varchar(31) charset utf8mb3 +) engine=myisam; +insert into t1 values (1,'aa','xxx'), ('2','bb','yyy'), (3,'cc','zzz'); +create view v1 as +select case when n=1 then lv when n=2 then mv else NULL end as r from t1 +union +select 'a'; +select * from v1 where r < 'x'; +r +aa +a +explain extended select * from v1 where r < 'x'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY ALL NULL NULL NULL NULL 3 100.00 Using where +2 DERIVED t1 ALL NULL NULL NULL NULL 3 100.00 Using where +3 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used +NULL UNION RESULT ALL NULL NULL NULL NULL NULL NULL +Warnings: +Note 1003 /* select#1 */ select `v1`.`r` AS `r` from `test`.`v1` where `v1`.`r` < 'x' +explain format=json select * from v1 where r < 'x'; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "", + "access_type": "ALL", + "rows": 3, + "filtered": 100, + "attached_condition": "v1.r < 'x'", + "materialized": { + "query_block": { + "union_result": { + "table_name": "", + "access_type": "ALL", + "query_specifications": [ + { + "query_block": { + "select_id": 2, + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 3, + "filtered": 100, + "attached_condition": "case when t1.n = 1 then convert(t1.lv using utf8) when t1.n = 2 then t1.mv else NULL end < 'x'" + } + } + }, + { + "query_block": { + "select_id": 3, + "operation": "UNION", + "table": { + "message": "No tables used" + } + } + } + ] + } + } + } + } + } +} +prepare stmt from "select * from v1 where r < 'x'"; +execute stmt; +r +aa +a +execute stmt; +r +aa +a +deallocate prepare stmt; +drop view v1; +drop table t1; # End of 10.4 tests diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test index 6cfe23b7866..b4e131dbe79 100644 --- a/mysql-test/main/derived_cond_pushdown.test +++ b/mysql-test/main/derived_cond_pushdown.test @@ -3942,4 +3942,34 @@ explain select * from v1; drop view v1; drop table t1; +--echo # +--echo # MDEV-31102: execution of PS for query where pushdown of condition +--echo # into view defined as union is applied +--echo # + +create table t1 ( + n int, + lv varchar(31) charset latin1, + mv varchar(31) charset utf8mb3 +) engine=myisam; +insert into t1 values (1,'aa','xxx'), ('2','bb','yyy'), (3,'cc','zzz'); +create view v1 as +select case when n=1 then lv when n=2 then mv else NULL end as r from t1 +union +select 'a'; + +let $q= +select * from v1 where r < 'x'; + +eval $q; +eval explain extended $q; +eval explain format=json $q; +eval prepare stmt from "$q"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +drop view v1; +drop table t1; + --echo # End of 10.4 tests diff --git a/sql/item.h b/sql/item.h index 31568aafc8c..1e0caaa7c83 100644 --- a/sql/item.h +++ b/sql/item.h @@ -7647,7 +7647,7 @@ public: Item *get_tmp_table_item(THD *thd) { return m_item->get_tmp_table_item(thd); } Item *get_copy(THD *thd) - { return m_item->get_copy(thd); } + { return get_item_copy(thd, this); } COND *build_equal_items(THD *thd, COND_EQUAL *inherited, bool link_item_fields, COND_EQUAL **cond_equal_ref) @@ -7715,7 +7715,20 @@ public: bool excl_dep_on_grouping_fields(st_select_lex *sel) { return m_item->excl_dep_on_grouping_fields(sel); } bool is_expensive() { return m_item->is_expensive(); } - Item* build_clone(THD *thd) { return get_copy(thd); } + void set_item(Item *item) { m_item= item; } + Item *build_clone(THD *thd) + { + Item *clone_item= m_item->build_clone(thd); + if (clone_item) + { + Item_direct_ref_to_item *copy= (Item_direct_ref_to_item *) get_copy(thd); + if (!copy) + return 0; + copy->set_item(clone_item); + return copy; + } + return 0; + } void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array, List &fields, uint flags) From d3e7dba329f517072c80b81cd17e9a67e2748729 Mon Sep 17 00:00:00 2001 From: Brandon Nesterenko Date: Wed, 28 Sep 2022 12:34:44 -0600 Subject: [PATCH 165/260] MDEV-28798: Previously Binlog Encrypted Master Segfaults on Binlog Dump with Using_Gtid=Slave_Pos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: ======== A master can segfault if it can't set up decryption for its binary log during a binlog dump with Using_Gtid=Slave_Pos. If slave connects using GTID mode, the master will call into log.cc::get_gtid_list_event(), which iterate through binlog events looking for a Gtid_list_log_event. On an encrypted binlog that the master cannot decrypt, the first event will be a START_ENCRYPTION_EVENT which will call into the following decryption branch if (fdle->start_decryption((Start_encryption_log_event*) ev)) errormsg= ‘Could not set up decryption for binlog.’; The event iteration however, does not stop in spite of this error. The master will try to read the next event, but segfault while trying to decrypt it because decryption failed to initialize. Solution: ======== Break the event iteration if decryption cannot be set up. Reviewed By: ============ Andrei Elkin --- ...d_master_switch_to_unencrypted_coords.cnf} | 0 ...aster_switch_to_unencrypted_coords.result} | 1 + ..._master_switch_to_unencrypted_coords.test} | 16 +- ...pted_master_switch_to_unencrypted_gtid.cnf | 8 + ...d_master_switch_to_unencrypted_gtid.result | 84 ++++++++++ ...ted_master_switch_to_unencrypted_gtid.test | 154 ++++++++++++++++++ sql/log.cc | 3 + 7 files changed, 261 insertions(+), 5 deletions(-) rename mysql-test/suite/binlog_encryption/{encrypted_master_switch_to_unencrypted.cnf => encrypted_master_switch_to_unencrypted_coords.cnf} (100%) rename mysql-test/suite/binlog_encryption/{encrypted_master_switch_to_unencrypted.result => encrypted_master_switch_to_unencrypted_coords.result} (98%) rename mysql-test/suite/binlog_encryption/{encrypted_master_switch_to_unencrypted.test => encrypted_master_switch_to_unencrypted_coords.test} (88%) create mode 100644 mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.cnf create mode 100644 mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result create mode 100644 mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.cnf b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.cnf similarity index 100% rename from mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.cnf rename to mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.cnf diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.result b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.result similarity index 98% rename from mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.result rename to mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.result index d632c565ad2..33c1f1413b4 100644 --- a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.result +++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.result @@ -4,6 +4,7 @@ include/rpl_init.inc [topology=1->2] connection server_2; include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; ##################################################### # Part 1: unencrypted master ##################################################### diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.test b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.test similarity index 88% rename from mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.test rename to mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.test index 1e1b0cbd353..732058c21b8 100644 --- a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted.test +++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.test @@ -1,14 +1,19 @@ # -# TODO: write here what the test checks after MDEV-11288 is fixed -# # The test starts with unencrypted master. # It stops replication, generates a few statement and row events # on the master, then restarts the server with encrypted binlog, # generates some more events and restarts it back without encryption # (no encryption plugin). -# Then it resumes replication and checks what happens when the server -# tries to feed the binary logs (included the encrypted ones) -# to the slave. +# Then it resumes replication and should error with +# ER_MASTER_FATAL_ERROR_READING_BINLOG because the encrypted binlog is +# sent and unable to be decrypted. +# +# Note this variation of encrypted_master_switch_to_unencrypted tests +# using MASTER_USE_GTID=NO. In contrast to the GTID variant of this +# test, at part 3 (the error case), the master will scan binlogs +# starting from the first one (which is unencrypted initially, so +# replication is okay) and continue until the slave encounters the +# first encrypted event, which causes the slave to error. # --source include/have_binlog_format_mixed.inc @@ -27,6 +32,7 @@ --connection server_2 --disable_connect_log --source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=NO; --enable_connect_log --echo ##################################################### diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.cnf b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.cnf new file mode 100644 index 00000000000..ad1b8b44c24 --- /dev/null +++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.cnf @@ -0,0 +1,8 @@ +!include my.cnf + +[mysqld.1] +encrypt-binlog=0 +skip-file-key-management + +[mysqld.2] +gtid-domain-id=1 diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result new file mode 100644 index 00000000000..16ea30557e7 --- /dev/null +++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result @@ -0,0 +1,84 @@ +################# +# Initialization +################# +include/rpl_init.inc [topology=1->2] +connection server_2; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=SLAVE_POS; +call mtr.add_suppression(" Got fatal error 1236 from master when reading data from binary log: 'Could not set up decryption for binlog.'"); +##################################################### +# Part 1: unencrypted master +##################################################### +connection server_1; +CREATE TABLE table1_no_encryption ( +pk INT AUTO_INCREMENT PRIMARY KEY, +ts TIMESTAMP NULL, +b BLOB +) ENGINE=MyISAM; +INSERT INTO table1_no_encryption VALUES (NULL,NOW(),'data_no_encryption'); +INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption; +FLUSH BINARY LOGS; +SET binlog_format=ROW; +INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption; +INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption; +NOT FOUND /table1_no_encryption/ in master-bin.0* +##################################################### +# Part 2: restart master, now with binlog encryption +##################################################### +connection default; +connection server_1; +CREATE TABLE table2_to_encrypt ( +pk INT AUTO_INCREMENT PRIMARY KEY, +ts TIMESTAMP NULL, +b BLOB +) ENGINE=MyISAM; +INSERT INTO table2_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt'); +INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt; +FLUSH BINARY LOGS; +SET binlog_format=ROW; +INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt; +INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt; +NOT FOUND /table2_to_encrypt/ in master-bin.0* +##################################################### +# Part 3: restart master again without encryption +##################################################### +connection default; +connection server_1; +CREATE TABLE table3_no_encryption ( +pk INT AUTO_INCREMENT PRIMARY KEY, +ts TIMESTAMP NULL, +b BLOB +) ENGINE=MyISAM; +INSERT INTO table3_no_encryption VALUES (NULL,NOW(),'data_no_encryption'); +INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption; +INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption; +##################################################### +# Check: resume replication and check how it goes +##################################################### +connection server_2; +start slave; +include/wait_for_slave_io_error.inc [errno=1236] +# Ensuring slave was unable to replicate any transactions.. +# ..success +SHOW TABLES; +Tables_in_test +include/stop_slave.inc +reset slave; +########## +# Cleanup +########## +connection server_1; +reset master; +SELECT COUNT(*) FROM table1_no_encryption; +COUNT(*) +8 +SELECT COUNT(*) FROM table2_to_encrypt; +COUNT(*) +8 +SELECT COUNT(*) FROM table3_no_encryption; +COUNT(*) +4 +DROP TABLE table1_no_encryption, table2_to_encrypt, table3_no_encryption; +connection server_2; +include/start_slave.inc +include/rpl_end.inc diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test new file mode 100644 index 00000000000..f882e8f3440 --- /dev/null +++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test @@ -0,0 +1,154 @@ +# +# The test starts with unencrypted master. +# It stops replication, generates a few statement and row events +# on the master, then restarts the server with encrypted binlog, +# generates some more events and restarts it back without encryption +# (no encryption plugin). +# Then it resumes replication and should error with +# ER_MASTER_FATAL_ERROR_READING_BINLOG because the encrypted binlog is +# sent and unable to be decrypted. +# +# Note this variation of encrypted_master_switch_to_unencrypted tests +# using MASTER_USE_GTID=SLAVE_POS. encrypted_master_switch_to_unencrypted +# was the original test which only used binlog coordinates. When tested +# using MASTER_USE_GTID=Slave_Pos, the master optimizes the detection of +# an undecryptable binlog. I.e, the master will initially look for a +# Gtid_list_log_event, but fail to decrypt it and fail immediately in +# part 3. +# + +--source include/have_binlog_format_mixed.inc + +--echo ################# +--echo # Initialization +--echo ################# + +--let $rpl_topology= 1->2 +--source include/rpl_init.inc + +--enable_connect_log + +# We stop replication because we want it to happen after the switch + +--connection server_2 +--disable_connect_log +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=SLAVE_POS; +--enable_connect_log +call mtr.add_suppression(" Got fatal error 1236 from master when reading data from binary log: 'Could not set up decryption for binlog.'"); + +--echo ##################################################### +--echo # Part 1: unencrypted master +--echo ##################################################### + +--connection server_1 + +CREATE TABLE table1_no_encryption ( + pk INT AUTO_INCREMENT PRIMARY KEY, + ts TIMESTAMP NULL, + b BLOB +) ENGINE=MyISAM; + +INSERT INTO table1_no_encryption VALUES (NULL,NOW(),'data_no_encryption'); +INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption; +FLUSH BINARY LOGS; +SET binlog_format=ROW; +INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption; +INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption; + +# Make sure that binary logs are not encrypted + +--let SEARCH_RANGE = 500000 +--let SEARCH_FILE= master-bin.0* +--let SEARCH_PATTERN= table1_no_encryption +--source include/search_pattern_in_file.inc + +--echo ##################################################### +--echo # Part 2: restart master, now with binlog encryption +--echo ##################################################### + +--let $rpl_server_parameters= --encrypt-binlog=1 --plugin-load-add=$FILE_KEY_MANAGEMENT_SO --file-key-management --loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt + +--let $rpl_server_number= 1 +--source restart_server.inc + +CREATE TABLE table2_to_encrypt ( + pk INT AUTO_INCREMENT PRIMARY KEY, + ts TIMESTAMP NULL, + b BLOB +) ENGINE=MyISAM; + +INSERT INTO table2_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt'); +INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt; +FLUSH BINARY LOGS; +SET binlog_format=ROW; +INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt; +INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt; + +# Make sure that binary logs are encrypted + +--let SEARCH_FILE= master-bin.0* +--let SEARCH_PATTERN= table2_to_encrypt +--source include/search_pattern_in_file.inc + +--echo ##################################################### +--echo # Part 3: restart master again without encryption +--echo ##################################################### + +--let $rpl_server_parameters= --encrypt-binlog=0 +--let $rpl_server_number= 1 +--source restart_server.inc + +CREATE TABLE table3_no_encryption ( + pk INT AUTO_INCREMENT PRIMARY KEY, + ts TIMESTAMP NULL, + b BLOB +) ENGINE=MyISAM; + +INSERT INTO table3_no_encryption VALUES (NULL,NOW(),'data_no_encryption'); +INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption; +INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption; + +--echo ##################################################### +--echo # Check: resume replication and check how it goes +--echo ##################################################### + +--connection server_2 +start slave; +# Make slave to try to synchronize. It shouldn't work, the slave IO thread is +# expected to abort with an error +--let $slave_io_errno= 1236 +--source include/wait_for_slave_io_error.inc + +--echo # Ensuring slave was unable to replicate any transactions.. +--let $gsp= `SELECT @@global.gtid_slave_pos` +if (`SELECT strcmp("$gsp","")`) +{ + die Slave without encryption configured should fail to read encrypted binlog; +} +--echo # ..success + +--sorted_result +SHOW TABLES; + +--disable_connect_log +--source include/stop_slave.inc +--enable_connect_log +reset slave; + +--echo ########## +--echo # Cleanup +--echo ########## + +--connection server_1 +reset master; + +SELECT COUNT(*) FROM table1_no_encryption; +SELECT COUNT(*) FROM table2_to_encrypt; +SELECT COUNT(*) FROM table3_no_encryption; +DROP TABLE table1_no_encryption, table2_to_encrypt, table3_no_encryption; + +--connection server_2 +--disable_connect_log +--source include/start_slave.inc +--source include/rpl_end.inc diff --git a/sql/log.cc b/sql/log.cc index 8c75ae847b3..38ab6db746c 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -10786,7 +10786,10 @@ get_gtid_list_event(IO_CACHE *cache, Gtid_list_log_event **out_gtid_list) if (typ == START_ENCRYPTION_EVENT) { if (fdle->start_decryption((Start_encryption_log_event*) ev)) + { errormsg= "Could not set up decryption for binlog."; + break; + } } delete ev; if (typ == ROTATE_EVENT || typ == STOP_EVENT || From 4ec3dca34baeeeb750d4104d64cda0b022a7ef70 Mon Sep 17 00:00:00 2001 From: Brandon Nesterenko Date: Thu, 29 Sep 2022 13:40:51 -0600 Subject: [PATCH 166/260] MDEV-28798: Cosmetic Changes Only Removed trailing whitespaces --- ...rypted_master_switch_to_unencrypted_coords.test | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.test b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.test index 732058c21b8..a34c9715239 100644 --- a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.test +++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_coords.test @@ -1,8 +1,8 @@ # -# The test starts with unencrypted master. +# The test starts with unencrypted master. # It stops replication, generates a few statement and row events -# on the master, then restarts the server with encrypted binlog, -# generates some more events and restarts it back without encryption +# on the master, then restarts the server with encrypted binlog, +# generates some more events and restarts it back without encryption # (no encryption plugin). # Then it resumes replication and should error with # ER_MASTER_FATAL_ERROR_READING_BINLOG because the encrypted binlog is @@ -47,7 +47,7 @@ CREATE TABLE table1_no_encryption ( pk INT AUTO_INCREMENT PRIMARY KEY, ts TIMESTAMP NULL, b BLOB -) ENGINE=MyISAM; +) ENGINE=MyISAM; INSERT INTO table1_no_encryption VALUES (NULL,NOW(),'data_no_encryption'); INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption; @@ -80,7 +80,7 @@ CREATE TABLE table2_to_encrypt ( pk INT AUTO_INCREMENT PRIMARY KEY, ts TIMESTAMP NULL, b BLOB -) ENGINE=MyISAM; +) ENGINE=MyISAM; INSERT INTO table2_to_encrypt VALUES (NULL,NOW(),'data_to_encrypt'); INSERT INTO table2_to_encrypt SELECT NULL,NOW(),b FROM table2_to_encrypt; @@ -107,7 +107,7 @@ CREATE TABLE table3_no_encryption ( pk INT AUTO_INCREMENT PRIMARY KEY, ts TIMESTAMP NULL, b BLOB -) ENGINE=MyISAM; +) ENGINE=MyISAM; INSERT INTO table3_no_encryption VALUES (NULL,NOW(),'data_no_encryption'); INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption; @@ -119,7 +119,7 @@ INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption; --connection server_2 start slave; -# The slave should be able to synchronize with master up to +# The slave should be able to synchronize with master up to # the previously saved position (when the log was still unencrypted) --sync_with_master From 29fb041007285c34d9c22dbc6359a2e9b9ea32f3 Mon Sep 17 00:00:00 2001 From: Brandon Nesterenko Date: Wed, 5 Apr 2023 10:43:28 -0600 Subject: [PATCH 167/260] MDEV-30430: Enabling system versioning on tables without primary key breaks replication When replicating MDL events for a table that uses system versioning without primary keys, ensure that for data sets with duplicate records, the updates to these records with duplicates are enacted on the correct row. That is, there was a bug (reported in MDEV-30430) such that the function to find the row to update would stop after finding the first matching record. However, in the absence of primary keys, the version of the record is needed to compare the row to ensure we are updating the correct one. The fix, therefore, updates the record comparison functionality to use system version columns when there are no primary keys on the table. Reviewed By: ============ Andrei Elkin --- mysql-test/suite/versioning/r/rpl.result | 24 +++++++++++++++++ mysql-test/suite/versioning/t/rpl.test | 34 ++++++++++++++++++++++++ sql/log_event.cc | 21 ++++++++++----- 3 files changed, 73 insertions(+), 6 deletions(-) diff --git a/mysql-test/suite/versioning/r/rpl.result b/mysql-test/suite/versioning/r/rpl.result index a6fa6b3fca7..17372c63e99 100644 --- a/mysql-test/suite/versioning/r/rpl.result +++ b/mysql-test/suite/versioning/r/rpl.result @@ -164,4 +164,28 @@ update t1 set i = 0; connection slave; connection master; drop table t1; +# check versioned -> versioned replication without any keys on duplicate records +connection master; +create table t1 (a INT) with system versioning; +insert into t1 values (1); +insert into t1 values (1); +delete from t1; +connection slave; +include/diff_tables.inc [master:test.t1,slave:test.t1] +connection master; +drop table t1; +connection slave; +# check unversioned -> versioned replication with non-unique keys on duplicate records +connection master; +set statement sql_log_bin=0 for create table t1 (a INT NOT NULL, b INT, INDEX(a,b)); +connection slave; +set statement sql_log_bin=0 for create table t1 (a INT NOT NULL, b INT, INDEX(a,b)) with system versioning; +connection master; +insert into t1 values (1,1); +insert into t1 values (1,1); +delete from t1; +connection slave; +include/diff_tables.inc [master:test.t1,slave:test.t1] +connection master; +drop table t1; include/rpl_end.inc diff --git a/mysql-test/suite/versioning/t/rpl.test b/mysql-test/suite/versioning/t/rpl.test index b5be68feece..7d78b60e6fa 100644 --- a/mysql-test/suite/versioning/t/rpl.test +++ b/mysql-test/suite/versioning/t/rpl.test @@ -133,4 +133,38 @@ sync_slave_with_master; connection master; drop table t1; + +# +# MDEV-30430: Enabling system versioning on tables without primary key breaks replication +# Note that bugs are only present with row binlog format +# +--echo # check versioned -> versioned replication without any keys on duplicate records +connection master; +create table t1 (a INT) with system versioning; +insert into t1 values (1); +insert into t1 values (1); +delete from t1; +sync_slave_with_master; +--let $diff_tables= master:test.t1,slave:test.t1 +--source include/diff_tables.inc +connection master; +drop table t1; +sync_slave_with_master; + +--echo # check unversioned -> versioned replication with non-unique keys on duplicate records +connection master; +set statement sql_log_bin=0 for create table t1 (a INT NOT NULL, b INT, INDEX(a,b)); +connection slave; +set statement sql_log_bin=0 for create table t1 (a INT NOT NULL, b INT, INDEX(a,b)) with system versioning; +connection master; +insert into t1 values (1,1); +insert into t1 values (1,1); +delete from t1; +sync_slave_with_master; +--let $diff_tables= master:test.t1,slave:test.t1 +--source include/diff_tables.inc + +connection master; +drop table t1; + --source include/rpl_end.inc diff --git a/sql/log_event.cc b/sql/log_event.cc index 14cdf880d62..74b39dcadef 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -13873,7 +13873,7 @@ uint8 Write_rows_log_event::get_trg_event_map() Returns TRUE if different. */ -static bool record_compare(TABLE *table) +static bool record_compare(TABLE *table, bool vers_from_plain= false) { bool result= FALSE; /** @@ -13906,10 +13906,19 @@ static bool record_compare(TABLE *table) /* Compare fields */ for (Field **ptr=table->field ; *ptr ; ptr++) { - if (table->versioned() && (*ptr)->vers_sys_field()) - { + /* + If the table is versioned, don't compare using the version if there is a + primary key. If there isn't a primary key, we need the version to + identify the correct record if there are duplicate rows in the data set. + However, if the primary server is unversioned (vers_from_plain is true), + then we implicitly use row_end as the primary key on our side. This is + because the implicit row_end value will be set to the maximum value for + the latest row update (which is what we care about). + */ + if (table->versioned() && (*ptr)->vers_sys_field() && + (table->s->primary_key < MAX_KEY || + (vers_from_plain && table->vers_start_field() == (*ptr)))) continue; - } /** We only compare field contents that are not null. NULL fields (i.e., their null bits) were compared @@ -14306,7 +14315,7 @@ int Rows_log_event::find_row(rpl_group_info *rgi) /* We use this to test that the correct key is used in test cases. */ DBUG_EXECUTE_IF("slave_crash_if_index_scan", abort();); - while (record_compare(table)) + while (record_compare(table, m_vers_from_plain)) { while ((error= table->file->ha_index_next(table->record[0]))) { @@ -14359,7 +14368,7 @@ int Rows_log_event::find_row(rpl_group_info *rgi) goto end; } } - while (record_compare(table)); + while (record_compare(table, m_vers_from_plain)); /* Note: above record_compare will take into account all record fields From 31f09e36c183d026a28f42ddbb9be2229613a3ed Mon Sep 17 00:00:00 2001 From: Brandon Nesterenko Date: Tue, 18 Apr 2023 13:22:43 -0600 Subject: [PATCH 168/260] MDEV-31038: Parallel Replication Breaks if XA PREPARE Fails Updating Slave GTID State If a replica failed to update the GTID slave state when committing an XA PREPARE, the replica would retry the transaction and get an out-of-order GTID error. This is because the commit phase of an XA PREPARE is bifurcated. That is, first, the prepare is handled by the relevant storage engines. Then second, the GTID slave state is updated as a separate autocommit transaction. If the second phase fails, and the transaction is retried, then the same transaction is attempted to be committed again, resulting in a GTID out-of-order error. This patch fixes this error by immediately stopping the slave and reporting the appropriate error. That is, there was logic to bypass the error when updating the GTID slave state table if the underlying error is allowed for retry on a parallel slave. This patch adds a parameter to disallow the error bypass, thereby forcing the error state to still happen. Reviewed By ============ Andrei Elkin --- .../rpl/r/rpl_xa_prepare_gtid_fail.result | 51 +++++++++ .../suite/rpl/t/rpl_xa_prepare_gtid_fail.test | 106 ++++++++++++++++++ sql/handler.cc | 7 +- sql/log_event.h | 2 +- sql/log_event_server.cc | 64 +++++++---- 5 files changed, 208 insertions(+), 22 deletions(-) create mode 100644 mysql-test/suite/rpl/r/rpl_xa_prepare_gtid_fail.result create mode 100644 mysql-test/suite/rpl/t/rpl_xa_prepare_gtid_fail.test diff --git a/mysql-test/suite/rpl/r/rpl_xa_prepare_gtid_fail.result b/mysql-test/suite/rpl/r/rpl_xa_prepare_gtid_fail.result new file mode 100644 index 00000000000..f3fecbda349 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_xa_prepare_gtid_fail.result @@ -0,0 +1,51 @@ +include/master-slave.inc +[connection master] +connection slave; +include/stop_slave.inc +change master to master_use_gtid=slave_pos; +set @@global.slave_parallel_threads= 4; +set @@global.slave_parallel_mode= optimistic; +set @@global.gtid_strict_mode=ON; +set sql_log_bin= 0; +alter table mysql.gtid_slave_pos engine=innodb; +call mtr.add_suppression("Deadlock found.*"); +set sql_log_bin= 1; +include/start_slave.inc +connection master; +create table t1 (a int primary key, b int) engine=innodb; +insert t1 values (1,1); +include/save_master_gtid.inc +connection slave; +include/sync_with_master_gtid.inc +include/stop_slave.inc +set @@global.innodb_lock_wait_timeout= 1; +connection master; +set @@session.gtid_seq_no=100; +xa start '1'; +update t1 set b=b+10 where a=1; +xa end '1'; +xa prepare '1'; +xa commit '1'; +include/save_master_gtid.inc +connection slave; +connection slave1; +BEGIN; +SELECT * FROM mysql.gtid_slave_pos WHERE seq_no=100 FOR UPDATE; +domain_id sub_id server_id seq_no +connection slave; +include/start_slave.inc +include/wait_for_slave_sql_error.inc [errno=1942,1213] +connection slave1; +ROLLBACK; +# Cleanup +connection master; +drop table t1; +connection slave; +include/stop_slave.inc +set @@global.gtid_slave_pos= "0-1-100"; +set @@global.slave_parallel_threads= 0; +set @@global.gtid_strict_mode= 0; +set @@global.innodb_lock_wait_timeout= 50; +include/start_slave.inc +include/rpl_end.inc +# End of rpl_xa_prepare_gtid_fail.test diff --git a/mysql-test/suite/rpl/t/rpl_xa_prepare_gtid_fail.test b/mysql-test/suite/rpl/t/rpl_xa_prepare_gtid_fail.test new file mode 100644 index 00000000000..8042b355754 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_xa_prepare_gtid_fail.test @@ -0,0 +1,106 @@ +# +# When handling the replication of an XA PREPARE, the commit phase is +# bifurcated. First, the prepare is handled by the relevant storage engines. +# Then second,the GTID slave state is updated as a separate autocommit +# transaction. If the second stage fails, i.e. we are unable to update the +# GTID slave state, then the slave should immediately quit in error, without +# retry. +# +# This tests validates the above behavior by simulating a deadlock on the +# GTID slave state table during the second part of XA PREPARE's commit, to +# ensure that the appropriate error is reported and the transaction was never +# retried. +# +# +# References +# MDEV-31038: Parallel Replication Breaks if XA PREPARE Fails Updating Slave +# GTID State +# +source include/master-slave.inc; +source include/have_binlog_format_row.inc; +source include/have_innodb.inc; + +--connection slave +--source include/stop_slave.inc + +--let $save_par_thds= `SELECT @@global.slave_parallel_threads` +--let $save_strict_mode= `SELECT @@global.gtid_strict_mode` +--let $save_innodb_lock_wait_timeout= `SELECT @@global.innodb_lock_wait_timeout` + +change master to master_use_gtid=slave_pos; +set @@global.slave_parallel_threads= 4; +set @@global.slave_parallel_mode= optimistic; +set @@global.gtid_strict_mode=ON; + +set sql_log_bin= 0; +alter table mysql.gtid_slave_pos engine=innodb; +call mtr.add_suppression("Deadlock found.*"); +set sql_log_bin= 1; +--source include/start_slave.inc + +--connection master +let $datadir= `select @@datadir`; +create table t1 (a int primary key, b int) engine=innodb; +insert t1 values (1,1); +--source include/save_master_gtid.inc + +--connection slave +--source include/sync_with_master_gtid.inc +--source include/stop_slave.inc +set @@global.innodb_lock_wait_timeout= 1; + +--let $retried_tx_initial= query_get_value(SHOW ALL SLAVES STATUS, Retried_transactions, 1) + +--connection master +--let $gtid_domain_id=`SELECT @@GLOBAL.gtid_domain_id` +--let $gtid_server_id=`SELECT @@GLOBAL.server_id` +--let $xap_seq_no=100 +--eval set @@session.gtid_seq_no=$xap_seq_no +xa start '1'; +update t1 set b=b+10 where a=1; +xa end '1'; +xa prepare '1'; +--let $new_gtid= `SELECT @@global.gtid_binlog_pos` +xa commit '1'; +--source include/save_master_gtid.inc + + +--connection slave + +#--eval set statement sql_log_bin=0 for insert into mysql.gtid_slave_pos values ($gtid_domain_id, 5, $gtid_server_id, $xap_seq_no) + +--connection slave1 +BEGIN; +--eval SELECT * FROM mysql.gtid_slave_pos WHERE seq_no=$xap_seq_no FOR UPDATE + +--connection slave +--source include/start_slave.inc + +--let $slave_sql_errno= 1942,1213 +--source include/wait_for_slave_sql_error.inc + +--let $retried_tx_test= query_get_value(SHOW ALL SLAVES STATUS, Retried_transactions, 1) +if ($retried_tx_initial != $retried_tx_test) +{ + --echo Transaction was retried when a failed XA PREPARE slave GTID update should lead to immediate slave stop without retry + --die Transaction was retried when a failed XA PREPARE slave GTID update should lead to immediate slave stop without retry +} + +--connection slave1 +ROLLBACK; + +--echo # Cleanup + +--connection master +drop table t1; + +--connection slave +--source include/stop_slave.inc +--eval set @@global.gtid_slave_pos= "$new_gtid" +--eval set @@global.slave_parallel_threads= $save_par_thds +--eval set @@global.gtid_strict_mode= $save_strict_mode +--eval set @@global.innodb_lock_wait_timeout= $save_innodb_lock_wait_timeout +--source include/start_slave.inc + +--source include/rpl_end.inc +--echo # End of rpl_xa_prepare_gtid_fail.test diff --git a/sql/handler.cc b/sql/handler.cc index 926ef2f4f54..eaaf4664c07 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2057,8 +2057,11 @@ int ha_rollback_trans(THD *thd, bool all) rollback without signalling following transactions. And in release builds, we explicitly do the signalling before rolling back. */ - DBUG_ASSERT(!(thd->rgi_slave && thd->rgi_slave->did_mark_start_commit) || - thd->transaction->xid_state.is_explicit_XA()); + DBUG_ASSERT( + !(thd->rgi_slave && thd->rgi_slave->did_mark_start_commit) || + (thd->transaction->xid_state.is_explicit_XA() || + (thd->rgi_slave->gtid_ev_flags2 & Gtid_log_event::FL_PREPARED_XA))); + if (thd->rgi_slave && thd->rgi_slave->did_mark_start_commit) thd->rgi_slave->unmark_start_commit(); } diff --git a/sql/log_event.h b/sql/log_event.h index 5dcf0315f68..2fcc4549bc9 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -3042,7 +3042,7 @@ private: virtual int do_commit()= 0; virtual int do_apply_event(rpl_group_info *rgi); int do_record_gtid(THD *thd, rpl_group_info *rgi, bool in_trans, - void **out_hton); + void **out_hton, bool force_err= false); enum_skip_reason do_shall_skip(rpl_group_info *rgi); virtual const char* get_query()= 0; #endif diff --git a/sql/log_event_server.cc b/sql/log_event_server.cc index c5fb637a000..a2b78bc241d 100644 --- a/sql/log_event_server.cc +++ b/sql/log_event_server.cc @@ -152,6 +152,30 @@ is_parallel_retry_error(rpl_group_info *rgi, int err) return has_temporary_error(rgi->thd); } +/** + Accumulate a Diagnostics_area's errors and warnings into an output buffer + + @param errbuf The output buffer to write error messages + @param errbuf_size The size of the output buffer + @param da The Diagnostics_area to check for errors +*/ +static void inline aggregate_da_errors(char *errbuf, size_t errbuf_size, + Diagnostics_area *da) +{ + const char *errbuf_end= errbuf + errbuf_size; + char *slider; + Diagnostics_area::Sql_condition_iterator it= da->sql_conditions(); + const Sql_condition *err; + size_t len; + for (err= it++, slider= errbuf; err && slider < errbuf_end - 1; + slider += len, err= it++) + { + len= my_snprintf(slider, errbuf_end - slider, + " %s, Error_code: %d;", err->get_message_text(), + err->get_sql_errno()); + } +} + /** Error reporting facility for Rows_log_event::do_apply_event @@ -172,13 +196,8 @@ static void inline slave_rows_error_report(enum loglevel level, int ha_error, const char *log_name, my_off_t pos) { const char *handler_error= (ha_error ? HA_ERR(ha_error) : NULL); - char buff[MAX_SLAVE_ERRMSG], *slider; - const char *buff_end= buff + sizeof(buff); - size_t len; - Diagnostics_area::Sql_condition_iterator it= - thd->get_stmt_da()->sql_conditions(); + char buff[MAX_SLAVE_ERRMSG]; Relay_log_info const *rli= rgi->rli; - const Sql_condition *err; buff[0]= 0; int errcode= thd->is_error() ? thd->get_stmt_da()->sql_errno() : 0; @@ -191,13 +210,7 @@ static void inline slave_rows_error_report(enum loglevel level, int ha_error, if (is_parallel_retry_error(rgi, errcode)) return; - for (err= it++, slider= buff; err && slider < buff_end - 1; - slider += len, err= it++) - { - len= my_snprintf(slider, buff_end - slider, - " %s, Error_code: %d;", err->get_message_text(), - err->get_sql_errno()); - } + aggregate_da_errors(buff, sizeof(buff), thd->get_stmt_da()); if (ha_error != 0) rli->report(level, errcode, rgi->gtid_info(), @@ -3893,7 +3906,8 @@ bool slave_execute_deferred_events(THD *thd) #if defined(HAVE_REPLICATION) int Xid_apply_log_event::do_record_gtid(THD *thd, rpl_group_info *rgi, - bool in_trans, void **out_hton) + bool in_trans, void **out_hton, + bool force_err) { int err= 0; Relay_log_info const *rli= rgi->rli; @@ -3908,14 +3922,26 @@ int Xid_apply_log_event::do_record_gtid(THD *thd, rpl_group_info *rgi, int ec= thd->get_stmt_da()->sql_errno(); /* Do not report an error if this is really a kill due to a deadlock. - In this case, the transaction will be re-tried instead. + In this case, the transaction will be re-tried instead. Unless force_err + is set, as in the case of XA PREPARE, as the GTID state is updated as a + separate transaction, and if that fails, we should not retry but exit in + error immediately. */ - if (!is_parallel_retry_error(rgi, ec)) + if (!is_parallel_retry_error(rgi, ec) || force_err) + { + char buff[MAX_SLAVE_ERRMSG]; + buff[0]= 0; + aggregate_da_errors(buff, sizeof(buff), thd->get_stmt_da()); + + if (force_err) + thd->clear_error(); + rli->report(ERROR_LEVEL, ER_CANNOT_UPDATE_GTID_STATE, rgi->gtid_info(), "Error during XID COMMIT: failed to update GTID state in " - "%s.%s: %d: %s", + "%s.%s: %d: %s the event's master log %s, end_log_pos %llu", "mysql", rpl_gtid_slave_state_table_name.str, ec, - thd->get_stmt_da()->message()); + buff, RPL_LOG_NAME, log_pos); + } thd->is_slave_error= 1; } @@ -3989,7 +4015,7 @@ int Xid_apply_log_event::do_apply_event(rpl_group_info *rgi) { DBUG_ASSERT(!thd->transaction->xid_state.is_explicit_XA()); - if ((err= do_record_gtid(thd, rgi, false, &hton))) + if ((err= do_record_gtid(thd, rgi, false, &hton, true))) return err; } From 50f3b7d1649002df3c73ec88827707096ce3135c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 25 Apr 2023 12:17:06 +0300 Subject: [PATCH 169/260] MDEV-31124 Innodb_data_written miscounts doublewrites When commit a5a2ef079cec378340d8b575aef05974b0b3442e implemented asynchronous doublewrite, the writes via the doublewrite buffer started to be counted incorrectly, without multiplying them by innodb_page_size. srv_export_innodb_status(): Correctly count the Innodb_data_written. buf_dblwr_t: Remove submitted(), because it is close to written() and only Innodb_data_written was interested in it. According to its name, it should count completed and not submitted writes. Tested by: Axel Schwenke --- storage/innobase/buf/buf0dblwr.cc | 1 - storage/innobase/include/buf0dblwr.h | 5 ----- storage/innobase/srv/srv0srv.cc | 7 ++++--- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc index 1d582b6cfbf..b6b6e87b6df 100644 --- a/storage/innobase/buf/buf0dblwr.cc +++ b/storage/innobase/buf/buf0dblwr.cc @@ -582,7 +582,6 @@ bool buf_dblwr_t::flush_buffered_writes(const ulint size) const bool multi_batch= block1 + static_cast(size) != block2 && old_first_free > size; flushing_buffered_writes= 1 + multi_batch; - pages_submitted+= old_first_free; /* Now safe to release the mutex. */ mysql_mutex_unlock(&mutex); #ifdef UNIV_DEBUG diff --git a/storage/innobase/include/buf0dblwr.h b/storage/innobase/include/buf0dblwr.h index fb9df55504c..f82baeec89a 100644 --- a/storage/innobase/include/buf0dblwr.h +++ b/storage/innobase/include/buf0dblwr.h @@ -66,8 +66,6 @@ class buf_dblwr_t bool batch_running; /** number of expected flush_buffered_writes_completed() calls */ unsigned flushing_buffered_writes; - /** pages submitted to flush_buffered_writes() */ - ulint pages_submitted; /** number of flush_buffered_writes_completed() calls */ ulint writes_completed; /** number of pages written by flush_buffered_writes_completed() */ @@ -92,9 +90,6 @@ public: /** Acquire the mutex */ void lock() { mysql_mutex_lock(&mutex); } - /** @return the number of submitted page writes */ - ulint submitted() const - { mysql_mutex_assert_owner(&mutex); return pages_submitted; } /** @return the number of completed batches */ ulint batches() const { mysql_mutex_assert_owner(&mutex); return writes_completed; } diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 337460fc4d2..57aa4bef9fe 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -1013,13 +1013,14 @@ srv_export_innodb_status(void) if (buf_dblwr.is_initialised()) { buf_dblwr.lock(); - dblwr = buf_dblwr.submitted(); - export_vars.innodb_dblwr_pages_written = buf_dblwr.written(); + dblwr = buf_dblwr.written(); + export_vars.innodb_dblwr_pages_written = dblwr; export_vars.innodb_dblwr_writes = buf_dblwr.batches(); buf_dblwr.unlock(); } - export_vars.innodb_data_written = srv_stats.data_written + dblwr; + export_vars.innodb_data_written = srv_stats.data_written + + (dblwr << srv_page_size_shift); export_vars.innodb_buffer_pool_read_requests = buf_pool.stat.n_page_gets; From a72b2c3ffb15541520de96c29ea482f80a57f46f Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Mon, 24 Apr 2023 17:57:45 +0300 Subject: [PATCH 170/260] MDEV-31121: ANALYZE statement produces 0 for all timings in embedded server Timers require my_timer_init() call. It was made only in mysqld_main(). Call it also from init_embedded_server(). --- libmysqld/lib_sql.cc | 2 ++ mysql-test/main/analyze_format_json_emb.result | 11 +++++++++++ mysql-test/main/analyze_format_json_emb.test | 18 ++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 mysql-test/main/analyze_format_json_emb.result create mode 100644 mysql-test/main/analyze_format_json_emb.test diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 5742a8d66ef..565a722e13b 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -565,6 +565,8 @@ int init_embedded_server(int argc, char **argv, char **groups) if (ho_error != 0) return 1; + my_timer_init(&sys_timer_info); + if (init_common_variables()) { mysql_server_end(); diff --git a/mysql-test/main/analyze_format_json_emb.result b/mysql-test/main/analyze_format_json_emb.result new file mode 100644 index 00000000000..d61e205f031 --- /dev/null +++ b/mysql-test/main/analyze_format_json_emb.result @@ -0,0 +1,11 @@ +# +# MDEV-31121: ANALYZE statement produces 0 for all timings in embedded serve +# +create table t1 (a int); +insert into t1 values (0),(0); +set @js='$out'; +set @out=(select json_extract(@js,'$**.query_block.r_total_time_ms')); +select cast(json_extract(@out,'$[0]') as DOUBLE) > 0; +cast(json_extract(@out,'$[0]') as DOUBLE) > 0 +1 +drop table t1; diff --git a/mysql-test/main/analyze_format_json_emb.test b/mysql-test/main/analyze_format_json_emb.test new file mode 100644 index 00000000000..dcf6f24dd8e --- /dev/null +++ b/mysql-test/main/analyze_format_json_emb.test @@ -0,0 +1,18 @@ +--source include/is_embedded.inc +--source include/big_test.inc + +--echo # +--echo # MDEV-31121: ANALYZE statement produces 0 for all timings in embedded serve +--echo # +create table t1 (a int); +insert into t1 values (0),(0); +let $out=` +analyze format=json select sleep(1+a) from t1 +`; + +evalp set @js='$out'; +set @out=(select json_extract(@js,'$**.query_block.r_total_time_ms')); +select cast(json_extract(@out,'$[0]') as DOUBLE) > 0; + +drop table t1; + From c22ab93f8af5baf2cefe802dfd4a3819225d6df5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 25 Apr 2023 15:03:38 +0300 Subject: [PATCH 171/260] MDEV-26827 fixup: Prevent a hang in LRU eviction buf_pool_t::page_cleaner_wakeup(): If for_LRU=true, wake up the page cleaner immediately, also when it is in a timed wait. This avoids an unnecessary delay of up to 1 second. --- storage/innobase/buf/buf0flu.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index fff70eefd13..b201250bc3b 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -115,7 +115,12 @@ static void buf_flush_validate_skip() void buf_pool_t::page_cleaner_wakeup(bool for_LRU) { if (!page_cleaner_idle()) + { + if (for_LRU) + /* Ensure that the page cleaner is not in a timed wait. */ + pthread_cond_signal(&do_flush_list); return; + } double dirty_pct= double(UT_LIST_GET_LEN(buf_pool.flush_list)) * 100.0 / double(UT_LIST_GET_LEN(buf_pool.LRU) + UT_LIST_GET_LEN(buf_pool.free)); double pct_lwm= srv_max_dirty_pages_pct_lwm; From e22a57da827f11f0ba9903675e4086ab9cf52a0d Mon Sep 17 00:00:00 2001 From: Andrei Date: Thu, 23 Mar 2023 18:45:34 +0200 Subject: [PATCH 172/260] MDEV-30620 Trying to lock uninitialized LOCK_parallel_entry The error was seen by a number of mtr tests being caused by overdue initialization of rpl_parallel::LOCK_parallel_entry. Specifically, SHOW-SLAVE-STATUS might find in rpl_parallel::workers_idle() a gtid domain hash entry already inserted whose mutex had not done mysql_mutex_init(). Fixed with swapping the mutex init and the its entry's stack insertion. Tested with a generous number of `mtr --repeat` of a few of the reported to fail tests, incl rpl.parallel_backup. --- sql/rpl_parallel.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index 7e70e04b857..746c923ba44 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -2312,14 +2312,16 @@ rpl_parallel::find(uint32 domain_id) e->domain_id= domain_id; e->stop_on_error_sub_id= (uint64)ULONGLONG_MAX; e->pause_sub_id= (uint64)ULONGLONG_MAX; - if (my_hash_insert(&domain_hash, (uchar *)e)) - { - my_free(e); - return NULL; - } mysql_mutex_init(key_LOCK_parallel_entry, &e->LOCK_parallel_entry, MY_MUTEX_INIT_FAST); mysql_cond_init(key_COND_parallel_entry, &e->COND_parallel_entry, NULL); + if (my_hash_insert(&domain_hash, (uchar *)e)) + { + mysql_cond_destroy(&e->COND_parallel_entry); + mysql_mutex_destroy(&e->LOCK_parallel_entry); + my_free(e); + return NULL; + } } else e->force_abort= false; From 898320b5f8afd20ba07efa8ea193e18661f2a0a4 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Tue, 25 Apr 2023 18:55:53 +0200 Subject: [PATCH 173/260] MDEV-30804 addendum for 10.6+ branches This addition to MDEV-30804 is relevant for 10.6+, it excludes the mixed transaction section using both innodb and aria storage engines from the galera_var_replicate_aria_off test, since such transactions cannot be executed unless aria supports two-phase transaction commit. No additional tests are required as this commit fixes the mtr test itself. --- .../suite/galera/r/galera_var_replicate_aria_on.result | 5 ++--- .../suite/galera/t/galera_var_replicate_aria_on.test | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/mysql-test/suite/galera/r/galera_var_replicate_aria_on.result b/mysql-test/suite/galera/r/galera_var_replicate_aria_on.result index 39fd748314c..91c07ba6681 100644 --- a/mysql-test/suite/galera/r/galera_var_replicate_aria_on.result +++ b/mysql-test/suite/galera/r/galera_var_replicate_aria_on.result @@ -89,11 +89,8 @@ connection node_1; SET GLOBAL wsrep_sync_wait=15; CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=Aria; CREATE TABLE t2 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB; -SET AUTOCOMMIT=OFF; -START TRANSACTION; INSERT INTO t1 VALUES (1); INSERT INTO t2 VALUES (1); -COMMIT; connection node_2; SET GLOBAL wsrep_sync_wait=15; SELECT COUNT(*) AS EXPECT_1 FROM t1; @@ -103,6 +100,7 @@ SELECT COUNT(*) AS EXPECT_1 FROM t2; EXPECT_1 1 connection node_1; +SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES (2); INSERT INTO t2 VALUES (2); @@ -129,6 +127,7 @@ INSERT INTO t1 VALUES (1); ERROR 23000: Duplicate entry '1' for key 'PRIMARY' connection node_1; COMMIT; +ERROR HY000: Transactional commit not supported by involved engine(s) DROP TABLE t1,t2; connection node_1; CREATE TABLE t1 (i INT NOT NULL PRIMARY KEY) ENGINE=INNODB; diff --git a/mysql-test/suite/galera/t/galera_var_replicate_aria_on.test b/mysql-test/suite/galera/t/galera_var_replicate_aria_on.test index c3bc53ee17f..ac9a79e6196 100644 --- a/mysql-test/suite/galera/t/galera_var_replicate_aria_on.test +++ b/mysql-test/suite/galera/t/galera_var_replicate_aria_on.test @@ -85,18 +85,15 @@ SELECT * FROM t1; DROP TABLE t1; # -# Transaction +# Preparation for next tests # --connection node_1 SET GLOBAL wsrep_sync_wait=15; CREATE TABLE t1 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=Aria; CREATE TABLE t2 (f1 INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB; -SET AUTOCOMMIT=OFF; -START TRANSACTION; INSERT INTO t1 VALUES (1); INSERT INTO t2 VALUES (1); -COMMIT; --connection node_2 SET GLOBAL wsrep_sync_wait=15; @@ -108,6 +105,7 @@ SELECT COUNT(*) AS EXPECT_1 FROM t2; # --connection node_1 +SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES (2); INSERT INTO t2 VALUES (2); @@ -138,6 +136,8 @@ INSERT INTO t2 VALUES (1); INSERT INTO t1 VALUES (1); --connection node_1 + +--error ER_ERROR_DURING_COMMIT COMMIT; DROP TABLE t1,t2; From 7e75f94ba1a0b72b23a43220e4d81334a18097b4 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Tue, 25 Apr 2023 08:33:23 +0200 Subject: [PATCH 174/260] New CC --- libmariadb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmariadb b/libmariadb index d204e831042..f5a4c73df4f 160000 --- a/libmariadb +++ b/libmariadb @@ -1 +1 @@ -Subproject commit d204e83104222844251b221e9be7eb3dd9f8d63d +Subproject commit f5a4c73df4fa30a2fd0c5fad65338f455665b334 From b3817425d96dc24591eb2c8e634ef5143d23888a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 21 Apr 2023 14:02:56 +0200 Subject: [PATCH 175/260] MDEV-11356 Option skip-core-file does not work remove ancient hard-coded treatment of --core-file. This enables normal my_getopt behavior for the already existing sysvar --- mysql-test/main/mysqld--help.result | 3 ++- mysql-test/suite/sys_vars/r/sysvars_server_embedded.result | 4 ++-- .../suite/sys_vars/r/sysvars_server_notembedded.result | 4 ++-- sql/mysqld.cc | 5 ----- sql/sys_vars.cc | 7 +++---- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result index c008df32257..6ada7faeb10 100644 --- a/mysql-test/main/mysqld--help.result +++ b/mysql-test/main/mysqld--help.result @@ -173,7 +173,7 @@ The following specify which files/extra groups are read (specified before remain ALWAYS --console Write error output on screen; don't remove the console window on windows. - --core-file Write core on errors. + --core-file Write core on crashes -h, --datadir=name Path to the database root directory --date-format=name The DATE format (ignored) --datetime-format=name @@ -1441,6 +1441,7 @@ column-compression-zlib-wrap FALSE completion-type NO_CHAIN concurrent-insert AUTO console TRUE +core-file TRUE date-format %Y-%m-%d datetime-format %Y-%m-%d %H:%i:%s deadlock-search-depth-long 15 diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result index 9454f1b9d96..1ed5b5ce3bd 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result @@ -645,13 +645,13 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME CORE_FILE VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BOOLEAN -VARIABLE_COMMENT write a core-file on crashes +VARIABLE_COMMENT Write core on crashes NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL ENUM_VALUE_LIST OFF,ON READ_ONLY YES -COMMAND_LINE_ARGUMENT NULL +COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME DATADIR VARIABLE_SCOPE GLOBAL VARIABLE_TYPE VARCHAR diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index 27e5daf7615..125d629ac87 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -645,13 +645,13 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME CORE_FILE VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BOOLEAN -VARIABLE_COMMENT write a core-file on crashes +VARIABLE_COMMENT Write core on crashes NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL ENUM_VALUE_LIST OFF,ON READ_ONLY YES -COMMAND_LINE_ARGUMENT NULL +COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME DATADIR VARIABLE_SCOPE GLOBAL VARIABLE_TYPE VARCHAR diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 228a3d909e2..c110baa9634 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -6754,8 +6754,6 @@ struct my_option my_long_options[]= {"console", OPT_CONSOLE, "Write error output on screen; don't remove the console window on windows.", &opt_console, &opt_console, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"core-file", OPT_WANT_CORE, "Write core on errors.", 0, 0, 0, GET_NO_ARG, - NO_ARG, 0, 0, 0, 0, 0, 0}, #ifdef DBUG_OFF {"debug", '#', "Built in DBUG debugger. Disabled in this build.", ¤t_dbug_option, ¤t_dbug_option, 0, GET_STR, OPT_ARG, @@ -8542,9 +8540,6 @@ mysqld_get_one_option(int optid, const struct my_option *opt, char *argument) case (int) OPT_SKIP_HOST_CACHE: opt_specialflag|= SPECIAL_NO_HOST_CACHE; break; - case (int) OPT_WANT_CORE: - test_flags |= TEST_CORE_ON_SIGNAL; - break; case OPT_CONSOLE: if (opt_console) opt_error_log= 0; // Force logs to stdout diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 4dd45b7ce43..6cb2733feb0 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -531,10 +531,9 @@ bool check_has_super(sys_var *self, THD *thd, set_var *var) return false; } -static Sys_var_bit Sys_core_file("core_file", "write a core-file on crashes", - READ_ONLY GLOBAL_VAR(test_flags), NO_CMD_LINE, - TEST_CORE_ON_SIGNAL, DEFAULT(IF_WIN(TRUE,FALSE)), NO_MUTEX_GUARD, NOT_IN_BINLOG, - 0,0,0); +static Sys_var_bit Sys_core_file("core_file", "Write core on crashes", + READ_ONLY GLOBAL_VAR(test_flags), CMD_LINE(OPT_ARG), + TEST_CORE_ON_SIGNAL, DEFAULT(IF_WIN(TRUE,FALSE))); static bool binlog_format_check(sys_var *self, THD *thd, set_var *var) { From b942f41438339bf6ba33d9156471b29a19fb4121 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 25 Apr 2023 12:37:13 +0200 Subject: [PATCH 176/260] MDEV-30218 update test result followup for d1a46c68cd4 --- mysql-test/main/selectivity_innodb.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/main/selectivity_innodb.result b/mysql-test/main/selectivity_innodb.result index 6c6811f9754..4ee2da02ec6 100644 --- a/mysql-test/main/selectivity_innodb.result +++ b/mysql-test/main/selectivity_innodb.result @@ -1671,7 +1671,7 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` # gives selectivity data explain extended select * from t1 where a in (17,51,5) and b=2; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ref b,a b 5 const 59 2.90 Using where +1 SIMPLE t1 range|filter b,a a|b 5|5 NULL 29 (6%) 5.90 Using index condition; Using where; Using rowid filter Warnings: Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` in (17,51,5) drop table t1; From d4265fbde587bd79b6fe3793225d3f4798ee955e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 26 Apr 2023 11:53:42 +0300 Subject: [PATCH 177/260] MDEV-26055: Correct the formula for adaptive flushing page_cleaner_flush_pages_recommendation(): If dirty_pct is between innodb_max_dirty_pages_pct_lwm and innodb_max_dirty_pages_pct, scale the effort relative to how close we are to innodb_max_dirty_pages_pct. The previous formula was missing a multiplication by 100. Tested by: Axel Schwenke --- storage/innobase/buf/buf0flu.cc | 37 +++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index b201250bc3b..73fc2957ebb 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -2081,10 +2081,12 @@ Based on various factors it decides if there is a need to do flushing. @return number of pages recommended to be flushed @param last_pages_in number of pages flushed in previous batch @param oldest_lsn buf_pool.get_oldest_modification(0) +@param pct_lwm innodb_max_dirty_pages_pct_lwm, or 0 to ignore it @param dirty_blocks UT_LIST_GET_LEN(buf_pool.flush_list) @param dirty_pct 100*flush_list.count / (LRU.count + free.count) */ static ulint page_cleaner_flush_pages_recommendation(ulint last_pages_in, lsn_t oldest_lsn, + double pct_lwm, ulint dirty_blocks, double dirty_pct) { @@ -2154,11 +2156,17 @@ func_exit: sum_pages = 0; } - const ulint pct_for_dirty = srv_max_dirty_pages_pct_lwm == 0 - ? (dirty_pct >= max_pct ? 100 : 0) - : static_cast - (max_pct > 0.0 ? dirty_pct / max_pct : dirty_pct); - ulint pct_total = std::max(pct_for_dirty, pct_for_lsn); + MONITOR_SET(MONITOR_FLUSH_PCT_FOR_LSN, pct_for_lsn); + + double total_ratio; + if (pct_lwm == 0.0 || max_pct == 0.0) { + total_ratio = 1; + } else { + total_ratio = std::max(double(pct_for_lsn) / 100, + (dirty_pct / max_pct)); + } + + MONITOR_SET(MONITOR_FLUSH_PCT_FOR_DIRTY, ulint(total_ratio * 100)); /* Estimate pages to be flushed for the lsn progress */ lsn_t target_lsn = oldest_lsn @@ -2184,7 +2192,7 @@ func_exit: pages_for_lsn = 1; } - n_pages = (ulint(double(srv_io_capacity) * double(pct_total) / 100.0) + n_pages = (ulint(double(srv_io_capacity) * total_ratio) + avg_page_rate + pages_for_lsn) / 3; if (n_pages > srv_max_io_capacity) { @@ -2197,8 +2205,6 @@ func_exit: MONITOR_SET(MONITOR_FLUSH_AVG_PAGE_RATE, avg_page_rate); MONITOR_SET(MONITOR_FLUSH_LSN_AVG_RATE, lsn_avg_rate); - MONITOR_SET(MONITOR_FLUSH_PCT_FOR_DIRTY, pct_for_dirty); - MONITOR_SET(MONITOR_FLUSH_PCT_FOR_LSN, pct_for_lsn); goto func_exit; } @@ -2305,7 +2311,7 @@ static void buf_flush_page_cleaner() soft_lsn_limit= lsn_limit; } - bool idle_flush= false; + double pct_lwm= 0.0; ulint n_flushed= 0, n; if (UNIV_UNLIKELY(soft_lsn_limit != 0)) @@ -2324,7 +2330,7 @@ static void buf_flush_page_cleaner() mysql_mutex_unlock(&buf_pool.mutex); last_pages+= n; - if (!idle_flush) + if (pct_lwm == 0.0) goto end_of_batch; /* when idle flushing kicks in page_cleaner is marked active. @@ -2342,7 +2348,8 @@ static void buf_flush_page_cleaner() guaranteed to be nonempty, and it is a subset of buf_pool.LRU. */ const double dirty_pct= double(dirty_blocks) * 100.0 / double(UT_LIST_GET_LEN(buf_pool.LRU) + UT_LIST_GET_LEN(buf_pool.free)); - if (srv_max_dirty_pages_pct_lwm != 0.0) + pct_lwm= srv_max_dirty_pages_pct_lwm; + if (pct_lwm != 0.0) { const ulint activity_count= srv_get_activity_count(); if (activity_count != last_activity_count) @@ -2359,13 +2366,16 @@ static void buf_flush_page_cleaner() - there are no pending reads but there are dirty pages to flush */ buf_pool.update_last_activity_count(activity_count); mysql_mutex_unlock(&buf_pool.flush_list_mutex); - idle_flush= true; goto idle_flush; } else + { maybe_unemployed: - if (dirty_pct < srv_max_dirty_pages_pct_lwm) + const bool below{dirty_pct < pct_lwm}; + pct_lwm= 0.0; + if (below) goto possibly_unemployed; + } } else if (dirty_pct < srv_max_buf_pool_modified_pct) possibly_unemployed: @@ -2396,6 +2406,7 @@ static void buf_flush_page_cleaner() } else if ((n= page_cleaner_flush_pages_recommendation(last_pages, oldest_lsn, + pct_lwm, dirty_blocks, dirty_pct)) != 0) { From 5740638c4c3337a0021a82f5b744afca1ab1346c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 26 Apr 2023 12:08:59 +0300 Subject: [PATCH 178/260] MDEV-31132 Deadlock between DDL and purge of InnoDB history log_free_check(): Assert that the caller must not hold exclusive lock_sys.latch. This was the case for calls from ibuf_delete_for_discarded_space(). This caused a deadlock with another thread that would be holding a latch on a dirty page that would need to be written so that the checkpoint would advance and log_free_check() could return. That other thread was waiting for a shared lock_sys.latch. fil_delete_tablespace(): Do not invoke ibuf_delete_for_discarded_space() because in DDL operations, we will be holding exclusive lock_sys.latch. trx_t::commit(std::vector&), innodb_drop_database(), row_purge_remove_clust_if_poss_low(), row_undo_ins_remove_clust_rec(), row_discard_tablespace_for_mysql(): Invoke ibuf_delete_for_discarded_space() on the deleted tablespaces after releasing all latches. --- storage/innobase/dict/drop.cc | 7 +++++++ storage/innobase/fil/fil0fil.cc | 2 -- storage/innobase/handler/ha_innodb.cc | 5 +++++ storage/innobase/include/log0log.h | 13 ++++--------- storage/innobase/include/log0log.inl | 20 -------------------- storage/innobase/log/log0log.cc | 10 ++++++++++ storage/innobase/row/row0mysql.cc | 1 + storage/innobase/row/row0purge.cc | 9 +++++++-- storage/innobase/row/row0uins.cc | 9 +++++++-- 9 files changed, 41 insertions(+), 35 deletions(-) diff --git a/storage/innobase/dict/drop.cc b/storage/innobase/dict/drop.cc index 9013841ba5e..45747fb3596 100644 --- a/storage/innobase/dict/drop.cc +++ b/storage/innobase/dict/drop.cc @@ -68,6 +68,7 @@ before transaction commit and must be rolled back explicitly are as follows: #include "dict0defrag_bg.h" #include "btr0defragment.h" +#include "ibuf0ibuf.h" #include "lock0lock.h" #include "que0que.h" @@ -237,6 +238,8 @@ void trx_t::commit(std::vector &deleted) commit_persist(); if (dict_operation) { + std::vector space_ids; + space_ids.reserve(mod_tables.size()); ut_ad(dict_sys.locked()); lock_sys.wr_lock(SRW_LOCK_CALL); mutex_lock(); @@ -271,6 +274,7 @@ void trx_t::commit(std::vector &deleted) dict_sys.remove(table); if (const auto id= space ? space->id : 0) { + space_ids.emplace_back(uint32_t(id)); pfs_os_file_t d= fil_delete_tablespace(id); if (d != OS_FILE_CLOSED) deleted.emplace_back(d); @@ -283,6 +287,9 @@ void trx_t::commit(std::vector &deleted) mysql_mutex_lock(&lock_sys.wait_mutex); lock_sys.deadlock_check(); mysql_mutex_unlock(&lock_sys.wait_mutex); + + for (const auto id : space_ids) + ibuf_delete_for_discarded_space(id); } commit_cleanup(); } diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 48d205f428a..23f0cf75f39 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -45,7 +45,6 @@ Created 10/25/1995 Heikki Tuuri #include "srv0start.h" #include "trx0purge.h" #include "buf0lru.h" -#include "ibuf0ibuf.h" #include "buf0flu.h" #include "log.h" #ifdef __linux__ @@ -1689,7 +1688,6 @@ pfs_os_file_t fil_delete_tablespace(ulint id) fil_space_free_low(space); } - ibuf_delete_for_discarded_space(id); return handle; } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index f102789d7ab..0b117c02e29 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -1542,6 +1542,7 @@ static void innodb_drop_database(handlerton*, char *path) dfield_set_data(&dfield, namebuf, len); dict_index_copy_types(&tuple, sys_index, 1); std::vector to_close; + std::vector space_ids; mtr_t mtr; mtr.start(); pcur.btr_cur.page_cur.index = sys_index; @@ -1585,6 +1586,7 @@ static void innodb_drop_database(handlerton*, char *path) ut_ad("corrupted SYS_TABLES.SPACE" == 0); else if (uint32_t space_id= mach_read_from_4(s)) { + space_ids.emplace_back(space_id); pfs_os_file_t detached= fil_delete_tablespace(space_id); if (detached != OS_FILE_CLOSED) to_close.emplace_back(detached); @@ -1594,6 +1596,9 @@ static void innodb_drop_database(handlerton*, char *path) mtr.commit(); for (pfs_os_file_t detached : to_close) os_file_close(detached); + for (const auto id : space_ids) + ibuf_delete_for_discarded_space(id); + /* Any changes must be persisted before we return. */ log_write_up_to(mtr.commit_lsn(), true); } diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h index 0f9a4da049b..0996b66ef52 100644 --- a/storage/innobase/include/log0log.h +++ b/storage/innobase/include/log0log.h @@ -73,15 +73,10 @@ log_reserve_and_write_fast( const void* str, ulint len, lsn_t* start_lsn); -/***********************************************************************//** -Checks if there is need for a log buffer flush or a new checkpoint, and does -this if yes. Any database operation should call this when it has modified -more than about 4 pages. NOTE that this function may only be called when the -OS thread owns no synchronization objects except dict_sys.latch. */ -UNIV_INLINE -void -log_free_check(void); -/*================*/ +/** Wait for a log checkpoint if needed. +NOTE that this function may only be called while not holding +any synchronization objects except dict_sys.latch. */ +void log_free_check(); /** Extends the log buffer. @param[in] len requested minimum size in bytes */ diff --git a/storage/innobase/include/log0log.inl b/storage/innobase/include/log0log.inl index c29c0bfa55f..27856fca8f9 100644 --- a/storage/innobase/include/log0log.inl +++ b/storage/innobase/include/log0log.inl @@ -289,23 +289,3 @@ log_reserve_and_write_fast( return lsn; } - -/***********************************************************************//** -Checks if there is need for a log buffer flush or a new checkpoint, and does -this if yes. Any database operation should call this when it has modified -more than about 4 pages. NOTE that this function may only be called when the -OS thread owns no synchronization objects except dict_sys.latch. */ -UNIV_INLINE -void -log_free_check(void) -/*================*/ -{ - /* During row_log_table_apply(), this function will be called while we - are holding some latches. This is OK, as long as we are not holding - any latches on buffer blocks. */ - - if (log_sys.check_flush_or_checkpoint()) { - - log_check_margins(); - } -} diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index c53e2fd5074..f65e812f40f 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -1065,6 +1065,16 @@ ATTRIBUTE_COLD void log_check_margins() while (log_sys.check_flush_or_checkpoint()); } +/** Wait for a log checkpoint if needed. +NOTE that this function may only be called while not holding +any synchronization objects except dict_sys.latch. */ +void log_free_check() +{ + ut_ad(!lock_sys.is_writer()); + if (log_sys.check_flush_or_checkpoint()) + log_check_margins(); +} + extern void buf_resize_shutdown(); /** Make a checkpoint at the latest lsn on shutdown. */ diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index 67167f19c70..d27fc964219 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -2492,6 +2492,7 @@ rollback: if (fts_exist) purge_sys.resume_FTS(); + ibuf_delete_for_discarded_space(space_id); buf_flush_remove_pages(space_id); trx->op_info= ""; return err; diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc index 753b42332fc..f4db252b069 100644 --- a/storage/innobase/row/row0purge.cc +++ b/storage/innobase/row/row0purge.cc @@ -162,8 +162,9 @@ close_and_exit: ut_ad("corrupted SYS_INDEXES record" == 0); } - if (const uint32_t space_id = dict_drop_index_tree( - &node->pcur, nullptr, &mtr)) { + const uint32_t space_id = dict_drop_index_tree( + &node->pcur, nullptr, &mtr); + if (space_id) { if (table) { if (table->get_ref_count() == 0) { dict_sys.remove(table); @@ -184,6 +185,10 @@ close_and_exit: table = nullptr; } + if (space_id) { + ibuf_delete_for_discarded_space(space_id); + } + purge_sys.check_stop_SYS(); mtr.start(); index->set_modified(mtr); diff --git a/storage/innobase/row/row0uins.cc b/storage/innobase/row/row0uins.cc index 50196e78092..ff1a34b46c3 100644 --- a/storage/innobase/row/row0uins.cc +++ b/storage/innobase/row/row0uins.cc @@ -147,8 +147,9 @@ restart: pfs_os_file_t d = OS_FILE_CLOSED; - if (const uint32_t space_id = dict_drop_index_tree( - &node->pcur, node->trx, &mtr)) { + const uint32_t space_id = dict_drop_index_tree( + &node->pcur, node->trx, &mtr); + if (space_id) { if (table) { lock_release_on_rollback(node->trx, table); @@ -187,6 +188,10 @@ restart: os_file_close(d); } + if (space_id) { + ibuf_delete_for_discarded_space(space_id); + } + mtr.start(); ut_a(node->pcur.restore_position( BTR_MODIFY_LEAF, &mtr) == btr_pcur_t::SAME_ALL); From 348f4c9f3b9d7b2cb4aeff5f3b5c5d1b7291189a Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Tue, 11 Apr 2023 14:00:42 +0200 Subject: [PATCH 179/260] MDEV-30889: 1 - Allocation in Item_subselect::mark_as_dependent Fix leack in Item_subselect::mark_as_dependent (allocation of temporary list in statement memory inctroduced in f4d552104364fe195237f39862d91f657c7a34cb ) --- sql/item_subselect.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 1454073e459..eb7988dffe7 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -400,11 +400,11 @@ bool Item_subselect::mark_as_dependent(THD *thd, st_select_lex *select, { is_correlated= TRUE; Ref_to_outside *upper; - if (!(upper= new (thd->stmt_arena->mem_root) Ref_to_outside())) + if (!(upper= new (thd->mem_root) Ref_to_outside())) return TRUE; upper->select= select; upper->item= item; - if (upper_refs.push_back(upper, thd->stmt_arena->mem_root)) + if (upper_refs.push_back(upper, thd->mem_root)) return TRUE; } return FALSE; From 45d4f6b97b4811b1b7783dcd19526be1dbb196dc Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Wed, 12 Apr 2023 15:08:23 +0200 Subject: [PATCH 180/260] MDEV-30889: 2 - Allocation in TABLE_SHARE::init_from_sql_statement_string Fix leack in TABLE_SHARE::init_from_sql_statement_string by removing uneeded switching arenas. --- sql/table.cc | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/sql/table.cc b/sql/table.cc index d96e9248cd1..fd5334271be 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -3163,7 +3163,6 @@ int TABLE_SHARE::init_from_sql_statement_string(THD *thd, bool write, char *sql_copy; handler *file; LEX *old_lex; - Query_arena *arena, backup; LEX tmp_lex; KEY *unused1; uint unused2; @@ -3172,12 +3171,6 @@ int TABLE_SHARE::init_from_sql_statement_string(THD *thd, bool write, LEX_CSTRING db_backup= thd->db; DBUG_ENTER("TABLE_SHARE::init_from_sql_statement_string"); - /* - Ouch. Parser may *change* the string it's working on. - Currently (2013-02-26) it is used to permanently disable - conditional comments. - Anyway, let's copy the caller's string... - */ if (!(sql_copy= thd->strmake(sql, sql_length))) DBUG_RETURN(HA_ERR_OUT_OF_MEM); @@ -3190,12 +3183,6 @@ int TABLE_SHARE::init_from_sql_statement_string(THD *thd, bool write, old_lex= thd->lex; thd->lex= &tmp_lex; - arena= thd->stmt_arena; - if (arena->is_conventional()) - arena= 0; - else - thd->set_n_backup_active_arena(arena, &backup); - thd->reset_db(&db); lex_start(thd); @@ -3230,8 +3217,6 @@ ret: lex_end(thd->lex); thd->reset_db(&db_backup); thd->lex= old_lex; - if (arena) - thd->restore_active_arena(arena, &backup); reenable_binlog(thd); thd->variables.sql_mode= saved_mode; thd->variables.character_set_client= old_cs; From 6171119bc145a91d94a89458142e087924e4a9c6 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Mon, 17 Apr 2023 15:06:52 +0200 Subject: [PATCH 181/260] MDEV-30889: 3 - Item_in_optimizer leak Keep Item_in_optimizer cache always (but only once) in statement memory. --- sql/item.cc | 10 ++++++---- sql/item.h | 11 ++++++++--- sql/item_cmpfunc.cc | 26 +++++++++++++++----------- sql/item_cmpfunc.h | 6 ++---- sql/item_subselect.cc | 4 ++-- 5 files changed, 33 insertions(+), 24 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index be7780cb015..685fdc2b69f 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -10430,7 +10430,8 @@ int Item_cache_str::save_in_field(Field *field, bool no_conversions) bool Item_cache_row::allocate(THD *thd, uint num) { item_count= num; - return (!(values= + return (!values && + !(values= (Item_cache **) thd->calloc(sizeof(Item_cache *)*item_count))); } @@ -10467,10 +10468,11 @@ bool Item_cache_row::setup(THD *thd, Item *item) for (uint i= 0; i < item_count; i++) { Item *el= item->element_index(i); - Item_cache *tmp; - if (!(tmp= values[i]= el->get_cache(thd))) + + if ((!values[i]) && !(values[i]= el->get_cache(thd))) return 1; - tmp->setup(thd, el); + + values[i]->setup(thd, el); } return 0; } diff --git a/sql/item.h b/sql/item.h index 1e0caaa7c83..d04d77da666 100644 --- a/sql/item.h +++ b/sql/item.h @@ -6901,6 +6901,9 @@ public: } virtual void keep_array() {} +#ifndef DBUG_OFF + bool is_array_kept() { return TRUE; } +#endif virtual void print(String *str, enum_query_type query_type); bool eq_def(const Field *field) { @@ -7388,13 +7391,15 @@ public: bool null_inside(); void bring_value(); void keep_array() { save_array= 1; } +#ifndef DBUG_OFF + bool is_array_kept() { return save_array; } +#endif + void cleanup() { DBUG_ENTER("Item_cache_row::cleanup"); Item_cache::cleanup(); - if (save_array) - bzero(values, item_count*sizeof(Item**)); - else + if (!save_array) values= 0; DBUG_VOID_RETURN; } diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 6fbbb79c263..fa96d95adb1 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1298,9 +1298,22 @@ bool Item_in_optimizer::fix_left(THD *thd) ref0= &(((Item_in_subselect *)args[1])->left_expr); args[0]= ((Item_in_subselect *)args[1])->left_expr; } - if ((*ref0)->fix_fields_if_needed(thd, ref0) || - (!cache && !(cache= (*ref0)->get_cache(thd)))) + if ((*ref0)->fix_fields_if_needed(thd, ref0)) DBUG_RETURN(1); + if (!cache) + { + Query_arena *arena, backup; + arena= thd->activate_stmt_arena_if_needed(&backup); + + bool rc= !(cache= (*ref0)->get_cache(thd)); + + if (arena) + thd->restore_active_arena(arena, &backup); + + if (rc) + DBUG_RETURN(1); + cache->keep_array(); + } /* During fix_field() expression could be substituted. So we copy changes before use @@ -1663,19 +1676,10 @@ longlong Item_in_optimizer::val_int() } -void Item_in_optimizer::keep_top_level_cache() -{ - cache->keep_array(); - save_cache= 1; -} - - void Item_in_optimizer::cleanup() { DBUG_ENTER("Item_in_optimizer::cleanup"); Item_bool_func::cleanup(); - if (!save_cache) - cache= 0; expr_cache= 0; DBUG_VOID_RETURN; } diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 24f2b35576d..6706c2edf40 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -353,8 +353,7 @@ class Item_in_optimizer: public Item_bool_func protected: Item_cache *cache; Item *expr_cache; - bool save_cache; - /* + /* Stores the value of "NULL IN (SELECT ...)" for uncorrelated subqueries: UNKNOWN - "NULL in (SELECT ...)" has not yet been evaluated FALSE - result is FALSE @@ -364,7 +363,7 @@ protected: public: Item_in_optimizer(THD *thd, Item *a, Item *b): Item_bool_func(thd, a, b), cache(0), expr_cache(0), - save_cache(0), result_for_null_param(UNKNOWN) + result_for_null_param(UNKNOWN) { m_with_subquery= true; } bool fix_fields(THD *, Item **); bool fix_left(THD *thd); @@ -375,7 +374,6 @@ public: enum Functype functype() const { return IN_OPTIMIZER_FUNC; } const char *func_name() const { return ""; } Item_cache **get_cache() { return &cache; } - void keep_top_level_cache(); Item *transform(THD *thd, Item_transformer transformer, uchar *arg); virtual Item *expr_cache_insert_transformer(THD *thd, uchar *unused); bool is_expensive_processor(void *arg); diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index eb7988dffe7..f88e1e7e101 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -1994,7 +1994,7 @@ Item_in_subselect::single_value_transformer(JOIN *join) thd->lex->current_select= current; /* We will refer to upper level cache array => we have to save it for SP */ - optimizer->keep_top_level_cache(); + DBUG_ASSERT(optimizer->get_cache()[0]->is_array_kept()); /* As far as Item_in_optimizer does not substitute itself on fix_fields @@ -2391,7 +2391,7 @@ Item_in_subselect::row_value_transformer(JOIN *join) } // we will refer to upper level cache array => we have to save it in PS - optimizer->keep_top_level_cache(); + DBUG_ASSERT(optimizer->get_cache()[0]->is_array_kept()); thd->lex->current_select= current; /* From 09fdd3aca6f0d6cfaf8218def9d1a99f5a325160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 26 Apr 2023 18:19:44 +0300 Subject: [PATCH 182/260] After-merge fix This fixes up commit e3f6e1c92e1604c63e4de113f8863953c05b29a9 --- storage/spider/spd_db_mysql.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc index 753e777017c..f11bf4fc439 100644 --- a/storage/spider/spd_db_mysql.cc +++ b/storage/spider/spd_db_mysql.cc @@ -2261,8 +2261,7 @@ void spider_db_mbase::fetch_and_print_warnings(struct tm *l_time) DBUG_VOID_RETURN; if (mysql_num_fields(res) == 3) - for (MYSQL_ROW row= mysql_fetch_row(res); row; - mysql_fetch_row(res)) + while (MYSQL_ROW row= mysql_fetch_row(res)) fprintf(stderr, "%04d%02d%02d %02d:%02d:%02d [WARN SPIDER RESULT] from [%s] %ld " "to %ld: %s %s %s\n", From 55cf4194f91262234eda1fabd380484894b1a5a7 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 9 Feb 2023 16:55:54 +1100 Subject: [PATCH 183/260] MDEV-30411: Fix my_timer_init() to match the code in as my_timer_cycles() make the compile-time logic in my_timer_cycles() also #define MY_TIMER_ROUTINE_CYCLES to indicate which implementation it is using. Then, make my_timer_init() use MY_TIMER_ROUTINE_CYCLES. This leaves us with just one set of compile-time #if's which determine how we read time in #cycles. Reviewer (and commit message author): Sergei Petrunia --- include/my_rdtsc.h | 53 +++++++++++++++++++++++++++++----------------- mysys/my_rdtsc.c | 24 +-------------------- 2 files changed, 34 insertions(+), 43 deletions(-) diff --git a/include/my_rdtsc.h b/include/my_rdtsc.h index b2d30fa3151..8b9b0046bc0 100644 --- a/include/my_rdtsc.h +++ b/include/my_rdtsc.h @@ -72,6 +72,26 @@ struct my_timer_info typedef struct my_timer_info MY_TIMER_INFO; +#define MY_TIMER_ROUTINE_RDTSC 5 +#define MY_TIMER_ROUTINE_ASM_IA64 6 +#define MY_TIMER_ROUTINE_PPC_GET_TIMEBASE 7 +#define MY_TIMER_ROUTINE_GETHRTIME 9 +#define MY_TIMER_ROUTINE_READ_REAL_TIME 10 +#define MY_TIMER_ROUTINE_CLOCK_GETTIME 11 +#define MY_TIMER_ROUTINE_GETTIMEOFDAY 13 +#define MY_TIMER_ROUTINE_QUERYPERFORMANCECOUNTER 14 +#define MY_TIMER_ROUTINE_GETTICKCOUNT 15 +#define MY_TIMER_ROUTINE_TIME 16 +#define MY_TIMER_ROUTINE_TIMES 17 +#define MY_TIMER_ROUTINE_FTIME 18 +#define MY_TIMER_ROUTINE_ASM_GCC_SPARC64 23 +#define MY_TIMER_ROUTINE_ASM_GCC_SPARC32 24 +#define MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME 25 +#define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26 +#define MY_TIMER_ROUTINE_ASM_S390 28 +#define MY_TIMER_ROUTINE_AARCH64 29 +#define MY_TIMER_ROUTINE_RISCV 30 + C_MODE_START /** @@ -133,28 +153,36 @@ C_MODE_START static inline ulonglong my_timer_cycles(void) { # if __has_builtin(__builtin_readcyclecounter) && !defined (__aarch64__) + #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_AARCH64 return __builtin_readcyclecounter(); # elif defined _M_IX86 || defined _M_X64 || defined __i386__ || defined __x86_64__ + #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_RDTSC return __rdtsc(); #elif defined _M_ARM64 + #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_AARCH64 return _ReadStatusReg(ARM64_CNTVCT); # elif defined(__INTEL_COMPILER) && defined(__ia64__) && defined(HAVE_IA64INTRIN_H) + #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_ASM_IA64 return (ulonglong) __getReg(_IA64_REG_AR_ITC); /* (3116) */ #elif defined(__GNUC__) && defined(__ia64__) + #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_ASM_IA64 { ulonglong result; __asm __volatile__ ("mov %0=ar.itc" : "=r" (result)); return result; } #elif defined __GNUC__ && defined __powerpc__ + #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_PPC_GET_TIMEBASE return __builtin_ppc_get_timebase(); #elif defined(__GNUC__) && defined(__sparcv9) && defined(_LP64) + #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_ASM_GCC_SPARC64 { ulonglong result; __asm __volatile__ ("rd %%tick,%0" : "=r" (result)); return result; } #elif defined(__GNUC__) && defined(__sparc__) && !defined(_LP64) + #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_ASM_GCC_SPARC32 { union { ulonglong wholeresult; @@ -167,6 +195,7 @@ static inline ulonglong my_timer_cycles(void) return result.wholeresult; } #elif defined(__GNUC__) && defined(__s390__) + #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_ASM_S390 /* covers both s390 and s390x */ { ulonglong result; @@ -174,12 +203,14 @@ static inline ulonglong my_timer_cycles(void) return result; } #elif defined(__GNUC__) && defined (__aarch64__) + #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_AARCH64 { ulonglong result; __asm __volatile("mrs %0, CNTVCT_EL0" : "=&r" (result)); return result; } #elif defined(__riscv) + #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_RISCV /* Use RDCYCLE (and RDCYCLEH on riscv32) */ { # if __riscv_xlen == 32 @@ -202,9 +233,11 @@ static inline ulonglong my_timer_cycles(void) } # endif #elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME) + #define MY_TIMER_ROUTINE_CYCLES MY_TIMER_ROUTINE_GETHRTIME /* gethrtime may appear as either cycle or nanosecond counter */ return (ulonglong) gethrtime(); #else + #define MY_TIMER_ROUTINE_CYCLES 0 return 0; #endif } @@ -241,25 +274,5 @@ void my_timer_init(MY_TIMER_INFO *mti); C_MODE_END -#define MY_TIMER_ROUTINE_RDTSC 5 -#define MY_TIMER_ROUTINE_ASM_IA64 6 -#define MY_TIMER_ROUTINE_PPC_GET_TIMEBASE 7 -#define MY_TIMER_ROUTINE_GETHRTIME 9 -#define MY_TIMER_ROUTINE_READ_REAL_TIME 10 -#define MY_TIMER_ROUTINE_CLOCK_GETTIME 11 -#define MY_TIMER_ROUTINE_GETTIMEOFDAY 13 -#define MY_TIMER_ROUTINE_QUERYPERFORMANCECOUNTER 14 -#define MY_TIMER_ROUTINE_GETTICKCOUNT 15 -#define MY_TIMER_ROUTINE_TIME 16 -#define MY_TIMER_ROUTINE_TIMES 17 -#define MY_TIMER_ROUTINE_FTIME 18 -#define MY_TIMER_ROUTINE_ASM_GCC_SPARC64 23 -#define MY_TIMER_ROUTINE_ASM_GCC_SPARC32 24 -#define MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME 25 -#define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26 -#define MY_TIMER_ROUTINE_ASM_S390 28 -#define MY_TIMER_ROUTINE_AARCH64 29 -#define MY_TIMER_ROUTINE_RISCV 30 - #endif diff --git a/mysys/my_rdtsc.c b/mysys/my_rdtsc.c index ffd816024e5..e16825cedd2 100644 --- a/mysys/my_rdtsc.c +++ b/mysys/my_rdtsc.c @@ -368,29 +368,7 @@ void my_timer_init(MY_TIMER_INFO *mti) /* cycles */ mti->cycles.frequency= 1000000000; -#if defined _WIN32 || defined __i386__ || defined __x86_64__ - mti->cycles.routine= MY_TIMER_ROUTINE_RDTSC; -#elif defined(__INTEL_COMPILER) && defined(__ia64__) && defined(HAVE_IA64INTRIN_H) - mti->cycles.routine= MY_TIMER_ROUTINE_ASM_IA64; -#elif defined(__GNUC__) && defined(__ia64__) - mti->cycles.routine= MY_TIMER_ROUTINE_ASM_IA64; -#elif defined __GNUC__ && defined __powerpc__ - mti->cycles.routine= MY_TIMER_ROUTINE_PPC_GET_TIMEBASE; -#elif defined(__GNUC__) && defined(__sparcv9) && defined(_LP64) && (__GNUC__>2) - mti->cycles.routine= MY_TIMER_ROUTINE_ASM_GCC_SPARC64; -#elif defined(__GNUC__) && defined(__sparc__) && !defined(_LP64) && (__GNUC__>2) - mti->cycles.routine= MY_TIMER_ROUTINE_ASM_GCC_SPARC32; -#elif defined(__GNUC__) && defined(__s390__) - mti->cycles.routine= MY_TIMER_ROUTINE_ASM_S390; -#elif defined(__GNUC__) && defined (__aarch64__) - mti->cycles.routine= MY_TIMER_ROUTINE_AARCH64; -#elif defined(__GNUC__) && defined (__riscv) - mti->cycles.routine= MY_TIMER_ROUTINE_RISCV; -#elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME) - mti->cycles.routine= MY_TIMER_ROUTINE_GETHRTIME; -#else - mti->cycles.routine= 0; -#endif + mti->cycles.routine= MY_TIMER_ROUTINE_CYCLES; if (!mti->cycles.routine || !my_timer_cycles()) { From 7020887e3edb8a681375b5e0cdd7cb59d3dfe1c0 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Sat, 4 Feb 2023 20:32:26 +1100 Subject: [PATCH 184/260] MDEV-30411: main.explain_json_format_partitions fails on Debian arm{el,hf} Extend the portability of ANALYZE FORMAT=JSON by using the microsecond timer if cycles isn't available. Reviewer: Sergei Petrunia --- sql/sql_analyze_stmt.h | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/sql/sql_analyze_stmt.h b/sql/sql_analyze_stmt.h index d033e79168a..30706889eff 100644 --- a/sql/sql_analyze_stmt.h +++ b/sql/sql_analyze_stmt.h @@ -38,6 +38,16 @@ $stmt"). */ +/* fake microseconds as cycles if cycles isn't available */ +static inline double timer_tracker_frequency() +{ +#if (MY_TIMER_ROUTINE_CYCLES) + return static_cast(sys_timer_info.cycles.frequency); +#else + return static_cast(sys_timer_info.microseconds.frequency); +#endif +} + class Gap_time_tracker; void attach_gap_time_tracker(THD *thd, Gap_time_tracker *gap_tracker, ulonglong timeval); void process_gap_time_tracker(THD *thd, ulonglong timeval); @@ -52,9 +62,18 @@ protected: ulonglong cycles; ulonglong last_start; + ulonglong measure() const + { +#if (MY_TIMER_ROUTINE_CYCLES) + return my_timer_cycles(); +#else + return my_timer_microseconds(); +#endif + } + void cycles_stop_tracking(THD *thd) { - ulonglong end= my_timer_cycles(); + ulonglong end= measure(); cycles += end - last_start; if (unlikely(end < last_start)) cycles += ULONGLONG_MAX; @@ -80,7 +99,7 @@ public: // interface for collecting time void start_tracking(THD *thd) { - last_start= my_timer_cycles(); + last_start= measure(); process_gap_time_tracker(thd, last_start); } @@ -96,7 +115,7 @@ public: { // convert 'cycles' to milliseconds. return 1000.0 * static_cast(cycles) / - static_cast(sys_timer_info.cycles.frequency); + timer_tracker_frequency(); } bool has_timed_statistics() const { return cycles > 0; } @@ -122,13 +141,11 @@ public: double get_time_ms() const { // convert 'cycles' to milliseconds. - return 1000.0 * static_cast(cycles) / - static_cast(sys_timer_info.cycles.frequency); + return 1000.0 * static_cast(cycles) / timer_tracker_frequency(); } }; - /* A class for counting certain actions (in all queries), and optionally collecting the timings (in ANALYZE queries). From f99a891858ac64fb09ab23aa6d3adb78fc491f6b Mon Sep 17 00:00:00 2001 From: Tuukka Pasanen Date: Mon, 13 Mar 2023 11:56:53 +0200 Subject: [PATCH 185/260] MDEV-30837: Remove usage of AWK from Debian init and postinst scripts AWK in used in Debian SysV-init and postinst scripts to determine is there enough space starting MariaDB database or create new database to target destination. These AWK scripts can be rewrited to use pure SH or help using Coreutils which is mandatory for usage of MariaDB currently. Reasoning behind this is to get rid of one very less used dependency --- debian/mariadb-server-10.6.mariadb.init | 5 ++++- debian/mariadb-server-10.6.preinst | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/debian/mariadb-server-10.6.mariadb.init b/debian/mariadb-server-10.6.mariadb.init index 0bc7a972e88..b2b7142084f 100644 --- a/debian/mariadb-server-10.6.mariadb.init +++ b/debian/mariadb-server-10.6.mariadb.init @@ -84,7 +84,10 @@ sanity_checks() { # check for diskspace shortage datadir=`mariadbd_get_param datadir` - if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then + # As preset blocksize of GNU df is 1024 then available bytes is $df_available_blocks * 1024 + # 4096 blocks is then lower than 4 MB + df_available_blocks=`LC_ALL=C BLOCKSIZE= df --output=avail "$datadir" | tail -n 1` + if [ "$df_available_blocks" -lt "4096" ]; then log_failure_msg "$0: ERROR: The partition with $datadir is too full!" echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER exit 1 diff --git a/debian/mariadb-server-10.6.preinst b/debian/mariadb-server-10.6.preinst index b79f20a9803..c865173e29e 100644 --- a/debian/mariadb-server-10.6.preinst +++ b/debian/mariadb-server-10.6.preinst @@ -209,8 +209,10 @@ if [ ! -d $mysql_datadir ] && [ ! -L $mysql_datadir ]; then mkdir -Z $mysql_datadir fi -# checking disc space -if LC_ALL=C BLOCKSIZE= df --portability $mysql_datadir/. | tail -n 1 | awk '{ exit ($4>1000) }'; then +# As preset blocksize of GNU df is 1024 then available bytes is $df_available_blocks * 1024 +# 4096 blocks is then lower than 4 MB +df_available_blocks=`LC_ALL=C BLOCKSIZE= df --output=avail "$datadir" | tail -n 1` +if [ "$df_available_blocks" -lt "4096" ]; then echo "ERROR: There's not enough space in $mysql_datadir/" 1>&2 db_stop exit 1 From c5e50c48bba3bad2da4dab498135c4ba7da4b4aa Mon Sep 17 00:00:00 2001 From: Tuukka Pasanen Date: Fri, 24 Mar 2023 11:42:15 +0200 Subject: [PATCH 186/260] MDEV-30837: Remove usage of AWK in autobake-debs.sh AWK is used in autobake-debs.sh for printing information about created DEB packages. This can be rewrite with bash inner commands read and echo. --- debian/autobake-deb.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index eed1f65fef6..5188413b40b 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -215,7 +215,11 @@ then for package in *.deb do echo "$package" | cut -d '_' -f 1 - dpkg-deb -c "$package" | awk '{print $1 " " $2 " " $6 " " $7 " " $8}' | sort -k 3 + # shellcheck disable=SC2034 + dpkg-deb -c "$package" | while IFS=" " read -r col1 col2 col3 col4 col5 col6 col7 col8 + do + echo "$col1 $col2 $col6 $col7 $col8" | sort -k 3 + done echo "------------------------------------------------" done fi From 6fccf8ba05a19e42ef7ec0e88d98fdcf165648bb Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 27 Apr 2023 16:14:05 +1000 Subject: [PATCH 187/260] MDEV-29644 post-merge fixup Applying b98375f instead of 9b32e4b for version 10.5-10.8. Applying 5075f4e instead of 9b32e4b for version 10.9+. --- .../bugfix/r/self_reference_multi.result | 4 +- storage/spider/spd_db_mysql.cc | 58 ++++++++++++------- storage/spider/spd_db_mysql.h | 2 +- 3 files changed, 41 insertions(+), 23 deletions(-) diff --git a/storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result b/storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result index 8ddf428b4ea..c4399ddf9d2 100644 --- a/storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result +++ b/storage/spider/mysql-test/spider/bugfix/r/self_reference_multi.result @@ -12,9 +12,9 @@ alter table t2 ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t0"'; select * from t0; ERROR HY000: An infinite loop is detected when opening table test.t0 select * from t1; -ERROR HY000: An infinite loop is detected when opening table test.t1 +ERROR HY000: An infinite loop is detected when opening table test.t0 select * from t2; -ERROR HY000: An infinite loop is detected when opening table test.t2 +ERROR HY000: An infinite loop is detected when opening table test.t0 drop table t0, t1, t2; for master_1 for child2 diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc index 78734640a52..bc8383017f7 100644 --- a/storage/spider/spd_db_mysql.cc +++ b/storage/spider/spd_db_mysql.cc @@ -2289,44 +2289,64 @@ bool spider_db_mbase::is_xa_nota_error( DBUG_RETURN(xa_nota); } -void spider_db_mbase::fetch_and_print_warnings(struct tm *l_time) +int spider_db_mbase::fetch_and_print_warnings(struct tm *l_time) { + int error_num = 0; DBUG_ENTER("spider_db_mbase::fetch_and_print_warnings"); + DBUG_PRINT("info",("spider this=%p", this)); if (spider_param_dry_access() || db_conn->status != MYSQL_STATUS_READY || - db_conn->server_status & SERVER_MORE_RESULTS_EXISTS) - DBUG_VOID_RETURN; + db_conn->server_status & SERVER_MORE_RESULTS_EXISTS || + !db_conn->warning_count) + DBUG_RETURN(0); if (mysql_real_query(db_conn, SPIDER_SQL_SHOW_WARNINGS_STR, SPIDER_SQL_SHOW_WARNINGS_LEN)) - DBUG_VOID_RETURN; + DBUG_RETURN(0); MYSQL_RES *res= mysql_store_result(db_conn); if (!res) - DBUG_VOID_RETURN; + DBUG_RETURN(0); uint num_fields= mysql_num_fields(res); if (num_fields != 3) { mysql_free_result(res); - DBUG_VOID_RETURN; + DBUG_RETURN(0); } MYSQL_ROW row= mysql_fetch_row(res); - while (row) + if (l_time) { - fprintf(stderr, - "%04d%02d%02d %02d:%02d:%02d [WARN SPIDER RESULT] from [%s] %ld " - "to %ld: %s %s %s\n", - l_time->tm_year + 1900, l_time->tm_mon + 1, l_time->tm_mday, - l_time->tm_hour, l_time->tm_min, l_time->tm_sec, conn->tgt_host, - (ulong) db_conn->thread_id, (ulong) current_thd->thread_id, row[0], - row[1], row[2]); - row= mysql_fetch_row(res); + while (row) + { + fprintf(stderr, + "%04d%02d%02d %02d:%02d:%02d [WARN SPIDER RESULT] from [%s] %ld " + "to %ld: %s %s %s\n", + l_time->tm_year + 1900, l_time->tm_mon + 1, l_time->tm_mday, + l_time->tm_hour, l_time->tm_min, l_time->tm_sec, conn->tgt_host, + (ulong) db_conn->thread_id, (ulong) current_thd->thread_id, row[0], + row[1], row[2]); + row= mysql_fetch_row(res); + } + } else { + while (row) + { + DBUG_PRINT("info",("spider row[0]=%s", row[0])); + DBUG_PRINT("info",("spider row[1]=%s", row[1])); + DBUG_PRINT("info",("spider row[2]=%s", row[2])); + longlong res_num = + (longlong) my_strtoll10(row[1], (char**) NULL, &error_num); + DBUG_PRINT("info",("spider res_num=%lld", res_num)); + my_printf_error((int) res_num, row[2], MYF(0)); + error_num = (int) res_num; + row = mysql_fetch_row(res); + } } + mysql_free_result(res); - DBUG_VOID_RETURN; + DBUG_RETURN(error_num); } spider_db_result *spider_db_mbase::store_result( @@ -14630,11 +14650,9 @@ int spider_mbase_handler::show_table_status( DBUG_RETURN(error_num); } } + if ((error_num = ((spider_db_mbase *) conn->db_conn)->fetch_and_print_warnings(NULL))) { - time_t cur_time = (time_t) time((time_t*) 0); - struct tm lt; - struct tm *l_time = localtime_r(&cur_time, <); - ((spider_db_mbase *) conn->db_conn)->fetch_and_print_warnings(l_time); + DBUG_RETURN(error_num); } if (share->static_records_for_status != -1) { diff --git a/storage/spider/spd_db_mysql.h b/storage/spider/spd_db_mysql.h index 757484c3990..a8eada5a62e 100644 --- a/storage/spider/spd_db_mysql.h +++ b/storage/spider/spd_db_mysql.h @@ -442,7 +442,7 @@ public: bool is_xa_nota_error( int error_num ); - void fetch_and_print_warnings(struct tm *l_time); + int fetch_and_print_warnings(struct tm *l_time); spider_db_result *store_result( spider_db_result_buffer **spider_res_buf, st_spider_db_request_key *request_key, From d0a71e90b8065cfa4122125dce1ad7f3fc6929df Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 27 Apr 2023 16:55:47 +1000 Subject: [PATCH 188/260] deb: sid - debian autobake Deb-autobakes where failing with: dh_missing: warning: usr/share/mysql/mysql-test/mysql-test-run exists in debian/tmp but is not installed to anywhere dh_missing: warning: usr/share/mysql/mysql-test/mtr exists in debian/tmp but is not installed to anywhere dh_missing: warning: usr/share/mysql/mysql-test/mariadb-test-run exists in debian/tmp but is not installed to anywhere dh_missing: warning: usr/share/mysql/mysql-test/mysql-test-run.pl exists in debian/tmp but is not installed to anywhere Add all to mariadb-test.install and remove mariadb-test.links --- debian/mariadb-test.install | 4 ++++ debian/mariadb-test.links | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) delete mode 100644 debian/mariadb-test.links diff --git a/debian/mariadb-test.install b/debian/mariadb-test.install index 1cb063440c6..5dda38d665c 100644 --- a/debian/mariadb-test.install +++ b/debian/mariadb-test.install @@ -41,7 +41,11 @@ usr/share/mysql/mysql-test/README.stress usr/share/mysql/mysql-test/dgcov.pl usr/share/mysql/mysql-test/lib usr/share/mysql/mysql-test/mariadb-stress-test.pl +usr/share/mysql/mysql-test/mariadb-test-run usr/share/mysql/mysql-test/mariadb-test-run.pl +usr/share/mysql/mysql-test/mtr +usr/share/mysql/mysql-test/mysql-test-run +usr/share/mysql/mysql-test/mysql-test-run.pl usr/share/mysql/mysql-test/purify.supp usr/share/mysql/mysql-test/suite.pm usr/share/mysql/mysql-test/valgrind.supp diff --git a/debian/mariadb-test.links b/debian/mariadb-test.links deleted file mode 100644 index 3939176ee96..00000000000 --- a/debian/mariadb-test.links +++ /dev/null @@ -1 +0,0 @@ -usr/share/mysql/mysql-test/mariadb-test-run.pl usr/share/mysql/mysql-test/mysql-test-run.pl From f272463b028d3c377acf02b4818ba8d607f71d1c Mon Sep 17 00:00:00 2001 From: Monty Date: Tue, 25 Apr 2023 21:16:43 +0300 Subject: [PATCH 189/260] Cleanup of MDEV-14974: --port ignored for --host=localhost The old code added to 10.6 was inconsisting in how TCP/IP and socket connection was chosen. One got also a confusing warning in some cases. Examples: > ../client/mysql --print-defaults ../client/mysql would have been started with the following arguments: --socket=/tmp/mariadbd.sock --port=3307 --no-auto-rehash > ../client/mysql ERROR 2002 (HY000): Can't connect to local server through socket '/tmp/mariadbd.sock' (2) > ../client/mysql --print-defaults ../client/mysql would have been started with the following arguments: --socket=/tmp/mariadbd.sock --port=3307 --no-auto-rehash > ../client/mysql --port=3333 WARNING: Forcing protocol to TCP due to option specification. Please explicitly state intended protocol. ERROR 2002 (HY000): Can't connect to server on 'localhost' (111) > ../client/mysql --port=3333 --socket=sss ERROR 2002 (HY000): Can't connect to local server through socket 'sss' (2) > ../client/mysql --socket=sss --port=3333 ERROR 2002 (HY000): Can't connect to local server through socket 'sss' (2) Some notable things: - One gets a warning if one uses just --port if config file sets socket - Using port and socket gives no warning - Using socket and then port still uses socket This patch changes things the following ways: If --port= is given on the command line, the the protocol is automatically changed to "TCP/IP". - If --socket= is given on the command line, the protocol is automatically changed to "socket". - The last option wins - No warning is given if protocol changes automatically. --- client/client_priv.h | 48 ------------- client/mysql.cc | 64 +++-------------- client/mysqladmin.cc | 61 +++------------- client/mysqlbinlog.cc | 53 +++----------- client/mysqlcheck.c | 59 ++------------- client/mysqldump.c | 72 ++++--------------- client/mysqlimport.c | 58 ++------------- client/mysqlshow.c | 59 ++------------- client/mysqlslap.c | 57 ++------------- .../cli_options_force_protocol_not_win.result | 24 +++---- .../cli_options_force_protocol_not_win.test | 34 +++++---- .../cli_options_force_protocol_win.result | 25 +++---- .../main/cli_options_force_protocol_win.test | 38 ++++------ 13 files changed, 113 insertions(+), 539 deletions(-) diff --git a/client/client_priv.h b/client/client_priv.h index 56e81ebb94f..3856859f89d 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -148,51 +148,3 @@ enum options_client #else #define SOCKET_PROTOCOL_TO_FORCE MYSQL_PROTOCOL_PIPE #endif - -/** - Utility function to implicitly change the connection protocol to a - consistent value given the command line arguments. Additionally, - warns the user that the protocol has been changed. - - Arguments: - @param [in] host Name of the host to connect to - @param [in, out] opt_protocol Location of the protocol option - variable to update - @param [in] new_protocol New protocol to force -*/ -static inline void warn_protocol_override(char *host, - uint *opt_protocol, - uint new_protocol) -{ - DBUG_ASSERT(new_protocol == MYSQL_PROTOCOL_TCP - || new_protocol == SOCKET_PROTOCOL_TO_FORCE); - - - if ((host == NULL - || strncmp(host, LOCAL_HOST, sizeof(LOCAL_HOST)-1) == 0)) - { - const char *protocol_name; - - if (*opt_protocol == MYSQL_PROTOCOL_DEFAULT -#ifndef _WIN32 - && new_protocol == MYSQL_PROTOCOL_SOCKET -#else - && new_protocol == MYSQL_PROTOCOL_TCP -#endif - ) - { - /* This is already the default behavior, do nothing */ - return; - } - - protocol_name= sql_protocol_typelib.type_names[new_protocol-1]; - - fprintf(stderr, "%s %s %s\n", - "WARNING: Forcing protocol to ", - protocol_name, - " due to option specification. " - "Please explicitly state intended protocol."); - - *opt_protocol = new_protocol; - } -} diff --git a/client/mysql.cc b/client/mysql.cc index 889b67cfa4d..bf3091ed262 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -210,8 +210,6 @@ static uint opt_protocol=0; static const char *opt_protocol_type= ""; static CHARSET_INFO *charset_info= &my_charset_latin1; -static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT; - #include "sslopt-vars.h" const char *default_dbug_option="d:t:o,/tmp/mariadb.trace"; @@ -1180,14 +1178,6 @@ int main(int argc,char *argv[]) exit(status.exit_status); } - /* Command line options override configured protocol */ - if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT - && protocol_to_force != opt_protocol) - { - warn_protocol_override(current_host, &opt_protocol, protocol_to_force); - } - - if (status.batch && !status.line_buff && !(status.line_buff= batch_readline_init(MAX_BATCH_BUFFER_SIZE, stdin))) { @@ -1737,11 +1727,9 @@ static void usage(int version) my_bool -get_one_option(const struct my_option *opt, const char *argument, const char *filename) +get_one_option(const struct my_option *opt, const char *argument, + const char *filename) { - /* Track when protocol is set via CLI to not force port TCP protocol override */ - static my_bool ignore_protocol_override = FALSE; - switch(opt->id) { case OPT_CHARSETS_DIR: strmake_buf(mysql_charsets_dir, argument); @@ -1802,18 +1790,11 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi #ifndef EMBEDDED_LIBRARY if (!argument[0]) opt_protocol= 0; - else if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib, + else if ((opt_protocol= + find_type_with_warning(argument, &sql_protocol_typelib, opt->name)) <= 0) exit(1); #endif - - /* Specification of protocol via CLI trumps implicit overrides */ - if (filename[0] == '\0') - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - break; case OPT_SERVER_ARG: #ifdef EMBEDDED_LIBRARY @@ -1913,13 +1894,6 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi #ifdef _WIN32 opt_protocol = MYSQL_PROTOCOL_PIPE; opt_protocol_type= "pipe"; - - /* Prioritize pipe if explicit via command line */ - if (filename[0] == '\0') - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } #endif break; #include @@ -1932,35 +1906,17 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi mysql_end(-1); break; case 'P': - /* If port and socket are set, fall back to default behavior */ - if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE) + if (filename[0] == '\0') { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - - /* If port is set via CLI, try to force protocol to TCP */ - if (filename[0] == '\0' && - !ignore_protocol_override && - protocol_to_force == MYSQL_PROTOCOL_DEFAULT) - { - protocol_to_force = MYSQL_PROTOCOL_TCP; + /* Port given on command line, switch protocol to use TCP */ + opt_protocol= MYSQL_PROTOCOL_TCP; } break; case 'S': - /* If port and socket are set, fall back to default behavior */ - if (protocol_to_force == MYSQL_PROTOCOL_TCP) + if (filename[0] == '\0') { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - - /* Prioritize socket if set via command line */ - if (filename[0] == '\0' && - !ignore_protocol_override && - protocol_to_force == MYSQL_PROTOCOL_DEFAULT) - { - protocol_to_force = SOCKET_PROTOCOL_TO_FORCE; + /* Socket given on command line, switch protocol to use SOCKETSt */ + opt_protocol= MYSQL_PROTOCOL_SOCKET; } break; case 'I': diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 38c1caf654a..e11dd4f91be 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -54,8 +54,6 @@ static bool sql_log_bin_off= false; static uint opt_protocol=0; static myf error_flags; /* flags to pass to my_printf_error, like ME_BELL */ -static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT; - /* When using extended-status relatively, ex_val_max_len is the estimated maximum length for any relative value printed by extended-status. The @@ -243,12 +241,9 @@ static const char *load_default_groups[]= 0 }; my_bool -get_one_option(const struct my_option *opt, const char *argument, const char *filename) +get_one_option(const struct my_option *opt, const char *argument, + const char *filename) { - - /* Track when protocol is set via CLI to not force overrides */ - static my_bool ignore_protocol_override = FALSE; - switch(opt->id) { case 'c': opt_count_iterations= 1; @@ -280,13 +275,6 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi case 'W': #ifdef _WIN32 opt_protocol = MYSQL_PROTOCOL_PIPE; - - /* Prioritize pipe if explicit via command line */ - if (filename[0] == '\0') - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } #endif break; case '#': @@ -322,45 +310,19 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi sf_leaking_memory= 1; /* no memory leak reports here */ exit(1); } - - /* Specification of protocol via CLI trumps implicit overrides */ - if (filename[0] == '\0') - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - break; case 'P': - /* If port and socket are set, fall back to default behavior */ - if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE) + if (filename[0] == '\0') { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - - /* If port is set via CLI, try to force protocol to TCP */ - if (filename[0] == '\0' && - !ignore_protocol_override && - protocol_to_force == MYSQL_PROTOCOL_DEFAULT) - { - protocol_to_force = MYSQL_PROTOCOL_TCP; + /* Port given on command line, switch protocol to use TCP */ + opt_protocol= MYSQL_PROTOCOL_TCP; } break; case 'S': - /* If port and socket are set, fall back to default behavior */ - if (protocol_to_force == MYSQL_PROTOCOL_TCP) + if (filename[0] == '\0') { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - - /* Prioritize socket if set via command line */ - if (filename[0] == '\0' && - !ignore_protocol_override && - protocol_to_force == MYSQL_PROTOCOL_DEFAULT) - { - protocol_to_force = SOCKET_PROTOCOL_TO_FORCE; + /* Socket given on command line, switch protocol to use SOCKETSt */ + opt_protocol= MYSQL_PROTOCOL_SOCKET; } break; } @@ -388,13 +350,6 @@ int main(int argc,char *argv[]) temp_argv= mask_password(argc, &argv); temp_argc= argc; - /* Command line options override configured protocol */ - if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT - && protocol_to_force != opt_protocol) - { - warn_protocol_override(host, &opt_protocol, protocol_to_force); - } - if (debug_info_flag) my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO; if (debug_check_flag) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 460ab22c3c9..d644a9bda49 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -98,8 +98,6 @@ static const char *output_prefix= ""; static char **defaults_argv= 0; static MEM_ROOT glob_root; -static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT; - #ifndef DBUG_OFF static const char *default_dbug_option = "d:t:o,/tmp/mariadb-binlog.trace"; const char *current_dbug_option= default_dbug_option; @@ -1898,13 +1896,11 @@ static my_time_t convert_str_to_timestamp(const char* str) extern "C" my_bool -get_one_option(const struct my_option *opt, const char *argument, const char *filename) +get_one_option(const struct my_option *opt, const char *argument, + const char *filename) { bool tty_password=0; - /* Track when protocol is set via CLI to not force overrides */ - static my_bool ignore_protocol_override = FALSE; - switch (opt->id) { #ifndef DBUG_OFF case '#': @@ -1954,14 +1950,6 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi sf_leaking_memory= 1; /* no memory leak reports here */ die(1); } - - /* Specification of protocol via CLI trumps implicit overrides */ - if (filename[0] == '\0') - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - break; #ifdef WHEN_FLASHBACK_REVIEW_READY case opt_flashback_review: @@ -2039,35 +2027,17 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi print_row_event_positions_used= 1; break; case 'P': - /* If port and socket are set, fall back to default behavior */ - if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE) + if (filename[0] == '\0') { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - - /* If port is set via CLI, try to force protocol to TCP */ - if (filename[0] == '\0' && - !ignore_protocol_override && - protocol_to_force == MYSQL_PROTOCOL_DEFAULT) - { - protocol_to_force = MYSQL_PROTOCOL_TCP; + /* Port given on command line, switch protocol to use TCP */ + opt_protocol= MYSQL_PROTOCOL_TCP; } break; case 'S': - /* If port and socket are set, fall back to default behavior */ - if (protocol_to_force == MYSQL_PROTOCOL_TCP) + if (filename[0] == '\0') { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - - /* Prioritize socket if set via command line */ - if (filename[0] == '\0' && - !ignore_protocol_override && - protocol_to_force == MYSQL_PROTOCOL_DEFAULT) - { - protocol_to_force = SOCKET_PROTOCOL_TO_FORCE; + /* Socket given on command line, switch protocol to use SOCKETSt */ + opt_protocol= MYSQL_PROTOCOL_SOCKET; } break; case 'v': @@ -3043,13 +3013,6 @@ int main(int argc, char** argv) parse_args(&argc, (char***)&argv); - /* Command line options override configured protocol */ - if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT - && protocol_to_force != opt_protocol) - { - warn_protocol_override(host, &opt_protocol, protocol_to_force); - } - if (!argc || opt_version) { if (!opt_version) diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index c37e258f186..c6f384ac185 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -57,8 +57,6 @@ DYNAMIC_ARRAY tables4repair, tables4rebuild, alter_table_cmds; DYNAMIC_ARRAY views4repair; static uint opt_protocol=0; -static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT; - enum operations { DO_CHECK=1, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE, DO_FIX_NAMES }; const char *operation_name[]= { @@ -291,10 +289,6 @@ get_one_option(const struct my_option *opt, const char *filename) { int orig_what_to_do= what_to_do; - - /* Track when protocol is set via CLI to not force overrides */ - static my_bool ignore_protocol_override = FALSE; - DBUG_ENTER("get_one_option"); switch(opt->id) { @@ -357,13 +351,6 @@ get_one_option(const struct my_option *opt, case 'W': #ifdef _WIN32 opt_protocol = MYSQL_PROTOCOL_PIPE; - - /* Prioritize pipe if explicit via command line */ - if (filename[0] == '\0') - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } #endif break; case '#': @@ -387,45 +374,19 @@ get_one_option(const struct my_option *opt, sf_leaking_memory= 1; /* no memory leak reports here */ exit(1); } - - /* Specification of protocol via CLI trumps implicit overrides */ - if (filename[0] == '\0') - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - break; case 'P': - /* If port and socket are set, fall back to default behavior */ - if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE) + if (filename[0] == '\0') { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - - /* If port is set via CLI, try to force protocol to TCP */ - if (filename[0] == '\0' && - !ignore_protocol_override && - protocol_to_force == MYSQL_PROTOCOL_DEFAULT) - { - protocol_to_force = MYSQL_PROTOCOL_TCP; + /* Port given on command line, switch protocol to use TCP */ + opt_protocol= MYSQL_PROTOCOL_TCP; } break; case 'S': - /* If port and socket are set, fall back to default behavior */ - if (protocol_to_force == MYSQL_PROTOCOL_TCP) + if (filename[0] == '\0') { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - - /* Prioritize socket if set via command line */ - if (filename[0] == '\0' && - !ignore_protocol_override && - protocol_to_force == MYSQL_PROTOCOL_DEFAULT) - { - protocol_to_force = SOCKET_PROTOCOL_TO_FORCE; + /* Socket given on command line, switch protocol to use SOCKETSt */ + opt_protocol= MYSQL_PROTOCOL_SOCKET; } break; } @@ -1248,14 +1209,6 @@ int main(int argc, char **argv) if (get_options(&argc, &argv)) goto end1; - - /* Command line options override configured protocol */ - if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT - && protocol_to_force != opt_protocol) - { - warn_protocol_override(current_host, &opt_protocol, protocol_to_force); - } - sf_leaking_memory=0; /* from now on we cleanup properly */ ret= EX_MYSQLERR; diff --git a/client/mysqldump.c b/client/mysqldump.c index 9c973b9b8cb..50ace857b9e 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -194,12 +194,10 @@ FILE *stderror_file=0; static uint opt_protocol= 0; static char *opt_plugin_dir= 0, *opt_default_auth= 0; -static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT; - /* -Dynamic_string wrapper functions. In this file use these -wrappers, they will terminate the process if there is -an allocation failure. + Dynamic_string wrapper functions. In this file use these + wrappers, they will terminate the process if there is + an allocation failure. */ static void init_dynamic_string_checked(DYNAMIC_STRING *str, const char *init_str, size_t init_alloc, size_t alloc_increment); @@ -871,9 +869,6 @@ get_one_option(const struct my_option *opt, const char *filename) { - /* Track when protocol is set via CLI to not force overrides */ - static my_bool ignore_protocol_override = FALSE; - switch (opt->id) { case 'p': if (argument == disabled_my_option) @@ -904,13 +899,6 @@ get_one_option(const struct my_option *opt, case 'W': #ifdef _WIN32 opt_protocol= MYSQL_PROTOCOL_PIPE; - - /* Prioritize pipe if explicit via command line */ - if (filename[0] == '\0') - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } #endif break; case 'N': @@ -1061,49 +1049,23 @@ get_one_option(const struct my_option *opt, sf_leaking_memory= 1; /* no memory leak reports here */ exit(1); } - - /* Specification of protocol via CLI trumps implicit overrides */ - if (filename[0] == '\0') - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - break; case (int) OPT_DEFAULT_CHARSET: if (default_charset == disabled_my_option) default_charset= (char *)mysql_universal_client_charset; break; case 'P': - /* If port and socket are set, fall back to default behavior */ - if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE) + if (filename[0] == '\0') { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - - /* If port is set via CLI, try to force protocol to TCP */ - if (filename[0] == '\0' && - !ignore_protocol_override && - protocol_to_force == MYSQL_PROTOCOL_DEFAULT) - { - protocol_to_force = MYSQL_PROTOCOL_TCP; + /* Port given on command line, switch protocol to use TCP */ + opt_protocol= MYSQL_PROTOCOL_TCP; } break; case 'S': - /* If port and socket are set, fall back to default behavior */ - if (protocol_to_force == MYSQL_PROTOCOL_TCP) + if (filename[0] == '\0') { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - - /* Prioritize socket if set via command line */ - if (filename[0] == '\0' && - !ignore_protocol_override && - protocol_to_force == MYSQL_PROTOCOL_DEFAULT) - { - protocol_to_force = SOCKET_PROTOCOL_TO_FORCE; + /* Socket given on command line, switch protocol to use SOCKETSt */ + opt_protocol= MYSQL_PROTOCOL_SOCKET; } break; } @@ -1152,19 +1114,9 @@ static int get_options(int *argc, char ***argv) return(ho_error); /* - Command line options override configured protocol - */ - if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT - && protocol_to_force != opt_protocol) - { - warn_protocol_override(current_host, &opt_protocol, protocol_to_force); - } - - - /* - Dumping under --system=stats with --replace or --insert-ignore is safe and will not - result into race condition. Otherwise dump only structure and ignore data by default - while dumping. + Dumping under --system=stats with --replace or --insert-ignore is + safe and will not result into race condition. Otherwise dump only + structure and ignore data by default while dumping. */ if (!(opt_system & OPT_SYSTEM_STATS) && !(opt_ignore || opt_replace_into)) { diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 185cf69b9b6..8628b32dd53 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -64,8 +64,6 @@ static char * opt_mysql_unix_port=0; static char *opt_plugin_dir= 0, *opt_default_auth= 0; static longlong opt_ignore_lines= -1; -static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT; - #include static char **argv_to_free; @@ -227,9 +225,6 @@ static my_bool get_one_option(const struct my_option *opt, const char *argument, const char *filename) { - /* Track when protocol is set via CLI to not force overrides */ - static my_bool ignore_protocol_override = FALSE; - switch(opt->id) { case 'p': if (argument == disabled_my_option) @@ -256,14 +251,6 @@ get_one_option(const struct my_option *opt, const char *argument, case 'W': opt_protocol = MYSQL_PROTOCOL_PIPE; opt_local_file=1; - - /* Prioritize pipe if explicit via command line */ - if (filename[0] == '\0') - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - break; #endif case OPT_MYSQL_PROTOCOL: @@ -273,45 +260,19 @@ get_one_option(const struct my_option *opt, const char *argument, sf_leaking_memory= 1; /* no memory leak reports here */ exit(1); } - - /* Specification of protocol via CLI trumps implicit overrides */ - if (filename[0] == '\0') - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - break; case 'P': - /* If port and socket are set, fall back to default behavior */ - if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE) + if (filename[0] == '\0') { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - - /* If port is set via CLI, try to force protocol to TCP */ - if (filename[0] == '\0' && - !ignore_protocol_override && - protocol_to_force == MYSQL_PROTOCOL_DEFAULT) - { - protocol_to_force = MYSQL_PROTOCOL_TCP; + /* Port given on command line, switch protocol to use TCP */ + opt_protocol= MYSQL_PROTOCOL_TCP; } break; case 'S': - /* If port and socket are set, fall back to default behavior */ - if (protocol_to_force == MYSQL_PROTOCOL_TCP) + if (filename[0] == '\0') { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - - /* Prioritize socket if set via command line */ - if (filename[0] == '\0' && - !ignore_protocol_override && - protocol_to_force == MYSQL_PROTOCOL_DEFAULT) - { - protocol_to_force = SOCKET_PROTOCOL_TO_FORCE; + /* Socket given on command line, switch protocol to use SOCKETSt */ + opt_protocol= MYSQL_PROTOCOL_SOCKET; } break; case '#': @@ -709,13 +670,6 @@ int main(int argc, char **argv) return(1); } - /* Command line options override configured protocol */ - if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT - && protocol_to_force != opt_protocol) - { - warn_protocol_override(current_host, &opt_protocol, protocol_to_force); - } - sf_leaking_memory=0; /* from now on we cleanup properly */ if (opt_use_threads && !lock_tables) diff --git a/client/mysqlshow.c b/client/mysqlshow.c index 23bafa3ccea..824686173ec 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -41,8 +41,6 @@ static char *opt_plugin_dir= 0, *opt_default_auth= 0; static uint opt_protocol=0; -static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT; - static void get_options(int *argc,char ***argv); static uint opt_mysql_port=0; static int list_dbs(MYSQL *mysql,const char *wild); @@ -81,14 +79,6 @@ int main(int argc, char **argv) get_options(&argc,&argv); - - /* Command line options override configured protocol */ - if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT - && protocol_to_force != opt_protocol) - { - warn_protocol_override(host, &opt_protocol, protocol_to_force); - } - sf_leaking_memory=0; /* from now on we cleanup properly */ wild=0; if (argc) @@ -307,9 +297,6 @@ get_one_option(const struct my_option *opt, const char *argument, const char *filename) { - /* Track when protocol is set via CLI to not force overrides */ - static my_bool ignore_protocol_override = FALSE; - switch(opt->id) { case 'v': opt_verbose++; @@ -338,13 +325,6 @@ get_one_option(const struct my_option *opt, const char *argument, case 'W': #ifdef _WIN32 opt_protocol = MYSQL_PROTOCOL_PIPE; - - /* Prioritize pipe if explicit via command line */ - if (filename[0] == '\0') - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } #endif break; case OPT_MYSQL_PROTOCOL: @@ -354,47 +334,22 @@ get_one_option(const struct my_option *opt, const char *argument, sf_leaking_memory= 1; /* no memory leak reports here */ exit(1); } - - /* Specification of protocol via CLI trumps implicit overrides */ - if (filename[0] == '\0') - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - break; case 'P': - /* If port and socket are set, fall back to default behavior */ - if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE) + if (filename[0] == '\0') { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - - /* If port is set via CLI, try to force protocol to TCP */ - if (filename[0] == '\0' && - !ignore_protocol_override && - protocol_to_force == MYSQL_PROTOCOL_DEFAULT) - { - protocol_to_force = MYSQL_PROTOCOL_TCP; + /* Port given on command line, switch protocol to use TCP */ + opt_protocol= MYSQL_PROTOCOL_TCP; } break; case 'S': - /* If port and socket are set, fall back to default behavior */ - if (protocol_to_force == MYSQL_PROTOCOL_TCP) + if (filename[0] == '\0') { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - - /* Prioritize socket if set via command line */ - if (filename[0] == '\0' && - !ignore_protocol_override && - protocol_to_force == MYSQL_PROTOCOL_DEFAULT) - { - protocol_to_force = SOCKET_PROTOCOL_TO_FORCE; + /* Socket given on command line, switch protocol to use SOCKETSt */ + opt_protocol= MYSQL_PROTOCOL_SOCKET; } break; + break; case '#': DBUG_PUSH(argument ? argument : "d:t:o"); debug_check_flag= 1; diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 27a80a115fd..79e5fe1f8bc 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -172,8 +172,6 @@ File csv_file; static uint opt_protocol= 0; -static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT; - static int get_options(int *argc,char ***argv); static uint opt_mysql_port= 0; @@ -335,13 +333,6 @@ int main(int argc, char **argv) exit(1); } - /* Command line options override configured protocol */ - if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT - && protocol_to_force != opt_protocol) - { - warn_protocol_override(host, &opt_protocol, protocol_to_force); - } - sf_leaking_memory=0; /* from now on we cleanup properly */ /* Seed the random number generator if we will be using it. */ @@ -744,9 +735,6 @@ static my_bool get_one_option(const struct my_option *opt, const char *argument, const char *filename) { - /* Track when protocol is set via CLI to not force overrides */ - static my_bool ignore_protocol_override = FALSE; - DBUG_ENTER("get_one_option"); switch(opt->id) { case 'v': @@ -776,13 +764,6 @@ get_one_option(const struct my_option *opt, const char *argument, case 'W': #ifdef _WIN32 opt_protocol= MYSQL_PROTOCOL_PIPE; - - /* Prioritize pipe if explicit via command line */ - if (filename[0] == '\0') - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } #endif break; case OPT_MYSQL_PROTOCOL: @@ -792,45 +773,19 @@ get_one_option(const struct my_option *opt, const char *argument, sf_leaking_memory= 1; /* no memory leak reports here */ exit(1); } - - /* Specification of protocol via CLI trumps implicit overrides */ - if (filename[0] == '\0') - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - break; case 'P': - /* If port and socket are set, fall back to default behavior */ - if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE) + if (filename[0] == '\0') { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - - /* If port is set via CLI, try to force protocol to TCP */ - if (filename[0] == '\0' && - !ignore_protocol_override && - protocol_to_force == MYSQL_PROTOCOL_DEFAULT) - { - protocol_to_force = MYSQL_PROTOCOL_TCP; + /* Port given on command line, switch protocol to use TCP */ + opt_protocol= MYSQL_PROTOCOL_TCP; } break; case 'S': - /* If port and socket are set, fall back to default behavior */ - if (protocol_to_force == MYSQL_PROTOCOL_TCP) + if (filename[0] == '\0') { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - - /* Prioritize socket if set via command line */ - if (filename[0] == '\0' && - !ignore_protocol_override && - protocol_to_force == MYSQL_PROTOCOL_DEFAULT) - { - protocol_to_force = SOCKET_PROTOCOL_TO_FORCE; + /* Socket given on command line, switch protocol to use SOCKETSt */ + opt_protocol= MYSQL_PROTOCOL_SOCKET; } break; case '#': diff --git a/mysql-test/main/cli_options_force_protocol_not_win.result b/mysql-test/main/cli_options_force_protocol_not_win.result index 20b12eb2cc0..46ee29dc509 100644 --- a/mysql-test/main/cli_options_force_protocol_not_win.result +++ b/mysql-test/main/cli_options_force_protocol_not_win.result @@ -4,21 +4,19 @@ # # The following group of tests should produce no warnings # -# exec MYSQL --host=localhost -e "status" 2>&1 | grep "Connection:\|WARNING:" +# exec MYSQL --host=localhost -e "status" 2>&1 | grep "Connection:" Connection: Localhost via UNIX socket -# exec MYSQL --port=MASTER_MYPORT --protocol=tcp -e "status" 2>&1 | grep "Connection:\|WARNING:" +# exec MYSQL --port=MASTER_MYPORT --protocol=tcp -e "status" 2>&1 | grep "Connection:" Connection: localhost via TCP/IP -# exec MYSQL --host=localhost --port=MASTER_MYPORT --protocol=socket -e "status" 2>&1 | grep "Connection:\|WARNING:" +# exec MYSQL --host=localhost --port=MASTER_MYPORT --protocol=socket -e "status" 2>&1 | grep "Connection:" Connection: Localhost via UNIX socket -# exec MYSQL --host=127.0.0.1 --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:\|WARNING:" +# exec MYSQL --host=127.0.0.1 --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:" Connection: 127.0.0.1 via TCP/IP -# exec MYSQL --host=localhost --socket=MASTER_MYSOCK --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:\|WARNING:" -Connection: Localhost via UNIX socket -# exec MYSQL --host=localhost --socket=MASTER_MYSOCK -e "status" 2>&1 | grep "Connection:\|WARNING:" -Connection: Localhost via UNIX socket -# -# The remaining tests should produce warnings -# -# exec MYSQL --host=localhost --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:\|WARNING:" -WARNING: Forcing protocol to TCP due to option specification. Please explicitly state intended protocol. +# exec MYSQL --host=localhost --socket=MASTER_MYSOCK --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:" +Connection: localhost via TCP/IP +# exec MYSQL --host=localhost --port=MASTER_MYPORT --socket=MASTER_MYSOCK -e "status" 2>&1 | grep "Connection:" +Connection: Localhost via UNIX socket +# exec MYSQL --host=localhost --socket=MASTER_MYSOCK -e "status" 2>&1 | grep "Connection:" +Connection: Localhost via UNIX socket +# exec MYSQL --host=localhost --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:" Connection: localhost via TCP/IP diff --git a/mysql-test/main/cli_options_force_protocol_not_win.test b/mysql-test/main/cli_options_force_protocol_not_win.test index a3c495f26ee..a92f6b93c4d 100644 --- a/mysql-test/main/cli_options_force_protocol_not_win.test +++ b/mysql-test/main/cli_options_force_protocol_not_win.test @@ -10,28 +10,26 @@ --echo # The following group of tests should produce no warnings --echo # ---echo # exec MYSQL --host=localhost -e "status" 2>&1 | grep "Connection:\|WARNING:" ---exec $MYSQL --host=localhost -e "status" 2>&1 | grep "Connection:\|WARNING:" +--echo # exec MYSQL --host=localhost -e "status" 2>&1 | grep "Connection:" +--exec $MYSQL --host=localhost -e "status" 2>&1 | grep "Connection:" ---echo # exec MYSQL --port=MASTER_MYPORT --protocol=tcp -e "status" 2>&1 | grep "Connection:\|WARNING:" ---exec $MYSQL --port=$MASTER_MYPORT --protocol=tcp -e "status" 2>&1 | grep "Connection:\|WARNING:" +--echo # exec MYSQL --port=MASTER_MYPORT --protocol=tcp -e "status" 2>&1 | grep "Connection:" +--exec $MYSQL --port=$MASTER_MYPORT --protocol=tcp -e "status" 2>&1 | grep "Connection:" ---echo # exec MYSQL --host=localhost --port=MASTER_MYPORT --protocol=socket -e "status" 2>&1 | grep "Connection:\|WARNING:" ---exec $MYSQL --host=localhost --port=$MASTER_MYPORT --protocol=socket -e "status" 2>&1 | grep "Connection:\|WARNING:" +--echo # exec MYSQL --host=localhost --port=MASTER_MYPORT --protocol=socket -e "status" 2>&1 | grep "Connection:" +--exec $MYSQL --host=localhost --port=$MASTER_MYPORT --protocol=socket -e "status" 2>&1 | grep "Connection:" ---echo # exec MYSQL --host=127.0.0.1 --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:\|WARNING:" ---exec $MYSQL --host=127.0.0.1 --port=$MASTER_MYPORT -e "status" 2>&1 | grep "Connection:\|WARNING:" +--echo # exec MYSQL --host=127.0.0.1 --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:" +--exec $MYSQL --host=127.0.0.1 --port=$MASTER_MYPORT -e "status" 2>&1 | grep "Connection:" ---echo # exec MYSQL --host=localhost --socket=MASTER_MYSOCK --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:\|WARNING:" ---exec $MYSQL --host=localhost --socket=$MASTER_MYSOCK --port=$MASTER_MYPORT -e "status" 2>&1 | grep "Connection:\|WARNING:" +--echo # exec MYSQL --host=localhost --socket=MASTER_MYSOCK --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:" +--exec $MYSQL --host=localhost --socket=$MASTER_MYSOCK --port=$MASTER_MYPORT -e "status" 2>&1 | grep "Connection:" ---echo # exec MYSQL --host=localhost --socket=MASTER_MYSOCK -e "status" 2>&1 | grep "Connection:\|WARNING:" ---exec $MYSQL --host=localhost --socket=$MASTER_MYSOCK -e "status" 2>&1 | grep "Connection:\|WARNING:" +--echo # exec MYSQL --host=localhost --port=MASTER_MYPORT --socket=MASTER_MYSOCK -e "status" 2>&1 | grep "Connection:" +--exec $MYSQL --host=localhost --port=MASTER_MYPORT --socket=$MASTER_MYSOCK -e "status" 2>&1 | grep "Connection:" +--echo # exec MYSQL --host=localhost --socket=MASTER_MYSOCK -e "status" 2>&1 | grep "Connection:" +--exec $MYSQL --host=localhost --socket=$MASTER_MYSOCK -e "status" 2>&1 | grep "Connection:" ---echo # ---echo # The remaining tests should produce warnings ---echo # - ---echo # exec MYSQL --host=localhost --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:\|WARNING:" ---exec $MYSQL --host=localhost --port=$MASTER_MYPORT -e "status" 2>&1 | grep "Connection:\|WARNING:" +--echo # exec MYSQL --host=localhost --port=MASTER_MYPORT -e "status" 2>&1 | grep "Connection:" +--exec $MYSQL --host=localhost --port=$MASTER_MYPORT -e "status" 2>&1 | grep "Connection:" diff --git a/mysql-test/main/cli_options_force_protocol_win.result b/mysql-test/main/cli_options_force_protocol_win.result index 4fffc2a4837..eedfde4f1de 100644 --- a/mysql-test/main/cli_options_force_protocol_win.result +++ b/mysql-test/main/cli_options_force_protocol_win.result @@ -1,24 +1,17 @@ # # MDEV-14974: --port ignored for --host=localhost # -# -# The following group of tests should produce no warnings -# -# exec MYSQL --host=localhost -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" +# exec MYSQL --host=localhost -e "status" 2>&1 | findstr /c:"Connection:" Connection: localhost via TCP/IP -# exec MYSQL --host=localhost --port=MASTER_MYPORT -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" +# exec MYSQL --host=localhost --port=MASTER_MYPORT -e "status" 2>&1 | findstr /c:"Connection:" Connection: localhost via TCP/IP -# exec MYSQL --host=localhost --port=MASTER_MYPORT --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" +# exec MYSQL --host=localhost --port=MASTER_MYPORT --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" Connection: localhost via TCP/IP -# exec MYSQL --host=localhost --protocol=pipe -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" +# exec MYSQL --host=localhost --protocol=pipe -e "status" 2>&1 | findstr /c:"Connection:" Connection: localhost via named pipe -# exec MYSQL --host=localhost -W -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" -Connection: localhost via named pipe -# exec MYSQL --host=localhost -W --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" -Connection: localhost via named pipe -# -# The remaining tests should produce warnings -# -# exec MYSQL --host=localhost --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" -WARNING: Forcing protocol to PIPE due to option specification. Please explicitly state intended protocol. +# exec MYSQL --host=localhost -W -e "status" 2>&1 | findstr /c:"Connection:" Connection: localhost via named pipe +# exec MYSQL --host=localhost -W --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" +Connection: localhost via TCP/IP +# exec MYSQL --host=localhost --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" +Connection: localhost via TCP/IP diff --git a/mysql-test/main/cli_options_force_protocol_win.test b/mysql-test/main/cli_options_force_protocol_win.test index 54fbb78e5dc..63024f3b620 100644 --- a/mysql-test/main/cli_options_force_protocol_win.test +++ b/mysql-test/main/cli_options_force_protocol_win.test @@ -5,33 +5,23 @@ --source include/not_embedded.inc --source include/windows.inc +--echo # exec MYSQL --host=localhost -e "status" 2>&1 | findstr /c:"Connection:" +--exec $MYSQL --host=localhost -e "status" 2>&1 | findstr /c:"Connection:" ---echo # ---echo # The following group of tests should produce no warnings ---echo # +--echo # exec MYSQL --host=localhost --port=MASTER_MYPORT -e "status" 2>&1 | findstr /c:"Connection:" +--exec $MYSQL --host=localhost --port=$MASTER_MYPORT -e "status" 2>&1 | findstr /c:"Connection:" ---echo # exec MYSQL --host=localhost -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" ---exec $MYSQL --host=localhost -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" +--echo # exec MYSQL --host=localhost --port=MASTER_MYPORT --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" +--exec $MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" ---echo # exec MYSQL --host=localhost --port=MASTER_MYPORT -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" ---exec $MYSQL --host=localhost --port=$MASTER_MYPORT -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" +--echo # exec MYSQL --host=localhost --protocol=pipe -e "status" 2>&1 | findstr /c:"Connection:" +--exec $MYSQL --host=localhost --protocol=pipe -e "status" 2>&1 | findstr /c:"Connection:" ---echo # exec MYSQL --host=localhost --port=MASTER_MYPORT --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" ---exec $MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" +--echo # exec MYSQL --host=localhost -W -e "status" 2>&1 | findstr /c:"Connection:" +--exec $MYSQL --host=localhost -W -e "status" 2>&1 | findstr /c:"Connection:" ---echo # exec MYSQL --host=localhost --protocol=pipe -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" ---exec $MYSQL --host=localhost --protocol=pipe -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" +--echo # exec MYSQL --host=localhost -W --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" +--exec $MYSQL --host=localhost -W --socket=$MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" ---echo # exec MYSQL --host=localhost -W -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" ---exec $MYSQL --host=localhost -W -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" - ---echo # exec MYSQL --host=localhost -W --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" ---exec $MYSQL --host=localhost -W --socket=$MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" - - ---echo # ---echo # The remaining tests should produce warnings ---echo # - ---echo # exec MYSQL --host=localhost --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" ---exec $MYSQL --host=localhost --socket=$MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" /c:"WARNING:" +--echo # exec MYSQL --host=localhost --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" +--exec $MYSQL --host=localhost --socket=$MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:" From a959c22e7fbbac9c19cc9e1dfb18284bf7c67046 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Thu, 27 Apr 2023 10:46:41 +0200 Subject: [PATCH 190/260] return accidentally removed in 45d4f6b97b4811b1b7783dcd19526be1dbb196dc comment --- sql/table.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sql/table.cc b/sql/table.cc index fd5334271be..15a92818b81 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -3171,6 +3171,12 @@ int TABLE_SHARE::init_from_sql_statement_string(THD *thd, bool write, LEX_CSTRING db_backup= thd->db; DBUG_ENTER("TABLE_SHARE::init_from_sql_statement_string"); + /* + Ouch. Parser may *change* the string it's working on. + Currently (2013-02-26) it is used to permanently disable + conditional comments. + Anyway, let's copy the caller's string... + */ if (!(sql_copy= thd->strmake(sql, sql_length))) DBUG_RETURN(HA_ERR_OUT_OF_MEM); From f21664414da8c4cf26daf5cad012dc0aca028602 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 27 Apr 2023 10:31:50 +0200 Subject: [PATCH 191/260] MDEV-31129 build failure with RocksDB, incompatible pointer to integer conversion FreeBSD 13.2 --- storage/rocksdb/ut0counter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/rocksdb/ut0counter.h b/storage/rocksdb/ut0counter.h index 3a7ee85d01c..99134ebd3f4 100644 --- a/storage/rocksdb/ut0counter.h +++ b/storage/rocksdb/ut0counter.h @@ -61,7 +61,7 @@ struct get_sched_indexer_t : public generic_indexer_t { size_t cpu = sched_getcpu(); if (cpu == (size_t) -1) { - cpu = get_curr_thread_id(); + cpu = (size_t) get_curr_thread_id(); } return(cpu); From 4a668c18926eca055a45b4153467bc6a5c50ff19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 27 Apr 2023 17:11:32 +0300 Subject: [PATCH 192/260] MDEV-29401 InnoDB history list length increased in 10.6 compared to 10.5 The InnoDB buffer pool and locking were heavily refactored in MariaDB Server 10.6. Among other things, dict_sys.mutex was removed, and the contended lock_sys.mutex was replaced with a combination of lock_sys.latch and distributed latches in hash tables. Also, a default value was changed to innodb_flush_method=O_DIRECT to improve performance in write-heavy workloads. One thing where an adjustment was missing is around the parameters innodb_max_purge_lag (number of committed transactions waiting to be purged), and innodb_max_purge_lag_delay (maximum number of microseconds to delay a DML operation). purge_coordinator_state::do_purge(): Pass the history_size to trx_purge() and reset srv_dml_needed_delay if the history is empty. Keep executing the loop non-stop as long as srv_dml_needed_delay is set. trx_purge_dml_delay(): Made part of trx_purge(). Set srv_dml_needed_delay=0 when nothing can be purged (!n_pages_handled). row_mysql_delay_if_needed(): Mimic the logic of innodb_max_purge_lag_wait_update(). Reviewed by: Thirunarayanan Balathandayuthapani --- storage/innobase/include/trx0purge.h | 7 +-- storage/innobase/row/row0mysql.cc | 26 ++++++----- storage/innobase/srv/srv0mon.cc | 6 ++- storage/innobase/srv/srv0srv.cc | 27 +++++++----- storage/innobase/trx/trx0purge.cc | 65 ++++++++++------------------ 5 files changed, 64 insertions(+), 67 deletions(-) diff --git a/storage/innobase/include/trx0purge.h b/storage/innobase/include/trx0purge.h index ac39d3ec45b..bf6f6eb8eff 100644 --- a/storage/innobase/include/trx0purge.h +++ b/storage/innobase/include/trx0purge.h @@ -41,10 +41,11 @@ void trx_purge_add_undo_to_history(const trx_t* trx, trx_undo_t*& undo, mtr_t* mtr); /** Run a purge batch. -@param n_tasks number of purge tasks to submit to the queue -@param truncate whether to truncate the history at the end of the batch +@param n_tasks number of purge tasks to submit to the queue +@param history_size trx_sys.history_size() +@param truncate whether to truncate the history at the end of the batch @return number of undo log pages handled in the batch */ -ulint trx_purge(ulint n_tasks, bool truncate); +ulint trx_purge(ulint n_tasks, ulint history_size, bool truncate); /** Rollback segements from a given transaction with trx-no scheduled for purge. */ diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index d27fc964219..98b76c34ff5 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -67,17 +67,23 @@ Created 9/17/2000 Heikki Tuuri #include -/*******************************************************************//** -Delays an INSERT, DELETE or UPDATE operation if the purge is lagging. */ -static -void -row_mysql_delay_if_needed(void) -/*===========================*/ +/** Delay an INSERT, DELETE or UPDATE operation if the purge is lagging. */ +static void row_mysql_delay_if_needed() { - if (srv_dml_needed_delay) { - std::this_thread::sleep_for( - std::chrono::microseconds(srv_dml_needed_delay)); - } + const auto delay= srv_dml_needed_delay; + if (UNIV_UNLIKELY(delay != 0)) + { + /* Adjust for purge_coordinator_state::refresh() */ + mysql_mutex_lock(&log_sys.mutex); + const lsn_t last= log_sys.last_checkpoint_lsn, + max_age= log_sys.max_checkpoint_age; + mysql_mutex_unlock(&log_sys.mutex); + const lsn_t lsn= log_sys.get_lsn(); + if ((lsn - last) / 4 >= max_age / 5) + buf_flush_ahead(last + max_age / 5, false); + srv_wake_purge_thread_if_not_active(); + std::this_thread::sleep_for(std::chrono::microseconds(delay)); + } } /*******************************************************************//** diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc index 2a3720641bc..971f4f330c8 100644 --- a/storage/innobase/srv/srv0mon.cc +++ b/storage/innobase/srv/srv0mon.cc @@ -752,7 +752,8 @@ static monitor_info_t innodb_counter_info[] = {"purge_dml_delay_usec", "purge", "Microseconds DML to be delayed due to purge lagging", - MONITOR_DISPLAY_CURRENT, + static_cast( + MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT), MONITOR_DEFAULT_START, MONITOR_DML_PURGE_DELAY}, {"purge_stop_count", "purge", @@ -1710,6 +1711,9 @@ srv_mon_process_existing_counter( case MONITOR_RSEG_CUR_SIZE: value = srv_mon_get_rseg_size(); break; + case MONITOR_DML_PURGE_DELAY: + value = srv_max_purge_lag_delay; + break; case MONITOR_NUM_UNDO_SLOT_USED: value = srv_mon_get_rseg_used(); break; diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 21faf792d84..f87c748bb67 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -1689,27 +1689,32 @@ fewer_threads: m_history_length= history_size; - if (history_size && - trx_purge(n_use_threads, - !(++count % srv_purge_rseg_truncate_frequency) || - purge_sys.truncate.current || - (srv_shutdown_state != SRV_SHUTDOWN_NONE && - srv_fast_shutdown == 0))) + if (!history_size) + srv_dml_needed_delay= 0; + else if (trx_purge(n_use_threads, history_size, + !(++count % srv_purge_rseg_truncate_frequency) || + purge_sys.truncate.current || + (srv_shutdown_state != SRV_SHUTDOWN_NONE && + srv_fast_shutdown == 0))) continue; - if (m_running == sigcount) + if (srv_dml_needed_delay); + else if (m_running == sigcount) { /* Purge was not woken up by srv_wake_purge_thread_if_not_active() */ /* The magic number 5000 is an approximation for the case where we have cached undo log records which prevent truncate of rollback segments. */ - wakeup= history_size && - (history_size >= 5000 || - history_size != trx_sys.history_size_approx()); + wakeup= history_size >= 5000 || + (history_size && history_size != trx_sys.history_size_approx()); break; } - else if (!trx_sys.history_exists()) + + if (!trx_sys.history_exists()) + { + srv_dml_needed_delay= 0; break; + } if (!srv_purge_should_exit()) goto loop; diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index 7a63b1155b6..b04e71ba871 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -1243,43 +1243,6 @@ trx_purge_attach_undo_recs(ulint n_purge_threads) return(n_pages_handled); } -/*******************************************************************//** -Calculate the DML delay required. -@return delay in microseconds or ULINT_MAX */ -static -ulint -trx_purge_dml_delay(void) -/*=====================*/ -{ - /* Determine how much data manipulation language (DML) statements - need to be delayed in order to reduce the lagging of the purge - thread. */ - ulint delay = 0; /* in microseconds; default: no delay */ - - /* If purge lag is set then calculate the new DML delay. */ - - if (srv_max_purge_lag > 0) { - double ratio = static_cast(trx_sys.history_size()) / - static_cast(srv_max_purge_lag); - - if (ratio > 1.0) { - /* If the history list length exceeds the - srv_max_purge_lag, the data manipulation - statements are delayed by at least 5000 - microseconds. */ - delay = (ulint) ((ratio - .5) * 10000); - } - - if (delay > srv_max_purge_lag_delay) { - delay = srv_max_purge_lag_delay; - } - - MONITOR_SET(MONITOR_DML_PURGE_DELAY, delay); - } - - return(delay); -} - extern tpool::waitable_task purge_worker_task; /** Wait for pending purge jobs to complete. */ @@ -1323,18 +1286,18 @@ TRANSACTIONAL_INLINE void purge_sys_t::clone_end_view() /** Run a purge batch. -@param n_tasks number of purge tasks to submit to the queue -@param truncate whether to truncate the history at the end of the batch +@param n_tasks number of purge tasks to submit to the queue +@param history_size trx_sys.history_size() +@param truncate whether to truncate the history at the end of the batch @return number of undo log pages handled in the batch */ -TRANSACTIONAL_TARGET ulint trx_purge(ulint n_tasks, bool truncate) +TRANSACTIONAL_TARGET +ulint trx_purge(ulint n_tasks, ulint history_size, bool truncate) { que_thr_t* thr = NULL; ulint n_pages_handled; ut_ad(n_tasks > 0); - srv_dml_needed_delay = trx_purge_dml_delay(); - purge_sys.clone_oldest_view(); #ifdef UNIV_DEBUG @@ -1346,6 +1309,24 @@ TRANSACTIONAL_TARGET ulint trx_purge(ulint n_tasks, bool truncate) /* Fetch the UNDO recs that need to be purged. */ n_pages_handled = trx_purge_attach_undo_recs(n_tasks); + { + ulint delay = n_pages_handled ? srv_max_purge_lag : 0; + if (UNIV_UNLIKELY(delay)) { + if (delay >= history_size) { + no_throttle: + delay = 0; + } else if (const ulint max_delay = + srv_max_purge_lag_delay) { + delay = std::min(max_delay, + 10000 * history_size / delay + - 5000); + } else { + goto no_throttle; + } + } + srv_dml_needed_delay = delay; + } + /* Submit tasks to workers queue if using multi-threaded purge. */ for (ulint i = n_tasks; --i; ) { thr = que_fork_scheduler_round_robin(purge_sys.query, thr); From 06b443be34e3dc257613b17891bea0c5e7495919 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Wed, 26 Apr 2023 15:26:38 +0200 Subject: [PATCH 193/260] Nes CC 3.3 --- libmariadb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmariadb b/libmariadb index 12bd1d5511f..374f0eedc23 160000 --- a/libmariadb +++ b/libmariadb @@ -1 +1 @@ -Subproject commit 12bd1d5511fc2ff766ff6256c71b79a95739533f +Subproject commit 374f0eedc23ac3f91329046d28714794cfd14e07 From 55a53949beac6e212b1232d3628d96b9b8121a49 Mon Sep 17 00:00:00 2001 From: Andrei Date: Sat, 18 Mar 2023 21:11:07 +0200 Subject: [PATCH 194/260] MDEV-29621: Replica stopped by locks on sequence When using binlog_row_image=FULL with sequence table inserts, a replica can deadlock because it treats full inserts in a sequence as DDL statements by getting an exclusive lock on the sequence table. It has been observed that with parallel replication, this exclusive lock on the sequence table can lead to a deadlock where one transaction has the exclusive lock and is waiting on a prior transaction to commit, whereas this prior transaction is waiting on the MDL lock. This fix for this is on the master side, to raise FL_DDL flag on the GTID of a full binlog_row_image write of a sequence table. This forces the slave to execute the statement serially so a deadlock cannot happen. A test verifies the deadlock also to prove it happen on the OLD (pre-fixes) slave. OLD (buggy master) -replication-> NEW (fixed slave) is provided. As the pre-fixes master's full row-image may represent both SELECT NEXT VALUE and INSERT, the parallel slave pessimistically waits for the prior transaction to have committed before to take on the critical part of the second (like INSERT in the test) event execution. The waiting exploits a parallel slave's retry mechanism which is controlled by `@@global.slave_transaction_retries`. Note that in order to avoid any persistent 'Deadlock found' 2013 error in OLD -> NEW, `slave_transaction_retries` may need to be set to a higher than the default value. START-SLAVE is an effective work-around if this still happens. --- .../rpl/master-bin-seq_10.3.36.000001 | Bin 0 -> 1245 bytes .../suite/rpl/r/rpl_parallel_seq.result | 46 ++++++++++ mysql-test/suite/rpl/t/rpl_parallel_seq.test | 81 ++++++++++++++++++ sql/ha_sequence.cc | 3 +- sql/log_event.cc | 27 +++++- sql/rpl_parallel.cc | 7 +- sql/slave.cc | 36 ++++++-- sql/slave.h | 3 +- 8 files changed, 190 insertions(+), 13 deletions(-) create mode 100644 mysql-test/std_data/rpl/master-bin-seq_10.3.36.000001 create mode 100644 mysql-test/suite/rpl/r/rpl_parallel_seq.result create mode 100644 mysql-test/suite/rpl/t/rpl_parallel_seq.test diff --git a/mysql-test/std_data/rpl/master-bin-seq_10.3.36.000001 b/mysql-test/std_data/rpl/master-bin-seq_10.3.36.000001 new file mode 100644 index 0000000000000000000000000000000000000000..0fa163d04844b974a7248944cb701cfa45135a3b GIT binary patch literal 1245 zcmcgrO=uHQ5S~pIeMG9YIamt9s~)r=n`DiMr$9}fxYGQXY*h4M6LuR4F@@bIh~N*1 z9zBQ#4`OTe8kfC_phl}%+2XvKyz-zXf?EW3HGrL`AYgc&N7CVp@P7>t36G6wJo)Cq=Q z##jWmSS&U)@;^G&xC$fK4z{A?TQ7Rl^fG<>PEs;_IrHdwg$|d;dZpnHr%f5 zXvkbDL!wXSCa-)!>;r-%P+c?_F&WB~XMI2V_$eVHbXG@wBSBkzoC+}Ends&wnVX_+ z*HRg#W6-tTF666X+7!Gdj@3meFSx7U*>dwnSe{z_fzb>sFOytjoBfx2E2mx&c9H6) zQFqhDKuyeuyva-Aq{)v@&(sA!T&`m3hds?8c%0z-QBO!XM@x>0>?q>ubi*VH-u6pl zRkE>zVoswz8Hi!)@GVN=a@6F$wl3u|1&{>$S0CqjalP2PbvLBXKt~@_GuRM)PlniR=%=Ad!+-Oc4+k{9eKP-{*lJjx3G7rPOi` ziO2$u-oFr;^E(MLq88@jtfwOsi#__MA)%hL(o avOBiZ=-L))CJiEVruw literal 0 HcmV?d00001 diff --git a/mysql-test/suite/rpl/r/rpl_parallel_seq.result b/mysql-test/suite/rpl/r/rpl_parallel_seq.result new file mode 100644 index 00000000000..d3512d6cc53 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_parallel_seq.result @@ -0,0 +1,46 @@ +include/master-slave.inc +[connection master] +connection slave; +include/stop_slave.inc +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +# MDEV-29621 the sequence engine binlog_row_image-full events +# MDL-deadlock on the parallel slave. +connection master; +CREATE SEQUENCE s1; +SET @@session.binlog_row_image=FULL; +SET @@session.debug_dbug="+d,binlog_force_commit_id"; +SET @commit_id=7; +SET @@gtid_seq_no=100; +SELECT NEXT VALUE FOR s1; +NEXT VALUE FOR s1 +1 +INSERT INTO s1 VALUES(2, 1, 10, 1, 2, 1, 1, 0); +SET @@session.debug_dbug=""; +connection slave; +SET @@global.slave_parallel_threads=2; +SET @@global.slave_parallel_mode=optimistic; +SET @@global.debug_dbug="+d,hold_worker_on_schedule"; +include/start_slave.inc +SET DEBUG_SYNC = 'now SIGNAL continue_worker'; +connection master; +DROP SEQUENCE s1; +connection slave; +include/stop_slave.inc +# Simulate buggy 10.3.36 master to prove the parallel applier +# does not deadlock now at replaying the above master load. +connection master; +include/rpl_stop_server.inc [server_number=1] +include/rpl_start_server.inc [server_number=1] +connection slave; +RESET MASTER; +SET @@global.gtid_slave_pos=""; +CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1, master_user='root', master_use_gtid=slave_pos; +START SLAVE UNTIL MASTER_GTID_POS='0-1-102'; +SET DEBUG_SYNC = 'now SIGNAL continue_worker'; +include/wait_for_slave_to_stop.inc +SET debug_sync = RESET; +SET @@global.slave_parallel_threads= 0; +SET @@global.slave_parallel_mode= conservative; +SET @@global.debug_dbug = ""; +include/start_slave.inc +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_parallel_seq.test b/mysql-test/suite/rpl/t/rpl_parallel_seq.test new file mode 100644 index 00000000000..e92c0f61746 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_parallel_seq.test @@ -0,0 +1,81 @@ +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc +--source include/have_binlog_format_row.inc +--source include/master-slave.inc + +--connection slave +--source include/stop_slave.inc +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; + +--echo # MDEV-29621 the sequence engine binlog_row_image-full events +--echo # MDL-deadlock on the parallel slave. +--connection master +CREATE SEQUENCE s1; +SET @@session.binlog_row_image=FULL; +SET @@session.debug_dbug="+d,binlog_force_commit_id"; +SET @commit_id=7; +SET @@gtid_seq_no=100; +SELECT NEXT VALUE FOR s1; +INSERT INTO s1 VALUES(2, 1, 10, 1, 2, 1, 1, 0); +SET @@session.debug_dbug=""; + +--connection slave +--let $slave_parallel_threads=`select @@global.slave_parallel_threads` +--let $slave_parallel_mode=`select @@global.slave_parallel_mode` +SET @@global.slave_parallel_threads=2; +SET @@global.slave_parallel_mode=optimistic; +SET @@global.debug_dbug="+d,hold_worker_on_schedule"; +--source include/start_slave.inc + +--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to start commit before starting%" +--source include/wait_condition.inc +SET DEBUG_SYNC = 'now SIGNAL continue_worker'; + +--connection master +DROP SEQUENCE s1; +--sync_slave_with_master +--source include/stop_slave.inc + +--echo # Simulate buggy 10.3.36 master to prove the parallel applier +--echo # does not deadlock now at replaying the above master load. +--connection master +--let $datadir= `SELECT @@datadir` + +--let $rpl_server_number= 1 +--source include/rpl_stop_server.inc + +--remove_file $datadir/master-bin.000001 +--copy_file $MYSQL_TEST_DIR/std_data/rpl/master-bin-seq_10.3.36.000001 $datadir/master-bin.000001 + +--let $rpl_server_number= 1 +--source include/rpl_start_server.inc + +--source include/wait_until_connected_again.inc +--save_master_pos + +--connection slave +RESET MASTER; +SET @@global.gtid_slave_pos=""; + +--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1 +eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1, master_user='root', master_use_gtid=slave_pos; + +START SLAVE UNTIL MASTER_GTID_POS='0-1-102'; + +--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit" +--source include/wait_condition.inc +SET DEBUG_SYNC = 'now SIGNAL continue_worker'; + +# +# MDEV-29621 clean up. +# +--source include/wait_for_slave_to_stop.inc +SET debug_sync = RESET; +--eval SET @@global.slave_parallel_threads= $slave_parallel_threads +--eval SET @@global.slave_parallel_mode= $slave_parallel_mode + SET @@global.debug_dbug = ""; +--source include/start_slave.inc + + +--source include/rpl_end.inc diff --git a/sql/ha_sequence.cc b/sql/ha_sequence.cc index a0959f692cf..35e765188cb 100644 --- a/sql/ha_sequence.cc +++ b/sql/ha_sequence.cc @@ -235,8 +235,9 @@ int ha_sequence::write_row(uchar *buf) on master and slaves - Check that the new row is an accurate SEQUENCE object */ - THD *thd= table->in_use; + /* mark a full binlog image insert to force non-parallel slave */ + thd->transaction.stmt.mark_trans_did_ddl(); if (table->s->tmp_table == NO_TMP_TABLE && thd->mdl_context.upgrade_shared_lock(table->mdl_ticket, MDL_EXCLUSIVE, diff --git a/sql/log_event.cc b/sql/log_event.cc index b2b1adc1558..9eb10ce1a58 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -13713,8 +13713,14 @@ Rows_log_event::write_row(rpl_group_info *rgi, int Rows_log_event::update_sequence() { TABLE *table= m_table; // pointer to event's table + bool old_master= false; + int err= 0; - if (!bitmap_is_set(table->rpl_write_set, MIN_VALUE_FIELD_NO)) + if (!bitmap_is_set(table->rpl_write_set, MIN_VALUE_FIELD_NO) || + (!(table->in_use->rgi_slave->gtid_ev_flags2 & Gtid_log_event::FL_DDL) && + !(old_master= + rpl_master_has_bug(thd->rgi_slave->rli, + 29621, FALSE, FALSE, FALSE, TRUE)))) { /* This event come from a setval function executed on the master. Update the sequence next_number and round, like we do with setval() @@ -13727,12 +13733,27 @@ int Rows_log_event::update_sequence() return table->s->sequence->set_value(table, nextval, round, 0) > 0; } - + if (thd->rgi_slave->is_parallel_exec && old_master) + { + DBUG_ASSERT(thd->rgi_slave->parallel_entry); + /* + With parallel replication enabled, we can't execute alongside any other + transaction in which we may depend, so we force retry to release + the server layer table lock for possible prior in binlog order + same table transactions. + */ + if (thd->rgi_slave->parallel_entry->last_committed_sub_id < + thd->rgi_slave->wait_commit_sub_id) + { + err= ER_LOCK_DEADLOCK; + my_error(err, MYF(0)); + } + } /* Update all fields in table and update the active sequence, like with ALTER SEQUENCE */ - return table->file->ha_write_row(table->record[0]); + return err == 0 ? table->file->ha_write_row(table->record[0]) : err; } diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index dbe77c54230..7ec87e4aa62 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -2780,7 +2780,12 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev, if (mode <= SLAVE_PARALLEL_MINIMAL || !(gtid_flags & Gtid_log_event::FL_GROUP_COMMIT_ID) || - e->last_commit_id != gtid_ev->commit_id) + e->last_commit_id != gtid_ev->commit_id || + /* + MULTI_BATCH is also set when the current gtid even being a member + of a commit group is flagged as DDL which disallows parallel. + */ + (gtid_flags & Gtid_log_event::FL_DDL)) flags|= group_commit_orderer::MULTI_BATCH; /* Make sure we do not attempt to run DDL in parallel speculatively. */ if (gtid_flags & Gtid_log_event::FL_DDL) diff --git a/sql/slave.cc b/sql/slave.cc index b64b9a64979..3f06c40e7c2 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -8028,14 +8028,15 @@ end: @return TRUE if master has the bug, FALSE if it does not. */ bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report, - bool (*pred)(const void *), const void *param) + bool (*pred)(const void *), const void *param, + bool maria_master) { struct st_version_range_for_one_bug { uint bug_id; const uchar introduced_in[3]; // first version with bug const uchar fixed_in[3]; // first version with fix }; - static struct st_version_range_for_one_bug versions_for_all_bugs[]= + static struct st_version_range_for_one_bug versions_for_their_bugs[]= { {24432, { 5, 0, 24 }, { 5, 0, 38 } }, {24432, { 5, 1, 12 }, { 5, 1, 17 } }, @@ -8043,13 +8044,30 @@ bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report, {33029, { 5, 1, 0 }, { 5, 1, 12 } }, {37426, { 5, 1, 0 }, { 5, 1, 26 } }, }; + static struct st_version_range_for_one_bug versions_for_our_bugs[]= + { + {29621, { 10, 3, 36 }, { 10, 3, 39 } }, + {29621, { 10, 4, 26 }, { 10, 4, 29 } }, + {29621, { 10, 5, 17 }, { 10, 5, 20 } }, + {29621, { 10, 6, 9 }, { 10, 6, 13 } }, + {29621, { 10, 7, 5 }, { 10, 7, 9 } }, + {29621, { 10, 8, 4 }, { 10, 8, 8 } }, + {29621, { 10, 9, 2 }, { 10, 9, 6 } }, + {29621, { 10, 10,1 }, { 10, 10,4 } }, + {29621, { 10, 11,1 }, { 10, 11,3 } }, + }; const uchar *master_ver= rli->relay_log.description_event_for_exec->server_version_split.ver; DBUG_ASSERT(sizeof(rli->relay_log.description_event_for_exec->server_version_split.ver) == 3); - for (uint i= 0; - i < sizeof(versions_for_all_bugs)/sizeof(*versions_for_all_bugs);i++) + struct st_version_range_for_one_bug* versions_for_all_bugs= maria_master ? + versions_for_our_bugs : versions_for_their_bugs; + uint all_size= maria_master ? + sizeof(versions_for_our_bugs)/sizeof(*versions_for_our_bugs) : + sizeof(versions_for_their_bugs)/sizeof(*versions_for_their_bugs); + + for (uint i= 0; i < all_size; i++) { const uchar *introduced_in= versions_for_all_bugs[i].introduced_in, *fixed_in= versions_for_all_bugs[i].fixed_in; @@ -8058,18 +8076,21 @@ bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report, (memcmp(fixed_in, master_ver, 3) > 0) && (pred == NULL || (*pred)(param))) { + const char *bug_source= maria_master ? + "https://jira.mariadb.org/browse/MDEV-" : + "http://bugs.mysql.com/bug.php?id="; if (!report) return TRUE; // a short message for SHOW SLAVE STATUS (message length constraints) my_printf_error(ER_UNKNOWN_ERROR, "master may suffer from" - " http://bugs.mysql.com/bug.php?id=%u" + " %s%u" " so slave stops; check error log on slave" - " for more info", MYF(0), bug_id); + " for more info", MYF(0), bug_source, bug_id); // a verbose message for the error log rli->report(ERROR_LEVEL, ER_UNKNOWN_ERROR, NULL, "According to the master's version ('%s')," " it is probable that master suffers from this bug:" - " http://bugs.mysql.com/bug.php?id=%u" + " %s%u" " and thus replicating the current binary log event" " may make the slave's data become different from the" " master's data." @@ -8083,6 +8104,7 @@ bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report, " equal to '%d.%d.%d'. Then replication can be" " restarted.", rli->relay_log.description_event_for_exec->server_version, + bug_source, bug_id, fixed_in[0], fixed_in[1], fixed_in[2]); return TRUE; diff --git a/sql/slave.h b/sql/slave.h index 8d3b4f6d2aa..aeea317a5ab 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -231,7 +231,8 @@ bool show_all_master_info(THD* thd); void show_binlog_info_get_fields(THD *thd, List *field_list); bool show_binlog_info(THD* thd); bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report, - bool (*pred)(const void *), const void *param); + bool (*pred)(const void *), const void *param, + bool maria_master= false); bool rpl_master_erroneous_autoinc(THD* thd); const char *print_slave_db_safe(const char *db); From 2eb7bf1ec301d43a7e72b8720f6ee153dc52b6c9 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Fri, 21 Apr 2023 10:55:14 +0200 Subject: [PATCH 195/260] MDEV-31073 Server crash, assertion `table != 0 && view->field_translation != 0' failure with ROWNUM and view Now the same rule applied to vews and derived tables. So we should allow merge of views (and derived) in queries with rownum, because it do not change results, only makes query plans better. --- mysql-test/main/rownum.result | 33 +++++++++++++++++++++++++++ mysql-test/main/rownum.test | 42 +++++++++++++++++++++++++++++++++++ sql/sql_lex.cc | 6 +++++ sql/sql_lex.h | 1 + sql/sql_select.cc | 4 ++-- sql/table.cc | 12 +++++++++- 6 files changed, 95 insertions(+), 3 deletions(-) diff --git a/mysql-test/main/rownum.result b/mysql-test/main/rownum.result index 3ad51c93260..b61269b1b47 100644 --- a/mysql-test/main/rownum.result +++ b/mysql-test/main/rownum.result @@ -139,6 +139,13 @@ select * from t1,t2 where t1.a=t2.a and rownum()<=2 order by t1.a,t2.a; a b a b 2 20 2 21 3 30 3 31 +create view v1 as +select * from (select * from t1 order by a desc) as t where rownum() <= 2; +select * from v1; +a b +3 30 +2 20 +drop view v1; # # Having # @@ -984,3 +991,29 @@ next row is 3 3 next row is 5 5 +# +# MDEV-31073: Server crash, assertion `table != 0 && +# view->field_translation != 0' failure with ROWNUM and view +# +CREATE TABLE t (f INT); +INSERT INTO t VALUES (1),(2); +CREATE VIEW v AS SELECT * FROM t; +UPDATE v SET f = 10 WHERE ROWNUM() > 42 LIMIT 1; +DROP VIEW v; +DROP TABLE t; +CREATE TABLE t (f INT); +INSERT INTO t VALUES (1),(2); +CREATE VIEW v AS SELECT f, 3 as e FROM t; +UPDATE v SET f = 10 WHERE e > 42 LIMIT 1; +DROP VIEW v; +DROP TABLE t; +CREATE TABLE t (f INT); +INSERT INTO t VALUES (1),(2); +CREATE VIEW v AS SELECT f, ROWNUM() as e FROM t; +UPDATE v SET f = 10 WHERE e > 42 LIMIT 1; +ERROR HY000: The target table v of the UPDATE is not updatable +DROP VIEW v; +DROP TABLE t; +# +# End of 10.6 tests +# diff --git a/mysql-test/main/rownum.test b/mysql-test/main/rownum.test index bdd0bfa4f41..291bd9bd993 100644 --- a/mysql-test/main/rownum.test +++ b/mysql-test/main/rownum.test @@ -58,6 +58,11 @@ select *,rownum() from t1,t2 order by t2.a desc, t1.a desc; select * from (select * from t1 order by a desc) as t where rownum() <= 2; select * from t1,t2 where t1.a=t2.a and rownum()<=2 order by t1.a,t2.a; +create view v1 as +select * from (select * from t1 order by a desc) as t where rownum() <= 2; +select * from v1; +drop view v1; + --echo # --echo # Having --echo # @@ -568,3 +573,40 @@ drop table t1; --echo # Table value constructors --echo # values ("first row"),("next row is 3"),(rownum()),("next row is 5"),(rownum()); + +--echo # +--echo # MDEV-31073: Server crash, assertion `table != 0 && +--echo # view->field_translation != 0' failure with ROWNUM and view +--echo # + +CREATE TABLE t (f INT); +INSERT INTO t VALUES (1),(2); +CREATE VIEW v AS SELECT * FROM t; +UPDATE v SET f = 10 WHERE ROWNUM() > 42 LIMIT 1; + +# Cleanup +DROP VIEW v; +DROP TABLE t; + +CREATE TABLE t (f INT); +INSERT INTO t VALUES (1),(2); +CREATE VIEW v AS SELECT f, 3 as e FROM t; +UPDATE v SET f = 10 WHERE e > 42 LIMIT 1; + +# Cleanup +DROP VIEW v; +DROP TABLE t; + +CREATE TABLE t (f INT); +INSERT INTO t VALUES (1),(2); +CREATE VIEW v AS SELECT f, ROWNUM() as e FROM t; +--error ER_NON_UPDATABLE_TABLE +UPDATE v SET f = 10 WHERE e > 42 LIMIT 1; + +# Cleanup +DROP VIEW v; +DROP TABLE t; + +--echo # +--echo # End of 10.6 tests +--echo # diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 61df2f153db..743488ab808 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -11847,3 +11847,9 @@ bool SELECT_LEX_UNIT::explainable() const derived->is_materialized_derived() : // (3) false; } + + +bool st_select_lex::is_query_topmost(THD *thd) +{ + return get_master() == &thd->lex->unit; +} diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 778c6105d6b..2076fdf21f4 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1384,6 +1384,7 @@ public: return (st_select_lex_unit*) slave; } st_select_lex* outer_select(); + bool is_query_topmost(THD *thd); st_select_lex* next_select() { return (st_select_lex*) next; } st_select_lex* next_select_in_list() { diff --git a/sql/sql_select.cc b/sql/sql_select.cc index eda833b89b0..65e36ac68db 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -28739,7 +28739,7 @@ void st_select_lex::print_item_list(THD *thd, String *str, outer_select() can not be used here because it is for name resolution and will return NULL at any end of name resolution chain (view/derived) */ - bool top_level= (get_master() == &thd->lex->unit); + bool top_level= is_query_topmost(thd); List_iterator_fast it(item_list); Item *item; while ((item= it++)) @@ -28846,7 +28846,7 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type) return; } - bool top_level= (get_master() == &thd->lex->unit); + bool top_level= is_query_topmost(thd); enum explainable_cmd_type sel_type= SELECT_CMD; if (top_level) sel_type= get_explainable_cmd_type(thd); diff --git a/sql/table.cc b/sql/table.cc index 26b13debc95..f5144357a1d 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -9536,7 +9536,17 @@ bool TABLE_LIST::init_derived(THD *thd, bool init_view) { /* A subquery might be forced to be materialized due to a side-effect. */ if (!is_materialized_derived() && unit->can_be_merged() && - (unit->outer_select() && !unit->outer_select()->with_rownum) && + /* + Following is special case of + SELECT * FROM () WHERE ROWNUM() <= nnn + */ + (unit->outer_select() && + !(unit->outer_select()->with_rownum && + unit->outer_select()->table_list.elements == 1 && + (thd->lex->sql_command == SQLCOM_SELECT || + !unit->outer_select()->is_query_topmost(thd)) && + !is_view())) && + (!thd->lex->with_rownum || (!first_select->group_list.elements && !first_select->order_list.elements)) && From f2f54868b03a380207f92c01038698eb28464e1f Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Fri, 24 Mar 2023 10:38:20 +1100 Subject: [PATCH 196/260] MDEV-30920 Remove need_lock and table from spider_close_sys_table() --- storage/spider/ha_spider.cc | 65 ++++------------ storage/spider/spd_copy_tables.cc | 8 +- storage/spider/spd_ping_table.cc | 48 +++++------- storage/spider/spd_sys_table.cc | 125 ++++++++++++------------------ storage/spider/spd_sys_table.h | 35 +++------ storage/spider/spd_table.cc | 76 +++++++----------- storage/spider/spd_trx.cc | 96 +++++++++++------------ 7 files changed, 173 insertions(+), 280 deletions(-) diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc index 5cf67a091db..d17bb83de39 100644 --- a/storage/spider/ha_spider.cc +++ b/storage/spider/ha_spider.cc @@ -8597,7 +8597,6 @@ int ha_spider::create( SPIDER_TRX *trx; TABLE *table_tables = NULL; SPIDER_Open_tables_backup open_tables_backup; - bool need_lock = FALSE; DBUG_ENTER("ha_spider::create"); DBUG_PRINT("info",("spider this=%p", this)); DBUG_PRINT("info",("spider name=%s", name)); @@ -8675,7 +8674,7 @@ int ha_spider::create( if ( !(table_tables = spider_open_sys_table( current_thd, SPIDER_SYS_TABLES_TABLE_NAME_STR, - SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, FALSE, + SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, &error_num)) ) { goto error; @@ -8692,8 +8691,7 @@ int ha_spider::create( ) { goto error; } - spider_close_sys_table(current_thd, table_tables, - &open_tables_backup, FALSE); + spider_sys_close_table(current_thd, &open_tables_backup); table_tables = NULL; } else if ( sql_command == SQLCOM_ALTER_TABLE @@ -8726,11 +8724,10 @@ int ha_spider::create( ) && memcmp(name + strlen(name) - 5, "#TMP#", 5) ) { - need_lock = TRUE; if ( !(table_tables = spider_open_sys_table( current_thd, SPIDER_SYS_TABLES_TABLE_NAME_STR, - SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, TRUE, + SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, &error_num)) ) { goto error; @@ -8740,8 +8737,7 @@ int ha_spider::create( ) { goto error; } - spider_close_sys_table(current_thd, table_tables, - &open_tables_backup, TRUE); + spider_sys_close_table(current_thd, &open_tables_backup); table_tables = NULL; } } @@ -8770,8 +8766,7 @@ int ha_spider::create( error: if (table_tables) - spider_close_sys_table(current_thd, table_tables, - &open_tables_backup, need_lock); + spider_sys_close_table(current_thd, &open_tables_backup); if (tmp_share.lgtm_tblhnd_share) spider_free_lgtm_tblhnd_share_alloc(tmp_share.lgtm_tblhnd_share, FALSE); if (tmp_share.static_key_cardinality) @@ -8843,7 +8838,6 @@ int ha_spider::rename_table( SPIDER_ALTER_TABLE *alter_table_from, *alter_table_to; SPIDER_LGTM_TBLHND_SHARE *from_lgtm_tblhnd_share, *to_lgtm_tblhnd_share; SPIDER_Open_tables_backup open_tables_backup; - bool need_lock = FALSE; DBUG_ENTER("ha_spider::rename_table"); DBUG_PRINT("info",("spider this=%p", this)); DBUG_PRINT("info",("spider from=%s", from)); @@ -8875,7 +8869,7 @@ int ha_spider::rename_table( if ( !(table_tables = spider_open_sys_table( current_thd, SPIDER_SYS_TABLES_TABLE_NAME_STR, - SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, FALSE, + SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, &error_num)) ) { goto error; @@ -8886,8 +8880,7 @@ int ha_spider::rename_table( ) { goto error; } - spider_close_sys_table(current_thd, table_tables, - &open_tables_backup, FALSE); + spider_sys_close_table(current_thd, &open_tables_backup); table_tables = NULL; /* release table mon list */ @@ -8929,21 +8922,10 @@ int ha_spider::rename_table( DBUG_PRINT("info", ("spider alter_info.flags: %llu alter_info.partition_flags: %lu", thd->lex->alter_info.flags, thd->lex->alter_info.partition_flags)); - if ( - (thd->lex->alter_info.partition_flags & - ( - SPIDER_ALTER_PARTITION_ADD | SPIDER_ALTER_PARTITION_DROP | - SPIDER_ALTER_PARTITION_COALESCE | SPIDER_ALTER_PARTITION_REORGANIZE | - SPIDER_ALTER_PARTITION_TABLE_REORG | SPIDER_ALTER_PARTITION_REBUILD - ) - ) - ) - need_lock = TRUE; - if ( !(table_tables = spider_open_sys_table( current_thd, SPIDER_SYS_TABLES_TABLE_NAME_STR, - SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, need_lock, + SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, &error_num)) ) { goto error; @@ -8972,8 +8954,7 @@ int ha_spider::rename_table( goto error; } } - spider_close_sys_table(current_thd, table_tables, - &open_tables_backup, need_lock); + spider_sys_close_table(current_thd, &open_tables_backup); table_tables = NULL; if (!alter_table_from->now_create) @@ -9031,8 +9012,7 @@ int ha_spider::rename_table( error: if (table_tables) - spider_close_sys_table(current_thd, table_tables, - &open_tables_backup, need_lock); + spider_sys_close_table(current_thd, &open_tables_backup); pthread_mutex_lock(&spider_lgtm_tblhnd_share_mutex); to_lgtm_tblhnd_share = spider_get_lgtm_tblhnd_share( to, to_len, to_hash_value, TRUE, FALSE, &tmp_error_num); @@ -9052,7 +9032,6 @@ int ha_spider::delete_table( uint sql_command = thd_sql_command(thd); SPIDER_ALTER_TABLE *alter_table; SPIDER_Open_tables_backup open_tables_backup; - bool need_lock = FALSE; DBUG_ENTER("ha_spider::delete_table"); DBUG_PRINT("info",("spider this=%p", this)); DBUG_PRINT("info",("spider name=%s", name)); @@ -9098,28 +9077,16 @@ int ha_spider::delete_table( DBUG_PRINT("info", ("spider alter_info.flags: %llu alter_info.partition_flags: %lu", thd->lex->alter_info.flags, thd->lex->alter_info.partition_flags)); - if ( - sql_command == SQLCOM_ALTER_TABLE && - (thd->lex->alter_info.partition_flags & - ( - SPIDER_ALTER_PARTITION_ADD | SPIDER_ALTER_PARTITION_DROP | - SPIDER_ALTER_PARTITION_COALESCE | SPIDER_ALTER_PARTITION_REORGANIZE | - SPIDER_ALTER_PARTITION_TABLE_REORG | SPIDER_ALTER_PARTITION_REBUILD - ) - ) - ) - need_lock = TRUE; - if ((error_num = spider_sys_delete_table_sts( - current_thd, name, name_len, need_lock))) + current_thd, name, name_len))) goto error; if ((error_num = spider_sys_delete_table_crd( - current_thd, name, name_len, need_lock))) + current_thd, name, name_len))) goto error; if ( !(table_tables = spider_open_sys_table( current_thd, SPIDER_SYS_TABLES_TABLE_NAME_STR, - SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, need_lock, + SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, &error_num)) ) { goto error; @@ -9130,8 +9097,7 @@ int ha_spider::delete_table( ) { goto error; } - spider_close_sys_table(current_thd, table_tables, - &open_tables_backup, need_lock); + spider_sys_close_table(current_thd, &open_tables_backup); table_tables = NULL; /* release table mon list */ @@ -9155,8 +9121,7 @@ int ha_spider::delete_table( error: if (table_tables) - spider_close_sys_table(current_thd, table_tables, - &open_tables_backup, need_lock); + spider_sys_close_table(current_thd, &open_tables_backup); DBUG_RETURN(error_num); } diff --git a/storage/spider/spd_copy_tables.cc b/storage/spider/spd_copy_tables.cc index 5e28b590309..0d6f05dfdbd 100644 --- a/storage/spider/spd_copy_tables.cc +++ b/storage/spider/spd_copy_tables.cc @@ -355,7 +355,7 @@ int spider_udf_get_copy_tgt_tables( !(table_tables = spider_open_sys_table( thd, SPIDER_SYS_TABLES_TABLE_NAME_STR, SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, &open_tables_backup, - need_lock, &error_num)) + &error_num)) ) { my_error(error_num, MYF(0)); goto error; @@ -543,8 +543,7 @@ int spider_udf_get_copy_tgt_tables( error_num = spider_sys_index_next_same(table_tables, table_key); } while (error_num == 0); spider_sys_index_end(table_tables); - spider_close_sys_table(thd, table_tables, - &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); table_tables = NULL; if (!copy_tables->table_conn[0]) @@ -566,8 +565,7 @@ int spider_udf_get_copy_tgt_tables( error: if (table_tables) - spider_close_sys_table(thd, table_tables, - &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); if (table_conn) { spider_free_tmp_dbton_share(tmp_share); diff --git a/storage/spider/spd_ping_table.cc b/storage/spider/spd_ping_table.cc index e82a5925265..3de30e6a80b 100644 --- a/storage/spider/spd_ping_table.cc +++ b/storage/spider/spd_ping_table.cc @@ -267,7 +267,7 @@ int spider_get_ping_table_mon( !(table_link_mon = spider_open_sys_table( thd, SPIDER_SYS_LINK_MON_TABLE_NAME_STR, SPIDER_SYS_LINK_MON_TABLE_NAME_LEN, FALSE, &open_tables_backup, - need_lock, &error_num)) + &error_num)) ) { my_error(error_num, MYF(0)); goto error; @@ -386,8 +386,7 @@ create_table_mon: error_num = spider_sys_index_next_same(table_link_mon, table_key); } while (error_num == 0); spider_sys_index_end(table_link_mon); - spider_close_sys_table(thd, table_link_mon, - &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); table_link_mon = NULL; table_mon_list->list_size = list_size; @@ -403,8 +402,7 @@ create_table_mon: error: if (table_link_mon) - spider_close_sys_table(thd, table_link_mon, - &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); table_mon = table_mon_list->first; table_mon_list->first = NULL; table_mon_list->current = NULL; @@ -474,7 +472,7 @@ SPIDER_TABLE_MON_LIST *spider_get_ping_table_tgt( if ( !(table_tables = spider_open_sys_table( thd, SPIDER_SYS_TABLES_TABLE_NAME_STR, - SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, &open_tables_backup, need_lock, + SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, &open_tables_backup, error_num)) ) { my_error(*error_num, MYF(0)); @@ -512,8 +510,7 @@ SPIDER_TABLE_MON_LIST *spider_get_ping_table_tgt( table_tables->file->print_error(*error_num, MYF(0)); goto error; } - spider_close_sys_table(thd, table_tables, - &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); table_tables = NULL; if ( @@ -576,8 +573,7 @@ error_receptor_mutex_init: error_caller_mutex_init: error: if (table_tables) - spider_close_sys_table(thd, table_tables, - &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); free_root(&mem_root, MYF(0)); if (table_mon_list) { @@ -791,11 +787,10 @@ int spider_get_ping_table_gtid_pos( goto error_sys_index_end; } #ifdef SPIDER_REQUIRE_DEFINE_FOR_SECONDARY_OPEN_TABLES_BACKUP - spider_close_sys_table(thd, table_gtid_pos, + spider_sys_close_table(thd, table_gtid_pos, &open_tables_backup_gtid_pos, need_lock); #endif - spider_close_sys_table(thd, table_tables, &open_tables_backup_tables, - need_lock); + spider_sys_close_table(thd, &open_tables_backup_tables); DBUG_RETURN(0); @@ -806,13 +801,12 @@ error_get_sys_tables_link_status: error_sys_index_end: error_get_sys_table_by_idx: #ifdef SPIDER_REQUIRE_DEFINE_FOR_SECONDARY_OPEN_TABLES_BACKUP - spider_close_sys_table(thd, table_gtid_pos, + spider_sys_close_table(thd, table_gtid_pos, &open_tables_backup_gtid_pos, need_lock); error_open_table_gtid_pos: #endif - spider_close_sys_table(thd, table_tables, &open_tables_backup_tables, - need_lock); + spider_sys_close_table(thd, &open_tables_backup_tables); error_open_table_tables: DBUG_RETURN(error_num); } @@ -833,7 +827,7 @@ int spider_init_ping_table_mon_cache( !(table_link_mon = spider_open_sys_table( thd, SPIDER_SYS_LINK_MON_TABLE_NAME_STR, SPIDER_SYS_LINK_MON_TABLE_NAME_LEN, FALSE, &open_tables_backup, - need_lock, &error_num)) + &error_num)) ) { my_error(error_num, MYF(0)); goto error_open_sys_table; @@ -921,7 +915,7 @@ int spider_init_ping_table_mon_cache( spider_mon_table_cache_version = spider_mon_table_cache_version_req; } pthread_mutex_unlock(&spider_mon_table_cache_mutex); - spider_close_sys_table(thd, table_link_mon, &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); DBUG_RETURN(0); error_push_dynamic: @@ -930,7 +924,7 @@ error_sys_index_next: spider_sys_index_end(table_link_mon); error_sys_index_first: pthread_mutex_unlock(&spider_mon_table_cache_mutex); - spider_close_sys_table(thd, table_link_mon, &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); error_open_sys_table: DBUG_RETURN(error_num); } @@ -1223,9 +1217,9 @@ long long spider_ping_table_body( conv_name_length, link_idx, SPIDER_LINK_STATUS_NG); spider_sys_update_tables_link_status(trx->thd, conv_name.c_ptr(), conv_name_length, link_idx, - SPIDER_LINK_STATUS_NG, TRUE); + SPIDER_LINK_STATUS_NG); spider_sys_log_tables_link_failed(trx->thd, - conv_name.c_ptr(), conv_name_length, link_idx, TRUE); + conv_name.c_ptr(), conv_name_length, link_idx); status_changed_to_ng = TRUE; } /* @@ -1296,9 +1290,9 @@ long long spider_ping_table_body( conv_name_length, link_idx, SPIDER_LINK_STATUS_NG); spider_sys_update_tables_link_status(trx->thd, conv_name.c_ptr(), conv_name_length, link_idx, - SPIDER_LINK_STATUS_NG, TRUE); + SPIDER_LINK_STATUS_NG); spider_sys_log_tables_link_failed(trx->thd, - conv_name.c_ptr(), conv_name_length, link_idx, TRUE); + conv_name.c_ptr(), conv_name_length, link_idx); status_changed_to_ng = TRUE; } /* @@ -1359,9 +1353,9 @@ long long spider_ping_table_body( conv_name_length, link_idx, SPIDER_LINK_STATUS_NG); spider_sys_update_tables_link_status(trx->thd, conv_name.c_ptr(), conv_name_length, link_idx, - SPIDER_LINK_STATUS_NG, TRUE); + SPIDER_LINK_STATUS_NG); spider_sys_log_tables_link_failed(trx->thd, - conv_name.c_ptr(), conv_name_length, link_idx, TRUE); + conv_name.c_ptr(), conv_name_length, link_idx); status_changed_to_ng = TRUE; } /* @@ -1715,9 +1709,9 @@ int spider_ping_table_mon_from_table( link_idx)); share->link_statuses[link_idx] = SPIDER_LINK_STATUS_NG; spider_sys_update_tables_link_status(thd, conv_name, - conv_name_length, link_idx, SPIDER_LINK_STATUS_NG, need_lock); + conv_name_length, link_idx, SPIDER_LINK_STATUS_NG); spider_sys_log_tables_link_failed(thd, conv_name, - conv_name_length, link_idx, need_lock); + conv_name_length, link_idx); } /* pthread_mutex_unlock(&table_mon_list->update_status_mutex); diff --git a/storage/spider/spd_sys_table.cc b/storage/spider/spd_sys_table.cc index df95336cc19..fdab66161d5 100644 --- a/storage/spider/spd_sys_table.cc +++ b/storage/spider/spd_sys_table.cc @@ -235,7 +235,6 @@ TABLE *spider_open_sys_table( int table_name_length, bool write, SPIDER_Open_tables_backup *open_tables_backup, - bool need_lock, int *error_num ) { TABLE *table; @@ -277,7 +276,7 @@ TABLE *spider_open_sys_table( DBUG_PRINT("info",("spider checking for SYS_XA")); if (table->s->fields != SPIDER_SYS_XA_COL_CNT) { - spider_close_sys_table(thd, table, open_tables_backup, need_lock); + spider_sys_close_table(thd, open_tables_backup); table = NULL; my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM, ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0), @@ -296,7 +295,7 @@ TABLE *spider_open_sys_table( DBUG_PRINT("info",("spider checking for SYS_TABLES")); if (table->s->fields != SPIDER_SYS_TABLES_COL_CNT) { - spider_close_sys_table(thd, table, open_tables_backup, need_lock); + spider_sys_close_table(thd, open_tables_backup); table = NULL; my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM, ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0), @@ -315,7 +314,7 @@ TABLE *spider_open_sys_table( DBUG_PRINT("info",("spider checking for SYS_XA_MEMBER")); if (table->s->fields != SPIDER_SYS_XA_MEMBER_COL_CNT) { - spider_close_sys_table(thd, table, open_tables_backup, need_lock); + spider_sys_close_table(thd, open_tables_backup); table = NULL; my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM, ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0), @@ -331,7 +330,7 @@ TABLE *spider_open_sys_table( DBUG_PRINT("info",("spider checking for SYS_TABLE_STS")); if (table->s->fields != SPIDER_SYS_TABLE_STS_COL_CNT) { - spider_close_sys_table(thd, table, open_tables_backup, need_lock); + spider_sys_close_table(thd, open_tables_backup); table = NULL; my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM, ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0), @@ -347,7 +346,7 @@ TABLE *spider_open_sys_table( DBUG_PRINT("info",("spider checking for SYS_TABLE_CRD")); if (table->s->fields != SPIDER_SYS_TABLE_CRD_COL_CNT) { - spider_close_sys_table(thd, table, open_tables_backup, need_lock); + spider_sys_close_table(thd, open_tables_backup); table = NULL; my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM, ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0), @@ -366,7 +365,7 @@ TABLE *spider_open_sys_table( DBUG_PRINT("info",("spider checking for SYS_XA_FAILED")); if (table->s->fields != SPIDER_SYS_XA_FAILED_TABLE_COL_CNT) { - spider_close_sys_table(thd, table, open_tables_backup, need_lock); + spider_sys_close_table(thd, open_tables_backup); table = NULL; my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM, ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0), @@ -385,7 +384,7 @@ TABLE *spider_open_sys_table( DBUG_PRINT("info",("spider checking for SYS_RW_TBLS")); if (table->s->fields != SPIDER_SYS_RW_TBLS_COL_CNT) { - spider_close_sys_table(thd, table, open_tables_backup, need_lock); + spider_sys_close_table(thd, open_tables_backup); table = NULL; my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM, ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0), @@ -403,7 +402,7 @@ TABLE *spider_open_sys_table( DBUG_PRINT("info",("spider checking for SYS_LINK_FAILED")); if (table->s->fields != SPIDER_SYS_LINK_FAILED_TABLE_COL_CNT) { - spider_close_sys_table(thd, table, open_tables_backup, need_lock); + spider_sys_close_table(thd, open_tables_backup); table = NULL; my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM, ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0), @@ -422,7 +421,7 @@ TABLE *spider_open_sys_table( DBUG_PRINT("info",("spider checking for SYS_LINK_MON")); if (table->s->fields != SPIDER_SYS_LINK_MON_TABLE_COL_CNT) { - spider_close_sys_table(thd, table, open_tables_backup, need_lock); + spider_sys_close_table(thd, open_tables_backup); table = NULL; my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM, ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0), @@ -438,7 +437,7 @@ TABLE *spider_open_sys_table( DBUG_PRINT("info",("spider checking for SYS_RWN_TBLS")); if (table->s->fields != SPIDER_SYS_RWN_TBLS_COL_CNT) { - spider_close_sys_table(thd, table, open_tables_backup, need_lock); + spider_sys_close_table(thd, open_tables_backup); table = NULL; my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM, ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0), @@ -457,7 +456,7 @@ TABLE *spider_open_sys_table( DBUG_PRINT("info",("spider checking for SYS_RW_TBL_TBLS")); if (table->s->fields != SPIDER_SYS_RW_TBL_TBLS_COL_CNT) { - spider_close_sys_table(thd, table, open_tables_backup, need_lock); + spider_sys_close_table(thd, open_tables_backup); table = NULL; my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM, ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0), @@ -476,7 +475,7 @@ TABLE *spider_open_sys_table( DBUG_PRINT("info",("spider checking for SYS_RW_TBL_PTTS")); if (table->s->fields != SPIDER_SYS_RW_TBL_PTTS_COL_CNT) { - spider_close_sys_table(thd, table, open_tables_backup, need_lock); + spider_sys_close_table(thd, open_tables_backup); table = NULL; my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM, ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0), @@ -495,7 +494,7 @@ TABLE *spider_open_sys_table( DBUG_PRINT("info",("spider checking for SYS_POS_FOR_RECOVERY")); if (table->s->fields != SPIDER_SYS_POS_FOR_RECOVERY_TABLE_COL_CNT) { - spider_close_sys_table(thd, table, open_tables_backup, need_lock); + spider_sys_close_table(thd, open_tables_backup); table = NULL; my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM, ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0), @@ -511,7 +510,7 @@ TABLE *spider_open_sys_table( DBUG_PRINT("info",("spider checking for SYS_RW_TBL_SPTTS")); if (table->s->fields != SPIDER_SYS_RW_TBL_SPTTS_COL_CNT) { - spider_close_sys_table(thd, table, open_tables_backup, need_lock); + spider_sys_close_table(thd, open_tables_backup); table = NULL; my_printf_error(ER_SPIDER_SYS_TABLE_VERSION_NUM, ER_SPIDER_SYS_TABLE_VERSION_STR, MYF(0), @@ -532,17 +531,6 @@ error_col_num_chk: DBUG_RETURN(NULL); } -void spider_close_sys_table( - THD *thd, - TABLE *table, - SPIDER_Open_tables_backup *open_tables_backup, - bool need_lock -) { - DBUG_ENTER("spider_close_sys_table"); - spider_sys_close_table(thd, open_tables_backup); - DBUG_VOID_RETURN; -} - bool spider_sys_open_and_lock_tables( THD *thd, TABLE_LIST **tables, @@ -2791,8 +2779,7 @@ int spider_sys_update_tables_link_status( char *name, uint name_length, int link_idx, - long link_status, - bool need_lock + long link_status ) { int error_num; TABLE *table_tables = NULL; @@ -2801,7 +2788,7 @@ int spider_sys_update_tables_link_status( if ( !(table_tables = spider_open_sys_table( thd, SPIDER_SYS_TABLES_TABLE_NAME_STR, - SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, need_lock, + SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, &error_num)) ) { goto error; @@ -2809,15 +2796,13 @@ int spider_sys_update_tables_link_status( if ((error_num = spider_update_tables_link_status(table_tables, name, name_length, link_idx, link_status))) goto error; - spider_close_sys_table(thd, table_tables, - &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); table_tables = NULL; DBUG_RETURN(0); error: if (table_tables) - spider_close_sys_table(thd, table_tables, - &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); DBUG_RETURN(error_num); } @@ -2825,8 +2810,7 @@ int spider_sys_log_tables_link_failed( THD *thd, char *name, uint name_length, - int link_idx, - bool need_lock + int link_idx ) { int error_num; TABLE *table_tables = NULL; @@ -2836,7 +2820,7 @@ int spider_sys_log_tables_link_failed( !(table_tables = spider_open_sys_table( thd, SPIDER_SYS_LINK_FAILED_TABLE_NAME_STR, SPIDER_SYS_LINK_FAILED_TABLE_NAME_LEN, TRUE, &open_tables_backup, - need_lock, &error_num)) + &error_num)) ) { goto error; } @@ -2844,15 +2828,13 @@ int spider_sys_log_tables_link_failed( if ((error_num = spider_log_tables_link_failed(table_tables, name, name_length, link_idx))) goto error; - spider_close_sys_table(thd, table_tables, - &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); table_tables = NULL; DBUG_RETURN(0); error: if (table_tables) - spider_close_sys_table(thd, table_tables, - &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); DBUG_RETURN(error_num); } @@ -2860,8 +2842,7 @@ int spider_sys_log_xa_failed( THD *thd, XID *xid, SPIDER_CONN *conn, - const char *status, - bool need_lock + const char *status ) { int error_num; TABLE *table_tables = NULL; @@ -2871,20 +2852,20 @@ int spider_sys_log_xa_failed( !(table_tables = spider_open_sys_table( thd, SPIDER_SYS_XA_FAILED_TABLE_NAME_STR, SPIDER_SYS_XA_FAILED_TABLE_NAME_LEN, TRUE, &open_tables_backup, - need_lock, &error_num)) + &error_num)) ) { goto error; } empty_record(table_tables); if ((error_num = spider_log_xa_failed(thd, table_tables, xid, conn, status))) goto error; - spider_close_sys_table(thd, table_tables, &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); table_tables = NULL; DBUG_RETURN(0); error: if (table_tables) - spider_close_sys_table(thd, table_tables, &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); DBUG_RETURN(error_num); } @@ -3230,8 +3211,7 @@ int spider_sys_insert_or_update_table_sts( THD *thd, const char *name, uint name_length, - ha_statistics *stat, - bool need_lock + ha_statistics *stat ) { int error_num; TABLE *table_sts = NULL; @@ -3241,7 +3221,7 @@ int spider_sys_insert_or_update_table_sts( !(table_sts = spider_open_sys_table( thd, SPIDER_SYS_TABLE_STS_TABLE_NAME_STR, SPIDER_SYS_TABLE_STS_TABLE_NAME_LEN, TRUE, - &open_tables_backup, need_lock, &error_num)) + &open_tables_backup, &error_num)) ) { goto error; } @@ -3252,13 +3232,13 @@ int spider_sys_insert_or_update_table_sts( stat ))) goto error; - spider_close_sys_table(thd, table_sts, &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); table_sts = NULL; DBUG_RETURN(0); error: if (table_sts) - spider_close_sys_table(thd, table_sts, &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); DBUG_RETURN(error_num); } @@ -3267,8 +3247,7 @@ int spider_sys_insert_or_update_table_crd( const char *name, uint name_length, longlong *cardinality, - uint number_of_keys, - bool need_lock + uint number_of_keys ) { int error_num; TABLE *table_crd = NULL; @@ -3278,7 +3257,7 @@ int spider_sys_insert_or_update_table_crd( !(table_crd = spider_open_sys_table( thd, SPIDER_SYS_TABLE_CRD_TABLE_NAME_STR, SPIDER_SYS_TABLE_CRD_TABLE_NAME_LEN, TRUE, - &open_tables_backup, need_lock, &error_num)) + &open_tables_backup, &error_num)) ) { goto error; } @@ -3290,21 +3269,20 @@ int spider_sys_insert_or_update_table_crd( number_of_keys ))) goto error; - spider_close_sys_table(thd, table_crd, &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); table_crd = NULL; DBUG_RETURN(0); error: if (table_crd) - spider_close_sys_table(thd, table_crd, &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); DBUG_RETURN(error_num); } int spider_sys_delete_table_sts( THD *thd, const char *name, - uint name_length, - bool need_lock + uint name_length ) { int error_num; TABLE *table_sts = NULL; @@ -3314,7 +3292,7 @@ int spider_sys_delete_table_sts( !(table_sts = spider_open_sys_table( thd, SPIDER_SYS_TABLE_STS_TABLE_NAME_STR, SPIDER_SYS_TABLE_STS_TABLE_NAME_LEN, TRUE, - &open_tables_backup, need_lock, &error_num)) + &open_tables_backup, &error_num)) ) { goto error; } @@ -3324,21 +3302,20 @@ int spider_sys_delete_table_sts( name_length ))) goto error; - spider_close_sys_table(thd, table_sts, &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); table_sts = NULL; DBUG_RETURN(0); error: if (table_sts) - spider_close_sys_table(thd, table_sts, &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); DBUG_RETURN(error_num); } int spider_sys_delete_table_crd( THD *thd, const char *name, - uint name_length, - bool need_lock + uint name_length ) { int error_num; TABLE *table_crd = NULL; @@ -3348,7 +3325,7 @@ int spider_sys_delete_table_crd( !(table_crd = spider_open_sys_table( thd, SPIDER_SYS_TABLE_CRD_TABLE_NAME_STR, SPIDER_SYS_TABLE_CRD_TABLE_NAME_LEN, TRUE, - &open_tables_backup, need_lock, &error_num)) + &open_tables_backup, &error_num)) ) { goto error; } @@ -3358,13 +3335,13 @@ int spider_sys_delete_table_crd( name_length ))) goto error; - spider_close_sys_table(thd, table_crd, &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); table_crd = NULL; DBUG_RETURN(0); error: if (table_crd) - spider_close_sys_table(thd, table_crd, &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); DBUG_RETURN(error_num); } @@ -3372,8 +3349,7 @@ int spider_sys_get_table_sts( THD *thd, const char *name, uint name_length, - ha_statistics *stat, - bool need_lock + ha_statistics *stat ) { int error_num; char table_key[MAX_KEY_LENGTH]; @@ -3384,7 +3360,7 @@ int spider_sys_get_table_sts( !(table_sts = spider_open_sys_table( thd, SPIDER_SYS_TABLE_STS_TABLE_NAME_STR, SPIDER_SYS_TABLE_STS_TABLE_NAME_LEN, TRUE, - &open_tables_backup, need_lock, &error_num)) + &open_tables_backup, &error_num)) ) { goto error; } @@ -3405,13 +3381,13 @@ int spider_sys_get_table_sts( ); } - spider_close_sys_table(thd, table_sts, &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); table_sts = NULL; DBUG_RETURN(0); error: if (table_sts) - spider_close_sys_table(thd, table_sts, &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); DBUG_RETURN(error_num); } @@ -3420,8 +3396,7 @@ int spider_sys_get_table_crd( const char *name, uint name_length, longlong *cardinality, - uint number_of_keys, - bool need_lock + uint number_of_keys ) { int error_num; char table_key[MAX_KEY_LENGTH]; @@ -3434,7 +3409,7 @@ int spider_sys_get_table_crd( !(table_crd = spider_open_sys_table( thd, SPIDER_SYS_TABLE_CRD_TABLE_NAME_STR, SPIDER_SYS_TABLE_CRD_TABLE_NAME_LEN, TRUE, - &open_tables_backup, need_lock, &error_num)) + &open_tables_backup, &error_num)) ) { goto error; } @@ -3467,7 +3442,7 @@ int spider_sys_get_table_crd( goto error; } - spider_close_sys_table(thd, table_crd, &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); table_crd = NULL; DBUG_RETURN(0); @@ -3476,7 +3451,7 @@ error: spider_sys_index_end(table_crd); if (table_crd) - spider_close_sys_table(thd, table_crd, &open_tables_backup, need_lock); + spider_sys_close_table(thd, &open_tables_backup); DBUG_RETURN(error_num); } diff --git a/storage/spider/spd_sys_table.h b/storage/spider/spd_sys_table.h index 36f72375f5a..b26f08204cb 100644 --- a/storage/spider/spd_sys_table.h +++ b/storage/spider/spd_sys_table.h @@ -92,17 +92,9 @@ TABLE *spider_open_sys_table( int table_name_length, bool write, SPIDER_Open_tables_backup *open_tables_backup, - bool need_lock, int *error_num ); -void spider_close_sys_table( - THD *thd, - TABLE *table, - SPIDER_Open_tables_backup *open_tables_backup, - bool need_lock -); - bool spider_sys_open_and_lock_tables( THD *thd, TABLE_LIST **tables, @@ -487,24 +479,21 @@ int spider_sys_update_tables_link_status( char *name, uint name_length, int link_idx, - long link_status, - bool need_lock + long link_status ); int spider_sys_log_tables_link_failed( THD *thd, char *name, uint name_length, - int link_idx, - bool need_lock + int link_idx ); int spider_sys_log_xa_failed( THD *thd, XID *xid, SPIDER_CONN *conn, - const char *status, - bool need_lock + const char *status ); int spider_get_sys_link_mon_key( @@ -537,8 +526,7 @@ int spider_sys_insert_or_update_table_sts( THD *thd, const char *name, uint name_length, - ha_statistics *stat, - bool need_lock + ha_statistics *stat ); int spider_sys_insert_or_update_table_crd( @@ -546,30 +534,26 @@ int spider_sys_insert_or_update_table_crd( const char *name, uint name_length, longlong *cardinality, - uint number_of_keys, - bool need_lock + uint number_of_keys ); int spider_sys_delete_table_sts( THD *thd, const char *name, - uint name_length, - bool need_lock + uint name_length ); int spider_sys_delete_table_crd( THD *thd, const char *name, - uint name_length, - bool need_lock + uint name_length ); int spider_sys_get_table_sts( THD *thd, const char *name, uint name_length, - ha_statistics *stat, - bool need_lock + ha_statistics *stat ); int spider_sys_get_table_crd( @@ -577,8 +561,7 @@ int spider_sys_get_table_crd( const char *name, uint name_length, longlong *cardinality, - uint number_of_keys, - bool need_lock + uint number_of_keys ); int spider_sys_replace( diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index 102e0c3521c..dfdbbf4479c 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -4688,7 +4688,7 @@ SPIDER_SHARE *spider_get_share( !(table_tables = spider_open_sys_table( thd, SPIDER_SYS_TABLES_TABLE_NAME_STR, SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, &open_tables_backup, - FALSE, error_num)) + error_num)) ) { for (roop_count = 0; roop_count < (int) spider_udf_table_mon_mutex_count; @@ -4724,8 +4724,7 @@ SPIDER_SHARE *spider_get_share( share->init_error_time = (time_t) time((time_t*) 0); share->init = TRUE; spider_free_share(share); - spider_close_sys_table(thd, table_tables, - &open_tables_backup, FALSE); + spider_sys_close_table(thd, &open_tables_backup); table_tables = NULL; goto error_open_sys_table; } @@ -4734,8 +4733,7 @@ SPIDER_SHARE *spider_get_share( sizeof(long) * share->all_link_count); share->link_status_init = TRUE; } - spider_close_sys_table(thd, table_tables, - &open_tables_backup, FALSE); + spider_sys_close_table(thd, &open_tables_backup); table_tables = NULL; } share->have_recovery_link = spider_conn_check_recovery_link(share); @@ -5157,7 +5155,7 @@ SPIDER_SHARE *spider_get_share( !(table_tables = spider_open_sys_table( thd, SPIDER_SYS_TABLES_TABLE_NAME_STR, SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, &open_tables_backup, - FALSE, error_num)) + error_num)) ) { for (roop_count = 0; roop_count < (int) spider_udf_table_mon_mutex_count; @@ -5187,8 +5185,7 @@ SPIDER_SHARE *spider_get_share( } pthread_mutex_unlock(&share->mutex); spider_free_share(share); - spider_close_sys_table(thd, table_tables, - &open_tables_backup, FALSE); + spider_sys_close_table(thd, &open_tables_backup); table_tables = NULL; goto error_open_sys_table; } @@ -5197,8 +5194,7 @@ SPIDER_SHARE *spider_get_share( sizeof(long) * share->all_link_count); share->link_status_init = TRUE; } - spider_close_sys_table(thd, table_tables, - &open_tables_backup, FALSE); + spider_sys_close_table(thd, &open_tables_backup); table_tables = NULL; } share->have_recovery_link = spider_conn_check_recovery_link(share); @@ -5620,8 +5616,7 @@ int spider_free_share( thd, share->lgtm_tblhnd_share->table_name, share->lgtm_tblhnd_share->table_name_length, - &share->stat, - FALSE + &share->stat ); } if ( @@ -5642,8 +5637,7 @@ int spider_free_share( share->lgtm_tblhnd_share->table_name, share->lgtm_tblhnd_share->table_name_length, share->cardinality, - share->table_share->fields, - FALSE + share->table_share->fields ); } spider_free_share_alloc(share); @@ -5950,7 +5944,7 @@ int spider_open_all_tables( if ( !(table_tables = spider_open_sys_table( thd, SPIDER_SYS_TABLES_TABLE_NAME_STR, - SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, TRUE, + SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, &error_num)) ) DBUG_RETURN(error_num); @@ -5960,12 +5954,10 @@ int spider_open_all_tables( if (error_num != HA_ERR_KEY_NOT_FOUND && error_num != HA_ERR_END_OF_FILE) { table_tables->file->print_error(error_num, MYF(0)); - spider_close_sys_table(thd, table_tables, - &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); DBUG_RETURN(error_num); } else { - spider_close_sys_table(thd, table_tables, - &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); DBUG_RETURN(0); } } @@ -5996,8 +5988,7 @@ int spider_open_all_tables( )) ) { spider_sys_index_end(table_tables); - spider_close_sys_table(thd, table_tables, - &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); spider_free_tmp_share_alloc(&tmp_share); free_root(&mem_root, MYF(0)); DBUG_RETURN(error_num); @@ -6020,8 +6011,7 @@ int spider_open_all_tables( (error_num = spider_create_tmp_dbton_share(&tmp_share)) ) { spider_sys_index_end(table_tables); - spider_close_sys_table(thd, table_tables, - &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); spider_free_tmp_share_alloc(&tmp_share); free_root(&mem_root, MYF(0)); DBUG_RETURN(error_num); @@ -6032,8 +6022,7 @@ int spider_open_all_tables( NULL, FALSE, FALSE, &error_num))) { spider_sys_index_end(table_tables); - spider_close_sys_table(thd, table_tables, - &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); spider_free_tmp_dbton_share(&tmp_share); spider_free_tmp_share_alloc(&tmp_share); free_root(&mem_root, MYF(0)); @@ -6058,8 +6047,7 @@ int spider_open_all_tables( SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); pthread_mutex_unlock(&conn->mta_conn_mutex); spider_sys_index_end(table_tables); - spider_close_sys_table(thd, table_tables, - &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); spider_free_tmp_dbton_share(&tmp_share); spider_free_tmp_share_alloc(&tmp_share); free_root(&mem_root, MYF(0)); @@ -6077,8 +6065,7 @@ int spider_open_all_tables( if (!(spider = new ha_spider())) { spider_sys_index_end(table_tables); - spider_close_sys_table(thd, table_tables, - &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); spider_free_tmp_dbton_share(&tmp_share); spider_free_tmp_share_alloc(&tmp_share); free_root(&mem_root, MYF(0)); @@ -6104,8 +6091,7 @@ int spider_open_all_tables( ) { delete spider; spider_sys_index_end(table_tables); - spider_close_sys_table(thd, table_tables, - &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); spider_free_tmp_dbton_share(&tmp_share); spider_free_tmp_share_alloc(&tmp_share); free_root(&mem_root, MYF(0)); @@ -6132,8 +6118,7 @@ int spider_open_all_tables( spider_free(trx, share, MYF(0)); delete spider; spider_sys_index_end(table_tables); - spider_close_sys_table(thd, table_tables, - &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); spider_free_tmp_dbton_share(&tmp_share); spider_free_tmp_share_alloc(&tmp_share); free_root(&mem_root, MYF(0)); @@ -6148,8 +6133,7 @@ int spider_open_all_tables( spider_free(trx, share, MYF(0)); delete spider; spider_sys_index_end(table_tables); - spider_close_sys_table(thd, table_tables, - &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); spider_free_tmp_dbton_share(&tmp_share); spider_free_tmp_share_alloc(&tmp_share); free_root(&mem_root, MYF(0)); @@ -6175,8 +6159,7 @@ int spider_open_all_tables( spider_free(trx, share, MYF(0)); delete spider; spider_sys_index_end(table_tables); - spider_close_sys_table(thd, table_tables, - &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); spider_free_tmp_dbton_share(&tmp_share); spider_free_tmp_share_alloc(&tmp_share); free_root(&mem_root, MYF(0)); @@ -6191,8 +6174,7 @@ int spider_open_all_tables( free_root(&mem_root, MYF(0)); spider_sys_index_end(table_tables); - spider_close_sys_table(thd, table_tables, - &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); DBUG_RETURN(0); } @@ -7144,8 +7126,7 @@ int spider_get_sts( current_thd, share->lgtm_tblhnd_share->table_name, share->lgtm_tblhnd_share->table_name_length, - &share->stat, - FALSE + &share->stat ); if ( !error_num || @@ -7279,8 +7260,7 @@ int spider_get_crd( share->lgtm_tblhnd_share->table_name, share->lgtm_tblhnd_share->table_name_length, share->cardinality, - table->s->fields, - FALSE + table->s->fields ); if ( !error_num || @@ -8521,7 +8501,7 @@ int spider_discover_table_structure( if ( (table_tables = spider_open_sys_table( thd, SPIDER_SYS_TABLES_TABLE_NAME_STR, - SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, FALSE, + SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, &error_num)) ) { if (thd->lex->create_info.or_replace()) @@ -8533,8 +8513,7 @@ int spider_discover_table_structure( { error_num = spider_insert_tables(table_tables, spider_share); } - spider_close_sys_table(thd, table_tables, - &open_tables_backup, FALSE); + spider_sys_close_table(thd, &open_tables_backup); } } @@ -8607,7 +8586,7 @@ int spider_discover_table_structure( if ( !(table_tables = spider_open_sys_table( thd, SPIDER_SYS_TABLES_TABLE_NAME_STR, - SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, FALSE, + SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, &error_num)) ) { DBUG_RETURN(error_num); @@ -8682,8 +8661,7 @@ int spider_discover_table_structure( break; } } - spider_close_sys_table(thd, table_tables, - &open_tables_backup, FALSE); + spider_sys_close_table(thd, &open_tables_backup); } } diff --git a/storage/spider/spd_trx.cc b/storage/spider/spd_trx.cc index 8e1257bad21..a6c5ea8f85a 100644 --- a/storage/spider/spd_trx.cc +++ b/storage/spider/spd_trx.cc @@ -1909,7 +1909,7 @@ int spider_internal_xa_commit( if ( !(table_xa = spider_open_sys_table( thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN, - TRUE, &open_tables_backup, TRUE, &error_num)) + TRUE, &open_tables_backup, &error_num)) ) goto error_open_table; table_xa_opened = TRUE; @@ -1960,7 +1960,7 @@ int spider_internal_xa_commit( table_xa, &trx->xid, SPIDER_SYS_XA_COMMIT_STR)) ) goto error; - spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); table_xa_opened = FALSE; } @@ -1984,7 +1984,7 @@ int spider_internal_xa_commit( error_num = tmp_error_num; } spider_sys_log_xa_failed(thd, &trx->xid, conn, - SPIDER_SYS_XA_COMMIT_STR, TRUE); + SPIDER_SYS_XA_COMMIT_STR); } if ((tmp_error_num = spider_end_trx(trx, conn))) { @@ -2013,14 +2013,14 @@ int spider_internal_xa_commit( if ( !(table_xa_member = spider_open_sys_table( thd, SPIDER_SYS_XA_MEMBER_TABLE_NAME_STR, - SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup, TRUE, + SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup, &error_num)) ) goto error_open_table; table_xa_member_opened = TRUE; if ((error_num = spider_delete_xa_member(table_xa_member, &trx->xid))) goto error; - spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); table_xa_member_opened = FALSE; /* @@ -2034,13 +2034,13 @@ int spider_internal_xa_commit( if ( !(table_xa = spider_open_sys_table( thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN, - TRUE, &open_tables_backup, TRUE, &error_num)) + TRUE, &open_tables_backup, &error_num)) ) goto error_open_table; table_xa_opened = TRUE; if ((error_num = spider_delete_xa(table_xa, &trx->xid))) goto error; - spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); table_xa_opened = FALSE; } if (trx->internal_xa) @@ -2051,9 +2051,9 @@ int spider_internal_xa_commit( error: if (table_xa_opened) - spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); if (table_xa_member_opened) - spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); error_in_commit: error_open_table: if (trx->internal_xa) @@ -2099,7 +2099,7 @@ int spider_internal_xa_rollback( if ( !(table_xa = spider_open_sys_table( thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN, - TRUE, &open_tables_backup, TRUE, &error_num)) + TRUE, &open_tables_backup, &error_num)) ) goto error_open_table; table_xa_opened = TRUE; @@ -2150,7 +2150,7 @@ int spider_internal_xa_rollback( table_xa, &trx->xid, SPIDER_SYS_XA_ROLLBACK_STR)) ) goto error; - spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); table_xa_opened = FALSE; } @@ -2251,14 +2251,14 @@ int spider_internal_xa_rollback( if ( !(table_xa_member = spider_open_sys_table( thd, SPIDER_SYS_XA_MEMBER_TABLE_NAME_STR, - SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup, TRUE, + SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup, &error_num)) ) goto error_open_table; table_xa_member_opened = TRUE; if ((error_num = spider_delete_xa_member(table_xa_member, &trx->xid))) goto error; - spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); table_xa_member_opened = FALSE; /* @@ -2272,13 +2272,13 @@ int spider_internal_xa_rollback( if ( !(table_xa = spider_open_sys_table( thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN, - TRUE, &open_tables_backup, TRUE, &error_num)) + TRUE, &open_tables_backup, &error_num)) ) goto error_open_table; table_xa_opened = TRUE; if ((error_num = spider_delete_xa(table_xa, &trx->xid))) goto error; - spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); table_xa_opened = FALSE; } if (trx->internal_xa) @@ -2289,9 +2289,9 @@ int spider_internal_xa_rollback( error: if (table_xa_opened) - spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); if (table_xa_member_opened) - spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); error_in_rollback: error_open_table: if (trx->internal_xa) @@ -2326,7 +2326,7 @@ int spider_internal_xa_prepare( if ( !(table_xa = spider_open_sys_table( thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN, - TRUE, &open_tables_backup, TRUE, &error_num)) + TRUE, &open_tables_backup, &error_num)) ) goto error_open_table; table_xa_opened = TRUE; @@ -2335,13 +2335,13 @@ int spider_internal_xa_prepare( table_xa, &trx->xid, SPIDER_SYS_XA_NOT_YET_STR)) ) goto error; - spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); table_xa_opened = FALSE; if ( !(table_xa_member = spider_open_sys_table( thd, SPIDER_SYS_XA_MEMBER_TABLE_NAME_STR, - SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup, TRUE, + SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup, &error_num)) ) goto error_open_table; @@ -2434,7 +2434,7 @@ int spider_internal_xa_prepare( } if (trx->updated_in_this_trx || spider_param_xa_register_mode(thd) == 0) { - spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); table_xa_member_opened = FALSE; /* @@ -2450,7 +2450,7 @@ int spider_internal_xa_prepare( if ( !(table_xa = spider_open_sys_table( thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN, - TRUE, &open_tables_backup, TRUE, &error_num)) + TRUE, &open_tables_backup, &error_num)) ) goto error_open_table; table_xa_opened = TRUE; @@ -2459,16 +2459,16 @@ int spider_internal_xa_prepare( table_xa, &trx->xid, SPIDER_SYS_XA_PREPARED_STR)) ) goto error; - spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); table_xa_opened = FALSE; } DBUG_RETURN(0); error: if (table_xa_opened) - spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); if (table_xa_member_opened) - spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); error_open_table: DBUG_RETURN(error_num); } @@ -2498,7 +2498,7 @@ int spider_internal_xa_recover( if ( !(table_xa = spider_open_sys_table( thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN, - FALSE, &open_tables_backup, TRUE, &my_errno)) + FALSE, &open_tables_backup, &my_errno)) ) goto error_open_table; spider_store_xa_status(table_xa, SPIDER_SYS_XA_PREPARED_STR); @@ -2523,11 +2523,11 @@ int spider_internal_xa_recover( } while (my_errno == 0 && cnt < (int) len); free_root(&mem_root, MYF(0)); spider_sys_index_end(table_xa); - spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); DBUG_RETURN(cnt); error: - spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); error_open_table: DBUG_RETURN(0); } @@ -2568,7 +2568,7 @@ int spider_initinal_xa_recover( if ( !(table_xa = spider_open_sys_table( thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN, - FALSE, &open_tables_backup, TRUE, &error_num)) + FALSE, &open_tables_backup, &error_num)) ) goto error_open_table; SPIDER_init_read_record(read_record, thd, table_xa, NULL, NULL, TRUE, @@ -2583,7 +2583,7 @@ int spider_initinal_xa_recover( free_root(&mem_root, MYF(0)); end_read_record(read_record); - spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); table_xa = NULL; spider_free_tmp_thd(thd); thd = NULL; @@ -2635,7 +2635,7 @@ int spider_internal_xa_commit_by_xid( if ( !(table_xa = spider_open_sys_table( thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN, - TRUE, &open_tables_backup, TRUE, &error_num)) + TRUE, &open_tables_backup, &error_num)) ) goto error_open_table; table_xa_opened = TRUE; @@ -2687,7 +2687,7 @@ int spider_internal_xa_commit_by_xid( free_root(&mem_root, MYF(0)); goto error; } - spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); table_xa_opened = FALSE; /* @@ -2708,7 +2708,7 @@ int spider_internal_xa_commit_by_xid( if ( !(table_xa_member = spider_open_sys_table( thd, SPIDER_SYS_XA_MEMBER_TABLE_NAME_STR, - SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup, TRUE, + SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup, &error_num)) ) { free_root(&mem_root, MYF(0)); @@ -2727,7 +2727,7 @@ int spider_internal_xa_commit_by_xid( goto error; } else { free_root(&mem_root, MYF(0)); - spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); table_xa_member_opened = FALSE; goto xa_delete; } @@ -2796,7 +2796,7 @@ int spider_internal_xa_commit_by_xid( */ if ((error_num = spider_delete_xa_member(table_xa_member, xid))) goto error; - spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); table_xa_member_opened = FALSE; xa_delete: @@ -2811,21 +2811,21 @@ xa_delete: if ( !(table_xa = spider_open_sys_table( thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN, - TRUE, &open_tables_backup, TRUE, &error_num)) + TRUE, &open_tables_backup, &error_num)) ) goto error_open_table; table_xa_opened = TRUE; if ((error_num = spider_delete_xa(table_xa, xid))) goto error; - spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); table_xa_opened = FALSE; DBUG_RETURN(0); error: if (table_xa_opened) - spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); if (table_xa_member_opened) - spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); error_open_table: DBUG_RETURN(error_num); } @@ -2864,7 +2864,7 @@ int spider_internal_xa_rollback_by_xid( if ( !(table_xa = spider_open_sys_table( thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN, - TRUE, &open_tables_backup, TRUE, &error_num)) + TRUE, &open_tables_backup, &error_num)) ) goto error_open_table; table_xa_opened = TRUE; @@ -2914,7 +2914,7 @@ int spider_internal_xa_rollback_by_xid( free_root(&mem_root, MYF(0)); goto error; } - spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); table_xa_opened = FALSE; /* @@ -2935,7 +2935,7 @@ int spider_internal_xa_rollback_by_xid( if ( !(table_xa_member = spider_open_sys_table( thd, SPIDER_SYS_XA_MEMBER_TABLE_NAME_STR, - SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup, TRUE, + SPIDER_SYS_XA_MEMBER_TABLE_NAME_LEN, TRUE, &open_tables_backup, &error_num)) ) { free_root(&mem_root, MYF(0)); @@ -2954,7 +2954,7 @@ int spider_internal_xa_rollback_by_xid( goto error; } else { free_root(&mem_root, MYF(0)); - spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); table_xa_member_opened = FALSE; goto xa_delete; } @@ -3023,7 +3023,7 @@ int spider_internal_xa_rollback_by_xid( */ if ((error_num = spider_delete_xa_member(table_xa_member, xid))) goto error; - spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); table_xa_member_opened = FALSE; xa_delete: @@ -3038,21 +3038,21 @@ xa_delete: if ( !(table_xa = spider_open_sys_table( thd, SPIDER_SYS_XA_TABLE_NAME_STR, SPIDER_SYS_XA_TABLE_NAME_LEN, - TRUE, &open_tables_backup, TRUE, &error_num)) + TRUE, &open_tables_backup, &error_num)) ) goto error_open_table; table_xa_opened = TRUE; if ((error_num = spider_delete_xa(table_xa, xid))) goto error; - spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); table_xa_opened = FALSE; DBUG_RETURN(0); error: if (table_xa_opened) - spider_close_sys_table(thd, table_xa, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); if (table_xa_member_opened) - spider_close_sys_table(thd, table_xa_member, &open_tables_backup, TRUE); + spider_sys_close_table(thd, &open_tables_backup); error_open_table: DBUG_RETURN(error_num); } From a8dac17a42c246478bf5ac6c45539779a6aa2ce3 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 13 Apr 2023 23:10:52 +1000 Subject: [PATCH 197/260] MDEV-28363 remove #ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor --- storage/spider/ha_spider.cc | 10 ---------- storage/spider/spd_db_conn.cc | 14 -------------- storage/spider/spd_db_mysql.cc | 5 ----- storage/spider/spd_include.h | 1 - storage/spider/spd_sys_table.cc | 22 ---------------------- storage/spider/spd_sys_table.h | 22 ---------------------- 6 files changed, 74 deletions(-) diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc index d17bb83de39..e5ef9499eda 100644 --- a/storage/spider/ha_spider.cc +++ b/storage/spider/ha_spider.cc @@ -11849,7 +11849,6 @@ int ha_spider::mk_bulk_tmp_table_and_bulk_start() dbton_hdl->first_link_idx >= 0 && dbton_hdl->need_copy_for_update(roop_count) ) { -#ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor LEX_CSTRING field_name = {STRING_WITH_LEN("a")}; if ( !tmp_table[roop_count] && @@ -11858,15 +11857,6 @@ int ha_spider::mk_bulk_tmp_table_and_bulk_start() &result_list.upd_tmp_tbl_prms[roop_count], &field_name, result_list.update_sqls[roop_count].charset())) ) -#else - if ( - !tmp_table[roop_count] && - !(tmp_table[roop_count] = spider_mk_sys_tmp_table( - wide_handler->trx->thd, table, - &result_list.upd_tmp_tbl_prms[roop_count], "a", - result_list.update_sqls[roop_count].charset())) - ) -#endif { error_num = HA_ERR_OUT_OF_MEM; goto error_2; diff --git a/storage/spider/spd_db_conn.cc b/storage/spider/spd_db_conn.cc index 9c91d666c0a..80e4a541790 100644 --- a/storage/spider/spd_db_conn.cc +++ b/storage/spider/spd_db_conn.cc @@ -3419,18 +3419,12 @@ int spider_db_store_result( DBUG_PRINT("info",("spider store result to temporary table")); DBUG_ASSERT(!current->result_tmp_tbl); -#ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor LEX_CSTRING field_name1 = {STRING_WITH_LEN("a")}; LEX_CSTRING field_name2 = {STRING_WITH_LEN("b")}; LEX_CSTRING field_name3 = {STRING_WITH_LEN("c")}; if (!(current->result_tmp_tbl = spider_mk_sys_tmp_table_for_result( thd, table, ¤t->result_tmp_tbl_prm, &field_name1, &field_name2, &field_name3, &my_charset_bin))) -#else - if (!(current->result_tmp_tbl = spider_mk_sys_tmp_table_for_result( - thd, table, ¤t->result_tmp_tbl_prm, "a", "b", "c", - &my_charset_bin))) -#endif { DBUG_RETURN(HA_ERR_OUT_OF_MEM); } @@ -3780,21 +3774,13 @@ int spider_db_store_result_for_reuse_cursor( DBUG_PRINT("info",("spider store result to temporary table")); DBUG_ASSERT(!current->result_tmp_tbl); -#ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor LEX_CSTRING field_name1 = {STRING_WITH_LEN("a")}; LEX_CSTRING field_name2 = {STRING_WITH_LEN("b")}; LEX_CSTRING field_name3 = {STRING_WITH_LEN("c")}; if (!(current->result_tmp_tbl = spider_mk_sys_tmp_table_for_result( thd, table, ¤t->result_tmp_tbl_prm, &field_name1, &field_name2, &field_name3, &my_charset_bin))) -#else - if (!(current->result_tmp_tbl = spider_mk_sys_tmp_table_for_result( - thd, table, ¤t->result_tmp_tbl_prm, "a", "b", "c", - &my_charset_bin))) -#endif - { DBUG_RETURN(HA_ERR_OUT_OF_MEM); - } current->result_tmp_tbl_thd = thd; TABLE *tmp_tbl = current->result_tmp_tbl; tmp_tbl->file->extra(HA_EXTRA_WRITE_CACHE); diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc index 0a31f46b9c9..3f3ee266839 100644 --- a/storage/spider/spd_db_mysql.cc +++ b/storage/spider/spd_db_mysql.cc @@ -12941,14 +12941,9 @@ int spider_mbase_handler::mk_bulk_tmp_table_and_bulk_start() DBUG_PRINT("info",("spider this=%p", this)); if (!upd_tmp_tbl) { -#ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor LEX_CSTRING field_name = {STRING_WITH_LEN("a")}; if (!(upd_tmp_tbl = spider_mk_sys_tmp_table( thd, table, &upd_tmp_tbl_prm, &field_name, update_sql.charset()))) -#else - if (!(upd_tmp_tbl = spider_mk_sys_tmp_table( - thd, table, &upd_tmp_tbl_prm, "a", update_sql.charset()))) -#endif { DBUG_RETURN(HA_ERR_OUT_OF_MEM); } diff --git a/storage/spider/spd_include.h b/storage/spider/spd_include.h index e6d4c2dca87..35f348ca999 100644 --- a/storage/spider/spd_include.h +++ b/storage/spider/spd_include.h @@ -107,7 +107,6 @@ #define SPIDER_read_record_read_record(A) read_record() #define SPIDER_has_Item_with_subquery -#define SPIDER_use_LEX_CSTRING_for_Field_blob_constructor #define SPIDER_use_LEX_CSTRING_for_database_tablename_alias #define SPIDER_THD_db_str(A) (A)->db.str #define SPIDER_THD_db_length(A) (A)->db.length diff --git a/storage/spider/spd_sys_table.cc b/storage/spider/spd_sys_table.cc index fdab66161d5..b42215a2da3 100644 --- a/storage/spider/spd_sys_table.cc +++ b/storage/spider/spd_sys_table.cc @@ -3523,7 +3523,6 @@ error: DBUG_RETURN(error_num); } -#ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor TABLE *spider_mk_sys_tmp_table( THD *thd, TABLE *table, @@ -3531,15 +3530,6 @@ TABLE *spider_mk_sys_tmp_table( const LEX_CSTRING *field_name, CHARSET_INFO *cs ) -#else -TABLE *spider_mk_sys_tmp_table( - THD *thd, - TABLE *table, - TMP_TABLE_PARAM *tmp_tbl_prm, - const char *field_name, - CHARSET_INFO *cs -) -#endif { Field_blob *field; Item_field *i_field; @@ -3586,7 +3576,6 @@ void spider_rm_sys_tmp_table( DBUG_VOID_RETURN; } -#ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor TABLE *spider_mk_sys_tmp_table_for_result( THD *thd, TABLE *table, @@ -3596,17 +3585,6 @@ TABLE *spider_mk_sys_tmp_table_for_result( const LEX_CSTRING *field_name3, CHARSET_INFO *cs ) -#else -TABLE *spider_mk_sys_tmp_table_for_result( - THD *thd, - TABLE *table, - TMP_TABLE_PARAM *tmp_tbl_prm, - const char *field_name1, - const char *field_name2, - const char *field_name3, - CHARSET_INFO *cs -) -#endif { Field_blob *field1, *field2, *field3; Item_field *i_field1, *i_field2, *i_field3; diff --git a/storage/spider/spd_sys_table.h b/storage/spider/spd_sys_table.h index b26f08204cb..0ad98893322 100644 --- a/storage/spider/spd_sys_table.h +++ b/storage/spider/spd_sys_table.h @@ -569,7 +569,6 @@ int spider_sys_replace( bool *modified_non_trans_table ); -#ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor TABLE *spider_mk_sys_tmp_table( THD *thd, TABLE *table, @@ -577,15 +576,6 @@ TABLE *spider_mk_sys_tmp_table( const LEX_CSTRING *field_name, CHARSET_INFO *cs ); -#else -TABLE *spider_mk_sys_tmp_table( - THD *thd, - TABLE *table, - TMP_TABLE_PARAM *tmp_tbl_prm, - const char *field_name, - CHARSET_INFO *cs -); -#endif void spider_rm_sys_tmp_table( THD *thd, @@ -593,7 +583,6 @@ void spider_rm_sys_tmp_table( TMP_TABLE_PARAM *tmp_tbl_prm ); -#ifdef SPIDER_use_LEX_CSTRING_for_Field_blob_constructor TABLE *spider_mk_sys_tmp_table_for_result( THD *thd, TABLE *table, @@ -603,17 +592,6 @@ TABLE *spider_mk_sys_tmp_table_for_result( const LEX_CSTRING *field_name3, CHARSET_INFO *cs ); -#else -TABLE *spider_mk_sys_tmp_table_for_result( - THD *thd, - TABLE *table, - TMP_TABLE_PARAM *tmp_tbl_prm, - const char *field_name1, - const char *field_name2, - const char *field_name3, - CHARSET_INFO *cs -); -#endif void spider_rm_sys_tmp_table_for_result( THD *thd, From b5d317197c6fb154ae3f16eba9674cdbc86bbe4d Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 23 Mar 2023 17:32:09 +1100 Subject: [PATCH 198/260] MDEV-29676 refactored and documented spider_get_share() and friends Extracted out common subroutines, gave more meaningful names etc, added comments etc. Also: - Documented active servers load balancing reads, and other fields in SPIDER_SHARE etc. - Removed commented out code - Documented and refactored self-reference check - Removed some unnecessary functions - Renamed unhelpful roop_count - Refactored spider_get_{sts,crd}, where we turn get_type into an enum - Cleaned up spider_mbase_handler::show_table_status() and spider_mbase_handler::show_index() --- storage/spider/ha_spider.cc | 16 +- storage/spider/ha_spider.h | 4 +- storage/spider/spd_conn.cc | 146 +- storage/spider/spd_copy_tables.cc | 2 +- storage/spider/spd_db_include.h | 12 + storage/spider/spd_db_mysql.cc | 798 +++-------- storage/spider/spd_include.h | 57 +- storage/spider/spd_param.cc | 2 +- storage/spider/spd_param.h | 1 - storage/spider/spd_ping_table.cc | 2 +- storage/spider/spd_sys_table.cc | 105 +- storage/spider/spd_sys_table.h | 7 - storage/spider/spd_table.cc | 2071 ++++++++++++----------------- storage/spider/spd_table.h | 22 - storage/spider/spd_trx.cc | 49 +- 15 files changed, 1319 insertions(+), 1975 deletions(-) diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc index e5ef9499eda..8af57895b93 100644 --- a/storage/spider/ha_spider.cc +++ b/storage/spider/ha_spider.cc @@ -309,10 +309,10 @@ int ha_spider::open( no_bytes_in_map(table->read_set)); wide_handler_alloc = TRUE; - if (!share && !spider_get_share(name, table, thd, this, &error_num)) - goto error_get_share; + if (!share && !spider_get_share(name, table, thd, this, &error_num)) + goto error_get_share; - wide_share = share->wide_share; + wide_share = share->wide_share; DBUG_PRINT("info",("spider create partition_handler")); DBUG_PRINT("info",("spider table=%p", table)); @@ -6559,13 +6559,6 @@ int ha_spider::info( auto_inc_temporary = FALSE; #endif wide_handler->sql_command = thd_sql_command(thd); -/* - if ( - sql_command == SQLCOM_DROP_TABLE || - sql_command == SQLCOM_ALTER_TABLE || - sql_command == SQLCOM_SHOW_CREATE - ) { -*/ if (flag & HA_STATUS_AUTO) { if (share->lgtm_tblhnd_share->auto_increment_value) @@ -6583,9 +6576,6 @@ int ha_spider::info( wide_handler->sql_command == SQLCOM_ALTER_TABLE ) DBUG_RETURN(0); -/* - } -*/ if (flag & (HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE | HA_STATUS_AUTO)) diff --git a/storage/spider/ha_spider.h b/storage/spider/ha_spider.h index ac865e78f2c..50266739b63 100644 --- a/storage/spider/ha_spider.h +++ b/storage/spider/ha_spider.h @@ -63,8 +63,10 @@ public: char *conn_keys_first_ptr; char **conn_keys; SPIDER_CONN **conns; - /* for active-standby mode */ + /* array of indexes of active servers */ uint *conn_link_idx; + /* A bitmap indicating whether each active server have some higher + numbered server in the same "group" left to try (can fail over) */ uchar *conn_can_fo; void **quick_targets; int *need_mons; diff --git a/storage/spider/spd_conn.cc b/storage/spider/spd_conn.cc index ca556702c65..1baf6a30e7c 100644 --- a/storage/spider/spd_conn.cc +++ b/storage/spider/spd_conn.cc @@ -2992,12 +2992,6 @@ void *spider_bg_sts_action( if (spider.search_link_idx < 0) { spider_trx_set_link_idx_for_all(&spider); -/* - spider.search_link_idx = spider_conn_next_link_idx( - thd, share->link_statuses, share->access_balances, - spider.conn_link_idx, spider.search_link_idx, share->link_count, - SPIDER_LINK_STATUS_OK); -*/ spider.search_link_idx = spider_conn_first_link_idx(thd, share->link_statuses, share->access_balances, spider.conn_link_idx, share->link_count, SPIDER_LINK_STATUS_OK); @@ -3013,32 +3007,6 @@ void *spider_bg_sts_action( share->conn_keys[spider.search_link_idx], trx, &spider, FALSE, FALSE, &error_num); conns[spider.search_link_idx]->error_mode = 0; -/* - if ( - error_num && - share->monitoring_kind[spider.search_link_idx] && - need_mons[spider.search_link_idx] - ) { - lex_start(thd); - error_num = spider_ping_table_mon_from_table( - trx, - thd, - share, - spider.search_link_idx, - (uint32) share->monitoring_sid[spider.search_link_idx], - share->table_name, - share->table_name_length, - spider.conn_link_idx[spider.search_link_idx], - NULL, - 0, - share->monitoring_kind[spider.search_link_idx], - share->monitoring_limit[spider.search_link_idx], - share->monitoring_flag[spider.search_link_idx], - TRUE - ); - lex_end(thd->lex); - } -*/ spider.search_link_idx = -1; } if (spider.search_link_idx != -1 && conns[spider.search_link_idx]) @@ -3049,31 +3017,6 @@ void *spider_bg_sts_action( share->bg_sts_sync, 2, HA_STATUS_CONST | HA_STATUS_VARIABLE)) { -/* - if ( - share->monitoring_kind[spider.search_link_idx] && - need_mons[spider.search_link_idx] - ) { - lex_start(thd); - error_num = spider_ping_table_mon_from_table( - trx, - thd, - share, - spider.search_link_idx, - (uint32) share->monitoring_sid[spider.search_link_idx], - share->table_name, - share->table_name_length, - spider.conn_link_idx[spider.search_link_idx], - NULL, - 0, - share->monitoring_kind[spider.search_link_idx], - share->monitoring_limit[spider.search_link_idx], - share->monitoring_flag[spider.search_link_idx], - TRUE - ); - lex_end(thd->lex); - } -*/ spider.search_link_idx = -1; } } @@ -3316,12 +3259,6 @@ void *spider_bg_crd_action( if (spider.search_link_idx < 0) { spider_trx_set_link_idx_for_all(&spider); -/* - spider.search_link_idx = spider_conn_next_link_idx( - thd, share->link_statuses, share->access_balances, - spider.conn_link_idx, spider.search_link_idx, share->link_count, - SPIDER_LINK_STATUS_OK); -*/ spider.search_link_idx = spider_conn_first_link_idx(thd, share->link_statuses, share->access_balances, spider.conn_link_idx, share->link_count, SPIDER_LINK_STATUS_OK); @@ -3747,6 +3684,24 @@ void *spider_bg_mon_action( } } +/** + Returns a random (active) server with a maximum required link status + + Calculate the sum of balances of all servers whose link status is at + most the specified status ("eligible"), generate a random number + less than this balance, then find the first server cumulatively + exceeding this balance + + @param thd Connection used for generating a random number + @param link_statuses The link statuses of servers + @param access_balances The access balances of servers + @param conn_link_idx Array of indexes to servers + @param link_count Number of servers + @param link_status The maximum required link status + @retval Index to the found server + @retval -1 if no eligible servers + @retval -2 if out of memory +*/ int spider_conn_first_link_idx( THD *thd, long *link_statuses, @@ -3755,35 +3710,35 @@ int spider_conn_first_link_idx( int link_count, int link_status ) { - int roop_count, active_links = 0; - longlong balance_total = 0, balance_val; + int eligible_link_idx, eligible_links = 0; + longlong balance_total = 0, balance_threshold; double rand_val; - int *link_idxs, link_idx; - long *balances; + int *link_idxs, result; DBUG_ENTER("spider_conn_first_link_idx"); char *ptr; - ptr = (char *) my_alloca((sizeof(int) * link_count) + (sizeof(long) * link_count)); + /* Allocate memory for link_idxs */ + ptr = (char *) my_alloca((sizeof(int) * link_count)); if (!ptr) { DBUG_PRINT("info",("spider out of memory")); DBUG_RETURN(-2); } link_idxs = (int *) ptr; - ptr += sizeof(int) * link_count; - balances = (long *) ptr; - for (roop_count = 0; roop_count < link_count; roop_count++) + + /* Filter for eligible servers, store their indexes and calculate + the total balances */ + for (int link_idx = 0; link_idx < link_count; link_idx++) { - DBUG_ASSERT((conn_link_idx[roop_count] - roop_count) % link_count == 0); - if (link_statuses[conn_link_idx[roop_count]] <= link_status) + DBUG_ASSERT((conn_link_idx[link_idx] - link_idx) % link_count == 0); + if (link_statuses[conn_link_idx[link_idx]] <= link_status) { - link_idxs[active_links] = roop_count; - balances[active_links] = access_balances[roop_count]; - balance_total += access_balances[roop_count]; - active_links++; + link_idxs[eligible_links] = link_idx; + balance_total += access_balances[link_idx]; + eligible_links++; } } - if (active_links == 0) + if (eligible_links == 0) { DBUG_PRINT("info",("spider all links are failed")); my_afree(link_idxs); @@ -3793,21 +3748,25 @@ int spider_conn_first_link_idx( DBUG_PRINT("info",("spider thread_id=%lu", thd_get_thread_id(thd))); rand_val = spider_rand(thd->variables.server_id + thd_get_thread_id(thd)); DBUG_PRINT("info",("spider rand_val=%f", rand_val)); - balance_val = (longlong) (rand_val * balance_total); - DBUG_PRINT("info",("spider balance_val=%lld", balance_val)); - for (roop_count = 0; roop_count < active_links - 1; roop_count++) + balance_threshold = (longlong) (rand_val * balance_total); + DBUG_PRINT("info",("spider balance_threshold=%lld", balance_threshold)); + /* Since balance_threshold < total balance, this loop WILL break */ + for (eligible_link_idx = 0; + eligible_link_idx < eligible_links; + eligible_link_idx++) { + result = link_idxs[eligible_link_idx]; + const long balance = access_balances[result]; DBUG_PRINT("info",("spider balances[%d]=%ld", - roop_count, balances[roop_count])); - if (balance_val < balances[roop_count]) + link_idxs[eligible_link_idx], balance)); + if (balance_threshold < balance) break; - balance_val -= balances[roop_count]; + balance_threshold -= balance; } - DBUG_PRINT("info",("spider first link_idx=%d", link_idxs[roop_count])); - link_idx = link_idxs[roop_count]; + DBUG_PRINT("info",("spider first link_idx=%d", result)); my_afree(link_idxs); - DBUG_RETURN(link_idx); + DBUG_RETURN(result); } int spider_conn_next_link_idx( @@ -3842,6 +3801,17 @@ int spider_conn_next_link_idx( DBUG_RETURN(tmp_link_idx); } +/** + Finds the next active server with a maximum required link status + + @param link_statuses The statuses of servers + @param conn_link_idx The array of active servers + @param link_idx The index of the current active server + @param link_count The number of active servers + @param link_status The required maximum link status + @return The next active server whose link status is + at most the required one. +*/ int spider_conn_link_idx_next( long *link_statuses, uint *conn_link_idx, @@ -3854,6 +3824,8 @@ int spider_conn_link_idx_next( link_idx++; if (link_idx >= link_count) break; + /* Asserts that the `link_idx`th active server is in the correct + "group" */ DBUG_ASSERT((conn_link_idx[link_idx] - link_idx) % link_count == 0); } while (link_statuses[conn_link_idx[link_idx]] > link_status); DBUG_PRINT("info",("spider link_idx=%d", link_idx)); diff --git a/storage/spider/spd_copy_tables.cc b/storage/spider/spd_copy_tables.cc index 0d6f05dfdbd..64b86722099 100644 --- a/storage/spider/spd_copy_tables.cc +++ b/storage/spider/spd_copy_tables.cc @@ -398,7 +398,7 @@ int spider_udf_get_copy_tgt_tables( (error_num = spider_get_sys_tables_connect_info( table_tables, tmp_share, 0, mem_root)) || (error_num = spider_get_sys_tables_link_status( - table_tables, tmp_share, 0, mem_root)) || + table_tables, tmp_share->link_statuses, mem_root)) || (error_num = spider_get_sys_tables_link_idx( table_tables, &table_conn->link_idx, mem_root)) ) { diff --git a/storage/spider/spd_db_include.h b/storage/spider/spd_db_include.h index 8b2ebb821df..583299515cb 100644 --- a/storage/spider/spd_db_include.h +++ b/storage/spider/spd_db_include.h @@ -19,12 +19,19 @@ #define SPD_INIT_ALLOC_ROOT(A, B, C, D) \ init_alloc_root(PSI_INSTRUMENT_ME, A, B, C, D) +/** Maximum possible number of `SPIDER_DBTON`s available to use */ #define SPIDER_DBTON_SIZE 15 #ifndef SIZEOF_STORED_DOUBLE #define SIZEOF_STORED_DOUBLE 8 #endif +/** + Possible wrapper values, e.g. for `SPIDER_DBTON::wrapper` and + `SPIDER_SHARE::tgt_wrappers`. + + fixme: change this to enum +*/ #define SPIDER_DB_WRAPPER_MYSQL "mysql" #define SPIDER_DB_WRAPPER_MARIADB "mariadb" @@ -683,6 +690,8 @@ struct st_spider_db_request_key class spider_db_util { public: + /** Same as the `SPIDER_DBTON::dbton_id` of the `SPIDER_DBTON` + containing this `spider_db_util` */ uint dbton_id; spider_db_util() = default; virtual ~spider_db_util() = default; @@ -1683,7 +1692,10 @@ static const LEX_CSTRING maturity_name[] = typedef struct st_spider_dbton { + /** The index of this dbton in `spider_dbton` */ uint dbton_id; + /** The wrapper of this dbton, same possible values as each element + of `SPIDER_SHARE::tgt_wrappers` */ const char *wrapper; enum spider_db_access_type db_access_type; int (*init)(); diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc index 3f3ee266839..f376ae3037f 100644 --- a/storage/spider/spd_db_mysql.cc +++ b/storage/spider/spd_db_mysql.cc @@ -307,6 +307,7 @@ bool spider_mariadb_support_direct_join( DBUG_RETURN(TRUE); } +/** Available `SPIDER_DBTON`s */ SPIDER_DBTON spider_dbton_mysql = { 0, SPIDER_DB_WRAPPER_MYSQL, @@ -803,6 +804,7 @@ SPIDER_DB_ROW *spider_db_mbase_result::fetch_row_from_tmp_table( DBUG_RETURN((SPIDER_DB_ROW *) &row); } +/* Fetches table status into `stat` */ int spider_db_mbase_result::fetch_table_status( int mode, ha_statistics &stat @@ -5302,6 +5304,7 @@ int spider_db_mbase_util::append_sql_mode( DBUG_RETURN(0); } +/** Append `set session time_zone = ...` to a query string */ int spider_db_mbase_util::append_time_zone( spider_string *str, Time_zone *time_zone @@ -5320,6 +5323,14 @@ int spider_db_mbase_util::append_time_zone( DBUG_RETURN(0); } +/** + Append a query for self-referencing check + + The query is setting a user variable `@spider_lc$target_table_path` + to the value of `"$spider_unique_id$spider_table_path-"`, where + $target_table_path is the path to the data node table ("to"), and + $spider_table_path the path to the spider table ("from") +*/ int spider_db_mbase_util::append_loop_check( spider_string *str, SPIDER_CONN *conn @@ -13432,6 +13443,38 @@ int spider_mbase_handler::sts_mode_exchange( DBUG_RETURN(sts_mode); } +/** FIXME: refactor more functions to use spider_setup_for_query() and +spider_teardown_after_query(). */ +void spider_setup_for_query(ha_spider *spider, SPIDER_CONN *conn, int link_idx) +{ + pthread_mutex_assert_not_owner(&conn->mta_conn_mutex); + pthread_mutex_lock(&conn->mta_conn_mutex); + SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos); + conn->need_mon= &spider->need_mons[link_idx]; + DBUG_ASSERT(!conn->mta_conn_mutex_lock_already); + DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later); + conn->mta_conn_mutex_lock_already= TRUE; + conn->mta_conn_mutex_unlock_later= TRUE; + conn->disable_connect_retry= TRUE; +} + +int spider_teardown_after_query(SPIDER_CONN *conn, int error_num, bool clear) +{ + conn->disable_connect_retry= FALSE; + DBUG_ASSERT(conn->mta_conn_mutex_lock_already); + DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); + conn->mta_conn_mutex_lock_already= FALSE; + conn->mta_conn_mutex_unlock_later= FALSE; + if (clear) + { + SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); + pthread_mutex_unlock(&conn->mta_conn_mutex); + } + return error_num; +} +/** + Executes show table status query and stores results in share->stat +*/ int spider_mbase_handler::show_table_status( int link_idx, int sts_mode, @@ -13441,329 +13484,118 @@ int spider_mbase_handler::show_table_status( SPIDER_CONN *conn = spider->conns[link_idx]; SPIDER_DB_RESULT *res; SPIDER_SHARE *share = spider->share; - uint pos = (2 * spider->conn_link_idx[link_idx]); + const uint pos = 2 * spider->conn_link_idx[link_idx] + + (sts_mode == 1 ? 0 : 1); ulonglong auto_increment_value = 0; DBUG_ENTER("spider_mbase_handler::show_table_status"); DBUG_PRINT("info",("spider sts_mode=%d", sts_mode)); - if (sts_mode == 1) + spider_setup_for_query(spider, conn, link_idx); + spider_conn_set_timeout_from_share( + conn, link_idx, spider->wide_handler->trx->thd, share); + if ((error_num = spider_db_set_names(spider, conn, link_idx)) || + /* Executes the `show table status` query */ + (spider_db_query( + conn, + mysql_share->show_table_status[pos].ptr(), + mysql_share->show_table_status[pos].length(), + -1, + &spider->need_mons[link_idx]) && + (error_num = spider_db_errorno(conn)))) { - pthread_mutex_assert_not_owner(&conn->mta_conn_mutex); - pthread_mutex_lock(&conn->mta_conn_mutex); - SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos); - conn->need_mon = &spider->need_mons[link_idx]; - DBUG_ASSERT(!conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = TRUE; - conn->mta_conn_mutex_unlock_later = TRUE; - conn->disable_connect_retry = TRUE; - spider_conn_set_timeout_from_share(conn, link_idx, - spider->wide_handler->trx->thd, - share); - if ( - (error_num = spider_db_set_names(spider, conn, link_idx)) || - ( - spider_db_query( - conn, - mysql_share->show_table_status[0 + pos].ptr(), - mysql_share->show_table_status[0 + pos].length(), - -1, - &spider->need_mons[link_idx]) && - (error_num = spider_db_errorno(conn)) - ) - ) { - if ( - error_num == ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM && - !conn->disable_reconnect + if (error_num == ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM && + !conn->disable_reconnect) + { + /* retry */ + if ((error_num = spider_db_ping(spider, conn, link_idx))) + DBUG_RETURN(spider_teardown_after_query(conn, error_num, true)); + if ((error_num = spider_db_set_names(spider, conn, link_idx))) + DBUG_RETURN(spider_teardown_after_query(conn, error_num, true)); + spider_conn_set_timeout_from_share(conn, link_idx, + spider->wide_handler->trx->thd, + share); + if (spider_db_query( + conn, + mysql_share->show_table_status[pos].ptr(), + mysql_share->show_table_status[pos].length(), + -1, + &spider->need_mons[link_idx]) ) { - /* retry */ - if ((error_num = spider_db_ping(spider, conn, link_idx))) - { - conn->disable_connect_retry = FALSE; - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - DBUG_RETURN(error_num); - } - if ((error_num = spider_db_set_names(spider, conn, link_idx))) - { - conn->disable_connect_retry = FALSE; - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - DBUG_RETURN(error_num); - } - spider_conn_set_timeout_from_share(conn, link_idx, - spider->wide_handler->trx->thd, - share); - if (spider_db_query( - conn, - mysql_share->show_table_status[0 + pos].ptr(), - mysql_share->show_table_status[0 + pos].length(), - -1, - &spider->need_mons[link_idx]) - ) { - conn->disable_connect_retry = FALSE; - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - DBUG_RETURN(spider_db_errorno(conn)); - } - } else { - conn->disable_connect_retry = FALSE; - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - DBUG_RETURN(error_num); + spider_teardown_after_query(conn, 0, false); + DBUG_RETURN(spider_db_errorno(conn)); } - } - st_spider_db_request_key request_key; - request_key.spider_thread_id = spider->wide_handler->trx->spider_thread_id; - request_key.query_id = spider->wide_handler->trx->thd->query_id; - request_key.handler = spider; - request_key.request_id = 1; - request_key.next = NULL; - if (spider_param_dry_access()) + } else + DBUG_RETURN(spider_teardown_after_query(conn, error_num, true)); + } + st_spider_db_request_key request_key = { + spider->wide_handler->trx->spider_thread_id, + spider->wide_handler->trx->thd->query_id, spider, 1, NULL}; + if (spider_param_dry_access()) + DBUG_RETURN(spider_teardown_after_query(conn, 0, true)); + if (!(res = conn->db_conn->store_result(NULL, &request_key, &error_num))) + { + if (sts_mode == 1) /* get from status table */ { - conn->disable_connect_retry = FALSE; - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - DBUG_RETURN(0); - } - if (!(res = conn->db_conn->store_result(NULL, &request_key, &error_num))) - { - conn->disable_connect_retry = FALSE; - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; if (error_num) + DBUG_RETURN(spider_teardown_after_query(conn, error_num, true)); + spider_teardown_after_query(conn, 0, false); + if ((error_num = spider_db_errorno(conn))) + DBUG_RETURN(error_num); + else { - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - DBUG_RETURN(error_num); - } - else if ((error_num = spider_db_errorno(conn))) - DBUG_RETURN(error_num); - else { - my_printf_error(ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM, + my_printf_error( + ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM, ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0), mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(), - mysql_share->table_names_str[spider->conn_link_idx[ - link_idx]].ptr()); + mysql_share->table_names_str[spider->conn_link_idx[link_idx]].ptr()); DBUG_RETURN(ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM); } - } - conn->disable_connect_retry = FALSE; - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - error_num = res->fetch_table_status( - sts_mode, - share->stat - ); - auto_increment_value = share->stat.auto_increment_value; - res->free_result(); - delete res; - if (error_num) + } else /* get from information schema */ { - switch (error_num) - { - case ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM: - my_printf_error(ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM, - ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0), - mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(), - mysql_share->table_names_str[spider->conn_link_idx[ - link_idx]].ptr()); - break; - case ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM: - my_printf_error(ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM, - ER_SPIDER_INVALID_REMOTE_TABLE_INFO_STR, MYF(0), - mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(), - mysql_share->table_names_str[spider->conn_link_idx[ - link_idx]].ptr()); - break; - default: - break; - } - DBUG_RETURN(error_num); - } - } else { - pthread_mutex_assert_not_owner(&conn->mta_conn_mutex); - pthread_mutex_lock(&conn->mta_conn_mutex); - SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos); - conn->need_mon = &spider->need_mons[link_idx]; - DBUG_ASSERT(!conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = TRUE; - conn->mta_conn_mutex_unlock_later = TRUE; - conn->disable_connect_retry = TRUE; - spider_conn_set_timeout_from_share(conn, link_idx, - spider->wide_handler->trx->thd, - share); - if ( - (error_num = spider_db_set_names(spider, conn, link_idx)) || - ( - spider_db_query( - conn, - mysql_share->show_table_status[1 + pos].ptr(), - mysql_share->show_table_status[1 + pos].length(), - -1, - &spider->need_mons[link_idx]) && - (error_num = spider_db_errorno(conn)) - ) - ) { - if ( - error_num == ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM && - !conn->disable_reconnect - ) { - /* retry */ - if ((error_num = spider_db_ping(spider, conn, link_idx))) - { - conn->disable_connect_retry = FALSE; - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - DBUG_RETURN(error_num); - } - if ((error_num = spider_db_set_names(spider, conn, link_idx))) - { - conn->disable_connect_retry = FALSE; - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - DBUG_RETURN(error_num); - } - spider_conn_set_timeout_from_share(conn, link_idx, - spider->wide_handler->trx->thd, - share); - if (spider_db_query( - conn, - mysql_share->show_table_status[1 + pos].ptr(), - mysql_share->show_table_status[1 + pos].length(), - -1, - &spider->need_mons[link_idx]) - ) { - conn->disable_connect_retry = FALSE; - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - DBUG_RETURN(spider_db_errorno(conn)); - } - } else { - conn->disable_connect_retry = FALSE; - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - DBUG_RETURN(error_num); - } - } - st_spider_db_request_key request_key; - request_key.spider_thread_id = spider->wide_handler->trx->spider_thread_id; - request_key.query_id = spider->wide_handler->trx->thd->query_id; - request_key.handler = spider; - request_key.request_id = 1; - request_key.next = NULL; - if (spider_param_dry_access()) - { - conn->disable_connect_retry = FALSE; - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - DBUG_RETURN(0); - } - if (!(res = conn->db_conn->store_result(NULL, &request_key, &error_num))) - { - conn->disable_connect_retry = FALSE; - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - if (error_num || (error_num = spider_db_errorno(conn))) + spider_teardown_after_query(conn, error_num, false); + if (error_num || (error_num= spider_db_errorno(conn))) DBUG_RETURN(error_num); else DBUG_RETURN(ER_QUERY_ON_FOREIGN_DATA_SOURCE); } - conn->disable_connect_retry = FALSE; - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - error_num = res->fetch_table_status( - sts_mode, - share->stat - ); - auto_increment_value = share->stat.auto_increment_value; - res->free_result(); - delete res; - if (error_num) + } + spider_teardown_after_query(conn, 0, true); + /* Fetches query results into share->stat. */ + error_num = res->fetch_table_status(sts_mode, share->stat); + auto_increment_value = share->stat.auto_increment_value; + res->free_result(); + delete res; + if (error_num) + { + switch (error_num) { - switch (error_num) - { - case ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM: - my_printf_error(ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM, - ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0), - mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(), - mysql_share->table_names_str[spider->conn_link_idx[ - link_idx]].ptr()); - break; - case ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM: - my_printf_error(ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM, - ER_SPIDER_INVALID_REMOTE_TABLE_INFO_STR, MYF(0), - mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(), - mysql_share->table_names_str[spider->conn_link_idx[ - link_idx]].ptr()); - break; - default: - break; - } - DBUG_RETURN(error_num); + case ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM: + my_printf_error( + ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM, + ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0), + mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(), + mysql_share->table_names_str[spider->conn_link_idx[link_idx]].ptr()); + break; + case ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM: + my_printf_error( + ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM, + ER_SPIDER_INVALID_REMOTE_TABLE_INFO_STR, MYF(0), + mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(), + mysql_share->table_names_str[spider->conn_link_idx[link_idx]].ptr()); + break; + default: + break; } + DBUG_RETURN(error_num); } if ((error_num = ((spider_db_mbase *) conn->db_conn)->fetch_and_print_warnings(NULL))) { DBUG_RETURN(error_num); } if (share->static_records_for_status != -1) - { share->stat.records = (ha_rows) share->static_records_for_status; - } if (share->static_mean_rec_length != -1) - { share->stat.mean_rec_length = (ulong) share->static_mean_rec_length; - } if (auto_increment_value > share->lgtm_tblhnd_share->auto_increment_value) { share->lgtm_tblhnd_share->auto_increment_value = auto_increment_value; @@ -13790,314 +13622,96 @@ int spider_mbase_handler::show_index( SPIDER_SHARE *share = spider->share; TABLE *table = spider->get_table(); SPIDER_DB_RESULT *res; - int roop_count; - longlong *tmp_cardinality; - uint pos = (2 * spider->conn_link_idx[link_idx]); + int field; + longlong *tmp_crd; + const uint pos = 2 * spider->conn_link_idx[link_idx] + + (crd_mode == 1 ? 0 : 1); DBUG_ENTER("spider_mbase_handler::show_index"); DBUG_PRINT("info",("spider crd_mode=%d", crd_mode)); - if (crd_mode == 1) + spider_setup_for_query(spider, conn, link_idx); + spider_conn_set_timeout_from_share(conn, link_idx, + spider->wide_handler->trx->thd, share); + if ((error_num = spider_db_set_names(spider, conn, link_idx)) || + (spider_db_query( + conn, + mysql_share->show_index[pos].ptr(), + mysql_share->show_index[pos].length(), + -1, + &spider->need_mons[link_idx]) && + (error_num = spider_db_errorno(conn)))) { - pthread_mutex_assert_not_owner(&conn->mta_conn_mutex); - pthread_mutex_lock(&conn->mta_conn_mutex); - SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos); - conn->need_mon = &spider->need_mons[link_idx]; - DBUG_ASSERT(!conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = TRUE; - conn->mta_conn_mutex_unlock_later = TRUE; - spider_conn_set_timeout_from_share(conn, link_idx, - spider->wide_handler->trx->thd, - share); - if ( - (error_num = spider_db_set_names(spider, conn, link_idx)) || - ( - spider_db_query( - conn, - mysql_share->show_index[0 + pos].ptr(), - mysql_share->show_index[0 + pos].length(), - -1, - &spider->need_mons[link_idx]) && - (error_num = spider_db_errorno(conn)) - ) - ) { - if ( - error_num == ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM && - !conn->disable_reconnect - ) { - /* retry */ - if ((error_num = spider_db_ping(spider, conn, link_idx))) - { - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - DBUG_RETURN(error_num); - } - if ((error_num = spider_db_set_names(spider, conn, link_idx))) - { - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - DBUG_RETURN(error_num); - } - spider_conn_set_timeout_from_share(conn, link_idx, - spider->wide_handler->trx->thd, - share); - if (spider_db_query( - conn, - mysql_share->show_index[0 + pos].ptr(), - mysql_share->show_index[0 + pos].length(), - -1, - &spider->need_mons[link_idx]) - ) { - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - DBUG_RETURN(spider_db_errorno(conn)); - } - } else { - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - DBUG_RETURN(error_num); - } - } - st_spider_db_request_key request_key; - request_key.spider_thread_id = spider->wide_handler->trx->spider_thread_id; - request_key.query_id = spider->wide_handler->trx->thd->query_id; - request_key.handler = spider; - request_key.request_id = 1; - request_key.next = NULL; - if (!(res = conn->db_conn->store_result(NULL, &request_key, &error_num))) + if (error_num == ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM && + !conn->disable_reconnect) { - if (error_num || (error_num = spider_db_errorno(conn))) + /* retry */ + if ((error_num = spider_db_ping(spider, conn, link_idx))) + DBUG_RETURN(spider_teardown_after_query(conn, error_num, true)); + if ((error_num = spider_db_set_names(spider, conn, link_idx))) + DBUG_RETURN(spider_teardown_after_query(conn, error_num, true)); + spider_conn_set_timeout_from_share(conn, link_idx, + spider->wide_handler->trx->thd, + share); + if (spider_db_query( + conn, + mysql_share->show_index[pos].ptr(), + mysql_share->show_index[pos].length(), + -1, + &spider->need_mons[link_idx])) { - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - DBUG_RETURN(error_num); + spider_teardown_after_query(conn, 0, false); + DBUG_RETURN(spider_db_errorno(conn)); } - /* no record is ok */ - } - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - if (res) + } else + DBUG_RETURN(spider_teardown_after_query(conn, error_num, true)); + } + st_spider_db_request_key request_key = { + spider->wide_handler->trx->spider_thread_id, + spider->wide_handler->trx->thd->query_id, spider, 1, NULL}; + /* no record is ok */ + if (!(res = conn->db_conn->store_result(NULL, &request_key, &error_num)) && + (error_num || (error_num = spider_db_errorno(conn)))) + DBUG_RETURN(spider_teardown_after_query(conn, error_num, true)); + spider_teardown_after_query(conn, 0, true); + if (res) + error_num = res->fetch_table_cardinality( + crd_mode, table, share->cardinality, share->cardinality_upd, + share->bitmap_size); + for (field = 0, tmp_crd = share->cardinality; + field < (int) table->s->fields; + field++, tmp_crd++) + { + if (!spider_bit_is_set(share->cardinality_upd, field)) { - error_num = res->fetch_table_cardinality( - crd_mode, - table, - share->cardinality, - share->cardinality_upd, - share->bitmap_size - ); - } - for (roop_count = 0, tmp_cardinality = share->cardinality; - roop_count < (int) table->s->fields; - roop_count++, tmp_cardinality++) - { - if (!spider_bit_is_set(share->cardinality_upd, roop_count)) - { - DBUG_PRINT("info", - ("spider uninitialized column cardinality id=%d", roop_count)); - *tmp_cardinality = -1; - } - } - if (res) - { - res->free_result(); - delete res; - } - if (error_num) - { - switch (error_num) - { - case ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM: - my_printf_error(ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM, - ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0), - mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(), - mysql_share->table_names_str[spider->conn_link_idx[ - link_idx]].ptr()); - break; - case ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM: - my_printf_error(ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM, - ER_SPIDER_INVALID_REMOTE_TABLE_INFO_STR, MYF(0), - mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(), - mysql_share->table_names_str[spider->conn_link_idx[ - link_idx]].ptr()); - break; - default: - break; - } - DBUG_RETURN(error_num); - } - } else { - pthread_mutex_assert_not_owner(&conn->mta_conn_mutex); - pthread_mutex_lock(&conn->mta_conn_mutex); - SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos); - conn->need_mon = &spider->need_mons[link_idx]; - DBUG_ASSERT(!conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = TRUE; - conn->mta_conn_mutex_unlock_later = TRUE; - spider_conn_set_timeout_from_share(conn, link_idx, - spider->wide_handler->trx->thd, - share); - if ( - (error_num = spider_db_set_names(spider, conn, link_idx)) || - ( - spider_db_query( - conn, - mysql_share->show_index[1 + pos].ptr(), - mysql_share->show_index[1 + pos].length(), - -1, - &spider->need_mons[link_idx]) && - (error_num = spider_db_errorno(conn)) - ) - ) { - if ( - error_num == ER_SPIDER_REMOTE_SERVER_GONE_AWAY_NUM && - !conn->disable_reconnect - ) { - /* retry */ - if ((error_num = spider_db_ping(spider, conn, link_idx))) - { - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - DBUG_RETURN(error_num); - } - if ((error_num = spider_db_set_names(spider, conn, link_idx))) - { - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - DBUG_RETURN(error_num); - } - spider_conn_set_timeout_from_share(conn, link_idx, - spider->wide_handler->trx->thd, - share); - if (spider_db_query( - conn, - mysql_share->show_index[1 + pos].ptr(), - mysql_share->show_index[1 + pos].length(), - -1, - &spider->need_mons[link_idx]) - ) { - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - DBUG_RETURN(spider_db_errorno(conn)); - } - } else { - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - DBUG_RETURN(error_num); - } - } - st_spider_db_request_key request_key; - request_key.spider_thread_id = spider->wide_handler->trx->spider_thread_id; - request_key.query_id = spider->wide_handler->trx->thd->query_id; - request_key.handler = spider; - request_key.request_id = 1; - request_key.next = NULL; - if (!(res = conn->db_conn->store_result(NULL, &request_key, &error_num))) - { - if (error_num || (error_num = spider_db_errorno(conn))) - { - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - DBUG_RETURN(error_num); - } - /* no record is ok */ - } - DBUG_ASSERT(conn->mta_conn_mutex_lock_already); - DBUG_ASSERT(conn->mta_conn_mutex_unlock_later); - conn->mta_conn_mutex_lock_already = FALSE; - conn->mta_conn_mutex_unlock_later = FALSE; - SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos); - pthread_mutex_unlock(&conn->mta_conn_mutex); - if (res) - { - error_num = res->fetch_table_cardinality( - crd_mode, - table, - share->cardinality, - share->cardinality_upd, - share->bitmap_size - ); - } - for (roop_count = 0, tmp_cardinality = share->cardinality; - roop_count < (int) table->s->fields; - roop_count++, tmp_cardinality++) - { - if (!spider_bit_is_set(share->cardinality_upd, roop_count)) - { - DBUG_PRINT("info", - ("spider uninitialized column cardinality id=%d", roop_count)); - *tmp_cardinality = -1; - } - } - if (res) - { - res->free_result(); - delete res; - } - if (error_num) - { - switch (error_num) - { - case ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM: - my_printf_error(ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM, - ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0), - mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(), - mysql_share->table_names_str[spider->conn_link_idx[ - link_idx]].ptr()); - break; - case ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM: - my_printf_error(ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM, - ER_SPIDER_INVALID_REMOTE_TABLE_INFO_STR, MYF(0), - mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(), - mysql_share->table_names_str[spider->conn_link_idx[ - link_idx]].ptr()); - break; - default: - break; - } - DBUG_RETURN(error_num); + DBUG_PRINT("info", + ("spider uninitialized column cardinality id=%d", field)); + *tmp_crd = -1; } } - DBUG_RETURN(0); + if (res) + { + res->free_result(); + delete res; + } + switch (error_num) + { + case ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM: + my_printf_error( + ER_SPIDER_REMOTE_TABLE_NOT_FOUND_NUM, + ER_SPIDER_REMOTE_TABLE_NOT_FOUND_STR, MYF(0), + mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(), + mysql_share->table_names_str[spider->conn_link_idx[link_idx]].ptr()); + break; + case ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM: + my_printf_error( + ER_SPIDER_INVALID_REMOTE_TABLE_INFO_NUM, + ER_SPIDER_INVALID_REMOTE_TABLE_INFO_STR, MYF(0), + mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(), + mysql_share->table_names_str[spider->conn_link_idx[link_idx]].ptr()); + break; + default: + break; + } + DBUG_RETURN(error_num); } int spider_mbase_handler::simple_action( diff --git a/storage/spider/spd_include.h b/storage/spider/spd_include.h index 35f348ca999..10675aee3ef 100644 --- a/storage/spider/spd_include.h +++ b/storage/spider/spd_include.h @@ -148,9 +148,14 @@ typedef start_new_trans *SPIDER_Open_tables_backup; #define spider_bit_is_set(BITMAP, BIT) \ (uint) ((BITMAP)[(BIT) / 8] & (1 << ((BIT) & 7))) +/* Change status of the remote backend server link. */ +/* 0 Doesn't change status. */ #define SPIDER_LINK_STATUS_NO_CHANGE 0 +/* 1 Changes status to OK. */ #define SPIDER_LINK_STATUS_OK 1 +/* 2 Changes status to RECOVERY. */ #define SPIDER_LINK_STATUS_RECOVERY 2 +/* 3 Changes status to no more in group communication. */ #define SPIDER_LINK_STATUS_NG 3 #define SPIDER_LINK_MON_OK 0 @@ -699,22 +704,30 @@ typedef struct st_spider_share char *table_name; uint table_name_length; uint use_count; + /** + Probably equals `active_link_count`. See also commit ddff602 of + https://github.com/nayuta-yanagisawa/spider-history + + FIXME: consider removing it and using `active_link_count` instead. + */ uint link_count; + /* Number of all links, i.e. all remote servers for the spider + table. */ uint all_link_count; uint link_bitmap_size; pthread_mutex_t mutex; pthread_mutex_t sts_mutex; pthread_mutex_t crd_mutex; -/* - pthread_mutex_t auto_increment_mutex; -*/ TABLE_SHARE *table_share; SPIDER_LGTM_TBLHND_SHARE *lgtm_tblhnd_share; my_hash_value_type table_name_hash_value; my_hash_value_type table_path_hash_value; + /* Whether the share has been initialised */ volatile bool init; + /* Whether an error occurred in initialisation of this share */ volatile bool init_error; + /* The time of the initialisation error */ volatile time_t init_error_time; volatile bool link_status_init; uchar *table_mon_mutex_bitmap; @@ -770,10 +783,6 @@ typedef struct st_spider_share MEM_ROOT mem_root; -/* - volatile bool auto_increment_init; - volatile ulonglong auto_increment_lclval; -*/ ha_statistics stat; longlong static_records_for_status; @@ -788,17 +797,27 @@ typedef struct st_spider_share longlong additional_table_flags; bool have_recovery_link; + /** See `mysql_sysvar_sts_bg_mode` */ int sts_bg_mode; + /** See `mysql_sysvar_sts_interval` */ double sts_interval; + /** See `mysql_sysvar_sts_mode` */ int sts_mode; + /** See `mysql_sysvar_sts_sync` */ int sts_sync; int store_last_sts; + /** See `mysql_sysvar_load_sts_at_startup` */ int load_sts_at_startup; + /** See `mysql_sysvar_crd_bg_mode` */ int crd_bg_mode; + /** See `mysql_sysvar_crd_interval` */ double crd_interval; + /** See `mysql_sysvar_crd_mode` */ int crd_mode; + /** See `mysql_sysvar_crd_sync` */ int crd_sync; int store_last_crd; + /** See `mysql_sysvar_load_crd_at_startup` */ int load_crd_at_startup; int crd_type; double crd_weight; @@ -836,6 +855,7 @@ typedef struct st_spider_share longlong bgs_second_read; longlong first_read; longlong second_read; + /** See `mysql_sysvar_auto_increment_mode` */ int auto_increment_mode; int use_table_charset; int use_pushdown_udf; @@ -846,6 +866,8 @@ typedef struct st_spider_share int read_only_mode; int error_read_mode; int error_write_mode; + /* Number of active remote servers, for use in load balancing read + connections */ int active_link_count; #ifdef HA_CAN_FORCE_BULK_UPDATE int force_bulk_update; @@ -868,6 +890,8 @@ typedef struct st_spider_share char **tgt_usernames; char **tgt_passwords; char **tgt_sockets; + /** The wrapper of target servers, each element has the same + possible values as `SPIDER_DBTON::wrapper` */ char **tgt_wrappers; char **tgt_ssl_cas; char **tgt_ssl_capaths; @@ -885,6 +909,7 @@ typedef struct st_spider_share char **conn_keys; long *tgt_ports; long *tgt_ssl_vscs; + /* See SPIDER_LINK_STATUS_* in spd_include.h */ long *link_statuses; long *monitoring_bg_flag; long *monitoring_bg_kind; @@ -897,6 +922,7 @@ typedef struct st_spider_share long *connect_timeouts; long *net_read_timeouts; long *net_write_timeouts; + /* Connection load balancing integer weight */ long *access_balances; long *bka_table_name_types; long *strict_group_bys; @@ -988,10 +1014,16 @@ typedef struct st_spider_share uint bka_table_name_types_length; uint strict_group_bys_length; - /* for dbton */ + /* + For dbton. A `SPIDER_SHARE` uses all `SPIDER_DBTON`s with the same + wrappers as any its `tgt_wrappers` + */ + /* Specifies which dbtons of the `spider_dbton` to use */ uchar dbton_bitmap[spider_bitmap_size(SPIDER_DBTON_SIZE)]; spider_db_share *dbton_share[SPIDER_DBTON_SIZE]; + /* Number of `SPIDER_DBTON`s used */ uint use_dbton_count; + /* Index of each `SPIDER_DBTON` in `spider_dbton` to use */ uint use_dbton_ids[SPIDER_DBTON_SIZE]; uint dbton_id_to_seq[SPIDER_DBTON_SIZE]; uint use_sql_dbton_count; @@ -1008,14 +1040,23 @@ typedef struct st_spider_link_pack int link_idx; } SPIDER_LINK_PACK; +/** A struct storing the initialisation error of a table. All +instances are in `spider_init_error_tables` */ typedef struct st_spider_init_error_table { + /* The associated table name */ char *table_name; + /* Length of the associated table name */ uint table_name_length; + /* Hash value of the associated table name for lookup */ my_hash_value_type table_name_hash_value; + /* Whether the error has a message */ bool init_error_with_message; + /* The error message */ char init_error_msg[MYSQL_ERRMSG_SIZE]; + /* The error code */ volatile int init_error; + /* The error time */ volatile time_t init_error_time; } SPIDER_INIT_ERROR_TABLE; diff --git a/storage/spider/spd_param.cc b/storage/spider/spd_param.cc index 0a5d881749c..dfd98b9fbc0 100644 --- a/storage/spider/spd_param.cc +++ b/storage/spider/spd_param.cc @@ -1771,7 +1771,7 @@ int spider_param_sts_mode( /* -1 :use table parameter 0 :No synchronization. - 1 :Table state is synchronized when opening a table. + 1 :Table stat is synchronized when opening a table. Then no synchronization. 2 :Synchronization. */ diff --git a/storage/spider/spd_param.h b/storage/spider/spd_param.h index 6abdca43492..a7573a6fb29 100644 --- a/storage/spider/spd_param.h +++ b/storage/spider/spd_param.h @@ -316,7 +316,6 @@ my_bool spider_param_index_hint_pushdown( ); uint spider_param_max_connections(); uint spider_param_conn_wait_timeout(); -uint spider_param_internal_lock_wait_timeout(); uint spider_param_log_result_errors(); uint spider_param_log_result_error_with_sql(); uint spider_param_internal_xa_id_type( diff --git a/storage/spider/spd_ping_table.cc b/storage/spider/spd_ping_table.cc index 3de30e6a80b..056c21e07ec 100644 --- a/storage/spider/spd_ping_table.cc +++ b/storage/spider/spd_ping_table.cc @@ -505,7 +505,7 @@ SPIDER_TABLE_MON_LIST *spider_get_ping_table_tgt( (*error_num = spider_get_sys_tables_connect_info( table_tables, tmp_share, 0, &mem_root)) || (*error_num = spider_get_sys_tables_link_status( - table_tables, tmp_share, 0, &mem_root)) + table_tables, tmp_share->link_statuses, &mem_root)) ) { table_tables->file->print_error(*error_num, MYF(0)); goto error; diff --git a/storage/spider/spd_sys_table.cc b/storage/spider/spd_sys_table.cc index b42215a2da3..7b96c483d5e 100644 --- a/storage/spider/spd_sys_table.cc +++ b/storage/spider/spd_sys_table.cc @@ -979,6 +979,16 @@ void spider_store_xa_member_info( DBUG_VOID_RETURN; } +/** + Stores the DB and table names in a table + + If `name` starts with "./", separates out db and table names from + `name`. Otherwise stores empty strings as names + + @param table The table to store the info + @param name The name of the table + @param name_length The length of the name +*/ void spider_store_tables_name( TABLE *table, const char *name, @@ -1443,6 +1453,12 @@ void spider_store_binlog_pos_gtid( DBUG_VOID_RETURN; } +/** + Stores sts info in the spider sts table + + Stores all fields except the db name and table name, which are + stored in `spider_store_tables_name()`. +*/ void spider_store_table_sts_info( TABLE *table, ha_statistics *stat @@ -1595,6 +1611,18 @@ int spider_insert_sys_table( DBUG_RETURN(error_num); } +/** + Inserts or updates a row in the spider sts system table + + @param table The spider sts system table + @param name The name of the spider table whose stat will be + inserted / updated in the sts table + @param name_length Length of the name + @param stat The stat of the spider table that will be + inserted / updated in the sts table + + @retval 0 or error +*/ int spider_insert_or_update_table_sts( TABLE *table, const char *name, @@ -2642,31 +2670,22 @@ int spider_get_sys_tables_monitoring_binlog_pos_at_failing( DBUG_RETURN(error_num); } -int spider_get_sys_tables_link_status( - TABLE *table, - SPIDER_SHARE *share, - int link_idx, - MEM_ROOT *mem_root -) { - char *ptr; - int error_num = 0; - DBUG_ENTER("spider_get_sys_tables_link_status"); - if ((ptr = get_field(mem_root, table->field[SPIDER_TABLES_LINK_STATUS_POS]))) - { - share->link_statuses[link_idx] = - (long) my_strtoll10(ptr, (char**) NULL, &error_num); - } else - share->link_statuses[link_idx] = 1; - DBUG_PRINT("info",("spider link_statuses[%d]=%ld", - link_idx, share->link_statuses[link_idx])); - DBUG_RETURN(error_num); -} +/** + Reads a table field and updates a link_status of a spider share + @param table The system table (`spider_tables` table) to read the + field from + @param share The share to update its link status with + @param link_idx Which link status to update + @param mem_root MEM_ROOT for allocating + @reval 0 for success, or error num +*/ int spider_get_sys_tables_link_status( TABLE *table, long *link_status, MEM_ROOT *mem_root -) { +) +{ char *ptr; int error_num = 0; DBUG_ENTER("spider_get_sys_tables_link_status"); @@ -2674,7 +2693,6 @@ int spider_get_sys_tables_link_status( *link_status = (long) my_strtoll10(ptr, (char**) NULL, &error_num); else *link_status = 1; - DBUG_PRINT("info",("spider link_statuses=%ld", *link_status)); DBUG_RETURN(error_num); } @@ -2716,6 +2734,14 @@ int spider_get_sys_tables_static_link_id( DBUG_RETURN(error_num); } +/** + Reads the table status from the system sts table + + The result is set into `stat` + + @param table The system sts table + @param stat The stat to read the table status into +*/ void spider_get_sys_table_sts_info( TABLE *table, ha_statistics *stat @@ -3173,6 +3199,15 @@ int spider_get_sys_link_mon_connect_info( DBUG_RETURN(error_num); } +/** + Reads link statuses from the spider_tables system table into a + spider share + + @param table The table to read from + @param share The spider share + @param mem_root MEM_ROOT for allocating + @reval 0 for success, or error code +*/ int spider_get_link_statuses( TABLE *table, SPIDER_SHARE *share, @@ -3191,14 +3226,10 @@ int spider_get_link_statuses( { if ( (error_num == HA_ERR_KEY_NOT_FOUND || error_num == HA_ERR_END_OF_FILE) - ) { -/* - table->file->print_error(error_num, MYF(0)); -*/ + ) DBUG_RETURN(error_num); - } - } else if ((error_num = - spider_get_sys_tables_link_status(table, share, roop_count, mem_root))) + } else if ((error_num = spider_get_sys_tables_link_status( + table, &share->link_statuses[roop_count], mem_root))) { table->file->print_error(error_num, MYF(0)); DBUG_RETURN(error_num); @@ -3207,6 +3238,16 @@ int spider_get_link_statuses( DBUG_RETURN(0); } +/** + Inserts or updates status of a table into the system sts table + + @param thd Connection + @param name Name of the table whose status will be stored + @param name_length Length of `name` + @param stat The table status that will be stored into the + system sts table + @reval 0 for success, or error code +*/ int spider_sys_insert_or_update_table_sts( THD *thd, const char *name, @@ -3345,6 +3386,14 @@ error: DBUG_RETURN(error_num); } +/** + Reads table status of a table from the system sts table. + + @param thd Connection + @param name The name of the table for which to read status of + @param name_length The length of `name` + @param stat The struct to read the status into +*/ int spider_sys_get_table_sts( THD *thd, const char *name, diff --git a/storage/spider/spd_sys_table.h b/storage/spider/spd_sys_table.h index 0ad98893322..6cb6c3957a7 100644 --- a/storage/spider/spd_sys_table.h +++ b/storage/spider/spd_sys_table.h @@ -437,13 +437,6 @@ int spider_get_sys_tables_monitoring_binlog_pos_at_failing( MEM_ROOT *mem_root ); -int spider_get_sys_tables_link_status( - TABLE *table, - SPIDER_SHARE *share, - int link_idx, - MEM_ROOT *mem_root -); - int spider_get_sys_tables_link_status( TABLE *table, long *link_status, diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index dfdbbf4479c..0a652b7473e 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -122,6 +122,7 @@ static pthread_mutex_t *spd_LOCK_server_started; static pthread_cond_t *spd_COND_server_started; extern long spider_conn_mutex_id; handlerton *spider_hton_ptr; +/** All `SPIDER_DBTON`s */ SPIDER_DBTON spider_dbton[SPIDER_DBTON_SIZE]; extern SPIDER_DBTON spider_dbton_mysql; extern SPIDER_DBTON spider_dbton_mariadb; @@ -267,6 +268,20 @@ ha_create_table_option spider_table_option_list[]= { HA_TOPTION_STRING("REMOTE_DATABASE", remote_database), HA_TOPTION_STRING("REMOTE_TABLE", remote_table), HA_TOPTION_END}; +/** + Determines how to populate sts (stat) / crd (cardinality) of a + spider share +*/ +enum ha_sts_crd_get_type +{ + HA_GET_COPY = 0, /* Get by copying from wide_share */ + HA_GET_FETCH = 1, /* Get by executing a sql query */ + HA_GET_AFTER_LOCK = 2, /* Get by executing a sql query after + locking wide_share->sts_mutex. */ + HA_GET_AFTER_TRYLOCK = 3 /* Get by executing a sql query after + trylocking wide_share->sts_mutex. */ +}; + extern HASH spider_open_connections; extern HASH spider_ipport_conns; extern uint spider_open_connections_id; @@ -295,6 +310,7 @@ const char *spider_open_tables_func_name; const char *spider_open_tables_file_name; ulong spider_open_tables_line_no; pthread_mutex_t spider_tbl_mutex; +/** All the `SPIDER_INIT_ERROR_TABLE`s */ HASH spider_init_error_tables; uint spider_init_error_tables_id; const char *spider_init_error_tables_func_name; @@ -342,6 +358,11 @@ extern ulonglong spider_free_mem_count[SPIDER_MEM_CALC_LIST_NUM]; static char spider_wild_many = '%', spider_wild_one = '_', spider_wild_prefix='\\'; +/** + `spider_unique_id` is used for identifying a spider table. It is set + to be a concatenation of the MAC address and the PID, give or take + some separators +*/ static char spider_unique_id_buf[1 + 12 + 1 + (16 * 2) + 1 + 1]; LEX_CSTRING spider_unique_id; @@ -4094,7 +4115,7 @@ void spider_print_keys( int spider_create_conn_keys( SPIDER_SHARE *share ) { - int roop_count, roop_count2; + int roop_count; char *tmp_name, port_str[6]; uint length_base = sizeof(uint) * share->all_link_count; uint *conn_keys_lengths; @@ -4112,70 +4133,79 @@ int spider_create_conn_keys( sql_dbton_ids = (uint *) ptr; share->conn_keys_charlen = 0; - for (roop_count = 0; roop_count < (int) share->all_link_count; roop_count++) + for (int all_link_idx = 0; all_link_idx < (int) share->all_link_count; all_link_idx++) { bool get_sql_id = FALSE; - for (roop_count2 = 0; roop_count2 < SPIDER_DBTON_SIZE; roop_count2++) + /** + Find all `SPIDER_DBTON`s with the same wrapper as the target + server and set the bitmap. Stop at the first `SPIDER_DBTON` whose + db_access_type is sql + + fixme: the logic may be more complicated than the intended + one. For one thing, ALL `SPIDER_DBTON`s have sql access + type. Consider removing everything to do with the db access + type. + */ + for (int dbton_idx = 0; dbton_idx < SPIDER_DBTON_SIZE; dbton_idx++) { - DBUG_PRINT("info",("spider share->tgt_wrappers[%d]=%s", roop_count, - share->tgt_wrappers[roop_count])); - DBUG_PRINT("info",("spider spider_dbton[%d].wrapper=%s", roop_count2, - spider_dbton[roop_count2].wrapper ? - spider_dbton[roop_count2].wrapper : "NULL")); + DBUG_PRINT("info",("spider share->tgt_wrappers[%d]=%s", all_link_idx, + share->tgt_wrappers[all_link_idx])); + DBUG_PRINT("info",("spider spider_dbton[%d].wrapper=%s", dbton_idx, + spider_dbton[dbton_idx].wrapper ? + spider_dbton[dbton_idx].wrapper : "NULL")); if ( - spider_dbton[roop_count2].wrapper && - !strcmp(share->tgt_wrappers[roop_count], - spider_dbton[roop_count2].wrapper) + spider_dbton[dbton_idx].wrapper && + !strcmp(share->tgt_wrappers[all_link_idx], + spider_dbton[dbton_idx].wrapper) ) { - spider_set_bit(share->dbton_bitmap, roop_count2); + spider_set_bit(share->dbton_bitmap, dbton_idx); if ( !get_sql_id && - spider_dbton[roop_count2].db_access_type == SPIDER_DB_ACCESS_TYPE_SQL + spider_dbton[dbton_idx].db_access_type == SPIDER_DB_ACCESS_TYPE_SQL ) { - sql_dbton_ids[roop_count] = roop_count2; + sql_dbton_ids[all_link_idx] = dbton_idx; get_sql_id = TRUE; break; } } } if (!get_sql_id) - sql_dbton_ids[roop_count] = SPIDER_DBTON_SIZE; + sql_dbton_ids[all_link_idx] = SPIDER_DBTON_SIZE; bool tables_on_different_db_are_joinable; if (get_sql_id) { tables_on_different_db_are_joinable = - spider_dbton[sql_dbton_ids[roop_count]].db_util-> + spider_dbton[sql_dbton_ids[all_link_idx]].db_util-> tables_on_different_db_are_joinable(); } else { tables_on_different_db_are_joinable = TRUE; } - conn_keys_lengths[roop_count] + conn_keys_lengths[all_link_idx] = 1 - + share->tgt_wrappers_lengths[roop_count] + 1 - + share->tgt_hosts_lengths[roop_count] + 1 + + share->tgt_wrappers_lengths[all_link_idx] + 1 + + share->tgt_hosts_lengths[all_link_idx] + 1 + 5 + 1 - + share->tgt_sockets_lengths[roop_count] + 1 + + share->tgt_sockets_lengths[all_link_idx] + 1 + (tables_on_different_db_are_joinable ? - 0 : share->tgt_dbs_lengths[roop_count] + 1) - + share->tgt_usernames_lengths[roop_count] + 1 - + share->tgt_passwords_lengths[roop_count] + 1 - + share->tgt_ssl_cas_lengths[roop_count] + 1 - + share->tgt_ssl_capaths_lengths[roop_count] + 1 - + share->tgt_ssl_certs_lengths[roop_count] + 1 - + share->tgt_ssl_ciphers_lengths[roop_count] + 1 - + share->tgt_ssl_keys_lengths[roop_count] + 1 + 0 : share->tgt_dbs_lengths[all_link_idx] + 1) + + share->tgt_usernames_lengths[all_link_idx] + 1 + + share->tgt_passwords_lengths[all_link_idx] + 1 + + share->tgt_ssl_cas_lengths[all_link_idx] + 1 + + share->tgt_ssl_capaths_lengths[all_link_idx] + 1 + + share->tgt_ssl_certs_lengths[all_link_idx] + 1 + + share->tgt_ssl_ciphers_lengths[all_link_idx] + 1 + + share->tgt_ssl_keys_lengths[all_link_idx] + 1 + 1 + 1 - + share->tgt_default_files_lengths[roop_count] + 1 - + share->tgt_default_groups_lengths[roop_count] + 1 - + share->tgt_dsns_lengths[roop_count] + 1 - + share->tgt_filedsns_lengths[roop_count] + 1 - + share->tgt_drivers_lengths[roop_count]; - share->conn_keys_charlen += conn_keys_lengths[roop_count] + 2; + + share->tgt_default_files_lengths[all_link_idx] + 1 + + share->tgt_default_groups_lengths[all_link_idx] + 1 + + share->tgt_dsns_lengths[all_link_idx] + 1 + + share->tgt_filedsns_lengths[all_link_idx] + 1 + + share->tgt_drivers_lengths[all_link_idx]; + share->conn_keys_charlen += conn_keys_lengths[all_link_idx] + 2; } if (!(share->conn_keys = (char **) - spider_bulk_alloc_mem(spider_current_trx, 45, - __func__, __FILE__, __LINE__, MYF(MY_WME | MY_ZEROFILL), + spider_bulk_malloc(spider_current_trx, 45, MYF(MY_WME | MY_ZEROFILL), &share->conn_keys, sizeof(char *) * share->all_link_count, &share->conn_keys_lengths, length_base, &share->conn_keys_hash_value, @@ -4331,15 +4361,15 @@ int spider_create_conn_keys( &spider_open_connections, (uchar*) share->conn_keys[roop_count], share->conn_keys_lengths[roop_count]); } - for (roop_count2 = 0; roop_count2 < SPIDER_DBTON_SIZE; roop_count2++) + for (int dbton_idx = 0; dbton_idx < SPIDER_DBTON_SIZE; dbton_idx++) { - if (spider_bit_is_set(share->dbton_bitmap, roop_count2)) + if (spider_bit_is_set(share->dbton_bitmap, dbton_idx)) { - share->use_sql_dbton_ids[share->use_dbton_count] = roop_count2; - share->sql_dbton_id_to_seq[roop_count2] = share->use_dbton_count; - share->use_sql_dbton_count++; - share->use_dbton_ids[share->use_dbton_count] = roop_count2; - share->dbton_id_to_seq[roop_count2] = share->use_dbton_count; + share->use_sql_dbton_ids[share->use_dbton_count] = dbton_idx; + share->sql_dbton_id_to_seq[dbton_idx] = share->use_dbton_count; + share->use_sql_dbton_count++; + share->use_dbton_ids[share->use_dbton_count] = dbton_idx; + share->dbton_id_to_seq[dbton_idx] = share->use_dbton_count; share->use_dbton_count++; } } @@ -4539,6 +4569,642 @@ error_alloc_share: DBUG_RETURN(NULL); } +/** + Checks for spider table self-reference + + Get the user variable value (source) and compare it with the user + variable name (target). If the target is a substring of the source, + then there is a self-reference + + @param thd Connection + @param share The table share + @retval 0 for success, or else the error number +*/ +int spider_check_for_self_reference(THD *thd, const TABLE_SHARE *share) +{ + String target(0); + LEX_CSTRING key; + DBUG_ENTER("spider_check_for_self_reference"); + + target.append(STRING_WITH_LEN(SPIDER_SQL_LOP_CHK_PRM_PRF_STR)); + target.append(share->path); + DBUG_PRINT("info",("spider loop check param name=%s", target.c_ptr())); + key = target.to_lex_cstring(); + const user_var_entry *loop_check= get_variable(&thd->user_vars, &key, FALSE); + if (loop_check && loop_check->type == STRING_RESULT) + { + String expected(0); + expected.append(spider_unique_id); + expected.append(share->path); + expected.append(STRING_WITH_LEN("-")); + DBUG_PRINT("info",("spider loop check expected=%s", expected.c_ptr())); + DBUG_PRINT("info",("spider loop check param value=%s", + loop_check->value)); + if (unlikely(strstr(loop_check->value, expected.c_ptr()))) + { + const int error_num = ER_SPIDER_INFINITE_LOOP_NUM; + my_printf_error(error_num, ER_SPIDER_INFINITE_LOOP_STR, MYF(0), + share->db.str, share->table_name.str); + DBUG_RETURN(error_num); + } + } + DBUG_RETURN(0); +} + +/** Populate the init_errors and init of share and/or free it */ +void spider_share_init_error_free( + SPIDER_SHARE *share, + const bool init, + const bool free_share +) +{ + share->init_error= TRUE; + share->init_error_time= (time_t) time((time_t *) 0); + share->init= TRUE; + if (free_share) + spider_free_share(share); +} + +void spider_lock_udf_table_mon_mutexes(SPIDER_SHARE *share) +{ + pthread_mutex_lock(&share->mutex); + for (int roop_count = 0; + roop_count < (int) spider_udf_table_mon_mutex_count; + roop_count++) + { + if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count)) + pthread_mutex_lock(&spider_udf_table_mon_mutexes[roop_count]); + } +} + +void spider_unlock_udf_table_mon_mutexes(SPIDER_SHARE *share) +{ + for (int roop_count = 0; + roop_count < (int) spider_udf_table_mon_mutex_count; + roop_count++) + { + if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count)) + pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]); + } + pthread_mutex_unlock(&share->mutex); +} + +/** + Initialises the link_statuses of a spider share + + Open the spider_tables system table, read the link_statuses and + update the spider share, and close the table. Frees share if + failure + + @param thd Connection + @param share The spider share to populate the link_statuses of + @param table_share fixme + @param sql_command The sql command of the thread + @param error_num The error number + @retval true Failure + false Success +*/ +bool spider_share_init_link_statuses( + THD *thd, + SPIDER_SHARE *share, + TABLE_SHARE *table_share, + const int sql_command, + const bool init_share, + int *error_num +) +{ + MEM_ROOT mem_root; + bool init_mem_root= FALSE; + TABLE *table_tables; + SPIDER_Open_tables_backup open_tables_backup; + DBUG_ENTER("spider_share_init_link_statuses"); + /* + The link statuses need to be refreshed from the spider_tables table + if the operation: + - Is not a DROP TABLE on a permanent table; or + - Is an ALTER TABLE. + + Note that SHOW CREATE TABLE is not excluded, because the commands + that follow it require up-to-date link statuses. + */ + if ((table_share->tmp_table == NO_TMP_TABLE && + sql_command != SQLCOM_DROP_TABLE) || + /* for alter change link status */ + sql_command == SQLCOM_ALTER_TABLE) + { + SPD_INIT_ALLOC_ROOT(&mem_root, 4096, 0, MYF(MY_WME)); + init_mem_root = TRUE; + + if (!(table_tables = + spider_open_sys_table(thd, SPIDER_SYS_TABLES_TABLE_NAME_STR, + SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, + &open_tables_backup, error_num))) + { + spider_unlock_udf_table_mon_mutexes(share); + spider_share_init_error_free(share, true, true); + free_root(&mem_root, MYF(0)); + DBUG_RETURN(TRUE); + } + if ((*error_num= spider_get_link_statuses(table_tables, share, + &mem_root))) + { + if (*error_num != HA_ERR_KEY_NOT_FOUND && + *error_num != HA_ERR_END_OF_FILE) + { + spider_unlock_udf_table_mon_mutexes(share); + spider_share_init_error_free(share, init_share, true); + spider_sys_close_table(thd, &open_tables_backup); + free_root(&mem_root, MYF(0)); + DBUG_RETURN(TRUE); + } + } else + { + memcpy(share->alter_table.tmp_link_statuses, share->link_statuses, + sizeof(long) * share->all_link_count); + share->link_status_init = TRUE; + } + spider_sys_close_table(thd, &open_tables_backup); + } + share->have_recovery_link = spider_conn_check_recovery_link(share); + + if (init_mem_root) + free_root(&mem_root, MYF(0)); + DBUG_RETURN(FALSE); +} + +/** Creates an `ha_spider` for the sts thread of the spider share. */ +int spider_share_init_sts( + const char* table_name, + ha_spider *spider, + SPIDER_SHARE *share, + const bool init_share +) +{ + DBUG_ENTER("spider_share_init_sts"); + if (int error_num = spider_create_spider_object_for_share( + spider->wide_handler->trx, share, &share->sts_spider)) + { + pthread_mutex_unlock(&share->mutex); + spider_share_init_error_free(share, init_share, true); + DBUG_RETURN(error_num); + } + share->sts_thread = + &spider_table_sts_threads[my_calc_hash(&spider_open_tables, + (uchar *) table_name, + (uint) strlen(table_name)) % + spider_param_table_sts_thread_count()]; + share->sts_spider_init = TRUE; + DBUG_RETURN(0); +} + +/** Creates an `ha_spider` for the crd thread of the spider share */ +int spider_share_init_crd( + const char* table_name, + ha_spider *spider, + SPIDER_SHARE *share, + const bool init_share +) +{ + DBUG_ENTER("spider_share_init_crd"); + if (int error_num = spider_create_spider_object_for_share( + spider->wide_handler->trx, share, &share->crd_spider)) + { + pthread_mutex_unlock(&share->mutex); + spider_share_init_error_free(share, init_share, true); + DBUG_RETURN(error_num); + } + share->crd_thread = + &spider_table_crd_threads[my_calc_hash(&spider_open_tables, + (uchar *) table_name, + (uint) strlen(table_name)) % + spider_param_table_crd_thread_count()]; + share->crd_spider_init = TRUE; + DBUG_RETURN(0); +} + +void *spider_share_malloc_for_spider( + ha_spider *spider, + SPIDER_SHARE *share, + const uint id, + char** tmp_name, + SPIDER_RESULT_LIST* result_list +) +{ + return spider_bulk_malloc( + spider_current_trx, id, MYF(MY_WME | MY_ZEROFILL), + &spider->conn_keys, sizeof(char *) * share->link_count, + tmp_name, sizeof(char) * share->conn_keys_charlen, + &spider->conns, sizeof(SPIDER_CONN *) * share->link_count, + &spider->conn_link_idx, sizeof(uint) * share->link_count, + &spider->conn_can_fo, sizeof(uchar) * share->link_bitmap_size, + &spider->connection_ids, sizeof(ulonglong) * share->link_count, + &spider->db_request_id, sizeof(ulonglong) * share->link_count, + &spider->db_request_phase, sizeof(uchar) * share->link_bitmap_size, + &spider->need_mons, sizeof(int) * share->link_count, + &spider->quick_targets, sizeof(void *) * share->link_count, + &result_list->upd_tmp_tbls, sizeof(TABLE *) * share->link_count, + &result_list->upd_tmp_tbl_prms, + sizeof(TMP_TABLE_PARAM) * share->link_count, + &result_list->tmp_table_join_first, + sizeof(uchar) * share->link_bitmap_size, + &result_list->tmp_table_created, + sizeof(uchar) * share->link_bitmap_size, + &result_list->casual_read, sizeof(int) * share->link_count, + &spider->dbton_handler, + sizeof(spider_db_handler *) * SPIDER_DBTON_SIZE, + NullS); +} + +/** + Initialise dbton_handlers of a spider. +*/ +int spider_share_init_spider_dbton_handlers(ha_spider *spider, SPIDER_SHARE *share) +{ + int roop_count, error_num= 0; + for (roop_count = 0; roop_count < (int) share->use_dbton_count; + roop_count++) + { + uint dbton_id = share->use_dbton_ids[roop_count]; + if (!(spider->dbton_handler[dbton_id]= + spider_dbton[dbton_id].create_db_handler(spider, + share->dbton_share[dbton_id]))) + { + error_num = HA_ERR_OUT_OF_MEM; + break; + } + if ((error_num = spider->dbton_handler[dbton_id]->init())) + break; + } + /* Failure: rollback */ + if (roop_count < (int) share->use_dbton_count) + { + for (; roop_count >= 0; roop_count--) + { + uint dbton_id = share->use_dbton_ids[roop_count]; + if (spider->dbton_handler[dbton_id]) + { + delete spider->dbton_handler[dbton_id]; + spider->dbton_handler[dbton_id]= NULL; + } + } + } + return error_num; +} + +/** Gets or creates connections to all active servers */ +bool spider_share_get_conns(ha_spider *spider, SPIDER_SHARE *share, + int *error_num) +{ + DBUG_ENTER("spider_share_get_conns"); + for (int roop_count = spider_conn_link_idx_next( + share->link_statuses, spider->conn_link_idx, -1, + share->link_count, SPIDER_LINK_STATUS_RECOVERY); + roop_count < (int) share->link_count; + roop_count = spider_conn_link_idx_next( + share->link_statuses, spider->conn_link_idx, roop_count, + share->link_count, SPIDER_LINK_STATUS_RECOVERY)) + { + if (!(spider->conns[roop_count] = + spider_get_conn(share, roop_count, spider->conn_keys[roop_count], + spider->wide_handler->trx, spider, FALSE, TRUE, + error_num))) + { + if (share->monitoring_kind[roop_count] && spider->need_mons[roop_count]) + { + *error_num = spider_ping_table_mon_from_table( + spider->wide_handler->trx, + spider->wide_handler->trx->thd, + share, + roop_count, + (uint32) share->monitoring_sid[roop_count], + share->table_name, + share->table_name_length, + spider->conn_link_idx[roop_count], + NULL, + 0, + share->monitoring_kind[roop_count], + share->monitoring_limit[roop_count], + share->monitoring_flag[roop_count], + FALSE + ); + } + DBUG_RETURN(TRUE); + } + spider->conns[roop_count]->error_mode &= spider->error_mode; + } + DBUG_RETURN(FALSE); +} + +/** + Handles a failed search for usable servers + + @param share The spider share to update its init error + @param table_share The table share + @param search_result The search result, either -1 (no usable server) or + -2 (out of memory) + @return Error code associated with the failure +*/ +int spider_share_handle_search_link_failure( + SPIDER_SHARE* share, + TABLE_SHARE* table_share, + const int search_result, + const bool init_share +) +{ + DBUG_ENTER("spider_share_handle_search_link_failure"); + if (likely(search_result == -1)) /* No available servers. */ + { + char *db = (char *) my_alloca( + table_share->db.length + 1 + table_share->table_name.length + 1); + if (unlikely(!db)) + { + spider_share_init_error_free(share, init_share, false); + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + } + char *table_name = db + table_share->db.length + 1; + memcpy(db, table_share->db.str, table_share->db.length); + db[table_share->db.length] = '\0'; + memcpy(table_name, table_share->table_name.str, + table_share->table_name.length); + table_name[table_share->table_name.length] = '\0'; + my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM, + ER_SPIDER_ALL_LINKS_FAILED_STR, MYF(0), db, table_name); + my_afree(db); + spider_share_init_error_free(share, init_share, false); + DBUG_RETURN(ER_SPIDER_ALL_LINKS_FAILED_NUM); + } + spider_share_init_error_free(share, init_share, false); + DBUG_RETURN(HA_ERR_OUT_OF_MEM); +} + +/** Gets sts and crd for spider_init_share() */ +bool spider_share_get_sts_crd( + THD *thd, + ha_spider *spider, + SPIDER_SHARE *share, + TABLE *table, + const bool init_share, + /* fixme: do we need this? */ + const bool has_lock, + int *error_num +) +{ + const bool same_server_link = spider_param_same_server_link(thd); + const int load_sts_at_startup = + spider_param_load_sts_at_startup(share->load_sts_at_startup); + const int load_crd_at_startup = + spider_param_load_crd_at_startup(share->load_crd_at_startup); + DBUG_ENTER("spider_share_get_sts_crd"); + if (!spider->error_mode && + (!same_server_link || load_sts_at_startup || load_crd_at_startup)) + { + const double sts_interval = spider_param_sts_interval(thd, share->sts_interval); + const int sts_mode = spider_param_sts_mode(thd, share->sts_mode); + const int auto_increment_mode = spider_param_auto_increment_mode( + thd, share->auto_increment_mode); + const int sts_sync = auto_increment_mode == 1 ? 0 : + spider_param_sts_sync(thd, share->sts_sync); + const double crd_interval = spider_param_crd_interval(thd, share->crd_interval); + int crd_mode = spider_param_crd_mode(thd, share->crd_mode); + /* TODO(MDEV-27996): Delete spider_crd_mode and spider_sts_mode */ + if (crd_mode == 3) + crd_mode = 1; + const int crd_sync = spider_param_crd_sync(thd, share->crd_sync); + + const time_t tmp_time = (time_t) time((time_t*) 0); + if (!has_lock) + { + pthread_mutex_lock(&share->sts_mutex); + pthread_mutex_lock(&share->crd_mutex); + } + /* If not enough time has passed since the last init error, abort */ + if (const SPIDER_INIT_ERROR_TABLE *spider_init_error_table = + spider_get_init_error_table(spider->wide_handler->trx, share, FALSE)) + { + DBUG_PRINT("info",("spider diff1=%f", + difftime(tmp_time, spider_init_error_table->init_error_time))); + if (difftime(tmp_time, + spider_init_error_table->init_error_time) < + spider_param_table_init_error_interval()) + { + *error_num = spider_init_error_table->init_error; + if (spider_init_error_table->init_error_with_message) + my_message(spider_init_error_table->init_error, + spider_init_error_table->init_error_msg, MYF(0)); + spider_share_init_error_free(share, init_share, false); + pthread_mutex_unlock(&share->crd_mutex); + pthread_mutex_unlock(&share->sts_mutex); + DBUG_RETURN(TRUE); + } + } + + if ((!same_server_link || load_sts_at_startup) && + (*error_num = spider_get_sts(share, spider->search_link_idx, tmp_time, + spider, sts_interval, sts_mode, sts_sync, + 1, HA_STATUS_VARIABLE | HA_STATUS_CONST | HA_STATUS_AUTO)) + ) { + if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM) + thd->clear_error(); + else + { + pthread_mutex_unlock(&share->crd_mutex); + pthread_mutex_unlock(&share->sts_mutex); + spider_share_init_error_free(share, init_share, false); + DBUG_RETURN(TRUE); + } + } + + if ((!same_server_link || load_crd_at_startup) && + (*error_num = spider_get_crd(share, spider->search_link_idx, tmp_time, + spider, table, crd_interval, crd_mode, + crd_sync, + 1))) + { + if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM) + thd->clear_error(); + else + { + pthread_mutex_unlock(&share->crd_mutex); + pthread_mutex_unlock(&share->sts_mutex); + spider_share_init_error_free(share, init_share, false); + DBUG_RETURN(TRUE); + } + } + if (!has_lock) + { + pthread_mutex_unlock(&share->crd_mutex); + pthread_mutex_unlock(&share->sts_mutex); + } + } + DBUG_RETURN(FALSE); +} + +/** Initialises a `SPIDER_SHARE` */ +bool spider_init_share( + const char *table_name, + TABLE *table, + THD *thd, + ha_spider *spider, + int *error_num, + SPIDER_SHARE *share, + TABLE_SHARE *table_share, + const bool new_share +) +{ + char first_byte; + char *tmp_name; + SPIDER_RESULT_LIST *result_list = &spider->result_list; + int search_link_idx; + const uint sql_command = thd_sql_command(thd); + const bool continue_with_sql_command = + sql_command != SQLCOM_DROP_TABLE && + sql_command != SQLCOM_ALTER_TABLE && + sql_command != SQLCOM_SHOW_CREATE; + DBUG_ENTER("spider_init_share"); + if (!share->link_status_init) + { + spider_lock_udf_table_mon_mutexes(share); + if (!share->link_status_init && + spider_share_init_link_statuses(thd, share, table_share, + sql_command, new_share, error_num)) + DBUG_RETURN(TRUE); + spider_unlock_udf_table_mon_mutexes(share); + } + + const int semi_table_lock_conn = + spider_param_semi_table_lock_connection(thd, share->semi_table_lock_conn); + if (semi_table_lock_conn) + first_byte = '0' + + spider_param_semi_table_lock(thd, share->semi_table_lock); + else + first_byte = '0'; + + /* fixme: do we need to assign spider->share at different places + depending on new_share? */ + if (!new_share) + spider->share = share; + + if (!(spider->wide_handler->trx = spider_get_trx(thd, TRUE, error_num))) + { + spider_share_init_error_free(share, new_share, true); + DBUG_RETURN(TRUE); + } + spider->set_error_mode(); + + if (!share->sts_spider_init) + { + pthread_mutex_lock(&share->mutex); + if (!share->sts_spider_init && + (*error_num= spider_share_init_sts(table_name, spider, share, new_share))) + DBUG_RETURN(TRUE); + pthread_mutex_unlock(&share->mutex); + } + + if (!share->crd_spider_init) + { + pthread_mutex_lock(&share->mutex); + if (!share->crd_spider_init && + (*error_num= spider_share_init_crd(table_name, spider, share, new_share))) + DBUG_RETURN(TRUE); + pthread_mutex_unlock(&share->mutex); + } + + if (continue_with_sql_command && + (*error_num = spider_create_mon_threads(spider->wide_handler->trx, + share))) + { + spider_share_init_error_free(share, new_share, true); + DBUG_RETURN(TRUE); + } + + if (!(spider_share_malloc_for_spider(spider, share, 47, &tmp_name, + result_list))) + { + spider_share_init_error_free(share, new_share, true); + DBUG_RETURN(TRUE); + } + memcpy(tmp_name, share->conn_keys[0], share->conn_keys_charlen); + + spider->conn_keys_first_ptr = tmp_name; + for (int link_idx = 0; link_idx < (int) share->link_count; link_idx++) + { + spider->conn_keys[link_idx] = tmp_name; + *tmp_name = first_byte; + tmp_name += share->conn_keys_lengths[link_idx] + 1; + result_list->upd_tmp_tbl_prms[link_idx].init(); + result_list->upd_tmp_tbl_prms[link_idx].field_count = 1; + } + spider_trx_set_link_idx_for_all(spider); + + if ((*error_num= spider_share_init_spider_dbton_handlers(spider, share))) + { + spider_share_init_error_free(share, new_share, false); + goto error_after_alloc_conn_keys; + } + + if (continue_with_sql_command && + spider_share_get_conns(spider, share, error_num)) + { + spider_share_init_error_free(share, new_share, false); + goto error_after_alloc_dbton_handler; + } + + search_link_idx = + spider_conn_first_link_idx(thd, share->link_statuses, + share->access_balances, + spider->conn_link_idx, share->link_count, + SPIDER_LINK_STATUS_OK); + if (search_link_idx < 0) + { + *error_num= spider_share_handle_search_link_failure( + share, table_share, search_link_idx, new_share); + goto error_after_alloc_dbton_handler; + } + spider->search_link_idx= search_link_idx; + + if (new_share) + { + if (continue_with_sql_command && + spider_share_get_sts_crd(thd, spider, share, table, true, false, + error_num)) + goto error_after_alloc_dbton_handler; + } else if (share->init_error) + { + pthread_mutex_lock(&share->sts_mutex); + pthread_mutex_lock(&share->crd_mutex); + if (share->init_error) + { + if (continue_with_sql_command && + spider_share_get_sts_crd(thd, spider, share, table, FALSE, TRUE, + error_num)) + goto error_after_alloc_dbton_handler; + share->init_error= FALSE; + } + pthread_mutex_unlock(&share->crd_mutex); + pthread_mutex_unlock(&share->sts_mutex); + } + DBUG_RETURN(FALSE); + +error_after_alloc_dbton_handler: + for (int roop_count = 0; roop_count < (int) share->use_dbton_count; ++roop_count) + { + uint dbton_id = share->use_dbton_ids[roop_count]; + if (spider->dbton_handler[dbton_id]) + { + delete spider->dbton_handler[dbton_id]; + spider->dbton_handler[dbton_id] = NULL; + } + } +error_after_alloc_conn_keys: + spider_free(spider_current_trx, spider->conn_keys, MYF(0)); + spider->conn_keys = NULL; + spider_free_share(share); + DBUG_RETURN(TRUE); +} + +/** + Gets or creates a spider share, then initialises it +*/ SPIDER_SHARE *spider_get_share( const char *table_name, TABLE *table, @@ -4548,92 +5214,24 @@ SPIDER_SHARE *spider_get_share( ) { SPIDER_SHARE *share; TABLE_SHARE *table_share = table->s; - SPIDER_RESULT_LIST *result_list = &spider->result_list; - uint length, tmp_conn_link_idx = 0, buf_sz; - char *tmp_name; - int roop_count; - double sts_interval; - int sts_mode; - int sts_sync; - int auto_increment_mode; - double crd_interval; - int crd_mode; - int crd_sync; - char first_byte; - int semi_table_lock_conn; - int search_link_idx; - uint sql_command = thd_sql_command(thd); - SPIDER_Open_tables_backup open_tables_backup; - MEM_ROOT mem_root; - TABLE *table_tables = NULL; - bool init_mem_root = FALSE; - bool same_server_link; - int load_sts_at_startup; - int load_crd_at_startup; - user_var_entry *loop_check; - char *loop_check_buf; - TABLE_SHARE *top_share; - LEX_CSTRING lex_str; DBUG_ENTER("spider_get_share"); - top_share = spider->wide_handler->top_share; - length = (uint) strlen(table_name); - my_hash_value_type hash_value = my_calc_hash(&spider_open_tables, - (uchar*) table_name, length); - if (top_share) - { - lex_str.length = top_share->path.length + SPIDER_SQL_LOP_CHK_PRM_PRF_LEN; - buf_sz = spider_unique_id.length > SPIDER_SQL_LOP_CHK_PRM_PRF_LEN ? - top_share->path.length + spider_unique_id.length + 2 : - lex_str.length + 2; - loop_check_buf = (char *) my_alloca(buf_sz); - if (unlikely(!loop_check_buf)) - { - *error_num = HA_ERR_OUT_OF_MEM; - DBUG_RETURN(NULL); - } - lex_str.str = loop_check_buf + buf_sz - lex_str.length - 2; - memcpy((void *) lex_str.str, - SPIDER_SQL_LOP_CHK_PRM_PRF_STR, SPIDER_SQL_LOP_CHK_PRM_PRF_LEN); - memcpy((void *) (lex_str.str + SPIDER_SQL_LOP_CHK_PRM_PRF_LEN), - top_share->path.str, top_share->path.length); - ((char *) lex_str.str)[lex_str.length] = '\0'; - DBUG_PRINT("info",("spider loop check param name=%s", lex_str.str)); - loop_check = get_variable(&thd->user_vars, &lex_str, FALSE); - if (loop_check && loop_check->type == STRING_RESULT) - { - lex_str.length = top_share->path.length + spider_unique_id.length + 1; - lex_str.str = loop_check_buf + buf_sz - top_share->path.length - - spider_unique_id.length - 2; - memcpy((void *) lex_str.str, spider_unique_id.str, - spider_unique_id.length); - ((char *) lex_str.str)[lex_str.length - 1] = '-'; - ((char *) lex_str.str)[lex_str.length] = '\0'; - DBUG_PRINT("info",("spider loop check key=%s", lex_str.str)); - DBUG_PRINT("info",("spider loop check param value=%s", - loop_check->value)); - if (unlikely(strstr(loop_check->value, lex_str.str))) - { - *error_num = ER_SPIDER_INFINITE_LOOP_NUM; - my_printf_error(*error_num, ER_SPIDER_INFINITE_LOOP_STR, MYF(0), - top_share->db.str, top_share->table_name.str); - my_afree(loop_check_buf); - DBUG_RETURN(NULL); - } - } - my_afree(loop_check_buf); - } + + const TABLE_SHARE *top_share = spider->wide_handler->top_share; + if (top_share && + (*error_num = spider_check_for_self_reference(thd, top_share))) + DBUG_RETURN(NULL); + + const uint length = (uint) strlen(table_name); + const my_hash_value_type hash_value = + my_calc_hash(&spider_open_tables, (uchar*) table_name, length); pthread_mutex_lock(&spider_tbl_mutex); if (!(share = (SPIDER_SHARE*) my_hash_search_using_hash_value( &spider_open_tables, hash_value, (uchar*) table_name, length))) { - if (!(share = spider_create_share( - table_name, table_share, - table->part_info, - hash_value, - error_num - ))) { + if (!(share = spider_create_share(table_name, table_share, + table->part_info, hash_value, + error_num))) goto error_alloc_share; - } uint old_elements = spider_open_tables.array.max_element; if (my_hash_insert(&spider_open_tables, (uchar*) share)) @@ -4650,455 +5248,19 @@ SPIDER_SHARE *spider_get_share( } spider->share = share; + uint tmp_conn_link_idx= 0; spider->conn_link_idx = &tmp_conn_link_idx; share->use_count++; pthread_mutex_unlock(&spider_tbl_mutex); - if (!share->link_status_init) - { - pthread_mutex_lock(&share->mutex); - for (roop_count = 0; - roop_count < (int) spider_udf_table_mon_mutex_count; - roop_count++ - ) { - if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count)) - pthread_mutex_lock(&spider_udf_table_mon_mutexes[roop_count]); - } - if (!share->link_status_init) - { - /* - The link statuses need to be refreshed from the spider_tables table - if the operation: - - Is not a DROP TABLE on a permanent table; or - - Is an ALTER TABLE. - - Note that SHOW CREATE TABLE is not excluded, because the commands - that follow it require up-to-date link statuses. - */ - if ((table_share->tmp_table == NO_TMP_TABLE && - sql_command != SQLCOM_DROP_TABLE) || - /* for alter change link status */ - sql_command == SQLCOM_ALTER_TABLE) - { - SPD_INIT_ALLOC_ROOT(&mem_root, 4096, 0, MYF(MY_WME)); - init_mem_root = TRUE; - - if ( - !(table_tables = spider_open_sys_table( - thd, SPIDER_SYS_TABLES_TABLE_NAME_STR, - SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, &open_tables_backup, - error_num)) - ) { - for (roop_count = 0; - roop_count < (int) spider_udf_table_mon_mutex_count; - roop_count++ - ) { - if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count)) - pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]); - } - pthread_mutex_unlock(&share->mutex); - share->init_error = TRUE; - share->init_error_time = (time_t) time((time_t*) 0); - share->init = TRUE; - spider_free_share(share); - goto error_open_sys_table; - } - *error_num = spider_get_link_statuses(table_tables, share, - &mem_root); - if (*error_num) - { - if ( - *error_num != HA_ERR_KEY_NOT_FOUND && - *error_num != HA_ERR_END_OF_FILE - ) { - for (roop_count = 0; - roop_count < (int) spider_udf_table_mon_mutex_count; - roop_count++ - ) { - if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count)) - pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]); - } - pthread_mutex_unlock(&share->mutex); - share->init_error = TRUE; - share->init_error_time = (time_t) time((time_t*) 0); - share->init = TRUE; - spider_free_share(share); - spider_sys_close_table(thd, &open_tables_backup); - table_tables = NULL; - goto error_open_sys_table; - } - } else { - memcpy(share->alter_table.tmp_link_statuses, share->link_statuses, - sizeof(long) * share->all_link_count); - share->link_status_init = TRUE; - } - spider_sys_close_table(thd, &open_tables_backup); - table_tables = NULL; - } - share->have_recovery_link = spider_conn_check_recovery_link(share); - if (init_mem_root) - { - free_root(&mem_root, MYF(0)); - init_mem_root = FALSE; - } - } - for (roop_count = 0; - roop_count < (int) spider_udf_table_mon_mutex_count; - roop_count++ - ) { - if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count)) - pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]); - } - pthread_mutex_unlock(&share->mutex); - } - - semi_table_lock_conn = spider_param_semi_table_lock_connection(thd, - share->semi_table_lock_conn); - if (semi_table_lock_conn) - first_byte = '0' + - spider_param_semi_table_lock(thd, share->semi_table_lock); - else - first_byte = '0'; - - if (!(spider->wide_handler->trx = spider_get_trx(thd, TRUE, error_num))) - { - share->init_error = TRUE; - share->init_error_time = (time_t) time((time_t*) 0); - share->init = TRUE; - spider_free_share(share); - goto error_but_no_delete; - } - spider->set_error_mode(); - - if (!share->sts_spider_init) - { - pthread_mutex_lock(&share->mutex); - if (!share->sts_spider_init) - { - if ((*error_num = spider_create_spider_object_for_share( - spider->wide_handler->trx, share, &share->sts_spider))) - { - pthread_mutex_unlock(&share->mutex); - share->init_error = TRUE; - share->init_error_time = (time_t) time((time_t*) 0); - share->init = TRUE; - spider_free_share(share); - goto error_sts_spider_init; - } - share->sts_thread = &spider_table_sts_threads[ - my_calc_hash(&spider_open_tables, (uchar*) table_name, length) % - spider_param_table_sts_thread_count()]; - share->sts_spider_init = TRUE; - } - pthread_mutex_unlock(&share->mutex); - } - - if (!share->crd_spider_init) - { - pthread_mutex_lock(&share->mutex); - if (!share->crd_spider_init) - { - if ((*error_num = spider_create_spider_object_for_share( - spider->wide_handler->trx, share, &share->crd_spider))) - { - pthread_mutex_unlock(&share->mutex); - share->init_error = TRUE; - share->init_error_time = (time_t) time((time_t*) 0); - share->init = TRUE; - spider_free_share(share); - goto error_crd_spider_init; - } - share->crd_thread = &spider_table_crd_threads[ - my_calc_hash(&spider_open_tables, (uchar*) table_name, length) % - spider_param_table_crd_thread_count()]; - share->crd_spider_init = TRUE; - } - pthread_mutex_unlock(&share->mutex); - } - - if ( - sql_command != SQLCOM_DROP_TABLE && - sql_command != SQLCOM_ALTER_TABLE && - sql_command != SQLCOM_SHOW_CREATE && - (*error_num = spider_create_mon_threads(spider->wide_handler->trx, - share)) - ) { - share->init_error = TRUE; - share->init_error_time = (time_t) time((time_t*) 0); - share->init = TRUE; - spider_free_share(share); - goto error_but_no_delete; - } - - if (!(spider->conn_keys = (char **) - spider_bulk_alloc_mem(spider_current_trx, 47, - __func__, __FILE__, __LINE__, MYF(MY_WME | MY_ZEROFILL), - &spider->conn_keys, sizeof(char *) * share->link_count, - &tmp_name, sizeof(char) * share->conn_keys_charlen, - &spider->conns, sizeof(SPIDER_CONN *) * share->link_count, - &spider->conn_link_idx, sizeof(uint) * share->link_count, - &spider->conn_can_fo, sizeof(uchar) * share->link_bitmap_size, - &spider->connection_ids, sizeof(ulonglong) * share->link_count, - &spider->db_request_id, sizeof(ulonglong) * share->link_count, - &spider->db_request_phase, sizeof(uchar) * share->link_bitmap_size, - &spider->need_mons, sizeof(int) * share->link_count, - &spider->quick_targets, sizeof(void *) * share->link_count, - &result_list->upd_tmp_tbls, sizeof(TABLE *) * share->link_count, - &result_list->upd_tmp_tbl_prms, - sizeof(TMP_TABLE_PARAM) * share->link_count, - &result_list->tmp_table_join_first, - sizeof(uchar) * share->link_bitmap_size, - &result_list->tmp_table_created, - sizeof(uchar) * share->link_bitmap_size, - &result_list->casual_read, sizeof(int) * share->link_count, - &spider->dbton_handler, - sizeof(spider_db_handler *) * SPIDER_DBTON_SIZE, - NullS)) - ) { - share->init_error = TRUE; - share->init_error_time = (time_t) time((time_t*) 0); - share->init = TRUE; - spider_free_share(share); - goto error_but_no_delete; - } - memcpy(tmp_name, share->conn_keys[0], share->conn_keys_charlen); - - spider->conn_keys_first_ptr = tmp_name; - for (roop_count = 0; roop_count < (int) share->link_count; roop_count++) - { - spider->conn_keys[roop_count] = tmp_name; - *tmp_name = first_byte; - tmp_name += share->conn_keys_lengths[roop_count] + 1; - result_list->upd_tmp_tbl_prms[roop_count].init(); - result_list->upd_tmp_tbl_prms[roop_count].field_count = 1; - } - spider_trx_set_link_idx_for_all(spider); - - for (roop_count = 0; roop_count < (int) share->use_dbton_count; - roop_count++) - { - uint dbton_id = share->use_dbton_ids[roop_count]; - if (!(spider->dbton_handler[dbton_id] = - spider_dbton[dbton_id].create_db_handler(spider, - share->dbton_share[dbton_id]))) - { - *error_num = HA_ERR_OUT_OF_MEM; - break; - } - if ((*error_num = spider->dbton_handler[dbton_id]->init())) - { - break; - } - } - if (roop_count < (int) share->use_dbton_count) - { - for (; roop_count >= 0; roop_count--) - { - uint dbton_id = share->use_dbton_ids[roop_count]; - if (spider->dbton_handler[dbton_id]) - { - delete spider->dbton_handler[dbton_id]; - spider->dbton_handler[dbton_id] = NULL; - } - } - share->init_error = TRUE; - share->init_error_time = (time_t) time((time_t*) 0); - share->init = TRUE; - goto error_after_alloc_conn_keys; - } - - if ( - sql_command != SQLCOM_DROP_TABLE && - sql_command != SQLCOM_ALTER_TABLE && - sql_command != SQLCOM_SHOW_CREATE - ) { - for ( - roop_count = spider_conn_link_idx_next(share->link_statuses, - spider->conn_link_idx, -1, share->link_count, - SPIDER_LINK_STATUS_RECOVERY); - roop_count < (int) share->link_count; - roop_count = spider_conn_link_idx_next(share->link_statuses, - spider->conn_link_idx, roop_count, share->link_count, - SPIDER_LINK_STATUS_RECOVERY) - ) { - if ( - !(spider->conns[roop_count] = - spider_get_conn(share, roop_count, spider->conn_keys[roop_count], - spider->wide_handler->trx, spider, FALSE, TRUE, - error_num)) - ) { - if ( - share->monitoring_kind[roop_count] && - spider->need_mons[roop_count] - ) { - *error_num = spider_ping_table_mon_from_table( - spider->wide_handler->trx, - spider->wide_handler->trx->thd, - share, - roop_count, - (uint32) share->monitoring_sid[roop_count], - share->table_name, - share->table_name_length, - spider->conn_link_idx[roop_count], - NULL, - 0, - share->monitoring_kind[roop_count], - share->monitoring_limit[roop_count], - share->monitoring_flag[roop_count], - FALSE - ); - } - share->init_error = TRUE; - share->init_error_time = (time_t) time((time_t*) 0); - share->init = TRUE; - goto error_after_alloc_dbton_handler; - } - spider->conns[roop_count]->error_mode &= spider->error_mode; - } - } - search_link_idx = spider_conn_first_link_idx(thd, - share->link_statuses, share->access_balances, spider->conn_link_idx, - share->link_count, SPIDER_LINK_STATUS_OK); - if (search_link_idx == -1) - { - char *db = (char *) my_alloca( - table_share->db.length + 1 + table_share->table_name.length + 1); - if (!db) - { - *error_num = HA_ERR_OUT_OF_MEM; - share->init_error = TRUE; - share->init_error_time = (time_t) time((time_t*) 0); - share->init = TRUE; - goto error_after_alloc_dbton_handler; - } - char *table_name = db + table_share->db.length + 1; - memcpy(db, table_share->db.str, table_share->db.length); - db[table_share->db.length] = '\0'; - memcpy(table_name, table_share->table_name.str, - table_share->table_name.length); - table_name[table_share->table_name.length] = '\0'; - my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM, - ER_SPIDER_ALL_LINKS_FAILED_STR, MYF(0), db, table_name); - my_afree(db); - *error_num = ER_SPIDER_ALL_LINKS_FAILED_NUM; - share->init_error = TRUE; - share->init_error_time = (time_t) time((time_t*) 0); - share->init = TRUE; - goto error_after_alloc_dbton_handler; - } else if (search_link_idx == -2) - { - *error_num = HA_ERR_OUT_OF_MEM; - share->init_error = TRUE; - share->init_error_time = (time_t) time((time_t*) 0); - share->init = TRUE; - goto error_after_alloc_dbton_handler; - } - spider->search_link_idx = search_link_idx; - - same_server_link = spider_param_same_server_link(thd); - load_sts_at_startup = - spider_param_load_sts_at_startup(share->load_sts_at_startup); - load_crd_at_startup = - spider_param_load_crd_at_startup(share->load_crd_at_startup); - if ( - sql_command != SQLCOM_DROP_TABLE && - sql_command != SQLCOM_ALTER_TABLE && - sql_command != SQLCOM_SHOW_CREATE && - !spider->error_mode && - ( - !same_server_link || - load_sts_at_startup || - load_crd_at_startup - ) - ) { - SPIDER_INIT_ERROR_TABLE *spider_init_error_table; - sts_interval = spider_param_sts_interval(thd, share->sts_interval); - sts_mode = spider_param_sts_mode(thd, share->sts_mode); - sts_sync = spider_param_sts_sync(thd, share->sts_sync); - auto_increment_mode = spider_param_auto_increment_mode(thd, - share->auto_increment_mode); - if (auto_increment_mode == 1) - sts_sync = 0; - crd_interval = spider_param_crd_interval(thd, share->crd_interval); - crd_mode = spider_param_crd_mode(thd, share->crd_mode); - if (crd_mode == 3) - crd_mode = 1; - crd_sync = spider_param_crd_sync(thd, share->crd_sync); - time_t tmp_time = (time_t) time((time_t*) 0); - pthread_mutex_lock(&share->sts_mutex); - pthread_mutex_lock(&share->crd_mutex); - if ((spider_init_error_table = - spider_get_init_error_table(spider->wide_handler->trx, share, FALSE))) - { - DBUG_PRINT("info",("spider diff1=%f", - difftime(tmp_time, spider_init_error_table->init_error_time))); - if (difftime(tmp_time, - spider_init_error_table->init_error_time) < - spider_param_table_init_error_interval()) - { - *error_num = spider_init_error_table->init_error; - if (spider_init_error_table->init_error_with_message) - my_message(spider_init_error_table->init_error, - spider_init_error_table->init_error_msg, MYF(0)); - share->init_error = TRUE; - share->init = TRUE; - pthread_mutex_unlock(&share->crd_mutex); - pthread_mutex_unlock(&share->sts_mutex); - goto error_after_alloc_dbton_handler; - } - } - - if ( - ( - !same_server_link || - load_sts_at_startup - ) && - (*error_num = spider_get_sts(share, spider->search_link_idx, tmp_time, - spider, sts_interval, sts_mode, - sts_sync, - 1, HA_STATUS_VARIABLE | HA_STATUS_CONST | HA_STATUS_AUTO)) - ) { - if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM) - { - thd->clear_error(); - } else { - pthread_mutex_unlock(&share->crd_mutex); - pthread_mutex_unlock(&share->sts_mutex); - share->init_error = TRUE; - share->init_error_time = (time_t) time((time_t*) 0); - share->init = TRUE; - goto error_after_alloc_dbton_handler; - } - } - if ( - ( - !same_server_link || - load_crd_at_startup - ) && - (*error_num = spider_get_crd(share, spider->search_link_idx, tmp_time, - spider, table, crd_interval, crd_mode, - crd_sync, - 1)) - ) { - if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM) - { - thd->clear_error(); - } else { - pthread_mutex_unlock(&share->crd_mutex); - pthread_mutex_unlock(&share->sts_mutex); - share->init_error = TRUE; - share->init_error_time = (time_t) time((time_t*) 0); - share->init = TRUE; - goto error_after_alloc_dbton_handler; - } - } - pthread_mutex_unlock(&share->crd_mutex); - pthread_mutex_unlock(&share->sts_mutex); - } + if (spider_init_share(table_name, table, thd, spider, error_num, share, + table_share, TRUE)) + DBUG_RETURN(NULL); share->init = TRUE; - } else { + } else + { share->use_count++; pthread_mutex_unlock(&spider_tbl_mutex); @@ -5116,452 +5278,23 @@ SPIDER_SHARE *spider_get_share( ER_SPIDER_TABLE_OPEN_TIMEOUT_STR, MYF(0), table_share->db.str, table_share->table_name.str); spider_free_share(share); - goto error_but_no_delete; + DBUG_RETURN(NULL); } my_sleep(10000); // wait 10 ms } - if (!share->link_status_init) - { - pthread_mutex_lock(&share->mutex); - for (roop_count = 0; - roop_count < (int) spider_udf_table_mon_mutex_count; - roop_count++ - ) { - if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count)) - pthread_mutex_lock(&spider_udf_table_mon_mutexes[roop_count]); - } - if (!share->link_status_init) - { - DBUG_ASSERT(!table_tables); - /* - The link statuses need to be refreshed from the spider_tables table - if the operation: - - Is not a DROP TABLE on a permanent table; or - - Is an ALTER TABLE. - - Note that SHOW CREATE TABLE is not excluded, because the commands - that follow it require up-to-date link statuses. - */ - if ((table_share->tmp_table == NO_TMP_TABLE && - sql_command != SQLCOM_DROP_TABLE) || - /* for alter change link status */ - sql_command == SQLCOM_ALTER_TABLE) - { - SPD_INIT_ALLOC_ROOT(&mem_root, 4096, 0, MYF(MY_WME)); - init_mem_root = TRUE; - - if ( - !(table_tables = spider_open_sys_table( - thd, SPIDER_SYS_TABLES_TABLE_NAME_STR, - SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, &open_tables_backup, - error_num)) - ) { - for (roop_count = 0; - roop_count < (int) spider_udf_table_mon_mutex_count; - roop_count++ - ) { - if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count)) - pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]); - } - pthread_mutex_unlock(&share->mutex); - spider_free_share(share); - goto error_open_sys_table; - } - *error_num = spider_get_link_statuses(table_tables, share, - &mem_root); - if (*error_num) - { - if ( - *error_num != HA_ERR_KEY_NOT_FOUND && - *error_num != HA_ERR_END_OF_FILE - ) { - for (roop_count = 0; - roop_count < (int) spider_udf_table_mon_mutex_count; - roop_count++ - ) { - if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count)) - pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]); - } - pthread_mutex_unlock(&share->mutex); - spider_free_share(share); - spider_sys_close_table(thd, &open_tables_backup); - table_tables = NULL; - goto error_open_sys_table; - } - } else { - memcpy(share->alter_table.tmp_link_statuses, share->link_statuses, - sizeof(long) * share->all_link_count); - share->link_status_init = TRUE; - } - spider_sys_close_table(thd, &open_tables_backup); - table_tables = NULL; - } - share->have_recovery_link = spider_conn_check_recovery_link(share); - if (init_mem_root) - { - free_root(&mem_root, MYF(0)); - init_mem_root = FALSE; - } - } - for (roop_count = 0; - roop_count < (int) spider_udf_table_mon_mutex_count; - roop_count++ - ) { - if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count)) - pthread_mutex_unlock(&spider_udf_table_mon_mutexes[roop_count]); - } - pthread_mutex_unlock(&share->mutex); - } - - semi_table_lock_conn = spider_param_semi_table_lock_connection(thd, - share->semi_table_lock_conn); - if (semi_table_lock_conn) - first_byte = '0' + - spider_param_semi_table_lock(thd, share->semi_table_lock); - else - first_byte = '0'; - - spider->share = share; - if (!(spider->wide_handler->trx = spider_get_trx(thd, TRUE, error_num))) - { - spider_free_share(share); - goto error_but_no_delete; - } - spider->set_error_mode(); - - if (!share->sts_spider_init) - { - pthread_mutex_lock(&share->mutex); - if (!share->sts_spider_init) - { - if ((*error_num = spider_create_spider_object_for_share( - spider->wide_handler->trx, share, &share->sts_spider))) - { - pthread_mutex_unlock(&share->mutex); - spider_free_share(share); - goto error_sts_spider_init; - } - share->sts_thread = &spider_table_sts_threads[ - my_calc_hash(&spider_open_tables, (uchar*) table_name, length) % - spider_param_table_sts_thread_count()]; - share->sts_spider_init = TRUE; - } - pthread_mutex_unlock(&share->mutex); - } - - if (!share->crd_spider_init) - { - pthread_mutex_lock(&share->mutex); - if (!share->crd_spider_init) - { - if ((*error_num = spider_create_spider_object_for_share( - spider->wide_handler->trx, share, &share->crd_spider))) - { - pthread_mutex_unlock(&share->mutex); - spider_free_share(share); - goto error_crd_spider_init; - } - share->crd_thread = &spider_table_crd_threads[ - my_calc_hash(&spider_open_tables, (uchar*) table_name, length) % - spider_param_table_crd_thread_count()]; - share->crd_spider_init = TRUE; - } - pthread_mutex_unlock(&share->mutex); - } - - if ( - sql_command != SQLCOM_DROP_TABLE && - sql_command != SQLCOM_ALTER_TABLE && - sql_command != SQLCOM_SHOW_CREATE && - (*error_num = spider_create_mon_threads(spider->wide_handler->trx, - share)) - ) { - spider_free_share(share); - goto error_but_no_delete; - } - - if (!(spider->conn_keys = (char **) - spider_bulk_alloc_mem(spider_current_trx, 49, - __func__, __FILE__, __LINE__, MYF(MY_WME | MY_ZEROFILL), - &spider->conn_keys, sizeof(char *) * share->link_count, - &tmp_name, sizeof(char) * share->conn_keys_charlen, - &spider->conns, sizeof(SPIDER_CONN *) * share->link_count, - &spider->conn_link_idx, sizeof(uint) * share->link_count, - &spider->conn_can_fo, sizeof(uchar) * share->link_bitmap_size, - &spider->connection_ids, sizeof(ulonglong) * share->link_count, - &spider->db_request_id, sizeof(ulonglong) * share->link_count, - &spider->db_request_phase, sizeof(uchar) * share->link_bitmap_size, - &spider->need_mons, sizeof(int) * share->link_count, - &spider->quick_targets, sizeof(void *) * share->link_count, - &result_list->upd_tmp_tbls, sizeof(TABLE *) * share->link_count, - &result_list->upd_tmp_tbl_prms, - sizeof(TMP_TABLE_PARAM) * share->link_count, - &result_list->tmp_table_join_first, - sizeof(uchar) * share->link_bitmap_size, - &result_list->tmp_table_created, - sizeof(uchar) * share->link_bitmap_size, - &result_list->casual_read, sizeof(int) * share->link_count, - &spider->dbton_handler, - sizeof(spider_db_handler *) * SPIDER_DBTON_SIZE, - NullS)) - ) { - spider_free_share(share); - goto error_but_no_delete; - } - memcpy(tmp_name, share->conn_keys[0], share->conn_keys_charlen); - - spider->conn_keys_first_ptr = tmp_name; - for (roop_count = 0; roop_count < (int) share->link_count; roop_count++) - { - spider->conn_keys[roop_count] = tmp_name; - *tmp_name = first_byte; - tmp_name += share->conn_keys_lengths[roop_count] + 1; - result_list->upd_tmp_tbl_prms[roop_count].init(); - result_list->upd_tmp_tbl_prms[roop_count].field_count = 1; - } - spider_trx_set_link_idx_for_all(spider); - - for (roop_count = 0; roop_count < (int) share->use_dbton_count; - roop_count++) - { - uint dbton_id = share->use_dbton_ids[roop_count]; - if (!(spider->dbton_handler[dbton_id] = - spider_dbton[dbton_id].create_db_handler(spider, - share->dbton_share[dbton_id]))) - { - *error_num = HA_ERR_OUT_OF_MEM; - break; - } - if ((*error_num = spider->dbton_handler[dbton_id]->init())) - { - break; - } - } - if (roop_count < (int) share->use_dbton_count) - { - for (; roop_count >= 0; roop_count--) - { - uint dbton_id = share->use_dbton_ids[roop_count]; - if (spider->dbton_handler[dbton_id]) - { - delete spider->dbton_handler[dbton_id]; - spider->dbton_handler[dbton_id] = NULL; - } - } - goto error_after_alloc_conn_keys; - } - - if ( - sql_command != SQLCOM_DROP_TABLE && - sql_command != SQLCOM_ALTER_TABLE && - sql_command != SQLCOM_SHOW_CREATE - ) { - for ( - roop_count = spider_conn_link_idx_next(share->link_statuses, - spider->conn_link_idx, -1, share->link_count, - SPIDER_LINK_STATUS_RECOVERY); - roop_count < (int) share->link_count; - roop_count = spider_conn_link_idx_next(share->link_statuses, - spider->conn_link_idx, roop_count, share->link_count, - SPIDER_LINK_STATUS_RECOVERY) - ) { - if ( - !(spider->conns[roop_count] = - spider_get_conn(share, roop_count, spider->conn_keys[roop_count], - spider->wide_handler->trx, spider, FALSE, TRUE, - error_num)) - ) { - if ( - share->monitoring_kind[roop_count] && - spider->need_mons[roop_count] - ) { - *error_num = spider_ping_table_mon_from_table( - spider->wide_handler->trx, - spider->wide_handler->trx->thd, - share, - roop_count, - (uint32) share->monitoring_sid[roop_count], - share->table_name, - share->table_name_length, - spider->conn_link_idx[roop_count], - NULL, - 0, - share->monitoring_kind[roop_count], - share->monitoring_limit[roop_count], - share->monitoring_flag[roop_count], - FALSE - ); - } - goto error_after_alloc_dbton_handler; - } - spider->conns[roop_count]->error_mode &= spider->error_mode; - } - } - search_link_idx = spider_conn_first_link_idx(thd, - share->link_statuses, share->access_balances, spider->conn_link_idx, - share->link_count, SPIDER_LINK_STATUS_OK); - if (search_link_idx == -1) - { - char *db = (char *) my_alloca( - table_share->db.length + 1 + table_share->table_name.length + 1); - if (!db) - { - *error_num = HA_ERR_OUT_OF_MEM; - goto error_after_alloc_dbton_handler; - } - char *table_name = db + table_share->db.length + 1; - memcpy(db, table_share->db.str, table_share->db.length); - db[table_share->db.length] = '\0'; - memcpy(table_name, table_share->table_name.str, - table_share->table_name.length); - table_name[table_share->table_name.length] = '\0'; - my_printf_error(ER_SPIDER_ALL_LINKS_FAILED_NUM, - ER_SPIDER_ALL_LINKS_FAILED_STR, MYF(0), db, table_name); - my_afree(db); - *error_num = ER_SPIDER_ALL_LINKS_FAILED_NUM; - goto error_after_alloc_dbton_handler; - } else if (search_link_idx == -2) - { - *error_num = HA_ERR_OUT_OF_MEM; - goto error_after_alloc_dbton_handler; - } - spider->search_link_idx = search_link_idx; - - if (share->init_error) - { - pthread_mutex_lock(&share->sts_mutex); - pthread_mutex_lock(&share->crd_mutex); - if (share->init_error) - { - same_server_link = spider_param_same_server_link(thd); - load_sts_at_startup = - spider_param_load_sts_at_startup(share->load_sts_at_startup); - load_crd_at_startup = - spider_param_load_crd_at_startup(share->load_crd_at_startup); - if ( - sql_command != SQLCOM_DROP_TABLE && - sql_command != SQLCOM_ALTER_TABLE && - sql_command != SQLCOM_SHOW_CREATE && - !spider->error_mode && - ( - !same_server_link || - load_sts_at_startup || - load_crd_at_startup - ) - ) { - SPIDER_INIT_ERROR_TABLE *spider_init_error_table; - sts_interval = spider_param_sts_interval(thd, share->sts_interval); - sts_mode = spider_param_sts_mode(thd, share->sts_mode); - sts_sync = spider_param_sts_sync(thd, share->sts_sync); - auto_increment_mode = spider_param_auto_increment_mode(thd, - share->auto_increment_mode); - if (auto_increment_mode == 1) - sts_sync = 0; - crd_interval = spider_param_crd_interval(thd, share->crd_interval); - crd_mode = spider_param_crd_mode(thd, share->crd_mode); - if (crd_mode == 3) - crd_mode = 1; - crd_sync = spider_param_crd_sync(thd, share->crd_sync); - time_t tmp_time = (time_t) time((time_t*) 0); - if ((spider_init_error_table = - spider_get_init_error_table(spider->wide_handler->trx, share, - FALSE))) - { - DBUG_PRINT("info",("spider diff2=%f", - difftime(tmp_time, spider_init_error_table->init_error_time))); - if (difftime(tmp_time, - spider_init_error_table->init_error_time) < - spider_param_table_init_error_interval()) - { - *error_num = spider_init_error_table->init_error; - if (spider_init_error_table->init_error_with_message) - my_message(spider_init_error_table->init_error, - spider_init_error_table->init_error_msg, MYF(0)); - pthread_mutex_unlock(&share->crd_mutex); - pthread_mutex_unlock(&share->sts_mutex); - goto error_after_alloc_dbton_handler; - } - } - - if ( - ( - !same_server_link || - load_sts_at_startup - ) && - (*error_num = spider_get_sts(share, spider->search_link_idx, - tmp_time, spider, sts_interval, sts_mode, - sts_sync, - 1, HA_STATUS_VARIABLE | HA_STATUS_CONST | HA_STATUS_AUTO)) - ) { - if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM) - { - thd->clear_error(); - } else { - pthread_mutex_unlock(&share->crd_mutex); - pthread_mutex_unlock(&share->sts_mutex); - goto error_after_alloc_dbton_handler; - } - } - if ( - ( - !same_server_link || - load_crd_at_startup - ) && - (*error_num = spider_get_crd(share, spider->search_link_idx, - tmp_time, spider, table, crd_interval, crd_mode, - crd_sync, - 1)) - ) { - if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM) - { - thd->clear_error(); - } else { - pthread_mutex_unlock(&share->crd_mutex); - pthread_mutex_unlock(&share->sts_mutex); - goto error_after_alloc_dbton_handler; - } - } - } - share->init_error = FALSE; - } - pthread_mutex_unlock(&share->crd_mutex); - pthread_mutex_unlock(&share->sts_mutex); - } + if (spider_init_share(table_name, table, thd, spider, error_num, share, + table_share, FALSE)) + DBUG_RETURN(NULL); } DBUG_PRINT("info",("spider share=%p", share)); DBUG_RETURN(share); -error_after_alloc_dbton_handler: - for (roop_count = 0; roop_count < (int) share->use_dbton_count; ++roop_count) - { - uint dbton_id = share->use_dbton_ids[roop_count]; - if (spider->dbton_handler[dbton_id]) - { - delete spider->dbton_handler[dbton_id]; - spider->dbton_handler[dbton_id] = NULL; - } - } -error_after_alloc_conn_keys: - spider_free(spider_current_trx, spider->conn_keys, MYF(0)); - spider->conn_keys = NULL; - spider_free_share(share); - goto error_but_no_delete; - error_hash_insert: spider_free_share_resource_only(share); error_alloc_share: pthread_mutex_unlock(&spider_tbl_mutex); -error_open_sys_table: -error_crd_spider_init: -error_sts_spider_init: - if (init_mem_root) - { - free_root(&mem_root, MYF(0)); - init_mem_root = FALSE; - } -error_but_no_delete: DBUG_RETURN(NULL); } @@ -5877,46 +5610,6 @@ int spider_free_wide_share( DBUG_RETURN(0); } -void spider_copy_sts_to_wide_share( - SPIDER_WIDE_SHARE *wide_share, - SPIDER_SHARE *share -) { - DBUG_ENTER("spider_copy_sts_to_pt_share"); - wide_share->stat = share->stat; - DBUG_VOID_RETURN; -} - -void spider_copy_sts_to_share( - SPIDER_SHARE *share, - SPIDER_WIDE_SHARE *wide_share -) { - DBUG_ENTER("spider_copy_sts_to_share"); - share->stat = wide_share->stat; - DBUG_VOID_RETURN; -} - -void spider_copy_crd_to_wide_share( - SPIDER_WIDE_SHARE *wide_share, - SPIDER_SHARE *share, - int fields -) { - DBUG_ENTER("spider_copy_crd_to_wide_share"); - memcpy(wide_share->cardinality, share->cardinality, - sizeof(longlong) * fields); - DBUG_VOID_RETURN; -} - -void spider_copy_crd_to_share( - SPIDER_SHARE *share, - SPIDER_WIDE_SHARE *wide_share, - int fields -) { - DBUG_ENTER("spider_copy_crd_to_share"); - memcpy(share->cardinality, wide_share->cardinality, - sizeof(longlong) * fields); - DBUG_VOID_RETURN; -} - int spider_open_all_tables( SPIDER_TRX *trx, bool lock @@ -6515,7 +6208,7 @@ int spider_db_init( void *p ) { int error_num = HA_ERR_OUT_OF_MEM, roop_count; - uint dbton_id = 0; + uint dbton_id; uchar addr[6]; handlerton *spider_hton = (handlerton *)p; DBUG_ENTER("spider_db_init"); @@ -6795,6 +6488,8 @@ int spider_db_init( } } + /** Populates `spider_dbton` with available `SPIDER_DBTON`s */ + dbton_id = 0; spider_dbton_mysql.dbton_id = dbton_id; spider_dbton_mysql.db_util->dbton_id = dbton_id; spider_dbton[dbton_id] = spider_dbton_mysql; @@ -6803,15 +6498,11 @@ int spider_db_init( spider_dbton_mariadb.db_util->dbton_id = dbton_id; spider_dbton[dbton_id] = spider_dbton_mariadb; ++dbton_id; - for (roop_count = 0; roop_count < SPIDER_DBTON_SIZE; roop_count++) + for (roop_count = 0; roop_count < (int) dbton_id; roop_count++) { - if (spider_dbton[roop_count].init) - { - if ((error_num = spider_dbton[roop_count].init())) - { + if (spider_dbton[roop_count].init && + (error_num = spider_dbton[roop_count].init())) goto error_init_dbton; - } - } } DBUG_RETURN(0); @@ -6819,9 +6510,7 @@ error_init_dbton: for (roop_count--; roop_count >= 0; roop_count--) { if (spider_dbton[roop_count].deinit) - { spider_dbton[roop_count].deinit(); - } } roop_count = spider_param_table_crd_thread_count() - 1; error_init_table_crd_threads: @@ -7067,6 +6756,33 @@ void spider_get_partition_info( DBUG_VOID_RETURN; } +/** Determines the get type for spider_get_sts() */ +enum ha_sts_crd_get_type spider_get_sts_type( + SPIDER_SHARE *share, + double sts_interval, + int sts_sync +) { + if (sts_sync == 0) + return HA_GET_FETCH; + if (!share->wide_share->sts_init) + { + pthread_mutex_lock(&share->wide_share->sts_mutex); + if (!share->wide_share->sts_init) + return HA_GET_AFTER_LOCK; + pthread_mutex_unlock(&share->wide_share->sts_mutex); + return HA_GET_COPY; + } + if (difftime(share->sts_get_time, share->wide_share->sts_get_time) < + sts_interval) + return HA_GET_COPY; + if (!pthread_mutex_trylock(&share->wide_share->sts_mutex)) + return HA_GET_AFTER_TRYLOCK; + return HA_GET_COPY; +} + +/** + Populates share->stat or share->wide_share->stat with table status. +*/ int spider_get_sts( SPIDER_SHARE *share, int link_idx, @@ -7078,85 +6794,50 @@ int spider_get_sts( int sts_sync_level, uint flag ) { - int get_type; int error_num = 0; bool need_to_get = TRUE; DBUG_ENTER("spider_get_sts"); - if ( - sts_sync == 0 - ) { - /* get */ - get_type = 1; - } else if ( - !share->wide_share->sts_init - ) { - pthread_mutex_lock(&share->wide_share->sts_mutex); - if (!share->wide_share->sts_init) - { - /* get after mutex_lock */ - get_type = 2; - } else { - pthread_mutex_unlock(&share->wide_share->sts_mutex); - /* copy */ - get_type = 0; - } - } else if ( - difftime(share->sts_get_time, share->wide_share->sts_get_time) < - sts_interval - ) { - /* copy */ - get_type = 0; - } else if ( - !pthread_mutex_trylock(&share->wide_share->sts_mutex) - ) { - /* get after mutex_trylock */ - get_type = 3; - } else { - /* copy */ - get_type = 0; - } - if ( - !share->sts_init && - share->table_share->tmp_table == NO_TMP_TABLE && - spider_param_load_sts_at_startup(share->load_sts_at_startup) && - (!share->init || share->init_error) - ) { + enum ha_sts_crd_get_type get_type = + spider_get_sts_type(share, sts_interval, sts_sync); + if (!share->sts_init && + share->table_share->tmp_table == NO_TMP_TABLE && + spider_param_load_sts_at_startup(share->load_sts_at_startup) && + (!share->init || share->init_error)) + { error_num = spider_sys_get_table_sts( current_thd, share->lgtm_tblhnd_share->table_name, share->lgtm_tblhnd_share->table_name_length, - &share->stat - ); - if ( - !error_num || - (error_num != HA_ERR_KEY_NOT_FOUND && error_num != HA_ERR_END_OF_FILE) - ) + &share->stat); + if (!error_num || + (error_num != HA_ERR_KEY_NOT_FOUND && error_num != HA_ERR_END_OF_FILE)) need_to_get = FALSE; } if (need_to_get) { - if (get_type == 0) - spider_copy_sts_to_share(share, share->wide_share); - else { + if (get_type == HA_GET_COPY) + share->stat = share->wide_share->stat; + else + /* Executes a `show table status` query and store the results in + share->stat */ error_num = spider_db_show_table_status(spider, link_idx, sts_mode, flag); - } } - if (get_type >= 2) + if (get_type >= HA_GET_AFTER_LOCK) pthread_mutex_unlock(&share->wide_share->sts_mutex); + if (error_num) { SPIDER_PARTITION_HANDLER *partition_handler = spider->partition_handler; - if ( - !share->wide_share->sts_init && - sts_sync >= sts_sync_level && - get_type > 1 && - partition_handler && - partition_handler->handlers && - partition_handler->handlers[0] == spider - ) { + if (!share->wide_share->sts_init && + sts_sync >= sts_sync_level && + get_type > HA_GET_FETCH && + partition_handler && + partition_handler->handlers && + partition_handler->handlers[0] == spider) + { int roop_count; ha_spider *tmp_spider; SPIDER_SHARE *tmp_share; @@ -7165,24 +6846,23 @@ int spider_get_sts( int tmp_sts_sync; THD *thd = spider->wide_handler->trx->thd; for (roop_count = 1; - roop_count < (int) partition_handler->no_parts; - roop_count++) + roop_count < (int) partition_handler->no_parts; + roop_count++) { - tmp_spider = - (ha_spider *) partition_handler->handlers[roop_count]; + tmp_spider = (ha_spider *) partition_handler->handlers[roop_count]; tmp_share = tmp_spider->share; tmp_sts_interval = spider_param_sts_interval(thd, share->sts_interval); tmp_sts_mode = spider_param_sts_mode(thd, share->sts_mode); tmp_sts_sync = spider_param_sts_sync(thd, share->sts_sync); - spider_get_sts(tmp_share, tmp_spider->search_link_idx, - tmp_time, tmp_spider, tmp_sts_interval, tmp_sts_mode, tmp_sts_sync, - 1, flag); + spider_get_sts(tmp_share, tmp_spider->search_link_idx, tmp_time, + tmp_spider, tmp_sts_interval, tmp_sts_mode, + tmp_sts_sync, 1, flag); if (share->wide_share->sts_init) { error_num = 0; thd->clear_error(); - get_type = 0; - spider_copy_sts_to_share(share, share->wide_share); + get_type = HA_GET_COPY; + share->stat = share->wide_share->stat; break; } } @@ -7190,9 +6870,10 @@ int spider_get_sts( if (error_num) DBUG_RETURN(error_num); } - if (sts_sync >= sts_sync_level && get_type > 0) + + if (sts_sync >= sts_sync_level && get_type > HA_GET_COPY) { - spider_copy_sts_to_wide_share(share->wide_share, share); + share->wide_share->stat = share->stat; share->wide_share->sts_get_time = tmp_time; share->wide_share->sts_init = TRUE; } @@ -7201,6 +6882,34 @@ int spider_get_sts( DBUG_RETURN(0); } +/** Determines the get type for spider_get_crd() */ +enum ha_sts_crd_get_type spider_get_crd_type( + SPIDER_SHARE *share, + double crd_interval, + int crd_sync +) { + if (crd_sync == 0) + return HA_GET_FETCH; + if (!share->wide_share->crd_init) + { + pthread_mutex_lock(&share->wide_share->crd_mutex); + if (!share->wide_share->crd_init) + return HA_GET_AFTER_LOCK; + pthread_mutex_unlock(&share->wide_share->crd_mutex); + return HA_GET_COPY; + } + if (difftime(share->crd_get_time, share->wide_share->crd_get_time) < + crd_interval) + return HA_GET_COPY; + if (!pthread_mutex_trylock(&share->wide_share->crd_mutex)) + return HA_GET_AFTER_TRYLOCK; + return HA_GET_COPY; +} + +/** + Populates share->cardinality or share->wide_share->cardinality with + table index +*/ int spider_get_crd( SPIDER_SHARE *share, int link_idx, @@ -7212,86 +6921,47 @@ int spider_get_crd( int crd_sync, int crd_sync_level ) { - int get_type; int error_num = 0; bool need_to_get = TRUE; DBUG_ENTER("spider_get_crd"); - if ( - crd_sync == 0 - ) { - /* get */ - get_type = 1; - } else if ( - !share->wide_share->crd_init - ) { - pthread_mutex_lock(&share->wide_share->crd_mutex); - if (!share->wide_share->crd_init) - { - /* get after mutex_lock */ - get_type = 2; - } else { - pthread_mutex_unlock(&share->wide_share->crd_mutex); - /* copy */ - get_type = 0; - } - } else if ( - difftime(share->crd_get_time, share->wide_share->crd_get_time) < - crd_interval - ) { - /* copy */ - get_type = 0; - } else if ( - !pthread_mutex_trylock(&share->wide_share->crd_mutex) - ) { - /* get after mutex_trylock */ - get_type = 3; - } else { - /* copy */ - get_type = 0; - } - if ( - !share->crd_init && - share->table_share->tmp_table == NO_TMP_TABLE && - spider_param_load_sts_at_startup(share->load_crd_at_startup) - ) { + enum ha_sts_crd_get_type get_type = + spider_get_crd_type(share, crd_interval, crd_sync); + if (!share->crd_init && + share->table_share->tmp_table == NO_TMP_TABLE && + spider_param_load_sts_at_startup(share->load_crd_at_startup)) + { error_num = spider_sys_get_table_crd( current_thd, share->lgtm_tblhnd_share->table_name, share->lgtm_tblhnd_share->table_name_length, share->cardinality, - table->s->fields - ); - if ( - !error_num || - (error_num != HA_ERR_KEY_NOT_FOUND && error_num != HA_ERR_END_OF_FILE) - ) + table->s->fields); + if (!error_num || + (error_num != HA_ERR_KEY_NOT_FOUND && error_num != HA_ERR_END_OF_FILE)) need_to_get = FALSE; } if (need_to_get) { - if (get_type == 0) - spider_copy_crd_to_share(share, share->wide_share, - table->s->fields); - else { + if (get_type == HA_GET_COPY) + memcpy(share->cardinality, share->wide_share->cardinality, + sizeof(longlong) * table->s->fields); + else error_num = spider_db_show_index(spider, link_idx, table, crd_mode); - } } - if (get_type >= 2) + if (get_type >= HA_GET_AFTER_LOCK) pthread_mutex_unlock(&share->wide_share->crd_mutex); if (error_num) { - SPIDER_PARTITION_HANDLER *partition_handler = - spider->partition_handler; - if ( - !share->wide_share->crd_init && - crd_sync >= crd_sync_level && - get_type > 1 && - partition_handler && - partition_handler->handlers && - partition_handler->handlers[0] == spider - ) { + SPIDER_PARTITION_HANDLER *partition_handler = spider->partition_handler; + if (!share->wide_share->crd_init && + crd_sync >= crd_sync_level && + get_type > HA_GET_FETCH && + partition_handler && + partition_handler->handlers && + partition_handler->handlers[0] == spider) + { int roop_count; ha_spider *tmp_spider; SPIDER_SHARE *tmp_share; @@ -7300,25 +6970,24 @@ int spider_get_crd( int tmp_crd_sync; THD *thd = spider->wide_handler->trx->thd; for (roop_count = 1; - roop_count < (int) partition_handler->no_parts; - roop_count++) + roop_count < (int) partition_handler->no_parts; + roop_count++) { - tmp_spider = - (ha_spider *) partition_handler->handlers[roop_count]; + tmp_spider = (ha_spider *) partition_handler->handlers[roop_count]; tmp_share = tmp_spider->share; tmp_crd_interval = spider_param_crd_interval(thd, share->crd_interval); tmp_crd_mode = spider_param_crd_mode(thd, share->crd_mode); tmp_crd_sync = spider_param_crd_sync(thd, share->crd_sync); - spider_get_crd(tmp_share, tmp_spider->search_link_idx, - tmp_time, tmp_spider, table, tmp_crd_interval, tmp_crd_mode, - tmp_crd_sync, 1); + spider_get_crd(tmp_share, tmp_spider->search_link_idx, tmp_time, + tmp_spider, table, tmp_crd_interval, tmp_crd_mode, + tmp_crd_sync, 1); if (share->wide_share->crd_init) { error_num = 0; thd->clear_error(); - get_type = 0; - spider_copy_crd_to_share(share, share->wide_share, - table->s->fields); + get_type = HA_GET_COPY; + memcpy(share->cardinality, share->wide_share->cardinality, + sizeof(longlong) * table->s->fields); break; } } @@ -7326,10 +6995,10 @@ int spider_get_crd( if (error_num) DBUG_RETURN(error_num); } - if (crd_sync >= crd_sync_level && get_type > 0) + if (crd_sync >= crd_sync_level && get_type > HA_GET_COPY) { - spider_copy_crd_to_wide_share(share->wide_share, share, - table->s->fields); + memcpy(share->wide_share->cardinality, share->cardinality, + sizeof(longlong) * table->s->fields); share->wide_share->crd_get_time = tmp_time; share->wide_share->crd_init = TRUE; } @@ -7374,6 +7043,18 @@ void spider_set_result_list_param( DBUG_VOID_RETURN; } +/** + Gets or creates a `SPIDER_INIT_ERROR_TABLE` with the table name from + a given `SPIDER_SHARE` + + When creating, also add the newly created object to + `spider_init_error_tables` + + @param trx Transaction + @param share The spider share providing the table name + @param create Whether to create a new `SPIDER_INIT_ERROR_TABLE` if one wi th the required table name does not exist yet + @return A `SPIDER_INIT_ERROR_TABLE` or NULL if failure +*/ SPIDER_INIT_ERROR_TABLE *spider_get_init_error_table( SPIDER_TRX *trx, SPIDER_SHARE *share, @@ -7393,11 +7074,10 @@ SPIDER_INIT_ERROR_TABLE *spider_get_init_error_table( pthread_mutex_unlock(&spider_init_error_tbl_mutex); DBUG_RETURN(NULL); } - if (!(spider_init_error_table = (SPIDER_INIT_ERROR_TABLE *) - spider_bulk_malloc(spider_current_trx, 54, MYF(MY_WME | MY_ZEROFILL), + if (!spider_bulk_malloc(spider_current_trx, 54, MYF(MY_WME | MY_ZEROFILL), &spider_init_error_table, (uint) (sizeof(*spider_init_error_table)), &tmp_name, (uint) (share->table_name_length + 1), - NullS)) + NullS) ) { pthread_mutex_unlock(&spider_init_error_tbl_mutex); DBUG_RETURN(NULL); @@ -8404,6 +8084,7 @@ ulong spider_calc_for_sort( DBUG_RETURN(sort); } +/** Generates a random number between 0 and 1 */ double spider_rand( uint32 rand_source ) { diff --git a/storage/spider/spd_table.h b/storage/spider/spd_table.h index 9b6eecb9d56..b5c265aff9d 100644 --- a/storage/spider/spd_table.h +++ b/storage/spider/spd_table.h @@ -493,28 +493,6 @@ int spider_free_wide_share( SPIDER_WIDE_SHARE *wide_share ); -void spider_copy_sts_to_wide_share( - SPIDER_WIDE_SHARE *wide_share, - SPIDER_SHARE *share -); - -void spider_copy_sts_to_share( - SPIDER_SHARE *share, - SPIDER_WIDE_SHARE *wide_share -); - -void spider_copy_crd_to_wide_share( - SPIDER_WIDE_SHARE *wide_share, - SPIDER_SHARE *share, - int fields -); - -void spider_copy_crd_to_share( - SPIDER_SHARE *share, - SPIDER_WIDE_SHARE *wide_share, - int fields -); - int spider_open_all_tables( SPIDER_TRX *trx, bool lock diff --git a/storage/spider/spd_trx.cc b/storage/spider/spd_trx.cc index a6c5ea8f85a..3361f485d58 100644 --- a/storage/spider/spd_trx.cc +++ b/storage/spider/spd_trx.cc @@ -3872,46 +3872,59 @@ void spider_reuse_trx_ha( DBUG_VOID_RETURN; } +/** + Sets link indices for load balancing read connections + + Assuming `spider->share->link_count` is the number of active servers + to use, this function updates `spider->conn_link_idx` with the first + server in the same "modulus group" whose link status is not + `SPIDER_LINK_STATUS_NG`, or if one cannot be found, use the + `link_idx`th server +*/ void spider_trx_set_link_idx_for_all( ha_spider *spider ) { - int roop_count, roop_count2; SPIDER_SHARE *share = spider->share; long *link_statuses = share->link_statuses; uint *conn_link_idx = spider->conn_link_idx; - int link_count = share->link_count; - int all_link_count = share->all_link_count; + uint link_count = share->link_count; + uint all_link_count = share->all_link_count; uchar *conn_can_fo = spider->conn_can_fo; DBUG_ENTER("spider_trx_set_link_idx_for_all"); DBUG_PRINT("info",("spider set link_count=%d", link_count)); DBUG_PRINT("info",("spider set all_link_count=%d", all_link_count)); memset(conn_can_fo, 0, sizeof(uchar) * share->link_bitmap_size); - for (roop_count = 0; roop_count < link_count; roop_count++) + /* We change the name from roop_count and roop_count2 to link_idx + and all_link_idx because the latter are generally used in the + same context. */ + for (uint link_idx = 0; link_idx < link_count; link_idx++) { - for (roop_count2 = roop_count; roop_count2 < all_link_count; - roop_count2 += link_count) + uint all_link_idx; + for (all_link_idx = link_idx; all_link_idx < all_link_count; + all_link_idx += link_count) { - if (link_statuses[roop_count2] <= SPIDER_LINK_STATUS_RECOVERY) + if (link_statuses[all_link_idx] <= SPIDER_LINK_STATUS_RECOVERY) break; } - if (roop_count2 < all_link_count) + if (all_link_idx < all_link_count) { - conn_link_idx[roop_count] = roop_count2; - if (roop_count2 + link_count < all_link_count) - spider_set_bit(conn_can_fo, roop_count); + conn_link_idx[link_idx] = all_link_idx; + if (all_link_idx + link_count < all_link_count) + spider_set_bit(conn_can_fo, link_idx); DBUG_PRINT("info",("spider set conn_link_idx[%d]=%d", - roop_count, roop_count2)); - } else { - conn_link_idx[roop_count] = roop_count; + link_idx, all_link_idx)); + } else + { + conn_link_idx[link_idx] = link_idx; DBUG_PRINT("info",("spider set2 conn_link_idx[%d]=%d", - roop_count, roop_count)); + link_idx, link_idx)); } - spider->conn_keys[roop_count] = + spider->conn_keys[link_idx] = ADD_TO_PTR(spider->conn_keys_first_ptr, - PTR_BYTE_DIFF(share->conn_keys[conn_link_idx[roop_count]], + PTR_BYTE_DIFF(share->conn_keys[conn_link_idx[link_idx]], share->conn_keys[0]), char*); DBUG_PRINT("info",("spider conn_keys[%d]=%s", - roop_count, spider->conn_keys[roop_count])); + link_idx, spider->conn_keys[link_idx])); } DBUG_VOID_RETURN; } From 779307dd5b5de8a6eea9d5ce5db574e5d6a2f70b Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 27 Apr 2023 09:48:26 +1000 Subject: [PATCH 199/260] MDEV-29676 Some changes in behaviour w.r.t. spider sts crd - assign spider->share early when !new_share - remove locking before spider_share_init_{sts,crd} --- storage/spider/spd_table.cc | 64 +++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index 0a652b7473e..66042b36a66 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -5079,11 +5079,6 @@ bool spider_init_share( else first_byte = '0'; - /* fixme: do we need to assign spider->share at different places - depending on new_share? */ - if (!new_share) - spider->share = share; - if (!(spider->wide_handler->trx = spider_get_trx(thd, TRUE, error_num))) { spider_share_init_error_free(share, new_share, true); @@ -5091,23 +5086,17 @@ bool spider_init_share( } spider->set_error_mode(); - if (!share->sts_spider_init) - { - pthread_mutex_lock(&share->mutex); - if (!share->sts_spider_init && - (*error_num= spider_share_init_sts(table_name, spider, share, new_share))) + /* There's no other place doing anything that + `spider_share_init_sts()` does or updating + `st_spider_share::sts_spider_init`, therefore there's no need to + lock/unlock. Same goes for crd */ + if (!share->sts_spider_init && + (*error_num= spider_share_init_sts(table_name, spider, share, new_share))) DBUG_RETURN(TRUE); - pthread_mutex_unlock(&share->mutex); - } - if (!share->crd_spider_init) - { - pthread_mutex_lock(&share->mutex); - if (!share->crd_spider_init && - (*error_num= spider_share_init_crd(table_name, spider, share, new_share))) + if (!share->crd_spider_init && + (*error_num= spider_share_init_crd(table_name, spider, share, new_share))) DBUG_RETURN(TRUE); - pthread_mutex_unlock(&share->mutex); - } if (continue_with_sql_command && (*error_num = spider_create_mon_threads(spider->wide_handler->trx, @@ -5162,26 +5151,29 @@ bool spider_init_share( } spider->search_link_idx= search_link_idx; - if (new_share) + if (continue_with_sql_command) { - if (continue_with_sql_command && - spider_share_get_sts_crd(thd, spider, share, table, true, false, - error_num)) - goto error_after_alloc_dbton_handler; - } else if (share->init_error) - { - pthread_mutex_lock(&share->sts_mutex); - pthread_mutex_lock(&share->crd_mutex); - if (share->init_error) + if (new_share) { - if (continue_with_sql_command && - spider_share_get_sts_crd(thd, spider, share, table, FALSE, TRUE, - error_num)) + if (spider_share_get_sts_crd(thd, spider, share, table, true, false, + error_num)) goto error_after_alloc_dbton_handler; - share->init_error= FALSE; + } else if (share->init_error) + { + /* fixme: can we move the locking and unlocking into + spider_share_get_sts_crd()? */ + pthread_mutex_lock(&share->sts_mutex); + pthread_mutex_lock(&share->crd_mutex); + if (share->init_error) + { + if (spider_share_get_sts_crd(thd, spider, share, table, FALSE, TRUE, + error_num)) + goto error_after_alloc_dbton_handler; + share->init_error= FALSE; + } + pthread_mutex_unlock(&share->crd_mutex); + pthread_mutex_unlock(&share->sts_mutex); } - pthread_mutex_unlock(&share->crd_mutex); - pthread_mutex_unlock(&share->sts_mutex); } DBUG_RETURN(FALSE); @@ -5283,6 +5275,8 @@ SPIDER_SHARE *spider_get_share( my_sleep(10000); // wait 10 ms } + spider->share = share; + if (spider_init_share(table_name, table, thd, spider, error_num, share, table_share, FALSE)) DBUG_RETURN(NULL); From 6abafdbb7cb79aec4dda159f177948e1ea77b7aa Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 27 Apr 2023 09:51:34 +1000 Subject: [PATCH 200/260] MDEV-29676 Add query to set lock wait timeout when getting sts crd Set the lock wait timeout to 1 beforehand, and reset it afterwards, to avoid lock conflict caused by opening the same table twice in case of self-reference. --- .../mysql-test/spider/bugfix/disabled.def | 1 + .../spider/bugfix/r/mdev_29676.result | 47 +++++++++++ .../bugfix/r/slave_trx_isolation.result | 4 + .../spider/bugfix/t/mdev_29676.test | 41 ++++++++++ .../spider/r/slave_trx_isolation.result | 4 + storage/spider/spd_db_mysql.cc | 77 +++++++++++++++++++ storage/spider/spd_db_mysql.h | 6 ++ storage/spider/spd_err.h | 2 + storage/spider/spd_table.cc | 9 ++- 9 files changed, 188 insertions(+), 3 deletions(-) create mode 100644 storage/spider/mysql-test/spider/bugfix/r/mdev_29676.result create mode 100644 storage/spider/mysql-test/spider/bugfix/t/mdev_29676.test diff --git a/storage/spider/mysql-test/spider/bugfix/disabled.def b/storage/spider/mysql-test/spider/bugfix/disabled.def index e19ea07b76b..2314e88ea0c 100644 --- a/storage/spider/mysql-test/spider/bugfix/disabled.def +++ b/storage/spider/mysql-test/spider/bugfix/disabled.def @@ -1 +1,2 @@ wait_timeout : MDEV-26045 +mdev_29676 : MDEV-31138 diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29676.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29676.result new file mode 100644 index 00000000000..72c624c926b --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29676.result @@ -0,0 +1,47 @@ +# +# MDEV-29676 Dual thread hang in 'closing tables' and 'Waiting for table metadata lock' on Spider CREATE OR REPLACE TABLE +# +for master_1 +for child2 +for child3 +CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); + +# length-0 self-reference + +CREATE TABLE t (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t"'; +CREATE OR REPLACE TABLE t (c INT); +Warnings: +Error 1205 Lock wait timeout exceeded; try restarting transaction +Error 12722 Table test.t open lock wait timeout. Please check for self-reference. +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `c` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +DROP TABLE t; + +# length-2 self-reference + +CREATE TABLE t2 (c int); +CREATE TABLE t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"'; +CREATE TABLE t0 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t1"'; +ALTER TABLE t2 ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t0"'; +CREATE OR REPLACE TABLE t0 (c int); +Warnings: +Error 1205 Lock wait timeout exceeded; try restarting transaction +Error 12722 Table test.t1 open lock wait timeout. Please check for self-reference. +SHOW CREATE TABLE t0; +Table Create Table +t0 CREATE TABLE `t0` ( + `c` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +CREATE OR REPLACE TABLE t1 (c int); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +drop TABLE t0, t1, t2; +for master_1 +for child2 +for child3 diff --git a/storage/spider/mysql-test/spider/bugfix/r/slave_trx_isolation.result b/storage/spider/mysql-test/spider/bugfix/r/slave_trx_isolation.result index e84d42bbc8a..ffccf2d5ef1 100644 --- a/storage/spider/mysql-test/spider/bugfix/r/slave_trx_isolation.result +++ b/storage/spider/mysql-test/spider/bugfix/r/slave_trx_isolation.result @@ -50,6 +50,10 @@ SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argum argument set session time_zone = '+00:00';set @`spider_lc_./auto_test_remote/tbl_a` = '-xxxxxxxxxxxx-xxxxx-./auto_test_local/tbl_a-' SET NAMES utf8mb3 +set @old_lock_wait_timeout=@@session.lock_wait_timeout;set session lock_wait_timeout=1 +set session lock_wait_timeout=@old_lock_wait_timeout +set @old_lock_wait_timeout=@@session.lock_wait_timeout;set session lock_wait_timeout=1 +set session lock_wait_timeout=@old_lock_wait_timeout set session transaction isolation level read committed;set session autocommit = 1;set session wait_timeout = 604800;set session sql_mode = 'strict_trans_tables,error_for_division_by_zero,no_auto_create_user,no_engine_substitution';start transaction SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%set %' SELECT pkey FROM tbl_a ORDER BY pkey; diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29676.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29676.test new file mode 100644 index 00000000000..565d95dfaac --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29676.test @@ -0,0 +1,41 @@ +--echo # +--echo # MDEV-29676 Dual thread hang in 'closing tables' and 'Waiting for table metadata lock' on Spider CREATE OR REPLACE TABLE +--echo # + +--disable_query_log +--disable_result_log +--source ../../t/test_init.inc +--enable_result_log +--enable_query_log + +--replace_regex /SOCKET ".*"/SOCKET "$MASTER_1_MYSOCK"/ +eval CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); + +--echo +--echo # length-0 self-reference +--echo +CREATE TABLE t (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t"'; +CREATE OR REPLACE TABLE t (c INT); +SHOW CREATE TABLE t; +DROP TABLE t; + +--echo +--echo # length-2 self-reference +--echo +CREATE TABLE t2 (c int); +CREATE TABLE t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"'; +CREATE TABLE t0 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t1"'; +ALTER TABLE t2 ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv",TABLE "t0"'; +# warnings +CREATE OR REPLACE TABLE t0 (c int); +SHOW CREATE TABLE t0; +# no warnings +CREATE OR REPLACE TABLE t1 (c int); +SHOW CREATE TABLE t1; +drop TABLE t0, t1, t2; + +--disable_query_log +--disable_result_log +--source ../../t/test_deinit.inc +--enable_result_log +--enable_query_log diff --git a/storage/spider/mysql-test/spider/r/slave_trx_isolation.result b/storage/spider/mysql-test/spider/r/slave_trx_isolation.result index 28aaf74fa3d..c48d68758bf 100644 --- a/storage/spider/mysql-test/spider/r/slave_trx_isolation.result +++ b/storage/spider/mysql-test/spider/r/slave_trx_isolation.result @@ -53,6 +53,10 @@ SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argum argument set session time_zone = '+00:00';set @`spider_lc_./auto_test_remote/tbl_a` = '-xxxxxxxxxxxx-xxxxx-./auto_test_local/tbl_a-' SET NAMES utf8mb3 +set @old_lock_wait_timeout=@@session.lock_wait_timeout;set session lock_wait_timeout=1 +set session lock_wait_timeout=@old_lock_wait_timeout +set @old_lock_wait_timeout=@@session.lock_wait_timeout;set session lock_wait_timeout=1 +set session lock_wait_timeout=@old_lock_wait_timeout set session transaction isolation level read committed;set session autocommit = 1;set session wait_timeout = 604800;set session sql_mode = 'strict_trans_tables,error_for_division_by_zero,no_auto_create_user,no_engine_substitution';start transaction SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%set %' SELECT pkey FROM tbl_a ORDER BY pkey; diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc index f376ae3037f..555ab33d777 100644 --- a/storage/spider/spd_db_mysql.cc +++ b/storage/spider/spd_db_mysql.cc @@ -13443,6 +13443,56 @@ int spider_mbase_handler::sts_mode_exchange( DBUG_RETURN(sts_mode); } +/** Set the session lock wait time out */ +int spider_db_mbase::set_lock_wait_timeout(uint timeout) +{ + String query(0); + int error_num; + DBUG_ENTER("spider_db_set_lock_wait_timeout"); + query.append(STRING_WITH_LEN( + "set @old_lock_wait_timeout=@@session.lock_wait_timeout;" + "set session lock_wait_timeout=")); + query.append_ulonglong(timeout); + query.append(STRING_WITH_LEN(";")); + if ((error_num = exec_query(query.c_ptr(), query.length(), -1))) + DBUG_RETURN(error_num); + spider_db_result *result; + do { + st_spider_db_request_key request_key= {1, 1, NULL, 1, NULL}; + if ((result = conn->db_conn->store_result(NULL, &request_key, + &error_num))) + { + result->free_result(); + delete result; + } else if ((error_num = conn->db_conn->get_errno())) + break; + } while (!(error_num = conn->db_conn->next_result())); + DBUG_RETURN(0); +} + +/** Reset the session lock wait time out */ +int spider_db_mbase::reset_lock_wait_timeout() +{ + const LEX_CSTRING query = {STRING_WITH_LEN( + "set session lock_wait_timeout=@old_lock_wait_timeout;")}; + int error_num; + DBUG_ENTER("spider_db_set_lock_wait_timeout"); + if ((error_num = exec_query(query.str, query.length, -1))) + DBUG_RETURN(error_num); + spider_db_result *result; + do { + st_spider_db_request_key request_key= {1, 1, NULL, 1, NULL}; + if ((result = conn->db_conn->store_result(NULL, &request_key, + &error_num))) + { + result->free_result(); + delete result; + } else if ((error_num = conn->db_conn->get_errno())) + break; + } while (!(error_num= conn->db_conn->next_result())); + DBUG_RETURN(0); +} + /** FIXME: refactor more functions to use spider_setup_for_query() and spider_teardown_after_query(). */ void spider_setup_for_query(ha_spider *spider, SPIDER_CONN *conn, int link_idx) @@ -13494,6 +13544,8 @@ int spider_mbase_handler::show_table_status( spider_conn_set_timeout_from_share( conn, link_idx, spider->wide_handler->trx->thd, share); if ((error_num = spider_db_set_names(spider, conn, link_idx)) || + (error_num = + ((spider_db_mbase *) conn->db_conn)->set_lock_wait_timeout(1)) || /* Executes the `show table status` query */ (spider_db_query( conn, @@ -13514,6 +13566,9 @@ int spider_mbase_handler::show_table_status( spider_conn_set_timeout_from_share(conn, link_idx, spider->wide_handler->trx->thd, share); + if ((error_num = + ((spider_db_mbase *) conn->db_conn)->set_lock_wait_timeout(1))) + DBUG_RETURN(spider_teardown_after_query(conn, error_num, true)); if (spider_db_query( conn, mysql_share->show_table_status[pos].ptr(), @@ -13590,8 +13645,21 @@ int spider_mbase_handler::show_table_status( } if ((error_num = ((spider_db_mbase *) conn->db_conn)->fetch_and_print_warnings(NULL))) { + ((spider_db_mbase *) conn->db_conn)->reset_lock_wait_timeout(); + if (error_num == ER_LOCK_WAIT_TIMEOUT) + { + error_num = ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_NUM; + my_printf_error( + ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_NUM, + ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_STR, MYF(0), + mysql_share->db_names_str[spider->conn_link_idx[link_idx]].ptr(), + mysql_share->table_names_str[spider->conn_link_idx[link_idx]].ptr()); + } DBUG_RETURN(error_num); } + if ((error_num = + ((spider_db_mbase *) conn->db_conn)->reset_lock_wait_timeout())) + DBUG_RETURN(error_num); if (share->static_records_for_status != -1) share->stat.records = (ha_rows) share->static_records_for_status; if (share->static_mean_rec_length != -1) @@ -13632,6 +13700,8 @@ int spider_mbase_handler::show_index( spider_conn_set_timeout_from_share(conn, link_idx, spider->wide_handler->trx->thd, share); if ((error_num = spider_db_set_names(spider, conn, link_idx)) || + (error_num = + ((spider_db_mbase *) conn->db_conn)->set_lock_wait_timeout(1)) || (spider_db_query( conn, mysql_share->show_index[pos].ptr(), @@ -13651,6 +13721,9 @@ int spider_mbase_handler::show_index( spider_conn_set_timeout_from_share(conn, link_idx, spider->wide_handler->trx->thd, share); + if ((error_num = + ((spider_db_mbase *) conn->db_conn)->set_lock_wait_timeout(1))) + DBUG_RETURN(spider_teardown_after_query(conn, error_num, true)); if (spider_db_query( conn, mysql_share->show_index[pos].ptr(), @@ -13711,6 +13784,10 @@ int spider_mbase_handler::show_index( default: break; } + if (!error_num) + error_num = ((spider_db_mbase *) conn->db_conn)->reset_lock_wait_timeout(); + else + ((spider_db_mbase *) conn->db_conn)->reset_lock_wait_timeout(); DBUG_RETURN(error_num); } diff --git a/storage/spider/spd_db_mysql.h b/storage/spider/spd_db_mysql.h index b1f30c22c00..35f4f8392d9 100644 --- a/storage/spider/spd_db_mysql.h +++ b/storage/spider/spd_db_mysql.h @@ -513,6 +513,12 @@ public: int wait_timeout, int *need_mon ); + + /** Set the global lock wait time out */ + int set_lock_wait_timeout(uint timeout); + /** Reset the global lock wait time out */ + int reset_lock_wait_timeout(); + bool set_sql_mode_in_bulk_sql(); int set_sql_mode( sql_mode_t sql_mode, diff --git a/storage/spider/spd_err.h b/storage/spider/spd_err.h index e9a4a41946e..e2098d4e751 100644 --- a/storage/spider/spd_err.h +++ b/storage/spider/spd_err.h @@ -134,6 +134,8 @@ #define ER_SPIDER_SAME_SERVER_LINK_STR2 "Host:%s and Port:%ld aim self server. Please change spider_same_server_link parameter if this link is required." #define ER_SPIDER_CANT_NUM 12721 #define ER_SPIDER_CANT_STR1 "Can't %s%d" +#define ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_NUM 12722 +#define ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_STR "Table %s.%s open lock wait timeout. Please check for self-reference." #define ER_SPIDER_COND_SKIP_NUM 12801 #define ER_SPIDER_UNKNOWN_NUM 12500 diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index 66042b36a66..943d781a171 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -5002,8 +5002,10 @@ bool spider_share_get_sts_crd( (*error_num = spider_get_sts(share, spider->search_link_idx, tmp_time, spider, sts_interval, sts_mode, sts_sync, 1, HA_STATUS_VARIABLE | HA_STATUS_CONST | HA_STATUS_AUTO)) - ) { - if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM) + ) + { + if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM && + *error_num != ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_NUM) thd->clear_error(); else { @@ -5020,7 +5022,8 @@ bool spider_share_get_sts_crd( crd_sync, 1))) { - if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM) + if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM && + *error_num != ER_SPIDER_TABLE_OPEN_LOCK_WAIT_TIMEOUT_NUM) thd->clear_error(); else { From adbad5e36f99f64eedbcc43f98215f5e52f10cad Mon Sep 17 00:00:00 2001 From: Oleg Smirnov Date: Tue, 25 Apr 2023 14:34:31 +0700 Subject: [PATCH 201/260] MDEV-31113 Server crashes in store_length / Type_handler_string_result::make_sort_key with DISTINCT and group function Fix-up for commit 476b24d084e7e717310155bb986eb086d3c1e1a6 Author: Monty Date: Thu Feb 16 14:19:33 2023 +0200 MDEV-20057 Distinct SUM on CROSS JOIN and grouped returns wrong result which misses initializing of sorder->suffix_length. In this commit the initialization is implemented by passing MY_ZEROFILL flag to the allocation of SORT_FIELD elements --- mysql-test/main/distinct.result | 14 ++++++++++++++ mysql-test/main/distinct.test | 13 +++++++++++++ sql/sql_select.cc | 3 +-- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/mysql-test/main/distinct.result b/mysql-test/main/distinct.result index 331b57faa27..82176386817 100644 --- a/mysql-test/main/distinct.result +++ b/mysql-test/main/distinct.result @@ -1093,6 +1093,7 @@ sum(distinct 1) sum(t1.d) > 5 c 1 1 0 1 0 5 1 1 6 +SET @sort_buffer_size_save= @@sort_buffer_size; set @@sort_buffer_size=1024; insert into t1 select -seq,-seq from seq_1_to_100; select distinct sum(distinct 1), sum(t1.d) > 2, length(group_concat(t1.d)) > 1000 from (t1 e join t1) group by t1.c having t1.c > -2 ; @@ -1106,4 +1107,17 @@ sum(distinct 1) sum(t1.d) > 2 length(group_concat(t1.d)) > 1000 c 1 1 0 5 1 1 0 6 drop table t1; +set @@sort_buffer_size=@sort_buffer_size_save; +# +# MDEV-31113 Server crashes in store_length / Type_handler_string_result::make_sort_key +# with DISTINCT and group function +# +CREATE TABLE t (f INT); +INSERT INTO t VALUES (1),(2); +SELECT DISTINCT CONVERT(STDDEV(f), CHAR(16)) AS f1, UUID() AS f2 FROM t GROUP BY f2 WITH ROLLUP; +f1 f2 +0.0000 # +0.0000 # +0.5000 # +DROP TABLE t; # End of 10.4 tests diff --git a/mysql-test/main/distinct.test b/mysql-test/main/distinct.test index a2a0f14e008..122034885bd 100644 --- a/mysql-test/main/distinct.test +++ b/mysql-test/main/distinct.test @@ -834,10 +834,23 @@ select distinct sum(distinct 1), sum(t1.d) > 5 from (t1 e join t1) group by t1.c select distinct sum(distinct 1), sum(t1.d) > 5, t1.c from (t1 e join t1) group by t1.c; # Force usage of remove_dup_with_compare() algorithm +SET @sort_buffer_size_save= @@sort_buffer_size; set @@sort_buffer_size=1024; insert into t1 select -seq,-seq from seq_1_to_100; select distinct sum(distinct 1), sum(t1.d) > 2, length(group_concat(t1.d)) > 1000 from (t1 e join t1) group by t1.c having t1.c > -2 ; select distinct sum(distinct 1), sum(t1.d) > 2, length(group_concat(t1.d)) > 1000,t1.c from (t1 e join t1) group by t1.c having t1.c > -2; drop table t1; +set @@sort_buffer_size=@sort_buffer_size_save; + +--echo # +--echo # MDEV-31113 Server crashes in store_length / Type_handler_string_result::make_sort_key +--echo # with DISTINCT and group function +--echo # + +CREATE TABLE t (f INT); +INSERT INTO t VALUES (1),(2); +--replace_column 2 # +SELECT DISTINCT CONVERT(STDDEV(f), CHAR(16)) AS f1, UUID() AS f2 FROM t GROUP BY f2 WITH ROLLUP; +DROP TABLE t; --echo # End of 10.4 tests diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 03a2c3d0853..56a185acdd5 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -24226,7 +24226,7 @@ JOIN_TAB::remove_duplicates() if (!(sortorder= (SORT_FIELD*) my_malloc((fields->elements+1) * sizeof(SORT_FIELD), - MYF(MY_WME)))) + MYF(MY_WME | MY_ZEROFILL)))) DBUG_RETURN(TRUE); /* Calculate how many saved fields there is in list */ @@ -24245,7 +24245,6 @@ JOIN_TAB::remove_duplicates() else { /* Item is not stored in temporary table, remember it */ - sorder->field= 0; // Safety, not used sorder->item= item; /* Calculate sorder->length */ item->type_handler()->sortlength(thd, item, sorder); From 512dbc45275a5b6813d07986c11782aaaabfab30 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Fri, 28 Apr 2023 08:09:26 +0200 Subject: [PATCH 202/260] 5.7.42 (only copyright year in all files changed) --- include/mysql/psi/mysql_file.h | 2 +- include/mysql/psi/mysql_idle.h | 2 +- include/mysql/psi/mysql_mdl.h | 2 +- include/mysql/psi/mysql_memory.h | 2 +- include/mysql/psi/mysql_ps.h | 2 +- include/mysql/psi/mysql_socket.h | 2 +- include/mysql/psi/mysql_sp.h | 2 +- include/mysql/psi/mysql_stage.h | 2 +- include/mysql/psi/mysql_statement.h | 2 +- include/mysql/psi/mysql_table.h | 2 +- include/mysql/psi/mysql_thread.h | 2 +- include/mysql/psi/mysql_transaction.h | 2 +- include/mysql/psi/psi.h | 2 +- include/mysql/psi/psi_abi_v0.h | 2 +- include/mysql/psi/psi_abi_v1.h | 2 +- include/mysql/psi/psi_abi_v2.h | 2 +- include/mysql/psi/psi_base.h | 2 +- include/mysql/psi/psi_memory.h | 2 +- storage/perfschema/CMakeLists.txt | 2 +- storage/perfschema/cursor_by_account.cc | 2 +- storage/perfschema/cursor_by_account.h | 2 +- storage/perfschema/cursor_by_host.cc | 2 +- storage/perfschema/cursor_by_host.h | 2 +- storage/perfschema/cursor_by_thread.cc | 2 +- storage/perfschema/cursor_by_thread.h | 2 +- storage/perfschema/cursor_by_thread_connect_attr.cc | 2 +- storage/perfschema/cursor_by_thread_connect_attr.h | 2 +- storage/perfschema/cursor_by_user.cc | 2 +- storage/perfschema/cursor_by_user.h | 2 +- storage/perfschema/ha_perfschema.cc | 2 +- storage/perfschema/ha_perfschema.h | 2 +- storage/perfschema/pfs.cc | 2 +- storage/perfschema/pfs.h | 2 +- storage/perfschema/pfs_account.cc | 2 +- storage/perfschema/pfs_account.h | 2 +- storage/perfschema/pfs_atomic.h | 2 +- storage/perfschema/pfs_autosize.cc | 2 +- storage/perfschema/pfs_buffer_container.cc | 2 +- storage/perfschema/pfs_buffer_container.h | 2 +- storage/perfschema/pfs_builtin_memory.cc | 2 +- storage/perfschema/pfs_builtin_memory.h | 2 +- storage/perfschema/pfs_check.cc | 2 +- storage/perfschema/pfs_column_types.h | 2 +- storage/perfschema/pfs_column_values.cc | 2 +- storage/perfschema/pfs_column_values.h | 2 +- storage/perfschema/pfs_con_slice.cc | 2 +- storage/perfschema/pfs_con_slice.h | 2 +- storage/perfschema/pfs_defaults.cc | 2 +- storage/perfschema/pfs_defaults.h | 2 +- storage/perfschema/pfs_digest.cc | 2 +- storage/perfschema/pfs_digest.h | 2 +- storage/perfschema/pfs_engine_table.cc | 2 +- storage/perfschema/pfs_engine_table.h | 2 +- storage/perfschema/pfs_events.h | 2 +- storage/perfschema/pfs_events_stages.cc | 2 +- storage/perfschema/pfs_events_stages.h | 2 +- storage/perfschema/pfs_events_statements.cc | 2 +- storage/perfschema/pfs_events_statements.h | 2 +- storage/perfschema/pfs_events_transactions.cc | 2 +- storage/perfschema/pfs_events_transactions.h | 2 +- storage/perfschema/pfs_events_waits.cc | 2 +- storage/perfschema/pfs_events_waits.h | 2 +- storage/perfschema/pfs_global.cc | 2 +- storage/perfschema/pfs_global.h | 2 +- storage/perfschema/pfs_host.cc | 2 +- storage/perfschema/pfs_host.h | 2 +- storage/perfschema/pfs_instr.cc | 2 +- storage/perfschema/pfs_instr.h | 2 +- storage/perfschema/pfs_instr_class.cc | 2 +- storage/perfschema/pfs_instr_class.h | 2 +- storage/perfschema/pfs_lock.h | 2 +- storage/perfschema/pfs_memory.cc | 2 +- storage/perfschema/pfs_memory.h | 2 +- storage/perfschema/pfs_prepared_stmt.cc | 2 +- storage/perfschema/pfs_prepared_stmt.h | 2 +- storage/perfschema/pfs_program.cc | 2 +- storage/perfschema/pfs_program.h | 2 +- storage/perfschema/pfs_server.cc | 2 +- storage/perfschema/pfs_server.h | 2 +- storage/perfschema/pfs_setup_actor.cc | 2 +- storage/perfschema/pfs_setup_actor.h | 2 +- storage/perfschema/pfs_setup_object.cc | 2 +- storage/perfschema/pfs_setup_object.h | 2 +- storage/perfschema/pfs_stat.h | 2 +- storage/perfschema/pfs_status.cc | 2 +- storage/perfschema/pfs_status.h | 2 +- storage/perfschema/pfs_timer.cc | 2 +- storage/perfschema/pfs_timer.h | 2 +- storage/perfschema/pfs_user.cc | 2 +- storage/perfschema/pfs_user.h | 2 +- storage/perfschema/pfs_variable.cc | 2 +- storage/perfschema/pfs_variable.h | 2 +- storage/perfschema/pfs_visitor.cc | 2 +- storage/perfschema/pfs_visitor.h | 2 +- storage/perfschema/table_accounts.cc | 2 +- storage/perfschema/table_accounts.h | 2 +- storage/perfschema/table_all_instr.cc | 2 +- storage/perfschema/table_all_instr.h | 2 +- storage/perfschema/table_esgs_by_account_by_event_name.cc | 2 +- storage/perfschema/table_esgs_by_account_by_event_name.h | 2 +- storage/perfschema/table_esgs_by_host_by_event_name.cc | 2 +- storage/perfschema/table_esgs_by_host_by_event_name.h | 2 +- storage/perfschema/table_esgs_by_thread_by_event_name.cc | 2 +- storage/perfschema/table_esgs_by_thread_by_event_name.h | 2 +- storage/perfschema/table_esgs_by_user_by_event_name.cc | 2 +- storage/perfschema/table_esgs_by_user_by_event_name.h | 2 +- storage/perfschema/table_esgs_global_by_event_name.cc | 2 +- storage/perfschema/table_esgs_global_by_event_name.h | 2 +- storage/perfschema/table_esms_by_account_by_event_name.cc | 2 +- storage/perfschema/table_esms_by_account_by_event_name.h | 2 +- storage/perfschema/table_esms_by_digest.cc | 2 +- storage/perfschema/table_esms_by_digest.h | 2 +- storage/perfschema/table_esms_by_host_by_event_name.cc | 2 +- storage/perfschema/table_esms_by_host_by_event_name.h | 2 +- storage/perfschema/table_esms_by_program.cc | 2 +- storage/perfschema/table_esms_by_program.h | 2 +- storage/perfschema/table_esms_by_thread_by_event_name.cc | 2 +- storage/perfschema/table_esms_by_thread_by_event_name.h | 2 +- storage/perfschema/table_esms_by_user_by_event_name.cc | 2 +- storage/perfschema/table_esms_by_user_by_event_name.h | 2 +- storage/perfschema/table_esms_global_by_event_name.cc | 2 +- storage/perfschema/table_esms_global_by_event_name.h | 2 +- storage/perfschema/table_ets_by_account_by_event_name.cc | 2 +- storage/perfschema/table_ets_by_account_by_event_name.h | 2 +- storage/perfschema/table_ets_by_host_by_event_name.cc | 2 +- storage/perfschema/table_ets_by_host_by_event_name.h | 2 +- storage/perfschema/table_ets_by_thread_by_event_name.cc | 2 +- storage/perfschema/table_ets_by_thread_by_event_name.h | 2 +- storage/perfschema/table_ets_by_user_by_event_name.cc | 2 +- storage/perfschema/table_ets_by_user_by_event_name.h | 2 +- storage/perfschema/table_ets_global_by_event_name.cc | 2 +- storage/perfschema/table_ets_global_by_event_name.h | 2 +- storage/perfschema/table_events_stages.cc | 2 +- storage/perfschema/table_events_stages.h | 2 +- storage/perfschema/table_events_statements.cc | 2 +- storage/perfschema/table_events_statements.h | 2 +- storage/perfschema/table_events_transactions.cc | 2 +- storage/perfschema/table_events_transactions.h | 2 +- storage/perfschema/table_events_waits.cc | 2 +- storage/perfschema/table_events_waits.h | 2 +- storage/perfschema/table_events_waits_summary.cc | 2 +- storage/perfschema/table_events_waits_summary.h | 2 +- storage/perfschema/table_ews_by_account_by_event_name.cc | 2 +- storage/perfschema/table_ews_by_account_by_event_name.h | 2 +- storage/perfschema/table_ews_by_host_by_event_name.cc | 2 +- storage/perfschema/table_ews_by_host_by_event_name.h | 2 +- storage/perfschema/table_ews_by_thread_by_event_name.cc | 2 +- storage/perfschema/table_ews_by_thread_by_event_name.h | 2 +- storage/perfschema/table_ews_by_user_by_event_name.cc | 2 +- storage/perfschema/table_ews_by_user_by_event_name.h | 2 +- storage/perfschema/table_ews_global_by_event_name.cc | 2 +- storage/perfschema/table_ews_global_by_event_name.h | 2 +- storage/perfschema/table_file_instances.cc | 2 +- storage/perfschema/table_file_instances.h | 2 +- storage/perfschema/table_file_summary_by_event_name.cc | 2 +- storage/perfschema/table_file_summary_by_event_name.h | 2 +- storage/perfschema/table_file_summary_by_instance.cc | 2 +- storage/perfschema/table_file_summary_by_instance.h | 2 +- storage/perfschema/table_global_status.cc | 2 +- storage/perfschema/table_global_status.h | 2 +- storage/perfschema/table_global_variables.cc | 2 +- storage/perfschema/table_global_variables.h | 2 +- storage/perfschema/table_helper.cc | 2 +- storage/perfschema/table_helper.h | 2 +- storage/perfschema/table_host_cache.cc | 2 +- storage/perfschema/table_host_cache.h | 2 +- storage/perfschema/table_hosts.cc | 2 +- storage/perfschema/table_hosts.h | 2 +- storage/perfschema/table_md_locks.cc | 2 +- storage/perfschema/table_md_locks.h | 2 +- storage/perfschema/table_mems_by_account_by_event_name.cc | 2 +- storage/perfschema/table_mems_by_account_by_event_name.h | 2 +- storage/perfschema/table_mems_by_host_by_event_name.cc | 2 +- storage/perfschema/table_mems_by_host_by_event_name.h | 2 +- storage/perfschema/table_mems_by_thread_by_event_name.cc | 2 +- storage/perfschema/table_mems_by_thread_by_event_name.h | 2 +- storage/perfschema/table_mems_by_user_by_event_name.cc | 2 +- storage/perfschema/table_mems_by_user_by_event_name.h | 2 +- storage/perfschema/table_mems_global_by_event_name.cc | 2 +- storage/perfschema/table_mems_global_by_event_name.h | 2 +- storage/perfschema/table_os_global_by_type.cc | 2 +- storage/perfschema/table_os_global_by_type.h | 2 +- storage/perfschema/table_performance_timers.cc | 2 +- storage/perfschema/table_performance_timers.h | 2 +- storage/perfschema/table_prepared_stmt_instances.cc | 2 +- storage/perfschema/table_prepared_stmt_instances.h | 2 +- storage/perfschema/table_processlist.cc | 2 +- storage/perfschema/table_processlist.h | 2 +- storage/perfschema/table_replication_applier_configuration.cc | 2 +- storage/perfschema/table_replication_applier_configuration.h | 2 +- storage/perfschema/table_replication_applier_status.cc | 2 +- storage/perfschema/table_replication_applier_status.h | 2 +- .../table_replication_applier_status_by_coordinator.cc | 2 +- .../table_replication_applier_status_by_coordinator.h | 2 +- .../perfschema/table_replication_applier_status_by_worker.cc | 2 +- storage/perfschema/table_replication_applier_status_by_worker.h | 2 +- .../perfschema/table_replication_connection_configuration.cc | 2 +- storage/perfschema/table_replication_connection_configuration.h | 2 +- storage/perfschema/table_replication_connection_status.cc | 2 +- storage/perfschema/table_replication_connection_status.h | 2 +- storage/perfschema/table_replication_group_member_stats.cc | 2 +- storage/perfschema/table_replication_group_member_stats.h | 2 +- storage/perfschema/table_replication_group_members.cc | 2 +- storage/perfschema/table_replication_group_members.h | 2 +- storage/perfschema/table_session_account_connect_attrs.cc | 2 +- storage/perfschema/table_session_account_connect_attrs.h | 2 +- storage/perfschema/table_session_connect.cc | 2 +- storage/perfschema/table_session_connect.h | 2 +- storage/perfschema/table_session_connect_attrs.cc | 2 +- storage/perfschema/table_session_connect_attrs.h | 2 +- storage/perfschema/table_session_status.cc | 2 +- storage/perfschema/table_session_status.h | 2 +- storage/perfschema/table_session_variables.cc | 2 +- storage/perfschema/table_session_variables.h | 2 +- storage/perfschema/table_setup_actors.cc | 2 +- storage/perfschema/table_setup_actors.h | 2 +- storage/perfschema/table_setup_consumers.cc | 2 +- storage/perfschema/table_setup_consumers.h | 2 +- storage/perfschema/table_setup_instruments.cc | 2 +- storage/perfschema/table_setup_instruments.h | 2 +- storage/perfschema/table_setup_objects.cc | 2 +- storage/perfschema/table_setup_objects.h | 2 +- storage/perfschema/table_setup_timers.cc | 2 +- storage/perfschema/table_setup_timers.h | 2 +- storage/perfschema/table_socket_instances.cc | 2 +- storage/perfschema/table_socket_instances.h | 2 +- storage/perfschema/table_socket_summary_by_event_name.cc | 2 +- storage/perfschema/table_socket_summary_by_event_name.h | 2 +- storage/perfschema/table_socket_summary_by_instance.cc | 2 +- storage/perfschema/table_socket_summary_by_instance.h | 2 +- storage/perfschema/table_status_by_account.cc | 2 +- storage/perfschema/table_status_by_account.h | 2 +- storage/perfschema/table_status_by_host.cc | 2 +- storage/perfschema/table_status_by_host.h | 2 +- storage/perfschema/table_status_by_thread.cc | 2 +- storage/perfschema/table_status_by_thread.h | 2 +- storage/perfschema/table_status_by_user.cc | 2 +- storage/perfschema/table_status_by_user.h | 2 +- storage/perfschema/table_sync_instances.cc | 2 +- storage/perfschema/table_sync_instances.h | 2 +- storage/perfschema/table_table_handles.cc | 2 +- storage/perfschema/table_table_handles.h | 2 +- storage/perfschema/table_threads.cc | 2 +- storage/perfschema/table_threads.h | 2 +- storage/perfschema/table_tiws_by_index_usage.cc | 2 +- storage/perfschema/table_tiws_by_index_usage.h | 2 +- storage/perfschema/table_tiws_by_table.cc | 2 +- storage/perfschema/table_tiws_by_table.h | 2 +- storage/perfschema/table_tlws_by_table.cc | 2 +- storage/perfschema/table_tlws_by_table.h | 2 +- storage/perfschema/table_users.cc | 2 +- storage/perfschema/table_users.h | 2 +- storage/perfschema/table_uvar_by_thread.cc | 2 +- storage/perfschema/table_uvar_by_thread.h | 2 +- storage/perfschema/table_variables_by_thread.cc | 2 +- storage/perfschema/table_variables_by_thread.h | 2 +- storage/perfschema/unittest/CMakeLists.txt | 2 +- storage/perfschema/unittest/conf.txt | 2 +- storage/perfschema/unittest/pfs-t.cc | 2 +- storage/perfschema/unittest/pfs_account-oom-t.cc | 2 +- storage/perfschema/unittest/pfs_connect_attr-t.cc | 2 +- storage/perfschema/unittest/pfs_host-oom-t.cc | 2 +- storage/perfschema/unittest/pfs_instr-oom-t.cc | 2 +- storage/perfschema/unittest/pfs_instr-t.cc | 2 +- storage/perfschema/unittest/pfs_instr_class-oom-t.cc | 2 +- storage/perfschema/unittest/pfs_instr_class-t.cc | 2 +- storage/perfschema/unittest/pfs_misc-t.cc | 2 +- storage/perfschema/unittest/pfs_noop-t.cc | 2 +- storage/perfschema/unittest/pfs_server_stubs.cc | 2 +- storage/perfschema/unittest/pfs_timer-t.cc | 2 +- storage/perfschema/unittest/pfs_user-oom-t.cc | 2 +- storage/perfschema/unittest/stub_global_status_var.h | 2 +- storage/perfschema/unittest/stub_pfs_defaults.h | 2 +- storage/perfschema/unittest/stub_pfs_global.h | 2 +- storage/perfschema/unittest/stub_print_error.h | 2 +- 275 files changed, 275 insertions(+), 275 deletions(-) diff --git a/include/mysql/psi/mysql_file.h b/include/mysql/psi/mysql_file.h index 8f0fe6d9c78..ed306738482 100644 --- a/include/mysql/psi/mysql_file.h +++ b/include/mysql/psi/mysql_file.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/mysql_idle.h b/include/mysql/psi/mysql_idle.h index 61a25f20a0e..b9f7cb6c4fd 100644 --- a/include/mysql/psi/mysql_idle.h +++ b/include/mysql/psi/mysql_idle.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/mysql_mdl.h b/include/mysql/psi/mysql_mdl.h index 45723a60d3b..bcc47a34c38 100644 --- a/include/mysql/psi/mysql_mdl.h +++ b/include/mysql/psi/mysql_mdl.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2012, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/mysql_memory.h b/include/mysql/psi/mysql_memory.h index 03dc181b83d..8a0680152b9 100644 --- a/include/mysql/psi/mysql_memory.h +++ b/include/mysql/psi/mysql_memory.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2012, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/mysql_ps.h b/include/mysql/psi/mysql_ps.h index a3291e3402e..b60fe45a26e 100644 --- a/include/mysql/psi/mysql_ps.h +++ b/include/mysql/psi/mysql_ps.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2014, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/mysql_socket.h b/include/mysql/psi/mysql_socket.h index 3bc22dddca9..50abd113b64 100644 --- a/include/mysql/psi/mysql_socket.h +++ b/include/mysql/psi/mysql_socket.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/mysql_sp.h b/include/mysql/psi/mysql_sp.h index 1fec59cec91..c25247459ae 100644 --- a/include/mysql/psi/mysql_sp.h +++ b/include/mysql/psi/mysql_sp.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/mysql_stage.h b/include/mysql/psi/mysql_stage.h index 473611dc66d..91f1292d88d 100644 --- a/include/mysql/psi/mysql_stage.h +++ b/include/mysql/psi/mysql_stage.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/mysql_statement.h b/include/mysql/psi/mysql_statement.h index bee98456d2f..2341101b144 100644 --- a/include/mysql/psi/mysql_statement.h +++ b/include/mysql/psi/mysql_statement.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/mysql_table.h b/include/mysql/psi/mysql_table.h index a0755aa4c92..6de423688e4 100644 --- a/include/mysql/psi/mysql_table.h +++ b/include/mysql/psi/mysql_table.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/mysql_thread.h b/include/mysql/psi/mysql_thread.h index c25e90f2120..b52ea13613f 100644 --- a/include/mysql/psi/mysql_thread.h +++ b/include/mysql/psi/mysql_thread.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/mysql_transaction.h b/include/mysql/psi/mysql_transaction.h index 763c3aa05dd..38775bef3a2 100644 --- a/include/mysql/psi/mysql_transaction.h +++ b/include/mysql/psi/mysql_transaction.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/psi.h b/include/mysql/psi/psi.h index 98bcffd7b5c..31ffd7fadc6 100644 --- a/include/mysql/psi/psi.h +++ b/include/mysql/psi/psi.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/psi_abi_v0.h b/include/mysql/psi/psi_abi_v0.h index 2fe6546ecac..589668e3994 100644 --- a/include/mysql/psi/psi_abi_v0.h +++ b/include/mysql/psi/psi_abi_v0.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/psi_abi_v1.h b/include/mysql/psi/psi_abi_v1.h index 78c2ddb094f..d8028db3c24 100644 --- a/include/mysql/psi/psi_abi_v1.h +++ b/include/mysql/psi/psi_abi_v1.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/psi_abi_v2.h b/include/mysql/psi/psi_abi_v2.h index 0aeebaca779..295e0a909d6 100644 --- a/include/mysql/psi/psi_abi_v2.h +++ b/include/mysql/psi/psi_abi_v2.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/psi_base.h b/include/mysql/psi/psi_base.h index 66d709b48ef..546bf117234 100644 --- a/include/mysql/psi/psi_base.h +++ b/include/mysql/psi/psi_base.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/include/mysql/psi/psi_memory.h b/include/mysql/psi/psi_memory.h index 454c3dbe2a1..f5e0ebce56b 100644 --- a/include/mysql/psi/psi_memory.h +++ b/include/mysql/psi/psi_memory.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/CMakeLists.txt b/storage/perfschema/CMakeLists.txt index 15207bfa571..953d3b1c078 100644 --- a/storage/perfschema/CMakeLists.txt +++ b/storage/perfschema/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2022, Oracle and/or its affiliates. +# Copyright (c) 2009, 2023, Oracle and/or its affiliates. # # # This program is free software; you can redistribute it and/or modify diff --git a/storage/perfschema/cursor_by_account.cc b/storage/perfschema/cursor_by_account.cc index f948d353b2b..3518ee61331 100644 --- a/storage/perfschema/cursor_by_account.cc +++ b/storage/perfschema/cursor_by_account.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/cursor_by_account.h b/storage/perfschema/cursor_by_account.h index 95b2020db30..77c01b3d912 100644 --- a/storage/perfschema/cursor_by_account.h +++ b/storage/perfschema/cursor_by_account.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/cursor_by_host.cc b/storage/perfschema/cursor_by_host.cc index feb629a14ba..6338e06f823 100644 --- a/storage/perfschema/cursor_by_host.cc +++ b/storage/perfschema/cursor_by_host.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/cursor_by_host.h b/storage/perfschema/cursor_by_host.h index e39e35e1f0c..b0c4368c6a9 100644 --- a/storage/perfschema/cursor_by_host.h +++ b/storage/perfschema/cursor_by_host.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/cursor_by_thread.cc b/storage/perfschema/cursor_by_thread.cc index 22cab4eed66..50a5d919749 100644 --- a/storage/perfschema/cursor_by_thread.cc +++ b/storage/perfschema/cursor_by_thread.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/cursor_by_thread.h b/storage/perfschema/cursor_by_thread.h index cb07554e2bb..848656d9ca9 100644 --- a/storage/perfschema/cursor_by_thread.h +++ b/storage/perfschema/cursor_by_thread.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/cursor_by_thread_connect_attr.cc b/storage/perfschema/cursor_by_thread_connect_attr.cc index 03365e276c6..8945625c90a 100644 --- a/storage/perfschema/cursor_by_thread_connect_attr.cc +++ b/storage/perfschema/cursor_by_thread_connect_attr.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/cursor_by_thread_connect_attr.h b/storage/perfschema/cursor_by_thread_connect_attr.h index 7848b6b0978..d98a24bf2c0 100644 --- a/storage/perfschema/cursor_by_thread_connect_attr.h +++ b/storage/perfschema/cursor_by_thread_connect_attr.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2012, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/cursor_by_user.cc b/storage/perfschema/cursor_by_user.cc index 03ab997a255..b45c9563dc0 100644 --- a/storage/perfschema/cursor_by_user.cc +++ b/storage/perfschema/cursor_by_user.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/cursor_by_user.h b/storage/perfschema/cursor_by_user.h index e02cd42cf47..3b201f6d77f 100644 --- a/storage/perfschema/cursor_by_user.h +++ b/storage/perfschema/cursor_by_user.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc index 3ba31e4f133..bad9cb6ae61 100644 --- a/storage/perfschema/ha_perfschema.cc +++ b/storage/perfschema/ha_perfschema.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h index fab824945a7..681684d77a8 100644 --- a/storage/perfschema/ha_perfschema.h +++ b/storage/perfschema/ha_perfschema.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc index 0391f36bf12..037c321f211 100644 --- a/storage/perfschema/pfs.cc +++ b/storage/perfschema/pfs.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs.h b/storage/perfschema/pfs.h index ad19c1daa8c..5d4889f9bb9 100644 --- a/storage/perfschema/pfs.h +++ b/storage/perfschema/pfs.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_account.cc b/storage/perfschema/pfs_account.cc index 4983d29ee92..b5d6a3449f2 100644 --- a/storage/perfschema/pfs_account.cc +++ b/storage/perfschema/pfs_account.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_account.h b/storage/perfschema/pfs_account.h index c9ebc8ef78c..b317a5d74f7 100644 --- a/storage/perfschema/pfs_account.h +++ b/storage/perfschema/pfs_account.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_atomic.h b/storage/perfschema/pfs_atomic.h index e8170399420..8b45c71dcd2 100644 --- a/storage/perfschema/pfs_atomic.h +++ b/storage/perfschema/pfs_atomic.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2009, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_autosize.cc b/storage/perfschema/pfs_autosize.cc index ad08f427b1d..c5ca8586d1f 100644 --- a/storage/perfschema/pfs_autosize.cc +++ b/storage/perfschema/pfs_autosize.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2012, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_buffer_container.cc b/storage/perfschema/pfs_buffer_container.cc index dfae6e0ad2e..04f6f5219a3 100644 --- a/storage/perfschema/pfs_buffer_container.cc +++ b/storage/perfschema/pfs_buffer_container.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2014, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_buffer_container.h b/storage/perfschema/pfs_buffer_container.h index ea4021f39c1..241ef6f91a3 100644 --- a/storage/perfschema/pfs_buffer_container.h +++ b/storage/perfschema/pfs_buffer_container.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2014, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_builtin_memory.cc b/storage/perfschema/pfs_builtin_memory.cc index 7f4adc9bde9..6a5f90820a5 100644 --- a/storage/perfschema/pfs_builtin_memory.cc +++ b/storage/perfschema/pfs_builtin_memory.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2014, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_builtin_memory.h b/storage/perfschema/pfs_builtin_memory.h index c0f0aa86c45..956b31c5dcf 100644 --- a/storage/perfschema/pfs_builtin_memory.h +++ b/storage/perfschema/pfs_builtin_memory.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2014, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_check.cc b/storage/perfschema/pfs_check.cc index 6fe16e520d4..c48f9e5ad3c 100644 --- a/storage/perfschema/pfs_check.cc +++ b/storage/perfschema/pfs_check.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2009, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_column_types.h b/storage/perfschema/pfs_column_types.h index 49d73d0561c..e820bc8c851 100644 --- a/storage/perfschema/pfs_column_types.h +++ b/storage/perfschema/pfs_column_types.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_column_values.cc b/storage/perfschema/pfs_column_values.cc index 1fc5f1d471a..eba320a0b26 100644 --- a/storage/perfschema/pfs_column_values.cc +++ b/storage/perfschema/pfs_column_values.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_column_values.h b/storage/perfschema/pfs_column_values.h index f33c4383d8e..cbaeabebcd2 100644 --- a/storage/perfschema/pfs_column_values.h +++ b/storage/perfschema/pfs_column_values.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_con_slice.cc b/storage/perfschema/pfs_con_slice.cc index a26ee28542f..ea8f3865bb9 100644 --- a/storage/perfschema/pfs_con_slice.cc +++ b/storage/perfschema/pfs_con_slice.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_con_slice.h b/storage/perfschema/pfs_con_slice.h index 338973a50da..cdf62a428bc 100644 --- a/storage/perfschema/pfs_con_slice.h +++ b/storage/perfschema/pfs_con_slice.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_defaults.cc b/storage/perfschema/pfs_defaults.cc index f46e823f67e..a72ca36335a 100644 --- a/storage/perfschema/pfs_defaults.cc +++ b/storage/perfschema/pfs_defaults.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_defaults.h b/storage/perfschema/pfs_defaults.h index 709feb88966..c61b0dd8d55 100644 --- a/storage/perfschema/pfs_defaults.h +++ b/storage/perfschema/pfs_defaults.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_digest.cc b/storage/perfschema/pfs_digest.cc index 4df7567be75..6e3943ad380 100644 --- a/storage/perfschema/pfs_digest.cc +++ b/storage/perfschema/pfs_digest.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_digest.h b/storage/perfschema/pfs_digest.h index 6a82a9871c8..143db774d58 100644 --- a/storage/perfschema/pfs_digest.h +++ b/storage/perfschema/pfs_digest.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_engine_table.cc b/storage/perfschema/pfs_engine_table.cc index 96b1e762410..87563eb8b10 100644 --- a/storage/perfschema/pfs_engine_table.cc +++ b/storage/perfschema/pfs_engine_table.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_engine_table.h b/storage/perfschema/pfs_engine_table.h index 79e452551cc..5d25160e51d 100644 --- a/storage/perfschema/pfs_engine_table.h +++ b/storage/perfschema/pfs_engine_table.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_events.h b/storage/perfschema/pfs_events.h index 8fe52600c3a..f66ea2ec4dc 100644 --- a/storage/perfschema/pfs_events.h +++ b/storage/perfschema/pfs_events.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_events_stages.cc b/storage/perfschema/pfs_events_stages.cc index 0d614330313..721617b3806 100644 --- a/storage/perfschema/pfs_events_stages.cc +++ b/storage/perfschema/pfs_events_stages.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_events_stages.h b/storage/perfschema/pfs_events_stages.h index 40828911df7..600573b2a4e 100644 --- a/storage/perfschema/pfs_events_stages.h +++ b/storage/perfschema/pfs_events_stages.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_events_statements.cc b/storage/perfschema/pfs_events_statements.cc index af00607109b..91a2dec69d5 100644 --- a/storage/perfschema/pfs_events_statements.cc +++ b/storage/perfschema/pfs_events_statements.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_events_statements.h b/storage/perfschema/pfs_events_statements.h index 8bba4731281..ceed4fb8429 100644 --- a/storage/perfschema/pfs_events_statements.h +++ b/storage/perfschema/pfs_events_statements.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_events_transactions.cc b/storage/perfschema/pfs_events_transactions.cc index 6f6b1a4cbc6..5ccdb0345d7 100644 --- a/storage/perfschema/pfs_events_transactions.cc +++ b/storage/perfschema/pfs_events_transactions.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_events_transactions.h b/storage/perfschema/pfs_events_transactions.h index 2fd8428c9bf..fb781362811 100644 --- a/storage/perfschema/pfs_events_transactions.h +++ b/storage/perfschema/pfs_events_transactions.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_events_waits.cc b/storage/perfschema/pfs_events_waits.cc index de26ad1f13b..11f09e3f317 100644 --- a/storage/perfschema/pfs_events_waits.cc +++ b/storage/perfschema/pfs_events_waits.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_events_waits.h b/storage/perfschema/pfs_events_waits.h index e194803fbd6..a33bee6cb8d 100644 --- a/storage/perfschema/pfs_events_waits.h +++ b/storage/perfschema/pfs_events_waits.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_global.cc b/storage/perfschema/pfs_global.cc index 97f20eb502e..6bb62c62e02 100644 --- a/storage/perfschema/pfs_global.cc +++ b/storage/perfschema/pfs_global.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify diff --git a/storage/perfschema/pfs_global.h b/storage/perfschema/pfs_global.h index 023f172bf9b..c29a4b12dfa 100644 --- a/storage/perfschema/pfs_global.h +++ b/storage/perfschema/pfs_global.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_host.cc b/storage/perfschema/pfs_host.cc index 8b284ca8b74..fa6b369f435 100644 --- a/storage/perfschema/pfs_host.cc +++ b/storage/perfschema/pfs_host.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_host.h b/storage/perfschema/pfs_host.h index 4fb5903f4b9..0c65c3d8c8b 100644 --- a/storage/perfschema/pfs_host.h +++ b/storage/perfschema/pfs_host.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_instr.cc b/storage/perfschema/pfs_instr.cc index 925d3122945..c7e27036dea 100644 --- a/storage/perfschema/pfs_instr.cc +++ b/storage/perfschema/pfs_instr.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_instr.h b/storage/perfschema/pfs_instr.h index f8b8799097a..61140c9c326 100644 --- a/storage/perfschema/pfs_instr.h +++ b/storage/perfschema/pfs_instr.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_instr_class.cc b/storage/perfschema/pfs_instr_class.cc index 3c534b993f0..01725a755fa 100644 --- a/storage/perfschema/pfs_instr_class.cc +++ b/storage/perfschema/pfs_instr_class.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_instr_class.h b/storage/perfschema/pfs_instr_class.h index d8b91ac3dd9..a011870d5e6 100644 --- a/storage/perfschema/pfs_instr_class.h +++ b/storage/perfschema/pfs_instr_class.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_lock.h b/storage/perfschema/pfs_lock.h index fdb23d64cd5..f8ab3a6c87c 100644 --- a/storage/perfschema/pfs_lock.h +++ b/storage/perfschema/pfs_lock.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2009, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_memory.cc b/storage/perfschema/pfs_memory.cc index 4b4b14fc186..0ee8e3dd7df 100644 --- a/storage/perfschema/pfs_memory.cc +++ b/storage/perfschema/pfs_memory.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_memory.h b/storage/perfschema/pfs_memory.h index 085f8af8bad..ee90b7d90e9 100644 --- a/storage/perfschema/pfs_memory.h +++ b/storage/perfschema/pfs_memory.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_prepared_stmt.cc b/storage/perfschema/pfs_prepared_stmt.cc index 92579dd4db1..de9c50d912e 100644 --- a/storage/perfschema/pfs_prepared_stmt.cc +++ b/storage/perfschema/pfs_prepared_stmt.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2014, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_prepared_stmt.h b/storage/perfschema/pfs_prepared_stmt.h index ef3fbc3ae6d..80680f48af5 100644 --- a/storage/perfschema/pfs_prepared_stmt.h +++ b/storage/perfschema/pfs_prepared_stmt.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2014, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_program.cc b/storage/perfschema/pfs_program.cc index 74c2b66e65d..43207997e1d 100644 --- a/storage/perfschema/pfs_program.cc +++ b/storage/perfschema/pfs_program.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_program.h b/storage/perfschema/pfs_program.h index 56abcee97f7..a5a6245c1cc 100644 --- a/storage/perfschema/pfs_program.h +++ b/storage/perfschema/pfs_program.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_server.cc b/storage/perfschema/pfs_server.cc index dfb971d23dd..51a0645d5d9 100644 --- a/storage/perfschema/pfs_server.cc +++ b/storage/perfschema/pfs_server.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_server.h b/storage/perfschema/pfs_server.h index 28f7149346c..fe21f44cc2b 100644 --- a/storage/perfschema/pfs_server.h +++ b/storage/perfschema/pfs_server.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_setup_actor.cc b/storage/perfschema/pfs_setup_actor.cc index 10dd080e79a..c7f1a150a8d 100644 --- a/storage/perfschema/pfs_setup_actor.cc +++ b/storage/perfschema/pfs_setup_actor.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_setup_actor.h b/storage/perfschema/pfs_setup_actor.h index 200452a9ddb..8fa1860a337 100644 --- a/storage/perfschema/pfs_setup_actor.h +++ b/storage/perfschema/pfs_setup_actor.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_setup_object.cc b/storage/perfschema/pfs_setup_object.cc index 3caca529e06..b5f91bb44a0 100644 --- a/storage/perfschema/pfs_setup_object.cc +++ b/storage/perfschema/pfs_setup_object.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_setup_object.h b/storage/perfschema/pfs_setup_object.h index 1a88938947c..0b3504f19b9 100644 --- a/storage/perfschema/pfs_setup_object.h +++ b/storage/perfschema/pfs_setup_object.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_stat.h b/storage/perfschema/pfs_stat.h index bc98d54a759..10cd7cde539 100644 --- a/storage/perfschema/pfs_stat.h +++ b/storage/perfschema/pfs_stat.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_status.cc b/storage/perfschema/pfs_status.cc index 8eade2ee363..1894cc2851c 100644 --- a/storage/perfschema/pfs_status.cc +++ b/storage/perfschema/pfs_status.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_status.h b/storage/perfschema/pfs_status.h index ee9d74426fd..7517d4910c3 100644 --- a/storage/perfschema/pfs_status.h +++ b/storage/perfschema/pfs_status.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_timer.cc b/storage/perfschema/pfs_timer.cc index e0749027365..6571740e3f4 100644 --- a/storage/perfschema/pfs_timer.cc +++ b/storage/perfschema/pfs_timer.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_timer.h b/storage/perfschema/pfs_timer.h index 3517e272def..adaa07d7ad1 100644 --- a/storage/perfschema/pfs_timer.h +++ b/storage/perfschema/pfs_timer.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_user.cc b/storage/perfschema/pfs_user.cc index 05dc0e6a769..8c403f5b723 100644 --- a/storage/perfschema/pfs_user.cc +++ b/storage/perfschema/pfs_user.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_user.h b/storage/perfschema/pfs_user.h index 1164d2d0af6..45faf36821e 100644 --- a/storage/perfschema/pfs_user.h +++ b/storage/perfschema/pfs_user.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_variable.cc b/storage/perfschema/pfs_variable.cc index 2d09f5a3d9e..be3d5bf8299 100644 --- a/storage/perfschema/pfs_variable.cc +++ b/storage/perfschema/pfs_variable.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_variable.h b/storage/perfschema/pfs_variable.h index d08fec36ba3..3f08baf72ac 100644 --- a/storage/perfschema/pfs_variable.h +++ b/storage/perfschema/pfs_variable.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_visitor.cc b/storage/perfschema/pfs_visitor.cc index 0915bd4e40d..3c2edea94e5 100644 --- a/storage/perfschema/pfs_visitor.cc +++ b/storage/perfschema/pfs_visitor.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/pfs_visitor.h b/storage/perfschema/pfs_visitor.h index 93f52ca44ab..411e1a45248 100644 --- a/storage/perfschema/pfs_visitor.h +++ b/storage/perfschema/pfs_visitor.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_accounts.cc b/storage/perfschema/table_accounts.cc index b1609da028b..08126551d87 100644 --- a/storage/perfschema/table_accounts.cc +++ b/storage/perfschema/table_accounts.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_accounts.h b/storage/perfschema/table_accounts.h index 96d6c52da6c..919e299728e 100644 --- a/storage/perfschema/table_accounts.h +++ b/storage/perfschema/table_accounts.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_all_instr.cc b/storage/perfschema/table_all_instr.cc index a3396f304ca..c9a9313f65e 100644 --- a/storage/perfschema/table_all_instr.cc +++ b/storage/perfschema/table_all_instr.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_all_instr.h b/storage/perfschema/table_all_instr.h index 93c7c845cbe..a5f22f379e8 100644 --- a/storage/perfschema/table_all_instr.h +++ b/storage/perfschema/table_all_instr.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esgs_by_account_by_event_name.cc b/storage/perfschema/table_esgs_by_account_by_event_name.cc index f0551e6d06d..3c51b7c28f4 100644 --- a/storage/perfschema/table_esgs_by_account_by_event_name.cc +++ b/storage/perfschema/table_esgs_by_account_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esgs_by_account_by_event_name.h b/storage/perfschema/table_esgs_by_account_by_event_name.h index 11aafcb1323..b64435ebd58 100644 --- a/storage/perfschema/table_esgs_by_account_by_event_name.h +++ b/storage/perfschema/table_esgs_by_account_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esgs_by_host_by_event_name.cc b/storage/perfschema/table_esgs_by_host_by_event_name.cc index ac25b2b42d7..43cf8a06cc7 100644 --- a/storage/perfschema/table_esgs_by_host_by_event_name.cc +++ b/storage/perfschema/table_esgs_by_host_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esgs_by_host_by_event_name.h b/storage/perfschema/table_esgs_by_host_by_event_name.h index 51dd9697343..9097012da8c 100644 --- a/storage/perfschema/table_esgs_by_host_by_event_name.h +++ b/storage/perfschema/table_esgs_by_host_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esgs_by_thread_by_event_name.cc b/storage/perfschema/table_esgs_by_thread_by_event_name.cc index e8c8f6f850b..9580e387be3 100644 --- a/storage/perfschema/table_esgs_by_thread_by_event_name.cc +++ b/storage/perfschema/table_esgs_by_thread_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esgs_by_thread_by_event_name.h b/storage/perfschema/table_esgs_by_thread_by_event_name.h index 78aedfc1983..ef2a9ce882c 100644 --- a/storage/perfschema/table_esgs_by_thread_by_event_name.h +++ b/storage/perfschema/table_esgs_by_thread_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esgs_by_user_by_event_name.cc b/storage/perfschema/table_esgs_by_user_by_event_name.cc index 7cc315c99a5..c4cf38b32f9 100644 --- a/storage/perfschema/table_esgs_by_user_by_event_name.cc +++ b/storage/perfschema/table_esgs_by_user_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esgs_by_user_by_event_name.h b/storage/perfschema/table_esgs_by_user_by_event_name.h index 076867a088b..af88de1dda6 100644 --- a/storage/perfschema/table_esgs_by_user_by_event_name.h +++ b/storage/perfschema/table_esgs_by_user_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esgs_global_by_event_name.cc b/storage/perfschema/table_esgs_global_by_event_name.cc index 34c4bac1806..2b6dbda7138 100644 --- a/storage/perfschema/table_esgs_global_by_event_name.cc +++ b/storage/perfschema/table_esgs_global_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esgs_global_by_event_name.h b/storage/perfschema/table_esgs_global_by_event_name.h index 91d9cbd7554..18b0ba4f9ae 100644 --- a/storage/perfschema/table_esgs_global_by_event_name.h +++ b/storage/perfschema/table_esgs_global_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_by_account_by_event_name.cc b/storage/perfschema/table_esms_by_account_by_event_name.cc index 70c2d2335ab..ca03e6608bd 100644 --- a/storage/perfschema/table_esms_by_account_by_event_name.cc +++ b/storage/perfschema/table_esms_by_account_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_by_account_by_event_name.h b/storage/perfschema/table_esms_by_account_by_event_name.h index 0241599a219..afc63419aa0 100644 --- a/storage/perfschema/table_esms_by_account_by_event_name.h +++ b/storage/perfschema/table_esms_by_account_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_by_digest.cc b/storage/perfschema/table_esms_by_digest.cc index 67a2e7f5799..a05ab145155 100644 --- a/storage/perfschema/table_esms_by_digest.cc +++ b/storage/perfschema/table_esms_by_digest.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_by_digest.h b/storage/perfschema/table_esms_by_digest.h index 26577d43dcd..5e683e98ea5 100644 --- a/storage/perfschema/table_esms_by_digest.h +++ b/storage/perfschema/table_esms_by_digest.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_by_host_by_event_name.cc b/storage/perfschema/table_esms_by_host_by_event_name.cc index 27445b57d9d..31ba44d82c2 100644 --- a/storage/perfschema/table_esms_by_host_by_event_name.cc +++ b/storage/perfschema/table_esms_by_host_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_by_host_by_event_name.h b/storage/perfschema/table_esms_by_host_by_event_name.h index 199f5581202..cbe666ad8e3 100644 --- a/storage/perfschema/table_esms_by_host_by_event_name.h +++ b/storage/perfschema/table_esms_by_host_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_by_program.cc b/storage/perfschema/table_esms_by_program.cc index 621259fead8..05b15d0c9ff 100644 --- a/storage/perfschema/table_esms_by_program.cc +++ b/storage/perfschema/table_esms_by_program.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_by_program.h b/storage/perfschema/table_esms_by_program.h index a9aa47c2300..f9e686efc6f 100644 --- a/storage/perfschema/table_esms_by_program.h +++ b/storage/perfschema/table_esms_by_program.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_by_thread_by_event_name.cc b/storage/perfschema/table_esms_by_thread_by_event_name.cc index 5cafafe5dfc..b62bfd23b32 100644 --- a/storage/perfschema/table_esms_by_thread_by_event_name.cc +++ b/storage/perfschema/table_esms_by_thread_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_by_thread_by_event_name.h b/storage/perfschema/table_esms_by_thread_by_event_name.h index 784af3e04c7..6a1ddbbdcb7 100644 --- a/storage/perfschema/table_esms_by_thread_by_event_name.h +++ b/storage/perfschema/table_esms_by_thread_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_by_user_by_event_name.cc b/storage/perfschema/table_esms_by_user_by_event_name.cc index 2a0b53caf08..be7f88cb893 100644 --- a/storage/perfschema/table_esms_by_user_by_event_name.cc +++ b/storage/perfschema/table_esms_by_user_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_by_user_by_event_name.h b/storage/perfschema/table_esms_by_user_by_event_name.h index 92069382629..8e512d13a14 100644 --- a/storage/perfschema/table_esms_by_user_by_event_name.h +++ b/storage/perfschema/table_esms_by_user_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_global_by_event_name.cc b/storage/perfschema/table_esms_global_by_event_name.cc index 8b3410ab9a2..e83d79067d7 100644 --- a/storage/perfschema/table_esms_global_by_event_name.cc +++ b/storage/perfschema/table_esms_global_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_esms_global_by_event_name.h b/storage/perfschema/table_esms_global_by_event_name.h index f43fb7421b1..9814a18fb84 100644 --- a/storage/perfschema/table_esms_global_by_event_name.h +++ b/storage/perfschema/table_esms_global_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ets_by_account_by_event_name.cc b/storage/perfschema/table_ets_by_account_by_event_name.cc index ee570eaa311..ddffd0bf12a 100644 --- a/storage/perfschema/table_ets_by_account_by_event_name.cc +++ b/storage/perfschema/table_ets_by_account_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ets_by_account_by_event_name.h b/storage/perfschema/table_ets_by_account_by_event_name.h index e227db2e08e..a5202b299e0 100644 --- a/storage/perfschema/table_ets_by_account_by_event_name.h +++ b/storage/perfschema/table_ets_by_account_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ets_by_host_by_event_name.cc b/storage/perfschema/table_ets_by_host_by_event_name.cc index f08ec69435e..5cad8c21c99 100644 --- a/storage/perfschema/table_ets_by_host_by_event_name.cc +++ b/storage/perfschema/table_ets_by_host_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ets_by_host_by_event_name.h b/storage/perfschema/table_ets_by_host_by_event_name.h index add2d1a32a6..00b4dbd02f8 100644 --- a/storage/perfschema/table_ets_by_host_by_event_name.h +++ b/storage/perfschema/table_ets_by_host_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ets_by_thread_by_event_name.cc b/storage/perfschema/table_ets_by_thread_by_event_name.cc index bf8749fb7b6..70c229dd6ce 100644 --- a/storage/perfschema/table_ets_by_thread_by_event_name.cc +++ b/storage/perfschema/table_ets_by_thread_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ets_by_thread_by_event_name.h b/storage/perfschema/table_ets_by_thread_by_event_name.h index a69e19653ee..1fa62f84e51 100644 --- a/storage/perfschema/table_ets_by_thread_by_event_name.h +++ b/storage/perfschema/table_ets_by_thread_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ets_by_user_by_event_name.cc b/storage/perfschema/table_ets_by_user_by_event_name.cc index 725535f36d9..0e610dedf0d 100644 --- a/storage/perfschema/table_ets_by_user_by_event_name.cc +++ b/storage/perfschema/table_ets_by_user_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ets_by_user_by_event_name.h b/storage/perfschema/table_ets_by_user_by_event_name.h index fc18a3e94e6..9bd5b859ef9 100644 --- a/storage/perfschema/table_ets_by_user_by_event_name.h +++ b/storage/perfschema/table_ets_by_user_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ets_global_by_event_name.cc b/storage/perfschema/table_ets_global_by_event_name.cc index d2d891796e7..d27c19547a2 100644 --- a/storage/perfschema/table_ets_global_by_event_name.cc +++ b/storage/perfschema/table_ets_global_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ets_global_by_event_name.h b/storage/perfschema/table_ets_global_by_event_name.h index a2136a23210..d5a67f43505 100644 --- a/storage/perfschema/table_ets_global_by_event_name.h +++ b/storage/perfschema/table_ets_global_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_events_stages.cc b/storage/perfschema/table_events_stages.cc index a4edf9df2aa..56695f288b4 100644 --- a/storage/perfschema/table_events_stages.cc +++ b/storage/perfschema/table_events_stages.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_events_stages.h b/storage/perfschema/table_events_stages.h index c3c6707fbc4..9a00c3b03f3 100644 --- a/storage/perfschema/table_events_stages.h +++ b/storage/perfschema/table_events_stages.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_events_statements.cc b/storage/perfschema/table_events_statements.cc index 2b66b746ebd..3d56a77ab8b 100644 --- a/storage/perfschema/table_events_statements.cc +++ b/storage/perfschema/table_events_statements.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_events_statements.h b/storage/perfschema/table_events_statements.h index 64c7fa8e297..0e0ce22dfbc 100644 --- a/storage/perfschema/table_events_statements.h +++ b/storage/perfschema/table_events_statements.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_events_transactions.cc b/storage/perfschema/table_events_transactions.cc index 2e27337727b..48564dcca13 100644 --- a/storage/perfschema/table_events_transactions.cc +++ b/storage/perfschema/table_events_transactions.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_events_transactions.h b/storage/perfschema/table_events_transactions.h index 158ee7a56b8..328418b7e29 100644 --- a/storage/perfschema/table_events_transactions.h +++ b/storage/perfschema/table_events_transactions.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_events_waits.cc b/storage/perfschema/table_events_waits.cc index b28c501a493..d5475d3fac9 100644 --- a/storage/perfschema/table_events_waits.cc +++ b/storage/perfschema/table_events_waits.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_events_waits.h b/storage/perfschema/table_events_waits.h index aa9fa61c002..e189396ae07 100644 --- a/storage/perfschema/table_events_waits.h +++ b/storage/perfschema/table_events_waits.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_events_waits_summary.cc b/storage/perfschema/table_events_waits_summary.cc index 4415ce5193f..da551f7826e 100644 --- a/storage/perfschema/table_events_waits_summary.cc +++ b/storage/perfschema/table_events_waits_summary.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_events_waits_summary.h b/storage/perfschema/table_events_waits_summary.h index 643c09a8e7c..5f89dbfdf6b 100644 --- a/storage/perfschema/table_events_waits_summary.h +++ b/storage/perfschema/table_events_waits_summary.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ews_by_account_by_event_name.cc b/storage/perfschema/table_ews_by_account_by_event_name.cc index 28f01731845..7c309fd9c60 100644 --- a/storage/perfschema/table_ews_by_account_by_event_name.cc +++ b/storage/perfschema/table_ews_by_account_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ews_by_account_by_event_name.h b/storage/perfschema/table_ews_by_account_by_event_name.h index 3447302aa93..7a5feb3efac 100644 --- a/storage/perfschema/table_ews_by_account_by_event_name.h +++ b/storage/perfschema/table_ews_by_account_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ews_by_host_by_event_name.cc b/storage/perfschema/table_ews_by_host_by_event_name.cc index 00f054d39cf..083b2d459dc 100644 --- a/storage/perfschema/table_ews_by_host_by_event_name.cc +++ b/storage/perfschema/table_ews_by_host_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ews_by_host_by_event_name.h b/storage/perfschema/table_ews_by_host_by_event_name.h index 4c277b26fa5..77f7d558092 100644 --- a/storage/perfschema/table_ews_by_host_by_event_name.h +++ b/storage/perfschema/table_ews_by_host_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ews_by_thread_by_event_name.cc b/storage/perfschema/table_ews_by_thread_by_event_name.cc index 0a7879912ef..213cfc29fea 100644 --- a/storage/perfschema/table_ews_by_thread_by_event_name.cc +++ b/storage/perfschema/table_ews_by_thread_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ews_by_thread_by_event_name.h b/storage/perfschema/table_ews_by_thread_by_event_name.h index f7f44a151d0..cdc7756d410 100644 --- a/storage/perfschema/table_ews_by_thread_by_event_name.h +++ b/storage/perfschema/table_ews_by_thread_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ews_by_user_by_event_name.cc b/storage/perfschema/table_ews_by_user_by_event_name.cc index e5c51bc37fe..f1817ed5d2f 100644 --- a/storage/perfschema/table_ews_by_user_by_event_name.cc +++ b/storage/perfschema/table_ews_by_user_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ews_by_user_by_event_name.h b/storage/perfschema/table_ews_by_user_by_event_name.h index e83a030521a..868130a9372 100644 --- a/storage/perfschema/table_ews_by_user_by_event_name.h +++ b/storage/perfschema/table_ews_by_user_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ews_global_by_event_name.cc b/storage/perfschema/table_ews_global_by_event_name.cc index bb304153857..a82f0649263 100644 --- a/storage/perfschema/table_ews_global_by_event_name.cc +++ b/storage/perfschema/table_ews_global_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_ews_global_by_event_name.h b/storage/perfschema/table_ews_global_by_event_name.h index e04fb01c096..6de4ad89ad3 100644 --- a/storage/perfschema/table_ews_global_by_event_name.h +++ b/storage/perfschema/table_ews_global_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_file_instances.cc b/storage/perfschema/table_file_instances.cc index 29803a31fff..95544c7e908 100644 --- a/storage/perfschema/table_file_instances.cc +++ b/storage/perfschema/table_file_instances.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_file_instances.h b/storage/perfschema/table_file_instances.h index 336041f0aff..cd7c98f3e3a 100644 --- a/storage/perfschema/table_file_instances.h +++ b/storage/perfschema/table_file_instances.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_file_summary_by_event_name.cc b/storage/perfschema/table_file_summary_by_event_name.cc index 33705b78509..d9bc90c0cb5 100644 --- a/storage/perfschema/table_file_summary_by_event_name.cc +++ b/storage/perfschema/table_file_summary_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_file_summary_by_event_name.h b/storage/perfschema/table_file_summary_by_event_name.h index 7bbedd7503f..7cfeebcf54a 100644 --- a/storage/perfschema/table_file_summary_by_event_name.h +++ b/storage/perfschema/table_file_summary_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_file_summary_by_instance.cc b/storage/perfschema/table_file_summary_by_instance.cc index 3a9f35a89fa..ba48fcd3b5c 100644 --- a/storage/perfschema/table_file_summary_by_instance.cc +++ b/storage/perfschema/table_file_summary_by_instance.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_file_summary_by_instance.h b/storage/perfschema/table_file_summary_by_instance.h index 6db8bcae8df..7860dd52ad2 100644 --- a/storage/perfschema/table_file_summary_by_instance.h +++ b/storage/perfschema/table_file_summary_by_instance.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_global_status.cc b/storage/perfschema/table_global_status.cc index cf7e97621c6..54192380869 100644 --- a/storage/perfschema/table_global_status.cc +++ b/storage/perfschema/table_global_status.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_global_status.h b/storage/perfschema/table_global_status.h index 45c57fb6900..5b5f6e60c37 100644 --- a/storage/perfschema/table_global_status.h +++ b/storage/perfschema/table_global_status.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_global_variables.cc b/storage/perfschema/table_global_variables.cc index 594cfbf6bde..2d43da85b0c 100644 --- a/storage/perfschema/table_global_variables.cc +++ b/storage/perfschema/table_global_variables.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_global_variables.h b/storage/perfschema/table_global_variables.h index f5429c671a2..49083e63292 100644 --- a/storage/perfschema/table_global_variables.h +++ b/storage/perfschema/table_global_variables.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_helper.cc b/storage/perfschema/table_helper.cc index 59dc8906ec3..2a7e1650180 100644 --- a/storage/perfschema/table_helper.cc +++ b/storage/perfschema/table_helper.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_helper.h b/storage/perfschema/table_helper.h index 680339c2257..07dd9b06e12 100644 --- a/storage/perfschema/table_helper.h +++ b/storage/perfschema/table_helper.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_host_cache.cc b/storage/perfschema/table_host_cache.cc index 3a580985659..a60e6857a0d 100644 --- a/storage/perfschema/table_host_cache.cc +++ b/storage/perfschema/table_host_cache.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_host_cache.h b/storage/perfschema/table_host_cache.h index 209bee5484f..c6777d6517d 100644 --- a/storage/perfschema/table_host_cache.h +++ b/storage/perfschema/table_host_cache.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_hosts.cc b/storage/perfschema/table_hosts.cc index 99da395088c..872d140d494 100644 --- a/storage/perfschema/table_hosts.cc +++ b/storage/perfschema/table_hosts.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_hosts.h b/storage/perfschema/table_hosts.h index 089ae75c285..b64f447fc9b 100644 --- a/storage/perfschema/table_hosts.h +++ b/storage/perfschema/table_hosts.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_md_locks.cc b/storage/perfschema/table_md_locks.cc index 05b8da86bf9..f3d66b40ca8 100644 --- a/storage/perfschema/table_md_locks.cc +++ b/storage/perfschema/table_md_locks.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2012, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_md_locks.h b/storage/perfschema/table_md_locks.h index ddb133ea7ff..5c9ad9b5638 100644 --- a/storage/perfschema/table_md_locks.h +++ b/storage/perfschema/table_md_locks.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2012, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_mems_by_account_by_event_name.cc b/storage/perfschema/table_mems_by_account_by_event_name.cc index 369d5ba4d8d..3d90c743ff8 100644 --- a/storage/perfschema/table_mems_by_account_by_event_name.cc +++ b/storage/perfschema/table_mems_by_account_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_mems_by_account_by_event_name.h b/storage/perfschema/table_mems_by_account_by_event_name.h index 626190461d5..e242bc40ac6 100644 --- a/storage/perfschema/table_mems_by_account_by_event_name.h +++ b/storage/perfschema/table_mems_by_account_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_mems_by_host_by_event_name.cc b/storage/perfschema/table_mems_by_host_by_event_name.cc index d8426166c15..0f322537b99 100644 --- a/storage/perfschema/table_mems_by_host_by_event_name.cc +++ b/storage/perfschema/table_mems_by_host_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_mems_by_host_by_event_name.h b/storage/perfschema/table_mems_by_host_by_event_name.h index f46f3c889e0..7920b362b5e 100644 --- a/storage/perfschema/table_mems_by_host_by_event_name.h +++ b/storage/perfschema/table_mems_by_host_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_mems_by_thread_by_event_name.cc b/storage/perfschema/table_mems_by_thread_by_event_name.cc index a5be3f6c517..c2ddf7e7920 100644 --- a/storage/perfschema/table_mems_by_thread_by_event_name.cc +++ b/storage/perfschema/table_mems_by_thread_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_mems_by_thread_by_event_name.h b/storage/perfschema/table_mems_by_thread_by_event_name.h index 17196e0fd80..0f698990b47 100644 --- a/storage/perfschema/table_mems_by_thread_by_event_name.h +++ b/storage/perfschema/table_mems_by_thread_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_mems_by_user_by_event_name.cc b/storage/perfschema/table_mems_by_user_by_event_name.cc index 179f339d4a2..39fbc231664 100644 --- a/storage/perfschema/table_mems_by_user_by_event_name.cc +++ b/storage/perfschema/table_mems_by_user_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_mems_by_user_by_event_name.h b/storage/perfschema/table_mems_by_user_by_event_name.h index c2ad8bd7462..c17f5d3302b 100644 --- a/storage/perfschema/table_mems_by_user_by_event_name.h +++ b/storage/perfschema/table_mems_by_user_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_mems_global_by_event_name.cc b/storage/perfschema/table_mems_global_by_event_name.cc index cb06b592363..e637486d780 100644 --- a/storage/perfschema/table_mems_global_by_event_name.cc +++ b/storage/perfschema/table_mems_global_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_mems_global_by_event_name.h b/storage/perfschema/table_mems_global_by_event_name.h index eaff095f8d7..ae3cd0435d6 100644 --- a/storage/perfschema/table_mems_global_by_event_name.h +++ b/storage/perfschema/table_mems_global_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_os_global_by_type.cc b/storage/perfschema/table_os_global_by_type.cc index efb3c30db67..27c154ce2db 100644 --- a/storage/perfschema/table_os_global_by_type.cc +++ b/storage/perfschema/table_os_global_by_type.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_os_global_by_type.h b/storage/perfschema/table_os_global_by_type.h index 856919ad2ee..171ff388c9c 100644 --- a/storage/perfschema/table_os_global_by_type.h +++ b/storage/perfschema/table_os_global_by_type.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_performance_timers.cc b/storage/perfschema/table_performance_timers.cc index a082a842c46..c22b555e85f 100644 --- a/storage/perfschema/table_performance_timers.cc +++ b/storage/perfschema/table_performance_timers.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_performance_timers.h b/storage/perfschema/table_performance_timers.h index 8fe8612b71a..9a75f1e1bf4 100644 --- a/storage/perfschema/table_performance_timers.h +++ b/storage/perfschema/table_performance_timers.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_prepared_stmt_instances.cc b/storage/perfschema/table_prepared_stmt_instances.cc index 6c883584364..68e3da09f4e 100644 --- a/storage/perfschema/table_prepared_stmt_instances.cc +++ b/storage/perfschema/table_prepared_stmt_instances.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2014, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_prepared_stmt_instances.h b/storage/perfschema/table_prepared_stmt_instances.h index e7afe5d48b0..8bd9acafce5 100644 --- a/storage/perfschema/table_prepared_stmt_instances.h +++ b/storage/perfschema/table_prepared_stmt_instances.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2014, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2014, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_processlist.cc b/storage/perfschema/table_processlist.cc index f7f1e72aa0b..3098a2bbe24 100644 --- a/storage/perfschema/table_processlist.cc +++ b/storage/perfschema/table_processlist.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_processlist.h b/storage/perfschema/table_processlist.h index 0531fddadf9..94978d2ebe7 100644 --- a/storage/perfschema/table_processlist.h +++ b/storage/perfschema/table_processlist.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_applier_configuration.cc b/storage/perfschema/table_replication_applier_configuration.cc index 952b5811896..9c13964b960 100644 --- a/storage/perfschema/table_replication_applier_configuration.cc +++ b/storage/perfschema/table_replication_applier_configuration.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2022, Oracle and/or its affiliates. + Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_applier_configuration.h b/storage/perfschema/table_replication_applier_configuration.h index 1c2d3785d4b..77dbbb8d50f 100644 --- a/storage/perfschema/table_replication_applier_configuration.h +++ b/storage/perfschema/table_replication_applier_configuration.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2022, Oracle and/or its affiliates. + Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_applier_status.cc b/storage/perfschema/table_replication_applier_status.cc index 9680a59e533..1aa6b90cb43 100644 --- a/storage/perfschema/table_replication_applier_status.cc +++ b/storage/perfschema/table_replication_applier_status.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2022, Oracle and/or its affiliates. + Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_applier_status.h b/storage/perfschema/table_replication_applier_status.h index 7bc1def7eef..1c1beb0f8b7 100644 --- a/storage/perfschema/table_replication_applier_status.h +++ b/storage/perfschema/table_replication_applier_status.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2022, Oracle and/or its affiliates. + Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_applier_status_by_coordinator.cc b/storage/perfschema/table_replication_applier_status_by_coordinator.cc index 1dc6c68ee5a..1d16b14104f 100644 --- a/storage/perfschema/table_replication_applier_status_by_coordinator.cc +++ b/storage/perfschema/table_replication_applier_status_by_coordinator.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2022, Oracle and/or its affiliates. + Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_applier_status_by_coordinator.h b/storage/perfschema/table_replication_applier_status_by_coordinator.h index 7bb42ff5da4..ef6bf07b68b 100644 --- a/storage/perfschema/table_replication_applier_status_by_coordinator.h +++ b/storage/perfschema/table_replication_applier_status_by_coordinator.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2022, Oracle and/or its affiliates. + Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_applier_status_by_worker.cc b/storage/perfschema/table_replication_applier_status_by_worker.cc index 023bf2c3fe8..b68b6f3e4a0 100644 --- a/storage/perfschema/table_replication_applier_status_by_worker.cc +++ b/storage/perfschema/table_replication_applier_status_by_worker.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2022, Oracle and/or its affiliates. + Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_applier_status_by_worker.h b/storage/perfschema/table_replication_applier_status_by_worker.h index a14cbf3660f..18a15ceba9a 100644 --- a/storage/perfschema/table_replication_applier_status_by_worker.h +++ b/storage/perfschema/table_replication_applier_status_by_worker.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2022, Oracle and/or its affiliates. + Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_connection_configuration.cc b/storage/perfschema/table_replication_connection_configuration.cc index 66013118e6a..6d631988252 100644 --- a/storage/perfschema/table_replication_connection_configuration.cc +++ b/storage/perfschema/table_replication_connection_configuration.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2022, Oracle and/or its affiliates. + Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_connection_configuration.h b/storage/perfschema/table_replication_connection_configuration.h index 71f4cb2cee9..f53a8bc43fe 100644 --- a/storage/perfschema/table_replication_connection_configuration.h +++ b/storage/perfschema/table_replication_connection_configuration.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2022, Oracle and/or its affiliates. + Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_connection_status.cc b/storage/perfschema/table_replication_connection_status.cc index 538451bedf2..f07bc832419 100644 --- a/storage/perfschema/table_replication_connection_status.cc +++ b/storage/perfschema/table_replication_connection_status.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2022, Oracle and/or its affiliates. + Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_connection_status.h b/storage/perfschema/table_replication_connection_status.h index 31eedec5db6..7151ce55ef7 100644 --- a/storage/perfschema/table_replication_connection_status.h +++ b/storage/perfschema/table_replication_connection_status.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2022, Oracle and/or its affiliates. + Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_group_member_stats.cc b/storage/perfschema/table_replication_group_member_stats.cc index 960baffd364..84d693860ec 100644 --- a/storage/perfschema/table_replication_group_member_stats.cc +++ b/storage/perfschema/table_replication_group_member_stats.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2014, 2022, Oracle and/or its affiliates. + Copyright (c) 2014, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_group_member_stats.h b/storage/perfschema/table_replication_group_member_stats.h index 2bc0ca6ed2d..8aec5e650d1 100644 --- a/storage/perfschema/table_replication_group_member_stats.h +++ b/storage/perfschema/table_replication_group_member_stats.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2014, 2022, Oracle and/or its affiliates. + Copyright (c) 2014, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_group_members.cc b/storage/perfschema/table_replication_group_members.cc index b9e0d20bb8a..e5cc7d27c00 100644 --- a/storage/perfschema/table_replication_group_members.cc +++ b/storage/perfschema/table_replication_group_members.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2022, Oracle and/or its affiliates. + Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_replication_group_members.h b/storage/perfschema/table_replication_group_members.h index a90e81343da..b56c72212b3 100644 --- a/storage/perfschema/table_replication_group_members.h +++ b/storage/perfschema/table_replication_group_members.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, 2022, Oracle and/or its affiliates. + Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_session_account_connect_attrs.cc b/storage/perfschema/table_session_account_connect_attrs.cc index 9a64fcad5c9..806623f956b 100644 --- a/storage/perfschema/table_session_account_connect_attrs.cc +++ b/storage/perfschema/table_session_account_connect_attrs.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_session_account_connect_attrs.h b/storage/perfschema/table_session_account_connect_attrs.h index a733d5e0bb9..b209c4f0e05 100644 --- a/storage/perfschema/table_session_account_connect_attrs.h +++ b/storage/perfschema/table_session_account_connect_attrs.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2012, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_session_connect.cc b/storage/perfschema/table_session_connect.cc index 5a94bfb96fb..503e0ba33b5 100644 --- a/storage/perfschema/table_session_connect.cc +++ b/storage/perfschema/table_session_connect.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_session_connect.h b/storage/perfschema/table_session_connect.h index fa78960ac7e..f48631e63d2 100644 --- a/storage/perfschema/table_session_connect.h +++ b/storage/perfschema/table_session_connect.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2012, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_session_connect_attrs.cc b/storage/perfschema/table_session_connect_attrs.cc index f7236ba4a0f..bbb4ef389fd 100644 --- a/storage/perfschema/table_session_connect_attrs.cc +++ b/storage/perfschema/table_session_connect_attrs.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_session_connect_attrs.h b/storage/perfschema/table_session_connect_attrs.h index 05e1e2203bc..161c54473fd 100644 --- a/storage/perfschema/table_session_connect_attrs.h +++ b/storage/perfschema/table_session_connect_attrs.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2012, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_session_status.cc b/storage/perfschema/table_session_status.cc index c16a75b7beb..437fb6ec9d0 100644 --- a/storage/perfschema/table_session_status.cc +++ b/storage/perfschema/table_session_status.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_session_status.h b/storage/perfschema/table_session_status.h index d338ccafa8a..0b3e16c6011 100644 --- a/storage/perfschema/table_session_status.h +++ b/storage/perfschema/table_session_status.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_session_variables.cc b/storage/perfschema/table_session_variables.cc index 37d7347ae7d..6b98beaeddf 100644 --- a/storage/perfschema/table_session_variables.cc +++ b/storage/perfschema/table_session_variables.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_session_variables.h b/storage/perfschema/table_session_variables.h index 0223438824a..f46d9967e5c 100644 --- a/storage/perfschema/table_session_variables.h +++ b/storage/perfschema/table_session_variables.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_setup_actors.cc b/storage/perfschema/table_setup_actors.cc index 8280781eec2..e9b7d44a4a2 100644 --- a/storage/perfschema/table_setup_actors.cc +++ b/storage/perfschema/table_setup_actors.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_setup_actors.h b/storage/perfschema/table_setup_actors.h index 7653a3ee220..69b8041907a 100644 --- a/storage/perfschema/table_setup_actors.h +++ b/storage/perfschema/table_setup_actors.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_setup_consumers.cc b/storage/perfschema/table_setup_consumers.cc index 3125e63a30f..c52c6979f78 100644 --- a/storage/perfschema/table_setup_consumers.cc +++ b/storage/perfschema/table_setup_consumers.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_setup_consumers.h b/storage/perfschema/table_setup_consumers.h index 13412c93257..8f761715390 100644 --- a/storage/perfschema/table_setup_consumers.h +++ b/storage/perfschema/table_setup_consumers.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_setup_instruments.cc b/storage/perfschema/table_setup_instruments.cc index b4963e258fd..fd4c7c25860 100644 --- a/storage/perfschema/table_setup_instruments.cc +++ b/storage/perfschema/table_setup_instruments.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_setup_instruments.h b/storage/perfschema/table_setup_instruments.h index 00a405c1b7a..ea07095e700 100644 --- a/storage/perfschema/table_setup_instruments.h +++ b/storage/perfschema/table_setup_instruments.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_setup_objects.cc b/storage/perfschema/table_setup_objects.cc index 532b5e9d01e..d33647253f5 100644 --- a/storage/perfschema/table_setup_objects.cc +++ b/storage/perfschema/table_setup_objects.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_setup_objects.h b/storage/perfschema/table_setup_objects.h index 2dd5737c75f..7485b89d686 100644 --- a/storage/perfschema/table_setup_objects.h +++ b/storage/perfschema/table_setup_objects.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_setup_timers.cc b/storage/perfschema/table_setup_timers.cc index e8dcdff4144..4ae5205ab5c 100644 --- a/storage/perfschema/table_setup_timers.cc +++ b/storage/perfschema/table_setup_timers.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_setup_timers.h b/storage/perfschema/table_setup_timers.h index 7e3451530a7..309c14cac54 100644 --- a/storage/perfschema/table_setup_timers.h +++ b/storage/perfschema/table_setup_timers.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_socket_instances.cc b/storage/perfschema/table_socket_instances.cc index 0427bcf42ee..498e08a9fc9 100644 --- a/storage/perfschema/table_socket_instances.cc +++ b/storage/perfschema/table_socket_instances.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_socket_instances.h b/storage/perfschema/table_socket_instances.h index 2f67eba9944..d53baf78834 100644 --- a/storage/perfschema/table_socket_instances.h +++ b/storage/perfschema/table_socket_instances.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_socket_summary_by_event_name.cc b/storage/perfschema/table_socket_summary_by_event_name.cc index b8bb856f09a..77b485e51d3 100644 --- a/storage/perfschema/table_socket_summary_by_event_name.cc +++ b/storage/perfschema/table_socket_summary_by_event_name.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_socket_summary_by_event_name.h b/storage/perfschema/table_socket_summary_by_event_name.h index 5abc8eeb099..ba4a5d93305 100644 --- a/storage/perfschema/table_socket_summary_by_event_name.h +++ b/storage/perfschema/table_socket_summary_by_event_name.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_socket_summary_by_instance.cc b/storage/perfschema/table_socket_summary_by_instance.cc index 6a5fe5d76dd..64ba51c3dc9 100644 --- a/storage/perfschema/table_socket_summary_by_instance.cc +++ b/storage/perfschema/table_socket_summary_by_instance.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_socket_summary_by_instance.h b/storage/perfschema/table_socket_summary_by_instance.h index 961661b0e8a..8507b46db4f 100644 --- a/storage/perfschema/table_socket_summary_by_instance.h +++ b/storage/perfschema/table_socket_summary_by_instance.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_status_by_account.cc b/storage/perfschema/table_status_by_account.cc index 33878970dbc..941af9120a2 100644 --- a/storage/perfschema/table_status_by_account.cc +++ b/storage/perfschema/table_status_by_account.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_status_by_account.h b/storage/perfschema/table_status_by_account.h index 3da5077ebc6..c8d270c5926 100644 --- a/storage/perfschema/table_status_by_account.h +++ b/storage/perfschema/table_status_by_account.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_status_by_host.cc b/storage/perfschema/table_status_by_host.cc index d3de95e8f36..33109eff07a 100644 --- a/storage/perfschema/table_status_by_host.cc +++ b/storage/perfschema/table_status_by_host.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_status_by_host.h b/storage/perfschema/table_status_by_host.h index c697638bacf..4e28966c016 100644 --- a/storage/perfschema/table_status_by_host.h +++ b/storage/perfschema/table_status_by_host.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_status_by_thread.cc b/storage/perfschema/table_status_by_thread.cc index 0f1ac287783..89499a1f8e1 100644 --- a/storage/perfschema/table_status_by_thread.cc +++ b/storage/perfschema/table_status_by_thread.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_status_by_thread.h b/storage/perfschema/table_status_by_thread.h index c3f50941597..770490438f1 100644 --- a/storage/perfschema/table_status_by_thread.h +++ b/storage/perfschema/table_status_by_thread.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_status_by_user.cc b/storage/perfschema/table_status_by_user.cc index e00e3ac62b2..26a7ce28725 100644 --- a/storage/perfschema/table_status_by_user.cc +++ b/storage/perfschema/table_status_by_user.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_status_by_user.h b/storage/perfschema/table_status_by_user.h index 4cf348fdec7..1954b15d820 100644 --- a/storage/perfschema/table_status_by_user.h +++ b/storage/perfschema/table_status_by_user.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_sync_instances.cc b/storage/perfschema/table_sync_instances.cc index 85914894a33..5b9cd2cb5a6 100644 --- a/storage/perfschema/table_sync_instances.cc +++ b/storage/perfschema/table_sync_instances.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_sync_instances.h b/storage/perfschema/table_sync_instances.h index 1e429e78e09..a96d79df078 100644 --- a/storage/perfschema/table_sync_instances.h +++ b/storage/perfschema/table_sync_instances.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_table_handles.cc b/storage/perfschema/table_table_handles.cc index 26374ac37e0..b2e4e4e2ea9 100644 --- a/storage/perfschema/table_table_handles.cc +++ b/storage/perfschema/table_table_handles.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2012, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_table_handles.h b/storage/perfschema/table_table_handles.h index 3f2f8c5c1ad..7e184deb9a0 100644 --- a/storage/perfschema/table_table_handles.h +++ b/storage/perfschema/table_table_handles.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2012, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_threads.cc b/storage/perfschema/table_threads.cc index 379b97d91be..c138586ef44 100644 --- a/storage/perfschema/table_threads.cc +++ b/storage/perfschema/table_threads.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_threads.h b/storage/perfschema/table_threads.h index 723b2a18306..db27d973cd2 100644 --- a/storage/perfschema/table_threads.h +++ b/storage/perfschema/table_threads.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_tiws_by_index_usage.cc b/storage/perfschema/table_tiws_by_index_usage.cc index 22c106e0436..9dcfd691500 100644 --- a/storage/perfschema/table_tiws_by_index_usage.cc +++ b/storage/perfschema/table_tiws_by_index_usage.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_tiws_by_index_usage.h b/storage/perfschema/table_tiws_by_index_usage.h index fc82b6783f7..822de366bd2 100644 --- a/storage/perfschema/table_tiws_by_index_usage.h +++ b/storage/perfschema/table_tiws_by_index_usage.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_tiws_by_table.cc b/storage/perfschema/table_tiws_by_table.cc index 2b0d1e8365b..4fa073e4268 100644 --- a/storage/perfschema/table_tiws_by_table.cc +++ b/storage/perfschema/table_tiws_by_table.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_tiws_by_table.h b/storage/perfschema/table_tiws_by_table.h index ed7e5d9b235..908ca5e5eed 100644 --- a/storage/perfschema/table_tiws_by_table.h +++ b/storage/perfschema/table_tiws_by_table.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_tlws_by_table.cc b/storage/perfschema/table_tlws_by_table.cc index b4b181153b4..a0339eac2d6 100644 --- a/storage/perfschema/table_tlws_by_table.cc +++ b/storage/perfschema/table_tlws_by_table.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_tlws_by_table.h b/storage/perfschema/table_tlws_by_table.h index 87b4cf1db00..60bf458bc9d 100644 --- a/storage/perfschema/table_tlws_by_table.h +++ b/storage/perfschema/table_tlws_by_table.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_users.cc b/storage/perfschema/table_users.cc index d20e37ffa5c..04f6be7bb79 100644 --- a/storage/perfschema/table_users.cc +++ b/storage/perfschema/table_users.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_users.h b/storage/perfschema/table_users.h index 06db6e30267..3d8ea61686d 100644 --- a/storage/perfschema/table_users.h +++ b/storage/perfschema/table_users.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_uvar_by_thread.cc b/storage/perfschema/table_uvar_by_thread.cc index af53858ce4d..3ea2907fc2d 100644 --- a/storage/perfschema/table_uvar_by_thread.cc +++ b/storage/perfschema/table_uvar_by_thread.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_uvar_by_thread.h b/storage/perfschema/table_uvar_by_thread.h index 7be23458cc5..a6e29f9d34d 100644 --- a/storage/perfschema/table_uvar_by_thread.h +++ b/storage/perfschema/table_uvar_by_thread.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_variables_by_thread.cc b/storage/perfschema/table_variables_by_thread.cc index 7cfc19e7359..3174496998e 100644 --- a/storage/perfschema/table_variables_by_thread.cc +++ b/storage/perfschema/table_variables_by_thread.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/table_variables_by_thread.h b/storage/perfschema/table_variables_by_thread.h index a9e70388366..99adcda4e98 100644 --- a/storage/perfschema/table_variables_by_thread.h +++ b/storage/perfschema/table_variables_by_thread.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/CMakeLists.txt b/storage/perfschema/unittest/CMakeLists.txt index ec09a1136fc..6643ccb27d6 100644 --- a/storage/perfschema/unittest/CMakeLists.txt +++ b/storage/perfschema/unittest/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2022, Oracle and/or its affiliates. +# Copyright (c) 2009, 2023, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/conf.txt b/storage/perfschema/unittest/conf.txt index 678ec35d507..0cbca30eb47 100644 --- a/storage/perfschema/unittest/conf.txt +++ b/storage/perfschema/unittest/conf.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2022, Oracle and/or its affiliates. +# Copyright (c) 2009, 2023, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs-t.cc b/storage/perfschema/unittest/pfs-t.cc index 256fa144577..943c8273767 100644 --- a/storage/perfschema/unittest/pfs-t.cc +++ b/storage/perfschema/unittest/pfs-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_account-oom-t.cc b/storage/perfschema/unittest/pfs_account-oom-t.cc index 1ad451baad8..29187800034 100644 --- a/storage/perfschema/unittest/pfs_account-oom-t.cc +++ b/storage/perfschema/unittest/pfs_account-oom-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_connect_attr-t.cc b/storage/perfschema/unittest/pfs_connect_attr-t.cc index b626caca650..08124dcbefb 100644 --- a/storage/perfschema/unittest/pfs_connect_attr-t.cc +++ b/storage/perfschema/unittest/pfs_connect_attr-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_host-oom-t.cc b/storage/perfschema/unittest/pfs_host-oom-t.cc index c4aeb06981f..bd539623154 100644 --- a/storage/perfschema/unittest/pfs_host-oom-t.cc +++ b/storage/perfschema/unittest/pfs_host-oom-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_instr-oom-t.cc b/storage/perfschema/unittest/pfs_instr-oom-t.cc index 973d0d7e88a..5873a72bbd8 100644 --- a/storage/perfschema/unittest/pfs_instr-oom-t.cc +++ b/storage/perfschema/unittest/pfs_instr-oom-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_instr-t.cc b/storage/perfschema/unittest/pfs_instr-t.cc index be75937c262..d8c96a8c7cc 100644 --- a/storage/perfschema/unittest/pfs_instr-t.cc +++ b/storage/perfschema/unittest/pfs_instr-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc index 807fbf6c84d..b119c683406 100644 --- a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc +++ b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_instr_class-t.cc b/storage/perfschema/unittest/pfs_instr_class-t.cc index db4dc7f2770..41f24856649 100644 --- a/storage/perfschema/unittest/pfs_instr_class-t.cc +++ b/storage/perfschema/unittest/pfs_instr_class-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_misc-t.cc b/storage/perfschema/unittest/pfs_misc-t.cc index 8e1cb267c9a..a5823f972a6 100644 --- a/storage/perfschema/unittest/pfs_misc-t.cc +++ b/storage/perfschema/unittest/pfs_misc-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_noop-t.cc b/storage/perfschema/unittest/pfs_noop-t.cc index 079e138b349..e1d6f34243d 100644 --- a/storage/perfschema/unittest/pfs_noop-t.cc +++ b/storage/perfschema/unittest/pfs_noop-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2013, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_server_stubs.cc b/storage/perfschema/unittest/pfs_server_stubs.cc index fb5f41813f5..339686f83f6 100644 --- a/storage/perfschema/unittest/pfs_server_stubs.cc +++ b/storage/perfschema/unittest/pfs_server_stubs.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify diff --git a/storage/perfschema/unittest/pfs_timer-t.cc b/storage/perfschema/unittest/pfs_timer-t.cc index b64d488b5af..41e79c73ac7 100644 --- a/storage/perfschema/unittest/pfs_timer-t.cc +++ b/storage/perfschema/unittest/pfs_timer-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/pfs_user-oom-t.cc b/storage/perfschema/unittest/pfs_user-oom-t.cc index fe1563daa7b..63cb49bdaa8 100644 --- a/storage/perfschema/unittest/pfs_user-oom-t.cc +++ b/storage/perfschema/unittest/pfs_user-oom-t.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2011, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/stub_global_status_var.h b/storage/perfschema/unittest/stub_global_status_var.h index ddefe4de880..c9f4be01f1a 100644 --- a/storage/perfschema/unittest/stub_global_status_var.h +++ b/storage/perfschema/unittest/stub_global_status_var.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/stub_pfs_defaults.h b/storage/perfschema/unittest/stub_pfs_defaults.h index 592a30ea9a1..4b37c46fc28 100644 --- a/storage/perfschema/unittest/stub_pfs_defaults.h +++ b/storage/perfschema/unittest/stub_pfs_defaults.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2010, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/stub_pfs_global.h b/storage/perfschema/unittest/stub_pfs_global.h index 3ccb739ca1b..46a2d747fef 100644 --- a/storage/perfschema/unittest/stub_pfs_global.h +++ b/storage/perfschema/unittest/stub_pfs_global.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/perfschema/unittest/stub_print_error.h b/storage/perfschema/unittest/stub_print_error.h index ad6cc279b76..6c84ba4e360 100644 --- a/storage/perfschema/unittest/stub_print_error.h +++ b/storage/perfschema/unittest/stub_print_error.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2022, Oracle and/or its affiliates. +/* Copyright (c) 2008, 2023, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, From 8d26537fbf20d249d65d4daba0394a8ff71e540e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 28 Apr 2023 10:18:30 +0300 Subject: [PATCH 203/260] MDEV-30895 Assertion btr_cur->rtr_info->thr... in rtr_ins_enlarge_mbr() rtr_ins_enlarge_mbr(): Relax the assertion that was added in commit f27e9c894779a4c7ebe6446ba9aa408f1771c114 to cover also table-rebuilding DDL. We only need btr_cur->rtr_info->thr for acquiring R-tree locks, and the thread that is executing a DDL operation has exclusive access to the being-built index or the copy of the being-rebuilt table. --- .../suite/innodb_gis/r/rtree_optimize.result | 44 +++++++++++++++++++ .../suite/innodb_gis/t/rtree_optimize.test | 44 +++++++++++++++++++ storage/innobase/gis/gis0rtree.cc | 3 +- 3 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/innodb_gis/r/rtree_optimize.result create mode 100644 mysql-test/suite/innodb_gis/t/rtree_optimize.test diff --git a/mysql-test/suite/innodb_gis/r/rtree_optimize.result b/mysql-test/suite/innodb_gis/r/rtree_optimize.result new file mode 100644 index 00000000000..4abdb5f2cf4 --- /dev/null +++ b/mysql-test/suite/innodb_gis/r/rtree_optimize.result @@ -0,0 +1,44 @@ +CREATE TABLE t ( +id INT AUTO_INCREMENT, +c BINARY(226) DEFAULT '', +s POINT NOT NULL, +PRIMARY KEY(id,c) +) ENGINE=InnoDB; +INSERT INTO t (s) VALUES +(POINTFromText('POINT(0.78 0.72)')),(POINTFromText('POINT(0.44 0.21)')), +(POINTFromText('POINT(0.93 0.56)')),(POINTFromText('POINT(0.57 0.21)')), +(POINTFromText('POINT(0.12 0.65)')),(POINTFromText('POINT(0.20 0.96)')), +(POINTFromText('POINT(0.99 0.71)')),(POINTFromText('POINT(0.27 0.23)')), +(POINTFromText('POINT(0.68 0.14)')),(POINTFromText('POINT(0.20 0.05)')), +(POINTFromText('POINT(0.47 0.57)')),(POINTFromText('POINT(0.89 0.79)')), +(POINTFromText('POINT(0.09 0.57)')),(POINTFromText('POINT(0.58 0.52)')), +(POINTFromText('POINT(0.73 0.32)')),(POINTFromText('POINT(0.87 0.35)')), +(POINTFromText('POINT(0.60 0.12)')),(POINTFromText('POINT(0.14 0.17)')), +(POINTFromText('POINT(0.76 0.29)')),(POINTFromText('POINT(0.60 0.35)')), +(POINTFromText('POINT(0.48 0.69)')),(POINTFromText('POINT(0.79 0.45)')), +(POINTFromText('POINT(0.85 0.11)')),(POINTFromText('POINT(0.59 0.99)')), +(POINTFromText('POINT(0.95 0.18)')),(POINTFromText('POINT(0.78 0.49)')), +(POINTFromText('POINT(0.11 0.22)')),(POINTFromText('POINT(0.26 0.85)')), +(POINTFromText('POINT(0.28 0.10)')),(POINTFromText('POINT(0.45 0.25)')), +(POINTFromText('POINT(0.70 0.40)')),(POINTFromText('POINT(0.65 0.86)')), +(POINTFromText('POINT(0.69 0.98)')),(POINTFromText('POINT(0.56 0.11)')), +(POINTFromText('POINT(0.94 0.59)')),(POINTFromText('POINT(0.19 0.94)')), +(POINTFromText('POINT(0.82 0.85)')),(POINTFromText('POINT(0.74 0.07)')), +(POINTFromText('POINT(0.33 0.48)')),(POINTFromText('POINT(0.37 0.37)')), +(POINTFromText('POINT(0.40 0.08)')),(POINTFromText('POINT(0.45 0.74)')), +(POINTFromText('POINT(0.57 0.07)')),(POINTFromText('POINT(0.36 0.11)')), +(POINTFromText('POINT(0.94 0.60)')),(POINTFromText('POINT(0.75 0.76)')), +(POINTFromText('POINT(0.92 0.56)')),(POINTFromText('POINT(0.88 0.52)')), +(POINTFromText('POINT(0.49 0.24)')),(POINTFromText('POINT(0.96 0.08)')), +(POINTFromText('POINT(0.93 0.99)')),(POINTFromText('POINT(0.88 0.31)')), +(POINTFromText('POINT(0.93 0.78)')),(POINTFromText('POINT(0.62 0.50)')), +(POINTFromText('POINT(0.54 0.53)')),(POINTFromText('POINT(0.66 0.83)')), +(POINTFromText('POINT(0.21 0.87)')),(POINTFromText('POINT(0.42 0.28)')), +(POINTFromText('POINT(0.80 0.84)')),(POINTFromText('POINT(0.39 0.68)')), +(POINTFromText('POINT(0.05 0.24)')),(POINTFromText('POINT(0.05 0.58)')); +ALTER TABLE t ADD SPATIAL INDEX(s); +OPTIMIZE TABLE t; +Table Op Msg_type Msg_text +test.t optimize note Table does not support optimize, doing recreate + analyze instead +test.t optimize status OK +DROP TABLE t; diff --git a/mysql-test/suite/innodb_gis/t/rtree_optimize.test b/mysql-test/suite/innodb_gis/t/rtree_optimize.test new file mode 100644 index 00000000000..c3de282da27 --- /dev/null +++ b/mysql-test/suite/innodb_gis/t/rtree_optimize.test @@ -0,0 +1,44 @@ +--source include/have_innodb.inc + +CREATE TABLE t ( + id INT AUTO_INCREMENT, + c BINARY(226) DEFAULT '', + s POINT NOT NULL, + PRIMARY KEY(id,c) +) ENGINE=InnoDB; +INSERT INTO t (s) VALUES + (POINTFromText('POINT(0.78 0.72)')),(POINTFromText('POINT(0.44 0.21)')), + (POINTFromText('POINT(0.93 0.56)')),(POINTFromText('POINT(0.57 0.21)')), + (POINTFromText('POINT(0.12 0.65)')),(POINTFromText('POINT(0.20 0.96)')), + (POINTFromText('POINT(0.99 0.71)')),(POINTFromText('POINT(0.27 0.23)')), + (POINTFromText('POINT(0.68 0.14)')),(POINTFromText('POINT(0.20 0.05)')), + (POINTFromText('POINT(0.47 0.57)')),(POINTFromText('POINT(0.89 0.79)')), + (POINTFromText('POINT(0.09 0.57)')),(POINTFromText('POINT(0.58 0.52)')), + (POINTFromText('POINT(0.73 0.32)')),(POINTFromText('POINT(0.87 0.35)')), + (POINTFromText('POINT(0.60 0.12)')),(POINTFromText('POINT(0.14 0.17)')), + (POINTFromText('POINT(0.76 0.29)')),(POINTFromText('POINT(0.60 0.35)')), + (POINTFromText('POINT(0.48 0.69)')),(POINTFromText('POINT(0.79 0.45)')), + (POINTFromText('POINT(0.85 0.11)')),(POINTFromText('POINT(0.59 0.99)')), + (POINTFromText('POINT(0.95 0.18)')),(POINTFromText('POINT(0.78 0.49)')), + (POINTFromText('POINT(0.11 0.22)')),(POINTFromText('POINT(0.26 0.85)')), + (POINTFromText('POINT(0.28 0.10)')),(POINTFromText('POINT(0.45 0.25)')), + (POINTFromText('POINT(0.70 0.40)')),(POINTFromText('POINT(0.65 0.86)')), + (POINTFromText('POINT(0.69 0.98)')),(POINTFromText('POINT(0.56 0.11)')), + (POINTFromText('POINT(0.94 0.59)')),(POINTFromText('POINT(0.19 0.94)')), + (POINTFromText('POINT(0.82 0.85)')),(POINTFromText('POINT(0.74 0.07)')), + (POINTFromText('POINT(0.33 0.48)')),(POINTFromText('POINT(0.37 0.37)')), + (POINTFromText('POINT(0.40 0.08)')),(POINTFromText('POINT(0.45 0.74)')), + (POINTFromText('POINT(0.57 0.07)')),(POINTFromText('POINT(0.36 0.11)')), + (POINTFromText('POINT(0.94 0.60)')),(POINTFromText('POINT(0.75 0.76)')), + (POINTFromText('POINT(0.92 0.56)')),(POINTFromText('POINT(0.88 0.52)')), + (POINTFromText('POINT(0.49 0.24)')),(POINTFromText('POINT(0.96 0.08)')), + (POINTFromText('POINT(0.93 0.99)')),(POINTFromText('POINT(0.88 0.31)')), + (POINTFromText('POINT(0.93 0.78)')),(POINTFromText('POINT(0.62 0.50)')), + (POINTFromText('POINT(0.54 0.53)')),(POINTFromText('POINT(0.66 0.83)')), + (POINTFromText('POINT(0.21 0.87)')),(POINTFromText('POINT(0.42 0.28)')), + (POINTFromText('POINT(0.80 0.84)')),(POINTFromText('POINT(0.39 0.68)')), + (POINTFromText('POINT(0.05 0.24)')),(POINTFromText('POINT(0.05 0.58)')); +ALTER TABLE t ADD SPATIAL INDEX(s); +OPTIMIZE TABLE t; +# Cleanup +DROP TABLE t; diff --git a/storage/innobase/gis/gis0rtree.cc b/storage/innobase/gis/gis0rtree.cc index 60218a132c9..f75eab07cf3 100644 --- a/storage/innobase/gis/gis0rtree.cc +++ b/storage/innobase/gis/gis0rtree.cc @@ -1468,7 +1468,8 @@ rtr_ins_enlarge_mbr( /* Check path info is not empty. */ ut_ad(!btr_cur->rtr_info->parent_path->empty()); - ut_ad(btr_cur->rtr_info->thr || !btr_cur->index()->is_committed()); + ut_ad(btr_cur->rtr_info->thr || !btr_cur->index()->is_committed() + || btr_cur->index()->table->name.is_temporary()); /* Create a memory heap. */ heap = mem_heap_create(1024); From 7d967423fe2fd061c51f43230e0286cf7868c5b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 28 Apr 2023 12:15:45 +0300 Subject: [PATCH 204/260] MDEV-31147 json_normalize does not work correctly with MSAN build json_normalize_number(): Avoid accessing str past str_len. The function would seem to work incorrectly when some digits are not followed by a decimal point (.) or an exponent (E or e). --- mysql-test/main/func_json.result | 13 +++++++++++++ mysql-test/main/func_json.test | 13 +++++++++++++ strings/json_normalize.c | 17 ++++++++++------- 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/mysql-test/main/func_json.result b/mysql-test/main/func_json.result index 7d60801abec..73cc64d95aa 100644 --- a/mysql-test/main/func_json.result +++ b/mysql-test/main/func_json.result @@ -1673,3 +1673,16 @@ DROP TABLE t; # # End of 10.6 tests # +# +# MDEV-31147 json_normalize does not work correctly with MSAN build +# +CREATE TABLE t1 (val JSON); +ALTER TABLE t1 ADD COLUMN normalized_json JSON AS (JSON_NORMALIZE(val)); +INSERT INTO t1 (val) VALUES ('15'); +SELECT * FROM t1; +val normalized_json +15 1.5E1 +DROP TABLE t1; +# +# End of 10.8 tests +# diff --git a/mysql-test/main/func_json.test b/mysql-test/main/func_json.test index 9f6c51cbc27..1f61f9abd13 100644 --- a/mysql-test/main/func_json.test +++ b/mysql-test/main/func_json.test @@ -1112,3 +1112,16 @@ DROP TABLE t; --echo # --echo # End of 10.6 tests --echo # + +--echo # +--echo # MDEV-31147 json_normalize does not work correctly with MSAN build +--echo # +CREATE TABLE t1 (val JSON); +ALTER TABLE t1 ADD COLUMN normalized_json JSON AS (JSON_NORMALIZE(val)); +INSERT INTO t1 (val) VALUES ('15'); +SELECT * FROM t1; +DROP TABLE t1; + +--echo # +--echo # End of 10.8 tests +--echo # diff --git a/strings/json_normalize.c b/strings/json_normalize.c index 0b7f172dae6..2c66c712e81 100644 --- a/strings/json_normalize.c +++ b/strings/json_normalize.c @@ -147,13 +147,16 @@ json_normalize_number(DYNAMIC_STRING *out, const char *str, size_t str_len) magnitude = (long)(j - 1); - /* skip the . */ - if (str[i] == '.') - ++i; + if (i < str_len) + { + /* skip the . */ + if (str[i] == '.') + ++i; - /* grab rest of digits before the E */ - for (; i < str_len && str[i] != 'e' && str[i] != 'E'; ++i) - buf[j++] = str[i]; + /* grab rest of digits before the E */ + for (; i < str_len && str[i] != 'e' && str[i] != 'E'; ++i) + buf[j++] = str[i]; + } /* trim trailing zeros */ for (k = j - 1; k && buf[k] == '0'; --k, --j) @@ -187,7 +190,7 @@ json_normalize_number(DYNAMIC_STRING *out, const char *str, size_t str_len) err|= dynstr_append_mem(out, STRING_WITH_LEN("E")); - if (str[i] == 'e' || str[i] == 'E') + if (i < str_len && (str[i] == 'e' || str[i] == 'E')) { char *endptr = NULL; /* skip the [eE] */ From bc970573b38e87a3087c8d7b2252c42e87b7cebb Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 28 Apr 2023 11:25:31 +0200 Subject: [PATCH 205/260] MDEV-22756 SQL Error (1364): Field 'DB_ROW_HASH_1' doesn't have a default value exclude generated columns from the "has default value" check --- mysql-test/main/long_unique_bugs.result | 6 ++++++ mysql-test/main/long_unique_bugs.test | 7 +++++++ sql/sql_insert.cc | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/mysql-test/main/long_unique_bugs.result b/mysql-test/main/long_unique_bugs.result index 0071beb7a24..eb60f79ac67 100644 --- a/mysql-test/main/long_unique_bugs.result +++ b/mysql-test/main/long_unique_bugs.result @@ -448,5 +448,11 @@ a b 1 xxx drop table t1; # +# MDEV-22756 SQL Error (1364): Field 'DB_ROW_HASH_1' doesn't have a default value +# +create table t1 (f text not null, unique (f)); +insert into t1 (f) select 'f'; +drop table t1; +# # End of 10.4 tests # diff --git a/mysql-test/main/long_unique_bugs.test b/mysql-test/main/long_unique_bugs.test index f594038c375..c6cfd5f006a 100644 --- a/mysql-test/main/long_unique_bugs.test +++ b/mysql-test/main/long_unique_bugs.test @@ -442,6 +442,13 @@ insert into t1 (a,b) select 1,'xxx' from seq_1_to_5; select * from t1; drop table t1; +--echo # +--echo # MDEV-22756 SQL Error (1364): Field 'DB_ROW_HASH_1' doesn't have a default value +--echo # +create table t1 (f text not null, unique (f)); +insert into t1 (f) select 'f'; +drop table t1; + --echo # --echo # End of 10.4 tests --echo # diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 9a760614f6a..424296efcf5 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -2134,7 +2134,7 @@ int check_that_all_fields_are_given_values(THD *thd, TABLE *entry, TABLE_LIST *t for (Field **field=entry->field ; *field ; field++) { if (!bitmap_is_set(write_set, (*field)->field_index) && - !(*field)->vers_sys_field() && + !(*field)->vers_sys_field() && !(*field)->vcol_info && has_no_default_value(thd, *field, table_list) && ((*field)->real_type() != MYSQL_TYPE_ENUM)) err=1; From 4329ec5d3b109cb0bcbee151b5800dc7b19d1945 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Thu, 9 Mar 2023 17:04:07 +0300 Subject: [PATCH 206/260] MDEV-30812: Improve output cardinality estimates for hash join Introduce @@optimizer_switch flag: hash_join_cardinality When it is on, use EITS statistics to produce tighter bounds for hash join output cardinality. Amended by Monty. Reviewed by: Monty --- mysql-test/main/join_cache_cardinality.result | 105 ++++++++ mysql-test/main/join_cache_cardinality.test | 41 ++++ mysql-test/main/mysqld--help.result | 3 +- .../main/mysqltest_tracking_info.result | 2 +- .../sys_vars/r/optimizer_switch_basic.result | 32 +-- .../sys_vars/r/sysvars_server_embedded.result | 2 +- .../r/sysvars_server_notembedded.result | 2 +- sql/sql_priv.h | 1 + sql/sql_select.cc | 227 +++++++++++++++--- sql/sys_vars.cc | 1 + 10 files changed, 363 insertions(+), 53 deletions(-) create mode 100644 mysql-test/main/join_cache_cardinality.result create mode 100644 mysql-test/main/join_cache_cardinality.test diff --git a/mysql-test/main/join_cache_cardinality.result b/mysql-test/main/join_cache_cardinality.result new file mode 100644 index 00000000000..0a76080e601 --- /dev/null +++ b/mysql-test/main/join_cache_cardinality.result @@ -0,0 +1,105 @@ +create table t1 (a int, b int, c int); +insert into t1 select seq,seq/2, seq/4 from seq_1_to_100; +create table t2 (a int, b int, c int); +insert into t2 select seq, seq/2, seq/4 from seq_1_to_200; +analyze table t1,t2 persistent for all; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status OK +set optimizer_trace=1; +set join_cache_level=6; +set optimizer_switch='hash_join_cardinality=on'; +explain select * +from t1, t2 +where t1.a=t2.a and t1.a=t2.b and t1.c=t2.c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where +1 SIMPLE t2 hash_ALL NULL #hash#$hj 15 test.t1.a,test.t1.a,test.t1.c 200 Using where; Using join buffer (flat, BNLH join) +set @json= (select trace from information_schema.optimizer_trace); +select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS; +JS +[ + { + "hash_join_columns": + [ + { + "field": "a", + "avg_frequency": 1 + }, + { + "field": "b", + "avg_frequency": 2 + }, + { + "field": "c", + "avg_frequency": 3.9216 + } + ], + "rows": 1 + } +] +select json_detailed(json_extract(@json, '$**.rest_of_plan[*].rows_for_plan')) +as ROWS_FOR_PLAN; +ROWS_FOR_PLAN +[100] +explain select * +from t1, t2 where t1.c=t2.c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where +1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.c 200 Using where; Using join buffer (flat, BNLH join) +set @json= (select trace from information_schema.optimizer_trace); +select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS; +JS +[ + { + "hash_join_columns": + [ + { + "field": "c", + "avg_frequency": 3.9216 + } + ], + "rows": 3.9216 + } +] +select json_detailed(json_extract(@json, '$**.rest_of_plan[*].rows_for_plan')) +as ROWS_FOR_PLAN; +ROWS_FOR_PLAN +[392.16] +explain select * +from t1 straight_join t2 where t1.c=t2.c and t2.a<30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where +1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.c 200 Using where; Using join buffer (flat, BNLH join) +set @json= (select trace from information_schema.optimizer_trace); +# Note that rows is the same: +select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS; +JS +[ + { + "hash_join_columns": + [ + { + "field": "c", + "avg_frequency": 3.9216 + } + ], + "rows": 3.9216 + } +] +# Despite available selectivity: +select json_detailed(json_extract(@json, '$**.selectivity_for_columns')) as JS; +JS +[ + [ + { + "column_name": "a", + "ranges": + ["NULL < a < 30"], + "selectivity_from_histogram": 0.1484375 + } + ] +] +drop table t1,t2; diff --git a/mysql-test/main/join_cache_cardinality.test b/mysql-test/main/join_cache_cardinality.test new file mode 100644 index 00000000000..b178810b807 --- /dev/null +++ b/mysql-test/main/join_cache_cardinality.test @@ -0,0 +1,41 @@ +--source include/have_sequence.inc + +# Embedded doesn't have optimizer trace: +--source include/not_embedded.inc + +create table t1 (a int, b int, c int); +insert into t1 select seq,seq/2, seq/4 from seq_1_to_100; + +create table t2 (a int, b int, c int); +insert into t2 select seq, seq/2, seq/4 from seq_1_to_200; + +analyze table t1,t2 persistent for all; + +set optimizer_trace=1; +set join_cache_level=6; +set optimizer_switch='hash_join_cardinality=on'; +explain select * +from t1, t2 +where t1.a=t2.a and t1.a=t2.b and t1.c=t2.c; + +set @json= (select trace from information_schema.optimizer_trace); +select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS; +select json_detailed(json_extract(@json, '$**.rest_of_plan[*].rows_for_plan')) +as ROWS_FOR_PLAN; + +explain select * +from t1, t2 where t1.c=t2.c; +set @json= (select trace from information_schema.optimizer_trace); +select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS; +select json_detailed(json_extract(@json, '$**.rest_of_plan[*].rows_for_plan')) +as ROWS_FOR_PLAN; + +explain select * +from t1 straight_join t2 where t1.c=t2.c and t2.a<30; +set @json= (select trace from information_schema.optimizer_trace); +--echo # Note that rows is the same: +select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS; + +--echo # Despite available selectivity: +select json_detailed(json_extract(@json, '$**.selectivity_for_columns')) as JS; +drop table t1,t2; diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result index 9d3cbae2c84..5c1a8840fa5 100644 --- a/mysql-test/main/mysqld--help.result +++ b/mysql-test/main/mysqld--help.result @@ -734,7 +734,8 @@ The following specify which files/extra groups are read (specified before remain extended_keys, exists_to_in, orderby_uses_equalities, condition_pushdown_for_derived, split_materialized, condition_pushdown_for_subquery, rowid_filter, - condition_pushdown_from_having, not_null_range_scan + condition_pushdown_from_having, not_null_range_scan, + hash_join_cardinality --optimizer-trace=name Controls tracing of the Optimizer: optimizer_trace=option=val[,option=val...], where option diff --git a/mysql-test/main/mysqltest_tracking_info.result b/mysql-test/main/mysqltest_tracking_info.result index 61bb3f2d1e2..791f2a2b4a4 100644 --- a/mysql-test/main/mysqltest_tracking_info.result +++ b/mysql-test/main/mysqltest_tracking_info.result @@ -38,7 +38,7 @@ SET @@session.session_track_system_variables='optimizer_switch'; set optimizer_switch='index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off'; -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES -- optimizer_switch --- index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off +-- index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=off Warnings: Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release diff --git a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result index 80bd2d7af5f..7f2e1c6586c 100644 --- a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result +++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result @@ -1,60 +1,60 @@ set @@global.optimizer_switch=@@optimizer_switch; select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=off select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=off show global variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off +optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=off show session variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off +optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=off select * from information_schema.global_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off +OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=off select * from information_schema.session_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off +OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=off set global optimizer_switch=4101; set session optimizer_switch=2058; select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off +index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off +index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off set global optimizer_switch="index_merge_sort_union=on"; set session optimizer_switch="index_merge=off"; select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off +index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off +index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off show global variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off +optimizer_switch index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off show session variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off +optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off select * from information_schema.global_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off +OPTIMIZER_SWITCH index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off select * from information_schema.session_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off +OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off set session optimizer_switch="default"; select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off +index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off set optimizer_switch = replace(@@optimizer_switch, '=off', '=on'); Warnings: Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release select @@optimizer_switch; @@optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=on,hash_join_cardinality=on set global optimizer_switch=1.1; ERROR 42000: Incorrect argument type to variable 'optimizer_switch' set global optimizer_switch=1e1; diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result index b15fcc318a2..40da0c920be 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result @@ -2299,7 +2299,7 @@ VARIABLE_COMMENT Fine-tune the optimizer behavior NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,split_materialized,condition_pushdown_for_subquery,rowid_filter,condition_pushdown_from_having,not_null_range_scan,default +ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,split_materialized,condition_pushdown_for_subquery,rowid_filter,condition_pushdown_from_having,not_null_range_scan,hash_join_cardinality,default READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_TRACE diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index 7193d0510e1..2e3173a2544 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -2459,7 +2459,7 @@ VARIABLE_COMMENT Fine-tune the optimizer behavior NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,split_materialized,condition_pushdown_for_subquery,rowid_filter,condition_pushdown_from_having,not_null_range_scan,default +ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,split_materialized,condition_pushdown_for_subquery,rowid_filter,condition_pushdown_from_having,not_null_range_scan,hash_join_cardinality,default READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_TRACE diff --git a/sql/sql_priv.h b/sql/sql_priv.h index a304cd39df7..76260ec51e7 100644 --- a/sql/sql_priv.h +++ b/sql/sql_priv.h @@ -234,6 +234,7 @@ #define OPTIMIZER_SWITCH_USE_ROWID_FILTER (1ULL << 33) #define OPTIMIZER_SWITCH_COND_PUSHDOWN_FROM_HAVING (1ULL << 34) #define OPTIMIZER_SWITCH_NOT_NULL_RANGE_SCAN (1ULL << 35) +#define OPTIMIZER_SWITCH_HASH_JOIN_CARDINALITY (1ULL << 36) #define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \ OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \ diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 65e36ac68db..d502fafdfae 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7597,20 +7597,28 @@ void set_position(JOIN *join,uint idx,JOIN_TAB *table,KEYUSE *key) Estimate how many records we will get if we read just this table and apply a part of WHERE that can be checked for it. + @param s Current JOIN_TAB + @param use_cond_selectivity Value of optimizer_use_condition_selectivity. + If > 1 then use table->cond_selecitivity. + @param force_estiamte Set to 1 if we should not call + use_found_constraint. To be deleted in 11.0 + @return 0.0 No matching rows + @return >= 1.0 Number of expected matching rows + @detail Estimate how many records we will get if we - read the given table with its "independent" access method (either quick select or full table/index scan), - apply the part of WHERE that refers only to this table. - @seealso + @see also table_cond_selectivity() produces selectivity of condition that is checked after joining rows from this table to rows from preceding tables. */ -inline -double matching_candidates_in_table(JOIN_TAB *s, bool with_found_constraint, - uint use_cond_selectivity) +static double apply_selectivity_for_table(JOIN_TAB *s, + uint use_cond_selectivity, + bool *force_estimate) { ha_rows records; double dbl_records; @@ -7621,34 +7629,47 @@ double matching_candidates_in_table(JOIN_TAB *s, bool with_found_constraint, double sel= table->cond_selectivity; double table_records= rows2double(s->records); dbl_records= table_records * sel; + *force_estimate= 1; // Don't call use_found_constraint() return dbl_records; } records = s->found_records; /* - If there is a filtering condition on the table (i.e. ref analyzer found - at least one "table.keyXpartY= exprZ", where exprZ refers only to tables - preceding this table in the join order we're now considering), then - assume that 25% of the rows will be filtered out by this condition. - - This heuristic is supposed to force tables used in exprZ to be before - this table in join order. + If applicable, get a more accurate estimate. */ - if (with_found_constraint) - records-= records/4; - - /* - If applicable, get a more accurate estimate. Don't use the two - heuristics at once. - */ + DBUG_ASSERT(s->table->opt_range_condition_rows <= s->found_records); if (s->table->opt_range_condition_rows != s->found_records) + { + *force_estimate= 1; // Don't call use_found_constraint() records= s->table->opt_range_condition_rows; + } dbl_records= (double)records; return dbl_records; } +/* + Take into account that the table's WHERE clause has conditions on earlier + tables that can reduce the number of accepted rows. + + @param records Number of original rows (after selectivity) + + If there is a filtering condition on the table (i.e. ref analyzer found + at least one "table.keyXpartY= exprZ", where exprZ refers only to tables + preceding this table in the join order we're now considering), then + assume that 25% of the rows will be filtered out by this condition. + + This heuristic is supposed to force tables used in exprZ to be before + this table in join order. +*/ + +inline double use_found_constraint(double records) +{ + records-= records/4; + return records; +} + /* Calculate the cost of reading a set of rows trough an index @@ -7705,6 +7726,92 @@ double adjust_quick_cost(double quick_cost, ha_rows records) } +/* + @brief + Compute the fanout of hash join operation using EITS data +*/ + +double hash_join_fanout(JOIN *join, JOIN_TAB *s, table_map remaining_tables, + double rnd_records, KEYUSE *hj_start_key, + bool *stats_found) +{ + THD *thd= join->thd; + /* + Before doing the hash join, we will scan the table and apply the local part + of the WHERE condition. This will produce rnd_records. + + The EITS statistics describes the entire table. Calling + + table->field[N]->get_avg_frequency() + + produces average #rows in the table with some value. + + What happens if we filter out rows so that rnd_records rows are left? + Something between the two outcomes: + A. filtering removes a fraction of rows for each value: + avg_frequency=avg_frequency * condition_selectivity + + B. filtering removes entire groups of rows with the same value, but + the remaining groups remain of the same size. + + We make pessimistic assumption and assume B. + We also handle an edge case: if rnd_records is less than avg_frequency, + assume we'll get rnd_records rows with the same value, and return + rnd_records as the fanout estimate. + */ + double min_freq= rnd_records; + + Json_writer_object trace_obj(thd, "hash_join_cardinality"); + /* + There can be multiple KEYUSE referring to same or different columns + + KEYUSE(tbl.col1 = ...) + KEYUSE(tbl.col1 = ...) + KEYUSE(tbl.col2 = ...) + + Hash join code can use multiple columns: (col1, col2) for joining. + We need n_distinct({col1, col2}). + + EITS only has statistics on individual columns: n_distinct(col1), + n_distinct(col2). + + Our current solution is to be very conservative and use selectivity + of one column with the lowest avg_frequency. + + In the future, we should an approach that cautiosly takes into account + multiple KEYUSEs either multiply by number of equalities or by sqrt + of the second most selective equality. + */ + Json_writer_array trace_arr(thd, "hash_join_columns"); + for (KEYUSE *keyuse= hj_start_key; + keyuse->table == s->table && is_hash_join_key_no(keyuse->key); + keyuse++) + { + if (!(remaining_tables & keyuse->used_tables) && + (!keyuse->validity_ref || *keyuse->validity_ref) && + s->access_from_tables_is_allowed(keyuse->used_tables, + join->sjm_lookup_tables)) + { + Field *field= s->table->field[keyuse->keypart]; + if (is_eits_usable(field)) + { + double freq= field->read_stats->get_avg_frequency(); + + Json_writer_object trace_field(thd); + trace_field.add("field",field->field_name.str). + add("avg_frequency", freq); + if (freq < min_freq) + min_freq= freq; + *stats_found= 1; + } + } + } + trace_arr.end(); + trace_obj.add("rows", min_freq); + return min_freq; +} + + /** Find the best access path for an extension of a partial execution plan and add this path to the plan. @@ -8399,11 +8506,44 @@ best_access_path(JOIN *join, (!(s->table->map & join->outer_join) || join->allowed_outer_join_with_cache)) // (2) { + double fanout; Json_writer_object trace_access_hash(thd); - double join_sel= 0.1; + trace_access_hash.add("type", "hash"); + trace_access_hash.add("index", "hj-key"); + double join_sel; + bool stats_found= 0, force_estimate= 0; /* Estimate the cost of the hash join access to the table */ - double rnd_records= matching_candidates_in_table(s, found_constraint, - use_cond_selectivity); + double rnd_records= apply_selectivity_for_table(s, use_cond_selectivity, + &force_estimate); + + DBUG_ASSERT(hj_start_key); + if (optimizer_flag(thd, OPTIMIZER_SWITCH_HASH_JOIN_CARDINALITY)) + { + /* + Starting from this point, rnd_records should not be used anymore. + Use "fanout" for an estimate of # matching records. + */ + fanout= hash_join_fanout(join, s, remaining_tables, rnd_records, + hj_start_key, &stats_found); + join_sel= 1.0; // Don't do the "10% heuristic" + } + if (!stats_found) + { + /* + No OPTIMIZER_SWITCH_HASH_JOIN_CARDINALITY or no field statistics + found. + + Take into account if there is non constant constraints used with + earlier tables in the where expression. + If yes, this will set fanout to rnd_records/4. + We estimate that there will be HASH_FANOUT (10%) + hash matches / row. + */ + if (found_constraint && !force_estimate) + rnd_records= use_found_constraint(rnd_records); + fanout= rnd_records; + join_sel= 0.1; + } tmp= s->quick ? s->quick->read_time : s->scan_time(); double cmp_time= (s->records - rnd_records)/TIME_FOR_COMPARE; @@ -8415,19 +8555,36 @@ best_access_path(JOIN *join, record_count / (double) thd->variables.join_buff_size)); tmp= COST_MULT(tmp, refills); - best_time= COST_ADD(tmp, - COST_MULT((record_count*join_sel) / TIME_FOR_COMPARE, - rnd_records)); + + // Add cost of reading/writing the join buffer + if (optimizer_flag(thd, OPTIMIZER_SWITCH_HASH_JOIN_CARDINALITY)) + { + /* Set it to be 1/10th of TIME_FOR_COMPARE */ + double row_copy_cost= 1.0 / (10*TIME_FOR_COMPARE); + double join_buffer_operations= + COST_ADD( + COST_MULT(record_count, row_copy_cost), + COST_MULT(record_count, fanout * (idx - join->const_tables)) + ); + double jbuf_use_cost= row_copy_cost * join_buffer_operations; + trace_access_hash.add("jbuf_use_cost", jbuf_use_cost); + tmp= COST_ADD(tmp, jbuf_use_cost); + } + + double where_cost= COST_MULT((fanout*join_sel) / TIME_FOR_COMPARE, + record_count); + trace_access_hash.add("extra_cond_check_cost", where_cost); + + best_time= COST_ADD(tmp, where_cost); + best= tmp; - records= rnd_records; + records= fanout; best_key= hj_start_key; best_ref_depends_map= 0; best_uses_jbuf= TRUE; best_filter= 0; best_type= JT_HASH; - trace_access_hash.add("type", "hash"); - trace_access_hash.add("index", "hj-key"); - trace_access_hash.add("cost", rnd_records); + trace_access_hash.add("records", records); trace_access_hash.add("cost", best); trace_access_hash.add("chosen", true); } @@ -8479,9 +8636,13 @@ best_access_path(JOIN *join, !(s->table->force_index && best_key && !s->quick) && // (4) !(best_key && s->table->pos_in_table_list->jtbm_subselect)) // (5) { // Check full join - double rnd_records= matching_candidates_in_table(s, found_constraint, - use_cond_selectivity); - + bool force_estimate= 0; + double rnd_records= apply_selectivity_for_table(s, + use_cond_selectivity, + &force_estimate); + rnd_records= ((found_constraint && !force_estimate) ? + use_found_constraint(rnd_records) : + rnd_records); /* Range optimizer never proposes a RANGE if it isn't better than FULL: so if RANGE is present, it's always preferred to FULL. @@ -9698,7 +9859,7 @@ double table_multi_eq_cond_selectivity(JOIN *join, uint idx, JOIN_TAB *s, with previous tables. For quick selects and full table scans, selectivity of COND(this_table) - is accounted for in matching_candidates_in_table(). Here, we only count + is accounted for in apply_selectivity_for_table(). Here, we only count selectivity of COND(this_table, previous_tables). For other access methods, we need to calculate selectivity of the whole @@ -9900,7 +10061,7 @@ double table_cond_selectivity(JOIN *join, uint idx, JOIN_TAB *s, /* The table is accessed with full table scan, or quick select. Selectivity of COND(table) is already accounted for in - matching_candidates_in_table(). + apply_selectivity_for_table(). */ sel= 1; } diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 2dbfe1bdeec..29cd5809ea1 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -2756,6 +2756,7 @@ export const char *optimizer_switch_names[]= "rowid_filter", "condition_pushdown_from_having", "not_null_range_scan", + "hash_join_cardinality", "default", NullS }; From 85cc83188059d0cd280aa9f9e290dc8f025a4c3c Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Wed, 19 Apr 2023 15:15:27 +0300 Subject: [PATCH 207/260] MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram Variant #2. When Histogram::point_selectivity() sees that the point value of interest falls into one bucket, it tries to guess whether the bucket has many different (unpopular) values or a few popular values. (The number of rows is fixed, as it's a Height-balanced histogram). The basis for this guess is the "width" of the value range the bucket covers. Buckets covering wider value ranges are assumed to contain values with proportionally lower frequencies. This is just a [brave] guesswork. For a very narrow bucket, it may produce an estimate that's larger than total #rows in the bucket or even in the whole table. Remove the guesswork and replace it with basic logic: return either the per-table average selectivity of col=const, or selectivity of one bucket, whichever is lower. --- mysql-test/main/selectivity.result | 77 +++++++++++++++++- mysql-test/main/selectivity.test | 85 +++++++++++++++++++- mysql-test/main/selectivity_innodb.result | 75 ++++++++++++++++- mysql-test/main/selectivity_no_engine.result | 6 +- sql/sql_statistics.cc | 44 ++-------- 5 files changed, 234 insertions(+), 53 deletions(-) diff --git a/mysql-test/main/selectivity.result b/mysql-test/main/selectivity.result index 0b922609916..7d7343847cd 100644 --- a/mysql-test/main/selectivity.result +++ b/mysql-test/main/selectivity.result @@ -834,7 +834,7 @@ flush table t1; set optimizer_use_condition_selectivity=4; explain extended select * from t1 where a=0; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1025 0.39 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 1025 0.78 Using where Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 0 drop table t1; @@ -1649,7 +1649,7 @@ test.t1 analyze status Table is already up to date # Check what info the optimizer has about selectivities explain extended select * from t1 use index () where a in (17,51,5); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 3.90 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 3.91 Using where Warnings: Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` USE INDEX () where `test`.`t1`.`a` in (17,51,5) explain extended select * from t1 use index () where b=2; @@ -1935,9 +1935,78 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 25.00 Using where Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 +DROP TABLE t1; +# End of 10.2 tests +# +# MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram +# +create table t0(a int); +insert into t0 select 1 from seq_1_to_78; +create table t1(a int); +insert into t1 select 1 from seq_1_to_26; +create table t10 (a int); +insert into t10 select 0 from t0, seq_1_to_4; +insert into t10 select 8693 from t1; +insert into t10 select 8694 from t1; +insert into t10 select 8695 from t1; +insert into t10 select 34783 from t1; +insert into t10 select 34784 from t1; +insert into t10 select 34785 from t1; +insert into t10 select 34785 from t0, seq_1_to_8; +insert into t10 select 65214 from t1; +insert into t10 select 65215 from t1; +insert into t10 select 65216 from t1; +insert into t10 select 65216 from t0, seq_1_to_52; +insert into t10 select 65217 from t1; +insert into t10 select 65218 from t1; +insert into t10 select 65219 from t1; +insert into t10 select 65219 from t0; +insert into t10 select 73913 from t1; +insert into t10 select 73914 from t1; +insert into t10 select 73915 from t1; +insert into t10 select 73915 from t0, seq_1_to_40; +insert into t10 select 78257 from t1; +insert into t10 select 78258 from t1; +insert into t10 select 78259 from t1; +insert into t10 select 91300 from t1; +insert into t10 select 91301 from t1; +insert into t10 select 91302 from t1; +insert into t10 select 91302 from t0, seq_1_to_6; +insert into t10 select 91303 from t1; +insert into t10 select 91304 from t1; +insert into t10 select 91305 from t1; +insert into t10 select 91305 from t0, seq_1_to_8; +insert into t10 select 99998 from t1; +insert into t10 select 99999 from t1; +insert into t10 select 100000 from t1; +set use_stat_tables=preferably; +analyze table t10 persistent for all; +Table Op Msg_type Msg_text +test.t10 analyze status Engine-independent statistics collected +test.t10 analyze status OK +flush tables; +set @tmp=@@optimizer_trace; +set optimizer_trace=1; +explain select * from t10 where a in (91303); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t10 ALL NULL NULL NULL NULL 9984 Using where +# Must have selectivity_from_histogram <= 1.0: +select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) +from information_schema.optimizer_trace; +json_detailed(json_extract(trace, '$**.selectivity_for_columns')) +[ + [ + { + "column_name": "a", + "ranges": + ["91303 <= a <= 91303"], + "selectivity_from_histogram": 0.0357 + } + ] +] +set optimizer_trace=@tmp; +drop table t0,t1,t10; set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; set histogram_size=@save_histogram_size; set use_stat_tables= @save_use_stat_tables; -DROP TABLE t1; -# End of 10.2 tests set @@global.histogram_size=@save_histogram_size; diff --git a/mysql-test/main/selectivity.test b/mysql-test/main/selectivity.test index 9c82a8d37a7..06a3e32da95 100644 --- a/mysql-test/main/selectivity.test +++ b/mysql-test/main/selectivity.test @@ -1319,14 +1319,93 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=2; -set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; -set histogram_size=@save_histogram_size; -set use_stat_tables= @save_use_stat_tables; DROP TABLE t1; --echo # End of 10.2 tests +--echo # +--echo # MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram +--echo # +create table t0(a int); # This holds how many rows we hold in a bucket. +insert into t0 select 1 from seq_1_to_78; + +create table t1(a int); # one-third of a bucket +insert into t1 select 1 from seq_1_to_26; + +create table t10 (a int); +insert into t10 select 0 from t0, seq_1_to_4; + +insert into t10 select 8693 from t1; +insert into t10 select 8694 from t1; +insert into t10 select 8695 from t1; + + +insert into t10 select 34783 from t1; +insert into t10 select 34784 from t1; +insert into t10 select 34785 from t1; + + +insert into t10 select 34785 from t0, seq_1_to_8; + +insert into t10 select 65214 from t1; +insert into t10 select 65215 from t1; +insert into t10 select 65216 from t1; + +insert into t10 select 65216 from t0, seq_1_to_52; + +insert into t10 select 65217 from t1; +insert into t10 select 65218 from t1; +insert into t10 select 65219 from t1; + +insert into t10 select 65219 from t0; + + +insert into t10 select 73913 from t1; +insert into t10 select 73914 from t1; +insert into t10 select 73915 from t1; + +insert into t10 select 73915 from t0, seq_1_to_40; + + +insert into t10 select 78257 from t1; +insert into t10 select 78258 from t1; +insert into t10 select 78259 from t1; + +insert into t10 select 91300 from t1; +insert into t10 select 91301 from t1; +insert into t10 select 91302 from t1; + +insert into t10 select 91302 from t0, seq_1_to_6; + +insert into t10 select 91303 from t1; # Only 1/3rd of bucket matches the search tuple +insert into t10 select 91304 from t1; +insert into t10 select 91305 from t1; + +insert into t10 select 91305 from t0, seq_1_to_8; + +insert into t10 select 99998 from t1; +insert into t10 select 99999 from t1; +insert into t10 select 100000 from t1; + +set use_stat_tables=preferably; +analyze table t10 persistent for all; +flush tables; + +set @tmp=@@optimizer_trace; +set optimizer_trace=1; +explain select * from t10 where a in (91303); + +--echo # Must have selectivity_from_histogram <= 1.0: +select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) +from information_schema.optimizer_trace; + +set optimizer_trace=@tmp; +drop table t0,t1,t10; + +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +set histogram_size=@save_histogram_size; +set use_stat_tables= @save_use_stat_tables; # # Clean up # diff --git a/mysql-test/main/selectivity_innodb.result b/mysql-test/main/selectivity_innodb.result index 4ee2da02ec6..dfba12f2b05 100644 --- a/mysql-test/main/selectivity_innodb.result +++ b/mysql-test/main/selectivity_innodb.result @@ -843,7 +843,7 @@ flush table t1; set optimizer_use_condition_selectivity=4; explain extended select * from t1 where a=0; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1025 0.39 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 1025 0.78 Using where Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 0 drop table t1; @@ -1659,7 +1659,7 @@ test.t1 analyze status OK # Check what info the optimizer has about selectivities explain extended select * from t1 use index () where a in (17,51,5); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 3.90 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 3.91 Using where Warnings: Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` USE INDEX () where `test`.`t1`.`a` in (17,51,5) explain extended select * from t1 use index () where b=2; @@ -1945,11 +1945,78 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 25.00 Using where Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 +DROP TABLE t1; +# End of 10.2 tests +# +# MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram +# +create table t0(a int); +insert into t0 select 1 from seq_1_to_78; +create table t1(a int); +insert into t1 select 1 from seq_1_to_26; +create table t10 (a int); +insert into t10 select 0 from t0, seq_1_to_4; +insert into t10 select 8693 from t1; +insert into t10 select 8694 from t1; +insert into t10 select 8695 from t1; +insert into t10 select 34783 from t1; +insert into t10 select 34784 from t1; +insert into t10 select 34785 from t1; +insert into t10 select 34785 from t0, seq_1_to_8; +insert into t10 select 65214 from t1; +insert into t10 select 65215 from t1; +insert into t10 select 65216 from t1; +insert into t10 select 65216 from t0, seq_1_to_52; +insert into t10 select 65217 from t1; +insert into t10 select 65218 from t1; +insert into t10 select 65219 from t1; +insert into t10 select 65219 from t0; +insert into t10 select 73913 from t1; +insert into t10 select 73914 from t1; +insert into t10 select 73915 from t1; +insert into t10 select 73915 from t0, seq_1_to_40; +insert into t10 select 78257 from t1; +insert into t10 select 78258 from t1; +insert into t10 select 78259 from t1; +insert into t10 select 91300 from t1; +insert into t10 select 91301 from t1; +insert into t10 select 91302 from t1; +insert into t10 select 91302 from t0, seq_1_to_6; +insert into t10 select 91303 from t1; +insert into t10 select 91304 from t1; +insert into t10 select 91305 from t1; +insert into t10 select 91305 from t0, seq_1_to_8; +insert into t10 select 99998 from t1; +insert into t10 select 99999 from t1; +insert into t10 select 100000 from t1; +set use_stat_tables=preferably; +analyze table t10 persistent for all; +Table Op Msg_type Msg_text +test.t10 analyze status Engine-independent statistics collected +test.t10 analyze status OK +flush tables; +set statement optimizer_trace=1 for +explain select * from t10 where a in (91303); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t10 ALL NULL NULL NULL NULL 9984 Using where +# Must have selectivity_from_histogram <= 1.0: +select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) +from information_schema.optimizer_trace; +json_detailed(json_extract(trace, '$**.selectivity_for_columns')) +[ + [ + { + "column_name": "a", + "ranges": + ["91303 <= a <= 91303"], + "selectivity_from_histogram": 0.035714283 + } + ] +] +drop table t0,t1,t10; set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; set histogram_size=@save_histogram_size; set use_stat_tables= @save_use_stat_tables; -DROP TABLE t1; -# End of 10.2 tests set @@global.histogram_size=@save_histogram_size; set optimizer_switch=@save_optimizer_switch_for_selectivity_test; set @tmp_ust= @@use_stat_tables; diff --git a/mysql-test/main/selectivity_no_engine.result b/mysql-test/main/selectivity_no_engine.result index b6830e91f61..9ecf2eea23a 100644 --- a/mysql-test/main/selectivity_no_engine.result +++ b/mysql-test/main/selectivity_no_engine.result @@ -36,12 +36,12 @@ test.t2 analyze status OK # The following two must have the same in 'Extra' column: explain extended select * from t2 where col1 IN (20, 180); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 1100 1.35 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1100 1.00 Using where Warnings: Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where `test`.`t2`.`col1` in (20,180) explain extended select * from t2 where col1 IN (180, 20); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 1100 1.35 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1100 1.00 Using where Warnings: Note 1003 select `test`.`t2`.`col1` AS `col1` from `test`.`t2` where `test`.`t2`.`col1` in (180,20) drop table t1, t2; @@ -102,7 +102,7 @@ test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK explain extended select * from t1 where col1 in (1,2,3); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 3.37 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 2.97 Using where Warnings: Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where `test`.`t1`.`col1` in (1,2,3) # Must not cause fp division by zero, or produce nonsense numbers: diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index c7f6d2ff489..f27da375562 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -3902,50 +3902,16 @@ double Histogram::point_selectivity(double pos, double avg_sel) } else { - /* + /* The value 'pos' fits within one single histogram bucket. - Histogram buckets have the same numbers of rows, but they cover - different ranges of values. - - We assume that values are uniformly distributed across the [0..1] value - range. - */ - - /* - If all buckets covered value ranges of the same size, the width of - value range would be: + We also have avg_sel which is per-table average selectivity of col=const. + If there are popular values, this may be larger than one bucket, so + cap the returned number by the selectivity of one bucket. */ double avg_bucket_width= 1.0 / (get_width() + 1); - - /* - Let's see what is the width of value range that our bucket is covering. - (min==max currently. they are kept in the formula just in case we - will want to extend it to handle multi-bucket case) - */ - double inv_prec_factor= (double) 1.0 / prec_factor(); - double current_bucket_width= - (max + 1 == get_width() ? 1.0 : (get_value(max) * inv_prec_factor)) - - (min == 0 ? 0.0 : (get_value(min-1) * inv_prec_factor)); - DBUG_ASSERT(current_bucket_width); /* We shouldn't get a one zero-width bucket */ - - /* - So: - - each bucket has the same #rows - - values are unformly distributed across the [min_value,max_value] domain. - - If a bucket has value range that's N times bigger then average, than - each value will have to have N times fewer rows than average. - */ - sel= avg_sel * avg_bucket_width / current_bucket_width; - - /* - (Q: if we just follow this proportion we may end up in a situation - where number of different values we expect to find in this bucket - exceeds the number of rows that this histogram has in a bucket. Are - we ok with this or we would want to have certain caps?) - */ + sel= MY_MIN(avg_bucket_width, avg_sel); } return sel; } From 1963a87b2e9a57fd1628a940809dc7ac089308c0 Mon Sep 17 00:00:00 2001 From: Angelique Date: Tue, 25 Apr 2023 16:07:05 +0000 Subject: [PATCH 208/260] MDEV-30221: Move environmental macros to before master-slave The fix was introduced, along with re-ordering to do other macros that check test environment capabilities before master/slave is set up. --- mysql-test/suite/rpl/t/rpl_binlog_index.test | 8 ++++---- mysql-test/suite/rpl/t/rpl_gtid_stop_start.test | 2 +- mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db.test | 2 +- mysql-test/suite/rpl/t/rpl_mdev12179.test | 2 +- mysql-test/suite/rpl/t/rpl_mdev382.test | 2 +- mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test | 4 ++-- mysql-test/suite/rpl/t/rpl_semi_sync_event.test | 2 +- mysql-test/suite/rpl/t/rpl_ssl.test | 2 +- mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/mysql-test/suite/rpl/t/rpl_binlog_index.test b/mysql-test/suite/rpl/t/rpl_binlog_index.test index 95c49c3d574..6112affb3c4 100644 --- a/mysql-test/suite/rpl/t/rpl_binlog_index.test +++ b/mysql-test/suite/rpl/t/rpl_binlog_index.test @@ -17,10 +17,6 @@ # BUG#12133 master.index file keeps mysqld from starting if bin log has been moved # BUG#42576 Relay logs in relay-log.info&localhost-relay-bin.index not processed after move -source include/master-slave.inc; -# There is no need to run this test case on all binlog format -source include/have_binlog_format_row.inc; - # Since this test relies heavily on filesystem operations (like # moving files around, backslashes and so forth) we avoid messing # around with windows access violations for not cluttering the @@ -28,6 +24,10 @@ source include/have_binlog_format_row.inc; # it is not 100% compliant. --source include/not_windows.inc +source include/master-slave.inc; +# There is no need to run this test case on all binlog format +source include/have_binlog_format_row.inc; + connection master; --let $master_datadir= `select @@datadir` connection slave; diff --git a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test index 5d0d39cadce..25452346523 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test @@ -1,7 +1,7 @@ +--source include/no_valgrind_without_big.inc --let $rpl_topology=1->2 --source include/rpl_init.inc --source include/have_innodb.inc ---source include/no_valgrind_without_big.inc --echo *** Test normal shutdown/restart of slave server configured as a GTID slave. *** diff --git a/mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db.test b/mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db.test index 9c804d8206a..a27a50d0fc4 100644 --- a/mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db.test +++ b/mysql-test/suite/rpl/t/rpl_lcase_tblnames_rewrite_db.test @@ -15,8 +15,8 @@ # # (iii) master and slave tables do not differ # --- source include/master-slave.inc -- source include/not_windows.inc +-- source include/master-slave.inc SET SQL_LOG_BIN=0; CREATE DATABASE B37656; diff --git a/mysql-test/suite/rpl/t/rpl_mdev12179.test b/mysql-test/suite/rpl/t/rpl_mdev12179.test index 962ce3f0135..6d2dda1044f 100644 --- a/mysql-test/suite/rpl/t/rpl_mdev12179.test +++ b/mysql-test/suite/rpl/t/rpl_mdev12179.test @@ -1,7 +1,7 @@ +--source include/no_valgrind_without_big.inc --source include/have_innodb.inc --let $rpl_topology=1->2 --source include/rpl_init.inc ---source include/no_valgrind_without_big.inc --connection server_2 call mtr.add_suppression("The automatically created table.*name may not be entirely in lowercase"); diff --git a/mysql-test/suite/rpl/t/rpl_mdev382.test b/mysql-test/suite/rpl/t/rpl_mdev382.test index 093b7b92413..84e3c84982d 100644 --- a/mysql-test/suite/rpl/t/rpl_mdev382.test +++ b/mysql-test/suite/rpl/t/rpl_mdev382.test @@ -1,7 +1,7 @@ +--source include/not_windows.inc #unix shell escaping used for mysqlbinlog --source include/have_innodb.inc --source include/have_binlog_format_statement.inc --source include/master-slave.inc ---source include/not_windows.inc #unix shell escaping used for mysqlbinlog # MDEV-382: multiple SQL injections in replication code. diff --git a/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test b/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test index 44c04dd62d3..7decd130a43 100644 --- a/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test +++ b/mysql-test/suite/rpl/t/rpl_row_lcase_tblnames.test @@ -3,10 +3,10 @@ # For details look into extra/rpl_tests/rpl_lower_case_table_names.test # --- source include/master-slave.inc --- source include/have_innodb.inc -- source include/not_windows.inc +-- source include/have_innodb.inc -- source include/have_binlog_format_row.inc +-- source include/master-slave.inc -- let $engine=InnoDB -- source include/rpl_lower_case_table_names.test diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test index 7a7e1c1e074..d4df9b4041b 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test @@ -1,7 +1,7 @@ +source include/no_valgrind_without_big.inc; source include/not_embedded.inc; source include/have_innodb.inc; source include/master-slave.inc; -source include/no_valgrind_without_big.inc; let $engine_type= InnoDB; diff --git a/mysql-test/suite/rpl/t/rpl_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test index 59a2af9f137..0420a6c8c2d 100644 --- a/mysql-test/suite/rpl/t/rpl_ssl.test +++ b/mysql-test/suite/rpl/t/rpl_ssl.test @@ -4,9 +4,9 @@ # Please check all dependent tests after modifying it # +source include/no_valgrind_without_big.inc; source include/have_ssl_communication.inc; source include/master-slave.inc; -source include/no_valgrind_without_big.inc; # create a user for replication that requires ssl encryption connection master; diff --git a/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test b/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test index 619b57994c2..3809cd89e4a 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test +++ b/mysql-test/suite/rpl/t/rpl_stm_lcase_tblnames.test @@ -3,10 +3,10 @@ # For details look into extra/rpl_tests/rpl_lower_case_table_names.test # +-- source include/not_windows.inc +-- source include/have_innodb.inc -- source include/have_binlog_format_mixed_or_statement.inc -- source include/master-slave.inc --- source include/have_innodb.inc --- source include/not_windows.inc -- let $engine=InnoDB -- source include/rpl_lower_case_table_names.test From 2e74f9d281b0251040aef2364f061c5f23e4ab21 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Sat, 29 Apr 2023 06:33:09 +0400 Subject: [PATCH 209/260] Adding "const" qualifiers to a few trivial Lex_input_string methods --- sql/sql_lex.cc | 4 ++-- sql/sql_lex.h | 42 +++++++++++++++++++++--------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index e7689a99c22..b51a4acc5f6 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -350,7 +350,7 @@ void Lex_input_stream::body_utf8_start(THD *thd, const char *begin_ptr) } -size_t Lex_input_stream::get_body_utf8_maximum_length(THD *thd) +size_t Lex_input_stream::get_body_utf8_maximum_length(THD *thd) const { /* String literals can grow during escaping: @@ -853,7 +853,7 @@ Yacc_state::~Yacc_state() } int Lex_input_stream::find_keyword(Lex_ident_cli_st *kwd, - uint len, bool function) + uint len, bool function) const { const char *tok= m_tok_start; diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 6170637ad77..052151f5352 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -2449,7 +2449,7 @@ private: Get the last character accepted. @return the last character accepted. */ - unsigned char yyGetLast() + unsigned char yyGetLast() const { return m_ptr[-1]; } @@ -2457,7 +2457,7 @@ private: /** Look at the next character to parse, but do not accept it. */ - unsigned char yyPeek() + unsigned char yyPeek() const { return m_ptr[0]; } @@ -2466,7 +2466,7 @@ private: Look ahead at some character to parse. @param n offset of the character to look up */ - unsigned char yyPeekn(int n) + unsigned char yyPeekn(int n) const { return m_ptr[n]; } @@ -2527,7 +2527,7 @@ private: @param n number of characters expected @return true if there are less than n characters to parse */ - bool eof(int n) + bool eof(int n) const { return ((m_ptr + n) >= m_end_of_query); } @@ -2558,10 +2558,10 @@ private: Get the maximum length of the utf8-body buffer. The utf8 body can grow because of the character set conversion and escaping. */ - size_t get_body_utf8_maximum_length(THD *thd); + size_t get_body_utf8_maximum_length(THD *thd) const; /** Get the length of the current token, in the raw buffer. */ - uint yyLength() + uint yyLength() const { /* The assumption is that the lexical analyser is always 1 character ahead, @@ -2586,31 +2586,31 @@ public: End of file indicator for the query text to parse. @return true if there are no more characters to parse */ - bool eof() + bool eof() const { return (m_ptr >= m_end_of_query); } /** Get the raw query buffer. */ - const char *get_buf() + const char *get_buf() const { return m_buf; } /** Get the pre-processed query buffer. */ - const char *get_cpp_buf() + const char *get_cpp_buf() const { return m_cpp_buf; } /** Get the end of the raw query buffer. */ - const char *get_end_of_query() + const char *get_end_of_query() const { return m_end_of_query; } /** Get the token start position, in the raw buffer. */ - const char *get_tok_start() + const char *get_tok_start() const { return has_lookahead() ? m_tok_start_prev : m_tok_start; } @@ -2621,25 +2621,25 @@ public: } /** Get the token end position, in the raw buffer. */ - const char *get_tok_end() + const char *get_tok_end() const { return m_tok_end; } /** Get the current stream pointer, in the raw buffer. */ - const char *get_ptr() + const char *get_ptr() const { return m_ptr; } /** Get the token start position, in the pre-processed buffer. */ - const char *get_cpp_tok_start() + const char *get_cpp_tok_start() const { return has_lookahead() ? m_cpp_tok_start_prev : m_cpp_tok_start; } /** Get the token end position, in the pre-processed buffer. */ - const char *get_cpp_tok_end() + const char *get_cpp_tok_end() const { return m_cpp_tok_end; } @@ -2648,7 +2648,7 @@ public: Get the token end position in the pre-processed buffer, with trailing spaces removed. */ - const char *get_cpp_tok_end_rtrim() + const char *get_cpp_tok_end_rtrim() const { const char *p; for (p= m_cpp_tok_end; @@ -2659,7 +2659,7 @@ public: } /** Get the current stream pointer, in the pre-processed buffer. */ - const char *get_cpp_ptr() + const char *get_cpp_ptr() const { return m_cpp_ptr; } @@ -2668,7 +2668,7 @@ public: Get the current stream pointer, in the pre-processed buffer, with traling spaces removed. */ - const char *get_cpp_ptr_rtrim() + const char *get_cpp_ptr_rtrim() const { const char *p; for (p= m_cpp_ptr; @@ -2678,13 +2678,13 @@ public: return p; } /** Get the utf8-body string. */ - const char *get_body_utf8_str() + const char *get_body_utf8_str() const { return m_body_utf8; } /** Get the utf8-body length. */ - size_t get_body_utf8_length() + size_t get_body_utf8_length() const { return (size_t) (m_body_utf8_ptr - m_body_utf8); } @@ -2720,7 +2720,7 @@ private: bool consume_comment(int remaining_recursions_permitted); int lex_one_token(union YYSTYPE *yylval, THD *thd); - int find_keyword(Lex_ident_cli_st *str, uint len, bool function); + int find_keyword(Lex_ident_cli_st *str, uint len, bool function) const; LEX_CSTRING get_token(uint skip, uint length); int scan_ident_sysvar(THD *thd, Lex_ident_cli_st *str); int scan_ident_start(THD *thd, Lex_ident_cli_st *str); From ddcc9d2281de9fa68525a6808e9181bbd6bf98e0 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Sat, 29 Apr 2023 07:39:38 +0400 Subject: [PATCH 210/260] MDEV-31153 New methods Schema::make_item_func_* for REPLACE, SUBSTRING, TRIM Adding virtual methods to class Schema: make_item_func_replace() make_item_func_substr() make_item_func_trim() This is a non-functional preparatory change for MDEV-27744. --- sql/sql_lex.cc | 27 -------------------- sql/sql_lex.h | 3 --- sql/sql_schema.cc | 61 +++++++++++++++++++++++++++++++++++++++++++++ sql/sql_schema.h | 11 ++++++++ sql/sql_yacc.yy | 59 +++++++++++++++++++++++++++---------------- sql/sql_yacc_ora.yy | 59 +++++++++++++++++++++++++++---------------- sql/structs.h | 24 ++++++++++++++++++ 7 files changed, 170 insertions(+), 74 deletions(-) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index b51a4acc5f6..f77b98f04f1 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -8639,33 +8639,6 @@ bool LEX::add_grant_command(THD *thd, enum_sql_command sql_command_arg, } -Item *LEX::make_item_func_substr(THD *thd, Item *a, Item *b, Item *c) -{ - return (thd->variables.sql_mode & MODE_ORACLE) ? - new (thd->mem_root) Item_func_substr_oracle(thd, a, b, c) : - new (thd->mem_root) Item_func_substr(thd, a, b, c); -} - - -Item *LEX::make_item_func_substr(THD *thd, Item *a, Item *b) -{ - return (thd->variables.sql_mode & MODE_ORACLE) ? - new (thd->mem_root) Item_func_substr_oracle(thd, a, b) : - new (thd->mem_root) Item_func_substr(thd, a, b); -} - - -Item *LEX::make_item_func_replace(THD *thd, - Item *org, - Item *find, - Item *replace) -{ - return (thd->variables.sql_mode & MODE_ORACLE) ? - new (thd->mem_root) Item_func_replace_oracle(thd, org, find, replace) : - new (thd->mem_root) Item_func_replace(thd, org, find, replace); -} - - bool SELECT_LEX::vers_push_field(THD *thd, TABLE_LIST *table, const LEX_CSTRING field_name) { diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 052151f5352..a2c5fec03e5 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -4033,9 +4033,6 @@ public: Item *create_item_query_expression(THD *thd, st_select_lex_unit *unit); - Item *make_item_func_replace(THD *thd, Item *org, Item *find, Item *replace); - Item *make_item_func_substr(THD *thd, Item *a, Item *b, Item *c); - Item *make_item_func_substr(THD *thd, Item *a, Item *b); Item *make_item_func_call_generic(THD *thd, Lex_ident_cli_st *db, Lex_ident_cli_st *name, List *args); Item *make_item_func_call_generic(THD *thd, diff --git a/sql/sql_schema.cc b/sql/sql_schema.cc index 0bf4a63c2f8..f08204d272d 100644 --- a/sql/sql_schema.cc +++ b/sql/sql_schema.cc @@ -32,6 +32,14 @@ public: return thd->type_handler_for_datetime(); return src; } + + Item *make_item_func_replace(THD *thd, + Item *subj, + Item *find, + Item *replace) const; + Item *make_item_func_substr(THD *thd, + const Lex_substring_spec_st &spec) const; + Item *make_item_func_trim(THD *thd, const Lex_trim_st &spec) const; }; @@ -78,3 +86,56 @@ Schema *Schema::find_implied(THD *thd) return &maxdb_schema; return &mariadb_schema; } + + +Item *Schema::make_item_func_replace(THD *thd, + Item *subj, + Item *find, + Item *replace) const +{ + return new (thd->mem_root) Item_func_replace(thd, subj, find, replace); +} + + +Item *Schema::make_item_func_substr(THD *thd, + const Lex_substring_spec_st &spec) const +{ + return spec.m_for ? + new (thd->mem_root) Item_func_substr(thd, spec.m_subject, spec.m_from, + spec.m_for) : + new (thd->mem_root) Item_func_substr(thd, spec.m_subject, spec.m_from); +} + + +Item *Schema::make_item_func_trim(THD *thd, const Lex_trim_st &spec) const +{ + return spec.make_item_func_trim_std(thd); +} + + +Item *Schema_oracle::make_item_func_replace(THD *thd, + Item *subj, + Item *find, + Item *replace) const +{ + return new (thd->mem_root) Item_func_replace_oracle(thd, subj, find, replace); +} + + +Item *Schema_oracle::make_item_func_substr(THD *thd, + const Lex_substring_spec_st &spec) const +{ + return spec.m_for ? + new (thd->mem_root) Item_func_substr_oracle(thd, spec.m_subject, + spec.m_from, + spec.m_for) : + new (thd->mem_root) Item_func_substr_oracle(thd, spec.m_subject, + spec.m_from); +} + + +Item *Schema_oracle::make_item_func_trim(THD *thd, + const Lex_trim_st &spec) const +{ + return spec.make_item_func_trim_oracle(thd); +} diff --git a/sql/sql_schema.h b/sql/sql_schema.h index 27ee0c10dce..1174bc7a83f 100644 --- a/sql/sql_schema.h +++ b/sql/sql_schema.h @@ -33,6 +33,17 @@ public: { return src; } + + // Builders for native SQL function with a special syntax in sql_yacc.yy + virtual Item *make_item_func_replace(THD *thd, + Item *subj, + Item *find, + Item *replace) const; + virtual Item *make_item_func_substr(THD *thd, + const Lex_substring_spec_st &spec) const; + + virtual Item *make_item_func_trim(THD *thd, const Lex_trim_st &spec) const; + /* For now we have *hard-coded* compatibility schemas: schema_mariadb, schema_oracle, schema_maxdb. diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 20fc299624f..cf3927ac30c 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -718,6 +718,7 @@ Virtual_column_info *add_virtual_expression(THD *thd, Item *expr) Lex_for_loop_st for_loop; Lex_for_loop_bounds_st for_loop_bounds; Lex_trim_st trim; + Lex_substring_spec_st substring_spec; vers_history_point_t vers_history_point; struct { @@ -1077,7 +1078,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %token RELEASE_SYM /* SQL-2003-R */ %token RENAME %token REPEAT_SYM /* MYSQL-FUNC */ -%token REPLACE /* MYSQL-FUNC */ %token REQUIRE_SYM %token RESIGNAL_SYM /* SQL-2003-R */ %token RESTRICT @@ -1117,7 +1117,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %token STDDEV_SAMP_SYM /* SQL-2003-N */ %token STD_SYM %token STRAIGHT_JOIN -%token SUBSTRING /* SQL-2003-N */ %token SUM_SYM /* SQL-2003-N */ %token SYSDATE %token TABLE_REF_PRIORITY @@ -1131,7 +1130,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %token TO_SYM /* SQL-2003-R */ %token TRAILING /* SQL-2003-R */ %token TRIGGER_SYM /* SQL-2003-R */ -%token TRIM /* SQL-2003-N */ %token TRUE_SYM /* SQL-2003-R */ %token ULONGLONG_NUM %token UNDERSCORE_CHARSET @@ -1182,6 +1180,14 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %token RAISE_MARIADB_SYM // PLSQL-R %token ROWTYPE_MARIADB_SYM // PLSQL-R +/* + SQL functions with a special syntax +*/ +%token REPLACE /* MYSQL-FUNC */ +%token SUBSTRING /* SQL-2003-N */ +%token TRIM /* SQL-2003-N */ + + /* Non-reserved keywords */ @@ -2172,6 +2178,7 @@ END_OF_INPUT %type sp_for_loop_index_and_bounds %type sp_for_loop_bounds %type trim_operands +%type substring_operands %type opt_sp_for_loop_direction %type sp_opt_inout %type index_hint_type @@ -10916,7 +10923,8 @@ function_call_keyword: } | TRIM '(' trim_operands ')' { - if (unlikely(!($$= $3.make_item_func_trim(thd)))) + if (unlikely(!($$= Schema::find_implied(thd)-> + make_item_func_trim(thd, $3)))) MYSQL_YYABORT; } | USER_SYM '(' ')' @@ -10935,6 +10943,26 @@ function_call_keyword: } ; +substring_operands: + expr ',' expr ',' expr + { + $$= Lex_substring_spec_st::init($1, $3, $5); + } + | expr ',' expr + { + $$= Lex_substring_spec_st::init($1, $3); + } + | expr FROM expr FOR_SYM expr + { + $$= Lex_substring_spec_st::init($1, $3, $5); + } + | expr FROM expr + { + $$= Lex_substring_spec_st::init($1, $3); + } + ; + + /* Function calls using non reserved keywords, with special syntaxic forms. Dedicated grammar rules are needed because of the syntax, @@ -11049,24 +11077,10 @@ function_call_nonkeyword: if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | SUBSTRING '(' expr ',' expr ',' expr ')' + | SUBSTRING '(' substring_operands ')' { - if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5, $7)))) - MYSQL_YYABORT; - } - | SUBSTRING '(' expr ',' expr ')' - { - if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5)))) - MYSQL_YYABORT; - } - | SUBSTRING '(' expr FROM expr FOR_SYM expr ')' - { - if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5, $7)))) - MYSQL_YYABORT; - } - | SUBSTRING '(' expr FROM expr ')' - { - if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5)))) + if (unlikely(!($$= Schema::find_implied(thd)-> + make_item_func_substr(thd, $3)))) MYSQL_YYABORT; } | SYSDATE opt_time_precision @@ -11282,7 +11296,8 @@ function_call_conflict: } | REPLACE '(' expr ',' expr ',' expr ')' { - if (unlikely(!($$= Lex->make_item_func_replace(thd, $3, $5, $7)))) + if (unlikely(!($$= Schema::find_implied(thd)-> + make_item_func_replace(thd, $3, $5, $7)))) MYSQL_YYABORT; } | REVERSE_SYM '(' expr ')' diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy index afc1b007b11..87f71d8332b 100644 --- a/sql/sql_yacc_ora.yy +++ b/sql/sql_yacc_ora.yy @@ -196,6 +196,7 @@ void ORAerror(THD *thd, const char *s) Lex_for_loop_st for_loop; Lex_for_loop_bounds_st for_loop_bounds; Lex_trim_st trim; + Lex_substring_spec_st substring_spec; vers_history_point_t vers_history_point; struct { @@ -553,7 +554,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %token RELEASE_SYM /* SQL-2003-R */ %token RENAME %token REPEAT_SYM /* MYSQL-FUNC */ -%token REPLACE /* MYSQL-FUNC */ %token REQUIRE_SYM %token RESIGNAL_SYM /* SQL-2003-R */ %token RESTRICT @@ -593,7 +593,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %token STDDEV_SAMP_SYM /* SQL-2003-N */ %token STD_SYM %token STRAIGHT_JOIN -%token SUBSTRING /* SQL-2003-N */ %token SUM_SYM /* SQL-2003-N */ %token SYSDATE %token TABLE_REF_PRIORITY @@ -607,7 +606,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %token TO_SYM /* SQL-2003-R */ %token TRAILING /* SQL-2003-R */ %token TRIGGER_SYM /* SQL-2003-R */ -%token TRIM /* SQL-2003-N */ %token TRUE_SYM /* SQL-2003-R */ %token ULONGLONG_NUM %token UNDERSCORE_CHARSET @@ -658,6 +656,14 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %token RAISE_MARIADB_SYM // PLSQL-R %token ROWTYPE_MARIADB_SYM // PLSQL-R +/* + SQL functions with a special syntax +*/ +%token REPLACE /* MYSQL-FUNC */ +%token SUBSTRING /* SQL-2003-N */ +%token TRIM /* SQL-2003-N */ + + /* Non-reserved keywords */ @@ -1673,6 +1679,7 @@ END_OF_INPUT %type sp_for_loop_index_and_bounds %type sp_for_loop_bounds %type trim_operands +%type substring_operands %type opt_sp_for_loop_direction %type sp_opt_inout %type index_hint_type @@ -11031,7 +11038,8 @@ function_call_keyword: } | TRIM '(' trim_operands ')' { - if (unlikely(!($$= $3.make_item_func_trim(thd)))) + if (unlikely(!($$= Schema::find_implied(thd)-> + make_item_func_trim(thd, $3)))) MYSQL_YYABORT; } | USER_SYM '(' ')' @@ -11050,6 +11058,26 @@ function_call_keyword: } ; +substring_operands: + expr ',' expr ',' expr + { + $$= Lex_substring_spec_st::init($1, $3, $5); + } + | expr ',' expr + { + $$= Lex_substring_spec_st::init($1, $3); + } + | expr FROM expr FOR_SYM expr + { + $$= Lex_substring_spec_st::init($1, $3, $5); + } + | expr FROM expr + { + $$= Lex_substring_spec_st::init($1, $3); + } + ; + + /* Function calls using non reserved keywords, with special syntaxic forms. Dedicated grammar rules are needed because of the syntax, @@ -11164,24 +11192,10 @@ function_call_nonkeyword: if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | SUBSTRING '(' expr ',' expr ',' expr ')' + | SUBSTRING '(' substring_operands ')' { - if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5, $7)))) - MYSQL_YYABORT; - } - | SUBSTRING '(' expr ',' expr ')' - { - if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5)))) - MYSQL_YYABORT; - } - | SUBSTRING '(' expr FROM expr FOR_SYM expr ')' - { - if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5, $7)))) - MYSQL_YYABORT; - } - | SUBSTRING '(' expr FROM expr ')' - { - if (unlikely(!($$= Lex->make_item_func_substr(thd, $3, $5)))) + if (unlikely(!($$= Schema::find_implied(thd)-> + make_item_func_substr(thd, $3)))) MYSQL_YYABORT; } | SYSDATE opt_time_precision @@ -11397,7 +11411,8 @@ function_call_conflict: } | REPLACE '(' expr ',' expr ',' expr ')' { - if (unlikely(!($$= Lex->make_item_func_replace(thd, $3, $5, $7)))) + if (unlikely(!($$= Schema::find_implied(thd)-> + make_item_func_replace(thd, $3, $5, $7)))) MYSQL_YYABORT; } | REVERSE_SYM '(' expr ')' diff --git a/sql/structs.h b/sql/structs.h index 31601fee154..2e6683ec706 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -779,6 +779,11 @@ public: } Item *make_item_func_trim_std(THD *thd) const; Item *make_item_func_trim_oracle(THD *thd) const; + /* + This method is still used to handle LTRIM and RTRIM, + while the special syntax TRIM(... BOTH|LEADING|TRAILING) + is now handled by Schema::make_item_func_trim(). + */ Item *make_item_func_trim(THD *thd) const; }; @@ -790,6 +795,25 @@ public: }; +class Lex_substring_spec_st +{ +public: + Item *m_subject; + Item *m_from; + Item *m_for; + static Lex_substring_spec_st init(Item *subject, + Item *from, + Item *xfor= NULL) + { + Lex_substring_spec_st res; + res.m_subject= subject; + res.m_from= from; + res.m_for= xfor; + return res; + } +}; + + class st_select_lex; class Lex_select_lock From 7e2e96899711316aa99ef025e0d845f7430f2b32 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Sun, 30 Apr 2023 11:53:21 -0700 Subject: [PATCH 211/260] MDEV-31143 Crash for query using ROWNUM() over view with ORDER BY When processing a query over a mergeable view at some conditions checked at prepare stage it may be decided to materialize the view rather than to merge it. Before this patch in such case the field 'derived' of the TABLE_LIST structure created for the view remained set to 0. As a result the guard condition preventing range analysis for materialized views did not work properly. This led to a call of some handler method for the temporary table created to contain the view's records that was supposed to be used only for opened tables. However temporary tables created for materialization of derived tables or views are not opened yet when range analysis is performed. Approved by Oleksandr Byelkin --- mysql-test/main/derived_view.result | 20 ++++++++++++++++++++ mysql-test/main/derived_view.test | 22 ++++++++++++++++++++++ sql/sql_select.cc | 2 +- sql/table.cc | 2 +- 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/mysql-test/main/derived_view.result b/mysql-test/main/derived_view.result index c367b882e7f..0bb934f5016 100644 --- a/mysql-test/main/derived_view.result +++ b/mysql-test/main/derived_view.result @@ -4171,3 +4171,23 @@ deallocate prepare stmt; drop view v; drop table t1,t2,t3; # End of 10.4 tests +# +# MDEV-31143: view with ORDER BY used in query with rownum() in WHERE +# +create table t1 (id int primary key); +insert into t1 values (3), (7), (1); +create table t2 (a int); +insert into t2 values (2), (4); +create view v as select a from t2 order by a; +set big_tables= 1; +Warnings: +Warning 1287 '@@big_tables' is deprecated and will be removed in a future release +select t1.id from v, t1 where rownum() = 1 group by t1.id; +id +1 +set big_tables=default; +Warnings: +Warning 1287 '@@big_tables' is deprecated and will be removed in a future release +drop view v; +drop table t1, t2; +# End of 10.6 tests diff --git a/mysql-test/main/derived_view.test b/mysql-test/main/derived_view.test index 5422fbcfd1d..d03fc37fe24 100644 --- a/mysql-test/main/derived_view.test +++ b/mysql-test/main/derived_view.test @@ -2752,3 +2752,25 @@ drop view v; drop table t1,t2,t3; --echo # End of 10.4 tests + +--echo # +--echo # MDEV-31143: view with ORDER BY used in query with rownum() in WHERE +--echo # + +create table t1 (id int primary key); +insert into t1 values (3), (7), (1); + +create table t2 (a int); +insert into t2 values (2), (4); + +create view v as select a from t2 order by a; + +set big_tables= 1; +select t1.id from v, t1 where rownum() = 1 group by t1.id; + +set big_tables=default; + +drop view v; +drop table t1, t2; + +--echo # End of 10.6 tests diff --git a/sql/sql_select.cc b/sql/sql_select.cc index d502fafdfae..cff8b623d64 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -5814,7 +5814,7 @@ make_join_statistics(JOIN *join, List &tables_list, /* Perform range analysis if there are keys it could use (1). Don't do range analysis for materialized subqueries (2). - Don't do range analysis for materialized derived tables (3) + Don't do range analysis for materialized derived tables/views (3) */ if ((!s->const_keys.is_clear_all() || !bitmap_is_clear_all(&s->table->cond_set)) && // (1) diff --git a/sql/table.cc b/sql/table.cc index f5144357a1d..1bc7b36775a 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -6743,7 +6743,7 @@ void TABLE_LIST::set_check_materialized() DBUG_ENTER("TABLE_LIST::set_check_materialized"); SELECT_LEX_UNIT *derived= this->derived; if (view) - derived= &view->unit; + derived= this->derived= &view->unit; DBUG_ASSERT(derived); DBUG_ASSERT(!derived->is_excluded()); if (!derived->first_select()->exclude_from_table_unique_test) From 4e942bcd93e961fe9e5ee5502f7817633600db4c Mon Sep 17 00:00:00 2001 From: sara Date: Mon, 23 Jan 2023 12:09:54 +0200 Subject: [PATCH 212/260] MDEV-30414 sporadic failures with galera var retry autocommit changed tast case 2 to be deterministic Signed-off-by: Julius Goryavsky --- .../r/galera_var_retry_autocommit.result | 12 +++++++++++- .../galera/t/galera_var_retry_autocommit.test | 19 ++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/galera/r/galera_var_retry_autocommit.result b/mysql-test/suite/galera/r/galera_var_retry_autocommit.result index 56c2c995402..50667b0a4fa 100644 --- a/mysql-test/suite/galera/r/galera_var_retry_autocommit.result +++ b/mysql-test/suite/galera/r/galera_var_retry_autocommit.result @@ -20,17 +20,25 @@ DROP TABLE t1; connection node_1; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; SET SESSION wsrep_retry_autocommit = 1; +SET GLOBAL debug_dbug = '+d,sync.wsrep_retry_autocommit'; SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continue'; INSERT INTO t1 (f1) VALUES (3); connection node_1a; SET DEBUG_SYNC = 'now WAIT_FOR before_cert'; connection node_2; TRUNCATE TABLE t1; -connection node_1; +connection node_1a; +SET DEBUG_SYNC = 'now WAIT_FOR wsrep_retry_autocommit_reached'; SELECT COUNT(*) FROM t1; COUNT(*) 0 +SET DEBUG_SYNC = 'now SIGNAL wsrep_retry_autocommit_continue'; +connection node_1; +SELECT COUNT(*) FROM t1; +COUNT(*) +1 SET DEBUG_SYNC = 'RESET'; +SET GLOBAL debug_dbug = NULL; DROP TABLE t1; connection node_1; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; @@ -64,6 +72,8 @@ SET SESSION wsrep_retry_autocommit = 64; SET GLOBAL debug_dbug = '+d,sync.wsrep_retry_autocommit'; SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continue EXECUTE 64'; INSERT INTO t1 VALUES (5); +connection node_2; +connection node_1; connection node_1; SELECT COUNT(*) FROM t1; COUNT(*) diff --git a/mysql-test/suite/galera/t/galera_var_retry_autocommit.test b/mysql-test/suite/galera/t/galera_var_retry_autocommit.test index bd10e448e06..c58eba1410e 100644 --- a/mysql-test/suite/galera/t/galera_var_retry_autocommit.test +++ b/mysql-test/suite/galera/t/galera_var_retry_autocommit.test @@ -25,6 +25,8 @@ SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continu SET DEBUG_SYNC = 'now WAIT_FOR before_cert'; --connection node_2 +--let $wait_condition = SELECT count(*)=1 FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1' +--source include/wait_condition.inc TRUNCATE TABLE t1; --connection node_1 @@ -44,6 +46,7 @@ DROP TABLE t1; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; SET SESSION wsrep_retry_autocommit = 1; +SET GLOBAL debug_dbug = '+d,sync.wsrep_retry_autocommit'; SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continue'; --send INSERT INTO t1 (f1) VALUES (3) @@ -51,14 +54,21 @@ SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continu SET DEBUG_SYNC = 'now WAIT_FOR before_cert'; --connection node_2 +--let $wait_condition = SELECT count(*)=1 FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1' +--source include/wait_condition.inc TRUNCATE TABLE t1; +--connection node_1a +SET DEBUG_SYNC = 'now WAIT_FOR wsrep_retry_autocommit_reached'; +SELECT COUNT(*) FROM t1; +SET DEBUG_SYNC = 'now SIGNAL wsrep_retry_autocommit_continue'; + --connection node_1 ---error 0,ER_LOCK_DEADLOCK --reap SELECT COUNT(*) FROM t1; SET DEBUG_SYNC = 'RESET'; +SET GLOBAL debug_dbug = NULL; DROP TABLE t1; @@ -79,6 +89,8 @@ SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continu SET DEBUG_SYNC = 'now WAIT_FOR before_cert'; --connection node_2 +--let $wait_condition = SELECT count(*)=1 FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1' +--source include/wait_condition.inc TRUNCATE TABLE t1; --connection node_1a @@ -114,6 +126,11 @@ SET DEBUG_SYNC = 'wsrep_before_certification SIGNAL before_cert WAIT_FOR continu --send INSERT INTO t1 VALUES (5) +--connection node_2 +--let $wait_condition = SELECT count(*)=1 FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1' +--source include/wait_condition.inc + +--connection node_1 --disable_query_log --disable_result_log --let $count = 64 From ef227762b1c08b6259dfebb541ebb226e390203d Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Tue, 14 Mar 2023 10:30:09 +0100 Subject: [PATCH 213/260] MDEV-30838 Assertion `m_thd == _current_thd()' - Update wsrep-lib which contains fix for the assertion - Fix error handling for appending fragment to streaming log, make sure tables are closed after rollback. Signed-off-by: Julius Goryavsky --- mysql-test/suite/galera_sr/r/MDEV-30838.result | 15 +++++++++++++++ mysql-test/suite/galera_sr/t/MDEV-30838.test | 18 ++++++++++++++++++ sql/wsrep_schema.cc | 5 ++--- sql/wsrep_thd.h | 9 ++++++++- 4 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 mysql-test/suite/galera_sr/r/MDEV-30838.result create mode 100644 mysql-test/suite/galera_sr/t/MDEV-30838.test diff --git a/mysql-test/suite/galera_sr/r/MDEV-30838.result b/mysql-test/suite/galera_sr/r/MDEV-30838.result new file mode 100644 index 00000000000..6997b9c4d5d --- /dev/null +++ b/mysql-test/suite/galera_sr/r/MDEV-30838.result @@ -0,0 +1,15 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +SET SESSION wsrep_trx_fragment_size=1; +START TRANSACTION; +INSERT INTO t1 VALUES(1); +SET debug_dbug='+d,ib_create_table_fail_too_many_trx'; +INSERT INTO t1 VALUES(2); +ERROR HY000: Error while appending streaming replication fragment +COMMIT; +SELECT * FROM t1; +f1 +SET debug_dbug='-d,ib_create_table_fail_too_many_trx'; +DROP TABLE t1; +CALL mtr.add_suppression("Error writing into mysql.wsrep_streaming_log: 177"); diff --git a/mysql-test/suite/galera_sr/t/MDEV-30838.test b/mysql-test/suite/galera_sr/t/MDEV-30838.test new file mode 100644 index 00000000000..39ca7d2a375 --- /dev/null +++ b/mysql-test/suite/galera_sr/t/MDEV-30838.test @@ -0,0 +1,18 @@ +# +# MDEV-30838 - Assertion `m_thd == _current_thd()' failed in +# virtual int Wsrep_client_service::bf_rollback() +# +--source include/galera_cluster.inc +--source include/have_debug_sync.inc +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +SET SESSION wsrep_trx_fragment_size=1; +START TRANSACTION; +INSERT INTO t1 VALUES(1); +SET debug_dbug='+d,ib_create_table_fail_too_many_trx'; +--error ER_ERROR_DURING_COMMIT +INSERT INTO t1 VALUES(2); +COMMIT; +SELECT * FROM t1; +SET debug_dbug='-d,ib_create_table_fail_too_many_trx'; +DROP TABLE t1; +CALL mtr.add_suppression("Error writing into mysql.wsrep_streaming_log: 177"); diff --git a/sql/wsrep_schema.cc b/sql/wsrep_schema.cc index 40cdd6496b2..1bc8dd5c98f 100644 --- a/sql/wsrep_schema.cc +++ b/sql/wsrep_schema.cc @@ -991,10 +991,9 @@ int Wsrep_schema::append_fragment(THD* thd, Wsrep_schema_impl::store(frag_table, 3, flags); Wsrep_schema_impl::store(frag_table, 4, data.data(), data.size()); - int error; - if ((error= Wsrep_schema_impl::insert(frag_table))) { - WSREP_ERROR("Failed to write to frag table: %d", error); + if (Wsrep_schema_impl::insert(frag_table)) { trans_rollback_stmt(thd); + close_thread_tables(thd); thd->lex->restore_backup_query_tables_list(&query_tables_list_backup); DBUG_RETURN(1); } diff --git a/sql/wsrep_thd.h b/sql/wsrep_thd.h index cf8528c3165..a17de084c93 100644 --- a/sql/wsrep_thd.h +++ b/sql/wsrep_thd.h @@ -228,7 +228,14 @@ static inline void wsrep_override_error(THD* thd, break; case wsrep::e_append_fragment_error: /* TODO: Figure out better error number */ - wsrep_override_error(thd, ER_ERROR_DURING_COMMIT, 0, status); + if (status) + wsrep_override_error(thd, ER_ERROR_DURING_COMMIT, + "Error while appending streaming replication fragment" + "(provider status: %s)", + wsrep::provider::to_string(status).c_str()); + else + wsrep_override_error(thd, ER_ERROR_DURING_COMMIT, + "Error while appending streaming replication fragment"); break; case wsrep::e_not_supported_error: wsrep_override_error(thd, ER_NOT_SUPPORTED_YET); From 5f3a4beb9dabbb6e531f48661907b73100bc4ef3 Mon Sep 17 00:00:00 2001 From: Tuukka Pasanen Date: Thu, 13 Apr 2023 11:24:44 +0300 Subject: [PATCH 214/260] MDEV-31045: Update debian/rules to be in sync to MariaDB LTS 10.6 To make sure that PMEM problem does not happen again sync 10.9 and up debian/rules to make sure that they are not making anymore problems with autobake-debs.sh --- debian/autobake-deb.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index 5188413b40b..0ceabf8b1de 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -58,8 +58,8 @@ remove_rocksdb_tools() replace_uring_with_aio() { sed 's/liburing-dev/libaio-dev/g' -i debian/control - sed -e '/-DIGNORE_AIO_CHECK=YES/d' \ - -e '/-DWITH_URING=YES/d' -i debian/rules + sed -e '/-DIGNORE_AIO_CHECK=ON/d' \ + -e '/-DWITH_URING=ON/d' -i debian/rules } disable_pmem() From fe89df42686fd41e986dc775e12ad6f3594d5bca Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Tue, 2 May 2023 00:31:57 -0700 Subject: [PATCH 215/260] MDEV-31162 Crash for query using ROWNUM over multi-table view with ORDER BY This bug could cause a crash of the server when processing a query with ROWNUM() if it used in its FROM list a reference to a mergeable view defined as SELECT over more than one table that contained ORDER BY clause. When a mergeable view with ORDER BY clause and without LIMIT clause is used in the FROM list of a query that does not have ORDER BY clause the ORDER BY clause of the view is moved to the query. The code that performed this transformation forgot to delete the moved ORDER BY list from the view. If a query contains ROWNUM() and uses a mergeable multi-table view with ORDER BY then according to the current code of TABLE_LIST::init_derived() the view has to be forcibly materialized. As the query and the view shared the same items in its ORDER BY lists they could not be properly resolved either in the query or in the view. This led to a crash of the server. This patch has returned back the original signature of LEX::can_not_use_merged() to comply with 10.4 code of the condition that checks whether a megeable view has to be forcibly materialized. Approved by Oleksandr Byelkin --- mysql-test/main/derived_view.result | 48 +++++++++++++++++++++++++++++ mysql-test/main/derived_view.test | 40 ++++++++++++++++++++++++ sql/sql_lex.cc | 6 +--- sql/sql_lex.h | 2 +- sql/sql_view.cc | 5 ++- sql/table.cc | 6 ++-- 6 files changed, 98 insertions(+), 9 deletions(-) diff --git a/mysql-test/main/derived_view.result b/mysql-test/main/derived_view.result index 0bb934f5016..4cb567ccab0 100644 --- a/mysql-test/main/derived_view.result +++ b/mysql-test/main/derived_view.result @@ -4190,4 +4190,52 @@ Warnings: Warning 1287 '@@big_tables' is deprecated and will be removed in a future release drop view v; drop table t1, t2; +# +# MDEV-31162: multi-table mergeable view with ORDER BY used +# in query with rownum() in WHERE +# +create table t1 (a INT) engine=MyISAM; +insert into t1 values (1),(2); +create table t2 (b INT) engine=MyISAM; +insert into t2 values (3),(4); +create view v1 AS select * from t1 join t2 order by b; +explain select * from v1 where rownum() <= 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) +select * from v1 where rownum() <= 2; +a b +1 3 +2 3 +prepare stmt from "select * from v1 where rownum() <= 2"; +execute stmt; +a b +1 3 +2 3 +execute stmt; +a b +1 3 +2 3 +deallocate prepare stmt; +create view v2 AS select * from t1 join t2 order by b/a; +explain select * from v2 where rownum() <= 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) +select * from v2 where rownum() <= 2; +a b +2 3 +1 3 +prepare stmt from "select * from v2 where rownum() <= 2"; +execute stmt; +a b +2 3 +1 3 +execute stmt; +a b +2 3 +1 3 +deallocate prepare stmt; +drop view v1,v2; +drop table t1,t2; # End of 10.6 tests diff --git a/mysql-test/main/derived_view.test b/mysql-test/main/derived_view.test index d03fc37fe24..777389a9844 100644 --- a/mysql-test/main/derived_view.test +++ b/mysql-test/main/derived_view.test @@ -2773,4 +2773,44 @@ set big_tables=default; drop view v; drop table t1, t2; +--echo # +--echo # MDEV-31162: multi-table mergeable view with ORDER BY used +--echo # in query with rownum() in WHERE +--echo # + +create table t1 (a INT) engine=MyISAM; +insert into t1 values (1),(2); + +create table t2 (b INT) engine=MyISAM; +insert into t2 values (3),(4); + +create view v1 AS select * from t1 join t2 order by b; +let $q1= +select * from v1 where rownum() <= 2; + +eval explain $q1; +--sorted_result +eval $q1; + +eval prepare stmt from "$q1"; +--sorted_result +execute stmt; +--sorted_result +execute stmt; +deallocate prepare stmt; + +create view v2 AS select * from t1 join t2 order by b/a; +let $q2= +select * from v2 where rownum() <= 2; + +eval explain $q2; +eval $q2; +eval prepare stmt from "$q2"; +execute stmt; +execute stmt; +deallocate prepare stmt; + +drop view v1,v2; +drop table t1,t2; + --echo # End of 10.6 tests diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 743488ab808..dd3d182784c 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -4090,7 +4090,7 @@ bool LEX::can_use_merged() TRUE - VIEWs with MERGE algorithms can be used */ -bool LEX::can_not_use_merged(bool no_update_or_delete) +bool LEX::can_not_use_merged() { switch (sql_command) { case SQLCOM_CREATE_VIEW: @@ -4103,10 +4103,6 @@ bool LEX::can_not_use_merged(bool no_update_or_delete) case SQLCOM_SHOW_FIELDS: return TRUE; - case SQLCOM_UPDATE_MULTI: - case SQLCOM_DELETE_MULTI: - return no_update_or_delete; - default: return FALSE; } diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 2076fdf21f4..d457e309014 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -3659,7 +3659,7 @@ public: bool can_be_merged(); bool can_use_merged(); - bool can_not_use_merged(bool no_update_or_delete); + bool can_not_use_merged(); bool only_view_structure(); bool need_correct_ident(); uint8 get_effective_with_check(TABLE_LIST *view); diff --git a/sql/sql_view.cc b/sql/sql_view.cc index e3bfe37b172..a4da5c48b6d 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1808,7 +1808,7 @@ bool mysql_make_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *table, if (view_is_mergeable && (table->select_lex->master_unit() != &old_lex->unit || old_lex->can_use_merged()) && - !old_lex->can_not_use_merged(0)) + !old_lex->can_not_use_merged()) { /* lex should contain at least one table */ DBUG_ASSERT(view_main_select_tables != 0); @@ -1841,8 +1841,11 @@ bool mysql_make_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *table, */ if (!table->select_lex->master_unit()->is_unit_op() && table->select_lex->order_list.elements == 0) + { table->select_lex->order_list. push_back(&lex->first_select_lex()->order_list); + lex->first_select_lex()->order_list.empty(); + } else { if (old_lex->sql_command == SQLCOM_SELECT && diff --git a/sql/table.cc b/sql/table.cc index 1bc7b36775a..5bbecb88bb6 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -9551,8 +9551,10 @@ bool TABLE_LIST::init_derived(THD *thd, bool init_view) (!first_select->group_list.elements && !first_select->order_list.elements)) && (is_view() || - (optimizer_flag(thd, OPTIMIZER_SWITCH_DERIVED_MERGE) && - !thd->lex->can_not_use_merged(1))) && + optimizer_flag(thd, OPTIMIZER_SWITCH_DERIVED_MERGE)) && + !thd->lex->can_not_use_merged() && + !((thd->lex->sql_command == SQLCOM_UPDATE_MULTI || + thd->lex->sql_command == SQLCOM_DELETE_MULTI) && !is_view()) && !is_recursive_with_table()) set_merged_derived(); else From c6ef9b1c1a59dd5dae81888d47f1749e1a433b96 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Tue, 2 May 2023 11:20:35 +0200 Subject: [PATCH 216/260] wsrep-lib external submodule update --- wsrep-lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wsrep-lib b/wsrep-lib index 275a0af8c5b..4951c383577 160000 --- a/wsrep-lib +++ b/wsrep-lib @@ -1 +1 @@ -Subproject commit 275a0af8c5b92f0ee33cfe9e23f3db5f59b56e9d +Subproject commit 4951c38357737d568b554402bc5b6abe88a38fe1 From 495f1ecac20dd94719ec24332c4c56c806b54269 Mon Sep 17 00:00:00 2001 From: Andrei Date: Tue, 2 May 2023 15:52:36 +0300 Subject: [PATCH 217/260] MDEV-29621 manual merge from 10.4 -> 10.5 1. log_event.cc stuff should go into log_event_server.cc 2. the test's wait condition is textually different in 10.5, fixed. 3. pre-exec 'optimistic' global var value is correct for 10.5 indeed. --- .../suite/rpl/r/rpl_parallel_seq.result | 2 +- mysql-test/suite/rpl/t/rpl_parallel_seq.test | 2 +- sql/log_event_server.cc | 27 ++++++++++++++++--- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_parallel_seq.result b/mysql-test/suite/rpl/r/rpl_parallel_seq.result index 60061049ed4..ae4041f470d 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel_seq.result +++ b/mysql-test/suite/rpl/r/rpl_parallel_seq.result @@ -74,7 +74,7 @@ connection slave; include/stop_slave.inc SET debug_sync = RESET; SET @@global.slave_parallel_threads= 0; -SET @@global.slave_parallel_mode= conservative; +SET @@global.slave_parallel_mode= optimistic; SET @@global.debug_dbug = ""; SET @@global.gtid_strict_mode=0; include/start_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_parallel_seq.test b/mysql-test/suite/rpl/t/rpl_parallel_seq.test index 741859bc588..2a4fd96ff34 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel_seq.test +++ b/mysql-test/suite/rpl/t/rpl_parallel_seq.test @@ -28,7 +28,7 @@ SET @@global.slave_parallel_mode=optimistic; SET @@global.debug_dbug="+d,hold_worker_on_schedule"; --source include/start_slave.inc ---let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to start commit before starting%" +--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to start commit" --source include/wait_condition.inc SET DEBUG_SYNC = 'now SIGNAL continue_worker'; diff --git a/sql/log_event_server.cc b/sql/log_event_server.cc index f19bebd9863..b93c892dc02 100644 --- a/sql/log_event_server.cc +++ b/sql/log_event_server.cc @@ -7493,8 +7493,14 @@ Rows_log_event::write_row(rpl_group_info *rgi, int Rows_log_event::update_sequence() { TABLE *table= m_table; // pointer to event's table + bool old_master= false; + int err= 0; - if (!bitmap_is_set(table->rpl_write_set, MIN_VALUE_FIELD_NO)) + if (!bitmap_is_set(table->rpl_write_set, MIN_VALUE_FIELD_NO) || + (!(table->in_use->rgi_slave->gtid_ev_flags2 & Gtid_log_event::FL_DDL) && + !(old_master= + rpl_master_has_bug(thd->rgi_slave->rli, + 29621, FALSE, FALSE, FALSE, TRUE)))) { /* This event come from a setval function executed on the master. Update the sequence next_number and round, like we do with setval() @@ -7507,12 +7513,27 @@ int Rows_log_event::update_sequence() return table->s->sequence->set_value(table, nextval, round, 0) > 0; } - + if (thd->rgi_slave->is_parallel_exec && old_master) + { + DBUG_ASSERT(thd->rgi_slave->parallel_entry); + /* + With parallel replication enabled, we can't execute alongside any other + transaction in which we may depend, so we force retry to release + the server layer table lock for possible prior in binlog order + same table transactions. + */ + if (thd->rgi_slave->parallel_entry->last_committed_sub_id < + thd->rgi_slave->wait_commit_sub_id) + { + err= ER_LOCK_DEADLOCK; + my_error(err, MYF(0)); + } + } /* Update all fields in table and update the active sequence, like with ALTER SEQUENCE */ - return table->file->ha_write_row(table->record[0]); + return err == 0 ? table->file->ha_write_row(table->record[0]) : err; } From ca001cf2048f0152689e1895e2dc15486dd0b1af Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Tue, 2 May 2023 20:13:48 +0200 Subject: [PATCH 218/260] New CC 3.1 --- libmariadb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmariadb b/libmariadb index f5a4c73df4f..a3bba4639f5 160000 --- a/libmariadb +++ b/libmariadb @@ -1 +1 @@ -Subproject commit f5a4c73df4fa30a2fd0c5fad65338f455665b334 +Subproject commit a3bba4639f55148c59a28a506df8a2b88e5e83ab From 8c793eaaf44ba3aea7f07986b908367ece3d247f Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Wed, 3 May 2023 07:30:12 +0200 Subject: [PATCH 219/260] Fix test after merge (by Thiru) --- mysql-test/main/insert_innodb.result | 2 +- mysql-test/main/insert_innodb.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/main/insert_innodb.result b/mysql-test/main/insert_innodb.result index 314412bcfdd..b8f3979d2ba 100644 --- a/mysql-test/main/insert_innodb.result +++ b/mysql-test/main/insert_innodb.result @@ -51,7 +51,7 @@ CREATE TEMPORARY TABLE v0 ( v1 TEXT ( 15 ) CHAR SET BINARY NOT NULL NOT NULL UNI ERROR HY000: Field 'v1' doesn't have a default value CREATE TEMPORARY TABLE t1 (i TEXT(15) NOT NULL DEFAULT '' UNIQUE CHECK (i)) engine=innodb REPLACE SELECT NULL AS a; -ERROR HY000: Field 'DB_ROW_HASH_1' doesn't have a default value +ERROR 23000: CONSTRAINT `t1.i` failed for `test`.`t1` # # End of 10.5 tests # diff --git a/mysql-test/main/insert_innodb.test b/mysql-test/main/insert_innodb.test index b5a9fc72c07..56ddb2eafbf 100644 --- a/mysql-test/main/insert_innodb.test +++ b/mysql-test/main/insert_innodb.test @@ -71,7 +71,7 @@ DROP TABLE t2, t1; --error ER_NO_DEFAULT_FOR_FIELD CREATE TEMPORARY TABLE v0 ( v1 TEXT ( 15 ) CHAR SET BINARY NOT NULL NOT NULL UNIQUE CHECK ( v1 ) ) REPLACE SELECT NULL AS v3 , 74 AS v2 ; ---error ER_NO_DEFAULT_FOR_FIELD +--error ER_CONSTRAINT_FAILED CREATE TEMPORARY TABLE t1 (i TEXT(15) NOT NULL DEFAULT '' UNIQUE CHECK (i)) engine=innodb REPLACE SELECT NULL AS a; From 430b972702542f128c1b50aea02e8e810f98048c Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Wed, 3 May 2023 07:45:15 +0200 Subject: [PATCH 220/260] Protect a new condition (by Andrei) --- sql/log_event.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index db682bd0835..42d15ea1810 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -13766,7 +13766,11 @@ int Rows_log_event::update_sequence() int err= 0; if (!bitmap_is_set(table->rpl_write_set, MIN_VALUE_FIELD_NO) || - (!(table->in_use->rgi_slave->gtid_ev_flags2 & Gtid_log_event::FL_DDL) && + ( +#if defined(WITH_WSREP) + ! WSREP(thd) && +#endif + !(table->in_use->rgi_slave->gtid_ev_flags2 & Gtid_log_event::FL_DDL) && !(old_master= rpl_master_has_bug(thd->rgi_slave->rli, 29621, FALSE, FALSE, FALSE, TRUE)))) From ec79f377186adf7a233608e7f30364c4007a981a Mon Sep 17 00:00:00 2001 From: Andrei Date: Wed, 3 May 2023 10:32:29 +0300 Subject: [PATCH 221/260] MDEV-29621 part 2 of post-merge fixes in galera (part 1 is in the previous commit) to [ pass ] galera.MDEV-18832, galera.MDEV-27862 --- sql/log_event.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index 42d15ea1810..bafcf34cc2e 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -13786,7 +13786,7 @@ int Rows_log_event::update_sequence() return table->s->sequence->set_value(table, nextval, round, 0) > 0; } - if (thd->rgi_slave->is_parallel_exec && old_master) + if (old_master && !WSREP(thd) && thd->rgi_slave->is_parallel_exec) { DBUG_ASSERT(thd->rgi_slave->parallel_entry); /* From ce7ffe61d836fe9f0cfc1087f058bc40d66e5cfb Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Tue, 2 May 2023 23:17:07 -0700 Subject: [PATCH 222/260] MDEV-26301 Split optimization refills temporary table too many times This patch optimizes the number of refills for the lateral derived table to which a materialized derived table subject to split optimization is is converted. This optimized number of refills is now considered as the expected number of refills of the materialized derived table when searching for the best possible splitting of the table. --- mysql-test/main/derived_split_innodb.result | 511 ++++++++++++++++++++ mysql-test/main/derived_split_innodb.test | 213 ++++++++ sql/opt_split.cc | 150 +++++- sql/sql_select.cc | 37 +- sql/sql_select.h | 31 +- 5 files changed, 910 insertions(+), 32 deletions(-) diff --git a/mysql-test/main/derived_split_innodb.result b/mysql-test/main/derived_split_innodb.result index 04f79d3f018..a2dd1470d15 100644 --- a/mysql-test/main/derived_split_innodb.result +++ b/mysql-test/main/derived_split_innodb.result @@ -284,3 +284,514 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DERIVED t4 ALL NULL NULL NULL NULL 40 Using filesort drop table t3, t4; # End of 10.3 tests +# +# MDEV-26301: Split optimization refills temporary table too many times +# +create table t1(a int, b int); +insert into t1 select seq,seq from seq_1_to_5; +create table t2(a int, b int, key(a)); +insert into t2 +select A.seq,B.seq from seq_1_to_25 A, seq_1_to_2 B; +create table t3(a int, b int, key(a)); +insert into t3 +select A.seq,B.seq from seq_1_to_5 A, seq_1_to_3 B; +analyze table t1,t2,t3 persistent for all; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status Table is already up to date +test.t3 analyze status Engine-independent statistics collected +test.t3 analyze status Table is already up to date +explain +select * from +(t1 left join t2 on t2.a=t1.b) left join t3 on t3.a=t1.b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 5 test.t1.b 2 Using where +1 SIMPLE t3 ref a a 5 test.t1.b 3 Using where +create table t10 ( +grp_id int, +col1 int, +key(grp_id) +); +insert into t10 +select +A.seq, +B.seq +from +seq_1_to_100 A, +seq_1_to_100 B; +create table t11 ( +col1 int, +col2 int +); +insert into t11 +select A.seq, A.seq from seq_1_to_10 A; +analyze table t10,t11 persistent for all; +Table Op Msg_type Msg_text +test.t10 analyze status Engine-independent statistics collected +test.t10 analyze status Table is already up to date +test.t11 analyze status Engine-independent statistics collected +test.t11 analyze status OK +explain select * from +( +(t1 left join t2 on t2.a=t1.b) +left join t3 on t3.a=t1.b +) left join (select grp_id, count(*) +from t10 left join t11 on t11.col1=t10.col1 +group by grp_id) T on T.grp_id=t1.b; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 5 +1 PRIMARY t2 ref a a 5 test.t1.b 2 Using where +1 PRIMARY t3 ref a a 5 test.t1.b 3 Using where +1 PRIMARY ref key0 key0 5 test.t1.b 10 Using where +2 LATERAL DERIVED t10 ref grp_id grp_id 5 test.t1.b 100 +2 LATERAL DERIVED t11 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join) +# The important part in the below output is: +# "lateral": 1, +# "query_block": { +# "select_id": 2, +# "r_loops": 5, <-- must be 5, not 30. +analyze format=json select * from +( +(t1 left join t2 on t2.a=t1.b) +left join t3 on t3.a=t1.b +) left join (select grp_id, count(*) +from t10 left join t11 on t11.col1=t10.col1 +group by grp_id) T on T.grp_id=t1.b; +ANALYZE +{ + "query_block": { + "select_id": 1, + "r_loops": 1, + "r_total_time_ms": "REPLACED", + "const_condition": "1", + "table": { + "table_name": "t1", + "access_type": "ALL", + "r_loops": 1, + "rows": 5, + "r_rows": 5, + "r_total_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 100 + }, + "table": { + "table_name": "t2", + "access_type": "ref", + "possible_keys": ["a"], + "key": "a", + "key_length": "5", + "used_key_parts": ["a"], + "ref": ["test.t1.b"], + "r_loops": 5, + "rows": 2, + "r_rows": 2, + "r_total_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 100, + "attached_condition": "trigcond(trigcond(t1.b is not null))" + }, + "table": { + "table_name": "t3", + "access_type": "ref", + "possible_keys": ["a"], + "key": "a", + "key_length": "5", + "used_key_parts": ["a"], + "ref": ["test.t1.b"], + "r_loops": 10, + "rows": 3, + "r_rows": 3, + "r_total_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 100, + "attached_condition": "trigcond(trigcond(t1.b is not null))" + }, + "table": { + "table_name": "", + "access_type": "ref", + "possible_keys": ["key0"], + "key": "key0", + "key_length": "5", + "used_key_parts": ["grp_id"], + "ref": ["test.t1.b"], + "r_loops": 30, + "rows": 10, + "r_rows": 1, + "r_total_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 100, + "attached_condition": "trigcond(trigcond(t1.b is not null))", + "materialized": { + "lateral": 1, + "query_block": { + "select_id": 2, + "r_loops": 5, + "r_total_time_ms": "REPLACED", + "outer_ref_condition": "t1.b is not null", + "table": { + "table_name": "t10", + "access_type": "ref", + "possible_keys": ["grp_id"], + "key": "grp_id", + "key_length": "5", + "used_key_parts": ["grp_id"], + "ref": ["test.t1.b"], + "r_loops": 5, + "rows": 100, + "r_rows": 100, + "r_total_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 100 + }, + "block-nl-join": { + "table": { + "table_name": "t11", + "access_type": "ALL", + "r_loops": 5, + "rows": 10, + "r_rows": 10, + "r_total_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 100 + }, + "buffer_type": "flat", + "buffer_size": "1Kb", + "join_type": "BNL", + "attached_condition": "trigcond(t11.col1 = t10.col1)", + "r_filtered": 10 + } + } + } + } + } +} +create table t21 (pk int primary key); +insert into t21 values (1),(2),(3); +create table t22 (pk int primary key); +insert into t22 values (1),(2),(3); +explain +select * from +t21, t22, +( +(t1 left join t2 on t2.a=t1.b) +left join t3 on t3.a=t1.b +) left join (select grp_id, count(*) +from t10 left join t11 on t11.col1=t10.col1 +group by grp_id) T on T.grp_id=t1.b +where +t21.pk=1 and t22.pk=2; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t21 const PRIMARY PRIMARY 4 const 1 Using index +1 PRIMARY t22 const PRIMARY PRIMARY 4 const 1 Using index +1 PRIMARY t1 ALL NULL NULL NULL NULL 5 +1 PRIMARY t2 ref a a 5 test.t1.b 2 Using where +1 PRIMARY t3 ref a a 5 test.t1.b 3 Using where +1 PRIMARY ref key0 key0 5 test.t1.b 10 Using where +2 LATERAL DERIVED t10 ref grp_id grp_id 5 test.t1.b 100 +2 LATERAL DERIVED t11 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join) +explain +select * from +t21, +( +(t1 left join t2 on t2.a=t1.b) +left join t3 on t3.a=t1.b +) left join (select grp_id, count(*) +from +t22 join t10 left join t11 on t11.col1=t10.col1 +where +t22.pk=1 +group by grp_id) T on T.grp_id=t1.b +where +t21.pk=1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t21 const PRIMARY PRIMARY 4 const 1 Using index +1 PRIMARY t1 ALL NULL NULL NULL NULL 5 +1 PRIMARY t2 ref a a 5 test.t1.b 2 Using where +1 PRIMARY t3 ref a a 5 test.t1.b 3 Using where +1 PRIMARY ref key0 key0 5 test.t1.b 10 Using where +2 LATERAL DERIVED t22 const PRIMARY PRIMARY 4 const 1 Using index +2 LATERAL DERIVED t10 ref grp_id grp_id 5 test.t1.b 100 +2 LATERAL DERIVED t11 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join) +create table t5 ( +pk int primary key +); +insert into t5 select seq from seq_1_to_1000; +explain +select * from +t21, +( +(((t1 join t5 on t5.pk=t1.b)) left join t2 on t2.a=t1.b) +left join t3 on t3.a=t1.b +) left join (select grp_id, count(*) +from +t22 join t10 left join t11 on t11.col1=t10.col1 +where +t22.pk=1 +group by grp_id) T on T.grp_id=t1.b +where +t21.pk=1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t21 const PRIMARY PRIMARY 4 const 1 Using index +1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where +1 PRIMARY t5 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 Using index +1 PRIMARY t2 ref a a 5 test.t1.b 2 +1 PRIMARY t3 ref a a 5 test.t1.b 3 +1 PRIMARY ref key0 key0 5 test.t1.b 10 Using where +2 LATERAL DERIVED t22 const PRIMARY PRIMARY 4 const 1 Using index +2 LATERAL DERIVED t10 ref grp_id grp_id 5 test.t5.pk 100 Using index condition +2 LATERAL DERIVED t11 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join) +drop table t1,t2,t3,t5, t10, t11, t21, t22; +create table t1(a int, b int); +insert into t1 select seq,seq from seq_1_to_5; +create table t2(a int, b int, key(a)); +insert into t2 +select A.seq,B.seq from seq_1_to_25 A, seq_1_to_2 B; +create table t3(a int, b int, key(a)); +insert into t3 +select A.seq,B.seq from seq_1_to_5 A, seq_1_to_3 B; +analyze table t1,t2,t3 persistent for all; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status Table is already up to date +test.t3 analyze status Engine-independent statistics collected +test.t3 analyze status Table is already up to date +create table t10 ( +grp_id int, +col1 int, +key(grp_id) +); +insert into t10 +select +A.seq, +B.seq +from +seq_1_to_100 A, +seq_1_to_100 B; +create table t11 ( +col1 int, +col2 int +); +insert into t11 +select A.seq, A.seq from seq_1_to_10 A; +analyze table t10,t11 persistent for all; +Table Op Msg_type Msg_text +test.t10 analyze status Engine-independent statistics collected +test.t10 analyze status Table is already up to date +test.t11 analyze status Engine-independent statistics collected +test.t11 analyze status OK +explain select * +from +( +(t1 left join t2 on t2.a=t1.b) +left join +t3 +on t3.a=t1.b +) +left join +( +select grp_id, count(*) +from t10 left join t11 on t11.col1=t10.col1 +group by grp_id +)dt +on dt.grp_id=t1.b; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 5 +1 PRIMARY t2 ref a a 5 test.t1.b 2 Using where +1 PRIMARY t3 ref a a 5 test.t1.b 3 Using where +1 PRIMARY ref key0 key0 5 test.t1.b 10 Using where +2 LATERAL DERIVED t10 ref grp_id grp_id 5 test.t1.b 100 +2 LATERAL DERIVED t11 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join) +select * +from +( +(t1 left join t2 on t2.a=t1.b) +left join +t3 +on t3.a=t1.b +) +left join +( +select grp_id, count(*) +from t10 left join t11 on t11.col1=t10.col1 +group by grp_id +)dt +on dt.grp_id=t1.b; +a b a b a b grp_id count(*) +1 1 1 1 1 1 1 100 +1 1 1 1 1 2 1 100 +1 1 1 1 1 3 1 100 +1 1 1 2 1 1 1 100 +1 1 1 2 1 2 1 100 +1 1 1 2 1 3 1 100 +2 2 2 1 2 1 2 100 +2 2 2 1 2 2 2 100 +2 2 2 1 2 3 2 100 +2 2 2 2 2 1 2 100 +2 2 2 2 2 2 2 100 +2 2 2 2 2 3 2 100 +3 3 3 1 3 1 3 100 +3 3 3 1 3 2 3 100 +3 3 3 1 3 3 3 100 +3 3 3 2 3 1 3 100 +3 3 3 2 3 2 3 100 +3 3 3 2 3 3 3 100 +4 4 4 1 4 1 4 100 +4 4 4 1 4 2 4 100 +4 4 4 1 4 3 4 100 +4 4 4 2 4 1 4 100 +4 4 4 2 4 2 4 100 +4 4 4 2 4 3 4 100 +5 5 5 1 5 1 5 100 +5 5 5 1 5 2 5 100 +5 5 5 1 5 3 5 100 +5 5 5 2 5 1 5 100 +5 5 5 2 5 2 5 100 +5 5 5 2 5 3 5 100 +set join_cache_level=4; +explain select * +from +( +(t1 left join t2 on t2.a=t1.b) +left join +t3 +on t3.a=t1.b +) +left join +( +select grp_id, count(*) +from t10 left join t11 on t11.col1=t10.col1 +group by grp_id +)dt +on dt.grp_id=t1.b; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 5 +1 PRIMARY t2 ref a a 5 test.t1.b 2 Using where +1 PRIMARY t3 ref a a 5 test.t1.b 3 Using where +1 PRIMARY ref key0 key0 5 test.t1.b 10 Using where +2 LATERAL DERIVED t10 ref grp_id grp_id 5 test.t1.b 100 +2 LATERAL DERIVED t11 hash_ALL NULL #hash#$hj 5 test.t10.col1 10 Using where; Using join buffer (flat, BNLH join) +select * +from +( +(t1 left join t2 on t2.a=t1.b) +left join +t3 +on t3.a=t1.b +) +left join +( +select grp_id, count(*) +from t10 left join t11 on t11.col1=t10.col1 +group by grp_id +)dt +on dt.grp_id=t1.b; +a b a b a b grp_id count(*) +1 1 1 1 1 1 1 100 +1 1 1 1 1 2 1 100 +1 1 1 1 1 3 1 100 +1 1 1 2 1 1 1 100 +1 1 1 2 1 2 1 100 +1 1 1 2 1 3 1 100 +2 2 2 1 2 1 2 100 +2 2 2 1 2 2 2 100 +2 2 2 1 2 3 2 100 +2 2 2 2 2 1 2 100 +2 2 2 2 2 2 2 100 +2 2 2 2 2 3 2 100 +3 3 3 1 3 1 3 100 +3 3 3 1 3 2 3 100 +3 3 3 1 3 3 3 100 +3 3 3 2 3 1 3 100 +3 3 3 2 3 2 3 100 +3 3 3 2 3 3 3 100 +4 4 4 1 4 1 4 100 +4 4 4 1 4 2 4 100 +4 4 4 1 4 3 4 100 +4 4 4 2 4 1 4 100 +4 4 4 2 4 2 4 100 +4 4 4 2 4 3 4 100 +5 5 5 1 5 1 5 100 +5 5 5 1 5 2 5 100 +5 5 5 1 5 3 5 100 +5 5 5 2 5 1 5 100 +5 5 5 2 5 2 5 100 +5 5 5 2 5 3 5 100 +set join_cache_level=default; +drop index a on t2; +drop index a on t3; +explain select * +from +( +(t1 left join t2 on t2.a=t1.b) +left join +t3 +on t3.a=t1.b +) +left join +( +select grp_id, count(*) +from t10 left join t11 on t11.col1=t10.col1 +group by grp_id +)dt +on dt.grp_id=t1.b; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 5 +1 PRIMARY t2 ALL NULL NULL NULL NULL 50 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t3 ALL NULL NULL NULL NULL 15 Using where; Using join buffer (incremental, BNL join) +1 PRIMARY ref key0 key0 5 test.t1.b 1000 Using where +2 DERIVED t10 ALL grp_id NULL NULL NULL 10000 Using temporary; Using filesort +2 DERIVED t11 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join) +select * +from +( +(t1 left join t2 on t2.a=t1.b) +left join +t3 +on t3.a=t1.b +) +left join +( +select grp_id, count(*) +from t10 left join t11 on t11.col1=t10.col1 +group by grp_id +)dt +on dt.grp_id=t1.b; +a b a b a b grp_id count(*) +1 1 1 1 1 1 1 100 +1 1 1 2 1 1 1 100 +1 1 1 1 1 2 1 100 +1 1 1 2 1 2 1 100 +1 1 1 1 1 3 1 100 +1 1 1 2 1 3 1 100 +2 2 2 1 2 1 2 100 +2 2 2 2 2 1 2 100 +2 2 2 1 2 2 2 100 +2 2 2 2 2 2 2 100 +2 2 2 1 2 3 2 100 +2 2 2 2 2 3 2 100 +3 3 3 1 3 1 3 100 +3 3 3 2 3 1 3 100 +3 3 3 1 3 2 3 100 +3 3 3 2 3 2 3 100 +3 3 3 1 3 3 3 100 +3 3 3 2 3 3 3 100 +4 4 4 1 4 1 4 100 +4 4 4 2 4 1 4 100 +4 4 4 1 4 2 4 100 +4 4 4 2 4 2 4 100 +4 4 4 1 4 3 4 100 +4 4 4 2 4 3 4 100 +5 5 5 1 5 1 5 100 +5 5 5 2 5 1 5 100 +5 5 5 1 5 2 5 100 +5 5 5 2 5 2 5 100 +5 5 5 1 5 3 5 100 +5 5 5 2 5 3 5 100 +drop table t1,t2,t3; +drop table t10, t11; +# End of 10.4 tests diff --git a/mysql-test/main/derived_split_innodb.test b/mysql-test/main/derived_split_innodb.test index 2f74f5fe747..a26c9af4e64 100644 --- a/mysql-test/main/derived_split_innodb.test +++ b/mysql-test/main/derived_split_innodb.test @@ -227,3 +227,216 @@ where t3.b > 15; drop table t3, t4; --echo # End of 10.3 tests + +--source include/have_sequence.inc + +--echo # +--echo # MDEV-26301: Split optimization refills temporary table too many times +--echo # + +# 5 values +create table t1(a int, b int); +insert into t1 select seq,seq from seq_1_to_5; + +# 5 value groups of size 2 each +create table t2(a int, b int, key(a)); +insert into t2 +select A.seq,B.seq from seq_1_to_25 A, seq_1_to_2 B; + +# 5 value groups of size 3 each +create table t3(a int, b int, key(a)); +insert into t3 +select A.seq,B.seq from seq_1_to_5 A, seq_1_to_3 B; + +analyze table t1,t2,t3 persistent for all; + +explain +select * from + (t1 left join t2 on t2.a=t1.b) left join t3 on t3.a=t1.b; + +# Now, create tables for Groups. + +create table t10 ( + grp_id int, + col1 int, + key(grp_id) +); + +# 100 groups of 100 values each +insert into t10 +select + A.seq, + B.seq +from + seq_1_to_100 A, + seq_1_to_100 B; + +# and X10 multiplier + +create table t11 ( + col1 int, + col2 int +); +insert into t11 +select A.seq, A.seq from seq_1_to_10 A; + +analyze table t10,t11 persistent for all; + +let $q1= +select * from + ( + (t1 left join t2 on t2.a=t1.b) + left join t3 on t3.a=t1.b + ) left join (select grp_id, count(*) + from t10 left join t11 on t11.col1=t10.col1 + group by grp_id) T on T.grp_id=t1.b; + +eval +explain $q1; + +--echo # The important part in the below output is: +--echo # "lateral": 1, +--echo # "query_block": { +--echo # "select_id": 2, +--echo # "r_loops": 5, <-- must be 5, not 30. +--source include/analyze-format.inc + +eval +analyze format=json $q1; + +create table t21 (pk int primary key); +insert into t21 values (1),(2),(3); + +create table t22 (pk int primary key); +insert into t22 values (1),(2),(3); + +# Same as above but throw in a couple of const tables. +explain +select * from + t21, t22, + ( + (t1 left join t2 on t2.a=t1.b) + left join t3 on t3.a=t1.b + ) left join (select grp_id, count(*) + from t10 left join t11 on t11.col1=t10.col1 + group by grp_id) T on T.grp_id=t1.b +where + t21.pk=1 and t22.pk=2; + +explain +select * from + t21, + ( + (t1 left join t2 on t2.a=t1.b) + left join t3 on t3.a=t1.b + ) left join (select grp_id, count(*) + from + t22 join t10 left join t11 on t11.col1=t10.col1 + where + t22.pk=1 + group by grp_id) T on T.grp_id=t1.b +where + t21.pk=1; + +# And also add a non-const table + +create table t5 ( + pk int primary key + ); +insert into t5 select seq from seq_1_to_1000; + +explain +select * from + t21, + ( + (((t1 join t5 on t5.pk=t1.b)) left join t2 on t2.a=t1.b) + left join t3 on t3.a=t1.b + ) left join (select grp_id, count(*) + from + t22 join t10 left join t11 on t11.col1=t10.col1 + where + t22.pk=1 + group by grp_id) T on T.grp_id=t1.b +where + t21.pk=1; + +drop table t1,t2,t3,t5, t10, t11, t21, t22; + +# 5 values +create table t1(a int, b int); +insert into t1 select seq,seq from seq_1_to_5; + +# 5 value groups of size 2 each +create table t2(a int, b int, key(a)); +insert into t2 +select A.seq,B.seq from seq_1_to_25 A, seq_1_to_2 B; + +# 5 value groups of size 3 each +create table t3(a int, b int, key(a)); +insert into t3 +select A.seq,B.seq from seq_1_to_5 A, seq_1_to_3 B; + +analyze table t1,t2,t3 persistent for all; + +create table t10 ( + grp_id int, + col1 int, + key(grp_id) +); + +# 100 groups of 100 values each +insert into t10 +select + A.seq, + B.seq +from + seq_1_to_100 A, + seq_1_to_100 B; + +# and X10 multiplier + +create table t11 ( + col1 int, + col2 int +); +insert into t11 +select A.seq, A.seq from seq_1_to_10 A; + +analyze table t10,t11 persistent for all; + +let $q= +select * +from + ( + (t1 left join t2 on t2.a=t1.b) + left join + t3 + on t3.a=t1.b + ) + left join + ( + select grp_id, count(*) + from t10 left join t11 on t11.col1=t10.col1 + group by grp_id + )dt + on dt.grp_id=t1.b; + +eval explain $q; +eval $q; + +set join_cache_level=4; +eval explain $q; +eval $q; + +set join_cache_level=default; + +drop index a on t2; +drop index a on t3; + +eval explain $q; +eval $q; + +drop table t1,t2,t3; +drop table t10, t11; + +--echo # End of 10.4 tests diff --git a/sql/opt_split.cc b/sql/opt_split.cc index a356335855c..3a873e220b6 100644 --- a/sql/opt_split.cc +++ b/sql/opt_split.cc @@ -65,7 +65,7 @@ If we have only one equi-join condition then we either push it as for Q1R or we don't. In a general case we may have much more options. Consider the query (Q3) - SELECT + SELECT * FROM t1,t2 (SELECT t3.a, t3.b, MIN(t3.c) as min FROM t3 GROUP BY a,b) t WHERE t.a = t1.a AND t.b = t2.b @@ -102,6 +102,47 @@ If we just drop the index on t3(a,b) the chances that the splitting will be used becomes much lower but they still exists providing that the fanout of the partial join of t1 and t2 is small enough. + + The lateral derived table LT formed as a result of SM optimization applied + to a materialized derived table DT must be joined after all parameters + of splitting has been evaluated, i.e. after all expressions used in the + equalities pushed into DT that make the employed splitting effective + could be evaluated. With the chosen join order all the parameters can be + evaluated after the last table LPT that contains any columns referenced in + the parameters has been joined and the table APT following LPT in the chosen + join order is accessed. + Usually the formed lateral derived table LT is accessed right after the table + LPT. As in such cases table LT must be refilled for each combination of + splitting parameters this table must be populated before each access to LT + and the estimate of the expected number of refills that could be suggested in + such cases is the number of rows in the partial join ending with table LPT. + However in other cases the chosen join order may contain tables between LPT + and LT. + Consider the query (Q4) + SELECT * + FROM t1 JOIN t2 ON t1.b = t2.b + LEFT JOIN (SELECT t3.a, t3.b, MIN(t3.c) as min + FROM t3 GROUP BY a,b) t + ON t.a = t1.a AND t.c > 0 + [WHERE P(t1,t2)]; + Let's assume that the join order t1,t2,t was chosen for this query and + SP optimization was applied to t with splitting over t3.a using the index + on column t3.a. Here the table t1 serves as LPT, t2 as APT while t with + pushed condition t.a = t1.a serves as LT. Note that here LT is accessed + after t2, not right after t1. Here the number of refills of the lateral + derived is not more that the number of key values of t1.a that might be + less than the cardinality of the partial join (t1,t2). That's why it makes + sense to signal that t3 has to be refilled just before t2 is accessed. + However if the cardinality of the partial join (t1,t2) happens to be less + than the cardinality of the partial join (t1) due to additional selective + condition P(t1,t2) then the flag informing about necessity of a new refill + can be set either when accessing t2 or right after it has been joined. + The current code sets such flag right after generating a record of the + partial join with minimal cardinality for all those partial joins that + end between APT and LT. It allows sometimes to push extra conditions + into the lateral derived without any increase of the number of refills. + However this flag can be set only after the last join table between + APT and LT using join buffer has been joined. */ /* @@ -248,6 +289,7 @@ public: double unsplit_card; /* Lastly evaluated execution plan for 'join' with pushed equalities */ SplM_plan_info *last_plan; + double last_refills; SplM_plan_info *find_plan(TABLE *table, uint key, uint parts); }; @@ -831,13 +873,13 @@ SplM_plan_info *SplM_opt_info::find_plan(TABLE *table, uint key, uint parts) static void reset_validity_vars_for_keyuses(KEYUSE_EXT *key_keyuse_ext_start, TABLE *table, uint key, - table_map remaining_tables, + table_map excluded_tables, bool validity_val) { KEYUSE_EXT *keyuse_ext= key_keyuse_ext_start; do { - if (!(keyuse_ext->needed_in_prefix & remaining_tables)) + if (!(keyuse_ext->needed_in_prefix & excluded_tables)) { /* The enabling/disabling flags are set just in KEYUSE_EXT structures. @@ -857,8 +899,11 @@ void reset_validity_vars_for_keyuses(KEYUSE_EXT *key_keyuse_ext_start, Choose the best splitting to extend the evaluated partial join @param - record_count estimated cardinality of the extended partial join + idx index for joined table T in current partial join P remaining_tables tables not joined yet + spl_pd_boundary OUT bitmap of the table from P extended by T that + starts the sub-sequence of tables S from which + no conditions are allowed to be pushed into T. @details This function is called during the search for the best execution @@ -873,17 +918,19 @@ void reset_validity_vars_for_keyuses(KEYUSE_EXT *key_keyuse_ext_start, splitting the function set it as the true plan of materialization of the table T. The function caches the found plans for materialization of table T - together if the info what key was used for splitting. Next time when + together with the info what key was used for splitting. Next time when the optimizer prefers to use the same key the plan is taken from the cache of plans @retval Pointer to the info on the found plan that employs the pushed equalities if the plan has been chosen, NULL - otherwise. + If the function returns NULL the value of spl_param_tables is set to 0. */ -SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count, - table_map remaining_tables) +SplM_plan_info * JOIN_TAB::choose_best_splitting(uint idx, + table_map remaining_tables, + table_map *spl_pd_boundary) { SplM_opt_info *spl_opt_info= table->spl_opt_info; DBUG_ASSERT(spl_opt_info != NULL); @@ -898,6 +945,7 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count, SplM_plan_info *spl_plan= 0; uint best_key= 0; uint best_key_parts= 0; + table_map best_param_tables; /* Check whether there are keys that can be used to join T employing splitting @@ -916,6 +964,7 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count, uint key= keyuse_ext->key; KEYUSE_EXT *key_keyuse_ext_start= keyuse_ext; key_part_map found_parts= 0; + table_map needed_in_prefix= 0; do { if (keyuse_ext->needed_in_prefix & remaining_tables) @@ -941,6 +990,7 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count, KEY *key_info= table->key_info + key; double rec_per_key= key_info->actual_rec_per_key(keyuse_ext->keypart); + needed_in_prefix|= keyuse_ext->needed_in_prefix; if (rec_per_key < best_rec_per_key) { best_table= keyuse_ext->table; @@ -948,6 +998,7 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count, best_key_parts= keyuse_ext->keypart + 1; best_rec_per_key= rec_per_key; best_key_keyuse_ext_start= key_keyuse_ext_start; + best_param_tables= needed_in_prefix; } keyuse_ext++; } @@ -956,8 +1007,30 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count, while (keyuse_ext->table == table); } spl_opt_info->last_plan= 0; + double refills= DBL_MAX; + table_map excluded_tables= remaining_tables | this->join->sjm_lookup_tables; if (best_table) { + *spl_pd_boundary= this->table->map; + if (!best_param_tables) + refills= 1; + else + { + table_map last_found= this->table->map; + for (POSITION *pos= &this->join->positions[idx - 1]; ; pos--) + { + if (pos->table->table->map & excluded_tables) + continue; + if (pos->partial_join_cardinality < refills) + { + *spl_pd_boundary= last_found; + refills= pos->partial_join_cardinality; + } + last_found= pos->table->table->map; + if ((last_found & best_param_tables) || pos->use_join_buffer) + break; + } + } /* The key for splitting was chosen, look for the plan for this key in the cache @@ -971,7 +1044,7 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count, */ table_map all_table_map= (((table_map) 1) << join->table_count) - 1; reset_validity_vars_for_keyuses(best_key_keyuse_ext_start, best_table, - best_key, remaining_tables, true); + best_key, excluded_tables, true); choose_plan(join, all_table_map & ~join->const_table_map); /* @@ -990,7 +1063,7 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count, spl_opt_info->plan_cache.push_back(spl_plan)) { reset_validity_vars_for_keyuses(best_key_keyuse_ext_start, best_table, - best_key, remaining_tables, false); + best_key, excluded_tables, false); return 0; } @@ -1014,17 +1087,19 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count, (char *) join->best_positions, sizeof(POSITION) * join->table_count); reset_validity_vars_for_keyuses(best_key_keyuse_ext_start, best_table, - best_key, remaining_tables, false); + best_key, excluded_tables, false); } + if (spl_plan) { - if(record_count * spl_plan->cost < spl_opt_info->unsplit_cost) + if (refills * spl_plan->cost < spl_opt_info->unsplit_cost) { /* The best plan that employs splitting is cheaper than the plan without splitting */ spl_opt_info->last_plan= spl_plan; + spl_opt_info->last_refills= refills; } } } @@ -1034,11 +1109,14 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count, spl_plan= spl_opt_info->last_plan; if (spl_plan) { - startup_cost= record_count * spl_plan->cost; + startup_cost= spl_opt_info->last_refills * spl_plan->cost; records= (ha_rows) (records * spl_plan->split_sel); } else + { startup_cost= spl_opt_info->unsplit_cost; + *spl_pd_boundary= 0; + } return spl_plan; } @@ -1048,8 +1126,8 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count, Inject equalities for splitting used by the materialization join @param - excluded_tables used to filter out the equalities that cannot - be pushed. + excluded_tables used to filter out the equalities that are not + to be pushed. @details This function injects equalities pushed into a derived table T for which @@ -1142,7 +1220,7 @@ bool is_eq_cond_injected_for_split_opt(Item_func_eq *eq_item) @param spl_plan info on the splitting plan chosen for the splittable table T - remaining_tables the table T is joined just before these tables + excluded_tables tables that cannot be used in equalities pushed into T is_const_table the table T is a constant table @details @@ -1157,7 +1235,7 @@ bool is_eq_cond_injected_for_split_opt(Item_func_eq *eq_item) */ bool JOIN_TAB::fix_splitting(SplM_plan_info *spl_plan, - table_map remaining_tables, + table_map excluded_tables, bool is_const_table) { SplM_opt_info *spl_opt_info= table->spl_opt_info; @@ -1165,6 +1243,7 @@ bool JOIN_TAB::fix_splitting(SplM_plan_info *spl_plan, JOIN *md_join= spl_opt_info->join; if (spl_plan && !is_const_table) { + is_split_derived= true; memcpy((char *) md_join->best_positions, (char *) spl_plan->best_positions, sizeof(POSITION) * md_join->table_count); @@ -1175,7 +1254,7 @@ bool JOIN_TAB::fix_splitting(SplM_plan_info *spl_plan, reset_validity_vars_for_keyuses(spl_plan->keyuse_ext_start, spl_plan->table, spl_plan->key, - remaining_tables, + excluded_tables, true); } else if (md_join->save_qep) @@ -1211,8 +1290,21 @@ bool JOIN::fix_all_splittings_in_plan() if (tab->table->is_splittable()) { SplM_plan_info *spl_plan= cur_pos->spl_plan; + table_map excluded_tables= (all_tables & ~prev_tables) | + sjm_lookup_tables; + ; + if (spl_plan) + { + POSITION *pos= cur_pos; + table_map spl_pd_boundary= pos->spl_pd_boundary; + do + { + excluded_tables|= pos->table->table->map; + } + while (!((pos--)->table->table->map & spl_pd_boundary)); + } if (tab->fix_splitting(spl_plan, - all_tables & ~prev_tables, + excluded_tables, tablenr < const_tables )) return true; } @@ -1251,13 +1343,21 @@ bool JOIN::inject_splitting_cond_for_all_tables_with_split_opt() continue; SplM_opt_info *spl_opt_info= tab->table->spl_opt_info; JOIN *join= spl_opt_info->join; - /* - Currently the equalities referencing columns of SJM tables with - look-up access cannot be pushed into materialized derived. - */ - if (join->inject_best_splitting_cond((all_tables & ~prev_tables) | - sjm_lookup_tables)) - return true; + table_map excluded_tables= (all_tables & ~prev_tables) | sjm_lookup_tables; + table_map spl_pd_boundary= cur_pos->spl_pd_boundary; + for (POSITION *pos= cur_pos; ; pos--) + { + excluded_tables|= pos->table->table->map; + pos->table->no_forced_join_cache= true; + if (pos->table->table->map & spl_pd_boundary) + { + pos->table->split_derived_to_update|= tab->table->map; + break; + } + } + + if (join->inject_best_splitting_cond(excluded_tables)) + return true; } return false; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 56a185acdd5..bc5fd2be8b5 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7298,6 +7298,7 @@ void set_position(JOIN *join,uint idx,JOIN_TAB *table,KEYUSE *key) join->positions[idx].records_read=1.0; /* This is a const table */ join->positions[idx].cond_selectivity= 1.0; join->positions[idx].ref_depend_map= 0; + join->positions[idx].partial_join_cardinality= 1; // join->positions[idx].loosescan_key= MAX_KEY; /* Not a LooseScan */ join->positions[idx].sj_strategy= SJ_OPT_NONE; @@ -7315,6 +7316,7 @@ void set_position(JOIN *join,uint idx,JOIN_TAB *table,KEYUSE *key) } join->best_ref[idx]=table; join->positions[idx].spl_plan= 0; + join->positions[idx].spl_pd_boundary= 0; } @@ -7431,6 +7433,7 @@ best_access_path(JOIN *join, MY_BITMAP *eq_join_set= &s->table->eq_join_set; KEYUSE *hj_start_key= 0; SplM_plan_info *spl_plan= 0; + table_map spl_pd_boundary= 0; Range_rowid_filter_cost_info *filter= 0; const char* cause= NULL; enum join_type best_type= JT_UNKNOWN, type= JT_UNKNOWN; @@ -7448,7 +7451,9 @@ best_access_path(JOIN *join, loose_scan_opt.init(join, s, remaining_tables); if (s->table->is_splittable()) - spl_plan= s->choose_best_splitting(record_count, remaining_tables); + spl_plan= s->choose_best_splitting(idx, + remaining_tables, + &spl_pd_boundary); if (s->keyuse) { /* Use key if possible */ @@ -8243,8 +8248,9 @@ best_access_path(JOIN *join, best_filter= filter; /* range/index_merge/ALL/index access method are "independent", so: */ best_ref_depends_map= 0; - best_uses_jbuf= MY_TEST(!disable_jbuf && !((s->table->map & - join->outer_join))); + best_uses_jbuf= MY_TEST(!disable_jbuf && + (join->allowed_outer_join_with_cache || + !(s->table->map & join->outer_join))); spl_plan= 0; best_type= type; } @@ -8266,6 +8272,7 @@ best_access_path(JOIN *join, pos->loosescan_picker.loosescan_key= MAX_KEY; pos->use_join_buffer= best_uses_jbuf; pos->spl_plan= spl_plan; + pos->spl_pd_boundary= !spl_plan ? 0 : spl_pd_boundary; pos->range_rowid_filter_info= best_filter; loose_scan_opt.save_to_position(s, loose_scan_pos); @@ -8795,6 +8802,9 @@ optimize_straight_join(JOIN *join, table_map join_tables) pushdown_cond_selectivity= table_cond_selectivity(join, idx, s, join_tables); position->cond_selectivity= pushdown_cond_selectivity; + double partial_join_cardinality= record_count * + pushdown_cond_selectivity; + join->positions[idx].partial_join_cardinality= partial_join_cardinality; ++idx; } @@ -9833,6 +9843,8 @@ best_extension_by_limited_search(JOIN *join, double partial_join_cardinality= current_record_count * pushdown_cond_selectivity; + join->positions[idx].partial_join_cardinality= partial_join_cardinality; + if ( (search_depth > 1) && (remaining_tables & ~real_table_bit) & allowed_tables ) { /* Recursively expand the current partial plan */ swap_variables(JOIN_TAB*, join->best_ref[idx], *pos); @@ -12860,6 +12872,9 @@ uint check_join_cache_usage(JOIN_TAB *tab, join->return_tab= 0; + if (tab->no_forced_join_cache) + return 0; + /* Don't use join cache if @@join_cache_level==0 or this table is the first one join suborder (either at top level or inside a bush) @@ -13825,7 +13840,8 @@ bool JOIN_TAB::preread_init() DBUG_RETURN(TRUE); if (!(derived->get_unit()->uncacheable & UNCACHEABLE_DEPENDENT) || - derived->is_nonrecursive_derived_with_rec_ref()) + derived->is_nonrecursive_derived_with_rec_ref() || + is_split_derived) preread_init_done= TRUE; if (select && select->quick) select->quick->replace_handler(table->file); @@ -17276,6 +17292,9 @@ void optimize_wo_join_buffering(JOIN *join, uint first_tab, uint last_tab, reopt_remaining_tables & ~real_table_bit); } + double partial_join_cardinality= rec_count * + pushdown_cond_selectivity; + join->positions[i].partial_join_cardinality= partial_join_cardinality; (*outer_rec_count) *= pushdown_cond_selectivity; if (!rs->emb_sj_nest) *outer_rec_count= COST_MULT(*outer_rec_count, pos.records_read); @@ -20764,6 +20783,16 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records) { DBUG_ENTER("sub_select"); + if (join_tab->split_derived_to_update && !end_of_records) + { + table_map tab_map= join_tab->split_derived_to_update; + for (uint i= 0; tab_map; i++, tab_map>>= 1) + { + if (tab_map & 1) + join->map2table[i]->preread_init_done= false; + } + } + if (join_tab->last_inner) { JOIN_TAB *last_inner_tab= join_tab->last_inner; diff --git a/sql/sql_select.h b/sql/sql_select.h index 0dfecc98a48..f4b266292c9 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -394,6 +394,8 @@ typedef struct st_join_table { */ bool idx_cond_fact_out; bool use_join_cache; + /* TRUE <=> it is prohibited to join this table using join buffer */ + bool no_forced_join_cache; uint used_join_cache_level; ulong join_buffer_size_limit; JOIN_CACHE *cache; @@ -520,6 +522,16 @@ typedef struct st_join_table { bool preread_init_done; + /* true <=> split optimization has been applied to this materialized table */ + bool is_split_derived; + + /* + Bitmap of split materialized derived tables that can be filled just before + this join table is to be joined. All parameters of the split derived tables + belong to tables preceding this join table. + */ + table_map split_derived_to_update; + /* Cost info to the range filter used when joining this join table (Defined when the best join order has been already chosen) @@ -680,9 +692,10 @@ typedef struct st_join_table { void partial_cleanup(); void add_keyuses_for_splitting(); - SplM_plan_info *choose_best_splitting(double record_count, - table_map remaining_tables); - bool fix_splitting(SplM_plan_info *spl_plan, table_map remaining_tables, + SplM_plan_info *choose_best_splitting(uint idx, + table_map remaining_tables, + table_map *spl_pd_boundary); + bool fix_splitting(SplM_plan_info *spl_plan, table_map excluded_tables, bool is_const_table); } JOIN_TAB; @@ -947,9 +960,21 @@ public: */ KEYUSE *key; + /* Cardinality of current partial join ending with this position */ + double partial_join_cardinality; + /* Info on splitting plan used at this position */ SplM_plan_info *spl_plan; + /* + If spl_plan is NULL the value of spl_pd_boundary is 0. Otherwise + spl_pd_boundary contains the bitmap of the table from the current + partial join ending at this position that starts the sub-sequence of + tables S from which no conditions are allowed to be used in the plan + spl_plan for the split table joined at this position. + */ + table_map spl_pd_boundary; + /* Cost info for the range filter used at this position */ Range_rowid_filter_cost_info *range_rowid_filter_info; From ed3e6f66a265952afded33fb134f6f8bcc31aa89 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Wed, 3 May 2023 13:49:32 +0300 Subject: [PATCH 223/260] MDEV-26301: Split optimization refills: Optimizer Trace coverage Add Optimizer Trace printouts. --- mysql-test/main/opt_trace.result | 114 +++++++++++++++++++++++++++++++ mysql-test/main/opt_trace.test | 70 +++++++++++++++++++ sql/opt_split.cc | 72 +++++++++++++++---- sql/sql_select.cc | 2 +- 4 files changed, 245 insertions(+), 13 deletions(-) diff --git a/mysql-test/main/opt_trace.result b/mysql-test/main/opt_trace.result index a7a8fb88e6d..7856f9248ba 100644 --- a/mysql-test/main/opt_trace.result +++ b/mysql-test/main/opt_trace.result @@ -449,6 +449,11 @@ select * from v2 { } ] }, + { + "check_split_materialized": { + "not_applicable": "no candidate field can be accessed through ref" + } + }, { "best_join_order": ["t1"] }, @@ -772,6 +777,11 @@ explain select * from v1 { } ] }, + { + "check_split_materialized": { + "not_applicable": "group list has no candidates" + } + }, { "best_join_order": ["t1"] }, @@ -8861,5 +8871,109 @@ SET optimizer_trace=DEFAULT; DROP VIEW v; DROP TABLE t; # +# MDEV-26301: Split optimization improvements: Optimizer Trace coverage +# +create table t1(a int, b int); +insert into t1 select seq,seq from seq_1_to_5; +create table t2(a int, b int, key(a)); +insert into t2 +select A.seq,B.seq from seq_1_to_25 A, seq_1_to_2 B; +create table t3(a int, b int, key(a)); +insert into t3 +select A.seq,B.seq from seq_1_to_5 A, seq_1_to_3 B; +analyze table t1,t2,t3 persistent for all; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status Table is already up to date +test.t3 analyze status Engine-independent statistics collected +test.t3 analyze status Table is already up to date +create table t10 ( +grp_id int, +col1 int, +key(grp_id) +); +insert into t10 +select +A.seq, +B.seq +from +seq_1_to_100 A, +seq_1_to_100 B; +create table t11 ( +col1 int, +col2 int +); +insert into t11 +select A.seq, A.seq from seq_1_to_10 A; +analyze table t10,t11 persistent for all; +Table Op Msg_type Msg_text +test.t10 analyze status Engine-independent statistics collected +test.t10 analyze status Table is already up to date +test.t11 analyze status Engine-independent statistics collected +test.t11 analyze status OK +set optimizer_trace=1; +explain +select * from +( +(t1 left join t2 on t2.a=t1.b) +left join t3 on t3.a=t1.b +) left join (select grp_id, count(*) +from t10 left join t11 on t11.col1=t10.col1 +group by grp_id) T on T.grp_id=t1.b; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 5 +1 PRIMARY t2 ref a a 5 test.t1.b 2 Using where +1 PRIMARY t3 ref a a 5 test.t1.b 3 Using where +1 PRIMARY ref key0 key0 5 test.t1.b 10 Using where +2 LATERAL DERIVED t10 ref grp_id grp_id 5 test.t1.b 100 +2 LATERAL DERIVED t11 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join) +select json_detailed(json_extract(trace, '$**.check_split_materialized')) as JS +from information_schema.optimizer_trace; +JS +[ + { + "split_candidates": + ["t10.grp_id"] + } +] +select +json_detailed( +json_remove( +json_extract(trace, '$**.choose_best_splitting') +, '$[0].split_plan_search[0]' + ) +) as JS +from information_schema.optimizer_trace; +JS +[ + { + "considered_keys": + [ + { + "table_name": "t10", + "index": "grp_id", + "rec_per_key": 100, + "param_tables": 1 + } + ], + "refills": 5, + "spl_pd_boundary": 2, + "split_plan_search": + [], + "lead_table": "t10", + "index": "grp_id", + "parts": 1, + "split_sel": 0.001, + "cost": 2536, + "records": 100, + "refills": 5, + "chosen": true + } +] +drop table t1,t2,t3,t10,t11; +set optimizer_trace=DEFAULT; +# # End of 10.4 tests # diff --git a/mysql-test/main/opt_trace.test b/mysql-test/main/opt_trace.test index e0be5360069..2f1047df7c5 100644 --- a/mysql-test/main/opt_trace.test +++ b/mysql-test/main/opt_trace.test @@ -696,6 +696,76 @@ SET optimizer_trace=DEFAULT; DROP VIEW v; DROP TABLE t; +--echo # +--echo # MDEV-26301: Split optimization improvements: Optimizer Trace coverage +--echo # + +# 5 values +create table t1(a int, b int); +insert into t1 select seq,seq from seq_1_to_5; + +# 5 value groups of size 2 each +create table t2(a int, b int, key(a)); +insert into t2 +select A.seq,B.seq from seq_1_to_25 A, seq_1_to_2 B; + +# 5 value groups of size 3 each +create table t3(a int, b int, key(a)); +insert into t3 +select A.seq,B.seq from seq_1_to_5 A, seq_1_to_3 B; + +analyze table t1,t2,t3 persistent for all; + +create table t10 ( + grp_id int, + col1 int, + key(grp_id) +); + +# 100 groups of 100 values each +insert into t10 +select + A.seq, + B.seq +from + seq_1_to_100 A, + seq_1_to_100 B; + +# and X10 multiplier +create table t11 ( + col1 int, + col2 int +); +insert into t11 +select A.seq, A.seq from seq_1_to_10 A; + +analyze table t10,t11 persistent for all; + +set optimizer_trace=1; +explain +select * from + ( + (t1 left join t2 on t2.a=t1.b) + left join t3 on t3.a=t1.b + ) left join (select grp_id, count(*) + from t10 left join t11 on t11.col1=t10.col1 + group by grp_id) T on T.grp_id=t1.b; + +select json_detailed(json_extract(trace, '$**.check_split_materialized')) as JS +from information_schema.optimizer_trace; + +select + json_detailed( + json_remove( + json_extract(trace, '$**.choose_best_splitting') + , '$[0].split_plan_search[0]' + ) + ) as JS +from information_schema.optimizer_trace; + +drop table t1,t2,t3,t10,t11; +set optimizer_trace=DEFAULT; + --echo # --echo # End of 10.4 tests --echo # diff --git a/sql/opt_split.cc b/sql/opt_split.cc index 3a873e220b6..bb3aec9ee8d 100644 --- a/sql/opt_split.cc +++ b/sql/opt_split.cc @@ -228,6 +228,7 @@ #include "mariadb.h" #include "sql_select.h" +#include "opt_trace.h" /* Info on a splitting field */ struct SplM_field_info @@ -387,6 +388,9 @@ bool JOIN::check_for_splittable_materialized() if (!partition_list) return false; + Json_writer_object trace_wrapper(thd); + Json_writer_object trace_split(thd, "check_split_materialized"); + ORDER *ord; Dynamic_array candidates; @@ -432,7 +436,10 @@ bool JOIN::check_for_splittable_materialized() } } if (candidates.elements() == 0) // no candidates satisfying (8.1) && (8.2) + { + trace_split.add("not_applicable", "group list has no candidates"); return false; + } /* For each table from this join find the keys that can be used for ref access @@ -491,7 +498,11 @@ bool JOIN::check_for_splittable_materialized() } if (!spl_field_cnt) // No candidate field can be accessed by ref => !(9) + { + trace_split.add("not_applicable", + "no candidate field can be accessed through ref"); return false; + } /* Create a structure of the type SplM_opt_info and fill it with @@ -509,16 +520,22 @@ bool JOIN::check_for_splittable_materialized() spl_opt_info->tables_usable_for_splitting= 0; spl_opt_info->spl_field_cnt= spl_field_cnt; spl_opt_info->spl_fields= spl_field; - for (cand= cand_start; cand < cand_end; cand++) + { - if (!cand->is_usable_for_ref_access) - continue; - spl_field->producing_item= cand->producing_item; - spl_field->underlying_field= cand->underlying_field; - spl_field->mat_field= cand->mat_field; - spl_opt_info->tables_usable_for_splitting|= - cand->underlying_field->table->map; - spl_field++; + Json_writer_array trace_range(thd, "split_candidates"); + for (cand= cand_start; cand < cand_end; cand++) + { + if (!cand->is_usable_for_ref_access) + continue; + trace_range.add(cand->producing_item); + + spl_field->producing_item= cand->producing_item; + spl_field->underlying_field= cand->underlying_field; + spl_field->mat_field= cand->mat_field; + spl_opt_info->tables_usable_for_splitting|= + cand->underlying_field->table->map; + spl_field++; + } } /* Attach this info to the table T */ @@ -773,7 +790,7 @@ void JOIN::add_keyuses_for_splitting() bzero((char*) &keyuse_ext_end, sizeof(keyuse_ext_end)); if (ext_keyuses_for_splitting->push(keyuse_ext_end)) goto err; - + // psergey-todo: trace anything here? spl_opt_info->unsplit_card= join_record_count; rec_len= table->s->rec_buff_length; @@ -946,7 +963,8 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(uint idx, uint best_key= 0; uint best_key_parts= 0; table_map best_param_tables; - + Json_writer_object trace_obj(thd, "choose_best_splitting"); + Json_writer_array trace_arr(thd, "considered_keys"); /* Check whether there are keys that can be used to join T employing splitting and if so, select the best out of such keys @@ -999,6 +1017,13 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(uint idx, best_rec_per_key= rec_per_key; best_key_keyuse_ext_start= key_keyuse_ext_start; best_param_tables= needed_in_prefix; + // trace table, key_name, parts, needed_tables. + Json_writer_object cur_index(thd); + cur_index. + add("table_name", best_table->alias.ptr()). + add("index", best_table->key_info[best_key].name). + add("rec_per_key", best_rec_per_key). + add("param_tables", best_param_tables); } keyuse_ext++; } @@ -1006,6 +1031,8 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(uint idx, } while (keyuse_ext->table == table); } + trace_arr.end(); + spl_opt_info->last_plan= 0; double refills= DBL_MAX; table_map excluded_tables= remaining_tables | this->join->sjm_lookup_tables; @@ -1031,6 +1058,10 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(uint idx, break; } } + + trace_obj.add("refills", refills). + add("spl_pd_boundary", *spl_pd_boundary); + /* The key for splitting was chosen, look for the plan for this key in the cache @@ -1042,11 +1073,13 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(uint idx, The plan for the chosen key has not been found in the cache. Build a new plan and save info on it in the cache */ + Json_writer_array wrapper(thd, "split_plan_search"); table_map all_table_map= (((table_map) 1) << join->table_count) - 1; reset_validity_vars_for_keyuses(best_key_keyuse_ext_start, best_table, best_key, excluded_tables, true); choose_plan(join, all_table_map & ~join->const_table_map); + wrapper.end(); /* Check that the chosen plan is really a splitting plan. If not or if there is not enough memory to save the plan in the cache @@ -1064,6 +1097,7 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(uint idx, { reset_validity_vars_for_keyuses(best_key_keyuse_ext_start, best_table, best_key, excluded_tables, false); + trace_obj.add("split_plan_discarded", "constructed unapplicable query plan"); return 0; } @@ -1089,9 +1123,20 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(uint idx, reset_validity_vars_for_keyuses(best_key_keyuse_ext_start, best_table, best_key, excluded_tables, false); } + else + trace_obj.add("cached_plan_found", 1); if (spl_plan) { + trace_obj. + add("lead_table", spl_plan->table->alias.ptr()). + add("index", spl_plan->table->key_info[spl_plan->key].name). + add("parts", spl_plan->parts). + add("split_sel", spl_plan->split_sel). + add("cost", spl_plan->cost). + add("records", (ha_rows) (records * spl_plan->split_sel)). + add("refills", refills); + if (refills * spl_plan->cost < spl_opt_info->unsplit_cost) { /* @@ -1100,7 +1145,10 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(uint idx, */ spl_opt_info->last_plan= spl_plan; spl_opt_info->last_refills= refills; + trace_obj.add("chosen", true); } + else + trace_obj.add("chosen", false); } } @@ -1132,7 +1180,7 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(uint idx, @details This function injects equalities pushed into a derived table T for which the split optimization has been chosen by the optimizer. The function - is called by JOIN::inject_splitting_cond_for_all_tables_with_split_op(). + is called by JOIN::inject_splitting_cond_for_all_tables_with_split_opt(). All equalities usable for splitting T whose right parts do not depend on any of the 'excluded_tables' can be pushed into the where clause of the derived table T. diff --git a/sql/sql_select.cc b/sql/sql_select.cc index bc5fd2be8b5..5e2ce06add7 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7444,7 +7444,6 @@ best_access_path(JOIN *join, DBUG_ENTER("best_access_path"); Json_writer_object trace_wrapper(thd, "best_access_path"); - Json_writer_array trace_paths(thd, "considered_access_paths"); bitmap_clear_all(eq_join_set); @@ -7455,6 +7454,7 @@ best_access_path(JOIN *join, remaining_tables, &spl_pd_boundary); + Json_writer_array trace_paths(thd, "considered_access_paths"); if (s->keyuse) { /* Use key if possible */ KEYUSE *keyuse; From 3bdc5542dc10693ec7a28add487747f43f580553 Mon Sep 17 00:00:00 2001 From: Monty Date: Mon, 13 Mar 2023 02:40:24 +0200 Subject: [PATCH 224/260] MDEV-30812: Improve output cardinality estimates for hash join Introduces @@optimizer_switch flag: hash_join_cardinality When this option is on, use EITS statistics to produce tighter bounds for hash join output cardinality. This patch is an extension / replacement to a similar patch in 10.6 New features: - optimizer_switch hash_join_cardinality is on by default - records_out is set to fanout when HASH is used - Fixed bug in is_eits_usable: The function did not work with views --- mysql-test/main/analyze_format_json.result | 2 +- .../main/analyze_format_json_timings.result | 4 +- mysql-test/main/join_cache.result | 24 +- mysql-test/main/join_cache_cardinality.result | 105 +++++++++ mysql-test/main/join_cache_cardinality.test | 40 ++++ mysql-test/main/join_nested_jcl6.result | 68 +++--- mysql-test/main/join_outer_jcl6.result | 22 +- mysql-test/main/mysqld--help.result | 5 +- .../main/mysqltest_tracking_info.result | 2 +- mysql-test/main/subselect3_jcl6.result | 8 +- mysql-test/main/subselect_sj2.result | 2 +- mysql-test/main/subselect_sj2.test | 3 +- mysql-test/main/subselect_sj2_jcl6.result | 23 +- mysql-test/main/subselect_sj2_mat.result | 22 +- mysql-test/main/subselect_sj_jcl6.result | 4 +- .../sys_vars/r/optimizer_switch_basic.result | 32 +-- .../sys_vars/r/sysvars_server_embedded.result | 2 +- .../r/sysvars_server_notembedded.result | 2 +- .../suite/sysschema/r/optimizer_switch.result | 1 + sql/sql_priv.h | 63 ++--- sql/sql_select.cc | 219 ++++++++++++++++-- sql/sql_statistics.cc | 6 +- sql/sys_vars.cc | 1 + 23 files changed, 493 insertions(+), 167 deletions(-) create mode 100644 mysql-test/main/join_cache_cardinality.result create mode 100644 mysql-test/main/join_cache_cardinality.test diff --git a/mysql-test/main/analyze_format_json.result b/mysql-test/main/analyze_format_json.result index efe6c03f2ec..0e1ea88404b 100644 --- a/mysql-test/main/analyze_format_json.result +++ b/mysql-test/main/analyze_format_json.result @@ -1236,7 +1236,7 @@ ANALYZE "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", - "filtered": 70, + "filtered": 0.209580004, "r_filtered": 70, "attached_condition": "t10.a < 700" }, diff --git a/mysql-test/main/analyze_format_json_timings.result b/mysql-test/main/analyze_format_json_timings.result index af801095b81..4686359186e 100644 --- a/mysql-test/main/analyze_format_json_timings.result +++ b/mysql-test/main/analyze_format_json_timings.result @@ -78,7 +78,7 @@ X "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", - "filtered": 100, + "filtered": 10, "r_filtered": 20, "attached_condition": "t2.a < 100" }, @@ -174,7 +174,7 @@ X "cost": "REPLACED", "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", - "filtered": 100, + "filtered": 10, "r_filtered": 100 }, "buffer_type": "flat", diff --git a/mysql-test/main/join_cache.result b/mysql-test/main/join_cache.result index c02ac192dde..d6a530a9f77 100644 --- a/mysql-test/main/join_cache.result +++ b/mysql-test/main/join_cache.result @@ -5977,10 +5977,9 @@ LEFT JOIN t5 ON t4.e1 = t5.e1 LEFT JOIN (SELECT e1 FROM t2 ) AS d ON t4.e1 = d.e1) a); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 128 Using where -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t4 ALL NULL NULL NULL NULL 128 -2 MATERIALIZED t5 hash_ALL NULL #hash#$hj 5 test.t4.e1 128 Using where; Using join buffer (flat, BNLH join) -2 MATERIALIZED t2 hash_ALL NULL #hash#$hj 5 test.t4.e1 128 Using where; Using join buffer (incremental, BNLH join) +1 PRIMARY t4 hash_ALL NULL #hash#$hj 5 test.t1.i1 128 Using where; Start temporary; Using join buffer (flat, BNLH join) +1 PRIMARY t5 hash_ALL NULL #hash#$hj 5 test.t4.e1 128 Using where; Using join buffer (incremental, BNLH join) +1 PRIMARY t2 hash_ALL NULL #hash#$hj 5 test.t4.e1 128 Using where; End temporary; Using join buffer (incremental, BNLH join) SELECT * FROM t1 WHERE i1 < 10 AND @@ -6035,12 +6034,11 @@ f1 f2 EXPLAIN EXTENDED SELECT * FROM temp WHERE (f1,f2) IN (SELECT t1.i1, t1.v1 FROM (t2 JOIN t1 ON (t1.v1 = t2.v1))); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY temp ALL NULL NULL NULL NULL 7 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 8 func,func 1 100.00 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 1 100.00 Using where -2 MATERIALIZED t2 hash_index v1 #hash#v1:v1 4:9 test.t1.v1 10 33.33 Using index; Using join buffer (flat, BNLH join) +1 PRIMARY t1 ALL NULL NULL NULL NULL 1 100.00 Using where; Start temporary +1 PRIMARY temp hash_ALL NULL #hash#$hj 9 test.t1.i1,test.t1.v1 7 10.00 Using where; Using join buffer (flat, BNLH join) +1 PRIMARY t2 hash_index v1 #hash#v1:v1 4:9 test.t1.v1 10 10.00 Using index; End temporary; Using join buffer (incremental, BNLH join) Warnings: -Note 1003 select `test`.`temp`.`f1` AS `f1`,`test`.`temp`.`f2` AS `f2` from `test`.`temp` semi join (`test`.`t2` join `test`.`t1`) where `test`.`t2`.`v1` = `test`.`t1`.`v1` +Note 1003 select `test`.`temp`.`f1` AS `f1`,`test`.`temp`.`f2` AS `f2` from `test`.`temp` semi join (`test`.`t2` join `test`.`t1`) where `test`.`temp`.`f1` = `test`.`t1`.`i1` and `test`.`temp`.`f2` = `test`.`t1`.`v1` and `test`.`t2`.`v1` = `test`.`t1`.`v1` DROP TABLE t1,t2,temp; set join_cache_level=@save_join_cache_level; # @@ -6163,9 +6161,9 @@ b c d e EXPLAIN SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t4 index PRIMARY PRIMARY 4 NULL 2 Using where; Using index; Using join buffer (flat, BNL join) +1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t4.e 2 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t3 hash_index d #hash#d:d 5:5 test.t2.c 2 Using where; Using index; Using join buffer (incremental, BNLH join) -1 SIMPLE t4 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.b 2 Using index; Using join buffer (incremental, BNLH join) SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e; a b c d e 1 1 2 2 1 @@ -6176,9 +6174,9 @@ EXPLAIN SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b WHERE e IS NULL; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t4 index PRIMARY PRIMARY 4 NULL 2 Using where; Using index; Not exists; Using join buffer (flat, BNL join) +1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t4.e 2 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t3 hash_index d #hash#d:d 5:5 test.t2.c 2 Using where; Using index; Using join buffer (incremental, BNLH join) -1 SIMPLE t4 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.b 2 Using where; Using index; Not exists; Using join buffer (incremental, BNLH join) SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e WHERE e IS NULL; a b c d e diff --git a/mysql-test/main/join_cache_cardinality.result b/mysql-test/main/join_cache_cardinality.result new file mode 100644 index 00000000000..de6b99f4b3a --- /dev/null +++ b/mysql-test/main/join_cache_cardinality.result @@ -0,0 +1,105 @@ +create table t1 (a int, b int, c int); +insert into t1 select seq,seq/2, seq/4 from seq_1_to_100; +create table t2 (a int, b int, c int); +insert into t2 select seq, seq/2, seq/4 from seq_1_to_200; +analyze table t1,t2 persistent for all; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status OK +set optimizer_trace=1; +set join_cache_level=6; +set optimizer_switch='hash_join_cardinality=on'; +explain select * +from t1, t2 +where t1.a=t2.a and t1.a=t2.b and t1.c=t2.c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where +1 SIMPLE t2 hash_ALL NULL #hash#$hj 15 test.t1.a,test.t1.a,test.t1.c 200 Using where; Using join buffer (flat, BNLH join) +set @json= (select trace from information_schema.optimizer_trace); +select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS; +JS +[ + { + "hash_join_columns": + [ + { + "field": "a", + "avg_frequency": 1 + }, + { + "field": "b", + "avg_frequency": 2 + }, + { + "field": "c", + "avg_frequency": 3.9216 + } + ], + "rows": 1 + } +] +select json_detailed(json_extract(@json, '$**.rest_of_plan[*].rows_for_plan')) +as ROWS_FOR_PLAN; +ROWS_FOR_PLAN +[100] +explain select * +from t1, t2 where t1.c=t2.c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where +1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.c 200 Using where; Using join buffer (flat, BNLH join) +set @json= (select trace from information_schema.optimizer_trace); +select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS; +JS +[ + { + "hash_join_columns": + [ + { + "field": "c", + "avg_frequency": 3.9216 + } + ], + "rows": 3.9216 + } +] +select json_detailed(json_extract(@json, '$**.rest_of_plan[*].rows_for_plan')) +as ROWS_FOR_PLAN; +ROWS_FOR_PLAN +[392.16] +explain select * +from t1 straight_join t2 where t1.c=t2.c and t2.a<30; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where +1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.c 200 Using where; Using join buffer (flat, BNLH join) +set @json= (select trace from information_schema.optimizer_trace); +# Note that rows is the same: +select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS; +JS +[ + { + "hash_join_columns": + [ + { + "field": "c", + "avg_frequency": 3.9216 + } + ], + "rows": 0.568632 + } +] +# Despite available selectivity: +select json_detailed(json_extract(@json, '$**.selectivity_for_columns')) as JS; +JS +[ + [ + { + "column_name": "a", + "ranges": + ["NULL < a < 30"], + "selectivity_from_histogram": 0.145 + } + ] +] +drop table t1,t2; diff --git a/mysql-test/main/join_cache_cardinality.test b/mysql-test/main/join_cache_cardinality.test new file mode 100644 index 00000000000..9036f1fecd2 --- /dev/null +++ b/mysql-test/main/join_cache_cardinality.test @@ -0,0 +1,40 @@ +# Disabled embedded as it does not support optimizer_trace +--source include/not_embedded.inc +--source include/have_sequence.inc + +create table t1 (a int, b int, c int); +insert into t1 select seq,seq/2, seq/4 from seq_1_to_100; + +create table t2 (a int, b int, c int); +insert into t2 select seq, seq/2, seq/4 from seq_1_to_200; + +analyze table t1,t2 persistent for all; + +set optimizer_trace=1; +set join_cache_level=6; +set optimizer_switch='hash_join_cardinality=on'; +explain select * +from t1, t2 +where t1.a=t2.a and t1.a=t2.b and t1.c=t2.c; + +set @json= (select trace from information_schema.optimizer_trace); +select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS; +select json_detailed(json_extract(@json, '$**.rest_of_plan[*].rows_for_plan')) +as ROWS_FOR_PLAN; + +explain select * +from t1, t2 where t1.c=t2.c; +set @json= (select trace from information_schema.optimizer_trace); +select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS; +select json_detailed(json_extract(@json, '$**.rest_of_plan[*].rows_for_plan')) +as ROWS_FOR_PLAN; + +explain select * +from t1 straight_join t2 where t1.c=t2.c and t2.a<30; +set @json= (select trace from information_schema.optimizer_trace); +--echo # Note that rows is the same: +select json_detailed(json_extract(@json, '$**.hash_join_cardinality')) as JS; + +--echo # Despite available selectivity: +select json_detailed(json_extract(@json, '$**.selectivity_for_columns')) as JS; +drop table t1,t2; diff --git a/mysql-test/main/join_nested_jcl6.result b/mysql-test/main/join_nested_jcl6.result index d5c46d48e68..3c292484c9e 100644 --- a/mysql-test/main/join_nested_jcl6.result +++ b/mysql-test/main/join_nested_jcl6.result @@ -61,8 +61,8 @@ LEFT JOIN ON t2.b=t4.b; a b a b a b 4 2 1 2 3 2 -4 2 2 2 3 2 4 2 1 2 4 2 +4 2 2 2 3 2 4 2 2 2 4 2 3 3 NULL NULL NULL NULL 5 3 NULL NULL NULL NULL @@ -85,8 +85,8 @@ ON t2.b=t4.b WHERE t3.a=1 OR t3.c IS NULL; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) -1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join) Warnings: Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) where `test`.`t3`.`a` = 1 or `test`.`t3`.`c` is null SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b @@ -139,16 +139,16 @@ LEFT JOIN ON t2.b=t4.b; a b a b a b a b 4 2 1 2 3 2 3 1 -4 2 2 2 3 2 3 1 4 2 1 2 4 2 3 1 +4 2 2 2 3 2 3 1 4 2 2 2 4 2 3 1 4 2 1 2 3 2 2 2 -4 2 2 2 3 2 2 2 4 2 1 2 4 2 2 2 +4 2 2 2 3 2 2 2 4 2 2 2 4 2 2 2 4 2 1 2 3 2 3 3 -4 2 2 2 3 2 3 3 4 2 1 2 4 2 3 3 +4 2 2 2 3 2 3 3 4 2 2 2 4 2 3 3 3 3 NULL NULL NULL NULL NULL NULL 5 3 NULL NULL NULL NULL NULL NULL @@ -161,8 +161,8 @@ ON t2.b=t4.b WHERE t3.a>1 OR t3.c IS NULL; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) -1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join) Warnings: Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4` join `test`.`t5`) on(`test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) where `test`.`t3`.`a` > 1 or `test`.`t3`.`c` is null @@ -191,8 +191,8 @@ WHERE (t3.a>1 OR t3.c IS NULL) AND (t5.a<3 OR t5.c IS NULL); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) -1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) Warnings: Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4` join `test`.`t5`) on(`test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) where (`test`.`t3`.`a` > 1 or `test`.`t3`.`c` is null) and (`test`.`t5`.`a` < 3 or `test`.`t5`.`c` is null) @@ -242,7 +242,7 @@ ON t7.b=t8.b AND t6.b < 10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) -1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t7.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t7.b 2 10.00 Using where; Using join buffer (incremental, BNLH join) Warnings: Note 1003 select `test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t7`.`b` and `test`.`t6`.`b` < 10 and `test`.`t7`.`b` is not null) where 1 SELECT t6.a,t6.b,t7.a,t7.b,t8.a,t8.b @@ -556,14 +556,14 @@ t0.b=t1.b AND (t2.a >= 4 OR t2.c IS NULL); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where -1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 100.00 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 10.00 Using where; Using join buffer (flat, BNLH join) 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) +1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join) -1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join) Warnings: Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b, @@ -651,17 +651,17 @@ t0.b=t1.b AND (t9.a=1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where -1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 100.00 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 10.00 Using where; Using join buffer (flat, BNLH join) 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) +1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t9`.`b` = `test`.`t8`.`b` or `test`.`t8`.`c` is null) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t3`.`b` = `test`.`t4`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t9`.`b` = `test`.`t8`.`b` or `test`.`t8`.`c` is null) SELECT t9.a,t9.b FROM t9; a b @@ -849,8 +849,8 @@ WHERE t1.a <= 2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) +1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) Warnings: Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t1` join `test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) where `test`.`t1`.`a` <= 2 INSERT INTO t2 VALUES (-1,9,0), (-3,10,0), (-2,8,0), (-4,11,0), (-5,15,0); @@ -919,17 +919,17 @@ t0.b=t1.b AND (t9.a=1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where -1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 100.00 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 10.00 Using where; Using join buffer (flat, BNLH join) 1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where; Using join buffer (incremental, BNL join) +1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t9`.`b` = `test`.`t8`.`b` or `test`.`t8`.`c` is null) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t3`.`b` = `test`.`t4`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t9`.`b` = `test`.`t8`.`b` or `test`.`t8`.`c` is null) INSERT INTO t4 VALUES (-3,12,0), (-4,13,0), (-1,11,0), (-3,11,0), (-5,15,0); INSERT INTO t5 VALUES (-3,11,0), (-2,12,0), (-3,13,0), (-4,12,0); CREATE INDEX idx_b ON t4(b); @@ -971,12 +971,12 @@ t0.b=t1.b AND (t9.a=1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where -1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 100.00 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 10.00 Using where; Using join buffer (flat, BNLH join) 1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t5 ALL idx_b NULL NULL NULL 7 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 1 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join) @@ -1021,10 +1021,10 @@ t0.b=t1.b AND (t9.a=1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where -1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 100.00 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 10.00 Using where; Using join buffer (flat, BNLH join) 1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t5 ALL idx_b NULL NULL NULL 7 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 1 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan 1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where; Using join buffer (incremental, BNL join) @@ -1075,7 +1075,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ref idx_b idx_b 5 test.t0.b 1 100.00 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan 1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t5 ALL idx_b NULL NULL NULL 7 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 1 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan 1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where; Using join buffer (incremental, BNL join) @@ -1848,8 +1848,8 @@ ON t1.a=t2.a WHERE t3.a IS NULL; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 -1 SIMPLE t2 hash_ALL NULL #hash#$hj 4 test.t1.a 1 100.00 Using where; Using join buffer (flat, BNLH join) -1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 test.t1.a 1 100.00 Using where; Not exists; Using join buffer (incremental, BNLH join) +1 SIMPLE t2 hash_ALL NULL #hash#$hj 4 test.t1.a 1 10.00 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 test.t1.a 1 10.00 Using where; Not exists; Using join buffer (incremental, BNLH join) 1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t3.a 0 0.00 Using where; Using join buffer (incremental, BNLH join) Warnings: Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`b` AS `b` from `test`.`t1` left join (`test`.`t2` left join `test`.`t3` on(`test`.`t3`.`b` = `test`.`t1`.`a`) left join `test`.`t4` on(`test`.`t4`.`b` = `test`.`t3`.`a` and `test`.`t3`.`a` is not null)) on(`test`.`t2`.`a` = `test`.`t1`.`a`) where `test`.`t3`.`a` is null diff --git a/mysql-test/main/join_outer_jcl6.result b/mysql-test/main/join_outer_jcl6.result index ff5e76b78ad..a34bf96a0ef 100644 --- a/mysql-test/main/join_outer_jcl6.result +++ b/mysql-test/main/join_outer_jcl6.result @@ -2230,8 +2230,8 @@ SELECT * FROM t1 LEFT JOIN t2 LEFT JOIN t3 ON i2 = i3 ON i1 = i3 WHERE d3 IS NULL; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 -1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.i1 2 100.00 Using where; Using join buffer (flat, BNLH join) -1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 test.t1.i1 2 100.00 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.i1 2 10.00 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 test.t1.i1 2 10.00 Using where; Using join buffer (incremental, BNLH join) Warnings: Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t2`.`i2` AS `i2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`d3` AS `d3` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`i2` = `test`.`t1`.`i1` and `test`.`t3`.`i3` = `test`.`t1`.`i1` and `test`.`t1`.`i1` is not null and `test`.`t1`.`i1` is not null) where `test`.`t3`.`d3` = 0 or `test`.`t3`.`d3` is null DROP TABLE t1,t2,t3; @@ -2251,7 +2251,7 @@ WHERE b IN (1,2,3) OR b = d; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where -1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 const 2 100.00 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 const 2 10.00 Using where; Using join buffer (flat, BNLH join) Warnings: Note 1003 select 10 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t2` left join `test`.`t3` on(`test`.`t3`.`d` = 10 and 10 is not null) where `test`.`t2`.`c` = 8 and `test`.`t3`.`d` = 8 SELECT * FROM t1 INNER JOIN t2 ON c = b LEFT JOIN t3 ON d = a @@ -2368,7 +2368,7 @@ ON t1.x = t2.x WHERE IFNULL(t2.x,0)=0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 -1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.x 2 100.00 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.x 2 10.00 Using where; Using join buffer (flat, BNLH join) Warnings: Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t2`.`x` AS `x`,ifnull(`test`.`t2`.`x`,0) AS `IFNULL(t2.x,0)`,`f`(`test`.`t2`.`x`,0) AS `f(t2.x,0)` from `test`.`t` `t1` left join `test`.`t` `t2` on(`test`.`t2`.`x` = `test`.`t1`.`x` and `test`.`t1`.`x` is not null) where ifnull(`test`.`t2`.`x`,0) = 0 SELECT t1.x, t2.x, IFNULL(t2.x,0), f(t2.x,0) @@ -2384,7 +2384,7 @@ ON t1.x = t2.x WHERE f(t2.x,0)=0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 -1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.x 2 100.00 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.x 2 10.00 Using where; Using join buffer (flat, BNLH join) Warnings: Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t2`.`x` AS `x`,ifnull(`test`.`t2`.`x`,0) AS `IFNULL(t2.x,0)`,`f`(`test`.`t2`.`x`,0) AS `f(t2.x,0)` from `test`.`t` `t1` left join `test`.`t` `t2` on(`test`.`t2`.`x` = `test`.`t1`.`x` and `test`.`t1`.`x` is not null) where `f`(`test`.`t2`.`x`,0) = 0 drop function f; @@ -2424,7 +2424,7 @@ FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2 WHERE IFNULL(t2.col3,0) = 0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 -1 SIMPLE t2 hash_ALL NULL #hash#$hj 17 test.t1.col1 2 100.00 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t2 hash_ALL NULL #hash#$hj 17 test.t1.col1 2 10.00 Using where; Using join buffer (flat, BNLH join) Warnings: Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`col2` = `test`.`t1`.`col1` and `test`.`t1`.`col1` is not null) where ifnull(`test`.`t2`.`col3`,0) = 0 SELECT t1.col1, t2.col1, t2.col3 @@ -2438,7 +2438,7 @@ FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2 WHERE f1(t2.col3,0) = 0; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 -1 SIMPLE t2 hash_ALL NULL #hash#$hj 17 test.t1.col1 2 100.00 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t2 hash_ALL NULL #hash#$hj 17 test.t1.col1 2 10.00 Using where; Using join buffer (flat, BNLH join) Warnings: Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`col2` = `test`.`t1`.`col1` and `test`.`t1`.`col1` is not null) where `f1`(`test`.`t2`.`col3`,0) = 0 DROP FUNCTION f1; @@ -2542,7 +2542,7 @@ a b explain extended select * from t1 left join t2 on a=b where (b > 3) is not true; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.a 3 100.00 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.a 3 10.00 Using where; Using join buffer (flat, BNLH join) Warnings: Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` is not null) where `test`.`t2`.`b` > 3 is not true select * from t1 left join t2 on a=b where (b > 3) is not false; @@ -2552,7 +2552,7 @@ a b explain extended select * from t1 left join t2 on a=b where (b > 3) is not false; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 -1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.a 3 100.00 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.a 3 10.00 Using where; Using join buffer (flat, BNLH join) Warnings: Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` is not null) where `test`.`t2`.`b` > 3 is not false drop table t1,t2; @@ -2783,8 +2783,8 @@ id select_type table type possible_keys key key_len ref rows Extra explain select * from t1 left join (t3 join t2) on t1.a=t3.b and t3.a<5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -1 SIMPLE t3 hash_range a #hash#$hj:a 5:5 test.t1.a 5 Using where; Rowid-ordered scan; Using join buffer (incremental, BNLH join) +1 SIMPLE t3 hash_range a #hash#$hj:a 5:5 test.t1.a 5 Using where; Rowid-ordered scan; Using join buffer (flat, BNLH join) +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using join buffer (incremental, BNL join) # # .. part 2: make sure condition selectivity can use the condition too. # diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result index 69cd7b5cb35..dbb4fbc262d 100644 --- a/mysql-test/main/mysqld--help.result +++ b/mysql-test/main/mysqld--help.result @@ -799,7 +799,8 @@ The following specify which files/extra groups are read (specified before remain extended_keys, exists_to_in, orderby_uses_equalities, condition_pushdown_for_derived, split_materialized, condition_pushdown_for_subquery, rowid_filter, - condition_pushdown_from_having, not_null_range_scan + condition_pushdown_from_having, not_null_range_scan, + hash_join_cardinality --optimizer-trace=name Controls tracing of the Optimizer: optimizer_trace=option=val[,option=val...], where option @@ -1758,7 +1759,7 @@ optimizer-rowid-copy-cost 0.002653 optimizer-scan-setup-cost 10 optimizer-search-depth 62 optimizer-selectivity-sampling-limit 100 -optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on +optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on optimizer-trace optimizer-trace-max-mem-size 1048576 optimizer-use-condition-selectivity 4 diff --git a/mysql-test/main/mysqltest_tracking_info.result b/mysql-test/main/mysqltest_tracking_info.result index 61bb3f2d1e2..c4fedd6b59c 100644 --- a/mysql-test/main/mysqltest_tracking_info.result +++ b/mysql-test/main/mysqltest_tracking_info.result @@ -38,7 +38,7 @@ SET @@session.session_track_system_variables='optimizer_switch'; set optimizer_switch='index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off'; -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES -- optimizer_switch --- index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off +-- index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on Warnings: Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release diff --git a/mysql-test/main/subselect3_jcl6.result b/mysql-test/main/subselect3_jcl6.result index acd1269d875..ca06d25db49 100644 --- a/mysql-test/main/subselect3_jcl6.result +++ b/mysql-test/main/subselect3_jcl6.result @@ -1170,11 +1170,11 @@ set @@optimizer_switch='firstmatch=off,materialization=off'; set @@max_heap_table_size= 16384; explain select count(*) from t0 A, t0 B, t0 C, t0 D where D.a in (select a from t1 E where a+1 < 10000 + A.a + B.a +C.a+D.a); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY E ALL NULL NULL NULL NULL 5 Using where; Start temporary -1 PRIMARY A ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join) +1 PRIMARY A ALL NULL NULL NULL NULL 10 +1 PRIMARY E ALL NULL NULL NULL NULL 5 Using where; Start temporary; Using join buffer (flat, BNL join) +1 PRIMARY D hash_ALL NULL #hash#$hj 5 test.E.a 10 Using where; Using join buffer (incremental, BNLH join) 1 PRIMARY B ALL NULL NULL NULL NULL 10 Using join buffer (incremental, BNL join) -1 PRIMARY C ALL NULL NULL NULL NULL 10 Using where; Using join buffer (incremental, BNL join) -1 PRIMARY D hash_ALL NULL #hash#$hj 5 test.E.a 10 Using where; End temporary; Using join buffer (incremental, BNLH join) +1 PRIMARY C ALL NULL NULL NULL NULL 10 Using where; End temporary; Using join buffer (incremental, BNL join) flush status; select count(*) from t0 A, t0 B, t0 C, t0 D where D.a in (select a from t1 E where a+1 < 10000 + A.a + B.a +C.a+D.a); count(*) diff --git a/mysql-test/main/subselect_sj2.result b/mysql-test/main/subselect_sj2.result index fa10a4aa066..e2e44fd8e80 100644 --- a/mysql-test/main/subselect_sj2.result +++ b/mysql-test/main/subselect_sj2.result @@ -152,7 +152,7 @@ insert into t1 values (2, 'duplicate ok', 'duplicate ok'); insert into t1 values (18, 'duplicate ok', 'duplicate ok'); insert into t2 values (3, 'duplicate ok', 'duplicate ok'); insert into t2 values (19, 'duplicate ok', 'duplicate ok'); -explain select +explain select a, mid(filler1, 1,10), length(filler1)=length(filler2) as Z from t1 ot where a in (select a from t2 it); id select_type table type possible_keys key key_len ref rows Extra diff --git a/mysql-test/main/subselect_sj2.test b/mysql-test/main/subselect_sj2.test index 4ccdcc50a38..67c70d449d7 100644 --- a/mysql-test/main/subselect_sj2.test +++ b/mysql-test/main/subselect_sj2.test @@ -124,7 +124,7 @@ insert into t1 values (18, 'duplicate ok', 'duplicate ok'); insert into t2 values (3, 'duplicate ok', 'duplicate ok'); insert into t2 values (19, 'duplicate ok', 'duplicate ok'); -explain select +explain select a, mid(filler1, 1,10), length(filler1)=length(filler2) as Z from t1 ot where a in (select a from t2 it); select @@ -1248,6 +1248,7 @@ INSERT INTO t2 VALUES analyze table t1 persistent for all; analyze table t2 persistent for all; --replace_column 9 # + EXPLAIN SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3 WHERE alias3.d IN ( diff --git a/mysql-test/main/subselect_sj2_jcl6.result b/mysql-test/main/subselect_sj2_jcl6.result index 6ccec99ba5e..a5bcfbfa147 100644 --- a/mysql-test/main/subselect_sj2_jcl6.result +++ b/mysql-test/main/subselect_sj2_jcl6.result @@ -161,7 +161,7 @@ insert into t1 values (2, 'duplicate ok', 'duplicate ok'); insert into t1 values (18, 'duplicate ok', 'duplicate ok'); insert into t2 values (3, 'duplicate ok', 'duplicate ok'); insert into t2 values (19, 'duplicate ok', 'duplicate ok'); -explain select +explain select a, mid(filler1, 1,10), length(filler1)=length(filler2) as Z from t1 ot where a in (select a from t2 it); id select_type table type possible_keys key key_len ref rows Extra @@ -912,11 +912,10 @@ EXPLAIN SELECT * FROM t3 LEFT JOIN (v1,t2) ON t3.a = t2.a WHERE t3.b IN (SELECT b FROM t4); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ALL NULL NULL NULL NULL 1 +1 PRIMARY t3 ALL NULL NULL NULL NULL 1 Using where 1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t3.a 1 Using where; Using join buffer (flat, BNLH join) 1 PRIMARY ALL NULL NULL NULL NULL 2 Using join buffer (incremental, BNL join) -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t4 ALL NULL NULL NULL NULL 2 +1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t3.b 2 Using where; Start temporary; End temporary; Using join buffer (incremental, BNLH join) 3 DERIVED t1 ALL NULL NULL NULL NULL 1 SELECT * FROM t3 LEFT JOIN (v1,t2) ON t3.a = t2.a WHERE t3.b IN (SELECT b FROM t4); @@ -1151,10 +1150,10 @@ WHERE alias5.b = alias4.b AND ( alias5.b >= alias3.b OR alias5.c != alias3.c ) ); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL # Using where -1 PRIMARY alias4 ref PRIMARY,c c 4 test.alias3.d # Using index -1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b # Using where; FirstMatch(alias3) -1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join) +1 PRIMARY alias4 index PRIMARY,c c 4 NULL # Using where; Using index; Start temporary +1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b # Using join buffer (flat, BKA join); Key-ordered scan +1 PRIMARY alias3 hash_ALL PRIMARY #hash#$hj 4 test.alias4.c # Using where; End temporary; Using join buffer (incremental, BNLH join) +1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (incremental, BNL join) 1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using join buffer (incremental, BNL join) SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3 WHERE alias3.d IN ( @@ -1172,10 +1171,10 @@ WHERE alias5.b = alias4.b AND ( alias5.b >= alias3.b OR alias3.c != alias5.c ) ); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL # Using where -1 PRIMARY alias4 ref PRIMARY,c c 4 test.alias3.d # Using index -1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b # Using where; FirstMatch(alias3) -1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join) +1 PRIMARY alias4 index PRIMARY,c c 4 NULL # Using where; Using index; Start temporary +1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b # Using join buffer (flat, BKA join); Key-ordered scan +1 PRIMARY alias3 hash_ALL PRIMARY #hash#$hj 4 test.alias4.c # Using where; End temporary; Using join buffer (incremental, BNLH join) +1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (incremental, BNL join) 1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using join buffer (incremental, BNL join) SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3 WHERE alias3.d IN ( diff --git a/mysql-test/main/subselect_sj2_mat.result b/mysql-test/main/subselect_sj2_mat.result index 5bc7751eeaa..acd600a734f 100644 --- a/mysql-test/main/subselect_sj2_mat.result +++ b/mysql-test/main/subselect_sj2_mat.result @@ -154,7 +154,7 @@ insert into t1 values (2, 'duplicate ok', 'duplicate ok'); insert into t1 values (18, 'duplicate ok', 'duplicate ok'); insert into t2 values (3, 'duplicate ok', 'duplicate ok'); insert into t2 values (19, 'duplicate ok', 'duplicate ok'); -explain select +explain select a, mid(filler1, 1,10), length(filler1)=length(filler2) as Z from t1 ot where a in (select a from t2 it); id select_type table type possible_keys key key_len ref rows Extra @@ -1661,7 +1661,7 @@ SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 -2 DEPENDENT SUBQUERY t3 hash_ALL NULL #hash#$hj 5 func 3 100.00 Using where; Using join buffer (flat, BNLH join) +2 DEPENDENT SUBQUERY t3 hash_ALL NULL #hash#$hj 5 func 3 10.00 Using where; Using join buffer (flat, BNLH join) Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`i1` AS `i1` from `test`.`t1` where <`test`.`t1`.`i1`>((`test`.`t1`.`i1`,(/* select#2 */ select `test`.`t3`.`i3` from `test`.`t2` join `test`.`t3` where `test`.`t3`.`i3` = `test`.`t2`.`i2` and (`test`.`t1`.`i1`) = `test`.`t3`.`i3`))) SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2); @@ -1671,12 +1671,11 @@ set optimizer_switch='materialization=on,semijoin=on'; EXPLAIN EXTENDED SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 Using where -2 MATERIALIZED t3 hash_ALL NULL #hash#$hj 5 test.t2.i2 3 100.00 Using where; Using join buffer (flat, BNLH join) +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary +1 PRIMARY t3 hash_ALL NULL #hash#$hj 5 test.t2.i2 3 10.00 Using where; Using join buffer (flat, BNLH join) +1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 test.t2.i2 5 10.00 Using where; End temporary; Using join buffer (flat, BNLH join) Warnings: -Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t3`.`i3` = `test`.`t2`.`i2` +Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t3`.`i3` = `test`.`t2`.`i2` and `test`.`t1`.`i1` = `test`.`t2`.`i2` SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2); i1 7 @@ -1684,12 +1683,11 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 > 0 AND i3 = i2 OR 1=2); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 -1 PRIMARY eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 Using where -2 MATERIALIZED t3 hash_ALL NULL #hash#$hj 5 test.t2.i2 3 100.00 Using where; Using join buffer (flat, BNLH join) +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary +1 PRIMARY t3 hash_ALL NULL #hash#$hj 5 test.t2.i2 3 10.00 Using where; Using join buffer (flat, BNLH join) +1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 test.t2.i2 5 10.00 Using where; End temporary; Using join buffer (flat, BNLH join) Warnings: -Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t3`.`i3` = `test`.`t2`.`i2` and `test`.`t3`.`i3` > 0 +Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t3`.`i3` = `test`.`t2`.`i2` and `test`.`t1`.`i1` = `test`.`t2`.`i2` and `test`.`t3`.`i3` > 0 SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 > 0 AND i3 = i2 OR 1=2); i1 diff --git a/mysql-test/main/subselect_sj_jcl6.result b/mysql-test/main/subselect_sj_jcl6.result index 5971fa30e89..6e397ddd754 100644 --- a/mysql-test/main/subselect_sj_jcl6.result +++ b/mysql-test/main/subselect_sj_jcl6.result @@ -3575,8 +3575,8 @@ SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a) GROUP BY a HAVING a != 'z'; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t range idx_a idx_a 4 NULL 3 Using where; Using index -1 PRIMARY t1 ref idx_a idx_a 4 test.t.a 1 Using index -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(t) +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where +1 PRIMARY t1 ref idx_a idx_a 4 test.t.a 1 Using index; FirstMatch(t) SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a) GROUP BY a HAVING a != 'z'; a diff --git a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result index 80bd2d7af5f..66399f61535 100644 --- a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result +++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result @@ -1,60 +1,60 @@ set @@global.optimizer_switch=@@optimizer_switch; select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on show global variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off +optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on show session variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off +optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on select * from information_schema.global_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off +OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on select * from information_schema.session_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off +OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on set global optimizer_switch=4101; set session optimizer_switch=2058; select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off +index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off +index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off set global optimizer_switch="index_merge_sort_union=on"; set session optimizer_switch="index_merge=off"; select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off +index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off +index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off show global variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off +optimizer_switch index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off show session variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off +optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off select * from information_schema.global_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off +OPTIMIZER_SWITCH index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off select * from information_schema.session_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off +OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off set session optimizer_switch="default"; select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off +index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off set optimizer_switch = replace(@@optimizer_switch, '=off', '=on'); Warnings: Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release select @@optimizer_switch; @@optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=on,hash_join_cardinality=on set global optimizer_switch=1.1; ERROR 42000: Incorrect argument type to variable 'optimizer_switch' set global optimizer_switch=1e1; diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result index cc63673635f..bbf6c22b70f 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result @@ -2489,7 +2489,7 @@ VARIABLE_COMMENT Fine-tune the optimizer behavior NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,split_materialized,condition_pushdown_for_subquery,rowid_filter,condition_pushdown_from_having,not_null_range_scan,default +ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,split_materialized,condition_pushdown_for_subquery,rowid_filter,condition_pushdown_from_having,not_null_range_scan,hash_join_cardinality,default READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_TRACE diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index 9ade9511434..545a1ad7a6b 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -2659,7 +2659,7 @@ VARIABLE_COMMENT Fine-tune the optimizer behavior NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL -ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,split_materialized,condition_pushdown_for_subquery,rowid_filter,condition_pushdown_from_having,not_null_range_scan,default +ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,split_materialized,condition_pushdown_for_subquery,rowid_filter,condition_pushdown_from_having,not_null_range_scan,hash_join_cardinality,default READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_TRACE diff --git a/mysql-test/suite/sysschema/r/optimizer_switch.result b/mysql-test/suite/sysschema/r/optimizer_switch.result index 017276fc4b8..4193bf0739e 100644 --- a/mysql-test/suite/sysschema/r/optimizer_switch.result +++ b/mysql-test/suite/sysschema/r/optimizer_switch.result @@ -8,6 +8,7 @@ derived_with_keys on exists_to_in on extended_keys on firstmatch on +hash_join_cardinality on index_condition_pushdown on index_merge on index_merge_intersection on diff --git a/sql/sql_priv.h b/sql/sql_priv.h index 6f4eff4880c..5f2074851e1 100644 --- a/sql/sql_priv.h +++ b/sql/sql_priv.h @@ -238,38 +238,39 @@ #define OPTIMIZER_SWITCH_USE_ROWID_FILTER (1ULL << 33) #define OPTIMIZER_SWITCH_COND_PUSHDOWN_FROM_HAVING (1ULL << 34) #define OPTIMIZER_SWITCH_NOT_NULL_RANGE_SCAN (1ULL << 35) +#define OPTIMIZER_SWITCH_HASH_JOIN_CARDINALITY (1ULL << 36) -#define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \ - OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \ - OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION | \ - OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT | \ - OPTIMIZER_SWITCH_INDEX_COND_PUSHDOWN | \ - OPTIMIZER_SWITCH_DERIVED_MERGE | \ - OPTIMIZER_SWITCH_DERIVED_WITH_KEYS | \ - OPTIMIZER_SWITCH_TABLE_ELIMINATION | \ - OPTIMIZER_SWITCH_EXTENDED_KEYS | \ - OPTIMIZER_SWITCH_IN_TO_EXISTS | \ - OPTIMIZER_SWITCH_MATERIALIZATION | \ - OPTIMIZER_SWITCH_PARTIAL_MATCH_ROWID_MERGE|\ - OPTIMIZER_SWITCH_PARTIAL_MATCH_TABLE_SCAN|\ - OPTIMIZER_SWITCH_OUTER_JOIN_WITH_CACHE | \ - OPTIMIZER_SWITCH_SEMIJOIN_WITH_CACHE | \ - OPTIMIZER_SWITCH_JOIN_CACHE_INCREMENTAL | \ - OPTIMIZER_SWITCH_JOIN_CACHE_HASHED | \ - OPTIMIZER_SWITCH_JOIN_CACHE_BKA | \ - OPTIMIZER_SWITCH_SUBQUERY_CACHE | \ - OPTIMIZER_SWITCH_SEMIJOIN | \ - OPTIMIZER_SWITCH_FIRSTMATCH | \ - OPTIMIZER_SWITCH_LOOSE_SCAN | \ - OPTIMIZER_SWITCH_EXISTS_TO_IN | \ - OPTIMIZER_SWITCH_ORDERBY_EQ_PROP | \ - OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_DERIVED | \ - OPTIMIZER_SWITCH_SPLIT_MATERIALIZED | \ - OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_SUBQUERY | \ - OPTIMIZER_SWITCH_USE_ROWID_FILTER | \ - OPTIMIZER_SWITCH_COND_PUSHDOWN_FROM_HAVING | \ - OPTIMIZER_SWITCH_OPTIMIZE_JOIN_BUFFER_SIZE) - +#define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \ + OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \ + OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION | \ + OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT | \ + OPTIMIZER_SWITCH_INDEX_COND_PUSHDOWN | \ + OPTIMIZER_SWITCH_DERIVED_MERGE | \ + OPTIMIZER_SWITCH_DERIVED_WITH_KEYS | \ + OPTIMIZER_SWITCH_TABLE_ELIMINATION | \ + OPTIMIZER_SWITCH_EXTENDED_KEYS | \ + OPTIMIZER_SWITCH_IN_TO_EXISTS | \ + OPTIMIZER_SWITCH_MATERIALIZATION | \ + OPTIMIZER_SWITCH_PARTIAL_MATCH_ROWID_MERGE|\ + OPTIMIZER_SWITCH_PARTIAL_MATCH_TABLE_SCAN|\ + OPTIMIZER_SWITCH_OUTER_JOIN_WITH_CACHE | \ + OPTIMIZER_SWITCH_SEMIJOIN_WITH_CACHE | \ + OPTIMIZER_SWITCH_JOIN_CACHE_INCREMENTAL | \ + OPTIMIZER_SWITCH_JOIN_CACHE_HASHED | \ + OPTIMIZER_SWITCH_JOIN_CACHE_BKA | \ + OPTIMIZER_SWITCH_SUBQUERY_CACHE | \ + OPTIMIZER_SWITCH_SEMIJOIN | \ + OPTIMIZER_SWITCH_FIRSTMATCH | \ + OPTIMIZER_SWITCH_LOOSE_SCAN | \ + OPTIMIZER_SWITCH_EXISTS_TO_IN | \ + OPTIMIZER_SWITCH_ORDERBY_EQ_PROP | \ + OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_DERIVED | \ + OPTIMIZER_SWITCH_SPLIT_MATERIALIZED | \ + OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_SUBQUERY |\ + OPTIMIZER_SWITCH_USE_ROWID_FILTER | \ + OPTIMIZER_SWITCH_COND_PUSHDOWN_FROM_HAVING | \ + OPTIMIZER_SWITCH_OPTIMIZE_JOIN_BUFFER_SIZE |\ + OPTIMIZER_SWITCH_HASH_JOIN_CARDINALITY) /* Replication uses 8 bytes to store SQL_MODE in the binary log. The day you use strictly more than 64 bits by adding one more define above, you should diff --git a/sql/sql_select.cc b/sql/sql_select.cc index cdf9af40f7a..9c665bf5df0 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7872,7 +7872,7 @@ static double apply_selectivity_for_table(JOIN_TAB *s, this table in join order. */ -static double use_found_constraint(double records) +inline double use_found_constraint(double records) { records-= records/4; return records ? MY_MAX(records, MIN_ROWS_AFTER_FILTERING) : 0.0; @@ -8062,6 +8062,155 @@ apply_filter(THD *thd, TABLE *table, ALL_READ_COST *cost, } +/* + @brief + Compute the fanout of hash join operation using EITS data + + @param join JOIN structure + @param tab JOIN_TAB for the current table + @param remaining_tables Map of tables not yet accessable + @param rnd_records Number of accepted rows in the table, after taking + selectivity into account. + @param hj_start_key Pointer to hash key + @param stats_found Is set to 1 if we found any usable hash key part + with statistics from analyze. +*/ + +double hash_join_fanout(JOIN *join, JOIN_TAB *tab, table_map remaining_tables, + double rnd_records, KEYUSE *hj_start_key, + bool *stats_found) +{ + THD *thd= join->thd; + /* + Before doing the hash join, we will scan the table and apply the local part + of the WHERE condition. This will produce rnd_records. + + The EITS statistics describes the entire table. Calling + + table->field[N]->get_avg_frequency() + + produces average #rows in the table with some value. + + What happens if we filter out rows so that rnd_records rows are left? + Something between the two outcomes: + A. filtering removes a fraction of rows for each value: + avg_frequency=avg_frequency * condition_selectivity + + B. filtering removes entire groups of rows with the same value, but + the remaining groups remain of the same size. + + We make pessimistic assumption and assume B. + We also handle an edge case: if rnd_records is less than avg_frequency, + assume we'll get rnd_records rows with the same value, and return + rnd_records as the fanout estimate. + */ + double min_freq= (double) tab->table->stat_records(); + bool found_not_usable_field= 0; + bool found_usable_field __attribute__((unused))= 0; + DBUG_ENTER("hash_join_cardinality"); + + Json_writer_object trace_obj(thd, "hash_join_cardinality"); + + /* + There can be multiple KEYUSE referring to same or different columns + + KEYUSE(tbl.col1 = ...) + KEYUSE(tbl.col1 = ...) + KEYUSE(tbl.col2 = ...) + + Hash join code can use multiple columns: (col1, col2) for joining. + We need n_distinct({col1, col2}). + + EITS only has statistics on individual columns: n_distinct(col1), + n_distinct(col2). + + Our current solution is to be very conservative and use selectivity + of one column with the lowest avg_frequency. + + In the future, we should an approach that cautiosly takes into account + multiple KEYUSEs either multiply by number of equalities or by sqrt + of the second most selective equality. + */ + Json_writer_array trace_arr(thd, "hash_join_columns"); + for (KEYUSE *keyuse= hj_start_key; + keyuse->table == tab->table && is_hash_join_key_no(keyuse->key); + keyuse++) + { + if (!(remaining_tables & keyuse->used_tables) && + (!keyuse->validity_ref || *keyuse->validity_ref) && + tab->access_from_tables_is_allowed(keyuse->used_tables, + join->sjm_lookup_tables)) + { + Field *field= tab->table->field[keyuse->keypart]; + found_usable_field= 1; + if (is_eits_usable(field)) + { + double freq= field->read_stats->get_avg_frequency(); + + Json_writer_object trace_field(thd); + trace_field.add("field",field->field_name.str). + add("avg_frequency", freq); + if (freq < min_freq) + min_freq= freq; + *stats_found= 1; + continue; + } + } + if (!keyuse->validity_ref || *keyuse->validity_ref) + found_not_usable_field= 1; + } + /* Ensure that some part of hash_key is usable */ + DBUG_ASSERT(found_usable_field); + + trace_arr.end(); + if (found_not_usable_field) + { + /* + We did not't have data for all key fields. Assume that the hash + will at least limit the number of matched rows to HASH_FANOUT. + This makes the cost same as when 'hash_join_cardinality=off' + in the case when no analyze of the tables have been made. + + However, it may cause problems when min_freq is higher than + HASH_FANOUT as the optimizer will then assume it is better to + put the table earlier in the plan when all key parts are not + usable. + Note that min_freq can become less than 1.0. This is intentional + as it matches what happens if OPTIMIZER_SWITCH_HASH_JOIN_CARDINALITY + is not used. + */ + double max_expected_records= rnd_records * HASH_FANOUT; + set_if_smaller(min_freq, max_expected_records); + trace_obj.add("using_default_hash_fanout", HASH_FANOUT); + } + else + { + /* + Before joining the table with the contents of join buffer, we will + use the quick select and/or apply the table condition. + + This will reduce the number of rows joined to rnd_records. + How will this affect n_distinct? + Depending on which rows are removed, this can either leave n_distinct as + is (for some value X, some rows are removed but some are left, leaving the + number of distinct values the same), or reduce n_distinct in proportion + with the fraction of rows removed (for some values of X, either all or + none of the rows with that value are removed). + + We assume the latter: n_distinct is reduced in proportion the condition + and quick select's selectivity. + This is in effect same as applying apply_selectivity_for_table() on + min_freq as we have already done on rnd_records + */ + min_freq*= rnd_records / tab->table->stat_records(); + set_if_bigger(min_freq, HASH_FANOUT); + } + + trace_obj.add("rows", min_freq); + DBUG_RETURN(min_freq); +} + + /** Find the best access path for an extension of a partial execution plan and add this path to the plan. @@ -8923,15 +9072,47 @@ best_access_path(JOIN *join, (!(table->map & join->outer_join) || join->allowed_outer_join_with_cache)) // (2) { - double refills, row_copy_cost, cmp_time, cur_cost, records_table_filter; + Json_writer_object trace_access_hash(thd); + double refills, row_copy_cost, copy_cost, cur_cost, where_cost; + double matching_combinations, fanout, join_sel; /* Estimate the cost of the hash join access to the table */ - double rnd_records= apply_selectivity_for_table(s, use_cond_selectivity); - records_table_filter= ((found_constraint) ? - use_found_constraint(rnd_records) : - rnd_records); + double rnd_records; + bool stats_found= 0; + rnd_records= apply_selectivity_for_table(s, use_cond_selectivity); DBUG_ASSERT(rnd_records <= rows2double(s->found_records) + 0.5); - set_if_smaller(best.records_out, records_table_filter); + DBUG_ASSERT(hj_start_key); + + fanout= rnd_records; + if (optimizer_flag(thd, OPTIMIZER_SWITCH_HASH_JOIN_CARDINALITY)) + { + /* + Starting from this point, rnd_records should not be used anymore. + Use "fanout" for an estimate of # matching records. + */ + fanout= hash_join_fanout(join, s, remaining_tables, rnd_records, + hj_start_key, &stats_found); + set_if_smaller(best.records_out, fanout); + join_sel= 1.0; + } + if (!stats_found) + { + /* + No OPTIMIZER_SWITCH_HASH_JOIN_CARDINALITY or no field statistics + found. + + Take into account if there is non constant constraints used with + earlier tables in the where expression. + If yes, this will set fanout to rnd_records/4. + We estimate that there will be HASH_FANOUT (10%) + hash matches / row. + */ + fanout= ((found_constraint) ? + use_found_constraint(rnd_records) : + rnd_records); + set_if_smaller(best.records_out, fanout * HASH_FANOUT); + join_sel= HASH_FANOUT; + } /* The following cost calculation is identical to the cost calculation for @@ -8958,36 +9139,36 @@ best_access_path(JOIN *join, Cost of doing the hash lookup and check all matching rows with the WHERE clause. We assume here that, thanks to the hash, we don't have to compare all - row combinations, only a HASH_FANOUT (10%) rows in the cache. + row combinations, only a fanout or HASH_FANOUT (10%) rows in the cache. */ row_copy_cost= (ROW_COPY_COST_THD(thd) * JOIN_CACHE_ROW_COPY_COST_FACTOR(thd)); - cmp_time= (record_count * row_copy_cost + - rnd_records * record_count * HASH_FANOUT * - ((idx - join->const_tables) * row_copy_cost + - WHERE_COST_THD(thd))); - cur_cost= COST_ADD(cur_cost, cmp_time); + matching_combinations= fanout * join_sel * record_count; + copy_cost= (record_count * row_copy_cost + + matching_combinations * + ((idx - join->const_tables) * row_copy_cost)); + where_cost= matching_combinations * WHERE_COST_THD(thd); + cur_cost= COST_ADD(cur_cost, copy_cost + where_cost); best.cost= cur_cost; best.records_read= best.records_after_filter= rows2double(s->records); - best.records= rnd_records; -#ifdef NOT_YET - set_if_smaller(best.records_out, rnd_records * HASH_FANOUT); -#endif + best.records= rnd_records; // Records after where (Legacy value) best.key= hj_start_key; best.ref_depends_map= 0; best.use_join_buffer= TRUE; best.filter= 0; best.type= JT_HASH; best.refills= (ulonglong) ceil(refills); - Json_writer_object trace_access_hash(thd); if (unlikely(trace_access_hash.trace_started())) trace_access_hash. add("type", "hash"). add("index", "hj-key"). add("rows", rnd_records). + add("rows_after_hash", fanout * join_sel). add("refills", refills). - add("cost", best.cost). + add("jbuf_use_cost", copy_cost). + add("extra_cond_check_cost", where_cost). + add("total_cost", best.cost). add("chosen", true); } diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index ecde847c8d4..b6f180f609f 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -4147,7 +4147,7 @@ bool is_eits_usable(Field *field) if (!col_stats) return false; - DBUG_ASSERT(field->table->stats_is_read); + DBUG_ASSERT(field->orig_table->stats_is_read); /* (1): checks if we have EITS statistics for a particular column @@ -4160,8 +4160,8 @@ bool is_eits_usable(Field *field) return !col_stats->no_stat_values_provided() && //(1) field->type() != MYSQL_TYPE_GEOMETRY && //(2) #ifdef WITH_PARTITION_STORAGE_ENGINE - (!field->table->part_info || - !field->table->part_info->field_in_partition_expr(field)) && //(3) + (!field->orig_table->part_info || + !field->orig_table->part_info->field_in_partition_expr(field)) && //(3) #endif true; } diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 7c940c36723..a77841e4dda 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -2891,6 +2891,7 @@ export const char *optimizer_switch_names[]= "rowid_filter", "condition_pushdown_from_having", "not_null_range_scan", + "hash_join_cardinality", "default", NullS }; From 0099c2fc1aefaf2ed18b18567a9c641eb6a51518 Mon Sep 17 00:00:00 2001 From: Monty Date: Mon, 27 Mar 2023 17:15:59 +0300 Subject: [PATCH 225/260] MDEV-30786 SIGFPE in cost_group_min_max on EXP The problem was that for merge tables without any underlaying tables the block size was 0, which the code could not handle. Fixed by ensuring that MERGE tables never have a block size of 0. Fixed also a wrong assumption of number of seeks needed to scan merge tables. --- mysql-test/main/merge.result | 14 ++++++++++++++ mysql-test/main/merge.test | 10 ++++++++++ storage/myisammrg/ha_myisammrg.cc | 25 ++++++++----------------- 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/mysql-test/main/merge.result b/mysql-test/main/merge.result index 1eecb3e34ca..590a2f74e34 100644 --- a/mysql-test/main/merge.result +++ b/mysql-test/main/merge.result @@ -3965,5 +3965,19 @@ SELECT DISTINCT f FROM tm WHERE f IN (47, 126, 97, 48, 73, 0); f DROP TABLE tm, t1, t2; # +# MDEV-30786 SIGFPE in cost_group_min_max on EXP +# +SET use_stat_tables='preferably'; +CREATE TABLE t1 (a INT,b INT,KEY i1 (a),KEY i2 (b)) ENGINE=MRG_MyISAM; +ANALYZE LOCAL TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze note The storage engine for the table doesn't support analyze +EXPLAIN SELECT DISTINCT a FROM t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range NULL i1 5 NULL 1 Using index for group-by +drop table t1; +set use_stat_tables=default; +# # End of 11.0 tests # diff --git a/mysql-test/main/merge.test b/mysql-test/main/merge.test index 6b88d427fb4..21b296a81d7 100644 --- a/mysql-test/main/merge.test +++ b/mysql-test/main/merge.test @@ -2922,6 +2922,16 @@ CREATE TABLE tm (f INT, KEY(f)) ENGINE=MERGE UNION = (t1, t2); SELECT DISTINCT f FROM tm WHERE f IN (47, 126, 97, 48, 73, 0); DROP TABLE tm, t1, t2; +--echo # +--echo # MDEV-30786 SIGFPE in cost_group_min_max on EXP +--echo # +SET use_stat_tables='preferably'; +CREATE TABLE t1 (a INT,b INT,KEY i1 (a),KEY i2 (b)) ENGINE=MRG_MyISAM; +ANALYZE LOCAL TABLE t1; +EXPLAIN SELECT DISTINCT a FROM t1; +drop table t1; +set use_stat_tables=default; + --echo # --echo # End of 11.0 tests --echo # diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index ee5d44b5d26..8d03320ea58 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -343,7 +343,7 @@ IO_AND_CPU_COST ha_myisammrg::rnd_pos_time(ha_rows rows) { IO_AND_CPU_COST cost= handler::rnd_pos_time(rows); /* - Row data is notcached. costs.row_lookup_cost includes the cost of + Row data is not cached. costs.row_lookup_cost includes the cost of the reading the row from system (probably cached by the OS). */ cost.io= 0; @@ -1300,26 +1300,17 @@ int ha_myisammrg::info(uint flag) table->s->keys_in_use.set_prefix(table->s->keys); stats.mean_rec_length= mrg_info.reclength; - /* + /* The handler::block_size is used all over the code in index scan cost calculations. It is used to get number of disk seeks required to retrieve a number of index tuples. - If the merge table has N underlying tables, then (assuming underlying - tables have equal size, the only "simple" approach we can use) - retrieving X index records from a merge table will require N times more - disk seeks compared to doing the same on a MyISAM table with equal - number of records. - In the edge case (file_tables > myisam_block_size) we'll get - block_size==0, and index calculation code will act as if we need one - disk seek to retrieve one index tuple. - - TODO: In 5.2 index scan cost calculation will be factored out into a - virtual function in class handler and we'll be able to remove this hack. + If the merge table has N underlying tables, there will be + N more disk seeks compared to a scanning a normal MyISAM table. + The number of bytes read is the rougly the same for a normal MyISAM + and a MyISAM merge tables. */ - stats.block_size= 0; - if (file->tables) - stats.block_size= myisam_block_size / file->tables; - + stats.block_size= myisam_block_size; + stats.update_time= 0; #if SIZEOF_OFF_T > 4 ref_length=6; // Should be big enough From ec820a380e081493e2b6fb191237a2f1c949fb4d Mon Sep 17 00:00:00 2001 From: Monty Date: Mon, 27 Mar 2023 17:57:19 +0300 Subject: [PATCH 226/260] Moved merge tests from main to suite/merge This makes it easier to run test on just the MRG_MYISAM engine. Other things: - Renamed merge-big.test to flush_corruption.test as it does not have anything to do with merge tables. --- mysql-test/main/alter_table.result | 22 ------------------- mysql-test/main/alter_table.test | 14 ------------ ...rge-big.result => flush_corruption.result} | 0 .../{merge-big.test => flush_corruption.test} | 2 +- mysql-test/mariadb-test-run.pl | 1 + mysql-test/suite/merge/alter_table.result | 22 +++++++++++++++++++ mysql-test/suite/merge/alter_table.test | 12 ++++++++++ mysql-test/{main => suite/merge}/merge.result | 0 mysql-test/{main => suite/merge}/merge.test | 0 .../{main => suite/merge}/merge_debug.result | 0 .../{main => suite/merge}/merge_debug.test | 0 .../{main => suite/merge}/merge_innodb.result | 0 .../{main => suite/merge}/merge_innodb.test | 0 .../merge}/merge_mmap-master.opt | 0 .../{main => suite/merge}/merge_mmap.result | 0 .../{main => suite/merge}/merge_mmap.test | 0 16 files changed, 36 insertions(+), 37 deletions(-) rename mysql-test/main/{merge-big.result => flush_corruption.result} (100%) rename mysql-test/main/{merge-big.test => flush_corruption.test} (98%) create mode 100644 mysql-test/suite/merge/alter_table.result create mode 100644 mysql-test/suite/merge/alter_table.test rename mysql-test/{main => suite/merge}/merge.result (100%) rename mysql-test/{main => suite/merge}/merge.test (100%) rename mysql-test/{main => suite/merge}/merge_debug.result (100%) rename mysql-test/{main => suite/merge}/merge_debug.test (100%) rename mysql-test/{main => suite/merge}/merge_innodb.result (100%) rename mysql-test/{main => suite/merge}/merge_innodb.test (100%) rename mysql-test/{main => suite/merge}/merge_mmap-master.opt (100%) rename mysql-test/{main => suite/merge}/merge_mmap.result (100%) rename mysql-test/{main => suite/merge}/merge_mmap.test (100%) diff --git a/mysql-test/main/alter_table.result b/mysql-test/main/alter_table.result index 879bc0edfec..1508bb9d34a 100644 --- a/mysql-test/main/alter_table.result +++ b/mysql-test/main/alter_table.result @@ -268,28 +268,6 @@ ERROR 42000: Incorrect table name '' rename table t1 to ``; ERROR 42000: Incorrect table name '' drop table t1; -drop table if exists t1, t2; -Warnings: -Note 1051 Unknown table 'test.t1,test.t2' -create table t1 ( a varchar(10) not null primary key ) engine=myisam; -create table t2 ( a varchar(10) not null primary key ) engine=merge union=(t1); -flush tables; -alter table t1 modify a varchar(10); -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `a` varchar(10) NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci UNION=(`t1`) -flush tables; -alter table t1 modify a varchar(10) not null; -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `a` varchar(10) NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci UNION=(`t1`) -drop table if exists t1, t2; create table t1 (a int, b int, c int, d int, e int, f int, g int, h int,i int, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM; insert ignore into t1 (a) values(1); Warnings: diff --git a/mysql-test/main/alter_table.test b/mysql-test/main/alter_table.test index 8ddf60f26d8..ebf10008f48 100644 --- a/mysql-test/main/alter_table.test +++ b/mysql-test/main/alter_table.test @@ -244,20 +244,6 @@ alter table t1 rename to ``; rename table t1 to ``; drop table t1; -# -# BUG#6236 - ALTER TABLE MODIFY should set implicit NOT NULL on PK columns -# -drop table if exists t1, t2; -create table t1 ( a varchar(10) not null primary key ) engine=myisam; -create table t2 ( a varchar(10) not null primary key ) engine=merge union=(t1); -flush tables; -alter table t1 modify a varchar(10); -show create table t2; -flush tables; -alter table t1 modify a varchar(10) not null; -show create table t2; -drop table if exists t1, t2; - # The following is also part of bug #6236 (CREATE TABLE didn't properly count # not null columns for primary keys) diff --git a/mysql-test/main/merge-big.result b/mysql-test/main/flush_corruption.result similarity index 100% rename from mysql-test/main/merge-big.result rename to mysql-test/main/flush_corruption.result diff --git a/mysql-test/main/merge-big.test b/mysql-test/main/flush_corruption.test similarity index 98% rename from mysql-test/main/merge-big.test rename to mysql-test/main/flush_corruption.test index 5873d2eb233..97ef416307f 100644 --- a/mysql-test/main/merge-big.test +++ b/mysql-test/main/flush_corruption.test @@ -1,5 +1,5 @@ # -# Test of MERGE tables with multisession and many waits. +# Test of MyISAM tables with multisession and many waits. # # This test takes rather long time so let us run it only in --big-test mode --source include/big_test.inc diff --git a/mysql-test/mariadb-test-run.pl b/mysql-test/mariadb-test-run.pl index 1c4d2866c85..0c97866bd67 100755 --- a/mysql-test/mariadb-test-run.pl +++ b/mysql-test/mariadb-test-run.pl @@ -200,6 +200,7 @@ my @DEFAULT_SUITES= qw( json- maria- mariabackup- + merge- multi_source- optimizer_unfixed_bugs- parts- diff --git a/mysql-test/suite/merge/alter_table.result b/mysql-test/suite/merge/alter_table.result new file mode 100644 index 00000000000..5adf610e5c0 --- /dev/null +++ b/mysql-test/suite/merge/alter_table.result @@ -0,0 +1,22 @@ +# +# BUG#6236 - ALTER TABLE MODIFY should set implicit NOT NULL on PK columns +# +create table t1 ( a varchar(10) not null primary key ) engine=myisam; +create table t2 ( a varchar(10) not null primary key ) engine=merge union=(t1); +flush tables; +alter table t1 modify a varchar(10); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` varchar(10) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci UNION=(`t1`) +flush tables; +alter table t1 modify a varchar(10) not null; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` varchar(10) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci UNION=(`t1`) +drop table if exists t1, t2; diff --git a/mysql-test/suite/merge/alter_table.test b/mysql-test/suite/merge/alter_table.test new file mode 100644 index 00000000000..da56772bf60 --- /dev/null +++ b/mysql-test/suite/merge/alter_table.test @@ -0,0 +1,12 @@ +--echo # +--echo # BUG#6236 - ALTER TABLE MODIFY should set implicit NOT NULL on PK columns +--echo # +create table t1 ( a varchar(10) not null primary key ) engine=myisam; +create table t2 ( a varchar(10) not null primary key ) engine=merge union=(t1); +flush tables; +alter table t1 modify a varchar(10); +show create table t2; +flush tables; +alter table t1 modify a varchar(10) not null; +show create table t2; +drop table if exists t1, t2; diff --git a/mysql-test/main/merge.result b/mysql-test/suite/merge/merge.result similarity index 100% rename from mysql-test/main/merge.result rename to mysql-test/suite/merge/merge.result diff --git a/mysql-test/main/merge.test b/mysql-test/suite/merge/merge.test similarity index 100% rename from mysql-test/main/merge.test rename to mysql-test/suite/merge/merge.test diff --git a/mysql-test/main/merge_debug.result b/mysql-test/suite/merge/merge_debug.result similarity index 100% rename from mysql-test/main/merge_debug.result rename to mysql-test/suite/merge/merge_debug.result diff --git a/mysql-test/main/merge_debug.test b/mysql-test/suite/merge/merge_debug.test similarity index 100% rename from mysql-test/main/merge_debug.test rename to mysql-test/suite/merge/merge_debug.test diff --git a/mysql-test/main/merge_innodb.result b/mysql-test/suite/merge/merge_innodb.result similarity index 100% rename from mysql-test/main/merge_innodb.result rename to mysql-test/suite/merge/merge_innodb.result diff --git a/mysql-test/main/merge_innodb.test b/mysql-test/suite/merge/merge_innodb.test similarity index 100% rename from mysql-test/main/merge_innodb.test rename to mysql-test/suite/merge/merge_innodb.test diff --git a/mysql-test/main/merge_mmap-master.opt b/mysql-test/suite/merge/merge_mmap-master.opt similarity index 100% rename from mysql-test/main/merge_mmap-master.opt rename to mysql-test/suite/merge/merge_mmap-master.opt diff --git a/mysql-test/main/merge_mmap.result b/mysql-test/suite/merge/merge_mmap.result similarity index 100% rename from mysql-test/main/merge_mmap.result rename to mysql-test/suite/merge/merge_mmap.result diff --git a/mysql-test/main/merge_mmap.test b/mysql-test/suite/merge/merge_mmap.test similarity index 100% rename from mysql-test/main/merge_mmap.test rename to mysql-test/suite/merge/merge_mmap.test From 78f684e552fbdf7fc82c666035a0b8d66144a15a Mon Sep 17 00:00:00 2001 From: Monty Date: Sat, 22 Apr 2023 17:23:52 +0300 Subject: [PATCH 227/260] Moved events tests from main to suite/events This makes it easier to run test on just events. --- mysql-test/main/disabled.def | 1 - mysql-test/mariadb-test-run.pl | 3 ++- mysql-test/suite/events/disabled.def | 12 ++++++++++++ mysql-test/{main => suite/events}/events_1.result | 0 mysql-test/{main => suite/events}/events_1.test | 0 mysql-test/{main => suite/events}/events_2.result | 0 mysql-test/{main => suite/events}/events_2.test | 0 .../{main => suite/events}/events_bugs-master.opt | 0 mysql-test/{main => suite/events}/events_bugs.result | 0 mysql-test/{main => suite/events}/events_bugs.test | 0 .../{main => suite/events}/events_embedded.result | 0 .../{main => suite/events}/events_embedded.test | 0 .../{main => suite/events}/events_grant.result | 0 mysql-test/{main => suite/events}/events_grant.test | 0 .../events}/events_logs_tests-master.opt | 0 .../{main => suite/events}/events_logs_tests.result | 0 .../{main => suite/events}/events_logs_tests.test | 0 .../{main => suite/events}/events_microsec.result | 0 .../{main => suite/events}/events_microsec.test | 0 .../{main => suite/events}/events_restart-master.opt | 0 .../{main => suite/events}/events_restart.result | 0 .../{main => suite/events}/events_restart.test | 0 .../{main => suite/events}/events_scheduling.result | 0 .../{main => suite/events}/events_scheduling.test | 0 .../{main => suite/events}/events_slowlog.result | 0 .../{main => suite/events}/events_slowlog.test | 0 .../{main => suite/events}/events_stress.result | 0 mysql-test/{main => suite/events}/events_stress.test | 0 .../{main => suite/events}/events_time_zone.result | 0 .../{main => suite/events}/events_time_zone.test | 0 .../{main => suite/events}/events_trans.result | 0 mysql-test/{main => suite/events}/events_trans.test | 0 .../events}/events_trans_notembedded.result | 0 .../events}/events_trans_notembedded.test | 0 34 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 mysql-test/suite/events/disabled.def rename mysql-test/{main => suite/events}/events_1.result (100%) rename mysql-test/{main => suite/events}/events_1.test (100%) rename mysql-test/{main => suite/events}/events_2.result (100%) rename mysql-test/{main => suite/events}/events_2.test (100%) rename mysql-test/{main => suite/events}/events_bugs-master.opt (100%) rename mysql-test/{main => suite/events}/events_bugs.result (100%) rename mysql-test/{main => suite/events}/events_bugs.test (100%) rename mysql-test/{main => suite/events}/events_embedded.result (100%) rename mysql-test/{main => suite/events}/events_embedded.test (100%) rename mysql-test/{main => suite/events}/events_grant.result (100%) rename mysql-test/{main => suite/events}/events_grant.test (100%) rename mysql-test/{main => suite/events}/events_logs_tests-master.opt (100%) rename mysql-test/{main => suite/events}/events_logs_tests.result (100%) rename mysql-test/{main => suite/events}/events_logs_tests.test (100%) rename mysql-test/{main => suite/events}/events_microsec.result (100%) rename mysql-test/{main => suite/events}/events_microsec.test (100%) rename mysql-test/{main => suite/events}/events_restart-master.opt (100%) rename mysql-test/{main => suite/events}/events_restart.result (100%) rename mysql-test/{main => suite/events}/events_restart.test (100%) rename mysql-test/{main => suite/events}/events_scheduling.result (100%) rename mysql-test/{main => suite/events}/events_scheduling.test (100%) rename mysql-test/{main => suite/events}/events_slowlog.result (100%) rename mysql-test/{main => suite/events}/events_slowlog.test (100%) rename mysql-test/{main => suite/events}/events_stress.result (100%) rename mysql-test/{main => suite/events}/events_stress.test (100%) rename mysql-test/{main => suite/events}/events_time_zone.result (100%) rename mysql-test/{main => suite/events}/events_time_zone.test (100%) rename mysql-test/{main => suite/events}/events_trans.result (100%) rename mysql-test/{main => suite/events}/events_trans.test (100%) rename mysql-test/{main => suite/events}/events_trans_notembedded.result (100%) rename mysql-test/{main => suite/events}/events_trans_notembedded.test (100%) diff --git a/mysql-test/main/disabled.def b/mysql-test/main/disabled.def index 02104f6a680..7d0c59e1c84 100644 --- a/mysql-test/main/disabled.def +++ b/mysql-test/main/disabled.def @@ -10,7 +10,6 @@ # ############################################################################## tablespace : disabled in MariaDB (no TABLESPACE table attribute) -events_time_zone : Test is not predictable as it depends on precise timing. read_many_rows_innodb : Bug#11748886 2010-11-15 mattiasj report already exists mysql_embedded : Bug#12561297 2011-05-14 Anitha Dependent on PB2 changes - eventum#41836 #show_explain : Psergey: random timeout in range-checked-for-each record query. diff --git a/mysql-test/mariadb-test-run.pl b/mysql-test/mariadb-test-run.pl index 0c97866bd67..07d55afe959 100755 --- a/mysql-test/mariadb-test-run.pl +++ b/mysql-test/mariadb-test-run.pl @@ -186,6 +186,7 @@ my @DEFAULT_SUITES= qw( compat/mssql- compat/maxdb- encryption- + events- federated- funcs_1- funcs_2- @@ -5961,7 +5962,7 @@ Misc options phases of test execution. stress=ARGS Run stress test, providing options to mysql-stress-test.pl. Options are separated by comma. - xml-report= Output jUnit xml file of the results. + xml-report= Output xml file of the results. tail-lines=N Number of lines of the result to include in a failure report. diff --git a/mysql-test/suite/events/disabled.def b/mysql-test/suite/events/disabled.def new file mode 100644 index 00000000000..d895d7d221e --- /dev/null +++ b/mysql-test/suite/events/disabled.def @@ -0,0 +1,12 @@ +############################################################################## +# +# List the test cases that are to be disabled temporarily. +# +# Separate the test case name and the comment with ':'. +# +# : BUG# +# +# Do not use any TAB characters for whitespace. +# +############################################################################## +events_time_zone : Test is not predictable as it depends on precise timing. diff --git a/mysql-test/main/events_1.result b/mysql-test/suite/events/events_1.result similarity index 100% rename from mysql-test/main/events_1.result rename to mysql-test/suite/events/events_1.result diff --git a/mysql-test/main/events_1.test b/mysql-test/suite/events/events_1.test similarity index 100% rename from mysql-test/main/events_1.test rename to mysql-test/suite/events/events_1.test diff --git a/mysql-test/main/events_2.result b/mysql-test/suite/events/events_2.result similarity index 100% rename from mysql-test/main/events_2.result rename to mysql-test/suite/events/events_2.result diff --git a/mysql-test/main/events_2.test b/mysql-test/suite/events/events_2.test similarity index 100% rename from mysql-test/main/events_2.test rename to mysql-test/suite/events/events_2.test diff --git a/mysql-test/main/events_bugs-master.opt b/mysql-test/suite/events/events_bugs-master.opt similarity index 100% rename from mysql-test/main/events_bugs-master.opt rename to mysql-test/suite/events/events_bugs-master.opt diff --git a/mysql-test/main/events_bugs.result b/mysql-test/suite/events/events_bugs.result similarity index 100% rename from mysql-test/main/events_bugs.result rename to mysql-test/suite/events/events_bugs.result diff --git a/mysql-test/main/events_bugs.test b/mysql-test/suite/events/events_bugs.test similarity index 100% rename from mysql-test/main/events_bugs.test rename to mysql-test/suite/events/events_bugs.test diff --git a/mysql-test/main/events_embedded.result b/mysql-test/suite/events/events_embedded.result similarity index 100% rename from mysql-test/main/events_embedded.result rename to mysql-test/suite/events/events_embedded.result diff --git a/mysql-test/main/events_embedded.test b/mysql-test/suite/events/events_embedded.test similarity index 100% rename from mysql-test/main/events_embedded.test rename to mysql-test/suite/events/events_embedded.test diff --git a/mysql-test/main/events_grant.result b/mysql-test/suite/events/events_grant.result similarity index 100% rename from mysql-test/main/events_grant.result rename to mysql-test/suite/events/events_grant.result diff --git a/mysql-test/main/events_grant.test b/mysql-test/suite/events/events_grant.test similarity index 100% rename from mysql-test/main/events_grant.test rename to mysql-test/suite/events/events_grant.test diff --git a/mysql-test/main/events_logs_tests-master.opt b/mysql-test/suite/events/events_logs_tests-master.opt similarity index 100% rename from mysql-test/main/events_logs_tests-master.opt rename to mysql-test/suite/events/events_logs_tests-master.opt diff --git a/mysql-test/main/events_logs_tests.result b/mysql-test/suite/events/events_logs_tests.result similarity index 100% rename from mysql-test/main/events_logs_tests.result rename to mysql-test/suite/events/events_logs_tests.result diff --git a/mysql-test/main/events_logs_tests.test b/mysql-test/suite/events/events_logs_tests.test similarity index 100% rename from mysql-test/main/events_logs_tests.test rename to mysql-test/suite/events/events_logs_tests.test diff --git a/mysql-test/main/events_microsec.result b/mysql-test/suite/events/events_microsec.result similarity index 100% rename from mysql-test/main/events_microsec.result rename to mysql-test/suite/events/events_microsec.result diff --git a/mysql-test/main/events_microsec.test b/mysql-test/suite/events/events_microsec.test similarity index 100% rename from mysql-test/main/events_microsec.test rename to mysql-test/suite/events/events_microsec.test diff --git a/mysql-test/main/events_restart-master.opt b/mysql-test/suite/events/events_restart-master.opt similarity index 100% rename from mysql-test/main/events_restart-master.opt rename to mysql-test/suite/events/events_restart-master.opt diff --git a/mysql-test/main/events_restart.result b/mysql-test/suite/events/events_restart.result similarity index 100% rename from mysql-test/main/events_restart.result rename to mysql-test/suite/events/events_restart.result diff --git a/mysql-test/main/events_restart.test b/mysql-test/suite/events/events_restart.test similarity index 100% rename from mysql-test/main/events_restart.test rename to mysql-test/suite/events/events_restart.test diff --git a/mysql-test/main/events_scheduling.result b/mysql-test/suite/events/events_scheduling.result similarity index 100% rename from mysql-test/main/events_scheduling.result rename to mysql-test/suite/events/events_scheduling.result diff --git a/mysql-test/main/events_scheduling.test b/mysql-test/suite/events/events_scheduling.test similarity index 100% rename from mysql-test/main/events_scheduling.test rename to mysql-test/suite/events/events_scheduling.test diff --git a/mysql-test/main/events_slowlog.result b/mysql-test/suite/events/events_slowlog.result similarity index 100% rename from mysql-test/main/events_slowlog.result rename to mysql-test/suite/events/events_slowlog.result diff --git a/mysql-test/main/events_slowlog.test b/mysql-test/suite/events/events_slowlog.test similarity index 100% rename from mysql-test/main/events_slowlog.test rename to mysql-test/suite/events/events_slowlog.test diff --git a/mysql-test/main/events_stress.result b/mysql-test/suite/events/events_stress.result similarity index 100% rename from mysql-test/main/events_stress.result rename to mysql-test/suite/events/events_stress.result diff --git a/mysql-test/main/events_stress.test b/mysql-test/suite/events/events_stress.test similarity index 100% rename from mysql-test/main/events_stress.test rename to mysql-test/suite/events/events_stress.test diff --git a/mysql-test/main/events_time_zone.result b/mysql-test/suite/events/events_time_zone.result similarity index 100% rename from mysql-test/main/events_time_zone.result rename to mysql-test/suite/events/events_time_zone.result diff --git a/mysql-test/main/events_time_zone.test b/mysql-test/suite/events/events_time_zone.test similarity index 100% rename from mysql-test/main/events_time_zone.test rename to mysql-test/suite/events/events_time_zone.test diff --git a/mysql-test/main/events_trans.result b/mysql-test/suite/events/events_trans.result similarity index 100% rename from mysql-test/main/events_trans.result rename to mysql-test/suite/events/events_trans.result diff --git a/mysql-test/main/events_trans.test b/mysql-test/suite/events/events_trans.test similarity index 100% rename from mysql-test/main/events_trans.test rename to mysql-test/suite/events/events_trans.test diff --git a/mysql-test/main/events_trans_notembedded.result b/mysql-test/suite/events/events_trans_notembedded.result similarity index 100% rename from mysql-test/main/events_trans_notembedded.result rename to mysql-test/suite/events/events_trans_notembedded.result diff --git a/mysql-test/main/events_trans_notembedded.test b/mysql-test/suite/events/events_trans_notembedded.test similarity index 100% rename from mysql-test/main/events_trans_notembedded.test rename to mysql-test/suite/events/events_trans_notembedded.test From 63df43a0e830c6b54178574e4f72f21d19ed765e Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 13 Apr 2023 13:55:28 +0300 Subject: [PATCH 228/260] Removed temporary test file that should not have been pushed --- mysql-test/main/skr.result | 54 ------------------------------------ mysql-test/main/skr.test | 56 -------------------------------------- 2 files changed, 110 deletions(-) delete mode 100644 mysql-test/main/skr.result delete mode 100644 mysql-test/main/skr.test diff --git a/mysql-test/main/skr.result b/mysql-test/main/skr.result deleted file mode 100644 index 291377573bc..00000000000 --- a/mysql-test/main/skr.result +++ /dev/null @@ -1,54 +0,0 @@ -# -# MDEV-23406: query with mutually recursive CTEs when big_tables=1 -# -set @save_big_tables=@@big_tables; -set big_tables=1; -Warnings: -Warning 1287 '@@big_tables' is deprecated and will be removed in a future release -create table folks(id int, name char(32), dob date, father int, mother int); -insert into folks values -(100, 'Me', '2000-01-01', 20, 30), -(20, 'Dad', '1970-02-02', 10, 9), -(30, 'Mom', '1975-03-03', 8, 7), -(10, 'Grandpa Bill', '1940-04-05', null, null), -(9, 'Grandma Ann', '1941-10-15', null, null), -(25, 'Uncle Jim', '1968-11-18', 8, 7), -(98, 'Sister Amy', '2001-06-20', 20, 30), -(7, 'Grandma Sally', '1943-08-23', null, 6), -(8, 'Grandpa Ben', '1940-10-21', null, null), -(6, 'Grandgrandma Martha', '1923-05-17', null, null), -(67, 'Cousin Eddie', '1992-02-28', 25, 27), -(27, 'Auntie Melinda', '1971-03-29', null, null); -with recursive -ancestor_couples(h_id, h_name, h_dob, h_father, h_mother, -w_id, w_name, w_dob, w_father, w_mother) -as -( -select h.*, w.* -from folks h, folks w, coupled_ancestors a -where a.father = h.id AND a.mother = w.id -union -select h.*, w.* -from folks v, folks h, folks w -where v.name = 'Me' and -(v.father = h.id AND v.mother= w.id) -), -coupled_ancestors (id, name, dob, father, mother) -as -( -select h_id, h_name, h_dob, h_father, h_mother -from ancestor_couples -union -select w_id, w_name, w_dob, w_father, w_mother -from ancestor_couples -) -select h_name, h_dob, w_name, w_dob -from ancestor_couples; -h_name h_dob w_name w_dob -Dad 1970-02-02 Mom 1975-03-03 -Grandpa Bill 1940-04-05 Grandma Ann 1941-10-15 -Grandpa Ben 1940-10-21 Grandma Sally 1943-08-23 -drop table folks; -set big_tables=@save_big_tables; -Warnings: -Warning 1287 '@@big_tables' is deprecated and will be removed in a future release diff --git a/mysql-test/main/skr.test b/mysql-test/main/skr.test deleted file mode 100644 index 3094faff696..00000000000 --- a/mysql-test/main/skr.test +++ /dev/null @@ -1,56 +0,0 @@ ---source include/default_optimizer_switch.inc - ---echo # ---echo # MDEV-23406: query with mutually recursive CTEs when big_tables=1 ---echo # - -set @save_big_tables=@@big_tables; -set big_tables=1; - -create table folks(id int, name char(32), dob date, father int, mother int); - -insert into folks values -(100, 'Me', '2000-01-01', 20, 30), -(20, 'Dad', '1970-02-02', 10, 9), -(30, 'Mom', '1975-03-03', 8, 7), -(10, 'Grandpa Bill', '1940-04-05', null, null), -(9, 'Grandma Ann', '1941-10-15', null, null), -(25, 'Uncle Jim', '1968-11-18', 8, 7), -(98, 'Sister Amy', '2001-06-20', 20, 30), -(7, 'Grandma Sally', '1943-08-23', null, 6), -(8, 'Grandpa Ben', '1940-10-21', null, null), -(6, 'Grandgrandma Martha', '1923-05-17', null, null), -(67, 'Cousin Eddie', '1992-02-28', 25, 27), -(27, 'Auntie Melinda', '1971-03-29', null, null); - -let q= -with recursive -ancestor_couples(h_id, h_name, h_dob, h_father, h_mother, - w_id, w_name, w_dob, w_father, w_mother) -as -( - select h.*, w.* - from folks h, folks w, coupled_ancestors a - where a.father = h.id AND a.mother = w.id - union - select h.*, w.* - from folks v, folks h, folks w - where v.name = 'Me' and - (v.father = h.id AND v.mother= w.id) -), -coupled_ancestors (id, name, dob, father, mother) -as -( - select h_id, h_name, h_dob, h_father, h_mother - from ancestor_couples - union - select w_id, w_name, w_dob, w_father, w_mother - from ancestor_couples -) -select h_name, h_dob, w_name, w_dob - from ancestor_couples; - -eval $q; -drop table folks; - -set big_tables=@save_big_tables; From 62ec258f100ee8fd3072275decd03e39d81fe286 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Thu, 4 May 2023 08:05:40 +0200 Subject: [PATCH 229/260] Fix of selectivity test to behave correctly with embedded and view protocols. --- mysql-test/main/selectivity.result | 69 ---------- mysql-test/main/selectivity.test | 84 +----------- mysql-test/main/selectivity_innodb.result | 67 ---------- .../selectivity_innodb_notembedded.result | 100 +++++++++++++++ .../main/selectivity_innodb_notembedded.test | 16 +++ .../main/selectivity_notembedded.result | 95 ++++++++++++++ mysql-test/main/selectivity_notembedded.test | 121 ++++++++++++++++++ 7 files changed, 335 insertions(+), 217 deletions(-) create mode 100644 mysql-test/main/selectivity_innodb_notembedded.result create mode 100644 mysql-test/main/selectivity_innodb_notembedded.test create mode 100644 mysql-test/main/selectivity_notembedded.result create mode 100644 mysql-test/main/selectivity_notembedded.test diff --git a/mysql-test/main/selectivity.result b/mysql-test/main/selectivity.result index 7d7343847cd..a6866e55b13 100644 --- a/mysql-test/main/selectivity.result +++ b/mysql-test/main/selectivity.result @@ -1937,75 +1937,6 @@ Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 DROP TABLE t1; # End of 10.2 tests -# -# MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram -# -create table t0(a int); -insert into t0 select 1 from seq_1_to_78; -create table t1(a int); -insert into t1 select 1 from seq_1_to_26; -create table t10 (a int); -insert into t10 select 0 from t0, seq_1_to_4; -insert into t10 select 8693 from t1; -insert into t10 select 8694 from t1; -insert into t10 select 8695 from t1; -insert into t10 select 34783 from t1; -insert into t10 select 34784 from t1; -insert into t10 select 34785 from t1; -insert into t10 select 34785 from t0, seq_1_to_8; -insert into t10 select 65214 from t1; -insert into t10 select 65215 from t1; -insert into t10 select 65216 from t1; -insert into t10 select 65216 from t0, seq_1_to_52; -insert into t10 select 65217 from t1; -insert into t10 select 65218 from t1; -insert into t10 select 65219 from t1; -insert into t10 select 65219 from t0; -insert into t10 select 73913 from t1; -insert into t10 select 73914 from t1; -insert into t10 select 73915 from t1; -insert into t10 select 73915 from t0, seq_1_to_40; -insert into t10 select 78257 from t1; -insert into t10 select 78258 from t1; -insert into t10 select 78259 from t1; -insert into t10 select 91300 from t1; -insert into t10 select 91301 from t1; -insert into t10 select 91302 from t1; -insert into t10 select 91302 from t0, seq_1_to_6; -insert into t10 select 91303 from t1; -insert into t10 select 91304 from t1; -insert into t10 select 91305 from t1; -insert into t10 select 91305 from t0, seq_1_to_8; -insert into t10 select 99998 from t1; -insert into t10 select 99999 from t1; -insert into t10 select 100000 from t1; -set use_stat_tables=preferably; -analyze table t10 persistent for all; -Table Op Msg_type Msg_text -test.t10 analyze status Engine-independent statistics collected -test.t10 analyze status OK -flush tables; -set @tmp=@@optimizer_trace; -set optimizer_trace=1; -explain select * from t10 where a in (91303); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t10 ALL NULL NULL NULL NULL 9984 Using where -# Must have selectivity_from_histogram <= 1.0: -select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) -from information_schema.optimizer_trace; -json_detailed(json_extract(trace, '$**.selectivity_for_columns')) -[ - [ - { - "column_name": "a", - "ranges": - ["91303 <= a <= 91303"], - "selectivity_from_histogram": 0.0357 - } - ] -] -set optimizer_trace=@tmp; -drop table t0,t1,t10; set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; set histogram_size=@save_histogram_size; set use_stat_tables= @save_use_stat_tables; diff --git a/mysql-test/main/selectivity.test b/mysql-test/main/selectivity.test index 06a3e32da95..b0c440718d1 100644 --- a/mysql-test/main/selectivity.test +++ b/mysql-test/main/selectivity.test @@ -1324,90 +1324,12 @@ DROP TABLE t1; --echo # End of 10.2 tests ---echo # ---echo # MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram ---echo # -create table t0(a int); # This holds how many rows we hold in a bucket. -insert into t0 select 1 from seq_1_to_78; -create table t1(a int); # one-third of a bucket -insert into t1 select 1 from seq_1_to_26; - -create table t10 (a int); -insert into t10 select 0 from t0, seq_1_to_4; - -insert into t10 select 8693 from t1; -insert into t10 select 8694 from t1; -insert into t10 select 8695 from t1; - - -insert into t10 select 34783 from t1; -insert into t10 select 34784 from t1; -insert into t10 select 34785 from t1; - - -insert into t10 select 34785 from t0, seq_1_to_8; - -insert into t10 select 65214 from t1; -insert into t10 select 65215 from t1; -insert into t10 select 65216 from t1; - -insert into t10 select 65216 from t0, seq_1_to_52; - -insert into t10 select 65217 from t1; -insert into t10 select 65218 from t1; -insert into t10 select 65219 from t1; - -insert into t10 select 65219 from t0; - - -insert into t10 select 73913 from t1; -insert into t10 select 73914 from t1; -insert into t10 select 73915 from t1; - -insert into t10 select 73915 from t0, seq_1_to_40; - - -insert into t10 select 78257 from t1; -insert into t10 select 78258 from t1; -insert into t10 select 78259 from t1; - -insert into t10 select 91300 from t1; -insert into t10 select 91301 from t1; -insert into t10 select 91302 from t1; - -insert into t10 select 91302 from t0, seq_1_to_6; - -insert into t10 select 91303 from t1; # Only 1/3rd of bucket matches the search tuple -insert into t10 select 91304 from t1; -insert into t10 select 91305 from t1; - -insert into t10 select 91305 from t0, seq_1_to_8; - -insert into t10 select 99998 from t1; -insert into t10 select 99999 from t1; -insert into t10 select 100000 from t1; - -set use_stat_tables=preferably; -analyze table t10 persistent for all; -flush tables; - -set @tmp=@@optimizer_trace; -set optimizer_trace=1; -explain select * from t10 where a in (91303); - ---echo # Must have selectivity_from_histogram <= 1.0: -select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) -from information_schema.optimizer_trace; - -set optimizer_trace=@tmp; -drop table t0,t1,t10; - -set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; -set histogram_size=@save_histogram_size; -set use_stat_tables= @save_use_stat_tables; # # Clean up # +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +set histogram_size=@save_histogram_size; +set use_stat_tables= @save_use_stat_tables; --source include/restore_charset.inc set @@global.histogram_size=@save_histogram_size; diff --git a/mysql-test/main/selectivity_innodb.result b/mysql-test/main/selectivity_innodb.result index dfba12f2b05..13816f8185c 100644 --- a/mysql-test/main/selectivity_innodb.result +++ b/mysql-test/main/selectivity_innodb.result @@ -1947,73 +1947,6 @@ Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 DROP TABLE t1; # End of 10.2 tests -# -# MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram -# -create table t0(a int); -insert into t0 select 1 from seq_1_to_78; -create table t1(a int); -insert into t1 select 1 from seq_1_to_26; -create table t10 (a int); -insert into t10 select 0 from t0, seq_1_to_4; -insert into t10 select 8693 from t1; -insert into t10 select 8694 from t1; -insert into t10 select 8695 from t1; -insert into t10 select 34783 from t1; -insert into t10 select 34784 from t1; -insert into t10 select 34785 from t1; -insert into t10 select 34785 from t0, seq_1_to_8; -insert into t10 select 65214 from t1; -insert into t10 select 65215 from t1; -insert into t10 select 65216 from t1; -insert into t10 select 65216 from t0, seq_1_to_52; -insert into t10 select 65217 from t1; -insert into t10 select 65218 from t1; -insert into t10 select 65219 from t1; -insert into t10 select 65219 from t0; -insert into t10 select 73913 from t1; -insert into t10 select 73914 from t1; -insert into t10 select 73915 from t1; -insert into t10 select 73915 from t0, seq_1_to_40; -insert into t10 select 78257 from t1; -insert into t10 select 78258 from t1; -insert into t10 select 78259 from t1; -insert into t10 select 91300 from t1; -insert into t10 select 91301 from t1; -insert into t10 select 91302 from t1; -insert into t10 select 91302 from t0, seq_1_to_6; -insert into t10 select 91303 from t1; -insert into t10 select 91304 from t1; -insert into t10 select 91305 from t1; -insert into t10 select 91305 from t0, seq_1_to_8; -insert into t10 select 99998 from t1; -insert into t10 select 99999 from t1; -insert into t10 select 100000 from t1; -set use_stat_tables=preferably; -analyze table t10 persistent for all; -Table Op Msg_type Msg_text -test.t10 analyze status Engine-independent statistics collected -test.t10 analyze status OK -flush tables; -set statement optimizer_trace=1 for -explain select * from t10 where a in (91303); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t10 ALL NULL NULL NULL NULL 9984 Using where -# Must have selectivity_from_histogram <= 1.0: -select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) -from information_schema.optimizer_trace; -json_detailed(json_extract(trace, '$**.selectivity_for_columns')) -[ - [ - { - "column_name": "a", - "ranges": - ["91303 <= a <= 91303"], - "selectivity_from_histogram": 0.035714283 - } - ] -] -drop table t0,t1,t10; set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; set histogram_size=@save_histogram_size; set use_stat_tables= @save_use_stat_tables; diff --git a/mysql-test/main/selectivity_innodb_notembedded.result b/mysql-test/main/selectivity_innodb_notembedded.result new file mode 100644 index 00000000000..013f9196031 --- /dev/null +++ b/mysql-test/main/selectivity_innodb_notembedded.result @@ -0,0 +1,100 @@ +SET SESSION STORAGE_ENGINE='InnoDB'; +set @save_optimizer_switch_for_selectivity_test=@@optimizer_switch; +set optimizer_switch='extended_keys=on'; +drop table if exists t0,t1,t2,t3; +select @@global.use_stat_tables; +@@global.use_stat_tables +COMPLEMENTARY +select @@session.use_stat_tables; +@@session.use_stat_tables +COMPLEMENTARY +set @save_use_stat_tables=@@use_stat_tables; +set use_stat_tables='preferably'; +set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity; +set @save_histogram_size=@@histogram_size; +set @save_histogram_type=@@histogram_type; +set join_cache_level=2; +set @@global.histogram_size=0,@@local.histogram_size=0; +set histogram_type='single_prec_hb'; +set optimizer_use_condition_selectivity=3; +# +# MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram +# +create table t0(a int); +insert into t0 select 1 from seq_1_to_78; +create table t1(a int); +insert into t1 select 1 from seq_1_to_26; +create table t10 (a int); +insert into t10 select 0 from t0, seq_1_to_4; +insert into t10 select 8693 from t1; +insert into t10 select 8694 from t1; +insert into t10 select 8695 from t1; +insert into t10 select 34783 from t1; +insert into t10 select 34784 from t1; +insert into t10 select 34785 from t1; +insert into t10 select 34785 from t0, seq_1_to_8; +insert into t10 select 65214 from t1; +insert into t10 select 65215 from t1; +insert into t10 select 65216 from t1; +insert into t10 select 65216 from t0, seq_1_to_52; +insert into t10 select 65217 from t1; +insert into t10 select 65218 from t1; +insert into t10 select 65219 from t1; +insert into t10 select 65219 from t0; +insert into t10 select 73913 from t1; +insert into t10 select 73914 from t1; +insert into t10 select 73915 from t1; +insert into t10 select 73915 from t0, seq_1_to_40; +insert into t10 select 78257 from t1; +insert into t10 select 78258 from t1; +insert into t10 select 78259 from t1; +insert into t10 select 91300 from t1; +insert into t10 select 91301 from t1; +insert into t10 select 91302 from t1; +insert into t10 select 91302 from t0, seq_1_to_6; +insert into t10 select 91303 from t1; +insert into t10 select 91304 from t1; +insert into t10 select 91305 from t1; +insert into t10 select 91305 from t0, seq_1_to_8; +insert into t10 select 99998 from t1; +insert into t10 select 99999 from t1; +insert into t10 select 100000 from t1; +set use_stat_tables=preferably; +analyze table t10 persistent for all; +Table Op Msg_type Msg_text +test.t10 analyze status Engine-independent statistics collected +test.t10 analyze status OK +flush tables; +set @tmp=@@optimizer_trace; +set optimizer_trace=1; +explain select * from t10 where a in (91303); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t10 ALL NULL NULL NULL NULL 9984 Using where +# Must have selectivity_from_histogram <= 1.0: +select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) as sel +from information_schema.optimizer_trace; +sel +[ + [ + { + "column_name": "a", + "ranges": + ["91303 <= a <= 91303"], + "selectivity_from_histogram": 0.0357 + } + ] +] +set optimizer_trace=@tmp; +drop table t0,t1,t10; +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +set histogram_size=@save_histogram_size; +set use_stat_tables= @save_use_stat_tables; +# +# End of 10.4 tests +# +# +# Clean up +# +set @@global.histogram_size=@save_histogram_size; +set optimizer_switch=@save_optimizer_switch_for_selectivity_test; +SET SESSION STORAGE_ENGINE=DEFAULT; diff --git a/mysql-test/main/selectivity_innodb_notembedded.test b/mysql-test/main/selectivity_innodb_notembedded.test new file mode 100644 index 00000000000..387f7dcb7de --- /dev/null +++ b/mysql-test/main/selectivity_innodb_notembedded.test @@ -0,0 +1,16 @@ +--source include/have_innodb.inc +# This test is slow on buildbot. +--source include/big_test.inc +--source include/default_optimizer_switch.inc +--source include/not_embedded.inc + +SET SESSION STORAGE_ENGINE='InnoDB'; + +set @save_optimizer_switch_for_selectivity_test=@@optimizer_switch; +set optimizer_switch='extended_keys=on'; + +--source selectivity_notembedded.test + +set optimizer_switch=@save_optimizer_switch_for_selectivity_test; + +SET SESSION STORAGE_ENGINE=DEFAULT; diff --git a/mysql-test/main/selectivity_notembedded.result b/mysql-test/main/selectivity_notembedded.result new file mode 100644 index 00000000000..7388c17e991 --- /dev/null +++ b/mysql-test/main/selectivity_notembedded.result @@ -0,0 +1,95 @@ +drop table if exists t0,t1,t2,t3; +select @@global.use_stat_tables; +@@global.use_stat_tables +COMPLEMENTARY +select @@session.use_stat_tables; +@@session.use_stat_tables +COMPLEMENTARY +set @save_use_stat_tables=@@use_stat_tables; +set use_stat_tables='preferably'; +set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity; +set @save_histogram_size=@@histogram_size; +set @save_histogram_type=@@histogram_type; +set join_cache_level=2; +set @@global.histogram_size=0,@@local.histogram_size=0; +set histogram_type='single_prec_hb'; +set optimizer_use_condition_selectivity=3; +# +# MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram +# +create table t0(a int); +insert into t0 select 1 from seq_1_to_78; +create table t1(a int); +insert into t1 select 1 from seq_1_to_26; +create table t10 (a int); +insert into t10 select 0 from t0, seq_1_to_4; +insert into t10 select 8693 from t1; +insert into t10 select 8694 from t1; +insert into t10 select 8695 from t1; +insert into t10 select 34783 from t1; +insert into t10 select 34784 from t1; +insert into t10 select 34785 from t1; +insert into t10 select 34785 from t0, seq_1_to_8; +insert into t10 select 65214 from t1; +insert into t10 select 65215 from t1; +insert into t10 select 65216 from t1; +insert into t10 select 65216 from t0, seq_1_to_52; +insert into t10 select 65217 from t1; +insert into t10 select 65218 from t1; +insert into t10 select 65219 from t1; +insert into t10 select 65219 from t0; +insert into t10 select 73913 from t1; +insert into t10 select 73914 from t1; +insert into t10 select 73915 from t1; +insert into t10 select 73915 from t0, seq_1_to_40; +insert into t10 select 78257 from t1; +insert into t10 select 78258 from t1; +insert into t10 select 78259 from t1; +insert into t10 select 91300 from t1; +insert into t10 select 91301 from t1; +insert into t10 select 91302 from t1; +insert into t10 select 91302 from t0, seq_1_to_6; +insert into t10 select 91303 from t1; +insert into t10 select 91304 from t1; +insert into t10 select 91305 from t1; +insert into t10 select 91305 from t0, seq_1_to_8; +insert into t10 select 99998 from t1; +insert into t10 select 99999 from t1; +insert into t10 select 100000 from t1; +set use_stat_tables=preferably; +analyze table t10 persistent for all; +Table Op Msg_type Msg_text +test.t10 analyze status Engine-independent statistics collected +test.t10 analyze status OK +flush tables; +set @tmp=@@optimizer_trace; +set optimizer_trace=1; +explain select * from t10 where a in (91303); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t10 ALL NULL NULL NULL NULL 9984 Using where +# Must have selectivity_from_histogram <= 1.0: +select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) as sel +from information_schema.optimizer_trace; +sel +[ + [ + { + "column_name": "a", + "ranges": + ["91303 <= a <= 91303"], + "selectivity_from_histogram": 0.0357 + } + ] +] +set optimizer_trace=@tmp; +drop table t0,t1,t10; +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +set histogram_size=@save_histogram_size; +set use_stat_tables= @save_use_stat_tables; +# +# End of 10.4 tests +# +# +# Clean up +# +set @@global.histogram_size=@save_histogram_size; diff --git a/mysql-test/main/selectivity_notembedded.test b/mysql-test/main/selectivity_notembedded.test new file mode 100644 index 00000000000..6752bd3c7e1 --- /dev/null +++ b/mysql-test/main/selectivity_notembedded.test @@ -0,0 +1,121 @@ +--source include/no_valgrind_without_big.inc +--source include/have_stat_tables.inc +--source include/have_sequence.inc +--source include/default_charset.inc +--source include/not_embedded.inc + +--disable_warnings +drop table if exists t0,t1,t2,t3; +--enable_warnings + +select @@global.use_stat_tables; +select @@session.use_stat_tables; + +set @save_use_stat_tables=@@use_stat_tables; +set use_stat_tables='preferably'; + +--source include/default_optimizer_switch.inc +set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity; +set @save_histogram_size=@@histogram_size; +set @save_histogram_type=@@histogram_type; +set join_cache_level=2; +set @@global.histogram_size=0,@@local.histogram_size=0; +set histogram_type='single_prec_hb'; + +# check that statistics on nulls is used + +set optimizer_use_condition_selectivity=3; + +--echo # +--echo # MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram +--echo # +create table t0(a int); # This holds how many rows we hold in a bucket. +insert into t0 select 1 from seq_1_to_78; + +create table t1(a int); # one-third of a bucket +insert into t1 select 1 from seq_1_to_26; + +create table t10 (a int); +insert into t10 select 0 from t0, seq_1_to_4; + +insert into t10 select 8693 from t1; +insert into t10 select 8694 from t1; +insert into t10 select 8695 from t1; + + +insert into t10 select 34783 from t1; +insert into t10 select 34784 from t1; +insert into t10 select 34785 from t1; + + +insert into t10 select 34785 from t0, seq_1_to_8; + +insert into t10 select 65214 from t1; +insert into t10 select 65215 from t1; +insert into t10 select 65216 from t1; + +insert into t10 select 65216 from t0, seq_1_to_52; + +insert into t10 select 65217 from t1; +insert into t10 select 65218 from t1; +insert into t10 select 65219 from t1; + +insert into t10 select 65219 from t0; + + +insert into t10 select 73913 from t1; +insert into t10 select 73914 from t1; +insert into t10 select 73915 from t1; + +insert into t10 select 73915 from t0, seq_1_to_40; + + +insert into t10 select 78257 from t1; +insert into t10 select 78258 from t1; +insert into t10 select 78259 from t1; + +insert into t10 select 91300 from t1; +insert into t10 select 91301 from t1; +insert into t10 select 91302 from t1; + +insert into t10 select 91302 from t0, seq_1_to_6; + +insert into t10 select 91303 from t1; # Only 1/3rd of bucket matches the search tuple +insert into t10 select 91304 from t1; +insert into t10 select 91305 from t1; + +insert into t10 select 91305 from t0, seq_1_to_8; + +insert into t10 select 99998 from t1; +insert into t10 select 99999 from t1; +insert into t10 select 100000 from t1; + +set use_stat_tables=preferably; +analyze table t10 persistent for all; +flush tables; + +set @tmp=@@optimizer_trace; +set optimizer_trace=1; +explain select * from t10 where a in (91303); + +--echo # Must have selectivity_from_histogram <= 1.0: +select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) as sel +from information_schema.optimizer_trace; + +set optimizer_trace=@tmp; +drop table t0,t1,t10; + +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +set histogram_size=@save_histogram_size; +set use_stat_tables= @save_use_stat_tables; + + +--echo # +--echo # End of 10.4 tests +--echo # + +--echo # +--echo # Clean up +--echo # +--source include/restore_charset.inc +set @@global.histogram_size=@save_histogram_size; From f5e7c56e3254271a434253ae1367a7be7c429f94 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Thu, 4 May 2023 08:11:00 +0200 Subject: [PATCH 230/260] MDEV-31181 Server crash in subselect_uniquesubquery_engine::print upon EXPLAIN EXTENDED DELETE Temporary fix to avoid the server crash. --- mysql-test/main/explain_innodb.result | 18 ++++++++++++++++++ mysql-test/main/explain_innodb.test | 19 +++++++++++++++++++ sql/item_subselect.cc | 6 ++++++ 3 files changed, 43 insertions(+) diff --git a/mysql-test/main/explain_innodb.result b/mysql-test/main/explain_innodb.result index fe51e45e35d..255299cedb9 100644 --- a/mysql-test/main/explain_innodb.result +++ b/mysql-test/main/explain_innodb.result @@ -18,3 +18,21 @@ id select_type table type possible_keys key key_len ref rows Extra 2 DERIVED t1 index NULL id 53 NULL 1 Using index SET GLOBAL slow_query_log = @sql_tmp; drop table t1; +# +# MDEV-31181: Server crash in subselect_uniquesubquery_engine::print +# upon EXPLAIN EXTENDED DELETE +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (pk INT PRIMARY KEY); +INSERT INTO t2 VALUES (1),(2); +EXPLAIN EXTENDED DELETE FROM t1 WHERE a IN (SELECT pk FROM t2); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where +2 DEPENDENT SUBQUERY t2 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ delete from `test`.`t1` where (`test`.`t1`.`a`,(((`test`.`t1`.`a`)))) +drop table t1, t2; +# +# End of 10.4 tests +# diff --git a/mysql-test/main/explain_innodb.test b/mysql-test/main/explain_innodb.test index 2c29a6e26da..3dcad4c2d49 100644 --- a/mysql-test/main/explain_innodb.test +++ b/mysql-test/main/explain_innodb.test @@ -18,3 +18,22 @@ SELECT * FROM (SELECT id FROM t1 GROUP BY id) dt WHERE 1=0; SET GLOBAL slow_query_log = @sql_tmp; drop table t1; + + +--echo # +--echo # MDEV-31181: Server crash in subselect_uniquesubquery_engine::print +--echo # upon EXPLAIN EXTENDED DELETE +--echo # + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (pk INT PRIMARY KEY); +INSERT INTO t2 VALUES (1),(2); + +EXPLAIN EXTENDED DELETE FROM t1 WHERE a IN (SELECT pk FROM t2); + +drop table t1, t2; + +--echo # +--echo # End of 10.4 tests +--echo # diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index f88e1e7e101..a4a36d96ccc 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -4538,6 +4538,12 @@ void subselect_uniquesubquery_engine::print(String *str, { str->append(STRING_WITH_LEN("(")); tab->ref.items[0]->print(str, query_type); + if (!tab->table) + { + // table is not opened so unknown + str->append(')'); + return; + } str->append(STRING_WITH_LEN(" in ")); if (tab->table->s->table_category == TABLE_CATEGORY_TEMPORARY) { From 4d6e458f9f3956931b7c4c093fb9a0775faa9931 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 3 May 2023 15:37:05 +0200 Subject: [PATCH 231/260] MDEV-31164 default current_timestamp() not working when used INSERT ON DUPLICATE KEY in some cases select_insert::store_values() must reset has_value_set bitmap before every row, just like mysql_insert() does. because ON DUPLICATE KEY UPDATE and triggers modify it --- mysql-test/main/insert_update.result | 41 ++++++++++++++++++++++++++++ mysql-test/main/insert_update.test | 26 ++++++++++++++++++ sql/sql_insert.cc | 1 + 3 files changed, 68 insertions(+) diff --git a/mysql-test/main/insert_update.result b/mysql-test/main/insert_update.result index 68a1003ad85..83344971c59 100644 --- a/mysql-test/main/insert_update.result +++ b/mysql-test/main/insert_update.result @@ -412,3 +412,44 @@ select if( @stamp1 = @stamp2, "correct", "wrong"); if( @stamp1 = @stamp2, "correct", "wrong") correct drop table t1; +# +# MDEV-31164 default current_timestamp() not working when used INSERT ON DUPLICATE KEY in some cases +# +set timestamp=unix_timestamp('2000-10-20 0:0:0'); +create table t1 (pk integer primary key, val varchar(20) not null, ts timestamp); +insert t1 (pk, val) values(1, 'val1'); +select * from t1; +pk val ts +1 val1 2000-10-20 00:00:00 +set timestamp=unix_timestamp('2000-10-20 1:0:0'); +insert t1 (pk, val) select 2, 'val3' union select 3, 'val4' + on duplicate key update ts=now(); +select * from t1; +pk val ts +1 val1 2000-10-20 00:00:00 +2 val3 2000-10-20 01:00:00 +3 val4 2000-10-20 01:00:00 +set timestamp=unix_timestamp('2000-10-20 2:0:0'); +insert t1 (pk, val) select 1, 'val1' union select 4, 'val2' + on duplicate key update ts=now(); +select * from t1; +pk val ts +1 val1 2000-10-20 02:00:00 +2 val3 2000-10-20 01:00:00 +3 val4 2000-10-20 01:00:00 +4 val2 2000-10-20 02:00:00 +set timestamp=unix_timestamp('2000-10-20 3:0:0'); +insert t1 (pk, val) select 5, 'val1' union select 1, 'val2' + on duplicate key update ts=now(); +select * from t1; +pk val ts +1 val1 2000-10-20 03:00:00 +2 val3 2000-10-20 01:00:00 +3 val4 2000-10-20 01:00:00 +4 val2 2000-10-20 02:00:00 +5 val1 2000-10-20 03:00:00 +drop table t1; +set timestamp=default; +# +# End of 10.4 tests +# diff --git a/mysql-test/main/insert_update.test b/mysql-test/main/insert_update.test index 06e16be84d7..25953938ad1 100644 --- a/mysql-test/main/insert_update.test +++ b/mysql-test/main/insert_update.test @@ -311,3 +311,29 @@ insert into t1(f1) values(1) on duplicate key update f1=1; select @stamp2:=f2 from t1; select if( @stamp1 = @stamp2, "correct", "wrong"); drop table t1; + +--echo # +--echo # MDEV-31164 default current_timestamp() not working when used INSERT ON DUPLICATE KEY in some cases +--echo # +set timestamp=unix_timestamp('2000-10-20 0:0:0'); +create table t1 (pk integer primary key, val varchar(20) not null, ts timestamp); +insert t1 (pk, val) values(1, 'val1'); +select * from t1; +set timestamp=unix_timestamp('2000-10-20 1:0:0'); +insert t1 (pk, val) select 2, 'val3' union select 3, 'val4' + on duplicate key update ts=now(); +select * from t1; +set timestamp=unix_timestamp('2000-10-20 2:0:0'); +insert t1 (pk, val) select 1, 'val1' union select 4, 'val2' + on duplicate key update ts=now(); +select * from t1; +set timestamp=unix_timestamp('2000-10-20 3:0:0'); +insert t1 (pk, val) select 5, 'val1' union select 1, 'val2' + on duplicate key update ts=now(); +select * from t1; +drop table t1; +set timestamp=default; + +--echo # +--echo # End of 10.4 tests +--echo # diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 424296efcf5..0f1b66f7610 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -4028,6 +4028,7 @@ bool select_insert::store_values(List &values) DBUG_ENTER("select_insert::store_values"); bool error; + table->reset_default_fields(); if (fields->elements) error= fill_record_n_invoke_before_triggers(thd, table, *fields, values, true, TRG_EVENT_INSERT); From cf4a16b5557be5fb3568c1de0d6cc0a18291afc9 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 4 May 2023 16:05:08 +0200 Subject: [PATCH 232/260] MDEV-31057 rocksdb does not compile with gcc-13 RocksDB (in a submodule) has to include to use uint64_t but it doesn't. Until the submodule is upgraded, let's replace problematic types with something that's available --- storage/rocksdb/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt index 15fc4dc735a..71259703e5a 100644 --- a/storage/rocksdb/CMakeLists.txt +++ b/storage/rocksdb/CMakeLists.txt @@ -30,6 +30,11 @@ IF(WITH_VALGRIND) ADD_DEFINITIONS(-DROCKSDB_VALGRIND_RUN=1) ENDIF() +ADD_DEFINITIONS(-Duint64_t=u_int64_t) +ADD_DEFINITIONS(-Duint32_t=u_int32_t) +ADD_DEFINITIONS(-Duint16_t=u_int16_t) +ADD_DEFINITIONS(-Duint8_t=u_int8_t) + # We've had our builders hang during the build process. This prevents MariaRocks # to be built on 32 bit intel OS kernels. IF(CMAKE_SYSTEM_PROCESSOR MATCHES "i[36]86") From 7973ffde0fede83049a1d611c379b9ee61dea9c9 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Thu, 4 May 2023 17:51:27 +0200 Subject: [PATCH 233/260] MDEV-31189 Server crash or assertion failure in upon 2nd execution of PS with views and HAVING Do not try to decide merge/materialize for derived if it was already decided (even if it is a view). --- mysql-test/main/view.result | 18 ++++++++++++++++++ mysql-test/main/view.test | 19 +++++++++++++++++++ sql/table.cc | 12 ++++++++---- 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/mysql-test/main/view.result b/mysql-test/main/view.result index 8c31545eb84..97d19aa2690 100644 --- a/mysql-test/main/view.result +++ b/mysql-test/main/view.result @@ -6956,4 +6956,22 @@ create algorithm=merge view v as select * from t1 left join t2 on t1.a=t2.b and t1.a in (select d from t3); ERROR 42S22: Unknown column 'd' in 'field list' drop table t1,t2,t3; +# +# MDEV-31189: Server crash or assertion failure in upon 2nd +# execution of PS with views and HAVING +# +CREATE TABLE t (f INT); +INSERT INTO t VALUES (1),(2); +CREATE VIEW v1 AS SELECT 1 AS a; +CREATE VIEW v2 AS SELECT a FROM v1; +PREPARE stmt FROM "SELECT * FROM v2 HAVING 1 IN (SELECT f FROM t)"; +EXECUTE stmt; +a +1 +EXECUTE stmt; +a +1 +DROP VIEW v1; +DROP VIEW v2; +DROP TABLE t; # End of 10.4 tests diff --git a/mysql-test/main/view.test b/mysql-test/main/view.test index 0e2dce1fb70..385ca523436 100644 --- a/mysql-test/main/view.test +++ b/mysql-test/main/view.test @@ -6696,4 +6696,23 @@ create algorithm=merge view v as drop table t1,t2,t3; +--echo # +--echo # MDEV-31189: Server crash or assertion failure in upon 2nd +--echo # execution of PS with views and HAVING +--echo # + +CREATE TABLE t (f INT); +INSERT INTO t VALUES (1),(2); # Optional, fails either way +CREATE VIEW v1 AS SELECT 1 AS a; +CREATE VIEW v2 AS SELECT a FROM v1; + +PREPARE stmt FROM "SELECT * FROM v2 HAVING 1 IN (SELECT f FROM t)"; +EXECUTE stmt; +EXECUTE stmt; + +# Cleanup +DROP VIEW v1; +DROP VIEW v2; +DROP TABLE t; + --echo # End of 10.4 tests diff --git a/sql/table.cc b/sql/table.cc index 15a92818b81..0f296a85e58 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -9163,8 +9163,13 @@ void TABLE_LIST::wrap_into_nested_join(List &join_list) static inline bool derived_table_optimization_done(TABLE_LIST *table) { - return table->derived && - (table->derived->is_excluded() || + SELECT_LEX_UNIT *derived= (table->derived ? + table->derived : + (table->view ? + &table->view->unit: + NULL)); + return derived && + (derived->is_excluded() || table->is_materialized_derived()); } @@ -9226,8 +9231,7 @@ bool TABLE_LIST::init_derived(THD *thd, bool init_view) set_derived(); } - if (is_view() || - !derived_table_optimization_done(this)) + if (!derived_table_optimization_done(this)) { /* A subquery might be forced to be materialized due to a side-effect. */ if (!is_materialized_derived() && unit->can_be_merged() && From 83fa03359f0359b666c074a5dde8ae87ad6bb515 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 4 May 2023 23:28:45 +0200 Subject: [PATCH 234/260] after merge: update the test for 10.10 because explicit_defaults_for_timestamp is now true --- mysql-test/main/insert_update.result | 3 ++- mysql-test/main/insert_update.test | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mysql-test/main/insert_update.result b/mysql-test/main/insert_update.result index 83344971c59..3cbc1944b5e 100644 --- a/mysql-test/main/insert_update.result +++ b/mysql-test/main/insert_update.result @@ -416,7 +416,8 @@ drop table t1; # MDEV-31164 default current_timestamp() not working when used INSERT ON DUPLICATE KEY in some cases # set timestamp=unix_timestamp('2000-10-20 0:0:0'); -create table t1 (pk integer primary key, val varchar(20) not null, ts timestamp); +create table t1 (pk integer primary key, val varchar(20) not null, ts timestamp +default current_timestamp on update current_timestamp); insert t1 (pk, val) values(1, 'val1'); select * from t1; pk val ts diff --git a/mysql-test/main/insert_update.test b/mysql-test/main/insert_update.test index 25953938ad1..bb56f04c532 100644 --- a/mysql-test/main/insert_update.test +++ b/mysql-test/main/insert_update.test @@ -316,7 +316,8 @@ drop table t1; --echo # MDEV-31164 default current_timestamp() not working when used INSERT ON DUPLICATE KEY in some cases --echo # set timestamp=unix_timestamp('2000-10-20 0:0:0'); -create table t1 (pk integer primary key, val varchar(20) not null, ts timestamp); +create table t1 (pk integer primary key, val varchar(20) not null, ts timestamp + default current_timestamp on update current_timestamp); insert t1 (pk, val) values(1, 'val1'); select * from t1; set timestamp=unix_timestamp('2000-10-20 1:0:0'); From 2594da7a33580bf03590502a011679c878487d0c Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Fri, 5 May 2023 11:16:23 +0300 Subject: [PATCH 235/260] MDEV-31194: Server crash or assertion failure with join_cache_level=4 The problem, introduced in patch for MDEV-26301: When check_join_cache_usage() decides not to use join buffer, it must adjust the access method accordingly. For BNL-H joins this means switching from pseudo-"ref access"(with index=MAX_KEY) to some other access method. Failing to do this will cause assertions down the line when code that is not aware of BNL-H will try to initialize index use for ref access with index=MAX_KEY. The fix is to follow the regular code path to disable the join buffer for the join_tab ("goto no_join_cache") instead of just returning from check_join_cache_usage(). --- mysql-test/main/derived_split_innodb.result | 16 ++++++++++++++ mysql-test/main/derived_split_innodb.test | 23 +++++++++++++++++++++ sql/sql_select.cc | 2 +- 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/mysql-test/main/derived_split_innodb.result b/mysql-test/main/derived_split_innodb.result index a2dd1470d15..736e6a2c020 100644 --- a/mysql-test/main/derived_split_innodb.result +++ b/mysql-test/main/derived_split_innodb.result @@ -794,4 +794,20 @@ a b a b a b grp_id count(*) 5 5 5 2 5 3 5 100 drop table t1,t2,t3; drop table t10, t11; +# +# MDEV-31194: Server crash or assertion failure with join_cache_level=4 +# (a followup to the above bug, MDEV-26301) +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (3),(4); +CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=Aria; +INSERT INTO t2 VALUES (1),(2); +set @tmp1= @@optimizer_switch, @tmp2= @@join_cache_level; +set +optimizer_switch= 'derived_with_keys=off', +join_cache_level= 4; +SELECT t1.* FROM t1 JOIN (SELECT id, COUNT(*) FROM t2 GROUP BY id) sq ON sq.id= t1.a; +a +set optimizer_switch= @tmp1, join_cache_level= @tmp2; +DROP TABLE t1, t2; # End of 10.4 tests diff --git a/mysql-test/main/derived_split_innodb.test b/mysql-test/main/derived_split_innodb.test index a26c9af4e64..b8dd5ad20e1 100644 --- a/mysql-test/main/derived_split_innodb.test +++ b/mysql-test/main/derived_split_innodb.test @@ -439,4 +439,27 @@ eval $q; drop table t1,t2,t3; drop table t10, t11; + +--echo # +--echo # MDEV-31194: Server crash or assertion failure with join_cache_level=4 +--echo # (a followup to the above bug, MDEV-26301) +--echo # +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (3),(4); + +CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=Aria; +INSERT INTO t2 VALUES (1),(2); + +set @tmp1= @@optimizer_switch, @tmp2= @@join_cache_level; +set + optimizer_switch= 'derived_with_keys=off', + join_cache_level= 4; + +SELECT t1.* FROM t1 JOIN (SELECT id, COUNT(*) FROM t2 GROUP BY id) sq ON sq.id= t1.a; + +set optimizer_switch= @tmp1, join_cache_level= @tmp2; + +# Cleanup +DROP TABLE t1, t2; + --echo # End of 10.4 tests diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5e2ce06add7..bfe17bb43e1 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -12873,7 +12873,7 @@ uint check_join_cache_usage(JOIN_TAB *tab, join->return_tab= 0; if (tab->no_forced_join_cache) - return 0; + goto no_join_cache; /* Don't use join cache if @@join_cache_level==0 or this table is the first From a24f2bb50ba4a0dd4127455f7fcdfed584937f36 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Fri, 5 May 2023 13:55:42 +0300 Subject: [PATCH 236/260] MDEV-31199: Assertion `field->table->stats_is_read' fails with hash_join_cardinality=on Derived table creation code would call Field::make_new_field() which would memcpy the Field object from the source table, including Field::read_stats. But the temp. table as a whole had table->stats_is_read=false. Which was correct but not consistent with Field::read_stats and caused an assertion. Fixed by making sure that Field::read_stats=NULL for fields in the new temporary (i.e. work) tables. --- mysql-test/main/selectivity_no_engine.result | 23 ++++++++++++++++++++ mysql-test/main/selectivity_no_engine.test | 20 +++++++++++++++++ sql/field.cc | 1 + 3 files changed, 44 insertions(+) diff --git a/mysql-test/main/selectivity_no_engine.result b/mysql-test/main/selectivity_no_engine.result index 8e0710a0bd6..00e2b8fc397 100644 --- a/mysql-test/main/selectivity_no_engine.result +++ b/mysql-test/main/selectivity_no_engine.result @@ -314,6 +314,29 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE a ALL NULL NULL NULL NULL 5 Using where 1 SIMPLE b hash_ALL NULL #hash#$hj 1341 test.a.Host,test.a.User,test.a.Password,test.a.Select_priv,test.a.Insert_priv,test.a.Update_priv,test.a.Delete_priv,test.a.Create_priv,test.a.Drop_priv,test.a.Reload_priv,test.a.Shutdown_priv,test.a.Process_priv,test.a.File_priv,test.a.Grant_priv,test.a.References_priv,test.a.Index_priv,test.a.Alter_priv,test.a.Show_db_priv,test.a.Super_priv,test.a.Create_tmp_table_priv,test.a.Lock_tables_priv,test.a.Execute_priv,test.a.Repl_slave_priv,test.a.Repl_client_priv,test.a.Create_view_priv,test.a.Show_view_priv,test.a.Create_routine_priv,test.a.Alter_routine_priv,test.a.Create_user_priv,test.a.Event_priv,test.a.Trigger_priv,test.a.Create_tablespace_priv,test.a.Delete_history_priv,test.a.ssl_type,test.a.ssl_cipher,test.a.x509_issuer,test.a.x509_subject,test.a.max_questions,test.a.max_updates,test.a.max_connections,test.a.max_user_connections,test.a.plugin,test.a.authentication_string,test.a.password_expired,test.a.is_role,test.a.default_role,test.a.max_statement_time 5 Using where; Using join buffer (flat, BNLH join) DROP TABLE t1,t2,t3; +# +# MDEV-31199: Assertion `field->table->stats_is_read' fails with hash_join_cardinality=on +# +CREATE TABLE t1 (a VARCHAR(255)); +INSERT INTO t1 VALUES ('u'),('uu'); +CREATE TABLE t2 (b VARCHAR(255)) CHARACTER SET utf8mb4; +INSERT INTO t2 VALUES ('x'),('xx'); +CREATE TABLE t3 (c VARCHAR(255)); +INSERT INTO t3 VALUES ('z'),('zz'); +ANALYZE TABLE t1, t2, t3 PERSISTENT FOR ALL; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status OK +test.t3 analyze status Engine-independent statistics collected +test.t3 analyze status OK +set @tmp1=@@optimizer_switch, @tmp2=@@join_cache_level; +set optimizer_switch='hash_join_cardinality=on', join_cache_level=3; +SELECT t1.* FROM t1 JOIN (SELECT DISTINCT b FROM t2 JOIN t3) sq ON sq.b = t1.a; +a +set optimizer_switch=@tmp1, join_cache_level=@tmp2; +DROP TABLE t1, t2, t3; # # End of the test file # diff --git a/mysql-test/main/selectivity_no_engine.test b/mysql-test/main/selectivity_no_engine.test index 5bc78e03781..47bac21a2e1 100644 --- a/mysql-test/main/selectivity_no_engine.test +++ b/mysql-test/main/selectivity_no_engine.test @@ -250,6 +250,26 @@ SELECT * FROM t1 AS a NATURAL JOIN t1 AS b; DROP TABLE t1,t2,t3; +--echo # +--echo # MDEV-31199: Assertion `field->table->stats_is_read' fails with hash_join_cardinality=on +--echo # +CREATE TABLE t1 (a VARCHAR(255)); +INSERT INTO t1 VALUES ('u'),('uu'); + +CREATE TABLE t2 (b VARCHAR(255)) CHARACTER SET utf8mb4; +INSERT INTO t2 VALUES ('x'),('xx'); + +CREATE TABLE t3 (c VARCHAR(255)); +INSERT INTO t3 VALUES ('z'),('zz'); + +ANALYZE TABLE t1, t2, t3 PERSISTENT FOR ALL; # Optional, fails either way + +set @tmp1=@@optimizer_switch, @tmp2=@@join_cache_level; +set optimizer_switch='hash_join_cardinality=on', join_cache_level=3; +SELECT t1.* FROM t1 JOIN (SELECT DISTINCT b FROM t2 JOIN t3) sq ON sq.b = t1.a; +set optimizer_switch=@tmp1, join_cache_level=@tmp2; +DROP TABLE t1, t2, t3; + --echo # --echo # End of the test file --echo # diff --git a/sql/field.cc b/sql/field.cc index 333a843f81c..f413d77be87 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -2503,6 +2503,7 @@ Field *Field::make_new_field(MEM_ROOT *root, TABLE *new_table, tmp->key_start.init(0); tmp->part_of_key.init(0); tmp->part_of_sortkey.init(0); + tmp->read_stats= NULL; /* TODO: it is not clear why this method needs to reset unireg_check. Try not to reset it, or explain why it needs to be reset. From b3edbf25a1f3bb4c8d7e9824096fc0538c04a977 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Wed, 3 May 2023 15:15:37 +0300 Subject: [PATCH 237/260] MDEV-31022: SIGSEGV in maria_create from create_internal_tmp_table The code in create_internal_tmp_table() didn't take into account that now temporary (derived) tables may have multiple indexes: - one index due to duplicate removal = In this example created by conversion of big-IN(...) into subquery = this index might be converted into a "unique constraint" if the key length is too large. - one index added by derived_with_keys optimization. Make create_internal_tmp_table() handle multiple indexes. Before this patch, use of a unique constraint was indicated in TABLE_SHARE::uniques. This was ok as unique constraint was the only index in the table. Now it's no longer the case so TABLE_SHARE::uniques is removed and replaced with an in-memory-only flag HA_UNIQUE_HASH. This patch is based on Monty's patch. Co-Author: Monty --- include/my_base.h | 11 +- mysql-test/main/derived.result | 28 +++++ mysql-test/main/derived.test | 24 ++++ sql/item_subselect.cc | 2 +- sql/opt_subselect.cc | 6 +- sql/sql_select.cc | 206 ++++++++++++++++++--------------- sql/sql_show.cc | 1 - sql/table.h | 13 ++- storage/maria/ha_maria.cc | 3 +- 9 files changed, 192 insertions(+), 102 deletions(-) diff --git a/include/my_base.h b/include/my_base.h index 22f1ea0a5df..05b3b56359e 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -104,7 +104,8 @@ enum ha_key_alg { HA_KEY_ALG_RTREE= 2, /* R-tree, for spatial searches */ HA_KEY_ALG_HASH= 3, /* HASH keys (HEAP tables) */ HA_KEY_ALG_FULLTEXT= 4, /* FULLTEXT (MyISAM tables) */ - HA_KEY_ALG_LONG_HASH= 5 /* long BLOB keys */ + HA_KEY_ALG_LONG_HASH= 5, /* long BLOB keys */ + HA_KEY_ALG_UNIQUE_HASH= 6 /* Internal UNIQUE hash (Aria) */ }; /* Storage media types */ @@ -276,11 +277,17 @@ enum ha_base_keytype { #define HA_SPATIAL 1024U /* For spatial search */ #define HA_NULL_ARE_EQUAL 2048U /* NULL in key are cmp as equal */ #define HA_GENERATED_KEY 8192U /* Automatically generated key */ +/* + Part of unique hash key. Used only for temporary (work) tables so is not + written to .frm files. +*/ +#define HA_UNIQUE_HASH 262144U /* The combination of the above can be used for key type comparison. */ #define HA_KEYFLAG_MASK (HA_NOSAME | HA_AUTO_KEY | \ HA_FULLTEXT | HA_UNIQUE_CHECK | \ - HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY) + HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY | \ + HA_UNIQUE_HASH) /* Key contains partial segments. diff --git a/mysql-test/main/derived.result b/mysql-test/main/derived.result index e15be3aecc4..091ca13d579 100644 --- a/mysql-test/main/derived.result +++ b/mysql-test/main/derived.result @@ -1499,5 +1499,33 @@ a 2 drop table t1; # +# MDEV-31022: SIGSEGV in maria_create from create_internal_tmp_table +# keydef incorrectly allocated on the stack in create_internal_tmp_table() +# +CREATE TABLE t1 (c CHAR(1) NULL) ENGINE=MyISAM; +INSERT INTO t1 (c) VALUES (1); +SET statement +optimizer_where_cost=1, +big_tables=1, +in_predicate_conversion_threshold=2 +FOR +SELECT * FROM t1 WHERE c IN ('',''); +c +Warnings: +Warning 1287 '@@big_tables' is deprecated and will be removed in a future release +Warning 1287 '@@big_tables' is deprecated and will be removed in a future release +SET statement +optimizer_where_cost=1, +big_tables=1, +in_predicate_conversion_threshold=2, +sql_mode='' +FOR +SELECT * FROM t1 WHERE c IN ('',''); +c +Warnings: +Warning 1287 '@@big_tables' is deprecated and will be removed in a future release +Warning 1287 '@@big_tables' is deprecated and will be removed in a future release +DROP TABLE t1; +# # End of 11.0 tests # diff --git a/mysql-test/main/derived.test b/mysql-test/main/derived.test index 83de98c5d89..78ccba0b362 100644 --- a/mysql-test/main/derived.test +++ b/mysql-test/main/derived.test @@ -1273,6 +1273,30 @@ SET IN_PREDICATE_CONVERSION_THRESHOLD=100; SELECT a FROM t1 WHERE a IN ( 1, 1, 2, 194 ); drop table t1; +--echo # +--echo # MDEV-31022: SIGSEGV in maria_create from create_internal_tmp_table +--echo # keydef incorrectly allocated on the stack in create_internal_tmp_table() +--echo # + +CREATE TABLE t1 (c CHAR(1) NULL) ENGINE=MyISAM; +INSERT INTO t1 (c) VALUES (1); +SET statement + optimizer_where_cost=1, + big_tables=1, + in_predicate_conversion_threshold=2 +FOR +SELECT * FROM t1 WHERE c IN ('',''); + +SET statement + optimizer_where_cost=1, + big_tables=1, + in_predicate_conversion_threshold=2, + sql_mode='' +FOR +SELECT * FROM t1 WHERE c IN ('',''); + +DROP TABLE t1; + --echo # --echo # End of 11.0 tests --echo # diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 80228917210..3adc65008e0 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -5266,7 +5266,7 @@ bool subselect_hash_sj_engine::init(List *tmp_columns, uint subquery_id) //fprintf(stderr, "Q: %s\n", current_thd->query()); DBUG_ASSERT(0); DBUG_ASSERT( - tmp_table->s->uniques || + (tmp_table->key_info->flags & HA_UNIQUE_HASH) || tmp_table->key_info->key_length >= tmp_table->file->max_key_length() || tmp_table->key_info->user_defined_key_parts > tmp_table->file->max_key_parts()); diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 1d0b1ff1874..94adae02a17 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -4903,11 +4903,13 @@ SJ_TMP_TABLE::create_sj_weedout_tmp_table(THD *thd) { DBUG_PRINT("info",("Creating group key in temporary table")); share->keys=1; - share->uniques= MY_TEST(using_unique_constraint); table->key_info= share->key_info= keyinfo; keyinfo->key_part=key_part_info; - keyinfo->flags=HA_NOSAME; + keyinfo->flags= HA_NOSAME | (using_unique_constraint ? HA_UNIQUE_HASH : 0); + keyinfo->ext_key_flags= keyinfo->flags; keyinfo->usable_key_parts= keyinfo->user_defined_key_parts= 1; + keyinfo->ext_key_parts= 1; + share->key_parts= 1; keyinfo->key_length=0; keyinfo->rec_per_key=0; keyinfo->algorithm= HA_KEY_ALG_UNDEF; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 9c665bf5df0..048f101c046 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -21410,12 +21410,13 @@ bool Create_tmp_table::finalize(THD *thd, table->group= m_group; /* Table is grouped by key */ param->group_buff= m_group_buff; share->keys=1; - share->uniques= MY_TEST(m_using_unique_constraint); table->key_info= table->s->key_info= keyinfo; table->keys_in_use_for_query.set_bit(0); share->keys_in_use.set_bit(0); keyinfo->key_part= m_key_part_info; keyinfo->flags=HA_NOSAME | HA_BINARY_PACK_KEY | HA_PACK_KEY; + if (m_using_unique_constraint) + keyinfo->flags|= HA_UNIQUE_HASH; keyinfo->ext_key_flags= keyinfo->flags; keyinfo->usable_key_parts=keyinfo->user_defined_key_parts= param->group_parts; @@ -21514,6 +21515,7 @@ bool Create_tmp_table::finalize(THD *thd, */ DBUG_PRINT("info",("hidden_field_count: %d", param->hidden_field_count)); + keyinfo->flags= 0; if (m_blobs_count[distinct]) { /* @@ -21521,10 +21523,11 @@ bool Create_tmp_table::finalize(THD *thd, indexes on blobs with arbitrary length. Such indexes cannot be used for lookups. */ - share->uniques= 1; + keyinfo->flags|= HA_UNIQUE_HASH; } keyinfo->user_defined_key_parts= m_field_count[distinct] + - (share->uniques ? MY_TEST(null_pack_length[distinct]) : 0); + ((keyinfo->flags & HA_UNIQUE_HASH) ? + MY_TEST(null_pack_length[distinct]) : 0); keyinfo->ext_key_parts= keyinfo->user_defined_key_parts; keyinfo->usable_key_parts= keyinfo->user_defined_key_parts; table->distinct= 1; @@ -21539,7 +21542,8 @@ bool Create_tmp_table::finalize(THD *thd, share->keys_in_use.set_bit(0); table->key_info= table->s->key_info= keyinfo; keyinfo->key_part= m_key_part_info; - keyinfo->flags=HA_NOSAME | HA_NULL_ARE_EQUAL | HA_BINARY_PACK_KEY | HA_PACK_KEY; + keyinfo->flags|= (HA_NOSAME | HA_NULL_ARE_EQUAL | HA_BINARY_PACK_KEY | + HA_PACK_KEY); keyinfo->ext_key_flags= keyinfo->flags; keyinfo->key_length= 0; // Will compute the sum of the parts below. keyinfo->name= distinct_key; @@ -21568,7 +21572,7 @@ bool Create_tmp_table::finalize(THD *thd, blobs can distinguish NULL from 0. This extra field is not needed when we do not use UNIQUE indexes for blobs. */ - if (null_pack_length[distinct] && share->uniques) + if (null_pack_length[distinct] && (keyinfo->flags & HA_UNIQUE_HASH)) { m_key_part_info->null_bit=0; m_key_part_info->offset= null_pack_base[distinct]; @@ -21986,113 +21990,125 @@ bool open_tmp_table(TABLE *table) */ -bool create_internal_tmp_table(TABLE *table, KEY *keyinfo, +bool create_internal_tmp_table(TABLE *table, KEY *org_keyinfo, TMP_ENGINE_COLUMNDEF *start_recinfo, TMP_ENGINE_COLUMNDEF **recinfo, ulonglong options) { int error; - MARIA_KEYDEF keydef; + MARIA_KEYDEF *keydefs= 0, *keydef; MARIA_UNIQUEDEF uniquedef; TABLE_SHARE *share= table->s; MARIA_CREATE_INFO create_info; + bool use_unique= false; DBUG_ENTER("create_internal_tmp_table"); if (share->keys) { // Get keys for ni_create - bool using_unique_constraint=0; - HA_KEYSEG *seg= (HA_KEYSEG*) alloc_root(&table->mem_root, - sizeof(*seg) * keyinfo->user_defined_key_parts); - if (!seg) + HA_KEYSEG *seg; + DBUG_ASSERT(share->key_parts); + + if (!(multi_alloc_root(&table->mem_root, + &seg, sizeof(*seg) * share->key_parts, + &keydefs, sizeof(*keydefs) * share->keys, + NullS))) goto err; + keydef= keydefs; - bzero(seg, sizeof(*seg) * keyinfo->user_defined_key_parts); - /* - Note that a similar check is performed during - subquery_types_allow_materialization. See MDEV-7122 for more details as - to why. Whenever this changes, it must be updated there as well, for - all tmp_table engines. - */ - if (keyinfo->key_length > table->file->max_key_length() || - keyinfo->user_defined_key_parts > table->file->max_key_parts() || - share->uniques) + bzero(seg, sizeof(*seg) * share->key_parts); + + /* Note that share->keys may change in the loop ! */ + for (KEY *keyinfo= org_keyinfo, *end_keyinfo= keyinfo + share->keys; + keyinfo < end_keyinfo ; + keyinfo++) { - if (!share->uniques && !(keyinfo->flags & HA_NOSAME)) + /* + Note that a similar check is performed during + subquery_types_allow_materialization. See MDEV-7122 for more details as + to why. Whenever this changes, it must be updated there as well, for + all tmp_table engines. + */ + if (keyinfo->key_length > table->file->max_key_length() || + keyinfo->user_defined_key_parts > table->file->max_key_parts() || + (keyinfo->flags & HA_UNIQUE_HASH)) { - my_error(ER_INTERNAL_ERROR, MYF(0), - "Using too big key for internal temp tables"); - DBUG_RETURN(1); - } + if (!(keyinfo->flags & (HA_NOSAME | HA_UNIQUE_HASH))) + { + my_error(ER_INTERNAL_ERROR, MYF(0), + "Using too big key for internal temp tables"); + DBUG_RETURN(1); + } + /* Can't create a key; Make a unique constraint instead of a key */ + share->keys--; + share->key_parts-= keyinfo->user_defined_key_parts; + share->ext_key_parts-= keyinfo->ext_key_parts; + use_unique= true; + bzero((char*) &uniquedef,sizeof(uniquedef)); + uniquedef.keysegs= keyinfo->user_defined_key_parts; + uniquedef.seg=seg; + uniquedef.null_are_equal=1; + keyinfo->flags|= HA_UNIQUE_HASH; + keyinfo->algorithm= HA_KEY_ALG_UNIQUE_HASH; - /* Can't create a key; Make a unique constraint instead of a key */ - share->keys= 0; - share->key_parts= share->ext_key_parts= 0; - share->uniques= 1; - using_unique_constraint=1; - bzero((char*) &uniquedef,sizeof(uniquedef)); - uniquedef.keysegs=keyinfo->user_defined_key_parts; - uniquedef.seg=seg; - uniquedef.null_are_equal=1; + /* Create extra column for hash value */ + bzero((uchar*) *recinfo,sizeof(**recinfo)); + (*recinfo)->type= FIELD_CHECK; + (*recinfo)->length= MARIA_UNIQUE_HASH_LENGTH; + (*recinfo)++; - /* Create extra column for hash value */ - bzero((uchar*) *recinfo,sizeof(**recinfo)); - (*recinfo)->type= FIELD_CHECK; - (*recinfo)->length= MARIA_UNIQUE_HASH_LENGTH; - (*recinfo)++; - - /* Avoid warnings from valgrind */ - bzero(table->record[0]+ share->reclength, MARIA_UNIQUE_HASH_LENGTH); - bzero(share->default_values+ share->reclength, MARIA_UNIQUE_HASH_LENGTH); - share->reclength+= MARIA_UNIQUE_HASH_LENGTH; - } - else - { - /* Create a key */ - bzero((char*) &keydef,sizeof(keydef)); - keydef.flag= keyinfo->flags & HA_NOSAME; - keydef.keysegs= keyinfo->user_defined_key_parts; - keydef.seg= seg; - } - for (uint i=0; i < keyinfo->user_defined_key_parts ; i++,seg++) - { - Field *field=keyinfo->key_part[i].field; - seg->flag= 0; - seg->language= field->charset()->number; - seg->length= keyinfo->key_part[i].length; - seg->start= keyinfo->key_part[i].offset; - if (field->flags & BLOB_FLAG) - { - seg->type= - ((keyinfo->key_part[i].key_type & FIELDFLAG_BINARY) ? - HA_KEYTYPE_VARBINARY2 : HA_KEYTYPE_VARTEXT2); - seg->bit_start= (uint8)(field->pack_length() - - portable_sizeof_char_ptr); - seg->flag= HA_BLOB_PART; - seg->length=0; // Whole blob in unique constraint + /* Avoid warnings from valgrind */ + bzero(table->record[0]+ share->reclength, MARIA_UNIQUE_HASH_LENGTH); + bzero(share->default_values+ share->reclength, + MARIA_UNIQUE_HASH_LENGTH); + share->reclength+= MARIA_UNIQUE_HASH_LENGTH; } else { - seg->type= keyinfo->key_part[i].type; - /* Tell handler if it can do suffic space compression */ - if (field->real_type() == MYSQL_TYPE_STRING && - keyinfo->key_part[i].length > 32) - seg->flag|= HA_SPACE_PACK; + /* Create a key */ + bzero((char*) keydef,sizeof(*keydef)); + /* + We are using a GROUP BY on something that contains NULL + In this case we have to tell Aria that two NULL should + on INSERT be regarded at the same value. + */ + keydef->flag= (keyinfo->flags & HA_NOSAME) | HA_NULL_ARE_EQUAL; + keydef->keysegs= keyinfo->user_defined_key_parts; + keydef->seg= seg; + keydef++; } - if (!(field->flags & NOT_NULL_FLAG)) + for (uint i=0; i < keyinfo->user_defined_key_parts ; i++,seg++) { - seg->null_bit= field->null_bit; - seg->null_pos= (uint) (field->null_ptr - (uchar*) table->record[0]); - /* - We are using a GROUP BY on something that contains NULL - In this case we have to tell Aria that two NULL should - on INSERT be regarded at the same value - */ - if (!using_unique_constraint) - keydef.flag|= HA_NULL_ARE_EQUAL; + Field *field=keyinfo->key_part[i].field; + seg->flag= 0; + seg->language= field->charset()->number; + seg->length= keyinfo->key_part[i].length; + seg->start= keyinfo->key_part[i].offset; + if (field->flags & BLOB_FLAG) + { + seg->type= + ((keyinfo->key_part[i].key_type & FIELDFLAG_BINARY) ? + HA_KEYTYPE_VARBINARY2 : HA_KEYTYPE_VARTEXT2); + seg->bit_start= (uint8)(field->pack_length() - + portable_sizeof_char_ptr); + seg->flag= HA_BLOB_PART; + seg->length=0; // Whole blob in unique constraint + } + else + { + seg->type= keyinfo->key_part[i].type; + /* Tell handler if it can do suffic space compression */ + if (field->real_type() == MYSQL_TYPE_STRING && + keyinfo->key_part[i].length > 32) + seg->flag|= HA_SPACE_PACK; + } + if (!(field->flags & NOT_NULL_FLAG)) + { + seg->null_bit= field->null_bit; + seg->null_pos= (uint) (field->null_ptr - (uchar*) table->record[0]); + } } - } - if (share->keys) keyinfo->index_flags= table->file->index_flags(0, 0, 1); + } } bzero((char*) &create_info,sizeof(create_info)); create_info.data_file_length= table->in_use->variables.tmp_disk_table_size; @@ -22138,8 +22154,8 @@ bool create_internal_tmp_table(TABLE *table, KEY *keyinfo, } if (unlikely((error= maria_create(share->path.str, file_type, share->keys, - &keydef, (uint) (*recinfo-start_recinfo), - start_recinfo, share->uniques, &uniquedef, + keydefs, (uint) (*recinfo-start_recinfo), + start_recinfo, use_unique, &uniquedef, &create_info, create_flags)))) { table->file->print_error(error,MYF(0)); /* purecov: inspected */ @@ -22191,7 +22207,7 @@ bool create_internal_tmp_table(TABLE *table, KEY *keyinfo, /* Create internal MyISAM temporary table */ -bool create_internal_tmp_table(TABLE *table, KEY *keyinfo, +bool create_internal_tmp_table(TABLE *table, KEY *org_keyinfo, TMP_ENGINE_COLUMNDEF *start_recinfo, TMP_ENGINE_COLUMNDEF **recinfo, ulonglong options) @@ -22206,11 +22222,12 @@ bool create_internal_tmp_table(TABLE *table, KEY *keyinfo, { // Get keys for ni_create bool using_unique_constraint=0; HA_KEYSEG *seg= (HA_KEYSEG*) alloc_root(&table->mem_root, - sizeof(*seg) * keyinfo->user_defined_key_parts); + sizeof(*seg) * + share->user_defined_key_parts); if (!seg) goto err; - bzero(seg, sizeof(*seg) * keyinfo->user_defined_key_parts); + bzero(seg, sizeof(*seg) * share->user_defined_key_parts); /* Note that a similar check is performed during subquery_types_allow_materialization. See MDEV-7122 for more details as @@ -22546,7 +22563,7 @@ void set_postjoin_aggr_write_func(JOIN_TAB *tab) Note for MyISAM tmp tables: if uniques is true keys won't be created. */ - if (table->s->keys && !table->s->uniques) + if (table->s->keys && !table->s->have_unique_constraint()) { DBUG_PRINT("info",("Using end_update")); aggr->set_write_func(end_update); @@ -22856,6 +22873,8 @@ bool instantiate_tmp_table(TABLE *table, KEY *keyinfo, TMP_ENGINE_COLUMNDEF **recinfo, ulonglong options) { + DBUG_ASSERT(table->s->keys == 0 || table->key_info == keyinfo); + DBUG_ASSERT(table->s->keys <= 1); if (table->s->db_type() == TMP_ENGINE_HTON) { /* @@ -24768,7 +24787,6 @@ end_write(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), DBUG_RETURN(NESTED_LOOP_ERROR); // Not a table_is_full error if (is_duplicate) goto end; - table->s->uniques=0; // To ensure rows are the same } if (++join_tab->send_records >= join_tab->tmp_table_param->end_write_records && diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 1a99f6f0bae..fa95aa66b0f 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -8841,7 +8841,6 @@ bool optimize_schema_tables_memory_usage(List &tables) TMP_TABLE_PARAM *p= table_list->schema_table_param; TMP_ENGINE_COLUMNDEF *from_recinfo, *to_recinfo; DBUG_ASSERT(table->s->keys == 0); - DBUG_ASSERT(table->s->uniques == 0); uchar *cur= table->field[0]->ptr; /* first recinfo could be a NULL bitmap, not an actual Field */ diff --git a/sql/table.h b/sql/table.h index c67a5783c89..3874ccacb9a 100644 --- a/sql/table.h +++ b/sql/table.h @@ -853,7 +853,18 @@ struct TABLE_SHARE uint keys, key_parts; uint ext_key_parts; /* Total number of key parts in extended keys */ uint max_key_length, max_unique_length; - uint uniques; /* Number of UNIQUE index */ + + /* + Older versions had TABLE_SHARE::uniques but now it is replaced with + per-index HA_UNIQUE_HASH flag + */ + bool have_unique_constraint() const + { + for (uint i=0; i < keys; i++) + if (key_info[i].flags & HA_UNIQUE_HASH) + return true; + return false; + } uint db_create_options; /* Create options from database */ uint db_options_in_use; /* Options in use */ uint db_record_offset; /* if HA_REC_IN_SEQ */ diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 08e2b34a90e..2f58110cb91 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -1082,7 +1082,8 @@ const char *ha_maria::index_type(uint key_number) ulong ha_maria::index_flags(uint inx, uint part, bool all_parts) const { ulong flags; - if (table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) + if (table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT || + table_share->key_info[inx].algorithm == HA_KEY_ALG_UNIQUE_HASH) flags= 0; else if ((table_share->key_info[inx].flags & HA_SPATIAL || From 368dd22a816f3b437bccd0b9ff28b9de9b1abf0a Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Tue, 9 May 2023 13:09:00 +0300 Subject: [PATCH 238/260] MDEV-31223: UBSan error: sql_select.h:969:7: runtime error: load of value... In Loose_scan_opt::save_to_position, initialize POSITION::firstmatch_with_join_buf. --- sql/opt_subselect.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/opt_subselect.h b/sql/opt_subselect.h index c0398fc8539..8140a01974d 100644 --- a/sql/opt_subselect.h +++ b/sql/opt_subselect.h @@ -316,6 +316,7 @@ public: pos->loosescan_picker.loosescan_key= best_loose_scan_key; pos->loosescan_picker.loosescan_parts= best_max_loose_keypart + 1; pos->use_join_buffer= FALSE; + pos->firstmatch_with_join_buf= FALSE; pos->table= tab; pos->range_rowid_filter_info= tab->range_rowid_filter_info; pos->ref_depend_map= best_ref_depend_map; From 209fed8eeda06d16de9b563efa6d9ff61b41e534 Mon Sep 17 00:00:00 2001 From: Monty Date: Sat, 27 May 2023 12:18:49 +0300 Subject: [PATCH 239/260] MDEV-31258 Assertion `cond_selectivity <= 1.000000001' upon range query This was caused of two minor issues: - get_quick_record_count() returned the number of rows for range with least cost, when it should have returned the minum number of rows for any range. - When changing REF to RANGE, we also changed records_out, which should not be done (number of records in the result will not change). The above change can cause a small change in row estimates where the optimizer chooses a clustered key with more rows than a range one secondary key (unlikely case). --- mysql-test/main/range.result | 40 ++++++++++++++++++++++++++++++++++ mysql-test/main/range.test | 42 ++++++++++++++++++++++++++++++++++++ sql/sql_select.cc | 23 ++++++++++++++------ 3 files changed, 98 insertions(+), 7 deletions(-) diff --git a/mysql-test/main/range.result b/mysql-test/main/range.result index a352252c616..1e3d05e81e0 100644 --- a/mysql-test/main/range.result +++ b/mysql-test/main/range.result @@ -3786,3 +3786,43 @@ DROP TABLE t1; set global innodb_stats_persistent= @innodb_stats_persistent_save; set global innodb_stats_persistent_sample_pages= @innodb_stats_persistent_sample_pages_save; +# +# MDEV-31258 Assertion `cond_selectivity <= 1.000000001' upon range +# query +# +CREATE TABLE t1 (id int, a int, b char(3), PRIMARY KEY (id), KEY idx (a,b)) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(1,8,'UT'),(2,0,'NU'),(3,1,'SD'),(4,0,'QU'),(5,0,'FL'),(6,0,'ZR'), +(7,3,'LA'),(8,5,'NU'),(9,0,'NU'),(10,0,'SD'),(11,0,'NU'),(12,1,'SD'), +(13,0,'BD'),(14,0,'PA'),(15,0,'VT'),(16,4,'WA'),(17,0,'ME'),(18,6,'OH'), +(19,0,'ME'),(20,4,'NU'),(21,0,'SC'),(22,0,'GA'),(23,1,'CO'),(24,0,'IL'), +(25,0,'GA'),(26,0,'HI'),(27,0,'BU'),(28,0,'NU'),(29,7,'LA'),(30,0,'NU'), +(31,0,'JR'),(32,6,'BR'),(33,0,'NU'),(34,6,'CO'),(35,7,'NU'),(36,2,'LA'), +(37,0,'PR'),(38,1,'UT'),(39,2,'BR'),(40,1,'HI'),(41,0,'SD'),(42,0,'RI'), +(43,2,'LA'),(44,0,'TN'),(45,4,'HI'),(46,0,'VT'),(47,1,'NU'),(48,0,'SC'), +(49,0,'TX'),(50,8,'DC'),(51,4,'NU'),(52,0,'AL'),(53,0,'CO'),(54,9,'PR'), +(55,0,'AR'),(56,0,'SD'),(57,0,'RI'),(58,0,'XE'),(59,0,'NU'),(60,4,'EL'), +(61,2,'LA'),(62,5,'UT'),(63,3,'NU'),(64,0,'RI'),(65,1,'NU'),(66,0,'BR'), +(67,3,'WA'),(68,0,'TN'),(69,3,'HI'),(70,0,'OH'),(71,8,'GA'),(72,6,'AL'), +(73,6,'NU'),(74,1,'HI'),(75,5,'JR'),(76,3,'RI'),(77,0,'DC'),(78,0,'SC'), +(79,0,'CO'),(80,2,'BO'),(81,8,'XE'),(82,1,'NU'),(83,0,'SD'),(84,0,'PA'), +(85,5,'PA'),(86,0,'QU'),(87,0,'PA'),(88,0,'NU'),(89,0,'ND'),(90,0,'UT'), +(91,0,'NU'),(92,0,'NU'),(93,6,'ZR'),(94,0,'NU'),(95,2,'EL'),(96,0,'NU'), +(97,0,'RI'),(98,5,'DC'),(99,7,'JR'),(100,5,'CO'),(101,0,'UT'),(102,0,'QU'), +(103,0,'NU'),(104,0,'GA'),(105,7,'AK'),(106,0,'ZR'),(107,0,'YT'),(108,0,'MD'), +(109,0,'NU'),(110,1,'EL'),(111,0,'ME'),(112,0,'VT'),(113,2,'NU'),(114,0,'CO'), +(115,5,'TN'),(116,0,'OH'),(117,0,'GA'),(118,9,'GA'),(119,0,'CO'),(120,0,'AL'), +(121,0,'NU'),(122,2,'NE'),(123,2,'TX'),(124,3,'CO'),(125,0,'TN'),(126,0,'WA'), +(127,0,'NE'),(128,6,'TN'),(129,0,'BR'),(130,0,'ID'),(131,0,'NU'),(132,2,'EL'), +(133,0,'PR'),(134,0,'NU'),(135,1,'AZ'),(136,7,'EL'),(137,0,'TN'),(138,0,'PA'), +(139,5,'QU'),(140,0,'AR'),(141,0,'DC'),(142,2,'WA'),(143,7,'OH'),(144,2,'CO'), +(145,6,'NU'),(146,9,'FL'),(147,0,'HI'),(148,0,'WA'),(149,1,'BR'),(150,3,'QU'); +SELECT id, MIN(id) FROM t1 +WHERE (b > 'TX' OR b BETWEEN 'NE' AND 'SC') AND id IN (1,7,8) AND a = 5 +GROUP BY id; +id MIN(id) +8 8 +DROP TABLE t1; +# +# End of 11.0 tests +# diff --git a/mysql-test/main/range.test b/mysql-test/main/range.test index c2cc794b485..5911fc45741 100644 --- a/mysql-test/main/range.test +++ b/mysql-test/main/range.test @@ -2563,3 +2563,45 @@ DROP TABLE t1; set global innodb_stats_persistent= @innodb_stats_persistent_save; set global innodb_stats_persistent_sample_pages= @innodb_stats_persistent_sample_pages_save; + +--echo # +--echo # MDEV-31258 Assertion `cond_selectivity <= 1.000000001' upon range +--echo # query +--echo # + +CREATE TABLE t1 (id int, a int, b char(3), PRIMARY KEY (id), KEY idx (a,b)) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(1,8,'UT'),(2,0,'NU'),(3,1,'SD'),(4,0,'QU'),(5,0,'FL'),(6,0,'ZR'), +(7,3,'LA'),(8,5,'NU'),(9,0,'NU'),(10,0,'SD'),(11,0,'NU'),(12,1,'SD'), +(13,0,'BD'),(14,0,'PA'),(15,0,'VT'),(16,4,'WA'),(17,0,'ME'),(18,6,'OH'), +(19,0,'ME'),(20,4,'NU'),(21,0,'SC'),(22,0,'GA'),(23,1,'CO'),(24,0,'IL'), +(25,0,'GA'),(26,0,'HI'),(27,0,'BU'),(28,0,'NU'),(29,7,'LA'),(30,0,'NU'), +(31,0,'JR'),(32,6,'BR'),(33,0,'NU'),(34,6,'CO'),(35,7,'NU'),(36,2,'LA'), +(37,0,'PR'),(38,1,'UT'),(39,2,'BR'),(40,1,'HI'),(41,0,'SD'),(42,0,'RI'), +(43,2,'LA'),(44,0,'TN'),(45,4,'HI'),(46,0,'VT'),(47,1,'NU'),(48,0,'SC'), +(49,0,'TX'),(50,8,'DC'),(51,4,'NU'),(52,0,'AL'),(53,0,'CO'),(54,9,'PR'), +(55,0,'AR'),(56,0,'SD'),(57,0,'RI'),(58,0,'XE'),(59,0,'NU'),(60,4,'EL'), +(61,2,'LA'),(62,5,'UT'),(63,3,'NU'),(64,0,'RI'),(65,1,'NU'),(66,0,'BR'), +(67,3,'WA'),(68,0,'TN'),(69,3,'HI'),(70,0,'OH'),(71,8,'GA'),(72,6,'AL'), +(73,6,'NU'),(74,1,'HI'),(75,5,'JR'),(76,3,'RI'),(77,0,'DC'),(78,0,'SC'), +(79,0,'CO'),(80,2,'BO'),(81,8,'XE'),(82,1,'NU'),(83,0,'SD'),(84,0,'PA'), +(85,5,'PA'),(86,0,'QU'),(87,0,'PA'),(88,0,'NU'),(89,0,'ND'),(90,0,'UT'), +(91,0,'NU'),(92,0,'NU'),(93,6,'ZR'),(94,0,'NU'),(95,2,'EL'),(96,0,'NU'), +(97,0,'RI'),(98,5,'DC'),(99,7,'JR'),(100,5,'CO'),(101,0,'UT'),(102,0,'QU'), +(103,0,'NU'),(104,0,'GA'),(105,7,'AK'),(106,0,'ZR'),(107,0,'YT'),(108,0,'MD'), +(109,0,'NU'),(110,1,'EL'),(111,0,'ME'),(112,0,'VT'),(113,2,'NU'),(114,0,'CO'), +(115,5,'TN'),(116,0,'OH'),(117,0,'GA'),(118,9,'GA'),(119,0,'CO'),(120,0,'AL'), +(121,0,'NU'),(122,2,'NE'),(123,2,'TX'),(124,3,'CO'),(125,0,'TN'),(126,0,'WA'), +(127,0,'NE'),(128,6,'TN'),(129,0,'BR'),(130,0,'ID'),(131,0,'NU'),(132,2,'EL'), +(133,0,'PR'),(134,0,'NU'),(135,1,'AZ'),(136,7,'EL'),(137,0,'TN'),(138,0,'PA'), +(139,5,'QU'),(140,0,'AR'),(141,0,'DC'),(142,2,'WA'),(143,7,'OH'),(144,2,'CO'), +(145,6,'NU'),(146,9,'FL'),(147,0,'HI'),(148,0,'WA'),(149,1,'BR'),(150,3,'QU'); + +SELECT id, MIN(id) FROM t1 +WHERE (b > 'TX' OR b BETWEEN 'NE' AND 'SC') AND id IN (1,7,8) AND a = 5 +GROUP BY id; +DROP TABLE t1; + +--echo # +--echo # End of 11.0 tests +--echo # diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 048f101c046..32485bde46c 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -5206,7 +5206,17 @@ static ha_rows get_quick_record_count(THD *thd, SQL_SELECT *select, TRUE, /* remove_where_parts*/ FALSE)) == 1)) - DBUG_RETURN(select->quick->records); + { + /* + opt_range_condition_rows was updated in test_quick_select to be + the smallest number of rows in any range. + select->quick->records is the number of rows in range with + smallest cost. + */ + DBUG_ASSERT(select->quick->records >= + table->opt_range_condition_rows); + DBUG_RETURN(table->opt_range_condition_rows); + } if (unlikely(error == -1)) { table->reginfo.impossible_range=1; @@ -9268,11 +9278,11 @@ best_access_path(JOIN *join, TABLE::OPT_RANGE *range= &table->opt_range[key_no]; /* - Ensure that 'range' and 's' are comming from the same source + Ensure that 'range' and 's' are coming from the same source The complex 'double' comparison is there because floating point registers complications when costs are calculated. */ - DBUG_ASSERT(range->rows == s->found_records); + DBUG_ASSERT(range->rows >= s->found_records); DBUG_ASSERT((range->cost.total_cost() == 0.0 && s->quick->read_time == 0.0) || (range->cost.total_cost() / s->quick->read_time <= 1.0000001 && @@ -13610,9 +13620,8 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) tab->use_quick=1; tab->ref.key= -1; tab->ref.key_parts=0; // Don't use ref key. - join->best_positions[i].records_read= - join->best_positions[i].records_out= - rows2double(tab->quick->records); + join->best_positions[i].records_read= rows2double(tab->quick->records); + /* We will use join cache here : prevent sorting of the first table only and sort at the end. @@ -31314,6 +31323,7 @@ static bool get_range_limit_read_cost(const POSITION *pos, if (pos) { + double cond_selectivity; /* Take into count table selectivity as the number of accepted rows for this table will be 'records_out'. @@ -31325,7 +31335,6 @@ static bool get_range_limit_read_cost(const POSITION *pos, account that using key2 we have to examine much fewer rows. */ best_rows= pos->records_out; // Best rows with any key/keys - double cond_selectivity; /* We assign "double range_rows" from integer #rows a few lines above so comparison with 0.0 makes sense From 661141948fc26c76f14da6a6356681409ececce0 Mon Sep 17 00:00:00 2001 From: Monty Date: Sat, 27 May 2023 14:39:17 +0300 Subject: [PATCH 240/260] MDEV-31247 Assertion `c >= 0' failed in COST_MULT upon query with many joins Problem was an overflow when calculating number of join cache refills. --- mysql-test/main/optimizer_crash.result | 38 ++++++++++++++++++++ mysql-test/main/optimizer_crash.test | 48 ++++++++++++++++++++++++++ mysql-test/main/range_mrr_icp.result | 40 +++++++++++++++++++++ sql/sql_select.cc | 8 +++-- 4 files changed, 131 insertions(+), 3 deletions(-) create mode 100644 mysql-test/main/optimizer_crash.result create mode 100644 mysql-test/main/optimizer_crash.test diff --git a/mysql-test/main/optimizer_crash.result b/mysql-test/main/optimizer_crash.result new file mode 100644 index 00000000000..2a9e8dd51ed --- /dev/null +++ b/mysql-test/main/optimizer_crash.result @@ -0,0 +1,38 @@ +# +# MDEV-31247 Assertion `c >= 0' failed in COST_MULT upon query with +# many joins +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +CREATE TABLE t3 (c INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (1),(2),(3); +CREATE TABLE t4 (d CHAR(200), e INT, KEY(e)) ENGINE=Aria; +INSERT INTO t4 (e) VALUES (1),(2),(3); +CREATE TABLE t5 (f INT) ENGINE=MyISAM; +INSERT INTO t5 VALUES (1),(2),(3),(4),(5),(6); +create table t1000 engine=memory select seq from seq_1_to_1000; +create table t2000 engine=memory select seq from seq_1_to_2000; +CREATE ALGORITHM=TEMPTABLE VIEW v AS select t1000.seq +from t1000 ml1 +join t1000 ml2 +join t1000; +set @@max_statement_time=10; +SELECT * FROM information_schema.TABLES +JOIN t1000 ts +JOIN t1000 d1 +JOIN t2000 d3 +LEFT JOIN (t1 JOIN t2) ON 1 +JOIN t1000 d5 +JOIN t1000 PROCESSLIST +JOIN t1000 d2 +JOIN t1000 event_name +JOIN t3 +JOIN t4 ON ts.seq = t4.e +JOIN v ON ts.seq+1 = v.seq +JOIN t5 limit rows examined 1000; +TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT MAX_INDEX_LENGTH TEMPORARY seq seq seq a b seq seq seq seq c d e seq f +Warnings: +Warning 1931 Query execution was interrupted. The query examined at least ### rows, which exceeds LIMIT ROWS EXAMINED (1000). The query result may be incomplete +DROP VIEW v; +DROP TABLE t1, t2, t3, t4, t5, t1000, t2000; diff --git a/mysql-test/main/optimizer_crash.test b/mysql-test/main/optimizer_crash.test new file mode 100644 index 00000000000..d7aee294353 --- /dev/null +++ b/mysql-test/main/optimizer_crash.test @@ -0,0 +1,48 @@ +--source include/have_innodb.inc +--source include/have_sequence.inc + +--echo # +--echo # MDEV-31247 Assertion `c >= 0' failed in COST_MULT upon query with +--echo # many joins +--echo # + +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); + +CREATE TABLE t2 (b INT) ENGINE=MyISAM; + +CREATE TABLE t3 (c INT) ENGINE=MyISAM; +INSERT INTO t3 VALUES (1),(2),(3); + +CREATE TABLE t4 (d CHAR(200), e INT, KEY(e)) ENGINE=Aria; +INSERT INTO t4 (e) VALUES (1),(2),(3); + +CREATE TABLE t5 (f INT) ENGINE=MyISAM; +INSERT INTO t5 VALUES (1),(2),(3),(4),(5),(6); + +create table t1000 engine=memory select seq from seq_1_to_1000; +create table t2000 engine=memory select seq from seq_1_to_2000; + +CREATE ALGORITHM=TEMPTABLE VIEW v AS select t1000.seq + from t1000 ml1 + join t1000 ml2 + join t1000; + +set @@max_statement_time=10; +--replace_regex /least \d* rows/least ### rows/ +SELECT * FROM information_schema.TABLES + JOIN t1000 ts + JOIN t1000 d1 + JOIN t2000 d3 + LEFT JOIN (t1 JOIN t2) ON 1 + JOIN t1000 d5 + JOIN t1000 PROCESSLIST + JOIN t1000 d2 + JOIN t1000 event_name + JOIN t3 + JOIN t4 ON ts.seq = t4.e + JOIN v ON ts.seq+1 = v.seq + JOIN t5 limit rows examined 1000; +# Cleanup +DROP VIEW v; +DROP TABLE t1, t2, t3, t4, t5, t1000, t2000; diff --git a/mysql-test/main/range_mrr_icp.result b/mysql-test/main/range_mrr_icp.result index ba81a6c4cba..b9d74cb3c18 100644 --- a/mysql-test/main/range_mrr_icp.result +++ b/mysql-test/main/range_mrr_icp.result @@ -3783,4 +3783,44 @@ DROP TABLE t1; set global innodb_stats_persistent= @innodb_stats_persistent_save; set global innodb_stats_persistent_sample_pages= @innodb_stats_persistent_sample_pages_save; +# +# MDEV-31258 Assertion `cond_selectivity <= 1.000000001' upon range +# query +# +CREATE TABLE t1 (id int, a int, b char(3), PRIMARY KEY (id), KEY idx (a,b)) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(1,8,'UT'),(2,0,'NU'),(3,1,'SD'),(4,0,'QU'),(5,0,'FL'),(6,0,'ZR'), +(7,3,'LA'),(8,5,'NU'),(9,0,'NU'),(10,0,'SD'),(11,0,'NU'),(12,1,'SD'), +(13,0,'BD'),(14,0,'PA'),(15,0,'VT'),(16,4,'WA'),(17,0,'ME'),(18,6,'OH'), +(19,0,'ME'),(20,4,'NU'),(21,0,'SC'),(22,0,'GA'),(23,1,'CO'),(24,0,'IL'), +(25,0,'GA'),(26,0,'HI'),(27,0,'BU'),(28,0,'NU'),(29,7,'LA'),(30,0,'NU'), +(31,0,'JR'),(32,6,'BR'),(33,0,'NU'),(34,6,'CO'),(35,7,'NU'),(36,2,'LA'), +(37,0,'PR'),(38,1,'UT'),(39,2,'BR'),(40,1,'HI'),(41,0,'SD'),(42,0,'RI'), +(43,2,'LA'),(44,0,'TN'),(45,4,'HI'),(46,0,'VT'),(47,1,'NU'),(48,0,'SC'), +(49,0,'TX'),(50,8,'DC'),(51,4,'NU'),(52,0,'AL'),(53,0,'CO'),(54,9,'PR'), +(55,0,'AR'),(56,0,'SD'),(57,0,'RI'),(58,0,'XE'),(59,0,'NU'),(60,4,'EL'), +(61,2,'LA'),(62,5,'UT'),(63,3,'NU'),(64,0,'RI'),(65,1,'NU'),(66,0,'BR'), +(67,3,'WA'),(68,0,'TN'),(69,3,'HI'),(70,0,'OH'),(71,8,'GA'),(72,6,'AL'), +(73,6,'NU'),(74,1,'HI'),(75,5,'JR'),(76,3,'RI'),(77,0,'DC'),(78,0,'SC'), +(79,0,'CO'),(80,2,'BO'),(81,8,'XE'),(82,1,'NU'),(83,0,'SD'),(84,0,'PA'), +(85,5,'PA'),(86,0,'QU'),(87,0,'PA'),(88,0,'NU'),(89,0,'ND'),(90,0,'UT'), +(91,0,'NU'),(92,0,'NU'),(93,6,'ZR'),(94,0,'NU'),(95,2,'EL'),(96,0,'NU'), +(97,0,'RI'),(98,5,'DC'),(99,7,'JR'),(100,5,'CO'),(101,0,'UT'),(102,0,'QU'), +(103,0,'NU'),(104,0,'GA'),(105,7,'AK'),(106,0,'ZR'),(107,0,'YT'),(108,0,'MD'), +(109,0,'NU'),(110,1,'EL'),(111,0,'ME'),(112,0,'VT'),(113,2,'NU'),(114,0,'CO'), +(115,5,'TN'),(116,0,'OH'),(117,0,'GA'),(118,9,'GA'),(119,0,'CO'),(120,0,'AL'), +(121,0,'NU'),(122,2,'NE'),(123,2,'TX'),(124,3,'CO'),(125,0,'TN'),(126,0,'WA'), +(127,0,'NE'),(128,6,'TN'),(129,0,'BR'),(130,0,'ID'),(131,0,'NU'),(132,2,'EL'), +(133,0,'PR'),(134,0,'NU'),(135,1,'AZ'),(136,7,'EL'),(137,0,'TN'),(138,0,'PA'), +(139,5,'QU'),(140,0,'AR'),(141,0,'DC'),(142,2,'WA'),(143,7,'OH'),(144,2,'CO'), +(145,6,'NU'),(146,9,'FL'),(147,0,'HI'),(148,0,'WA'),(149,1,'BR'),(150,3,'QU'); +SELECT id, MIN(id) FROM t1 +WHERE (b > 'TX' OR b BETWEEN 'NE' AND 'SC') AND id IN (1,7,8) AND a = 5 +GROUP BY id; +id MIN(id) +8 8 +DROP TABLE t1; +# +# End of 11.0 tests +# set optimizer_switch=@mrr_icp_extra_tmp; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 32485bde46c..ec1ecfd8580 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -104,6 +104,8 @@ #define double_to_rows(A) ((A) >= ((double)HA_ROWS_MAX) ? HA_ROWS_MAX : (ha_rows) (A)) +#define double_to_ulonglong(A) ((A) >= ((double)ULONGLONG_MAX) ? ULONGLONG_MAX : (ulonglong) (A)) + inline double safe_filtered(double a, double b) { return b != 0 ? a/b*100.0 : 0.0; @@ -9168,7 +9170,7 @@ best_access_path(JOIN *join, best.use_join_buffer= TRUE; best.filter= 0; best.type= JT_HASH; - best.refills= (ulonglong) ceil(refills); + best.refills= double_to_ulonglong(ceil(refills)); if (unlikely(trace_access_hash.trace_started())) trace_access_hash. add("type", "hash"). @@ -9443,7 +9445,7 @@ best_access_path(JOIN *join, (record_count / (double) thd->variables.join_buff_size))); cur_cost= COST_MULT(cur_cost, tmp_refills); - refills= (ulonglong) tmp_refills; + refills= double_to_ulonglong(ceil(tmp_refills)); /* We come here only if there are already rows in the join cache */ DBUG_ASSERT(idx != join->const_tables); @@ -9523,7 +9525,7 @@ best_access_path(JOIN *join, /* range/index_merge/ALL/index access method are "independent", so: */ best.ref_depends_map= 0; best.use_join_buffer= use_join_buffer; - best.refills= (ulonglong) ceil(refills); + best.refills= refills; best.spl_plan= 0; best.type= type; trace_access_scan.add("chosen", true); From aac88fc205306ef80c229b379863b049bd68632b Mon Sep 17 00:00:00 2001 From: Monty Date: Sat, 27 May 2023 15:35:12 +0300 Subject: [PATCH 241/260] MDEV-31237 Assertion `!(tab->select && tab->select->quick)' failed in make_join_readinfo The problem was a wrong assert. I changed it to match the code in best_access_path(). The given test case was a bit tricky for the optimizer, which first decided on using a index scan (because of force index), but then test_if_skip_sort_order() decided to use range anyway to handle distinct. --- mysql-test/main/range.result | 15 +++++++++++++++ mysql-test/main/range.test | 12 ++++++++++++ mysql-test/main/range_mrr_icp.result | 15 +++++++++++++++ sql/sql_select.cc | 11 ++++++++++- 4 files changed, 52 insertions(+), 1 deletion(-) diff --git a/mysql-test/main/range.result b/mysql-test/main/range.result index 1e3d05e81e0..bf4a490ebec 100644 --- a/mysql-test/main/range.result +++ b/mysql-test/main/range.result @@ -3824,5 +3824,20 @@ id MIN(id) 8 8 DROP TABLE t1; # +# MDEV-31237 Assertion `!(tab->select && tab->select->quick)' failed +# in make_join_readinfo +# +CREATE TABLE lineitem (l_orderkey int, l_linenumber int, l_receiptDATE date DEFAULT NULL, PRIMARY KEY (l_orderkey,l_linenumber), KEY i_l_receiptdate (l_receiptDATE), KEY i_l_orderkey (l_orderkey)) ENGINE=InnoDB; +INSERT INTO lineitem VALUES (291,1,'1994-06-23'),(291,2,'1994-06-19'), +(291,3,'1994-03-24'),(292,1,'1992-03-18'),(292,2,'1992-04-20'); +EXPLAIN SELECT DISTINCT l_orderkey FROM lineitem FORCE KEY (i_l_orderkey, i_l_receiptdate) WHERE l_orderkey > 1 ORDER BY l_receiptdate; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE lineitem range i_l_orderkey i_l_orderkey 4 NULL 5 Using where; Using temporary; Using filesort +SELECT DISTINCT l_orderkey FROM lineitem FORCE KEY (i_l_orderkey, i_l_receiptdate) WHERE l_orderkey > 1 ORDER BY l_receiptdate; +l_orderkey +292 +291 +DROP TABLE lineitem; +# # End of 11.0 tests # diff --git a/mysql-test/main/range.test b/mysql-test/main/range.test index 5911fc45741..f20970939d9 100644 --- a/mysql-test/main/range.test +++ b/mysql-test/main/range.test @@ -2602,6 +2602,18 @@ WHERE (b > 'TX' OR b BETWEEN 'NE' AND 'SC') AND id IN (1,7,8) AND a = 5 GROUP BY id; DROP TABLE t1; +--echo # +--echo # MDEV-31237 Assertion `!(tab->select && tab->select->quick)' failed +--echo # in make_join_readinfo +--echo # + +CREATE TABLE lineitem (l_orderkey int, l_linenumber int, l_receiptDATE date DEFAULT NULL, PRIMARY KEY (l_orderkey,l_linenumber), KEY i_l_receiptdate (l_receiptDATE), KEY i_l_orderkey (l_orderkey)) ENGINE=InnoDB; +INSERT INTO lineitem VALUES (291,1,'1994-06-23'),(291,2,'1994-06-19'), + (291,3,'1994-03-24'),(292,1,'1992-03-18'),(292,2,'1992-04-20'); +EXPLAIN SELECT DISTINCT l_orderkey FROM lineitem FORCE KEY (i_l_orderkey, i_l_receiptdate) WHERE l_orderkey > 1 ORDER BY l_receiptdate; +SELECT DISTINCT l_orderkey FROM lineitem FORCE KEY (i_l_orderkey, i_l_receiptdate) WHERE l_orderkey > 1 ORDER BY l_receiptdate; +DROP TABLE lineitem; + --echo # --echo # End of 11.0 tests --echo # diff --git a/mysql-test/main/range_mrr_icp.result b/mysql-test/main/range_mrr_icp.result index b9d74cb3c18..569080cc283 100644 --- a/mysql-test/main/range_mrr_icp.result +++ b/mysql-test/main/range_mrr_icp.result @@ -3821,6 +3821,21 @@ id MIN(id) 8 8 DROP TABLE t1; # +# MDEV-31237 Assertion `!(tab->select && tab->select->quick)' failed +# in make_join_readinfo +# +CREATE TABLE lineitem (l_orderkey int, l_linenumber int, l_receiptDATE date DEFAULT NULL, PRIMARY KEY (l_orderkey,l_linenumber), KEY i_l_receiptdate (l_receiptDATE), KEY i_l_orderkey (l_orderkey)) ENGINE=InnoDB; +INSERT INTO lineitem VALUES (291,1,'1994-06-23'),(291,2,'1994-06-19'), +(291,3,'1994-03-24'),(292,1,'1992-03-18'),(292,2,'1992-04-20'); +EXPLAIN SELECT DISTINCT l_orderkey FROM lineitem FORCE KEY (i_l_orderkey, i_l_receiptdate) WHERE l_orderkey > 1 ORDER BY l_receiptdate; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE lineitem range i_l_orderkey i_l_orderkey 4 NULL 5 Using where; Using temporary; Using filesort +SELECT DISTINCT l_orderkey FROM lineitem FORCE KEY (i_l_orderkey, i_l_receiptdate) WHERE l_orderkey > 1 ORDER BY l_receiptdate; +l_orderkey +292 +291 +DROP TABLE lineitem; +# # End of 11.0 tests # set optimizer_switch=@mrr_icp_extra_tmp; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index ec1ecfd8580..cec3aa1f91f 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -15373,7 +15373,16 @@ make_join_readinfo(JOIN *join, ulonglong options, uint no_jbuf_after) push_index_cond(tab, tab->ref.key); break; case JT_NEXT: // Index scan - DBUG_ASSERT(!(tab->select && tab->select->quick)); + DBUG_ASSERT(!tab->quick); + if (tab->select) + { + /* + select->quick may be set if there was a possible range and + it had a higher cost than a table scan. + */ + delete tab->select->quick; + tab->select->quick=0; + } if (tab->use_quick == 2) { join->thd->set_status_no_good_index_used(); From 54324e542f322ffa8d0f70af7ec5c4323a4687c3 Mon Sep 17 00:00:00 2001 From: Daniel Bartholomew Date: Wed, 10 May 2023 08:11:15 -0400 Subject: [PATCH 242/260] bump the VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 2abc1c05da3..91b253ca00c 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=10 MYSQL_VERSION_MINOR=4 -MYSQL_VERSION_PATCH=29 +MYSQL_VERSION_PATCH=30 SERVER_MATURITY=stable From aa713f5ae20513b0c4d9a74ea3ba3ea3bbdcd719 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Tue, 9 May 2023 21:20:10 -0700 Subject: [PATCH 243/260] MDEV-31224 Crash with EXPLAIN EXTENDED for multi-table update of system table EXPLAIN EXTENDED should always print the field item used in the left part of an equality expression from the SET clause of an update statement as a reference to table column. Approved by Oleksandr Byelkin --- mysql-test/main/explain_non_select.result | 19 ++++++++++++++++++ mysql-test/main/explain_non_select.test | 20 +++++++++++++++++++ .../main/myisam_explain_non_select_all.result | 4 ++-- sql/sql_select.cc | 2 +- 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/mysql-test/main/explain_non_select.result b/mysql-test/main/explain_non_select.result index d60f10f85c8..1200a3f9400 100644 --- a/mysql-test/main/explain_non_select.result +++ b/mysql-test/main/explain_non_select.result @@ -277,3 +277,22 @@ EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 drop table t1,t2; +# +# MDEV-31224: EXPLAIN EXTENDED for multi-table update of system table +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3); +EXPLAIN EXTENDED UPDATE t1, t2 SET b = 4 WHERE a IN (6,2); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00 +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 update `test`.`t1` set `test`.`t2`.`b` = 4 where `test`.`t1`.`a` in (6,2) +UPDATE t1, t2 SET b = 4 WHERE a IN (6,2); +SELECT * from t2; +b +4 +DROP TABLE t1, t2; +# End of 10.4 tests diff --git a/mysql-test/main/explain_non_select.test b/mysql-test/main/explain_non_select.test index d9ff0fb7245..f87a5d9ec8d 100644 --- a/mysql-test/main/explain_non_select.test +++ b/mysql-test/main/explain_non_select.test @@ -250,3 +250,23 @@ PREPARE stmt FROM 'EXPLAIN INSERT INTO t1 SELECT * FROM t2'; EXECUTE stmt; drop table t1,t2; +--echo # +--echo # MDEV-31224: EXPLAIN EXTENDED for multi-table update of system table +--echo # + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); + +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3); + +let $q= +UPDATE t1, t2 SET b = 4 WHERE a IN (6,2); + +eval EXPLAIN EXTENDED $q; +eval $q; +SELECT * from t2; + +DROP TABLE t1, t2; + +--echo # End of 10.4 tests diff --git a/mysql-test/main/myisam_explain_non_select_all.result b/mysql-test/main/myisam_explain_non_select_all.result index 3ca9629d027..b515cb4fd83 100644 --- a/mysql-test/main/myisam_explain_non_select_all.result +++ b/mysql-test/main/myisam_explain_non_select_all.result @@ -2689,7 +2689,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 system NULL NULL NULL NULL 0 0.00 Const row not found 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Warnings: -Note 1003 update `test`.`t1` set NULL = 10 +Note 1003 update `test`.`t1` set `test`.`t2`.`c2` = 10 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 7 @@ -2734,7 +2734,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 system NULL NULL NULL NULL 0 0.00 Const row not found 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 update `test`.`t1` set NULL = 10 where `test`.`t1`.`c3` = 10 +Note 1003 update `test`.`t1` set `test`.`t2`.`c2` = 10 where `test`.`t1`.`c3` = 10 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 7 diff --git a/sql/sql_select.cc b/sql/sql_select.cc index bfe17bb43e1..cb60b3442d8 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -28138,7 +28138,7 @@ void st_select_lex::print_set_clause(THD *thd, String *str, else str->append(','); - item->print(str, query_type); + item->print(str, (enum_query_type) (query_type | QT_NO_DATA_EXPANSION)); str->append(STRING_WITH_LEN(" = ")); val->print(str, query_type); } From 8f3bf593d24de9cd4744e71c86de80cd502786c7 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Thu, 11 May 2023 23:34:41 -0700 Subject: [PATCH 244/260] MDEV-31240 Crash with condition pushable into derived and containing outer reference This bug could affect queries containing a subquery over splittable derived tables and having an outer references in its WHERE clause. If such subquery contained an equality condition whose left part was a reference to a column of the derived table and the right part referred only to outer columns then the server crashed in the function st_join_table::choose_best_splitting() The crashing code was added in the commit ce7ffe61d836fe9f0cfc1087f058bc40d66e5cfb that made the code of the function sensitive to presence of the flag OUTER_REF_TABLE_BIT in the KEYUSE_EXT::needed_in_prefix fields. The field needed_in_prefix of the KEYUSE_EXT structure should not contain table maps with OUTER_REF_TABLE_BIT or RAND_TABLE_BIT. Note that this fix is quite conservative: for affected queries it just returns the query plans that were used before the above mentioned commit. In fact the equalities causing crashes should be pushed into derived tables without any usage of split optimization. Approved by Sergei Petrunia --- mysql-test/main/derived_cond_pushdown.result | 94 ++++++++++++++++++++ mysql-test/main/derived_cond_pushdown.test | 41 +++++++++ sql/opt_split.cc | 3 +- 3 files changed, 137 insertions(+), 1 deletion(-) diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result index 4b202ea7a12..a4fc7a7447d 100644 --- a/mysql-test/main/derived_cond_pushdown.result +++ b/mysql-test/main/derived_cond_pushdown.result @@ -18358,4 +18358,98 @@ a deallocate prepare stmt; drop view v1; drop table t1; +# +# MDEV-31240: condition pushed into splittable derived has reference to +# outer column and does not refer to any column of embedding +# select +# +create table t1 (a int); +insert into t1 select seq from seq_1_to_1000; +create table t2 (a int, b int, key (a)); +insert into t2 select mod(seq,100), rand(13) * mod(seq,500) from seq_1_to_1000; +create table t3 (a int); +insert into t3 values (3), (1); +analyze table t1, t2, t3 persistent for all; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status Table is already up to date +test.t3 analyze status Engine-independent statistics collected +test.t3 analyze status OK +explain select +a, +( select concat(t3.a,'=',dt.s) +from +(select a, sum(b) as s from t2 group by a) as dt, +t3 +where dt.a=t1.a and t3.a < 3 +) +from t1 limit 5; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 1000 +2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY ref key0 key0 5 test.t1.a 2 +3 LATERAL DERIVED t2 ref a a 5 test.t1.a 10 +select +a, +( select concat(t3.a,'=',dt.s) +from +(select a, sum(b) as s from t2 group by a) as dt, +t3 +where dt.a=t1.a and t3.a < 3 +) +from t1 limit 5; +a ( select concat(t3.a,'=',dt.s) +from +(select a, sum(b) as s from t2 group by a) as dt, +t3 +where dt.a=t1.a and t3.a < 3 +) +1 1=804 +2 1=1056 +3 1=846 +4 1=947 +5 1=973 +truncate table t2; +insert into t2 select mod(seq,10), rand(15) * mod(seq,500) from seq_1_to_1000; +analyze table t2 persistent for all; +Table Op Msg_type Msg_text +test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status Table is already up to date +explain select +a, +( select concat(t3.a,'=',dt.s) +from +(select a, sum(b) as s from t2 group by a) as dt, +t3 +where dt.a=t1.a and t3.a < 3 +) +from t1 limit 5; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 1000 +2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY ref key0 key0 5 test.t1.a 100 +3 DERIVED t2 ALL a NULL NULL NULL 1000 Using temporary; Using filesort +select +a, +( select concat(t3.a,'=',dt.s) +from +(select a, sum(b) as s from t2 group by a) as dt, +t3 +where dt.a=t1.a and t3.a < 3 +) +from t1 limit 5; +a ( select concat(t3.a,'=',dt.s) +from +(select a, sum(b) as s from t2 group by a) as dt, +t3 +where dt.a=t1.a and t3.a < 3 +) +1 1=11858 +2 1=11380 +3 1=11588 +4 1=11373 +5 1=11612 +drop table t1,t2,t3; # End of 10.4 tests diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test index b4e131dbe79..7a4d9b4ad7d 100644 --- a/mysql-test/main/derived_cond_pushdown.test +++ b/mysql-test/main/derived_cond_pushdown.test @@ -3972,4 +3972,45 @@ deallocate prepare stmt; drop view v1; drop table t1; +--echo # +--echo # MDEV-31240: condition pushed into splittable derived has reference to +--echo # outer column and does not refer to any column of embedding +--echo # select +--echo # + +create table t1 (a int); +insert into t1 select seq from seq_1_to_1000; + +create table t2 (a int, b int, key (a)); +insert into t2 select mod(seq,100), rand(13) * mod(seq,500) from seq_1_to_1000; + +create table t3 (a int); +insert into t3 values (3), (1); + +analyze table t1, t2, t3 persistent for all; + +let $q= +select + a, + ( select concat(t3.a,'=',dt.s) + from + (select a, sum(b) as s from t2 group by a) as dt, + t3 + where dt.a=t1.a and t3.a < 3 + ) +from t1 limit 5; + +eval explain $q; +eval $q; + +truncate table t2; +insert into t2 select mod(seq,10), rand(15) * mod(seq,500) from seq_1_to_1000; + +analyze table t2 persistent for all; + +eval explain $q; +eval $q; + +drop table t1,t2,t3; + --echo # End of 10.4 tests diff --git a/sql/opt_split.cc b/sql/opt_split.cc index bb3aec9ee8d..6d816552baf 100644 --- a/sql/opt_split.cc +++ b/sql/opt_split.cc @@ -664,7 +664,8 @@ add_ext_keyuse_for_splitting(Dynamic_array *ext_keyuses, keyuse_ext.cond_guard= added_key_field->cond_guard; keyuse_ext.sj_pred_no= added_key_field->sj_pred_no; keyuse_ext.validity_ref= 0; - keyuse_ext.needed_in_prefix= added_key_field->val->used_tables(); + keyuse_ext.needed_in_prefix= added_key_field->val->used_tables() & + ~(OUTER_REF_TABLE_BIT | RAND_TABLE_BIT); keyuse_ext.validity_var= false; return ext_keyuses->push(keyuse_ext); } From 0fd54c98922a49a0a5ea5df6a4ca5320aaa82103 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 3 Jun 2023 10:15:18 +0200 Subject: [PATCH 245/260] Revert "MDEV-30473 : Do not allow GET_LOCK() / RELEASE_LOCK() in cluster" This reverts commit 844ddb1109410e0ab1d4444549932f1dddb7b845. This fixes MDEV-30967, MDEV-31325, MDEV-31388 --- .../suite/galera/r/galera_locks_funcs.result | 19 ------------------- .../suite/galera/t/galera_locks_funcs.test | 14 -------------- sql/item_create.cc | 14 -------------- 3 files changed, 47 deletions(-) delete mode 100644 mysql-test/suite/galera/r/galera_locks_funcs.result delete mode 100644 mysql-test/suite/galera/t/galera_locks_funcs.test diff --git a/mysql-test/suite/galera/r/galera_locks_funcs.result b/mysql-test/suite/galera/r/galera_locks_funcs.result deleted file mode 100644 index 378067aa461..00000000000 --- a/mysql-test/suite/galera/r/galera_locks_funcs.result +++ /dev/null @@ -1,19 +0,0 @@ -connection node_2; -connection node_1; -CREATE TABLE t (c DOUBLE,c2 INT,PRIMARY KEY(c)) ENGINE=InnoDB; -INSERT INTO t values (1,1); -SELECT GET_LOCK('a',1); -ERROR 42000: This version of MariaDB doesn't yet support 'GET_LOCK in cluster (WSREP_ON=ON)' -SHOW WARNINGS; -Level Code Message -Error 1235 This version of MariaDB doesn't yet support 'GET_LOCK in cluster (WSREP_ON=ON)' -SELECT * FROM t; -c c2 -1 1 -SELECT RELEASE_LOCK('a'); -ERROR 42000: This version of MariaDB doesn't yet support 'RELEASE_LOCK in cluster (WSREP_ON=ON)' -SHOW WARNINGS; -Level Code Message -Error 1235 This version of MariaDB doesn't yet support 'RELEASE_LOCK in cluster (WSREP_ON=ON)' -COMMIT; -DROP TABLE t; diff --git a/mysql-test/suite/galera/t/galera_locks_funcs.test b/mysql-test/suite/galera/t/galera_locks_funcs.test deleted file mode 100644 index 68737f2daab..00000000000 --- a/mysql-test/suite/galera/t/galera_locks_funcs.test +++ /dev/null @@ -1,14 +0,0 @@ ---source include/galera_cluster.inc - -CREATE TABLE t (c DOUBLE,c2 INT,PRIMARY KEY(c)) ENGINE=InnoDB; -INSERT INTO t values (1,1); ---error ER_NOT_SUPPORTED_YET -SELECT GET_LOCK('a',1); -SHOW WARNINGS; -SELECT * FROM t; ---error ER_NOT_SUPPORTED_YET -SELECT RELEASE_LOCK('a'); -SHOW WARNINGS; -COMMIT; -DROP TABLE t; - diff --git a/sql/item_create.cc b/sql/item_create.cc index 616ba3a641a..29d9563d1d1 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -4933,13 +4933,6 @@ Create_func_get_lock Create_func_get_lock::s_singleton; Item* Create_func_get_lock::create_2_arg(THD *thd, Item *arg1, Item *arg2) { -#ifdef WITH_WSREP - if (WSREP_ON && WSREP(thd)) - { - my_error(ER_NOT_SUPPORTED_YET, MYF(0), "GET_LOCK in cluster (WSREP_ON=ON)"); - return NULL; - } -#endif /* WITH_WSREP */ thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT); return new (thd->mem_root) Item_func_get_lock(thd, arg1, arg2); @@ -6542,13 +6535,6 @@ Create_func_release_lock Create_func_release_lock::s_singleton; Item* Create_func_release_lock::create_1_arg(THD *thd, Item *arg1) { -#ifdef WITH_WSREP - if (WSREP_ON && WSREP(thd)) - { - my_error(ER_NOT_SUPPORTED_YET, MYF(0), "RELEASE_LOCK in cluster (WSREP_ON=ON)"); - return NULL; - } -#endif /* WITH_WSREP */ thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT); return new (thd->mem_root) Item_func_release_lock(thd, arg1); From eb472f77e3f6696bbdbe48d15e71a2c444edc5e1 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 3 Jun 2023 10:35:59 +0200 Subject: [PATCH 246/260] Revert "MDEV-30473 : Do not allow GET_LOCK() / RELEASE_LOCK() in cluster" This reverts commit b05218e08f45a17f46d1b73cbb9dcb2969dc04cd. --- mysql-test/suite/galera/r/MDEV-24143.result | 23 ++++++++++++ .../galera/r/galera_bf_abort_get_lock.result | 18 ++++++++++ mysql-test/suite/galera/t/MDEV-24143.test | 20 +++++++++++ .../galera/t/galera_bf_abort_get_lock.test | 36 +++++++++++++++++++ 4 files changed, 97 insertions(+) create mode 100644 mysql-test/suite/galera/r/MDEV-24143.result create mode 100644 mysql-test/suite/galera/r/galera_bf_abort_get_lock.result create mode 100644 mysql-test/suite/galera/t/MDEV-24143.test create mode 100644 mysql-test/suite/galera/t/galera_bf_abort_get_lock.test diff --git a/mysql-test/suite/galera/r/MDEV-24143.result b/mysql-test/suite/galera/r/MDEV-24143.result new file mode 100644 index 00000000000..860d8a35834 --- /dev/null +++ b/mysql-test/suite/galera/r/MDEV-24143.result @@ -0,0 +1,23 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 BINARY (10), c3 DATETIME); +SELECT get_lock ('test2', 0); +get_lock ('test2', 0) +1 +DROP TABLE t1; +CREATE TABLE t1 (c1 SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY); +INSERT INTO t1 VALUES (1); +SET SESSION wsrep_trx_fragment_size=10; +SET SESSION autocommit=0; +SELECT * FROM t1 WHERE c1 <=0 ORDER BY c1 DESC; +c1 +INSERT INTO t1 VALUES (4),(3),(1),(2); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +CREATE TABLE t1 (pk INT PRIMARY KEY, b INT) ENGINE=SEQUENCE; +ERROR 42S01: Table 't1' already exists +ALTER TABLE t1 DROP COLUMN c2; +ERROR 42000: Can't DROP COLUMN `c2`; check that it exists +SELECT get_lock ('test', 1.5); +get_lock ('test', 1.5) +1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_bf_abort_get_lock.result b/mysql-test/suite/galera/r/galera_bf_abort_get_lock.result new file mode 100644 index 00000000000..0ef2a1a72c6 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_bf_abort_get_lock.result @@ -0,0 +1,18 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +connection node_2a; +SELECT GET_LOCK("foo", 1000); +GET_LOCK("foo", 1000) +1 +connection node_2; +SET AUTOCOMMIT=OFF; +INSERT INTO t1 VALUES (1); +SELECT GET_LOCK("foo", 1000);; +connection node_1; +INSERT INTO t1 VALUES (1); +connection node_2; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +wsrep_local_aborts_increment +1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/MDEV-24143.test b/mysql-test/suite/galera/t/MDEV-24143.test new file mode 100644 index 00000000000..e58f147cb7c --- /dev/null +++ b/mysql-test/suite/galera/t/MDEV-24143.test @@ -0,0 +1,20 @@ +--source include/galera_cluster.inc +--source include/have_sequence.inc + +CREATE TABLE t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 BINARY (10), c3 DATETIME); +SELECT get_lock ('test2', 0); +DROP TABLE t1; +CREATE TABLE t1 (c1 SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY); +INSERT INTO t1 VALUES (1); +SET SESSION wsrep_trx_fragment_size=10; +SET SESSION autocommit=0; +SELECT * FROM t1 WHERE c1 <=0 ORDER BY c1 DESC; +--error ER_LOCK_DEADLOCK +INSERT INTO t1 VALUES (4),(3),(1),(2); +--error ER_TABLE_EXISTS_ERROR +CREATE TABLE t1 (pk INT PRIMARY KEY, b INT) ENGINE=SEQUENCE; +--error ER_CANT_DROP_FIELD_OR_KEY +ALTER TABLE t1 DROP COLUMN c2; +SELECT get_lock ('test', 1.5); +DROP TABLE t1; + diff --git a/mysql-test/suite/galera/t/galera_bf_abort_get_lock.test b/mysql-test/suite/galera/t/galera_bf_abort_get_lock.test new file mode 100644 index 00000000000..72fc1c5b583 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_bf_abort_get_lock.test @@ -0,0 +1,36 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc + +# +# Test a local transaction being aborted by a slave one while it is running a GET_LOCK() +# + +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; + +--let $galera_connection_name = node_2a +--let $galera_server_number = 2 +--source include/galera_connect.inc +--connection node_2a +SELECT GET_LOCK("foo", 1000); + +--connection node_2 +SET AUTOCOMMIT=OFF; +--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` +INSERT INTO t1 VALUES (1); +--send SELECT GET_LOCK("foo", 1000); + +--connection node_1 +INSERT INTO t1 VALUES (1); + +--connection node_2 +--error ER_LOCK_DEADLOCK +--reap + +--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` + +# Check that wsrep_local_bf_aborts has been incremented by exactly 1 +--disable_query_log +--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 1 AS wsrep_local_aborts_increment; +--enable_query_log + +DROP TABLE t1; From 318012a80a5b4365b4942edf2723742503a9fd1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 19 May 2023 12:19:26 +0300 Subject: [PATCH 247/260] MDEV-31234 InnoDB does not free UNDO after the fix of MDEV-30671 trx_purge_truncate_history(): Only call trx_purge_truncate_rseg_history() if the rollback segment is safe to process. This will avoid leaking undo log pages that are not yet ready to be processed. This fixes a regression that was introduced in commit 0de3be8cfdfc26f5c236eaefe12d03c7b4af22c8 (MDEV-30671). trx_sys_t::any_active_transactions(): Separately count XA PREPARE transactions. srv_purge_should_exit(): Terminate slow shutdown if the history size does not change and XA PREPARE transactions exist in the system. This will avoid a hang of the test innodb.recovery_shutdown. Tested by: Matthias Leich --- storage/innobase/include/trx0sys.h | 2 +- storage/innobase/srv/srv0srv.cc | 41 ++++++++++++++++++------------ storage/innobase/trx/trx0purge.cc | 10 +++----- storage/innobase/trx/trx0sys.cc | 24 +++++++++++++---- 4 files changed, 48 insertions(+), 29 deletions(-) diff --git a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h index e033a3e1fe4..016ac0b1363 100644 --- a/storage/innobase/include/trx0sys.h +++ b/storage/innobase/include/trx0sys.h @@ -1055,7 +1055,7 @@ public: void close(); /** @return total number of active (non-prepared) transactions */ - ulint any_active_transactions(); + size_t any_active_transactions(size_t *prepared= nullptr); /** diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 57aa4bef9fe..50569f810ea 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -1697,7 +1697,7 @@ void srv_master_callback(void*) } /** @return whether purge should exit due to shutdown */ -static bool srv_purge_should_exit() +static bool srv_purge_should_exit(size_t old_history_size) { ut_ad(srv_shutdown_state <= SRV_SHUTDOWN_CLEANUP); @@ -1708,7 +1708,12 @@ static bool srv_purge_should_exit() return true; /* Slow shutdown was requested. */ - if (const size_t history_size= trx_sys.rseg_history_len) + size_t prepared, active= trx_sys.any_active_transactions(&prepared); + const size_t history_size= trx_sys.rseg_history_len; + + if (!history_size); + else if (!active && history_size == old_history_size && prepared); + else { static time_t progress_time; time_t now= time(NULL); @@ -1725,7 +1730,7 @@ static bool srv_purge_should_exit() return false; } - return !trx_sys.any_active_transactions(); + return !active; } /*********************************************************************//** @@ -1845,7 +1850,7 @@ static size_t srv_do_purge(ulint* n_total_purged) *n_total_purged += n_pages_purged; } while (n_pages_purged > 0 && !purge_sys.paused() - && !srv_purge_should_exit()); + && !srv_purge_should_exit(rseg_history_len)); return(rseg_history_len); } @@ -1960,7 +1965,7 @@ static void purge_coordinator_callback_low() } } while ((purge_sys.enabled() && !purge_sys.paused()) || - !srv_purge_should_exit()); + !srv_purge_should_exit(trx_sys.rseg_history_len)); } static void purge_coordinator_callback(void*) @@ -2031,15 +2036,19 @@ ulint srv_get_task_queue_length() /** Shut down the purge threads. */ void srv_purge_shutdown() { - if (purge_sys.enabled()) { - if (!srv_fast_shutdown && !opt_bootstrap) - srv_update_purge_thread_count(innodb_purge_threads_MAX); - while(!srv_purge_should_exit()) { - ut_a(!purge_sys.paused()); - srv_wake_purge_thread_if_not_active(); - purge_coordinator_task.wait(); - } - purge_sys.coordinator_shutdown(); - srv_shutdown_purge_tasks(); - } + if (purge_sys.enabled()) + { + if (!srv_fast_shutdown && !opt_bootstrap) + srv_update_purge_thread_count(innodb_purge_threads_MAX); + size_t history_size= trx_sys.rseg_history_len; + while (!srv_purge_should_exit(history_size)) + { + history_size= trx_sys.rseg_history_len; + ut_a(!purge_sys.paused()); + srv_wake_purge_thread_if_not_active(); + purge_coordinator_task.wait(); + } + purge_sys.coordinator_shutdown(); + srv_shutdown_purge_tasks(); + } } diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index b22a85f4646..97979a3fefe 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -448,12 +448,7 @@ func_exit: prev_hdr_addr.boffset = static_cast(prev_hdr_addr.boffset - TRX_UNDO_HISTORY_NODE); - if (!rseg.trx_ref_count - && rseg.needs_purge <= (purge_sys.head.trx_no - ? purge_sys.head.trx_no - : purge_sys.tail.trx_no) - && mach_read_from_2(TRX_UNDO_SEG_HDR + TRX_UNDO_STATE - + block->frame) + if (mach_read_from_2(TRX_UNDO_SEG_HDR + TRX_UNDO_STATE + block->frame) == TRX_UNDO_TO_PURGE && !mach_read_from_2(block->frame + hdr_addr.boffset + TRX_UNDO_NEXT_LOG)) { @@ -544,7 +539,8 @@ static void trx_purge_truncate_history() ut_ad(rseg->id == i); ut_ad(rseg->is_persistent()); mutex_enter(&rseg->mutex); - trx_purge_truncate_rseg_history(*rseg, head); + if (!rseg->trx_ref_count && rseg->needs_purge <= head.trx_no) + trx_purge_truncate_rseg_history(*rseg, head); mutex_exit(&rseg->mutex); } } diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc index bcde969eb41..ab3de55db64 100644 --- a/storage/innobase/trx/trx0sys.cc +++ b/storage/innobase/trx/trx0sys.cc @@ -325,15 +325,29 @@ trx_sys_t::close() } /** @return total number of active (non-prepared) transactions */ -ulint trx_sys_t::any_active_transactions() +size_t trx_sys_t::any_active_transactions(size_t *prepared) { - uint32_t total_trx= 0; + size_t total_trx= 0, prepared_trx= 0; - trx_sys.trx_list.for_each([&total_trx](const trx_t &trx) { - if (trx.state == TRX_STATE_COMMITTED_IN_MEMORY || - (trx.state == TRX_STATE_ACTIVE && trx.id)) + trx_sys.trx_list.for_each([&](const trx_t &trx) { + switch (trx.state) { + case TRX_STATE_NOT_STARTED: + break; + case TRX_STATE_ACTIVE: + if (!trx.id) + break; + /* fall through */ + case TRX_STATE_COMMITTED_IN_MEMORY: total_trx++; + break; + case TRX_STATE_PREPARED: + case TRX_STATE_PREPARED_RECOVERED: + prepared_trx++; + } }); + if (prepared) + *prepared= prepared_trx; + return total_trx; } From 48d6a5f61bde7065cc04a9d225514535780b34a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 24 May 2023 08:25:26 +0300 Subject: [PATCH 248/260] MDEV-31234 fixup: Free some UNDO pages earlier trx_purge_truncate_rseg_history(): Add a parameter to specify if the entire rollback segment is safe to be freed. If not, we may still be able to invoke trx_undo_truncate_start() and free some pages. --- storage/innobase/trx/trx0purge.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index 97979a3fefe..c5ec42ecfce 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -399,12 +399,14 @@ void trx_purge_free_segment(mtr_t &mtr, trx_rseg_t* rseg, fil_addr_t hdr_addr) /** Remove unnecessary history data from a rollback segment. @param[in,out] rseg rollback segment -@param[in] limit truncate anything before this */ +@param[in] limit truncate anything before this +@param[in] all whether everything can be truncated */ static void trx_purge_truncate_rseg_history( trx_rseg_t& rseg, - const purge_sys_t::iterator& limit) + const purge_sys_t::iterator& limit, + bool all) { fil_addr_t hdr_addr; fil_addr_t prev_hdr_addr; @@ -443,6 +445,10 @@ func_exit: goto func_exit; } + if (!all) { + goto func_exit; + } + prev_hdr_addr = flst_get_prev_addr(block->frame + hdr_addr.boffset + TRX_UNDO_HISTORY_NODE); prev_hdr_addr.boffset = static_cast(prev_hdr_addr.boffset @@ -539,8 +545,9 @@ static void trx_purge_truncate_history() ut_ad(rseg->id == i); ut_ad(rseg->is_persistent()); mutex_enter(&rseg->mutex); - if (!rseg->trx_ref_count && rseg->needs_purge <= head.trx_no) - trx_purge_truncate_rseg_history(*rseg, head); + trx_purge_truncate_rseg_history(*rseg, head, + !rseg->trx_ref_count && + rseg->needs_purge <= head.trx_no); mutex_exit(&rseg->mutex); } } From 3b4b512d8e42bb3d33cf78789754cd10ff310646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 23 May 2023 12:20:27 +0300 Subject: [PATCH 249/260] MDEV-31234 fixup: Allow innodb_undo_log_truncate=ON after upgrade trx_purge_truncate_history(): Relax a condition that would prevent undo log truncation if the undo log tablespaces were "contaminated" by the bug that commit e0084b9d315f10e3ceb578b65e144d751b208bf1 fixed. That is, trx_purge_truncate_rseg_history() would have invoked flst_remove() on TRX_RSEG_HISTORY but not reduced TRX_RSEG_HISTORY_SIZE. To avoid any regression with normal operation, we implement this fixup during slow shutdown only. The condition on the history list being empty is necessary: without it, in the test innodb.undo_truncate_recover there may be much fewer than the expected 90,000 calls to row_purge() before the truncation. That is, we would truncate the undo tablespace before actually having processed all undo log records in it. To truncate such "contaminated" or "bloated" undo log tablespaces (when using innodb_undo_tablespaces=2 or more) you can execute the following SQL: BEGIN;INSERT mysql.innodb_table_stats VALUES('','',DEFAULT,0,0,0);ROLLBACK; SET GLOBAL innodb_undo_log_truncate=ON, innodb_fast_shutdown=0; SHUTDOWN; The first line creates a dummy InnoDB transaction, to ensure that there will be some history to be purged during shutdown and that the undo tablespaces will be truncated. --- storage/innobase/trx/trx0purge.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index c5ec42ecfce..2f21a4de1e6 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -626,7 +626,8 @@ static void trx_purge_truncate_history() ut_ad(rseg->curr_size > cached); - if (rseg->curr_size > cached + 1) + if (rseg->curr_size > cached + 1 && + (srv_fast_shutdown || srv_undo_sources || trx_sys.rseg_history_len)) goto not_free; mutex_exit(&rseg->mutex); From e89bd39c9b9c85454c3db21458b361a116100eb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 26 May 2023 16:16:10 +0300 Subject: [PATCH 250/260] MDEV-31343 Another server hang with innodb_undo_log_truncate=ON trx_purge_truncate_history(): While waiting for a write-fixed block to become available, simply wait for an exclusive latch on it. Also, simplify the iteration: first check for oldest_modification>2 (to ignore clean pages or pages belonging to the temporary tablespace) and then compare the tablespace identifier. Before releasing buf_pool.flush_list_mutex we will buffer-fix the block of interest. In that way, buf_page_t::can_relocate() will not hold on the block and it must remain in the buffer pool until we have acquired an exclusive latch on it. If the block is still dirty, we will register it with the tablespace truncation mini-transaction; else, we will simply release the latch and buffer-fix and move to the next block. This also reverts commit c4d79399895827c592d12b7be4b7ef21443d3a0f because that fix should no longer be necessary; the wait for an exclusive block latch should allow buf_pool_t::release_freed_page() on the same block to proceed. Tested by: Axel Schwenke, Matthias Leich --- storage/innobase/trx/trx0purge.cc | 42 ++++++++++++++++--------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index b04e71ba871..4b4afab5ef6 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -706,6 +706,7 @@ not_free: mtr_t mtr; mtr.start(); mtr.x_lock_space(&space); + const auto space_id= space.id; /* Lock all modified pages of the tablespace. @@ -715,8 +716,8 @@ not_free: mini-transaction commit and the server was killed, then discarding the to-be-trimmed pages without flushing would break crash recovery. */ + rescan: mysql_mutex_lock(&buf_pool.flush_list_mutex); - for (buf_page_t *bpage= UT_LIST_GET_LAST(buf_pool.flush_list); bpage; ) { ut_ad(bpage->oldest_modification()); @@ -724,46 +725,47 @@ not_free: buf_page_t *prev= UT_LIST_GET_PREV(list, bpage); - if (bpage->id().space() == space.id && - bpage->oldest_modification() != 1) + if (bpage->oldest_modification() > 2 && bpage->id().space() == space_id) { ut_ad(bpage->frame); - auto block= reinterpret_cast(bpage); - if (!bpage->lock.x_lock_try()) + bpage->fix(); { - rescan: - /* Let buf_pool_t::release_freed_page() proceed. */ + /* Try to acquire an exclusive latch while the cache line is + fresh after fix(). */ + const bool got_lock{bpage->lock.x_lock_try()}; + buf_pool.flush_hp.set(prev); mysql_mutex_unlock(&buf_pool.flush_list_mutex); - mysql_mutex_lock(&buf_pool.mutex); - mysql_mutex_lock(&buf_pool.flush_list_mutex); - mysql_mutex_unlock(&buf_pool.mutex); - bpage= UT_LIST_GET_LAST(buf_pool.flush_list); - continue; + if (!got_lock) + bpage->lock.x_lock(); } - buf_pool.flush_hp.set(prev); - mysql_mutex_unlock(&buf_pool.flush_list_mutex); #ifdef BTR_CUR_HASH_ADAPT - ut_ad(!block->index); /* There is no AHI on undo tablespaces. */ + /* There is no AHI on undo tablespaces. */ + ut_ad(!reinterpret_cast(bpage)->index); #endif - bpage->fix(); ut_ad(!bpage->is_io_fixed()); - mysql_mutex_lock(&buf_pool.flush_list_mutex); + ut_ad(bpage->id().space() == space_id); - if (bpage->oldest_modification() > 1) + if (bpage->oldest_modification() > 2) { + mtr.memo_push(reinterpret_cast(bpage), + MTR_MEMO_PAGE_X_FIX); + mysql_mutex_lock(&buf_pool.flush_list_mutex); + ut_ad(bpage->oldest_modification() > 2); bpage->reset_oldest_modification(); - mtr.memo_push(block, MTR_MEMO_PAGE_X_FIX); } else { bpage->unfix(); bpage->lock.x_unlock(); + mysql_mutex_lock(&buf_pool.flush_list_mutex); } if (prev != buf_pool.flush_hp.get()) - /* Rescan, because we may have lost the position. */ + { + mysql_mutex_unlock(&buf_pool.flush_list_mutex); goto rescan; + } } bpage= prev; From 459eb9a68646a73033336f46fd7ce7f510e1767b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 22 May 2023 17:10:25 +0300 Subject: [PATCH 251/260] MDEV-29593 fixup: Avoid a leak if rseg.undo_cached is corrupted trx_purge_truncate_rseg_history(): Avoid a leak similar to the one that was fixed in MDEV-31324, in case a supposedly cached undo log page is not found in the rseg.undo_cached list. --- storage/innobase/trx/trx0purge.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index 4b4afab5ef6..17666ddbd64 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -510,9 +510,9 @@ loop: if (undo->hdr_page_no == hdr_addr.page) goto found_cached; ut_ad("inconsistent undo logs" == 0); - break; - found_cached: - UT_LIST_REMOVE(rseg.undo_cached, undo); + if (false) + found_cached: + UT_LIST_REMOVE(rseg.undo_cached, undo); static_assert(FIL_NULL == 0xffffffff, ""); if (UNIV_UNLIKELY(mach_read_from_4(TRX_RSEG + TRX_RSEG_FORMAT + rseg_hdr->page.frame))) From 883333a74eb4b8d88b765dd5a111c24400996e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 11 May 2023 08:43:00 +0300 Subject: [PATCH 252/260] MDEV-31158: Potential hang with ROW_FORMAT=COMPRESSED tables btr_cur_need_opposite_intention(): Check also page_zip_available() so that we will escalate to exclusive index latch when a non-leaf page may have to be split further due to ROW_FORMAT=COMPRESSED page overflow. Tested by: Matthias Leich --- .../suite/innodb_zip/r/page_size.result | 21 +++++++++++++++ mysql-test/suite/innodb_zip/t/page_size.test | 24 +++++++++++++++++ storage/innobase/btr/btr0cur.cc | 27 ++++++++++++------- 3 files changed, 63 insertions(+), 9 deletions(-) diff --git a/mysql-test/suite/innodb_zip/r/page_size.result b/mysql-test/suite/innodb_zip/r/page_size.result index 47effe06884..48b954c945b 100644 --- a/mysql-test/suite/innodb_zip/r/page_size.result +++ b/mysql-test/suite/innodb_zip/r/page_size.result @@ -608,4 +608,25 @@ SET GLOBAL innodb_compression_level=0; INSERT INTO t1 VALUES (''); SET GLOBAL innodb_compression_level= @save_innodb_compression_level; DROP TABLE t1; +# +# MDEV-31158 Assertion ...MTR_MEMO_X_LOCKED in btr_attach_half_pages() +# +SET @save_compression_level=@@GLOBAL.innodb_compression_level; +SET GLOBAL innodb_compression_level=0; +CREATE TEMPORARY TABLE t(a SERIAL, prefix VARBINARY(4), pad INT); +INSERT INTO t(prefix, pad) VALUES +(_binary 0xff,160),('',19),(_binary 0x0001,253),(_binary 0x0b11,169), +(_binary 0x0b010001,23),(_binary 0x0b100001,251),(_binary 0x0d,163), +(_binary 0xb3,254),(_binary 0x96,254),(_binary 0xeb,61), +(_binary 0xf231,253),(_binary 0x1db0,253),(_binary 0x0005,101), +(_binary 0x6370,253),(_binary 0x0b12,112),(_binary 0x0b010002,23), +(_binary 0x0b100002,80),(_binary 0x181984,163),(_binary 0x181926,168), +(_binary 0xe1,176),(_binary 0xe2,187),(_binary 0xe6,254),(_binary 0xbb,51), +(_binary 0x1c,248),(_binary 0x8a,94),(_binary 0x14,254); +CREATE TABLE u(a SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, +b VARBINARY(255), KEY(b)) ENGINE=InnoDB +KEY_BLOCK_SIZE=1 ROW_FORMAT=COMPRESSED; +INSERT INTO u SELECT a,CONCAT(prefix,REPEAT(chr(0),pad)) FROM t; +DROP TABLE u, t; +SET GLOBAL innodb_compression_level=@save_compression_level; # End of 10.6 tests diff --git a/mysql-test/suite/innodb_zip/t/page_size.test b/mysql-test/suite/innodb_zip/t/page_size.test index 16d65a139cf..3455ef8ed94 100644 --- a/mysql-test/suite/innodb_zip/t/page_size.test +++ b/mysql-test/suite/innodb_zip/t/page_size.test @@ -888,4 +888,28 @@ INSERT INTO t1 VALUES (''); SET GLOBAL innodb_compression_level= @save_innodb_compression_level; DROP TABLE t1; +--echo # +--echo # MDEV-31158 Assertion ...MTR_MEMO_X_LOCKED in btr_attach_half_pages() +--echo # +--source include/have_innodb.inc + +SET @save_compression_level=@@GLOBAL.innodb_compression_level; +SET GLOBAL innodb_compression_level=0; +CREATE TEMPORARY TABLE t(a SERIAL, prefix VARBINARY(4), pad INT); +INSERT INTO t(prefix, pad) VALUES +(_binary 0xff,160),('',19),(_binary 0x0001,253),(_binary 0x0b11,169), +(_binary 0x0b010001,23),(_binary 0x0b100001,251),(_binary 0x0d,163), +(_binary 0xb3,254),(_binary 0x96,254),(_binary 0xeb,61), +(_binary 0xf231,253),(_binary 0x1db0,253),(_binary 0x0005,101), +(_binary 0x6370,253),(_binary 0x0b12,112),(_binary 0x0b010002,23), +(_binary 0x0b100002,80),(_binary 0x181984,163),(_binary 0x181926,168), +(_binary 0xe1,176),(_binary 0xe2,187),(_binary 0xe6,254),(_binary 0xbb,51), +(_binary 0x1c,248),(_binary 0x8a,94),(_binary 0x14,254); +CREATE TABLE u(a SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, + b VARBINARY(255), KEY(b)) ENGINE=InnoDB + KEY_BLOCK_SIZE=1 ROW_FORMAT=COMPRESSED; +INSERT INTO u SELECT a,CONCAT(prefix,REPEAT(chr(0),pad)) FROM t; +DROP TABLE u, t; +SET GLOBAL innodb_compression_level=@save_compression_level; + --echo # End of 10.6 tests diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 70b0ae4c32c..784e32a11c1 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -748,18 +748,24 @@ btr_cur_will_modify_tree( /** Detects whether the modifying record might need a opposite modification to the intention. -@param page page -@param lock_intention lock intention for the tree operation +@param bpage buffer pool page +@param is_clust whether this is a clustered index +@param lock_intention lock intention for the tree operation @param node_ptr_max_size the maximum size of a node pointer @param compress_limit BTR_CUR_PAGE_COMPRESS_LIMIT(index) -@param rec record (current node_ptr) -@return true if tree modification is needed */ -static bool btr_cur_need_opposite_intention(const page_t *page, +@param rec record (current node_ptr) +@return true if tree modification is needed */ +static bool btr_cur_need_opposite_intention(const buf_page_t &bpage, + bool is_clust, btr_intention_t lock_intention, ulint node_ptr_max_size, ulint compress_limit, const rec_t *rec) { + if (UNIV_LIKELY_NULL(bpage.zip.data) && + !page_zip_available(&bpage.zip, is_clust, node_ptr_max_size, 1)) + return true; + const page_t *const page= bpage.frame; if (lock_intention != BTR_INTENTION_INSERT) { /* We compensate also for btr_cur_compress_recommendation() */ @@ -1342,7 +1348,8 @@ release_tree: !btr_block_get(*index(), btr_page_get_next(block->page.frame), RW_X_LATCH, false, mtr, &err)) goto func_exit; - if (btr_cur_need_opposite_intention(block->page.frame, lock_intention, + if (btr_cur_need_opposite_intention(block->page, index()->is_clust(), + lock_intention, node_ptr_max_size, compress_limit, page_cur.rec)) goto need_opposite_intention; @@ -1398,7 +1405,8 @@ release_tree: default: break; case BTR_MODIFY_TREE: - if (btr_cur_need_opposite_intention(block->page.frame, lock_intention, + if (btr_cur_need_opposite_intention(block->page, index()->is_clust(), + lock_intention, node_ptr_max_size, compress_limit, page_cur.rec)) /* If the rec is the first or last in the page for pessimistic @@ -1948,7 +1956,7 @@ index_locked: break; if (!index->lock.have_x() && - btr_cur_need_opposite_intention(block->page.frame, + btr_cur_need_opposite_intention(block->page, index->is_clust(), lock_intention, node_ptr_max_size, compress_limit, page_cur.rec)) @@ -1995,7 +2003,8 @@ index_locked: ut_ad(latch_mode != BTR_MODIFY_TREE || upper_rw_latch == RW_X_LATCH); if (latch_mode != BTR_MODIFY_TREE); - else if (btr_cur_need_opposite_intention(block->page.frame, lock_intention, + else if (btr_cur_need_opposite_intention(block->page, index->is_clust(), + lock_intention, node_ptr_max_size, compress_limit, page_cur.rec)) { From 89eb6fa8a7f0d76c9b24e28646e1fe3401b5f4c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 19 May 2023 15:29:26 +0300 Subject: [PATCH 253/260] MDEV-31308 InnoDB monitor trx_rseg_history_len was accidentally disabled by default innodb_counter_info[]: Revert a change that was accidentally made in commit 204e7225dce32130ac2c96f469611d2cb421241e --- mysql-test/suite/innodb/r/monitor.result | 138 ++++++++++++----------- mysql-test/suite/innodb/t/monitor.test | 4 +- storage/innobase/srv/srv0mon.cc | 2 +- 3 files changed, 74 insertions(+), 70 deletions(-) diff --git a/mysql-test/suite/innodb/r/monitor.result b/mysql-test/suite/innodb/r/monitor.result index c874a84d26b..22e6fbea1e3 100644 --- a/mysql-test/suite/innodb/r/monitor.result +++ b/mysql-test/suite/innodb/r/monitor.result @@ -1,10 +1,9 @@ -set global innodb_monitor_disable = All; select name, if(enabled,'enabled','disabled') status from information_schema.innodb_metrics; name status metadata_table_handles_opened disabled -lock_deadlocks disabled -lock_timeouts disabled +lock_deadlocks enabled +lock_timeouts enabled lock_rec_lock_waits disabled lock_table_lock_waits disabled lock_rec_lock_requests disabled @@ -14,32 +13,32 @@ lock_rec_locks disabled lock_table_lock_created disabled lock_table_lock_removed disabled lock_table_locks disabled -lock_row_lock_current_waits disabled -lock_row_lock_time disabled -lock_row_lock_time_max disabled -lock_row_lock_waits disabled -lock_row_lock_time_avg disabled -buffer_pool_size disabled -buffer_pool_reads disabled -buffer_pool_read_requests disabled -buffer_pool_write_requests disabled -buffer_pool_wait_free disabled -buffer_pool_read_ahead disabled -buffer_pool_read_ahead_evicted disabled -buffer_pool_pages_total disabled -buffer_pool_pages_misc disabled -buffer_pool_pages_data disabled -buffer_pool_bytes_data disabled -buffer_pool_pages_dirty disabled -buffer_pool_bytes_dirty disabled -buffer_pool_pages_free disabled -buffer_pages_created disabled -buffer_pages_written disabled -buffer_pages_read disabled -buffer_index_sec_rec_cluster_reads disabled -buffer_index_sec_rec_cluster_reads_avoided disabled -buffer_data_reads disabled -buffer_data_written disabled +lock_row_lock_current_waits enabled +lock_row_lock_time enabled +lock_row_lock_time_max enabled +lock_row_lock_waits enabled +lock_row_lock_time_avg enabled +buffer_pool_size enabled +buffer_pool_reads enabled +buffer_pool_read_requests enabled +buffer_pool_write_requests enabled +buffer_pool_wait_free enabled +buffer_pool_read_ahead enabled +buffer_pool_read_ahead_evicted enabled +buffer_pool_pages_total enabled +buffer_pool_pages_misc enabled +buffer_pool_pages_data enabled +buffer_pool_bytes_data enabled +buffer_pool_pages_dirty enabled +buffer_pool_bytes_dirty enabled +buffer_pool_pages_free enabled +buffer_pages_created enabled +buffer_pages_written enabled +buffer_pages_read enabled +buffer_index_sec_rec_cluster_reads enabled +buffer_index_sec_rec_cluster_reads_avoided enabled +buffer_data_reads enabled +buffer_data_written enabled buffer_flush_batch_scanned disabled buffer_flush_batch_num_scan disabled buffer_flush_batch_scanned_per_call disabled @@ -72,8 +71,8 @@ buffer_flush_background_pages disabled buffer_LRU_batch_scanned disabled buffer_LRU_batch_num_scan disabled buffer_LRU_batch_scanned_per_call disabled -buffer_LRU_batch_flush_total_pages disabled -buffer_LRU_batch_evict_total_pages disabled +buffer_LRU_batch_flush_total_pages enabled +buffer_LRU_batch_evict_total_pages enabled buffer_LRU_single_flush_failure_count disabled buffer_LRU_get_free_search disabled buffer_LRU_search_scanned disabled @@ -114,24 +113,24 @@ buffer_page_written_blob disabled buffer_page_written_zblob disabled buffer_page_written_zblob2 disabled buffer_page_written_other disabled -os_data_reads disabled -os_data_writes disabled -os_data_fsyncs disabled -os_pending_reads disabled -os_pending_writes disabled -os_log_bytes_written disabled -os_log_fsyncs disabled -os_log_pending_fsyncs disabled -os_log_pending_writes disabled +os_data_reads enabled +os_data_writes enabled +os_data_fsyncs enabled +os_pending_reads enabled +os_pending_writes enabled +os_log_bytes_written enabled +os_log_fsyncs enabled +os_log_pending_fsyncs enabled +os_log_pending_writes enabled trx_rw_commits disabled trx_ro_commits disabled trx_nl_ro_commits disabled trx_commits_insert_update disabled trx_rollbacks disabled trx_rollbacks_savepoint disabled -trx_rseg_history_len disabled +trx_rseg_history_len enabled trx_undo_slots_used disabled -trx_undo_slots_cached disabled +trx_undo_slots_cached enabled trx_rseg_current_size disabled purge_del_mark_records disabled purge_upd_exist_or_extern_records disabled @@ -150,10 +149,10 @@ log_max_modified_age_async disabled log_pending_log_flushes disabled log_pending_checkpoint_writes disabled log_num_log_io disabled -log_waits disabled -log_write_requests disabled -log_writes disabled -log_padded disabled +log_waits enabled +log_write_requests enabled +log_writes enabled +log_padded enabled compress_pages_compressed disabled compress_pages_decompressed disabled compression_pad_increments disabled @@ -171,42 +170,42 @@ index_page_merge_successful disabled index_page_reorg_attempts disabled index_page_reorg_successful disabled index_page_discards disabled -adaptive_hash_searches disabled -adaptive_hash_searches_btree disabled +adaptive_hash_searches enabled +adaptive_hash_searches_btree enabled adaptive_hash_pages_added disabled adaptive_hash_pages_removed disabled adaptive_hash_rows_added disabled adaptive_hash_rows_removed disabled adaptive_hash_rows_deleted_no_hash_entry disabled adaptive_hash_rows_updated disabled -file_num_open_files disabled -ibuf_merges_insert disabled -ibuf_merges_delete_mark disabled -ibuf_merges_delete disabled -ibuf_merges_discard_insert disabled -ibuf_merges_discard_delete_mark disabled -ibuf_merges_discard_delete disabled -ibuf_merges disabled -ibuf_size disabled +file_num_open_files enabled +ibuf_merges_insert enabled +ibuf_merges_delete_mark enabled +ibuf_merges_delete enabled +ibuf_merges_discard_insert enabled +ibuf_merges_discard_delete_mark enabled +ibuf_merges_discard_delete enabled +ibuf_merges enabled +ibuf_size enabled innodb_master_thread_sleeps disabled -innodb_activity_count disabled +innodb_activity_count enabled innodb_master_active_loops disabled innodb_master_idle_loops disabled innodb_log_flush_usec disabled innodb_dict_lru_usec disabled innodb_dict_lru_count_active disabled innodb_dict_lru_count_idle disabled -innodb_dblwr_writes disabled -innodb_dblwr_pages_written disabled -innodb_page_size disabled +innodb_dblwr_writes enabled +innodb_dblwr_pages_written enabled +innodb_page_size enabled dml_reads disabled -dml_inserts disabled -dml_deletes disabled -dml_updates disabled -dml_system_reads disabled -dml_system_inserts disabled -dml_system_deletes disabled -dml_system_updates disabled +dml_inserts enabled +dml_deletes enabled +dml_updates enabled +dml_system_reads enabled +dml_system_inserts enabled +dml_system_deletes enabled +dml_system_updates enabled ddl_background_drop_indexes disabled ddl_online_create_index disabled ddl_pending_alter_table disabled @@ -216,6 +215,9 @@ icp_attempts disabled icp_no_match disabled icp_out_of_range disabled icp_match disabled +set global innodb_monitor_disable = All; +select name from information_schema.innodb_metrics where enabled; +name set global innodb_monitor_enable = all; select name from information_schema.innodb_metrics where not enabled; name diff --git a/mysql-test/suite/innodb/t/monitor.test b/mysql-test/suite/innodb/t/monitor.test index d6fa3f2fbc9..65a93e5a97a 100644 --- a/mysql-test/suite/innodb/t/monitor.test +++ b/mysql-test/suite/innodb/t/monitor.test @@ -5,12 +5,14 @@ # sys_vars.innodb_monitor_enable_basic --source include/have_innodb.inc -set global innodb_monitor_disable = All; # Test turn on/off the monitor counter with "all" option # By default, they will be off. select name, if(enabled,'enabled','disabled') status from information_schema.innodb_metrics; +set global innodb_monitor_disable = All; +select name from information_schema.innodb_metrics where enabled; + # Turn on all monitor counters set global innodb_monitor_enable = all; diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc index 971f4f330c8..3065ab19462 100644 --- a/storage/innobase/srv/srv0mon.cc +++ b/storage/innobase/srv/srv0mon.cc @@ -704,7 +704,7 @@ static monitor_info_t innodb_counter_info[] = {"trx_rseg_history_len", "transaction", "Length of the TRX_RSEG_HISTORY list", static_cast( - MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT), + MONITOR_EXISTING | MONITOR_DISPLAY_CURRENT | MONITOR_DEFAULT_ON), MONITOR_DEFAULT_START, MONITOR_RSEG_HISTORY_LEN}, {"trx_undo_slots_used", "transaction", "Number of undo slots used", From dd298873daf1681aaa3269e0e88a9344bcb2bfdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 19 May 2023 15:38:48 +0300 Subject: [PATCH 254/260] MDEV-31309 Innodb_buffer_pool_read_requests is not updated correctly srv_export_innodb_status(): Update export_vars.innodb_buffer_pool_read_requests as it was done before commit a55b951e6082a4ce9a1f2ed5ee176ea7dbbaf1f2 (MDEV-26827). If innodb_status_variables[] pointed to a sharded variable, it would only access the first shard. --- storage/innobase/handler/ha_innodb.cc | 3 ++- storage/innobase/include/srv0srv.h | 2 ++ storage/innobase/srv/srv0srv.cc | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 0b117c02e29..2937ca40752 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -946,7 +946,8 @@ static SHOW_VAR innodb_status_variables[]= { {"buffer_pool_read_ahead", &buf_pool.stat.n_ra_pages_read, SHOW_SIZE_T}, {"buffer_pool_read_ahead_evicted", &buf_pool.stat.n_ra_pages_evicted, SHOW_SIZE_T}, - {"buffer_pool_read_requests", &buf_pool.stat.n_page_gets, SHOW_SIZE_T}, + {"buffer_pool_read_requests", + &export_vars.innodb_buffer_pool_read_requests, SHOW_SIZE_T}, {"buffer_pool_reads", &buf_pool.stat.n_pages_read, SHOW_SIZE_T}, {"buffer_pool_wait_free", &buf_pool.stat.LRU_waits, SHOW_SIZE_T}, {"buffer_pool_write_requests", diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 96cfe886c02..c4c854f6b9c 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -674,6 +674,8 @@ struct export_var_t{ #ifdef UNIV_DEBUG ulint innodb_buffer_pool_pages_latched; /*!< Latched pages */ #endif /* UNIV_DEBUG */ + /** buf_pool.stat.n_page_gets (a sharded counter) */ + ulint innodb_buffer_pool_read_requests; ulint innodb_buffer_pool_write_requests;/*!< srv_stats.buf_pool_write_requests */ ulint innodb_checkpoint_age; ulint innodb_checkpoint_max_age; diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index f87c748bb67..0ce75fe84da 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -1011,6 +1011,9 @@ srv_export_innodb_status(void) export_vars.innodb_data_written = srv_stats.data_written + (dblwr << srv_page_size_shift); + export_vars.innodb_buffer_pool_read_requests + = buf_pool.stat.n_page_gets; + export_vars.innodb_buffer_pool_write_requests = srv_stats.buf_pool_write_requests; From cf37e44eecca75bdabe139056587a81c2e5af6e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 26 May 2023 16:40:07 +0300 Subject: [PATCH 255/260] MDEV-31350: Hang in innodb.recovery_memory buf_flush_page_cleaner(): Whenever buf_pool.ran_out(), invoke buf_pool.get_oldest_modification(0) so that all clean blocks will be removed from buf_pool.flush_list and buf_flush_LRU_list_batch() will be able to evict some pages. This fixes a regression that was likely caused by commit a55b951e6082a4ce9a1f2ed5ee176ea7dbbaf1f2 (MDEV-26827). --- storage/innobase/buf/buf0flu.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 73fc2957ebb..fedade950ab 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -2322,6 +2322,7 @@ static void buf_flush_page_cleaner() else if (buf_pool.ran_out()) { buf_pool.page_cleaner_set_idle(false); + buf_pool.get_oldest_modification(0); mysql_mutex_unlock(&buf_pool.flush_list_mutex); n= srv_max_io_capacity; mysql_mutex_lock(&buf_pool.mutex); From fcfd6361cb752fc53ade2811f9f5f82fd515d586 Mon Sep 17 00:00:00 2001 From: Otto Kekalainen Date: Sat, 27 May 2023 22:42:59 -0700 Subject: [PATCH 256/260] Deb: Fix blocksize check to use $mysql_datadir/$datadir correctly In commit f99a8918 this line was changed to not use awk, and new version copied both to init file and preinst file but overlooking that they use different variable names. Also fix minor syntax issues to make Shellcheck happy. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc. --- debian/mariadb-server-10.6.mariadb.init | 2 +- debian/mariadb-server-10.6.preinst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/mariadb-server-10.6.mariadb.init b/debian/mariadb-server-10.6.mariadb.init index b2b7142084f..f68fbc99bc2 100644 --- a/debian/mariadb-server-10.6.mariadb.init +++ b/debian/mariadb-server-10.6.mariadb.init @@ -86,7 +86,7 @@ sanity_checks() { datadir=`mariadbd_get_param datadir` # As preset blocksize of GNU df is 1024 then available bytes is $df_available_blocks * 1024 # 4096 blocks is then lower than 4 MB - df_available_blocks=`LC_ALL=C BLOCKSIZE= df --output=avail "$datadir" | tail -n 1` + df_available_blocks="$(LC_ALL=C BLOCKSIZE='' df --output=avail "$datadir" | tail -n 1)" if [ "$df_available_blocks" -lt "4096" ]; then log_failure_msg "$0: ERROR: The partition with $datadir is too full!" echo "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER diff --git a/debian/mariadb-server-10.6.preinst b/debian/mariadb-server-10.6.preinst index c865173e29e..92b8505e421 100644 --- a/debian/mariadb-server-10.6.preinst +++ b/debian/mariadb-server-10.6.preinst @@ -211,7 +211,7 @@ fi # As preset blocksize of GNU df is 1024 then available bytes is $df_available_blocks * 1024 # 4096 blocks is then lower than 4 MB -df_available_blocks=`LC_ALL=C BLOCKSIZE= df --output=avail "$datadir" | tail -n 1` +df_available_blocks="$(LC_ALL=C BLOCKSIZE='' df --output=avail "$mysql_datadir" | tail -n 1)" if [ "$df_available_blocks" -lt "4096" ]; then echo "ERROR: There's not enough space in $mysql_datadir/" 1>&2 db_stop From 7083e58e2e8c76e54f48591e545eb1ae7051fb33 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Tue, 16 May 2023 11:04:48 +0300 Subject: [PATCH 257/260] Fix UBSAN failure: sql_select.h:982:7: load of value ... not valid for type bool This is 11.0 part of the fix: in 11.0, get_costs_for_tables() calls best_access_path() for all possible tables, for each call it saves a POSITION object with the access method and "loose_scan_pos" POSITION object. The latter is saved even if there is no possible LooseScan plan. Saving is done by copying POSITION objects which may generate a spurious UBSan error. --- sql/sql_select.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index cec3aa1f91f..9d1987a6369 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -449,6 +449,7 @@ POSITION::POSITION() key= 0; forced_index= 0; use_join_buffer= 0; + firstmatch_with_join_buf= false; sj_strategy= SJ_OPT_NONE; n_sj_tables= 0; spl_plan= 0; From 5ba3bafb834dbc56e6105809ded9a7ccef70ee54 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Wed, 31 May 2023 16:57:34 +0200 Subject: [PATCH 258/260] Fix of maturity --- VERSION | 2 +- mysql-test/suite/sys_vars/r/sysvars_star.result | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 26f2d389e50..2c6ab649506 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=11 MYSQL_VERSION_MINOR=0 MYSQL_VERSION_PATCH=2 -SERVER_MATURITY=gamma +SERVER_MATURITY=stable diff --git a/mysql-test/suite/sys_vars/r/sysvars_star.result b/mysql-test/suite/sys_vars/r/sysvars_star.result index b3357fda3af..b80515db23d 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_star.result +++ b/mysql-test/suite/sys_vars/r/sysvars_star.result @@ -60,7 +60,7 @@ VARIABLE_NAME PLUGIN_MATURITY SESSION_VALUE NULL GLOBAL_VALUE alpha GLOBAL_VALUE_ORIGIN CONFIG -DEFAULT_VALUE beta +DEFAULT_VALUE gamma VARIABLE_SCOPE GLOBAL VARIABLE_TYPE ENUM VARIABLE_COMMENT The lowest desirable plugin maturity. Plugins less mature than that will not be installed or loaded From 928012a27ae2d1549f1b3e6975b9d22652bbea3a Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Mon, 5 Jun 2023 16:40:08 +0300 Subject: [PATCH 259/260] MDEV-31403: Server crashes in st_join_table::choose_best_splitting The code in choose_best_splitting() assumed that the join prefix is in join->positions[]. This is not necessarily the case. This function might be called when the join prefix is in join->best_positions[], too. Follow the approach from best_access_path(), which calls this function: pass the current join prefix as an argument, "const POSITION *join_positions" and use that. --- mysql-test/main/derived_split_innodb.result | 15 +++++++++++++++ mysql-test/main/derived_split_innodb.test | 21 +++++++++++++++++++++ sql/opt_split.cc | 3 ++- sql/sql_select.cc | 1 + sql/sql_select.h | 1 + 5 files changed, 40 insertions(+), 1 deletion(-) diff --git a/mysql-test/main/derived_split_innodb.result b/mysql-test/main/derived_split_innodb.result index 736e6a2c020..bea2271eaf3 100644 --- a/mysql-test/main/derived_split_innodb.result +++ b/mysql-test/main/derived_split_innodb.result @@ -810,4 +810,19 @@ SELECT t1.* FROM t1 JOIN (SELECT id, COUNT(*) FROM t2 GROUP BY id) sq ON sq.id= a set optimizer_switch= @tmp1, join_cache_level= @tmp2; DROP TABLE t1, t2; +# +# MDEV-31403: Server crashes in st_join_table::choose_best_splitting (still) +# +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES +(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15); +CREATE TABLE t2 (b INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (100),(200); +CREATE TABLE t3 (c INT, d INT, KEY(c)) ENGINE=InnoDB; +INSERT INTO t3 VALUES (1,1),(2,2); +CREATE VIEW v AS SELECT c, d FROM t3 GROUP BY c, d; +SELECT * FROM t1 JOIN t2 WHERE (t1.a, t2.b) IN (SELECT * FROM v); +a b +DROP VIEW v; +DROP TABLE t1, t2, t3; # End of 10.4 tests diff --git a/mysql-test/main/derived_split_innodb.test b/mysql-test/main/derived_split_innodb.test index b8dd5ad20e1..3c51f54fe02 100644 --- a/mysql-test/main/derived_split_innodb.test +++ b/mysql-test/main/derived_split_innodb.test @@ -462,4 +462,25 @@ set optimizer_switch= @tmp1, join_cache_level= @tmp2; # Cleanup DROP TABLE t1, t2; +--echo # +--echo # MDEV-31403: Server crashes in st_join_table::choose_best_splitting (still) +--echo # +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES + (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15); + +CREATE TABLE t2 (b INT) ENGINE=InnoDB; +INSERT INTO t2 VALUES (100),(200); + +CREATE TABLE t3 (c INT, d INT, KEY(c)) ENGINE=InnoDB; +INSERT INTO t3 VALUES (1,1),(2,2); + +CREATE VIEW v AS SELECT c, d FROM t3 GROUP BY c, d; + +SELECT * FROM t1 JOIN t2 WHERE (t1.a, t2.b) IN (SELECT * FROM v); + +# Cleanup +DROP VIEW v; +DROP TABLE t1, t2, t3; + --echo # End of 10.4 tests diff --git a/sql/opt_split.cc b/sql/opt_split.cc index 6d816552baf..89ffe35aba1 100644 --- a/sql/opt_split.cc +++ b/sql/opt_split.cc @@ -948,6 +948,7 @@ void reset_validity_vars_for_keyuses(KEYUSE_EXT *key_keyuse_ext_start, SplM_plan_info * JOIN_TAB::choose_best_splitting(uint idx, table_map remaining_tables, + const POSITION *join_positions, table_map *spl_pd_boundary) { SplM_opt_info *spl_opt_info= table->spl_opt_info; @@ -1045,7 +1046,7 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(uint idx, else { table_map last_found= this->table->map; - for (POSITION *pos= &this->join->positions[idx - 1]; ; pos--) + for (const POSITION *pos= &join_positions[idx - 1]; ; pos--) { if (pos->table->table->map & excluded_tables) continue; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index cb60b3442d8..2834c771ca3 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7452,6 +7452,7 @@ best_access_path(JOIN *join, if (s->table->is_splittable()) spl_plan= s->choose_best_splitting(idx, remaining_tables, + join_positions, &spl_pd_boundary); Json_writer_array trace_paths(thd, "considered_access_paths"); diff --git a/sql/sql_select.h b/sql/sql_select.h index f4b266292c9..37c784fc9b9 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -694,6 +694,7 @@ typedef struct st_join_table { void add_keyuses_for_splitting(); SplM_plan_info *choose_best_splitting(uint idx, table_map remaining_tables, + const POSITION *join_positions, table_map *spl_pd_boundary); bool fix_splitting(SplM_plan_info *spl_plan, table_map excluded_tables, bool is_const_table); From c93754d45e5d9379e3e23d7ada1d5f21d2711f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 19 May 2023 12:25:30 +0300 Subject: [PATCH 260/260] MDEV-31234 related cleanup trx_purge_free_segment(), trx_purge_truncate_rseg_history(): Replace some unreachable code with debug assertions. A buffer-fix does prevent pages from being evicted from the buffer pool; see buf_page_t::can_relocate(). Tested by: Matthias Leich --- storage/innobase/trx/trx0purge.cc | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index f1d0807b7fb..3cb5e9574fb 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -378,7 +378,7 @@ static void trx_purge_free_segment(buf_block_t *block, mtr_t &mtr) block->page.frame, &mtr)) { block->fix(); - const page_id_t id{block->page.id()}; + ut_d(const page_id_t id{block->page.id()}); mtr.commit(); /* NOTE: If the server is killed after the log that was produced up to this point was written, and before the log from the mtr.commit() @@ -390,16 +390,8 @@ static void trx_purge_free_segment(buf_block_t *block, mtr_t &mtr) log_free_check(); mtr.start(); block->page.lock.x_lock(); - if (UNIV_UNLIKELY(block->page.id() != id)) - { - block->unfix(); - block->page.lock.x_unlock(); - block= buf_page_get_gen(id, 0, RW_X_LATCH, nullptr, BUF_GET, &mtr); - if (!block) - return; - } - else - mtr.memo_push(block, MTR_MEMO_PAGE_X_MODIFY); + ut_ad(block->page.id() == id); + mtr.memo_push(block, MTR_MEMO_PAGE_X_MODIFY); } while (!fseg_free_step(TRX_UNDO_SEG_HDR + TRX_UNDO_FSEG_HEADER + @@ -422,7 +414,6 @@ trx_purge_truncate_rseg_history(trx_rseg_t &rseg, mtr.start(); dberr_t err; -reget: buf_block_t *rseg_hdr= rseg.get(&mtr, &err); if (!rseg_hdr) { @@ -524,12 +515,7 @@ loop: log_free_check(); mtr.start(); rseg_hdr->page.lock.x_lock(); - if (UNIV_UNLIKELY(rseg_hdr->page.id() != rseg.page_id())) - { - rseg_hdr->unfix(); - rseg_hdr->page.lock.x_unlock(); - goto reget; - } + ut_ad(rseg_hdr->page.id() == rseg.page_id()); mtr.memo_push(rseg_hdr, MTR_MEMO_PAGE_X_MODIFY); goto loop;