New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MDEV-31618: Server crashes in process_i_s_table_temporary_tables/get_all_tables #2685
MDEV-31618: Server crashes in process_i_s_table_temporary_tables/get_all_tables #2685
Conversation
SELECT table_schema, table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_type='temporary sequence'; | ||
table_schema table_name | ||
test seq1 | ||
mysqltest s2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vuvova not sure how this happened, when mysqltest
is removed before?
tmp_mem_root
maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I don't understand. what do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The temporary sequences are shown because they where created in previous tests that did not clean up itself properly.
Fix by moving:
DROP TABLE mysqltest.s1;
DROP TABLE mysqltest.s2;
before the line
#MDEV-31618: Server crashes in
sql/sql_show.cc
Outdated
@@ -5310,6 +5310,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) | |||
} | |||
|
|||
TABLE *tmp_tbl= share_temp->all_tmp_tables.front(); | |||
if(!tmp_tbl) | |||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is completely wrong. There cannot be a temporary table share without a single temporary table.
If this is the case here — it's a bug.
…all_tables - Mark temporary sequence as not needed to be reopen in case of renaming during alter prepare phase, since that operation will fail. - Without this patch, `find_temporary_table(0)` deletes the table from share - Closes PR MariaDB#2685 - Reviewer: <>
b47a95d
to
39f3418
Compare
…all_tables - Pre-open temporary table on sequence creation. - Without this patch, if rename alter is done on the temporary sequence, and after that `create replace`, since table is not preopened and alter rename marked the table as reopen, and such table is deleted in the `find_temporary_table()` leaving the share without the table, that causes `show tables` to fail - Closes PR MariaDB#2685 - Reviewer: <serg@mariadb.com>
39f3418
to
e334197
Compare
please, try to construct a test case that fails in earlier versions |
…all_tables - Pre-open temporary table on sequence creation. - Without this patch, if rename alter is done on the temporary sequence, and after that `create replace`, since table is not preopened and alter rename marked the table as reopen, and such table is deleted in the `find_temporary_table()` leaving the share without the table, that causes `show tables` to fail - Closes PR MariaDB#2685 - Reviewer: <serg@mariadb.com>
e334197
to
d4fe932
Compare
…isammrg::info - Fix MSAN uninitialized value error, obtained by calling handlerton's `info()`, and referencing uninitialized `errkey`. - Reviewer: serg@mariadb.com
c204487
to
c7edf8b
Compare
…all_tables - Pre-open temporary table on sequence creation. - Without this patch, if rename alter is done on the temporary sequence, and after that `create replace`, since table is not preopened and alter rename marked the table as reopen, and such table is deleted in the `find_temporary_table()` leaving the share without the table, that causes `show tables` to fail - Closes PR #2685 - Reviewer: <serg@mariadb.com>
…all_tables - Pre-open temporary table on sequence creation. - Without this patch, if rename alter is done on the temporary sequence, and after that `create replace`, since table is not preopened and alter rename marked the table as reopen, and such table is deleted in the `find_temporary_table()` leaving the share without the table, that causes `show tables` to fail - Closes PR #2685 - Reviewer: <serg@mariadb.com>
[x] The Jira issue number for this PR is: MDEV-31618
Basing the PR against the correct MariaDB version
PR quality check