summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--innobase/row/row0mysql.c5
-rw-r--r--mysql-test/r/union.result14
-rw-r--r--mysql-test/t/union.test10
-rw-r--r--sql/ha_innodb.cc3
4 files changed, 31 insertions, 1 deletions
diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c
index fd720046e31..fafbef4c999 100644
--- a/innobase/row/row0mysql.c
+++ b/innobase/row/row0mysql.c
@@ -3151,6 +3151,7 @@ row_drop_table_for_mysql(
foreign = UT_LIST_GET_FIRST(table->referenced_list);
while (foreign && foreign->foreign_table == table) {
+ check_next_foreign:
foreign = UT_LIST_GET_NEXT(referenced_list, foreign);
}
@@ -3179,6 +3180,10 @@ row_drop_table_for_mysql(
goto funct_exit;
}
+ if (foreign && trx->check_foreigns) {
+ goto check_next_foreign;
+ }
+
if (table->n_mysql_handles_opened > 0) {
ibool added;
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index daa0a428577..1f45d238ea5 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -1252,6 +1252,20 @@ t2 CREATE TABLE `t2` (
`a` varchar(12) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED
drop table t1,t2;
+CREATE TABLE t1 (a mediumtext);
+CREATE TABLE t2 (b varchar(20));
+INSERT INTO t1 VALUES ('a'),('b');
+SELECT left(a,100000000) FROM t1 UNION SELECT b FROM t2;
+left(a,100000000)
+a
+b
+create table t3 SELECT left(a,100000000) FROM t1 UNION SELECT b FROM t2;
+show create table t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `left(a,100000000)` longtext
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop tables t1,t2,t3;
create table t1 ( id int not null auto_increment, primary key (id), col1 int);
insert into t1 (col1) values (2),(3),(4),(5),(6);
select 99 union all select id from t1 order by 1;
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index af548074aa9..4da19622dcb 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -773,6 +773,16 @@ alter table t2 ROW_FORMAT=fixed;
show create table t2;
drop table t1,t2;
+#
+# correct conversion long string to TEXT (BUG#10025)
+#
+CREATE TABLE t1 (a mediumtext);
+CREATE TABLE t2 (b varchar(20));
+INSERT INTO t1 VALUES ('a'),('b');
+SELECT left(a,100000000) FROM t1 UNION SELECT b FROM t2;
+create table t3 SELECT left(a,100000000) FROM t1 UNION SELECT b FROM t2;
+show create table t3;
+drop tables t1,t2,t3;
#
# Bug #10032 Bug in parsing UNION with ORDER BY when one node does not use FROM
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 9f07532c227..7f454f43ae5 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -6482,7 +6482,8 @@ ha_innobase::store_lock(
if ((lock_type >= TL_WRITE_CONCURRENT_INSERT &&
lock_type <= TL_WRITE) && !thd->in_lock_tables
&& !thd->tablespace_op
- && thd->lex->sql_command != SQLCOM_TRUNCATE) {
+ && thd->lex->sql_command != SQLCOM_TRUNCATE
+ && thd->lex->sql_command != SQLCOM_CREATE_TABLE) {
lock_type = TL_WRITE_ALLOW_WRITE;
}