Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
8d2a57b4
Commit
8d2a57b4
authored
Apr 16, 2019
by
Robert Bindar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-15977 Assertion !thd->in_sub_stmt failed in trans_commit_stmt
parent
7e917bba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
184 additions
and
2 deletions
+184
-2
mysql-test/suite/sql_sequence/rebuild.result
mysql-test/suite/sql_sequence/rebuild.result
+161
-0
mysql-test/suite/sql_sequence/rebuild.test
mysql-test/suite/sql_sequence/rebuild.test
+18
-0
sql/sql_sequence.cc
sql/sql_sequence.cc
+5
-2
No files found.
mysql-test/suite/sql_sequence/rebuild.result
0 → 100644
View file @
8d2a57b4
#
# MDEV-15977 Assertion `! thd->in_sub_stmt' failed in trans_commit_stmt
#
CREATE SEQUENCE s1 ENGINE=InnoDB;
ALTER TABLE s1 FORCE;
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
CREATE TABLE t2 (b VARCHAR(64)) ENGINE=MyISAM;
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 SELECT TABLE_NAME FROM INFORMATION_SCHEMA.PARTITIONS;
INSERT INTO t1 VALUES (1);
select * from t1;
a
1
select * from t2;
b
t2
t1
s1
users
threads
table_lock_waits_summary_by_table
table_io_waits_summary_by_table
table_io_waits_summary_by_index_usage
socket_summary_by_instance
socket_summary_by_event_name
socket_instances
setup_timers
setup_objects
setup_instruments
setup_consumers
setup_actors
session_connect_attrs
session_account_connect_attrs
rwlock_instances
performance_timers
objects_summary_global_by_type
mutex_instances
hosts
host_cache
file_summary_by_instance
file_summary_by_event_name
file_instances
events_waits_summary_global_by_event_name
events_waits_summary_by_user_by_event_name
events_waits_summary_by_thread_by_event_name
events_waits_summary_by_instance
events_waits_summary_by_host_by_event_name
events_waits_summary_by_account_by_event_name
events_waits_history_long
events_waits_history
events_waits_current
events_statements_summary_global_by_event_name
events_statements_summary_by_user_by_event_name
events_statements_summary_by_thread_by_event_name
events_statements_summary_by_host_by_event_name
events_statements_summary_by_digest
events_statements_summary_by_account_by_event_name
events_statements_history_long
events_statements_history
events_statements_current
events_stages_summary_global_by_event_name
events_stages_summary_by_user_by_event_name
events_stages_summary_by_thread_by_event_name
events_stages_summary_by_host_by_event_name
events_stages_summary_by_account_by_event_name
events_stages_history_long
events_stages_history
events_stages_current
cond_instances
accounts
user
transaction_registry
time_zone_transition_type
time_zone_transition
time_zone_name
time_zone_leap_second
time_zone
tables_priv
table_stats
slow_log
servers
roles_mapping
proxies_priv
procs_priv
proc
plugin
innodb_table_stats
innodb_index_stats
index_stats
host
help_topic
help_relation
help_keyword
help_category
gtid_slave_pos
general_log
func
event
db
columns_priv
column_stats
test_suppressions
global_suppressions
ALL_PLUGINS
APPLICABLE_ROLES
CHARACTER_SETS
CHECK_CONSTRAINTS
COLLATIONS
COLLATION_CHARACTER_SET_APPLICABILITY
COLUMNS
COLUMN_PRIVILEGES
ENABLED_ROLES
ENGINES
EVENTS
FILES
GLOBAL_STATUS
GLOBAL_VARIABLES
KEY_CACHES
KEY_COLUMN_USAGE
PARAMETERS
PARTITIONS
PLUGINS
PROCESSLIST
PROFILING
REFERENTIAL_CONSTRAINTS
ROUTINES
SCHEMATA
SCHEMA_PRIVILEGES
SESSION_STATUS
SESSION_VARIABLES
STATISTICS
SYSTEM_VARIABLES
TABLES
TABLESPACES
TABLE_CONSTRAINTS
TABLE_PRIVILEGES
TRIGGERS
USER_PRIVILEGES
VIEWS
GEOMETRY_COLUMNS
SPATIAL_REF_SYS
CLIENT_STATISTICS
INDEX_STATISTICS
USER_STATISTICS
INNODB_LOCKS
INNODB_CMPMEM
INNODB_CMP_PER_INDEX
INNODB_LOCK_WAITS
TABLE_STATISTICS
INNODB_BUFFER_PAGE_LRU
INNODB_SYS_FIELDS
INNODB_SYS_COLUMNS
INNODB_SYS_FOREIGN_COLS
INNODB_BUFFER_POOL_STATS
INNODB_TRX
INNODB_SYS_FOREIGN
INNODB_SYS_TABLES
INNODB_BUFFER_PAGE
INNODB_METRICS
INNODB_SYS_INDEXES
INNODB_SYS_VIRTUAL
DROP TABLE t1, t2, s1;
mysql-test/suite/sql_sequence/rebuild.test
0 → 100644
View file @
8d2a57b4
--
source
include
/
have_innodb
.
inc
--
echo
#
--
echo
# MDEV-15977 Assertion `! thd->in_sub_stmt' failed in trans_commit_stmt
--
echo
#
CREATE
SEQUENCE
s1
ENGINE
=
InnoDB
;
ALTER
TABLE
s1
FORCE
;
CREATE
TABLE
t1
(
a
INT
)
ENGINE
=
MyISAM
;
CREATE
TABLE
t2
(
b
VARCHAR
(
64
))
ENGINE
=
MyISAM
;
CREATE
TRIGGER
tr1
BEFORE
INSERT
ON
t1
FOR
EACH
ROW
INSERT
INTO
t2
SELECT
TABLE_NAME
FROM
INFORMATION_SCHEMA
.
PARTITIONS
;
INSERT
INTO
t1
VALUES
(
1
);
select
*
from
t1
;
select
*
from
t2
;
# Cleanup
DROP
TABLE
t1
,
t2
,
s1
;
sql/sql_sequence.cc
View file @
8d2a57b4
...
...
@@ -487,9 +487,12 @@ int SEQUENCE::read_initial_values(TABLE *table)
Doing mysql_lock_tables() may have started a read only transaction.
If that happend, it's better that we commit it now, as a lot of
code assumes that there is no active stmt transaction directly after
open_tables()
open_tables().
But we also don't want to commit the stmt transaction while in a
substatement, see MDEV-15977.
*/
if
(
!
has_active_transaction
&&
!
thd
->
transaction
.
stmt
.
is_empty
())
if
(
!
has_active_transaction
&&
!
thd
->
transaction
.
stmt
.
is_empty
()
&&
!
thd
->
in_sub_stmt
)
trans_commit_stmt
(
thd
);
}
write_unlock
(
table
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment