Skip to content
Permalink
Browse files
MDEV-21690 LeakSanitizer: detected memory leaks in mem_heap_create_bl…
…ock_func
  • Loading branch information
midenok committed Feb 10, 2020
1 parent 77c6382 commit f79f537
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
@@ -565,4 +565,11 @@ t2 CREATE TABLE `t2` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop tables t2, t1;
set default_storage_engine= default;
#
# MDEV-21690 LeakSanitizer: detected memory leaks in mem_heap_create_block_func
#
CREATE TABLE t1 (a TEXT, b TEXT) ENGINE=InnoDB;
ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (b);
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
DROP TABLE t1;
# End of 10.5 tests
@@ -519,6 +519,16 @@ drop tables t2, t1;

set default_storage_engine= default;

--echo #
--echo # MDEV-21690 LeakSanitizer: detected memory leaks in mem_heap_create_block_func
--echo #
CREATE TABLE t1 (a TEXT, b TEXT) ENGINE=InnoDB;
--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (b);

# Cleanup
DROP TABLE t1;

--echo # End of 10.5 tests

--source include/wait_until_count_sessions.inc
@@ -12339,7 +12339,7 @@ create_table_info_t::create_foreign_keys()
" failed. Column %s was not found.",
operation, create_name, k.str(),
column_names[i]);

dict_foreign_free(foreign);
return (DB_CANNOT_ADD_CONSTRAINT);
}
++i;
@@ -12353,6 +12353,7 @@ create_table_info_t::create_foreign_keys()
"allowed).",
operation, create_name, k.str(), i,
MAX_COLS_PER_FK);
dict_foreign_free(foreign);
return (DB_CANNOT_ADD_CONSTRAINT);
}
}
@@ -12367,6 +12368,7 @@ create_table_info_t::create_foreign_keys()
k.str(), column_names,
index_error, err_col,
err_index, table);
dict_foreign_free(foreign);
return (DB_CANNOT_ADD_CONSTRAINT);
}

0 comments on commit f79f537

Please sign in to comment.