Comments (8)
MDEV-13711
CREATE SEQUENCE s;
CREATE TABLE t LIKE s;
Related to 17a87d6
1. Normal table locked
#0 lock_table_names (thd=0x7fff78000d50, options=..., tables_start=0x7fff78013700, tables_end=0x0, lock_wait_timeout=86400, flags=0) at /home/midenok/src/mariadb/myrepo/src/sql/sql_base.cc:3614
#1 0x000000000069b6ef in open_tables (thd=0x7fff78000d50, options=..., start=0x7fff78004958, counter=0x7fffe50299a8, flags=0, prelocking_strategy=0x7fffe5028fd8) at /home/midenok/src/mariadb/myrepo/src/sql/sql_base.cc:3905
#2 0x00000000006f97a6 in open_tables (thd=0x7fff78000d50, tables=0x7fff78004958, counter=0x7fffe50299a8, flags=0) at /home/midenok/src/mariadb/myrepo/src/sql/sql_base.h:463
#3 0x0000000000827a0e in mysql_create_like_table (thd=0x7fff78000d50, table=0x7fff78013700, src_table=0x7fff78013d50, create_info=0x7fffe502c418) at /home/midenok/src/mariadb/myrepo/src/sql/sql_table.cc:5259
#4 0x0000000000738128 in mysql_execute_command (thd=0x7fff78000d50) at /home/midenok/src/mariadb/myrepo/src/sql/sql_parse.cc:4218
#5 0x00000000007314cf in mysql_parse (thd=0x7fff78000d50, rawbuf=0x7fff78013628 "CREATE TABLE t LIKE m", length=21, parser_state=0x7fffe502d650, is_com_multi=false, is_next_command=false) at /home/midenok/src/mariadb/myrepo/src/sql/sql_parse.cc:7921
2. Normal table unlocked
#0 I_P_List<MDL_ticket, I_P_List_adapter<MDL_ticket, &MDL_ticket::next_in_context, &MDL_ticket::prev_in_context>, I_P_List_null_counter, I_P_List_no_push_back<MDL_ticket> >::remove (this=0x7fff80000f40, a=0x7fff80032eb0) at /home/midenok/src/mariadb/myrepo/src/sql/sql_plist.h:130
#1 0x00000000008d60a4 in MDL_context::release_lock (this=0x7fff80000e50, duration=MDL_STATEMENT, ticket=0x7fff80032eb0) at /home/midenok/src/mariadb/myrepo/src/sql/mdl.cc:2631
#2 0x00000000008d6306 in MDL_context::release_locks_stored_before (this=0x7fff80000e50, duration=MDL_STATEMENT, sentinel=0x0) at /home/midenok/src/mariadb/myrepo/src/sql/mdl.cc:2679
#3 0x00000000008d6697 in MDL_context::release_transactional_locks (this=0x7fff80000e50) at /home/midenok/src/mariadb/myrepo/src/sql/mdl.cc:2847
#4 0x000000000073fc3e in mysql_execute_command (thd=0x7fff80000d50) at /home/midenok/src/mariadb/myrepo/src/sql/sql_parse.cc:6327
#5 0x00000000007314cf in mysql_parse (thd=0x7fff80000d50, rawbuf=0x7fff80013628 "CREATE TABLE t LIKE m", length=21, parser_state=0x7fffe502d650, is_com_multi=false, is_next_command=false) at /home/midenok/src/mariadb/myrepo/src/sql/sql_parse.cc:7921
1. Sequence locked
#0 lock_table_names (thd=0x7fff78000d50, options=..., tables_start=0x7fff78013700, tables_end=0x0, lock_wait_timeout=86400, flags=0) at /home/midenok/src/mariadb/myrepo/src/sql/sql_base.cc:3614
#1 0x000000000069b6ef in open_tables (thd=0x7fff78000d50, options=..., start=0x7fff78004958, counter=0x7fffe50299a8, flags=0, prelocking_strategy=0x7fffe5028fd8) at /home/midenok/src/mariadb/myrepo/src/sql/sql_base.cc:3905
#2 0x00000000006f97a6 in open_tables (thd=0x7fff78000d50, tables=0x7fff78004958, counter=0x7fffe50299a8, flags=0) at /home/midenok/src/mariadb/myrepo/src/sql/sql_base.h:463
#3 0x0000000000827a0e in mysql_create_like_table (thd=0x7fff78000d50, table=0x7fff78013700, src_table=0x7fff78013d50, create_info=0x7fffe502c418) at /home/midenok/src/mariadb/myrepo/src/sql/sql_table.cc:5259
#4 0x0000000000738128 in mysql_execute_command (thd=0x7fff78000d50) at /home/midenok/src/mariadb/myrepo/src/sql/sql_parse.cc:4218
#5 0x00000000007314cf in mysql_parse (thd=0x7fff78000d50, rawbuf=0x7fff78013628 "CREATE TABLE t LIKE s", length=21, parser_state=0x7fffe502d650, is_com_multi=false, is_next_command=false) at /home/midenok/src/mariadb/myrepo/src/sql/sql_parse.cc:7921
2. Sequence unlocked
#0 I_P_List<MDL_ticket, I_P_List_adapter<MDL_ticket, &MDL_ticket::next_in_context, &MDL_ticket::prev_in_context>, I_P_List_null_counter, I_P_List_no_push_back<MDL_ticket> >::remove (this=0x7fff80000f40, a=0x7fff80030640) at /home/midenok/src/mariadb/myrepo/src/sql/sql_plist.h:130
#1 0x00000000008d60a4 in MDL_context::release_lock (this=0x7fff80000e50, duration=MDL_STATEMENT, ticket=0x7fff80030640) at /home/midenok/src/mariadb/myrepo/src/sql/mdl.cc:2631
#2 0x00000000008d6306 in MDL_context::release_locks_stored_before (this=0x7fff80000e50, duration=MDL_STATEMENT, sentinel=0x0) at /home/midenok/src/mariadb/myrepo/src/sql/mdl.cc:2679
#3 0x00000000008d6697 in MDL_context::release_transactional_locks (this=0x7fff80000e50) at /home/midenok/src/mariadb/myrepo/src/sql/mdl.cc:2847
#4 0x000000000096f76e in sequence_insert (thd=0x7fff80000d50, lex=0x7fff80004948, table_list=0x7fff80013700) at /home/midenok/src/mariadb/myrepo/src/sql/sql_sequence.cc:338
#5 0x00000000008257a9 in mysql_create_table_no_lock (thd=0x7fff80000d50, db=0x7fff80013d10 "test", table_name=0x7fff800136c8 "t", create_info=0x7fffe502a520, alter_info=0x7fffe502a470, is_trans=0x7fffe50299ae, create_table_mode=0, table_list=0x7fff80013700) at /home/midenok/src/mariadb/myrepo/src/sql/sql_table.cc:4872
#6 0x0000000000827db6 in mysql_create_like_table (thd=0x7fff80000d50, table=0x7fff80013700, src_table=0x7fff80013d50, create_info=0x7fffe502c418) at /home/midenok/src/mariadb/myrepo/src/sql/sql_table.cc:5325
#7 0x0000000000738128 in mysql_execute_command (thd=0x7fff80000d50) at /home/midenok/src/mariadb/myrepo/src/sql/sql_parse.cc:4218
#8 0x00000000007314cf in mysql_parse (thd=0x7fff80000d50, rawbuf=0x7fff80013628 "CREATE TABLE t LIKE s", length=21, parser_state=0x7fffe502d650, is_com_multi=false, is_next_command=false) at /home/midenok/src/mariadb/myrepo/src/sql/sql_parse.cc:7921
from mariadb.
Failed tests:
sql_sequence.gtid sql_sequence.replication
Not a failure but uncompiled wsrep:
--- /home/midenok/src/mariadb/myrepo/src/mysql-test/suite/sql_sequence/gtid.result 2017-10-13 22:49:04.185396828 +0300
+++ /home/midenok/src/mariadb/myrepo/src/mysql-test/suite/sql_sequence/gtid.reject 2017-10-14 13:08:21.937178809 +0300
@@ -603,7 +603,6 @@
show session variables like '%binlog_format%';
Variable_name Value
binlog_format STATEMENT
-wsrep_forced_binlog_format NONE
create sequence s1 cache 2;
select next value for s1;
ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a
storage engine limited to row-based logging.
--- /home/midenok/src/mariadb/myrepo/src/mysql-test/suite/sql_sequence/replication.result 2017-10-13 22:49:04.186397466 +0300
+++ /home/midenok/src/mariadb/myrepo/src/mysql-test/suite/sql_sequence/replication.reject 2017-10-14 13:08:24.520533449 +0300
@@ -699,7 +699,6 @@
show session variables like '%binlog_format%';
Variable_name Value
binlog_format STATEMENT
-wsrep_forced_binlog_format NONE
create sequence s1 cache 2;
select next value for s1;
ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.
@@ -722,7 +721,6 @@
show session variables like '%binlog_format%';
Variable_name Value
binlog_format MIXED
-wsrep_forced_binlog_format NONE
create sequence s1 cache 2;
select next value for s1;
next value for s1
from mariadb.
MDEV-13721
CREATE SEQUENCE s;
CREATE TEMPORARY TABLE s (i INT);
DROP SEQUENCE s;
#3 0x00007ffff5d97fc2 in __GI___assert_fail (assertion=0x147015e "thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db, table->table_name, MDL_SHARED)", file=0x146fbfd "/home/midenok/src/mariadb/myrepo/src/sql/sql_table.cc", line=2361, function=0x1470109 "int mysql_rm_table_no_locks(THD *, TABLE_LIST *, bool, bool, bool, bool, bool, bool)") at assert.c:101
#4 0x0000000000820fb8 in mysql_rm_table_no_locks (thd=0x7fff7c000d50, tables=0x7fff7c0136f0, if_exists=false, drop_temporary=false, drop_view=false, drop_sequence=true, dont_log_query=false, dont_free_locks=false) at /home/midenok/src/mariadb/myrepo/src/sql/sql_table.cc:2359
#5 0x000000000082044b in mysql_rm_table (thd=0x7fff7c000d50, tables=0x7fff7c0136f0, if_exists=false, drop_temporary=false, drop_sequence=true) at /home/midenok/src/mariadb/myrepo/src/sql/sql_table.cc:2087
#6 0x000000000073ae96 in mysql_execute_command (thd=0x7fff7c000d50) at /home/midenok/src/mariadb/myrepo/src/sql/sql_parse.cc:5010
#7 0x000000000073147f in mysql_parse (thd=0x7fff7c000d50, rawbuf=0x7fff7c013628 "DROP SEQUENCE s", length=15, parser_state=0x7fffe502d650, is_com_multi=false, is_next_command=false) at /home/midenok/src/mariadb/myrepo/src/sql/sql_parse.cc:7921
from mariadb.
Bad
#0 lock_table_names (thd=0x7fff84000d50, options=..., tables_start=0x7fff840136f0, tables_end=0x0, lock_wait_timeout=86400, flags=0) at /home/midenok/src/mariadb/myrepo/src/sql/sql_base.cc:3628
#1 0x0000000000820596 in lock_table_names (thd=0x7fff84000d50, table_list=0x7fff840136f0, table_list_end=0x0, lock_wait_timeout=86400, flags=0) at /home/midenok/src/mariadb/myrepo/src/sql/sql_base.h:225
#2 0x0000000000820270 in mysql_rm_table (thd=0x7fff84000d50, tables=0x7fff840136f0, if_exists=false, drop_temporary=false, drop_sequence=true) at /home/midenok/src/mariadb/myrepo/src/sql/sql_table.cc:2041
#3 0x000000000073ae96 in mysql_execute_command (thd=0x7fff84000d50) at /home/midenok/src/mariadb/myrepo/src/sql/sql_parse.cc:5010
#4 0x000000000073147f in mysql_parse (thd=0x7fff84000d50, rawbuf=0x7fff84013628 "drop sequence s", length=15, parser_state=0x7fffe502d650, is_com_multi=false, is_next_command=false) at /home/midenok/src/mariadb/myrepo/src/sql/sql_parse.cc:7921
(gdb) p is_temporary_table(table)
$21 = true
(gdb) p table->table->s->tmp_table
$24 = TRANSACTIONAL_TMP_TABLE
from mariadb.
Temporary tables are preopened like this:
3640 if (sql_command_flags[lex->sql_command] & CF_PREOPEN_TMP_TABLES)
3641 {
3642 if (thd->open_temporary_tables(all_tables))
3643 goto error;
3644 }
from mariadb.
Consider following cases
create sequence s;create temporary sequence s;drop sequence s;
create sequence s;create temporary table s(x int);drop sequence s;
from mariadb.
We could disable this flag
sql_command_flags[SQLCOM_DROP_SEQUENCE]|= CF_PREOPEN_TMP_TABLES;
but will it work for
create sequence s;create temporary sequence s;drop sequence s;
?
from mariadb.
The difference between temporary table and temporary sequence is in tables->table->s->sequence
.
from mariadb.
Related Issues (20)
- MDEV-27221 DELETE HISTORY ignores indices HOT 3
- MDEV-25529 Auto-create: Pre-existing historical data is not partitioned as specified by ALTER HOT 12
- MDEV-25058 ASAN use-after-poison in cmp_data / cmp_dtuple_rec_with_match_low
- MDEV-27180 Fully atomic partitioning DDL operations
- MDEV-25546 LIMIT partition temporarily populated in transaction is not used anymore after ROLLBACK HOT 2
- MDEV-28254 Wrong position for row_start, row_end after adding column to implicit versioned table
- MDEV-21540 Initialization of already inited long unique index on reorganize partition HOT 2
- MTR hang HOT 1
- MDEV-29544 SIGSEGV in HA_CREATE_INFO::finalize_locked_tables HOT 1
- SAMU-64 Allow administrators to enable or disable parallel replication on a per-table basis HOT 12
- SAMU performance HOT 6
- MDEV-16857 system-invisible row_end is displayed in SHOW INDEX
- MDEV-23639 Auto-create does not work under LOCK TABLES or inside triggers HOT 8
- MDEV-25672 table alias from previous statement interferes later commands (now MDEV-24176) HOT 15
- MDEV-21555 Assertion `!"secondary index is out of sync"' failed in dict_index_t::vers_history_row
- Helper commits
- MDEV-25004 Missing delete-marked record in FTS_DOC_ID_INDEX during purge of undo record HOT 4
- MDEV-22166 CONVERT PARTITION: move out partition into a table HOT 1
- MDEV-25803 Inplace ALTER breaks MyISAM/Aria table when order of keys is changed HOT 7
- MDEV-22284 Server crashes in _ma_keylength_part or Assertion `info->last_key.keyinfo == key->keyinfo' failed in _ma_search_no_save HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mariadb.