Bug #69618 | Set @@global.gtid_purged='UUID:1-1000000000000000000' Asserts | ||
---|---|---|---|
Submitted: | 28 Jun 2013 22:12 | Modified: | 21 Oct 2013 11:42 |
Reporter: | Santosh Praneeth Banda | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Row Based Replication ( RBR ) | Severity: | S2 (Serious) |
Version: | 5.6.12 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | GTID REPLICATION |
[28 Jun 2013 22:12]
Santosh Praneeth Banda
[29 Jun 2013 3:57]
MySQL Verification Team
Verfiied as described. Testcase: set @@global.gtid_purged = 'bcaaf9e8-e03e-11e2-b3ca-0002c9526dc0:1-1000000000000000000';
[29 Jun 2013 3:59]
MySQL Verification Team
Version: '5.7.2-m12-debug-log' MySQL Community Server (GPL) Assertion failed: _snprintf(buf, 22, "%lld", gno) == len, file rpl_gtid_set.cc, line 868 mysqld-debug.exe!my_sigabrt_handler()[my_thr_init.c:451] mysqld-debug.exe!raise()[winsig.c:593] mysqld-debug.exe!abort()[abort.c:81] mysqld-debug.exe!_wassert()[assert.c:153] mysqld-debug.exe!get_string_length()[rpl_gtid_set.cc:868] mysqld-debug.exe!Gtid_set::get_string_length()[rpl_gtid_set.cc:900] mysqld-debug.exe!Gtid_set::to_string()[rpl_gtid.h:1067] mysqld-debug.exe!Sys_var_gtid_purged::global_update()[sys_vars.h:2185] mysqld-debug.exe!sys_var::update()[set_var.cc:194] mysqld-debug.exe!set_var::update()[set_var.cc:670] mysqld-debug.exe!sql_set_variables()[set_var.cc:573] mysqld-debug.exe!mysql_execute_command()[sql_parse.cc:3515] mysqld-debug.exe!mysql_parse()[sql_parse.cc:5228] mysqld-debug.exe!dispatch_command()[sql_parse.cc:1330] mysqld-debug.exe!do_command()[sql_parse.cc:1026] mysqld-debug.exe!do_handle_one_connection()[sql_connect.cc:983] mysqld-debug.exe!handle_one_connection()[sql_connect.cc:900] mysqld-debug.exe!pfs_spawn_thread()[pfs.cc:1929] mysqld-debug.exe!pthread_start()[my_winthread.c:60] mysqld-debug.exe!_callthreadstartex()[threadex.c:314] mysqld-debug.exe!_threadstartex()[threadex.c:297]
[21 Oct 2013 11:42]
Jon Stephens
Fixed in 5.6+. Documented as follows in the 5.6.15 and 5.7.3 changelogs: An internal function used for storing GTID values could sometimes try to handle them as strings of the wrong length. Closed.
[4 Dec 2013 11:54]
Laurynas Biveinis
5.6$ bzr log -r 5510 ------------------------------------------------------------ revno: 5510 committer: Joao Gramacho <joao.gramacho@oracle.com> branch nick: mysql-5.6 timestamp: Thu 2013-10-10 18:15:38 +0100 message: Bug#17032712 SET @@GLOBAL.GTID_PURGED='UUID:1-1000000000000000000' ASSERTS Problem: ======= The get_string_length() function is failing to assert the correct string length of numbers with 19 digits. Analysis: ======== The get_string_length() function returns the length a string must have in order to store a given number. It is used to calculate the string length of a GTID set. Because this function is static at rpl_gtid_set.cc, it is not trivial to make unit tests to verify its functionality. So, there is an assert executed only in debug enabled versions that checks if the value to be returned is equal to the length of printing the number in a string with snprintf(). Because of the precision of the rpl_gno data type (int64), an auxiliary variable may overflow when the number to be evaluated has 19 digits. The currently implemented code doesn't take into account this overflow possibility, making that every 19 digit number be evaluated as having 20 digits in length. This divergence cause the assert to fail. Fix: === Changed the function code replacing the length calculation algorithm with one that is simple, easy to read and overflow free.