Merge tag 'mariadb-10.0.36' into 10.0-galera
This commit is contained in:
commit
c5a8583b31
6
.gitignore
vendored
6
.gitignore
vendored
@ -462,3 +462,9 @@ UpgradeLog*.htm
|
|||||||
|
|
||||||
# Microsoft Fakes
|
# Microsoft Fakes
|
||||||
FakesAssemblies/
|
FakesAssemblies/
|
||||||
|
|
||||||
|
# macOS garbage
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# QtCreator && CodeBlocks
|
||||||
|
*.cbp
|
||||||
|
@ -166,6 +166,12 @@ ENDIF()
|
|||||||
OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON)
|
OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON)
|
||||||
MARK_AS_ADVANCED(CYBOZU BACKUP_TEST WITHOUT_SERVER DISABLE_SHARED)
|
MARK_AS_ADVANCED(CYBOZU BACKUP_TEST WITHOUT_SERVER DISABLE_SHARED)
|
||||||
|
|
||||||
|
IF (WITHOUT_SERVER)
|
||||||
|
SET (SKIP_COMPONENTS "Server|IniFiles|SuportFiles|Readme")
|
||||||
|
ELSE()
|
||||||
|
SET (SKIP_COMPONENTS "N-O-N-E")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
OPTION(NOT_FOR_DISTRIBUTION "Allow linking with GPLv2-incompatible system libraries. Only set it you never plan to distribute the resulting binaries" OFF)
|
OPTION(NOT_FOR_DISTRIBUTION "Allow linking with GPLv2-incompatible system libraries. Only set it you never plan to distribute the resulting binaries" OFF)
|
||||||
|
|
||||||
include(CheckCSourceCompiles)
|
include(CheckCSourceCompiles)
|
||||||
|
@ -4893,6 +4893,14 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
|
|||||||
if (opt_xml)
|
if (opt_xml)
|
||||||
print_xml_tag(md_result_file, "", "\n", "database", "name=", db, NullS);
|
print_xml_tag(md_result_file, "", "\n", "database", "name=", db, NullS);
|
||||||
|
|
||||||
|
|
||||||
|
/* obtain dump of routines (procs/functions) */
|
||||||
|
if (opt_routines && mysql_get_server_version(mysql) >= 50009)
|
||||||
|
{
|
||||||
|
DBUG_PRINT("info", ("Dumping routines for database %s", db));
|
||||||
|
dump_routines_for_db(db);
|
||||||
|
}
|
||||||
|
|
||||||
if (opt_single_transaction && mysql_get_server_version(mysql) >= 50500)
|
if (opt_single_transaction && mysql_get_server_version(mysql) >= 50500)
|
||||||
{
|
{
|
||||||
verbose_msg("-- Setting savepoint...\n");
|
verbose_msg("-- Setting savepoint...\n");
|
||||||
@ -4902,7 +4910,6 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
|
|||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dump each selected table */
|
/* Dump each selected table */
|
||||||
for (pos= dump_tables; pos < end; pos++)
|
for (pos= dump_tables; pos < end; pos++)
|
||||||
{
|
{
|
||||||
@ -4964,12 +4971,6 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
|
|||||||
DBUG_PRINT("info", ("Dumping events for database %s", db));
|
DBUG_PRINT("info", ("Dumping events for database %s", db));
|
||||||
dump_events_for_db(db);
|
dump_events_for_db(db);
|
||||||
}
|
}
|
||||||
/* obtain dump of routines (procs/functions) */
|
|
||||||
if (opt_routines && mysql_get_server_version(mysql) >= 50009)
|
|
||||||
{
|
|
||||||
DBUG_PRINT("info", ("Dumping routines for database %s", db));
|
|
||||||
dump_routines_for_db(db);
|
|
||||||
}
|
|
||||||
free_root(&glob_root, MYF(0));
|
free_root(&glob_root, MYF(0));
|
||||||
if (opt_xml)
|
if (opt_xml)
|
||||||
{
|
{
|
||||||
|
@ -853,7 +853,7 @@ build_table_string(void)
|
|||||||
|
|
||||||
if (auto_generate_sql_guid_primary)
|
if (auto_generate_sql_guid_primary)
|
||||||
{
|
{
|
||||||
dynstr_append(&table_string, "id varchar(32) primary key");
|
dynstr_append(&table_string, "id varchar(36) primary key");
|
||||||
|
|
||||||
if (num_int_cols || num_char_cols || auto_generate_sql_guid_primary)
|
if (num_int_cols || num_char_cols || auto_generate_sql_guid_primary)
|
||||||
dynstr_append(&table_string, ",");
|
dynstr_append(&table_string, ",");
|
||||||
@ -868,7 +868,7 @@ build_table_string(void)
|
|||||||
if (count) /* Except for the first pass we add a comma */
|
if (count) /* Except for the first pass we add a comma */
|
||||||
dynstr_append(&table_string, ",");
|
dynstr_append(&table_string, ",");
|
||||||
|
|
||||||
if (snprintf(buf, HUGE_STRING_LENGTH, "id%d varchar(32) unique key", count)
|
if (snprintf(buf, HUGE_STRING_LENGTH, "id%d varchar(36) unique key", count)
|
||||||
> HUGE_STRING_LENGTH)
|
> HUGE_STRING_LENGTH)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Memory Allocation error in create table\n");
|
fprintf(stderr, "Memory Allocation error in create table\n");
|
||||||
|
@ -8770,6 +8770,7 @@ void init_re(void)
|
|||||||
"[[:space:]]*SELECT[[:space:]]|"
|
"[[:space:]]*SELECT[[:space:]]|"
|
||||||
"[[:space:]]*CREATE[[:space:]]+TABLE[[:space:]]|"
|
"[[:space:]]*CREATE[[:space:]]+TABLE[[:space:]]|"
|
||||||
"[[:space:]]*DO[[:space:]]|"
|
"[[:space:]]*DO[[:space:]]|"
|
||||||
|
"[[:space:]]*HANDLER[[:space:]]+.*[[:space:]]+READ[[:space:]]|"
|
||||||
"[[:space:]]*SET[[:space:]]+OPTION[[:space:]]|"
|
"[[:space:]]*SET[[:space:]]+OPTION[[:space:]]|"
|
||||||
"[[:space:]]*DELETE[[:space:]]+MULTI[[:space:]]|"
|
"[[:space:]]*DELETE[[:space:]]+MULTI[[:space:]]|"
|
||||||
"[[:space:]]*UPDATE[[:space:]]+MULTI[[:space:]]|"
|
"[[:space:]]*UPDATE[[:space:]]+MULTI[[:space:]]|"
|
||||||
|
@ -140,6 +140,10 @@ FUNCTION(INSTALL_SCRIPT)
|
|||||||
SET(COMP)
|
SET(COMP)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF (COMP MATCHES ${SKIP_COMPONENTS})
|
||||||
|
RETURN()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
INSTALL(FILES
|
INSTALL(FILES
|
||||||
${script}
|
${script}
|
||||||
DESTINATION ${ARG_DESTINATION}
|
DESTINATION ${ARG_DESTINATION}
|
||||||
@ -163,6 +167,10 @@ FUNCTION(INSTALL_DOCUMENTATION)
|
|||||||
SET(destination ${INSTALL_DOCDIR})
|
SET(destination ${INSTALL_DOCDIR})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF (ARG_COMPONENT MATCHES ${SKIP_COMPONENTS})
|
||||||
|
RETURN()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
STRING(TOUPPER ${ARG_COMPONENT} COMPUP)
|
STRING(TOUPPER ${ARG_COMPONENT} COMPUP)
|
||||||
IF(CPACK_COMPONENT_${COMPUP}_GROUP)
|
IF(CPACK_COMPONENT_${COMPUP}_GROUP)
|
||||||
SET(group ${CPACK_COMPONENT_${COMPUP}_GROUP})
|
SET(group ${CPACK_COMPONENT_${COMPUP}_GROUP})
|
||||||
|
@ -59,6 +59,9 @@ FUNCTION (MYSQL_ADD_EXECUTABLE)
|
|||||||
ELSE()
|
ELSE()
|
||||||
SET(COMP COMPONENT Client)
|
SET(COMP COMPONENT Client)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
IF (COMP MATCHES ${SKIP_COMPONENTS})
|
||||||
|
RETURN()
|
||||||
|
ENDIF()
|
||||||
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} ${COMP})
|
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} ${COMP})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDFUNCTION()
|
ENDFUNCTION()
|
||||||
|
@ -51,7 +51,7 @@ IF(CMAKE_C_COMPILER MATCHES "icl")
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
ADD_DEFINITIONS(-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE)
|
ADD_DEFINITIONS(-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE)
|
||||||
ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501)
|
ADD_DEFINITIONS(-D_WIN32_WINNT=0x0A00)
|
||||||
# We do not want the windows.h macros min/max
|
# We do not want the windows.h macros min/max
|
||||||
ADD_DEFINITIONS(-DNOMINMAX)
|
ADD_DEFINITIONS(-DNOMINMAX)
|
||||||
# Speed up build process excluding unused header files
|
# Speed up build process excluding unused header files
|
||||||
|
@ -365,7 +365,7 @@ typedef int (*my_charset_conv_mb_wc)(CHARSET_INFO *, my_wc_t *,
|
|||||||
typedef int (*my_charset_conv_wc_mb)(CHARSET_INFO *, my_wc_t,
|
typedef int (*my_charset_conv_wc_mb)(CHARSET_INFO *, my_wc_t,
|
||||||
uchar *, uchar *);
|
uchar *, uchar *);
|
||||||
typedef size_t (*my_charset_conv_case)(CHARSET_INFO *,
|
typedef size_t (*my_charset_conv_case)(CHARSET_INFO *,
|
||||||
char *, size_t, char *, size_t);
|
const char *, size_t, char *, size_t);
|
||||||
|
|
||||||
|
|
||||||
/* See strings/CHARSET_INFO.txt about information on this structure */
|
/* See strings/CHARSET_INFO.txt about information on this structure */
|
||||||
@ -565,9 +565,11 @@ extern uint my_instr_simple(CHARSET_INFO *,
|
|||||||
/* Functions for 8bit */
|
/* Functions for 8bit */
|
||||||
extern size_t my_caseup_str_8bit(CHARSET_INFO *, char *);
|
extern size_t my_caseup_str_8bit(CHARSET_INFO *, char *);
|
||||||
extern size_t my_casedn_str_8bit(CHARSET_INFO *, char *);
|
extern size_t my_casedn_str_8bit(CHARSET_INFO *, char *);
|
||||||
extern size_t my_caseup_8bit(CHARSET_INFO *, char *src, size_t srclen,
|
extern size_t my_caseup_8bit(CHARSET_INFO *,
|
||||||
|
const char *src, size_t srclen,
|
||||||
char *dst, size_t dstlen);
|
char *dst, size_t dstlen);
|
||||||
extern size_t my_casedn_8bit(CHARSET_INFO *, char *src, size_t srclen,
|
extern size_t my_casedn_8bit(CHARSET_INFO *,
|
||||||
|
const char *src, size_t srclen,
|
||||||
char *dst, size_t dstlen);
|
char *dst, size_t dstlen);
|
||||||
|
|
||||||
extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *);
|
extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *);
|
||||||
@ -658,17 +660,17 @@ uint my_mbcharlen_8bit(CHARSET_INFO *, uint c);
|
|||||||
/* Functions for multibyte charsets */
|
/* Functions for multibyte charsets */
|
||||||
extern size_t my_caseup_str_mb(CHARSET_INFO *, char *);
|
extern size_t my_caseup_str_mb(CHARSET_INFO *, char *);
|
||||||
extern size_t my_casedn_str_mb(CHARSET_INFO *, char *);
|
extern size_t my_casedn_str_mb(CHARSET_INFO *, char *);
|
||||||
extern size_t my_caseup_mb(CHARSET_INFO *, char *src, size_t srclen,
|
extern size_t my_caseup_mb(CHARSET_INFO *,
|
||||||
char *dst, size_t dstlen);
|
const char *src, size_t srclen,
|
||||||
extern size_t my_casedn_mb(CHARSET_INFO *, char *src, size_t srclen,
|
char *dst, size_t dstlen);
|
||||||
char *dst, size_t dstlen);
|
extern size_t my_casedn_mb(CHARSET_INFO *,
|
||||||
extern size_t my_caseup_mb_varlen(CHARSET_INFO *, char *src, size_t srclen,
|
const char *src, size_t srclen,
|
||||||
char *dst, size_t dstlen);
|
char *dst, size_t dstlen);
|
||||||
extern size_t my_casedn_mb_varlen(CHARSET_INFO *, char *src, size_t srclen,
|
extern size_t my_caseup_ujis(CHARSET_INFO *,
|
||||||
char *dst, size_t dstlen);
|
const char *src, size_t srclen,
|
||||||
extern size_t my_caseup_ujis(CHARSET_INFO *, char *src, size_t srclen,
|
|
||||||
char *dst, size_t dstlen);
|
char *dst, size_t dstlen);
|
||||||
extern size_t my_casedn_ujis(CHARSET_INFO *, char *src, size_t srclen,
|
extern size_t my_casedn_ujis(CHARSET_INFO *,
|
||||||
|
const char *src, size_t srclen,
|
||||||
char *dst, size_t dstlen);
|
char *dst, size_t dstlen);
|
||||||
extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *);
|
extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *);
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#ifndef SQL_COMMON_INCLUDED
|
#ifndef SQL_COMMON_INCLUDED
|
||||||
#define SQL_COMMON_INCLUDED
|
#define SQL_COMMON_INCLUDED
|
||||||
/* Copyright (c) 2003, 2012, Oracle and/or its affiliates.
|
/* Copyright (c) 2003, 2018, Oracle and/or its affiliates.
|
||||||
Copyright (c) 2010, 2018, MariaDB
|
Copyright (c) 2010, 2018, MariaDB
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
@ -32,627 +32,97 @@ INSERT INTO tt_2(ddl_case) VALUES(0);
|
|||||||
--echo # CHECK IMPLICT COMMIT
|
--echo # CHECK IMPLICT COMMIT
|
||||||
--echo #########################################################################
|
--echo #########################################################################
|
||||||
SET AUTOCOMMIT= 0;
|
SET AUTOCOMMIT= 0;
|
||||||
let $ddl_cases= 43;
|
|
||||||
while ($ddl_cases >= 1)
|
|
||||||
{
|
|
||||||
--echo -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
|
|
||||||
let $in_temporary= no;
|
|
||||||
let $ok= yes;
|
|
||||||
#
|
|
||||||
# In SBR and MIXED modes, the commit event is usually the third event in the
|
|
||||||
# binary log:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: INSERT
|
|
||||||
# 3: COMMIT
|
|
||||||
# 4: DDL EVENT which triggered the previous commmit.
|
|
||||||
#
|
|
||||||
if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 3;
|
|
||||||
}
|
|
||||||
#
|
|
||||||
# In RBR mode, the commit event is usually the fourth event in the binary log:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: TABLE MAP EVENT
|
|
||||||
# 3: ROW EVENT
|
|
||||||
# 4: COMMIT
|
|
||||||
# 5: DDL EVENT which triggered the previous commmit.
|
|
||||||
#
|
|
||||||
if (`select @@binlog_format = 'ROW'`)
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 4;
|
|
||||||
}
|
|
||||||
#
|
|
||||||
# In NDB (RBR and MIXED modes), the commit event is usually the seventh event
|
|
||||||
# in the binary log:
|
|
||||||
#
|
|
||||||
# 1: COMMAND
|
|
||||||
# 2: BEGIN
|
|
||||||
# 3: TABLE MAP EVENT
|
|
||||||
# 4: TABLE MAP EVENT (ndb_apply_status)
|
|
||||||
# 5: ROW EVENT
|
|
||||||
# 6: ROW EVENT
|
|
||||||
# 7: COMMIT
|
|
||||||
#
|
|
||||||
if ($engine == NDB)
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
let $first_binlog_position= query_get_value("SHOW MASTER STATUS", Position, 1);
|
|
||||||
--enable_query_log
|
|
||||||
eval INSERT INTO tt_1(ddl_case) VALUES ($ddl_cases);
|
|
||||||
|
|
||||||
if ($ddl_cases == 43)
|
INSERT INTO tt_1(ddl_case) VALUES (43);
|
||||||
{
|
replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB;
|
||||||
let $cmd= CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
|
eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_SO";
|
||||||
}
|
INSERT INTO tt_1(ddl_case) VALUES (42);
|
||||||
if ($ddl_cases == 42)
|
DROP FUNCTION myfunc_int;
|
||||||
{
|
INSERT INTO tt_1(ddl_case) VALUES (41);
|
||||||
let $cmd= DROP FUNCTION myfunc_int;
|
LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES;
|
||||||
}
|
INSERT INTO tt_1(ddl_case) VALUES (40);
|
||||||
if ($ddl_cases == 41)
|
LOAD INDEX INTO CACHE tt_1, tt_2 IGNORE LEAVES;
|
||||||
{
|
INSERT INTO tt_1(ddl_case) VALUES (39);
|
||||||
let $cmd= LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES;
|
ANALYZE TABLE nt_1;
|
||||||
if ($engine == NDB)
|
INSERT INTO tt_1(ddl_case) VALUES (38);
|
||||||
{
|
CHECK TABLE nt_1;
|
||||||
# This seems to be related to epochs.
|
INSERT INTO tt_1(ddl_case) VALUES (37);
|
||||||
# We need to check this against an updated version or avoid it.
|
OPTIMIZE TABLE nt_1;
|
||||||
let $ok= no;
|
INSERT INTO tt_1(ddl_case) VALUES (36);
|
||||||
let $commit_event_row_number= 6;
|
REPAIR TABLE nt_1;
|
||||||
}
|
INSERT INTO tt_1(ddl_case) VALUES (35);
|
||||||
}
|
LOCK TABLES tt_1 WRITE;
|
||||||
if ($ddl_cases == 40)
|
INSERT INTO tt_1(ddl_case) VALUES (34);
|
||||||
{
|
UNLOCK TABLES;
|
||||||
let $cmd= LOAD INDEX INTO CACHE tt_1, tt_2 IGNORE LEAVES;
|
INSERT INTO tt_1(ddl_case) VALUES (33);
|
||||||
#
|
CREATE USER 'user'@'localhost';
|
||||||
# In NDB (RBR and MIXED modes), the commit event is the sixth event
|
INSERT INTO tt_1(ddl_case) VALUES (32);
|
||||||
# in the binary log:
|
GRANT ALL ON *.* TO 'user'@'localhost';
|
||||||
#
|
INSERT INTO tt_1(ddl_case) VALUES (31);
|
||||||
# 1: BEGIN
|
SET PASSWORD FOR 'user'@'localhost' = PASSWORD('newpass');
|
||||||
# 2: TABLE MAP EVENT
|
INSERT INTO tt_1(ddl_case) VALUES (30);
|
||||||
# 3: TABLE MAP EVENT (ndb_apply_status)
|
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost';
|
||||||
# 4: ROW EVENT
|
INSERT INTO tt_1(ddl_case) VALUES (29);
|
||||||
# 5: ROW EVENT
|
RENAME USER 'user'@'localhost' TO 'user_new'@'localhost';
|
||||||
# 6: COMMIT
|
INSERT INTO tt_1(ddl_case) VALUES (28);
|
||||||
#
|
DROP USER 'user_new'@'localhost';
|
||||||
if ($engine == NDB)
|
INSERT INTO tt_1(ddl_case) VALUES (27);
|
||||||
{
|
CREATE EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1;
|
||||||
let $commit_event_row_number= 6;
|
INSERT INTO tt_1(ddl_case) VALUES (26);
|
||||||
}
|
ALTER EVENT evt COMMENT 'evt';
|
||||||
}
|
INSERT INTO tt_1(ddl_case) VALUES (25);
|
||||||
if ($ddl_cases == 39)
|
DROP EVENT evt;
|
||||||
{
|
INSERT INTO tt_1(ddl_case) VALUES (24);
|
||||||
let $cmd= ANALYZE TABLE nt_1;
|
CREATE TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case;
|
||||||
}
|
INSERT INTO tt_1(ddl_case) VALUES (23);
|
||||||
if ($ddl_cases == 38)
|
DROP TRIGGER tr;
|
||||||
{
|
INSERT INTO tt_1(ddl_case) VALUES (22);
|
||||||
let $cmd= CHECK TABLE nt_1;
|
CREATE FUNCTION fc () RETURNS VARCHAR(64) RETURN "fc";
|
||||||
#
|
INSERT INTO tt_1(ddl_case) VALUES (21);
|
||||||
# In NDB (RBR and MIXED modes), the commit event is the sixth event
|
ALTER FUNCTION fc COMMENT 'fc';
|
||||||
# in the binary log:
|
INSERT INTO tt_1(ddl_case) VALUES (20);
|
||||||
#
|
DROP FUNCTION fc;
|
||||||
# 1: BEGIN
|
INSERT INTO tt_1(ddl_case) VALUES (19);
|
||||||
# 2: TABLE MAP EVENT
|
CREATE PROCEDURE pc () UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case;
|
||||||
# 3: TABLE MAP EVENT (ndb_apply_status)
|
INSERT INTO tt_1(ddl_case) VALUES (18);
|
||||||
# 4: ROW EVENT
|
ALTER PROCEDURE pc COMMENT 'pc';
|
||||||
# 5: ROW EVENT
|
INSERT INTO tt_1(ddl_case) VALUES (17);
|
||||||
# 6: COMMIT
|
DROP PROCEDURE pc;
|
||||||
#
|
INSERT INTO tt_1(ddl_case) VALUES (16);
|
||||||
if ($engine == NDB)
|
CREATE VIEW v AS SELECT * FROM tt_1;
|
||||||
{
|
INSERT INTO tt_1(ddl_case) VALUES (15);
|
||||||
let $commit_event_row_number= 6;
|
ALTER VIEW v AS SELECT * FROM tt_1;
|
||||||
}
|
INSERT INTO tt_1(ddl_case) VALUES (14);
|
||||||
}
|
DROP VIEW v;
|
||||||
if ($ddl_cases == 37)
|
INSERT INTO tt_1(ddl_case) VALUES (13);
|
||||||
{
|
CREATE INDEX ix ON tt_1(ddl_case);
|
||||||
let $cmd= OPTIMIZE TABLE nt_1;
|
INSERT INTO tt_1(ddl_case) VALUES (12);
|
||||||
}
|
DROP INDEX ix ON tt_1;
|
||||||
if ($ddl_cases == 36)
|
INSERT INTO tt_1(ddl_case) VALUES (11);
|
||||||
{
|
CREATE TEMPORARY TABLE tt_xx (a int);
|
||||||
let $cmd= REPAIR TABLE nt_1;
|
INSERT INTO tt_1(ddl_case) VALUES (10);
|
||||||
}
|
ALTER TABLE tt_xx ADD COLUMN (b int);
|
||||||
if ($ddl_cases == 35)
|
INSERT INTO tt_1(ddl_case) VALUES (9);
|
||||||
{
|
ALTER TABLE tt_xx RENAME new_tt_xx;
|
||||||
let $cmd= LOCK TABLES tt_1 WRITE;
|
INSERT INTO tt_1(ddl_case) VALUES (8);
|
||||||
#
|
DROP TEMPORARY TABLE IF EXISTS new_tt_xx;
|
||||||
# In NDB (RBR and MIXED modes), the commit event is the sixth event
|
INSERT INTO tt_1(ddl_case) VALUES (7);
|
||||||
# in the binary log:
|
CREATE TABLE tt_xx (a int);
|
||||||
#
|
INSERT INTO tt_1(ddl_case) VALUES (6);
|
||||||
# 1: BEGIN
|
ALTER TABLE tt_xx ADD COLUMN (b int);
|
||||||
# 2: TABLE MAP EVENT
|
INSERT INTO tt_1(ddl_case) VALUES (5);
|
||||||
# 3: TABLE MAP EVENT (ndb_apply_status)
|
RENAME TABLE tt_xx TO new_tt_xx;
|
||||||
# 4: ROW EVENT
|
INSERT INTO tt_1(ddl_case) VALUES (4);
|
||||||
# 5: ROW EVENT
|
TRUNCATE TABLE new_tt_xx;
|
||||||
# 6: COMMIT
|
INSERT INTO tt_1(ddl_case) VALUES (3);
|
||||||
#
|
DROP TABLE IF EXISTS tt_xx, new_tt_xx;
|
||||||
if ($engine == NDB)
|
INSERT INTO tt_1(ddl_case) VALUES (2);
|
||||||
{
|
CREATE DATABASE db;
|
||||||
let $commit_event_row_number= 6;
|
INSERT INTO tt_1(ddl_case) VALUES (1);
|
||||||
}
|
DROP DATABASE IF EXISTS db;
|
||||||
}
|
|
||||||
if ($ddl_cases == 34)
|
source include/show_binlog_events.inc;
|
||||||
{
|
|
||||||
let $cmd= UNLOCK TABLES;
|
|
||||||
#
|
|
||||||
# In NDB (RBR and MIXED modes), the commit event is the sixth event
|
|
||||||
# in the binary log:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: TABLE MAP EVENT
|
|
||||||
# 3: TABLE MAP EVENT (ndb_apply_status)
|
|
||||||
# 4: ROW EVENT
|
|
||||||
# 5: ROW EVENT
|
|
||||||
# 6: COMMIT
|
|
||||||
#
|
|
||||||
if ($engine == NDB)
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 33)
|
|
||||||
{
|
|
||||||
let $cmd= CREATE USER 'user'@'localhost';
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 32)
|
|
||||||
{
|
|
||||||
let $cmd= GRANT ALL ON *.* TO 'user'@'localhost';
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 31)
|
|
||||||
{
|
|
||||||
let $cmd= SET PASSWORD FOR 'user'@'localhost' = PASSWORD('newpass');
|
|
||||||
#
|
|
||||||
# In NDB (RBR mode), the commit event is the eleventh event
|
|
||||||
# in the binary log:
|
|
||||||
#
|
|
||||||
# 1: DDL EVENT which triggered the previous commmit.
|
|
||||||
# 2: BEGIN
|
|
||||||
# 3: TABLE MAP EVENT
|
|
||||||
# 4: ROW EVENT
|
|
||||||
# 5: COMMIT
|
|
||||||
# 6: BEGIN
|
|
||||||
# 7: TABLE MAP EVENT
|
|
||||||
# 8: TABLE MAP EVENT (ndb_apply_status)
|
|
||||||
# 9: ROW EVENT
|
|
||||||
# 10: ROW EVENT
|
|
||||||
# 11: COMMIT
|
|
||||||
#
|
|
||||||
if (`SELECT '$engine' = 'NDB' && @@binlog_format = 'ROW'`)
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 11;
|
|
||||||
}
|
|
||||||
#
|
|
||||||
# In NDB (MIXED mode), the commit event is the eighth event
|
|
||||||
# in the binary log:
|
|
||||||
#
|
|
||||||
# 1: DDL EVENT which triggered the previous commmit.
|
|
||||||
# 2: BEGIN
|
|
||||||
# 3: TABLE MAP EVENT
|
|
||||||
# 4: TABLE MAP EVENT (ndb_apply_status)
|
|
||||||
# 5: ROW EVENT
|
|
||||||
# 6: ROW EVENT
|
|
||||||
# 7: COMMIT
|
|
||||||
#
|
|
||||||
if (`SELECT '$engine' = 'NDB' && @@binlog_format != 'ROW'`)
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 7;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 30)
|
|
||||||
{
|
|
||||||
let $cmd= REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost';
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 29)
|
|
||||||
{
|
|
||||||
let $cmd= RENAME USER 'user'@'localhost' TO 'user_new'@'localhost';
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 28)
|
|
||||||
{
|
|
||||||
let $cmd= DROP USER 'user_new'@'localhost';
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 27)
|
|
||||||
{
|
|
||||||
let $cmd= CREATE EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1;
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 26)
|
|
||||||
{
|
|
||||||
let $cmd= ALTER EVENT evt COMMENT 'evt';
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 25)
|
|
||||||
{
|
|
||||||
let $cmd= DROP EVENT evt;
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 24)
|
|
||||||
{
|
|
||||||
let $cmd= CREATE TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case;
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 23)
|
|
||||||
{
|
|
||||||
let $cmd= DROP TRIGGER tr;
|
|
||||||
#
|
|
||||||
# In RBR mode, due to the trigger the tt_2 is also updated:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: TABLE MAP EVENT
|
|
||||||
# 3: TABLE MAP EVENT
|
|
||||||
# 4: ROW EVENT
|
|
||||||
# 5: COMMIT
|
|
||||||
# 6: DDL EVENT which triggered the previous commmit.
|
|
||||||
#
|
|
||||||
if (`select @@binlog_format = 'ROW' && '$engine' != 'NDB'`)
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 22)
|
|
||||||
{
|
|
||||||
let $cmd= CREATE FUNCTION fc () RETURNS VARCHAR(64) RETURN "fc";
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 21)
|
|
||||||
{
|
|
||||||
let $cmd= ALTER FUNCTION fc COMMENT 'fc';
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 20)
|
|
||||||
{
|
|
||||||
let $cmd= DROP FUNCTION fc;
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 19)
|
|
||||||
{
|
|
||||||
let $cmd= CREATE PROCEDURE pc () UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case;
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 18)
|
|
||||||
{
|
|
||||||
let $cmd= ALTER PROCEDURE pc COMMENT 'pc';
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 17)
|
|
||||||
{
|
|
||||||
let $cmd= DROP PROCEDURE pc;
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 16)
|
|
||||||
{
|
|
||||||
let $cmd= CREATE VIEW v AS SELECT * FROM tt_1;
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 15)
|
|
||||||
{
|
|
||||||
let $cmd= ALTER VIEW v AS SELECT * FROM tt_1;
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 14)
|
|
||||||
{
|
|
||||||
let $cmd= DROP VIEW v;
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 13)
|
|
||||||
{
|
|
||||||
let $cmd= CREATE INDEX ix ON tt_1(ddl_case);
|
|
||||||
#
|
|
||||||
# In NDB (RBR and MIXED modes), the commit event is the sixth event
|
|
||||||
# in the binary log:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: TABLE MAP EVENT
|
|
||||||
# 3: TABLE MAP EVENT (ndb_apply_status)
|
|
||||||
# 4: ROW EVENT
|
|
||||||
# 5: ROW EVENT
|
|
||||||
# 6: COMMIT
|
|
||||||
# 7: DDL EVENT which triggered the previous commmit.
|
|
||||||
#
|
|
||||||
if ($engine == NDB)
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 12)
|
|
||||||
{
|
|
||||||
let $cmd= DROP INDEX ix ON tt_1;
|
|
||||||
#
|
|
||||||
# In NDB (RBR and MIXED modes), the commit event is the sixth event
|
|
||||||
# in the binary log:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: TABLE MAP EVENT
|
|
||||||
# 3: TABLE MAP EVENT (ndb_apply_status)
|
|
||||||
# 4: ROW EVENT
|
|
||||||
# 5: ROW EVENT
|
|
||||||
# 6: COMMIT
|
|
||||||
# 7: DDL EVENT which triggered the previous commmit.
|
|
||||||
#
|
|
||||||
if ($engine == NDB)
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 11)
|
|
||||||
{
|
|
||||||
let $cmd= CREATE TEMPORARY TABLE tt_xx (a int);
|
|
||||||
let $in_temporary= yes;
|
|
||||||
# In SBR and MIXED modes, the DDL statement is written to the binary log but
|
|
||||||
# does not commit the current transaction.
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: CREATE TEMPORARY
|
|
||||||
# 3: INSERT
|
|
||||||
# 4: COMMIT
|
|
||||||
#
|
|
||||||
# In RBR the transaction is not committed either and the statement is not
|
|
||||||
# written to the binary log:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: TABLE MAP EVENT
|
|
||||||
# 3: ROW EVENT
|
|
||||||
# 4: COMMIT
|
|
||||||
#
|
|
||||||
if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'` )
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 4;
|
|
||||||
}
|
|
||||||
#
|
|
||||||
# In NDB (RBR mode), the commit event is the sixth event
|
|
||||||
# in the binary log:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: TABLE MAP EVENT
|
|
||||||
# 3: TABLE MAP EVENT (ndb_apply_status)
|
|
||||||
# 4: ROW EVENT
|
|
||||||
# 5: ROW EVENT
|
|
||||||
# 6: COMMIT
|
|
||||||
#
|
|
||||||
if (`SELECT '$engine' = 'NDB' && @@binlog_format = 'ROW'` )
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 6;
|
|
||||||
}
|
|
||||||
#
|
|
||||||
# In NDB (MIXED mode), the commit event is the nineth event
|
|
||||||
# in the binary log:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: DDL EVENT which triggered the previous commmit.
|
|
||||||
# 3: COMMIT
|
|
||||||
# 4: BEGIN
|
|
||||||
# 5: TABLE MAP EVENT
|
|
||||||
# 6: TABLE MAP EVENT (ndb_apply_status)
|
|
||||||
# 7: ROW EVENT
|
|
||||||
# 8: ROW EVENT
|
|
||||||
# 9: COMMIT
|
|
||||||
#
|
|
||||||
if (`SELECT '$engine' = 'NDB' && @@binlog_format != 'ROW'` )
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 9;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 10)
|
|
||||||
{
|
|
||||||
let $cmd= ALTER TABLE tt_xx ADD COLUMN (b int);
|
|
||||||
#
|
|
||||||
# In MIXED mode, the changes are logged as rows and we have what follows:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: TABLE MAP EVENT
|
|
||||||
# 3: ROW EVENT
|
|
||||||
# 4: COMMIT
|
|
||||||
# 5: DDL EVENT which triggered the previous commmit.
|
|
||||||
#
|
|
||||||
if (`select @@binlog_format = 'MIXED'`)
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 4;
|
|
||||||
}
|
|
||||||
#
|
|
||||||
# In NDB (RBR and MIXED modes), the commit event is the sixth event
|
|
||||||
# in the binary log:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: TABLE MAP EVENT
|
|
||||||
# 3: TABLE MAP EVENT (ndb_apply_status)
|
|
||||||
# 4: ROW EVENT
|
|
||||||
# 5: ROW EVENT
|
|
||||||
# 6: COMMIT
|
|
||||||
#
|
|
||||||
if ($engine == NDB)
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 9)
|
|
||||||
{
|
|
||||||
let $cmd= ALTER TABLE tt_xx RENAME new_tt_xx;
|
|
||||||
#
|
|
||||||
# In MIXED mode, the changes are logged as rows and we have what follows:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: TABLE MAP EVENT
|
|
||||||
# 3: ROW EVENT
|
|
||||||
# 4: COMMIT
|
|
||||||
# 5: DDL EVENT which triggered the previous commmit.
|
|
||||||
#
|
|
||||||
if (`select @@binlog_format = 'MIXED'`)
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 4;
|
|
||||||
}
|
|
||||||
#
|
|
||||||
# In NDB (RBR and MIXED modes), the commit event is the sixth event
|
|
||||||
# in the binary log:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: TABLE MAP EVENT
|
|
||||||
# 3: TABLE MAP EVENT (ndb_apply_status)
|
|
||||||
# 4: ROW EVENT
|
|
||||||
# 5: ROW EVENT
|
|
||||||
# 6: COMMIT
|
|
||||||
#
|
|
||||||
if ($engine == NDB)
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 8)
|
|
||||||
{
|
|
||||||
let $cmd= DROP TEMPORARY TABLE IF EXISTS new_tt_xx;
|
|
||||||
let $in_temporary= yes;
|
|
||||||
#
|
|
||||||
# In SBR and MIXED modes, the DDL statement is written to the binary log
|
|
||||||
# but does not commit the current transaction:
|
|
||||||
#
|
|
||||||
# In SBR, we have what follows:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: INSERT
|
|
||||||
# 3: DROP TEMPORARY
|
|
||||||
# 4: COMMIT
|
|
||||||
#
|
|
||||||
# In RBR the transaction is not committed either and the statement is not
|
|
||||||
# written to the binary log:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: TABLE MAP EVENT
|
|
||||||
# 3: ROW EVENT
|
|
||||||
# 4: COMMIT
|
|
||||||
#
|
|
||||||
if (`select @@binlog_format = 'STATEMENT'`)
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 4;
|
|
||||||
}
|
|
||||||
# In MIXED mode, the changes are logged as rows and we have what follows:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: TABLE MAP EVENT
|
|
||||||
# 3: ROW EVENT
|
|
||||||
# 4: DROP TEMPORARY table IF EXISTS
|
|
||||||
# 5: COMMIT
|
|
||||||
#
|
|
||||||
if (`select @@binlog_format = 'MIXED' || @@binlog_format = 'ROW'`)
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 5;
|
|
||||||
}
|
|
||||||
#
|
|
||||||
# In NDB (RBR and MIXED modes), the commit event is the sixth event
|
|
||||||
# in the binary log:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: DROP TEMPORARY table IF EXISTS
|
|
||||||
# 3: COMMIT
|
|
||||||
# 4: BEGIN
|
|
||||||
# 5: TABLE MAP EVENT
|
|
||||||
# 6: TABLE MAP EVENT (ndb_apply_status)
|
|
||||||
# 7: ROW EVENT
|
|
||||||
# 8: ROW EVENT
|
|
||||||
# 9: COMMIT
|
|
||||||
#
|
|
||||||
if ($engine == NDB)
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 9;
|
|
||||||
}
|
|
||||||
#
|
|
||||||
# In NDB (MIXED mode), the commit event is the nineth event
|
|
||||||
# in the binary log:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: DDL EVENT which triggered the previous commmit.
|
|
||||||
# 3: COMMIT
|
|
||||||
# 4: BEGIN
|
|
||||||
# 5: TABLE MAP EVENT
|
|
||||||
# 6: TABLE MAP EVENT (ndb_apply_status)
|
|
||||||
# 7: ROW EVENT
|
|
||||||
# 8: ROW EVENT
|
|
||||||
# 9: COMMIT
|
|
||||||
#
|
|
||||||
if (`SELECT '$engine' = 'NDB' && @@binlog_format != 'ROW'` )
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 9;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 7)
|
|
||||||
{
|
|
||||||
let $cmd= CREATE TABLE tt_xx (a int);
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 6)
|
|
||||||
{
|
|
||||||
let $cmd= ALTER TABLE tt_xx ADD COLUMN (b int);
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 5)
|
|
||||||
{
|
|
||||||
let $cmd= RENAME TABLE tt_xx TO new_tt_xx;
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 4)
|
|
||||||
{
|
|
||||||
let $cmd= TRUNCATE TABLE new_tt_xx;
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 3)
|
|
||||||
{
|
|
||||||
let $cmd= DROP TABLE IF EXISTS tt_xx, new_tt_xx;
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 2)
|
|
||||||
{
|
|
||||||
let $cmd= CREATE DATABASE db;
|
|
||||||
#
|
|
||||||
# In NDB (RBR and MIXED modes), the commit event is the sixth event
|
|
||||||
# in the binary log:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: TABLE MAP EVENT
|
|
||||||
# 3: TABLE MAP EVENT (ndb_apply_status)
|
|
||||||
# 4: ROW EVENT
|
|
||||||
# 5: ROW EVENT
|
|
||||||
# 6: COMMIT
|
|
||||||
# 7: DDL EVENT which triggered the previous commmit.
|
|
||||||
#
|
|
||||||
if ($engine == NDB)
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($ddl_cases == 1)
|
|
||||||
{
|
|
||||||
let $cmd= DROP DATABASE IF EXISTS db;
|
|
||||||
#
|
|
||||||
# In NDB (RBR and MIXED modes), the commit event is the sixth event
|
|
||||||
# in the binary log:
|
|
||||||
#
|
|
||||||
# 1: BEGIN
|
|
||||||
# 2: TABLE MAP EVENT
|
|
||||||
# 3: TABLE MAP EVENT (ndb_apply_status)
|
|
||||||
# 4: ROW EVENT
|
|
||||||
# 5: ROW EVENT
|
|
||||||
# 6: COMMIT
|
|
||||||
# 7: DDL EVENT which triggered the previous commmit.
|
|
||||||
#
|
|
||||||
if ($engine == NDB)
|
|
||||||
{
|
|
||||||
let $commit_event_row_number= 6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
|
|
||||||
--eval $cmd
|
|
||||||
--disable_query_log
|
|
||||||
#
|
|
||||||
# When a temporary table is either created or dropped, there is no implicit
|
|
||||||
# commit. The flag in_temporary is used to avoid aborting the test in such
|
|
||||||
# cases. Thus we force the commit.
|
|
||||||
#
|
|
||||||
if ($in_temporary == yes)
|
|
||||||
{
|
|
||||||
--eval COMMIT
|
|
||||||
}
|
|
||||||
let $event_commit= query_get_value("SHOW BINLOG EVENTS FROM $first_binlog_position", Info, $commit_event_row_number);
|
|
||||||
if (`SELECT SUBSTRING("$event_commit",1,6) != "COMMIT"`)
|
|
||||||
{
|
|
||||||
if ($ok == yes)
|
|
||||||
{
|
|
||||||
--echo it *does not* commit the current transaction.
|
|
||||||
--echo $cmd
|
|
||||||
--echo $event_commit
|
|
||||||
SHOW BINLOG EVENTS;
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
--echo -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
|
|
||||||
let $binlog_start= $first_binlog_position;
|
|
||||||
--echo -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b-
|
|
||||||
--source include/show_binlog_events.inc
|
|
||||||
--echo -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e-
|
|
||||||
--echo
|
|
||||||
dec $ddl_cases;
|
|
||||||
}
|
|
||||||
SET AUTOCOMMIT= 1;
|
SET AUTOCOMMIT= 1;
|
||||||
|
|
||||||
--echo ###################################################################################
|
--echo ###################################################################################
|
||||||
|
15
mysql-test/include/ctype_mdev13118.inc
Normal file
15
mysql-test/include/ctype_mdev13118.inc
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
--echo #
|
||||||
|
--echo # MDEV-13118 Wrong results with LOWER and UPPER and subquery
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
SET @save_optimizer_switch=@@optimizer_switch;
|
||||||
|
SET optimizer_switch=_latin1'derived_merge=on';
|
||||||
|
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI');
|
||||||
|
--sorted_result
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub;
|
||||||
|
--sorted_result
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub;
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET optimizer_switch=@save_optimizer_switch;
|
@ -89,7 +89,7 @@ static void die(const char* fmt, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void kill_child(bool was_killed)
|
static int kill_child(bool was_killed)
|
||||||
{
|
{
|
||||||
int status= 0;
|
int status= 0;
|
||||||
|
|
||||||
@ -108,15 +108,15 @@ static void kill_child(bool was_killed)
|
|||||||
exit_code= WEXITSTATUS(status);
|
exit_code= WEXITSTATUS(status);
|
||||||
message("Child exit: %d", exit_code);
|
message("Child exit: %d", exit_code);
|
||||||
// Exit with exit status of the child
|
// Exit with exit status of the child
|
||||||
exit(exit_code);
|
return exit_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WIFSIGNALED(status))
|
if (WIFSIGNALED(status))
|
||||||
message("Child killed by signal: %d", WTERMSIG(status));
|
message("Child killed by signal: %d", WTERMSIG(status));
|
||||||
|
|
||||||
exit(exit_code);
|
return exit_code;
|
||||||
}
|
}
|
||||||
exit(5);
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -136,7 +136,7 @@ extern "C" void handle_signal(int sig)
|
|||||||
terminated= 1;
|
terminated= 1;
|
||||||
|
|
||||||
if (child_pid > 0)
|
if (child_pid > 0)
|
||||||
kill_child(sig == SIGCHLD);
|
_exit(kill_child(sig == SIGCHLD));
|
||||||
|
|
||||||
// Ignore further signals
|
// Ignore further signals
|
||||||
signal(SIGTERM, SIG_IGN);
|
signal(SIGTERM, SIG_IGN);
|
||||||
@ -292,8 +292,6 @@ int main(int argc, char* const argv[] )
|
|||||||
/* Wait for parent or child to die */
|
/* Wait for parent or child to die */
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
kill_child(0);
|
return kill_child(0);
|
||||||
|
|
||||||
return 4;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -655,50 +655,59 @@ sub run_test_server ($$$) {
|
|||||||
my $worker_savename= basename($worker_savedir);
|
my $worker_savename= basename($worker_savedir);
|
||||||
my $savedir= "$opt_vardir/log/$worker_savename";
|
my $savedir= "$opt_vardir/log/$worker_savename";
|
||||||
|
|
||||||
|
# Move any core files from e.g. mysqltest
|
||||||
|
foreach my $coref (glob("core*"), glob("*.dmp"))
|
||||||
|
{
|
||||||
|
mtr_report(" - found '$coref', moving it to '$worker_savedir'");
|
||||||
|
move($coref, $worker_savedir);
|
||||||
|
}
|
||||||
|
|
||||||
|
find(
|
||||||
|
{
|
||||||
|
no_chdir => 1,
|
||||||
|
wanted => sub
|
||||||
|
{
|
||||||
|
my $core_file= $File::Find::name;
|
||||||
|
my $core_name= basename($core_file);
|
||||||
|
|
||||||
|
# Name beginning with core, not ending in .gz
|
||||||
|
if (($core_name =~ /^core/ and $core_name !~ /\.gz$/)
|
||||||
|
or (IS_WINDOWS and $core_name =~ /\.dmp$/))
|
||||||
|
{
|
||||||
|
# Ending with .dmp
|
||||||
|
mtr_report(" - found '$core_name'",
|
||||||
|
"($num_saved_cores/$opt_max_save_core)");
|
||||||
|
|
||||||
|
My::CoreDump->show($core_file, $exe_mysqld, $opt_parallel);
|
||||||
|
|
||||||
|
# Limit number of core files saved
|
||||||
|
if ($opt_max_save_core > 0 &&
|
||||||
|
$num_saved_cores >= $opt_max_save_core)
|
||||||
|
{
|
||||||
|
mtr_report(" - deleting it, already saved",
|
||||||
|
"$opt_max_save_core");
|
||||||
|
unlink("$core_file");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mtr_compress_file($core_file) unless @opt_cases;
|
||||||
|
++$num_saved_cores;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
$worker_savedir);
|
||||||
|
|
||||||
if ($opt_max_save_datadir > 0 &&
|
if ($opt_max_save_datadir > 0 &&
|
||||||
$num_saved_datadir >= $opt_max_save_datadir)
|
$num_saved_datadir >= $opt_max_save_datadir)
|
||||||
{
|
{
|
||||||
mtr_report(" - skipping '$worker_savedir/'");
|
mtr_report(" - skipping '$worker_savedir/'");
|
||||||
rmtree($worker_savedir);
|
rmtree($worker_savedir);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
mtr_report(" - saving '$worker_savedir/' to '$savedir/'");
|
mtr_report(" - saving '$worker_savedir/' to '$savedir/'");
|
||||||
rename($worker_savedir, $savedir);
|
rename($worker_savedir, $savedir);
|
||||||
# Move any core files from e.g. mysqltest
|
|
||||||
foreach my $coref (glob("core*"), glob("*.dmp"))
|
|
||||||
{
|
|
||||||
mtr_report(" - found '$coref', moving it to '$savedir'");
|
|
||||||
move($coref, $savedir);
|
|
||||||
}
|
|
||||||
if ($opt_max_save_core > 0) {
|
|
||||||
# Limit number of core files saved
|
|
||||||
find({ no_chdir => 1,
|
|
||||||
wanted => sub {
|
|
||||||
my $core_file= $File::Find::name;
|
|
||||||
my $core_name= basename($core_file);
|
|
||||||
|
|
||||||
# Name beginning with core, not ending in .gz
|
|
||||||
if (($core_name =~ /^core/ and $core_name !~ /\.gz$/)
|
|
||||||
or (IS_WINDOWS and $core_name =~ /\.dmp$/)){
|
|
||||||
# Ending with .dmp
|
|
||||||
mtr_report(" - found '$core_name'",
|
|
||||||
"($num_saved_cores/$opt_max_save_core)");
|
|
||||||
|
|
||||||
My::CoreDump->show($core_file, $exe_mysqld, $opt_parallel);
|
|
||||||
|
|
||||||
if ($num_saved_cores >= $opt_max_save_core) {
|
|
||||||
mtr_report(" - deleting it, already saved",
|
|
||||||
"$opt_max_save_core");
|
|
||||||
unlink("$core_file");
|
|
||||||
} else {
|
|
||||||
mtr_compress_file($core_file) unless @opt_cases;
|
|
||||||
}
|
|
||||||
++$num_saved_cores;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
$savedir);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
resfile_print_test();
|
resfile_print_test();
|
||||||
$num_saved_datadir++;
|
$num_saved_datadir++;
|
||||||
@ -6125,7 +6134,7 @@ sub lldb_arguments {
|
|||||||
$input = $input ? "< $input" : "";
|
$input = $input ? "< $input" : "";
|
||||||
|
|
||||||
# write init file for mysqld or client
|
# write init file for mysqld or client
|
||||||
mtr_tofile($lldb_init_file, "set args $str $input\n");
|
mtr_tofile($lldb_init_file, "process launch --stop-at-entry -- $str $input\n");
|
||||||
|
|
||||||
print "\nTo start lldb for $type, type in another window:\n";
|
print "\nTo start lldb for $type, type in another window:\n";
|
||||||
print "cd $glob_mysql_test_dir && lldb -s $lldb_init_file $$exe\n";
|
print "cd $glob_mysql_test_dir && lldb -s $lldb_init_file $$exe\n";
|
||||||
|
@ -2164,3 +2164,87 @@ t1 CREATE TABLE `t1` (
|
|||||||
`b` int(11) DEFAULT NULL
|
`b` int(11) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-15308
|
||||||
|
# Assertion `ha_alter_info->alter_info->drop_list.elements > 0' failed
|
||||||
|
# in ha_innodb::prepare_inplace_alter_table
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB;
|
||||||
|
ALTER TABLE t1 DROP FOREIGN KEY IF EXISTS fk, DROP COLUMN b;
|
||||||
|
Warnings:
|
||||||
|
Note 1091 Can't DROP 'fk'; check that column/key exists
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` int(11) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB;
|
||||||
|
ALTER TABLE t1 DROP INDEX IF EXISTS fk, DROP COLUMN b;
|
||||||
|
Warnings:
|
||||||
|
Note 1091 Can't DROP 'fk'; check that column/key exists
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` int(11) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (a INT, b INT, c INT, KEY(c)) ENGINE=InnoDB;
|
||||||
|
ALTER TABLE t1 DROP FOREIGN KEY IF EXISTS fk, DROP COLUMN c;
|
||||||
|
Warnings:
|
||||||
|
Note 1091 Can't DROP 'fk'; check that column/key exists
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` int(11) DEFAULT NULL,
|
||||||
|
`b` int(11) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (a INT, b INT, c INT, KEY c1(c)) ENGINE=InnoDB;
|
||||||
|
ALTER TABLE t1 DROP FOREIGN KEY IF EXISTS fk, DROP INDEX c1;
|
||||||
|
Warnings:
|
||||||
|
Note 1091 Can't DROP 'fk'; check that column/key exists
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` int(11) DEFAULT NULL,
|
||||||
|
`b` int(11) DEFAULT NULL,
|
||||||
|
`c` int(11) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB;
|
||||||
|
ALTER TABLE t1 DROP INDEX IF EXISTS fk, DROP COLUMN IF EXISTS c;
|
||||||
|
Warnings:
|
||||||
|
Note 1091 Can't DROP 'fk'; check that column/key exists
|
||||||
|
Note 1091 Can't DROP 'c'; check that column/key exists
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` int(11) DEFAULT NULL,
|
||||||
|
`b` int(11) DEFAULT NULL
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# MDEV-14668 ADD PRIMARY KEY IF NOT EXISTS on composite key
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
`ID` BIGINT(20) NOT NULL,
|
||||||
|
`RANK` MEDIUMINT(4) NOT NULL,
|
||||||
|
`CHECK_POINT` BIGINT(20) NOT NULL,
|
||||||
|
UNIQUE INDEX `HORIZON_UIDX01` (`ID`, `RANK`)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS (`ID`, `CHECK_POINT`);
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`ID` bigint(20) NOT NULL,
|
||||||
|
`RANK` mediumint(4) NOT NULL,
|
||||||
|
`CHECK_POINT` bigint(20) NOT NULL,
|
||||||
|
PRIMARY KEY (`ID`,`CHECK_POINT`),
|
||||||
|
UNIQUE KEY `HORIZON_UIDX01` (`ID`,`RANK`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||||
|
ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS (`ID`, `CHECK_POINT`);
|
||||||
|
Warnings:
|
||||||
|
Note 1061 Multiple primary key defined
|
||||||
|
DROP TABLE t1;
|
||||||
|
13
mysql-test/r/assign_key_cache.result
Normal file
13
mysql-test/r/assign_key_cache.result
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
set global my_cache.key_buffer_size = 1024*1024;
|
||||||
|
create table t1 (i int) engine=myisam partition by hash (i) partitions 2;
|
||||||
|
xa start 'xid';
|
||||||
|
cache index t1 partition (non_existing_partition) in my_cache;
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.t1 assign_to_keycache error Error in list of partitions to test.t1
|
||||||
|
cache index t1 partition (p1) in my_cache;
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.t1 assign_to_keycache status OK
|
||||||
|
xa end 'xid';
|
||||||
|
xa rollback 'xid';
|
||||||
|
drop table t1;
|
||||||
|
set global my_cache.key_buffer_size = 0;
|
@ -537,3 +537,32 @@ pk
|
|||||||
-5
|
-5
|
||||||
1
|
1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
#
|
||||||
|
# Start of 5.5 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
id TINYINT NOT NULL AUTO_INCREMENT,
|
||||||
|
name CHAR(30) NOT NULL,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) ENGINE=MyISAM;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`id` tinyint(4) NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` char(30) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
INSERT INTO t1 (name) VALUES ('dog');
|
||||||
|
UPDATE t1 SET id=-1 WHERE id=1;
|
||||||
|
INSERT INTO t1 (name) VALUES ('cat');
|
||||||
|
SELECT * FROM t1;
|
||||||
|
id name
|
||||||
|
-1 dog
|
||||||
|
2 cat
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# End of 5.5 tests
|
||||||
|
#
|
||||||
|
@ -453,3 +453,23 @@ CREATE OR REPLACE TABLE t1 AS SELECT f1();
|
|||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
DROP FUNCTION f1;
|
DROP FUNCTION f1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# MDEV-11129
|
||||||
|
# CREATE OR REPLACE TABLE t1 AS SELECT spfunc() crashes if spfunc()
|
||||||
|
# references t1
|
||||||
|
#
|
||||||
|
CREATE OR REPLACE TABLE t1(a INT);
|
||||||
|
CREATE FUNCTION f1() RETURNS VARCHAR(16383)
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO t1 VALUES(1);
|
||||||
|
RETURN 'test';
|
||||||
|
END;
|
||||||
|
$$
|
||||||
|
CREATE OR REPLACE TABLE t1 AS SELECT f1();
|
||||||
|
ERROR HY000: Table 't1' is specified twice, both as a target for 'CREATE' and as a separate source for data
|
||||||
|
LOCK TABLE t1 WRITE;
|
||||||
|
CREATE OR REPLACE TABLE t1 AS SELECT f1();
|
||||||
|
ERROR HY000: Table 't1' was not locked with LOCK TABLES
|
||||||
|
UNLOCK TABLES;
|
||||||
|
DROP FUNCTION f1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -3022,6 +3022,29 @@ DROP TABLE t1;
|
|||||||
SELECT _binary 0x7E, _binary X'7E', _binary B'01111110';
|
SELECT _binary 0x7E, _binary X'7E', _binary B'01111110';
|
||||||
_binary 0x7E _binary X'7E' _binary B'01111110'
|
_binary 0x7E _binary X'7E' _binary B'01111110'
|
||||||
~ ~ ~
|
~ ~ ~
|
||||||
|
SET NAMES utf8, character_set_connection=binary;
|
||||||
|
#
|
||||||
|
# MDEV-13118 Wrong results with LOWER and UPPER and subquery
|
||||||
|
#
|
||||||
|
SET @save_optimizer_switch=@@optimizer_switch;
|
||||||
|
SET optimizer_switch=_latin1'derived_merge=on';
|
||||||
|
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`t` varbinary(10) NOT NULL DEFAULT ''
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI');
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET optimizer_switch=@save_optimizer_switch;
|
||||||
#
|
#
|
||||||
# End of 10.0 tests
|
# End of 10.0 tests
|
||||||
#
|
#
|
||||||
|
@ -33636,6 +33636,29 @@ HEX(a) CHAR_LENGTH(a)
|
|||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
SELECT _eucjpms 0x8EA0;
|
SELECT _eucjpms 0x8EA0;
|
||||||
ERROR HY000: Invalid eucjpms character string: '8EA0'
|
ERROR HY000: Invalid eucjpms character string: '8EA0'
|
||||||
|
SET NAMES eucjpms;
|
||||||
|
#
|
||||||
|
# MDEV-13118 Wrong results with LOWER and UPPER and subquery
|
||||||
|
#
|
||||||
|
SET @save_optimizer_switch=@@optimizer_switch;
|
||||||
|
SET optimizer_switch=_latin1'derived_merge=on';
|
||||||
|
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`t` varchar(10) CHARACTER SET eucjpms NOT NULL DEFAULT ''
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI');
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET optimizer_switch=@save_optimizer_switch;
|
||||||
#
|
#
|
||||||
# End of 10.0 tests
|
# End of 10.0 tests
|
||||||
#
|
#
|
||||||
|
@ -25274,3 +25274,32 @@ A1A1A1A1A1A120202020202020202020202020202020202020
|
|||||||
#
|
#
|
||||||
# End of 5.6 tests
|
# End of 5.6 tests
|
||||||
#
|
#
|
||||||
|
#
|
||||||
|
# Start of 10.0 tests
|
||||||
|
#
|
||||||
|
SET NAMES utf8, character_set_connection=euckr;
|
||||||
|
#
|
||||||
|
# MDEV-13118 Wrong results with LOWER and UPPER and subquery
|
||||||
|
#
|
||||||
|
SET @save_optimizer_switch=@@optimizer_switch;
|
||||||
|
SET optimizer_switch=_latin1'derived_merge=on';
|
||||||
|
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`t` varchar(10) CHARACTER SET euckr NOT NULL DEFAULT ''
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI');
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET optimizer_switch=@save_optimizer_switch;
|
||||||
|
#
|
||||||
|
# End of 10.0 tests
|
||||||
|
#
|
||||||
|
@ -4943,6 +4943,29 @@ E05C5B
|
|||||||
E05B
|
E05B
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
# Start of ctype_E05C.inc
|
# Start of ctype_E05C.inc
|
||||||
|
SET NAMES utf8, character_set_connection=gbk;
|
||||||
|
#
|
||||||
|
# MDEV-13118 Wrong results with LOWER and UPPER and subquery
|
||||||
|
#
|
||||||
|
SET @save_optimizer_switch=@@optimizer_switch;
|
||||||
|
SET optimizer_switch=_latin1'derived_merge=on';
|
||||||
|
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`t` varchar(10) CHARACTER SET gbk NOT NULL DEFAULT ''
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI');
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET optimizer_switch=@save_optimizer_switch;
|
||||||
#
|
#
|
||||||
# MDEV-9886 Illegal mix of collations with a view comparing a field to a binary constant
|
# MDEV-9886 Illegal mix of collations with a view comparing a field to a binary constant
|
||||||
#
|
#
|
||||||
|
@ -7939,6 +7939,29 @@ a
|
|||||||
0
|
0
|
||||||
DROP VIEW v1;
|
DROP VIEW v1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
SET NAMES latin1;
|
||||||
|
#
|
||||||
|
# MDEV-13118 Wrong results with LOWER and UPPER and subquery
|
||||||
|
#
|
||||||
|
SET @save_optimizer_switch=@@optimizer_switch;
|
||||||
|
SET optimizer_switch=_latin1'derived_merge=on';
|
||||||
|
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`t` varchar(10) NOT NULL DEFAULT ''
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI');
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET optimizer_switch=@save_optimizer_switch;
|
||||||
#
|
#
|
||||||
# End of 10.0 tests
|
# End of 10.0 tests
|
||||||
#
|
#
|
||||||
|
@ -5629,6 +5629,29 @@ c2
|
|||||||
YWJjZGVmZ2hp-YWJjZGVmZ2hp
|
YWJjZGVmZ2hp-YWJjZGVmZ2hp
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
SET optimizer_switch=@save_optimizer_switch;
|
SET optimizer_switch=@save_optimizer_switch;
|
||||||
|
SET NAMES utf8, character_set_connection=ucs2;
|
||||||
|
#
|
||||||
|
# MDEV-13118 Wrong results with LOWER and UPPER and subquery
|
||||||
|
#
|
||||||
|
SET @save_optimizer_switch=@@optimizer_switch;
|
||||||
|
SET optimizer_switch=_latin1'derived_merge=on';
|
||||||
|
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`t` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI');
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET optimizer_switch=@save_optimizer_switch;
|
||||||
#
|
#
|
||||||
# End of 10.0 tests
|
# End of 10.0 tests
|
||||||
#
|
#
|
||||||
|
@ -25942,6 +25942,29 @@ HEX(a) CHAR_LENGTH(a)
|
|||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
SELECT _ujis 0x8EA0;
|
SELECT _ujis 0x8EA0;
|
||||||
ERROR HY000: Invalid ujis character string: '8EA0'
|
ERROR HY000: Invalid ujis character string: '8EA0'
|
||||||
|
SET NAMES ujis;
|
||||||
|
#
|
||||||
|
# MDEV-13118 Wrong results with LOWER and UPPER and subquery
|
||||||
|
#
|
||||||
|
SET @save_optimizer_switch=@@optimizer_switch;
|
||||||
|
SET optimizer_switch=_latin1'derived_merge=on';
|
||||||
|
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`t` varchar(10) CHARACTER SET ujis NOT NULL DEFAULT ''
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI');
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET optimizer_switch=@save_optimizer_switch;
|
||||||
#
|
#
|
||||||
# End of 10.0 tests
|
# End of 10.0 tests
|
||||||
#
|
#
|
||||||
|
@ -2134,6 +2134,29 @@ EXECUTE stmt USING @arg00;
|
|||||||
CONCAT(_utf16'a' COLLATE utf16_unicode_ci, ?)
|
CONCAT(_utf16'a' COLLATE utf16_unicode_ci, ?)
|
||||||
aÿ
|
aÿ
|
||||||
DEALLOCATE PREPARE stmt;
|
DEALLOCATE PREPARE stmt;
|
||||||
|
SET NAMES utf8, character_set_connection=utf16;
|
||||||
|
#
|
||||||
|
# MDEV-13118 Wrong results with LOWER and UPPER and subquery
|
||||||
|
#
|
||||||
|
SET @save_optimizer_switch=@@optimizer_switch;
|
||||||
|
SET optimizer_switch=_latin1'derived_merge=on';
|
||||||
|
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`t` varchar(10) CHARACTER SET utf16 NOT NULL DEFAULT ''
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI');
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET optimizer_switch=@save_optimizer_switch;
|
||||||
#
|
#
|
||||||
# End of 10.0 tests
|
# End of 10.0 tests
|
||||||
#
|
#
|
||||||
|
@ -2319,3 +2319,32 @@ DFFFFFDFFFFF9CFFFF9DFFFF9EFFFF
|
|||||||
#
|
#
|
||||||
# End of 5.6 tests
|
# End of 5.6 tests
|
||||||
#
|
#
|
||||||
|
#
|
||||||
|
# Start of 10.0 tests
|
||||||
|
#
|
||||||
|
SET NAMES utf8, character_set_connection=utf16le;
|
||||||
|
#
|
||||||
|
# MDEV-13118 Wrong results with LOWER and UPPER and subquery
|
||||||
|
#
|
||||||
|
SET @save_optimizer_switch=@@optimizer_switch;
|
||||||
|
SET optimizer_switch=_latin1'derived_merge=on';
|
||||||
|
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`t` varchar(10) CHARACTER SET utf16le NOT NULL DEFAULT ''
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI');
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET optimizer_switch=@save_optimizer_switch;
|
||||||
|
#
|
||||||
|
# Start of 10.0 tests
|
||||||
|
#
|
||||||
|
@ -2231,6 +2231,29 @@ EXECUTE stmt USING @arg00;
|
|||||||
CONCAT(_utf32'a' COLLATE utf32_unicode_ci, ?)
|
CONCAT(_utf32'a' COLLATE utf32_unicode_ci, ?)
|
||||||
aÿ
|
aÿ
|
||||||
DEALLOCATE PREPARE stmt;
|
DEALLOCATE PREPARE stmt;
|
||||||
|
SET NAMEs utf8, character_set_connection=utf32;
|
||||||
|
#
|
||||||
|
# MDEV-13118 Wrong results with LOWER and UPPER and subquery
|
||||||
|
#
|
||||||
|
SET @save_optimizer_switch=@@optimizer_switch;
|
||||||
|
SET optimizer_switch=_latin1'derived_merge=on';
|
||||||
|
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`t` varchar(10) CHARACTER SET utf32 NOT NULL DEFAULT ''
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI');
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET optimizer_switch=@save_optimizer_switch;
|
||||||
#
|
#
|
||||||
# End of 10.0 tests
|
# End of 10.0 tests
|
||||||
#
|
#
|
||||||
|
@ -10127,6 +10127,29 @@ SELECT * FROM v1;
|
|||||||
c
|
c
|
||||||
ß
|
ß
|
||||||
DROP VIEW v1;
|
DROP VIEW v1;
|
||||||
|
SET NAMES utf8;
|
||||||
|
#
|
||||||
|
# MDEV-13118 Wrong results with LOWER and UPPER and subquery
|
||||||
|
#
|
||||||
|
SET @save_optimizer_switch=@@optimizer_switch;
|
||||||
|
SET optimizer_switch=_latin1'derived_merge=on';
|
||||||
|
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`t` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT ''
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI');
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET optimizer_switch=@save_optimizer_switch;
|
||||||
#
|
#
|
||||||
# End of 10.0 tests
|
# End of 10.0 tests
|
||||||
#
|
#
|
||||||
|
@ -3427,6 +3427,29 @@ t1 CREATE TABLE `t1` (
|
|||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
SET NAMES default;
|
SET NAMES default;
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
#
|
||||||
|
# MDEV-13118 Wrong results with LOWER and UPPER and subquery
|
||||||
|
#
|
||||||
|
SET @save_optimizer_switch=@@optimizer_switch;
|
||||||
|
SET optimizer_switch=_latin1'derived_merge=on';
|
||||||
|
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`t` varchar(10) CHARACTER SET utf8mb4 NOT NULL DEFAULT ''
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI');
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
abcdefghi-abcdefghi
|
||||||
|
SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub;
|
||||||
|
c2
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
ABCDEFGHI-ABCDEFGHI
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET optimizer_switch=@save_optimizer_switch;
|
||||||
# End of 10.0 tests
|
# End of 10.0 tests
|
||||||
#
|
#
|
||||||
# End of tests
|
# End of tests
|
||||||
|
@ -1049,6 +1049,7 @@ INSERT INTO t2 VALUES (NULL),(NULL);
|
|||||||
CREATE TABLE t3 (c VARCHAR(1024) CHARACTER SET utf8, d INT) ENGINE=MyISAM;
|
CREATE TABLE t3 (c VARCHAR(1024) CHARACTER SET utf8, d INT) ENGINE=MyISAM;
|
||||||
CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v3 AS SELECT * FROM t3;
|
CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v3 AS SELECT * FROM t3;
|
||||||
INSERT INTO t3 VALUES ('abc',NULL),('def',4);
|
INSERT INTO t3 VALUES ('abc',NULL),('def',4);
|
||||||
|
set @save_join_cache_level= @@join_cache_level;
|
||||||
SET join_cache_level= 8;
|
SET join_cache_level= 8;
|
||||||
explain
|
explain
|
||||||
SELECT * FROM v1, t2, v3 WHERE a = c AND b = d;
|
SELECT * FROM v1, t2, v3 WHERE a = c AND b = d;
|
||||||
@ -1078,4 +1079,36 @@ i
|
|||||||
drop procedure pr;
|
drop procedure pr;
|
||||||
drop view v1;
|
drop view v1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
set @@join_cache_level= @save_join_cache_level;
|
||||||
|
#
|
||||||
|
# MDEV-16307: Incorrect results when using BNLH join instead of BNL join with views
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (c1 text, c2 int);
|
||||||
|
INSERT INTO t1 VALUES ('a',1), ('c',3), ('g',7), ('d',4), ('c',3);
|
||||||
|
CREATE TABLE t2 (c1 text, c2 int);
|
||||||
|
INSERT INTO t2 VALUES ('b',2), ('c',3);
|
||||||
|
CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
|
||||||
|
explain SELECT v1.c1, v1.c2, t2.c1, t2.c2 FROM v1, t2 WHERE v1.c1=t2.c1;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY t2 ALL NULL NULL NULL NULL 2
|
||||||
|
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join)
|
||||||
|
2 DERIVED t1 ALL NULL NULL NULL NULL 5
|
||||||
|
SELECT v1.c1, v1.c2, t2.c1, t2.c2 FROM v1, t2 WHERE v1.c1=t2.c1;
|
||||||
|
c1 c2 c1 c2
|
||||||
|
c 3 c 3
|
||||||
|
c 3 c 3
|
||||||
|
set @save_join_cache_level= @@join_cache_level;
|
||||||
|
set @@join_cache_level=4;
|
||||||
|
explain SELECT v1.c1, v1.c2, t2.c1, t2.c2 FROM v1, t2 WHERE v1.c1=t2.c1;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
|
||||||
|
1 PRIMARY <derived2> hash_ALL NULL #hash#$hj 3 test.t2.c1 5 Using where; Using join buffer (flat, BNLH join)
|
||||||
|
2 DERIVED t1 ALL NULL NULL NULL NULL 5
|
||||||
|
SELECT v1.c1, v1.c2, t2.c1, t2.c2 FROM v1, t2 WHERE v1.c1=t2.c1;
|
||||||
|
c1 c2 c1 c2
|
||||||
|
c 3 c 3
|
||||||
|
c 3 c 3
|
||||||
|
drop table t1,t2;
|
||||||
|
drop view v1;
|
||||||
|
set @@join_cache_level= @save_join_cache_level;
|
||||||
# end of 5.5
|
# end of 5.5
|
||||||
|
@ -1636,11 +1636,6 @@ drop user mysqluser11@localhost;
|
|||||||
drop database mysqltest1;
|
drop database mysqltest1;
|
||||||
End of 5.0 tests
|
End of 5.0 tests
|
||||||
set names utf8;
|
set names utf8;
|
||||||
grant select on test.* to юзер_юзер@localhost;
|
|
||||||
user()
|
|
||||||
юзер_юзер@localhost
|
|
||||||
revoke all on test.* from юзер_юзер@localhost;
|
|
||||||
drop user юзер_юзер@localhost;
|
|
||||||
grant select on test.* to очень_длинный_юзер890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890@localhost;
|
grant select on test.* to очень_длинный_юзер890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890@localhost;
|
||||||
ERROR HY000: String 'очень_длинный_юзер890123456789012345678901234567890123' is too long for user name (should be no longer than 80)
|
ERROR HY000: String 'очень_длинный_юзер890123456789012345678901234567890123' is too long for user name (should be no longer than 80)
|
||||||
set names default;
|
set names default;
|
||||||
@ -1682,6 +1677,7 @@ revoke create, insert on mysqltest.t6 from mysqltest@localhost;
|
|||||||
drop user mysqltest@localhost;
|
drop user mysqltest@localhost;
|
||||||
drop database mysqltest;
|
drop database mysqltest;
|
||||||
use test;
|
use test;
|
||||||
|
call mtr.add_suppression("Can't open and lock privilege tables");
|
||||||
FLUSH PRIVILEGES without procs_priv table.
|
FLUSH PRIVILEGES without procs_priv table.
|
||||||
RENAME TABLE mysql.procs_priv TO mysql.procs_gone;
|
RENAME TABLE mysql.procs_priv TO mysql.procs_gone;
|
||||||
FLUSH PRIVILEGES;
|
FLUSH PRIVILEGES;
|
||||||
@ -1770,8 +1766,6 @@ BEGIN
|
|||||||
SET @x = 0;
|
SET @x = 0;
|
||||||
REPEAT SET @x = @x + 1; UNTIL @x > p1 END REPEAT;
|
REPEAT SET @x = @x + 1; UNTIL @x > p1 END REPEAT;
|
||||||
END ;||
|
END ;||
|
||||||
Warnings:
|
|
||||||
Warning 1404 Failed to grant EXECUTE and ALTER ROUTINE privileges
|
|
||||||
SHOW GRANTS FOR 'user1'@'localhost';
|
SHOW GRANTS FOR 'user1'@'localhost';
|
||||||
Grants for user1@localhost
|
Grants for user1@localhost
|
||||||
GRANT USAGE ON *.* TO 'user1'@'localhost'
|
GRANT USAGE ON *.* TO 'user1'@'localhost'
|
||||||
@ -1781,6 +1775,7 @@ SHOW GRANTS FOR 'user2';
|
|||||||
Grants for user2@%
|
Grants for user2@%
|
||||||
GRANT USAGE ON *.* TO 'user2'@'%'
|
GRANT USAGE ON *.* TO 'user2'@'%'
|
||||||
GRANT CREATE, CREATE ROUTINE ON `db1`.* TO 'user2'@'%'
|
GRANT CREATE, CREATE ROUTINE ON `db1`.* TO 'user2'@'%'
|
||||||
|
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `db1`.`proc2` TO 'user2'@'%'
|
||||||
DROP PROCEDURE db1.proc1;
|
DROP PROCEDURE db1.proc1;
|
||||||
DROP PROCEDURE db1.proc2;
|
DROP PROCEDURE db1.proc2;
|
||||||
REVOKE ALL ON db1.* FROM 'user1'@'localhost';
|
REVOKE ALL ON db1.* FROM 'user1'@'localhost';
|
||||||
|
@ -705,10 +705,9 @@ LOAD INDEX INTO CACHE t3;
|
|||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
mysqltest_db1.t3 preload_keys status OK
|
mysqltest_db1.t3 preload_keys status OK
|
||||||
#
|
#
|
||||||
# RENAME (doesn't work for temporary tables, thus should fail).
|
# RENAME should work for temporary tables
|
||||||
#
|
#
|
||||||
RENAME TABLE t3 TO t3_1;
|
RENAME TABLE t3 TO t3_1;
|
||||||
ERROR 42000: INSERT, CREATE command denied to user 'mysqltest_u1'@'localhost' for table 't3_1'
|
|
||||||
#
|
#
|
||||||
# HANDLER OPEN/READ/CLOSE.
|
# HANDLER OPEN/READ/CLOSE.
|
||||||
#
|
#
|
||||||
|
7
mysql-test/r/grant_not_windows.result
Normal file
7
mysql-test/r/grant_not_windows.result
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
set names utf8;
|
||||||
|
grant select on test.* to юзер_юзер@localhost;
|
||||||
|
user()
|
||||||
|
юзер_юзер@localhost
|
||||||
|
revoke all on test.* from юзер_юзер@localhost;
|
||||||
|
drop user юзер_юзер@localhost;
|
||||||
|
set names default;
|
@ -713,6 +713,23 @@ a ct
|
|||||||
set sql_mode=@save_sql_mode;
|
set sql_mode=@save_sql_mode;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
#
|
#
|
||||||
|
# mdev-16235: impossible HAVING in query without aggregation
|
||||||
|
#
|
||||||
|
explain extended
|
||||||
|
select * from mysql.help_topic where example = 'foo' having description is null;
|
||||||
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||||
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
|
||||||
|
Warnings:
|
||||||
|
Note 1003 select `mysql`.`help_topic`.`help_topic_id` AS `help_topic_id`,`mysql`.`help_topic`.`name` AS `name`,`mysql`.`help_topic`.`help_category_id` AS `help_category_id`,`mysql`.`help_topic`.`description` AS `description`,`mysql`.`help_topic`.`example` AS `example`,`mysql`.`help_topic`.`url` AS `url` from `mysql`.`help_topic` where (`mysql`.`help_topic`.`example` = 'foo') having 0
|
||||||
|
select * from mysql.help_topic where example = 'foo' having description is null;
|
||||||
|
help_topic_id name help_category_id description example url
|
||||||
|
#
|
||||||
|
# End of 5. tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Start of 10.0 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
# Bug mdev-5160: two-way join with HAVING over the second table
|
# Bug mdev-5160: two-way join with HAVING over the second table
|
||||||
#
|
#
|
||||||
CREATE TABLE t1 (c1 varchar(6)) ENGINE=MyISAM;
|
CREATE TABLE t1 (c1 varchar(6)) ENGINE=MyISAM;
|
||||||
|
@ -561,7 +561,7 @@ INSERT INTO db1.trans (a) VALUES (1);
|
|||||||
cache index t3 in keycache;
|
cache index t3 in keycache;
|
||||||
CALL db1.test_if_commit();
|
CALL db1.test_if_commit();
|
||||||
IMPLICIT COMMIT
|
IMPLICIT COMMIT
|
||||||
YES
|
NO
|
||||||
set global keycache.key_buffer_size=0;
|
set global keycache.key_buffer_size=0;
|
||||||
#
|
#
|
||||||
# SQLCOM_PRELOAD_KEYS
|
# SQLCOM_PRELOAD_KEYS
|
||||||
@ -570,7 +570,7 @@ INSERT INTO db1.trans (a) VALUES (1);
|
|||||||
load index into cache t3;
|
load index into cache t3;
|
||||||
CALL db1.test_if_commit();
|
CALL db1.test_if_commit();
|
||||||
IMPLICIT COMMIT
|
IMPLICIT COMMIT
|
||||||
YES
|
NO
|
||||||
#
|
#
|
||||||
# SQLCOM_FLUSH
|
# SQLCOM_FLUSH
|
||||||
#
|
#
|
||||||
|
@ -1405,7 +1405,7 @@ USE test;
|
|||||||
End of 5.0 tests.
|
End of 5.0 tests.
|
||||||
select * from information_schema.engines WHERE ENGINE="MyISAM";
|
select * from information_schema.engines WHERE ENGINE="MyISAM";
|
||||||
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
||||||
MyISAM DEFAULT MyISAM storage engine NO NO NO
|
MyISAM DEFAULT Non-transactional engine with good performance and small data footprint NO NO NO
|
||||||
grant select on *.* to user3148@localhost;
|
grant select on *.* to user3148@localhost;
|
||||||
select user,db from information_schema.processlist;
|
select user,db from information_schema.processlist;
|
||||||
user db
|
user db
|
||||||
|
@ -854,3 +854,12 @@ INSERT IGNORE INTO t1 SELECT t1.a FROM t1,t1 t2,t1 t3,t1 t4,t1 t5,t1 t6,t1 t7;
|
|||||||
SET GLOBAL myisam_data_pointer_size = @old_myisam_data_pointer_size;
|
SET GLOBAL myisam_data_pointer_size = @old_myisam_data_pointer_size;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
End of 5.1 tests
|
End of 5.1 tests
|
||||||
|
create table t1 (i int);
|
||||||
|
create table t2 as select values(i) as a from t1;
|
||||||
|
show create table t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`a` binary(0) DEFAULT NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
drop table t1, t2;
|
||||||
|
End of 5.5 tests
|
||||||
|
@ -1500,6 +1500,46 @@ DROP VIEW v2;
|
|||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
SET optimizer_switch=@save_optimizer_switch;
|
SET optimizer_switch=@save_optimizer_switch;
|
||||||
#
|
#
|
||||||
|
# MDEV-16512
|
||||||
|
# Server crashes in find_field_in_table_ref on 2nd execution of SP referring to
|
||||||
|
# non-existing field
|
||||||
|
#
|
||||||
|
CREATE TABLE t (i INT);
|
||||||
|
CREATE PROCEDURE p() SELECT t1.f FROM t AS t1 JOIN t AS t2 USING (f);
|
||||||
|
CALL p;
|
||||||
|
ERROR 42S22: Unknown column 'f' in 'from clause'
|
||||||
|
CALL p;
|
||||||
|
ERROR 42S22: Unknown column 'f' in 'from clause'
|
||||||
|
FLUSH TABLES;
|
||||||
|
CALL p;
|
||||||
|
ERROR 42S22: Unknown column 'f' in 'from clause'
|
||||||
|
DROP TABLE t;
|
||||||
|
CREATE TABLE t (f INT);
|
||||||
|
CALL p;
|
||||||
|
ERROR 42S22: Unknown column 'f' in 'from clause'
|
||||||
|
DROP TABLE t;
|
||||||
|
CREATE TABLE t (i INT);
|
||||||
|
CALL p;
|
||||||
|
ERROR 42S22: Unknown column 'f' in 'from clause'
|
||||||
|
DROP PROCEDURE p;
|
||||||
|
DROP TABLE t;
|
||||||
|
CREATE TABLE t1 (a INT, b INT);
|
||||||
|
CREATE TABLE t2 (a INT);
|
||||||
|
CREATE TABLE t3 (a INT, c INT);
|
||||||
|
CREATE TABLE t4 (a INT, c INT);
|
||||||
|
CREATE TABLE t5 (a INT, c INT);
|
||||||
|
CREATE PROCEDURE p1() SELECT c FROM t1 JOIN (t2 LEFT JOIN t3 USING (a) LEFT JOIN t4 USING (a)
|
||||||
|
LEFT JOIN t5 USING (a)) USING (a);
|
||||||
|
CALL p1;
|
||||||
|
ERROR 23000: Column 'c' in field list is ambiguous
|
||||||
|
CALL p1;
|
||||||
|
ERROR 23000: Column 'c' in field list is ambiguous
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
DROP TABLE t1,t2,t3,t4,t5;
|
||||||
|
#
|
||||||
|
# End of MariaDB 5.5 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
# Bug #35268: Parser can't handle STRAIGHT_JOIN with USING
|
# Bug #35268: Parser can't handle STRAIGHT_JOIN with USING
|
||||||
#
|
#
|
||||||
CREATE TABLE t1 (a int);
|
CREATE TABLE t1 (a int);
|
||||||
|
@ -5871,6 +5871,39 @@ SET join_buffer_space_limit= default;
|
|||||||
set optimizer_switch=@save_optimizer_switch;
|
set optimizer_switch=@save_optimizer_switch;
|
||||||
DROP TABLE t1,t4,t5,t2;
|
DROP TABLE t1,t4,t5,t2;
|
||||||
#
|
#
|
||||||
|
# MDEV-16603: BNLH for query with materialized semi-join
|
||||||
|
#
|
||||||
|
set join_cache_level=4;
|
||||||
|
CREATE TABLE t1 ( i1 int, v1 varchar(1)) ENGINE=InnoDB;
|
||||||
|
INSERT INTO t1 VALUES (7,'x');
|
||||||
|
CREATE TABLE t2 (i1 int, v1 varchar(1), KEY v1 (v1,i1)) ENGINE=InnoDB;
|
||||||
|
INSERT INTO t2 VALUES
|
||||||
|
(NULL,'x'),(1,'x'),(3,'x'),(5,'x'),(8,'x'),(48,'x'),
|
||||||
|
(228,'x'),(3,'y'),(1,'z'),(9,'z');
|
||||||
|
CREATE TABLE temp
|
||||||
|
SELECT t1.i1 AS f1, t1.v1 AS f2 FROM (t2 JOIN t1 ON (t1.v1 = t2.v1));
|
||||||
|
SELECT * FROM temp
|
||||||
|
WHERE (f1,f2) IN (SELECT t1.i1, t1.v1 FROM (t2 JOIN t1 ON (t1.v1 = t2.v1)));
|
||||||
|
f1 f2
|
||||||
|
7 x
|
||||||
|
7 x
|
||||||
|
7 x
|
||||||
|
7 x
|
||||||
|
7 x
|
||||||
|
7 x
|
||||||
|
7 x
|
||||||
|
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 <subquery2> ALL distinct_key NULL NULL NULL 1 100.00
|
||||||
|
1 PRIMARY temp hash_ALL NULL #hash#$hj 9 test.t1.i1,test.t1.v1 7 100.00 Using where; Using join buffer (flat, BNLH join)
|
||||||
|
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 10.00 Using join buffer (flat, 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`.`temp`.`f1` = `test`.`t1`.`i1`) and (`test`.`t2`.`v1` = `test`.`t1`.`v1`) and (`test`.`temp`.`f2` = `test`.`t1`.`v1`))
|
||||||
|
DROP TABLE t1,t2,temp;
|
||||||
|
SET join_cache_level = default;
|
||||||
|
#
|
||||||
# MDEV-5123 Remove duplicated conditions pushed both to join_tab->select_cond and join_tab->cache_select->cond for blocked joins.
|
# MDEV-5123 Remove duplicated conditions pushed both to join_tab->select_cond and join_tab->cache_select->cond for blocked joins.
|
||||||
#
|
#
|
||||||
set join_cache_level=default;
|
set join_cache_level=default;
|
||||||
|
@ -2371,5 +2371,55 @@ id sid id
|
|||||||
1 NULL NULL
|
1 NULL NULL
|
||||||
2 NULL NULL
|
2 NULL NULL
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
|
#
|
||||||
|
# MDEV-16726: SELECT with STRAGHT JOIN containing NESTED RIGHT JOIN
|
||||||
|
# converted to INNER JOIN with first constant inner table
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
pk int PRIMARY KEY, i1 int, v1 varchar(1), v2 varchar(1), KEY v1 (v1,i1)
|
||||||
|
) engine=MyISAM;
|
||||||
|
INSERT INTO t1 VALUES
|
||||||
|
(8,3,'c','c'),(9,4,'z','z'),(10,3,'i','i'),(11,186,'x','x'),
|
||||||
|
(14,226,'m','m'),(15,133,'p','p');
|
||||||
|
CREATE TABLE t2 (
|
||||||
|
pk int PRIMARY KEY, i1 int, v1 varchar(1), v2 varchar(1)
|
||||||
|
) engine=MyISAM;
|
||||||
|
INSERT INTO t2 VALUES (10,6,'p','p');
|
||||||
|
EXPLAIN EXTENDED
|
||||||
|
SELECT STRAIGHT_JOIN t2.v2
|
||||||
|
FROM
|
||||||
|
(t1 as tb1 LEFT JOIN t1 AS tb2 ON tb2.v1 = tb1.v2)
|
||||||
|
RIGHT JOIN
|
||||||
|
(t2,t1)
|
||||||
|
ON t1.pk = t2.pk AND t2.v2 = tb1.v1
|
||||||
|
WHERE tb1.pk = 40
|
||||||
|
ORDER BY tb1.i1;
|
||||||
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||||
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||||
|
Warnings:
|
||||||
|
Note 1003 select straight_join 'p' AS `v2` from `test`.`t1` join `test`.`t1` `tb1` left join `test`.`t1` `tb2` on(multiple equal(`test`.`tb2`.`v1`, NULL)) where 0 order by NULL
|
||||||
|
EXPLAIN EXTENDED
|
||||||
|
SELECT STRAIGHT_JOIN t2.v2
|
||||||
|
FROM
|
||||||
|
(t2,t1)
|
||||||
|
LEFT JOIN
|
||||||
|
(t1 as tb1 LEFT JOIN t1 AS tb2 ON tb2.v1 = tb1.v2)
|
||||||
|
ON t1.pk = t2.pk AND t2.v2 = tb1.v1
|
||||||
|
WHERE tb1.pk = 40
|
||||||
|
ORDER BY tb1.i1;
|
||||||
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||||
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||||
|
Warnings:
|
||||||
|
Note 1003 select straight_join 'p' AS `v2` from `test`.`t1` join `test`.`t1` `tb1` left join `test`.`t1` `tb2` on(multiple equal(`test`.`tb2`.`v1`, NULL)) where 0 order by NULL
|
||||||
|
SELECT STRAIGHT_JOIN DISTINCT t2.v2
|
||||||
|
FROM
|
||||||
|
(t1 as tb1 LEFT JOIN t1 AS tb2 ON tb2.v1 = tb1.v2)
|
||||||
|
RIGHT JOIN
|
||||||
|
(t2,t1)
|
||||||
|
ON t1.pk = t2.pk AND t2.v2 = tb1.v1
|
||||||
|
WHERE tb1.pk = 40
|
||||||
|
ORDER BY tb1.i1;
|
||||||
|
v2
|
||||||
|
DROP TABLE t1,t2;
|
||||||
# end of 5.5 tests
|
# end of 5.5 tests
|
||||||
SET optimizer_switch=@save_optimizer_switch;
|
SET optimizer_switch=@save_optimizer_switch;
|
||||||
|
@ -2382,6 +2382,56 @@ id sid id
|
|||||||
1 NULL NULL
|
1 NULL NULL
|
||||||
2 NULL NULL
|
2 NULL NULL
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
|
#
|
||||||
|
# MDEV-16726: SELECT with STRAGHT JOIN containing NESTED RIGHT JOIN
|
||||||
|
# converted to INNER JOIN with first constant inner table
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
pk int PRIMARY KEY, i1 int, v1 varchar(1), v2 varchar(1), KEY v1 (v1,i1)
|
||||||
|
) engine=MyISAM;
|
||||||
|
INSERT INTO t1 VALUES
|
||||||
|
(8,3,'c','c'),(9,4,'z','z'),(10,3,'i','i'),(11,186,'x','x'),
|
||||||
|
(14,226,'m','m'),(15,133,'p','p');
|
||||||
|
CREATE TABLE t2 (
|
||||||
|
pk int PRIMARY KEY, i1 int, v1 varchar(1), v2 varchar(1)
|
||||||
|
) engine=MyISAM;
|
||||||
|
INSERT INTO t2 VALUES (10,6,'p','p');
|
||||||
|
EXPLAIN EXTENDED
|
||||||
|
SELECT STRAIGHT_JOIN t2.v2
|
||||||
|
FROM
|
||||||
|
(t1 as tb1 LEFT JOIN t1 AS tb2 ON tb2.v1 = tb1.v2)
|
||||||
|
RIGHT JOIN
|
||||||
|
(t2,t1)
|
||||||
|
ON t1.pk = t2.pk AND t2.v2 = tb1.v1
|
||||||
|
WHERE tb1.pk = 40
|
||||||
|
ORDER BY tb1.i1;
|
||||||
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||||
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||||
|
Warnings:
|
||||||
|
Note 1003 select straight_join 'p' AS `v2` from `test`.`t1` join `test`.`t1` `tb1` left join `test`.`t1` `tb2` on(multiple equal(`test`.`tb2`.`v1`, NULL)) where 0 order by NULL
|
||||||
|
EXPLAIN EXTENDED
|
||||||
|
SELECT STRAIGHT_JOIN t2.v2
|
||||||
|
FROM
|
||||||
|
(t2,t1)
|
||||||
|
LEFT JOIN
|
||||||
|
(t1 as tb1 LEFT JOIN t1 AS tb2 ON tb2.v1 = tb1.v2)
|
||||||
|
ON t1.pk = t2.pk AND t2.v2 = tb1.v1
|
||||||
|
WHERE tb1.pk = 40
|
||||||
|
ORDER BY tb1.i1;
|
||||||
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||||
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||||
|
Warnings:
|
||||||
|
Note 1003 select straight_join 'p' AS `v2` from `test`.`t1` join `test`.`t1` `tb1` left join `test`.`t1` `tb2` on(multiple equal(`test`.`tb2`.`v1`, NULL)) where 0 order by NULL
|
||||||
|
SELECT STRAIGHT_JOIN DISTINCT t2.v2
|
||||||
|
FROM
|
||||||
|
(t1 as tb1 LEFT JOIN t1 AS tb2 ON tb2.v1 = tb1.v2)
|
||||||
|
RIGHT JOIN
|
||||||
|
(t2,t1)
|
||||||
|
ON t1.pk = t2.pk AND t2.v2 = tb1.v1
|
||||||
|
WHERE tb1.pk = 40
|
||||||
|
ORDER BY tb1.i1;
|
||||||
|
v2
|
||||||
|
DROP TABLE t1,t2;
|
||||||
# end of 5.5 tests
|
# end of 5.5 tests
|
||||||
SET optimizer_switch=@save_optimizer_switch;
|
SET optimizer_switch=@save_optimizer_switch;
|
||||||
set join_cache_level=default;
|
set join_cache_level=default;
|
||||||
|
@ -146,3 +146,19 @@ a
|
|||||||
16
|
16
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
End of 5.1 tests
|
End of 5.1 tests
|
||||||
|
#
|
||||||
|
# mdev-16235: SELECT over a table with LIMIT 0
|
||||||
|
#
|
||||||
|
EXPLAIN
|
||||||
|
SELECT * FROM mysql.slow_log WHERE sql_text != 'foo' LIMIT 0;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Zero limit
|
||||||
|
SELECT * FROM mysql.slow_log WHERE sql_text != 'foo' LIMIT 0;
|
||||||
|
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id
|
||||||
|
EXPLAIN
|
||||||
|
SELECT * FROM mysql.help_topic WHERE help_category_id != example LIMIT 0;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Zero limit
|
||||||
|
SELECT * FROM mysql.help_topic WHERE help_category_id != example LIMIT 0;
|
||||||
|
help_topic_id name help_category_id description example url
|
||||||
|
End of 5.5 tests
|
||||||
|
@ -407,7 +407,7 @@ LOCK TABLE t1 WRITE;
|
|||||||
HANDLER t1 OPEN;
|
HANDLER t1 OPEN;
|
||||||
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
|
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
|
||||||
HANDLER t1 READ FIRST;
|
HANDLER t1 READ FIRST;
|
||||||
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
|
Got one of the listed errors
|
||||||
HANDLER t1 CLOSE;
|
HANDLER t1 CLOSE;
|
||||||
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
|
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
@ -2545,6 +2545,14 @@ OPTIMIZE TABLE t1;
|
|||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t1 optimize status OK
|
test.t1 optimize status OK
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b)) engine=myisam;
|
||||||
|
INSERT INTO t1 VALUES(1,'0'),(2,'0'),(3,'0'),(4,'0'),(5,'0'),
|
||||||
|
(6,'0'),(7,'0');
|
||||||
|
flush tables test.t1 for export;
|
||||||
|
insert into t1 values (8,'0');
|
||||||
|
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
|
||||||
|
unlock tables;
|
||||||
|
drop table t1;
|
||||||
show variables like 'myisam_block_size';
|
show variables like 'myisam_block_size';
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
myisam_block_size 1024
|
myisam_block_size 1024
|
||||||
|
@ -5404,3 +5404,18 @@ DELIMITER ;
|
|||||||
ALTER DATABASE `a\"'``b` CHARACTER SET utf8 COLLATE utf8_general_ci ;
|
ALTER DATABASE `a\"'``b` CHARACTER SET utf8 COLLATE utf8_general_ci ;
|
||||||
DROP DATABASE `a\"'``b`;
|
DROP DATABASE `a\"'``b`;
|
||||||
FOUND /Database: mysql/ in bug11505.sql
|
FOUND /Database: mysql/ in bug11505.sql
|
||||||
|
#
|
||||||
|
# MDEV-15021: Fix the order in which routines are called
|
||||||
|
#
|
||||||
|
use test;
|
||||||
|
CREATE FUNCTION f() RETURNS INT RETURN 1;
|
||||||
|
CREATE VIEW v1 AS SELECT f();
|
||||||
|
# Running mysqldump -uroot test --routines --tables v1 > **vardir**/test.dmp
|
||||||
|
DROP VIEW v1;
|
||||||
|
DROP FUNCTION f;
|
||||||
|
# Running mysql -uroot test < **vardir**/test.dmp
|
||||||
|
#
|
||||||
|
# Cleanup after succesful import.
|
||||||
|
#
|
||||||
|
DROP VIEW v1;
|
||||||
|
DROP FUNCTION f;
|
||||||
|
@ -255,3 +255,6 @@ Benchmark
|
|||||||
# MDEV-4684 - Enhancement request: --init-command support for mysqlslap
|
# MDEV-4684 - Enhancement request: --init-command support for mysqlslap
|
||||||
#
|
#
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# Bug MDEV-15789 (Upstream: #80329): MYSQLSLAP OPTIONS --AUTO-GENERATE-SQL-GUID-PRIMARY and --AUTO-GENERATE-SQL-SECONDARY-INDEXES DONT WORK
|
||||||
|
#
|
||||||
|
@ -67,3 +67,73 @@ ERROR HY000: 'test.v1' is not BASE TABLE
|
|||||||
drop view v1;
|
drop view v1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
End of 5.0 tests
|
End of 5.0 tests
|
||||||
|
CREATE OR REPLACE TABLE t1 (a INT);
|
||||||
|
CREATE OR REPLACE TABLE t2 (a INT);
|
||||||
|
CREATE OR REPLACE TEMPORARY TABLE t1_tmp (b INT);
|
||||||
|
CREATE OR REPLACE TEMPORARY TABLE t2_tmp (b INT);
|
||||||
|
rename table t1 to t2;
|
||||||
|
ERROR 42S01: Table 't2' already exists
|
||||||
|
rename table t1 to tmp, tmp to t2;
|
||||||
|
ERROR 42S01: Table 't2' already exists
|
||||||
|
rename table t1_tmp to t2_tmp;
|
||||||
|
ERROR 42S01: Table 't2_tmp' already exists
|
||||||
|
rename table t1_tmp to tmp, tmp to t2_tmp;
|
||||||
|
ERROR 42S01: Table 't2_tmp' already exists
|
||||||
|
show create table t1_tmp;
|
||||||
|
Table Create Table
|
||||||
|
t1_tmp CREATE TEMPORARY TABLE `t1_tmp` (
|
||||||
|
`b` int(11) DEFAULT NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
show create table t2_tmp;
|
||||||
|
Table Create Table
|
||||||
|
t2_tmp CREATE TEMPORARY TABLE `t2_tmp` (
|
||||||
|
`b` int(11) DEFAULT NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
rename table t1 to t1_tmp;
|
||||||
|
rename table t2_tmp to t2;
|
||||||
|
rename table t2 to tmp, tmp to t2;
|
||||||
|
rename table t1_tmp to tmp, tmp to t1_tmp;
|
||||||
|
show tables;
|
||||||
|
Tables_in_test
|
||||||
|
t1_tmp
|
||||||
|
t2
|
||||||
|
SHOW CREATE TABLE t1_tmp;
|
||||||
|
Table Create Table
|
||||||
|
t1_tmp CREATE TEMPORARY TABLE `t1_tmp` (
|
||||||
|
`b` int(11) DEFAULT NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
drop table t1_tmp;
|
||||||
|
SHOW CREATE TABLE t1_tmp;
|
||||||
|
Table Create Table
|
||||||
|
t1_tmp CREATE TABLE `t1_tmp` (
|
||||||
|
`a` int(11) DEFAULT NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
drop table t1_tmp;
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TEMPORARY TABLE `t2` (
|
||||||
|
`b` int(11) DEFAULT NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
drop table t2;
|
||||||
|
SHOW CREATE TABLE t2;
|
||||||
|
Table Create Table
|
||||||
|
t2 CREATE TABLE `t2` (
|
||||||
|
`a` int(11) DEFAULT NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
drop table t2;
|
||||||
|
CREATE TABLE t1 (a INT);
|
||||||
|
insert into t1 values (1);
|
||||||
|
CREATE TEMPORARY TABLE t1 (b INT);
|
||||||
|
insert into t1 values (2);
|
||||||
|
RENAME TABLE t1 TO tmp, t1 TO t2;
|
||||||
|
select * from tmp;
|
||||||
|
b
|
||||||
|
2
|
||||||
|
select * from t2;
|
||||||
|
a
|
||||||
|
1
|
||||||
|
drop table tmp,t2;
|
||||||
|
create table t1 (a int) engine=memory;
|
||||||
|
rename table t1 to non_existent.t2;
|
||||||
|
ERROR 42000: Unknown database 'non_existent'
|
||||||
|
drop table t1;
|
||||||
|
@ -356,13 +356,13 @@ and o_orderkey = l_orderkey
|
|||||||
group by c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice
|
group by c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice
|
||||||
order by o_totalprice desc, o_orderdate;
|
order by o_totalprice desc, o_orderdate;
|
||||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||||
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 6005 0.00 Using temporary; Using filesort
|
1 PRIMARY orders ALL PRIMARY,i_o_custkey NULL NULL NULL 1500 100.00 Using where; Using temporary; Using filesort
|
||||||
1 PRIMARY orders eq_ref PRIMARY,i_o_custkey PRIMARY 4 <subquery2>.l_orderkey 1 100.00 Using where
|
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 dbt3_s001.orders.o_orderkey 1 100.00
|
||||||
1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 100.00
|
1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 100.00
|
||||||
1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 <subquery2>.l_orderkey 4 100.00
|
1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey_quantity 4 dbt3_s001.orders.o_orderkey 4 100.00 Using index
|
||||||
2 MATERIALIZED lineitem index NULL i_l_orderkey_quantity 13 NULL 6005 100.00 Using index
|
2 MATERIALIZED lineitem index NULL i_l_orderkey_quantity 13 NULL 6005 100.00 Using index
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from <materialize> (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having (sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250)) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey`) and (`dbt3_s001`.`orders`.`o_orderkey` = `<subquery2>`.`l_orderkey`) and (`dbt3_s001`.`lineitem`.`l_orderkey` = `<subquery2>`.`l_orderkey`)) group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE`
|
Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from <materialize> (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having (sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250)) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey`) and (`<subquery2>`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey`) and (`dbt3_s001`.`lineitem`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey`)) group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE`
|
||||||
select
|
select
|
||||||
c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity)
|
c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity)
|
||||||
from customer, orders, lineitem
|
from customer, orders, lineitem
|
||||||
@ -1535,6 +1535,68 @@ t
|
|||||||
10:00:00
|
10:00:00
|
||||||
11:00:00
|
11:00:00
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# MDEV-16374: filtered shows 0 for materilization scan for a semi join, which makes optimizer
|
||||||
|
# always pick materialization scan over materialization lookup
|
||||||
|
#
|
||||||
|
create table t0(a int);
|
||||||
|
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||||
|
create table t1 (a int, b int);
|
||||||
|
insert into t1 values (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),
|
||||||
|
(11,11),(12,12),(13,13),(14,14),(15,15);
|
||||||
|
set @@optimizer_use_condition_selectivity=2;
|
||||||
|
explain extended select * from t1 where a in (select max(a) from t1 group by b);
|
||||||
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||||
|
1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where
|
||||||
|
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
|
||||||
|
2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary
|
||||||
|
Warnings:
|
||||||
|
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where (`<subquery2>`.`max(a)` = `test`.`t1`.`a`)
|
||||||
|
select * from t1 where a in (select max(a) from t1 group by b);
|
||||||
|
a b
|
||||||
|
0 0
|
||||||
|
1 1
|
||||||
|
2 2
|
||||||
|
3 3
|
||||||
|
4 4
|
||||||
|
5 5
|
||||||
|
6 6
|
||||||
|
7 7
|
||||||
|
8 8
|
||||||
|
9 9
|
||||||
|
10 10
|
||||||
|
11 11
|
||||||
|
12 12
|
||||||
|
13 13
|
||||||
|
14 14
|
||||||
|
15 15
|
||||||
|
set @@optimizer_use_condition_selectivity=1;
|
||||||
|
explain extended select * from t1 where a in (select max(a) from t1 group by b);
|
||||||
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||||
|
1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where
|
||||||
|
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
|
||||||
|
2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary
|
||||||
|
Warnings:
|
||||||
|
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where (`<subquery2>`.`max(a)` = `test`.`t1`.`a`)
|
||||||
|
select * from t1 where a in (select max(a) from t1 group by b);
|
||||||
|
a b
|
||||||
|
0 0
|
||||||
|
1 1
|
||||||
|
2 2
|
||||||
|
3 3
|
||||||
|
4 4
|
||||||
|
5 5
|
||||||
|
6 6
|
||||||
|
7 7
|
||||||
|
8 8
|
||||||
|
9 9
|
||||||
|
10 10
|
||||||
|
11 11
|
||||||
|
12 12
|
||||||
|
13 13
|
||||||
|
14 14
|
||||||
|
15 15
|
||||||
|
drop table t1,t0;
|
||||||
set histogram_size=@save_histogram_size;
|
set histogram_size=@save_histogram_size;
|
||||||
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
||||||
set use_stat_tables=@save_use_stat_tables;
|
set use_stat_tables=@save_use_stat_tables;
|
||||||
|
@ -359,13 +359,13 @@ and o_orderkey = l_orderkey
|
|||||||
group by c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice
|
group by c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice
|
||||||
order by o_totalprice desc, o_orderdate;
|
order by o_totalprice desc, o_orderdate;
|
||||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||||
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 6005 0.00 Using temporary; Using filesort
|
1 PRIMARY orders ALL PRIMARY,i_o_custkey NULL NULL NULL 1500 100.00 Using where; Using temporary; Using filesort
|
||||||
1 PRIMARY orders eq_ref PRIMARY,i_o_custkey PRIMARY 4 <subquery2>.l_orderkey 1 100.00 Using where
|
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 dbt3_s001.orders.o_orderkey 1 100.00
|
||||||
1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 100.00
|
1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 100.00
|
||||||
1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 <subquery2>.l_orderkey 4 100.00
|
1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey_quantity 4 dbt3_s001.orders.o_orderkey 4 100.00 Using index
|
||||||
2 MATERIALIZED lineitem index NULL PRIMARY 8 NULL 6005 100.00
|
2 MATERIALIZED lineitem index NULL PRIMARY 8 NULL 6005 100.00
|
||||||
Warnings:
|
Warnings:
|
||||||
Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from <materialize> (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having (sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250)) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey`) and (`dbt3_s001`.`orders`.`o_orderkey` = `<subquery2>`.`l_orderkey`) and (`dbt3_s001`.`lineitem`.`l_orderkey` = `<subquery2>`.`l_orderkey`)) group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE`
|
Note 1003 select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from <materialize> (select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having (sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250)) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where ((`dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey`) and (`<subquery2>`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey`) and (`dbt3_s001`.`lineitem`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey`)) group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE`
|
||||||
select
|
select
|
||||||
c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity)
|
c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity)
|
||||||
from customer, orders, lineitem
|
from customer, orders, lineitem
|
||||||
@ -1539,6 +1539,68 @@ t
|
|||||||
10:00:00
|
10:00:00
|
||||||
11:00:00
|
11:00:00
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# MDEV-16374: filtered shows 0 for materilization scan for a semi join, which makes optimizer
|
||||||
|
# always pick materialization scan over materialization lookup
|
||||||
|
#
|
||||||
|
create table t0(a int);
|
||||||
|
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||||
|
create table t1 (a int, b int);
|
||||||
|
insert into t1 values (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),
|
||||||
|
(11,11),(12,12),(13,13),(14,14),(15,15);
|
||||||
|
set @@optimizer_use_condition_selectivity=2;
|
||||||
|
explain extended select * from t1 where a in (select max(a) from t1 group by b);
|
||||||
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||||
|
1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where
|
||||||
|
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
|
||||||
|
2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary
|
||||||
|
Warnings:
|
||||||
|
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where (`<subquery2>`.`max(a)` = `test`.`t1`.`a`)
|
||||||
|
select * from t1 where a in (select max(a) from t1 group by b);
|
||||||
|
a b
|
||||||
|
0 0
|
||||||
|
1 1
|
||||||
|
2 2
|
||||||
|
3 3
|
||||||
|
4 4
|
||||||
|
5 5
|
||||||
|
6 6
|
||||||
|
7 7
|
||||||
|
8 8
|
||||||
|
9 9
|
||||||
|
10 10
|
||||||
|
11 11
|
||||||
|
12 12
|
||||||
|
13 13
|
||||||
|
14 14
|
||||||
|
15 15
|
||||||
|
set @@optimizer_use_condition_selectivity=1;
|
||||||
|
explain extended select * from t1 where a in (select max(a) from t1 group by b);
|
||||||
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||||
|
1 PRIMARY t1 ALL NULL NULL NULL NULL 16 100.00 Using where
|
||||||
|
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
|
||||||
|
2 MATERIALIZED t1 ALL NULL NULL NULL NULL 16 100.00 Using temporary
|
||||||
|
Warnings:
|
||||||
|
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (select max(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`b`) join `test`.`t1` where (`<subquery2>`.`max(a)` = `test`.`t1`.`a`)
|
||||||
|
select * from t1 where a in (select max(a) from t1 group by b);
|
||||||
|
a b
|
||||||
|
0 0
|
||||||
|
1 1
|
||||||
|
2 2
|
||||||
|
3 3
|
||||||
|
4 4
|
||||||
|
5 5
|
||||||
|
6 6
|
||||||
|
7 7
|
||||||
|
8 8
|
||||||
|
9 9
|
||||||
|
10 10
|
||||||
|
11 11
|
||||||
|
12 12
|
||||||
|
13 13
|
||||||
|
14 14
|
||||||
|
15 15
|
||||||
|
drop table t1,t0;
|
||||||
set histogram_size=@save_histogram_size;
|
set histogram_size=@save_histogram_size;
|
||||||
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
||||||
set use_stat_tables=@save_use_stat_tables;
|
set use_stat_tables=@save_use_stat_tables;
|
||||||
|
@ -516,4 +516,64 @@ use test;
|
|||||||
drop database db1;
|
drop database db1;
|
||||||
drop database db2;
|
drop database db2;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
#
|
||||||
|
# MDEV-16552: [10.0] ASAN global-buffer-overflow in is_stat_table / statistics_for_tables_is_needed
|
||||||
|
#
|
||||||
|
SET use_stat_tables = PREFERABLY;
|
||||||
|
SELECT CONVERT_TZ( '1991-09-20 10:11:02', '+00:00', 'GMT' );
|
||||||
|
CONVERT_TZ( '1991-09-20 10:11:02', '+00:00', 'GMT' )
|
||||||
|
NULL
|
||||||
|
set use_stat_tables=@save_use_stat_tables;
|
||||||
|
#
|
||||||
|
# MDEV-16757: manual addition of min/max statistics for BLOB
|
||||||
|
#
|
||||||
|
SET use_stat_tables= PREFERABLY;
|
||||||
|
CREATE TABLE t1 (pk INT PRIMARY KEY, t TEXT);
|
||||||
|
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
|
||||||
|
ANALYZE TABLE t1;
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.t1 analyze status Engine-independent statistics collected
|
||||||
|
test.t1 analyze status OK
|
||||||
|
SELECT * FROM mysql.column_stats;
|
||||||
|
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
|
||||||
|
test t1 pk 1 2 0.0000 4.0000 1.0000 0 NULL NULL
|
||||||
|
test t1 t NULL NULL 0.0000 3.0000 NULL NULL NULL NULL
|
||||||
|
DELETE FROM mysql.column_stats
|
||||||
|
WHERE db_name='test' AND table_name='t1' AND column_name='t';
|
||||||
|
INSERT INTO mysql.column_stats VALUES
|
||||||
|
('test','t1','t','bar','foo', 0.0, 3.0, 1.0, 0, NULL, NULL);
|
||||||
|
SELECT * FROM mysql.column_stats;
|
||||||
|
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
|
||||||
|
test t1 pk 1 2 0.0000 4.0000 1.0000 0 NULL NULL
|
||||||
|
test t1 t bar foo 0.0000 3.0000 1.0000 0 NULL NULL
|
||||||
|
SELECT pk FROM t1;
|
||||||
|
pk
|
||||||
|
1
|
||||||
|
2
|
||||||
|
DROP TABLE t1;
|
||||||
|
set use_stat_tables=@save_use_stat_tables;
|
||||||
|
#
|
||||||
|
# MDEV-16760: CREATE OR REPLACE TABLE after ANALYZE TABLE
|
||||||
|
#
|
||||||
|
SET use_stat_tables= PREFERABLY;
|
||||||
|
CREATE TABLE t1 (pk int PRIMARY KEY, c varchar(32));
|
||||||
|
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
|
||||||
|
ANALYZE TABLE t1;
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.t1 analyze status Engine-independent statistics collected
|
||||||
|
test.t1 analyze status OK
|
||||||
|
SELECT * FROM t1;
|
||||||
|
pk c
|
||||||
|
1 foo
|
||||||
|
2 bar
|
||||||
|
SELECT * FROM mysql.column_stats;
|
||||||
|
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
|
||||||
|
test t1 pk 1 2 0.0000 4.0000 1.0000 0 NULL NULL
|
||||||
|
test t1 c bar foo 0.0000 3.0000 1.0000 0 NULL NULL
|
||||||
|
CREATE OR REPLACE TABLE t1 (pk int PRIMARY KEY, a char(7));
|
||||||
|
SELECT * FROM t1;
|
||||||
|
pk a
|
||||||
|
SELECT * FROM mysql.column_stats;
|
||||||
|
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
|
||||||
|
DROP TABLE t1;
|
||||||
set use_stat_tables=@save_use_stat_tables;
|
set use_stat_tables=@save_use_stat_tables;
|
||||||
|
@ -543,6 +543,66 @@ use test;
|
|||||||
drop database db1;
|
drop database db1;
|
||||||
drop database db2;
|
drop database db2;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
#
|
||||||
|
# MDEV-16552: [10.0] ASAN global-buffer-overflow in is_stat_table / statistics_for_tables_is_needed
|
||||||
|
#
|
||||||
|
SET use_stat_tables = PREFERABLY;
|
||||||
|
SELECT CONVERT_TZ( '1991-09-20 10:11:02', '+00:00', 'GMT' );
|
||||||
|
CONVERT_TZ( '1991-09-20 10:11:02', '+00:00', 'GMT' )
|
||||||
|
NULL
|
||||||
|
set use_stat_tables=@save_use_stat_tables;
|
||||||
|
#
|
||||||
|
# MDEV-16757: manual addition of min/max statistics for BLOB
|
||||||
|
#
|
||||||
|
SET use_stat_tables= PREFERABLY;
|
||||||
|
CREATE TABLE t1 (pk INT PRIMARY KEY, t TEXT);
|
||||||
|
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
|
||||||
|
ANALYZE TABLE t1;
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.t1 analyze status Engine-independent statistics collected
|
||||||
|
test.t1 analyze status OK
|
||||||
|
SELECT * FROM mysql.column_stats;
|
||||||
|
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
|
||||||
|
test t1 pk 1 2 0.0000 4.0000 1.0000 0 NULL NULL
|
||||||
|
test t1 t NULL NULL 0.0000 3.0000 NULL NULL NULL NULL
|
||||||
|
DELETE FROM mysql.column_stats
|
||||||
|
WHERE db_name='test' AND table_name='t1' AND column_name='t';
|
||||||
|
INSERT INTO mysql.column_stats VALUES
|
||||||
|
('test','t1','t','bar','foo', 0.0, 3.0, 1.0, 0, NULL, NULL);
|
||||||
|
SELECT * FROM mysql.column_stats;
|
||||||
|
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
|
||||||
|
test t1 pk 1 2 0.0000 4.0000 1.0000 0 NULL NULL
|
||||||
|
test t1 t bar foo 0.0000 3.0000 1.0000 0 NULL NULL
|
||||||
|
SELECT pk FROM t1;
|
||||||
|
pk
|
||||||
|
1
|
||||||
|
2
|
||||||
|
DROP TABLE t1;
|
||||||
|
set use_stat_tables=@save_use_stat_tables;
|
||||||
|
#
|
||||||
|
# MDEV-16760: CREATE OR REPLACE TABLE after ANALYZE TABLE
|
||||||
|
#
|
||||||
|
SET use_stat_tables= PREFERABLY;
|
||||||
|
CREATE TABLE t1 (pk int PRIMARY KEY, c varchar(32));
|
||||||
|
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
|
||||||
|
ANALYZE TABLE t1;
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.t1 analyze status Engine-independent statistics collected
|
||||||
|
test.t1 analyze status OK
|
||||||
|
SELECT * FROM t1;
|
||||||
|
pk c
|
||||||
|
1 foo
|
||||||
|
2 bar
|
||||||
|
SELECT * FROM mysql.column_stats;
|
||||||
|
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
|
||||||
|
test t1 pk 1 2 0.0000 4.0000 1.0000 0 NULL NULL
|
||||||
|
test t1 c bar foo 0.0000 3.0000 1.0000 0 NULL NULL
|
||||||
|
CREATE OR REPLACE TABLE t1 (pk int PRIMARY KEY, a char(7));
|
||||||
|
SELECT * FROM t1;
|
||||||
|
pk a
|
||||||
|
SELECT * FROM mysql.column_stats;
|
||||||
|
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
|
||||||
|
DROP TABLE t1;
|
||||||
set use_stat_tables=@save_use_stat_tables;
|
set use_stat_tables=@save_use_stat_tables;
|
||||||
set optimizer_switch=@save_optimizer_switch_for_stat_tables_test;
|
set optimizer_switch=@save_optimizer_switch_for_stat_tables_test;
|
||||||
SET SESSION STORAGE_ENGINE=DEFAULT;
|
SET SESSION STORAGE_ENGINE=DEFAULT;
|
||||||
|
@ -1659,3 +1659,23 @@ id
|
|||||||
set use_stat_tables=@save_use_stat_tables;
|
set use_stat_tables=@save_use_stat_tables;
|
||||||
set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
|
set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
|
#
|
||||||
|
# MDEV-16507: statistics for temporary tables should not be used
|
||||||
|
#
|
||||||
|
SET
|
||||||
|
@save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
|
||||||
|
SET @@use_stat_tables = preferably ;
|
||||||
|
SET @@optimizer_use_condition_selectivity = 4;
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
TIMESTAMP TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||||
|
ON UPDATE CURRENT_TIMESTAMP
|
||||||
|
);
|
||||||
|
SET @had_t1_table= @@warning_count != 0;
|
||||||
|
CREATE TEMPORARY TABLE tmp_t1 LIKE t1;
|
||||||
|
INSERT INTO tmp_t1 VALUES (now());
|
||||||
|
INSERT INTO t1 SELECT * FROM tmp_t1 WHERE @had_t1_table=0;
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET
|
||||||
|
use_stat_tables=@save_use_stat_tables;
|
||||||
|
SET
|
||||||
|
optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
|
||||||
|
6
mysql-test/r/statistics_close.result
Normal file
6
mysql-test/r/statistics_close.result
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
CREATE TABLE t1 (i int);
|
||||||
|
RENAME TABLE t1 TO t2;
|
||||||
|
FLUSH TABLES;
|
||||||
|
DROP TABLE IF EXISTS t1, t2;
|
||||||
|
Warnings:
|
||||||
|
Note 1051 Unknown table 'test.t1'
|
@ -7211,4 +7211,20 @@ a
|
|||||||
5
|
5
|
||||||
SET @@optimizer_switch= @optimiser_switch_save;
|
SET @@optimizer_switch= @optimiser_switch_save;
|
||||||
DROP TABLE t1, t2, t3;
|
DROP TABLE t1, t2, t3;
|
||||||
|
#
|
||||||
|
# MDEV-16820: impossible where with inexpensive subquery
|
||||||
|
#
|
||||||
|
create table t1 (a int) engine=myisam;
|
||||||
|
insert into t1 values (3), (1), (7);
|
||||||
|
create table t2 (b int, index idx(b));
|
||||||
|
insert into t2 values (2), (5), (3), (2);
|
||||||
|
explain select * from t1 where (select max(b) from t2) = 10;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||||
|
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||||
|
explain select * from t1 where (select max(b) from t2) = 10 and t1.a > 3;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||||
|
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||||
|
drop table t1,t2;
|
||||||
End of 5.5 tests
|
End of 5.5 tests
|
||||||
|
@ -1043,7 +1043,7 @@ EXPLAIN
|
|||||||
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10);
|
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10);
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||||
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No matching min/max row
|
||||||
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10);
|
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10);
|
||||||
f1 f2
|
f1 f2
|
||||||
SET @@optimizer_switch = 'materialization=off,in_to_exists=on,semijoin=off';
|
SET @@optimizer_switch = 'materialization=off,in_to_exists=on,semijoin=off';
|
||||||
@ -1134,7 +1134,7 @@ EXPLAIN
|
|||||||
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10);
|
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10);
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||||
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No matching min/max row
|
||||||
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10);
|
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT min(f3)+f3, min(f4)+f3+max(f4) FROM t2 WHERE f3 > 10);
|
||||||
f1 f2
|
f1 f2
|
||||||
set @@optimizer_switch=@save_optimizer_switch;
|
set @@optimizer_switch=@save_optimizer_switch;
|
||||||
@ -2499,7 +2499,7 @@ SELECT 2 IN (SELECT 2 from DUAL WHERE 1 != 1);
|
|||||||
SET optimizer_switch= @@global.optimizer_switch;
|
SET optimizer_switch= @@global.optimizer_switch;
|
||||||
set @@tmp_table_size= @@global.tmp_table_size;
|
set @@tmp_table_size= @@global.tmp_table_size;
|
||||||
#
|
#
|
||||||
# mfrv-14515: Wrong results for tableless query with subquery in WHERE
|
# mdev-14515: Wrong results for tableless query with subquery in WHERE
|
||||||
# and implicit aggregation
|
# and implicit aggregation
|
||||||
#
|
#
|
||||||
create table t1 (i1 int, i2 int);
|
create table t1 (i1 int, i2 int);
|
||||||
|
@ -2362,6 +2362,99 @@ ec70316637232000158bbfc8bcbe5d60
|
|||||||
ebb4620037332000158bbfc8bcbe5d89
|
ebb4620037332000158bbfc8bcbe5d89
|
||||||
DROP TABLE t1,t2,t3;
|
DROP TABLE t1,t2,t3;
|
||||||
set optimizer_switch=@save_optimizer_switch;
|
set optimizer_switch=@save_optimizer_switch;
|
||||||
|
#
|
||||||
|
# MDEV-16751: Server crashes in st_join_table::cleanup or
|
||||||
|
# TABLE_LIST::is_with_table_recursive_reference with join_cache_level>2
|
||||||
|
#
|
||||||
|
set @save_join_cache_level= @@join_cache_level;
|
||||||
|
set join_cache_level=4;
|
||||||
|
CREATE TABLE t1 ( id int NOT NULL);
|
||||||
|
INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19);
|
||||||
|
CREATE TABLE t2 (i1 int NOT NULL, i2 int NOT NULL) ;
|
||||||
|
INSERT INTO t2 VALUES (11,11),(12,12),(13,13);
|
||||||
|
explain
|
||||||
|
SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2);
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
|
||||||
|
1 PRIMARY t1 hash_ALL NULL #hash#$hj 4 test.t2.i1 9 Using where; Using join buffer (flat, BNLH join)
|
||||||
|
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
|
||||||
|
SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2);
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
set @@join_cache_level= @save_join_cache_level;
|
||||||
|
alter table t1 add key(id);
|
||||||
|
explain
|
||||||
|
SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2);
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
|
||||||
|
1 PRIMARY t1 ref id id 4 test.t2.i1 2 Using index
|
||||||
|
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
|
||||||
|
SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2);
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
drop table t1,t2;
|
||||||
|
#
|
||||||
|
# MDEV-15454: Nested SELECT IN returns wrong results
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 ( a int NOT NULL PRIMARY KEY);
|
||||||
|
CREATE TABLE t2 ( a int, b int );
|
||||||
|
INSERT INTO t2 VALUES (7878, 96),(3465, 96),(1403, 96),(4189, 96),(8732, 96), (5,96);
|
||||||
|
CREATE TABLE t3 (c int unsigned NOT NULL, b int unsigned NOT NULL, PRIMARY KEY (c,b));
|
||||||
|
INSERT INTO t3 (c, b) VALUES (27, 96);
|
||||||
|
CREATE PROCEDURE prepare_data()
|
||||||
|
BEGIN
|
||||||
|
DECLARE i INT DEFAULT 1;
|
||||||
|
WHILE i < 1000 DO
|
||||||
|
INSERT INTO t1 (a) VALUES (i);
|
||||||
|
INSERT INTO t2 (a,b) VALUES (i,56);
|
||||||
|
INSERT INTO t3 (c,b) VALUES (i,i);
|
||||||
|
SET i = i + 1;
|
||||||
|
END WHILE;
|
||||||
|
END$$
|
||||||
|
CALL prepare_data();
|
||||||
|
SELECT t2.a FROM t2 WHERE t2.b IN (SELECT t3.b FROM t3 WHERE t3.c= 27);
|
||||||
|
a
|
||||||
|
7878
|
||||||
|
3465
|
||||||
|
1403
|
||||||
|
4189
|
||||||
|
8732
|
||||||
|
5
|
||||||
|
set @save_optimizer_switch= @@optimizer_switch;
|
||||||
|
SET optimizer_switch='materialization=off';
|
||||||
|
SELECT t1.a FROM t1
|
||||||
|
WHERE t1.a IN (SELECT t2.a FROM t2 WHERE t2.b IN (SELECT t3.b FROM t3 WHERE t3.c= 27)) LIMIT 5;
|
||||||
|
a
|
||||||
|
5
|
||||||
|
SET optimizer_switch='materialization=on';
|
||||||
|
SELECT t1.a FROM t1
|
||||||
|
WHERE t1.a IN (SELECT t2.a FROM t2 WHERE t2.b IN (SELECT t3.b FROM t3 WHERE t3.c= 27)) LIMIT 5;
|
||||||
|
a
|
||||||
|
5
|
||||||
|
drop procedure prepare_data;
|
||||||
|
set @@optimizer_switch= @save_optimizer_switch;
|
||||||
|
drop table t1,t2,t3;
|
||||||
|
CREATE TABLE t1 ( id int NOT NULL, key(id));
|
||||||
|
INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19);
|
||||||
|
CREATE TABLE t2 (i1 int NOT NULL, i2 int NOT NULL);
|
||||||
|
INSERT INTO t2 VALUES (11,11),(12,12),(13,13);
|
||||||
|
CREATE VIEW v1 AS SELECT t2.i1 FROM t2 where t2.i1 = t2.i2;
|
||||||
|
explain SELECT 1 FROM t1 where t1.id IN (SELECT v1.i1 from v1);
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
|
||||||
|
1 PRIMARY t1 ref id id 4 test.t2.i1 2 Using index
|
||||||
|
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
|
||||||
|
SELECT 1 FROM t1 where t1.id IN (SELECT v1.i1 from v1);
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
drop table t1,t2;
|
||||||
|
drop view v1;
|
||||||
# End of 5.5 tests
|
# End of 5.5 tests
|
||||||
#
|
#
|
||||||
# MDEV-7220: Materialization strategy is not used for REPLACE ... SELECT
|
# MDEV-7220: Materialization strategy is not used for REPLACE ... SELECT
|
||||||
|
@ -334,7 +334,7 @@ SELECT * FROM t1
|
|||||||
WHERE (f1) IN (SELECT f1 FROM t2)
|
WHERE (f1) IN (SELECT f1 FROM t2)
|
||||||
LIMIT 0;
|
LIMIT 0;
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Zero limit
|
||||||
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
||||||
SELECT * FROM t1
|
SELECT * FROM t1
|
||||||
WHERE (f1) IN (SELECT f1 FROM t2)
|
WHERE (f1) IN (SELECT f1 FROM t2)
|
||||||
@ -442,7 +442,7 @@ SELECT i2 FROM t2 RIGHT JOIN t3 ON (c3 = c2) WHERE pk3 = i1
|
|||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 PRIMARY t1 system NULL NULL NULL NULL 1
|
1 PRIMARY t1 system NULL NULL NULL NULL 1
|
||||||
2 DEPENDENT SUBQUERY t3 const PRIMARY PRIMARY 4 const 1
|
2 DEPENDENT SUBQUERY t3 const PRIMARY PRIMARY 4 const 1
|
||||||
2 DEPENDENT SUBQUERY t2 index NULL i2 11 NULL 2 Using where; Using index
|
2 DEPENDENT SUBQUERY t2 index i2 i2 11 NULL 2 Using where; Using index
|
||||||
DROP TABLE t1,t2,t3;
|
DROP TABLE t1,t2,t3;
|
||||||
#
|
#
|
||||||
# MDEV-7599: in-to-exists chosen after min/max optimization
|
# MDEV-7599: in-to-exists chosen after min/max optimization
|
||||||
|
@ -7211,6 +7211,22 @@ a
|
|||||||
5
|
5
|
||||||
SET @@optimizer_switch= @optimiser_switch_save;
|
SET @@optimizer_switch= @optimiser_switch_save;
|
||||||
DROP TABLE t1, t2, t3;
|
DROP TABLE t1, t2, t3;
|
||||||
|
#
|
||||||
|
# MDEV-16820: impossible where with inexpensive subquery
|
||||||
|
#
|
||||||
|
create table t1 (a int) engine=myisam;
|
||||||
|
insert into t1 values (3), (1), (7);
|
||||||
|
create table t2 (b int, index idx(b));
|
||||||
|
insert into t2 values (2), (5), (3), (2);
|
||||||
|
explain select * from t1 where (select max(b) from t2) = 10;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||||
|
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||||
|
explain select * from t1 where (select max(b) from t2) = 10 and t1.a > 3;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||||
|
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||||
|
drop table t1,t2;
|
||||||
End of 5.5 tests
|
End of 5.5 tests
|
||||||
set optimizer_switch=default;
|
set optimizer_switch=default;
|
||||||
select @@optimizer_switch like '%exists_to_in=off%';
|
select @@optimizer_switch like '%exists_to_in=off%';
|
||||||
|
@ -7204,6 +7204,22 @@ a
|
|||||||
5
|
5
|
||||||
SET @@optimizer_switch= @optimiser_switch_save;
|
SET @@optimizer_switch= @optimiser_switch_save;
|
||||||
DROP TABLE t1, t2, t3;
|
DROP TABLE t1, t2, t3;
|
||||||
|
#
|
||||||
|
# MDEV-16820: impossible where with inexpensive subquery
|
||||||
|
#
|
||||||
|
create table t1 (a int) engine=myisam;
|
||||||
|
insert into t1 values (3), (1), (7);
|
||||||
|
create table t2 (b int, index idx(b));
|
||||||
|
insert into t2 values (2), (5), (3), (2);
|
||||||
|
explain select * from t1 where (select max(b) from t2) = 10;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||||
|
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||||
|
explain select * from t1 where (select max(b) from t2) = 10 and t1.a > 3;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||||
|
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||||
|
drop table t1,t2;
|
||||||
End of 5.5 tests
|
End of 5.5 tests
|
||||||
set optimizer_switch=default;
|
set optimizer_switch=default;
|
||||||
select @@optimizer_switch like '%materialization=on%';
|
select @@optimizer_switch like '%materialization=on%';
|
||||||
|
@ -7202,5 +7202,21 @@ a
|
|||||||
5
|
5
|
||||||
SET @@optimizer_switch= @optimiser_switch_save;
|
SET @@optimizer_switch= @optimiser_switch_save;
|
||||||
DROP TABLE t1, t2, t3;
|
DROP TABLE t1, t2, t3;
|
||||||
|
#
|
||||||
|
# MDEV-16820: impossible where with inexpensive subquery
|
||||||
|
#
|
||||||
|
create table t1 (a int) engine=myisam;
|
||||||
|
insert into t1 values (3), (1), (7);
|
||||||
|
create table t2 (b int, index idx(b));
|
||||||
|
insert into t2 values (2), (5), (3), (2);
|
||||||
|
explain select * from t1 where (select max(b) from t2) = 10;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||||
|
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||||
|
explain select * from t1 where (select max(b) from t2) = 10 and t1.a > 3;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||||
|
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||||
|
drop table t1,t2;
|
||||||
End of 5.5 tests
|
End of 5.5 tests
|
||||||
set @optimizer_switch_for_subselect_test=null;
|
set @optimizer_switch_for_subselect_test=null;
|
||||||
|
@ -7217,6 +7217,22 @@ a
|
|||||||
5
|
5
|
||||||
SET @@optimizer_switch= @optimiser_switch_save;
|
SET @@optimizer_switch= @optimiser_switch_save;
|
||||||
DROP TABLE t1, t2, t3;
|
DROP TABLE t1, t2, t3;
|
||||||
|
#
|
||||||
|
# MDEV-16820: impossible where with inexpensive subquery
|
||||||
|
#
|
||||||
|
create table t1 (a int) engine=myisam;
|
||||||
|
insert into t1 values (3), (1), (7);
|
||||||
|
create table t2 (b int, index idx(b));
|
||||||
|
insert into t2 values (2), (5), (3), (2);
|
||||||
|
explain select * from t1 where (select max(b) from t2) = 10;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||||
|
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||||
|
explain select * from t1 where (select max(b) from t2) = 10 and t1.a > 3;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||||
|
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||||
|
drop table t1,t2;
|
||||||
End of 5.5 tests
|
End of 5.5 tests
|
||||||
set optimizer_switch=default;
|
set optimizer_switch=default;
|
||||||
select @@optimizer_switch like '%subquery_cache=on%';
|
select @@optimizer_switch like '%subquery_cache=on%';
|
||||||
|
@ -7202,6 +7202,22 @@ a
|
|||||||
5
|
5
|
||||||
SET @@optimizer_switch= @optimiser_switch_save;
|
SET @@optimizer_switch= @optimiser_switch_save;
|
||||||
DROP TABLE t1, t2, t3;
|
DROP TABLE t1, t2, t3;
|
||||||
|
#
|
||||||
|
# MDEV-16820: impossible where with inexpensive subquery
|
||||||
|
#
|
||||||
|
create table t1 (a int) engine=myisam;
|
||||||
|
insert into t1 values (3), (1), (7);
|
||||||
|
create table t2 (b int, index idx(b));
|
||||||
|
insert into t2 values (2), (5), (3), (2);
|
||||||
|
explain select * from t1 where (select max(b) from t2) = 10;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||||
|
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||||
|
explain select * from t1 where (select max(b) from t2) = 10 and t1.a > 3;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||||
|
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
|
||||||
|
drop table t1,t2;
|
||||||
End of 5.5 tests
|
End of 5.5 tests
|
||||||
set @optimizer_switch_for_subselect_test=null;
|
set @optimizer_switch_for_subselect_test=null;
|
||||||
set @join_cache_level_for_subselect_test=NULL;
|
set @join_cache_level_for_subselect_test=NULL;
|
||||||
|
@ -1634,3 +1634,201 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||||||
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 11 func 1
|
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 11 func 1
|
||||||
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
|
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
|
||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
|
#
|
||||||
|
# MDEV-16225: wrong resultset from query with semijoin=on
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
`id` int(10) NOT NULL AUTO_INCREMENT,
|
||||||
|
`local_name` varchar(64) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1;
|
||||||
|
insert into t1(`id`,`local_name`) values
|
||||||
|
(1,'Cash Advance'),
|
||||||
|
(2,'Cash Advance'),
|
||||||
|
(3,'Rollover'),
|
||||||
|
(4,'AL Installment'),
|
||||||
|
(5,'AL Installment'),
|
||||||
|
(6,'AL Installment'),
|
||||||
|
(7,'AL Installment'),
|
||||||
|
(8,'AL Installment'),
|
||||||
|
(9,'AL Installment'),
|
||||||
|
(10,'Internet Payday'),
|
||||||
|
(11,'Rollover - Internet Payday'),
|
||||||
|
(12,'AL Monthly Installment'),
|
||||||
|
(13,'AL Semi-Monthly Installment');
|
||||||
|
explain
|
||||||
|
SELECT SQL_NO_CACHE t.id
|
||||||
|
FROM t1 t
|
||||||
|
WHERE (
|
||||||
|
t.id IN (SELECT A.id FROM t1 AS A WHERE A.local_name IN (SELECT B.local_name FROM t1 AS B WHERE B.id IN (0,4,12,13,1,10,3,11)))
|
||||||
|
OR
|
||||||
|
(t.id IN (0,4,12,13,1,10,3,11))
|
||||||
|
);
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY t index PRIMARY PRIMARY 4 NULL 13 Using where; Using index
|
||||||
|
2 MATERIALIZED <subquery3> ALL distinct_key NULL NULL NULL 8
|
||||||
|
2 MATERIALIZED A ALL PRIMARY NULL NULL NULL 13 Using where; Using join buffer (flat, BNL join)
|
||||||
|
3 MATERIALIZED B ALL PRIMARY NULL NULL NULL 13 Using where
|
||||||
|
SELECT SQL_NO_CACHE t.id
|
||||||
|
FROM t1 t
|
||||||
|
WHERE (
|
||||||
|
t.id IN (SELECT A.id FROM t1 AS A WHERE A.local_name IN (SELECT B.local_name FROM t1 AS B WHERE B.id IN (0,4,12,13,1,10,3,11)))
|
||||||
|
OR
|
||||||
|
(t.id IN (0,4,12,13,1,10,3,11))
|
||||||
|
);
|
||||||
|
id
|
||||||
|
1
|
||||||
|
2
|
||||||
|
3
|
||||||
|
4
|
||||||
|
5
|
||||||
|
6
|
||||||
|
7
|
||||||
|
8
|
||||||
|
9
|
||||||
|
10
|
||||||
|
11
|
||||||
|
12
|
||||||
|
13
|
||||||
|
drop table t1;
|
||||||
|
#
|
||||||
|
# MDEV-15982: Incorrect results when subquery is materialized
|
||||||
|
#
|
||||||
|
CREATE TABLE `t1` (`id` int(32) NOT NULL primary key);
|
||||||
|
INSERT INTO `t1` VALUES
|
||||||
|
(45), (46), (47), (48), (49), (50), (51), (52), (53), (54), (55), (56), (57), (58), (59), (60), (61), (62),
|
||||||
|
(63), (64), (65), (66), (67), (68), (69), (70), (71), (72), (73), (74), (75), (76), (77), (78), (79), (80),
|
||||||
|
(81), (82), (83), (84), (85), (86), (87), (88), (89), (90), (91), (92),(93),(94),(95),(96), (97), (98),
|
||||||
|
(99), (100), (101), (102), (103), (104), (105), (106), (107), (108), (109), (110), (111), (112), (113),
|
||||||
|
(114), (115), (116), (117), (118), (119), (120), (121), (122), (123), (124), (125), (126), (127), (128),
|
||||||
|
(129), (130), (131), (132), (133), (134), (135), (136), (137), (138), (139), (140), (141), (142), (143), (144), (145), (146),
|
||||||
|
(147), (148), (149), (150), (151), (152), (153), (154), (155), (156), (157), (158), (159), (160), (161),
|
||||||
|
(162), (163), (164), (165), (166), (167), (168), (169), (170), (171), (172), (173),
|
||||||
|
(174), (175), (176), (177), (178), (179), (180), (181), (182), (183), (2), (3), (4), (5), (6), (19), (35),
|
||||||
|
(7), (20), (8), (36), (219), (22), (10), (23), (37), (11), (24);
|
||||||
|
CREATE TABLE `t2` (`type` int , `id` int(32) NOT NULL primary key);
|
||||||
|
INSERT INTO `t2` VALUES
|
||||||
|
(2,2),(2,3),(1,4),(2,5),(1,6),(1,19),(5,7),(1,20),(1,8),(1,21),(1,9),
|
||||||
|
(1,22),(2,10),(1,23),(2,11),(1,24),(1,12),(1,25),(2,13),(2,26),(2,14),
|
||||||
|
(2,27),(1,15),(1,28),(3,16),(1,29),(2,17),(1,30),(5,18),(2,1);
|
||||||
|
CREATE TABLE `t3` (`ref_id` int(32) unsigned ,`type` varchar(80),`id` int(32) NOT NULL );
|
||||||
|
INSERT INTO `t3` VALUES
|
||||||
|
(1,'incident',31),(2,'faux pas',32),
|
||||||
|
(5,'oopsies',33),(3,'deniable',34),
|
||||||
|
(11,'wasntme',35),(10,'wasntme',36),
|
||||||
|
(17,'faux pas',37),(13,'unlikely',38),
|
||||||
|
(13,'improbable',39),(14,'incident',40),
|
||||||
|
(26,'problem',41),(14,'problem',42),
|
||||||
|
(26,'incident',43),(27,'incident',44);
|
||||||
|
explain
|
||||||
|
SELECT t2.id FROM t2,t1
|
||||||
|
WHERE t2.id IN (SELECT t3.ref_id FROM t3,t1 where t3.id = t1.id) and t2.id = t1.id;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 30 Using index
|
||||||
|
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 Using where
|
||||||
|
1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.id 1 Using index
|
||||||
|
2 MATERIALIZED t3 ALL NULL NULL NULL NULL 14
|
||||||
|
2 MATERIALIZED t1 eq_ref PRIMARY PRIMARY 4 test.t3.id 1 Using index
|
||||||
|
SELECT t2.id FROM t2,t1
|
||||||
|
WHERE t2.id IN (SELECT t3.ref_id FROM t3,t1 where t3.id = t1.id) and t2.id = t1.id;
|
||||||
|
id
|
||||||
|
10
|
||||||
|
11
|
||||||
|
set optimizer_switch='materialization=off';
|
||||||
|
SELECT t2.id FROM t2,t1
|
||||||
|
WHERE t2.id IN (SELECT t3.ref_id FROM t3,t1 where t3.id = t1.id) and t2.id = t1.id;
|
||||||
|
id
|
||||||
|
11
|
||||||
|
10
|
||||||
|
set optimizer_switch='materialization=on';
|
||||||
|
DROP TABLE t1,t2,t3;
|
||||||
|
#
|
||||||
|
# MDEV-15247: Crash when SET NAMES 'utf8' is set
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
id_category int unsigned,
|
||||||
|
id_product int unsigned,
|
||||||
|
PRIMARY KEY (id_category,id_product)
|
||||||
|
) ENGINE=MyISAM;
|
||||||
|
INSERT INTO `t1` VALUES (31,216), (31,215), (31,214), (31,213), (31,212), (32,211), (32,210), (32,209), (32,208), (29,207), (30,315372), (2,161), (2,132), (33,315380), (31,315371), (29,315370), (29,315373), (29,315369), (29,315374), (29,315368), (29,315375), (29,315367), (29,183), (29,182), (30,177), (29,315376), (13,315365), (2,167), (2,315357), (2,164), (2,159), (2,131), (2,127), (14,315364), (27,315363), (29,205), (29,204), (29,203), (29,202), (29,201), (29,200), (29,199), (29,198), (29,197), (29,196), (29,195), (29,194), (29,193), (29,192), (29,191), (29,190), (29,189), (14,188), (29,187), (29,186), (29,185), (29,184), (29,315377), (29,315378), (29,181), (33,315379), (29,179), (30,178), (29,180), (30,176), (30,175), (30,174), (30,173), (30,172), (11,171), (27,315357), (23,108), (23,102);
|
||||||
|
CREATE TABLE t2 (
|
||||||
|
id_product int,
|
||||||
|
id_t2 int,
|
||||||
|
KEY id_t2 (id_t2),
|
||||||
|
KEY id_product (id_product)
|
||||||
|
) ENGINE=MyISAM;
|
||||||
|
INSERT INTO `t2` VALUES (11,31), (11,31), (11,31), (11,32), (11,32),
|
||||||
|
(11,32), (10,26), (11,32), (10,28), (11,32), (10,29), (11,33), (10,26),
|
||||||
|
(11,33), (10,27), (9,23), (11,32), (10,26), (8,18), (7,15), (11,32),
|
||||||
|
(10,28), (11,32), (10,28), (11,32), (10,29), (11,32), (10,29), (8,19),
|
||||||
|
(7,16), (8,18), (7,16), (8,20), (7,16), (11,32), (10,28), (8,19),
|
||||||
|
(7,16), (8,20), (7,16), (11,32), (10,29), (8,19), (7,16), (8,20),
|
||||||
|
(7,16), (10,27), (9,23), (10,27), (9,23), (10,27), (9,23), (11,32),
|
||||||
|
(10,27), (11,32), (10,27), (8,18), (7,15), (10,26), (9,24), (8,19),
|
||||||
|
(7,16), (10,26), (9,23), (8,19), (7,16), (8,18), (7,16), (8,18), (7,16),
|
||||||
|
(9,23), (8,18), (9,23), (8,19), (7,16), (7,16), (8,19), (7,16), (11,31),
|
||||||
|
(10,27), (9,24), (11,31), (10,27), (9,23), (8,19), (11,31), (10,26), (9,24),
|
||||||
|
(8,19), (11,31), (10,26), (9,25), (8,18), (11,31), (10,26), (9,23), (8,19),
|
||||||
|
(11,31), (10,26), (9,23), (8,18), (11,31), (10,30), (9,23), (8,18), (11,31),
|
||||||
|
(10,30), (9,23), (8,19), (11,31), (10,26), (9,25), (8,19), (8,21), (11,32),
|
||||||
|
(10,26), (9,22), (8,19), (11,32), (10,26), (9,22), (8,18), (11,32), (10,26),
|
||||||
|
(9,22), (8,20), (11,33), (10,26), (9,22), (8,19), (11,33), (10,26), (9,22),
|
||||||
|
(8,18), (11,33), (10,26), (9,22), (8,20), (11,32), (10,26), (9,24), (8,19),
|
||||||
|
(11,32), (10,26), (9,25), (8,19), (11,32), (10,26), (9,25), (8,18), (11,32),
|
||||||
|
(10,26), (9,23), (8,18), (11,32), (10,30), (9,23), (8,18), (11,32), (10,30),
|
||||||
|
(9,23), (8,19), (11,32), (10,26), (9,23), (8,19), (11,32), (10,27), (9,23),
|
||||||
|
(11,32), (10,27), (9,23), (11,32), (10,27), (9,23), (10,26), (9,22), (8,19),
|
||||||
|
(7,15), (10,26), (9,22), (8,20), (7,15), (10,26), (9,22), (8,18), (7,15),
|
||||||
|
(8,19), (10,26), (10,26), (11,33), (10,26), (11,33), (10,26), (11,33),
|
||||||
|
(10,27), (11,33), (10,27), (11,31), (10,26), (11,31), (10,26), (8,18),
|
||||||
|
(7,15), (9,23), (9,23), (9,24), (8,21), (7,15), (7,15), (7,15), (7,15),
|
||||||
|
(7,15), (7,15), (7,15), (7,15), (7,15), (8,18), (7,17), (8,18), (7,17), (8,19), (8,19);
|
||||||
|
CREATE TABLE t3 (
|
||||||
|
id_product int unsigned,
|
||||||
|
PRIMARY KEY (id_product)
|
||||||
|
) ENGINE=MyISAM;
|
||||||
|
INSERT INTO t3 VALUES
|
||||||
|
(102),(103),(104),(105),(106),(107),(108),(109),(110),
|
||||||
|
(315371),(315373),(315374),(315375),(315376),(315377),
|
||||||
|
(315378),(315379),(315380);
|
||||||
|
CREATE TABLE t4 (
|
||||||
|
id_product int not null,
|
||||||
|
id_shop int,
|
||||||
|
PRIMARY KEY (id_product,id_shop)
|
||||||
|
) ENGINE=MyISAM ;
|
||||||
|
INSERT INTO t4 VALUES
|
||||||
|
(202,1),(201,1),(200,1),(199,1),(198,1),(197,1),(196,1),(195,1),
|
||||||
|
(194,1),(193,1),(192,1),(191,1),(190,1),(189,1),(188,1),(187,1),
|
||||||
|
(186,1),(185,1),(184,1),(183,1),(182,1),(181,1),(179,1),(178,1),
|
||||||
|
(177,1),(176,1),(126,1),(315380,1);
|
||||||
|
CREATE TABLE t5 (id_product int) ENGINE=MyISAM;
|
||||||
|
INSERT INTO `t5` VALUES
|
||||||
|
(652),(668),(669),(670),(671),(673),(674),(675),(676),
|
||||||
|
(677),(679),(680),(681),(682),(683),(684),(685),(686);
|
||||||
|
explain
|
||||||
|
SELECT * FROM t3
|
||||||
|
JOIN t4 ON (t4.id_product = t3.id_product AND t4.id_shop = 1)
|
||||||
|
JOIN t1 ON (t1.id_product = t3.id_product)
|
||||||
|
LEFT JOIN t5 ON (t5.id_product = t3.id_product)
|
||||||
|
WHERE 1=1
|
||||||
|
AND t3.id_product IN (SELECT id_product FROM t2 t2_1 WHERE t2_1.id_t2 = 32)
|
||||||
|
AND t3.id_product IN (SELECT id_product FROM t2 t2_2 WHERE t2_2.id_t2 = 15)
|
||||||
|
AND t3.id_product IN (SELECT id_product FROM t2 t2_3 WHERE t2_3.id_t2 = 18 OR t2_3.id_t2 = 19)
|
||||||
|
AND t3.id_product IN (SELECT id_product FROM t2 t2_4 WHERE t2_4.id_t2 = 34 OR t2_4.id_t2 = 23)
|
||||||
|
AND t3.id_product IN (SELECT id_product FROM t2 t2_5 WHERE t2_5.id_t2 = 29 OR t2_5.id_t2 = 28 OR t2_5.id_t2 = 26);
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY t1 index NULL PRIMARY 8 NULL 73 Using index
|
||||||
|
1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.id_product 1 Using index
|
||||||
|
1 PRIMARY <subquery5> eq_ref distinct_key distinct_key 4 func 1 Using where
|
||||||
|
1 PRIMARY <subquery4> eq_ref distinct_key distinct_key 4 func 1 Using where
|
||||||
|
1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 Using where
|
||||||
|
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 Using where
|
||||||
|
1 PRIMARY t4 eq_ref PRIMARY PRIMARY 8 test.t1.id_product,const 1 Using where; Using index
|
||||||
|
1 PRIMARY <subquery6> eq_ref distinct_key distinct_key 4 func 1 Using where
|
||||||
|
1 PRIMARY t5 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
|
||||||
|
5 MATERIALIZED t2_4 range id_t2,id_product id_t2 5 NULL 18 Using index condition; Using where
|
||||||
|
4 MATERIALIZED t2_3 range id_t2,id_product id_t2 5 NULL 32 Using index condition; Using where
|
||||||
|
3 MATERIALIZED t2_2 ref id_t2,id_product id_t2 5 const 12
|
||||||
|
2 MATERIALIZED t2_1 ref id_t2,id_product id_t2 5 const 50
|
||||||
|
6 MATERIALIZED t2_5 range id_t2,id_product id_t2 5 NULL 30 Using index condition; Using where
|
||||||
|
drop table t1,t2,t3,t4,t5;
|
||||||
|
@ -2402,6 +2402,99 @@ ec70316637232000158bbfc8bcbe5d60
|
|||||||
ebb4620037332000158bbfc8bcbe5d89
|
ebb4620037332000158bbfc8bcbe5d89
|
||||||
DROP TABLE t1,t2,t3;
|
DROP TABLE t1,t2,t3;
|
||||||
set optimizer_switch=@save_optimizer_switch;
|
set optimizer_switch=@save_optimizer_switch;
|
||||||
|
#
|
||||||
|
# MDEV-16751: Server crashes in st_join_table::cleanup or
|
||||||
|
# TABLE_LIST::is_with_table_recursive_reference with join_cache_level>2
|
||||||
|
#
|
||||||
|
set @save_join_cache_level= @@join_cache_level;
|
||||||
|
set join_cache_level=4;
|
||||||
|
CREATE TABLE t1 ( id int NOT NULL);
|
||||||
|
INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19);
|
||||||
|
CREATE TABLE t2 (i1 int NOT NULL, i2 int NOT NULL) ;
|
||||||
|
INSERT INTO t2 VALUES (11,11),(12,12),(13,13);
|
||||||
|
explain
|
||||||
|
SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2);
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
|
||||||
|
1 PRIMARY t1 hash_ALL NULL #hash#$hj 4 test.t2.i1 9 Using where; Using join buffer (flat, BNLH join)
|
||||||
|
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
|
||||||
|
SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2);
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
set @@join_cache_level= @save_join_cache_level;
|
||||||
|
alter table t1 add key(id);
|
||||||
|
explain
|
||||||
|
SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2);
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
|
||||||
|
1 PRIMARY t1 ref id id 4 test.t2.i1 2 Using index
|
||||||
|
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
|
||||||
|
SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2);
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
drop table t1,t2;
|
||||||
|
#
|
||||||
|
# MDEV-15454: Nested SELECT IN returns wrong results
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 ( a int NOT NULL PRIMARY KEY);
|
||||||
|
CREATE TABLE t2 ( a int, b int );
|
||||||
|
INSERT INTO t2 VALUES (7878, 96),(3465, 96),(1403, 96),(4189, 96),(8732, 96), (5,96);
|
||||||
|
CREATE TABLE t3 (c int unsigned NOT NULL, b int unsigned NOT NULL, PRIMARY KEY (c,b));
|
||||||
|
INSERT INTO t3 (c, b) VALUES (27, 96);
|
||||||
|
CREATE PROCEDURE prepare_data()
|
||||||
|
BEGIN
|
||||||
|
DECLARE i INT DEFAULT 1;
|
||||||
|
WHILE i < 1000 DO
|
||||||
|
INSERT INTO t1 (a) VALUES (i);
|
||||||
|
INSERT INTO t2 (a,b) VALUES (i,56);
|
||||||
|
INSERT INTO t3 (c,b) VALUES (i,i);
|
||||||
|
SET i = i + 1;
|
||||||
|
END WHILE;
|
||||||
|
END$$
|
||||||
|
CALL prepare_data();
|
||||||
|
SELECT t2.a FROM t2 WHERE t2.b IN (SELECT t3.b FROM t3 WHERE t3.c= 27);
|
||||||
|
a
|
||||||
|
7878
|
||||||
|
3465
|
||||||
|
1403
|
||||||
|
4189
|
||||||
|
8732
|
||||||
|
5
|
||||||
|
set @save_optimizer_switch= @@optimizer_switch;
|
||||||
|
SET optimizer_switch='materialization=off';
|
||||||
|
SELECT t1.a FROM t1
|
||||||
|
WHERE t1.a IN (SELECT t2.a FROM t2 WHERE t2.b IN (SELECT t3.b FROM t3 WHERE t3.c= 27)) LIMIT 5;
|
||||||
|
a
|
||||||
|
5
|
||||||
|
SET optimizer_switch='materialization=on';
|
||||||
|
SELECT t1.a FROM t1
|
||||||
|
WHERE t1.a IN (SELECT t2.a FROM t2 WHERE t2.b IN (SELECT t3.b FROM t3 WHERE t3.c= 27)) LIMIT 5;
|
||||||
|
a
|
||||||
|
5
|
||||||
|
drop procedure prepare_data;
|
||||||
|
set @@optimizer_switch= @save_optimizer_switch;
|
||||||
|
drop table t1,t2,t3;
|
||||||
|
CREATE TABLE t1 ( id int NOT NULL, key(id));
|
||||||
|
INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19);
|
||||||
|
CREATE TABLE t2 (i1 int NOT NULL, i2 int NOT NULL);
|
||||||
|
INSERT INTO t2 VALUES (11,11),(12,12),(13,13);
|
||||||
|
CREATE VIEW v1 AS SELECT t2.i1 FROM t2 where t2.i1 = t2.i2;
|
||||||
|
explain SELECT 1 FROM t1 where t1.id IN (SELECT v1.i1 from v1);
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3
|
||||||
|
1 PRIMARY t1 ref id id 4 test.t2.i1 2 Using index
|
||||||
|
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
|
||||||
|
SELECT 1 FROM t1 where t1.id IN (SELECT v1.i1 from v1);
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
drop table t1,t2;
|
||||||
|
drop view v1;
|
||||||
# End of 5.5 tests
|
# End of 5.5 tests
|
||||||
#
|
#
|
||||||
# MDEV-7220: Materialization strategy is not used for REPLACE ... SELECT
|
# MDEV-7220: Materialization strategy is not used for REPLACE ... SELECT
|
||||||
|
@ -77,9 +77,9 @@ explain select * from t4 where
|
|||||||
t4.a in (select max(t2.a) from t1, t2 group by t2.b) and
|
t4.a in (select max(t2.a) from t1, t2 group by t2.b) and
|
||||||
t4.b in (select max(t2.a) from t1, t2 group by t2.b);
|
t4.b in (select max(t2.a) from t1, t2 group by t2.b);
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 PRIMARY <subquery3> ALL distinct_key NULL NULL NULL 5
|
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 5
|
||||||
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 5 Using join buffer (flat, BNL join)
|
1 PRIMARY t4 ref a a 5 <subquery2>.max(t2.a) 12 Using index condition
|
||||||
1 PRIMARY t4 ref a a 10 <subquery2>.max(t2.a),<subquery3>.max(t2.a) 12
|
1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 test.t4.b 1
|
||||||
3 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary
|
3 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary
|
||||||
3 MATERIALIZED t1 ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join)
|
3 MATERIALIZED t1 ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join)
|
||||||
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary
|
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary
|
||||||
|
@ -2032,4 +2032,20 @@ DROP VIEW v1;
|
|||||||
UNION
|
UNION
|
||||||
(SELECT 2, 2);
|
(SELECT 2, 2);
|
||||||
ERROR 42S02: Table 'test.v1' doesn't exist
|
ERROR 42S02: Table 'test.v1' doesn't exist
|
||||||
|
#
|
||||||
|
# Bug#27197235 USER VARIABLE + UINON + DECIMAL COLUMN RETURNS
|
||||||
|
# WRONG VALUES
|
||||||
|
#
|
||||||
|
SET NAMES utf8;
|
||||||
|
SET @advertAcctId = 1000003;
|
||||||
|
select @advertAcctId as a from dual union all select 1.0 from dual;
|
||||||
|
a
|
||||||
|
1000003.0
|
||||||
|
1.0
|
||||||
|
SET NAMES latin1;
|
||||||
|
SET @advertAcctId = 1000003;
|
||||||
|
select @advertAcctId as a from dual union all select 1.0 from dual;
|
||||||
|
a
|
||||||
|
1000003.0
|
||||||
|
1.0
|
||||||
End of 5.5 tests
|
End of 5.5 tests
|
||||||
|
BIN
mysql-test/std_data/frm/t1.frm
Normal file
BIN
mysql-test/std_data/frm/t1.frm
Normal file
Binary file not shown.
31
mysql-test/suite/binlog/include/check_binlog_size.inc
Normal file
31
mysql-test/suite/binlog/include/check_binlog_size.inc
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# This file runs the query and checks
|
||||||
|
# whether the size of binlog is increased or not
|
||||||
|
# If size is changed it issue die command
|
||||||
|
# Parameters
|
||||||
|
# $sql_query = query to run
|
||||||
|
|
||||||
|
#Only last row of show binlog events matter
|
||||||
|
--let $tmp= 0
|
||||||
|
--let $counter= 1
|
||||||
|
while ($tmp != "No such row")
|
||||||
|
{
|
||||||
|
--let $initial_binlog_size= $tmp
|
||||||
|
--let $tmp= query_get_value(show binary logs, File_size, $counter)
|
||||||
|
--inc $counter
|
||||||
|
}
|
||||||
|
|
||||||
|
--eval $sql_query
|
||||||
|
|
||||||
|
--let $tmp= 0
|
||||||
|
--let $counter= 1
|
||||||
|
while ($tmp != "No such row")
|
||||||
|
{
|
||||||
|
--let $current_binlog_size= $tmp
|
||||||
|
--let $tmp= query_get_value(show binary logs, File_size, $counter)
|
||||||
|
--inc $counter
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($initial_binlog_size != $current_binlog_size)
|
||||||
|
{
|
||||||
|
die "Binlog size changed";
|
||||||
|
}
|
7
mysql-test/suite/binlog/r/binlog_tmp_table_row.result
Normal file
7
mysql-test/suite/binlog/r/binlog_tmp_table_row.result
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
RESET MASTER;
|
||||||
|
#Create table test
|
||||||
|
create temporary table t1(a int, b int);
|
||||||
|
#Add index test
|
||||||
|
create index index_a on t1(a);
|
||||||
|
#drop index test
|
||||||
|
drop index index_a on t1;
|
30
mysql-test/suite/binlog/t/binlog_tmp_table_row.test
Normal file
30
mysql-test/suite/binlog/t/binlog_tmp_table_row.test
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# ==== Purpose ====
|
||||||
|
#
|
||||||
|
# Test if statements used temporary tables are not binlogged in the case of
|
||||||
|
# binlog_format=row
|
||||||
|
#
|
||||||
|
# ==== Method ====
|
||||||
|
#
|
||||||
|
# We will see if binlog file size is increased or not, It should be constant for the
|
||||||
|
# entire period of test.
|
||||||
|
#
|
||||||
|
# ==== Related bugs ====
|
||||||
|
#
|
||||||
|
# Mdev-9266
|
||||||
|
#
|
||||||
|
source include/have_log_bin.inc;
|
||||||
|
source include/have_binlog_format_row.inc;
|
||||||
|
|
||||||
|
RESET MASTER;
|
||||||
|
|
||||||
|
--echo #Create table test
|
||||||
|
--let $sql_query= create temporary table t1(a int, b int)
|
||||||
|
--source suite/binlog/include/check_binlog_size.inc
|
||||||
|
|
||||||
|
--echo #Add index test
|
||||||
|
--let $sql_query= create index index_a on t1(a)
|
||||||
|
--source suite/binlog/include/check_binlog_size.inc
|
||||||
|
|
||||||
|
--echo #drop index test
|
||||||
|
--let $sql_query= drop index index_a on t1
|
||||||
|
--source suite/binlog/include/check_binlog_size.inc
|
@ -1,5 +1,5 @@
|
|||||||
if (!`SELECT count(*) FROM information_schema.plugins WHERE
|
if (!`SELECT count(*) FROM information_schema.plugins WHERE
|
||||||
plugin_name = 'federated' AND plugin_status = 'active' AND
|
plugin_name = 'federated' AND plugin_status = 'active' AND
|
||||||
plugin_description LIKE '%FederatedX%'`){
|
plugin_description LIKE '%transactions%'`){
|
||||||
skip Need FederatedX engine;
|
skip Need FederatedX engine;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines
|
|||||||
WHERE ENGINE = 'ARCHIVE';
|
WHERE ENGINE = 'ARCHIVE';
|
||||||
ENGINE ARCHIVE
|
ENGINE ARCHIVE
|
||||||
SUPPORT YES
|
SUPPORT YES
|
||||||
COMMENT Archive storage engine
|
COMMENT gzip-compresses tables for a low storage footprint
|
||||||
TRANSACTIONS NO
|
TRANSACTIONS NO
|
||||||
XA NO
|
XA NO
|
||||||
SAVEPOINTS NO
|
SAVEPOINTS NO
|
||||||
|
@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines
|
|||||||
WHERE ENGINE = 'CSV';
|
WHERE ENGINE = 'CSV';
|
||||||
ENGINE CSV
|
ENGINE CSV
|
||||||
SUPPORT YES
|
SUPPORT YES
|
||||||
COMMENT CSV storage engine
|
COMMENT Stores tables as CSV files
|
||||||
TRANSACTIONS NO
|
TRANSACTIONS NO
|
||||||
XA NO
|
XA NO
|
||||||
SAVEPOINTS NO
|
SAVEPOINTS NO
|
||||||
|
@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines
|
|||||||
WHERE ENGINE = 'FEDERATED';
|
WHERE ENGINE = 'FEDERATED';
|
||||||
ENGINE FEDERATED
|
ENGINE FEDERATED
|
||||||
SUPPORT YES
|
SUPPORT YES
|
||||||
COMMENT FederatedX pluggable storage engine
|
COMMENT Allows to access tables on other MariaDB servers, supports transactions and more
|
||||||
TRANSACTIONS YES
|
TRANSACTIONS YES
|
||||||
XA NO
|
XA NO
|
||||||
SAVEPOINTS YES
|
SAVEPOINTS YES
|
||||||
|
@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines
|
|||||||
WHERE ENGINE = 'MyISAM';
|
WHERE ENGINE = 'MyISAM';
|
||||||
ENGINE MyISAM
|
ENGINE MyISAM
|
||||||
SUPPORT DEFAULT
|
SUPPORT DEFAULT
|
||||||
COMMENT MyISAM storage engine
|
COMMENT Non-transactional engine with good performance and small data footprint
|
||||||
TRANSACTIONS NO
|
TRANSACTIONS NO
|
||||||
XA NO
|
XA NO
|
||||||
SAVEPOINTS NO
|
SAVEPOINTS NO
|
||||||
|
@ -377,7 +377,9 @@ send optimize table t1;
|
|||||||
# client 1
|
# client 1
|
||||||
--echo proceed with the normal connection
|
--echo proceed with the normal connection
|
||||||
connection default;
|
connection default;
|
||||||
|
--disable_ps_protocol
|
||||||
handler t1 read next;
|
handler t1 read next;
|
||||||
|
--enable_ps_protocol
|
||||||
handler t1 close;
|
handler t1 close;
|
||||||
# client 2
|
# client 2
|
||||||
--echo read the result from the other connection
|
--echo read the result from the other connection
|
||||||
|
@ -269,7 +269,7 @@ handler t1 open;
|
|||||||
lock table t1 write;
|
lock table t1 write;
|
||||||
alter table t1 engine=csv;
|
alter table t1 engine=csv;
|
||||||
handler t1 read a next;
|
handler t1 read a next;
|
||||||
ERROR HY000: Storage engine CSV of the table `test`.`t1` doesn't have this option
|
Got one of the listed errors
|
||||||
handler t1 close;
|
handler t1 close;
|
||||||
unlock tables;
|
unlock tables;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
@ -326,7 +326,7 @@ let $wait_condition=
|
|||||||
info = "alter table t1 engine=csv";
|
info = "alter table t1 engine=csv";
|
||||||
--source include/wait_condition.inc
|
--source include/wait_condition.inc
|
||||||
connection default;
|
connection default;
|
||||||
--error ER_ILLEGAL_HA
|
--error ER_ILLEGAL_HA,ER_KEY_DOES_NOT_EXITS
|
||||||
handler t1 read a next;
|
handler t1 read a next;
|
||||||
handler t1 close;
|
handler t1 close;
|
||||||
connection con1;
|
connection con1;
|
||||||
|
9
mysql-test/suite/handler/ps.result
Normal file
9
mysql-test/suite/handler/ps.result
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
create table t1 (i int);
|
||||||
|
handler test.t1 open handler_a;
|
||||||
|
flush status;
|
||||||
|
handler handler_a read first;
|
||||||
|
i
|
||||||
|
show status like 'Com_stmt_prepare%';
|
||||||
|
Variable_name Value
|
||||||
|
Com_stmt_prepare OK
|
||||||
|
drop table t1;
|
11
mysql-test/suite/handler/ps.test
Normal file
11
mysql-test/suite/handler/ps.test
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#
|
||||||
|
# MDEV-15729 Server crashes in Field::make_field upon HANDLER READ executed with PS protocol
|
||||||
|
#
|
||||||
|
create table t1 (i int);
|
||||||
|
handler test.t1 open handler_a;
|
||||||
|
flush status;
|
||||||
|
handler handler_a read first;
|
||||||
|
# handler...read must be prepared in --ps-protocol mode
|
||||||
|
--replace_result $PS_PROTOCOL OK
|
||||||
|
show status like 'Com_stmt_prepare%';
|
||||||
|
drop table t1;
|
@ -39,3 +39,32 @@ _rowid _rowid skey sval
|
|||||||
1 1 1 hello
|
1 1 1 hello
|
||||||
2 2 2 hey
|
2 2 2 hey
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
#
|
||||||
|
# Start of 5.5 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
id TINYINT NOT NULL AUTO_INCREMENT,
|
||||||
|
name CHAR(30) NOT NULL,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) ENGINE=MEMORY;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`id` tinyint(4) NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` char(30) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||||
|
INSERT INTO t1 (name) VALUES ('dog');
|
||||||
|
UPDATE t1 SET id=-1 WHERE id=1;
|
||||||
|
INSERT INTO t1 (name) VALUES ('cat');
|
||||||
|
SELECT * FROM t1;
|
||||||
|
id name
|
||||||
|
-1 dog
|
||||||
|
2 cat
|
||||||
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# End of 5.5 tests
|
||||||
|
#
|
||||||
|
@ -33,3 +33,28 @@ select _rowid,t1._rowid,skey,sval from t1;
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # Start of 5.5 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
id TINYINT NOT NULL AUTO_INCREMENT,
|
||||||
|
name CHAR(30) NOT NULL,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) ENGINE=MEMORY;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
INSERT INTO t1 (name) VALUES ('dog');
|
||||||
|
UPDATE t1 SET id=-1 WHERE id=1;
|
||||||
|
INSERT INTO t1 (name) VALUES ('cat');
|
||||||
|
SELECT * FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # End of 5.5 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
15
mysql-test/suite/innodb/r/alter_partitioned_xa.result
Normal file
15
mysql-test/suite/innodb/r/alter_partitioned_xa.result
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#
|
||||||
|
# MDEV-14693 XA: Assertion `!clust_index->online_log' failed
|
||||||
|
# in rollback_inplace_alter_table
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB PARTITION BY HASH(a) PARTITIONS 2;
|
||||||
|
XA START 'xid';
|
||||||
|
INSERT INTO t1 VALUES (1,10);
|
||||||
|
CREATE DATABASE IF NOT EXISTS db;
|
||||||
|
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
|
||||||
|
SET innodb_lock_wait_timeout= 1, lock_wait_timeout= 2;
|
||||||
|
ALTER TABLE t1 FORCE;
|
||||||
|
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||||
|
XA END 'xid';
|
||||||
|
XA ROLLBACK 'xid';
|
||||||
|
DROP TABLE t1;
|
@ -859,3 +859,32 @@ DROP TABLE dest_db.t1;
|
|||||||
DROP TABLE source_db.t1;
|
DROP TABLE source_db.t1;
|
||||||
DROP DATABASE source_db;
|
DROP DATABASE source_db;
|
||||||
DROP DATABASE dest_db;
|
DROP DATABASE dest_db;
|
||||||
|
#
|
||||||
|
# BUG #26334149 MYSQL CRASHES WHEN FULL TEXT INDEXES IBD FILES ARE
|
||||||
|
# ORPHANED DUE TO RENAME TABLE
|
||||||
|
#
|
||||||
|
CREATE DATABASE db1;
|
||||||
|
USE db1;
|
||||||
|
CREATE TABLE notes (
|
||||||
|
id int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
body text COLLATE utf8_unicode_ci,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
|
||||||
|
COLLATE=utf8_unicode_ci
|
||||||
|
ROW_FORMAT=COMPRESSED;
|
||||||
|
Warnings:
|
||||||
|
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
|
||||||
|
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
|
||||||
|
ALTER TABLE notes ADD FULLTEXT INDEX index_ft_body (body(255));
|
||||||
|
Warnings:
|
||||||
|
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
|
||||||
|
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
|
||||||
|
Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
|
||||||
|
DROP INDEX index_ft_body ON notes;
|
||||||
|
Warnings:
|
||||||
|
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
|
||||||
|
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
|
||||||
|
CREATE DATABASE db2;
|
||||||
|
RENAME TABLE db1.notes TO db2.notes;
|
||||||
|
DROP DATABASE db1;
|
||||||
|
DROP DATABASE db2;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
DROP TABLE IF EXISTS t1;
|
|
||||||
SET GLOBAL innodb_file_per_table = 1;
|
SET GLOBAL innodb_file_per_table = 1;
|
||||||
SELECT @@innodb_file_per_table;
|
SELECT @@innodb_file_per_table;
|
||||||
@@innodb_file_per_table
|
@@innodb_file_per_table
|
||||||
@ -580,7 +579,7 @@ SELECT * FROM t1;
|
|||||||
ERROR HY000: Tablespace has been discarded for table 't1'
|
ERROR HY000: Tablespace has been discarded for table 't1'
|
||||||
restore: t1 .ibd and .cfg files
|
restore: t1 .ibd and .cfg files
|
||||||
ALTER TABLE t1 IMPORT TABLESPACE;
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x1 and the meta-data file has 0x0)
|
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x1 and the meta-data file has 0x0; .cfg file uses ROW_FORMAT=REDUNDANT)
|
||||||
unlink: t1.ibd
|
unlink: t1.ibd
|
||||||
unlink: t1.cfg
|
unlink: t1.cfg
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@ -592,7 +591,19 @@ SELECT * FROM t1;
|
|||||||
ERROR HY000: Tablespace has been discarded for table 't1'
|
ERROR HY000: Tablespace has been discarded for table 't1'
|
||||||
restore: t1 .ibd and .cfg files
|
restore: t1 .ibd and .cfg files
|
||||||
ALTER TABLE t1 IMPORT TABLESPACE;
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x21 and the meta-data file has 0x0)
|
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x21 and the meta-data file has 0x0; .cfg file uses ROW_FORMAT=REDUNDANT)
|
||||||
|
unlink: t1.ibd
|
||||||
|
unlink: t1.cfg
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||||
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
ERROR HY000: Tablespace has been discarded for table 't1'
|
||||||
|
restore: t1 .ibd and .cfg files
|
||||||
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
|
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x29 and the meta-data file has 0x0; .cfg file uses ROW_FORMAT=REDUNDANT)
|
||||||
unlink: t1.ibd
|
unlink: t1.ibd
|
||||||
unlink: t1.cfg
|
unlink: t1.cfg
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@ -766,7 +777,7 @@ SELECT * FROM t1;
|
|||||||
ERROR HY000: Tablespace has been discarded for table 't1'
|
ERROR HY000: Tablespace has been discarded for table 't1'
|
||||||
restore: t1 .ibd and .cfg files
|
restore: t1 .ibd and .cfg files
|
||||||
ALTER TABLE t1 IMPORT TABLESPACE;
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x0 and the meta-data file has 0x1)
|
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x0 and the meta-data file has 0x1; .cfg file uses ROW_FORMAT=COMPACT)
|
||||||
unlink: t1.ibd
|
unlink: t1.ibd
|
||||||
unlink: t1.cfg
|
unlink: t1.cfg
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@ -778,7 +789,19 @@ SELECT * FROM t1;
|
|||||||
ERROR HY000: Tablespace has been discarded for table 't1'
|
ERROR HY000: Tablespace has been discarded for table 't1'
|
||||||
restore: t1 .ibd and .cfg files
|
restore: t1 .ibd and .cfg files
|
||||||
ALTER TABLE t1 IMPORT TABLESPACE;
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x21 and the meta-data file has 0x1)
|
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)
|
||||||
|
unlink: t1.ibd
|
||||||
|
unlink: t1.cfg
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||||
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
ERROR HY000: Tablespace has been discarded for table 't1'
|
||||||
|
restore: t1 .ibd and .cfg files
|
||||||
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
|
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x29 and the meta-data file has 0x1; .cfg file uses ROW_FORMAT=COMPACT)
|
||||||
unlink: t1.ibd
|
unlink: t1.ibd
|
||||||
unlink: t1.cfg
|
unlink: t1.cfg
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@ -955,7 +978,7 @@ SELECT * FROM t1;
|
|||||||
ERROR HY000: Tablespace has been discarded for table 't1'
|
ERROR HY000: Tablespace has been discarded for table 't1'
|
||||||
restore: t1 .ibd and .cfg files
|
restore: t1 .ibd and .cfg files
|
||||||
ALTER TABLE t1 IMPORT TABLESPACE;
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x1 and the meta-data file has 0x21)
|
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x1 and the meta-data file has 0x21; .cfg file uses ROW_FORMAT=DYNAMIC)
|
||||||
unlink: t1.ibd
|
unlink: t1.ibd
|
||||||
unlink: t1.cfg
|
unlink: t1.cfg
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@ -967,7 +990,19 @@ SELECT * FROM t1;
|
|||||||
ERROR HY000: Tablespace has been discarded for table 't1'
|
ERROR HY000: Tablespace has been discarded for table 't1'
|
||||||
restore: t1 .ibd and .cfg files
|
restore: t1 .ibd and .cfg files
|
||||||
ALTER TABLE t1 IMPORT TABLESPACE;
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x0 and the meta-data file has 0x21)
|
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x0 and the meta-data file has 0x21; .cfg file uses ROW_FORMAT=DYNAMIC)
|
||||||
|
unlink: t1.ibd
|
||||||
|
unlink: t1.cfg
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||||
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
ERROR HY000: Tablespace has been discarded for table 't1'
|
||||||
|
restore: t1 .ibd and .cfg files
|
||||||
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
|
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x29 and the meta-data file has 0x21; .cfg file uses ROW_FORMAT=DYNAMIC)
|
||||||
unlink: t1.ibd
|
unlink: t1.ibd
|
||||||
unlink: t1.cfg
|
unlink: t1.cfg
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@ -1026,6 +1061,220 @@ c1 c2
|
|||||||
42 1
|
42 1
|
||||||
43 1
|
43 1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||||
|
INSERT INTO t1(c2) VALUES(1);
|
||||||
|
INSERT INTO t1(c2) SELECT c2 FROM t1;
|
||||||
|
INSERT INTO t1(c2) SELECT c2 FROM t1;
|
||||||
|
INSERT INTO t1(c2) SELECT c2 FROM t1;
|
||||||
|
INSERT INTO t1(c2) SELECT c2 FROM t1;
|
||||||
|
INSERT INTO t1(c2) SELECT c2 FROM t1;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`c2` int(11) DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`c1`),
|
||||||
|
KEY `idx` (`c2`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
|
||||||
|
SELECT * FROM t1;
|
||||||
|
c1 c2
|
||||||
|
1 1
|
||||||
|
2 1
|
||||||
|
3 1
|
||||||
|
4 1
|
||||||
|
6 1
|
||||||
|
7 1
|
||||||
|
8 1
|
||||||
|
9 1
|
||||||
|
13 1
|
||||||
|
14 1
|
||||||
|
15 1
|
||||||
|
16 1
|
||||||
|
17 1
|
||||||
|
18 1
|
||||||
|
19 1
|
||||||
|
20 1
|
||||||
|
28 1
|
||||||
|
29 1
|
||||||
|
30 1
|
||||||
|
31 1
|
||||||
|
32 1
|
||||||
|
33 1
|
||||||
|
34 1
|
||||||
|
35 1
|
||||||
|
36 1
|
||||||
|
37 1
|
||||||
|
38 1
|
||||||
|
39 1
|
||||||
|
40 1
|
||||||
|
41 1
|
||||||
|
42 1
|
||||||
|
43 1
|
||||||
|
FLUSH TABLES t1 FOR EXPORT;
|
||||||
|
backup: t1
|
||||||
|
UNLOCK TABLES;
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||||
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
ERROR HY000: Tablespace has been discarded for table 't1'
|
||||||
|
restore: t1 .ibd and .cfg files
|
||||||
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
|
CHECK TABLE t1;
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.t1 check status OK
|
||||||
|
unlink: t1.cfg
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`c2` int(11) DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`c1`),
|
||||||
|
KEY `idx` (`c2`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
|
||||||
|
SELECT * FROM t1;
|
||||||
|
c1 c2
|
||||||
|
1 1
|
||||||
|
2 1
|
||||||
|
3 1
|
||||||
|
4 1
|
||||||
|
6 1
|
||||||
|
7 1
|
||||||
|
8 1
|
||||||
|
9 1
|
||||||
|
13 1
|
||||||
|
14 1
|
||||||
|
15 1
|
||||||
|
16 1
|
||||||
|
17 1
|
||||||
|
18 1
|
||||||
|
19 1
|
||||||
|
20 1
|
||||||
|
28 1
|
||||||
|
29 1
|
||||||
|
30 1
|
||||||
|
31 1
|
||||||
|
32 1
|
||||||
|
33 1
|
||||||
|
34 1
|
||||||
|
35 1
|
||||||
|
36 1
|
||||||
|
37 1
|
||||||
|
38 1
|
||||||
|
39 1
|
||||||
|
40 1
|
||||||
|
41 1
|
||||||
|
42 1
|
||||||
|
43 1
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
|
||||||
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
ERROR HY000: Tablespace has been discarded for table 't1'
|
||||||
|
restore: t1 .ibd and .cfg files
|
||||||
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
|
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x0 and the meta-data file has 0x29; .cfg file uses ROW_FORMAT=COMPRESSED)
|
||||||
|
unlink: t1.ibd
|
||||||
|
unlink: t1.cfg
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPACT;
|
||||||
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
ERROR HY000: Tablespace has been discarded for table 't1'
|
||||||
|
restore: t1 .ibd and .cfg files
|
||||||
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
|
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x1 and the meta-data file has 0x29; .cfg file uses ROW_FORMAT=COMPRESSED)
|
||||||
|
unlink: t1.ibd
|
||||||
|
unlink: t1.cfg
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||||
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
ERROR HY000: Tablespace has been discarded for table 't1'
|
||||||
|
restore: t1 .ibd and .cfg files
|
||||||
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
|
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x21 and the meta-data file has 0x29; .cfg file uses ROW_FORMAT=COMPRESSED)
|
||||||
|
unlink: t1.ibd
|
||||||
|
unlink: t1.cfg
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB
|
||||||
|
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
|
||||||
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
ERROR HY000: Tablespace has been discarded for table 't1'
|
||||||
|
restore: t1 .ibd and .cfg files
|
||||||
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
|
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x23 and the meta-data file has 0x29; .cfg file uses ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8)
|
||||||
|
unlink: t1.ibd
|
||||||
|
unlink: t1.cfg
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||||
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
ERROR HY000: Tablespace has been discarded for table 't1'
|
||||||
|
restore: t1 .ibd and .cfg files
|
||||||
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
|
CHECK TABLE t1;
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.t1 check status OK
|
||||||
|
unlink: t1.cfg
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`c2` int(11) DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`c1`),
|
||||||
|
KEY `idx` (`c2`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
|
||||||
|
SELECT * FROM t1;
|
||||||
|
c1 c2
|
||||||
|
1 1
|
||||||
|
2 1
|
||||||
|
3 1
|
||||||
|
4 1
|
||||||
|
6 1
|
||||||
|
7 1
|
||||||
|
8 1
|
||||||
|
9 1
|
||||||
|
13 1
|
||||||
|
14 1
|
||||||
|
15 1
|
||||||
|
16 1
|
||||||
|
17 1
|
||||||
|
18 1
|
||||||
|
19 1
|
||||||
|
20 1
|
||||||
|
28 1
|
||||||
|
29 1
|
||||||
|
30 1
|
||||||
|
31 1
|
||||||
|
32 1
|
||||||
|
33 1
|
||||||
|
34 1
|
||||||
|
35 1
|
||||||
|
36 1
|
||||||
|
37 1
|
||||||
|
38 1
|
||||||
|
39 1
|
||||||
|
40 1
|
||||||
|
41 1
|
||||||
|
42 1
|
||||||
|
43 1
|
||||||
|
DROP TABLE t1;
|
||||||
call mtr.add_suppression("Got error -1 when reading table '.*'");
|
call mtr.add_suppression("Got error -1 when reading table '.*'");
|
||||||
call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'.*");
|
call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'.*");
|
||||||
call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded");
|
call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded");
|
||||||
|
@ -16,9 +16,3 @@ tmp CREATE TABLE `tmp` (
|
|||||||
`NULL` binary(0) DEFAULT NULL
|
`NULL` binary(0) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||||
DROP TABLE tmp;
|
DROP TABLE tmp;
|
||||||
CREATE TABLE t1 (a VARCHAR(3)) ENGINE=InnoDB;
|
|
||||||
INSERT INTO t1 VALUES ('foo'),('bar');
|
|
||||||
FLUSH TABLES;
|
|
||||||
CREATE TEMPORARY TABLE tmp ENGINE=InnoDB AS SELECT VALUES(a) FROM t1;
|
|
||||||
ERROR HY000: Can't create table `test`.`tmp` (errno: -1 "Internal error < 0 (Not system error)")
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
5
mysql-test/suite/innodb/r/rename_table.result
Normal file
5
mysql-test/suite/innodb/r/rename_table.result
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
call mtr.add_suppression("InnoDB: (Operating system error|The error means|Cannot rename file)");
|
||||||
|
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||||
|
RENAME TABLE t1 TO non_existing_db.t1;
|
||||||
|
ERROR HY000: Error on rename of '**path-to-t1**' to '**path-to-non-existing-db-t1**' (errno: -1 "Internal error < 0 (Not system error)")
|
||||||
|
DROP TABLE t1;
|
31
mysql-test/suite/innodb/t/alter_partitioned_xa.test
Normal file
31
mysql-test/suite/innodb/t/alter_partitioned_xa.test
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
--source include/have_innodb.inc
|
||||||
|
--source include/have_partition.inc
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-14693 XA: Assertion `!clust_index->online_log' failed
|
||||||
|
--echo # in rollback_inplace_alter_table
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
# A bug in meta-data locking (MDL) for XA transactions causes
|
||||||
|
# a bug in InnoDB error handling for ALTER TABLE to be triggered.
|
||||||
|
CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB PARTITION BY HASH(a) PARTITIONS 2;
|
||||||
|
XA START 'xid';
|
||||||
|
INSERT INTO t1 VALUES (1,10);
|
||||||
|
# XA bug: The following releases the MDL on t1!
|
||||||
|
--error ER_XAER_RMFAIL
|
||||||
|
CREATE DATABASE IF NOT EXISTS db;
|
||||||
|
|
||||||
|
--connect (con1,localhost,root,,test)
|
||||||
|
SET innodb_lock_wait_timeout= 1, lock_wait_timeout= 2;
|
||||||
|
# Here, innodb_lock_wait_timeout would be exceeded, causing the operation
|
||||||
|
# to roll back when InnoDB is attempting to commit.
|
||||||
|
# (Instead, lock_wait_timeout should be exceeded!)
|
||||||
|
--error ER_LOCK_WAIT_TIMEOUT
|
||||||
|
ALTER TABLE t1 FORCE;
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
--disconnect con1
|
||||||
|
--connection default
|
||||||
|
XA END 'xid';
|
||||||
|
XA ROLLBACK 'xid';
|
||||||
|
DROP TABLE t1;
|
@ -481,3 +481,24 @@ eval ALTER TABLE $source_db.t1 DROP INDEX index2, algorithm=inplace;
|
|||||||
eval DROP TABLE $source_db.t1;
|
eval DROP TABLE $source_db.t1;
|
||||||
eval DROP DATABASE $source_db;
|
eval DROP DATABASE $source_db;
|
||||||
eval DROP DATABASE $dest_db;
|
eval DROP DATABASE $dest_db;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # BUG #26334149 MYSQL CRASHES WHEN FULL TEXT INDEXES IBD FILES ARE
|
||||||
|
--echo # ORPHANED DUE TO RENAME TABLE
|
||||||
|
--echo #
|
||||||
|
CREATE DATABASE db1; USE db1;
|
||||||
|
CREATE TABLE notes (
|
||||||
|
id int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
body text COLLATE utf8_unicode_ci,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
|
||||||
|
COLLATE=utf8_unicode_ci
|
||||||
|
ROW_FORMAT=COMPRESSED;
|
||||||
|
|
||||||
|
ALTER TABLE notes ADD FULLTEXT INDEX index_ft_body (body(255));
|
||||||
|
DROP INDEX index_ft_body ON notes;
|
||||||
|
|
||||||
|
CREATE DATABASE db2;
|
||||||
|
RENAME TABLE db1.notes TO db2.notes;
|
||||||
|
DROP DATABASE db1;
|
||||||
|
DROP DATABASE db2;
|
||||||
|
@ -9,9 +9,10 @@
|
|||||||
|
|
||||||
|
|
||||||
# Ignore OS errors
|
# Ignore OS errors
|
||||||
call mtr.add_suppression("InnoDB: File ./test/t1*");
|
call mtr.add_suppression("InnoDB: File ./test/t1");
|
||||||
call mtr.add_suppression("InnoDB: Error number*");
|
call mtr.add_suppression("InnoDB: Error number");
|
||||||
call mtr.add_suppression("InnoDB: File ./test/t1#p#p1#sp#p1sp0.ibd: 'rename' returned OS error*");
|
call mtr.add_suppression("InnoDB: Cannot rename file '.*/test/t1#[Pp]#p1#[Ss][Pp]#p1sp0\\.ibd' to");
|
||||||
|
call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation.");
|
||||||
|
|
||||||
# MDEV-7046: MySQL#74480 - Failing assertion: os_file_status(newpath, &exists, &type)
|
# MDEV-7046: MySQL#74480 - Failing assertion: os_file_status(newpath, &exists, &type)
|
||||||
# after Operating system error number 36 in a file operation
|
# after Operating system error number 36 in a file operation
|
||||||
|
@ -3,10 +3,6 @@
|
|||||||
|
|
||||||
-- source include/have_innodb.inc
|
-- source include/have_innodb.inc
|
||||||
|
|
||||||
--disable_warnings
|
|
||||||
DROP TABLE IF EXISTS t1;
|
|
||||||
--enable_warnings
|
|
||||||
|
|
||||||
let $innodb_file_per_table = `SELECT @@innodb_file_per_table`;
|
let $innodb_file_per_table = `SELECT @@innodb_file_per_table`;
|
||||||
let $innodb_file_format = `SELECT @@innodb_file_format`;
|
let $innodb_file_format = `SELECT @@innodb_file_format`;
|
||||||
|
|
||||||
@ -481,7 +477,7 @@ SELECT * FROM t1;
|
|||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Row format tests [EXPORT REDUNDANT - IMPORT COMPACT & DYNAMIC]
|
# EXPORT ROW_FORMAT=REDUNDANT
|
||||||
#
|
#
|
||||||
CREATE TABLE t1(
|
CREATE TABLE t1(
|
||||||
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
@ -583,6 +579,29 @@ EOF
|
|||||||
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||||
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||||
|
--error ER_TABLESPACE_DISCARDED
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||||
|
ib_discard_tablespaces("test", "t1");
|
||||||
|
ib_restore_tablespaces("test", "t1");
|
||||||
|
EOF
|
||||||
|
|
||||||
|
--error ER_TABLE_SCHEMA_MISMATCH
|
||||||
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||||
|
ib_unlink_tablespace("test", "t1");
|
||||||
|
EOF
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
# This should be OK.
|
# This should be OK.
|
||||||
CREATE TABLE t1(
|
CREATE TABLE t1(
|
||||||
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
@ -611,7 +630,7 @@ SELECT * FROM t1;
|
|||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Row format tests [EXPORT COMPACT - IMPORT REDUNDANT & DYNAMIC]
|
# EXPORT ROW_FORMAT=COMPACT
|
||||||
#
|
#
|
||||||
CREATE TABLE t1(
|
CREATE TABLE t1(
|
||||||
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
@ -713,6 +732,29 @@ EOF
|
|||||||
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||||
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||||
|
--error ER_TABLESPACE_DISCARDED
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||||
|
ib_discard_tablespaces("test", "t1");
|
||||||
|
ib_restore_tablespaces("test", "t1");
|
||||||
|
EOF
|
||||||
|
|
||||||
|
--error ER_TABLE_SCHEMA_MISMATCH
|
||||||
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||||
|
ib_unlink_tablespace("test", "t1");
|
||||||
|
EOF
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
# This should be OK.
|
# This should be OK.
|
||||||
CREATE TABLE t1(
|
CREATE TABLE t1(
|
||||||
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
@ -742,7 +784,7 @@ SELECT * FROM t1;
|
|||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Row format tests [EXPORT DYNAMIC- IMPORT REDUNDANT & DYNAMIC]
|
# EXPORT ROW_FORMAT=DYNAMIC
|
||||||
#
|
#
|
||||||
CREATE TABLE t1(
|
CREATE TABLE t1(
|
||||||
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
@ -844,6 +886,29 @@ EOF
|
|||||||
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||||
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||||
|
--error ER_TABLESPACE_DISCARDED
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||||
|
ib_discard_tablespaces("test", "t1");
|
||||||
|
ib_restore_tablespaces("test", "t1");
|
||||||
|
EOF
|
||||||
|
|
||||||
|
--error ER_TABLE_SCHEMA_MISMATCH
|
||||||
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||||
|
ib_unlink_tablespace("test", "t1");
|
||||||
|
EOF
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
# This should be OK.
|
# This should be OK.
|
||||||
CREATE TABLE t1(
|
CREATE TABLE t1(
|
||||||
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
@ -872,6 +937,185 @@ SELECT * FROM t1;
|
|||||||
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# EXPORT ROW_FORMAT=COMPRESSED
|
||||||
|
#
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||||
|
|
||||||
|
INSERT INTO t1(c2) VALUES(1);
|
||||||
|
INSERT INTO t1(c2) SELECT c2 FROM t1;
|
||||||
|
INSERT INTO t1(c2) SELECT c2 FROM t1;
|
||||||
|
INSERT INTO t1(c2) SELECT c2 FROM t1;
|
||||||
|
INSERT INTO t1(c2) SELECT c2 FROM t1;
|
||||||
|
INSERT INTO t1(c2) SELECT c2 FROM t1;
|
||||||
|
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
FLUSH TABLES t1 FOR EXPORT;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||||
|
ib_backup_tablespaces("test", "t1");
|
||||||
|
EOF
|
||||||
|
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||||
|
|
||||||
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||||
|
--error ER_TABLESPACE_DISCARDED
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||||
|
ib_discard_tablespaces("test", "t1");
|
||||||
|
ib_restore_tablespaces("test", "t1");
|
||||||
|
EOF
|
||||||
|
|
||||||
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
|
CHECK TABLE t1;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||||
|
ib_cleanup("test", "t1");
|
||||||
|
EOF
|
||||||
|
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
|
||||||
|
|
||||||
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||||
|
--error ER_TABLESPACE_DISCARDED
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||||
|
ib_discard_tablespaces("test", "t1");
|
||||||
|
ib_restore_tablespaces("test", "t1");
|
||||||
|
EOF
|
||||||
|
|
||||||
|
--error ER_TABLE_SCHEMA_MISMATCH
|
||||||
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||||
|
ib_unlink_tablespace("test", "t1");
|
||||||
|
EOF
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPACT;
|
||||||
|
|
||||||
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||||
|
--error ER_TABLESPACE_DISCARDED
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||||
|
ib_discard_tablespaces("test", "t1");
|
||||||
|
ib_restore_tablespaces("test", "t1");
|
||||||
|
EOF
|
||||||
|
|
||||||
|
--error ER_TABLE_SCHEMA_MISMATCH
|
||||||
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||||
|
ib_unlink_tablespace("test", "t1");
|
||||||
|
EOF
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
|
||||||
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||||
|
--error ER_TABLESPACE_DISCARDED
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||||
|
ib_discard_tablespaces("test", "t1");
|
||||||
|
ib_restore_tablespaces("test", "t1");
|
||||||
|
EOF
|
||||||
|
|
||||||
|
--error ER_TABLE_SCHEMA_MISMATCH
|
||||||
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||||
|
ib_unlink_tablespace("test", "t1");
|
||||||
|
EOF
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB
|
||||||
|
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
|
||||||
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||||
|
--error ER_TABLESPACE_DISCARDED
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||||
|
ib_discard_tablespaces("test", "t1");
|
||||||
|
ib_restore_tablespaces("test", "t1");
|
||||||
|
EOF
|
||||||
|
|
||||||
|
--error ER_TABLE_SCHEMA_MISMATCH
|
||||||
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||||
|
ib_unlink_tablespace("test", "t1");
|
||||||
|
EOF
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
# This should be OK.
|
||||||
|
CREATE TABLE t1(
|
||||||
|
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
||||||
|
|
||||||
|
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||||
|
--error ER_TABLESPACE_DISCARDED
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||||
|
ib_discard_tablespaces("test", "t1");
|
||||||
|
ib_restore_tablespaces("test", "t1");
|
||||||
|
EOF
|
||||||
|
|
||||||
|
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||||
|
CHECK TABLE t1;
|
||||||
|
|
||||||
|
perl;
|
||||||
|
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||||
|
ib_cleanup("test", "t1");
|
||||||
|
EOF
|
||||||
|
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
call mtr.add_suppression("Got error -1 when reading table '.*'");
|
call mtr.add_suppression("Got error -1 when reading table '.*'");
|
||||||
call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'.*");
|
call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'.*");
|
||||||
call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded");
|
call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded");
|
||||||
|
@ -16,13 +16,3 @@ CREATE TABLE tmp ENGINE = INNODB
|
|||||||
AS SELECT COALESCE(NULL, NULL, NULL), GREATEST(NULL, NULL), NULL;
|
AS SELECT COALESCE(NULL, NULL, NULL), GREATEST(NULL, NULL), NULL;
|
||||||
SHOW CREATE TABLE tmp;
|
SHOW CREATE TABLE tmp;
|
||||||
DROP TABLE tmp;
|
DROP TABLE tmp;
|
||||||
|
|
||||||
# These 'create table' operations should fail because of
|
|
||||||
# using NULL datatype
|
|
||||||
|
|
||||||
CREATE TABLE t1 (a VARCHAR(3)) ENGINE=InnoDB;
|
|
||||||
INSERT INTO t1 VALUES ('foo'),('bar');
|
|
||||||
FLUSH TABLES;
|
|
||||||
--error 1005
|
|
||||||
CREATE TEMPORARY TABLE tmp ENGINE=InnoDB AS SELECT VALUES(a) FROM t1;
|
|
||||||
DROP TABLE t1;
|
|
||||||
|
11
mysql-test/suite/innodb/t/rename_table.test
Normal file
11
mysql-test/suite/innodb/t/rename_table.test
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--source include/have_innodb.inc
|
||||||
|
|
||||||
|
call mtr.add_suppression("InnoDB: (Operating system error|The error means|Cannot rename file)");
|
||||||
|
|
||||||
|
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||||
|
--replace_regex /\'.*t1\' to/'**path-to-t1**' to/ /to \'.*non.*t1\'/to '**path-to-non-existing-db-t1**'/
|
||||||
|
--error ER_ERROR_ON_RENAME
|
||||||
|
RENAME TABLE t1 TO non_existing_db.t1;
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
DROP TABLE t1;
|
@ -257,3 +257,37 @@ WHERE MATCH (title,body)
|
|||||||
AGAINST ('"more test proximity"' IN BOOLEAN MODE);
|
AGAINST ('"more test proximity"' IN BOOLEAN MODE);
|
||||||
id title body
|
id title body
|
||||||
drop table articles;
|
drop table articles;
|
||||||
|
#
|
||||||
|
# Bug #22679185 INVALID INNODB FTS DOC ID DURING INSERT
|
||||||
|
#
|
||||||
|
create table t1 (f1 int not null primary key, f2 varchar(100),
|
||||||
|
FTS_DOC_ID bigint(20) unsigned not null,
|
||||||
|
unique key `FTS_DOC_ID_INDEX` (`FTS_DOC_ID`),
|
||||||
|
fulltext key (f2))engine=innodb;
|
||||||
|
insert into t1 values(1, "This is the first record", 20000);
|
||||||
|
insert into t1 values(2, "This is the second record", 40000);
|
||||||
|
select FTS_DOC_ID from t1;
|
||||||
|
FTS_DOC_ID
|
||||||
|
20000
|
||||||
|
40000
|
||||||
|
drop table t1;
|
||||||
|
create table t1 (f1 int not null primary key, f2 varchar(100),
|
||||||
|
FTS_DOC_ID bigint(20) unsigned not null auto_increment,
|
||||||
|
unique key `FTS_DOC_ID_INDEX` (`FTS_DOC_ID`),
|
||||||
|
fulltext key (f2))engine=innodb;
|
||||||
|
set auto_increment_increment = 65535;
|
||||||
|
insert into t1(f1, f2) values(1, "This is the first record");
|
||||||
|
insert into t1(f1, f2) values(2, "This is the second record");
|
||||||
|
insert into t1(f1, f2) values(3, "This is the third record");
|
||||||
|
select FTS_DOC_ID from t1;
|
||||||
|
FTS_DOC_ID
|
||||||
|
1
|
||||||
|
65536
|
||||||
|
131071
|
||||||
|
drop table t1;
|
||||||
|
call mtr.add_suppression("\\[ERROR\\] InnoDB: Doc ID 20030101000000 is too big. Its difference with largest used Doc ID 0 cannot exceed or equal to 65535");
|
||||||
|
CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
|
||||||
|
title VARCHAR(200), FULLTEXT(title)) ENGINE=InnoDB;
|
||||||
|
INSERT INTO t1 VALUES (NULL, NULL), (20030101000000, 20030102000000);
|
||||||
|
ERROR HY000: Invalid InnoDB FTS Doc ID
|
||||||
|
DROP TABLE t1;
|
117
mysql-test/suite/innodb_fts/r/sync_ddl.result
Normal file
117
mysql-test/suite/innodb_fts/r/sync_ddl.result
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
CREATE TABLE t1 (
|
||||||
|
id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
|
||||||
|
value VARCHAR(1024)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
CREATE FULLTEXT INDEX idx1 ON t1(value);
|
||||||
|
Warnings:
|
||||||
|
Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
|
||||||
|
SET @save_debug = @@GLOBAL.debug_dbug;
|
||||||
|
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_sync_before_syncing,ib_trunc_sleep_before_fts_cache_clear';
|
||||||
|
INSERT INTO t1 (value) VALUES
|
||||||
|
('By default or with the IN NATURAL LANGUAGE MODE modifier')
|
||||||
|
;
|
||||||
|
TRUNCATE TABLE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET GLOBAL debug_dbug = @save_debug;
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
|
||||||
|
value VARCHAR(1024)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
CREATE FULLTEXT INDEX idx1 ON t1(value);
|
||||||
|
Warnings:
|
||||||
|
Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
|
||||||
|
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_write_words_before_select_index,ib_trunc_sleep_before_fts_cache_clear';
|
||||||
|
INSERT INTO t1 (value) VALUES
|
||||||
|
('By default or with the IN NATURAL LANGUAGE MODE modifier'),
|
||||||
|
('performs a natural language search for a string'),
|
||||||
|
('collection is a set of one or more columns included'),
|
||||||
|
('returns a relevance value; that is, a similarity measure'),
|
||||||
|
('and the text in that row in the columns named in'),
|
||||||
|
('By default, the search is performed in case-insensitive'),
|
||||||
|
('sensitive full-text search, use a binary collation '),
|
||||||
|
('example, a column that uses the latin1 character'),
|
||||||
|
('collation of latin1_bin to make it case sensitive')
|
||||||
|
;
|
||||||
|
TRUNCATE TABLE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET GLOBAL debug_dbug = @save_debug;
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
value VARCHAR(1024)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
CREATE FULLTEXT INDEX idx1 ON t1(value);
|
||||||
|
Warnings:
|
||||||
|
Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
|
||||||
|
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_msg_sync_sleep';
|
||||||
|
INSERT INTO t1 (value) VALUES
|
||||||
|
('By default or with the IN NATURAL LANGUAGE MODE modifier'),
|
||||||
|
('performs a natural language search for a string'),
|
||||||
|
('collection is a set of one or more columns included'),
|
||||||
|
('returns a relevance value; that is, a similarity measure'),
|
||||||
|
('and the text in that row in the columns named in'),
|
||||||
|
('By default, the search is performed in case-insensitive'),
|
||||||
|
('sensitive full-text search, use a binary collation '),
|
||||||
|
('example, a column that uses the latin1 character'),
|
||||||
|
('collation of latin1_bin to make it case sensitive')
|
||||||
|
;
|
||||||
|
DROP INDEX idx1 ON t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET GLOBAL debug_dbug = @save_debug;
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
value VARCHAR(1024)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
CREATE FULLTEXT INDEX idx1 ON t1(value);
|
||||||
|
Warnings:
|
||||||
|
Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
|
||||||
|
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_msg_sync_sleep';
|
||||||
|
INSERT INTO t1 (value) VALUES
|
||||||
|
('By default or with the IN NATURAL LANGUAGE MODE modifier'),
|
||||||
|
('performs a natural language search for a string'),
|
||||||
|
('collection is a set of one or more columns included'),
|
||||||
|
('returns a relevance value; that is, a similarity measure'),
|
||||||
|
('and the text in that row in the columns named in'),
|
||||||
|
('By default, the search is performed in case-insensitive'),
|
||||||
|
('sensitive full-text search, use a binary collation '),
|
||||||
|
('example, a column that uses the latin1 character'),
|
||||||
|
('collation of latin1_bin to make it case sensitive')
|
||||||
|
;
|
||||||
|
ALTER TABLE t1
|
||||||
|
DROP INDEX idx1,
|
||||||
|
ALGORITHM=INPLACE;
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET GLOBAL debug_dbug = @save_debug;
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
value VARCHAR(1024)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
CREATE FULLTEXT INDEX idx1 ON t1(value);
|
||||||
|
Warnings:
|
||||||
|
Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
|
||||||
|
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_msg_sync_sleep';
|
||||||
|
INSERT INTO t1 (value) VALUES
|
||||||
|
('example, a column that uses the latin1 character'),
|
||||||
|
('collation of latin1_bin to make it case sensitive')
|
||||||
|
;
|
||||||
|
ALTER TABLE t1
|
||||||
|
DROP INDEX idx1,
|
||||||
|
ALGORITHM=COPY;
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET GLOBAL debug_dbug = @save_debug;
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
id1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
value VARCHAR(1024)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
CREATE FULLTEXT INDEX idx1 ON t1(value);
|
||||||
|
Warnings:
|
||||||
|
Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
|
||||||
|
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_msg_sync_sleep';
|
||||||
|
INSERT INTO t1 (value) VALUES
|
||||||
|
('example, a column that uses the latin1 character'),
|
||||||
|
('collation of latin1_bin to make it case sensitive')
|
||||||
|
;
|
||||||
|
ALTER TABLE t1
|
||||||
|
DROP COLUMN id1,
|
||||||
|
ADD COLUMN id2 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
DROP INDEX idx1,
|
||||||
|
ADD FULLTEXT INDEX idx2(value),
|
||||||
|
ALGORITHM=INPLACE;
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET GLOBAL debug_dbug = @save_debug;
|
@ -2,11 +2,6 @@
|
|||||||
|
|
||||||
-- source include/have_innodb.inc
|
-- source include/have_innodb.inc
|
||||||
|
|
||||||
if (`select plugin_auth_version <= "5.6.10" from information_schema.plugins where plugin_name='innodb'`)
|
|
||||||
{
|
|
||||||
--skip Not fixed in InnoDB 5.6.10 or earlier
|
|
||||||
}
|
|
||||||
|
|
||||||
# Create FTS table
|
# Create FTS table
|
||||||
CREATE TABLE articles (
|
CREATE TABLE articles (
|
||||||
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
|
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
|
||||||
@ -226,3 +221,37 @@ SELECT * FROM articles
|
|||||||
AGAINST ('"more test proximity"' IN BOOLEAN MODE);
|
AGAINST ('"more test proximity"' IN BOOLEAN MODE);
|
||||||
|
|
||||||
drop table articles;
|
drop table articles;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # Bug #22679185 INVALID INNODB FTS DOC ID DURING INSERT
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
create table t1 (f1 int not null primary key, f2 varchar(100),
|
||||||
|
FTS_DOC_ID bigint(20) unsigned not null,
|
||||||
|
unique key `FTS_DOC_ID_INDEX` (`FTS_DOC_ID`),
|
||||||
|
fulltext key (f2))engine=innodb;
|
||||||
|
|
||||||
|
insert into t1 values(1, "This is the first record", 20000);
|
||||||
|
insert into t1 values(2, "This is the second record", 40000);
|
||||||
|
select FTS_DOC_ID from t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
|
||||||
|
create table t1 (f1 int not null primary key, f2 varchar(100),
|
||||||
|
FTS_DOC_ID bigint(20) unsigned not null auto_increment,
|
||||||
|
unique key `FTS_DOC_ID_INDEX` (`FTS_DOC_ID`),
|
||||||
|
fulltext key (f2))engine=innodb;
|
||||||
|
|
||||||
|
set auto_increment_increment = 65535;
|
||||||
|
insert into t1(f1, f2) values(1, "This is the first record");
|
||||||
|
insert into t1(f1, f2) values(2, "This is the second record");
|
||||||
|
insert into t1(f1, f2) values(3, "This is the third record");
|
||||||
|
select FTS_DOC_ID from t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
call mtr.add_suppression("\\[ERROR\\] InnoDB: Doc ID 20030101000000 is too big. Its difference with largest used Doc ID 0 cannot exceed or equal to 65535");
|
||||||
|
CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
|
||||||
|
title VARCHAR(200), FULLTEXT(title)) ENGINE=InnoDB;
|
||||||
|
--error 182
|
||||||
|
INSERT INTO t1 VALUES (NULL, NULL), (20030101000000, 20030102000000);
|
||||||
|
DROP TABLE t1;
|
177
mysql-test/suite/innodb_fts/t/sync_ddl.test
Normal file
177
mysql-test/suite/innodb_fts/t/sync_ddl.test
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
#
|
||||||
|
# BUG#27082268 FTS synchronization issues
|
||||||
|
#
|
||||||
|
|
||||||
|
--source include/have_innodb.inc
|
||||||
|
--source include/have_debug.inc
|
||||||
|
|
||||||
|
#--------------------------------------
|
||||||
|
# Check FTS_sync vs TRUNCATE (1)
|
||||||
|
#--------------------------------------
|
||||||
|
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
|
||||||
|
value VARCHAR(1024)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
CREATE FULLTEXT INDEX idx1 ON t1(value);
|
||||||
|
|
||||||
|
SET @save_debug = @@GLOBAL.debug_dbug;
|
||||||
|
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_sync_before_syncing,ib_trunc_sleep_before_fts_cache_clear';
|
||||||
|
|
||||||
|
INSERT INTO t1 (value) VALUES
|
||||||
|
('By default or with the IN NATURAL LANGUAGE MODE modifier')
|
||||||
|
;
|
||||||
|
|
||||||
|
TRUNCATE TABLE t1;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
SET GLOBAL debug_dbug = @save_debug;
|
||||||
|
|
||||||
|
#--------------------------------------
|
||||||
|
# Check FTS sync vs DROP INDEX (2)
|
||||||
|
#--------------------------------------
|
||||||
|
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
|
||||||
|
value VARCHAR(1024)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
CREATE FULLTEXT INDEX idx1 ON t1(value);
|
||||||
|
|
||||||
|
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_write_words_before_select_index,ib_trunc_sleep_before_fts_cache_clear';
|
||||||
|
|
||||||
|
INSERT INTO t1 (value) VALUES
|
||||||
|
('By default or with the IN NATURAL LANGUAGE MODE modifier'),
|
||||||
|
('performs a natural language search for a string'),
|
||||||
|
('collection is a set of one or more columns included'),
|
||||||
|
('returns a relevance value; that is, a similarity measure'),
|
||||||
|
('and the text in that row in the columns named in'),
|
||||||
|
('By default, the search is performed in case-insensitive'),
|
||||||
|
('sensitive full-text search, use a binary collation '),
|
||||||
|
('example, a column that uses the latin1 character'),
|
||||||
|
('collation of latin1_bin to make it case sensitive')
|
||||||
|
;
|
||||||
|
|
||||||
|
TRUNCATE TABLE t1;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
SET GLOBAL debug_dbug = @save_debug;
|
||||||
|
|
||||||
|
#--------------------------------------
|
||||||
|
# Check FTS sync vs DROP INDEX
|
||||||
|
#--------------------------------------
|
||||||
|
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
value VARCHAR(1024)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
CREATE FULLTEXT INDEX idx1 ON t1(value);
|
||||||
|
|
||||||
|
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_msg_sync_sleep';
|
||||||
|
|
||||||
|
INSERT INTO t1 (value) VALUES
|
||||||
|
('By default or with the IN NATURAL LANGUAGE MODE modifier'),
|
||||||
|
('performs a natural language search for a string'),
|
||||||
|
('collection is a set of one or more columns included'),
|
||||||
|
('returns a relevance value; that is, a similarity measure'),
|
||||||
|
('and the text in that row in the columns named in'),
|
||||||
|
('By default, the search is performed in case-insensitive'),
|
||||||
|
('sensitive full-text search, use a binary collation '),
|
||||||
|
('example, a column that uses the latin1 character'),
|
||||||
|
('collation of latin1_bin to make it case sensitive')
|
||||||
|
;
|
||||||
|
|
||||||
|
DROP INDEX idx1 ON t1;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
SET GLOBAL debug_dbug = @save_debug;
|
||||||
|
|
||||||
|
#--------------------------------------
|
||||||
|
# Check FTS sync vs ALTER TABLE DROP INDEX (INPLACE)
|
||||||
|
#--------------------------------------
|
||||||
|
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
value VARCHAR(1024)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
CREATE FULLTEXT INDEX idx1 ON t1(value);
|
||||||
|
|
||||||
|
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_msg_sync_sleep';
|
||||||
|
|
||||||
|
INSERT INTO t1 (value) VALUES
|
||||||
|
('By default or with the IN NATURAL LANGUAGE MODE modifier'),
|
||||||
|
('performs a natural language search for a string'),
|
||||||
|
('collection is a set of one or more columns included'),
|
||||||
|
('returns a relevance value; that is, a similarity measure'),
|
||||||
|
('and the text in that row in the columns named in'),
|
||||||
|
('By default, the search is performed in case-insensitive'),
|
||||||
|
('sensitive full-text search, use a binary collation '),
|
||||||
|
('example, a column that uses the latin1 character'),
|
||||||
|
('collation of latin1_bin to make it case sensitive')
|
||||||
|
;
|
||||||
|
|
||||||
|
ALTER TABLE t1
|
||||||
|
DROP INDEX idx1,
|
||||||
|
ALGORITHM=INPLACE;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
SET GLOBAL debug_dbug = @save_debug;
|
||||||
|
|
||||||
|
#--------------------------------------
|
||||||
|
# Check FTS sync vs ALTER TABLE DROP INDEX (COPY)
|
||||||
|
#--------------------------------------
|
||||||
|
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
value VARCHAR(1024)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
CREATE FULLTEXT INDEX idx1 ON t1(value);
|
||||||
|
|
||||||
|
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_msg_sync_sleep';
|
||||||
|
|
||||||
|
INSERT INTO t1 (value) VALUES
|
||||||
|
('example, a column that uses the latin1 character'),
|
||||||
|
('collation of latin1_bin to make it case sensitive')
|
||||||
|
;
|
||||||
|
|
||||||
|
ALTER TABLE t1
|
||||||
|
DROP INDEX idx1,
|
||||||
|
ALGORITHM=COPY;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
SET GLOBAL debug_dbug = @save_debug;
|
||||||
|
|
||||||
|
#--------------------------------------
|
||||||
|
# Check FTS sync vs ALTER TABLE (INPLACE, new cluster)
|
||||||
|
#--------------------------------------
|
||||||
|
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
id1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
value VARCHAR(1024)
|
||||||
|
) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
CREATE FULLTEXT INDEX idx1 ON t1(value);
|
||||||
|
|
||||||
|
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_msg_sync_sleep';
|
||||||
|
|
||||||
|
INSERT INTO t1 (value) VALUES
|
||||||
|
('example, a column that uses the latin1 character'),
|
||||||
|
('collation of latin1_bin to make it case sensitive')
|
||||||
|
;
|
||||||
|
|
||||||
|
ALTER TABLE t1
|
||||||
|
DROP COLUMN id1,
|
||||||
|
ADD COLUMN id2 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
|
DROP INDEX idx1,
|
||||||
|
ADD FULLTEXT INDEX idx2(value),
|
||||||
|
ALGORITHM=INPLACE;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
SET GLOBAL debug_dbug = @save_debug;
|
@ -31,3 +31,19 @@ pk i
|
|||||||
8 88
|
8 88
|
||||||
9 99
|
9 99
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (f INT) ENGINE=Aria transactional=1;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`f` int(11) DEFAULT NULL
|
||||||
|
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 TRANSACTIONAL=1
|
||||||
|
INSERT INTO t1 VALUES (1),(2);
|
||||||
|
ALTER TABLE t1 ORDER BY unknown_column;
|
||||||
|
ERROR 42S22: Unknown column 'unknown_column' in 'order clause'
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`f` int(11) DEFAULT NULL
|
||||||
|
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 TRANSACTIONAL=1
|
||||||
|
CREATE TABLE t2 SELECT * FROM t1;
|
||||||
|
DROP TABLE t1, t2;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user