Commit 3e3a3261 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

Merge branch '11.1' into mariadb-11.1.6

parents 80abd847 fdaa44a4
MYSQL_VERSION_MAJOR=11 MYSQL_VERSION_MAJOR=11
MYSQL_VERSION_MINOR=1 MYSQL_VERSION_MINOR=1
MYSQL_VERSION_PATCH=6 MYSQL_VERSION_PATCH=7
SERVER_MATURITY=stable SERVER_MATURITY=stable
...@@ -148,3 +148,17 @@ CALL p1(2); ...@@ -148,3 +148,17 @@ CALL p1(2);
DROP TABLE t1; DROP TABLE t1;
DROP PROCEDURE p1; DROP PROCEDURE p1;
# End of 10.11 tests # End of 10.11 tests
#
# MDEV-34649: Memory leaks on running DELETE statement in PS mode with positional parameters
#
CREATE TABLE t1 (a INT, b VARCHAR(30)) CHARSET=utf8mb4;
INSERT INTO t1 VALUES (1, 'one'), (0, NULL), (3, 'three'), (4, 'four');
PREPARE stmt FROM 'DELETE FROM t1 WHERE b=?' ;
SET @arg00=NULL;
EXECUTE stmt USING @arg00;
SET @arg00='one';
EXECUTE stmt USING @arg00;
# Clean up
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
# End of 11.1
...@@ -167,3 +167,21 @@ DROP TABLE t1; ...@@ -167,3 +167,21 @@ DROP TABLE t1;
DROP PROCEDURE p1; DROP PROCEDURE p1;
--echo # End of 10.11 tests --echo # End of 10.11 tests
--echo #
--echo # MDEV-34649: Memory leaks on running DELETE statement in PS mode with positional parameters
--echo #
CREATE TABLE t1 (a INT, b VARCHAR(30)) CHARSET=utf8mb4;
INSERT INTO t1 VALUES (1, 'one'), (0, NULL), (3, 'three'), (4, 'four');
PREPARE stmt FROM 'DELETE FROM t1 WHERE b=?' ;
SET @arg00=NULL;
EXECUTE stmt USING @arg00;
SET @arg00='one';
# Without the patch, attempt to run the same prepared statement the second time
# would result in memory leaks
EXECUTE stmt USING @arg00;
--echo # Clean up
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
--echo # End of 11.1
...@@ -912,6 +912,7 @@ bool Sql_cmd_delete::delete_from_single_table(THD *thd) ...@@ -912,6 +912,7 @@ bool Sql_cmd_delete::delete_from_single_table(THD *thd)
{ {
thd->lex->current_select->save_leaf_tables(thd); thd->lex->current_select->save_leaf_tables(thd);
thd->lex->current_select->leaf_tables_saved= true; thd->lex->current_select->leaf_tables_saved= true;
thd->lex->current_select->first_cond_optimization= false;
} }
delete deltempfile; delete deltempfile;
......
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