mirror of
https://github.com/MariaDB/server.git
synced 2025-08-09 22:24:09 +03:00
MDEV-36138 Server null-pointer crash at startup when tmptables left in --tmpdir
Fix a regression introduced in MDEV-35840 78157c4765
Also tested compiling with -O3 that the -Warray-bounds fixed in
MDEV-35840 does not resurface
This commit is contained in:
@@ -25,3 +25,9 @@ OPENED_VIEWS 0
|
|||||||
set @@use_stat_tables= @save_use_stat_tables;
|
set @@use_stat_tables= @save_use_stat_tables;
|
||||||
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
#
|
||||||
|
# MDEV-36138 Server null-pointer crash at startup when tmptables left in --tmpdir
|
||||||
|
#
|
||||||
|
create table t1 (c int);
|
||||||
|
drop table t1;
|
||||||
|
# restart
|
||||||
|
@@ -24,4 +24,15 @@ select variable_name, session_status.variable_value - t1.variable_value
|
|||||||
from information_schema.session_status join t1 using (variable_name);
|
from information_schema.session_status join t1 using (variable_name);
|
||||||
set @@use_stat_tables= @save_use_stat_tables;
|
set @@use_stat_tables= @save_use_stat_tables;
|
||||||
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-36138 Server null-pointer crash at startup when tmptables left in --tmpdir
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
create table t1 (c int);
|
||||||
|
let $MYSQLD_TMPDIR=`SELECT @@tmpdir`;
|
||||||
|
let $MYSQLD_DATADIR=`SELECT @@datadir`;
|
||||||
|
--copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_TMPDIR/#sqlt1.frm
|
||||||
|
drop table t1;
|
||||||
|
--source include/restart_mysqld.inc
|
||||||
|
@@ -8986,9 +8986,11 @@ my_bool mysql_rm_tmp_tables(void)
|
|||||||
memcpy(path_copy, path, path_len - ext_len);
|
memcpy(path_copy, path, path_len - ext_len);
|
||||||
path_copy[path_len - ext_len]= 0;
|
path_copy[path_len - ext_len]= 0;
|
||||||
init_tmp_table_share(thd, &share, "", 0, "", path_copy);
|
init_tmp_table_share(thd, &share, "", 0, "", path_copy);
|
||||||
handlerton *ht= share.db_type();
|
|
||||||
if (!open_table_def(thd, &share))
|
if (!open_table_def(thd, &share))
|
||||||
ht->drop_table(share.db_type(), path_copy);
|
{
|
||||||
|
handlerton *ht= share.db_type();
|
||||||
|
ht->drop_table(ht, path_copy);
|
||||||
|
}
|
||||||
free_table_share(&share);
|
free_table_share(&share);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user