Commit b0a43818 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.5 into 10.6

parents 2325f8f3 59952b26
...@@ -81,4 +81,14 @@ DROP TABLE t2, t1; ...@@ -81,4 +81,14 @@ DROP TABLE t2, t1;
CREATE TABLE t (a VARCHAR(40), b INT, C INT) ENGINE=InnoDB; CREATE TABLE t (a VARCHAR(40), b INT, C INT) ENGINE=InnoDB;
ALTER TABLE t MODIFY a VARCHAR(50), DROP b; ALTER TABLE t MODIFY a VARCHAR(50), DROP b;
DROP TABLE t; DROP TABLE t;
#
# MDEV-32060 Server aborts when table doesn't
# have referenced index
#
SET SESSION FOREIGN_KEY_CHECKS = OFF;
CREATE TABLE t1 (a VARCHAR(16) KEY, FOREIGN KEY(a) REFERENCES t2(b)) ENGINE=InnoDB;
CREATE TABLE t2 (b VARCHAR(8)) ENGINE=InnoDB;
SET SESSION FOREIGN_KEY_CHECKS = ON;
ALTER TABLE t2 MODIFY b VARCHAR(16), ADD KEY(b);
DROP TABLE t1, t2;
# End of 10.4 tests # End of 10.4 tests
...@@ -111,4 +111,15 @@ DROP TABLE t2, t1; ...@@ -111,4 +111,15 @@ DROP TABLE t2, t1;
CREATE TABLE t (a VARCHAR(40), b INT, C INT) ENGINE=InnoDB; CREATE TABLE t (a VARCHAR(40), b INT, C INT) ENGINE=InnoDB;
ALTER TABLE t MODIFY a VARCHAR(50), DROP b; ALTER TABLE t MODIFY a VARCHAR(50), DROP b;
DROP TABLE t; DROP TABLE t;
--echo #
--echo # MDEV-32060 Server aborts when table doesn't
--echo # have referenced index
--echo #
SET SESSION FOREIGN_KEY_CHECKS = OFF;
CREATE TABLE t1 (a VARCHAR(16) KEY, FOREIGN KEY(a) REFERENCES t2(b)) ENGINE=InnoDB;
CREATE TABLE t2 (b VARCHAR(8)) ENGINE=InnoDB;
SET SESSION FOREIGN_KEY_CHECKS = ON;
ALTER TABLE t2 MODIFY b VARCHAR(16), ADD KEY(b);
DROP TABLE t1, t2;
--echo # End of 10.4 tests --echo # End of 10.4 tests
...@@ -179,8 +179,8 @@ SET (SQL_SOURCE ...@@ -179,8 +179,8 @@ SET (SQL_SOURCE
${MYSYS_LIBWRAP_SOURCE} ${MYSYS_LIBWRAP_SOURCE}
) )
IF(CMAKE_C_COMPILER_ID MATCHES "Clang" AND MY_CHECK_CXX_COMPILER_FLAG(-Wno-unused-but-set-variable)
NOT CMAKE_C_COMPILER_VERSION VERSION_LESS "13.0.0") IF(have_CXX__Wno_unused_but_set_variable)
ADD_COMPILE_FLAGS(${CMAKE_CURRENT_BINARY_DIR}/yy_mariadb.cc ADD_COMPILE_FLAGS(${CMAKE_CURRENT_BINARY_DIR}/yy_mariadb.cc
${CMAKE_CURRENT_BINARY_DIR}/yy_oracle.cc ${CMAKE_CURRENT_BINARY_DIR}/yy_oracle.cc
COMPILE_FLAGS "-Wno-unused-but-set-variable") COMPILE_FLAGS "-Wno-unused-but-set-variable")
......
...@@ -510,8 +510,9 @@ IF(MSVC) ...@@ -510,8 +510,9 @@ IF(MSVC)
# on generated file. # on generated file.
TARGET_COMPILE_OPTIONS(innobase PRIVATE "/wd4065") TARGET_COMPILE_OPTIONS(innobase PRIVATE "/wd4065")
ENDIF() ENDIF()
IF(CMAKE_C_COMPILER_ID MATCHES "Clang" AND
NOT CMAKE_C_COMPILER_VERSION VERSION_LESS "13.0.0") MY_CHECK_CXX_COMPILER_FLAG(-Wno-unused-but-set-variable)
IF(have_CXX__Wno_unused_but_set_variable)
ADD_COMPILE_FLAGS(pars/pars0grm.cc fts/fts0pars.cc ADD_COMPILE_FLAGS(pars/pars0grm.cc fts/fts0pars.cc
COMPILE_FLAGS "-Wno-unused-but-set-variable") COMPILE_FLAGS "-Wno-unused-but-set-variable")
ENDIF() ENDIF()
......
...@@ -7776,6 +7776,8 @@ bool check_col_is_in_fk_indexes( ...@@ -7776,6 +7776,8 @@ bool check_col_is_in_fk_indexes(
{ {
for (ulint i= 0; i < f->n_fields; i++) for (ulint i= 0; i < f->n_fields; i++)
{ {
if (!f->referenced_index)
continue;
if (f->referenced_index->fields[i].col == col) if (f->referenced_index->fields[i].col == col)
{ {
my_error(ER_FK_COLUMN_CANNOT_CHANGE_CHILD, MYF(0), my_error(ER_FK_COLUMN_CANNOT_CHANGE_CHILD, MYF(0),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment