From 67567f5c9aab1cd6400b581fa39a9cb41dc58265 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sun, 14 Oct 2018 12:28:46 +0200 Subject: [PATCH 01/26] - Implement the CHECK TABLE statement and accept REPAIR and ANALYZE modified: storage/connect/connect.cc modified: storage/connect/ha_connect.cc modified: storage/connect/ha_connect.h modified: storage/connect/tabjdbc.cpp modified: storage/connect/tabmysql.cpp modified: storage/connect/tabodbc.cpp - MDEV-17212: Test if NumResultCols is implemented by the data source modified: storage/connect/odbconn.cpp - Change error type in Optimize modified: storage/connect/ha_connect.cc - Update version date modified: storage/connect/ha_connect.cc - Fix truncating error messages on first unrecognized latin1 character modified: storage/connect/ha_connect.cc - Fix MDEV-17343 Reject multi-table UPDATE/DELETE commands that crash on some systems modified: storage/connect/ha_connect.cc modified: storage/connect/tabext.cpp - Try fix some failing tests modified: storage/connect/mysql-test/connect/r/jdbc.result modified: storage/connect/mysql-test/connect/r/jdbc_postgresql.result modified: storage/connect/mysql-test/connect/r/mysql_exec.result modified: storage/connect/mysql-test/connect/r/odbc_postgresql.result - Typo modified: storage/connect/global.h --- storage/connect/connect.cc | 2 +- storage/connect/global.h | 4 +- storage/connect/ha_connect.cc | 96 +++++++++++++++---- storage/connect/ha_connect.h | 6 +- .../connect/mysql-test/connect/r/jdbc.result | 13 +++ .../connect/r/jdbc_postgresql.result | 8 ++ .../mysql-test/connect/r/mysql_exec.result | 6 ++ .../connect/r/odbc_postgresql.result | 18 ++-- storage/connect/odbconn.cpp | 10 +- storage/connect/tabext.cpp | 6 ++ storage/connect/tabjdbc.cpp | 9 +- storage/connect/tabmysql.cpp | 11 ++- storage/connect/tabodbc.cpp | 13 ++- 13 files changed, 151 insertions(+), 51 deletions(-) diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc index 39123b18c59..21bca637eab 100644 --- a/storage/connect/connect.cc +++ b/storage/connect/connect.cc @@ -254,7 +254,7 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2, try { if (!c1) { - if (mode == MODE_INSERT) +// if (mode == MODE_INSERT) or CHECK TABLE // Allocate all column blocks for that table tdbp->ColDB(g, NULL, 0); diff --git a/storage/connect/global.h b/storage/connect/global.h index 472d09408c3..36e8a311124 100644 --- a/storage/connect/global.h +++ b/storage/connect/global.h @@ -1,7 +1,7 @@ /***********************************************************************/ /* GLOBAL.H: Declaration file used by all CONNECT implementations. */ /* (C) Copyright MariaDB Corporation Ab */ -/* Author Olivier Bertrand 1993-2017 */ +/* Author Olivier Bertrand 1993-2018 */ /***********************************************************************/ /***********************************************************************/ @@ -192,7 +192,7 @@ typedef struct _global { /* Global structure */ PACTIVITY Activityp; char Message[MAX_STR]; ulong More; /* Used by jsonudf */ - int Createas; /* To pass info to created table */ + int Createas; /* To pass multi to ext tables */ void *Xchk; /* indexes in create/alter */ short Alchecked; /* Checked for ALTER */ short Mrr; /* True when doing mrr */ diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 8811030e751..c9d8d34bd86 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -170,9 +170,9 @@ #define JSONMAX 10 // JSON Default max grp size extern "C" { - char version[]= "Version 1.06.0007 August 06, 2018"; + char version[]= "Version 1.06.0008 October 06, 2018"; #if defined(__WIN__) - char compver[]= "Version 1.06.0007 " __DATE__ " " __TIME__; + char compver[]= "Version 1.06.0008 " __DATE__ " " __TIME__; char slash= '\\'; #else // !__WIN__ char slash= '/'; @@ -3290,6 +3290,58 @@ ha_rows ha_connect::records() } // end of records +int ha_connect::check(THD* thd, HA_CHECK_OPT* check_opt) +{ + int rc = HA_ADMIN_OK; + PGLOBAL g = ((table && table->in_use) ? GetPlug(table->in_use, xp) : + (xp) ? xp->g : NULL); + DBUG_ENTER("ha_connect::check"); + + if (!g || !table || xmod != MODE_READ) + DBUG_RETURN(HA_ADMIN_INTERNAL_ERROR); + + // Do not close the table if it was opened yet (possible?) + if (IsOpened()) { + if (IsPartitioned() && CheckColumnList(g)) // map can have been changed + rc = HA_ADMIN_CORRUPT; + else if (tdbp->OpenDB(g)) // Rewind table + rc = HA_ADMIN_CORRUPT; + + } else if (xp->CheckQuery(valid_query_id)) { + tdbp = NULL; // Not valid anymore + + if (OpenTable(g, false)) + rc = HA_ADMIN_CORRUPT; + + } else // possible? + DBUG_RETURN(HA_ADMIN_INTERNAL_ERROR); + + if (rc == HA_ADMIN_OK) { + TABTYPE type = GetTypeID(GetStringOption("Type", "*")); + + if (IsFileType(type)) { + if (check_opt->flags & T_MEDIUM) { + // TO DO + do { + if ((rc = CntReadNext(g, tdbp)) == RC_FX) + break; + + } while (rc != RC_EF); + + rc = (rc == RC_EF) ? HA_ADMIN_OK : HA_ADMIN_CORRUPT; + } else if (check_opt->flags & T_EXTEND) { + // TO DO + } // endif's flags + + } // endif file type + + } else + PushWarning(g, thd, 1); + + DBUG_RETURN(rc); +} // end of check + + /** Return an error message specific to this handler. @@ -3309,7 +3361,8 @@ bool ha_connect::get_error_message(int error, String* buf) if (trace(1)) htrc("GEM(%d): %s\n", error, g->Message); - buf->append(g->Message); + buf->append(ErrConvString(g->Message, strlen(g->Message), + &my_charset_latin1).ptr()); } else buf->append("Cannot retrieve error message"); @@ -3424,7 +3477,7 @@ int ha_connect::optimize(THD* thd, HA_CHECK_OPT*) push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message); rc = 0; } else - rc = HA_ERR_INTERNAL_ERROR; + rc = HA_ERR_CRASHED_ON_USAGE; // Table must be repaired } // endif rc @@ -3440,6 +3493,9 @@ int ha_connect::optimize(THD* thd, HA_CHECK_OPT*) rc = HA_ERR_INTERNAL_ERROR; } // end catch + if (rc) + my_message(ER_WARN_DATA_OUT_OF_RANGE, g->Message, MYF(0)); + return rc; } // end of optimize @@ -4501,14 +4557,16 @@ MODE ha_connect::CheckMode(PGLOBAL g, THD *thd, // case SQLCOM_REPLACE_SELECT: // newmode= MODE_UPDATE; // To be checked // break; - case SQLCOM_DELETE: - case SQLCOM_DELETE_MULTI: + case SQLCOM_DELETE_MULTI: + *cras = true; + case SQLCOM_DELETE: case SQLCOM_TRUNCATE: newmode= MODE_DELETE; break; - case SQLCOM_UPDATE: case SQLCOM_UPDATE_MULTI: - newmode= MODE_UPDATE; + *cras = true; + case SQLCOM_UPDATE: + newmode= MODE_UPDATE; break; case SQLCOM_SELECT: case SQLCOM_OPTIMIZE: @@ -4533,8 +4591,10 @@ MODE ha_connect::CheckMode(PGLOBAL g, THD *thd, newmode= MODE_ANY; break; // } // endif partitioned - - default: + case SQLCOM_REPAIR: // TODO implement it + newmode = MODE_UPDATE; + break; + default: htrc("Unsupported sql_command=%d\n", thd_sql_command(thd)); strcpy(g->Message, "CONNECT Unsupported command"); my_message(ER_NOT_ALLOWED_COMMAND, g->Message, MYF(0)); @@ -4546,17 +4606,18 @@ MODE ha_connect::CheckMode(PGLOBAL g, THD *thd, switch (thd_sql_command(thd)) { case SQLCOM_CREATE_TABLE: *chk= true; - *cras= true; + break; + case SQLCOM_UPDATE_MULTI: + case SQLCOM_DELETE_MULTI: + *cras= true; case SQLCOM_INSERT: case SQLCOM_LOAD: case SQLCOM_INSERT_SELECT: // case SQLCOM_REPLACE: // case SQLCOM_REPLACE_SELECT: case SQLCOM_DELETE: - case SQLCOM_DELETE_MULTI: case SQLCOM_TRUNCATE: case SQLCOM_UPDATE: - case SQLCOM_UPDATE_MULTI: case SQLCOM_SELECT: case SQLCOM_OPTIMIZE: case SQLCOM_SET_OPTION: @@ -4584,8 +4645,9 @@ MODE ha_connect::CheckMode(PGLOBAL g, THD *thd, break; // } // endif partitioned - case SQLCOM_CHECK: // TODO implement it - case SQLCOM_END: // Met in procedures: IF(EXISTS(SELECT... + case SQLCOM_CHECK: // TODO implement it + case SQLCOM_ANALYZE: // TODO implement it + case SQLCOM_END: // Met in procedures: IF(EXISTS(SELECT... newmode= MODE_READ; break; default: @@ -4867,7 +4929,7 @@ int ha_connect::external_lock(THD *thd, int lock_type) #endif // 0 if (cras) - g->Createas= 1; // To tell created table to ignore FLAG + g->Createas= 1; // To tell external tables of a multi-table command if (trace(1)) { #if 0 @@ -7248,7 +7310,7 @@ maria_declare_plugin(connect) 0x0107, /* version number (1.05) */ NULL, /* status variables */ connect_system_variables, /* system variables */ - "1.06.0007", /* string version */ + "1.06.0008", /* string version */ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ } maria_declare_plugin_end; diff --git a/storage/connect/ha_connect.h b/storage/connect/ha_connect.h index 4c5bf5856cc..07b1c2d2e7d 100644 --- a/storage/connect/ha_connect.h +++ b/storage/connect/ha_connect.h @@ -347,11 +347,7 @@ PFIL CondFilter(PGLOBAL g, Item *cond); //PFIL CheckFilter(PGLOBAL g); /** admin commands - called from mysql_admin_table */ -virtual int check(THD* thd, HA_CHECK_OPT* check_opt) -{ - // TODO: implement it - return HA_ADMIN_OK; // Just to avoid error message with checktables -} // end of check +virtual int check(THD* thd, HA_CHECK_OPT* check_opt); /** Number of rows in table. It will only be called if diff --git a/storage/connect/mysql-test/connect/r/jdbc.result b/storage/connect/mysql-test/connect/r/jdbc.result index 12c8779f96d..0dbdf851860 100644 --- a/storage/connect/mysql-test/connect/r/jdbc.result +++ b/storage/connect/mysql-test/connect/r/jdbc.result @@ -236,24 +236,37 @@ WHEELFOR SALESMAN 10030.00 MARTIN ENGINEER 10000.00 DROP TABLE t1, connect.emp; CREATE TABLE t2 (command varchar(128) not null,number int(5) not null flag=1,message varchar(255) flag=2) ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='jdbc:mariadb://localhost:PORT/connect' OPTION_LIST='User=root,Execsrc=1'; +SELECT * FROM t2 WHERE command='drop table tx1'; command number message drop table tx1 0 Execute: java.sql.SQLSyntaxErrorException: (conn:24) Unknown table 'connect.tx1' +Warnings: +Warning 1105 Execute: java.sql.SQLSyntaxErrorException: (conn:24) Unknown table 'connect.tx1' SELECT * FROM t2 WHERE command = 'create table tx1 (a int not null, b char(32), c double(8,2))'; command number message create table tx1 (a int not null, b char(32), c double(8,2)) 0 Affected rows +Warnings: +Warning 1105 Affected rows SELECT * FROM t2 WHERE command in ('insert into tx1 values(1,''The number one'',456.12)',"insert into tx1(a,b) values(2,'The number two'),(3,'The number three')"); command number message insert into tx1 values(1,'The number one',456.12) 1 Affected rows insert into tx1(a,b) values(2,'The number two'),(3,'The number three') 2 Affected rows +Warnings: +Warning 1105 Affected rows SELECT * FROM t2 WHERE command='update tx1 set c = 3.1416 where a = 2'; command number message update tx1 set c = 3.1416 where a = 2 1 Affected rows +Warnings: +Warning 1105 Affected rows SELECT * FROM t2 WHERE command='select * from tx1'; command number message select * from tx1 3 Result set column number +Warnings: +Warning 1105 Result set column number SELECT * FROM t2 WHERE command='delete from tx1 where a = 2'; command number message delete from tx1 where a = 2 1 Affected rows +Warnings: +Warning 1105 Affected rows SELECT * FROM connect.tx1; a b c 1 The number one 456.12 diff --git a/storage/connect/mysql-test/connect/r/jdbc_postgresql.result b/storage/connect/mysql-test/connect/r/jdbc_postgresql.result index 7969672dd66..07cc3c465ea 100644 --- a/storage/connect/mysql-test/connect/r/jdbc_postgresql.result +++ b/storage/connect/mysql-test/connect/r/jdbc_postgresql.result @@ -9,12 +9,18 @@ OPTION_LIST='Execsrc=1'; SELECT * FROM t2 WHERE command='drop table employee'; command number message drop table employee 0 Execute: org.postgresql.util.PSQLException: ERREUR: la table « employee » n'existe pas +Warnings: +Warning 1105 Execute: org.postgresql.util.PSQLException: ERREUR: la table « employee » n'existe pas SELECT * FROM t2 WHERE command = 'create table employee (id int not null, name varchar(32), title char(16), salary decimal(8,2))'; command number message create table employee (id int not null, name varchar(32), title char(16), salary decimal(8,2)) 0 Affected rows +Warnings: +Warning 1105 Affected rows SELECT * FROM t2 WHERE command = "insert into employee values(4567,'Johnson', 'Engineer', 12560.50)"; command number message insert into employee values(4567,'Johnson', 'Engineer', 12560.50) 1 Affected rows +Warnings: +Warning 1105 Affected rows CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables CONNECTION='jdbc:postgresql://localhost/test?user=postgres&password=tinono' OPTION_LIST='Tabtype=TABLE,Maxres=10'; @@ -63,4 +69,6 @@ DROP SERVER 'postgresql'; SELECT * FROM t2 WHERE command='drop table employee'; command number message drop table employee 0 Affected rows +Warnings: +Warning 1105 Affected rows DROP TABLE t2; diff --git a/storage/connect/mysql-test/connect/r/mysql_exec.result b/storage/connect/mysql-test/connect/r/mysql_exec.result index c0400bc82e7..cc77240503b 100644 --- a/storage/connect/mysql-test/connect/r/mysql_exec.result +++ b/storage/connect/mysql-test/connect/r/mysql_exec.result @@ -35,6 +35,8 @@ insert ignore into t1(id) values(NULL) 1 1 Affected rows Warning 0 1364 Field 'msg' doesn't have a default value update t1 set msg = 'Four' where id = 4 0 1 Affected rows select * from t1 0 2 Result set columns +Warnings: +Warning 1105 Result set columns # # Checking Using Procedure # @@ -48,9 +50,13 @@ CALL p1('insert ignore into t1(id) values(NULL)'); command warnings number message insert ignore into t1(id) values(NULL) 1 1 Affected rows Warning 0 1364 Field 'msg' doesn't have a default value +Warnings: +Warning 1105 Affected rows CALL p1('update t1 set msg = "Five" where id = 5'); command warnings number message update t1 set msg = "Five" where id = 5 0 1 Affected rows +Warnings: +Warning 1105 Affected rows DROP PROCEDURE p1; DROP TABLE t1; connection slave; diff --git a/storage/connect/mysql-test/connect/r/odbc_postgresql.result b/storage/connect/mysql-test/connect/r/odbc_postgresql.result index 3426d23e29c..dc23dbdb990 100644 --- a/storage/connect/mysql-test/connect/r/odbc_postgresql.result +++ b/storage/connect/mysql-test/connect/r/odbc_postgresql.result @@ -99,9 +99,9 @@ Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Bu mtr public t1 a 4 int4 10 4 0 10 0 mtr public t2 a 4 int4 10 4 0 10 0 mtr public v1 a 4 int4 10 4 0 10 1 -mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0 -mtr schema1 t2 a 1 bpchar 10 60 NULL NULL 0 -mtr schema1 v1 a 1 bpchar 10 60 NULL NULL 1 +mtr schema1 t1 a 1 bpchar 10 40 NULL NULL 0 +mtr schema1 t2 a 1 bpchar 10 40 NULL NULL 0 +mtr schema1 v1 a 1 bpchar 10 40 NULL NULL 1 DROP TABLE t1; # All columns in the schemas "public" and "schema1" CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.%.%'; @@ -110,16 +110,16 @@ Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Bu mtr public t1 a 4 int4 10 4 0 10 0 mtr public t2 a 4 int4 10 4 0 10 0 mtr public v1 a 4 int4 10 4 0 10 1 -mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0 -mtr schema1 t2 a 1 bpchar 10 60 NULL NULL 0 -mtr schema1 v1 a 1 bpchar 10 60 NULL NULL 1 +mtr schema1 t1 a 1 bpchar 10 40 NULL NULL 0 +mtr schema1 t2 a 1 bpchar 10 40 NULL NULL 0 +mtr schema1 v1 a 1 bpchar 10 40 NULL NULL 1 DROP TABLE t1; # All tables "t1" in all schemas CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.%.t1'; SELECT * FROM t1 ORDER BY Table_Schema, Table_Name; Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks mtr public t1 a 4 int4 10 4 0 10 0 -mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0 +mtr schema1 t1 a 1 bpchar 10 40 NULL NULL 0 DROP TABLE t1; # Table "t1" in the schema "public" CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.public.t1'; @@ -131,14 +131,14 @@ DROP TABLE t1; CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.schema1.t1'; SELECT * FROM t1 ORDER BY Table_Schema, Table_Name; Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks -mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0 +mtr schema1 t1 a 1 bpchar 10 40 NULL NULL 0 DROP TABLE t1; # All tables "t1" in all schemas (Catalog name is ignored by PostgreSQL) CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='xxx.%.t1'; SELECT * FROM t1 ORDER BY Table_Schema, Table_Name; Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks mtr public t1 a 4 int4 10 4 0 10 0 -mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0 +mtr schema1 t1 a 1 bpchar 10 40 NULL NULL 0 DROP TABLE t1; # # Checking tables diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp index f7b1a43a95d..6687513fa6c 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -2354,11 +2354,11 @@ int ODBConn::GetCatInfo(CATPARM *cap) if (!Check(rc)) ThrowDBX(rc, fnc, hstmt); - rc = SQLNumResultCols(hstmt, &ncol); - - // n because we no more ignore the first column - if ((n = (UWORD)qrp->Nbcol) > (UWORD)ncol) - ThrowDBX(MSG(COL_NUM_MISM)); + // Some data source do not implement SQLNumResultCols + if (Check(SQLNumResultCols(hstmt, &ncol))) + // n because we no more ignore the first column + if ((n = (UWORD)qrp->Nbcol) > (UWORD)ncol) + ThrowDBX(MSG(COL_NUM_MISM)); // Unconditional to handle STRBLK's pval = (PVAL *)PlugSubAlloc(g, NULL, n * sizeof(PVAL)); diff --git a/storage/connect/tabext.cpp b/storage/connect/tabext.cpp index 139e4199ed9..f2d5eb0e69d 100644 --- a/storage/connect/tabext.cpp +++ b/storage/connect/tabext.cpp @@ -125,6 +125,12 @@ EXTDEF::EXTDEF(void) /***********************************************************************/ bool EXTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) { + if (g->Createas) { + strcpy(g->Message, + "Multiple-table UPDATE/DELETE commands are not supported"); + return true; + } // endif multi + Desc = NULL; Tabname = GetStringCatInfo(g, "Name", (Catfunc & (FNC_TABLE | FNC_COL)) ? NULL : Name); diff --git a/storage/connect/tabjdbc.cpp b/storage/connect/tabjdbc.cpp index 275b5edaeae..adb3fc4fb51 100644 --- a/storage/connect/tabjdbc.cpp +++ b/storage/connect/tabjdbc.cpp @@ -1157,8 +1157,9 @@ bool TDBXJDC::OpenDB(PGLOBAL g) /* Get the command to execute. */ /*********************************************************************/ if (!(Cmdlist = MakeCMD(g))) { - Jcp->Close(); - return true; + // Next lines commented out because of CHECK TABLE + //Jcp->Close(); + //return true; } // endif Query Rows = 1; @@ -1189,8 +1190,10 @@ int TDBXJDC::ReadDB(PGLOBAL g) Fpos++; // Used for progress info Cmdlist = (Nerr > Mxr) ? NULL : Cmdlist->Next; return RC_OK; - } else + } else { + PushWarning(g, this, 1); return RC_EF; + } // endif Cmdlist } // end of ReadDB diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp index 605b3822430..ceffafac02c 100644 --- a/storage/connect/tabmysql.cpp +++ b/storage/connect/tabmysql.cpp @@ -1587,8 +1587,9 @@ bool TDBMYEXC::OpenDB(PGLOBAL g) /* Get the command to execute. */ /*********************************************************************/ if (!(Cmdlist = MakeCMD(g))) { - Myc.Close(); - return true; + // Next lines commented out because of CHECK TABLE + //Myc.Close(); + //return true; } // endif Cmdlist return false; @@ -1647,8 +1648,10 @@ int TDBMYEXC::ReadDB(PGLOBAL g) ++N; return RC_OK; - } else - return RC_EF; + } else { + PushWarning(g, this, 1); + return RC_EF; + } // endif Cmdlist } // end of ReadDB diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp index f7bc3934fbd..fddfb0c0420 100644 --- a/storage/connect/tabodbc.cpp +++ b/storage/connect/tabodbc.cpp @@ -1249,9 +1249,10 @@ bool TDBXDBC::OpenDB(PGLOBAL g) /* Get the command to execute. */ /*********************************************************************/ if (!(Cmdlist = MakeCMD(g))) { - Ocp->Close(); - return true; - } // endif Query + // Next lines commented out because of CHECK TABLE + //Ocp->Close(); + //return true; + } // endif Cmdlist Rows = 1; return false; @@ -1274,8 +1275,10 @@ int TDBXDBC::ReadDB(PGLOBAL g) Fpos++; // Used for progress info Cmdlist = (Nerr > Mxr) ? NULL : Cmdlist->Next; return RC_OK; - } else - return RC_EF; + } else { + PushWarning(g, this, 1); + return RC_EF; + } // endif Cmdlist } // end of ReadDB From 6cecb10a2f8b6536bed78ab6d3791d8befc9d732 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Wed, 7 Nov 2018 09:25:12 +0100 Subject: [PATCH 02/26] MDEV-11167: InnoDB: Warning: using a partial-field key prefix in search, results in assertion failure or "Can't find record" error Fix ha_rnd_init() argument (we do not doing scan but use rnd_pos) --- mysql-test/r/partition_innodb.result | 26 ++++++++++++++++++++++++ mysql-test/t/partition_innodb.test | 30 ++++++++++++++++++++++++++++ sql/sql_update.cc | 2 +- 3 files changed, 57 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result index f863ec5522a..ee3525cb085 100644 --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@ -890,3 +890,29 @@ ERROR HY000: Table definition has changed, please retry transaction SELECT b FROM t1 WHERE b = 0; ERROR HY000: Table definition has changed, please retry transaction DROP TABLE t1; +# +# MDEV-11167: InnoDB: Warning: using a partial-field key prefix +# in search, results in assertion failure or "Can't find record" error +# +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +CREATE TABLE t2 (b INT, c INT, KEY(b)) ENGINE=InnoDB PARTITION BY HASH(c) PARTITIONS 2; +CREATE ALGORITHM = MERGE VIEW v AS SELECT a, b FROM t1 STRAIGHT_JOIN t2 WHERE b = 'foo' WITH CHECK OPTION; +INSERT INTO t1 VALUES (1),(2); +INSERT IGNORE INTO t2 VALUES (2,2),('three',3),(4,4); +Warnings: +Warning 1366 Incorrect integer value: 'three' for column 'b' at row 2 +UPDATE v SET a = NULL ORDER BY a, b; +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'foo' +DROP view v; +DROP TABLE t1, t2; +SET @save_isp=@@innodb_stats_persistent; +SET GLOBAL innodb_stats_persistent= ON; +CREATE TABLE t (f1 INT, f2 INT, KEY(f2)) ENGINE=InnoDB PARTITION BY HASH (f1) PARTITIONS 2; +INSERT IGNORE INTO t VALUES (NULL,0),(NULL,0),(0,21),(4,0),(1,8),(5,66); +CREATE ALGORITHM=MERGE VIEW v AS SELECT t1.* FROM t t1 JOIN t t2 WHERE t1.f1 < t2.f2 WITH LOCAL CHECK OPTION; +UPDATE v SET f2 = NULL; +ERROR HY000: CHECK OPTION failed 'test.v' +SET GLOBAL innodb_stats_persistent= @save_isp; +DROP view v; +DROP TABLE t; diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index f6faa4cb0e6..5dbe9f467fa 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -996,3 +996,33 @@ SELECT b FROM t1 WHERE b = 0; SELECT b FROM t1 WHERE b = 0; --disconnect con1 DROP TABLE t1; + +--echo # +--echo # MDEV-11167: InnoDB: Warning: using a partial-field key prefix +--echo # in search, results in assertion failure or "Can't find record" error +--echo # + +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +CREATE TABLE t2 (b INT, c INT, KEY(b)) ENGINE=InnoDB PARTITION BY HASH(c) PARTITIONS 2; +CREATE ALGORITHM = MERGE VIEW v AS SELECT a, b FROM t1 STRAIGHT_JOIN t2 WHERE b = 'foo' WITH CHECK OPTION; + +INSERT INTO t1 VALUES (1),(2); +INSERT IGNORE INTO t2 VALUES (2,2),('three',3),(4,4); +UPDATE v SET a = NULL ORDER BY a, b; + +DROP view v; +DROP TABLE t1, t2; + +SET @save_isp=@@innodb_stats_persistent; +SET GLOBAL innodb_stats_persistent= ON; + +CREATE TABLE t (f1 INT, f2 INT, KEY(f2)) ENGINE=InnoDB PARTITION BY HASH (f1) PARTITIONS 2; +INSERT IGNORE INTO t VALUES (NULL,0),(NULL,0),(0,21),(4,0),(1,8),(5,66); +CREATE ALGORITHM=MERGE VIEW v AS SELECT t1.* FROM t t1 JOIN t t2 WHERE t1.f1 < t2.f2 WITH LOCAL CHECK OPTION; +--error ER_VIEW_CHECK_FAILED +UPDATE v SET f2 = NULL; + +SET GLOBAL innodb_stats_persistent= @save_isp; +DROP view v; +DROP TABLE t; + diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 592e8158c0d..1972cc82454 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -2309,7 +2309,7 @@ int multi_update::do_updates() check_opt_it.rewind(); while(TABLE *tbl= check_opt_it++) { - if ((local_error= tbl->file->ha_rnd_init(1))) + if ((local_error= tbl->file->ha_rnd_init(0))) { err_table= tbl; goto err; From 3fbee66499624cf2340eaebcd230cbabf0dd97ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 8 Nov 2018 14:50:32 +0200 Subject: [PATCH 03/26] MDEV-17645 innodb.log_file_name_debug does not clean up after itself The test innodb.log_file_name_debug failed to ensure that the bogus redo log record that its debug injection emitted would be consumed by a redo log checkpoint before running a subsequent test, which could perform crash recovery. Add an extra shutdown to ensure that a redo log checkpoint is generated. In this way, the following will succeed: ./mtr --no-reorder innodb.log_file_name_debug innodb.read_only_recovery --- mysql-test/suite/innodb/t/innodb-index.test | 5 +++++ mysql-test/suite/innodb/t/log_file_name_debug.test | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test index 97014d84ca7..e575cff4774 100644 --- a/mysql-test/suite/innodb/t/innodb-index.test +++ b/mysql-test/suite/innodb/t/innodb-index.test @@ -1115,6 +1115,11 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED'); --move_file $MYSQLD_DATADIR/test/t0.ibd $MYSQLD_DATADIR/test/t1.ibd --source include/start_mysqld.inc +if ($have_debug) { +# Initiate shutdown in order to issue a redo log checkpoint and to discard +# the redo log record that was emitted due to '+d,fil_names_write_bogus'. +--source include/restart_mysqld.inc +} SELECT * FROM t1; SELECT * FROM t2; diff --git a/mysql-test/suite/innodb/t/log_file_name_debug.test b/mysql-test/suite/innodb/t/log_file_name_debug.test index 0aaf798e2b3..d85fbf08194 100644 --- a/mysql-test/suite/innodb/t/log_file_name_debug.test +++ b/mysql-test/suite/innodb/t/log_file_name_debug.test @@ -44,5 +44,7 @@ SELECT * FROM t1; --let $restart_parameters= --source include/restart_mysqld.inc +# Initiate shutdown in order to issue a redo log checkpoint and to discard +# the redo log record that was emitted due to '+d,fil_names_write_bogus'. +--source include/restart_mysqld.inc DROP TABLE t1; - From 2d7d19a3cd18f4bc2ac39ac61e99eb8f2ff933ca Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Thu, 8 Nov 2018 22:54:03 -0800 Subject: [PATCH 04/26] MDEV-17574 SIGSEGV or Assertion `producing_item != __null' in Item_direct_view_ref::derived_field_transformer_for_where upon updating a view The condition pushed into a materialized derived / view mast be adjusted for the new context: its column references must be substituted for references to the columns of the underlying tables if the condition is pushed into WHERE. The substitution is performed by the 'transform' method. If the materialized derived is used in a mergeable view then the references to the columns of the view are represented by Item_direct_view_ref objects. The transform method first processes the item wrapped in such an object and only after this it transforms the object itself. The transformation procedure of an Item_direct_view_ref object has to know whether the item it wraps has been substituted. If so the procedure does not have to do anything. In the code before this patch it was not possible for the transformation procedure used by an Item_direct_view_ref object to find out whether a substitution for the wrapped item had happened. --- mysql-test/r/derived_cond_pushdown.result | 93 +++++++++++++++++++++++ mysql-test/t/derived_cond_pushdown.test | 27 +++++++ sql/item.cc | 32 +++++++- sql/item.h | 1 + 4 files changed, 150 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/derived_cond_pushdown.result b/mysql-test/r/derived_cond_pushdown.result index f5bc72e91e7..14c8e4d5e8f 100644 --- a/mysql-test/r/derived_cond_pushdown.result +++ b/mysql-test/r/derived_cond_pushdown.result @@ -10387,4 +10387,97 @@ f 3 DROP VIEW v1; DROP TABLE t1; +# +# MDEV-17574: pushdown into derived from mergeable view +# used in multi-table UPDATE +# pushdown into materialized derived from mergeable view +# used in SELECT +# +CREATE TABLE t1 (f1 text, f2 int); +INSERT INTO t1 VALUES ('x',1), ('y',2); +CREATE VIEW v1 AS SELECT f2 FROM ( SELECT f2 FROM t1 ) AS t; +UPDATE v1, t1 SET t1.f1 = 'z' WHERE v1.f2 < 2 AND t1.f2 = v1.f2; +EXPLAIN FORMAT=JSON UPDATE v1, t1 SET t1.f1 = 'z' WHERE v1.f2 < 2 AND t1.f2 = v1.f2; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "t.f2 < 2", + "materialized": { + "query_block": { + "select_id": 3, + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "t1.f2 < 2" + } + } + } + }, + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "t1.f2 = t.f2" + } + } +} +SELECT * FROM t1; +f1 f2 +z 1 +y 2 +CREATE VIEW v2 AS SELECT f2 FROM ( SELECT DISTINCT f2 FROM t1 ) AS t; +SELECT * FROM v2, t1 WHERE v2.f2 < 2 AND t1.f2 = v2.f2; +f2 f1 f2 +1 z 1 +EXPLAIN FORMAT=JSON SELECT * FROM v2, t1 WHERE v2.f2 < 2 AND t1.f2 = v2.f2; +EXPLAIN +{ + "query_block": { + "select_id": 1, + "table": { + "table_name": "", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "t.f2 < 2", + "materialized": { + "query_block": { + "select_id": 3, + "temporary_table": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "t1.f2 < 2" + } + } + } + } + }, + "block-nl-join": { + "table": { + "table_name": "t1", + "access_type": "ALL", + "rows": 2, + "filtered": 100 + }, + "buffer_type": "flat", + "buffer_size": "256Kb", + "join_type": "BNL", + "attached_condition": "t1.f2 = t.f2" + } + } +} +DROP VIEW v1,v2; +DROP TABLE t1; # End of 10.2 tests diff --git a/mysql-test/t/derived_cond_pushdown.test b/mysql-test/t/derived_cond_pushdown.test index 46aa898c960..25cb29e13db 100644 --- a/mysql-test/t/derived_cond_pushdown.test +++ b/mysql-test/t/derived_cond_pushdown.test @@ -2075,4 +2075,31 @@ SELECT * FROM t1; DROP VIEW v1; DROP TABLE t1; +--echo # +--echo # MDEV-17574: pushdown into derived from mergeable view +--echo # used in multi-table UPDATE +--echo # pushdown into materialized derived from mergeable view +--echo # used in SELECT +--echo # + +CREATE TABLE t1 (f1 text, f2 int); +INSERT INTO t1 VALUES ('x',1), ('y',2); + +CREATE VIEW v1 AS SELECT f2 FROM ( SELECT f2 FROM t1 ) AS t; +let $q1 = +UPDATE v1, t1 SET t1.f1 = 'z' WHERE v1.f2 < 2 AND t1.f2 = v1.f2; +eval $q1; +eval EXPLAIN FORMAT=JSON $q1; + +SELECT * FROM t1; + +CREATE VIEW v2 AS SELECT f2 FROM ( SELECT DISTINCT f2 FROM t1 ) AS t; +let $q2 = +SELECT * FROM v2, t1 WHERE v2.f2 < 2 AND t1.f2 = v2.f2; +eval $q2; +eval EXPLAIN FORMAT=JSON $q2; + +DROP VIEW v1,v2; +DROP TABLE t1; + --echo # End of 10.2 tests diff --git a/sql/item.cc b/sql/item.cc index 2adec33491b..9ac1ed3947d 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -7143,13 +7143,21 @@ Item *Item_field::derived_field_transformer_for_having(THD *thd, uchar *arg) return this; if (!item_equal && used_tables() != tab_map) return this; - return get_field_item_for_having(thd, this, sel); + Item *item= get_field_item_for_having(thd, this, sel); + if (item) + item->marker|= SUBSTITUTION_FL; + return item; } Item *Item_direct_view_ref::derived_field_transformer_for_having(THD *thd, uchar *arg) { + if ((*ref)->marker & SUBSTITUTION_FL) + { + this->marker|= SUBSTITUTION_FL; + return this; + } st_select_lex *sel= (st_select_lex *)arg; table_map tab_map= sel->master_unit()->derived->table->map; if ((item_equal && !(item_equal->used_tables() & tab_map)) || @@ -7200,13 +7208,20 @@ Item *Item_field::derived_field_transformer_for_where(THD *thd, uchar *arg) st_select_lex *sel= (st_select_lex *)arg; Item *producing_item= find_producing_item(this, sel); if (producing_item) - return producing_item->build_clone(thd, thd->mem_root); + { + Item *producing_clone= producing_item->build_clone(thd, thd->mem_root); + if (producing_clone) + producing_clone->marker|= SUBSTITUTION_FL; + return producing_clone; + } return this; } Item *Item_direct_view_ref::derived_field_transformer_for_where(THD *thd, uchar *arg) { + if ((*ref)->marker & SUBSTITUTION_FL) + return (*ref); if (item_equal) { st_select_lex *sel= (st_select_lex *)arg; @@ -7258,7 +7273,13 @@ Item *Item_field::derived_grouping_field_transformer_for_where(THD *thd, st_select_lex *sel= (st_select_lex *)arg; Grouping_tmp_field *gr_field= find_matching_grouping_field(this, sel); if (gr_field) - return gr_field->producing_item->build_clone(thd, thd->mem_root); + { + Item *producing_clone= + gr_field->producing_item->build_clone(thd, thd->mem_root); + if (producing_clone) + producing_clone->marker|= SUBSTITUTION_FL; + return producing_clone; + } return this; } @@ -7267,6 +7288,11 @@ Item * Item_direct_view_ref::derived_grouping_field_transformer_for_where(THD *thd, uchar *arg) { + if ((*ref)->marker & SUBSTITUTION_FL) + { + this->marker|= SUBSTITUTION_FL; + return this; + } if (!item_equal) return this; st_select_lex *sel= (st_select_lex *)arg; diff --git a/sql/item.h b/sql/item.h index 8d02d981d38..3a64ea1a75d 100644 --- a/sql/item.h +++ b/sql/item.h @@ -147,6 +147,7 @@ bool mark_unsupported_function(const char *w1, const char *w2, #define NO_EXTRACTION_FL (1 << 6) #define FULL_EXTRACTION_FL (1 << 7) +#define SUBSTITUTION_FL (1 << 8) #define EXTRACTION_MASK (NO_EXTRACTION_FL | FULL_EXTRACTION_FL) class DTCollation { From 5cfb043d2919439fccfa350edd9a3fdb4aaf229b Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Fri, 9 Nov 2018 22:55:34 +0400 Subject: [PATCH 05/26] MDEV-16174 Assertion `0' failed in Type_handler_string_result::make_sort_key(uchar*, Item*, const SORT_FIELD_ATTR*, Sort_param*) maybe_null should be always set to TRUE in Item_func_json_array_append::fix_length_and_dec() --- mysql-test/r/func_json.result | 14 ++++++++++++++ mysql-test/t/func_json.test | 13 +++++++++++++ sql/item_jsonfunc.cc | 1 + 3 files changed, 28 insertions(+) diff --git a/mysql-test/r/func_json.result b/mysql-test/r/func_json.result index c828b2676b4..90458bcaa4e 100644 --- a/mysql-test/r/func_json.result +++ b/mysql-test/r/func_json.result @@ -810,3 +810,17 @@ SET @`json` := NULL, @`value` := NULL; SELECT JSON_MERGE('[1]', '[]'); JSON_MERGE('[1]', '[]') [1] +# +# MDEV-16174 Assertion `0' failed in Type_handler_string_result:: +# make_sort_key(uchar*, Item*, const SORT_FIELD_ATTR*, Sort_param*) +# +SET sql_mode=''; +CREATE TABLE t1 (fld varchar(16) NOT NULL); +CREATE TABLE t2 SELECT JSON_ARRAY_INSERT(fld, '$.[0]', '0') FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `JSON_ARRAY_INSERT(fld, '$.[0]', '0')` varchar(25) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1, t2; +SET sql_mode=default; diff --git a/mysql-test/t/func_json.test b/mysql-test/t/func_json.test index 1dc16419cfd..d266641e3d2 100644 --- a/mysql-test/t/func_json.test +++ b/mysql-test/t/func_json.test @@ -468,3 +468,16 @@ SET @`json` := NULL, @`value` := NULL; --echo # SELECT JSON_MERGE('[1]', '[]'); + +--echo # +--echo # MDEV-16174 Assertion `0' failed in Type_handler_string_result:: +--echo # make_sort_key(uchar*, Item*, const SORT_FIELD_ATTR*, Sort_param*) +--echo # + +SET sql_mode=''; +CREATE TABLE t1 (fld varchar(16) NOT NULL); +CREATE TABLE t2 SELECT JSON_ARRAY_INSERT(fld, '$.[0]', '0') FROM t1; +SHOW CREATE TABLE t2; +DROP TABLE t1, t2; +SET sql_mode=default; + diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index 60726050aca..27bc97f4c5e 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -1562,6 +1562,7 @@ bool Item_func_json_array_append::fix_length_and_dec() } fix_char_length_ulonglong(char_length); + maybe_null= 1; return FALSE; } From a12b8ac8e9636f8258bcb17a0845b9317d870fd9 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Fri, 9 Nov 2018 19:53:40 +0530 Subject: [PATCH 06/26] MDEV-12575: Server crash in AGGR_OP::put_record or in JOIN_CACHE::free or Invalid write in JOIN::make_aggr_tables_info During the optimize state of a query, we come know that the result set would atmost contain one row, then for such a query we don't need to compute GROUP BY, ORDER BY and DISTINCT. --- mysql-test/r/distinct.result | 20 ++++++++++++ mysql-test/r/group_by.result | 10 ++++++ mysql-test/r/win.result | 62 ++++++++++++++++++++++++++++++++++++ mysql-test/t/distinct.test | 18 +++++++++++ mysql-test/t/group_by.test | 12 +++++++ mysql-test/t/win.test | 56 ++++++++++++++++++++++++++++++++ sql/sql_select.cc | 12 +++++++ 7 files changed, 190 insertions(+) diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index e1bbf5adb79..850ce9a1965 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -1049,4 +1049,24 @@ b1+'0' b2+'0' b3+'0' b4+'0' b5+'0' b6 +'0' 1 0 0 1 0 1 0 1 0 0 1 0 DROP TABLE t1; +# +# MDEV-12575: Server crash in AGGR_OP::put_record or in JOIN_CACHE::free +# or Invalid write in JOIN::make_aggr_tables_info +# +CREATE TABLE t1 (pk INT PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2); +explain +( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) ) +UNION +( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL PRIMARY 4 NULL 2 Using index; Using temporary +2 UNION t1 index NULL PRIMARY 4 NULL 2 Using index; Using temporary +NULL UNION RESULT ALL NULL NULL NULL NULL NULL +( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) ) +UNION +( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) ); +1 +1 +drop table t1; End of 5.5 tests diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 9fee03877c5..9da6fa5ae8f 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -2832,3 +2832,13 @@ select distinct 1 from t1 group by a,b with rollup limit 1; 1 1 drop table t1; +CREATE TABLE t1 ( pk int, i1 int, v1 varchar(1)); +explain +SELECT 1 FROM t1 +GROUP BY REPEAT((BINARY pk), v1), AES_DECRYPT((@A := i1), 20852) WITH ROLLUP HAVING LOAD_FILE('a') ; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING +SELECT 1 FROM t1 +GROUP BY REPEAT((BINARY pk), v1), AES_DECRYPT((@A := i1), 20852) WITH ROLLUP HAVING LOAD_FILE('a') ; +1 +drop table t1; diff --git a/mysql-test/r/win.result b/mysql-test/r/win.result index 790b264fc09..c539ac4f252 100644 --- a/mysql-test/r/win.result +++ b/mysql-test/r/win.result @@ -3361,3 +3361,65 @@ Esben Tuning 31 68.7500 Kaolin Tuning 88 68.7500 Tatiana Tuning 83 68.7500 drop table t1; +# +# MDEV-12575: Server crash in AGGR_OP::put_record or in JOIN_CACHE::free +# or Invalid write in JOIN::make_aggr_tables_info +# +SELECT DISTINCT BIT_OR(100) OVER () FROM dual +GROUP BY LEFT('2018-08-24', 100) order by 1+2; +BIT_OR(100) OVER () +100 +CREATE TABLE t1 (i INT); +INSERT INTO t1 VALUES (1),(2); +SELECT * FROM ( +SELECT +ROW_NUMBER() OVER(), i, sum(i) +FROM t1 +WHERE 1=0 +limit 0 +) AS sq; +ROW_NUMBER() OVER() i sum(i) +SELECT * FROM ( +SELECT +ROW_NUMBER() OVER(), i, sum(i) +FROM t1 +WHERE 1=0 +GROUP BY i +) AS sq; +ROW_NUMBER() OVER() i sum(i) +drop table t1; +create table t1 (a int); +explain +select distinct 1, row_number() over (order by 1) from t1 where a=0 group by a with rollup; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +select distinct 1, row_number() over (order by 1) from t1 where a=0 group by a with rollup; +1 row_number() over (order by 1) +drop table t1; +explain +SELECT DISTINCT BIT_OR(100) OVER () FROM dual +GROUP BY LEFT('2018-08-24', 100) WITH ROLLUP +HAVING @A := 'qwerty'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING +SELECT DISTINCT BIT_OR(100) OVER () FROM dual +GROUP BY LEFT('2018-08-24', 100) WITH ROLLUP +HAVING @A := 'qwerty'; +BIT_OR(100) OVER () +explain +SELECT DISTINCT BIT_OR(100) OVER () FROM dual +GROUP BY LEFT('2018-08-24', 100) +HAVING @A := 'qwerty'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING +SELECT DISTINCT BIT_OR(100) OVER () FROM dual +GROUP BY LEFT('2018-08-24', 100) +HAVING @A := 'qwerty'; +BIT_OR(100) OVER () +create table t1 (a int); +explain +SELECT DISTINCT BIT_OR(100) OVER () FROM t1 +GROUP BY LEFT('2018-08-24', 100) having 1=1 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 +drop table t1; diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test index c11f8b501bc..d41340c29fd 100644 --- a/mysql-test/t/distinct.test +++ b/mysql-test/t/distinct.test @@ -798,4 +798,22 @@ CREATE TABLE t1 (b1 BIT, b2 BIT, b3 BIT, b4 BIT , b5 BIT, b6 BIT); INSERT INTO t1 VALUES (1,0,0,1,0,1),(0,1,0,0,1,0); SELECT DISTINCT b1+'0', b2+'0', b3+'0', b4+'0', b5+'0', b6 +'0' FROM t1; DROP TABLE t1; + +--echo # +--echo # MDEV-12575: Server crash in AGGR_OP::put_record or in JOIN_CACHE::free +--echo # or Invalid write in JOIN::make_aggr_tables_info +--echo # + +CREATE TABLE t1 (pk INT PRIMARY KEY); +INSERT INTO t1 VALUES (1),(2); +explain +( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) ) +UNION +( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) ); + +( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) ) +UNION +( SELECT DISTINCT 1 FROM t1 ORDER BY BENCHMARK(1, MIN(pk)) ); +drop table t1; + --echo End of 5.5 tests diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 275939df5c5..61be676bb11 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -1948,3 +1948,15 @@ insert into t1 values(-126,7),(1,1),(0,0),(-1,1),(351,65534); select distinct 1 from t1 group by a,b with rollup limit 1; drop table t1; +# +# MDEV-12575: Server crash in AGGR_OP::put_record or in JOIN_CACHE::free +# or Invalid write in JOIN::make_aggr_tables_info +# + +CREATE TABLE t1 ( pk int, i1 int, v1 varchar(1)); +explain +SELECT 1 FROM t1 +GROUP BY REPEAT((BINARY pk), v1), AES_DECRYPT((@A := i1), 20852) WITH ROLLUP HAVING LOAD_FILE('a') ; +SELECT 1 FROM t1 +GROUP BY REPEAT((BINARY pk), v1), AES_DECRYPT((@A := i1), 20852) WITH ROLLUP HAVING LOAD_FILE('a') ; +drop table t1; diff --git a/mysql-test/t/win.test b/mysql-test/t/win.test index e9c8ee05773..7dda2b6215f 100644 --- a/mysql-test/t/win.test +++ b/mysql-test/t/win.test @@ -2119,3 +2119,59 @@ SELECT name, test, score, FROM t1 ORDER BY test, name; drop table t1; + +--echo # +--echo # MDEV-12575: Server crash in AGGR_OP::put_record or in JOIN_CACHE::free +--echo # or Invalid write in JOIN::make_aggr_tables_info +--echo # + +SELECT DISTINCT BIT_OR(100) OVER () FROM dual +GROUP BY LEFT('2018-08-24', 100) order by 1+2; + +CREATE TABLE t1 (i INT); +INSERT INTO t1 VALUES (1),(2); + +SELECT * FROM ( + SELECT + ROW_NUMBER() OVER(), i, sum(i) + FROM t1 + WHERE 1=0 + limit 0 +) AS sq; + +SELECT * FROM ( + SELECT + ROW_NUMBER() OVER(), i, sum(i) + FROM t1 + WHERE 1=0 + GROUP BY i +) AS sq; +drop table t1; + +create table t1 (a int); +explain +select distinct 1, row_number() over (order by 1) from t1 where a=0 group by a with rollup; +select distinct 1, row_number() over (order by 1) from t1 where a=0 group by a with rollup; +drop table t1; + +explain +SELECT DISTINCT BIT_OR(100) OVER () FROM dual +GROUP BY LEFT('2018-08-24', 100) WITH ROLLUP +HAVING @A := 'qwerty'; +SELECT DISTINCT BIT_OR(100) OVER () FROM dual +GROUP BY LEFT('2018-08-24', 100) WITH ROLLUP +HAVING @A := 'qwerty'; + +explain +SELECT DISTINCT BIT_OR(100) OVER () FROM dual +GROUP BY LEFT('2018-08-24', 100) +HAVING @A := 'qwerty'; +SELECT DISTINCT BIT_OR(100) OVER () FROM dual +GROUP BY LEFT('2018-08-24', 100) +HAVING @A := 'qwerty'; + +create table t1 (a int); +explain +SELECT DISTINCT BIT_OR(100) OVER () FROM t1 +GROUP BY LEFT('2018-08-24', 100) having 1=1 limit 0; +drop table t1; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 0cdecf1bf2e..db3ed8a1aa9 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2245,6 +2245,18 @@ setup_subq_exit: if (!tables_list || !table_count) { choose_tableless_subquery_plan(); + + /* The output has atmost one row */ + if (group_list) + { + group_list= NULL; + group_optimized_away= 1; + rollup.state= ROLLUP::STATE_NONE; + } + order= NULL; + simple_order= TRUE; + select_distinct= FALSE; + if (select_lex->have_window_funcs()) { if (!(join_tab= (JOIN_TAB*) thd->alloc(sizeof(JOIN_TAB)))) From b290ef8c76e2d7dfbae7a85766694a6fd4648eac Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Mon, 12 Nov 2018 01:50:07 +0400 Subject: [PATCH 07/26] MDEV-17454 JSON_VALID( '{"a":1]' ) evaluates to 1. Produce syntax error when '{...]'. --- mysql-test/r/func_json.result | 6 ++++++ mysql-test/t/func_json.test | 6 ++++++ strings/json_lib.c | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/func_json.result b/mysql-test/r/func_json.result index 90458bcaa4e..74798b13e3a 100644 --- a/mysql-test/r/func_json.result +++ b/mysql-test/r/func_json.result @@ -824,3 +824,9 @@ t2 CREATE TABLE `t2` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1, t2; SET sql_mode=default; +# +# MDEV-17454 JSON_VALID( '{"a":1]' ) evaluates to 1 +# +select JSON_VALID( '{"a":1]' ); +JSON_VALID( '{"a":1]' ) +0 diff --git a/mysql-test/t/func_json.test b/mysql-test/t/func_json.test index d266641e3d2..43bd19801d5 100644 --- a/mysql-test/t/func_json.test +++ b/mysql-test/t/func_json.test @@ -481,3 +481,9 @@ SHOW CREATE TABLE t2; DROP TABLE t1, t2; SET sql_mode=default; +--echo # +--echo # MDEV-17454 JSON_VALID( '{"a":1]' ) evaluates to 1 +--echo # + +select JSON_VALID( '{"a":1]' ); + diff --git a/strings/json_lib.c b/strings/json_lib.c index 4f12cbb82b5..394517a4ab6 100644 --- a/strings/json_lib.c +++ b/strings/json_lib.c @@ -774,7 +774,7 @@ static json_state_handler json_actions[NR_JSON_STATES][NR_C_CLASSES]= syntax_error, syntax_error, syntax_error, syntax_error, syntax_error, syntax_error, syntax_error, syntax_error, not_json_chr, bad_chr}, {/*OBJ_CONT*/ - unexpected_eos, syntax_error, end_object, syntax_error, end_array, + unexpected_eos, syntax_error, end_object, syntax_error, syntax_error, syntax_error, next_key, syntax_error, syntax_error, syntax_error, syntax_error, syntax_error, syntax_error, not_json_chr, bad_chr}, {/*ARRAY_CONT*/ From 4b773ca2989218daf02df2d1cc502869e54dc1d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 12 Nov 2018 10:16:28 +0200 Subject: [PATCH 08/26] MDEV-13564 clean-up: Replace memset() with init() --- storage/innobase/handler/ha_innodb.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 638b8d73770..be91befcf1a 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -13455,7 +13455,7 @@ int ha_innobase::truncate() dict_table_t* ib_table = m_prebuilt->table; const time_t update_time = ib_table->update_time; const ulint stored_lock = m_prebuilt->stored_select_lock_type; - memset(&info, 0, sizeof info); + info.init(); update_create_info_from_table(&info, table); if (dict_table_is_temporary(ib_table)) { From 1bba3cc2e7f120f2645c98f3bc96821c938cb4e7 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 6 Nov 2018 11:37:15 +0100 Subject: [PATCH 09/26] C/C 3.0.7 --- libmariadb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmariadb b/libmariadb index 5d5c1ba5566..334964f0711 160000 --- a/libmariadb +++ b/libmariadb @@ -1 +1 @@ -Subproject commit 5d5c1ba55664f23cf474ff6278e467f85ada1a0f +Subproject commit 334964f0711c3fd027f634a239eee57bc912f7ff From 3f10cbf3e49a7e44429f69b9d74e74eefd8f97e4 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Sat, 19 May 2018 15:13:53 +0000 Subject: [PATCH 10/26] pipe and shared memory protocol should be statically compiled into C/C --- cmake/mariadb_connector_c.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/mariadb_connector_c.cmake b/cmake/mariadb_connector_c.cmake index fe2bcfa4a1f..c36087cb862 100644 --- a/cmake/mariadb_connector_c.cmake +++ b/cmake/mariadb_connector_c.cmake @@ -34,5 +34,9 @@ ENDIF() SET(PLUGIN_INSTALL_DIR ${INSTALL_PLUGINDIR}) SET(MARIADB_UNIX_ADDR ${MYSQL_UNIX_ADDR}) +SET(CLIENT_PLUGIN_PVIO_NPIPE STATIC) +SET(CLIENT_PLUGIN_PVIO_SHMEM STATIC) +SET(CLIENT_PLUGIN_PVIO_SOCKET STATIC) + MESSAGE("== Configuring MariaDB Connector/C") ADD_SUBDIRECTORY(libmariadb) From 4f9c44ed39af0b5531dfcc30d0037c1c71b8aaa6 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Sat, 19 May 2018 12:44:15 +0000 Subject: [PATCH 11/26] adjust MTR code after C/C changed the location of plugin libraries --- mysql-test/mysql-test-run.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index b317be5e017..f428f16940f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2591,7 +2591,7 @@ sub setup_vardir() { { for (<$bindir/storage/*$opt_vs_config/*.dll>, <$bindir/plugin/*$opt_vs_config/*.dll>, - <$bindir/libmariadb/plugins/*$opt_vs_config/*.dll>, + <$bindir/libmariadb$opt_vs_config/*.dll>, <$bindir/sql$opt_vs_config/*.dll>) { my $pname=basename($_); @@ -2612,6 +2612,7 @@ sub setup_vardir() { for (<$bindir/storage/*/*.so>, <$bindir/plugin/*/*.so>, <$bindir/libmariadb/plugins/*/*.so>, + <$bindir/libmariadb/*.so>, <$bindir/sql/*.so>) { my $pname=basename($_); From 85baa03c60d5e9da4890344f10fa0437337cb265 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 6 Nov 2018 21:18:49 +0100 Subject: [PATCH 12/26] update results after CONC-351 fix --- mysql-test/r/session_tracker_last_gtid.result | 6 ------ 1 file changed, 6 deletions(-) diff --git a/mysql-test/r/session_tracker_last_gtid.result b/mysql-test/r/session_tracker_last_gtid.result index deffeca1333..795d0aaa2a2 100644 --- a/mysql-test/r/session_tracker_last_gtid.result +++ b/mysql-test/r/session_tracker_last_gtid.result @@ -2,13 +2,7 @@ # MDEV-15477: SESSION_SYSVARS_TRACKER does not track last_gtid # SET gtid_seq_no=1000; --- Tracker : SESSION_TRACK_SCHEMA --- test - SET @@session.session_track_system_variables='last_gtid'; --- Tracker : SESSION_TRACK_SCHEMA --- test - create table t1 (a int) engine=innodb; -- Tracker : SESSION_TRACK_SYSTEM_VARIABLES -- last_gtid From 59b87e75d04f0ed75256724c78f7fd7af2f96e9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 12 Nov 2018 18:06:41 +0200 Subject: [PATCH 13/26] Fix a comment --- storage/innobase/trx/trx0purge.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index 825b9eab3a6..c20001c8df0 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -1076,7 +1076,7 @@ trx_purge_initiate_truncate( os_file_truncate(file->name, file->handle, os_offset_t(size) << srv_page_size_shift, true); - /* This is only executed by the srv_coordinator_thread. */ + /* This is only executed by the srv_purge_coordinator_thread. */ export_vars.innodb_undo_truncations++; /* TODO: PUNCH_HOLE the garbage (with write-ahead logging) */ From 32bebfeefb219aec22468a6eae30ffd4a778544d Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Mon, 12 Nov 2018 18:19:31 +0200 Subject: [PATCH 14/26] Updated list of unstable tests for 10.2.19 --- mysql-test/unstable-tests | 213 +++++++++++++++++++------------------- 1 file changed, 107 insertions(+), 106 deletions(-) diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests index 055196004d9..2e517228bfd 100644 --- a/mysql-test/unstable-tests +++ b/mysql-test/unstable-tests @@ -23,66 +23,58 @@ # ############################################################################## -# Based on 10.2 339edd462f519573b1c505fb99fdbfc3bc765b5a +# Based on 10.2 85baa03c60d5e9da4890344f10fa0437337cb265 +main.alter_table : Modified in 10.2.19 main.alter_table_trans : MDEV-12084 - timeout main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result main.auth_named_pipe : MDEV-14724 - System error 2 -main.bootstrap : Modified in 10.2.17 -main.check_constraint : Modified in 10.2.17 +main.auto_increment_ranges_innodb : Modified in 10.2.19 main.connect : MDEV-17282 - Wrong result main.connect2 : MDEV-13885 - Server crash main.constraints : Modified in 10.2.18 main.count_distinct2 : MDEV-11768 - timeout main.create_delayed : MDEV-10605 - failed with timeout -main.create_or_replace : Modified in 10.2.18 -main.create_replace_tmp : Added in 10.2.17 -main.cte_nonrecursive : Modified in 10.2.18 -main.cte_recursive : Modified in 10.2.18 -main.cte_recursive_not_embedded : Added in 10.2.17 -main.ctype_binary : Modified in 10.2.17 -main.ctype_eucjpms : Modified in 10.2.17 -main.ctype_euckr : Modified in 10.2.17 -main.ctype_gbk : Modified in 10.2.17 -main.ctype_latin1 : Modified in 10.2.17 -main.ctype_ucs : Modified in 10.2.17 -main.ctype_ujis : Modified in 10.2.17 +main.create_or_replace : Modified in 10.2.19 +main.cte_nonrecursive : Modified in 10.2.19 +main.cte_recursive : Modified in 10.2.19 +main.ctype_latin1 : Modified in 10.2.19 +main.ctype_uca : Modified in 10.2.19 +main.ctype_ucs : MDEV-17681 - Data too long for column main.ctype_upgrade : MDEV-16945 - Error upon mysql_upgrade -main.ctype_utf16le : Modified in 10.2.17 -main.ctype_utf16 : MDEV-10675: timeout or extra warnings; modified in 10.2.17 -main.ctype_utf32 : Modified in 10.2.17 -main.ctype_utf8 : Modified in 10.2.17 -main.ctype_utf8mb4 : Modified in 10.2.17 +main.ctype_utf16 : MDEV-10675: timeout or extra warnings main.debug_sync : MDEV-10607 - internal error -main.derived : Modified in 10.2.17 -main.derived_cond_pushdown : Modified in 10.2.18 -main.derived_opt : MDEV-11768 - timeout -main.distinct : MDEV-14194 - Crash +main.derived_cond_pushdown : Modified in 10.2.19 +main.derived_opt : MDEV-11768 - timeout; modified in 10.2.19 +main.distinct : MDEV-14194 - Crash; modified in 10.2.19 main.drop_bad_db_type : MDEV-15676 - Wrong result main.events_2 : MDEV-13277 - Crash main.events_bugs : MDEV-12892 - Crash main.events_restart : MDEV-12236 - Server shutdown problem main.events_slowlog : MDEV-12821 - Wrong result -main.flush : Modified in 10.2.18 +main.flush : Modified in 10.2.19 +main.func_concat : Modified in 10.2.19 main.func_isnull : Modified in 10.2.18 -main.func_json : Modified in 10.2.18 +main.func_json : Modified in 10.2.19 main.func_time : Modified in 10.2.18 main.gis : MDEV-13411 - wrong result on P8; modified in 10.2.18 main.gis-precise : Modified in 10.2.18 main.grant : Modified in 10.2.18 +main.group_by : Modified in 10.2.19 main.group_min_max : Modified in 10.2.18 main.host_cache_size_functionality : MDEV-10606 - sporadic failure on shutdown main.index_intersect_innodb : MDEV-10643 - failed with timeout main.index_merge_innodb : MDEV-7142 - Plan mismatch +main.index_merge_myisam : Modified in 10.2.19 main.innodb_mysql_lock : MDEV-7861 - Wrong result main.join : Modified in 10.2.18 -main.join_cache : Modified in 10.2.17 -main.join_outer : Modified in 10.2.17 main.kill-2 : MDEV-13257 - Wrong result main.kill_processlist-6619 : MDEV-10793 - Wrong result +main.lock : Modified in 10.2.19 +main.lock_multi : Modified in 10.2.19 main.log_slow : MDEV-13263 - Wrong result main.log_tables-big : MDEV-13408 - wrong result -main.max_statement_time : Modified in 10.2.17 +main.lowercase_fs_off : Modified in 10.2.19 main.mdev-504 : MDEV-15171 - warning main.mdev375 : MDEV-10607 - sporadic "can't connect" main.merge : MDEV-10607 - sporadic "can't connect" @@ -97,21 +89,19 @@ main.mysqld_option_err : MDEV-12747 - Timeout main.mysqlhotcopy_myisam : MDEV-10995 - Hang on debug main.mysqlslap : MDEV-11801 - timeout main.mysqltest : MDEV-9269 - fails on Alpha; MDEV-13887 - Wrong result -main.mysqltest_tracking_info : Added in 10.2.17 main.openssl_1 : MDEV-13492 - Unknown SSL error main.openssl_6975 : MDEV-17184 - Failures with OpenSSL 1.1.1 main.order_by_optimizer_innodb : MDEV-10683 - Wrong result +main.order_by_zerolength-4285 : Modified in 10.2.19 main.partition_debug_sync : MDEV-15669 - Deadlock found when trying to get lock +main.partition_explicit_prune : Modified in 10.2.19 main.partition_innodb_plugin : MDEV-12901 - Valgrind warnings main.ps : MDEV-11017 - Wrong result; modified in 10.2.18 main.query_cache : MDEV-16180 - Wrong result main.query_cache_debug : MDEV-15281 - Query cache is disabled main.range : Modified in 10.2.18 main.range_vs_index_merge_innodb : MDEV-15283 - Server has gone away -main.rename : Modified in 10.2.17 -main.reset_connection : Added in 10.2.17 main.selectivity : Modified in 10.2.18 -main.session_tracker_last_gtid : Added in 10.2.17 main.set_statement : MDEV-13183 - Wrong result main.shm : MDEV-12727 - Mismatch, ERROR 2013 main.show_explain : MDEV-10674 - Wrong result code @@ -127,22 +117,22 @@ main.ssl_timeout : MDEV-11244 - Crash main.stat_tables : Modified in 10.2.18 main.stat_tables_par : MDEV-13266 - Wrong result main.stat_tables_par_innodb : MDEV-14155 - Wrong rounding -main.statistics : Modified in 10.2.17 main.status : MDEV-13255 - Wrong result -main.subselect : Modified in 10.2.17 main.subselect_extra_no_semijoin : Modified in 10.2.18 main.subselect_innodb : MDEV-10614 - Sporadic wrong results -main.subselect_sj_mat : Modified in 10.2.17 -main.subselect_sj2_mat : Modified in 10.2.17 main.tc_heuristic_recover : MDEV-14189 - Wrong result main.type_blob : MDEV-15195 - Wrong result -main.type_datetime : MDEV-14322 - wrong result +main.type_datetime : Modified in 10.2.19 main.type_datetime_hires : MDEV-10687 - Timeout main.type_float : Modified in 10.2.18 -main.union : Modified in 10.2.17 +main.type_newdecimal : Modified in 10.2.19 +main.type_year : Modified in 10.2.19 main.userstat : MDEV-12904 - SSL errors -main.win : Modified in 10.2.18 +main.win : Modified in 10.2.19 main.win_lead_lag : Modified in 10.2.18 +main.win_percent_cume : Modified in 10.2.19 +main.win_rank : Modified in 10.2.19 +main.win_std : Modified in 10.2.19 main.xa : MDEV-11769 - lock wait timeout #---------------------------------------------------------------- @@ -156,17 +146,18 @@ archive-test_sql_discovery.discover : MDEV-16817 - Table marked as crashed #---------------------------------------------------------------- +auth_gssapi.basic : Modified in 10.2.19 + +#---------------------------------------------------------------- + binlog.binlog_commit_wait : MDEV-10150 - Mismatch -binlog.binlog_flush_binlogs_delete_domain : MDEV-14431 - Wrong exit code -binlog.binlog_incident : Modified in 10.1.36 +binlog.binlog_flush_binlogs_delete_domain : Modified in 10.2.19 binlog.binlog_killed : MDEV-12925 - Wrong result -binlog.binlog_tmp_table_row : Added in 10.2.17 binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint binlog.load_data_stm_view : MDEV-16948 - Wrong result #---------------------------------------------------------------- -binlog_encryption.binlog_incident : Modified in 10.1.36 binlog_encryption.binlog_xa_recover : MDEV-12908 - Extra checkpoint binlog_encryption.encrypted_master : MDEV-14201 - Extra warnings binlog_encryption.encrypted_master_switch_to_unencrypted : MDEV-14190 - Can't init tc log @@ -182,7 +173,7 @@ binlog_encryption.rpl_skip_replication : MDEV-13571 - Unexpected warning binlog_encryption.rpl_ssl : MDEV-14507 - Timeouts binlog_encryption.rpl_stm_relay_ign_space : MDEV-13278 - Wrong result (test assertion) binlog_encryption.rpl_sync : MDEV-13830 - Assertion failure -binlog_encryption.rpl_typeconv : MDEV-14362 - Lost connection to MySQL server during query +binlog_encryption.rpl_typeconv : MDEV-14362 - Lost connection to MySQL server during query; include file modified in 10.2.19 #---------------------------------------------------------------- @@ -201,7 +192,7 @@ encryption.innodb-checksum-algorithm : MDEV-12898 - Deadlock of thre encryption.innodb-compressed-blob : MDEV-14728 - Unable to get certificate encryption.innodb_encrypt_log : MDEV-13725 - Wrong result encryption.innodb_encryption : MDEV-15675 - Timeout -encryption.innodb-encryption-alter : MDEV-13566 - Lock wait timeout +encryption.innodb-encryption-alter : MDEV-13566 - Lock wait timeout; modified in 10.2.19 encryption.innodb_encryption_discard_import : MDEV-16116 - Wrong result encryption.innodb_encryption-page-compression : MDEV-12630 - crash or assertion failure encryption.innodb_encryption_row_compressed : MDEV-16113 - Crash @@ -252,31 +243,38 @@ galera_3nodes.* : Suite is not stable yet #---------------------------------------------------------------- +gcol.gcol_partition_innodb : Modified in 10.2.19 gcol.gcol_rollback : MDEV-16954 - Unknown storage engine 'InnoDB' -gcol.gcol_update : Include file modified in 10.2.17 gcol.innodb_virtual_basic : MDEV-16950 - Failing assertion -gcol.innodb_virtual_debug_purge : MDEV-16952 - Wrong result; modified in 10.2.17 -gcol.innodb_virtual_index : Include file modified in 10.2.17 +gcol.innodb_virtual_debug_purge : MDEV-16952 - Wrong result; modified in 10.2.19 +gcol.innodb_virtual_index : Modifed in 10.2.19 + +#---------------------------------------------------------------- + +heap.heap_btree : Modified in 10.2.19 #---------------------------------------------------------------- innodb.101_compatibility : MDEV-13891 - Wrong result -innodb.alter_copy : MDEV-16181 - Assertion failure -innodb.alter_crash : MDEV-16944 - The process cannot access the file -innodb.alter_kill : MDEV-16946 - Wrong result +innodb.alter_copy : MDEV-16181 - Assertion failure; modified in 10.2.19 +innodb.alter_crash : MDEV-16944 - The process cannot access the file; modified in 10.2.19 +innodb.alter_inplace_perfschema : Added in 10.2.19 +innodb.alter_kill : Modified in 10.2.19 +innodb.auto_increment_dup : Modified in 10.2.19 innodb.autoinc_persist : MDEV-15282 - Assertion failure innodb.binlog_consistent : MDEV-10618 - Server fails to start innodb.doublewrite : MDEV-12905 - Server crash +innodb.drop_table_background : Modified in 10.2.19 innodb.foreign-keys : Modified in 10.2.18 -innodb.foreign_key : Modified in 10.2.18 +innodb.foreign_key : Modified in 10.2.19 innodb.group_commit_crash : MDEV-14191 - InnoDB registration failed innodb.group_commit_crash_no_optimize_thread : MDEV-13830 - Assertion failure -innodb.index_merge_threshold : Include files modified in 10.2.17 innodb.innodb-32k-crash : MDEV-16953 - Corrupt log record found innodb.innodb-64k-crash : MDEV-13872 - Failure and crash on startup -innodb.innodb-alter-debug : MDEV-13182 - InnoDB: adjusting FSP_SPACE_FLAGS +innodb.innodb-alter : Modified in 10.2.19 +innodb.innodb-alter-debug : MDEV-13182 - InnoDB: adjusting FSP_SPACE_FLAGS; modified in 10.2.19 innodb.innodb-alter-table : MDEV-10619 - Testcase timeout -innodb.innodb-alter-tempfile : MDEV-15285 - Table already exists +innodb.innodb-alter-tempfile : MDEV-15285 - Table already exists; modified in 10.2.19 innodb.innodb-blob : MDEV-12053 - Client crash innodb.innodb_buffer_pool_resize_with_chunks : MDEV-16964 - Assertion failure innodb.innodb_bug14147491 : MDEV-11808 - Index is corrupt @@ -287,6 +285,7 @@ innodb.innodb_bulk_create_index_replication : MDEV-15273 - Slave failed to start innodb.innodb_defrag_stats_many_tables : MDEV-14198 - Table is full innodb.innodb-fk : MDEV-13832 - Assertion failure on shutdown innodb.innodb-get-fk : MDEV-13276 - Server crash +innodb.innodb-index : Modified in 10.2.19 innodb.innodb-index-online : MDEV-14809 - Cannot save statistics innodb.innodb_information_schema : MDEV-8851 - Wrong result innodb.innodb-lock : Modified in 10.2.18 @@ -297,55 +296,66 @@ innodb.innodb-page_compression_default : MDEV-13644 - Assertion failure innodb.innodb-page_compression_lzma : MDEV-14353 - Wrong result innodb.innodb-page_compression_zip : MDEV-10641 - mutex problem innodb.innodb_stats : MDEV-10682 - wrong result -innodb.innodb_stats_persistent : Include file modified in 10.2.17 innodb.innodb_stats_persistent_debug : MDEV-14801 - Operation failed innodb.innodb-table-online : MDEV-13894 - Wrong result innodb.innodb_sys_semaphore_waits : MDEV-10331 - Semaphore wait -innodb.innodb-wl5522 : Modified in 10.2.17 innodb.innodb-wl5522-debug : MDEV-14200 - Wrong errno innodb.innodb_zip_innochecksum2 : MDEV-13882 - Extra warnings innodb.innodb_zip_innochecksum3 : MDEV-14486 - Resource temporarily unavailable innodb.log_corruption : MDEV-13251 - Wrong result innodb.log_data_file_size : MDEV-14204 - Server failed to start innodb.log_file_name : MDEV-14193 - Exception -innodb.log_file_size : MDEV-15668 - Not found pattern +innodb.log_file_name_debug : Modified in 10.2.19 +innodb.log_file_size : MDEV-15668 - Not found pattern; modified in 10.2.19 innodb.monitor : MDEV-16179 - Wrong result -innodb.purge_secondary : MDEV-15681 - Wrong result; include file modified in 10.2.17 +innodb.purge_secondary : MDEV-15681 - Wrong result innodb.purge_thread_shutdown : MDEV-13792 - Wrong result innodb.read_only_recovery : MDEV-13886 - Server crash innodb.recovery_shutdown : MDEV-15671 - Checksum mismatch in datafile +innodb.rename_table_debug : Added in 10.2.19 innodb.row_format_redundant : MDEV-15192 - Trying to access missing tablespace innodb.table_definition_cache_debug : MDEV-14206 - Extra warning -innodb.table_flags : MDEV-13572 - Wrong result +innodb.table_flags : MDEV-13572 - Wrong result; modified in 10.2.19 innodb.temp_table_savepoint : MDEV-16182 - Wrong result -innodb.temporary_table : MDEV-13265 - Wrong result; modified in 10.2.17 -innodb.truncate_purge_debug : Include file modified in 10.2.17 +innodb.temporary_table : MDEV-13265 - Wrong result +innodb.truncate : Added in 10.2.19 +innodb.truncate_crash : Added in 10.2.19 +innodb.truncate_debug : Opt file added in 10.2.19 +innodb.truncate_foreign : Added in 10.2.19 +innodb.truncate_inject : Opt file added in 10.2.19 +innodb.truncate_missing : Added in 10.2.19 +innodb.truncate_purge_debug : Opt file added in 10.2.19 +innodb.truncate_restart : Opt file added in 10.2.19 innodb.update_time : MDEV-14804 - Wrong result -innodb.undo_log : Include file modified in 10.2.17 +innodb.undo_truncate : MDEV-17340 - Server hung; added in 10.2.19 +innodb.undo_truncate_recover : MDEV-17679 - MySQL server has gone away; added in 10.2.19 innodb.xa_recovery : MDEV-15279 - mysqld got exception -innodb_fts.fts_kill_query : Added in 10.2.17 +innodb_fts.crash_recovery : Modified in 10.2.19 +innodb_fts.fts_kill_query : Modified in 10.0.37 innodb_fts.innodb-fts-fic : MDEV-14154 - Assertion failure innodb_fts.innodb_fts_misc_debug : MDEV-14156 - Unexpected warning innodb_fts.innodb_fts_plugin : MDEV-13888 - Errors in server log innodb_fts.innodb_fts_stopword_charset : MDEV-13259 - Table crashed innodb_fts.sync : MDEV-14808 - Wrong result -innodb_fts.sync_ddl : Added in 10.2.17 -innodb_gis.create_spatial_index : Modified in 10.2.17 innodb_gis.kill_server : MDEV-16941 - Checksum mismatch -innodb_gis.rtree_compress : Include file modified in 10.2.17 -innodb_gis.rtree_concurrent_srch : MDEV-15284 - Wrong result with embedded -innodb_gis.rtree_purge : MDEV-15275 - Timeout; include file modified in 10.2.17 +innodb_gis.rtree_concurrent_srch : MDEV-15284 - Wrong result with embedded; modified in 10.2.19 +innodb_gis.rtree_purge : MDEV-15275 - Timeout innodb_gis.rtree_recovery : MDEV-15274 - Error on check innodb_gis.rtree_split : MDEV-14208 - Too many arguments -innodb_gis.rtree_undo : MDEV-14456 - Timeout in include file; include file modified in 10.2.17 +innodb_gis.rtree_undo : MDEV-14456 - Timeout in include file innodb_gis.types : MDEV-15679 - Table is marked as crashed innodb_zip.cmp_per_index : MDEV-14490 - Table is marked as crashed innodb_zip.innochecksum_3 : MDEV-13279 - Extra warnings +innodb_zip.restart : Opt file modified in 10.2.19 innodb_zip.wl6470_1 : MDEV-14240 - Assertion failure -innodb_zip.wl6501_1 : MDEV-10891 - Can't create UNIX socket +innodb_zip.wl6501_1 : MDEV-10891 - Can't create UNIX socket; opt file added in 10.2.19 +innodb_zip.wl6501_crash_3 : Opt file added in 10.2.19 +innodb_zip.wl6501_crash_4 : Opt file added in 10.2.19 +innodb_zip.wl6501_crash_5 : Opt file added in 10.2.19 +innodb_zip.wl6501_scale_1 : Opt file added in 10.2.19 innodb_zip.wl5522_debug_zip : MDEV-11600 - Operating system error number 2 innodb_zip.wl6501_scale_1 : MDEV-13254 - Timeout, MDEV-14104 - Error 192 @@ -353,6 +363,7 @@ innodb_zip.wl6501_scale_1 : MDEV-13254 - Timeout, MDEV-14104 - Error maria.concurrent : Added in 10.2.18 maria.create : Added in 10.2.18 +maria.fulltext2 : Added in 10.2.19 maria.insert_select : MDEV-12757 - Timeout maria.insert_select-7314 : MDEV-16492 - Timeout maria.maria : MDEV-14430 - Extra warning; modified in 10.2.18 @@ -371,22 +382,21 @@ mariabackup.full_backup : MDEV-16571 - Wrong result mariabackup.huge_lsn : MDEV-15662 - Sequence number is in the future mariabackup.incremental_backup : MDEV-14192 - Assertion failure mariabackup.incremental_ddl_during_backup : Added in 10.2.18 -mariabackup.incremental_encrypted : MDEV-15667 - Timeout; MDEV-14192 - Assertion failure; modified in 10.2.17 -mariabackup.innodb_log_optimize_ddl : Added in 10.2.17 +mariabackup.incremental_encrypted : MDEV-15667 - Timeout; MDEV-14192 - Assertion failure mariabackup.mdev-14447 : MDEV-15201 - Timeout mariabackup.mlog_index_load : Added in 10.2.18 mariabackup.nolock_ddl_during_backup_end : Added in 10.2.18 mariabackup.partial_exclude : MDEV-15270 - Error on exec mariabackup.recreate_table_during_backup : Added in 10.2.18 -mariabackup.rename_during_backup : Added in 10.2.18 +mariabackup.rename_during_backup : MDEV-14192 - Assertion failure; Added in 10.2.18 mariabackup.rename_during_mdl_lock : Modified in 10.2.18 mariabackup.skip_innodb : Added in 10.2.18 -mariabackup.truncate_during_backup : Added in 10.2.18 +mariabackup.truncate_during_backup : Modified in 10.2.19 mariabackup.undo_space_id : Opt file modified in 10.2.18 mariabackup.unsupported_redo : Modified in 10.2.18 mariabackup.xbstream : MDEV-14192 - Crash mariabackup.xb_page_compress : MDEV-14810 - status: 1, errno: 11 -mariabackup.xb_partition : MDEV-14192 - Assertion failure +mariabackup.xb_partition : MDEV-14192 - Assertion failure; MDEV-17584 - Crash on shutdown mariabackup.xb_compressed_encrypted : MDEV-14812 - Segmentation fault #---------------------------------------------------------------- @@ -395,17 +405,9 @@ mroonga/storage.column_datetime_32bit_2038 : Wrong resul mroonga/storage.column_datetime_32bit_before_unix_epoch : Wrong result on Alpha mroonga/storage.column_datetime_32bit_max : Wrong result on Alpha mroonga/storage.column_datetime_32bit_out_of_range : Wrong result on Alpha -mroonga/storage.index_multiple_column_range_all_used_less_than : MDEV-16127 - Wrong result with GCC 8 -mroonga/storage.index_multiple_column_range_all_used_less_than_or_equal : MDEV-16127 - Wrong result with GCC 8 -mroonga/storage.index_multiple_column_range_partially_used_have_prefix_less_than : MDEV-16127 - Wrong result with GCC 8 -mroonga/storage.index_multiple_column_range_partially_used_have_prefix_less_than_or_equal : MDEV-16127 - Wrong result with GCC 8 -mroonga/storage.index_multiple_column_range_partially_used_no_prefix_less_than : MDEV-16127 - Wrong result with GCC 8 -mroonga/storage.index_multiple_column_range_partially_used_no_prefix_less_than_or_equal : MDEV-16127 - Wrong result with GCC 8 mroonga/storage.index_multiple_column_unique_date_32bit_equal : Wrong result on Alpha mroonga/storage.index_multiple_column_unique_date_order_32bit_desc : Wrong result on Alpha mroonga/storage.index_multiple_column_unique_datetime_index_read : MDEV-8643 - Valgrind -mroonga/storage.optimization_order_limit_optimized_datetime_less_than : MDEV-16127 - Wrong result with GCC 8 -mroonga/storage.optimization_order_limit_optimized_datetime_less_than_or_equal : MDEV-16127 - Wrong result with GCC 8 mroonga/storage.repair_table_no_index_file : MDEV-9364 - Wrong result mroonga/wrapper.repair_table_no_index_file : MDEV-14807 - Wrong error message @@ -421,7 +423,6 @@ multi_source.status_vars : MDEV-4632 - failed while waiting for Slave_ #---------------------------------------------------------------- -parts.alter_data_directory_innodb : Added in 10.2.17 parts.partition_alter2_2_maria : MDEV-14364 - Lost connection to MySQL server during query parts.partition_auto_increment_archive : MDEV-16491 - Marked as crashed and should be repaired parts.partition_auto_increment_maria : MDEV-14430 - Extra warning @@ -430,7 +431,6 @@ parts.partition_exch_qa_10 : MDEV-11765 - wrong result parts.partition_innodb_status_file : MDEV-12901 - Valgrind parts.partition_special_innodb : MDEV-16942 - Timeout parts.show_create : Modified in 10.2.18 -parts.truncate_locked : Added in 10.2.17 parts.update_and_cache : Added in 10.2.18 #---------------------------------------------------------------- @@ -466,7 +466,7 @@ perfschema_stress.* : MDEV-10996 - Not maintained #---------------------------------------------------------------- plugins.feedback_plugin_send : MDEV-7932, MDEV-11118 - Connection problems and such -plugins.processlist : MDEV-16574 - Wrong result; modified in 10.2.17 +plugins.processlist : MDEV-16574 - Wrong result plugins.server_audit : MDEV-9562 - crashes on sol10-sparc plugins.thread_pool_server_audit : MDEV-14295 - Wrong result @@ -475,32 +475,23 @@ plugins.thread_pool_server_audit : MDEV-14295 - Wrong result rocksdb.* : Tests are unstable rocksdb.2pc_group_commit : MDEV-14455 - Wrong result -rocksdb.add_index_inplace : MDEV-16648 - Server crash -rocksdb.allow_no_primary_key : MDEV-16634 - Server crash rocksdb.allow_no_primary_key_with_sk : MDEV-16639 - Server crash rocksdb.autoinc_crash_safe_partition : MDEV-16639, MDEV-16637 - Server crash -rocksdb.autoinc_secondary : MDEV-16638 - Server crash rocksdb.autoinc_vars_thread : MDEV-16573 - Debug sync timed out rocksdb.bloomfilter2 : MDEV-16564 - Wrong result -rocksdb.bloomfilter4 : MDEV-16649 - Server crash rocksdb.deadlock : MDEV-16033 - Timeout rocksdb.drop_index_inplace : MDEV-14162 - Crash on shutdown rocksdb.drop_table : MDEV-14308 - Timeout -rocksdb.drop_table2 : MDEV-16631 - Server crash rocksdb.drop_table3 : MDEV-16949 - Server crash rocksdb.dup_key_update : MDEV-17284 - Wrong result -rocksdb.issue255 : MDEV-16577 - Wrong plan rocksdb.locking_issues : MDEV-14464 - Wrong result rocksdb.mariadb_ignore_dirs : MDEV-16639 - Server crash rocksdb.mariadb_port_fixes : MDEV-16387 - Wrong plan rocksdb.max_open_files : MDEV-16639 - Server crash rocksdb.perf_context : MDEV-17285 - Wrong results -rocksdb.read_only_tx : MDEV-16565 - Server crash rocksdb.rocksdb_cf_options : MDEV-16639 - Server crash rocksdb.rocksdb_cf_per_partition : MDEV-16636 - Wrong result rocksdb.rocksdb_parts : MDEV-13843 - Wrong result -rocksdb.singledelete : MDEV-16633 - Server crash -rocksdb.truncate_table3 : MDEV-14506 - Lost connection to server rocksdb.ttl_primary_read_filtering : MDEV-16560 - Wrong result rocksdb.ttl_secondary : MDEV-16943 - Timeout rocksdb.ttl_secondary_read_filtering : MDEV-16560 - Wrong result @@ -521,7 +512,7 @@ roles.create_and_grant_role : MDEV-11772 - wrong result #---------------------------------------------------------------- rpl.last_insert_id : MDEV-10625 - warnings in error log -rpl.rpl_15867 : Added in 10.2.17 +rpl.rpl_15919 : Added in 10.2.19 rpl.rpl_auto_increment : MDEV-10417 - Fails on Mips rpl.rpl_auto_increment_bug45679 : MDEV-10417 - Fails on Mips rpl.rpl_auto_increment_update_failure : MDEV-10625 - warnings in error log @@ -551,23 +542,25 @@ rpl.rpl_insert_id : MDEV-15197 - Wrong result rpl.rpl_insert_id_pk : MDEV-16567 - Assertion failure rpl.rpl_insert_ignore : MDEV-14365 - Lost connection to MySQL server during query rpl.rpl_invoked_features : MDEV-10417 - Fails on Mips +rpl.rpl_lcase_tblnames_rewrite_db : Added in 10.2.19 rpl.rpl_mariadb_slave_capability : MDEV-11018 - Extra lines in binlog rpl.rpl_mdev6020 : MDEV-15272 - Server crash rpl.rpl_mixed_mixing_engines : MDEV-14489 - Sync slave with master failed rpl.rpl_non_direct_row_mixing_engines : MDEV-16561 - Timeout in master_pos_wait rpl.rpl_non_direct_mixed_mixing_engines : MDEV-14489 - Sync slave with master failed rpl.rpl_non_direct_stm_mixing_engines : MDEV-14489 - Failed sync_slave_with_master +rpl.rpl_old_master : Modified in 10.2.19 rpl.rpl_parallel : MDEV-10653 - Timeouts rpl.rpl_parallel_conflicts : MDEV-15272 - Server crash rpl.rpl_parallel_mdev6589 : MDEV-12979 - Assertion failure rpl.rpl_parallel_multilevel2 : MDEV-14723 - Timeout -rpl.rpl_parallel_optimistic : MDEV-15278 - Failed to sync with master +rpl.rpl_parallel_optimistic : MDEV-15278 - Failed to sync with master; modified in 10.2.19 rpl.rpl_parallel_optimistic_nobinlog : MDEV-15278 - Failed to sync with master rpl.rpl_parallel_retry : MDEV-11119 - Crash; MDEV-17109 - Timeout rpl.rpl_parallel_temptable : MDEV-10356 - Crash rpl.rpl_partition_innodb : MDEV-10417 - Fails on Mips rpl.rpl_password_boundaries : MDEV-11534 - Slave IO warnings -rpl.rpl_row_001 : MDEV-16653 - Internal check fails; modified in 10.2.17 +rpl.rpl_row_001 : MDEV-16653 - Internal check fails rpl.rpl_row_basic_11bugs : MDEV-12171 - Server failed to start rpl.rpl_row_basic_2myisam : MDEV-13875 - command "diff_files" failed rpl.rpl_row_drop_create_temp_table : MDEV-14487 - Wrong result @@ -575,6 +568,7 @@ rpl.rpl_row_img_blobs : MDEV-13875 - command "diff_files" failed rpl.rpl_row_img_eng_min : MDEV-13875 - diff_files failed rpl.rpl_row_img_eng_noblob : MDEV-13875 - command "diff_files" failed rpl.rpl_row_index_choice : MDEV-15196 - Slave crash +rpl.rpl_row_lcase_tblnames : Added in 10.2.19 rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x rpl.rpl_row_spatial : Added in 10.2.18 rpl.rpl_semi_sync : MDEV-11220 - Wrong result @@ -591,7 +585,7 @@ rpl.rpl_slave_load_tmpdir_not_exist : MDEV-14203 - Extra warning rpl.rpl_slow_query_log : MDEV-13250 - Test abort rpl.rpl_sp_effects : MDEV-13249 - Crash rpl.rpl_start_stop_slave : MDEV-13567 - Sync slave timeout -rpl.rpl_stm_000001 : Modified in 10.2.17 +rpl.rpl_stm_lcase_tblnames : Added in 10.2.19 rpl.rpl_stm_mixing_engines : MDEV-14489 - Sync slave with master failed rpl.rpl_stm_multi_query : MDEV-9501 - Failed registering on master rpl.rpl_stm_relay_ign_space : MDEV-14360 - Test assertion @@ -599,6 +593,7 @@ rpl.rpl_stm_stop_middle_group : MDEV-13791 - Server crash rpl.rpl_sync : MDEV-13830 - Assertion failure rpl.rpl_temporal_mysql56_to_mariadb53 : MDEV-9501 - Failed registering on master rpl.rpl_temporary_error2 : MDEV-10634 - Wrong number of retries +rpl.rpl_typeconv : Include file modified in 10.2.19 rpl.sec_behind_master-5114 : MDEV-13878 - Wrong result rpl/extra/rpl_tests.* : MDEV-10994 - Not maintained @@ -635,12 +630,16 @@ stress.ddl_innodb : MDEV-10635 - Testcase timeout #---------------------------------------------------------------- sys_vars.autocommit_func2 : MDEV-9329 - Fails on Ubuntu/s390x +sys_vars.delayed_insert_limit_func : MDEV-17683 - Wrong result; modified in 10.2.19 sys_vars.innodb_buffer_pool_dump_at_shutdown_basic : MDEV-14280 - Unexpected error -sys_vars.innodb_log_optimize_ddl_basic : Added in 10.2.17 +sys_vars.innodb_ft_result_cache_limit_32 : Added in 10.2.19 +sys_vars.innodb_ft_result_cache_limit_64 : Added in 10.2.19 +sys_vars.innodb_ft_result_cache_limit_basic : Modified in 10.2.19 sys_vars.keep_files_on_create_basic : MDEV-10676 - timeout sys_vars.log_slow_admin_statements_func : MDEV-12235 - Server crash sys_vars.rpl_init_slave_func : MDEV-10149 - Test assertion sys_vars.slow_query_log_func : MDEV-14273 - Wrong result +sys_vars.sql_low_priority_updates_func : Modified in 10.2.19 sys_vars.thread_cache_size_func : MDEV-11775 - Wrong result sys_vars.wait_timeout_func : MDEV-12896 - Wrong result sys_vars.wsrep_start_position_basic : Modified in 10.2.18 @@ -652,6 +651,7 @@ tokudb.* : suite.pm and multiple modifications in 10 tokudb.change_column_all_1000_10 : MDEV-12640 - Lost connection tokudb.change_column_bin : MDEV-12640 - Lost connection tokudb.change_column_char : MDEV-12822 - Lost connection +tokudb.change_column_varbin : MDEV-17682 - Timeout tokudb.cluster_filter : MDEV-10678 - Wrong execution plan tokudb.cluster_filter_hidden : MDEV-10678 - Wrong execution plan tokudb.cluster_filter_unpack_varchar : MDEV-10636 - Wrong execution plan @@ -672,13 +672,13 @@ tokudb.type_datetime : MDEV-15193 - Wrong result tokudb_alter_table.hcad_all_add2 : MDEV-15269 - Timeout -tokudb_bugs.alter_table_comment_rebuild_data : Added in 10.1.36 +tokudb_bugs.PS-3773 : Added in 10.0.37 +tokudb_bugs.alter_table_comment_rebuild_data : Added in 10.0.37 tokudb_bugs.checkpoint_lock : MDEV-10637 - Wrong processlist output tokudb_bugs.checkpoint_lock_3 : MDEV-10637 - Wrong processlist output tokudb_bugs.frm_store : MDEV-12823 - Valgrind tokudb_bugs.frm_store2 : MDEV-12823 - Valgrind tokudb_bugs.frm_store3 : MDEV-12823 - Valgrind -tokudb_bugs.PS-3773 : Added in 10.1.36 tokudb_bugs.xa : MDEV-11804 - Lock wait timeout tokudb_bugs.xa-3 : MDEV-16953 - Corrupt log record found @@ -695,7 +695,7 @@ rpl-tokudb.* : MDEV-14354 - Tests fail with tcmalloc unit.conc_basic-t : MDEV-15286 - not ok 7 - test_reconnect_maxpackage unit.conc_misc : MDEV-14811 - not ok 12 - test_conc49 unit.conc_ps_bugs : MDEV-13252 - not ok 44 test_bug4236 -unit.lf : MDEV-12897 - Signal 11 thrown +unit.lf : MDEV-12897 - Unexpected return code unit.ma_test_loghandler : MDEV-10638 - record read not ok unit.my_atomic : MDEV-15670 - Signal 11 thrown @@ -703,6 +703,7 @@ unit.my_atomic : MDEV-15670 - Signal 11 thrown vcol.index : Modified in 10.2.18 vcol.not_supported : MDEV-10639 - Testcase timeout +vcol.races : Added in 10.2.19 vcol.vcol_keys_innodb : MDEV-10639 - Testcase timeout vcol.vcol_misc : MDEV-16651 - Wrong error message @@ -710,6 +711,6 @@ vcol.vcol_misc : MDEV-16651 - Wrong error message wsrep.foreign_key : MDEV-14725 - WSREP has not yet prepared node wsrep.mdev_6832 : MDEV-14195 - Check testcase failed -wsrep.variables : MDEV-14311 - Wrong result; modified in 10.2.18 +wsrep.variables : MDEV-14311 - Wrong result; MDEV-17585 - Deadlock; modified in 10.2.19 wsrep_info.plugin : MDEV-13569 - No nodes coming from prim view From c688ab29ca83d2676d948477b585b3f278f38bbd Mon Sep 17 00:00:00 2001 From: Daniel Bartholomew Date: Tue, 13 Nov 2018 11:14:21 -0500 Subject: [PATCH 15/26] bump the VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7454014f67c..0ecdac30b5d 100644 --- a/VERSION +++ b/VERSION @@ -1,3 +1,3 @@ MYSQL_VERSION_MAJOR=10 MYSQL_VERSION_MINOR=2 -MYSQL_VERSION_PATCH=19 +MYSQL_VERSION_PATCH=20 From 01d3e401971ab51bb4a2b9c8438b27d0161267f9 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Tue, 7 Aug 2018 15:28:58 +0200 Subject: [PATCH 16/26] MDEV-16217: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed in Field_num::get_date - clean up DEFAULT() to work only with default value and correctly print itself. - fix of DBUG_ASSERT about fields read/write - fix of field marking for write based really on the thd->mark_used_columns flag --- mysql-test/r/func_default.result | 10 +++++- mysql-test/r/func_time.result | 57 ++++++++++++++++++++++++++++++++ mysql-test/t/func_default.test | 5 +++ mysql-test/t/func_time.test | 32 ++++++++++++++++++ sql/field.cc | 17 ++++++++-- sql/field.h | 1 + sql/item.cc | 25 ++++++++++++-- sql/item.h | 5 +++ 8 files changed, 147 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/func_default.result b/mysql-test/r/func_default.result index 535be10da86..9699f0795e3 100644 --- a/mysql-test/r/func_default.result +++ b/mysql-test/r/func_default.result @@ -8,13 +8,21 @@ explain extended select default(str), default(strnull), default(intg), default(r id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00 Warnings: -Note 1003 select default('') AS `default(str)`,default('') AS `default(strnull)`,default(0) AS `default(intg)`,default(0) AS `default(rel)` from dual +Note 1003 select default(`test`.`t1`.`str`) AS `default(str)`,default(`test`.`t1`.`strnull`) AS `default(strnull)`,default(`test`.`t1`.`intg`) AS `default(intg)`,default(`test`.`t1`.`rel`) AS `default(rel)` from dual select * from t1 where str <> default(str); str strnull intg rel 0 0 explain select * from t1 where str <> default(str); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 +create view v1 as select default(str), default(strnull), default(intg), default(rel) from t1; +select * from v1; +default(str) default(strnull) default(intg) default(rel) +def NULL 10 3.14 +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select default(`t1`.`str`) AS `default(str)`,default(`t1`.`strnull`) AS `default(strnull)`,default(`t1`.`intg`) AS `default(intg)`,default(`t1`.`rel`) AS `default(rel)` from `t1` latin1 latin1_swedish_ci +drop view v1; drop table t1; CREATE TABLE t1 (id int(11), s varchar(20)); INSERT INTO t1 VALUES (1, 'one'), (2, 'two'), (3, 'three'); diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 5ca9cf5228f..16acf3fcbea 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -3423,3 +3423,60 @@ DROP TABLE t1,t2; # # End of 10.1 tests # +# +# MDEV-16217: Assertion `!table || (!table->read_set || +# bitmap_is_set(table->read_set, field_index))' +# failed in Field_num::get_date +# +CREATE TABLE t1 (pk int default 0, a1 date); +INSERT INTO t1 VALUES (1,'1900-01-01'),(2,NULL),(3,NULL),(4,NULL); +CREATE VIEW v1 AS +SELECT t1.pk AS pk, t1.a1 AS a1 FROM t1; +SELECT a1 BETWEEN (('2018-08-24')) AND (DEFAULT(pk)) FROM v1; +a1 BETWEEN (('2018-08-24')) AND (DEFAULT(pk)) +0 +NULL +NULL +NULL +SELECT a1 BETWEEN (('2018-08-24')) AND (~ DEFAULT(pk)) FROM v1; +a1 BETWEEN (('2018-08-24')) AND (~ DEFAULT(pk)) +0 +NULL +NULL +NULL +Warnings: +Warning 1292 Incorrect datetime value: '18446744073709551615' +CREATE TABLE t2 (pk int default 1, a1 date); +INSERT INTO t2 VALUES (4,NULL); +CREATE view v2 as SELECT default(t1.pk), default(t2.pk), t1.pk from t1,t2; +select * from v2; +default(t1.pk) default(t2.pk) pk +0 1 1 +0 1 2 +0 1 3 +0 1 4 +show create view v2; +View Create View character_set_client collation_connection +v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select default(`t1`.`pk`) AS `default(t1.pk)`,default(`t2`.`pk`) AS `default(t2.pk)`,`t1`.`pk` AS `pk` from (`t1` join `t2`) latin1 latin1_swedish_ci +CREATE view v3 as SELECT default(pk) from t2; +select * from v3; +default(pk) +1 +explain extended select * from v3; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00 +Warnings: +Note 1003 select default(`test`.`t2`.`pk`) AS `default(pk)` from dual +explain extended select default(pk) from t2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00 +Warnings: +Note 1003 select default(`test`.`t2`.`pk`) AS `default(pk)` from dual +show create view v3; +View Create View character_set_client collation_connection +v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select default(`t2`.`pk`) AS `default(pk)` from `t2` latin1 latin1_swedish_ci +DROP VIEW v1,v2,v3; +DROP TABLE t1,t2; +# +# End of 10.2 tests +# diff --git a/mysql-test/t/func_default.test b/mysql-test/t/func_default.test index fbd73990297..332bfca021f 100644 --- a/mysql-test/t/func_default.test +++ b/mysql-test/t/func_default.test @@ -11,6 +11,11 @@ explain extended select default(str), default(strnull), default(intg), default(r select * from t1 where str <> default(str); explain select * from t1 where str <> default(str); +create view v1 as select default(str), default(strnull), default(intg), default(rel) from t1; +select * from v1; +show create view v1; +drop view v1; + #TODO: uncomment when bug will be fixed #create table t2 select default(str), default(strnull), default(intg), default(rel) from t1; #show create table from t1; diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 73f91bb90a0..d391e5f5059 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -1910,3 +1910,35 @@ DROP TABLE t1,t2; --echo # --echo # End of 10.1 tests --echo # + +--echo # +--echo # MDEV-16217: Assertion `!table || (!table->read_set || +--echo # bitmap_is_set(table->read_set, field_index))' +--echo # failed in Field_num::get_date +--echo # +CREATE TABLE t1 (pk int default 0, a1 date); +INSERT INTO t1 VALUES (1,'1900-01-01'),(2,NULL),(3,NULL),(4,NULL); + +CREATE VIEW v1 AS +SELECT t1.pk AS pk, t1.a1 AS a1 FROM t1; + +SELECT a1 BETWEEN (('2018-08-24')) AND (DEFAULT(pk)) FROM v1; +SELECT a1 BETWEEN (('2018-08-24')) AND (~ DEFAULT(pk)) FROM v1; + +CREATE TABLE t2 (pk int default 1, a1 date); +INSERT INTO t2 VALUES (4,NULL); +CREATE view v2 as SELECT default(t1.pk), default(t2.pk), t1.pk from t1,t2; +select * from v2; +show create view v2; +CREATE view v3 as SELECT default(pk) from t2; +select * from v3; +explain extended select * from v3; +explain extended select default(pk) from t2; +show create view v3; + +DROP VIEW v1,v2,v3; +DROP TABLE t1,t2; + +--echo # +--echo # End of 10.2 tests +--echo # diff --git a/sql/field.cc b/sql/field.cc index caa84dc9932..6cd8940a893 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -70,8 +70,21 @@ const char field_separator=','; #define BLOB_PACK_LENGTH_TO_MAX_LENGH(arg) \ ((ulong) ((1LL << MY_MIN(arg, 4) * 8) - 1)) -#define ASSERT_COLUMN_MARKED_FOR_READ DBUG_ASSERT(!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))) -#define ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED DBUG_ASSERT(is_stat_field || !table || (!table->write_set || bitmap_is_set(table->write_set, field_index) || (table->vcol_set && bitmap_is_set(table->vcol_set, field_index)))) +// Column marked for read or the field set to read out or record[0] or [1] +#define ASSERT_COLUMN_MARKED_FOR_READ \ + DBUG_ASSERT(!table || \ + (!table->read_set || \ + bitmap_is_set(table->read_set, field_index) || \ + (!(ptr >= table->record[0] && \ + ptr < table->record[0] + table->s->reclength)))) + +#define ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED \ + DBUG_ASSERT(is_stat_field || !table || \ + (!table->write_set || \ + bitmap_is_set(table->write_set, field_index) || \ + (!(ptr >= table->record[0] && \ + ptr < table->record[0] + table->s->reclength))) || \ + (table->vcol_set && bitmap_is_set(table->vcol_set, field_index))) #define FLAGSTR(S,F) ((S) & (F) ? #F " " : "") diff --git a/sql/field.h b/sql/field.h index 22c276478b6..55c3ed4c4bd 100644 --- a/sql/field.h +++ b/sql/field.h @@ -630,6 +630,7 @@ public: bool utf8; /* Already in utf8 */ Item *expr; LEX_STRING name; /* Name of constraint */ + /* see VCOL_* (VCOL_FIELD_REF, ...) */ uint flags; Virtual_column_info() diff --git a/sql/item.cc b/sql/item.cc index 9ac1ed3947d..81da813a55e 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -8818,8 +8818,19 @@ bool Item_default_value::fix_fields(THD *thd, Item **items) fixed= 1; return FALSE; } + + /* + DEFAULT() do not need table field so should not ask handler to bring + field value (mark column for read) + */ + enum_mark_columns save_mark_used_columns= thd->mark_used_columns; + thd->mark_used_columns= MARK_COLUMNS_NONE; if (!arg->fixed && arg->fix_fields(thd, &arg)) + { + thd->mark_used_columns= save_mark_used_columns; goto error; + } + thd->mark_used_columns= save_mark_used_columns; real_arg= arg->real_item(); @@ -8839,15 +8850,19 @@ bool Item_default_value::fix_fields(THD *thd, Item **items) goto error; memcpy((void *)def_field, (void *)field_arg->field, field_arg->field->size_of()); - IF_DBUG(def_field->is_stat_field=1,); // a hack to fool ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED + // If non-constant default value expression if (def_field->default_value && def_field->default_value->flags) { uchar *newptr= (uchar*) thd->alloc(1+def_field->pack_length()); if (!newptr) goto error; + /* + Even if DEFAULT() do not read tables fields, the default value + expression can do it. + */ fix_session_vcol_expr_for_read(thd, def_field, def_field->default_value); if (thd->mark_used_columns != MARK_COLUMNS_NONE) - def_field->default_value->expr->walk(&Item::register_field_in_read_map, 1, 0); + def_field->default_value->expr->update_used_tables(); def_field->move_field(newptr+1, def_field->maybe_null() ? newptr : 0, 1); } else @@ -8871,6 +8886,12 @@ void Item_default_value::print(String *str, enum_query_type query_type) return; } str->append(STRING_WITH_LEN("default(")); + /* + We take DEFAULT from a field so do not need it value in case of const + tables but its name so we set QT_NO_DATA_EXPANSION (as we print for + table definition, also we do not need table and database name) + */ + query_type= (enum_query_type) (query_type | QT_NO_DATA_EXPANSION); arg->print(str, query_type); str->append(')'); } diff --git a/sql/item.h b/sql/item.h index 3a64ea1a75d..99eacdd6621 100644 --- a/sql/item.h +++ b/sql/item.h @@ -5230,6 +5230,11 @@ public: return false; } table_map used_tables() const; + virtual void update_used_tables() + { + if (field && field->default_value) + field->default_value->expr->update_used_tables(); + } Field *get_tmp_table_field() { return 0; } Item *get_tmp_table_item(THD *thd) { return this; } Item_field *field_for_view_update() { return 0; } From 47274d902e63663522176614157b4eace8a17b8e Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Wed, 14 Nov 2018 15:46:53 +0100 Subject: [PATCH 17/26] fix of test suite --- mysql-test/r/partition_innodb.result | 2 +- mysql-test/t/partition_innodb.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result index ee3525cb085..b1405be3f12 100644 --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@ -901,7 +901,7 @@ INSERT INTO t1 VALUES (1),(2); INSERT IGNORE INTO t2 VALUES (2,2),('three',3),(4,4); Warnings: Warning 1366 Incorrect integer value: 'three' for column 'b' at row 2 -UPDATE v SET a = NULL ORDER BY a, b; +UPDATE v SET a = NULL; Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'foo' DROP view v; diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index 5dbe9f467fa..5674a889023 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -1008,7 +1008,7 @@ CREATE ALGORITHM = MERGE VIEW v AS SELECT a, b FROM t1 STRAIGHT_JOIN t2 WHERE b INSERT INTO t1 VALUES (1),(2); INSERT IGNORE INTO t2 VALUES (2,2),('three',3),(4,4); -UPDATE v SET a = NULL ORDER BY a, b; +UPDATE v SET a = NULL; DROP view v; DROP TABLE t1, t2; From 7f175595c83b3ef55d6aa00cc7707ec565398bf5 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 15 Nov 2018 06:35:37 +0400 Subject: [PATCH 18/26] Backport for "MDEV-17698 MEMORY engine performance regression" Also, backporting a part of: MDEV-11485 Split Item_func_between::val_int() into virtual methods in Type_handler for easier merge to 10.3. --- sql/item.h | 4 + sql/item_cmpfunc.cc | 190 ++++++++++++++++++++++++-------------------- sql/item_cmpfunc.h | 5 ++ sql/sql_type_int.h | 28 +++++++ 4 files changed, 140 insertions(+), 87 deletions(-) diff --git a/sql/item.h b/sql/item.h index dacac2d725e..38dce1f3b97 100644 --- a/sql/item.h +++ b/sql/item.h @@ -794,6 +794,10 @@ public: If value is not null null_value flag will be reset to FALSE. */ virtual longlong val_int()=0; + Longlong_hybrid to_longlong_hybrid() + { + return Longlong_hybrid(val_int(), unsigned_flag); + } /* This is just a shortcut to avoid the cast. You should still use unsigned_flag to check the sign of the item. diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index d4a2c767b15..3af79c23ee7 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -158,7 +158,10 @@ static int cmp_row_type(Item* item1, Item* item2) 0 otherwise */ -static int agg_cmp_type(Item_result *type, Item **items, uint nitems) +static int agg_cmp_type(Item_result *type, + Item **items, + uint nitems, + bool int_uint_as_dec) { uint unsigned_count= items[0]->unsigned_flag; type[0]= items[0]->cmp_type(); @@ -180,7 +183,9 @@ static int agg_cmp_type(Item_result *type, Item **items, uint nitems) If all arguments are of INT type but have different unsigned_flag values, switch to DECIMAL_RESULT. */ - if (type[0] == INT_RESULT && unsigned_count != nitems && unsigned_count != 0) + if (int_uint_as_dec && + type[0] == INT_RESULT && + unsigned_count != nitems && unsigned_count != 0) type[0]= DECIMAL_RESULT; return 0; } @@ -2295,7 +2300,7 @@ void Item_func_between::fix_length_and_dec() */ if (!args[0] || !args[1] || !args[2]) return; - if ( agg_cmp_type(&cmp_type, args, 3)) + if (agg_cmp_type(&cmp_type, args, 3, false)) return; if (cmp_type == STRING_RESULT && agg_arg_charsets_for_comparison(cmp_collation, args, 3)) @@ -2329,6 +2334,97 @@ void Item_func_between::fix_length_and_dec() } +longlong Item_func_between::val_int_cmp_string() +{ + String *value,*a,*b; + value=args[0]->val_str(&value0); + if ((null_value=args[0]->null_value)) + return 0; + a= args[1]->val_str(&value1); + b= args[2]->val_str(&value2); + if (!args[1]->null_value && !args[2]->null_value) + return (longlong) ((sortcmp(value,a,cmp_collation.collation) >= 0 && + sortcmp(value,b,cmp_collation.collation) <= 0) != + negated); + if (args[1]->null_value && args[2]->null_value) + null_value= true; + else if (args[1]->null_value) + { + // Set to not null if false range. + null_value= sortcmp(value,b,cmp_collation.collation) <= 0; + } + else + { + // Set to not null if false range. + null_value= sortcmp(value,a,cmp_collation.collation) >= 0; + } + return (longlong) (!null_value && negated); +} + + +longlong Item_func_between::val_int_cmp_int() +{ + Longlong_hybrid value= args[0]->to_longlong_hybrid(); + if ((null_value= args[0]->null_value)) + return 0; /* purecov: inspected */ + Longlong_hybrid a= args[1]->to_longlong_hybrid(); + Longlong_hybrid b= args[2]->to_longlong_hybrid(); + if (!args[1]->null_value && !args[2]->null_value) + return (longlong) ((value.cmp(a) >= 0 && value.cmp(b) <= 0) != negated); + if (args[1]->null_value && args[2]->null_value) + null_value= true; + else if (args[1]->null_value) + null_value= value.cmp(b) <= 0; // not null if false range. + else + null_value= value.cmp(a) >= 0; + return (longlong) (!null_value && negated); +} + + +longlong Item_func_between::val_int_cmp_decimal() +{ + my_decimal dec_buf, *dec= args[0]->val_decimal(&dec_buf), + a_buf, *a_dec, b_buf, *b_dec; + if ((null_value=args[0]->null_value)) + return 0; /* purecov: inspected */ + a_dec= args[1]->val_decimal(&a_buf); + b_dec= args[2]->val_decimal(&b_buf); + if (!args[1]->null_value && !args[2]->null_value) + return (longlong) ((my_decimal_cmp(dec, a_dec) >= 0 && + my_decimal_cmp(dec, b_dec) <= 0) != negated); + if (args[1]->null_value && args[2]->null_value) + null_value= true; + else if (args[1]->null_value) + null_value= (my_decimal_cmp(dec, b_dec) <= 0); + else + null_value= (my_decimal_cmp(dec, a_dec) >= 0); + return (longlong) (!null_value && negated); +} + + +longlong Item_func_between::val_int_cmp_real() +{ + double value= args[0]->val_real(),a,b; + if ((null_value=args[0]->null_value)) + return 0; /* purecov: inspected */ + a= args[1]->val_real(); + b= args[2]->val_real(); + if (!args[1]->null_value && !args[2]->null_value) + return (longlong) ((value >= a && value <= b) != negated); + if (args[1]->null_value && args[2]->null_value) + null_value= true; + else if (args[1]->null_value) + { + null_value= value <= b; // not null if false range. + } + else + { + null_value= value >= a; + } + return (longlong) (!null_value && negated); +} + + longlong Item_func_between::val_int() { DBUG_ASSERT(fixed == 1); @@ -2370,94 +2466,14 @@ longlong Item_func_between::val_int() null_value= value >= a; break; } - case STRING_RESULT: - { - String *value,*a,*b; - value=args[0]->val_str(&value0); - if ((null_value=args[0]->null_value)) - return 0; - a=args[1]->val_str(&value1); - b=args[2]->val_str(&value2); - if (!args[1]->null_value && !args[2]->null_value) - return (longlong) ((sortcmp(value,a,cmp_collation.collation) >= 0 && - sortcmp(value,b,cmp_collation.collation) <= 0) != - negated); - if (args[1]->null_value && args[2]->null_value) - null_value=1; - else if (args[1]->null_value) - { - // Set to not null if false range. - null_value= sortcmp(value,b,cmp_collation.collation) <= 0; - } - else - { - // Set to not null if false range. - null_value= sortcmp(value,a,cmp_collation.collation) >= 0; - } - break; - } + return val_int_cmp_string(); case INT_RESULT: - { - longlong value=args[0]->val_int(), a, b; - if ((null_value=args[0]->null_value)) - return 0; /* purecov: inspected */ - a=args[1]->val_int(); - b=args[2]->val_int(); - if (!args[1]->null_value && !args[2]->null_value) - return (longlong) ((value >= a && value <= b) != negated); - if (args[1]->null_value && args[2]->null_value) - null_value=1; - else if (args[1]->null_value) - { - null_value= value <= b; // not null if false range. - } - else - { - null_value= value >= a; - } - break; - } + return val_int_cmp_int(); case DECIMAL_RESULT: - { - my_decimal dec_buf, *dec= args[0]->val_decimal(&dec_buf), - a_buf, *a_dec, b_buf, *b_dec; - if ((null_value=args[0]->null_value)) - return 0; /* purecov: inspected */ - a_dec= args[1]->val_decimal(&a_buf); - b_dec= args[2]->val_decimal(&b_buf); - if (!args[1]->null_value && !args[2]->null_value) - return (longlong) ((my_decimal_cmp(dec, a_dec) >= 0 && - my_decimal_cmp(dec, b_dec) <= 0) != negated); - if (args[1]->null_value && args[2]->null_value) - null_value=1; - else if (args[1]->null_value) - null_value= (my_decimal_cmp(dec, b_dec) <= 0); - else - null_value= (my_decimal_cmp(dec, a_dec) >= 0); - break; - } + return val_int_cmp_decimal(); case REAL_RESULT: - { - double value= args[0]->val_real(),a,b; - if ((null_value=args[0]->null_value)) - return 0; /* purecov: inspected */ - a= args[1]->val_real(); - b= args[2]->val_real(); - if (!args[1]->null_value && !args[2]->null_value) - return (longlong) ((value >= a && value <= b) != negated); - if (args[1]->null_value && args[2]->null_value) - null_value=1; - else if (args[1]->null_value) - { - null_value= value <= b; // not null if false range. - } - else - { - null_value= value >= a; - } - break; - } + return val_int_cmp_real(); case ROW_RESULT: case IMPOSSIBLE_RESULT: DBUG_ASSERT(0); diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index c4e6a53dd6b..12a12e05845 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -694,6 +694,11 @@ public: bool eval_not_null_tables(uchar *opt_arg); void fix_after_pullout(st_select_lex *new_parent, Item **ref); bool count_sargable_conds(uchar *arg); + + longlong val_int_cmp_string(); + longlong val_int_cmp_int(); + longlong val_int_cmp_real(); + longlong val_int_cmp_decimal(); }; diff --git a/sql/sql_type_int.h b/sql/sql_type_int.h index 1eda5651df5..7433bd5249f 100644 --- a/sql/sql_type_int.h +++ b/sql/sql_type_int.h @@ -24,12 +24,25 @@ class Longlong_hybrid protected: longlong m_value; bool m_unsigned; + int cmp_signed(const Longlong_hybrid& other) const + { + return m_value < other.m_value ? -1 : m_value == other.m_value ? 0 : 1; + } + int cmp_unsigned(const Longlong_hybrid& other) const + { + return (ulonglong) m_value < (ulonglong) other.m_value ? -1 : + m_value == other.m_value ? 0 : 1; + } public: Longlong_hybrid(longlong nr, bool unsigned_flag) :m_value(nr), m_unsigned(unsigned_flag) { } longlong value() const { return m_value; } bool is_unsigned() const { return m_unsigned; } + bool is_unsigned_outside_of_signed_range() const + { + return m_unsigned && ((ulonglong) m_value) > (ulonglong) LONGLONG_MAX; + } bool neg() const { return m_value < 0 && !m_unsigned; } ulonglong abs() const { @@ -39,6 +52,21 @@ public: return ((ulonglong) LONGLONG_MAX) + 1; return m_value < 0 ? -m_value : m_value; } + int cmp(const Longlong_hybrid& other) const + { + if (m_unsigned == other.m_unsigned) + return m_unsigned ? cmp_unsigned(other) : cmp_signed(other); + if (is_unsigned_outside_of_signed_range()) + return 1; + if (other.is_unsigned_outside_of_signed_range()) + return -1; + /* + The unsigned argument is in the range 0..LONGLONG_MAX. + The signed argument is in the range LONGLONG_MIN..LONGLONG_MAX. + Safe to compare as signed. + */ + return cmp_signed(other); + } }; #endif // SQL_TYPE_INT_INCLUDED From 1956695c69467375fc634ad709f1b32a2daf29b1 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Thu, 15 Nov 2018 16:45:43 +0400 Subject: [PATCH 19/26] MDEV-17724 Wrong result for BETWEEN 0 AND 18446744073709551615 The fix for "MDEV-17698 MEMORY engine performance regression" previously fixed this problem. - Adding the test for MDEV-17724 - Re-recording wrong results for tests: * engines/iuds/r/insert_number * engines/iuds/r/update_delete_number which started to fail since MDEV-17698 --- mysql-test/r/bigint.result | 11 ++ .../suite/engines/iuds/r/insert_number.result | 100 ++++++++++++++++++ .../iuds/r/update_delete_number.result | 17 +++ mysql-test/t/bigint.test | 9 ++ 4 files changed, 137 insertions(+) diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result index b06ec5805a0..760b9c7b205 100644 --- a/mysql-test/r/bigint.result +++ b/mysql-test/r/bigint.result @@ -508,3 +508,14 @@ DROP TABLE t1; SELECT 100 BETWEEN 1 AND 9223372036854775808; 100 BETWEEN 1 AND 9223372036854775808 1 +# +# MDEV-17724 Wrong result for BETWEEN 0 AND 18446744073709551615 +# +CREATE TABLE t1 (c1 bigint(20) unsigned NOT NULL); +INSERT INTO t1 VALUES (0),(101),(255); +SELECT * FROM t1 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1; +c1 +0 +101 +255 +DROP TABLE t1; diff --git a/mysql-test/suite/engines/iuds/r/insert_number.result b/mysql-test/suite/engines/iuds/r/insert_number.result index ab56b82807c..9f937b33364 100644 --- a/mysql-test/suite/engines/iuds/r/insert_number.result +++ b/mysql-test/suite/engines/iuds/r/insert_number.result @@ -31565,8 +31565,33 @@ c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 1 2 3 4 5 SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6; c1 c2 c3 c4 c5 c6 c7 +0 NULL 5 6 NULL 0 NULL +0 -9223372036854775808 1 2 3 4 5 +0 0 17 18 19 20 21 +0 124 22 23 24 25 26 +0 124 27 28 29 30 31 +0 -9223372036854775808 31 32 33 34 35 +0 0 32 32 34 35 36 +101 0 37 38 39 40 41 +101 -102 103 104 105 106 107 +102 -109 110 111 112 113 114 +103 -109 110 111 112 113 114 +105 NULL 102 103 104 105 106 +108 -109 110 111 112 101 114 +108 -109 110 111 112 102 114 +108 -109 110 111 112 113 114 +115 -116 117 118 119 120 121 +122 -123 124 125 126 127 128 +255 -2147483648 6 7 8 9 10 +65535 -8388608 11 12 13 14 15 +16777215 -32768 16 17 18 19 20 +4294967295 -128 21 22 23 24 25 +18446744073709551615 9223372036854775807 26 27 28 29 30 +18446744073709551615 9223372036854775807 36 37 38 39 40 SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +0 NULL 5 6 NULL 0 NULL +0 -9223372036854775808 1 2 3 4 5 SELECT * FROM t2 WHERE c1 IN (0,18446744073709551615) ORDER BY c1,c6; c1 c2 c3 c4 c5 c6 c7 0 NULL 5 6 NULL 0 NULL @@ -31726,8 +31751,33 @@ c1 c2 c3 c4 c5 c6 c7 0 -9223372036854775808 31 32 33 34 35 SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6 DESC; c1 c2 c3 c4 c5 c6 c7 +0 0 32 32 34 35 36 +0 -9223372036854775808 31 32 33 34 35 +0 124 27 28 29 30 31 +0 124 22 23 24 25 26 +0 0 17 18 19 20 21 +0 -9223372036854775808 1 2 3 4 5 +0 NULL 5 6 NULL 0 NULL +101 -102 103 104 105 106 107 +101 0 37 38 39 40 41 +102 -109 110 111 112 113 114 +103 -109 110 111 112 113 114 +105 NULL 102 103 104 105 106 +108 -109 110 111 112 113 114 +108 -109 110 111 112 102 114 +108 -109 110 111 112 101 114 +115 -116 117 118 119 120 121 +122 -123 124 125 126 127 128 +255 -2147483648 6 7 8 9 10 +65535 -8388608 11 12 13 14 15 +16777215 -32768 16 17 18 19 20 +4294967295 -128 21 22 23 24 25 +18446744073709551615 9223372036854775807 36 37 38 39 40 +18446744073709551615 9223372036854775807 26 27 28 29 30 SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +0 0 32 32 34 35 36 +0 -9223372036854775808 31 32 33 34 35 SELECT * FROM t2 WHERE c1 IN (0,18446744073709551615) ORDER BY c1,c6 DESC; c1 c2 c3 c4 c5 c6 c7 0 0 32 32 34 35 36 @@ -31993,8 +32043,33 @@ c1 c2 c3 c4 c5 c6 c7 18446744073709551615 9223372036854775807 36 37 38 39 40 SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6; c1 c2 c3 c4 c5 c6 c7 +0 NULL 5 6 NULL 0 NULL +0 -9223372036854775808 1 2 3 4 5 +0 0 17 18 19 20 21 +0 124 22 23 24 25 26 +0 124 27 28 29 30 31 +0 -9223372036854775808 31 32 33 34 35 +0 0 32 32 34 35 36 +101 0 37 38 39 40 41 +101 -102 103 104 105 106 107 +102 -109 110 111 112 113 114 +103 -109 110 111 112 113 114 +105 NULL 102 103 104 105 106 +108 -109 110 111 112 101 114 +108 -109 110 111 112 102 114 +108 -109 110 111 112 113 114 +115 -116 117 118 119 120 121 +122 -123 124 125 126 127 128 +255 -2147483648 6 7 8 9 10 +65535 -8388608 11 12 13 14 15 +16777215 -32768 16 17 18 19 20 +4294967295 -128 21 22 23 24 25 +18446744073709551615 9223372036854775807 26 27 28 29 30 +18446744073709551615 9223372036854775807 36 37 38 39 40 SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6 LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +0 NULL 5 6 NULL 0 NULL +0 -9223372036854775808 1 2 3 4 5 SELECT * FROM t2 WHERE c1 IN (0,18446744073709551615) ORDER BY c1,c6; c1 c2 c3 c4 c5 c6 c7 0 NULL 5 6 NULL 0 NULL @@ -32154,8 +32229,33 @@ c1 c2 c3 c4 c5 c6 c7 18446744073709551615 9223372036854775807 26 27 28 29 30 SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6 DESC; c1 c2 c3 c4 c5 c6 c7 +0 0 32 32 34 35 36 +0 -9223372036854775808 31 32 33 34 35 +0 124 27 28 29 30 31 +0 124 22 23 24 25 26 +0 0 17 18 19 20 21 +0 -9223372036854775808 1 2 3 4 5 +0 NULL 5 6 NULL 0 NULL +101 -102 103 104 105 106 107 +101 0 37 38 39 40 41 +102 -109 110 111 112 113 114 +103 -109 110 111 112 113 114 +105 NULL 102 103 104 105 106 +108 -109 110 111 112 113 114 +108 -109 110 111 112 102 114 +108 -109 110 111 112 101 114 +115 -116 117 118 119 120 121 +122 -123 124 125 126 127 128 +255 -2147483648 6 7 8 9 10 +65535 -8388608 11 12 13 14 15 +16777215 -32768 16 17 18 19 20 +4294967295 -128 21 22 23 24 25 +18446744073709551615 9223372036854775807 36 37 38 39 40 +18446744073709551615 9223372036854775807 26 27 28 29 30 SELECT * FROM t2 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1,c6 DESC LIMIT 2; c1 c2 c3 c4 c5 c6 c7 +0 0 32 32 34 35 36 +0 -9223372036854775808 31 32 33 34 35 SELECT * FROM t2 WHERE c1 IN (0,18446744073709551615) ORDER BY c1,c6 DESC; c1 c2 c3 c4 c5 c6 c7 0 0 32 32 34 35 36 diff --git a/mysql-test/suite/engines/iuds/r/update_delete_number.result b/mysql-test/suite/engines/iuds/r/update_delete_number.result index 8e190870092..e676b7a79f8 100644 --- a/mysql-test/suite/engines/iuds/r/update_delete_number.result +++ b/mysql-test/suite/engines/iuds/r/update_delete_number.result @@ -3768,8 +3768,25 @@ c1 c2 c3 -12 18446744073709551615 12 SELECT * FROM t2 WHERE c2 BETWEEN 0 AND 18446744073709551615 ORDER BY c2,c1; c1 c2 c3 +-4 4 4 +-9 9 9 +0 255 13 +-9223372036854775808 18446744073709551615 12 +-12 18446744073709551615 12 +-11 18446744073709551615 11 +-8 18446744073709551615 8 +-7 18446744073709551615 7 +-6 18446744073709551615 6 +-5 18446744073709551615 5 +-3 18446744073709551615 3 +-2 18446744073709551615 2 +-1 18446744073709551615 1 +50 18446744073709551615 10 +9223372036854775807 18446744073709551615 14 SELECT * FROM t2 WHERE c2 BETWEEN 0 AND 18446744073709551615 ORDER BY c2,c1 DESC LIMIT 2; c1 c2 c3 +-4 4 4 +-9 9 9 SELECT * FROM t2 WHERE c2 IN(0,18446744073709551615) ORDER BY c2,c1 DESC; c1 c2 c3 9223372036854775807 18446744073709551615 14 diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test index fb18d60edd9..71fef813a8d 100644 --- a/mysql-test/t/bigint.test +++ b/mysql-test/t/bigint.test @@ -414,3 +414,12 @@ DROP TABLE t1; --echo # MDEV-9372 select 100 between 1 and 9223372036854775808 returns false --echo # SELECT 100 BETWEEN 1 AND 9223372036854775808; + +--echo # +--echo # MDEV-17724 Wrong result for BETWEEN 0 AND 18446744073709551615 +--echo # + +CREATE TABLE t1 (c1 bigint(20) unsigned NOT NULL); +INSERT INTO t1 VALUES (0),(101),(255); +SELECT * FROM t1 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1; +DROP TABLE t1; From c6838cc646dde24a2a5518a3c07ef210c84f787a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 15 Nov 2018 17:52:57 +0200 Subject: [PATCH 20/26] MDEV-17726 Assertion `sqlcom != SQLCOM_TRUNCATE' failed in ha_innobase::delete_table after truncating temporary table THD::close_temporary_tables(): Assign lex->sql_command so that the debug assertion will not fail in ha_innobase::delete_table(). Alternatively, we could ensure that thd_killed() holds inside ha_innobase::delete_table(). There should be no impact for the non-debug build. The thd_sql_command() inside ha_innobase::delete_table() only affects the treatment of persistent FOREIGN KEY metadata. There is no persistent metadata nor foreign key constraints for temporary tables. No test case was added, because the failure is nondeterministic. --- sql/temporary_tables.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc index 3201b306fad..574ed96ada8 100644 --- a/sql/temporary_tables.cc +++ b/sql/temporary_tables.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2016 MariaDB Corporation + Copyright (c) 2016,2018 MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -476,6 +476,7 @@ bool THD::close_temporary_tables() } DBUG_ASSERT(!rgi_slave); + lex->sql_command = SQLCOM_DROP_TABLE; /* Ensure we don't have open HANDLERs for tables we are about to close. From 705abdebaf192adb5642b6f0e7d0a1f8027b262b Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Fri, 16 Nov 2018 10:39:08 +0530 Subject: [PATCH 21/26] MDEV-13170: Database service (MySQL) stops after update with trigger For prepare statemtent/stored procedures we rollback the items to original ones after prepare execution in the function reinit_stmt_before_use. This rollback is done for group by, order by clauses but is not done for the window specification containing the order by and partition by clause of the window function. --- mysql-test/r/win.result | 34 ++++++++++++++++++++++++++++++++++ mysql-test/t/win.test | 41 +++++++++++++++++++++++++++++++++++++++++ sql/sql_prepare.cc | 12 ++++++++++++ 3 files changed, 87 insertions(+) diff --git a/mysql-test/r/win.result b/mysql-test/r/win.result index c539ac4f252..4ffa9f34c1d 100644 --- a/mysql-test/r/win.result +++ b/mysql-test/r/win.result @@ -3423,3 +3423,37 @@ GROUP BY LEFT('2018-08-24', 100) having 1=1 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 drop table t1; +# +# MDEV-13170: Database service (MySQL) stops after update with trigger +# +CREATE TABLE t1 ( t1_id int, point_id int, ml_id int, UNIQUE KEY t1_ml_u (ml_id,point_id)) ; +INSERT INTO t1 VALUES (1,1,8884),(2,1,8885); +CREATE TABLE t2 ( db_time datetime, au_nr int, col_id int, new_val int); +CREATE TABLE t3 (id1 int, id2 int, d1 int); +CREATE TRIGGER t1_aurtrg AFTER UPDATE ON t1 FOR EACH ROW begin +CREATE OR REPLACE TEMPORARY TABLE trg_u AS +WITH l AS +(SELECT a.*, +Max(t2.col_id) over (PARTITION BY a.d1), +Max(t2.new_val) over (PARTITION BY a.d1) +FROM +(SELECT d1 , id1, id2 FROM t3) a +JOIN t2 ON (a.d1=t2.db_time AND a.id1=t2.au_nr)) +SELECT 1; +END;// +update t1 set ml_id=8884 where point_id=1; +ERROR 23000: Duplicate entry '8884-1' for key 't1_ml_u' +update t1 set ml_id=8884 where point_id=1; +ERROR 23000: Duplicate entry '8884-1' for key 't1_ml_u' +drop table t1, t2,t3; +CREATE TABLE t1 (i INT, a char); +INSERT INTO t1 VALUES (1, 'a'),(2, 'b'); +create view v1 as select * from t1; +PREPARE stmt FROM "SELECT i, row_number() over (partition by i order by i) FROM v1"; +execute stmt; +i row_number() over (partition by i order by i) +1 1 +2 1 +deallocate prepare stmt; +drop table t1; +drop view v1; diff --git a/mysql-test/t/win.test b/mysql-test/t/win.test index 7dda2b6215f..807d394edd3 100644 --- a/mysql-test/t/win.test +++ b/mysql-test/t/win.test @@ -2175,3 +2175,44 @@ explain SELECT DISTINCT BIT_OR(100) OVER () FROM t1 GROUP BY LEFT('2018-08-24', 100) having 1=1 limit 0; drop table t1; + +--echo # +--echo # MDEV-13170: Database service (MySQL) stops after update with trigger +--echo # + +CREATE TABLE t1 ( t1_id int, point_id int, ml_id int, UNIQUE KEY t1_ml_u (ml_id,point_id)) ; +INSERT INTO t1 VALUES (1,1,8884),(2,1,8885); + +CREATE TABLE t2 ( db_time datetime, au_nr int, col_id int, new_val int); +CREATE TABLE t3 (id1 int, id2 int, d1 int); + +delimiter //; + +CREATE TRIGGER t1_aurtrg AFTER UPDATE ON t1 FOR EACH ROW begin +CREATE OR REPLACE TEMPORARY TABLE trg_u AS +WITH l AS + (SELECT a.*, + Max(t2.col_id) over (PARTITION BY a.d1), + Max(t2.new_val) over (PARTITION BY a.d1) + FROM + (SELECT d1 , id1, id2 FROM t3) a + JOIN t2 ON (a.d1=t2.db_time AND a.id1=t2.au_nr)) +SELECT 1; + + END;// + + delimiter ;// +--error 1062 +update t1 set ml_id=8884 where point_id=1; +--error 1062 +update t1 set ml_id=8884 where point_id=1; +drop table t1, t2,t3; + +CREATE TABLE t1 (i INT, a char); +INSERT INTO t1 VALUES (1, 'a'),(2, 'b'); +create view v1 as select * from t1; +PREPARE stmt FROM "SELECT i, row_number() over (partition by i order by i) FROM v1"; +execute stmt; +deallocate prepare stmt; +drop table t1; +drop view v1; diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 65f7c85b4ec..c3156ce1d5c 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2927,6 +2927,7 @@ void reinit_stmt_before_use(THD *thd, LEX *lex) { SELECT_LEX *sl= lex->all_selects_list; DBUG_ENTER("reinit_stmt_before_use"); + Window_spec *win_spec; /* We have to update "thd" pointer in LEX, all its units and in LEX::result, @@ -2995,6 +2996,17 @@ void reinit_stmt_before_use(THD *thd, LEX *lex) /* Fix ORDER list */ for (order= sl->order_list.first; order; order= order->next) order->item= &order->item_ptr; + /* Fix window functions too */ + List_iterator it(sl->window_specs); + + while ((win_spec= it++)) + { + for (order= win_spec->partition_list->first; order; order= order->next) + order->item= &order->item_ptr; + for (order= win_spec->order_list->first; order; order= order->next) + order->item= &order->item_ptr; + } + { #ifndef DBUG_OFF bool res= From ab812c108978b65f73076ff1e8fbf8011cb23787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 16 Nov 2018 10:36:57 +0200 Subject: [PATCH 22/26] MDEV-17726: A better fix THD::close_temporary_tables(): Revert the change. ha_innobase::delete_table(): Move the work-around inside a debug assertion, and check thd_kill_level() instead of thd_killed(), because the latter would not hold for KILL_CONNECTION. --- sql/temporary_tables.cc | 3 +-- storage/innobase/handler/ha_innodb.cc | 26 +++++++++++++++++--------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc index 574ed96ada8..3201b306fad 100644 --- a/sql/temporary_tables.cc +++ b/sql/temporary_tables.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2016,2018 MariaDB Corporation + Copyright (c) 2016 MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -476,7 +476,6 @@ bool THD::close_temporary_tables() } DBUG_ASSERT(!rgi_slave); - lex->sql_command = SQLCOM_DROP_TABLE; /* Ensure we don't have open HANDLERs for tables we are about to close. diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index be91befcf1a..293a80ecbcc 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -13187,17 +13187,25 @@ inline int ha_innobase::delete_table(const char* name, enum_sql_command sqlcom) int ha_innobase::delete_table(const char* name) { enum_sql_command sqlcom = enum_sql_command(thd_sql_command(ha_thd())); + /* SQLCOM_TRUNCATE should be passed via ha_innobase::truncate() only. - if (sqlcom == SQLCOM_TRUNCATE - && thd_killed(ha_thd()) - && (m_prebuilt == NULL - || dict_table_is_temporary(m_prebuilt->table))) { - sqlcom = SQLCOM_DROP_TABLE; - } + On client disconnect, when dropping temporary tables, the + previous sqlcom would not be overwritten. In such a case, we + will have thd_kill_level() != NOT_KILLED, !m_prebuilt can + hold, and sqlcom could be anything, including TRUNCATE. - /* SQLCOM_TRUNCATE will be passed via ha_innobase::truncate() only. */ - DBUG_ASSERT(sqlcom != SQLCOM_TRUNCATE); - return delete_table(name, sqlcom); + The sqlcom only matters for persistent tables; no persistent + metadata or FOREIGN KEY metadata is kept for temporary + tables. Therefore, we relax the assertion. If there is a bug + that slips through this assertion due to !m_prebuilt, the + worst impact should be that on DROP TABLE of a persistent + table, FOREIGN KEY constraints will be ignored and their + metadata will not be removed. */ + DBUG_ASSERT(sqlcom != SQLCOM_TRUNCATE + || (thd_kill_level(ha_thd()) != NOT_KILLED + && (!m_prebuilt + || m_prebuilt->table->is_temporary()))); + return delete_table(name, sqlcom); } /** Remove all tables in the named database inside InnoDB. From f037b910981aa2422af8cd043311eb8369e96f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 19 Nov 2018 11:11:53 +0200 Subject: [PATCH 23/26] MDEV-17726: Fix compiler warning Compare against the correct constant 0. NOT_KILLED belongs to enum killed_state, while THD_IS_NOT_KILLED is what we want. --- storage/innobase/handler/ha_innodb.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 293a80ecbcc..0b7bc5f16af 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -13202,7 +13202,7 @@ int ha_innobase::delete_table(const char* name) table, FOREIGN KEY constraints will be ignored and their metadata will not be removed. */ DBUG_ASSERT(sqlcom != SQLCOM_TRUNCATE - || (thd_kill_level(ha_thd()) != NOT_KILLED + || (thd_kill_level(ha_thd()) != THD_IS_NOT_KILLED && (!m_prebuilt || m_prebuilt->table->is_temporary()))); return delete_table(name, sqlcom); From cb5bca721b47cfb344146d5d104263da752661eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 19 Nov 2018 11:40:10 +0200 Subject: [PATCH 24/26] MDEV-17765 lock_discard_page() may fail to discard locks for SPATIAL INDEX lock_discard_page(): Traverse and discard the B-tree record locks only if they exist. Else, discard the R-tree (spatial) index locks. --- storage/innobase/lock/lock0lock.cc | 69 ++++++++++++++++-------------- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 3169313d874..a9cc8ab1901 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -3424,48 +3424,55 @@ lock_update_discard( lock_mutex_enter(); - if (!lock_rec_get_first_on_page(lock_sys->rec_hash, block) - && (!lock_rec_get_first_on_page(lock_sys->prdt_hash, block))) { - /* No locks exist on page, nothing to do */ + if (lock_rec_get_first_on_page(lock_sys->rec_hash, block)) { + ut_ad(!lock_rec_get_first_on_page(lock_sys->prdt_hash, block)); + ut_ad(!lock_rec_get_first_on_page(lock_sys->prdt_page_hash, + block)); + /* Inherit all the locks on the page to the record and + reset all the locks on the page */ - lock_mutex_exit(); + if (page_is_comp(page)) { + rec = page + PAGE_NEW_INFIMUM; - return; - } + do { + heap_no = rec_get_heap_no_new(rec); - /* Inherit all the locks on the page to the record and reset all - the locks on the page */ + lock_rec_inherit_to_gap(heir_block, block, + heir_heap_no, heap_no); - if (page_is_comp(page)) { - rec = page + PAGE_NEW_INFIMUM; + lock_rec_reset_and_release_wait( + block, heap_no); - do { - heap_no = rec_get_heap_no_new(rec); + rec = page + rec_get_next_offs(rec, TRUE); + } while (heap_no != PAGE_HEAP_NO_SUPREMUM); + } else { + rec = page + PAGE_OLD_INFIMUM; - lock_rec_inherit_to_gap(heir_block, block, - heir_heap_no, heap_no); + do { + heap_no = rec_get_heap_no_old(rec); - lock_rec_reset_and_release_wait(block, heap_no); + lock_rec_inherit_to_gap(heir_block, block, + heir_heap_no, heap_no); - rec = page + rec_get_next_offs(rec, TRUE); - } while (heap_no != PAGE_HEAP_NO_SUPREMUM); + lock_rec_reset_and_release_wait( + block, heap_no); + + rec = page + rec_get_next_offs(rec, FALSE); + } while (heap_no != PAGE_HEAP_NO_SUPREMUM); + } + + lock_rec_free_all_from_discard_page_low( + block->page.id.space(), block->page.id.page_no(), + lock_sys->rec_hash); } else { - rec = page + PAGE_OLD_INFIMUM; - - do { - heap_no = rec_get_heap_no_old(rec); - - lock_rec_inherit_to_gap(heir_block, block, - heir_heap_no, heap_no); - - lock_rec_reset_and_release_wait(block, heap_no); - - rec = page + rec_get_next_offs(rec, FALSE); - } while (heap_no != PAGE_HEAP_NO_SUPREMUM); + lock_rec_free_all_from_discard_page_low( + block->page.id.space(), block->page.id.page_no(), + lock_sys->prdt_hash); + lock_rec_free_all_from_discard_page_low( + block->page.id.space(), block->page.id.page_no(), + lock_sys->prdt_page_hash); } - lock_rec_free_all_from_discard_page(block); - lock_mutex_exit(); } From ff88e4bb8ae1bd8e903c403a598e7d2c5d2bbcaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 19 Nov 2018 11:42:14 +0200 Subject: [PATCH 25/26] Remove many redundant #include from InnoDB --- storage/innobase/btr/btr0btr.cc | 3 --- storage/innobase/buf/buf0buf.cc | 4 ---- storage/innobase/buf/buf0dblwr.cc | 1 - storage/innobase/buf/buf0flu.cc | 4 +--- storage/innobase/buf/buf0lru.cc | 1 - storage/innobase/buf/buf0rea.cc | 2 +- storage/innobase/data/data0data.cc | 2 -- storage/innobase/data/data0type.cc | 2 -- storage/innobase/dict/dict0boot.cc | 2 -- storage/innobase/dict/dict0crea.cc | 4 ---- storage/innobase/dict/dict0defrag_bg.cc | 5 +---- storage/innobase/dict/dict0dict.cc | 2 -- storage/innobase/dict/dict0load.cc | 3 --- storage/innobase/dict/dict0stats.cc | 3 --- storage/innobase/dict/dict0stats_bg.cc | 1 - storage/innobase/fil/fil0crypt.cc | 1 - storage/innobase/fil/fil0fil.cc | 4 ---- storage/innobase/fil/fil0pagecompress.cc | 1 - storage/innobase/fsp/fsp0file.cc | 5 ----- storage/innobase/fsp/fsp0fsp.cc | 3 --- storage/innobase/fsp/fsp0space.cc | 3 --- storage/innobase/fsp/fsp0sysspace.cc | 3 --- storage/innobase/fts/fts0ast.cc | 2 -- storage/innobase/fts/fts0fts.cc | 3 --- storage/innobase/fts/fts0opt.cc | 2 -- storage/innobase/fts/fts0que.cc | 3 --- storage/innobase/ha/ha0storage.cc | 1 - storage/innobase/handler/ha_innodb.cc | 2 -- storage/innobase/handler/handler0alter.cc | 4 +--- storage/innobase/handler/i_s.cc | 5 +---- storage/innobase/ibuf/ibuf0ibuf.cc | 3 --- storage/innobase/include/btr0bulk.h | 1 - storage/innobase/include/buf0buf.ic | 2 -- storage/innobase/include/dict0crea.h | 3 +-- storage/innobase/include/dict0dict.h | 2 -- storage/innobase/include/dict0load.h | 2 -- storage/innobase/include/dict0mem.h | 1 - storage/innobase/include/fsp0file.h | 5 +---- storage/innobase/include/fsp0fsp.h | 1 - storage/innobase/include/fsp0space.h | 2 -- storage/innobase/include/fsp0sysspace.h | 1 - storage/innobase/include/fts0ast.h | 1 - storage/innobase/include/fts0fts.h | 2 -- storage/innobase/include/fts0plugin.h | 2 +- storage/innobase/include/fts0types.ic | 3 --- storage/innobase/include/gis0type.h | 3 --- storage/innobase/include/log0recv.h | 2 -- storage/innobase/include/mem0mem.ic | 2 -- storage/innobase/include/page0types.h | 1 - storage/innobase/include/rem0cmp.h | 7 +++---- storage/innobase/include/rem0cmp.ic | 1 + storage/innobase/include/row0mysql.h | 16 +++++++--------- storage/innobase/include/row0trunc.h | 1 - storage/innobase/include/trx0purge.h | 2 ++ storage/innobase/include/trx0trx.h | 8 +++----- storage/innobase/include/trx0types.h | 2 -- storage/innobase/include/ut0mutex.h | 4 ---- storage/innobase/include/ut0new.h | 4 +--- storage/innobase/include/ut0vec.ic | 2 -- storage/innobase/lock/lock0lock.cc | 8 ++------ storage/innobase/lock/lock0prdt.cc | 9 --------- storage/innobase/lock/lock0wait.cc | 2 +- storage/innobase/log/log0log.cc | 2 +- storage/innobase/log/log0recv.cc | 4 +--- storage/innobase/mem/mem0mem.cc | 2 -- storage/innobase/mtr/mtr0mtr.cc | 1 - storage/innobase/os/os0event.cc | 2 -- storage/innobase/os/os0file.cc | 8 +------- storage/innobase/os/os0proc.cc | 7 +------ storage/innobase/os/os0thread.cc | 8 ++------ storage/innobase/page/page0cur.cc | 2 -- storage/innobase/pars/pars0opt.cc | 1 - storage/innobase/pars/pars0pars.cc | 3 --- storage/innobase/que/que0que.cc | 5 ----- storage/innobase/rem/rem0cmp.cc | 11 ++--------- storage/innobase/rem/rem0rec.cc | 8 ++------ storage/innobase/row/row0ftsort.cc | 7 +------ storage/innobase/row/row0import.cc | 4 ---- storage/innobase/row/row0ins.cc | 6 ------ storage/innobase/row/row0log.cc | 1 - storage/innobase/row/row0merge.cc | 4 ---- storage/innobase/row/row0mysql.cc | 4 +--- storage/innobase/row/row0quiesce.cc | 3 --- storage/innobase/row/row0row.cc | 2 -- storage/innobase/row/row0sel.cc | 2 -- storage/innobase/row/row0trunc.cc | 2 +- storage/innobase/row/row0umod.cc | 2 -- storage/innobase/row/row0undo.cc | 2 -- storage/innobase/row/row0upd.cc | 2 -- storage/innobase/row/row0vers.cc | 2 -- storage/innobase/srv/srv0conc.cc | 4 +--- storage/innobase/srv/srv0srv.cc | 3 --- storage/innobase/srv/srv0start.cc | 4 ---- storage/innobase/sync/sync0arr.cc | 6 ------ storage/innobase/sync/sync0debug.cc | 3 --- storage/innobase/sync/sync0rw.cc | 9 --------- storage/innobase/trx/trx0i_s.cc | 9 +++------ storage/innobase/trx/trx0purge.cc | 3 --- storage/innobase/trx/trx0rec.cc | 1 - storage/innobase/trx/trx0roll.cc | 6 +----- storage/innobase/trx/trx0rseg.cc | 1 - storage/innobase/trx/trx0sys.cc | 3 --- storage/innobase/trx/trx0trx.cc | 4 ---- storage/innobase/trx/trx0undo.cc | 3 --- storage/innobase/ut/ut0dbg.cc | 3 +-- storage/innobase/ut/ut0new.cc | 2 -- storage/innobase/ut/ut0rbt.cc | 3 --- 107 files changed, 47 insertions(+), 313 deletions(-) diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index 696d493e078..d06568535e6 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -26,9 +26,7 @@ Created 6/2/1994 Heikki Tuuri *******************************************************/ #include "btr0btr.h" -#include "ha_prototypes.h" -#include "fsp0sysspace.h" #include "page0page.h" #include "page0zip.h" #include "gis0rtree.h" @@ -43,7 +41,6 @@ Created 6/2/1994 Heikki Tuuri #include "trx0trx.h" #include "srv0mon.h" #include "gis0geo.h" -#include "ut0new.h" #include "dict0boot.h" #include "row0sel.h" /* row_search_max_autoinc() */ diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index be70a723232..2f6eb080958 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -47,7 +47,6 @@ Created 11/5/1995 Heikki Tuuri #include "btr0btr.h" #include "fil0fil.h" #include "fil0crypt.h" -#include "fsp0sysspace.h" #include "buf0buddy.h" #include "lock0lock.h" #include "sync0rw.h" @@ -62,12 +61,10 @@ Created 11/5/1995 Heikki Tuuri #include "dict0dict.h" #include "log0recv.h" #include "srv0mon.h" -#include "fsp0sysspace.h" #endif /* !UNIV_INNOCHECKSUM */ #include "page0zip.h" #include "sync0sync.h" #include "buf0dump.h" -#include "ut0new.h" #include #include #include @@ -75,7 +72,6 @@ Created 11/5/1995 Heikki Tuuri #include "fil0pagecompress.h" #include "fsp0pagecompress.h" #endif -#include "ha_prototypes.h" #include "ut0byte.h" #include diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc index bed24fd7704..f7b31eefa41 100644 --- a/storage/innobase/buf/buf0dblwr.cc +++ b/storage/innobase/buf/buf0dblwr.cc @@ -24,7 +24,6 @@ Doublwrite buffer module Created 2011/12/19 *******************************************************/ -#include "ha_prototypes.h" #include "buf0dblwr.h" #include "buf0buf.h" #include "buf0checksum.h" diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index a73b841b627..a84a79669a7 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -25,9 +25,8 @@ The database buffer buf_pool flush algorithm Created 11/11/1995 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" +#include "univ.i" #include -#include #include #include "buf0flu.h" @@ -47,7 +46,6 @@ Created 11/11/1995 Heikki Tuuri #include "os0file.h" #include "trx0sys.h" #include "srv0mon.h" -#include "fsp0sysspace.h" #include "ut0stage.h" #include "fil0pagecompress.h" #ifdef UNIV_LINUX diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc index 331f6d4a3f2..9218ea1b141 100644 --- a/storage/innobase/buf/buf0lru.cc +++ b/storage/innobase/buf/buf0lru.cc @@ -44,7 +44,6 @@ Created 11/5/1995 Heikki Tuuri #include "log0recv.h" #include "srv0srv.h" #include "srv0mon.h" -#include "lock0lock.h" /** The number of blocks from the LRU_old pointer onward, including the block pointed to, must be buf_pool->LRU_old_ratio/BUF_LRU_OLD_RATIO_DIV diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc index 3d5a319a820..372b1c5e0a0 100644 --- a/storage/innobase/buf/buf0rea.cc +++ b/storage/innobase/buf/buf0rea.cc @@ -24,7 +24,7 @@ The database buffer read Created 11/5/1995 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" +#include "univ.i" #include #include "buf0rea.h" diff --git a/storage/innobase/data/data0data.cc b/storage/innobase/data/data0data.cc index 7fb0eae611c..cd5a8024db1 100644 --- a/storage/innobase/data/data0data.cc +++ b/storage/innobase/data/data0data.cc @@ -24,8 +24,6 @@ SQL data field and tuple Created 5/30/1994 Heikki Tuuri *************************************************************************/ -#include "ha_prototypes.h" - #include "data0data.h" #include "rem0rec.h" #include "rem0cmp.h" diff --git a/storage/innobase/data/data0type.cc b/storage/innobase/data/data0type.cc index 54cdfa35803..02e79ab6983 100644 --- a/storage/innobase/data/data0type.cc +++ b/storage/innobase/data/data0type.cc @@ -24,8 +24,6 @@ Data types Created 1/16/1996 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" - #include "data0type.h" /* At the database startup we store the default-charset collation number of diff --git a/storage/innobase/dict/dict0boot.cc b/storage/innobase/dict/dict0boot.cc index ec53591c323..43c64c86aec 100644 --- a/storage/innobase/dict/dict0boot.cc +++ b/storage/innobase/dict/dict0boot.cc @@ -24,8 +24,6 @@ Data dictionary creation and booting Created 4/18/1996 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" - #include "dict0boot.h" #include "dict0crea.h" #include "btr0btr.h" diff --git a/storage/innobase/dict/dict0crea.cc b/storage/innobase/dict/dict0crea.cc index 758a45de943..d66762a011e 100644 --- a/storage/innobase/dict/dict0crea.cc +++ b/storage/innobase/dict/dict0crea.cc @@ -24,8 +24,6 @@ Database object creation Created 1/8/1996 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" - #include "dict0crea.h" #include "btr0pcur.h" #include "btr0btr.h" @@ -42,8 +40,6 @@ Created 1/8/1996 Heikki Tuuri #include "ut0vec.h" #include "dict0priv.h" #include "fts0priv.h" -#include "fsp0space.h" -#include "fsp0sysspace.h" #include "srv0start.h" /*****************************************************************//** diff --git a/storage/innobase/dict/dict0defrag_bg.cc b/storage/innobase/dict/dict0defrag_bg.cc index 69038d4cb77..6347a239812 100644 --- a/storage/innobase/dict/dict0defrag_bg.cc +++ b/storage/innobase/dict/dict0defrag_bg.cc @@ -27,11 +27,8 @@ Created 25/08/2016 Jan Lindström #include "dict0stats.h" #include "dict0stats_bg.h" #include "dict0defrag_bg.h" -#include "row0mysql.h" +#include "btr0btr.h" #include "srv0start.h" -#include "ut0new.h" - -#include static ib_mutex_t defrag_pool_mutex; diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index 436612c195f..914c9946977 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -60,7 +60,6 @@ ib_warn_row_too_big(const dict_table_t* table); #include "dict0mem.h" #include "dict0priv.h" #include "dict0stats.h" -#include "fsp0sysspace.h" #include "fts0fts.h" #include "fts0types.h" #include "lock0lock.h" @@ -81,7 +80,6 @@ ib_warn_row_too_big(const dict_table_t* table); #include "srv0start.h" #include "sync0sync.h" #include "trx0undo.h" -#include "ut0new.h" #include #include diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc index 77415d30643..2fe34886df2 100644 --- a/storage/innobase/dict/dict0load.cc +++ b/storage/innobase/dict/dict0load.cc @@ -25,8 +25,6 @@ from dictionary tables Created 4/24/1996 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" - #include "dict0load.h" #include "mysql_version.h" @@ -39,7 +37,6 @@ Created 4/24/1996 Heikki Tuuri #include "dict0priv.h" #include "dict0stats.h" #include "fsp0file.h" -#include "fsp0sysspace.h" #include "fts0priv.h" #include "mach0data.h" #include "page0page.h" diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc index 2719c7e7222..7f3930ba18b 100644 --- a/storage/innobase/dict/dict0stats.cc +++ b/storage/innobase/dict/dict0stats.cc @@ -25,7 +25,6 @@ Created Jan 06, 2010 Vasil Dimov *******************************************************/ #include "univ.i" - #include "ut0ut.h" #include "ut0rnd.h" #include "dyn0buf.h" @@ -33,8 +32,6 @@ Created Jan 06, 2010 Vasil Dimov #include "trx0trx.h" #include "pars0pars.h" #include "dict0stats.h" -#include "ha_prototypes.h" -#include "ut0new.h" #include #include "btr0btr.h" diff --git a/storage/innobase/dict/dict0stats_bg.cc b/storage/innobase/dict/dict0stats_bg.cc index 423558f70c8..55bcafddc70 100644 --- a/storage/innobase/dict/dict0stats_bg.cc +++ b/storage/innobase/dict/dict0stats_bg.cc @@ -30,7 +30,6 @@ Created Apr 25, 2012 Vasil Dimov #include "dict0defrag_bg.h" #include "row0mysql.h" #include "srv0start.h" -#include "ut0new.h" #include "fil0fil.h" #ifdef WITH_WSREP # include "mysql/service_wsrep.h" diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index 6c32531a07e..77760d7159a 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -39,7 +39,6 @@ Modified Jan Lindström jan.lindstrom@mariadb.com #include "btr0scrub.h" #include "fsp0fsp.h" #include "fil0pagecompress.h" -#include "ha_prototypes.h" // IB_LOG_ #include /** Mutex for keys */ diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 38ad8caf137..6c5ae70a2cc 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -33,10 +33,7 @@ Created 10/25/1995 Heikki Tuuri #include "dict0boot.h" #include "dict0dict.h" #include "fsp0file.h" -#include "fsp0file.h" #include "fsp0fsp.h" -#include "fsp0space.h" -#include "fsp0sysspace.h" #include "hash0hash.h" #include "log0log.h" #include "log0recv.h" @@ -49,7 +46,6 @@ Created 10/25/1995 Heikki Tuuri #include "row0trunc.h" #include "srv0start.h" #include "trx0purge.h" -#include "ut0new.h" #include "buf0lru.h" #include "ibuf0ibuf.h" #include "os0event.h" diff --git a/storage/innobase/fil/fil0pagecompress.cc b/storage/innobase/fil/fil0pagecompress.cc index 491de512156..1c734f39f15 100644 --- a/storage/innobase/fil/fil0pagecompress.cc +++ b/storage/innobase/fil/fil0pagecompress.cc @@ -47,7 +47,6 @@ Updated 14/02/2015 #include "page0zip.h" #include "trx0sys.h" #include "row0mysql.h" -#include "ha_prototypes.h" // IB_LOG_ #include "buf0lru.h" #include "ibuf0ibuf.h" #include "sync0sync.h" diff --git a/storage/innobase/fsp/fsp0file.cc b/storage/innobase/fsp/fsp0file.cc index 6e9f307ebc8..4a8874d0fa5 100644 --- a/storage/innobase/fsp/fsp0file.cc +++ b/storage/innobase/fsp/fsp0file.cc @@ -24,16 +24,11 @@ Tablespace data file implementation Created 2013-7-26 by Kevin Lewis *******************************************************/ -#include "ha_prototypes.h" - #include "fil0fil.h" #include "fsp0types.h" -#include "fsp0sysspace.h" #include "os0file.h" #include "page0page.h" #include "srv0start.h" -#include "ut0new.h" -#include "fil0crypt.h" /** Initialize the name, size and order of this datafile @param[in] name tablespace name, will be copied diff --git a/storage/innobase/fsp/fsp0fsp.cc b/storage/innobase/fsp/fsp0fsp.cc index 7bf31504119..11c5c65d861 100644 --- a/storage/innobase/fsp/fsp0fsp.cc +++ b/storage/innobase/fsp/fsp0fsp.cc @@ -24,8 +24,6 @@ File space management Created 11/29/1995 Heikki Tuuri ***********************************************************************/ -#include "ha_prototypes.h" - #include "fsp0fsp.h" #include "buf0buf.h" #include "fil0fil.h" @@ -41,7 +39,6 @@ Created 11/29/1995 Heikki Tuuri #include "btr0sea.h" #include "dict0boot.h" #include "log0log.h" -#include "fsp0sysspace.h" #include "dict0mem.h" #include "fsp0types.h" diff --git a/storage/innobase/fsp/fsp0space.cc b/storage/innobase/fsp/fsp0space.cc index 9ca2786b935..df234f7274e 100644 --- a/storage/innobase/fsp/fsp0space.cc +++ b/storage/innobase/fsp/fsp0space.cc @@ -24,9 +24,6 @@ Shared tablespace implementation. Created 2012-11-16 by Sunny Bains as srv/srv0space.cc *******************************************************/ -#include "ha_prototypes.h" - -#include "fsp0space.h" #include "fsp0sysspace.h" #include "fsp0fsp.h" #include "os0file.h" diff --git a/storage/innobase/fsp/fsp0sysspace.cc b/storage/innobase/fsp/fsp0sysspace.cc index e9f04cbd6c5..baf864bc1c3 100644 --- a/storage/innobase/fsp/fsp0sysspace.cc +++ b/storage/innobase/fsp/fsp0sysspace.cc @@ -24,8 +24,6 @@ Created 2012-11-16 by Sunny Bains as srv/srv0space.cc Refactored 2013-7-26 by Kevin Lewis *******************************************************/ -#include "ha_prototypes.h" - #include "fsp0sysspace.h" #include "srv0start.h" #include "trx0sys.h" @@ -33,7 +31,6 @@ Refactored 2013-7-26 by Kevin Lewis #include "mem0mem.h" #include "os0file.h" #include "row0mysql.h" -#include "ut0new.h" /** The server header file is included to access opt_initialize global variable. If server passes the option for create/open DB to SE, we should remove such diff --git a/storage/innobase/fts/fts0ast.cc b/storage/innobase/fts/fts0ast.cc index d6695cec5be..9a5eb2b49bb 100644 --- a/storage/innobase/fts/fts0ast.cc +++ b/storage/innobase/fts/fts0ast.cc @@ -24,8 +24,6 @@ Full Text Search parser helper file. Created 2007/3/16 Sunny Bains. ***********************************************************************/ -#include "ha_prototypes.h" - #include "fts0ast.h" #include "fts0pars.h" #include "fts0fts.h" diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc index aadd0e7a554..7d6dd75ced8 100644 --- a/storage/innobase/fts/fts0fts.cc +++ b/storage/innobase/fts/fts0fts.cc @@ -22,8 +22,6 @@ this program; if not, write to the Free Software Foundation, Inc., Full Text Search interface ***********************************************************************/ -#include "ha_prototypes.h" - #include "trx0roll.h" #include "row0mysql.h" #include "row0upd.h" @@ -40,7 +38,6 @@ Full Text Search interface #include "dict0stats.h" #include "btr0pcur.h" #include "sync0sync.h" -#include "ut0new.h" static const ulint FTS_MAX_ID_LEN = 32; diff --git a/storage/innobase/fts/fts0opt.cc b/storage/innobase/fts/fts0opt.cc index 9adfb16c438..a87e7091c1a 100644 --- a/storage/innobase/fts/fts0opt.cc +++ b/storage/innobase/fts/fts0opt.cc @@ -26,8 +26,6 @@ Completed 2011/7/10 Sunny and Jimmy Yang ***********************************************************************/ -#include "ha_prototypes.h" - #include "fts0fts.h" #include "row0sel.h" #include "que0types.h" diff --git a/storage/innobase/fts/fts0que.cc b/storage/innobase/fts/fts0que.cc index f4f10b7f016..2396a376853 100644 --- a/storage/innobase/fts/fts0que.cc +++ b/storage/innobase/fts/fts0que.cc @@ -25,8 +25,6 @@ Created 2007/03/27 Sunny Bains Completed 2011/7/10 Sunny and Jimmy Yang *******************************************************/ -#include "ha_prototypes.h" - #include "dict0dict.h" #include "ut0rbt.h" #include "row0sel.h" @@ -36,7 +34,6 @@ Completed 2011/7/10 Sunny and Jimmy Yang #include "fts0pars.h" #include "fts0types.h" #include "fts0plugin.h" -#include "ut0new.h" #include #include diff --git a/storage/innobase/ha/ha0storage.cc b/storage/innobase/ha/ha0storage.cc index cde4cc04cb7..a6960675adc 100644 --- a/storage/innobase/ha/ha0storage.cc +++ b/storage/innobase/ha/ha0storage.cc @@ -25,7 +25,6 @@ its own storage, avoiding duplicates. Created September 22, 2007 Vasil Dimov *******************************************************/ -#include "ha_prototypes.h" #include "ha0storage.h" #include "hash0hash.h" #include "mem0mem.h" diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 0b7bc5f16af..e6c57b015a0 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -78,8 +78,6 @@ this program; if not, write to the Free Software Foundation, Inc., #include "dict0stats_bg.h" #include "fil0fil.h" #include "fsp0fsp.h" -#include "fsp0space.h" -#include "fsp0sysspace.h" #include "fts0fts.h" #include "fts0plugin.h" #include "fts0priv.h" diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 7a4d4221e09..632b5dd5a5a 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -23,7 +23,7 @@ Smart ALTER TABLE *******************************************************/ /* Include necessary SQL headers */ -#include "ha_prototypes.h" +#include "univ.i" #include #include #include @@ -38,7 +38,6 @@ Smart ALTER TABLE #include "dict0priv.h" #include "dict0stats.h" #include "dict0stats_bg.h" -#include "fsp0sysspace.h" #include "log0log.h" #include "rem0types.h" #include "row0log.h" @@ -52,7 +51,6 @@ Smart ALTER TABLE #include "pars0pars.h" #include "row0sel.h" #include "ha_innodb.h" -#include "ut0new.h" #include "ut0stage.h" static const char *MSG_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN= diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index 064e0e88113..3e5fca6541a 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -25,10 +25,9 @@ Created July 18, 2007 Vasil Dimov Modified Dec 29, 2014 Jan Lindström (Added sys_semaphore_waits) *******************************************************/ -#include "ha_prototypes.h" +#include "univ.i" #include #include -#include "univ.i" #include #include @@ -58,8 +57,6 @@ Modified Dec 29, 2014 Jan Lindström (Added sys_semaphore_waits) #include "sync0arr.h" #include "fil0fil.h" #include "fil0crypt.h" -#include "fsp0sysspace.h" -#include "ut0new.h" #include "dict0crea.h" /** structure associates a name string with a file page type and/or buffer diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc index b45333eba5a..1fd7f7a2241 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -24,8 +24,6 @@ Insert buffer Created 7/19/1997 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" - #include "ibuf0ibuf.h" #include "sync0sync.h" #include "btr0sea.h" @@ -58,7 +56,6 @@ my_bool srv_ibuf_disable_background_merge; #include "log0recv.h" #include "que0que.h" #include "srv0start.h" /* srv_shutdown_state */ -#include "fsp0sysspace.h" #include "rem0cmp.h" /* STRUCTURE OF AN INSERT BUFFER RECORD diff --git a/storage/innobase/include/btr0bulk.h b/storage/innobase/include/btr0bulk.h index edf34bd5ae4..a63ab9ded0d 100644 --- a/storage/innobase/include/btr0bulk.h +++ b/storage/innobase/include/btr0bulk.h @@ -28,7 +28,6 @@ Created 03/11/2014 Shaohua Wang #include "dict0dict.h" #include "page0cur.h" -#include "ut0new.h" #include diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic index da7bff31821..91c602f71b0 100644 --- a/storage/innobase/include/buf0buf.ic +++ b/storage/innobase/include/buf0buf.ic @@ -35,9 +35,7 @@ Created 11/5/1995 Heikki Tuuri #include "buf0flu.h" #include "buf0lru.h" #include "buf0rea.h" -#include "sync0debug.h" #include "fsp0types.h" -#include "ut0new.h" /** A chunk of buffers. The buffer pool is allocated in chunks. */ struct buf_chunk_t{ diff --git a/storage/innobase/include/dict0crea.h b/storage/innobase/include/dict0crea.h index 5d149f24921..c57a63652a2 100644 --- a/storage/innobase/include/dict0crea.h +++ b/storage/innobase/include/dict0crea.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2017, 2018, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -34,7 +34,6 @@ Created 1/8/1996 Heikki Tuuri #include "row0types.h" #include "mtr0mtr.h" #include "fil0crypt.h" -#include "fsp0space.h" /*********************************************************************//** Creates a table create graph. diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index bb4e15ea329..44aff739d93 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -34,7 +34,6 @@ Created 1/8/1996 Heikki Tuuri #include "dict0mem.h" #include "dict0types.h" #include "fsp0fsp.h" -#include "fsp0sysspace.h" #include "hash0hash.h" #include "mem0mem.h" #include "rem0types.h" @@ -42,7 +41,6 @@ Created 1/8/1996 Heikki Tuuri #include "trx0types.h" #include "ut0byte.h" #include "ut0mem.h" -#include "ut0new.h" #include "ut0rnd.h" #include #include "fsp0fsp.h" diff --git a/storage/innobase/include/dict0load.h b/storage/innobase/include/dict0load.h index 9ba42007568..b35add02d9d 100644 --- a/storage/innobase/include/dict0load.h +++ b/storage/innobase/include/dict0load.h @@ -28,13 +28,11 @@ Created 4/24/1996 Heikki Tuuri #ifndef dict0load_h #define dict0load_h -#include "univ.i" #include "dict0types.h" #include "trx0types.h" #include "ut0byte.h" #include "mem0mem.h" #include "btr0types.h" -#include "ut0new.h" #include diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index fc120149c5f..671018d20e9 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -47,7 +47,6 @@ Created 1/8/1996 Heikki Tuuri #include "buf0buf.h" #include "gis0type.h" #include "os0once.h" -#include "ut0new.h" #include "fil0fil.h" #include #include "fil0crypt.h" diff --git a/storage/innobase/include/fsp0file.h b/storage/innobase/include/fsp0file.h index 68e9f687fcd..9bc7b4bf9c9 100644 --- a/storage/innobase/include/fsp0file.h +++ b/storage/innobase/include/fsp0file.h @@ -27,12 +27,9 @@ Created 2013-7-26 by Kevin Lewis #ifndef fsp0file_h #define fsp0file_h -#include "ha_prototypes.h" -#include "log0log.h" #include "mem0mem.h" #include "os0file.h" -#include "fil0crypt.h" -#include +#include "fil0fil.h" /** Types of raw partitions in innodb_data_file_path */ enum device_t { diff --git a/storage/innobase/include/fsp0fsp.h b/storage/innobase/include/fsp0fsp.h index 3e4c0368b00..af60383b0ca 100644 --- a/storage/innobase/include/fsp0fsp.h +++ b/storage/innobase/include/fsp0fsp.h @@ -33,7 +33,6 @@ Created 12/18/1995 Heikki Tuuri #ifndef UNIV_INNOCHECKSUM -#include "fsp0space.h" #include "fut0lst.h" #include "mtr0mtr.h" #include "page0types.h" diff --git a/storage/innobase/include/fsp0space.h b/storage/innobase/include/fsp0space.h index 9f869fda158..88e5bb583de 100644 --- a/storage/innobase/include/fsp0space.h +++ b/storage/innobase/include/fsp0space.h @@ -27,11 +27,9 @@ Created 2013-7-26 by Kevin Lewis #ifndef fsp0space_h #define fsp0space_h -#include "univ.i" #include "fsp0file.h" #include "fsp0fsp.h" #include "fsp0types.h" -#include "ut0new.h" #include diff --git a/storage/innobase/include/fsp0sysspace.h b/storage/innobase/include/fsp0sysspace.h index efbd4fc3f24..a60891c5515 100644 --- a/storage/innobase/include/fsp0sysspace.h +++ b/storage/innobase/include/fsp0sysspace.h @@ -26,7 +26,6 @@ Created 2013-7-26 by Kevin Lewis #ifndef fsp0sysspace_h #define fsp0sysspace_h -#include "univ.i" #include "fsp0space.h" /** If the last data file is auto-extended, we add this many pages to it diff --git a/storage/innobase/include/fts0ast.h b/storage/innobase/include/fts0ast.h index 2a2b25c36bd..0b55d458036 100644 --- a/storage/innobase/include/fts0ast.h +++ b/storage/innobase/include/fts0ast.h @@ -27,7 +27,6 @@ Created 2007/03/16/03 Sunny Bains #ifndef INNOBASE_FST0AST_H #define INNOBASE_FST0AST_H -#include "ha_prototypes.h" #include "mem0mem.h" #ifdef UNIV_PFS_MEMORY diff --git a/storage/innobase/include/fts0fts.h b/storage/innobase/include/fts0fts.h index 11749c991f0..ce628438cb0 100644 --- a/storage/innobase/include/fts0fts.h +++ b/storage/innobase/include/fts0fts.h @@ -27,8 +27,6 @@ Created 2011/09/02 Sunny Bains #ifndef fts0fts_h #define fts0fts_h -#include "ha_prototypes.h" - #include "data0type.h" #include "data0types.h" #include "dict0types.h" diff --git a/storage/innobase/include/fts0plugin.h b/storage/innobase/include/fts0plugin.h index 9bc9b6b9dd7..1e822ec3415 100644 --- a/storage/innobase/include/fts0plugin.h +++ b/storage/innobase/include/fts0plugin.h @@ -26,7 +26,7 @@ Created 2013/06/04 Shaohua Wang #ifndef INNOBASE_FTS0PLUGIN_H #define INNOBASE_FTS0PLUGIN_H -#include "ha_prototypes.h" +#include "univ.i" extern struct st_mysql_ftparser fts_default_parser; diff --git a/storage/innobase/include/fts0types.ic b/storage/innobase/include/fts0types.ic index a8712751412..18bc87213fc 100644 --- a/storage/innobase/include/fts0types.ic +++ b/storage/innobase/include/fts0types.ic @@ -27,9 +27,6 @@ Created 2007-03-27 Sunny Bains #ifndef INNOBASE_FTS0TYPES_IC #define INNOBASE_FTS0TYPES_IC -#include "rem0cmp.h" -#include "ha_prototypes.h" - /******************************************************************//** Duplicate a string. @return < 0 if n1 < n2, 0 if n1 == n2, > 0 if n1 > n2 */ diff --git a/storage/innobase/include/gis0type.h b/storage/innobase/include/gis0type.h index 14c098f9608..887b06f3613 100644 --- a/storage/innobase/include/gis0type.h +++ b/storage/innobase/include/gis0type.h @@ -26,8 +26,6 @@ Created 2013/03/27 Jimmy Yang #ifndef gis0type_h #define gis0type_h -#include "univ.i" - #include "buf0buf.h" #include "data0type.h" #include "data0types.h" @@ -41,7 +39,6 @@ Created 2013/03/27 Jimmy Yang #include "ut0wqueue.h" #include "que0types.h" #include "gis0geo.h" -#include "ut0new.h" #include #include diff --git a/storage/innobase/include/log0recv.h b/storage/innobase/include/log0recv.h index d3c891c9cba..267f8f6778d 100644 --- a/storage/innobase/include/log0recv.h +++ b/storage/innobase/include/log0recv.h @@ -27,13 +27,11 @@ Created 9/20/1997 Heikki Tuuri #ifndef log0recv_h #define log0recv_h -#include "univ.i" #include "ut0byte.h" #include "buf0types.h" #include "hash0hash.h" #include "log0log.h" #include "mtr0types.h" -#include "ut0new.h" #include #include diff --git a/storage/innobase/include/mem0mem.ic b/storage/innobase/include/mem0mem.ic index 4d76f07694d..42dda9e0bb9 100644 --- a/storage/innobase/include/mem0mem.ic +++ b/storage/innobase/include/mem0mem.ic @@ -24,8 +24,6 @@ The memory management Created 6/8/1994 Heikki Tuuri *************************************************************************/ -#include "ut0new.h" - #ifdef UNIV_DEBUG # define mem_heap_create_block(heap, n, type, file_name, line) \ mem_heap_create_block_func(heap, n, file_name, line, type) diff --git a/storage/innobase/include/page0types.h b/storage/innobase/include/page0types.h index fe56468c454..53a03466dde 100644 --- a/storage/innobase/include/page0types.h +++ b/storage/innobase/include/page0types.h @@ -29,7 +29,6 @@ Created 2/2/1994 Heikki Tuuri #include "univ.i" #include "dict0types.h" #include "mtr0types.h" -#include "ut0new.h" #include diff --git a/storage/innobase/include/rem0cmp.h b/storage/innobase/include/rem0cmp.h index 216e3a7655b..899624a003e 100644 --- a/storage/innobase/include/rem0cmp.h +++ b/storage/innobase/include/rem0cmp.h @@ -27,12 +27,11 @@ Created 7/1/1994 Heikki Tuuri #ifndef rem0cmp_h #define rem0cmp_h -#include "ha_prototypes.h" #include "data0data.h" #include "data0type.h" -#include "dict0dict.h" -#include "rem0rec.h" -#include +#include "dict0types.h" +#include "rem0types.h" +#include "page0types.h" /*************************************************************//** Returns TRUE if two columns are equal for comparison purposes. diff --git a/storage/innobase/include/rem0cmp.ic b/storage/innobase/include/rem0cmp.ic index bf913b93bfb..290c1455f27 100644 --- a/storage/innobase/include/rem0cmp.ic +++ b/storage/innobase/include/rem0cmp.ic @@ -24,6 +24,7 @@ Created 7/1/1994 Heikki Tuuri ************************************************************************/ #include +#include /** Compare two data fields. @param[in] dfield1 data field; must have type field set diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h index a16fd30c6ea..f3fdf5b4c42 100644 --- a/storage/innobase/include/row0mysql.h +++ b/storage/innobase/include/row0mysql.h @@ -28,21 +28,19 @@ Created 9/17/2000 Heikki Tuuri #ifndef row0mysql_h #define row0mysql_h -#include "ha_prototypes.h" -#include "sql_list.h" -#include "sql_cmd.h" - #include "data0data.h" #include "que0types.h" #include "dict0types.h" #include "trx0types.h" #include "row0types.h" -#include "btr0pcur.h" -#include "trx0types.h" -#include "fil0crypt.h" +#include "btr0types.h" +#include "lock0types.h" +#include "fil0fil.h" +#include "fts0fts.h" +#include "gis0type.h" -// Forward declaration -struct SysIndexCallback; +#include "sql_list.h" +#include "sql_cmd.h" extern ibool row_rollback_on_timeout; diff --git a/storage/innobase/include/row0trunc.h b/storage/innobase/include/row0trunc.h index 4d6bdee225c..5915596a389 100644 --- a/storage/innobase/include/row0trunc.h +++ b/storage/innobase/include/row0trunc.h @@ -31,7 +31,6 @@ Created 2013-04-25 Krunal Bauskar #include "dict0boot.h" #include "fil0fil.h" #include "srv0start.h" -#include "ut0new.h" #include diff --git a/storage/innobase/include/trx0purge.h b/storage/innobase/include/trx0purge.h index 8d31a50f028..5aae3a530f7 100644 --- a/storage/innobase/include/trx0purge.h +++ b/storage/innobase/include/trx0purge.h @@ -36,6 +36,8 @@ Created 3/26/1996 Heikki Tuuri #include "fil0fil.h" #include "read0types.h" +#include + /** A dummy undo record used as a return value when we have a whole undo log which needs no purge */ extern trx_undo_rec_t trx_purge_dummy_rec; diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index 917222477b1..440f4101c5c 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -27,21 +27,19 @@ Created 3/26/1996 Heikki Tuuri #ifndef trx0trx_h #define trx0trx_h -#include - -#include "ha_prototypes.h" - #include "dict0types.h" #include "trx0types.h" #include "lock0types.h" -#include "log0log.h" #include "que0types.h" #include "mem0mem.h" #include "trx0xa.h" #include "ut0vec.h" #include "fts0fts.h" +#include +#include + // Forward declaration struct mtr_t; diff --git a/storage/innobase/include/trx0types.h b/storage/innobase/include/trx0types.h index b42871bef31..de26de44193 100644 --- a/storage/innobase/include/trx0types.h +++ b/storage/innobase/include/trx0types.h @@ -29,10 +29,8 @@ Created 3/26/1996 Heikki Tuuri #include "ut0byte.h" #include "ut0mutex.h" -#include "ut0new.h" #include -#include #include //#include diff --git a/storage/innobase/include/ut0mutex.h b/storage/innobase/include/ut0mutex.h index dc387dadbdc..3dbd7919a2f 100644 --- a/storage/innobase/include/ut0mutex.h +++ b/storage/innobase/include/ut0mutex.h @@ -29,12 +29,8 @@ Created 2012-03-24 Sunny Bains. #ifndef ut0mutex_h #define ut0mutex_h -extern uint srv_spin_wait_delay; -extern ulong srv_n_spin_wait_rounds; - #include "sync0policy.h" #include "ib0mutex.h" -#include /** Create a typedef using the MutexType @param[in] M Mutex type diff --git a/storage/innobase/include/ut0new.h b/storage/innobase/include/ut0new.h index 955e7b026c7..86fcbd59418 100644 --- a/storage/innobase/include/ut0new.h +++ b/storage/innobase/include/ut0new.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2014, 2015, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2017, 2018, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -136,8 +136,6 @@ InnoDB: #include "mysql/psi/psi_memory.h" /* PSI_memory_key, PSI_memory_info */ -#include "univ.i" - #include "os0proc.h" /* os_mem_alloc_large() */ #include "os0thread.h" /* os_thread_sleep() */ #include "ut0ut.h" /* ut_strcmp_functor, ut_basename_noext() */ diff --git a/storage/innobase/include/ut0vec.ic b/storage/innobase/include/ut0vec.ic index 17f4df579b6..bf774c84683 100644 --- a/storage/innobase/include/ut0vec.ic +++ b/storage/innobase/include/ut0vec.ic @@ -23,8 +23,6 @@ A vector of pointers to data items Created 4/6/2006 Osku Salerma ************************************************************************/ -#include "ut0new.h" - #define IB_VEC_OFFSET(v, i) (vec->sizeof_value * i) /******************************************************************** diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index a9cc8ab1901..c2a0494a5d7 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -26,8 +26,7 @@ Created 5/7/1996 Heikki Tuuri #define LOCK_MODULE_IMPLEMENTATION - -#include "ha_prototypes.h" +#include "univ.i" #include #include @@ -37,11 +36,8 @@ Created 5/7/1996 Heikki Tuuri #include "dict0mem.h" #include "trx0purge.h" #include "trx0sys.h" -#include "srv0mon.h" #include "ut0vec.h" -#include "btr0btr.h" -#include "dict0boot.h" -#include "ut0new.h" +#include "btr0cur.h" #include "row0sel.h" #include "row0mysql.h" #include "row0vers.h" diff --git a/storage/innobase/lock/lock0prdt.cc b/storage/innobase/lock/lock0prdt.cc index 5843508741d..a179b0719cf 100644 --- a/storage/innobase/lock/lock0prdt.cc +++ b/storage/innobase/lock/lock0prdt.cc @@ -29,17 +29,8 @@ Created 9/7/2013 Jimmy Yang #include "lock0lock.h" #include "lock0priv.h" #include "lock0prdt.h" -#include "ha_prototypes.h" -#include "trx0purge.h" #include "dict0mem.h" -#include "dict0boot.h" -#include "trx0sys.h" -#include "srv0mon.h" -#include "ut0vec.h" -#include "btr0btr.h" -#include "dict0boot.h" #include "que0que.h" -#include /*********************************************************************//** Get a minimum bounding box from a Predicate diff --git a/storage/innobase/lock/lock0wait.cc b/storage/innobase/lock/lock0wait.cc index d6c812e1af0..055c67bacc3 100644 --- a/storage/innobase/lock/lock0wait.cc +++ b/storage/innobase/lock/lock0wait.cc @@ -26,7 +26,7 @@ Created 25/5/2010 Sunny Bains #define LOCK_MODULE_IMPLEMENTATION -#include "ha_prototypes.h" +#include "univ.i" #include #include diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index 8fa8662ca31..4a789382004 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -31,7 +31,7 @@ Database log Created 12/9/1995 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" +#include "univ.i" #include #include diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 42623aa9655..f8e9a64f9d4 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -25,7 +25,7 @@ Recovery Created 9/20/1997 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" +#include "univ.i" #include #include @@ -52,8 +52,6 @@ Created 9/20/1997 Heikki Tuuri #include "trx0undo.h" #include "trx0rec.h" #include "fil0fil.h" -#include "fsp0sysspace.h" -#include "ut0new.h" #include "row0trunc.h" #include "buf0rea.h" #include "srv0srv.h" diff --git a/storage/innobase/mem/mem0mem.cc b/storage/innobase/mem/mem0mem.cc index c101980d543..b4f1dd0602f 100644 --- a/storage/innobase/mem/mem0mem.cc +++ b/storage/innobase/mem/mem0mem.cc @@ -24,8 +24,6 @@ The memory management Created 6/9/1994 Heikki Tuuri *************************************************************************/ -#include "ha_prototypes.h" - #include "mem0mem.h" #include "buf0buf.h" #include "srv0srv.h" diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc index 9367d537424..dafa41e7a9c 100644 --- a/storage/innobase/mtr/mtr0mtr.cc +++ b/storage/innobase/mtr/mtr0mtr.cc @@ -28,7 +28,6 @@ Created 11/26/1995 Heikki Tuuri #include "buf0buf.h" #include "buf0flu.h" -#include "fsp0sysspace.h" #include "page0types.h" #include "mtr0log.h" #include "log0log.h" diff --git a/storage/innobase/os/os0event.cc b/storage/innobase/os/os0event.cc index b687af3e21c..71b86df24a4 100644 --- a/storage/innobase/os/os0event.cc +++ b/storage/innobase/os/os0event.cc @@ -25,8 +25,6 @@ Created 2012-09-23 Sunny Bains #include "os0event.h" #include "ut0mutex.h" -#include "ha_prototypes.h" -#include "ut0new.h" #ifdef _WIN32 #include diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 4d71eaf552b..26cc70e6e41 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -34,11 +34,8 @@ Created 10/21/1995 Heikki Tuuri *******************************************************/ #ifndef UNIV_INNOCHECKSUM - -#include "ha_prototypes.h" -#include "sql_const.h" - #include "os0file.h" +#include "sql_const.h" #ifdef UNIV_LINUX #include @@ -48,9 +45,6 @@ Created 10/21/1995 Heikki Tuuri #include "srv0srv.h" #include "srv0start.h" #include "fil0fil.h" -#include "fil0crypt.h" -#include "fsp0fsp.h" -#include "fil0pagecompress.h" #include "srv0srv.h" #ifdef HAVE_LINUX_UNISTD_H #include "unistd.h" diff --git a/storage/innobase/os/os0proc.cc b/storage/innobase/os/os0proc.cc index 22966690ab0..1a6da03a402 100644 --- a/storage/innobase/os/os0proc.cc +++ b/storage/innobase/os/os0proc.cc @@ -24,12 +24,7 @@ process control primitives Created 9/30/1995 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" - -#include "os0proc.h" -#include "srv0srv.h" -#include "ut0mem.h" -#include "ut0byte.h" +#include "univ.i" /* FreeBSD for example has only MAP_ANON, Linux has MAP_ANONYMOUS and MAP_ANON but MAP_ANON is marked as deprecated */ diff --git a/storage/innobase/os/os0thread.cc b/storage/innobase/os/os0thread.cc index 3986c4f4c44..e0d96276b55 100644 --- a/storage/innobase/os/os0thread.cc +++ b/storage/innobase/os/os0thread.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2017, 2018, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -24,13 +24,9 @@ The interface to the operating system thread control primitives Created 9/8/1995 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" - +#include "univ.i" #include "os0thread.h" -#include "ut0new.h" #include "srv0srv.h" -#include "os0event.h" -#include /** Number of threads active. */ ulint os_thread_count; diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc index 6bdb7f56842..2327d11f1fa 100644 --- a/storage/innobase/page/page0cur.cc +++ b/storage/innobase/page/page0cur.cc @@ -25,8 +25,6 @@ The page cursor Created 10/4/1994 Heikki Tuuri *************************************************************************/ -#include "ha_prototypes.h" - #include "page0cur.h" #include "page0zip.h" #include "btr0btr.h" diff --git a/storage/innobase/pars/pars0opt.cc b/storage/innobase/pars/pars0opt.cc index f08037d15aa..934cd80fd14 100644 --- a/storage/innobase/pars/pars0opt.cc +++ b/storage/innobase/pars/pars0opt.cc @@ -33,7 +33,6 @@ Created 12/21/1997 Heikki Tuuri #include "que0que.h" #include "pars0grm.h" #include "pars0pars.h" -#include "lock0lock.h" #define OPT_EQUAL 1 /* comparison by = */ #define OPT_COMPARISON 2 /* comparison by <, >, <=, or >= */ diff --git a/storage/innobase/pars/pars0pars.cc b/storage/innobase/pars/pars0pars.cc index 56ca037f247..d7447810912 100644 --- a/storage/innobase/pars/pars0pars.cc +++ b/storage/innobase/pars/pars0pars.cc @@ -26,8 +26,6 @@ Created 11/19/1996 Heikki Tuuri /* Historical note: Innobase executed its first SQL string (CREATE TABLE) on 1/27/1998 */ -#include "ha_prototypes.h" - #include "pars0pars.h" #include "row0sel.h" #include "row0ins.h" @@ -42,7 +40,6 @@ on 1/27/1998 */ #include "data0type.h" #include "trx0trx.h" #include "trx0roll.h" -#include "lock0lock.h" #include "eval0eval.h" /* Global variable used while parsing a single procedure or query : the code is diff --git a/storage/innobase/que/que0que.cc b/storage/innobase/que/que0que.cc index 99d8c70a2c0..05964403543 100644 --- a/storage/innobase/que/que0que.cc +++ b/storage/innobase/que/que0que.cc @@ -24,8 +24,6 @@ Query graph Created 5/27/1996 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" - #include "que0que.h" #include "trx0trx.h" #include "trx0roll.h" @@ -37,9 +35,6 @@ Created 5/27/1996 Heikki Tuuri #include "dict0crea.h" #include "log0log.h" #include "eval0proc.h" -#include "lock0lock.h" -#include "eval0eval.h" -#include "pars0types.h" #define QUE_MAX_LOOPS_WITHOUT_CHECK 16 diff --git a/storage/innobase/rem/rem0cmp.cc b/storage/innobase/rem/rem0cmp.cc index 0e2bc9b30de..62581bbac38 100644 --- a/storage/innobase/rem/rem0cmp.cc +++ b/storage/innobase/rem/rem0cmp.cc @@ -23,17 +23,10 @@ Comparison services for records Created 7/1/1994 Heikki Tuuri ************************************************************************/ -#include "ha_prototypes.h" - #include "rem0cmp.h" +#include "rem0rec.h" +#include "dict0mem.h" #include "handler0alter.h" -#include "srv0srv.h" - -#include -#include -#include -#include -#include /* ALPHABETICAL ORDER ================== diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc index 562dc53e9f8..35b0235b8ec 100644 --- a/storage/innobase/rem/rem0rec.cc +++ b/storage/innobase/rem/rem0rec.cc @@ -26,15 +26,9 @@ Created 5/30/1994 Heikki Tuuri #include "rem0rec.h" #include "page0page.h" -#include "mtr0mtr.h" #include "mtr0log.h" #include "fts0fts.h" -#ifdef WITH_WSREP -#include -#endif /* WITH_WSREP */ -#include "gis0geo.h" #include "trx0sys.h" -#include "mach0data.h" /* PHYSICAL RECORD (OLD STYLE) =========================== @@ -2201,6 +2195,8 @@ rec_offs_make_nth_extern( rec_offs_base(offsets)[1 + n] |= REC_OFFS_EXTERNAL; } #ifdef WITH_WSREP +# include "ha_prototypes.h" + int wsrep_rec_get_foreign_key( byte *buf, /* out: extracted key */ diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc index 507b7c25ed4..810b5387aec 100644 --- a/storage/innobase/row/row0ftsort.cc +++ b/storage/innobase/row/row0ftsort.cc @@ -24,16 +24,11 @@ Create Full Text Index with (parallel) merge sort Created 10/13/2010 Jimmy Yang *******************************************************/ -#include "ha_prototypes.h" - -#include "dict0dict.h" -#include "row0merge.h" -#include "pars0pars.h" #include "row0ftsort.h" +#include "dict0dict.h" #include "row0merge.h" #include "row0row.h" #include "btr0cur.h" -#include "btr0bulk.h" #include "fts0plugin.h" #include "log0crypt.h" diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc index 71520dd1b84..66807ced2c1 100644 --- a/storage/innobase/row/row0import.cc +++ b/storage/innobase/row/row0import.cc @@ -24,11 +24,8 @@ Import a tablespace to a running instance. Created 2012-02-08 by Sunny Bains. *******************************************************/ -#include "ha_prototypes.h" - #include "row0import.h" #include "btr0pcur.h" -#include "btr0sea.h" #include "que0que.h" #include "dict0boot.h" #include "ibuf0ibuf.h" @@ -39,7 +36,6 @@ Created 2012-02-08 by Sunny Bains. #include "srv0start.h" #include "row0quiesce.h" #include "fil0pagecompress.h" -#include "ut0new.h" #ifdef HAVE_LZO #include "lzo/lzo1x.h" #endif diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 3362e5302b1..2db545973a3 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -24,11 +24,8 @@ Insert into a table Created 4/20/1996 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" - #include "row0ins.h" #include "dict0dict.h" -#include "dict0boot.h" #include "trx0rec.h" #include "trx0undo.h" #include "btr0btr.h" @@ -38,7 +35,6 @@ Created 4/20/1996 Heikki Tuuri #include "que0que.h" #include "row0upd.h" #include "row0sel.h" -#include "row0row.h" #include "row0log.h" #include "rem0cmp.h" #include "lock0lock.h" @@ -48,8 +44,6 @@ Created 4/20/1996 Heikki Tuuri #include "buf0lru.h" #include "fts0fts.h" #include "fts0types.h" -#include "m_string.h" -#include "gis0geo.h" /************************************************************************* IMPORTANT NOTE: Any operation that generates redo MUST check that there diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc index 7e6760da372..16a71fbe896 100644 --- a/storage/innobase/row/row0log.cc +++ b/storage/innobase/row/row0log.cc @@ -35,7 +35,6 @@ Created 2011-05-26 Marko Makela #include "que0que.h" #include "srv0mon.h" #include "handler0alter.h" -#include "ut0new.h" #include "ut0stage.h" #include "trx0rec.h" diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 953f3070a11..f623cfb6df4 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -30,8 +30,6 @@ Completed by Sunny Bains and Marko Makela #include -#include "ha_prototypes.h" - #include "row0merge.h" #include "row0ext.h" #include "row0log.h" @@ -49,8 +47,6 @@ Completed by Sunny Bains and Marko Makela #include "row0vers.h" #include "handler0alter.h" #include "btr0bulk.h" -#include "fsp0sysspace.h" -#include "ut0new.h" #include "ut0stage.h" #include "fil0crypt.h" diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index 4b20d378473..b098617afda 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -25,7 +25,7 @@ Contains also create table and other data dictionary operations. Created 9/17/2000 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" +#include "univ.i" #include #include #include @@ -46,7 +46,6 @@ Created 9/17/2000 Heikki Tuuri #include "fil0fil.h" #include "fil0crypt.h" #include "fsp0file.h" -#include "fsp0sysspace.h" #include "fts0fts.h" #include "fts0types.h" #include "ibuf0ibuf.h" @@ -68,7 +67,6 @@ Created 9/17/2000 Heikki Tuuri #include "srv0start.h" #include "row0ext.h" #include "srv0start.h" -#include "ut0new.h" #include #include diff --git a/storage/innobase/row/row0quiesce.cc b/storage/innobase/row/row0quiesce.cc index de71c786fd8..865780c3df5 100644 --- a/storage/innobase/row/row0quiesce.cc +++ b/storage/innobase/row/row0quiesce.cc @@ -24,14 +24,11 @@ Quiesce a tablespace. Created 2012-02-08 by Sunny Bains. *******************************************************/ -#include "ha_prototypes.h" - #include "row0quiesce.h" #include "row0mysql.h" #include "ibuf0ibuf.h" #include "srv0start.h" #include "trx0purge.h" -#include "fsp0sysspace.h" #ifdef HAVE_MY_AES_H #include diff --git a/storage/innobase/row/row0row.cc b/storage/innobase/row/row0row.cc index 4c88130334e..a01238fd21a 100644 --- a/storage/innobase/row/row0row.cc +++ b/storage/innobase/row/row0row.cc @@ -24,8 +24,6 @@ General row routines Created 4/20/1996 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" - #include "row0row.h" #include "data0type.h" #include "dict0dict.h" diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc index 5d142c24490..e27b1b9df77 100644 --- a/storage/innobase/row/row0sel.cc +++ b/storage/innobase/row/row0sel.cc @@ -54,9 +54,7 @@ Created 12/19/1997 Heikki Tuuri #include "read0read.h" #include "buf0lru.h" #include "srv0srv.h" -#include "ha_prototypes.h" #include "srv0mon.h" -#include "ut0new.h" /* Maximum number of rows to prefetch; MySQL interface has another parameter */ #define SEL_MAX_N_PREFETCH 16 diff --git a/storage/innobase/row/row0trunc.cc b/storage/innobase/row/row0trunc.cc index c6c752a92b8..c326a9468a0 100644 --- a/storage/innobase/row/row0trunc.cc +++ b/storage/innobase/row/row0trunc.cc @@ -26,13 +26,13 @@ Created 2013-04-12 Sunny Bains #include "row0mysql.h" #include "pars0pars.h" +#include "btr0pcur.h" #include "dict0crea.h" #include "dict0boot.h" #include "dict0stats.h" #include "dict0stats_bg.h" #include "lock0lock.h" #include "fts0fts.h" -#include "fsp0sysspace.h" #include "srv0start.h" #include "row0trunc.h" #include "os0file.h" diff --git a/storage/innobase/row/row0umod.cc b/storage/innobase/row/row0umod.cc index 3b87c3ae1b7..4ed4e74fce3 100644 --- a/storage/innobase/row/row0umod.cc +++ b/storage/innobase/row/row0umod.cc @@ -24,8 +24,6 @@ Undo modify of a row Created 2/27/1997 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" - #include "row0umod.h" #include "dict0dict.h" #include "dict0stats.h" diff --git a/storage/innobase/row/row0undo.cc b/storage/innobase/row/row0undo.cc index 9f5d05f8f9f..3f960235f3e 100644 --- a/storage/innobase/row/row0undo.cc +++ b/storage/innobase/row/row0undo.cc @@ -24,8 +24,6 @@ Row undo Created 1/8/1997 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" - #include "row0undo.h" #include "fsp0fsp.h" #include "mach0data.h" diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc index 28658428e98..ccb18cb843b 100644 --- a/storage/innobase/row/row0upd.cc +++ b/storage/innobase/row/row0upd.cc @@ -24,8 +24,6 @@ Update of a row Created 12/27/1996 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" - #include "row0upd.h" #include "dict0dict.h" #include "dict0mem.h" diff --git a/storage/innobase/row/row0vers.cc b/storage/innobase/row/row0vers.cc index 811654fdef8..30aa44dcb33 100644 --- a/storage/innobase/row/row0vers.cc +++ b/storage/innobase/row/row0vers.cc @@ -24,8 +24,6 @@ Row versions Created 2/6/1997 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" - #include "row0vers.h" #include "dict0dict.h" #include "dict0boot.h" diff --git a/storage/innobase/srv/srv0conc.cc b/storage/innobase/srv/srv0conc.cc index a1ffa8986a8..9e2aa7d7af4 100644 --- a/storage/innobase/srv/srv0conc.cc +++ b/storage/innobase/srv/srv0conc.cc @@ -38,13 +38,11 @@ InnoDB concurrency manager Created 2011/04/18 Sunny Bains *******************************************************/ -#include "ha_prototypes.h" -#include - #include "srv0srv.h" #include "trx0trx.h" #include "row0mysql.h" #include "dict0dict.h" +#include #include /** Number of times a thread is allowed to enter InnoDB within the same diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 0aebdb1cfd3..08d201511da 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -46,14 +46,11 @@ Created 10/8/1995 Heikki Tuuri // #include "mysql/psi/mysql_stage.h" // #include "mysql/psi/psi.h" -#include "ha_prototypes.h" - #include "btr0sea.h" #include "buf0flu.h" #include "buf0lru.h" #include "dict0boot.h" #include "dict0load.h" -#include "fsp0sysspace.h" #include "ibuf0ibuf.h" #include "lock0lock.h" #include "log0recv.h" diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 5cb3f6572c0..8719d26d5f3 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -41,8 +41,6 @@ Created 2/16/1996 Heikki Tuuri #include "my_global.h" -#include "ha_prototypes.h" - #include "mysqld.h" #include "mysql/psi/mysql_stage.h" #include "mysql/psi/psi.h" @@ -76,7 +74,6 @@ Created 2/16/1996 Heikki Tuuri #include "srv0start.h" #include "srv0srv.h" #include "btr0defragment.h" -#include "fsp0sysspace.h" #include "row0trunc.h" #include "mysql/service_wsrep.h" /* wsrep_recovery */ #include "trx0rseg.h" @@ -107,7 +104,6 @@ Created 2/16/1996 Heikki Tuuri #include "zlib.h" #include "ut0crc32.h" #include "btr0scrub.h" -#include "ut0new.h" /** Log sequence number immediately after startup */ lsn_t srv_start_lsn; diff --git a/storage/innobase/sync/sync0arr.cc b/storage/innobase/sync/sync0arr.cc index f1589e1f3a7..183aa09dc2b 100644 --- a/storage/innobase/sync/sync0arr.cc +++ b/storage/innobase/sync/sync0arr.cc @@ -31,7 +31,6 @@ The wait array used in synchronization primitives Created 9/5/1995 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" #include "sync0arr.h" #include #include @@ -46,13 +45,8 @@ Created 9/5/1995 Heikki Tuuri #include #include -#include "sync0sync.h" #include "lock0lock.h" #include "sync0rw.h" -#include "sync0debug.h" -#include "os0event.h" -#include "os0file.h" -#include "srv0srv.h" /* WAIT ARRAY diff --git a/storage/innobase/sync/sync0debug.cc b/storage/innobase/sync/sync0debug.cc index d41d52b2f7d..deb081a6819 100644 --- a/storage/innobase/sync/sync0debug.cc +++ b/storage/innobase/sync/sync0debug.cc @@ -32,11 +32,8 @@ Created 2012-08-21 Sunny Bains #include "sync0sync.h" #include "sync0debug.h" - -#include "ut0new.h" #include "srv0start.h" -#include #include #include #include diff --git a/storage/innobase/sync/sync0rw.cc b/storage/innobase/sync/sync0rw.cc index 22d94af0a6c..31a8234dea7 100644 --- a/storage/innobase/sync/sync0rw.cc +++ b/storage/innobase/sync/sync0rw.cc @@ -32,15 +32,6 @@ Created 9/11/1995 Heikki Tuuri *******************************************************/ #include "sync0rw.h" -#include "ha_prototypes.h" - -#include "os0thread.h" -#include "mem0mem.h" -#include "srv0srv.h" -#include "os0event.h" -#include "srv0mon.h" -#include "sync0debug.h" -#include "ha_prototypes.h" #include "my_cpu.h" #include diff --git a/storage/innobase/trx/trx0i_s.cc b/storage/innobase/trx/trx0i_s.cc index 363b61b0cfe..374c7b12db1 100644 --- a/storage/innobase/trx/trx0i_s.cc +++ b/storage/innobase/trx/trx0i_s.cc @@ -36,9 +36,7 @@ Created July 17, 2007 Vasil Dimov From the symptoms, this is related to bug#46587 in the MySQL bug DB. */ -#include "ha_prototypes.h" -#include - +#include "trx0i_s.h" #include "buf0buf.h" #include "dict0dict.h" #include "ha0storage.h" @@ -52,10 +50,9 @@ Created July 17, 2007 Vasil Dimov #include "srv0srv.h" #include "sync0rw.h" #include "sync0sync.h" -#include "trx0i_s.h" #include "trx0sys.h" -#include "trx0trx.h" -#include "ut0mem.h" + +#include /** Initial number of rows in the table cache */ #define TABLE_CACHE_INITIAL_ROWSNUM 1024 diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index c20001c8df0..c4f272acf07 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -24,8 +24,6 @@ Purge old versions Created 3/26/1996 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" - #include "trx0purge.h" #include "fsp0fsp.h" #include "fut0fut.h" @@ -37,7 +35,6 @@ Created 3/26/1996 Heikki Tuuri #include "row0purge.h" #include "row0upd.h" #include "srv0mon.h" -#include "fsp0sysspace.h" #include "srv0srv.h" #include "srv0start.h" #include "sync0sync.h" diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc index 9c0008831a8..e700d5e0f58 100644 --- a/storage/innobase/trx/trx0rec.cc +++ b/storage/innobase/trx/trx0rec.cc @@ -38,7 +38,6 @@ Created 3/26/1996 Heikki Tuuri #include "trx0purge.h" #include "trx0rseg.h" #include "row0row.h" -#include "fsp0sysspace.h" #include "row0mysql.h" /*=========== UNDO LOG RECORD CREATION AND DECODING ====================*/ diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc index 2c14c9d895a..0e277c67453 100644 --- a/storage/innobase/trx/trx0roll.cc +++ b/storage/innobase/trx/trx0roll.cc @@ -24,12 +24,9 @@ Transaction rollback Created 3/26/1996 Heikki Tuuri *******************************************************/ -#include "my_config.h" -#include - -#include "ha_prototypes.h" #include "trx0roll.h" +#include #include #include "fsp0fsp.h" @@ -47,7 +44,6 @@ Created 3/26/1996 Heikki Tuuri #include "trx0sys.h" #include "trx0trx.h" #include "trx0undo.h" -#include "ha_prototypes.h" /** This many pages must be undone before a truncate is tried within rollback */ diff --git a/storage/innobase/trx/trx0rseg.cc b/storage/innobase/trx/trx0rseg.cc index 1c2d708ed4b..3d5320cdd15 100644 --- a/storage/innobase/trx/trx0rseg.cc +++ b/storage/innobase/trx/trx0rseg.cc @@ -30,7 +30,6 @@ Created 3/26/1996 Heikki Tuuri #include "srv0srv.h" #include "trx0purge.h" #include "srv0mon.h" -#include "fsp0sysspace.h" #include diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc index e2e42dc6569..f4c043a3ca9 100644 --- a/storage/innobase/trx/trx0sys.cc +++ b/storage/innobase/trx/trx0sys.cc @@ -24,8 +24,6 @@ Transaction system Created 3/26/1996 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" - #include "mysqld.h" #include "trx0sys.h" #include "sql_error.h" @@ -43,7 +41,6 @@ Created 3/26/1996 Heikki Tuuri #include "log0recv.h" #include "os0file.h" #include "read0read.h" -#include "fsp0sysspace.h" #include diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index 4aba7a64ed8..b56cb9609ab 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -24,8 +24,6 @@ The transaction Created 3/26/1996 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" - #include "trx0trx.h" #ifdef WITH_WSREP @@ -42,7 +40,6 @@ Created 3/26/1996 Heikki Tuuri #include "read0read.h" #include "srv0mon.h" #include "srv0srv.h" -#include "fsp0sysspace.h" #include "srv0start.h" #include "trx0purge.h" #include "trx0rec.h" @@ -50,7 +47,6 @@ Created 3/26/1996 Heikki Tuuri #include "trx0rseg.h" #include "trx0undo.h" #include "trx0xa.h" -#include "ut0new.h" #include "ut0pool.h" #include "ut0vec.h" diff --git a/storage/innobase/trx/trx0undo.cc b/storage/innobase/trx/trx0undo.cc index 33a38b915be..98db4bf4e9e 100644 --- a/storage/innobase/trx/trx0undo.cc +++ b/storage/innobase/trx/trx0undo.cc @@ -24,8 +24,6 @@ Transaction undo log Created 3/26/1996 Heikki Tuuri *******************************************************/ -#include "ha_prototypes.h" - #include "trx0undo.h" #include "fsp0fsp.h" #include "mach0data.h" @@ -36,7 +34,6 @@ Created 3/26/1996 Heikki Tuuri #include "trx0purge.h" #include "trx0rec.h" #include "trx0rseg.h" -#include "trx0trx.h" /* How should the old versions in the history list be managed? ---------------------------------------------------------- diff --git a/storage/innobase/ut/ut0dbg.cc b/storage/innobase/ut/ut0dbg.cc index 7df189ac560..56a2eb80337 100644 --- a/storage/innobase/ut/ut0dbg.cc +++ b/storage/innobase/ut/ut0dbg.cc @@ -24,8 +24,7 @@ Debug utilities for Innobase. Created 1/30/1994 Heikki Tuuri **********************************************************************/ -#include "ha_prototypes.h" - +#include "univ.i" #include "ut0dbg.h" /*************************************************************//** diff --git a/storage/innobase/ut/ut0new.cc b/storage/innobase/ut/ut0new.cc index 052db2fe7bd..8aad921278c 100644 --- a/storage/innobase/ut/ut0new.cc +++ b/storage/innobase/ut/ut0new.cc @@ -25,8 +25,6 @@ Created May 26, 2014 Vasil Dimov #include "univ.i" -#include "ut0new.h" - /** Maximum number of retries to allocate memory. */ const size_t alloc_max_retries = 60; diff --git a/storage/innobase/ut/ut0rbt.cc b/storage/innobase/ut/ut0rbt.cc index cb8e4f2df20..0da924fed43 100644 --- a/storage/innobase/ut/ut0rbt.cc +++ b/storage/innobase/ut/ut0rbt.cc @@ -23,9 +23,6 @@ Red-Black tree implementation Created 2007-03-20 Sunny Bains ***********************************************************************/ -#include "univ.i" - -#include "ut0new.h" #include "ut0rbt.h" /**********************************************************************//** From e669e705a1a7d2bbdd42734cb9fc8349a5f2f118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 19 Nov 2018 13:13:39 +0200 Subject: [PATCH 26/26] Fix the Windows build Commit ff88e4bb8ae1bd8e903c403a598e7d2c5d2bbcaf broke the Windows build. Clean up one more redundant #include to fix it. --- storage/innobase/include/srv0srv.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 832a67539da..4117a3f0dd3 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -42,12 +42,11 @@ Created 10/10/1995 Heikki Tuuri #ifndef srv0srv_h #define srv0srv_h -#include "my_global.h" +#include "univ.i" #include "mysql/psi/mysql_stage.h" #include "mysql/psi/psi.h" -#include "univ.i" #include "log0log.h" #include "os0event.h" #include "que0types.h"