Skip to content

Commit 177fb41

Browse files
Bug #22306581 VALGRIND FAILURE IN INNODB.TEMPORARY_TABLE
- Post push fix to address kevin's review comments.
1 parent 2178f2a commit 177fb41

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#
22
# Bug #22306581 VALGRIND FAILURE IN INNODB.TEMPORARY_TABLE
33
#
4-
create temporary table t (i int)COMPRESSION = "ZLIB" ENGINE = InnoDB;
4+
create temporary table t (i int) COMPRESSION = "ZLIB" ENGINE = InnoDB;
55
ERROR 42000: Table 't' uses an extension that doesn't exist in this MySQL version
6-
create table t1(i INT)COMPRESSION="ZLIB" ENGINE=InnoDB TABLESPACE=innodb_system;
6+
create table t1(i INT) COMPRESSION="ZLIB" ENGINE=InnoDB TABLESPACE=innodb_system;
77
ERROR 42000: Table 't1' uses an extension that doesn't exist in this MySQL version
8+
SET DEBUG ='+d, simulate_max_char_col';
9+
create table t1(f1 varchar(1000))engine=innodb;
10+
ERROR HY000: Got error 1005 from storage engine
11+
SET DEBUG ='-d, simulate_max_char_col';
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1+
--source include/have_innodb.inc
2+
--source include/have_debug.inc
3+
14
--echo #
25
--echo # Bug #22306581 VALGRIND FAILURE IN INNODB.TEMPORARY_TABLE
36
--echo #
47

58
--error ER_UNSUPPORTED_EXTENSION
6-
create temporary table t (i int)COMPRESSION = "ZLIB" ENGINE = InnoDB;
9+
create temporary table t (i int) COMPRESSION = "ZLIB" ENGINE = InnoDB;
710

811
--error ER_UNSUPPORTED_EXTENSION
9-
create table t1(i INT)COMPRESSION="ZLIB" ENGINE=InnoDB TABLESPACE=innodb_system;
12+
create table t1(i INT) COMPRESSION="ZLIB" ENGINE=InnoDB TABLESPACE=innodb_system;
13+
14+
SET DEBUG ='+d, simulate_max_char_col';
15+
--error 1030
16+
create table t1(f1 varchar(1000))engine=innodb;
17+
SET DEBUG ='-d, simulate_max_char_col';

storage/innobase/handler/ha_innodb.cc

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9591,12 +9591,13 @@ create_table_info_t::create_table_def()
95919591
}
95929592
}
95939593

9594+
ut_ad(trx_state_eq(m_trx, TRX_STATE_NOT_STARTED));
9595+
95949596
/* Check whether there already exists a FTS_DOC_ID column */
95959597
if (create_table_check_doc_id_col(m_trx, m_form, &doc_id_col)){
95969598

95979599
/* Raise error if the Doc ID column is of wrong type or name */
95989600
if (doc_id_col == ULINT_UNDEFINED) {
9599-
trx_commit_for_mysql(m_trx);
96009601

96019602
err = DB_ERROR;
96029603
goto error_ret;
@@ -9701,6 +9702,10 @@ create_table_info_t::create_table_def()
97019702

97029703
charset_no = (ulint) field->charset()->number;
97039704

9705+
DBUG_EXECUTE_IF("simulate_max_char_col",
9706+
charset_no = MAX_CHAR_COLL_NUM + 1;
9707+
);
9708+
97049709
if (charset_no > MAX_CHAR_COLL_NUM) {
97059710
/* in data0type.h we assume that the
97069711
number fits in one byte in prtype */
@@ -9712,6 +9717,11 @@ create_table_info_t::create_table_def()
97129717
" Unsupported code %lu.",
97139718
(ulong) charset_no);
97149719
mem_heap_free(heap);
9720+
dict_mem_table_free(table);
9721+
9722+
ut_ad(trx_state_eq(
9723+
m_trx, TRX_STATE_NOT_STARTED));
9724+
97159725
DBUG_RETURN(ER_CANT_CREATE_TABLE);
97169726
}
97179727
}
@@ -9747,7 +9757,7 @@ create_table_info_t::create_table_def()
97479757
err_col:
97489758
dict_mem_table_free(table);
97499759
mem_heap_free(heap);
9750-
trx_commit_for_mysql(m_trx);
9760+
ut_ad(trx_state_eq(m_trx, TRX_STATE_NOT_STARTED));
97519761

97529762
err = DB_ERROR;
97539763
goto error_ret;
@@ -9799,6 +9809,8 @@ create_table_info_t::create_table_def()
97999809
fts_add_doc_id_column(table, heap);
98009810
}
98019811

9812+
ut_ad(trx_state_eq(m_trx, TRX_STATE_NOT_STARTED));
9813+
98029814
/* If temp table, then we avoid creation of entries in SYSTEM TABLES.
98039815
Given that temp table lifetime is limited to connection/server lifetime
98049816
on re-start we don't need to restore temp-table and so no entry is
@@ -9816,7 +9828,6 @@ create_table_info_t::create_table_def()
98169828

98179829
err = DB_UNSUPPORTED;
98189830
dict_mem_table_free(table);
9819-
98209831
} else {
98219832

98229833
/* Get a new table ID */

0 commit comments

Comments
 (0)