mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug#50201: Server crashes in explain_filename on an InnoDB partitioned table
Problem was that in mysql-trunk the ER() macro is now dependent on current_thd and the innodb monitor thread has no binding to that thd object. This cause the crash because of bad derefencing. Solution was to add a new macro which take the thd as an argument (which the innodb thread uses for the call). (Updated according to reviewers comments, i.e. added ER_THD_OR_DEFAULT and moved test to suite parts.) mysql-test/suite/parts/r/partition_innodb_status_file.result: Bug#50201: Server crashes in explain_filename on an InnoDB partitioned table New test result file mysql-test/suite/parts/t/partition_innodb_status_file-master.opt: Bug#50201: Server crashes in explain_filename on an InnoDB partitioned table New test opt file mysql-test/suite/parts/t/partition_innodb_status_file.test: Bug#50201: Server crashes in explain_filename on an InnoDB partitioned table New test. Note that the innodb monitor thread only runs every 15 seconds, so this test will take at least 15 seconds, so I have moved it to the parts suite. sql/sql_table.cc: Bug#50201: Server crashes in explain_filename on an InnoDB partitioned table Using thd safe ER macro. sql/unireg.h: Bug#50201: Server crashes in explain_filename on an InnoDB partitioned table Added ER macros for use with specified thd pointer.
This commit is contained in:
@ -291,7 +291,8 @@ uint explain_filename(THD* thd,
|
||||
{
|
||||
if (explain_mode == EXPLAIN_ALL_VERBOSE)
|
||||
{
|
||||
to_p= strnmov(to_p, ER(ER_DATABASE_NAME), end_p - to_p);
|
||||
to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_DATABASE_NAME),
|
||||
end_p - to_p);
|
||||
*(to_p++)= ' ';
|
||||
to_p= add_identifier(thd, to_p, end_p, db_name, db_name_len);
|
||||
to_p= strnmov(to_p, ", ", end_p - to_p);
|
||||
@ -304,7 +305,7 @@ uint explain_filename(THD* thd,
|
||||
}
|
||||
if (explain_mode == EXPLAIN_ALL_VERBOSE)
|
||||
{
|
||||
to_p= strnmov(to_p, ER(ER_TABLE_NAME), end_p - to_p);
|
||||
to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_TABLE_NAME), end_p - to_p);
|
||||
*(to_p++)= ' ';
|
||||
to_p= add_identifier(thd, to_p, end_p, table_name, table_name_len);
|
||||
}
|
||||
@ -321,18 +322,22 @@ uint explain_filename(THD* thd,
|
||||
if (name_type != NORMAL)
|
||||
{
|
||||
if (name_type == TEMP)
|
||||
to_p= strnmov(to_p, ER(ER_TEMPORARY_NAME), end_p - to_p);
|
||||
to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_TEMPORARY_NAME),
|
||||
end_p - to_p);
|
||||
else
|
||||
to_p= strnmov(to_p, ER(ER_RENAMED_NAME), end_p - to_p);
|
||||
to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_RENAMED_NAME),
|
||||
end_p - to_p);
|
||||
to_p= strnmov(to_p, " ", end_p - to_p);
|
||||
}
|
||||
to_p= strnmov(to_p, ER(ER_PARTITION_NAME), end_p - to_p);
|
||||
to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_PARTITION_NAME),
|
||||
end_p - to_p);
|
||||
*(to_p++)= ' ';
|
||||
to_p= add_identifier(thd, to_p, end_p, part_name, part_name_len);
|
||||
if (subpart_name)
|
||||
{
|
||||
to_p= strnmov(to_p, ", ", end_p - to_p);
|
||||
to_p= strnmov(to_p, ER(ER_SUBPARTITION_NAME), end_p - to_p);
|
||||
to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_SUBPARTITION_NAME),
|
||||
end_p - to_p);
|
||||
*(to_p++)= ' ';
|
||||
to_p= add_identifier(thd, to_p, end_p, subpart_name, subpart_name_len);
|
||||
}
|
||||
|
Reference in New Issue
Block a user