Bug #76434 Assertion `gtid_next->type != AUTOMATIC_GROUP || thd->owned_gtid.is_empty()'
Submitted: 23 Mar 2015 0:11 Modified: 12 May 2015 12:00
Reporter: Roel Van de Paar (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S6 (Debug Builds)
Version:5.7.6, 5.7.8, 8.0.0 OS:Any
Assigned to: CPU Architecture:Any

[23 Mar 2015 0:11] Roel Van de Paar
Description:
Version: '5.7.6-m16-debug'  socket: '/sda/MS-mysql-5.7.6-m16-linux-x86_64-debug/socket.sock'  port: 10430  MySQL Community Server (GPL)
mysqld: /bzr/mysql-5.7.6-m16_dbg/sql/rpl_gtid_execution.cc:454: enum_gtid_statement_status gtid_pre_statement_checks(THD*): Assertion `gtid_next->type != AUTOMATIC_GROUP || thd->owned_gtid.is_empty()' failed.

How to repeat:
DROP DATABASE test;CREATE DATABASE test;USE test;
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO SELECT 1;
BINLOG ' O1ZVRw8BAAAAZgAAAGoAAAAAAAQANS4xLjIzLXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAA7VlVHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC ';
CREATE EVENT e1 ON SCHEDULE EVERY 10 HOUR DO SELECT 1;
set session gtid_next=default;
ALTER TABLE bug56680_2 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;

===OR===

DROP DATABASE test;CREATE DATABASE test;USE test;
SET @@SESSION.GTID_NEXT='ANONYMOUS';
set session gtid_next=default;
SELECT *;

May have to execute testcases twice in a row to trigger.
[23 Mar 2015 7:58] Umesh Shastry
Hello Roel,

Thank you for the bug report and test case.
Confirmed that 5.7.6, 5.7.8 debug builds are affected.

Thanks,
Umesh
[23 Mar 2015 7:59] Umesh Shastry
// 5.7.6 debug build is affected

bin/mysql_install_db --basedir=/export/umesh/mysql-5.7.6 --datadir=/export/umesh/mysql-5.7.6/76434 -v
bin/mysqld-debug --basedir=/export/umesh/mysql-5.7.6 --datadir=/export/umesh/mysql-5.7.6/76434 --sql_mode=ONLY_FULL_GROUP_BY --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/mysql-5.7.6/76434/log.err 2>&1 &

- build

commit: e1298eb6a8e2247361533811930a07fde7aff618
date: 2015-02-26 15:29:31 +0100
build-date: 2015-02-26 15:35:58 +0100
short: e1298eb
branch: mysql-5.7.6-m16-release

MySQL source 5.7.6

(gdb) bt
#0  0x00007f334fa4b771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x00000000013ee069 in my_write_core (sig=6) at /export/home/pb2/build/sb_0-14552753-1424962715.41/mysql-5.7.6-m16/mysys/stacktrace.c:247
#2  0x0000000000bdeba0 in handle_fatal_signal (sig=6) at /export/home/pb2/build/sb_0-14552753-1424962715.41/mysql-5.7.6-m16/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007f334e6515c9 in raise () from /lib64/libc.so.6
#5  0x00007f334e652cd8 in abort () from /lib64/libc.so.6
#6  0x00007f334e64a536 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007f334e64a5e2 in __assert_fail () from /lib64/libc.so.6
#8  0x000000000131a487 in gtid_pre_statement_checks (thd=0x7f32d4000bb0) at /export/home/pb2/build/sb_0-14552753-1424962715.41/mysql-5.7.6-m16/sql/rpl_gtid_execution.cc:454
#9  0x00000000010e171d in mysql_execute_command (thd=0x7f32d4000bb0) at /export/home/pb2/build/sb_0-14552753-1424962715.41/mysql-5.7.6-m16/sql/sql_parse.cc:2300
#10 0x00000000010e9a6f in mysql_parse (thd=0x7f32d4000bb0, parser_state=0x7f33442745d0) at /export/home/pb2/build/sb_0-14552753-1424962715.41/mysql-5.7.6-m16/sql/sql_parse.cc:5129
#11 0x00000000010debc8 in dispatch_command (command=COM_QUERY, thd=0x7f32d4000bb0, packet=0x7f32d4009ce1 "ALTER TABLE bug56680_2 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1", packet_length=61)
    at /export/home/pb2/build/sb_0-14552753-1424962715.41/mysql-5.7.6-m16/sql/sql_parse.cc:1249
#12 0x00000000010dd693 in do_command (thd=0x7f32d4000bb0) at /export/home/pb2/build/sb_0-14552753-1424962715.41/mysql-5.7.6-m16/sql/sql_parse.cc:835
#13 0x000000000120444f in handle_connection (arg=0x530cc90) at /export/home/pb2/build/sb_0-14552753-1424962715.41/mysql-5.7.6-m16/sql/conn_handler/connection_handler_per_thread.cc:298
#14 0x00000000017770f1 in pfs_spawn_thread (arg=0x5337b60) at /export/home/pb2/build/sb_0-14552753-1424962715.41/mysql-5.7.6-m16/storage/perfschema/pfs.cc:2147
#15 0x00007f334fa46df3 in start_thread () from /lib64/libpthread.so.0
#16 0x00007f334e71247d in clone () from /lib64/libc.so.6
(gdb)

(gdb) bt
#0  0x00007fbc7b71e771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x00000000013ee069 in my_write_core (sig=6) at /export/home/pb2/build/sb_0-14552753-1424962715.41/mysql-5.7.6-m16/mysys/stacktrace.c:247
#2  0x0000000000bdeba0 in handle_fatal_signal (sig=6) at /export/home/pb2/build/sb_0-14552753-1424962715.41/mysql-5.7.6-m16/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007fbc7a3245c9 in raise () from /lib64/libc.so.6
#5  0x00007fbc7a325cd8 in abort () from /lib64/libc.so.6
#6  0x00007fbc7a31d536 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007fbc7a31d5e2 in __assert_fail () from /lib64/libc.so.6
#8  0x000000000131a487 in gtid_pre_statement_checks (thd=0x7fbc00000bb0) at /export/home/pb2/build/sb_0-14552753-1424962715.41/mysql-5.7.6-m16/sql/rpl_gtid_execution.cc:454
#9  0x00000000010e171d in mysql_execute_command (thd=0x7fbc00000bb0) at /export/home/pb2/build/sb_0-14552753-1424962715.41/mysql-5.7.6-m16/sql/sql_parse.cc:2300
#10 0x00000000010e9a6f in mysql_parse (thd=0x7fbc00000bb0, parser_state=0x7fbc70f485d0) at /export/home/pb2/build/sb_0-14552753-1424962715.41/mysql-5.7.6-m16/sql/sql_parse.cc:5129
#11 0x00000000010debc8 in dispatch_command (command=COM_QUERY, thd=0x7fbc00000bb0, packet=0x7fbc00009ce1 "SELECT *", packet_length=8)
    at /export/home/pb2/build/sb_0-14552753-1424962715.41/mysql-5.7.6-m16/sql/sql_parse.cc:1249
#12 0x00000000010dd693 in do_command (thd=0x7fbc00000bb0) at /export/home/pb2/build/sb_0-14552753-1424962715.41/mysql-5.7.6-m16/sql/sql_parse.cc:835
#13 0x000000000120444f in handle_connection (arg=0x4534c90) at /export/home/pb2/build/sb_0-14552753-1424962715.41/mysql-5.7.6-m16/sql/conn_handler/connection_handler_per_thread.cc:298
#14 0x00000000017770f1 in pfs_spawn_thread (arg=0x455fb60) at /export/home/pb2/build/sb_0-14552753-1424962715.41/mysql-5.7.6-m16/storage/perfschema/pfs.cc:2147
#15 0x00007fbc7b719df3 in start_thread () from /lib64/libpthread.so.0
#16 0x00007fbc7a3e547d in clone () from /lib64/libc.so.6
(gdb)

// 5.7.8 - debug build affected

bin/mysql_install_db --basedir=/export/umesh/mysql-5.7.8 --datadir=/export/umesh/mysql-5.7.8/76434 -v
bin/mysqld-debug --basedir=/export/umesh/mysql-5.7.8 --datadir=/export/umesh/mysql-5.7.8/76434 --sql_mode=ONLY_FULL_GROUP_BY --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/mysql-5.7.8/76434/log.err 2>&1 &

- build

commit: 91153f3385c4917a215aa4c7818b3f6265608286
date: 2015-03-20 14:48:27 +0100
build-date: 2015-03-20 18:03:24 +0100
short: 91153f3
branch: mysql-5.7

MySQL source 5.7.8

(gdb) bt
#0  0x00007f4931e26771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x00000000018c6688 in my_write_core (sig=6) at /export/home3/pb2/build/sb_0-14765270-1426872165.51/mysqlcom-pro-5.7.8-rc/mysys/stacktrace.c:247
#2  0x0000000000f4b39e in handle_fatal_signal (sig=6) at /export/home3/pb2/build/sb_0-14765270-1426872165.51/mysqlcom-pro-5.7.8-rc/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007f4930a2c5c9 in raise () from /lib64/libc.so.6
#5  0x00007f4930a2dcd8 in abort () from /lib64/libc.so.6
#6  0x00007f4930a25536 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007f4930a255e2 in __assert_fail () from /lib64/libc.so.6
#8  0x00000000017f3377 in gtid_pre_statement_checks (thd=0x7f48a4000bb0) at /export/home3/pb2/build/sb_0-14765270-1426872165.51/mysqlcom-pro-5.7.8-rc/sql/rpl_gtid_execution.cc:453
#9  0x00000000015bfdb1 in mysql_execute_command (thd=0x7f48a4000bb0) at /export/home3/pb2/build/sb_0-14765270-1426872165.51/mysqlcom-pro-5.7.8-rc/sql/sql_parse.cc:2318
#10 0x00000000015c78b1 in mysql_parse (thd=0x7f48a4000bb0, parser_state=0x7f4919fcbe50) at /export/home3/pb2/build/sb_0-14765270-1426872165.51/mysqlcom-pro-5.7.8-rc/sql/sql_parse.cc:5201
#11 0x00000000015bd46c in dispatch_command (thd=0x7f48a4000bb0, com_data=0x7f4919fcce00, command=COM_QUERY)
    at /export/home3/pb2/build/sb_0-14765270-1426872165.51/mysqlcom-pro-5.7.8-rc/sql/sql_parse.cc:1280
#12 0x00000000015bc0bf in do_command (thd=0x7f48a4000bb0) at /export/home3/pb2/build/sb_0-14765270-1426872165.51/mysqlcom-pro-5.7.8-rc/sql/sql_parse.cc:851
#13 0x00000000016e052e in handle_connection (arg=0x50aff80) at /export/home3/pb2/build/sb_0-14765270-1426872165.51/mysqlcom-pro-5.7.8-rc/sql/conn_handler/connection_handler_per_thread.cc:299
#14 0x0000000001ce1375 in pfs_spawn_thread (arg=0x4fa71f0) at /export/home3/pb2/build/sb_0-14765270-1426872165.51/mysqlcom-pro-5.7.8-rc/storage/perfschema/pfs.cc:2147
#15 0x00007f4931e21df3 in start_thread () from /lib64/libpthread.so.0
#16 0x00007f4930aed47d in clone () from /lib64/libc.so.6
(gdb)
[23 Mar 2015 8:02] Umesh Shastry
// 5.8.0 debug build affected

bin/mysql_install_db --basedir=/export/umesh/mysql-5.8.0 --datadir=/export/umesh/mysql-5.8.0/76434 -v
bin/mysqld-debug --basedir=/export/umesh/mysql-5.8.0 --datadir=/export/umesh/mysql-5.8.0/76434 --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/mysql-5.8.0/76434/log.err 2>&1 &

- build

commit: b48798db34fbcaf5dbb5c8ae7ef738afeb60eccc
date: 2015-03-20 14:52:33 +0100
build-date: 2015-03-20 17:03:10 +0100
short: b48798d
branch: mysql-trunk

MySQL source 5.8.0

(gdb) bt
#0  0x00007fc57f129771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x00000000018b3108 in my_write_core (sig=6) at /export/home3/pb2/build/sb_0-14764689-1426868485.86/mysqlcom-pro-5.8.0-m17/mysys/stacktrace.c:247
#2  0x0000000000f3d9fb in handle_fatal_signal (sig=6) at /export/home3/pb2/build/sb_0-14764689-1426868485.86/mysqlcom-pro-5.8.0-m17/sql/signal_handler.cc:221
#3  <signal handler called>
#4  0x00007fc57dd2f5c9 in raise () from /lib64/libc.so.6
#5  0x00007fc57dd30cd8 in abort () from /lib64/libc.so.6
#6  0x00007fc57dd28536 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007fc57dd285e2 in __assert_fail () from /lib64/libc.so.6
#8  0x00000000017dff45 in gtid_pre_statement_checks (thd=0x7fc4f0000bb0) at /export/home3/pb2/build/sb_0-14764689-1426868485.86/mysqlcom-pro-5.8.0-m17/sql/rpl_gtid_execution.cc:454
#9  0x00000000015a8fea in mysql_execute_command (thd=0x7fc4f0000bb0) at /export/home3/pb2/build/sb_0-14764689-1426868485.86/mysqlcom-pro-5.8.0-m17/sql/sql_parse.cc:2287
#10 0x00000000015b0a1d in mysql_parse (thd=0x7fc4f0000bb0, parser_state=0x7fc574952e50) at /export/home3/pb2/build/sb_0-14764689-1426868485.86/mysqlcom-pro-5.8.0-m17/sql/sql_parse.cc:5158
#11 0x00000000015a66e6 in dispatch_command (thd=0x7fc4f0000bb0, com_data=0x7fc574953e00, command=COM_QUERY)
    at /export/home3/pb2/build/sb_0-14764689-1426868485.86/mysqlcom-pro-5.8.0-m17/sql/sql_parse.cc:1245
#12 0x00000000015a5335 in do_command (thd=0x7fc4f0000bb0) at /export/home3/pb2/build/sb_0-14764689-1426868485.86/mysqlcom-pro-5.8.0-m17/sql/sql_parse.cc:814
#13 0x00000000016ca436 in handle_connection (arg=0x56496c0) at /export/home3/pb2/build/sb_0-14764689-1426868485.86/mysqlcom-pro-5.8.0-m17/sql/conn_handler/connection_handler_per_thread.cc:300
#14 0x0000000001c59c8d in pfs_spawn_thread (arg=0x55408c0) at /export/home3/pb2/build/sb_0-14764689-1426868485.86/mysqlcom-pro-5.8.0-m17/storage/perfschema/pfs.cc:2147
#15 0x00007fc57f124df3 in start_thread () from /lib64/libpthread.so.0
#16 0x00007fc57ddf047d in clone () from /lib64/libc.so.6
[8 Apr 2015 8:09] Umesh Shastry
// Confirmed after Bill requested for re-verification

// 5.7.8 - only debug builds affected

bin/mysql_install_db --insecure --basedir=/export/umesh/server/binaries/mysql-5.7.8 --datadir=/export/umesh/server/binaries/mysql-5.7.8/20753378 -v
bin/mysqld-debug --basedir=/export/umesh/server/binaries/mysql-5.7.8 --datadir=/export/umesh/server/binaries/mysql-5.7.8/20753378 --sql_mode=ONLY_FULL_GROUP_BY --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-5.7.8/20753378/log.err 2>&1 &

- build

commit: e0e83d66a46ace298c5aeb610eeb09d3265877b9
date: 2015-04-06 14:33:46 +0530
build-date: 2015-04-06 18:01:30 +0200
short: e0e83d6
branch: mysql-5.7

MySQL source 5.7.8

[umshastr@hod03]/export/umesh/server/binaries/mysql-5.7.8: bin/mysql -uroot -p -S/tmp/mysql_ushastry.sock
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.8-rc-enterprise-commercial-advanced-debug MySQL Enterprise Server - Advanced Edition Debug (Commercial)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> DROP DATABASE test;CREATE DATABASE test;USE test;
ERROR 1008 (HY000): Can't drop database 'test'; database doesn't exist
Query OK, 1 row affected (0.00 sec)

Database changed
mysql> SET @@SESSION.GTID_NEXT='ANONYMOUS';
Query OK, 0 rows affected (0.00 sec)

mysql> set session gtid_next=default;
ERROR 1790 (HY000): @@SESSION.GTID_NEXT cannot be changed by a client that owns a GTID. The client owns ANONYMOUS. Ownership is released on COMMIT or ROLLBACK.
mysql> SELECT *;
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql> \q
Bye
[1]+  Aborted                 (core dumped) bin/mysqld-debug --basedir=/export/umesh/server/binaries/mysql-5.7.8 --datadir=/export/umesh/server/binaries/mysql-5.7.8/20753378 --sql_mode=ONLY_FULL_GROUP_BY --core-file --socket=/tmp/mysql_ushastry.sock --port=15000 --log-error=/export/umesh/server/binaries/mysql-5.7.8/20753378/log.err 2>&1

[umshastr@hod03]/export/umesh/server/binaries/mysql-5.7.8: gdb bin/mysqld-debug 20753378/core.14509
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-51.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /export/umesh/server/binaries/mysql-5.7.8/bin/mysqld-debug...done.
Illegal process-id: 20753378/core.14509.
[New LWP 14539]
[New LWP 14532]
[New LWP 14515]
[New LWP 14516]
[New LWP 14528]
[New LWP 14534]
[New LWP 14510]
[New LWP 14533]
[New LWP 14526]
[New LWP 14535]
[New LWP 14523]
[New LWP 14518]
[New LWP 14525]
[New LWP 14517]
[New LWP 14536]
[New LWP 14524]
[New LWP 14520]
[New LWP 14531]
[New LWP 14530]
[New LWP 14509]
[New LWP 14519]
[New LWP 14513]
[New LWP 14529]
[New LWP 14514]
[New LWP 14521]
[New LWP 14527]
[New LWP 14511]
[New LWP 14512]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `bin/mysqld-debug --basedir=/export/umesh/server/binaries/mysql-5.7.8 --datadir='.
Program terminated with signal 6, Aborted.
#0  0x00007f3a1b24a771 in pthread_kill () from /lib64/libpthread.so.0
Missing separate debuginfos, use: debuginfo-install glibc-2.17-55.0.4.el7_0.1.x86_64 libaio-0.3.109-12.el7.x86_64 libgcc-4.8.2-16.2.el7_0.x86_64 libstdc++-4.8.2-16.2.el7_0.x86_64 nss-softokn-freebl-3.16.2-1.el7_0.x86_64
(gdb) bt
#0  0x00007f3a1b24a771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x00000000018caf38 in my_write_core (sig=6) at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/mysys/stacktrace.c:247
#2  0x0000000000f4e15a in handle_fatal_signal (sig=6) at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007f3a19e505c9 in raise () from /lib64/libc.so.6
#5  0x00007f3a19e51cd8 in abort () from /lib64/libc.so.6
#6  0x00007f3a19e49536 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007f3a19e495e2 in __assert_fail () from /lib64/libc.so.6
#8  0x00000000017f7a87 in gtid_pre_statement_checks (thd=0x7f3994011e50) at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/rpl_gtid_execution.cc:453
#9  0x00000000015c3aa7 in mysql_execute_command (thd=0x7f3994011e50) at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/sql_parse.cc:2318
#10 0x00000000015cb5dd in mysql_parse (thd=0x7f3994011e50, parser_state=0x7f3a10a73e50) at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/sql_parse.cc:5206
#11 0x00000000015c1162 in dispatch_command (thd=0x7f3994011e50, com_data=0x7f3a10a74e00, command=COM_QUERY)
    at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/sql_parse.cc:1280
#12 0x00000000015bfdb5 in do_command (thd=0x7f3994011e50) at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/sql_parse.cc:851
#13 0x00000000016e48b2 in handle_connection (arg=0x40cec90) at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/sql/conn_handler/connection_handler_per_thread.cc:299
#14 0x00000000019814a5 in pfs_spawn_thread (arg=0x3fe7e50) at /export/home3/pb2/build/sb_0-14913028-1428337024.12/mysqlcom-pro-5.7.8-rc/storage/perfschema/pfs.cc:2147
#15 0x00007f3a1b245df3 in start_thread () from /lib64/libpthread.so.0
#16 0x00007f3a19f1147d in clone () from /lib64/libc.so.6
(gdb)
[8 Apr 2015 8:44] Bill Qu
Posted by developer:
 
Hi Umesh,
Please don't re-verify it. I can reproduce the problem with the following test:

DROP DATABASE test;CREATE DATABASE test;USE test;
SET @@SESSION.GTID_NEXT='ANONYMOUS';
--error ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID
set session gtid_next=default;
SELECT *;
[12 May 2015 12:00] David Moss
Thanks for your feedback. This has been fixed in an upcoming version and the following was noted in the 5.7.8 changelog:

Setting SESSION.GTID_NEXT=default immediately after setting SESSION.GTID_NEXT='ANONYMOUS' causes an ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID error, but this also changes the gtid_next type from ANONYMOUS to AUTOMATIC, meaning that the next transaction could potentially cause an GTID_NEXT->TYPE != AUTOMATIC_GROUP || THD->OWNED_GTID.IS_EMPTY() assertion. The fix ensures that setting SESSION.GTID_NEXT=default does not change the gtid_next type if it causes an error.
[18 Jun 2016 21:25] Omer Barnir
Posted by developer:
 
Reported version value updated to reflect release name change from 5.8 to 8.0