Skip to content

Commit a56c175

Browse files
Tor Didriksendahlerlend
authored andcommitted
Bug#36867806 Heap-use-after-free: regexp::Regexp_facade::~Regexp_facade()
An SQL statement had heap-use-after-free when run as a prepared statement. The failing statemen was a functional index in a create table statement, and objects created ended up in the execution MEM_ROOT. The solution is to switch to the prepare MEM_ROOT when doing resolving of functional indexes. Change-Id: Ic54ef5eaaa4b90e1018cb82b9c73f5f6c5e29e01
1 parent 6e8df86 commit a56c175

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

mysql-test/t/window_functions_bugs.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
--source include/elide_costs.inc
2+
# difference in '$.steps[*].join_preparation.steps[*].'
3+
--source include/no_ps_protocol.inc
24

35
--echo #
46
--echo # Bug#26475312 VALGRIND MEMORY LEAK ( CMP_FIELD_VALUE(FIELD*, LONG) (SQL_EXECUTOR.CC:3598)

sql/sql_table.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8077,6 +8077,8 @@ static Create_field *add_functional_index_to_create_list(
80778077
const Functional_index_error_handler error_handler(
80788078
{key_spec->name.str, key_spec->name.length}, thd);
80798079

8080+
const Prepared_stmt_arena_holder ps_arena_holder(thd);
8081+
80808082
Item *expr = kp->get_expression();
80818083
if (expr->type() == Item::FIELD_ITEM) {
80828084
my_error(ER_FUNCTIONAL_INDEX_ON_FIELD, MYF(0));

0 commit comments

Comments
 (0)