diff --git a/MYSQL_VERSION b/MYSQL_VERSION index f7b85be1ad3..c5fdd8f0645 100644 --- a/MYSQL_VERSION +++ b/MYSQL_VERSION @@ -1,5 +1,5 @@ MYSQL_VERSION_MAJOR=8 MYSQL_VERSION_MINOR=4 MYSQL_VERSION_PATCH=11 -MYSQL_VERSION_EXTRA=-11 +MYSQL_VERSION_EXTRA=-12 MYSQL_VERSION_MATURITY="LTS" diff --git a/client/mysqldump.cc b/client/mysqldump.cc index 33ea950fa0a..83be98bb970 100644 --- a/client/mysqldump.cc +++ b/client/mysqldump.cc @@ -1277,8 +1277,13 @@ static int get_options(int *argc, char ***argv) { ignore_table = new collation_unordered_set(charset_info, PSI_NOT_INSTRUMENTED); - processed_compression_dictionaries = - new collation_unordered_set(charset_info, PSI_NOT_INSTRUMENTED); + /* + Dictionary names are UTF-8 (see skip_compressed_columns()), and the + server compares them with utf8mb4_general_ci. charset_info does not + follow --default-character-set yet here. + */ + processed_compression_dictionaries = new collation_unordered_set( + &my_charset_utf8mb4_general_ci, PSI_NOT_INSTRUMENTED); /* Don't copy internal log tables */ ignore_table->insert("mysql.apply_status"); @@ -2138,8 +2143,10 @@ static char *quote_name(char *name, char *buff, bool force) { */ static const char *unquote_name(const char *opt_quoted_name, char *buff) noexcept { - if (!opt_quoted) return (const char *)opt_quoted_name; - + /* + Do not depend on opt_quoted: with SQL_QUOTE_SHOW_CREATE=0 the server + still quotes names that need it. + */ const char qtype = ansi_quotes_mode ? '\"' : '`'; if (*opt_quoted_name != qtype) { @@ -2152,8 +2159,9 @@ static const char *unquote_name(const char *opt_quoted_name, while (*opt_quoted_name) { if (*opt_quoted_name == qtype) { ++opt_quoted_name; + /* A doubled quote stands for one quote character. */ if (*opt_quoted_name == qtype) - *to++ = qtype; + *to++ = *opt_quoted_name++; else { assert(*opt_quoted_name == '\0'); } @@ -3278,7 +3286,47 @@ static void skip_secondary_keys(const char *table, char *create_str, my_free(autoinc_column); } -using dict_list_t = std::forward_list; +/** Dictionary name, and the name as SHOW CREATE TABLE quotes it. */ +using dict_list_t = std::forward_list>; + +/** + Finds the first occurrence of needle in a SHOW CREATE TABLE string that + is not inside a quoted string or identifier. + + String literals from COMMENT and DEFAULT values double the quote + character, and literals in expressions escape it with a backslash + (connect_to_db() never sets NO_BACKSLASH_ESCAPES). Identifiers double + their quote character. A doubled quote is handled as leaving and entering + the string or identifier again. + + The string is scanned byte by byte: get_table_structure() reads SHOW + CREATE TABLE with character_set_results=binary, so it is UTF-8, whose + multibyte characters never contain ASCII bytes. It must not be decoded + with charset_info, which follows --default-character-set. + + @param str position in SHOW CREATE TABLE output, outside of quotes + @param needle text to look for; must not contain quote characters + + @return the position of needle, or nullptr if not found +*/ +static char *find_unquoted(char *str, const char *needle) { + const size_t needle_length = strlen(needle); + const char *const end = str + strlen(str); + char quote = '\0'; + for (char *pos = str; pos < end; ++pos) { + if (quote == '\0') { + if (*pos == '\'' || *pos == '`' || *pos == '"') + quote = *pos; + else if (strncmp(pos, needle, needle_length) == 0) + return pos; + } else if (quote == '\'' && *pos == '\\') { + if (pos + 1 < end) ++pos; + } else if (*pos == quote) { + quote = '\0'; + } + } + return nullptr; +} /** Removes some compressed columns extensions from the create table @@ -3290,7 +3338,7 @@ using dict_list_t = std::forward_list; @param create_str SHOW CREATE TABLE output @param dictionaries the list of dictionary names found in the - create table definition + create table definition, unquoted and as quoted there */ static void skip_compressed_columns(char *create_str, dict_list_t *dictionaries) { @@ -3311,10 +3359,15 @@ static void skip_compressed_columns(char *create_str, char *ptr = create_str; char *end_ptr = ptr + strlen(create_str); - char *prefix_ptr = strstr(ptr, prefix); + /* + Only look outside quotes: the same text can be part of a COMMENT, + a default value or a quoted dictionary name. + */ + char *prefix_ptr = find_unquoted(ptr, prefix); while (prefix_ptr != nullptr) { - char *const suffix_ptr = strstr(prefix_ptr + prefix_length, suffix); - assert(suffix_ptr != nullptr); + char *const suffix_ptr = find_unquoted(prefix_ptr + prefix_length, suffix); + /* Not a complete column format extension. */ + if (suffix_ptr == nullptr) break; if (!opt_compressed_columns_with_dictionaries) { if (!opt_compressed_columns) { /* Strip out all compressed columns extensions. */ @@ -3333,24 +3386,32 @@ static void skip_compressed_columns(char *create_str, /* Do not strip out anything. Leave full column definition as is. */ if (dictionaries != nullptr && prefix_ptr + prefix_length != suffix_ptr) { const char *dictionary_keyword_ptr = - strstr(prefix_ptr + prefix_length, dictionary_keyword); - assert(dictionary_keyword_ptr < suffix_ptr); - const auto dictionary_name_length = - suffix_ptr - (dictionary_keyword_ptr + dictionary_keyword_length); - - char opt_quoted_buff[NAME_LEN * 2 + 3]; - strncpy(opt_quoted_buff, - dictionary_keyword_ptr + dictionary_keyword_length, - dictionary_name_length); - opt_quoted_buff[dictionary_name_length] = '\0'; - - char unquoted_buff[NAME_LEN * 2 + 3]; - dictionaries->emplace_front( - unquote_name(opt_quoted_buff, unquoted_buff)); + find_unquoted(prefix_ptr + prefix_length, dictionary_keyword); + if (dictionary_keyword_ptr != nullptr && + dictionary_keyword_ptr + dictionary_keyword_length <= suffix_ptr) { + const size_t dictionary_name_length = + suffix_ptr - (dictionary_keyword_ptr + dictionary_keyword_length); + + char opt_quoted_buff[NAME_LEN * 2 + 3]; + /* The name comes from the server, do not trust its length. */ + if (dictionary_name_length >= sizeof(opt_quoted_buff)) + die(EX_CONSCHECK, + "Compression dictionary name exceeds the maximum length of " + "%zu bytes", + sizeof(opt_quoted_buff) - 1); + memcpy(opt_quoted_buff, + dictionary_keyword_ptr + dictionary_keyword_length, + dictionary_name_length); + opt_quoted_buff[dictionary_name_length] = '\0'; + + char unquoted_buff[NAME_LEN * 2 + 3]; + dictionaries->emplace_front( + unquote_name(opt_quoted_buff, unquoted_buff), opt_quoted_buff); + } } ptr = suffix_ptr + suffix_length; } - prefix_ptr = strstr(ptr, prefix); + prefix_ptr = find_unquoted(ptr, prefix); } DBUG_VOID_RETURN; } @@ -3402,11 +3463,15 @@ static bool has_primary_key(const char *table_name) noexcept { Prints "CREATE COMPRESSION_DICTIONARY ..." statement for the specified dictionary name if this is the first time this dictionary is referenced. - @param sql_file output file - @param dictionary_name dictionary name + @param sql_file output file + @param dictionary_name dictionary name + @param quoted_dictionary_name dictionary name as SHOW CREATE TABLE + quotes it: with SQL_QUOTE_SHOW_CREATE=0 the server still quotes names + that need it, for example keywords and numbers */ static void print_optional_create_compression_dictionary( - FILE *sql_file, const char *dictionary_name) { + FILE *sql_file, const char *dictionary_name, + const char *quoted_dictionary_name) { DBUG_ENTER("print_optional_create_compression_dictionary"); DBUG_PRINT("enter", ("dictionary: %s", dictionary_name)); @@ -3417,13 +3482,21 @@ static void print_optional_create_compression_dictionary( static const constexpr char get_zip_dict_data_stmt[] = "SELECT `DICT_DATA` " "FROM `INFORMATION_SCHEMA`.`COMPRESSION_DICTIONARY` " - "WHERE `DICT_NAME` = '%s'"; + "WHERE `DICT_NAME` = _utf8mb4 X'%s'"; processed_compression_dictionaries->emplace(dictionary_name); + /* + The name comes from SHOW CREATE TABLE, which is UTF-8 whatever the + connection character set is. A hex literal needs no escaping. + */ + const size_t dictionary_name_length = strlen(dictionary_name); + char hex_name[(NAME_LEN * 2 + 3) * 2 + 1]; + assert(dictionary_name_length * 2 < sizeof(hex_name)); + mysql_hex_string(hex_name, dictionary_name, dictionary_name_length); + char query_buff[QUERY_LENGTH]; - snprintf(query_buff, sizeof(query_buff), get_zip_dict_data_stmt, - dictionary_name); + snprintf(query_buff, sizeof(query_buff), get_zip_dict_data_stmt, hex_name); MYSQL_RES *result = nullptr; if (mysql_query_with_error_report(mysql, &result, query_buff)) { @@ -3434,16 +3507,31 @@ static void print_optional_create_compression_dictionary( if (row == nullptr) { mysql_free_result(result); maybe_die(EX_MYSQLERR, - "Couldn't read data for compresion dictionary %s (%s)\n", + "Couldn't read data for compression dictionary %s (%s)\n", dictionary_name, mysql_error(mysql)); DBUG_VOID_RETURN; } const ulong *const lengths = mysql_fetch_lengths(result); assert(lengths != nullptr); - char quoted_buff[NAME_LEN * 2 + 3]; - const char *quoted_dictionary_name = - quote_name(dictionary_name, quoted_buff, false); + /* + Like CREATE TABLE, the statements are read with + character_set_client=utf8mb4, because the name is UTF-8. DICT_DATA is + a BLOB: pass it in a user variable set from a hex literal, which is + not converted to the connection character set. An escaped string + literal does not work: the mysql client splits statements with its + own --default-character-set, and in sjis, gbk or big5 a byte before + an escaping backslash can make one character with it. + */ + char *const hex_data = static_cast(my_malloc( + PSI_NOT_INSTRUMENTED, lengths[0] * 2 + 1, MYF(MY_WME | MY_FAE))); + mysql_hex_string(hex_data, row[0], lengths[0]); + + fputs( + "/*!40101 SET @saved_cs_client = @@character_set_client */;\n" + "/*!50503 SET character_set_client = utf8mb4 */;\n", + sql_file); + check_io(sql_file); /* We print DROP COMPRESSION_DICTIONARY only if no --tab @@ -3465,15 +3553,19 @@ static void print_optional_create_compression_dictionary( */ fprintf(sql_file, "/*!" STRINGIFY_ARG(FIRST_SUPPORTED_COMPRESSED_COLUMNS_VERSION) - " CREATE COMPRESSION_DICTIONARY %s%s (", - path != 0 ? "IF NOT EXISTS " : "", + " SET @compression_dictionary_data = X'%s' */;\n" + "/*!" STRINGIFY_ARG(FIRST_SUPPORTED_COMPRESSED_COLUMNS_VERSION) + " CREATE COMPRESSION_DICTIONARY %s%s" + " (@compression_dictionary_data) */;\n" + "/*!" STRINGIFY_ARG(FIRST_SUPPORTED_COMPRESSED_COLUMNS_VERSION) + " SET @compression_dictionary_data = NULL */;\n", + hex_data, path != 0 ? "IF NOT EXISTS " : "", quoted_dictionary_name); + fputs("/*!40101 SET character_set_client = @saved_cs_client */;\n", + sql_file); check_io(sql_file); - unescape(sql_file, row[0], lengths[0]); - fputs(") */;\n", sql_file); - check_io(sql_file); - + my_free(hex_data); mysql_free_result(result); } DBUG_VOID_RETURN; @@ -3821,9 +3913,51 @@ static uint get_table_structure(const char *table, char *db, char *table_type, dict_list_t referenced_dictionaries, current_dictionary; +#ifndef NDEBUG + /* Malformed extensions, which the server never returns. */ + static std::string debug_create; + debug_create.clear(); + const auto debug_column = [](const char *name, + const std::string &extension) { + return std::string(" `") + name + "` blob /*!" STRINGIFY_ARG( + FIRST_SUPPORTED_COMPRESSED_COLUMNS_VERSION) " " + "COLUMN_FORMAT COMPRESSED" + + extension; + }; + const auto debug_table = [](const std::string &columns) { + debug_create = + "CREATE TABLE `t1` (\n" + columns + "\n) ENGINE=InnoDB"; + }; + DBUG_EXECUTE_IF("compressed_columns_no_suffix", { + debug_table(debug_column("a", " WITH COMPRESSION_DICTIONARY `d1`")); + }); + DBUG_EXECUTE_IF("compressed_columns_no_keyword", { + debug_table(debug_column("a", " UNKNOWN `d1` */")); + }); + DBUG_EXECUTE_IF("compressed_columns_quoted_keyword", { + debug_table(debug_column( + "a", " UNKNOWN ` WITH COMPRESSION_DICTIONARY d1` */")); + }); + DBUG_EXECUTE_IF("compressed_columns_later_keyword", { + debug_table( + debug_column("a", " UNKNOWN `d1` */") + ",\n" + + debug_column("b", " WITH COMPRESSION_DICTIONARY `d2` */")); + }); + DBUG_EXECUTE_IF("compressed_columns_name_386", { + debug_table(debug_column("a", " WITH COMPRESSION_DICTIONARY " + + std::string(386, 'x') + " */")); + }); + DBUG_EXECUTE_IF("compressed_columns_name_387", { + debug_table(debug_column("a", " WITH COMPRESSION_DICTIONARY " + + std::string(387, 'x') + " */")); + }); + if (!debug_create.empty()) row[1] = debug_create.data(); +#endif + skip_compressed_columns(row[1], &referenced_dictionaries); for (const auto &it : referenced_dictionaries) - print_optional_create_compression_dictionary(sql_file, it.c_str()); + print_optional_create_compression_dictionary( + sql_file, it.first.c_str(), it.second.c_str()); } print_optional_drop_table(sql_file, db, table, opt_quoted_table); diff --git a/mysql-test/suite/percona_innodb/r/xtradb_compressed_columns_mysqldump_comment.result b/mysql-test/suite/percona_innodb/r/xtradb_compressed_columns_mysqldump_comment.result new file mode 100644 index 00000000000..7959f8531e3 --- /dev/null +++ b/mysql-test/suite/percona_innodb/r/xtradb_compressed_columns_mysqldump_comment.result @@ -0,0 +1,167 @@ +CREATE TABLE t1 (a INT COMMENT ' /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */'); +CREATE TABLE t2 (a INT COMMENT ' /*!50633 COLUMN_FORMAT COMPRESSED'); +CREATE TABLE t3 (a INT COMMENT 'keep /*!50633 COLUMN_FORMAT COMPRESSED this */ text'); +CREATE TABLE t4 ( +a INT COMMENT ' /*!50633 COLUMN_FORMAT COMPRESSED', +b BLOB COLUMN_FORMAT COMPRESSED, +c INT COMMENT ') ENGINE=InnoDB; CREATE TABLE t_injected (y INT); CREATE TABLE t5 (y INT -- '); +CREATE TABLE t7 ( +a VARCHAR(100) DEFAULT ('q\' /*!50633 COLUMN_FORMAT COMPRESSED z */'), + b BLOB COLUMN_FORMAT COMPRESSED, + c INT COMMENT 'keep /*!50633 COLUMN_FORMAT COMPRESSED this */ text', + d VARCHAR(20) GENERATED ALWAYS AS (CONCAT('it''s', ' /*!50633 COLUMN_FORMAT COMPRESSED */')) VIRTUAL, + e BLOB COLUMN_FORMAT COMPRESSED); +# Extension text inside comments is left as is +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t1` ( + `a` int DEFAULT NULL COMMENT ' /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t2` ( + `a` int DEFAULT NULL COMMENT ' /*!50633 COLUMN_FORMAT COMPRESSED' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t3` ( + `a` int DEFAULT NULL COMMENT 'keep /*!50633 COLUMN_FORMAT COMPRESSED this */ text' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t4` ( + `a` int DEFAULT NULL COMMENT ' /*!50633 COLUMN_FORMAT COMPRESSED', + `b` blob, + `c` int DEFAULT NULL COMMENT ') ENGINE=InnoDB; CREATE TABLE t_injected (y INT); CREATE TABLE t5 (y INT -- ' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t7` ( + `a` varchar(100) DEFAULT (_utf8mb4'q\' /*!50633 COLUMN_FORMAT COMPRESSED z */'), + `b` blob, + `c` int DEFAULT NULL COMMENT 'keep /*!50633 COLUMN_FORMAT COMPRESSED this */ text', + `d` varchar(20) GENERATED ALWAYS AS (concat(_utf8mb4'it\'s',_utf8mb4' /*!50633 COLUMN_FORMAT COMPRESSED */')) VIRTUAL, + `e` blob +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t3` ( + `a` int DEFAULT NULL COMMENT 'keep /*!50633 COLUMN_FORMAT COMPRESSED this */ text' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t4` ( + `a` int DEFAULT NULL COMMENT ' /*!50633 COLUMN_FORMAT COMPRESSED', + `b` blob /*!50633 COLUMN_FORMAT COMPRESSED */, + `c` int DEFAULT NULL COMMENT ') ENGINE=InnoDB; CREATE TABLE t_injected (y INT); CREATE TABLE t5 (y INT -- ' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t7` ( + `a` varchar(100) DEFAULT (_utf8mb4'q\' /*!50633 COLUMN_FORMAT COMPRESSED z */'), + `b` blob /*!50633 COLUMN_FORMAT COMPRESSED */, + `c` int DEFAULT NULL COMMENT 'keep /*!50633 COLUMN_FORMAT COMPRESSED this */ text', + `d` varchar(20) GENERATED ALWAYS AS (concat(_utf8mb4'it\'s',_utf8mb4' /*!50633 COLUMN_FORMAT COMPRESSED */')) VIRTUAL, + `e` blob /*!50633 COLUMN_FORMAT COMPRESSED */ +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t1` ( + `a` int DEFAULT NULL COMMENT ' /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +# Restored dump creates only the dumped tables +CREATE DATABASE restored; +SHOW TABLES FROM restored; +Tables_in_restored +t3 +t4 +t7 +SHOW CREATE TABLE restored.t4; +Table Create Table +t4 CREATE TABLE `t4` ( + `a` int DEFAULT NULL COMMENT ' /*!50633 COLUMN_FORMAT COMPRESSED', + `b` blob, + `c` int DEFAULT NULL COMMENT ') ENGINE=InnoDB; CREATE TABLE t_injected (y INT); CREATE TABLE t5 (y INT -- ' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +SHOW CREATE TABLE restored.t7; +Table Create Table +t7 CREATE TABLE `t7` ( + `a` varchar(100) DEFAULT (_utf8mb4'q\' /*!50633 COLUMN_FORMAT COMPRESSED z */'), + `b` blob, + `c` int DEFAULT NULL COMMENT 'keep /*!50633 COLUMN_FORMAT COMPRESSED this */ text', + `d` varchar(20) GENERATED ALWAYS AS (concat(_utf8mb4'it\'s',_utf8mb4' /*!50633 COLUMN_FORMAT COMPRESSED */')) VIRTUAL, + `e` blob +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +DROP DATABASE restored; +# Compression dictionary name that contains the extension suffix +CREATE COMPRESSION_DICTIONARY `d */ x` ('abcdef'); +CREATE TABLE t6 (a BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d */ x`); +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t6` ( + `a` blob +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t6` ( + `a` blob /*!50633 COLUMN_FORMAT COMPRESSED */ +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `d */ x` */; +/*!50633 SET @compression_dictionary_data = X'616263646566' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `d */ x` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t6` ( + `a` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d */ x` */ +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +# SHOW CREATE TABLE is UTF-8 whatever --default-character-set is +SET NAMES utf8mb4; +CREATE TABLE t8 ( +`あ` BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d */ x`, +b INT COMMENT 'keep ` /*!50633 COLUMN_FORMAT COMPRESSED this */ text'); +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t8` ( + `あ` blob, + `b` int DEFAULT NULL COMMENT 'keep ` /*!50633 COLUMN_FORMAT COMPRESSED this */ text' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t8` ( + `あ` blob, + `b` int DEFAULT NULL COMMENT 'keep ` /*!50633 COLUMN_FORMAT COMPRESSED this */ text' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `d */ x` */; +/*!50633 SET @compression_dictionary_data = X'616263646566' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `d */ x` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t8` ( + `あ` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d */ x` */, + `b` int DEFAULT NULL COMMENT 'keep ` /*!50633 COLUMN_FORMAT COMPRESSED this */ text' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE t1, t2, t3, t4, t6, t7, t8; +DROP COMPRESSION_DICTIONARY `d */ x`; diff --git a/mysql-test/suite/percona_innodb/r/xtradb_compressed_columns_mysqldump_dictionary_names.result b/mysql-test/suite/percona_innodb/r/xtradb_compressed_columns_mysqldump_dictionary_names.result new file mode 100644 index 00000000000..1b24d8f0e81 --- /dev/null +++ b/mysql-test/suite/percona_innodb/r/xtradb_compressed_columns_mysqldump_dictionary_names.result @@ -0,0 +1,570 @@ +SET NAMES utf8mb4; +CREATE COMPRESSION_DICTIONARY `d``x` ('data1'); +CREATE COMPRESSION_DICTIONARY `d``` ('data2'); +CREATE COMPRESSION_DICTIONARY `a````` ('data3'); +CREATE COMPRESSION_DICTIONARY `d'x` ('da''ta\\4'); +CREATE COMPRESSION_DICTIONARY `d\x` ('data5'); +CREATE COMPRESSION_DICTIONARY `d x` ('data6'); +CREATE COMPRESSION_DICTIONARY `d"x` ('data7'); +CREATE COMPRESSION_DICTIONARY `dあ` ('dataあ\\8'); +CREATE COMPRESSION_DICTIONARY `select` ('data9'); +CREATE COMPRESSION_DICTIONARY `123` ('data10'); +CREATE COMPRESSION_DICTIONARY `d©` ('data©11'); +CREATE COMPRESSION_DICTIONARY `dé` ('data\\é12'''); +CREATE TABLE t1 ( +a BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d``x`, +b BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d```, +c BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `a`````, +d BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d'x`, +e BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d\x`, +f BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d x`, +g BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d"x`, +h BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `dあ`, +i BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `select`, +j BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `123`, +k BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d©`, +l BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `dé`); +SELECT DICT_NAME, DICT_DATA FROM INFORMATION_SCHEMA.COMPRESSION_DICTIONARY +ORDER BY HEX(DICT_NAME); +DICT_NAME DICT_DATA +123 data10 +a`` data3 +d x data6 +d"x data7 +d'x da'ta\4 +d\x data5 +d` data2 +d`x data1 +d© data©11 +dé data\é12' +dあ dataあ\8 +select data9 +SELECT COUNT(*), MD5(GROUP_CONCAT(HEX(DICT_NAME), ':', HEX(DICT_DATA) ORDER BY HEX(DICT_NAME))) AS checksum FROM INFORMATION_SCHEMA.COMPRESSION_DICTIONARY; +COUNT(*) checksum +12 206393ce8edf11b9a4c6467e3de93776 +# Dump and restore with --skip-comments +DROP TABLE t1; +DROP COMPRESSION_DICTIONARY `d``x`; +DROP COMPRESSION_DICTIONARY `d```; +DROP COMPRESSION_DICTIONARY `a`````; +DROP COMPRESSION_DICTIONARY `d'x`; +DROP COMPRESSION_DICTIONARY `d\x`; +DROP COMPRESSION_DICTIONARY `d x`; +DROP COMPRESSION_DICTIONARY `d"x`; +DROP COMPRESSION_DICTIONARY `dあ`; +DROP COMPRESSION_DICTIONARY `select`; +DROP COMPRESSION_DICTIONARY `123`; +DROP COMPRESSION_DICTIONARY `d©`; +DROP COMPRESSION_DICTIONARY `dé`; +SELECT COUNT(*), MD5(GROUP_CONCAT(HEX(DICT_NAME), ':', HEX(DICT_DATA) ORDER BY HEX(DICT_NAME))) AS checksum FROM INFORMATION_SCHEMA.COMPRESSION_DICTIONARY; +COUNT(*) checksum +12 206393ce8edf11b9a4c6467e3de93776 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d``x` */, + `b` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d``` */, + `c` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `a````` */, + `d` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d'x` */, + `e` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d\x` */, + `f` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d x` */, + `g` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d"x` */, + `h` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `dあ` */, + `i` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `select` */, + `j` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `123` */, + `k` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d©` */, + `l` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `dé` */ +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +# Dump and restore with --skip-comments --skip-quote-names +DROP TABLE t1; +DROP COMPRESSION_DICTIONARY `d``x`; +DROP COMPRESSION_DICTIONARY `d```; +DROP COMPRESSION_DICTIONARY `a`````; +DROP COMPRESSION_DICTIONARY `d'x`; +DROP COMPRESSION_DICTIONARY `d\x`; +DROP COMPRESSION_DICTIONARY `d x`; +DROP COMPRESSION_DICTIONARY `d"x`; +DROP COMPRESSION_DICTIONARY `dあ`; +DROP COMPRESSION_DICTIONARY `select`; +DROP COMPRESSION_DICTIONARY `123`; +DROP COMPRESSION_DICTIONARY `d©`; +DROP COMPRESSION_DICTIONARY `dé`; +SELECT COUNT(*), MD5(GROUP_CONCAT(HEX(DICT_NAME), ':', HEX(DICT_DATA) ORDER BY HEX(DICT_NAME))) AS checksum FROM INFORMATION_SCHEMA.COMPRESSION_DICTIONARY; +COUNT(*) checksum +12 206393ce8edf11b9a4c6467e3de93776 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d``x` */, + `b` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d``` */, + `c` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `a````` */, + `d` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d'x` */, + `e` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d\x` */, + `f` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d x` */, + `g` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d"x` */, + `h` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `dあ` */, + `i` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `select` */, + `j` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `123` */, + `k` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d©` */, + `l` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `dé` */ +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +# Dump and restore with --skip-comments --default-character-set=sjis +DROP TABLE t1; +DROP COMPRESSION_DICTIONARY `d``x`; +DROP COMPRESSION_DICTIONARY `d```; +DROP COMPRESSION_DICTIONARY `a`````; +DROP COMPRESSION_DICTIONARY `d'x`; +DROP COMPRESSION_DICTIONARY `d\x`; +DROP COMPRESSION_DICTIONARY `d x`; +DROP COMPRESSION_DICTIONARY `d"x`; +DROP COMPRESSION_DICTIONARY `dあ`; +DROP COMPRESSION_DICTIONARY `select`; +DROP COMPRESSION_DICTIONARY `123`; +DROP COMPRESSION_DICTIONARY `d©`; +DROP COMPRESSION_DICTIONARY `dé`; +SELECT COUNT(*), MD5(GROUP_CONCAT(HEX(DICT_NAME), ':', HEX(DICT_DATA) ORDER BY HEX(DICT_NAME))) AS checksum FROM INFORMATION_SCHEMA.COMPRESSION_DICTIONARY; +COUNT(*) checksum +12 206393ce8edf11b9a4c6467e3de93776 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d``x` */, + `b` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d``` */, + `c` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `a````` */, + `d` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d'x` */, + `e` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d\x` */, + `f` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d x` */, + `g` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d"x` */, + `h` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `dあ` */, + `i` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `select` */, + `j` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `123` */, + `k` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d©` */, + `l` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `dé` */ +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +# Dump and restore with --skip-comments --default-character-set=gbk +DROP TABLE t1; +DROP COMPRESSION_DICTIONARY `d``x`; +DROP COMPRESSION_DICTIONARY `d```; +DROP COMPRESSION_DICTIONARY `a`````; +DROP COMPRESSION_DICTIONARY `d'x`; +DROP COMPRESSION_DICTIONARY `d\x`; +DROP COMPRESSION_DICTIONARY `d x`; +DROP COMPRESSION_DICTIONARY `d"x`; +DROP COMPRESSION_DICTIONARY `dあ`; +DROP COMPRESSION_DICTIONARY `select`; +DROP COMPRESSION_DICTIONARY `123`; +DROP COMPRESSION_DICTIONARY `d©`; +DROP COMPRESSION_DICTIONARY `dé`; +SELECT COUNT(*), MD5(GROUP_CONCAT(HEX(DICT_NAME), ':', HEX(DICT_DATA) ORDER BY HEX(DICT_NAME))) AS checksum FROM INFORMATION_SCHEMA.COMPRESSION_DICTIONARY; +COUNT(*) checksum +12 206393ce8edf11b9a4c6467e3de93776 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d``x` */, + `b` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d``` */, + `c` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `a````` */, + `d` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d'x` */, + `e` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d\x` */, + `f` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d x` */, + `g` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d"x` */, + `h` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `dあ` */, + `i` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `select` */, + `j` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `123` */, + `k` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d©` */, + `l` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `dé` */ +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +# Dump and restore with --skip-comments --default-character-set=latin1 +DROP TABLE t1; +DROP COMPRESSION_DICTIONARY `d``x`; +DROP COMPRESSION_DICTIONARY `d```; +DROP COMPRESSION_DICTIONARY `a`````; +DROP COMPRESSION_DICTIONARY `d'x`; +DROP COMPRESSION_DICTIONARY `d\x`; +DROP COMPRESSION_DICTIONARY `d x`; +DROP COMPRESSION_DICTIONARY `d"x`; +DROP COMPRESSION_DICTIONARY `dあ`; +DROP COMPRESSION_DICTIONARY `select`; +DROP COMPRESSION_DICTIONARY `123`; +DROP COMPRESSION_DICTIONARY `d©`; +DROP COMPRESSION_DICTIONARY `dé`; +SELECT COUNT(*), MD5(GROUP_CONCAT(HEX(DICT_NAME), ':', HEX(DICT_DATA) ORDER BY HEX(DICT_NAME))) AS checksum FROM INFORMATION_SCHEMA.COMPRESSION_DICTIONARY; +COUNT(*) checksum +12 206393ce8edf11b9a4c6467e3de93776 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d``x` */, + `b` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d``` */, + `c` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `a````` */, + `d` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d'x` */, + `e` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d\x` */, + `f` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d x` */, + `g` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d"x` */, + `h` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `dあ` */, + `i` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `select` */, + `j` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `123` */, + `k` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d©` */, + `l` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `dé` */ +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +# Dictionary statements of a non-UTF-8 dump +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `dé` */; +/*!50633 SET @compression_dictionary_data = X'646174615CC3A9313227' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `dé` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `d©` */; +/*!50633 SET @compression_dictionary_data = X'64617461C2A93131' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `d©` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `123` */; +/*!50633 SET @compression_dictionary_data = X'646174613130' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `123` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `select` */; +/*!50633 SET @compression_dictionary_data = X'6461746139' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `select` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `dあ` */; +/*!50633 SET @compression_dictionary_data = X'64617461E381825C38' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `dあ` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `d"x` */; +/*!50633 SET @compression_dictionary_data = X'6461746137' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `d"x` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `d x` */; +/*!50633 SET @compression_dictionary_data = X'6461746136' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `d x` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `d\x` */; +/*!50633 SET @compression_dictionary_data = X'6461746135' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `d\x` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `d'x` */; +/*!50633 SET @compression_dictionary_data = X'64612774615C34' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `d'x` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `a````` */; +/*!50633 SET @compression_dictionary_data = X'6461746133' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `a````` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `d``` */; +/*!50633 SET @compression_dictionary_data = X'6461746132' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `d``` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `d``x` */; +/*!50633 SET @compression_dictionary_data = X'6461746131' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `d``x` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t1` ( + `a` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d``x` */, + `b` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d``` */, + `c` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `a````` */, + `d` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d'x` */, + `e` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d\x` */, + `f` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d x` */, + `g` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d"x` */, + `h` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `dあ` */, + `i` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `select` */, + `j` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `123` */, + `k` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d©` */, + `l` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `dé` */ +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +# Keyword and number names with --skip-quote-names +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `dé` */; +/*!50633 SET @compression_dictionary_data = X'646174615CC3A9313227' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `dé` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `d©` */; +/*!50633 SET @compression_dictionary_data = X'64617461C2A93131' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `d©` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `123` */; +/*!50633 SET @compression_dictionary_data = X'646174613130' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `123` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `select` */; +/*!50633 SET @compression_dictionary_data = X'6461746139' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `select` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `dあ` */; +/*!50633 SET @compression_dictionary_data = X'64617461E381825C38' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `dあ` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `d"x` */; +/*!50633 SET @compression_dictionary_data = X'6461746137' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `d"x` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `d x` */; +/*!50633 SET @compression_dictionary_data = X'6461746136' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `d x` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `d\x` */; +/*!50633 SET @compression_dictionary_data = X'6461746135' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `d\x` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `d'x` */; +/*!50633 SET @compression_dictionary_data = X'64612774615C34' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `d'x` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `a````` */; +/*!50633 SET @compression_dictionary_data = X'6461746133' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `a````` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `d``` */; +/*!50633 SET @compression_dictionary_data = X'6461746132' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `d``` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `d``x` */; +/*!50633 SET @compression_dictionary_data = X'6461746131' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `d``x` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE t1 ( + a blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d``x` */, + b blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d``` */, + c blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `a````` */, + d blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d'x` */, + e blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d\x` */, + f blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d x` */, + g blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d"x` */, + h blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `dあ` */, + i blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `select` */, + j blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `123` */, + k blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d©` */, + l blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `dé` */ +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +# ANSI quotes +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS "dé" */; +/*!50633 SET @compression_dictionary_data = X'646174615CC3A9313227' */; +/*!50633 CREATE COMPRESSION_DICTIONARY "dé" (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS "d©" */; +/*!50633 SET @compression_dictionary_data = X'64617461C2A93131' */; +/*!50633 CREATE COMPRESSION_DICTIONARY "d©" (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS "123" */; +/*!50633 SET @compression_dictionary_data = X'646174613130' */; +/*!50633 CREATE COMPRESSION_DICTIONARY "123" (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS "select" */; +/*!50633 SET @compression_dictionary_data = X'6461746139' */; +/*!50633 CREATE COMPRESSION_DICTIONARY "select" (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS "dあ" */; +/*!50633 SET @compression_dictionary_data = X'64617461E381825C38' */; +/*!50633 CREATE COMPRESSION_DICTIONARY "dあ" (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS "d""x" */; +/*!50633 SET @compression_dictionary_data = X'6461746137' */; +/*!50633 CREATE COMPRESSION_DICTIONARY "d""x" (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS "d x" */; +/*!50633 SET @compression_dictionary_data = X'6461746136' */; +/*!50633 CREATE COMPRESSION_DICTIONARY "d x" (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS "d\x" */; +/*!50633 SET @compression_dictionary_data = X'6461746135' */; +/*!50633 CREATE COMPRESSION_DICTIONARY "d\x" (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS "d'x" */; +/*!50633 SET @compression_dictionary_data = X'64612774615C34' */; +/*!50633 CREATE COMPRESSION_DICTIONARY "d'x" (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS "a``" */; +/*!50633 SET @compression_dictionary_data = X'6461746133' */; +/*!50633 CREATE COMPRESSION_DICTIONARY "a``" (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS "d`" */; +/*!50633 SET @compression_dictionary_data = X'6461746132' */; +/*!50633 CREATE COMPRESSION_DICTIONARY "d`" (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS "d`x" */; +/*!50633 SET @compression_dictionary_data = X'6461746131' */; +/*!50633 CREATE COMPRESSION_DICTIONARY "d`x" (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE "t1" ( + "a" blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY "d`x" */, + "b" blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY "d`" */, + "c" blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY "a``" */, + "d" blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY "d'x" */, + "e" blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY "d\x" */, + "f" blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY "d x" */, + "g" blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY "d""x" */, + "h" blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY "dあ" */, + "i" blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY "select" */, + "j" blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY "123" */, + "k" blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY "d©" */, + "l" blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY "dé" */ +); +/*!40101 SET character_set_client = @saved_cs_client */; +# Dictionary data read by a mysql client in sjis and gbk +CREATE COMPRESSION_DICTIONARY mb1 ('あ''あ\\'); +SET @data = X'835C27835C5C'; +CREATE COMPRESSION_DICTIONARY mb2 (@data); +CREATE TABLE t2 ( +a BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY mb1, +b BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY mb2); +SELECT DICT_NAME, HEX(DICT_DATA) FROM INFORMATION_SCHEMA.COMPRESSION_DICTIONARY WHERE DICT_NAME IN ('mb1', 'mb2') ORDER BY DICT_NAME; +DICT_NAME HEX(DICT_DATA) +mb1 E3818227E381825C +mb2 835C27835C5C +# Dump and restore with --default-character-set=sjis +DROP TABLE t2; +DROP COMPRESSION_DICTIONARY mb1; +DROP COMPRESSION_DICTIONARY mb2; +SELECT DICT_NAME, HEX(DICT_DATA) FROM INFORMATION_SCHEMA.COMPRESSION_DICTIONARY WHERE DICT_NAME IN ('mb1', 'mb2') ORDER BY DICT_NAME; +DICT_NAME HEX(DICT_DATA) +mb1 E3818227E381825C +mb2 835C27835C5C +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `mb1` */, + `b` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `mb2` */ +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +# Dump and restore with --default-character-set=gbk +DROP TABLE t2; +DROP COMPRESSION_DICTIONARY mb1; +DROP COMPRESSION_DICTIONARY mb2; +SELECT DICT_NAME, HEX(DICT_DATA) FROM INFORMATION_SCHEMA.COMPRESSION_DICTIONARY WHERE DICT_NAME IN ('mb1', 'mb2') ORDER BY DICT_NAME; +DICT_NAME HEX(DICT_DATA) +mb1 E3818227E381825C +mb2 835C27835C5C +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `mb1` */, + `b` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `mb2` */ +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci +DROP TABLE t2; +DROP COMPRESSION_DICTIONARY mb1; +DROP COMPRESSION_DICTIONARY mb2; +DROP TABLE t1; +DROP COMPRESSION_DICTIONARY `d``x`; +DROP COMPRESSION_DICTIONARY `d```; +DROP COMPRESSION_DICTIONARY `a`````; +DROP COMPRESSION_DICTIONARY `d'x`; +DROP COMPRESSION_DICTIONARY `d\x`; +DROP COMPRESSION_DICTIONARY `d x`; +DROP COMPRESSION_DICTIONARY `d"x`; +DROP COMPRESSION_DICTIONARY `dあ`; +DROP COMPRESSION_DICTIONARY `select`; +DROP COMPRESSION_DICTIONARY `123`; +DROP COMPRESSION_DICTIONARY `d©`; +DROP COMPRESSION_DICTIONARY `dé`; diff --git a/mysql-test/suite/percona_innodb/r/xtradb_compressed_columns_mysqldump_malformed.result b/mysql-test/suite/percona_innodb/r/xtradb_compressed_columns_mysqldump_malformed.result new file mode 100644 index 00000000000..9e22c7a8253 --- /dev/null +++ b/mysql-test/suite/percona_innodb/r/xtradb_compressed_columns_mysqldump_malformed.result @@ -0,0 +1,51 @@ +CREATE TABLE t1 (a INT); +# Extension without " */" is left as is +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t1` ( + `a` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d1` +) ENGINE=InnoDB; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t1` ( + `a` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d1` +) ENGINE=InnoDB; +/*!40101 SET character_set_client = @saved_cs_client */; +# Extension without the dictionary keyword references no dictionary +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t1` ( + `a` blob /*!50633 COLUMN_FORMAT COMPRESSED UNKNOWN `d1` */ +) ENGINE=InnoDB; +/*!40101 SET character_set_client = @saved_cs_client */; +# Quoted dictionary keyword references no dictionary +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t1` ( + `a` blob /*!50633 COLUMN_FORMAT COMPRESSED UNKNOWN ` WITH COMPRESSION_DICTIONARY d1` */ +) ENGINE=InnoDB; +/*!40101 SET character_set_client = @saved_cs_client */; +# Dictionary keyword of a later extension is not used for an earlier one +CREATE COMPRESSION_DICTIONARY d2 ('data2'); +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +/*!50633 DROP COMPRESSION_DICTIONARY IF EXISTS `d2` */; +/*!50633 SET @compression_dictionary_data = X'6461746132' */; +/*!50633 CREATE COMPRESSION_DICTIONARY `d2` (@compression_dictionary_data) */; +/*!50633 SET @compression_dictionary_data = NULL */; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `t1` ( + `a` blob /*!50633 COLUMN_FORMAT COMPRESSED UNKNOWN `d1` */, + `b` blob /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d2` */ +) ENGINE=InnoDB; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP COMPRESSION_DICTIONARY d2; +# 386 byte dictionary name is looked up +mysqldump: Couldn't read data for compression dictionary xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx () + +# 387 byte dictionary name is rejected +mysqldump: Compression dictionary name exceeds the maximum length of 386 bytes +DROP TABLE t1; diff --git a/mysql-test/suite/percona_innodb/t/xtradb_compressed_columns_mysqldump_comment.test b/mysql-test/suite/percona_innodb/t/xtradb_compressed_columns_mysqldump_comment.test new file mode 100644 index 00000000000..20584f68dc0 --- /dev/null +++ b/mysql-test/suite/percona_innodb/t/xtradb_compressed_columns_mysqldump_comment.test @@ -0,0 +1,56 @@ +# +# mysqldump must only treat compressed column extensions outside quotes in +# SHOW CREATE TABLE output as extensions: column comments and quoted +# compression dictionary names can contain the same text. +# + +--let $name= `SELECT REPEAT('x', 500)` +eval CREATE TABLE t1 (a INT COMMENT ' /*!50633 COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY $name */'); +CREATE TABLE t2 (a INT COMMENT ' /*!50633 COLUMN_FORMAT COMPRESSED'); +CREATE TABLE t3 (a INT COMMENT 'keep /*!50633 COLUMN_FORMAT COMPRESSED this */ text'); +CREATE TABLE t4 ( + a INT COMMENT ' /*!50633 COLUMN_FORMAT COMPRESSED', + b BLOB COLUMN_FORMAT COMPRESSED, + c INT COMMENT ') ENGINE=InnoDB; CREATE TABLE t_injected (y INT); CREATE TABLE t5 (y INT -- '); +# Escaped quotes in an expression, and extension text after a real extension +CREATE TABLE t7 ( + a VARCHAR(100) DEFAULT ('q\' /*!50633 COLUMN_FORMAT COMPRESSED z */'), + b BLOB COLUMN_FORMAT COMPRESSED, + c INT COMMENT 'keep /*!50633 COLUMN_FORMAT COMPRESSED this */ text', + d VARCHAR(20) GENERATED ALWAYS AS (CONCAT('it''s', ' /*!50633 COLUMN_FORMAT COMPRESSED */')) VIRTUAL, + e BLOB COLUMN_FORMAT COMPRESSED); + +--echo # Extension text inside comments is left as is +--exec $MYSQL_DUMP --compact --set-gtid-purged=OFF test t1 t2 t3 t4 t7 +--exec $MYSQL_DUMP --compact --set-gtid-purged=OFF --enable-compressed-columns test t3 t4 t7 +--exec $MYSQL_DUMP --compact --set-gtid-purged=OFF --enable-compressed-columns-with-dictionaries test t1 + +--echo # Restored dump creates only the dumped tables +--let $dump_file= $MYSQLTEST_VARDIR/tmp/xtradb_compressed_columns_mysqldump_comment.sql +--exec $MYSQL_DUMP --skip-comments --set-gtid-purged=OFF test t3 t4 t7 > $dump_file +CREATE DATABASE restored; +--exec $MYSQL restored < $dump_file +SHOW TABLES FROM restored; +SHOW CREATE TABLE restored.t4; +SHOW CREATE TABLE restored.t7; +DROP DATABASE restored; +--remove_file $dump_file + +--echo # Compression dictionary name that contains the extension suffix +CREATE COMPRESSION_DICTIONARY `d */ x` ('abcdef'); +CREATE TABLE t6 (a BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d */ x`); +--exec $MYSQL_DUMP --compact --set-gtid-purged=OFF test t6 +--exec $MYSQL_DUMP --compact --set-gtid-purged=OFF --enable-compressed-columns test t6 +--exec $MYSQL_DUMP --compact --set-gtid-purged=OFF --enable-compressed-columns-with-dictionaries test t6 + +--echo # SHOW CREATE TABLE is UTF-8 whatever --default-character-set is +SET NAMES utf8mb4; +CREATE TABLE t8 ( + `あ` BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d */ x`, + b INT COMMENT 'keep ` /*!50633 COLUMN_FORMAT COMPRESSED this */ text'); +--exec $MYSQL_DUMP --compact --set-gtid-purged=OFF --default-character-set=sjis test t8 +--exec $MYSQL_DUMP --compact --set-gtid-purged=OFF --default-character-set=gbk test t8 +--exec $MYSQL_DUMP --compact --set-gtid-purged=OFF --default-character-set=sjis --enable-compressed-columns-with-dictionaries test t8 + +DROP TABLE t1, t2, t3, t4, t6, t7, t8; +DROP COMPRESSION_DICTIONARY `d */ x`; diff --git a/mysql-test/suite/percona_innodb/t/xtradb_compressed_columns_mysqldump_dictionary_names.test b/mysql-test/suite/percona_innodb/t/xtradb_compressed_columns_mysqldump_dictionary_names.test new file mode 100644 index 00000000000..3aab9bbb2b1 --- /dev/null +++ b/mysql-test/suite/percona_innodb/t/xtradb_compressed_columns_mysqldump_dictionary_names.test @@ -0,0 +1,145 @@ +# +# mysqldump --enable-compressed-columns-with-dictionaries must dump +# compression dictionaries whose names contain quote characters, +# backslashes, spaces or non-ASCII characters, or are keywords or numbers, +# and restore them with the same names and data whatever +# --default-character-set is. Dictionary data must also be restored when the +# mysql client reads the dump in sjis or gbk, where a byte before an escaping +# backslash can make one character with it. +# + +SET NAMES utf8mb4; +CREATE COMPRESSION_DICTIONARY `d``x` ('data1'); +CREATE COMPRESSION_DICTIONARY `d``` ('data2'); +CREATE COMPRESSION_DICTIONARY `a````` ('data3'); +CREATE COMPRESSION_DICTIONARY `d'x` ('da''ta\\4'); +CREATE COMPRESSION_DICTIONARY `d\x` ('data5'); +CREATE COMPRESSION_DICTIONARY `d x` ('data6'); +CREATE COMPRESSION_DICTIONARY `d"x` ('data7'); +CREATE COMPRESSION_DICTIONARY `dあ` ('dataあ\\8'); +CREATE COMPRESSION_DICTIONARY `select` ('data9'); +CREATE COMPRESSION_DICTIONARY `123` ('data10'); +CREATE COMPRESSION_DICTIONARY `d©` ('data©11'); +CREATE COMPRESSION_DICTIONARY `dé` ('data\\é12'''); +CREATE TABLE t1 ( + a BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d``x`, + b BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d```, + c BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `a`````, + d BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d'x`, + e BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d\x`, + f BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d x`, + g BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d"x`, + h BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `dあ`, + i BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `select`, + j BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `123`, + k BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `d©`, + l BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY `dé`); +SELECT DICT_NAME, DICT_DATA FROM INFORMATION_SCHEMA.COMPRESSION_DICTIONARY + ORDER BY HEX(DICT_NAME); +--let $checksum_query= SELECT COUNT(*), MD5(GROUP_CONCAT(HEX(DICT_NAME), ':', HEX(DICT_DATA) ORDER BY HEX(DICT_NAME))) AS checksum FROM INFORMATION_SCHEMA.COMPRESSION_DICTIONARY +--eval $checksum_query + +--let $dump_file= $MYSQLTEST_VARDIR/tmp/xtradb_compressed_columns_mysqldump_dictionary_names.sql +--let $i= 5 +while ($i) +{ + if ($i == 5) + { + --let $options= --skip-comments + } + if ($i == 4) + { + --let $options= --skip-comments --skip-quote-names + } + if ($i == 3) + { + --let $options= --skip-comments --default-character-set=sjis + } + if ($i == 2) + { + --let $options= --skip-comments --default-character-set=gbk + } + if ($i == 1) + { + --let $options= --skip-comments --default-character-set=latin1 + } + --echo # Dump and restore with $options + --exec $MYSQL_DUMP $options --set-gtid-purged=OFF --enable-compressed-columns-with-dictionaries test t1 > $dump_file + DROP TABLE t1; + DROP COMPRESSION_DICTIONARY `d``x`; + DROP COMPRESSION_DICTIONARY `d```; + DROP COMPRESSION_DICTIONARY `a`````; + DROP COMPRESSION_DICTIONARY `d'x`; + DROP COMPRESSION_DICTIONARY `d\x`; + DROP COMPRESSION_DICTIONARY `d x`; + DROP COMPRESSION_DICTIONARY `d"x`; + DROP COMPRESSION_DICTIONARY `dあ`; + DROP COMPRESSION_DICTIONARY `select`; + DROP COMPRESSION_DICTIONARY `123`; + DROP COMPRESSION_DICTIONARY `d©`; + DROP COMPRESSION_DICTIONARY `dé`; + --exec $MYSQL test < $dump_file + --remove_file $dump_file + --eval $checksum_query + SHOW CREATE TABLE t1; + --dec $i +} + +--echo # Dictionary statements of a non-UTF-8 dump +--exec $MYSQL_DUMP --compact --default-character-set=sjis --set-gtid-purged=OFF --enable-compressed-columns-with-dictionaries test t1 + +--echo # Keyword and number names with --skip-quote-names +--exec $MYSQL_DUMP --compact --skip-quote-names --set-gtid-purged=OFF --enable-compressed-columns-with-dictionaries test t1 + +--echo # ANSI quotes +--exec $MYSQL_DUMP --compact --compatible=ansi --no-tablespaces --set-gtid-purged=OFF --enable-compressed-columns-with-dictionaries test t1 + +--echo # Dictionary data read by a mysql client in sjis and gbk +# 'あ' (E3 81 82) and sjis 'ソ' (83 5C) before a quote and a backslash +CREATE COMPRESSION_DICTIONARY mb1 ('あ''あ\\'); +SET @data = X'835C27835C5C'; +CREATE COMPRESSION_DICTIONARY mb2 (@data); +CREATE TABLE t2 ( + a BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY mb1, + b BLOB COLUMN_FORMAT COMPRESSED WITH COMPRESSION_DICTIONARY mb2); +--let $mb_query= SELECT DICT_NAME, HEX(DICT_DATA) FROM INFORMATION_SCHEMA.COMPRESSION_DICTIONARY WHERE DICT_NAME IN ('mb1', 'mb2') ORDER BY DICT_NAME +--eval $mb_query +--let $i= 2 +while ($i) +{ + if ($i == 2) + { + --let $charset= sjis + } + if ($i == 1) + { + --let $charset= gbk + } + --echo # Dump and restore with --default-character-set=$charset + --exec $MYSQL_DUMP --skip-comments --default-character-set=$charset --set-gtid-purged=OFF --enable-compressed-columns-with-dictionaries test t2 > $dump_file + DROP TABLE t2; + DROP COMPRESSION_DICTIONARY mb1; + DROP COMPRESSION_DICTIONARY mb2; + --exec $MYSQL --default-character-set=$charset test < $dump_file + --remove_file $dump_file + --eval $mb_query + SHOW CREATE TABLE t2; + --dec $i +} +DROP TABLE t2; +DROP COMPRESSION_DICTIONARY mb1; +DROP COMPRESSION_DICTIONARY mb2; + +DROP TABLE t1; +DROP COMPRESSION_DICTIONARY `d``x`; +DROP COMPRESSION_DICTIONARY `d```; +DROP COMPRESSION_DICTIONARY `a`````; +DROP COMPRESSION_DICTIONARY `d'x`; +DROP COMPRESSION_DICTIONARY `d\x`; +DROP COMPRESSION_DICTIONARY `d x`; +DROP COMPRESSION_DICTIONARY `d"x`; +DROP COMPRESSION_DICTIONARY `dあ`; +DROP COMPRESSION_DICTIONARY `select`; +DROP COMPRESSION_DICTIONARY `123`; +DROP COMPRESSION_DICTIONARY `d©`; +DROP COMPRESSION_DICTIONARY `dé`; diff --git a/mysql-test/suite/percona_innodb/t/xtradb_compressed_columns_mysqldump_malformed.test b/mysql-test/suite/percona_innodb/t/xtradb_compressed_columns_mysqldump_malformed.test new file mode 100644 index 00000000000..d877abd6d7b --- /dev/null +++ b/mysql-test/suite/percona_innodb/t/xtradb_compressed_columns_mysqldump_malformed.test @@ -0,0 +1,34 @@ +# +# mysqldump must handle compressed column extensions that the server never +# returns: a missing " */", a missing dictionary keyword, a dictionary keyword +# that is quoted or belongs to a later extension, and dictionary names that do +# not fit the 386 byte buffer for a quoted name. +# +--source include/have_debug.inc + +CREATE TABLE t1 (a INT); + +--echo # Extension without " */" is left as is +--exec $MYSQL_DUMP --compact --set-gtid-purged=OFF --debug=d,compressed_columns_no_suffix test t1 +--exec $MYSQL_DUMP --compact --set-gtid-purged=OFF --debug=d,compressed_columns_no_suffix --enable-compressed-columns-with-dictionaries test t1 + +--echo # Extension without the dictionary keyword references no dictionary +--exec $MYSQL_DUMP --compact --set-gtid-purged=OFF --debug=d,compressed_columns_no_keyword --enable-compressed-columns-with-dictionaries test t1 + +--echo # Quoted dictionary keyword references no dictionary +--exec $MYSQL_DUMP --compact --set-gtid-purged=OFF --debug=d,compressed_columns_quoted_keyword --enable-compressed-columns-with-dictionaries test t1 + +--echo # Dictionary keyword of a later extension is not used for an earlier one +CREATE COMPRESSION_DICTIONARY d2 ('data2'); +--exec $MYSQL_DUMP --compact --set-gtid-purged=OFF --debug=d,compressed_columns_later_keyword --enable-compressed-columns-with-dictionaries test t1 +DROP COMPRESSION_DICTIONARY d2; + +--echo # 386 byte dictionary name is looked up +--error 2 +--exec $MYSQL_DUMP --compact --set-gtid-purged=OFF --debug=d,compressed_columns_name_386 --enable-compressed-columns-with-dictionaries test t1 2>&1 + +--echo # 387 byte dictionary name is rejected +--error 3 +--exec $MYSQL_DUMP --compact --set-gtid-purged=OFF --debug=d,compressed_columns_name_387 --enable-compressed-columns-with-dictionaries test t1 2>&1 + +DROP TABLE t1; diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i index f0befa3fdca..989d930bc0a 100644 --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -56,7 +56,7 @@ this program; if not, write to the Free Software Foundation, Inc., #define INNODB_VERSION_BUGFIX MYSQL_VERSION_PATCH #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 11 +#define PERCONA_INNODB_VERSION 12 #endif /* The following is the InnoDB version as shown in